@techie_doubts/vue-editor 3.2.3
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 +320 -0
- package/dist/esm/index.js +28421 -0
- package/dist/td-vue-editor.js +2 -0
- package/dist/td-vue-editor.js.LICENSE.txt +15 -0
- package/dist/toastui-vue-editor.js +2 -0
- package/dist/toastui-vue-editor.js.LICENSE.txt +15 -0
- package/index.d.ts +28 -0
- package/package.json +42 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see td-vue-editor.js.LICENSE.txt */
|
|
2
|
+
!function(){"use strict";var e={565(e,t,n){n.r(t),n.d(t,{AllSelection:function(){return f},EditorState:function(){return x},NodeSelection:function(){return h},Plugin:function(){return T},PluginKey:function(){return E},Selection:function(){return s},SelectionRange:function(){return l},TextSelection:function(){return c},Transaction:function(){return v}});var r=n(458),i=n(256),o=Object.create(null),s=function(e,t,n){this.ranges=n||[new l(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},a={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};a.anchor.get=function(){return this.$anchor.pos},a.head.get=function(){return this.$head.pos},a.from.get=function(){return this.$from.pos},a.to.get=function(){return this.$to.pos},a.$from.get=function(){return this.ranges[0].$from},a.$to.get=function(){return this.ranges[0].$to},a.empty.get=function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0},s.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},s.prototype.replace=function(e,t){void 0===t&&(t=r.Ji.empty);for(var n=t.content.lastChild,i=null,o=0;o<t.openEnd;o++)i=n,n=n.lastChild;for(var s=e.steps.length,a=this.ranges,l=0;l<a.length;l++){var c=a[l],u=c.$from,h=c.$to,p=e.mapping.slice(s);e.replaceRange(p.map(u.pos),p.map(h.pos),l?r.Ji.empty:t),0==l&&g(e,s,(n?n.isInline:i&&i.isTextblock)?-1:1)}},s.prototype.replaceWith=function(e,t){for(var n=e.steps.length,r=this.ranges,i=0;i<r.length;i++){var o=r[i],s=o.$from,a=o.$to,l=e.mapping.slice(n),c=l.map(s.pos),u=l.map(a.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,t),g(e,n,t.isInline?-1:1))}},s.findFrom=function(e,t,n){var r=e.parent.inlineContent?new c(e):m(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(var i=e.depth-1;i>=0;i--){var o=t<0?m(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):m(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(o)return o}},s.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new f(e.node(0))},s.atStart=function(e){return m(e,e,0,0,1)||new f(e)},s.atEnd=function(e){return m(e,e,e.content.size,e.childCount,-1)||new f(e)},s.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=o[t.type];if(!n)throw new RangeError("No selection type "+t.type+" defined");return n.fromJSON(e,t)},s.jsonID=function(e,t){if(e in o)throw new RangeError("Duplicate use of selection JSON ID "+e);return o[e]=t,t.prototype.jsonID=e,t},s.prototype.getBookmark=function(){return c.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(s.prototype,a),s.prototype.visible=!0;var l=function(e,t){this.$from=e,this.$to=t},c=function(e){function t(t,n){void 0===n&&(n=t),e.call(this,t,n)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(n,r){var i=n.resolve(r.map(this.head));if(!i.parent.inlineContent)return e.near(i);var o=n.resolve(r.map(this.anchor));return new t(o.parent.inlineContent?o:i,i)},t.prototype.replace=function(t,n){if(void 0===n&&(n=r.Ji.empty),e.prototype.replace.call(this,t,n),n==r.Ji.empty){var i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new u(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,t,n){void 0===n&&(n=t);var r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))},t.between=function(n,r,i){var o=n.pos-r.pos;if(i&&!o||(i=o>=0?1:-1),!r.parent.inlineContent){var s=e.findFrom(r,i,!0)||e.findFrom(r,-i,!0);if(!s)return e.near(r,i);r=s.$head}return n.parent.inlineContent||(0==o||(n=(e.findFrom(n,-i,!0)||e.findFrom(n,i,!0)).$anchor).pos<r.pos!=o<0)&&(n=r),new t(n,r)},Object.defineProperties(t.prototype,n),t}(s);s.jsonID("text",c);var u=function(e,t){this.anchor=e,this.head=t};u.prototype.map=function(e){return new u(e.map(this.anchor),e.map(this.head))},u.prototype.resolve=function(e){return c.between(e.resolve(this.anchor),e.resolve(this.head))};var h=function(e){function t(t){var n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);e.call(this,t,r),this.node=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,r){var i=r.mapResult(this.anchor),o=i.deleted,s=i.pos,a=n.resolve(s);return o?e.near(a):new t(a)},t.prototype.content=function(){return new r.Ji(r.FK.from(this.node),0,0)},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor},t.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},t.prototype.getBookmark=function(){return new p(this.anchor)},t.fromJSON=function(e,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(n.anchor))},t.create=function(e,t){return new this(e.resolve(t))},t.isSelectable=function(e){return!e.isText&&!1!==e.type.spec.selectable},t}(s);h.prototype.visible=!1,s.jsonID("node",h);var p=function(e){this.anchor=e};p.prototype.map=function(e){var t=e.mapResult(this.anchor),n=t.deleted,r=t.pos;return n?new u(r,r):new p(r)},p.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&h.isSelectable(n)?new h(t):s.near(t)};var f=function(e){function t(t){e.call(this,t.resolve(0),t.resolve(t.content.size))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.replace=function(t,n){if(void 0===n&&(n=r.Ji.empty),n==r.Ji.empty){t.delete(0,t.doc.content.size);var i=e.atStart(t.doc);i.eq(t.selection)||t.setSelection(i)}else e.prototype.replace.call(this,t,n)},t.prototype.toJSON=function(){return{type:"all"}},t.fromJSON=function(e){return new t(e)},t.prototype.map=function(e){return new t(e)},t.prototype.eq=function(e){return e instanceof t},t.prototype.getBookmark=function(){return d},t}(s);s.jsonID("all",f);var d={map:function(){return this},resolve:function(e){return new f(e)}};function m(e,t,n,r,i,o){if(t.inlineContent)return c.create(e,n);for(var s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){var a=t.child(s);if(a.isAtom){if(!o&&h.isSelectable(a))return h.create(e,n-(i<0?a.nodeSize:0))}else{var l=m(e,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}}function g(e,t,n){var r=e.steps.length-1;if(!(r<t)){var o,a=e.steps[r];(a instanceof i.ReplaceStep||a instanceof i.ReplaceAroundStep)&&(e.mapping.maps[r].forEach(function(e,t,n,r){null==o&&(o=r)}),e.setSelection(s.near(e.doc.resolve(o),n)))}}var v=function(e){function t(t){e.call(this,t.doc),this.time=Date.now(),this.curSelection=t.selection,this.curSelectionFor=0,this.storedMarks=t.storedMarks,this.updated=0,this.meta=Object.create(null)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;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},t.prototype.setSelection=function(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this},n.selectionSet.get=function(){return(1&this.updated)>0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return r.CU.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,n){e.prototype.addStep.call(this,t,n),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var n=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.CU.none))),n.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,n){void 0===n&&(n=t);var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,n);var i=this.storedMarks;if(!i){var o=this.doc.resolve(t);i=n==t?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},n.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,n),t}(i.Transform);function y(e,t){return t&&e?e.bind(t):e}var b=function(e,t,n){this.name=e,this.init=y(t.init,n),this.apply=y(t.apply,n)},k=[new b("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new b("selection",{init:function(e,t){return e.selection||s.atStart(t.doc)},apply:function(e){return e.selection}}),new b("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new b("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],w=function(e,t){var n=this;this.schema=e,this.fields=k.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach(function(e){if(n.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");n.plugins.push(e),n.pluginsByKey[e.key]=e,e.spec.state&&n.fields.push(new b(e.key,e.spec.state,e))})},x=function(e){this.config=e},C={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};C.schema.get=function(){return this.config.schema},C.plugins.get=function(){return this.config.plugins},x.prototype.apply=function(e){return this.applyTransaction(e).state},x.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=t){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0},x.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),r=null;;){for(var i=!1,o=0;o<this.config.plugins.length;o++){var s=this.config.plugins[o];if(s.spec.appendTransaction){var a=r?r[o].n:0,l=r?r[o].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(var u=0;u<this.config.plugins.length;u++)r.push(u<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}},x.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new x(this.config),n=this.config.fields,r=0;r<n.length;r++){var i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}for(var o=0;o<S.length;o++)S[o](this,e,t);return t},C.tr.get=function(){return new v(this)},x.create=function(e){for(var t=new w(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new x(t),r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n},x.prototype.reconfigure=function(e){for(var t=new w(this.schema,e.plugins),n=t.fields,r=new x(t),i=0;i<n.length;i++){var o=n[i].name;r[o]=this.hasOwnProperty(o)?this[o]:n[i].init(e,r)}return r},x.prototype.toJSON=function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(function(e){return e.toJSON()})),e&&"object"==typeof e)for(var n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t},x.fromJSON=function(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var i=new w(e.schema,e.plugins),o=new x(i);return i.fields.forEach(function(i){if("doc"==i.name)o.doc=r.bP.fromJSON(e.schema,t.doc);else if("selection"==i.name)o.selection=s.fromJSON(o.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(var a in n){var l=n[a],c=l.spec.state;if(l.key==i.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,a))return void(o[i.name]=c.fromJSON.call(l,e,t[a],o))}o[i.name]=i.init(e,o)}}),o},x.addApplyListener=function(e){S.push(e)},x.removeApplyListener=function(e){var t=S.indexOf(e);t>-1&&S.splice(t,1)},Object.defineProperties(x.prototype,C);var S=[];function N(e,t,n){for(var r in e){var i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=N(i,t,{})),n[r]=i}return n}var T=function(e){this.props={},e.props&&N(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:M("plugin")};T.prototype.getState=function(e){return e[this.key]};var O=Object.create(null);function M(e){return e in O?e+"$"+ ++O[e]:(O[e]=0,e+"$")}var E=function(e){void 0===e&&(e="key"),this.key=M(e)};E.prototype.get=function(e){return e.config.pluginsByKey[this.key]},E.prototype.getState=function(e){return e[this.key]}},256(e,t,n){n.r(t),n.d(t,{AddMarkStep:function(){return A},MapResult:function(){return a},Mapping:function(){return c},RemoveMarkStep:function(){return L},ReplaceAroundStep:function(){return y},ReplaceStep:function(){return v},Step:function(){return m},StepMap:function(){return l},StepResult:function(){return g},Transform:function(){return h},TransformError:function(){return u},canJoin:function(){return N},canSplit:function(){return S},dropPoint:function(){return E},findWrapping:function(){return x},insertPoint:function(){return M},joinPoint:function(){return O},liftTarget:function(){return w},replaceStep:function(){return R}});var r=n(458),i=Math.pow(2,16);function o(e,t){return e+t*i}function s(e){return 65535&e}var a=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=null),this.pos=e,this.deleted=t,this.recover=n},l=function e(t,n){if(void 0===n&&(n=!1),!t.length&&e.empty)return e.empty;this.ranges=t,this.inverted=n};l.prototype.recover=function(e){var t=0,n=s(e);if(!this.inverted)for(var r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/i}(e)},l.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},l.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},l.prototype._map=function(e,t,n){for(var r=0,i=this.inverted?2:1,s=this.inverted?1:2,l=0;l<this.ranges.length;l+=3){var c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;var u=this.ranges[l+i],h=this.ranges[l+s],p=c+u;if(e<=p){var f=c+r+((u?e==c?-1:e==p?1:t:t)<0?0:h);if(n)return f;var d=e==(t<0?c:p)?null:o(l/3,e-c);return new a(f,t<0?e!=c:e!=p,d)}r+=h-u}return n?e+r:new a(e+r)},l.prototype.touches=function(e,t){for(var n=0,r=s(t),i=this.inverted?2:1,o=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var l=this.ranges[a]-(this.inverted?n:0);if(l>e)break;var c=this.ranges[a+i];if(e<=l+c&&a==3*r)return!0;n+=this.ranges[a+o]-c}return!1},l.prototype.forEach=function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,i=0;r<this.ranges.length;r+=3){var o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),i+=c-l}},l.prototype.invert=function(){return new l(this.ranges,!this.inverted)},l.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},l.offset=function(e){return 0==e?l.empty:new l(e<0?[0,-e,0]:[0,0,e])},l.empty=new l([]);var c=function(e,t,n,r){this.maps=e||[],this.from=n||0,this.to=null==r?this.maps.length:r,this.mirror=t};function u(e){var t=Error.call(this,e);return t.__proto__=u.prototype,t}c.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new c(this.maps,this.mirror,e,t)},c.prototype.copy=function(){return new c(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},c.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},c.prototype.appendMapping=function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:null)}},c.prototype.getMirror=function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]},c.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},c.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:null)}},c.prototype.invert=function(){var e=new c;return e.appendMappingInverted(this),e},c.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e},c.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},c.prototype._map=function(e,t,n){for(var r=!1,i=this.from;i<this.to;i++){var o=this.maps[i].mapResult(e,t);if(null!=o.recover){var s=this.getMirror(i);if(null!=s&&s>i&&s<this.to){i=s,e=this.maps[s].recover(o.recover);continue}}o.deleted&&(r=!0),e=o.pos}return n?e:new a(e,r)},u.prototype=Object.create(Error.prototype),u.prototype.constructor=u,u.prototype.name="TransformError";var h=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new c},p={before:{configurable:!0},docChanged:{configurable:!0}};function f(){throw new Error("Override me")}p.before.get=function(){return this.docs.length?this.docs[0]:this.doc},h.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new u(t.failed);return this},h.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},p.docChanged.get=function(){return this.steps.length>0},h.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(h.prototype,p);var d=Object.create(null),m=function(){};m.prototype.apply=function(e){return f()},m.prototype.getMap=function(){return l.empty},m.prototype.invert=function(e){return f()},m.prototype.map=function(e){return f()},m.prototype.merge=function(e){return null},m.prototype.toJSON=function(){return f()},m.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=d[t.stepType];if(!n)throw new RangeError("No step type "+t.stepType+" defined");return n.fromJSON(e,t)},m.jsonID=function(e,t){if(e in d)throw new RangeError("Duplicate use of step JSON ID "+e);return d[e]=t,t.prototype.jsonID=e,t};var g=function(e,t){this.doc=e,this.failed=t};g.ok=function(e){return new g(e,null)},g.fail=function(e){return new g(null,e)},g.fromReplace=function(e,t,n,i){try{return g.ok(e.replace(t,n,i))}catch(e){if(e instanceof r.vI)return g.fail(e.message);throw e}};var v=function(e){function t(t,n,r,i){e.call(this),this.from=t,this.to=n,this.slice=r,this.structure=!!i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&b(e,this.from,this.to)?g.fail("Structure replace would overwrite content"):g.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new l([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new t(n.pos,Math.max(n.pos,r.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var n=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var i=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),i,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,r.Ji.fromJSON(e,n.slice),!!n.structure)},t}(m);m.jsonID("replace",v);var y=function(e){function t(t,n,r,i,o,s,a){e.call(this),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=!!a}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(b(e,this.from,this.gapFrom)||b(e,this.gapTo,this.to)))return g.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return g.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?g.fromReplace(e,this.from,this.to,n):g.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new l([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return n.deleted&&r.deleted||i<n.pos||o>r.pos?null:new t(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,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 t(n.from,n.to,n.gapFrom,n.gapTo,r.Ji.fromJSON(e,n.slice),n.insert,!!n.structure)},t}(m);function b(e,t,n){for(var r=e.resolve(t),i=n-t,o=r.depth;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0)for(var s=r.node(o).maybeChild(r.indexAfter(o));i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}return!1}function k(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function w(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!k(r,i,o))break}}function x(e,t,n,r){void 0===r&&(r=e);var i=function(e,t){var n=e.parent,r=e.startIndex,i=e.endIndex,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;var s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){var n=e.parent,r=e.startIndex,i=e.endIndex,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;for(var a=(s.length?s[s.length-1]:t).contentMatch,l=r;a&&l<i;l++)a=a.matchType(n.child(l).type);return a&&a.validEnd?s:null}(r,t);return o?i.map(C).concat({type:t,attrs:n}).concat(o.map(C)):null}function C(e){return{type:e,attrs:null}}function S(e,t,n,r){void 0===n&&(n=1);var i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(var a=i.depth-1,l=n-2;a>o;a--,l--){var c=i.node(a),u=i.index(a);if(c.type.spec.isolating)return!1;var h=c.content.cutByIndex(u,c.childCount),p=r&&r[l]||c;if(p!=c&&(h=h.replaceChild(0,p.type.create(p.attrs))),!c.canReplace(u+1,c.childCount)||!p.type.validContent(h))return!1}var f=i.indexAfter(o),d=r&&r[0];return i.node(o).canReplaceWith(f,f,d?d.type:i.node(o+1).type)}function N(e,t){var n=e.resolve(t),r=n.index();return T(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function T(e,t){return e&&t&&!e.isLeaf&&e.canAppend(t)}function O(e,t,n){void 0===n&&(n=-1);for(var r=e.resolve(t),i=r.depth;;i--){var o=void 0,s=void 0,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&T(o,s)&&r.node(i).canReplace(a,a+1))return t;if(0==i)break;t=n<0?r.before(i):r.after(i)}}function M(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var i=r.depth-1;i>=0;i--){var o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>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}}function E(e,t,n){var r=e.resolve(t);if(!n.content.size)return t;for(var i=n.content,o=0;o<n.openStart;o++)i=i.firstChild.content;for(var s=1;s<=(0==n.openStart&&n.size?2:1);s++)for(var a=r.depth;a>=0;a--){var l=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,c=r.index(a)+(l>0?1:0),u=r.node(a),h=!1;if(1==s)h=u.canReplace(c,c,i);else{var p=u.contentMatchAt(c).findWrapping(i.firstChild.type);h=p&&u.canReplaceWith(c,c,p[0])}if(h)return 0==l?r.pos:l<0?r.before(a+1):r.after(a+1)}return null}function D(e,t,n){for(var i=[],o=0;o<e.childCount;o++){var s=e.child(o);s.content.size&&(s=s.copy(D(s.content,t,s))),s.isInline&&(s=t(s,n,o)),i.push(s)}return r.FK.fromArray(i)}m.jsonID("replaceAround",y),h.prototype.lift=function(e,t){for(var n=e.$from,i=e.$to,o=e.depth,s=n.before(o+1),a=i.after(o+1),l=s,c=a,u=r.FK.empty,h=0,p=o,f=!1;p>t;p--)f||n.index(p)>0?(f=!0,u=r.FK.from(n.node(p).copy(u)),h++):l--;for(var d=r.FK.empty,m=0,g=o,v=!1;g>t;g--)v||i.after(g+1)<i.end(g)?(v=!0,d=r.FK.from(i.node(g).copy(d)),m++):c++;return this.step(new y(l,c,s,a,new r.Ji(u.append(d),h,m),u.size-h,!0))},h.prototype.wrap=function(e,t){for(var n=r.FK.empty,i=t.length-1;i>=0;i--){if(n.size){var o=t[i].type.contentMatch.matchFragment(n);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=r.FK.from(t[i].type.create(t[i].attrs,n))}var s=e.start,a=e.end;return this.step(new y(s,a,s,a,new r.Ji(n,0,0),t.length,!0))},h.prototype.setBlockType=function(e,t,n,i){var o=this;if(void 0===t&&(t=e),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var s=this.steps.length;return this.doc.nodesBetween(e,t,function(e,t){if(e.isTextblock&&!e.hasMarkup(n,i)&&function(e,t,n){var r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(o.doc,o.mapping.slice(s).map(t),n)){o.clearIncompatible(o.mapping.slice(s).map(t,1),n);var a=o.mapping.slice(s),l=a.map(t,1),c=a.map(t+e.nodeSize,1);return o.step(new y(l,c,l+1,c-1,new r.Ji(r.FK.from(n.create(i,null,e.marks)),0,0),1,!0)),!1}}),this},h.prototype.setNodeMarkup=function(e,t,n,i){var o=this.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);var s=t.create(n,null,i||o.marks);if(o.isLeaf)return this.replaceWith(e,e+o.nodeSize,s);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new y(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new r.Ji(r.FK.from(s),0,0),1,!0))},h.prototype.split=function(e,t,n){void 0===t&&(t=1);for(var i=this.doc.resolve(e),o=r.FK.empty,s=r.FK.empty,a=i.depth,l=i.depth-t,c=t-1;a>l;a--,c--){o=r.FK.from(i.node(a).copy(o));var u=n&&n[c];s=r.FK.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}return this.step(new v(e,e,new r.Ji(o.append(s),t,t),!0))},h.prototype.join=function(e,t){void 0===t&&(t=1);var n=new v(e-t,e+t,r.Ji.empty,!0);return this.step(n)};var A=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),i=e.resolve(this.from),o=i.node(i.sharedDepth(this.to)),s=new r.Ji(D(n.content,function(e,n){return e.isAtom&&n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e},o),n.openStart,n.openEnd);return g.fromReplace(e,this.from,this.to,s)},t.prototype.invert=function(){return new L(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(m);m.jsonID("addMark",A);var L=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),i=new r.Ji(D(n.content,function(e){return e.mark(t.mark.removeFromSet(e.marks))}),n.openStart,n.openEnd);return g.fromReplace(e,this.from,this.to,i)},t.prototype.invert=function(){return new A(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(m);function R(e,t,n,i){if(void 0===n&&(n=t),void 0===i&&(i=r.Ji.empty),t==n&&!i.size)return null;var o=e.resolve(t),s=e.resolve(n);return I(o,s,i)?new v(t,n,i):new F(o,s,i).fit()}function I(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}m.jsonID("removeMark",L),h.prototype.addMark=function(e,t,n){var r=this,i=[],o=[],s=null,a=null;return this.doc.nodesBetween(e,t,function(r,l,c){if(r.isInline){var u=r.marks;if(!n.isInSet(u)&&c.type.allowsMarkType(n.type)){for(var h=Math.max(l,e),p=Math.min(l+r.nodeSize,t),f=n.addToSet(u),d=0;d<u.length;d++)u[d].isInSet(f)||(s&&s.to==h&&s.mark.eq(u[d])?s.to=p:i.push(s=new L(h,p,u[d])));a&&a.to==h?a.to=p:o.push(a=new A(h,p,n))}}}),i.forEach(function(e){return r.step(e)}),o.forEach(function(e){return r.step(e)}),this},h.prototype.removeMark=function(e,t,n){var i=this;void 0===n&&(n=null);var o=[],s=0;return this.doc.nodesBetween(e,t,function(i,a){if(i.isInline){s++;var l=null;if(n instanceof r.sX)for(var c,u=i.marks;c=n.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u);else n?n.isInSet(i.marks)&&(l=[n]):l=i.marks;if(l&&l.length)for(var h=Math.min(a+i.nodeSize,t),p=0;p<l.length;p++){for(var f=l[p],d=void 0,m=0;m<o.length;m++){var g=o[m];g.step==s-1&&f.eq(o[m].style)&&(d=g)}d?(d.to=h,d.step=s):o.push({style:f,from:Math.max(a,e),to:h,step:s})}}}),o.forEach(function(e){return i.step(new L(e.from,e.to,e.style))}),this},h.prototype.clearIncompatible=function(e,t,n){void 0===n&&(n=t.contentMatch);for(var i=this.doc.nodeAt(e),o=[],s=e+1,a=0;a<i.childCount;a++){var l=i.child(a),c=s+l.nodeSize,u=n.matchType(l.type,l.attrs);if(u){n=u;for(var h=0;h<l.marks.length;h++)t.allowsMarkType(l.marks[h].type)||this.step(new L(s,c,l.marks[h]))}else o.push(new v(s,c,r.Ji.empty));s=c}if(!n.validEnd){var p=n.fillBefore(r.FK.empty,!0);this.replace(s,s,new r.Ji(p,0,0))}for(var f=o.length-1;f>=0;f--)this.step(o[f]);return this},h.prototype.replace=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=r.Ji.empty);var i=R(this.doc,e,t,n);return i&&this.step(i),this},h.prototype.replaceWith=function(e,t,n){return this.replace(e,t,new r.Ji(r.FK.from(n),0,0))},h.prototype.delete=function(e,t){return this.replace(e,t,r.Ji.empty)},h.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var F=function(e,t,n){this.$to=t,this.$from=e,this.unplaced=n,this.frontier=[];for(var i=0;i<=e.depth;i++){var o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}this.placed=r.FK.empty;for(var s=e.depth;s>0;s--)this.placed=r.FK.from(e.node(s).copy(this.placed))},P={depth:{configurable:!0}};function B(e,t,n){return 0==t?e.cutByIndex(n):e.replaceChild(0,e.firstChild.copy(B(e.firstChild.content,t-1,n)))}function z(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(z(e.lastChild.content,t-1,n)))}function q(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function _(e,t,n){if(t<=0)return e;var i=e.content;return t>1&&(i=i.replaceChild(0,_(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(r.FK.empty,!0)))),e.copy(i)}function j(e,t,n,r,i){var o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;var a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(var r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function H(e){return e.spec.defining||e.spec.definingForContent}function V(e,t,n,i,o){if(t<n){var s=e.firstChild;e=e.replaceChild(0,s.copy(V(s.content,t+1,n,i,s)))}if(t>i){var a=o.contentMatchAt(0),l=a.fillBefore(e).append(e);e=l.append(a.matchFragment(l).fillBefore(r.FK.empty,!0))}return e}function $(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}P.depth.get=function(){return this.frontier.length-1},F.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(t<0?this.$to:i.doc.resolve(t));if(!o)return null;for(var s=this.placed,a=i.depth,l=o.depth;a&&l&&1==s.childCount;)s=s.firstChild.content,a--,l--;var c=new r.Ji(s,a,l);return t>-1?new y(i.pos,t,this.$to.pos,this.$to.end(),c,n):c.size||i.pos!=this.$to.pos?new v(i.pos,o.pos,c):void 0},F.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=void 0,i=(t?(n=q(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,o=this.depth;o>=0;o--){var s=this.frontier[o],a=s.type,l=s.match,c=void 0,u=void 0;if(1==e&&(i?l.matchType(i.type)||(u=l.fillBefore(r.FK.from(i),!1)):a.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:o,parent:n,inject:u};if(2==e&&i&&(c=l.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:o,parent:n,wrap:c};if(n&&l.matchType(n.type))break}},F.prototype.openMore=function(){var e=this.unplaced,t=e.content,n=e.openStart,i=e.openEnd,o=q(t,n);return!(!o.childCount||o.firstChild.isLeaf||(this.unplaced=new r.Ji(t,n+1,Math.max(i,o.size+n>=t.size-i?n+1:0)),0))},F.prototype.dropNode=function(){var e=this.unplaced,t=e.content,n=e.openStart,i=e.openEnd,o=q(t,n);if(o.childCount<=1&&n>0){var s=t.size-n<=n+o.size;this.unplaced=new r.Ji(B(t,n-1,1),n-1,s?n-1:i)}else this.unplaced=new r.Ji(B(t,n,1),n,i)},F.prototype.placeNodes=function(e){for(var t=e.sliceDepth,n=e.frontierDepth,i=e.parent,o=e.inject,s=e.wrap;this.depth>n;)this.closeFrontierNode();if(s)for(var a=0;a<s.length;a++)this.openFrontierNode(s[a]);var l=this.unplaced,c=i?i.content:l.content,u=l.openStart-t,h=0,p=[],f=this.frontier[n],d=f.match,m=f.type;if(o){for(var g=0;g<o.childCount;g++)p.push(o.child(g));d=d.matchFragment(o)}for(var v=c.size+t-(l.content.size-l.openEnd);h<c.childCount;){var y=c.child(h),b=d.matchType(y.type);if(!b)break;(++h>1||0==u||y.content.size)&&(d=b,p.push(_(y.mark(m.allowedMarks(y.marks)),1==h?u:0,h==c.childCount?v:-1)))}var k=h==c.childCount;k||(v=-1),this.placed=z(this.placed,n,r.FK.from(p)),this.frontier[n].match=d,k&&v<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var w=0,x=c;w<v;w++){var C=x.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),x=C.content}this.unplaced=k?0==t?r.Ji.empty:new r.Ji(B(l.content,t-1,1),t-1,v<0?l.openEnd:t-1):new r.Ji(B(l.content,t,h),l.openStart,l.openEnd)},F.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock)return-1;var e,t=this.frontier[this.depth];if(!t.type.isTextblock||!j(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.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},F.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],r=n.match,i=n.type,o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=j(e,t,i,r,o);if(s){for(var a=t-1;a>=0;a--){var l=this.frontier[a],c=l.match,u=j(e,a,l.type,c,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:o?e.doc.resolve(e.after(t+1)):e}}}},F.prototype.close=function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=z(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var r=e.node(n),i=r.type.contentMatch.fillBefore(r.content,!0,e.index(n));this.openFrontierNode(r.type,r.attrs,i)}return e},F.prototype.openFrontierNode=function(e,t,n){var i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=z(this.placed,this.depth,r.FK.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})},F.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(r.FK.empty,!0);e.childCount&&(this.placed=z(this.placed,this.frontier.length,e))},Object.defineProperties(F.prototype,P),h.prototype.replaceRange=function(e,t,n){if(!n.size)return this.deleteRange(e,t);var i=this.doc.resolve(e),o=this.doc.resolve(t);if(I(i,o,n))return this.step(new v(e,t,n));var s=$(i,this.doc.resolve(t));0==s[s.length-1]&&s.pop();var a=-(i.depth+1);s.unshift(a);for(var l=i.depth,c=i.pos-1;l>0;l--,c--){var u=i.node(l).type.spec;if(u.defining||u.definingAsContext||u.isolating)break;s.indexOf(l)>-1?a=l:i.before(l)==c&&s.splice(1,0,-l)}for(var h=s.indexOf(a),p=[],f=n.openStart,d=n.content,m=0;;m++){var g=d.firstChild;if(p.push(g),m==n.openStart)break;d=g.content}for(var y=f-1;y>=0;y--){var b=p[y].type,k=H(b);if(k&&i.node(h).type!=b)f=y;else if(k||!b.isTextblock)break}for(var w=n.openStart;w>=0;w--){var x=(w+f+1)%(n.openStart+1),C=p[x];if(C)for(var S=0;S<s.length;S++){var N=s[(S+h)%s.length],T=!0;N<0&&(T=!1,N=-N);var O=i.node(N-1),M=i.index(N-1);if(O.canReplaceWith(M,M,C.type,C.marks))return this.replace(i.before(N),T?o.after(N):t,new r.Ji(V(n.content,0,n.openStart,x),x,n.openEnd))}}for(var E=this.steps.length,D=s.length-1;D>=0&&(this.replace(e,t,n),!(this.steps.length>E));D--){var A=s[D];A<0||(e=i.before(A),t=o.after(A))}return this},h.prototype.replaceRangeWith=function(e,t,n){if(!n.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var i=M(this.doc,e,n.type);null!=i&&(e=t=i)}return this.replaceRange(e,t,new r.Ji(r.FK.from(n),0,0))},h.prototype.deleteRange=function(e,t){for(var n=this.doc.resolve(e),r=this.doc.resolve(t),i=$(n,r),o=0;o<i.length;o++){var s=i[o],a=o==i.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 l=1;l<=n.depth&&l<=r.depth;l++)if(e-n.start(l)==n.depth-l&&t>n.end(l)&&r.end(l)-t!=r.depth-l)return this.delete(n.before(l),t);return this.delete(e,t)}},347(e,t,n){n.r(t),n.d(t,{Decoration:function(){return Tt},DecorationSet:function(){return Dt},EditorView:function(){return jt},__endComposition:function(){return gt},__parseFromClipboard:function(){return _e},__serializeForClipboard:function(){return qe}});var r=n(565),i=n(458),o=n(256),s={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var a=/Edge\/(\d+)/.exec(navigator.userAgent),l=/MSIE \d/.test(navigator.userAgent),c=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);s.mac=/Mac/.test(navigator.platform);var u=s.ie=!!(l||c||a);s.ie_version=l?document.documentMode||6:c?+c[1]:a?+a[1]:null,s.gecko=!u&&/gecko\/(\d+)/i.test(navigator.userAgent),s.gecko_version=s.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var h=!u&&/Chrome\/(\d+)/.exec(navigator.userAgent);s.chrome=!!h,s.chrome_version=h&&+h[1],s.safari=!u&&/Apple Computer/.test(navigator.vendor),s.ios=s.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),s.android=/Android \d/.test(navigator.userAgent),s.webkit="webkitFontSmoothing"in document.documentElement.style,s.webkit_version=s.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var p=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},f=function(e){var t=e.parentNode;return t&&11==t.nodeType?t.host:t},d=null,m=function(e,t,n){var r=d||(d=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},g=function(e,t,n,r){return n&&(y(e,t,n,r,-1)||y(e,t,n,r,1))},v=/^(img|br|input|textarea|hr)$/i;function y(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:b(e))){var o=e.parentNode;if(1!=o.nodeType||k(e)||v.test(e.nodeName)||"false"==e.contentEditable)return!1;t=p(e)+(i<0?0:1),e=o}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?b(e):0}}}function b(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function k(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var w=function(e){var t=e.isCollapsed;return t&&s.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function x(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function C(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function S(e,t){return"number"==typeof e?e:e[t]}function N(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function T(e,t,n){for(var r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument,s=n||e.dom;s;s=f(s))if(1==s.nodeType){var a=s==o.body||1!=s.nodeType,l=a?C(o):N(s),c=0,u=0;if(t.top<l.top+S(r,"top")?u=-(l.top-t.top+S(i,"top")):t.bottom>l.bottom-S(r,"bottom")&&(u=t.bottom-l.bottom+S(i,"bottom")),t.left<l.left+S(r,"left")?c=-(l.left-t.left+S(i,"left")):t.right>l.right-S(r,"right")&&(c=t.right-l.right+S(i,"right")),c||u)if(a)o.defaultView.scrollBy(c,u);else{var h=s.scrollLeft,p=s.scrollTop;u&&(s.scrollTop+=u),c&&(s.scrollLeft+=c);var d=s.scrollLeft-h,m=s.scrollTop-p;t={left:t.left-d,top:t.top-m,right:t.right-d,bottom:t.bottom-m}}if(a)break}}function O(e){for(var t=[],n=e.ownerDocument;e&&(t.push({dom:e,top:e.scrollTop,left:e.scrollLeft}),e!=n);e=f(e));return t}function M(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=r.dom,o=r.top,s=r.left;i.scrollTop!=o+t&&(i.scrollTop=o+t),i.scrollLeft!=s&&(i.scrollLeft=s)}}var E=null;function D(e,t){for(var n,r,i=2e8,o=0,s=t.top,a=t.top,l=e.firstChild,c=0;l;l=l.nextSibling,c++){var u=void 0;if(1==l.nodeType)u=l.getClientRects();else{if(3!=l.nodeType)continue;u=m(l).getClientRects()}for(var h=0;h<u.length;h++){var p=u[h];if(p.top<=s&&p.bottom>=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);var f=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(f<i){n=l,i=f,r=f&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==l.nodeType&&f&&(o=c+(t.left>=(p.left+p.right)/2?1:0));continue}}!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(o=c+1)}}return n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);var o=I(r,1);if(o.top!=o.bottom&&A(t,o))return{node:e,offset:i+(t.left>=(o.left+o.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:o}:D(n,r)}function A(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function L(e,t,n){var r=e.childNodes.length;if(r&&n.top<n.bottom)for(var i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){var s=e.childNodes[o];if(1==s.nodeType)for(var a=s.getClientRects(),l=0;l<a.length;l++){var c=a[l];if(A(t,c))return L(s,t,c)}if((o=(o+1)%r)==i)break}return e}function R(e,t){var n,r,i,o,a=e.root;if(a.caretPositionFromPoint)try{var l=a.caretPositionFromPoint(t.left,t.top);l&&(i=(n=l).offsetNode,o=n.offset)}catch(e){}if(!i&&a.caretRangeFromPoint){var c=a.caretRangeFromPoint(t.left,t.top);c&&(i=(r=c).startContainer,o=r.startOffset)}var u,h=a.elementFromPoint(t.left,t.top+1);if(!h||!e.dom.contains(1!=h.nodeType?h.parentNode:h)){var p=e.dom.getBoundingClientRect();if(!A(t,p))return null;if(!(h=L(e.dom,t,p)))return null}if(s.safari&&h.draggable&&(i=o=null),h=function(e,t){var n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(h,t),i){if(s.gecko&&1==i.nodeType&&(o=Math.min(o,i.childNodes.length))<i.childNodes.length){var f,d=i.childNodes[o];"IMG"==d.nodeName&&(f=d.getBoundingClientRect()).right<=t.left&&f.bottom>t.top&&o++}i==e.dom&&o==i.childNodes.length-1&&1==i.lastChild.nodeType&&t.top>i.lastChild.getBoundingClientRect().bottom?u=e.state.doc.content.size:0!=o&&1==i.nodeType&&"BR"==i.childNodes[o-1].nodeName||(u=function(e,t,n,r){for(var i=-1,o=t;o!=e.dom;){var s=e.docView.nearestDesc(o,!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)i=s.posBefore;else{if(!(a.right<r.left||a.bottom<r.top))break;i=s.posAfter}}o=s.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n)}(e,i,o,t))}null==u&&(u=function(e,t,n){var r=D(t,n),i=r.node,o=r.offset,s=-1;if(1==i.nodeType&&!i.firstChild){var a=i.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(i,o,s)}(e,h,t));var m=e.docView.nearestDesc(h,!0);return{pos:u,inside:m?m.posAtStart-m.border:-1}}function I(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}var F=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function P(e,t,n){var r=e.docView.domFromPos(t,n<0?-1:1),i=r.node,o=r.offset,a=s.webkit||s.gecko;if(3==i.nodeType){if(!a||!F.test(i.nodeValue)&&(n<0?o:o!=i.nodeValue.length)){var l=o,c=o,u=n<0?1:-1;return n<0&&!o?(c++,u=-1):n>=0&&o==i.nodeValue.length?(l--,u=1):n<0?l--:c++,B(I(m(i,l,c),u),u<0)}var h=I(m(i,o,o),n);if(s.gecko&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){var p=I(m(i,o-1,o-1),-1);if(p.top==h.top){var f=I(m(i,o,o+1),-1);if(f.top!=h.top)return B(f,f.left<p.left)}}return h}if(!e.state.doc.resolve(t).parent.inlineContent){if(o&&(n<0||o==b(i))){var d=i.childNodes[o-1];if(1==d.nodeType)return z(d.getBoundingClientRect(),!1)}if(o<b(i)){var g=i.childNodes[o];if(1==g.nodeType)return z(g.getBoundingClientRect(),!0)}return z(i.getBoundingClientRect(),n>=0)}if(o&&(n<0||o==b(i))){var v=i.childNodes[o-1],y=3==v.nodeType?m(v,b(v)-(a?0:1)):1!=v.nodeType||"BR"==v.nodeName&&v.nextSibling?null:v;if(y)return B(I(y,1),!1)}if(o<b(i)){var k=i.childNodes[o],w=3==k.nodeType?m(k,0,a?0:1):1==k.nodeType?k:null;if(w)return B(I(w,-1),!0)}return B(I(3==i.nodeType?m(i):i,-n),n>=0)}function B(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function z(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function q(e,t,n){var r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}var _=/[\u0590-\u08ac]/,j=null,H=null,V=!1;var $=function(e,t,n,r){this.parent=e,this.children=t,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},U={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}};$.prototype.matchesWidget=function(){return!1},$.prototype.matchesMark=function(){return!1},$.prototype.matchesNode=function(){return!1},$.prototype.matchesHack=function(){return!1},U.beforePosition.get=function(){return!1},$.prototype.parseRule=function(){return null},$.prototype.stopEvent=function(){return!1},U.size.get=function(){for(var e=0,t=0;t<this.children.length;t++)e+=this.children[t].size;return e},U.border.get=function(){return 0},$.prototype.destroy=function(){this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var e=0;e<this.children.length;e++)this.children[e].destroy()},$.prototype.posBeforeChild=function(e){for(var t=0,n=this.posAtStart;t<this.children.length;t++){var r=this.children[t];if(r==e)return n;n+=r.size}},U.posBefore.get=function(){return this.parent.posBeforeChild(this)},U.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},U.posAfter.get=function(){return this.posBefore+this.size},U.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},$.prototype.localPosFromDOM=function(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){var r,i;if(e==this.contentDOM)r=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;r=e.previousSibling}for(;r&&(!(i=r.pmViewDesc)||i.parent!=this);)r=r.previousSibling;return r?this.posBeforeChild(i)+i.size:this.posAtStart}var o,s;if(e==this.contentDOM)o=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&(!(s=o.pmViewDesc)||s.parent!=this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}var a;if(e==this.dom&&this.contentDOM)a=t>p(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))a=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var l=e;;l=l.parentNode){if(l==this.dom){a=!1;break}if(l.parentNode.firstChild!=l)break}if(null==a&&t==e.childNodes.length)for(var c=e;;c=c.parentNode){if(c==this.dom){a=!0;break}if(c.parentNode.lastChild!=c)break}}return(null==a?n>0:a)?this.posAtEnd:this.posAtStart},$.prototype.nearestDesc=function(e,t){for(var n=!0,r=e;r;r=r.parentNode){var i=this.getDesc(r);if(i&&(!t||i.node)){if(!n||!i.nodeDOM||(1==i.nodeDOM.nodeType?i.nodeDOM.contains(1==e.nodeType?e:e.parentNode):i.nodeDOM==e))return i;n=!1}}},$.prototype.getDesc=function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t},$.prototype.posFromDOM=function(e,t,n){for(var r=e;r;r=r.parentNode){var i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1},$.prototype.descAt=function(e){for(var t=0,n=0;t<this.children.length;t++){var r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<i)return r.descAt(e-n-r.border);n=i}},$.prototype.domFromPos=function(e,t){if(!this.contentDOM)return{node:this.dom,offset:0};for(var n=0,r=0,i=!0;;r++,i=!1){for(;r<this.children.length&&(this.children[r].beforePosition||this.children[r].dom.parentNode!=this.contentDOM);)n+=this.children[r++].size;var o=r==this.children.length?null:this.children[r];if(n==e&&(0==t||!o||!o.size||o.border||t<0&&i)||o&&o.domAtom&&e<n+o.size)return{node:this.contentDOM,offset:o?p(o.dom):this.contentDOM.childNodes.length};if(!o)throw new Error("Invalid position "+e);var s=n+o.size;if(!o.domAtom&&(t<0&&!o.border?s>=e:s>e)&&(s>e||r+1>=this.children.length||!this.children[r+1].beforePosition))return o.domFromPos(e-n-o.border,t);n=s}},$.prototype.parseRange=function(e,t,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,i=-1,o=n,s=0;;s++){var a=this.children[s],l=o+a.size;if(-1==r&&e<=l){var c=o+a.border;if(e>=c&&t<=l-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,c);e=o;for(var u=s;u>0;u--){var h=this.children[u-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){r=p(h.dom)+1;break}e-=h.size}-1==r&&(r=0)}if(r>-1&&(l>t||s==this.children.length-1)){t=l;for(var f=s+1;f<this.children.length;f++){var d=this.children[f];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=p(d.dom);break}t+=d.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}},$.prototype.emptyChildAt=function(e){if(this.border||!this.contentDOM||!this.children.length)return!1;var t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)},$.prototype.domAfterPos=function(e){var t=this.domFromPos(e,0),n=t.node,r=t.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]},$.prototype.setSelection=function(e,t,n,r){for(var i=Math.min(e,t),o=Math.max(e,t),a=0,l=0;a<this.children.length;a++){var c=this.children[a],u=l+c.size;if(i>l&&o<u)return c.setSelection(e-l-c.border,t-l-c.border,n,r);l=u}var h=this.domFromPos(e,e?-1:1),f=t==e?h:this.domFromPos(t,t?-1:1),d=n.getSelection(),m=!1;if((s.gecko||s.safari)&&e==t){var v=h.node,y=h.offset;if(3==v.nodeType)(m=y&&"\n"==v.nodeValue[y-1])&&y==v.nodeValue.length&&v.nextSibling&&"BR"==v.nextSibling.nodeName&&(h=f={node:v.parentNode,offset:p(v)+1});else{var b=v.childNodes[y-1];m=b&&("BR"==b.nodeName||"false"==b.contentEditable)}}if(r||m&&s.safari||!g(h.node,h.offset,d.anchorNode,d.anchorOffset)||!g(f.node,f.offset,d.focusNode,d.focusOffset)){var k=!1;if((d.extend||e==t)&&!m){d.collapse(h.node,h.offset);try{e!=t&&d.extend(f.node,f.offset),k=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!k){if(e>t){var w=h;h=f,f=w}var x=document.createRange();x.setEnd(f.node,f.offset),x.setStart(h.node,h.offset),d.removeAllRanges(),d.addRange(x)}}},$.prototype.ignoreMutation=function(e){return!this.contentDOM&&"selection"!=e.type},U.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},$.prototype.markDirty=function(e,t){for(var n=0,r=0;r<this.children.length;r++){var i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){var s=n+i.border,a=o-i.border;if(e>=s&&t<=a)return this.dirty=e==n||t==o?2:1,void(e!=s||t!=a||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-s,t-s):i.dirty=3);i.dirty=3}n=o}this.dirty=2},$.prototype.markParentsDirty=function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty<n&&(t.dirty=n)}},U.domAtom.get=function(){return!1},Object.defineProperties($.prototype,U);var J=[],W=function(e){function t(t,n,r,i){var o,s=n.type.toDOM;if("function"==typeof s&&(s=s(r,function(){return o?o.parent?o.parent.posBeforeChild(o):void 0:i})),!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")}e.call(this,t,J,s,null),this.widget=n,o=this}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={beforePosition:{configurable:!0},domAtom:{configurable:!0}};return n.beforePosition.get=function(){return this.widget.type.side<0},t.prototype.matchesWidget=function(e){return 0==this.dirty&&e.type.eq(this.widget.type)},t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.stopEvent=function(e){var t=this.widget.spec.stopEvent;return!!t&&t(e)},t.prototype.ignoreMutation=function(e){return"selection"!=e.type||this.widget.spec.ignoreSelection},n.domAtom.get=function(){return!0},Object.defineProperties(t.prototype,n),t}($),K=function(e){function t(t,n,r,i){e.call(this,t,J,n,null),this.textDOM=r,this.text=i}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={size:{configurable:!0}};return n.size.get=function(){return this.text.length},t.prototype.localPosFromDOM=function(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t},t.prototype.domFromPos=function(e){return{node:this.textDOM,offset:e}},t.prototype.ignoreMutation=function(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue},Object.defineProperties(t.prototype,n),t}($),G=function(e){function t(t,n,r,i){e.call(this,t,[],r,i),this.mark=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.create=function(e,n,r,o){var s=o.nodeViews[n.type.name],a=s&&s(n,o,r);return a&&a.dom||(a=i.ZF.renderSpec(document,n.type.spec.toDOM(n,r))),new t(e,n,a.dom,a.contentDOM||a.dom)},t.prototype.parseRule=function(){return{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},t.prototype.matchesMark=function(e){return 3!=this.dirty&&this.mark.eq(e)},t.prototype.markDirty=function(t,n){if(e.prototype.markDirty.call(this,t,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}},t.prototype.slice=function(e,n,r){var i=t.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=pe(o,n,s,r)),e>0&&(o=pe(o,0,e,r));for(var a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i},t}($),Z=function(e){function t(t,n,r,i,o,s,a,l,c){e.call(this,t,n.isLeaf?J:[],o,s),this.nodeDOM=a,this.node=n,this.outerDeco=r,this.innerDeco=i,s&&this.updateChildren(l,c)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={size:{configurable:!0},border:{configurable:!0},domAtom:{configurable:!0}};return t.create=function(e,n,r,o,s,a){var l,c,u=s.nodeViews[n.type.name],h=u&&u(n,s,function(){return c?c.parent?c.parent.posBeforeChild(c):void 0:a},r,o),p=h&&h.dom,f=h&&h.contentDOM;if(n.isText)if(p){if(3!=p.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else p=document.createTextNode(n.text);else p||(p=(l=i.ZF.renderSpec(document,n.type.spec.toDOM(n))).dom,f=l.contentDOM);f||n.isText||"BR"==p.nodeName||(p.hasAttribute("contenteditable")||(p.contentEditable=!1),n.type.spec.draggable&&(p.draggable=!0));var d=p;return p=ae(p,r,n),h?c=new ee(e,n,r,o,p,f,d,h,s,a+1):n.isText?new Y(e,n,r,o,p,d,s):new t(e,n,r,o,p,f,d,s,a+1)},t.prototype.parseRule=function(){var e=this;if(this.node.type.spec.reparseInView)return null;var t={node:this.node.type.name,attrs:this.node.attrs};return this.node.type.spec.code&&(t.preserveWhitespace="full"),this.contentDOM&&!this.contentLost?t.contentElement=this.contentDOM:t.getContent=function(){return e.contentDOM?i.FK.empty:e.node.content},t},t.prototype.matchesNode=function(e,t,n){return 0==this.dirty&&e.eq(this.node)&&le(t,this.outerDeco)&&n.eq(this.innerDeco)},n.size.get=function(){return this.node.nodeSize},n.border.get=function(){return this.node.isLeaf?0:1},t.prototype.updateChildren=function(e,t){var n=this,r=this.node.inlineContent,o=t,a=r&&e.composing&&this.localCompositionNode(e,t),l=new ue(this,a&&a.node);!function(e,t,n,r){var i=t.locals(e),o=0;if(0!=i.length)for(var s=0,a=[],l=null,c=0;;){if(s<i.length&&i[s].to==o){for(var u=i[s++],h=void 0;s<i.length&&i[s].to==o;)(h||(h=[u])).push(i[s++]);if(h){h.sort(he);for(var p=0;p<h.length;p++)n(h[p],c,!!l)}else n(u,c,!!l)}var f=void 0,d=void 0;if(l)d=-1,f=l,l=null;else{if(!(c<e.childCount))break;d=c,f=e.child(c++)}for(var m=0;m<a.length;m++)a[m].to<=o&&a.splice(m--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);var g=o+f.nodeSize;if(f.isText){var v=g;s<i.length&&i[s].from<v&&(v=i[s].from);for(var y=0;y<a.length;y++)a[y].to<v&&(v=a[y].to);v<g&&(l=f.cut(v-o),f=f.cut(0,v-o),g=v,d=-1)}r(f,a.length?f.isInline&&!f.isLeaf?a.filter(function(e){return!e.inline}):a.slice():J,t.forChild(o,f),d),o=g}else for(var b=0;b<e.childCount;b++){var k=e.child(b);r(k,i,t.forChild(o,k),b),o+=k.nodeSize}}(this.node,this.innerDeco,function(t,s,a){t.spec.marks?l.syncToMarks(t.spec.marks,r,e):t.type.side>=0&&!a&&l.syncToMarks(s==n.node.childCount?i.CU.none:n.node.child(s).marks,r,e),l.placeWidget(t,e,o)},function(t,n,i,s){l.syncToMarks(t.marks,r,e),l.findNodeMatch(t,n,i,s)||l.updateNextNode(t,n,i,e,s)||l.addNode(t,n,i,e,o),o+=t.nodeSize}),l.syncToMarks(J,r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),te(this.contentDOM,this.children,e),s.ios&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))},t.prototype.localCompositionNode=function(e,t){var n=e.state.selection,i=n.from,o=n.to;if(!(!(e.state.selection instanceof r.TextSelection)||i<t||o>t+this.node.content.size)){var s=e.root.getSelection(),a=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=b(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(s.focusNode,s.focusOffset);if(a&&this.dom.contains(a.parentNode)){var l=a.nodeValue,c=function(e,t,n,r){for(var i=0,o=0;i<e.childCount&&o<=r;){var s=e.child(i++),a=o;if(o+=s.nodeSize,s.isText){for(var l=s.text;i<e.childCount;){var c=e.child(i++);if(o+=c.nodeSize,!c.isText)break;l+=c.text}if(o>=n){var u=l.lastIndexOf(t,r-a);if(u>=0&&u+t.length+a>=n)return a+u}}}return-1}(this.node.content,l,i-t,o-t);return c<0?null:{node:a,pos:c,text:l}}}},t.prototype.protectLocalComposition=function(e,t){var n=t.node,r=t.pos,i=t.text;if(!this.getDesc(n)){for(var o=n;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=null)}var s=new K(this,o,n,i);e.compositionNodes.push(s),this.children=pe(this.children,r,r+i.length,e,s)}},t.prototype.update=function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node)||(this.updateInner(e,t,n,r),0))},t.prototype.updateInner=function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},t.prototype.updateOuterDeco=function(e){if(!le(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=oe(this.dom,this.nodeDOM,ie(this.outerDeco,this.node,t),ie(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=e}},t.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},t.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(t.prototype,n),t}($);function X(e,t,n,r,i){return ae(r,t,e),new Z(null,e,t,n,r,r,r,i,0)}var Y=function(e){function t(t,n,r,i,o,s,a){e.call(this,t,n,r,i,o,null,s,a)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={domAtom:{configurable:!0}};return t.prototype.parseRule=function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}},t.prototype.update=function(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,0))},t.prototype.inParent=function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1},t.prototype.domFromPos=function(e){return{node:this.nodeDOM,offset:e}},t.prototype.localPosFromDOM=function(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):e.prototype.localPosFromDOM.call(this,t,n,r)},t.prototype.ignoreMutation=function(e){return"characterData"!=e.type&&"selection"!=e.type},t.prototype.slice=function(e,n,r){var i=this.node.cut(e,n),o=document.createTextNode(i.text);return new t(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)},n.domAtom.get=function(){return!1},Object.defineProperties(t.prototype,n),t}(Z),Q=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={domAtom:{configurable:!0}};return t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.matchesHack=function(){return 0==this.dirty},n.domAtom.get=function(){return!0},Object.defineProperties(t.prototype,n),t}($),ee=function(e){function t(t,n,r,i,o,s,a,l,c,u){e.call(this,t,n,r,i,o,s,a,c,u),this.spec=l}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.update=function(t,n,r,i){if(3==this.dirty)return!1;if(this.spec.update){var o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}return!(!this.contentDOM&&!t.isLeaf)&&e.prototype.update.call(this,t,n,r,i)},t.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():e.prototype.selectNode.call(this)},t.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():e.prototype.deselectNode.call(this)},t.prototype.setSelection=function(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r):e.prototype.setSelection.call(this,t,n,r,i)},t.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),e.prototype.destroy.call(this)},t.prototype.stopEvent=function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)},t.prototype.ignoreMutation=function(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):e.prototype.ignoreMutation.call(this,t)},t}(Z);function te(e,t,n){for(var r=e.firstChild,i=!1,o=0;o<t.length;o++){var s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=ce(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof G){var l=r?r.previousSibling:e.lastChild;te(s.contentDOM,s.children,n),r=l?l.nextSibling:e.firstChild}}for(;r;)r=ce(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}function ne(e){e&&(this.nodeName=e)}ne.prototype=Object.create(null);var re=[new ne];function ie(e,t,n){if(0==e.length)return re;for(var r=n?re[0]:new ne,i=[r],o=0;o<e.length;o++){var s=e[o].type.attrs;if(s)for(var a in s.nodeName&&i.push(r=new ne(s.nodeName)),s){var l=s[a];null!=l&&(n&&1==i.length&&i.push(r=new ne(t.isInline?"span":"div")),"class"==a?r.class=(r.class?r.class+" ":"")+l:"style"==a?r.style=(r.style?r.style+";":"")+l:"nodeName"!=a&&(r[a]=l))}}return i}function oe(e,t,n,r){if(n==re&&r==re)return t;for(var i=t,o=0;o<r.length;o++){var s=r[o],a=n[o];if(o){var l=void 0;a&&a.nodeName==s.nodeName&&i!=e&&(l=i.parentNode)&&l.tagName.toLowerCase()==s.nodeName||((l=document.createElement(s.nodeName)).pmIsDeco=!0,l.appendChild(i),a=re[0]),i=l}se(i,a||re[0],s)}return i}function se(e,t,n){for(var r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(var i in n)"class"!=i&&"style"!=i&&"nodeName"!=i&&n[i]!=t[i]&&e.setAttribute(i,n[i]);if(t.class!=n.class){for(var o=t.class?t.class.split(" "):J,s=n.class?n.class.split(" "):J,a=0;a<o.length;a++)-1==s.indexOf(o[a])&&e.classList.remove(o[a]);for(var l=0;l<s.length;l++)-1==o.indexOf(s[l])&&e.classList.add(s[l])}if(t.style!=n.style){if(t.style)for(var c,u=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;c=u.exec(t.style);)e.style.removeProperty(c[1]);n.style&&(e.style.cssText+=n.style)}}function ae(e,t,n){return oe(e,e,re,ie(t,n,1!=e.nodeType))}function le(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function ce(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var ue=function(e,t){this.top=e,this.lock=t,this.index=0,this.stack=[],this.changed=!1;var n=function(e,t){for(var n=[],r=e.childCount,i=t.length-1;r>0&&i>=0;i--){var o=t[i],s=o.node;if(s){if(s!=e.child(r-1))break;n.push(o),--r}}return{nodes:n.reverse(),offset:r}}(e.node.content,e.children);this.preMatched=n.nodes,this.preMatchOffset=n.offset};function he(e,t){return e.type.side-t.type.side}function pe(e,t,n,r,i){for(var o=[],s=0,a=0;s<e.length;s++){var l=e[s],c=a,u=a+=l.size;c>=n||u<=t?o.push(l):(c<t&&o.push(l.slice(0,t-c,r)),i&&(o.push(i),i=null),u>n&&o.push(l.slice(n-c,l.size,r)))}return o}function fe(e,t){var n=e.root.getSelection(),i=e.state.doc;if(!n.focusNode)return null;var o=e.docView.nearestDesc(n.focusNode),s=o&&0==o.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset);if(a<0)return null;var l,c,u=i.resolve(a);if(w(n)){for(l=u;o&&!o.node;)o=o.parent;if(o&&o.node.isAtom&&r.NodeSelection.isSelectable(o.node)&&o.parent&&(!o.node.isInline||!function(e,t,n){for(var r=0==t,i=t==b(e);r||i;){if(e==n)return!0;var o=p(e);if(!(e=e.parentNode))return!1;r=r&&0==o,i=i&&o==b(e)}}(n.focusNode,n.focusOffset,o.dom))){var h=o.posBefore;c=new r.NodeSelection(a==h?u:i.resolve(h))}}else{var f=e.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(f<0)return null;l=i.resolve(f)}return c||(c=xe(e,l,u,"pointer"==t||e.state.selection.head<u.pos&&!s?1:-1)),c}function de(e){return e.editable?e.hasFocus():Ce(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function me(e,t){var n=e.state.selection;if(ke(e,n),de(e)){if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){var t=e.root.getSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,p(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&s.ie&&s.ie_version<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{var i,o,a=n.anchor,l=n.head;!ge||n instanceof r.TextSelection||(n.$from.parent.inlineContent||(i=ve(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=ve(e,n.to))),e.docView.setSelection(a,l,e.root,t),ge&&(i&&be(i),o&&be(o)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){var t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.hideSelectionGuard);var n=e.root.getSelection(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.hideSelectionGuard),setTimeout(function(){de(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}ue.prototype.getPreMatch=function(e){return e>=this.preMatchOffset?this.preMatched[e-this.preMatchOffset]:null},ue.prototype.destroyBetween=function(e,t){if(e!=t){for(var n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}},ue.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},ue.prototype.syncToMarks=function(e,t,n){for(var r=0,i=this.stack.length>>1,o=Math.min(i,e.length);r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.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(e[i])){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 l=G.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}},ue.prototype.findNodeMatch=function(e,t,n,r){var i=-1,o=r<0?void 0:this.getPreMatch(r),s=this.top.children;if(o&&o.matchesNode(e,t,n))i=s.indexOf(o);else for(var a=this.index,l=Math.min(s.length,a+5);a<l;a++){var c=s[a];if(c.matchesNode(e,t,n)&&this.preMatched.indexOf(c)<0){i=a;break}}return!(i<0||(this.destroyBetween(this.index,i),this.index++,0))},ue.prototype.updateNextNode=function(e,t,n,r,i){for(var o=this.index;o<this.top.children.length;o++){var s=this.top.children[o];if(s instanceof Z){var a=this.preMatched.indexOf(s);if(a>-1&&a+this.preMatchOffset!=i)return!1;var l=s.dom;if((!this.lock||!(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))||e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&3!=s.dirty&&le(t,s.outerDeco))&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1},ue.prototype.addNode=function(e,t,n,r,i){this.top.children.splice(this.index++,0,Z.create(this.top,e,t,n,r,i)),this.changed=!0},ue.prototype.placeWidget=function(e,t,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){var i=new W(this.top,e,t,n);this.top.children.splice(this.index++,0,i),this.changed=!0}else this.index++},ue.prototype.addTextblockHacks=function(){for(var e=this.top.children[this.index-1];e instanceof G;)e=e.children[e.children.length-1];if(!e||!(e instanceof Y)||/\n$/.test(e.node.text))if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack())this.index++;else{var t=document.createElement("br");this.top.children.splice(this.index++,0,new Q(this.top,J,t,null)),this.changed=!0}};var ge=s.safari||s.chrome&&s.chrome_version<63;function ve(e,t){var n=e.docView.domFromPos(t,0),r=n.node,i=n.offset,o=i<r.childNodes.length?r.childNodes[i]:null,a=i?r.childNodes[i-1]:null;if(s.safari&&o&&"false"==o.contentEditable)return ye(o);if(!(o&&"false"!=o.contentEditable||a&&"false"!=a.contentEditable)){if(o)return ye(o);if(a)return ye(a)}}function ye(e){return e.contentEditable="true",s.safari&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function be(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function ke(e,t){if(t instanceof r.NodeSelection){var n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(we(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else we(e)}function we(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=null)}function xe(e,t,n,i){return e.someProp("createSelectionBetween",function(r){return r(e,t,n)})||r.TextSelection.between(t,n,i)}function Ce(e){var t=e.root.getSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function Se(e,t){var n=e.selection,i=n.$anchor,o=n.$head,s=t>0?i.max(o):i.min(o),a=s.parent.inlineContent?s.depth?e.doc.resolve(t>0?s.after():s.before()):null:s;return a&&r.Selection.findFrom(a,t)}function Ne(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Te(e,t,n){var i=e.state.selection;if(!(i instanceof r.TextSelection)){if(i instanceof r.NodeSelection&&i.node.isInline)return Ne(e,new r.TextSelection(t>0?i.$to:i.$from));var o=Se(e.state,t);return!!o&&Ne(e,o)}if(!i.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var a=Se(e.state,t);return!!(a&&a instanceof r.NodeSelection)&&Ne(e,a)}if(!(s.mac&&n.indexOf("m")>-1)){var l,c=i.$head,u=c.textOffset?null:t<0?c.nodeBefore:c.nodeAfter;if(!u||u.isText)return!1;var h=t<0?c.pos-u.nodeSize:c.pos;return!!(u.isAtom||(l=e.docView.descAt(h))&&!l.contentDOM)&&(r.NodeSelection.isSelectable(u)?Ne(e,new r.NodeSelection(t<0?e.state.doc.resolve(c.pos-u.nodeSize):c)):!!s.webkit&&Ne(e,new r.TextSelection(e.state.doc.resolve(t<0?h:h+u.nodeSize))))}}function Oe(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Me(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function Ee(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){var i,o,a=!1;for(s.gecko&&1==n.nodeType&&r<Oe(n)&&Me(n.childNodes[r])&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;var l=n.childNodes[r-1];if(Me(l))i=n,o=--r;else{if(3!=l.nodeType)break;r=(n=l).nodeValue.length}}else{if(Ae(n))break;for(var c=n.previousSibling;c&&Me(c);)i=n.parentNode,o=p(c),c=c.previousSibling;if(c)r=Oe(n=c);else{if((n=n.parentNode)==e.dom)break;r=0}}a?Le(e,t,n,r):i&&Le(e,t,i,o)}}function De(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var i,o,s=Oe(n);;)if(r<s){if(1!=n.nodeType)break;if(!Me(n.childNodes[r]))break;i=n,o=++r}else{if(Ae(n))break;for(var a=n.nextSibling;a&&Me(a);)i=a.parentNode,o=p(a)+1,a=a.nextSibling;if(a)r=0,s=Oe(n=a);else{if((n=n.parentNode)==e.dom)break;r=s=0}}i&&Le(e,t,i,o)}}function Ae(e){var t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Le(e,t,n,r){if(w(t)){var i=document.createRange();i.setEnd(n,r),i.setStart(n,r),t.removeAllRanges(),t.addRange(i)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection();var o=e.state;setTimeout(function(){e.state==o&&me(e)},50)}function Re(e,t,n){var i=e.state.selection;if(i instanceof r.TextSelection&&!i.empty||n.indexOf("s")>-1)return!1;if(s.mac&&n.indexOf("m")>-1)return!1;var o=i.$from,a=i.$to;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var l=Se(e.state,t);if(l&&l instanceof r.NodeSelection)return Ne(e,l)}if(!o.parent.inlineContent){var c=t<0?o:a,u=i instanceof r.AllSelection?r.Selection.near(c,t):r.Selection.findFrom(c,t);return!!u&&Ne(e,u)}return!1}function Ie(e,t){if(!(e.state.selection instanceof r.TextSelection))return!0;var n=e.state.selection,i=n.$head,o=n.$anchor,s=n.empty;if(!i.sameParent(o))return!0;if(!s)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!i.textOffset&&(t<0?i.nodeBefore:i.nodeAfter);if(a&&!a.isText){var l=e.state.tr;return t<0?l.delete(i.pos-a.nodeSize,i.pos):l.delete(i.pos,i.pos+a.nodeSize),e.dispatch(l),!0}return!1}function Fe(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Pe(e){var t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(s.safari&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(e.parentNode.lastChild==e||s.safari&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0}}function Be(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:xe(e,t.resolve(n.anchor),t.resolve(n.head))}function ze(e,t,n){for(var r=e.depth,i=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n)for(var o=e.node(r).maybeChild(e.indexAfter(r));o&&!o.isLeaf;)o=o.firstChild,i++;return i}function qe(e,t){for(var n=[],r=t.content,o=t.openStart,s=t.openEnd;o>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,s--;var a=r.firstChild;n.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),r=a.content}var l=e.someProp("clipboardSerializer")||i.ZF.fromSchema(e.state.schema),c=We(),u=c.createElement("div");u.appendChild(l.serializeFragment(r,{document:c}));for(var h,p=u.firstChild;p&&1==p.nodeType&&(h=Ue[p.nodeName.toLowerCase()]);){for(var f=h.length-1;f>=0;f--){for(var d=c.createElement(h[f]);u.firstChild;)d.appendChild(u.firstChild);u.appendChild(d)}p=u.firstChild}return p&&1==p.nodeType&&p.setAttribute("data-pm-slice",o+" "+s+" "+JSON.stringify(n)),{dom:u,text:e.someProp("clipboardTextSerializer",function(e){return e(t)})||t.content.textBetween(0,t.content.size,"\n\n")}}function _e(e,t,n,r,o){var s,a,l=o.parent.type.spec.code;if(!n&&!t)return null;var c=t&&(r||l||!n);if(c){if(e.someProp("transformPastedText",function(e){t=e(t,l||r)}),l)return new i.Ji(i.FK.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0);var u=e.someProp("clipboardTextParser",function(e){return e(t,o,r)});u?a=u:(s=document.createElement("div"),t.trim().split(/(?:\r\n?|\n)+/).forEach(function(e){s.appendChild(document.createElement("p")).textContent=e}))}else e.someProp("transformPastedHTML",function(e){n=e(n)}),s=function(e){var t=/(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=We().createElement("div"),i=/(?:<meta [^>]*>)*<([a-z][^>\s]+)/i.exec(e),o=0;(n=i&&Ue[i[1].toLowerCase()])&&(e=n.map(function(e){return"<"+e+">"}).join("")+e+n.map(function(e){return"</"+e+">"}).reverse().join(""),o=n.length),r.innerHTML=e;for(var s=0;s<o;s++)r=r.firstChild;return r}(n);var h=s&&s.querySelector("[data-pm-slice]"),p=h&&/^(\d+) (\d+) (.*)/.exec(h.getAttribute("data-pm-slice"));if(!a){var f=e.someProp("clipboardParser")||e.someProp("domParser")||i.S4.fromSchema(e.state.schema);a=f.parseSlice(s,{preserveWhitespace:!(!c&&!p),context:o})}return a=p?function(e,t){if(!e.size)return e;var n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}for(var o=e.content,s=e.openStart,a=e.openEnd,l=n.length-2;l>=0;l-=2){var c=r.nodes[n[l]];if(!c||c.hasRequiredAttrs())break;o=i.FK.from(c.create(n[l+1],o)),s++,a++}return new i.Ji(o,s,a)}(function(e,t,n){return t<e.openStart&&(e=new i.Ji($e(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new i.Ji($e(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}(a,+p[1],+p[2]),p[3]):i.Ji.maxOpen(function(e,t){if(e.childCount<2)return e;for(var n=function(n){var r=t.node(n).contentMatchAt(t.index(n)),o=void 0,s=[];if(e.forEach(function(e){if(s){var t,n=r.findWrapping(e.type);if(!n)return s=null;if(t=s.length&&o.length&&He(n,o,e,s[s.length-1],0))s[s.length-1]=t;else{s.length&&(s[s.length-1]=Ve(s[s.length-1],o.length));var i=je(e,n);s.push(i),r=r.matchType(i.type,i.attrs),o=n}}}),s)return{v:i.FK.from(s)}},r=t.depth;r>=0;r--){var o=n(r);if(o)return o.v}return e}(a.content,o),!1),e.someProp("transformPasted",function(e){a=e(a)}),a}function je(e,t,n){void 0===n&&(n=0);for(var r=t.length-1;r>=n;r--)e=t[r].create(null,i.FK.from(e));return e}function He(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){var s=He(e,t,n,r.lastChild,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(i.FK.from(je(n,e,o+1))))}}function Ve(e,t){if(0==t)return e;var n=e.content.replaceChild(e.childCount-1,Ve(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(i.FK.empty,!0);return e.copy(n.append(r))}function $e(e,t,n,r,o,s){var a=t<0?e.firstChild:e.lastChild,l=a.content;return o<r-1&&(l=$e(l,t,n,r,o+1,s)),o>=n&&(l=t<0?a.contentMatchAt(0).fillBefore(l,e.childCount>1||s<=o).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore(i.FK.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(l))}var Ue={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Je=null;function We(){return Je||(Je=document.implementation.createHTMLDocument("title"))}var Ke={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ge=s.ie&&s.ie_version<=11,Ze=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};Ze.prototype.set=function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset},Ze.prototype.eq=function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset};var Xe=function(e,t){var n=this;this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver(function(e){for(var t=0;t<e.length;t++)n.queue.push(e[t]);s.ie&&s.ie_version<=11&&e.some(function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length})?n.flushSoon():n.flush()}),this.currentSelection=new Ze,Ge&&(this.onCharData=function(e){n.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};Xe.prototype.flushSoon=function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){e.flushingSoon=-1,e.flush()},20))},Xe.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},Xe.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,Ke),Ge&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},Xe.prototype.stop=function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(function(){return e.flush()},20)}this.observer.disconnect()}Ge&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()},Xe.prototype.connectSelection=function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)},Xe.prototype.disconnectSelection=function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)},Xe.prototype.suppressSelectionUpdates=function(){var e=this;this.suppressingSelectionUpdates=!0,setTimeout(function(){return e.suppressingSelectionUpdates=!1},50)},Xe.prototype.onSelectionChange=function(){if((!(e=this.view).editable||e.root.activeElement==e.dom)&&Ce(e)){var e;if(this.suppressingSelectionUpdates)return me(this.view);if(s.ie&&s.ie_version<=11&&!this.view.state.selection.empty){var t=this.view.root.getSelection();if(t.focusNode&&g(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}},Xe.prototype.setCurSelection=function(){this.currentSelection.set(this.view.root.getSelection())},Xe.prototype.ignoreSelectionChange=function(e){if(0==e.rangeCount)return!0;var t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0},Xe.prototype.flush=function(){if(this.view.docView&&!(this.flushingSoon>-1)){var e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var t=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&Ce(this.view)&&!this.ignoreSelectionChange(t),r=-1,i=-1,o=!1,a=[];if(this.view.editable)for(var l=0;l<e.length;l++){var c=this.registerMutation(e[l],a);c&&(r=r<0?c.from:Math.min(c.from,r),i=i<0?c.to:Math.max(c.to,i),c.typeOver&&(o=!0))}if(s.gecko&&a.length>1){var u=a.filter(function(e){return"BR"==e.nodeName});if(2==u.length){var h=u[0],p=u[1];h.parentNode&&h.parentNode.parentNode==p.parentNode?p.remove():h.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,i),f=this.view,Ye||(Ye=!0,"normal"==getComputedStyle(f.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.handleDOMChange(r,i,o,a),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||me(this.view),this.currentSelection.set(t))}var f},Xe.prototype.registerMutation=function(e,t){if(t.indexOf(e.target)>-1)return null;var n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};var r=e.previousSibling,i=e.nextSibling;if(s.ie&&s.ie_version<=11&&e.addedNodes.length)for(var o=0;o<e.addedNodes.length;o++){var a=e.addedNodes[o],l=a.previousSibling,c=a.nextSibling;(!l||Array.prototype.indexOf.call(e.addedNodes,l)<0)&&(r=l),(!c||Array.prototype.indexOf.call(e.addedNodes,c)<0)&&(i=c)}for(var u=r&&r.parentNode==e.target?p(r)+1:0,h=n.localPosFromDOM(e.target,u,-1),f=i&&i.parentNode==e.target?p(i):e.target.childNodes.length,d=0;d<e.addedNodes.length;d++)t.push(e.addedNodes[d]);return{from:h,to:n.localPosFromDOM(e.target,f,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}};var Ye=!1,Qe={},et={};function tt(e,t){e.lastSelectionOrigin=t,e.lastSelectionTime=Date.now()}function nt(e){e.someProp("handleDOMEvents",function(t){for(var n in t)e.eventHandlers[n]||e.dom.addEventListener(n,e.eventHandlers[n]=function(t){return rt(e,t)})})}function rt(e,t){return e.someProp("handleDOMEvents",function(n){var r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function it(e){return{left:e.clientX,top:e.clientY}}function ot(e,t,n,r,i){if(-1==r)return!1;for(var o=e.state.doc.resolve(r),s=function(r){if(e.someProp(t,function(t){return r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1)}))return{v:!0}},a=o.depth+1;a>0;a--){var l=s(a);if(l)return l.v}return!1}function st(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function at(e,t,n,r){return ot(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",function(n){return n(e,t,r)})}function lt(e,t,n,i){return ot(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",function(n){return n(e,t,i)})||function(e,t){var n=e.state.doc;if(-1==t)return!!n.inlineContent&&(st(e,r.TextSelection.create(n,0,n.content.size),"pointer"),!0);for(var i=n.resolve(t),o=i.depth+1;o>0;o--){var s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)st(e,r.TextSelection.create(n,a+1,a+1+s.content.size),"pointer");else{if(!r.NodeSelection.isSelectable(s))continue;st(e,r.NodeSelection.create(n,a),"pointer")}return!0}}(e,n)}function ct(e){return gt(e)}et.keydown=function(e,t){if(e.shiftKey=16==t.keyCode||t.shiftKey,!pt(e,t))if(e.domObserver.forceFlush(),e.lastKeyCode=t.keyCode,e.lastKeyCodeTime=Date.now(),!s.ios||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",function(n){return n(e,t)})||function(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||s.mac&&72==n&&"c"==r?Ie(e,-1)||Ee(e):46==n||s.mac&&68==n&&"c"==r?Ie(e,1)||De(e):13==n||27==n||(37==n?Te(e,-1,r)||Ee(e):39==n?Te(e,1,r)||De(e):38==n?Re(e,-1,r)||Ee(e):40==n?function(e){if(s.safari&&!(e.state.selection.$head.parentOffset>0)){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var i=n.firstChild;Fe(e,i,!0),setTimeout(function(){return Fe(e,i,!1)},20)}}}(e)||Re(e,1,r)||De(e):r==(s.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}(e,t)?t.preventDefault():tt(e,"key");else{var n=Date.now();e.lastIOSEnter=n,e.lastIOSEnterFallbackTimeout=setTimeout(function(){e.lastIOSEnter==n&&(e.someProp("handleKeyDown",function(t){return t(e,x(13,"Enter"))}),e.lastIOSEnter=0)},200)}},et.keyup=function(e,t){16==t.keyCode&&(e.shiftKey=!1)},et.keypress=function(e,t){if(!(pt(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||s.mac&&t.metaKey))if(e.someProp("handleKeyPress",function(n){return n(e,t)}))t.preventDefault();else{var n=e.state.selection;if(!(n instanceof r.TextSelection&&n.$from.sameParent(n.$to))){var i=String.fromCharCode(t.charCode);e.someProp("handleTextInput",function(t){return t(e,n.$from.pos,n.$to.pos,i)})||e.dispatch(e.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}}};var ut=s.mac?"metaKey":"ctrlKey";Qe.mousedown=function(e,t){e.shiftKey=t.shiftKey;var n=ct(e),r=Date.now(),i="singleClick";r-e.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(t,e.lastClick)&&!t[ut]&&("singleClick"==e.lastClick.type?i="doubleClick":"doubleClick"==e.lastClick.type&&(i="tripleClick")),e.lastClick={time:r,x:t.clientX,y:t.clientY,type:i};var o=e.posAtCoords(it(t));o&&("singleClick"==i?e.mouseDown=new ht(e,o,t,n):("doubleClick"==i?at:lt)(e,o.pos,o.inside,t)?t.preventDefault():tt(e,"pointer"))};var ht=function(e,t,n,i){var o,a,l=this;if(this.view=e,this.startDoc=e.state.doc,this.pos=t,this.event=n,this.flushed=i,this.selectNode=n[ut],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),a=t.inside;else{var c=e.state.doc.resolve(t.pos);o=c.parent,a=c.depth?c.before():0}this.mightDrag=null;var u=i?null:n.target,h=u?e.docView.nearestDesc(u,!0):null;this.target=h?h.dom:null,(o.type.spec.draggable&&!1!==o.type.spec.selectable||e.state.selection instanceof r.NodeSelection&&a==e.state.selection.from)&&(this.mightDrag={node:o,pos:a,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&s.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 l.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),tt(e,"pointer")};function pt(e,t){return!!e.composing||!!(s.safari&&Math.abs(t.timeStamp-e.compositionEndedAt)<500)&&(e.compositionEndedAt=-2e8,!0)}ht.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},ht.prototype.up=function(e){if(this.done(),this.view.dom.contains(3==e.target.nodeType?e.target.parentNode:e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(it(e))),this.allowDefault||!t?tt(this.view,"pointer"):function(e,t,n,i,o){return ot(e,"handleClickOn",t,n,i)||e.someProp("handleClick",function(n){return n(e,t,i)})||(o?function(e,t){if(-1==t)return!1;var n,i,o=e.state.selection;o instanceof r.NodeSelection&&(n=o.node);for(var s=e.state.doc.resolve(t),a=s.depth+1;a>0;a--){var l=a>s.depth?s.nodeAfter:s.node(a);if(r.NodeSelection.isSelectable(l)){i=n&&o.$from.depth>0&&a>=o.$from.depth&&s.before(o.$from.depth+1)==o.$from.pos?s.before(o.$from.depth):s.before(a);break}}return null!=i&&(st(e,r.NodeSelection.create(e.state.doc,i),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),i=n.nodeAfter;return!!(i&&i.isAtom&&r.NodeSelection.isSelectable(i))&&(st(e,new r.NodeSelection(n),"pointer"),!0)}(e,n))}(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():this.flushed||s.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||s.chrome&&!(this.view.state.selection instanceof r.TextSelection)&&(t.pos==this.view.state.selection.from||t.pos==this.view.state.selection.to)?(st(this.view,r.Selection.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):tt(this.view,"pointer")}},ht.prototype.move=function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),tt(this.view,"pointer")},Qe.touchdown=function(e){ct(e),tt(e,"pointer")},Qe.contextmenu=function(e){return ct(e)};var ft=s.android?5e3:-1;function dt(e,t){clearTimeout(e.composingTimeout),t>-1&&(e.composingTimeout=setTimeout(function(){return gt(e)},t))}function mt(e){for(e.composing=!1;e.compositionNodes.length>0;)e.compositionNodes.pop().markParentsDirty()}function gt(e,t){if(e.domObserver.forceFlush(),mt(e),t||e.docView.dirty){var n=fe(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}et.compositionstart=et.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(function(e){return!1===e.type.spec.inclusive})))e.markCursor=e.state.storedMarks||n.marks(),gt(e,!0),e.markCursor=null;else if(gt(e),s.gecko&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.root.getSelection(),i=r.focusNode,o=r.focusOffset;i&&1==i.nodeType&&0!=o;){var a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(3==a.nodeType){r.collapse(a,a.nodeValue.length);break}i=a,o=-1}e.composing=!0}dt(e,ft)},et.compositionend=function(e,t){e.composing&&(e.composing=!1,e.compositionEndedAt=t.timeStamp,dt(e,20))};var vt=s.ie&&s.ie_version<15||s.ios&&s.webkit_version<604;function yt(e,t,n,r){var o=_e(e,t,n,e.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",function(t){return t(e,r,o||i.Ji.empty)}))return!0;if(!o)return!1;var s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),a=s?e.state.tr.replaceSelectionWith(s,e.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Qe.copy=et.cut=function(e,t){var n=e.state.selection,r="cut"==t.type;if(!n.empty){var i=vt?null:t.clipboardData,o=qe(e,n.content()),s=o.dom,a=o.text;i?(t.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",a)):function(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}}(e,s),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},et.paste=function(e,t){var n=vt?null:t.clipboardData;n&&yt(e,n.getData("text/plain"),n.getData("text/html"),t)?t.preventDefault():function(e,t){if(e.dom.parentNode){var n=e.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.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(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?yt(e,r.value,null,t):yt(e,r.textContent,r.innerHTML,t)},50)}}(e,t)};var bt=function(e,t){this.slice=e,this.move=t},kt=s.mac?"altKey":"ctrlKey";for(var wt in Qe.dragstart=function(e,t){var n=e.mouseDown;if(n&&n.done(),t.dataTransfer){var i=e.state.selection,o=i.empty?null:e.posAtCoords(it(t));if(o&&o.pos>=i.from&&o.pos<=(i instanceof r.NodeSelection?i.to-1:i.to));else if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(r.NodeSelection.create(e.state.doc,n.mightDrag.pos)));else if(t.target&&1==t.target.nodeType){var s=e.docView.nearestDesc(t.target,!0);if(!s||!s.node.type.spec.draggable||s==e.docView)return;e.dispatch(e.state.tr.setSelection(r.NodeSelection.create(e.state.doc,s.posBefore)))}var a=e.state.selection.content(),l=qe(e,a),c=l.dom,u=l.text;t.dataTransfer.clearData(),t.dataTransfer.setData(vt?"Text":"text/html",c.innerHTML),vt||t.dataTransfer.setData("text/plain",u),e.dragging=new bt(a,!t[kt])}},Qe.dragend=function(e){var t=e.dragging;window.setTimeout(function(){e.dragging==t&&(e.dragging=null)},50)},et.dragover=et.dragenter=function(e,t){return t.preventDefault()},et.drop=function(e,t){var n=e.dragging;if(e.dragging=null,t.dataTransfer){var s=e.posAtCoords(it(t));if(s){var a=e.state.doc.resolve(s.pos);if(a){var l=n&&n.slice||_e(e,t.dataTransfer.getData(vt?"Text":"text/plain"),vt?null:t.dataTransfer.getData("text/html"),!1,a),c=n&&!t[kt];if(e.someProp("handleDrop",function(n){return n(e,t,l||i.Ji.empty,c)}))t.preventDefault();else if(l){t.preventDefault();var u=l?(0,o.dropPoint)(e.state.doc,a.pos,l):a.pos;null==u&&(u=a.pos);var h=e.state.tr;c&&h.deleteSelection();var p=h.mapping.map(u),f=0==l.openStart&&0==l.openEnd&&1==l.content.childCount,d=h.doc;if(f?h.replaceRangeWith(p,p,l.content.firstChild):h.replaceRange(p,p,l),!h.doc.eq(d)){var m=h.doc.resolve(p);if(f&&r.NodeSelection.isSelectable(l.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(l.content.firstChild))h.setSelection(new r.NodeSelection(m));else{var g=h.mapping.map(u);h.mapping.maps[h.mapping.maps.length-1].forEach(function(e,t,n,r){return g=r}),h.setSelection(xe(e,m,h.doc.resolve(g)))}e.focus(),e.dispatch(h.setMeta("uiEvent","drop"))}}}}}},Qe.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.root.getSelection())&&me(e)},20))},Qe.blur=function(e){e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),e.domObserver.currentSelection.set({}),e.focused=!1)},Qe.beforeinput=function(e,t){if(s.chrome&&s.android&&"deleteContentBackward"==t.inputType){var n=e.domChangeCount;setTimeout(function(){if(e.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",function(t){return t(e,x(8,"Backspace"))}))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}},50)}},et)Qe[wt]=et[wt];function xt(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var Ct=function(e,t){this.spec=t||Et,this.side=this.spec.side||0,this.toDOM=e};Ct.prototype.map=function(e,t,n,r){var i=e.mapResult(t.from+r,this.side<0?-1:1),o=i.pos;return i.deleted?null:new Tt(o-n,o-n,this)},Ct.prototype.valid=function(){return!0},Ct.prototype.eq=function(e){return this==e||e instanceof Ct&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&xt(this.spec,e.spec))};var St=function(e,t){this.spec=t||Et,this.attrs=e};St.prototype.map=function(e,t,n,r){var i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new Tt(i,o,this)},St.prototype.valid=function(e,t){return t.from<t.to},St.prototype.eq=function(e){return this==e||e instanceof St&&xt(this.attrs,e.attrs)&&xt(this.spec,e.spec)},St.is=function(e){return e.type instanceof St};var Nt=function(e,t){this.spec=t||Et,this.attrs=e};Nt.prototype.map=function(e,t,n,r){var i=e.mapResult(t.from+r,1);if(i.deleted)return null;var o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new Tt(i.pos-n,o.pos-n,this)},Nt.prototype.valid=function(e,t){var n=e.content.findIndex(t.from),r=n.index,i=n.offset;return i==t.from&&i+e.child(r).nodeSize==t.to},Nt.prototype.eq=function(e){return this==e||e instanceof Nt&&xt(this.attrs,e.attrs)&&xt(this.spec,e.spec)};var Tt=function(e,t,n){this.from=e,this.to=t,this.type=n},Ot={spec:{configurable:!0},inline:{configurable:!0}};Tt.prototype.copy=function(e,t){return new Tt(e,t,this.type)},Tt.prototype.eq=function(e,t){return void 0===t&&(t=0),this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to},Tt.prototype.map=function(e,t,n){return this.type.map(e,this,t,n)},Tt.widget=function(e,t,n){return new Tt(e,e,new Ct(t,n))},Tt.inline=function(e,t,n,r){return new Tt(e,t,new St(n,r))},Tt.node=function(e,t,n,r){return new Tt(e,t,new Nt(n,r))},Ot.spec.get=function(){return this.type.spec},Ot.inline.get=function(){return this.type instanceof St},Object.defineProperties(Tt.prototype,Ot);var Mt=[],Et={},Dt=function(e,t){this.local=e&&e.length?e:Mt,this.children=t&&t.length?t:Mt};Dt.create=function(e,t){return t.length?Pt(t,e,0,Et):At},Dt.prototype.find=function(e,t,n){var r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r},Dt.prototype.findInner=function(e,t,n,r,i){for(var o=0;o<this.local.length;o++){var s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(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]<t&&this.children[a+1]>e){var l=this.children[a]+1;this.children[a+2].findInner(e-l,t-l,n,r+l,i)}},Dt.prototype.map=function(e,t,n){return this==At||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Et)},Dt.prototype.mapInner=function(e,t,n,r,i){for(var o,s=0;s<this.local.length;s++){var a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){for(var a=e.slice(),l=function(e,t,n,r){for(var s=0;s<a.length;s+=3){var l=a[s+1],c=void 0;-1==l||e>l+o||(t>=a[s]+o?a[s+1]=-1:n>=i&&(c=r-n-(t-e))&&(a[s]+=c,a[s+1]+=c))}},c=0;c<n.maps.length;c++)n.maps[c].forEach(l);for(var u=!1,h=0;h<a.length;h+=3)if(-1==a[h+1]){var p=n.map(e[h]+o),f=p-i;if(f<0||f>=r.content.size){u=!0;continue}var d=n.map(e[h+1]+o,-1)-i,m=r.content.findIndex(f),g=m.index,v=m.offset,y=r.maybeChild(g);if(y&&v==f&&v+y.nodeSize==d){var b=a[h+2].mapInner(n,y,p+1,e[h]+o+1,s);b!=At?(a[h]=f,a[h+1]=d,a[h+2]=b):(a[h+1]=-2,u=!0)}else u=!0}if(u){var k=function(e,t,n,r,i,o,s){function a(e,t){for(var o=0;o<e.local.length;o++){var l=e.local[o].map(r,i,t);l?n.push(l):s.onRemove&&s.onRemove(e.local[o].spec)}for(var c=0;c<e.children.length;c+=3)a(e.children[c+2],e.children[c]+t+1)}for(var l=0;l<e.length;l+=3)-1==e[l+1]&&a(e[l+2],t[l]+o+1);return n}(a,e,t||[],n,i,o,s),w=Pt(k,r,0,s);t=w.local;for(var x=0;x<a.length;x+=3)a[x+1]<0&&(a.splice(x,3),x-=3);for(var C=0,S=0;C<w.children.length;C+=3){for(var N=w.children[C];S<a.length&&a[S]<N;)S+=3;a.splice(S,0,w.children[C],w.children[C+1],w.children[C+2])}}return new Dt(t&&t.sort(Bt),a)}(this.children,o,e,t,n,r,i):o?new Dt(o.sort(Bt)):At},Dt.prototype.add=function(e,t){return t.length?this==At?Dt.create(e,t):this.addInner(e,t,0):this},Dt.prototype.addInner=function(e,t,n){var r,i=this,o=0;e.forEach(function(e,s){var a,l=s+n;if(a=It(t,e,l)){for(r||(r=i.children.slice());o<r.length&&r[o]<s;)o+=3;r[o]==s?r[o+2]=r[o+2].addInner(e,a,l+1):r.splice(o,0,s,s+e.nodeSize,Pt(a,e,l+1,Et)),o+=3}});for(var s=Rt(o?Ft(t):t,-n),a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Dt(s.length?this.local.concat(s).sort(Bt):this.local,r||this.children)},Dt.prototype.remove=function(e){return 0==e.length||this==At?this:this.removeInner(e,0)},Dt.prototype.removeInner=function(e,t){for(var n=this.children,r=this.local,i=0;i<n.length;i+=3){for(var o=void 0,s=n[i]+t,a=n[i+1]+t,l=0,c=void 0;l<e.length;l++)(c=e[l])&&c.from>s&&c.to<a&&(e[l]=null,(o||(o=[])).push(c));if(o){n==this.children&&(n=this.children.slice());var u=n[i+2].removeInner(o,s+1);u!=At?n[i+2]=u:(n.splice(i,3),i-=3)}}if(r.length)for(var h=0,p=void 0;h<e.length;h++)if(p=e[h])for(var f=0;f<r.length;f++)r[f].eq(p,t)&&(r==this.local&&(r=this.local.slice()),r.splice(f--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Dt(r,n):At},Dt.prototype.forChild=function(e,t){if(this==At)return this;if(t.isLeaf)return Dt.empty;for(var n,r,i=0;i<this.children.length;i+=3)if(this.children[i]>=e){this.children[i]==e&&(n=this.children[i+2]);break}for(var o=e+1,s=o+t.content.size,a=0;a<this.local.length;a++){var l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof St){var c=Math.max(o,l.from)-o,u=Math.min(s,l.to)-o;c<u&&(r||(r=[])).push(l.copy(c,u))}}if(r){var h=new Dt(r.sort(Bt));return n?new Lt([h,n]):h}return n||At},Dt.prototype.eq=function(e){if(this==e)return!0;if(!(e instanceof Dt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(var t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(var n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0},Dt.prototype.locals=function(e){return zt(this.localsInner(e))},Dt.prototype.localsInner=function(e){if(this==At)return Mt;if(e.inlineContent||!this.local.some(St.is))return this.local;for(var t=[],n=0;n<this.local.length;n++)this.local[n].type instanceof St||t.push(this.local[n]);return t};var At=new Dt;Dt.empty=At,Dt.removeOverlap=zt;var Lt=function(e){this.members=e};function Rt(e,t){if(!t||!e.length)return e;for(var n=[],r=0;r<e.length;r++){var i=e[r];n.push(new Tt(i.from+t,i.to+t,i.type))}return n}function It(e,t,n){if(t.isLeaf)return null;for(var r=n+t.nodeSize,i=null,o=0,s=void 0;o<e.length;o++)(s=e[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),e[o]=null);return i}function Ft(e){for(var t=[],n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Pt(e,t,n,r){var i=[],o=!1;t.forEach(function(t,s){var a=It(e,t,s+n);if(a){o=!0;var l=Pt(a,t,n+s+1,r);l!=At&&i.push(s,s+t.nodeSize,l)}});for(var s=Rt(o?Ft(e):e,-n).sort(Bt),a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Dt(s,i):At}function Bt(e,t){return e.from-t.from||e.to-t.to}function zt(e){for(var t=e,n=0;n<t.length-1;n++){var r=t[n];if(r.from!=r.to)for(var i=n+1;i<t.length;i++){var o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),qt(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),qt(t,i+1,o.copy(r.to,o.to)))}}return t}function qt(e,t,n){for(;t<e.length&&Bt(n,e[t])>0;)t++;e.splice(t,0,n)}function _t(e){var t=[];return e.someProp("decorations",function(n){var r=n(e.state);r&&r!=At&&t.push(r)}),e.cursorWrapper&&t.push(Dt.create(e.state.doc,[e.cursorWrapper.deco])),Lt.from(t)}Lt.prototype.forChild=function(e,t){if(t.isLeaf)return Dt.empty;for(var n=[],r=0;r<this.members.length;r++){var i=this.members[r].forChild(e,t);i!=At&&(i instanceof Lt?n=n.concat(i.members):n.push(i))}return Lt.from(n)},Lt.prototype.eq=function(e){if(!(e instanceof Lt)||e.members.length!=this.members.length)return!1;for(var t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0},Lt.prototype.locals=function(e){for(var t,n=!0,r=0;r<this.members.length;r++){var i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(var o=0;o<i.length;o++)t.push(i[o])}else t=i}return t?zt(n?t:t.sort(Bt)):Mt},Lt.from=function(e){switch(e.length){case 0:return At;case 1:return e[0];default:return new Lt(e)}};var jt=function(e,t){this._props=t,this.state=t.state,this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):e.apply?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Ut(this),this.markCursor=null,this.cursorWrapper=null,$t(this),this.nodeViews=Jt(this),this.docView=X(this.state.doc,Vt(this),_t(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,function(e){e.shiftKey=!1,e.mouseDown=null,e.lastKeyCode=null,e.lastKeyCodeTime=0,e.lastClick={time:0,x:0,y:0,type:""},e.lastSelectionOrigin=null,e.lastSelectionTime=0,e.lastIOSEnter=0,e.lastIOSEnterFallbackTimeout=null,e.composing=!1,e.composingTimeout=null,e.compositionNodes=[],e.compositionEndedAt=-2e8,e.domObserver=new Xe(e,function(t,n,o,a){return function(e,t,n,o,a){if(t<0){var l=e.lastSelectionTime>Date.now()-50?e.lastSelectionOrigin:null,c=fe(e,l);if(c&&!e.state.selection.eq(c)){var u=e.state.tr.setSelection(c);"pointer"==l?u.setMeta("pointer",!0):"key"==l&&u.scrollIntoView(),e.dispatch(u)}}else{var h=e.state.doc.resolve(t),p=h.sharedDepth(n);t=h.before(p+1),n=e.state.doc.resolve(n).after(p+1);var f=e.state.selection,d=function(e,t,n){var r=e.docView.parseRange(t,n),o=r.node,a=r.fromOffset,l=r.toOffset,c=r.from,u=r.to,h=e.root.getSelection(),p=null,f=h.anchorNode;if(f&&e.dom.contains(1==f.nodeType?f:f.parentNode)&&(p=[{node:f,offset:h.anchorOffset}],w(h)||p.push({node:h.focusNode,offset:h.focusOffset})),s.chrome&&8===e.lastKeyCode)for(var d=l;d>a;d--){var m=o.childNodes[d-1],g=m.pmViewDesc;if("BR"==m.nodeType&&!g){l=d;break}if(!g||g.size)break}var v=e.state.doc,y=e.someProp("domParser")||i.S4.fromSchema(e.state.schema),b=v.resolve(c),k=null,x=y.parse(o,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:a,to:l,preserveWhitespace:!b.parent.type.spec.code||"full",editableContent:!0,findPositions:p,ruleFromNode:Pe,context:b});if(p&&null!=p[0].pos){var C=p[0].pos,S=p[1]&&p[1].pos;null==S&&(S=C),k={anchor:C+c,head:S+c}}return{doc:x,sel:k,from:c,to:u}}(e,t,n);if(s.chrome&&e.cursorWrapper&&d.sel&&d.sel.anchor==e.cursorWrapper.deco.from){var m=e.cursorWrapper.deco.type.toDOM.nextSibling,g=m&&m.nodeValue?m.nodeValue.length:1;d.sel={anchor:d.sel.anchor+g,head:d.sel.anchor+g}}var v,y,b=e.state.doc,k=b.slice(d.from,d.to);8===e.lastKeyCode&&Date.now()-100<e.lastKeyCodeTime?(v=e.state.selection.to,y="end"):(v=e.state.selection.from,y="start"),e.lastKeyCode=null;var C=function(e,t,n,r,i){var o=e.findDiffStart(t,n);if(null==o)return null;var s=e.findDiffEnd(t,n+e.size,n+t.size),a=s.a,l=s.b;return"end"==i&&(r-=a+Math.max(0,o-Math.min(a,l))-o),a<o&&e.size<t.size?(l=(o-=r<=o&&r>=a?o-r:0)+(l-a),a=o):l<o&&(a=(o-=r<=o&&r>=l?o-r:0)+(a-l),l=o),{start:o,endA:a,endB:l}}(k.content,d.doc.content,d.from,v,y);if(!C){if(!(o&&f instanceof r.TextSelection&&!f.empty&&f.$head.sameParent(f.$anchor))||e.composing||d.sel&&d.sel.anchor!=d.sel.head){if(s.ios&&e.lastIOSEnter>Date.now()-225&&a.some(function(e){return"DIV"==e.nodeName||"P"==e.nodeName})&&e.someProp("handleKeyDown",function(t){return t(e,x(13,"Enter"))}))return void(e.lastIOSEnter=0);if(d.sel){var S=Be(e,e.state.doc,d.sel);S&&!S.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(S))}return}C={start:f.from,endA:f.to,endB:f.to}}e.domChangeCount++,e.state.selection.from<e.state.selection.to&&C.start==C.endB&&e.state.selection instanceof r.TextSelection&&(C.start>e.state.selection.from&&C.start<=e.state.selection.from+2?C.start=e.state.selection.from:C.endA<e.state.selection.to&&C.endA>=e.state.selection.to-2&&(C.endB+=e.state.selection.to-C.endA,C.endA=e.state.selection.to)),s.ie&&s.ie_version<=11&&C.endB==C.start+1&&C.endA==C.start&&C.start>d.from&&" "==d.doc.textBetween(C.start-d.from-1,C.start-d.from+1)&&(C.start--,C.endA--,C.endB--);var N,T=d.doc.resolveNoCache(C.start-d.from),O=d.doc.resolveNoCache(C.endB-d.from),M=T.sameParent(O)&&T.parent.inlineContent;if((s.ios&&e.lastIOSEnter>Date.now()-225&&(!M||a.some(function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))||!M&&T.pos<d.doc.content.size&&(N=r.Selection.findFrom(d.doc.resolve(T.pos+1),1,!0))&&N.head==O.pos)&&e.someProp("handleKeyDown",function(t){return t(e,x(13,"Enter"))}))e.lastIOSEnter=0;else if(e.state.selection.anchor>C.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||ze(r,!0,!1)<i.pos)return!1;var o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;var s=e.resolve(ze(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||ze(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(b,C.start,C.endA,T,O)&&e.someProp("handleKeyDown",function(t){return t(e,x(8,"Backspace"))}))s.android&&s.chrome&&e.domObserver.suppressSelectionUpdates();else{s.android&&!M&&T.start()!=O.start()&&0==O.parentOffset&&T.depth==O.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==C.endA&&(C.endB-=2,O=d.doc.resolveNoCache(C.endB-d.from),setTimeout(function(){e.someProp("handleKeyDown",function(t){return t(e,x(13,"Enter"))})},20));var E,D,A,L,R=C.start,I=C.endA;if(M)if(T.pos==O.pos)s.ie&&s.ie_version<=11&&0==T.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(function(){return me(e)},20)),E=e.state.tr.delete(R,I),D=b.resolve(C.start).marksAcross(b.resolve(C.endA));else if(C.endA==C.endB&&(L=b.resolve(C.start))&&(A=function(e,t){for(var n,r,o,s=e.firstChild.marks,a=t.firstChild.marks,l=s,c=a,u=0;u<a.length;u++)l=a[u].removeFromSet(l);for(var h=0;h<s.length;h++)c=s[h].removeFromSet(c);if(1==l.length&&0==c.length)r=l[0],n="add",o=function(e){return e.mark(r.addToSet(e.marks))};else{if(0!=l.length||1!=c.length)return null;r=c[0],n="remove",o=function(e){return e.mark(r.removeFromSet(e.marks))}}for(var p=[],f=0;f<t.childCount;f++)p.push(o(t.child(f)));if(i.FK.from(p).eq(e))return{mark:r,type:n}}(T.parent.content.cut(T.parentOffset,O.parentOffset),L.parent.content.cut(L.parentOffset,C.endA-L.start()))))E=e.state.tr,"add"==A.type?E.addMark(R,I,A.mark):E.removeMark(R,I,A.mark);else if(T.parent.child(T.index()).isText&&T.index()==O.index()-(O.textOffset?0:1)){var F=T.parent.textBetween(T.parentOffset,O.parentOffset);if(e.someProp("handleTextInput",function(t){return t(e,R,I,F)}))return;E=e.state.tr.insertText(F,R,I)}if(E||(E=e.state.tr.replace(R,I,d.doc.slice(C.start-d.from,C.endB-d.from))),d.sel){var P=Be(e,E.doc,d.sel);P&&!(s.chrome&&s.android&&e.composing&&P.empty&&(P.head==R||P.head==E.mapping.map(I)-1)||s.ie&&P.empty&&P.head==R)&&E.setSelection(P)}D&&E.ensureMarks(D),e.dispatch(E.scrollIntoView())}}}(e,t,n,o,a)}),e.domObserver.start(),e.domChangeCount=0,e.eventHandlers=Object.create(null);var t=function(t){var n=Qe[t];e.dom.addEventListener(t,e.eventHandlers[t]=function(t){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||rt(e,t)||!e.editable&&t.type in et||n(e,t)})};for(var n in Qe)t(n);s.safari&&e.dom.addEventListener("input",function(){return null}),nt(e)}(this),this.pluginViews=[],this.updatePluginViews()},Ht={props:{configurable:!0},root:{configurable:!0}};function Vt(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var r in n)"class"==r?t.class+=" "+n[r]:t[r]||"contenteditable"==r||"nodeName"==r||(t[r]=String(n[r]))}),[Tt.node(0,e.state.doc.content.size,t)]}function $t(e){if(e.markCursor){var t=document.createElement("img");t.setAttribute("mark-placeholder","true"),e.cursorWrapper={dom:t,deco:Tt.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Ut(e){return!e.someProp("editable",function(t){return!1===t(e.state)})}function Jt(e){var t={};return e.someProp("nodeViews",function(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}),t}Ht.props.get=function(){if(this._props.state!=this.state){var e=this._props;for(var t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props},jt.prototype.update=function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&nt(this),this._props=e,this.updateStateInner(e.state,!0)},jt.prototype.setProps=function(e){var t={};for(var n in this._props)t[n]=this._props[n];for(var r in t.state=this.state,e)t[r]=e[r];this.update(t)},jt.prototype.updateState=function(e){this.updateStateInner(e,this.state.plugins!=e.plugins)},jt.prototype.updateStateInner=function(e,t){var n=this,i=this.state,o=!1,a=!1;if(e.storedMarks&&this.composing&&(mt(this),a=!0),this.state=e,t){var l=Jt(this);(function(e,t){var n=0,r=0;for(var i in e){if(e[i]!=t[i])return!0;n++}for(var o in t)r++;return n!=r})(l,this.nodeViews)&&(this.nodeViews=l,o=!0),nt(this)}this.editable=Ut(this),$t(this);var c=_t(this),u=Vt(this),h=t?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",p=o||!this.docView.matchesNode(e.doc,u,c);!p&&e.selection.eq(i.selection)||(a=!0);var f,d,m,v,y,b,k,w,x,C,S="preserve"==h&&a&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top),o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){var a=e.root.elementFromPoint(o,s);if(a!=e.dom&&e.dom.contains(a)){var l=a.getBoundingClientRect();if(l.top>=i-20){t=a,n=l.top;break}}}return{refDOM:t,refTop:n,stack:O(e.dom)}}(this);if(a){this.domObserver.stop();var N=p&&(s.ie||s.chrome)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&(v=i.selection,y=e.selection,b=Math.min(v.$anchor.sharedDepth(v.head),y.$anchor.sharedDepth(y.head)),v.$anchor.start(b)!=y.$anchor.start(b));if(p){var E=s.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!o&&this.docView.update(e.doc,u,c,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=X(e.doc,u,c,this.dom,this)),E&&!this.trackWrites&&(N=!0)}N||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(f=this,d=f.docView.domFromPos(f.state.selection.anchor,0),m=f.root.getSelection(),g(d.node,d.offset,m.anchorNode,m.anchorOffset)))?me(this,N):(ke(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(i),"reset"==h)this.dom.scrollTop=0;else if("to selection"==h){var D=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",function(e){return e(n)})||(e.selection instanceof r.NodeSelection?T(this,this.docView.domAfterPos(e.selection.from).getBoundingClientRect(),D):T(this,this.coordsAtPos(e.selection.head,1),D))}else S&&(w=(k=S).refDOM,x=k.refTop,M(k.stack,0==(C=w?w.getBoundingClientRect().top:0)?0:C-x))},jt.prototype.destroyPluginViews=function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()},jt.prototype.updatePluginViews=function(e){if(e&&e.plugins==this.state.plugins)for(var t=0;t<this.pluginViews.length;t++){var n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.destroyPluginViews();for(var r=0;r<this.state.plugins.length;r++){var i=this.state.plugins[r];i.spec.view&&this.pluginViews.push(i.spec.view(this))}}},jt.prototype.someProp=function(e,t){var n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;var i=this.state.plugins;if(i)for(var o=0;o<i.length;o++){var s=i[o].props[e];if(null!=s&&(n=t?t(s):s))return n}},jt.prototype.hasFocus=function(){return this.root.activeElement==this.dom},jt.prototype.focus=function(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(E)return e.focus(E);var t=O(e);e.focus(null==E?{get preventScroll(){return E={preventScroll:!0},!0}}:void 0),E||(E=!1,M(t,0))}(this.dom),me(this),this.domObserver.start()},Ht.root.get=function(){var e=this._root;if(null==e)for(var t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=function(){return document.getSelection()}),this._root=t;return e||document},jt.prototype.posAtCoords=function(e){return R(this,e)},jt.prototype.coordsAtPos=function(e,t){return void 0===t&&(t=1),P(this,e,t)},jt.prototype.domAtPos=function(e,t){return void 0===t&&(t=0),this.docView.domFromPos(e,t)},jt.prototype.nodeDOM=function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null},jt.prototype.posAtDOM=function(e,t,n){void 0===n&&(n=-1);var r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r},jt.prototype.endOfTextblock=function(e,t){return function(e,t,n){return j==t&&H==n?V:(j=t,H=n,V="up"==n||"down"==n?function(e,t,n){var r=t.selection,i="up"==n?r.$from:r.$to;return q(e,t,function(){for(var t=e.docView.domFromPos(i.pos,"up"==n?-1:1).node;;){var r=e.docView.nearestDesc(t,!0);if(!r)break;if(r.node.isBlock){t=r.dom;break}t=r.dom.parentNode}for(var o=P(e,i.pos,1),s=t.firstChild;s;s=s.nextSibling){var a=void 0;if(1==s.nodeType)a=s.getClientRects();else{if(3!=s.nodeType)continue;a=m(s,0,s.nodeValue.length).getClientRects()}for(var l=0;l<a.length;l++){var c=a[l];if(c.bottom>c.top&&("up"==n?c.bottom<o.top+1:c.top>o.bottom-1))return!1}}return!0})}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=getSelection();return _.test(r.parent.textContent)&&a.modify?q(e,t,function(){var t=a.getRangeAt(0),i=a.focusNode,o=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");var l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||i==a.focusNode&&o==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l}):"left"==n||"backward"==n?o:s}(e,t,n))}(this,t||this.state,e)},jt.prototype.destroy=function(){this.docView&&(function(e){for(var t in e.domObserver.stop(),e.eventHandlers)e.dom.removeEventListener(t,e.eventHandlers[t]);clearTimeout(e.composingTimeout),clearTimeout(e.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],_t(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},jt.prototype.dispatchEvent=function(e){return function(e,t){rt(e,t)||!Qe[t.type]||!e.editable&&t.type in et||Qe[t.type](e,t)}(this,e)},jt.prototype.dispatch=function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))},Object.defineProperties(jt.prototype,Ht)},504(e,t,n){var r;self,r=function(e,t,n,r,i){return function(){var o={651:function(e){e.exports=function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(e,r,i){return n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,n,r){var i=[null];i.push.apply(i,n);var o=new(Function.bind.apply(e,i));return r&&t(o,r.prototype),o},n.apply(null,arguments)}function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o=Object.hasOwnProperty,s=Object.setPrototypeOf,a=Object.isFrozen,l=Object.getPrototypeOf,c=Object.getOwnPropertyDescriptor,u=Object.freeze,h=Object.seal,p=Object.create,f="undefined"!=typeof Reflect&&Reflect,d=f.apply,m=f.construct;d||(d=function(e,t,n){return e.apply(t,n)}),u||(u=function(e){return e}),h||(h=function(e){return e}),m||(m=function(e,t){return n(e,r(t))});var g,v=M(Array.prototype.forEach),y=M(Array.prototype.pop),b=M(Array.prototype.push),k=M(String.prototype.toLowerCase),w=M(String.prototype.toString),x=M(String.prototype.match),C=M(String.prototype.replace),S=M(String.prototype.indexOf),N=M(String.prototype.trim),T=M(RegExp.prototype.test),O=(g=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m(g,t)});function M(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return d(e,t,r)}}function E(e,t,n){var r;n=null!==(r=n)&&void 0!==r?r:k,s&&s(e,null);for(var i=t.length;i--;){var o=t[i];if("string"==typeof o){var l=n(o);l!==o&&(a(t)||(t[i]=l),o=l)}e[o]=!0}return e}function D(e){var t,n=p(null);for(t in e)!0===d(o,e,[t])&&(n[t]=e[t]);return n}function A(e,t){for(;null!==e;){var n=c(e,t);if(n){if(n.get)return M(n.get);if("function"==typeof n.value)return M(n.value)}e=l(e)}return function(e){return console.warn("fallback value for",e),null}}var L=u(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),R=u(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),I=u(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),F=u(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),P=u(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),B=u(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),z=u(["#text"]),q=u(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),_=u(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),j=u(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),H=u(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),V=h(/\{\{[\w\W]*|[\w\W]*\}\}/gm),$=h(/<%[\w\W]*|[\w\W]*%>/gm),U=h(/\${[\w\W]*}/gm),J=h(/^data-[\-\w.\u00B7-\uFFFF]+$/),W=h(/^aria-[\-\w]+$/),K=h(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),G=h(/^(?:\w+script|data):/i),Z=h(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),X=h(/^html$/i),Y=h(/^[a-z][.\w]*(-[.\w]+)+$/i),Q=function(){return"undefined"==typeof window?null:window};return function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q(),i=function(e){return t(e)};if(i.version="2.5.8",i.removed=[],!n||!n.document||9!==n.document.nodeType)return i.isSupported=!1,i;var o=n.document,s=n.document,a=n.DocumentFragment,l=n.HTMLTemplateElement,c=n.Node,h=n.Element,p=n.NodeFilter,f=n.NamedNodeMap,d=void 0===f?n.NamedNodeMap||n.MozNamedAttrMap:f,m=n.HTMLFormElement,g=n.DOMParser,M=n.trustedTypes,ee=h.prototype,te=A(ee,"cloneNode"),ne=A(ee,"nextSibling"),re=A(ee,"childNodes"),ie=A(ee,"parentNode");if("function"==typeof l){var oe=s.createElement("template");oe.content&&oe.content.ownerDocument&&(s=oe.content.ownerDocument)}var se=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null,i="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(i)&&(r=n.currentScript.getAttribute(i));var o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(M,o),ae=se?se.createHTML(""):"",le=s,ce=le.implementation,ue=le.createNodeIterator,he=le.createDocumentFragment,pe=le.getElementsByTagName,fe=o.importNode,de={};try{de=D(s).documentMode?s.documentMode:{}}catch(e){}var me={};i.isSupported="function"==typeof ie&&ce&&void 0!==ce.createHTMLDocument&&9!==de;var ge,ve,ye=V,be=$,ke=U,we=J,xe=W,Ce=G,Se=Z,Ne=Y,Te=K,Oe=null,Me=E({},[].concat(r(L),r(R),r(I),r(P),r(z))),Ee=null,De=E({},[].concat(r(q),r(_),r(j),r(H))),Ae=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Le=null,Re=null,Ie=!0,Fe=!0,Pe=!1,Be=!0,ze=!1,qe=!0,_e=!1,je=!1,He=!1,Ve=!1,$e=!1,Ue=!1,Je=!0,We=!1,Ke=!0,Ge=!1,Ze={},Xe=null,Ye=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Qe=null,et=E({},["audio","video","img","source","image","track"]),tt=null,nt=E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rt="http://www.w3.org/1998/Math/MathML",it="http://www.w3.org/2000/svg",ot="http://www.w3.org/1999/xhtml",st=ot,at=!1,lt=null,ct=E({},[rt,it,ot],w),ut=["application/xhtml+xml","text/html"],ht=null,pt=s.createElement("form"),ft=function(e){return e instanceof RegExp||e instanceof Function},dt=function(t){ht&&ht===t||(t&&"object"===e(t)||(t={}),t=D(t),ge=ge=-1===ut.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,ve="application/xhtml+xml"===ge?w:k,Oe="ALLOWED_TAGS"in t?E({},t.ALLOWED_TAGS,ve):Me,Ee="ALLOWED_ATTR"in t?E({},t.ALLOWED_ATTR,ve):De,lt="ALLOWED_NAMESPACES"in t?E({},t.ALLOWED_NAMESPACES,w):ct,tt="ADD_URI_SAFE_ATTR"in t?E(D(nt),t.ADD_URI_SAFE_ATTR,ve):nt,Qe="ADD_DATA_URI_TAGS"in t?E(D(et),t.ADD_DATA_URI_TAGS,ve):et,Xe="FORBID_CONTENTS"in t?E({},t.FORBID_CONTENTS,ve):Ye,Le="FORBID_TAGS"in t?E({},t.FORBID_TAGS,ve):{},Re="FORBID_ATTR"in t?E({},t.FORBID_ATTR,ve):{},Ze="USE_PROFILES"in t&&t.USE_PROFILES,Ie=!1!==t.ALLOW_ARIA_ATTR,Fe=!1!==t.ALLOW_DATA_ATTR,Pe=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Be=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,ze=t.SAFE_FOR_TEMPLATES||!1,qe=!1!==t.SAFE_FOR_XML,_e=t.WHOLE_DOCUMENT||!1,Ve=t.RETURN_DOM||!1,$e=t.RETURN_DOM_FRAGMENT||!1,Ue=t.RETURN_TRUSTED_TYPE||!1,He=t.FORCE_BODY||!1,Je=!1!==t.SANITIZE_DOM,We=t.SANITIZE_NAMED_PROPS||!1,Ke=!1!==t.KEEP_CONTENT,Ge=t.IN_PLACE||!1,Te=t.ALLOWED_URI_REGEXP||Te,st=t.NAMESPACE||ot,Ae=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&ft(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ae.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ft(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ae.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ae.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ze&&(Fe=!1),$e&&(Ve=!0),Ze&&(Oe=E({},r(z)),Ee=[],!0===Ze.html&&(E(Oe,L),E(Ee,q)),!0===Ze.svg&&(E(Oe,R),E(Ee,_),E(Ee,H)),!0===Ze.svgFilters&&(E(Oe,I),E(Ee,_),E(Ee,H)),!0===Ze.mathMl&&(E(Oe,P),E(Ee,j),E(Ee,H))),t.ADD_TAGS&&(Oe===Me&&(Oe=D(Oe)),E(Oe,t.ADD_TAGS,ve)),t.ADD_ATTR&&(Ee===De&&(Ee=D(Ee)),E(Ee,t.ADD_ATTR,ve)),t.ADD_URI_SAFE_ATTR&&E(tt,t.ADD_URI_SAFE_ATTR,ve),t.FORBID_CONTENTS&&(Xe===Ye&&(Xe=D(Xe)),E(Xe,t.FORBID_CONTENTS,ve)),Ke&&(Oe["#text"]=!0),_e&&E(Oe,["html","head","body"]),Oe.table&&(E(Oe,["tbody"]),delete Le.tbody),u&&u(t),ht=t)},mt=E({},["mi","mo","mn","ms","mtext"]),gt=E({},["annotation-xml"]),vt=E({},["title","style","font","a","script"]),yt=E({},R);E(yt,I),E(yt,F);var bt=E({},P);E(bt,B);var kt=function(e){b(i.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ae}catch(t){e.remove()}}},wt=function(e,t){try{b(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){b(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Ee[e])if(Ve||$e)try{kt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},xt=function(e){var t,n;if(He)e="<remove></remove>"+e;else{var r=x(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ge&&st===ot&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=se?se.createHTML(e):e;if(st===ot)try{t=(new g).parseFromString(i,ge)}catch(e){}if(!t||!t.documentElement){t=ce.createDocument(st,"template",null);try{t.documentElement.innerHTML=at?ae:i}catch(e){}}var o=t.body||t.documentElement;return e&&n&&o.insertBefore(s.createTextNode(n),o.childNodes[0]||null),st===ot?pe.call(t,_e?"html":"body")[0]:_e?t.documentElement:o},Ct=function(e){return ue.call(e.ownerDocument||e,e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null,!1)},St=function(e){return e instanceof m&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Nt=function(t){return"object"===e(c)?t instanceof c:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},Tt=function(e,t,n){me[e]&&v(me[e],function(e){e.call(i,t,n,ht)})},Ot=function(e){var t;if(Tt("beforeSanitizeElements",e,null),St(e))return kt(e),!0;if(T(/[\u0080-\uFFFF]/,e.nodeName))return kt(e),!0;var n=ve(e.nodeName);if(Tt("uponSanitizeElement",e,{tagName:n,allowedTags:Oe}),e.hasChildNodes()&&!Nt(e.firstElementChild)&&(!Nt(e.content)||!Nt(e.content.firstElementChild))&&T(/<[/\w]/g,e.innerHTML)&&T(/<[/\w]/g,e.textContent))return kt(e),!0;if("select"===n&&T(/<template/i,e.innerHTML))return kt(e),!0;if(7===e.nodeType)return kt(e),!0;if(qe&&8===e.nodeType&&T(/<[/\w]/g,e.data))return kt(e),!0;if(!Oe[n]||Le[n]){if(!Le[n]&&Et(n)){if(Ae.tagNameCheck instanceof RegExp&&T(Ae.tagNameCheck,n))return!1;if(Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(n))return!1}if(Ke&&!Xe[n]){var r=ie(e)||e.parentNode,o=re(e)||e.childNodes;if(o&&r)for(var s=o.length-1;s>=0;--s){var a=te(o[s],!0);a.__removalCount=(e.__removalCount||0)+1,r.insertBefore(a,ne(e))}}return kt(e),!0}return e instanceof h&&!function(e){var t=ie(e);t&&t.tagName||(t={namespaceURI:st,tagName:"template"});var n=k(e.tagName),r=k(t.tagName);return!!lt[e.namespaceURI]&&(e.namespaceURI===it?t.namespaceURI===ot?"svg"===n:t.namespaceURI===rt?"svg"===n&&("annotation-xml"===r||mt[r]):Boolean(yt[n]):e.namespaceURI===rt?t.namespaceURI===ot?"math"===n:t.namespaceURI===it?"math"===n&>[r]:Boolean(bt[n]):e.namespaceURI===ot?!(t.namespaceURI===it&&!gt[r])&&!(t.namespaceURI===rt&&!mt[r])&&!bt[n]&&(vt[n]||!yt[n]):!("application/xhtml+xml"!==ge||!lt[e.namespaceURI]))}(e)?(kt(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!T(/<\/no(script|embed|frames)/i,e.innerHTML)?(ze&&3===e.nodeType&&(t=e.textContent,t=C(t,ye," "),t=C(t,be," "),t=C(t,ke," "),e.textContent!==t&&(b(i.removed,{element:e.cloneNode()}),e.textContent=t)),Tt("afterSanitizeElements",e,null),!1):(kt(e),!0)},Mt=function(e,t,n){if(Je&&("id"===t||"name"===t)&&(n in s||n in pt))return!1;if(Fe&&!Re[t]&&T(we,t));else if(Ie&&T(xe,t));else if(!Ee[t]||Re[t]){if(!(Et(e)&&(Ae.tagNameCheck instanceof RegExp&&T(Ae.tagNameCheck,e)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(e))&&(Ae.attributeNameCheck instanceof RegExp&&T(Ae.attributeNameCheck,t)||Ae.attributeNameCheck instanceof Function&&Ae.attributeNameCheck(t))||"is"===t&&Ae.allowCustomizedBuiltInElements&&(Ae.tagNameCheck instanceof RegExp&&T(Ae.tagNameCheck,n)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(n))))return!1}else if(tt[t]);else if(T(Te,C(n,Se,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==S(n,"data:")||!Qe[e])if(Pe&&!T(Ce,C(n,Se,"")));else if(n)return!1;return!0},Et=function(e){return"annotation-xml"!==e&&x(e,Ne)},Dt=function(t){var n,r,o,s;Tt("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a&&!St(t)){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ee};for(s=a.length;s--;){var c=n=a[s],u=c.name,h=c.namespaceURI;if(r="value"===u?n.value:N(n.value),o=ve(u),l.attrName=o,l.attrValue=r,l.keepAttr=!0,l.forceKeepAttr=void 0,Tt("uponSanitizeAttribute",t,l),r=l.attrValue,!l.forceKeepAttr&&(wt(u,t),l.keepAttr))if(Be||!T(/\/>/i,r)){ze&&(r=C(r,ye," "),r=C(r,be," "),r=C(r,ke," "));var p=ve(t.nodeName);if(Mt(p,o,r))if(!We||"id"!==o&&"name"!==o||(wt(u,t),r="user-content-"+r),qe&&T(/((--!?|])>)|<\/(style|title)/i,r))wt(u,t);else{if(se&&"object"===e(M)&&"function"==typeof M.getAttributeType)if(h);else switch(M.getAttributeType(p,o)){case"TrustedHTML":r=se.createHTML(r);break;case"TrustedScriptURL":r=se.createScriptURL(r)}try{h?t.setAttributeNS(h,u,r):t.setAttribute(u,r),St(t)?kt(t):y(i.removed)}catch(e){}}}else wt(u,t)}Tt("afterSanitizeAttributes",t,null)}},At=function e(t){var n,r=Ct(t);for(Tt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Tt("uponSanitizeShadowNode",n,null),Ot(n),Dt(n),n.content instanceof a&&e(n.content);Tt("afterSanitizeShadowDOM",t,null)};return i.sanitize=function(t){var r,s,l,u,h,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((at=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Nt(t)){if("function"!=typeof t.toString)throw O("toString is not a function");if("string"!=typeof(t=t.toString()))throw O("dirty is not a string, aborting")}if(!i.isSupported){if("object"===e(n.toStaticHTML)||"function"==typeof n.toStaticHTML){if("string"==typeof t)return n.toStaticHTML(t);if(Nt(t))return n.toStaticHTML(t.outerHTML)}return t}if(je||dt(p),i.removed=[],"string"==typeof t&&(Ge=!1),Ge){if(t.nodeName){var f=ve(t.nodeName);if(!Oe[f]||Le[f])throw O("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof c)1===(s=(r=xt("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?r=s:r.appendChild(s);else{if(!Ve&&!ze&&!_e&&-1===t.indexOf("<"))return se&&Ue?se.createHTML(t):t;if(!(r=xt(t)))return Ve?null:Ue?ae:""}r&&He&&kt(r.firstChild);for(var d=Ct(Ge?t:r);l=d.nextNode();)3===l.nodeType&&l===u||(Ot(l),Dt(l),l.content instanceof a&&At(l.content),u=l);if(u=null,Ge)return t;if(Ve){if($e)for(h=he.call(r.ownerDocument);r.firstChild;)h.appendChild(r.firstChild);else h=r;return(Ee.shadowroot||Ee.shadowrootmod)&&(h=fe.call(o,h,!0)),h}var m=_e?r.outerHTML:r.innerHTML;return _e&&Oe["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&T(X,r.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+m),ze&&(m=C(m,ye," "),m=C(m,be," "),m=C(m,ke," ")),se&&Ue?se.createHTML(m):m},i.setConfig=function(e){dt(e),je=!0},i.clearConfig=function(){ht=null,je=!1},i.isValidAttribute=function(e,t,n){ht||dt({});var r=ve(e),i=ve(t);return Mt(r,i,n)},i.addHook=function(e,t){"function"==typeof t&&(me[e]=me[e]||[],b(me[e],t))},i.removeHook=function(e){if(me[e])return y(me[e])},i.removeHooks=function(e){me[e]&&(me[e]=[])},i.removeAllHooks=function(){me={}},i}()}()},388:function(t){t.exports=e},144:function(e){e.exports=t},398:function(e){e.exports=n},22:function(e){e.exports=r},154:function(e){e.exports=i}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return o[e].call(n.exports,n,n.exports,a),n.exports}a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var l={};return function(){a.d(l,{default:function(){return ar}});var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},e.apply(this,arguments)};Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)};function n(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function i(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==a.g?a.g:"undefined"!=typeof self?self:{},s={};function c(e,t,n){var r,i,o,a,l,u="";for("string"!=typeof t&&(n=t,t=c.defaultChars),void 0===n&&(n=!0),l=function(e){var t,n,r=s[e];if(r)return r;for(r=s[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?r.push(n):r.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t<e.length;t++)r[e.charCodeAt(t)]=e[t];return r}(t),r=0,i=e.length;r<i;r++)if(o=e.charCodeAt(r),n&&37===o&&r+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(r+1,r+3)))u+=e.slice(r,r+3),r+=2;else if(o<128)u+=l[o];else if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&r+1<i&&(a=e.charCodeAt(r+1))>=56320&&a<=57343){u+=encodeURIComponent(e[r]+e[r+1]),r++;continue}u+="%EF%BF%BD"}else u+=encodeURIComponent(e[r]);return u}c.defaultChars=";/?:@&=+$,-_.!~*'()#",c.componentChars="-_.!~*'()";var u=c,h={},p={},f={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""},d={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},m={},g=o&&o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(m,"__esModule",{value:!0});var v=g({0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376}),y=String.fromCodePoint||function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+String.fromCharCode(e)};m.default=function(e){return e>=55296&&e<=57343||e>1114111?"�":(e in v.default&&(e=v.default[e]),y(e))};var b=o&&o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(p,"__esModule",{value:!0}),p.decodeHTML=p.decodeHTMLStrict=p.decodeXML=void 0;var k=b(f),w=b({Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"}),x=b(d),C=b(m),S=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;function N(e){var t=O(e);return function(e){return String(e).replace(S,t)}}p.decodeXML=N(x.default),p.decodeHTMLStrict=N(k.default);var T=function(e,t){return e<t?1:-1};function O(e){return function(t){if("#"===t.charAt(1)){var n=t.charAt(2);return"X"===n||"x"===n?C.default(parseInt(t.substr(3),16)):C.default(parseInt(t.substr(2),10))}return e[t.slice(1,-1)]||t}}p.decodeHTML=function(){for(var e=Object.keys(w.default).sort(T),t=Object.keys(k.default).sort(T),n=0,r=0;n<t.length;n++)e[r]===t[n]?(t[n]+=";?",r++):t[n]+=";";var i=new RegExp("&(?:"+t.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),o=O(k.default);function s(e){return";"!==e.substr(-1)&&(e+=";"),o(e)}return function(e){return String(e).replace(i,s)}}();var M={},E=o&&o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(M,"__esModule",{value:!0}),M.escapeUTF8=M.escape=M.encodeNonAsciiHTML=M.encodeHTML=M.encodeXML=void 0;var D=P(E(d).default),A=B(D);M.encodeXML=H(D);var L,R,I=P(E(f).default),F=B(I);function P(e){return Object.keys(e).sort().reduce(function(t,n){return t[e[n]]="&"+n+";",t},{})}function B(e){for(var t=[],n=[],r=0,i=Object.keys(e);r<i.length;r++){var o=i[r];1===o.length?t.push("\\"+o):n.push(o)}t.sort();for(var s=0;s<t.length-1;s++){for(var a=s;a<t.length-1&&t[a].charCodeAt(1)+1===t[a+1].charCodeAt(1);)a+=1;var l=1+a-s;l<3||t.splice(s,l,t[s]+"-"+t[a])}return n.unshift("["+t.join("")+"]"),new RegExp(n.join("|"),"g")}M.encodeHTML=(L=I,R=F,function(e){return e.replace(R,function(e){return L[e]}).replace(z,_)}),M.encodeNonAsciiHTML=H(I);var z=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,q=null!=String.prototype.codePointAt?function(e){return e.codePointAt(0)}:function(e){return 1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536};function _(e){return"&#x"+(e.length>1?q(e):e.charCodeAt(0)).toString(16).toUpperCase()+";"}var j=new RegExp(A.source+"|"+z.source,"g");function H(e){return function(t){return t.replace(j,function(t){return e[t]||_(t)})}}M.escape=function(e){return e.replace(j,_)},M.escapeUTF8=function(e){return e.replace(A,_)},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodeXMLStrict=e.decodeHTML5Strict=e.decodeHTML4Strict=e.decodeHTML5=e.decodeHTML4=e.decodeHTMLStrict=e.decodeHTML=e.decodeXML=e.encodeHTML5=e.encodeHTML4=e.escapeUTF8=e.escape=e.encodeNonAsciiHTML=e.encodeHTML=e.encodeXML=e.encode=e.decodeStrict=e.decode=void 0;var t=p,n=M;e.decode=function(e,n){return(!n||n<=0?t.decodeXML:t.decodeHTML)(e)},e.decodeStrict=function(e,n){return(!n||n<=0?t.decodeXML:t.decodeHTMLStrict)(e)},e.encode=function(e,t){return(!t||t<=0?n.encodeXML:n.encodeHTML)(e)};var r=M;Object.defineProperty(e,"encodeXML",{enumerable:!0,get:function(){return r.encodeXML}}),Object.defineProperty(e,"encodeHTML",{enumerable:!0,get:function(){return r.encodeHTML}}),Object.defineProperty(e,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return r.encodeNonAsciiHTML}}),Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return r.escape}}),Object.defineProperty(e,"escapeUTF8",{enumerable:!0,get:function(){return r.escapeUTF8}}),Object.defineProperty(e,"encodeHTML4",{enumerable:!0,get:function(){return r.encodeHTML}}),Object.defineProperty(e,"encodeHTML5",{enumerable:!0,get:function(){return r.encodeHTML}});var i=p;Object.defineProperty(e,"decodeXML",{enumerable:!0,get:function(){return i.decodeXML}}),Object.defineProperty(e,"decodeHTML",{enumerable:!0,get:function(){return i.decodeHTML}}),Object.defineProperty(e,"decodeHTMLStrict",{enumerable:!0,get:function(){return i.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML4",{enumerable:!0,get:function(){return i.decodeHTML}}),Object.defineProperty(e,"decodeHTML5",{enumerable:!0,get:function(){return i.decodeHTML}}),Object.defineProperty(e,"decodeHTML4Strict",{enumerable:!0,get:function(){return i.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML5Strict",{enumerable:!0,get:function(){return i.decodeHTMLStrict}}),Object.defineProperty(e,"decodeXMLStrict",{enumerable:!0,get:function(){return i.decodeXML}})}(h);var V="&(?:#x[a-f0-9]{1,6}|#[0-9]{1,7}|[a-z][a-z0-9]{1,31});",$=/[\\&]/,U="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",J=new RegExp("\\\\"+U+"|"+V,"gi"),W=new RegExp('[&<>"]',"g"),K=function(e){return 92===e.charCodeAt(0)?e.charAt(1):h.decodeHTML(e)};function G(e){return $.test(e)?e.replace(J,K):e}function Z(e){if(e.startsWith("#"))return e;try{return u(e)}catch(t){return e}}function X(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}}function Y(e){return W.test(e)?e.replace(W,X):e}function Q(e,t){for(var n=[],r=0;r<t;r++)n.push(e);return n.join("")}function ee(e){return!e||!/[^ \t]+/.test(e)}var te=function(){function e(e){this.current=e,this.root=e,this.entering=!0}return e.prototype.next=function(){var e=this.current,t=this.entering;if(null===e)return null;var n=ne(e);return t&&n?e.firstChild?(this.current=e.firstChild,this.entering=!0):this.entering=!1:e===this.root?this.current=null:null===e.next?(this.current=e.parent,this.entering=!1):(this.current=e.next,this.entering=!0),{entering:t,node:e}},e.prototype.resumeAt=function(e,t){this.current=e,this.entering=!0===t},e}();function ne(e){switch(e.type){case"document":case"blockQuote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"strike":case"mark":case"superscript":case"subscript":case"underline":case"link":case"image":case"table":case"tableHead":case"tableBody":case"tableRow":case"tableCell":case"tableDelimRow":case"customInline":return!0;default:return!1}}var re=1,ie={};function oe(e){delete ie[e]}var se=function(){function e(e,t){this.parent=null,this.prev=null,this.next=null,this.firstChild=null,this.lastChild=null,this.literal=null,this.id="document"===e?-1:re++,this.type=e,this.sourcepos=t,ie[this.id]=this}return e.prototype.isContainer=function(){return ne(this)},e.prototype.unlink=function(){this.prev?this.prev.next=this.next:this.parent&&(this.parent.firstChild=this.next),this.next?this.next.prev=this.prev:this.parent&&(this.parent.lastChild=this.prev),this.parent=null,this.next=null,this.prev=null},e.prototype.replaceWith=function(e){this.insertBefore(e),this.unlink()},e.prototype.insertAfter=function(e){e.unlink(),e.next=this.next,e.next&&(e.next.prev=e),e.prev=this,this.next=e,this.parent&&(e.parent=this.parent,e.next||(e.parent.lastChild=e))},e.prototype.insertBefore=function(e){e.unlink(),e.prev=this.prev,e.prev&&(e.prev.next=e),e.next=this,this.prev=e,e.parent=this.parent,e.prev||(e.parent.firstChild=e)},e.prototype.appendChild=function(e){e.unlink(),e.parent=this,this.lastChild?(this.lastChild.next=e,e.prev=this.lastChild,this.lastChild=e):(this.firstChild=e,this.lastChild=e)},e.prototype.prependChild=function(e){e.unlink(),e.parent=this,this.firstChild?(this.firstChild.prev=e,e.next=this.firstChild,this.firstChild=e):(this.firstChild=e,this.lastChild=e)},e.prototype.walker=function(){return new te(this)},e}(),ae=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.open=!0,r.lineOffsets=null,r.stringContent=null,r.lastLineBlank=!1,r.lastLineChecked=!1,r.type=t,r}return n(t,e),t}(se),le=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.listData=null,t}return n(t,e),t}(ae),ce=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.level=0,t.headingType="atx",t}return n(t,e),t}(ae),ue=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isFenced=!1,t.fenceChar=null,t.fenceLength=0,t.fenceOffset=-1,t.info=null,t.infoPadding=0,t}return n(t,e),t}(ae),he=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.columns=[],t}return n(t,e),t}(ae),pe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.startIdx=0,t.endIdx=0,t.paddingLeft=0,t.paddingRight=0,t.ignored=!1,t}return n(t,e),t}(ae),fe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.title="",t.dest="",t.label="",t}return n(t,e),t}(ae),de=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.syntaxLength=0,t.offset=-1,t.info="",t}return n(t,e),t}(ae),me=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.htmlBlockType=-1,t}return n(t,e),t}(ae),ge=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.destination=null,t.title=null,t.extendedAutolink=!1,t}return n(t,e),t}(se),ve=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tickCount=0,t}return n(t,e),t}(se),ye=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.info="",t}return n(t,e),t}(se);function be(e,t){switch(e){case"heading":return new ce(e,t);case"list":case"item":return new le(e,t);case"link":case"image":return new ge(e,t);case"codeBlock":return new ue(e,t);case"htmlBlock":return new me(e,t);case"table":return new he(e,t);case"tableCell":return new pe(e,t);case"document":case"paragraph":case"blockQuote":case"thematicBreak":case"tableRow":case"tableBody":case"tableHead":case"frontMatter":return new ae(e,t);case"code":return new ve(e,t);case"refDef":return new fe(e,t);case"customBlock":return new de(e,t);case"customInline":return new ye(e,t);default:return new se(e,t)}}function ke(e){return"codeBlock"===e.type}function we(e){return"list"===e.type}function xe(e){return"refDef"===e.type}function Ce(e){return"customBlock"===e.type}function Se(e,t){var n=be("text",t);return n.literal=e,n}var Ne,Te="[A-Za-z][A-Za-z0-9-]*",Oe="<"+Te+"(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",Me="</"+Te+"\\s*[>]",Ee=new RegExp("^(?:"+Oe+"|"+Me+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)","i");if(String.fromCodePoint)Ne=function(e){try{return String.fromCodePoint(e)}catch(e){if(e instanceof RangeError)return String.fromCharCode(65533);throw e}};else{var De=String.fromCharCode,Ae=Math.floor;Ne=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,r,i=[],o=-1,s=e.length;if(!s)return"";for(var a="";++o<s;){var l=Number(e[o]);if(!isFinite(l)||l<0||l>1114111||Ae(l)!==l)return String.fromCharCode(65533);l<=65535?i.push(l):(n=55296+((l-=65536)>>10),r=l%1024+56320,i.push(n,r)),(o+1===s||i.length>16384)&&(a+=De.apply(void 0,i),i.length=0)}return a}}var Le=Ne;function Re(e){var t=/\)+$/.exec(e);if(t){for(var n=0,r=0,i=e;r<i.length;r++){var o=i[r];"("===o?n<0?n=1:n+=1:")"===o&&(n-=1)}if(n<0){var s=Math.min(-n,t[0].length);return e.substring(0,e.length-s)}}return e}function Ie(e){return e.replace(/&[A-Za-z0-9]+;$/,"")}function Fe(e){return i(i([],function(e){for(var t,n=new RegExp("(www|https?://).(?:[w-]+.)*[A-Za-z0-9-]+.[A-Za-z0-9-]+[^<\\s]*[^<?!.,:*_?~\\s]","g"),r=[];t=n.exec(e);){var i=Ie(Re(t[0])),o="www"===t[1]?"http://":"";r.push({text:i,range:[t.index,t.index+i.length-1],url:""+o+i})}return r}(e)),function(e){for(var t,n=new RegExp("[\\w.+-]+@(?:[\\w-]+\\.)+[\\w-]+","g"),r=[];t=n.exec(e);){var i=t[0];/[_-]+$/.test(i)||r.push({text:i,range:[t.index,t.index+i.length-1],url:"mailto:"+i})}return r}(e)).sort(function(e,t){return e.range[0]-t.range[0]})}function Pe(e){return e[e.length-1]}function Be(e){return e.slice(1,e.length-1).trim().replace(/[ \t\r\n]+/," ").toLowerCase().toUpperCase()}function ze(e,t){Object.keys(e).forEach(function(n){t(n,e[n])})}function qe(e){return!Object.keys(e).length}var _e=39,je=34,He=36,Ve="\\\\"+U,$e=new RegExp(/[!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/),Ue=new RegExp('^(?:"('+Ve+'|[^"\\x00])*"|\'('+Ve+"|[^'\\x00])*'|\\(("+Ve+"|[^()\\x00])*\\))"),Je=/^(?:<(?:[^<>\n\\\x00]|\\.)*>)/,We=new RegExp("^"+U),Ke=new RegExp("^"+V,"i"),Ge=/`+/,Ze=/^`+/,Xe=/\.\.\./g,Ye=/--+/g,Qe=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,et=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,tt=/^ *(?:\n *)?/,nt=/^[ \t\n\x0b\x0c\x0d]/,rt=/^\s/,it=/ *$/,ot=/^ */,st=/^ *(?:\n|$)/,at=/^\[(?:[^\\\[\]]|\\.){0,1000}\]/,lt=/^[^\n`\[\]\\!<&*_'"~$=+^]+/m,ct=function(){function e(e){this.subject="",this.delimiters=null,this.brackets=null,this.pos=0,this.lineStartNum=0,this.lineIdx=0,this.lineOffsets=[0],this.linePosOffset=0,this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.options=e}return e.prototype.sourcepos=function(e,t){var n=this.linePosOffset+this.lineOffsets[this.lineIdx],r=this.lineStartNum+this.lineIdx,i=[r,e+n];return"number"==typeof t?[i,[r,t+n]]:i},e.prototype.nextLine=function(){this.lineIdx+=1,this.linePosOffset=-this.pos},e.prototype.match=function(e){var t=e.exec(this.subject.slice(this.pos));return null===t?null:(this.pos+=t.index+t[0].length,t[0])},e.prototype.peek=function(){return this.pos<this.subject.length?this.subject.charCodeAt(this.pos):-1},e.prototype.spnl=function(){return this.match(tt),!0},e.prototype.parseBackticks=function(e){var t=this.pos+1,n=this.match(Ze);if(null===n)return!1;for(var r,i=this.pos;null!==(r=this.match(Ge));)if(r===n){var o=this.subject.slice(i,this.pos-n.length),s=this.sourcepos(t,this.pos),a=o.split("\n");if(a.length>1){var l=Pe(a);this.lineIdx+=a.length-1,this.linePosOffset=-(this.pos-l.length-n.length),s[1]=this.sourcepos(this.pos),o=a.join(" ")}var c=be("code",s);return o.length>0&&null!==o.match(/[^ ]/)&&" "==o[0]&&" "==o[o.length-1]?c.literal=o.slice(1,o.length-1):c.literal=o,c.tickCount=n.length,e.appendChild(c),!0}return this.pos=i,e.appendChild(Se(n,this.sourcepos(t,this.pos-1))),!0},e.prototype.parseBackslash=function(e){var t,n=this.subject;this.pos+=1;var r=this.pos;return 10===this.peek()?(this.pos+=1,t=be("linebreak",this.sourcepos(this.pos-1,this.pos)),e.appendChild(t),this.nextLine()):We.test(n.charAt(this.pos))?(e.appendChild(Se(n.charAt(this.pos),this.sourcepos(r,this.pos))),this.pos+=1):e.appendChild(Se("\\",this.sourcepos(r,r))),!0},e.prototype.parseAutolink=function(e){var t,n,r,i=this.pos+1;return(t=this.match(Qe))?(n=t.slice(1,t.length-1),(r=be("link",this.sourcepos(i,this.pos))).destination=Z("mailto:"+n),r.title="",r.appendChild(Se(n,this.sourcepos(i+1,this.pos-1))),e.appendChild(r),!0):!!(t=this.match(et))&&(n=t.slice(1,t.length-1),(r=be("link",this.sourcepos(i,this.pos))).destination=Z(n),r.title="",r.appendChild(Se(n,this.sourcepos(i+1,this.pos-1))),e.appendChild(r),!0)},e.prototype.parseHtmlTag=function(e){var t=this.pos+1,n=this.match(Ee);if(null===n)return!1;var r=be("htmlInline",this.sourcepos(t,this.pos));return r.literal=n,e.appendChild(r),!0},e.prototype.parseMarkInline=function(t){if("=="!==this.subject.slice(this.pos,this.pos+2))return!1;var n=this.subject.indexOf("==",this.pos+2);if(-1===n)return!1;var r=this.subject.slice(this.pos+2,n);if(!r||r.includes("\n"))return!1;var i=this.pos+1,o=i+(n-this.pos)+2-1,s=be("mark",this.sourcepos(i,o)),a=i+2,l=a+r.length-1,c=be("paragraph",this.sourcepos(a,l));c.stringContent=r,c.lineOffsets=[0];var u=new e(this.options);for(u.refMap=this.refMap,u.refLinkCandidateMap=this.refLinkCandidateMap,u.refDefCandidateMap=this.refDefCandidateMap,u.subject=r,u.pos=0,u.delimiters=null,u.brackets=null,u.lineOffsets=[0],u.lineIdx=0,u.linePosOffset=this.linePosOffset+this.lineOffsets[this.lineIdx]+a-1,u.lineStartNum=this.lineStartNum+this.lineIdx;u.parseInline(c););u.processEmphasis(null),u.mergeTextNodes(c.walker());for(var h=c.firstChild;h;){var p=h.next;h.unlink(),s.appendChild(h),h=p}return t.appendChild(s),this.pos=n+2,!0},e.prototype.isInlineDollarAt=function(e){if("$"!==this.subject[e])return!1;for(var t=0,n=e-1;n>=0&&"\\"===this.subject[n];n-=1)t+=1;return t%2!=1&&"$"!==this.subject[e-1]&&"$"!==this.subject[e+1]},e.prototype.isInsideDollarInline=function(){for(var e=this.delimiters;e;){if(e.cc===He&&e.canOpen&&1===e.numdelims)return!0;e=e.previous}for(var t=-1,n=this.pos-1;n>=0&&"\n"!==this.subject[n];n-=1)if(this.isInlineDollarAt(n)){t=n;break}if(-1===t)return!1;for(n=this.pos;n<this.subject.length&&"\n"!==this.subject[n];n+=1)if(this.isInlineDollarAt(n))return!0;return!1},e.prototype.parseSuperscriptInline=function(t){if(this.isInsideDollarInline())return!1;if("^"!==this.subject.slice(this.pos,this.pos+1))return!1;if("^"===this.subject.slice(this.pos+1,this.pos+2))return!1;var n=this.subject.indexOf("^",this.pos+1);if(-1===n)return!1;var r=this.subject.slice(this.pos+1,n);if(!r||r.includes("\n"))return!1;var i=this.pos+1,o=i+(n-this.pos)+1-1,s=be("superscript",this.sourcepos(i,o)),a=i+1,l=a+r.length-1,c=be("paragraph",this.sourcepos(a,l));c.stringContent=r,c.lineOffsets=[0];var u=new e(this.options);for(u.refMap=this.refMap,u.refLinkCandidateMap=this.refLinkCandidateMap,u.refDefCandidateMap=this.refDefCandidateMap,u.subject=r,u.pos=0,u.delimiters=null,u.brackets=null,u.lineOffsets=[0],u.lineIdx=0,u.linePosOffset=this.linePosOffset+this.lineOffsets[this.lineIdx]+a-1,u.lineStartNum=this.lineStartNum+this.lineIdx;u.parseInline(c););u.processEmphasis(null),u.mergeTextNodes(c.walker());for(var h=c.firstChild;h;){var p=h.next;h.unlink(),s.appendChild(h),h=p}return t.appendChild(s),this.pos=n+1,!0},e.prototype.parseSubscriptInline=function(t){if(this.isInsideDollarInline())return!1;if("~"!==this.subject.slice(this.pos,this.pos+1))return!1;if("~"===this.subject.slice(this.pos+1,this.pos+2))return!1;var n=this.subject.indexOf("~",this.pos+1);if(-1===n)return!1;var r=this.subject.slice(this.pos+1,n);if(!r||r.includes("\n"))return!1;var i=this.pos+1,o=i+(n-this.pos)+1-1,s=be("subscript",this.sourcepos(i,o)),a=i+1,l=a+r.length-1,c=be("paragraph",this.sourcepos(a,l));c.stringContent=r,c.lineOffsets=[0];var u=new e(this.options);for(u.refMap=this.refMap,u.refLinkCandidateMap=this.refLinkCandidateMap,u.refDefCandidateMap=this.refDefCandidateMap,u.subject=r,u.pos=0,u.delimiters=null,u.brackets=null,u.lineOffsets=[0],u.lineIdx=0,u.linePosOffset=this.linePosOffset+this.lineOffsets[this.lineIdx]+a-1,u.lineStartNum=this.lineStartNum+this.lineIdx;u.parseInline(c););u.processEmphasis(null),u.mergeTextNodes(c.walker());for(var h=c.firstChild;h;){var p=h.next;h.unlink(),s.appendChild(h),h=p}return t.appendChild(s),this.pos=n+1,!0},e.prototype.parseUnderlineInline=function(t){if(this.isInsideDollarInline())return!1;if("++"!==this.subject.slice(this.pos,this.pos+2))return!1;var n=this.subject.indexOf("++",this.pos+2);if(-1===n)return!1;var r=this.subject.slice(this.pos+2,n);if(!r||r.includes("\n"))return!1;var i=this.pos+1,o=i+(n-this.pos)+2-1,s=be("underline",this.sourcepos(i,o)),a=i+2,l=a+r.length-1,c=be("paragraph",this.sourcepos(a,l));c.stringContent=r,c.lineOffsets=[0];var u=new e(this.options);for(u.refMap=this.refMap,u.refLinkCandidateMap=this.refLinkCandidateMap,u.refDefCandidateMap=this.refDefCandidateMap,u.subject=r,u.pos=0,u.delimiters=null,u.brackets=null,u.lineOffsets=[0],u.lineIdx=0,u.linePosOffset=this.linePosOffset+this.lineOffsets[this.lineIdx]+a-1,u.lineStartNum=this.lineStartNum+this.lineIdx;u.parseInline(c););u.processEmphasis(null),u.mergeTextNodes(c.walker());for(var h=c.firstChild;h;){var p=h.next;h.unlink(),s.appendChild(h),h=p}return t.appendChild(s),this.pos=n+2,!0},e.prototype.scanDelims=function(e){var t=0,n=this.pos;if(e===_e||e===je)t++,this.pos++;else for(;this.peek()===e;)t++,this.pos++;if(0===t||t<2&&(126===e||e===He))return this.pos=n,null;var r,i=0===n?"\n":this.subject.charAt(n-1),o=this.peek();r=-1===o?"\n":Le(o);var s,a,l=rt.test(r),c=$e.test(r),u=rt.test(i),h=$e.test(i),p=!l&&(!c||u||h),f=!u&&(!h||l||c);return 95===e?(s=p&&(!f||h),a=f&&(!p||c)):e===_e||e===je?(s=p&&!f,a=f):e===He?(s=!l,a=!u):(s=p,a=f),this.pos=n,{numdelims:t,canOpen:s,canClose:a}},e.prototype.handleDelim=function(e,t){var n=this.scanDelims(e);if(!n)return!1;var r=n.numdelims,i=this.pos+1;this.pos+=r;var o=Se(e===_e?"’":e===je?"“":this.subject.slice(i-1,this.pos),this.sourcepos(i,this.pos));return t.appendChild(o),(n.canOpen||n.canClose)&&(this.options.smart||e!==_e&&e!==je)&&(this.delimiters={cc:e,numdelims:r,origdelims:r,node:o,previous:this.delimiters,next:null,canOpen:n.canOpen,canClose:n.canClose},this.delimiters.previous&&(this.delimiters.previous.next=this.delimiters)),!0},e.prototype.removeDelimiter=function(e){null!==e.previous&&(e.previous.next=e.next),null===e.next?this.delimiters=e.previous:e.next.previous=e.previous},e.prototype.removeDelimitersBetween=function(e,t){e.next!==t&&(e.next=t,t.previous=e)},e.prototype.processEmphasis=function(e){var t,n,r,i,o,s,a,l=!1,c=((t={})[95]=[e,e,e],t[42]=[e,e,e],t[39]=[e],t[34]=[e],t[126]=[e],t[36]=[e],t);for(r=this.delimiters;null!==r&&r.previous!==e;)r=r.previous;for(;null!==r;){var u=r.cc,h=95===u||42===u;if(r.canClose){for(n=r.previous,a=!1;null!==n&&n!==e&&n!==c[u][h?r.origdelims%3:0];){if(l=h&&(r.canOpen||n.canClose)&&r.origdelims%3!=0&&(n.origdelims+r.origdelims)%3==0,n.cc===r.cc&&n.canOpen&&!l){a=!0;break}n=n.previous}if(i=r,h||126===u||u===He)if(a){if(n){var p=r.numdelims>=2&&n.numdelims>=2?2:1,f=h?0:1;o=n.node,s=r.node;var d=h?1===p?"emph":"strong":"strike";u===He&&(d="customInline");var m=be(d),g=o.sourcepos[1],v=s.sourcepos[0];m.sourcepos=[[g[0],g[1]-p+1],[v[0],v[1]+p-1]],o.sourcepos[1][1]-=p,s.sourcepos[0][1]+=p,o.literal=o.literal.slice(p),s.literal=s.literal.slice(p),n.numdelims-=p,r.numdelims-=p;for(var y=o.next,b=void 0;y&&y!==s;)b=y.next,y.unlink(),m.appendChild(y),y=b;if(u===He){var k=m.firstChild,w=k.literal||"",x=w.split(/\s/)[0];if(m.info=x,w.length<=x.length)k.unlink();else{var C=w.startsWith(x+" ")?x.length+1:x.length;k.sourcepos[0][1]+=x.length,k.literal=w.slice(C),k.literal.length||k.unlink()}}if(o.insertAfter(m),this.removeDelimitersBetween(n,r),n.numdelims<=f&&(0===n.numdelims&&o.unlink(),this.removeDelimiter(n)),r.numdelims<=f){0===r.numdelims&&s.unlink();var S=r.next;this.removeDelimiter(r),r=S}}}else r=r.next;else u===_e?(r.node.literal="’",a&&(n.node.literal="‘"),r=r.next):u===je&&(r.node.literal="”",a&&(n.node.literal="“"),r=r.next);a||(c[u][h?i.origdelims%3:0]=i.previous,i.canOpen||this.removeDelimiter(i))}else r=r.next}for(;null!==this.delimiters&&this.delimiters!==e;)this.removeDelimiter(this.delimiters)},e.prototype.parseLinkTitle=function(){var e=this.match(Ue);return null===e?null:G(e.substr(1,e.length-2))},e.prototype.parseLinkDestination=function(){var e=this.match(Je);if(null===e){if(60===this.peek())return null;for(var t=this.pos,n="#"===this.subject.charAt(t),r=0,i=void 0;-1!==(i=this.peek());)if(92===i&&We.test(this.subject.charAt(this.pos+1)))this.pos+=1,-1!==this.peek()&&(this.pos+=1);else if(40===i)this.pos+=1,r+=1;else if(41===i){if(r<1)break;this.pos+=1,r-=1}else if(null!==nt.exec(Le(i))){if(!n)break;this.pos+=1}else this.pos+=1;return this.pos===t&&41!==i||0!==r?null:Z(G(e=this.subject.substr(t,this.pos-t)))}return Z(G(e.substr(1,e.length-2)))},e.prototype.parseLinkLabel=function(){var e=this.match(at);return null===e||e.length>1001?0:e.length},e.prototype.parseOpenBracket=function(e){var t=this.pos;this.pos+=1;var n=Se("[",this.sourcepos(this.pos,this.pos));return e.appendChild(n),this.addBracket(n,t,!1),!0},e.prototype.parseBang=function(e){var t=this.pos;if(this.pos+=1,91===this.peek()){this.pos+=1;var n=Se("![",this.sourcepos(this.pos-1,this.pos));e.appendChild(n),this.addBracket(n,t+1,!0)}else n=Se("!",this.sourcepos(this.pos,this.pos)),e.appendChild(n);return!0},e.prototype.parseCloseBracket=function(e){var t=null,n=null,r=!1;this.pos+=1;var i=this.pos,o=this.brackets;if(null===o)return e.appendChild(Se("]",this.sourcepos(i,i))),!0;if(!o.active)return e.appendChild(Se("]",this.sourcepos(i,i))),this.removeBracket(),!0;var s=o.image,a=this.pos;40===this.peek()&&(this.pos++,this.spnl()&&null!==(t=this.parseLinkDestination())&&this.spnl()&&(nt.test(this.subject.charAt(this.pos-1))&&(n=this.parseLinkTitle()),1)&&this.spnl()&&41===this.peek()?(this.pos+=1,r=!0):this.pos=a);var l="";if(!r){var c=this.pos,u=this.parseLinkLabel();if(u>2?l=this.subject.slice(c,c+u):o.bracketAfter||(l=this.subject.slice(o.index,i)),0===u&&(this.pos=a),l){l=Be(l);var h=this.refMap[l];h&&(t=h.destination,n=h.title,r=!0)}}if(r){var p=be(s?"image":"link");p.destination=t,p.title=n||"",p.sourcepos=[o.startpos,this.sourcepos(this.pos)];for(var f=o.node.next,d=void 0;f;)d=f.next,f.unlink(),p.appendChild(f),f=d;if(e.appendChild(p),this.processEmphasis(o.previousDelimiter),this.removeBracket(),o.node.unlink(),!s)for(o=this.brackets;null!==o;)o.image||(o.active=!1),o=o.previous;return this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refLabel:l}),!0}return this.removeBracket(),this.pos=i,e.appendChild(Se("]",this.sourcepos(i,i))),this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refLabel:l}),!0},e.prototype.addBracket=function(e,t,n){null!==this.brackets&&(this.brackets.bracketAfter=!0),this.brackets={node:e,startpos:this.sourcepos(t+(n?0:1)),previous:this.brackets,previousDelimiter:this.delimiters,index:t,image:n,active:!0}},e.prototype.removeBracket=function(){this.brackets&&(this.brackets=this.brackets.previous)},e.prototype.parseEntity=function(e){var t,n=this.pos+1;return!!(t=this.match(Ke))&&(e.appendChild(Se(h.decodeHTML(t),this.sourcepos(n,this.pos))),!0)},e.prototype.parseString=function(e){var t,n=this.pos+1;if(t=this.match(lt)){if(this.options.smart){var r=t.replace(Xe,"…").replace(Ye,function(e){var t=0,n=0;return e.length%3==0?n=e.length/3:e.length%2==0?t=e.length/2:e.length%3==2?(t=1,n=(e.length-2)/3):(t=2,n=(e.length-4)/3),Q("—",n)+Q("–",t)});e.appendChild(Se(r,this.sourcepos(n,this.pos)))}else{var i=Se(t,this.sourcepos(n,this.pos));e.appendChild(i)}return!0}return!1},e.prototype.parseNewline=function(e){this.pos+=1;var t=e.lastChild;if(t&&"text"===t.type&&" "===t.literal[t.literal.length-1]){var n=" "===t.literal[t.literal.length-2],r=t.literal.length;t.literal=t.literal.replace(it,"");var i=r-t.literal.length;t.sourcepos[1][1]-=i,e.appendChild(be(n?"linebreak":"softbreak",this.sourcepos(this.pos-i,this.pos)))}else e.appendChild(be("softbreak",this.sourcepos(this.pos,this.pos)));return this.nextLine(),this.match(ot),!0},e.prototype.parseReference=function(e,t){if(!this.options.referenceDefinition)return 0;this.subject=e.stringContent,this.pos=0;var n=null,r=this.pos,i=this.parseLinkLabel();if(0===i)return 0;var o=this.subject.substr(0,i);if(58!==this.peek())return this.pos=r,0;this.pos++,this.spnl();var s=this.parseLinkDestination();if(null===s)return this.pos=r,0;var a=this.pos;this.spnl(),this.pos!==a&&(n=this.parseLinkTitle()),null===n&&(n="",this.pos=a);var l=!0;if(null===this.match(st)&&(""===n?l=!1:(n="",this.pos=a,l=null!==this.match(st))),!l)return this.pos=r,0;var c=Be(o);if(""===c)return this.pos=r,0;var u=this.getReferenceDefSourcepos(e);e.sourcepos[0][0]=u[1][0]+1;var h=be("refDef",u);return h.title=n,h.dest=s,h.label=c,e.insertBefore(h),t[c]?this.refDefCandidateMap[h.id]=h:t[c]=Yt(h),this.pos-r},e.prototype.mergeTextNodes=function(e){for(var t,n=[];t=e.next();){var r=t.entering,i=t.node;if(r&&"text"===i.type)n.push(i);else if(1===n.length)n=[];else if(n.length>1){var o=n[0],s=n[n.length-1];o.sourcepos&&s.sourcepos&&(o.sourcepos[1]=s.sourcepos[1]),o.next=s.next,o.next&&(o.next.prev=o);for(var a=1;a<n.length;a+=1)o.literal+=n[a].literal,n[a].unlink();n=[]}}},e.prototype.getReferenceDefSourcepos=function(e){for(var t=e.stringContent.split(/\n|\r\n/),n=!1,r=0,i={line:0,ch:0},o=0;o<t.length;o+=1){var s=t[o];if(nt.test(s))break;if(/\:/.test(s)&&0===r){if(n)break;var a=s.indexOf(":")===s.length-1?o+1:o;i={line:a,ch:t[a].length},n=!0}var l=s.match(/'|"/g);if(l&&(r+=l.length),2===r){i={line:o,ch:s.length};break}}return[[e.sourcepos[0][0],e.sourcepos[0][1]],[e.sourcepos[0][0]+i.line,i.ch]]},e.prototype.parseInline=function(e){var t,n=!1,r=this.peek();if(-1===r)return!1;switch(r){case 10:n=this.parseNewline(e);break;case 92:n=this.parseBackslash(e);break;case 96:n=this.parseBackticks(e);break;case 42:case 95:case 126:(n=this.parseSubscriptInline(e))||this.isInsideDollarInline()||(n=this.handleDelim(r,e));break;case He:n=this.handleDelim(r,e);break;case 61:n=this.parseMarkInline(e);break;case 43:n=this.parseUnderlineInline(e);break;case 94:n=this.parseSuperscriptInline(e);break;case _e:case je:n=!!(null===(t=this.options)||void 0===t?void 0:t.smart)&&this.handleDelim(r,e);break;case 91:n=this.parseOpenBracket(e);break;case 33:n=this.parseBang(e);break;case 93:n=this.parseCloseBracket(e);break;case 60:n=this.parseAutolink(e)||this.parseHtmlTag(e);break;case 38:e.disabledEntityParse||(n=this.parseEntity(e));break;default:n=this.parseString(e)}return n||(this.pos+=1,e.appendChild(Se(Le(r),this.sourcepos(this.pos,this.pos+1)))),!0},e.prototype.parse=function(e){for(this.subject=e.stringContent.trim(),this.pos=0,this.delimiters=null,this.brackets=null,this.lineOffsets=e.lineOffsets||[0],this.lineIdx=0,this.linePosOffset=0,this.lineStartNum=e.sourcepos[0][0],function(e){return"heading"===e.type}(e)&&(this.lineOffsets[0]+=e.level+1);this.parseInline(e););e.stringContent=null,this.processEmphasis(null),this.mergeTextNodes(e.walker());var t=this.options,n=t.extendedAutolinks,r=t.customParser;if(n&&function(e,t){var n;"boolean"==typeof t&&(t=Fe);for(var r=function(){var e=n.entering,r=n.node;if(e&&"text"===r.type&&"link"!==r.parent.type){var i=r.literal,o=t(i);if(!o||!o.length)return"continue";for(var s=0,a=r.sourcepos[0],l=a[0],c=a[1],u=function(e,t){return[[l,c+e],[l,c+t]]},h=[],p=0,f=o;p<f.length;p++){var d=f[p],m=d.range,g=d.url,v=d.text;m[0]>s&&h.push(Se(i.substring(s,m[0]),u(s,m[0]-1)));var y=be("link",u.apply(void 0,m));y.appendChild(Se(v,u.apply(void 0,m))),y.destination=g,y.extendedAutolink=!0,h.push(y),s=m[1]+1}s<i.length&&h.push(Se(i.substring(s),u(s,i.length-1)));for(var b=0,k=h;b<k.length;b++){var w=k[b];r.insertBefore(w)}r.unlink()}};n=e.next();)r()}(e.walker(),n),r&&e.firstChild)for(var i,o=e.firstChild.walker();i=o.next();){var s=i.node,a=i.entering;r[s.type]&&r[s.type](s,{entering:a,options:this.options})}},e}(),ut=/^\[([ \txX])\][ \t]+/,ht=/[^ \t\f\v\r\n]/,pt=/^(?:`{3,}|~{3,})(?= *$)/;function ft(e){for(var t=e;t;){if(t.lastLineBlank)return!0;var n=t.type;if(t.lastLineChecked||"list"!==n&&"item"!==n){t.lastLineChecked=!0;break}t.lastLineChecked=!0,t=t.lastChild}return!1}function dt(e,t){return t<e.length?e.charCodeAt(t):-1}function mt(e){return!ht.test(e)}function gt(e){return 32===e||9===e}var vt=/^\$\$$/,yt={continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!0},bt={continue:function(){return 0},finalize:function(e,t){for(var n=t.firstChild;n;){if(ft(n)&&n.next){t.listData.tight=!1;break}for(var r=n.firstChild;r;){if(ft(r)&&(n.next||r.next)){t.listData.tight=!1;break}r=r.next}n=n.next}},canContain:function(e){return"item"===e},acceptsLines:!1},kt={document:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},list:bt,blockQuote:{continue:function(e){var t=e.currentLine;return e.indented||62!==dt(t,e.nextNonspace)?1:(e.advanceNextNonspace(),e.advanceOffset(1,!1),gt(dt(t,e.offset))&&e.advanceOffset(1,!0),0)},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},item:{continue:function(e,t){if(e.blank){if(null===t.firstChild)return 1;e.advanceNextNonspace()}else{if(!(e.indent>=t.listData.markerOffset+t.listData.padding))return 1;e.advanceOffset(t.listData.markerOffset+t.listData.padding,!0)}return 0},finalize:function(e,t){if(t.firstChild&&"paragraph"===t.firstChild.type){var n=t.firstChild,r=n.stringContent.match(ut);if(r){var i=r[0].length;n.stringContent=n.stringContent.substring(i-1),n.sourcepos[0][1]+=i,n.lineOffsets[0]+=i,t.listData.task=!0,t.listData.checked=/[xX]/.test(r[1])}}},canContain:function(e){return"item"!==e},acceptsLines:!1},heading:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},thematicBreak:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},codeBlock:{continue:function(e,t){var n=e.currentLine,r=e.indent;if(t.isFenced){var i=r<=3&&n.charAt(e.nextNonspace)===t.fenceChar&&n.slice(e.nextNonspace).match(pt);if(i&&i[0].length>=t.fenceLength)return e.lastLineLength=e.offset+r+i[0].length,e.finalize(t,e.lineNumber),2;for(var o=t.fenceOffset;o>0&>(dt(n,e.offset));)e.advanceOffset(1,!0),o--}else if(r>=4)e.advanceOffset(4,!0);else{if(!e.blank)return 1;e.advanceNextNonspace()}return 0},finalize:function(e,t){var n;if(null!==t.stringContent){if(t.isFenced){var r=t.stringContent,i=r.indexOf("\n"),o=r.slice(0,i),s=r.slice(i+1),a=o.match(/^(\s*)(.*)/);t.infoPadding=a[1].length,t.info=G(a[2].trim()),t.literal=s}else t.literal=null===(n=t.stringContent)||void 0===n?void 0:n.replace(/(\n *)+$/,"\n");t.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},htmlBlock:{continue:function(e,t){return!e.blank||6!==t.htmlBlockType&&7!==t.htmlBlockType?0:1},finalize:function(e,t){var n;t.literal=(null===(n=t.stringContent)||void 0===n?void 0:n.replace(/(\n *)+$/,""))||null,t.stringContent=null},canContain:function(){return!1},acceptsLines:!0},paragraph:{continue:function(e){return e.blank?1:0},finalize:function(e,t){if(null!==t.stringContent){for(var n,r=!1;91===dt(t.stringContent,0)&&(n=e.inlineParser.parseReference(t,e.refMap));)t.stringContent=t.stringContent.slice(n),r=!0;r&&mt(t.stringContent)&&t.unlink()}},canContain:function(){return!1},acceptsLines:!0},table:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"tableHead"===e||"tableBody"===e},acceptsLines:!1},tableBody:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"tableRow"===e},acceptsLines:!1},tableHead:{continue:function(){return 1},finalize:function(){},canContain:function(e){return"tableRow"===e||"tableDelimRow"===e},acceptsLines:!1},tableRow:{continue:function(){return 1},finalize:function(){},canContain:function(e){return"tableCell"===e},acceptsLines:!1},tableCell:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},tableDelimRow:{continue:function(){return 1},finalize:function(){},canContain:function(e){return"tableDelimCell"===e},acceptsLines:!1},tableDelimCell:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},refDef:yt,customBlock:{continue:function(e,t){var n=e.currentLine,r=n.match(vt);if(r)return e.lastLineLength=r[0].length,e.finalize(t,e.lineNumber),2;for(var i=t.offset;i>0&>(dt(n,e.offset));)e.advanceOffset(1,!0),i--;return 0},finalize:function(e,t){if(null!==t.stringContent){var n=t.stringContent,r=n.indexOf("\n"),i=n.slice(0,r),o=n.slice(r+1),s=i.match(/^(\s*)(.*)/);t.info=G(s[2].trim())||"latex",t.literal=o,t.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},frontMatter:yt};function wt(e){for(var t=0,n=0,r=[],i=0;i<e.length;i+=1)if("|"===e[i]&&"\\"!==e[i-1]){var o=e.substring(t,i);0===t&&ee(o)?n=i+1:r.push(o),t=i+1}return t<e.length&&(ee(o=e.substring(t,e.length))||r.push(o)),[n,r]}function xt(e,t,n,r){for(var i=[],o=0,s=t;o<s.length;o++){var a=s[o],l=a.match(/^[ \t]+/),c=l?l[0].length:0,u=void 0,h=void 0;if(c===a.length)c=0,u=0,h="";else{var p=a.match(/[ \t]+$/);u=p?p[0].length:0,h=a.slice(c,a.length-u)}var f=r+c,d=be(e,[[n,r],[n,r+a.length-1]]);d.stringContent=h.replace(/\\\|/g,"|"),d.startIdx=i.length,d.endIdx=i.length,d.lineOffsets=[f-1],d.paddingLeft=c,d.paddingRight=u,i.push(d),r+=a.length+1}return i}function Ct(e){var t=null,n=e.stringContent,r=n[0];return":"===n[n.length-1]?t=":"===r?"center":"right":":"===r&&(t="left"),{align:t}}var St=/^(\$\$)(\s*[a-zA-Z]\w*)?\s*$/,Nt=/^\$\$.+\$\$/,Tt=/^`{3,}(?!.*`)|^~{3,}/,Ot=[/./,/^<(?:script|pre|style)(?:\s|>|$)/i,/^<!--/,/^<[?]/,/^<![A-Z]/,/^<!\[CDATA\[/,/^<[/]?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[123456]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[/]?[>]|$)/i,new RegExp("^(?:"+Oe+"|"+Me+")\\s*$","i")],Mt=/^(?:=+|-+)[ \t]*$/,Et=/^#{1,6}(?:[ \t]+|$)/,Dt=/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})[ \t]*$/,At=/^[*+-]/,Lt=/^(\d{1,9})([.)])/;function Rt(e,t){return e.options.disallowDeepHeading&&("blockQuote"===t.type||"item"===t.type)}var It=[function(e){return e.indented||62!==dt(e.currentLine,e.nextNonspace)?0:(e.advanceNextNonspace(),e.advanceOffset(1,!1),gt(dt(e.currentLine,e.offset))&&e.advanceOffset(1,!0),e.closeUnmatchedBlocks(),e.addChild("blockQuote",e.nextNonspace),1)},function(e,t){var n;if(!e.indented&&!Rt(e,t)&&(n=e.currentLine.slice(e.nextNonspace).match(Et))){e.advanceNextNonspace(),e.advanceOffset(n[0].length,!1),e.closeUnmatchedBlocks();var r=e.addChild("heading",e.nextNonspace);return r.level=n[0].trim().length,r.headingType="atx",r.stringContent=e.currentLine.slice(e.offset).replace(/^[ \t]*#+[ \t]*$/,"").replace(/[ \t]+#+[ \t]*$/,""),e.advanceOffset(e.currentLine.length-e.offset),2}return 0},function(e){var t;if(!e.indented&&(t=e.currentLine.slice(e.nextNonspace).match(Tt))){var n=t[0].length;e.closeUnmatchedBlocks();var r=e.addChild("codeBlock",e.nextNonspace);return r.isFenced=!0,r.fenceLength=n,r.fenceChar=t[0][0],r.fenceOffset=e.indent,e.advanceNextNonspace(),e.advanceOffset(n,!1),2}return 0},function(e,t){if(!e.indented&&60===dt(e.currentLine,e.nextNonspace)){var n=e.currentLine.slice(e.nextNonspace),r=e.options.disallowedHtmlBlockTags,i=void 0;for(i=1;i<=7;i++){var o=n.match(Ot[i]);if(o){if(7===i){if("paragraph"===t.type)return 0;if(r.length>0&&new RegExp("</?(?:"+r.join("|")+")","i").test(o[0]))return 0}return e.closeUnmatchedBlocks(),e.addChild("htmlBlock",e.offset).htmlBlockType=i,2}}}return 0},function(e,t){var n;if(null!==t.stringContent&&!e.indented&&"paragraph"===t.type&&!Rt(e,t.parent)&&(n=e.currentLine.slice(e.nextNonspace).match(Mt))){e.closeUnmatchedBlocks();for(var r=void 0;91===dt(t.stringContent,0)&&(r=e.inlineParser.parseReference(t,e.refMap));)t.stringContent=t.stringContent.slice(r);if(t.stringContent.length>0){var i=be("heading",t.sourcepos);return i.level="="===n[0][0]?1:2,i.headingType="setext",i.stringContent=t.stringContent,t.insertAfter(i),t.unlink(),e.tip=i,e.advanceOffset(e.currentLine.length-e.offset,!1),2}return 0}return 0},function(e){return!e.indented&&Dt.test(e.currentLine.slice(e.nextNonspace))?(e.closeUnmatchedBlocks(),e.addChild("thematicBreak",e.nextNonspace),e.advanceOffset(e.currentLine.length-e.offset,!1),2):0},function(e,t){var n,r,i,o=t;return e.indented&&"list"!==t.type||!(n=function(e,t){var n,r,i=e.currentLine.slice(e.nextNonspace),o={type:"bullet",tight:!0,bulletChar:"",start:0,delimiter:"",padding:0,markerOffset:e.indent,task:!1,checked:!1};if(e.indent>=4)return null;if(n=i.match(At))o.type="bullet",o.bulletChar=n[0][0];else{if(!(n=i.match(Lt))||"paragraph"===t.type&&"1"!==n[1])return null;o.type="ordered",o.start=parseInt(n[1],10),o.delimiter=n[2]}if(-1!==(r=dt(e.currentLine,e.nextNonspace+n[0].length))&&9!==r&&32!==r)return null;if("paragraph"===t.type&&!e.currentLine.slice(e.nextNonspace+n[0].length).match(ht))return null;e.advanceNextNonspace(),e.advanceOffset(n[0].length,!0);var s=e.column,a=e.offset;do{e.advanceOffset(1,!0),r=dt(e.currentLine,e.offset)}while(e.column-s<5&>(r));var l=-1===dt(e.currentLine,e.offset),c=e.column-s;return c>=5||c<1||l?(o.padding=n[0].length+1,e.column=s,e.offset=a,gt(dt(e.currentLine,e.offset))&&e.advanceOffset(1,!0)):o.padding=n[0].length+c,o}(e,o))?0:(e.closeUnmatchedBlocks(),"list"===e.tip.type&&(i=n,(r=o.listData).type===i.type&&r.delimiter===i.delimiter&&r.bulletChar===i.bulletChar)||((o=e.addChild("list",e.nextNonspace)).listData=n),(o=e.addChild("item",e.nextNonspace)).listData=n,1)},function(e){return e.indented&&"paragraph"!==e.tip.type&&!e.blank?(e.advanceOffset(4,!0),e.closeUnmatchedBlocks(),e.addChild("codeBlock",e.offset),2):0},function(e,t){var n=t.stringContent;if("paragraph"===t.type&&!e.indented&&!e.blank){var r=n.length-1,i=n.lastIndexOf("\n",r-1)+1,o=n.slice(i,r),s=e.currentLine.slice(e.nextNonspace),a=wt(o),l=a[0],c=a[1],u=wt(s),h=u[0],p=u[1],f=/^[ \t]*:?-+:?[ \t]*$/;if(!c.length||!p.length||p.some(function(e){return!f.test(e)})||1===p.length&&0!==s.indexOf("|"))return 0;var d=t.lineOffsets,m=e.lineNumber-1,g=Pe(d)+1,v=be("table",[[m,g],[e.lineNumber,e.offset]]);if(v.columns=p.map(function(){return{align:null}}),t.insertAfter(v),1===d.length)t.unlink();else{t.stringContent=n.slice(0,i);var y=i-(n.lastIndexOf("\n",i-2)+1)-1;e.lastLineLength=d[d.length-2]+y,e.finalize(t,m-1)}e.advanceOffset(e.currentLine.length-e.offset,!1);var b=be("tableHead",[[m,g],[e.lineNumber,e.offset]]);v.appendChild(b);var k=be("tableRow",[[m,g],[m,g+o.length-1]]),w=be("tableDelimRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.offset]]);b.appendChild(k),b.appendChild(w),xt("tableCell",c,m,g+l).forEach(function(e){k.appendChild(e)});var x=xt("tableDelimCell",p,e.lineNumber,e.nextNonspace+1+h);return x.forEach(function(e){w.appendChild(e)}),v.columns=x.map(Ct),e.tip=v,2}return 0},function(e,t){if("table"!==t.type&&"tableBody"!==t.type||!e.blank&&-1===e.currentLine.indexOf("|"))return 0;if(e.advanceOffset(e.currentLine.length-e.offset,!1),e.blank){var n=t;return"tableBody"===t.type&&(n=t.parent,e.finalize(t,e.lineNumber-1)),e.finalize(n,e.lineNumber-1),0}var r=t;"table"===t.type&&((r=e.addChild("tableBody",e.nextNonspace)).stringContent=null);var i=be("tableRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.currentLine.length]]);r.appendChild(i);var o=r.parent,s=wt(e.currentLine.slice(e.nextNonspace)),a=s[0];return xt("tableCell",s[1],e.lineNumber,e.nextNonspace+1+a).forEach(function(e,t){t>=o.columns.length&&(e.ignored=!0),i.appendChild(e)}),2},function(e){var t;if(!e.indented&&!Nt.test(e.currentLine)&&(t=e.currentLine.match(St))){var n=t[1].length;e.closeUnmatchedBlocks();var r=e.addChild("customBlock",e.nextNonspace);return r.syntaxLength=n,r.offset=e.indent,e.advanceNextNonspace(),e.advanceOffset(n,!1),2}return 0}],Ft=/^(-{3}|\+{3}|;{3})$/,Pt=function(e,t){var n=e.currentLine,r=e.lineNumber,i=e.indented;return 1===r&&!i&&"document"===t.type&&Ft.test(n)?(e.closeUnmatchedBlocks(),e.addChild("frontMatter",e.nextNonspace).stringContent=n,e.advanceNextNonspace(),e.advanceOffset(n.length,!1),2):0},Bt={continue:function(e,t){var n=e.currentLine,r=n.match(Ft);return"frontMatter"===t.type&&r?(t.stringContent+=n,e.lastLineLength=r[0].length,e.finalize(t,e.lineNumber),2):0},finalize:function(e,t){null!==t.stringContent&&(t.literal=t.stringContent,t.stringContent=null)},canContain:function(){return!1},acceptsLines:!0},zt=[/./,/<\/(?:script|pre|style)>/i,/-->/,/\?>/,/>/,/\]\]>/],qt=/^[#`~*+_=<>0-9-;$]/,_t=/\r\n|\n|\r/;function jt(){return be("document",[[1,1],[0,0]])}var Ht={smart:!1,tagFilter:!1,extendedAutolinks:!1,disallowedHtmlBlockTags:[],referenceDefinition:!1,disallowDeepHeading:!1,customParser:null,frontMatter:!1},Vt=function(){function e(e){this.options=r(r({},Ht),e),this.doc=jt(),this.tip=this.doc,this.oldtip=this.doc,this.lineNumber=0,this.offset=0,this.column=0,this.nextNonspace=0,this.nextNonspaceColumn=0,this.indent=0,this.currentLine="",this.indented=!1,this.blank=!1,this.partiallyConsumedTab=!1,this.allClosed=!0,this.lastMatchedContainer=this.doc,this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.lastLineLength=0,this.lines=[],this.options.frontMatter&&(kt.frontMatter=Bt,It.unshift(Pt)),this.inlineParser=new ct(this.options)}return e.prototype.advanceOffset=function(e,t){void 0===t&&(t=!1);for(var n,r,i,o=this.currentLine;e>0&&(i=o[this.offset]);)"\t"===i?(n=4-this.column%4,t?(this.partiallyConsumedTab=n>e,r=n>e?e:n,this.column+=r,this.offset+=this.partiallyConsumedTab?0:1,e-=r):(this.partiallyConsumedTab=!1,this.column+=n,this.offset+=1,e-=1)):(this.partiallyConsumedTab=!1,this.offset+=1,this.column+=1,e-=1)},e.prototype.advanceNextNonspace=function(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn,this.partiallyConsumedTab=!1},e.prototype.findNextNonspace=function(){for(var e,t=this.currentLine,n=this.offset,r=this.column;""!==(e=t.charAt(n));)if(" "===e)n++,r++;else{if("\t"!==e)break;n++,r+=4-r%4}this.blank="\n"===e||"\r"===e||""===e,this.nextNonspace=n,this.nextNonspaceColumn=r,this.indent=this.nextNonspaceColumn-this.column,this.indented=this.indent>=4},e.prototype.addLine=function(){if(this.partiallyConsumedTab){this.offset+=1;var e=4-this.column%4;this.tip.stringContent+=Q(" ",e)}this.tip.lineOffsets?this.tip.lineOffsets.push(this.offset):this.tip.lineOffsets=[this.offset],this.tip.stringContent+=this.currentLine.slice(this.offset)+"\n"},e.prototype.addChild=function(e,t){for(;!kt[this.tip.type].canContain(e);)this.finalize(this.tip,this.lineNumber-1);var n=t+1,r=be(e,[[this.lineNumber,n],[0,0]]);return r.stringContent="",this.tip.appendChild(r),this.tip=r,r},e.prototype.closeUnmatchedBlocks=function(){if(!this.allClosed){for(;this.oldtip!==this.lastMatchedContainer;){var e=this.oldtip.parent;this.finalize(this.oldtip,this.lineNumber-1),this.oldtip=e}this.allClosed=!0}},e.prototype.finalize=function(e,t){var n=e.parent;e.open=!1,e.sourcepos[1]=[t,this.lastLineLength],kt[e.type].finalize(this,e),this.tip=n},e.prototype.processInlines=function(e){var t,n=this.options.customParser,r=e.walker();for(this.inlineParser.refMap=this.refMap,this.inlineParser.refLinkCandidateMap=this.refLinkCandidateMap,this.inlineParser.refDefCandidateMap=this.refDefCandidateMap,this.inlineParser.options=this.options;t=r.next();){var i=t.node,o=t.entering,s=i.type;n&&n[s]&&n[s](i,{entering:o,options:this.options}),o||"paragraph"!==s&&"heading"!==s&&("tableCell"!==s||i.ignored)||this.inlineParser.parse(i)}},e.prototype.incorporateLine=function(e){var t=this.doc;this.oldtip=this.tip,this.offset=0,this.column=0,this.blank=!1,this.partiallyConsumedTab=!1,this.lineNumber+=1,-1!==e.indexOf("\0")&&(e=e.replace(/\0/g,"�")),this.currentLine=e;for(var n,r=!0;(n=t.lastChild)&&n.open;){switch(t=n,this.findNextNonspace(),kt[t.type].continue(this,t)){case 0:break;case 1:r=!1;break;case 2:return void(this.lastLineLength=e.length);default:throw new Error("continue returned illegal value, must be 0, 1, or 2")}if(!r){t=t.parent;break}}this.allClosed=t===this.oldtip,this.lastMatchedContainer=t;for(var i="paragraph"!==t.type&&kt[t.type].acceptsLines,o=It.length;!i;){if(this.findNextNonspace(),"table"!==t.type&&"tableBody"!==t.type&&"paragraph"!==t.type&&!this.indented&&!qt.test(e.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(var s=0;s<o;){var a=It[s](this,t);if(1===a){t=this.tip;break}if(2===a){t=this.tip,i=!0;break}s++}if(s===o){this.advanceNextNonspace();break}}if(this.allClosed||this.blank||"paragraph"!==this.tip.type){this.closeUnmatchedBlocks(),this.blank&&t.lastChild&&(t.lastChild.lastLineBlank=!0);for(var l=t.type,c=this.blank&&!("blockQuote"===l||ke(t)&&t.isFenced||"item"===l&&!t.firstChild&&t.sourcepos[0][0]===this.lineNumber),u=t;u;)u.lastLineBlank=c,u=u.parent;kt[l].acceptsLines?(this.addLine(),"htmlBlock"===t.type&&t.htmlBlockType>=1&&t.htmlBlockType<=5&&zt[t.htmlBlockType].test(this.currentLine.slice(this.offset))&&(this.lastLineLength=e.length,this.finalize(t,this.lineNumber))):this.offset<e.length&&!this.blank&&(t=this.addChild("paragraph",this.offset),this.advanceNextNonspace(),this.addLine())}else this.addLine();this.lastLineLength=e.length},e.prototype.parse=function(e,t){this.doc=jt(),this.tip=this.doc,this.lineNumber=0,this.lastLineLength=0,this.offset=0,this.column=0,this.lastMatchedContainer=this.doc,this.currentLine="";var n=e.split(_t),r=n.length;this.lines=t||n,this.options.referenceDefinition&&this.clearRefMaps(),10===e.charCodeAt(e.length-1)&&(r-=1);for(var i=0;i<r;i++)this.incorporateLine(n[i]);for(;this.tip;)this.finalize(this.tip,r);return this.processInlines(this.doc),this.doc},e.prototype.partialParseStart=function(e,t){this.doc=jt(),this.tip=this.doc,this.lineNumber=e-1,this.lastLineLength=0,this.offset=0,this.column=0,this.lastMatchedContainer=this.doc,this.currentLine="";for(var n=t.length,r=0;r<n;r++)this.incorporateLine(t[r]);return this.doc},e.prototype.partialParseExtends=function(e){for(var t=0;t<e.length;t++)this.incorporateLine(e[t])},e.prototype.partialParseFinish=function(){for(;this.tip;)this.finalize(this.tip,this.lineNumber);this.processInlines(this.doc)},e.prototype.setRefMaps=function(e,t,n){this.refMap=e,this.refLinkCandidateMap=t,this.refDefCandidateMap=n},e.prototype.clearRefMaps=function(){[this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap].forEach(function(e){var t;t=e,Object.keys(t).forEach(function(e){delete t[e]})})},e}();function $t(e,t){return e[0]<t[0]?1:e[0]>t[0]?-1:e[1]<t[1]?1:e[1]>t[1]?-1:0}function Ut(e,t){var n=e[0];return 1===$t(e[1],t)?1:-1===$t(n,t)?-1:0}function Jt(e,t){for(var n=0,r=t;n<r.length;n++){var i=r[n];e.insertBefore(i)}}function Wt(e,t){var n=e[0];return e[1][0]<t?1:n[0]>t?-1:0}function Kt(e,t){for(var n=e.firstChild;n;){var r=Wt(n.sourcepos,t);if(0===r)return n;if(-1===r)return n.prev||n;n=n.next}return e.lastChild}function Gt(e){return function(e){return ie[e]}(e)||null}function Zt(e,t,n){if(void 0===n&&(n=null),t)for(var r=t.walker();t&&t!==n;){e(t);var i=r.next();if(!i)break;t=i.node}}var Xt=/\r\n|\n|\r/;function Yt(e){return{id:e.id,title:e.title,sourcepos:e.sourcepos,unlinked:!1,destination:e.dest}}var Qt=function(){function e(e,t){this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.referenceDefinition=!!(null==t?void 0:t.referenceDefinition),this.parser=new Vt(t),this.parser.setRefMaps(this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap),this.eventHandlerMap={change:[]},e=e||"",this.lineTexts=e.split(Xt),this.root=this.parser.parse(e,this.lineTexts)}return e.prototype.updateLineTexts=function(e,t,n){var r,o=e[0],s=e[1],a=t[0],l=t[1],c=n.split(Xt),u=c.length,h=this.lineTexts[o-1],p=this.lineTexts[a-1];c[0]=h.slice(0,s-1)+c[0],c[u-1]=c[u-1]+p.slice(l-1);var f=a-o+1;return(r=this.lineTexts).splice.apply(r,i([o-1,f],c)),u-f},e.prototype.updateRootNodeState=function(){if(1===this.lineTexts.length&&""===this.lineTexts[0])return this.root.lastLineBlank=!0,void(this.root.sourcepos=[[1,1],[1,0]]);this.root.lastChild&&(this.root.lastLineBlank=this.root.lastChild.lastLineBlank);for(var e=this.lineTexts,t=e.length-1;""===e[t];)t-=1;e.length-2>t&&(t+=1),this.root.sourcepos[1]=[t+1,e[t].length]},e.prototype.replaceRangeNodes=function(e,t,n){e?(Jt(e,n),function(e,t){if(e.parent===t.parent&&e!==t){for(var n=e.next;n&&n!==t;){for(var r=n.next,i=0,o=["parent","prev","next"];i<o.length;i++){var s=o[i];n[s]&&(oe(n[s].id),n[s]=null)}n=r}e.next=t.next,t.next?t.next.prev=e:e.parent.lastChild=e}}(e,t),[e.id,t.id].forEach(function(e){return oe(e)}),e.unlink()):t?(Jt(t,n),oe(t.id),t.unlink()):function(e,t){for(var n=t.length-1;n>=0;n-=1)e.prependChild(t[n])}(this.root,n)},e.prototype.getNodeRange=function(e,t){var n=Kt(this.root,e[0]),r=Kt(this.root,t[0]);return r&&r.next&&t[0]+1===r.next.sourcepos[0][0]&&(r=r.next),[n,r]},e.prototype.trigger=function(e,t){this.eventHandlerMap[e].forEach(function(e){e(t)})},e.prototype.extendEndLine=function(e){for(;""===this.lineTexts[e];)e+=1;return e},e.prototype.parseRange=function(e,t,n,r){var i;e&&e.prev&&(we(e.prev)&&function(e){var t=e.match(/^[ \t]+/);if(t&&(t[0].length>=2||/\t/.test(t[0])))return!0;var n=t?e.slice(t.length):e;return At.test(n)||Lt.test(n)}(this.lineTexts[n-1])||"table"===e.prev.type&&!mt(i=this.lineTexts[n-1])&&-1!==i.indexOf("|"))&&(n=(e=e.prev).sourcepos[0][0]);for(var o=this.lineTexts.slice(n-1,r),s=this.parser.partialParseStart(n,o),a=t?t.next:this.root.firstChild,l=s.lastChild,c=l&&ke(l)&&l.open,u=l&&Ce(l)&&l.open,h=l&&we(l);(c||u)&&a||h&&a&&("list"===a.type||a.sourcepos[0][1]>=2);){var p=this.extendEndLine(a.sourcepos[1][0]);this.parser.partialParseExtends(this.lineTexts.slice(r,p)),e||(e=t),t=a,r=p,a=a.next}return this.parser.partialParseFinish(),{newNodes:function(e){for(var t=[],n=e.firstChild;n;)t.push(n),n=n.next;return t}(s),extStartNode:e,extEndNode:t}},e.prototype.getRemovedNodeRange=function(e,t){return!e||e&&xe(e)||t&&xe(t)?null:{id:[e.id,t.id],line:[e.sourcepos[0][0]-1,t.sourcepos[1][0]-1]}},e.prototype.markDeletedRefMap=function(e,t){var n=this;if(!qe(this.refMap)){var r=function(e){if(xe(e)){var t=n.refMap[e.label];t&&e.id===t.id&&(t.unlinked=!0)}};e&&Zt(r,e.parent,t),t&&Zt(r,t)}},e.prototype.replaceWithNewRefDefState=function(e){var t=this;if(!qe(this.refMap)){var n=function(e){if(xe(e)){var n=e.label,r=t.refMap[n];r&&!r.unlinked||(t.refMap[n]=Yt(e))}};e.forEach(function(e){Zt(n,e)})}},e.prototype.replaceWithRefDefCandidate=function(){var e=this;qe(this.refDefCandidateMap)||ze(this.refDefCandidateMap,function(t,n){var r=n.label,i=n.sourcepos,o=e.refMap[r];(!o||o.unlinked||o.sourcepos[0][0]>i[0][0])&&(e.refMap[r]=Yt(n))})},e.prototype.getRangeWithRefDef=function(e,t,n,r,i){if(this.referenceDefinition&&!qe(this.refMap)){var o=Kt(this.root,e-1),s=Kt(this.root,t+1);o&&xe(o)&&o!==n&&o!==r&&(e=(n=o).sourcepos[0][0]),s&&xe(s)&&s!==n&&s!==r&&(r=s,t=this.extendEndLine(r.sourcepos[1][0]+i))}return[n,r,e,t]},e.prototype.parse=function(e,t,n){void 0===n&&(n=0);var r=this.getNodeRange(e,t),i=r[0],o=r[1],s=i?Math.min(i.sourcepos[0][0],e[0]):e[0],a=this.extendEndLine((o?Math.max(o.sourcepos[1][0],t[0]):t[0])+n),l=this.parseRange.apply(this,this.getRangeWithRefDef(s,a,i,o,n)),c=l.newNodes,u=l.extStartNode,h=l.extEndNode,p=this.getRemovedNodeRange(u,h),f=h?h.next:this.root.firstChild;return this.referenceDefinition?(this.markDeletedRefMap(u,h),this.replaceRangeNodes(u,h,c),this.replaceWithNewRefDefState(c)):this.replaceRangeNodes(u,h,c),{nodes:c,removedNodeRange:p,nextNode:f}},e.prototype.parseRefLink=function(){var e=this,t=[];return qe(this.refMap)||ze(this.refMap,function(n,r){r.unlinked&&delete e.refMap[n],ze(e.refLinkCandidateMap,function(r,i){var o=i.node;i.refLabel===n&&t.push(e.parse(o.sourcepos[0],o.sourcepos[1]))})}),t},e.prototype.removeUnlinkedCandidate=function(){qe(this.refDefCandidateMap)||[this.refLinkCandidateMap,this.refDefCandidateMap].forEach(function(e){ze(e,function(t){(function(e){var t=Gt(e);if(!t)return!0;for(;t&&"document"!==t.type;){if(!t.parent&&!t.prev&&!t.next)return!0;t=t.parent}return!1})(t)&&delete e[t]})})},e.prototype.editMarkdown=function(e,t,n){var i=this.updateLineTexts(e,t,n),o=this.parse(e,t,i),s=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=r({},e);return t.forEach(function(e){delete i[e]}),i}(o,"nextNode");!function(e,t){if(e&&e.parent&&0!==t){var n,r=e.parent.walker();for(r.resumeAt(e,!0);n=r.next();){var i=n.node;n.entering&&(i.sourcepos[0][0]+=t,i.sourcepos[1][0]+=t)}}}(o.nextNode,i),this.updateRootNodeState();var a=[s];return this.referenceDefinition&&(this.removeUnlinkedCandidate(),this.replaceWithRefDefCandidate(),a=a.concat(this.parseRefLink())),this.trigger("change",a),a},e.prototype.getLineTexts=function(){return this.lineTexts},e.prototype.getRootNode=function(){return this.root},e.prototype.findNodeAtPosition=function(e){var t=function(e,t){for(var n=e,r=null;n;){var i=Ut(n.sourcepos,t);if(0===i){if(!n.firstChild)return n;r=n,n=n.firstChild}else{if(-1===i)return r;if(!n.next)return r;n=n.next}}return n}(this.root,e);return t&&t!==this.root?t:null},e.prototype.findFirstNodeAtLine=function(e){return function(e,t){for(var n=e.firstChild,r=null;n;){var i=Wt(n.sourcepos,t);if(0===i){if(n.sourcepos[0][0]===t||!n.firstChild)return n;r=n,n=n.firstChild}else{if(-1===i)break;r=n,n=n.next}}return r?function(e){for(;e.parent&&"document"!==e.parent.type&&e.parent.sourcepos[0][0]===e.sourcepos[0][0];)e=e.parent;return e}(function(e){for(;e.lastChild;)e=e.lastChild;return e}(r)):null}(this.root,e)},e.prototype.on=function(e,t){this.eventHandlerMap[e].push(t)},e.prototype.off=function(e,t){var n=this.eventHandlerMap[e],r=n.indexOf(t);n.splice(r,1)},e.prototype.findNodeById=function(e){return Gt(e)},e.prototype.removeAllNode=function(){ie={}},e}(),en=new RegExp("<(/?(?:"+["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"].join("|")+")[^>]*>)","ig");function tn(e){return en.test(e)?e.replace(en,function(e,t){return"<"+t}):e}var nn={heading:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"h"+e.level,outerNewLine:!0}},text:function(e){return{type:"text",content:e.literal}},softbreak:function(e,t){return{type:"html",content:t.options.softbreak}},linebreak:function(){return{type:"html",content:"<br />\n"}},emph:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"em"}},strong:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"strong"}},mark:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"mark"}},superscript:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"sup"}},subscript:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"sub"}},underline:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"u"}},paragraph:function(e,t){var n,r=t.entering,i=null===(n=e.parent)||void 0===n?void 0:n.parent;return i&&"list"===i.type&&i.listData.tight?null:{type:r?"openTag":"closeTag",tagName:"p",outerNewLine:!0}},thematicBreak:function(){return{type:"openTag",tagName:"hr",outerNewLine:!0,selfClose:!0}},blockQuote:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"blockquote",outerNewLine:!0,innerNewLine:!0}},list:function(e,t){var n=t.entering,r=e.listData,i=r.type,o=r.start,s="bullet"===i?"ul":"ol",a={};return"ol"===s&&null!==o&&1!==o&&(a.start=o.toString()),{type:n?"openTag":"closeTag",tagName:s,attributes:a,outerNewLine:!0}},item:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"li",outerNewLine:!0}},htmlInline:function(e,t){return{type:"html",content:t.options.tagFilter?tn(e.literal):e.literal}},htmlBlock:function(e,t){var n=t.options,r=n.tagFilter?tn(e.literal):e.literal;return n.nodeId?[{type:"openTag",tagName:"div",outerNewLine:!0},{type:"html",content:r},{type:"closeTag",tagName:"div",outerNewLine:!0}]:{type:"html",content:r,outerNewLine:!0}},code:function(e){return[{type:"openTag",tagName:"code"},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"}]},codeBlock:function(e){var t=e.info,n=t?t.split(/\s+/):[],r=[];return n.length>0&&n[0].length>0&&r.push("language-"+Y(n[0])),[{type:"openTag",tagName:"pre",outerNewLine:!0},{type:"openTag",tagName:"code",classNames:r},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre",outerNewLine:!0}]},link:function(e,t){if(t.entering){var n=e,i=n.title,o=n.destination;return{type:"openTag",tagName:"a",attributes:r({href:Y(o)},i&&{title:Y(i)})}}return{type:"closeTag",tagName:"a"}},image:function(e,t){var n=t.getChildrenText,i=t.skipChildren,o=e,s=o.title,a=o.destination;return i(),{type:"openTag",tagName:"img",selfClose:!0,attributes:r({src:Y(a),alt:n(e)},s&&{title:Y(s)})}},customBlock:function(e,t,n){var r=e.info.trim().toLowerCase(),i=n[r];if(i)try{return i(e,t)}catch(e){console.warn("[@techie_doubts/tui.editor.2026] - The error occurred when "+r+" block node was parsed in markdown renderer: "+e)}return[{type:"openTag",tagName:"div",outerNewLine:!0},{type:"text",content:e.literal},{type:"closeTag",tagName:"div",outerNewLine:!0}]},frontMatter:function(e){return[{type:"openTag",tagName:"div",outerNewLine:!0,attributes:{style:"white-space: pre; display: none;"}},{type:"text",content:e.literal},{type:"closeTag",tagName:"div",outerNewLine:!0}]},customInline:function(e,t,n){var r=e,i=r.info,o=r.firstChild,s=i.trim().toLowerCase(),a=n[s],l=t.entering;if(a)try{return a(e,t)}catch(e){console.warn("[@techie_doubts/tui.editor.2026] - The error occurred when "+s+" inline node was parsed in markdown renderer: "+e)}return l?[{type:"openTag",tagName:"span"},{type:"text",content:"$$"+i+(o?" ":"")}]:[{type:"text",content:"$$"},{type:"closeTag",tagName:"span"}]}},rn={strike:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"del"}},item:function(e,t){var n=t.entering,i=e.listData,o=i.checked,s=i.task;if(n){var a={type:"openTag",tagName:"li",outerNewLine:!0};return s?[a,{type:"openTag",tagName:"input",selfClose:!0,attributes:r(r({},o&&{checked:""}),{disabled:"",type:"checkbox"})},{type:"text",content:" "}]:a}return{type:"closeTag",tagName:"li",outerNewLine:!0}},table:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"table",outerNewLine:!0}},tableHead:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"thead",outerNewLine:!0}},tableBody:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"tbody",outerNewLine:!0}},tableRow:function(e,t){if(t.entering)return{type:"openTag",tagName:"tr",outerNewLine:!0};var n=[];if(e.lastChild)for(var r=e.parent.parent.columns.length,i=e.lastChild.endIdx+1;i<r;i+=1)n.push({type:"openTag",tagName:"td",outerNewLine:!0},{type:"closeTag",tagName:"td",outerNewLine:!0});return n.push({type:"closeTag",tagName:"tr",outerNewLine:!0}),n},tableCell:function(e,t){var n=t.entering;if(e.ignored)return{type:"text",content:""};var i=e.parent.parent,o="tableHead"===i.type?"th":"td",s=i.parent.columns[e.startIdx],a=(null==s?void 0:s.align)?{align:s.align}:null;return n?r({type:"openTag",tagName:o,outerNewLine:!0},a&&{attributes:a}):{type:"closeTag",tagName:o,outerNewLine:!0}}},on={softbreak:"\n",gfm:!1,tagFilter:!1,nodeId:!1};function sn(e){for(var t=[],n=e.walker(),r=null;r=n.next();){var i=r.node;"text"===i.type&&t.push(i.literal)}return t.join("")}var an=function(){function e(e){this.buffer=[],this.options=r(r({},on),e),this.convertors=this.createConvertors(),delete this.options.convertors}return e.prototype.createConvertors=function(){var e=r({},nn);if(this.options.gfm&&(e=r(r({},e),rn)),this.options.convertors){var t=this.options.convertors,n=Object.keys(t),i=r(r({},nn),rn);n.forEach(function(n){var r=e[n],o=t[n],s=-1===Object.keys(i).indexOf(n)?n.toLowerCase():n;e[s]=r?function(e,t,n){return t.origin=function(){return r(e,t,n)},o(e,t)}:o})}return e},e.prototype.getConvertors=function(){return this.convertors},e.prototype.getOptions=function(){return this.options},e.prototype.render=function(e){var t=this;this.buffer=[];for(var n=e.walker(),r=null,i=function(){var e=r.node,i=r.entering,s=o.convertors[e.type];if(!s)return"continue";var a=!1,l={entering:i,leaf:!ne(e),options:o.options,getChildrenText:sn,skipChildren:function(){a=!0}},c=Ce(e)||function(e){return"customInline"===e.type}(e)?s(e,l,o.convertors):s(e,l);c&&((Array.isArray(c)?c:[c]).forEach(function(n,r){"openTag"===n.type&&t.options.nodeId&&0===r&&(n.attributes||(n.attributes={}),n.attributes["data-nodeid"]=String(e.id)),t.renderHTMLNode(n)}),a&&(n.resumeAt(e,!1),n.next()))},o=this;r=n.next();)i();return this.addNewLine(),this.buffer.join("")},e.prototype.renderHTMLNode=function(e){switch(e.type){case"openTag":case"closeTag":this.renderElementNode(e);break;case"text":this.renderTextNode(e);break;case"html":this.renderRawHtmlNode(e)}},e.prototype.generateOpenTagString=function(e){var t=this,n=e.tagName,r=e.classNames,i=e.attributes;this.buffer.push("<"+n),r&&r.length>0&&this.buffer.push(' class="'+r.join(" ")+'"'),i&&Object.keys(i).forEach(function(e){var n=i[e];null!=n&&("class"===e&&""===n||t.buffer.push(" "+e+'="'+n+'"'))}),e.selfClose&&this.buffer.push(" /"),this.buffer.push(">")},e.prototype.generateCloseTagString=function(e){var t=e.tagName;this.buffer.push("</"+t+">")},e.prototype.addNewLine=function(){this.buffer.length&&"\n"!==Pe(Pe(this.buffer))&&this.buffer.push("\n")},e.prototype.addOuterNewLine=function(e){e.outerNewLine&&this.addNewLine()},e.prototype.addInnerNewLine=function(e){e.innerNewLine&&this.addNewLine()},e.prototype.renderTextNode=function(e){this.buffer.push(Y(e.content))},e.prototype.renderRawHtmlNode=function(e){this.addOuterNewLine(e),this.buffer.push(e.content),this.addOuterNewLine(e)},e.prototype.renderElementNode=function(e){"openTag"===e.type?(this.addOuterNewLine(e),this.generateOpenTagString(e),e.selfClose?this.addOuterNewLine(e):this.addInnerNewLine(e)):(this.addInnerNewLine(e),this.generateCloseTagString(e),this.addOuterNewLine(e))},e}(),ln="[A-Za-z][A-Za-z0-9-]*",cn="(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)",un=new RegExp("^(?:<("+ln+")("+cn+")*\\s*/?>|</("+ln+")\\s*[>])","i");function hn(e,t){return-1!==e.indexOf(t)}/Mac/.test(navigator.platform),new RegExp('[&<>"]',"g");var pn=["rel","target","hreflang","type"];function fn(e){return"object"==typeof e&&null!==e}function dn(t,n){var r=e({},t);return t&&n&&Object.keys(n).forEach(function(e){fn(r[e])?Array.isArray(n[e])?r[e]=mn(n[e]):r.hasOwnProperty(e)?r[e]=dn(r[e],n[e]):r[e]=gn(n[e]):r[e]=n[e]}),r}function mn(e){return e.map(function(e){return fn(e)?Array.isArray(e)?mn(e):gn(e):e})}function gn(e){var t=Object.keys(e);return t.length?t.reduce(function(t,n){return fn(e[n])?t[n]=Array.isArray(e[n])?mn(e[n]):gn(e[n]):t[n]=e[n],t},{}):e}function vn(e,t){return void 0===t&&(t={}),Object.keys(t).forEach(function(n){e.hasOwnProperty(n)&&"object"==typeof e[n]?Array.isArray(t[n])?e[n]=t[n]:vn(e[n],t[n]):e[n]=t[n]}),e}function yn(e,t){return e>t?[t,e]:[e,t]}function bn(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=[],r=0,i=e;r<i.length;r++){var o,s=i[r];(o=Array.isArray(s)?s[0]?s[1]:null:s)&&n.push("toastui-editor-"+o)}return n.join(" ")}function kn(e){e.parentNode&&e.parentNode.removeChild(e)}function wn(e,t,n){void 0===n&&(n=!e.classList.contains(t)),n?e.classList.add(t):e.classList.remove(t)}function xn(e,t,n){"string"!=typeof t?Object.keys(t).forEach(function(n){e.style[n]=t[n]}):e.style[t]=n}function Cn(e){return e.sourcepos[0][1]}function Sn(e){var t=e.firstChild.literal;switch(e.type){case"emph":return"*"+t+"*";case"strong":return"**"+t+"**";case"strike":return"~~"+t+"~~";case"mark":return"=="+t+"==";case"superscript":return"^"+t+"^";case"subscript":return"~"+t+"~";case"underline":return"++"+t+"++";case"code":return"`"+t+"`";case"link":case"image":var n=e,r=n.destination,i=n.title;return("link"===e.type?"":"!")+"["+t+"]("+r+(i?' "'+i+'"':"")+")";default:return null}}var Nn={},Tn=/\$\$widget\d+\s/;function On(e){var t=e.search(Tn);if(-1!==t){var n=e.substring(t).replace(Tn,"").replace("$$","");e=e.substring(0,t),e+=On(n)}return e}var Mn=a(651),En=a.n(Mn),Dn=["iframe","embed"],An=[];function Ln(t,n){return En().sanitize(t,e({ADD_TAGS:An,ADD_ATTR:["rel","target","hreflang","type"],FORBID_TAGS:["input","script","textarea","form","button","select","meta","style","link","title","object","base"]},n))}var Rn=/^\s*<\s*\//,In={paragraph:function(e,t){var n=t.entering,r=t.origin;return t.options.nodeId?{type:n?"openTag":"closeTag",outerNewLine:!0,tagName:"p"}:r()},softbreak:function(e){return{type:"html",content:e.prev&&"htmlInline"===e.prev.type&&/<br ?\/?>/.test(e.prev.literal)?"\n":"<br>\n"}},item:function(e,t){if(t.entering){var n={},r=[];return e.listData.task&&(n["data-task"]="",r.push("task-list-item"),e.listData.checked&&(r.push("checked"),n["data-task-checked"]="")),{type:"openTag",tagName:"li",classNames:r,attributes:n,outerNewLine:!0}}return{type:"closeTag",tagName:"li",outerNewLine:!0}},code:function(e){return[{type:"openTag",tagName:"code",attributes:{"data-backticks":String(e.tickCount)}},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"}]},codeBlock:function(e){var t=e,n=t.fenceLength,r=t.info,i=r?r.split(/\s+/):[],o=[],s={},a={},l=null;if(n>3&&(s["data-backticks"]=n),i.length>0&&i[0].length>0){var c=i[0],u=c.match(/^(.+?)=(\d*)$/),h=c;u&&(h=u[1],l=u[2]?Number(u[2]):1),o.push("lang-"+h),s["data-language"]=h}if(null!==l){o.push("line-numbers");for(var p=(e.literal||"").replace(/\n$/,"").split("\n").length,f=[],d=0;d<p;d+=1)f.push(String(l+d));return a["data-line-numbers"]=f.join("\n"),[{type:"openTag",tagName:"pre",classNames:o,attributes:a},{type:"openTag",tagName:"code",attributes:s},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre"}]}return[{type:"openTag",tagName:"pre",classNames:o},{type:"openTag",tagName:"code",attributes:s},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre"}]},customInline:function(e,t){var n=t.origin,r=t.entering,i=t.skipChildren,o=e.info;if(-1!==o.indexOf("widget")&&r){i();var s=function(e){for(var t,n="",r=e.walker();t=r.next();){var i=t.node;t.entering&&(i!==e&&"text"!==i.type?(n+=Sn(i),r.resumeAt(e,!1),r.next()):"text"===i.type&&(n+=i.literal))}return n}(e),a=function(e,t){var n=Nn[e],r=n.rule,i=n.toDOM,o=On(t).match(r);return o&&(t=o[0]),i(t)}(o,s).outerHTML;return[{type:"openTag",tagName:"span",classNames:["tui-widget"]},{type:"html",content:a},{type:"closeTag",tagName:"span"}]}return n()}},Fn=["mermaid","uml","chart"];function Pn(t,n){var r=e({},In);if(t&&(r.link=function(n,r){var i=r.entering,o=(0,r.origin)();return i&&(o.attributes=e(e({},o.attributes),t)),o}),n){Object.keys(n).forEach(function(t){var i=r[t],o=n[t];i&&"function"==typeof o?r[t]=function(t,n){var r=e({},n);return r.origin=function(){return i(t,n)},o(t,r)}:hn(["htmlBlock","htmlInline"],t)&&"function"!=typeof o?r[t]=function(t,n){var r,i=t.literal.match(un);if(i){var s=i[0],a=i[1],l=i[3],c=(a||l).toLowerCase(),u=o[c],h=function(e,t){return e.literal.replace(new RegExp("(<\\s*"+t+"[^>]*>)|(</"+t+"\\s*[>])","ig"),"").trim()}(t,c);if(u){var p=e({},t);return p.attrs=(r=s.match(un)[0].match(new RegExp(cn,"g")))?r.reduce(function(e,t){var n=t.trim().split("="),r=n[0],i=n.slice(1);return i.length&&(e[r]=i.join("=").replace(/'|"/g,"").trim()),e},{}):{},p.childrenHTML=h,p.type=c,n.entering=!Rn.test(t.literal),u(p,n)}}return n.origin()}:r[t]=o});var i=r.codeBlock;r.codeBlock=function(e,t){var r=e.info,o=r?r.split(/\s+/)[0].replace(/[=]\d*$/,"").toLowerCase():"";return Fn.includes(o)&&"function"==typeof n[o]?n[o](e,t):i(e,t)}}return r}var Bn=["UL","OL","BLOCKQUOTE"];function zn(e,t){for(var n=0;e&&e!==t&&(hn(Bn,e.tagName)||(n+=e.offsetTop),e.offsetParent!==t.offsetParent);)e=e.parentElement;return n}function qn(e,t,n){return e&&t>n+e.offsetTop?qn(e.nextElementSibling,t,n)||e:null}var _n={};function jn(e){e&&(delete _n[Number(e.getAttribute("data-nodeid"))],Array.from(e.children).forEach(function(e){jn(e)}))}var Hn=bn("md-preview-highlight"),Vn=function(){function e(e,t){this.scrollHandler=null;var n=document.createElement("div");this.el=n,this.eventEmitter=e,this.isViewer=!!t.isViewer,this.el.className=bn("md-preview");var r=t.linkAttributes,i=t.customHTMLRenderer,o=t.sanitizer,s=t.highlight,a=void 0!==s&&s;this.renderer=new an({gfm:!0,nodeId:!0,convertors:Pn(r,i)}),this.cursorNodeId=null,this.sanitizer=o,this.initEvent(a),this.initContentSection(),this.isViewer&&(this.previewContent.style.overflowWrap="break-word")}return e.prototype.initContentSection=function(){this.previewContent=function(e){var t=document.createElement("div");"string"==typeof e?t.innerHTML=e:t.appendChild(e);var n=t.firstChild;return n}('<div class="'+bn("contents")+'"></div>'),this.isViewer||this.el.appendChild(this.previewContent)},e.prototype.toggleActive=function(e){wn(this.el,"active",e)},e.prototype.initEvent=function(e){var t=this;this.eventEmitter.listen("updatePreview",this.update.bind(this)),this.isViewer||(e&&(this.eventEmitter.listen("changeToolbarState",function(e){var n=e.mdNode,r=e.cursorPos;t.updateCursorNode(n,r)}),this.eventEmitter.listen("blur",function(){t.removeHighlight()})),this.scrollHandler=function(e){t.eventEmitter.emit("scroll","preview",function(e,t){for(var n=t,r=null;n;){var i=n.firstElementChild;if(!i)break;r=n,n=qn(i,e,zn(n,t))}var o=n||r;return o===t?null:o}(e.target.scrollTop,t.previewContent))},this.el.addEventListener("scroll",this.scrollHandler),this.eventEmitter.listen("changePreviewTabPreview",function(){return t.toggleActive(!0)}),this.eventEmitter.listen("changePreviewTabWrite",function(){return t.toggleActive(!1)}))},e.prototype.removeHighlight=function(){if(this.cursorNodeId){var e=this.getElementByNodeId(this.cursorNodeId);e&&this.removeHighlightClass(e)}},e.prototype.removeHighlightClass=function(e){e.classList.remove(Hn),e.className||e.removeAttribute("class")},e.prototype.updateCursorNode=function(e,t){e&&("tableRow"===(e=function(e,t,n){for(void 0===n&&(n=!0),e=n?e:e.parent;e&&"document"!==e.type;){if(t(e))return e;e=e.parent}return null}(e,function(e){return!function(e){switch(e.type){case"code":case"text":case"emph":case"strong":case"strike":case"mark":case"superscript":case"subscript":case"underline":case"link":case"image":case"htmlInline":case"linebreak":case"softbreak":case"customInline":return!0;default:return!1}}(e)})).type?e=function(e,t){for(var n=e.firstChild;n&&n.next&&!(Cn(n.next)>t+1);)n=n.next;return n}(e,t[1]):"tableBody"===e.type&&(e=null));var n=e?e.id:null;if(this.cursorNodeId!==n){var r=this.getElementByNodeId(this.cursorNodeId),i=this.getElementByNodeId(n);r&&this.removeHighlightClass(r),i&&i.classList.add(Hn),this.cursorNodeId=n}},e.prototype.getElementByNodeId=function(e){return e?this.previewContent.querySelector('[data-nodeid="'+e+'"]'):null},e.prototype.update=function(e){var t=this;e.forEach(function(e){return t.replaceRangeNodes(e)}),this.eventEmitter.emit("afterPreviewRender",this)},e.prototype.replaceRangeNodes=function(e){var t=this,n=e.nodes,r=e.removedNodeRange,i=this.previewContent,o=this.eventEmitter.emitReduce("beforePreviewRender",this.sanitizer(n.map(function(e){return t.renderer.render(e)}).join("")));if(r){var s=r.id,a=s[0],l=s[1],c=this.getElementByNodeId(a),u=this.getElementByNodeId(l);if(c){c.insertAdjacentHTML("beforebegin",o);for(var h=c;h&&h!==u;){var p=h.nextElementSibling;kn(h),jn(h),h=p}(null==h?void 0:h.parentNode)&&(kn(h),jn(h))}}else i.insertAdjacentHTML("afterbegin",o)},e.prototype.getRenderer=function(){return this.renderer},e.prototype.destroy=function(){this.scrollHandler&&this.el.removeEventListener("scroll",this.scrollHandler),this.el=null},e.prototype.getElement=function(){return this.el},e.prototype.getHTML=function(){return this.previewContent.innerHTML.replace(/<img class="ProseMirror-separator" alt="">/g,"").replace(/ class="ProseMirror-trailingBreak"/g,"")},e.prototype.setHTML=function(e){this.previewContent.innerHTML=e},e.prototype.setHeight=function(e){xn(this.el,{height:e+"px"})},e.prototype.setMinHeight=function(e){xn(this.el,{minHeight:e+"px"})},e}(),$n=Vn,Un=a(22),Jn=a(388),Wn=a(154),Kn=a(144),Gn=a(398),Zn=function(){function e(){this.keys=[],this.values=[]}return e.prototype.getKeyIndex=function(e){return this.keys.indexOf(e)},e.prototype.get=function(e){return this.values[this.getKeyIndex(e)]},e.prototype.set=function(e,t){var n=this.getKeyIndex(e);return n>-1?this.values[n]=t:(this.keys.push(e),this.values.push(t)),this},e.prototype.has=function(e){return this.getKeyIndex(e)>-1},e.prototype.delete=function(e){var t=this.getKeyIndex(e);return t>-1&&(this.keys.splice(t,1),this.values.splice(t,1),!0)},e.prototype.forEach=function(e,t){var n=this;void 0===t&&(t=this),this.values.forEach(function(r,i){r&&n.keys[i]&&e.call(t,r,n.keys[i],n)})},e.prototype.clear=function(){this.keys=[],this.values=[]},e}(),Xn="en-US",Yn=new(function(){function e(){this.code=Xn,this.langs=new Zn}return e.prototype.setCode=function(e){this.code=e||Xn},e.prototype.setLanguage=function(e,t){var n=this;(e=[].concat(e)).forEach(function(e){if(n.langs.has(e)){var r=n.langs.get(e);n.langs.set(e,Object.assign(r,t))}else n.langs.set(e,t)})},e.prototype.get=function(e,t){t||(t=this.code);var n=this.langs.get(t);n||(n=this.langs.get(Xn));var r=n[e];if(!r)throw new Error('There is no text key "'+e+'" in '+t);return r},e}());var Qn=new Map,er=function(){function e(e,t,n,r){this.table=e,this.tableRows=t,this.tableStartPos=n,this.rowInfo=r}return e.create=function(t){var n=function(e,t){for(var n=e.depth;n;){var r=e.node(n);if(t(r,n))return{node:r,depth:n,offset:n>0?e.before(n):0};n-=1}return null}(t,function(e){return"table"===e.type.name});if(n){var r=n.node,i=n.depth,o=n.offset,s=Qn.get(r);if((null==s?void 0:s.tableStartPos)===o+1)return s;var a=[],l=t.start(i),c=r.child(0),u=r.child(1),h=tr(c,l),p=tr(u,l+c.nodeSize);c.forEach(function(e){return a.push(e)}),u.forEach(function(e){return a.push(e)});var f=new e(r,a,l,h.concat(p));return Qn.set(r,f),f}return null},Object.defineProperty(e.prototype,"totalRowCount",{get:function(){return this.rowInfo.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"totalColumnCount",{get:function(){return this.rowInfo[0].length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tableStartOffset",{get:function(){return this.tableStartPos},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tableEndOffset",{get:function(){return this.tableStartPos+this.table.nodeSize-1},enumerable:!1,configurable:!0}),e.prototype.getCellInfo=function(e,t){return this.rowInfo[e][t]},e.prototype.posAt=function(e,t){for(var n=0,r=this.tableStartPos;;n+=1){var i=r+this.tableRows[n].nodeSize;if(n===e){for(var o=t;o<this.totalColumnCount&&this.rowInfo[n][o].offset<r;)o+=1;return o===this.totalColumnCount?i:this.rowInfo[n][o].offset}r=i}},e.prototype.getNodeAndPos=function(e,t){var n=this.rowInfo[e][t];return{node:this.table.nodeAt(n.offset-this.tableStartOffset),pos:n.offset}},e.prototype.extendedRowspan=function(e,t){return!1},e.prototype.extendedColspan=function(e,t){return!1},e.prototype.getRowspanCount=function(e,t){return 0},e.prototype.getColspanCount=function(e,t){return 0},e.prototype.decreaseColspanCount=function(e,t){return 0},e.prototype.decreaseRowspanCount=function(e,t){return 0},e.prototype.getColspanStartInfo=function(e,t){return null},e.prototype.getRowspanStartInfo=function(e,t){return null},e.prototype.getCellStartOffset=function(e,t){var n=this.rowInfo[e][t].offset;return this.extendedRowspan(e,t)?this.posAt(e,t):n},e.prototype.getCellEndOffset=function(e,t){var n=this.rowInfo[e][t],r=n.offset,i=n.nodeSize;return this.extendedRowspan(e,t)?this.posAt(e,t):r+i},e.prototype.getCellIndex=function(e){for(var t=0;t<this.totalRowCount;t+=1)for(var n=this.rowInfo[t],r=0;r<this.totalColumnCount;r+=1)if(n[r].offset+1>e.pos)return[t,r];return[0,0]},e.prototype.getRectOffsets=function(e,t){var n,r,i;void 0===t&&(t=e),e.pos>t.pos&&(e=(n=[t,e])[0],t=n[1]);var o=this.getCellIndex(e),s=o[0],a=o[1],l=this.getCellIndex(t),c=l[0],u=l[1];return s=(r=yn(s,c))[0],c=r[1],a=(i=yn(a,u))[0],u=i[1],this.getSpannedOffsets({startRowIdx:s,startColIdx:a,endRowIdx:c,endColIdx:u})},e.prototype.getSpannedOffsets=function(e){return e},e}(),tr=function(e,t){var n=[];return e.forEach(function(e,r){var i={rowspanMap:{},colspanMap:{},length:0};e.forEach(function(e,n){for(var o=e.nodeSize,s=0;i[s];)s+=1;i[s]={offset:t+r+n+2,nodeSize:o},i.length+=1}),n.push(i)}),n};function nr(e,t){return vn(er.prototype,e),tr=t,er}var rr=["afterPreviewRender","updatePreview","changeMode","needChangeMode","changeTheme","command","changePreviewStyle","changePreviewTabPreview","changePreviewTabWrite","scroll","contextmenu","show","hide","changeLanguage","changeToolbarState","toggleScrollSync","mixinTableOffsetMapPrototype","setFocusedNode","removePopupWidget","query","openPopup","closePopup","addImageBlobHook","beforePreviewRender","beforeConvertWysiwygToMarkdown","load","loadUI","change","caretChange","destroy","focus","blur","keydown","keyup","wwUserEdit","beforeExportHtml","afterExportHtml"],ir=function(){function t(){var t=this;this.events=new Zn,this.eventTypes=rr.reduce(function(t,n){return e(e({},t),{type:n})},{}),this.hold=!1,rr.forEach(function(e){t.addEventType(e)})}return t.prototype.listen=function(e,t){var n=this.getTypeInfo(e),r=this.events.get(n.type)||[];if(!this.hasEventType(n.type))throw new Error("There is no event type "+n.type);n.namespace&&(t.namespace=n.namespace),r.push(t),this.events.set(n.type,r)},t.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this.getTypeInfo(e),i=this.events.get(r.type),o=[];return!this.hold&&i&&i.forEach(function(e){var n=e.apply(void 0,t);void 0!==n&&o.push(n)}),o},t.prototype.emitReduce=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=this.events.get(e);return!this.hold&&i&&i.forEach(function(e){var r=e.apply(void 0,function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([t],n));r&&(t=r)}),t},t.prototype.getTypeInfo=function(e){var t=e.split(".");return{type:t[0],namespace:t[1]}},t.prototype.hasEventType=function(e){return void 0!==this.eventTypes[this.getTypeInfo(e).type]},t.prototype.addEventType=function(e){if(this.hasEventType(e))throw new Error("There is already have event type "+e);this.eventTypes[e]=e},t.prototype.removeEventHandler=function(e,t){var n=this,r=this.getTypeInfo(e),i=r.type,o=r.namespace;i&&t?this.removeEventHandlerWithHandler(i,t):i&&!o?this.events.delete(i):!i&&o?this.events.forEach(function(e,t){n.removeEventHandlerWithTypeInfo(t,o)}):i&&o&&this.removeEventHandlerWithTypeInfo(i,o)},t.prototype.removeEventHandlerWithHandler=function(e,t){var n=this.events.get(e);if(n){var r=n.indexOf(t);n.indexOf(t)>=0&&n.splice(r,1)}},t.prototype.removeEventHandlerWithTypeInfo=function(e,t){var n=[],r=this.events.get(e);r&&(r.map(function(e){return e.namespace!==t&&n.push(e),null}),this.events.set(e,n))},t.prototype.getEvents=function(){return this.events},t.prototype.holdEventInvoke=function(e){this.hold=!0,e(),this.hold=!1},t}(),or=ir;var sr=function(){function t(t){var n=this;this.options=Object.assign({linkAttributes:null,extendedAutolinks:!1,customHTMLRenderer:null,referenceDefinition:!1,customHTMLSanitizer:null,frontMatter:!1,usageStatistics:!0,theme:"light"},t),this.eventEmitter=new or;var r,i=function(e){if(!e)return null;var t={};return pn.forEach(function(n){void 0!==e[n]&&(t[n]=e[n])}),t}(this.options.linkAttributes),o=function(t){var n=t.plugins,r=t.eventEmitter,i=t.usageStatistics,o=t.instance;return r.listen("mixinTableOffsetMapPrototype",nr),(null!=n?n:[]).reduce(function(t,n){var s=function(e){var t=e.plugin,n={eventEmitter:e.eventEmitter,usageStatistics:e.usageStatistics,instance:e.instance,pmState:{Plugin:Un.Plugin,PluginKey:Un.PluginKey,Selection:Un.Selection,TextSelection:Un.TextSelection},pmView:{Decoration:Wn.Decoration,DecorationSet:Wn.DecorationSet},pmModel:{Fragment:Gn.Fragment},pmRules:{InputRule:Jn.InputRule,inputRules:Jn.inputRules,undoInputRule:Jn.undoInputRule},pmKeymap:{keymap:Kn.keymap},i18n:Yn};if(Array.isArray(t)){var r=t[0],i=t[1];return r(n,void 0===i?{}:i)}return t(n)}({plugin:n,eventEmitter:r,usageStatistics:i,instance:o});if(!s)throw new Error("The return value of the executed plugin is empty.");var a=s.markdownParsers,l=s.toHTMLRenderers,c=s.toMarkdownRenderers,u=s.markdownPlugins,h=s.wysiwygPlugins,p=s.wysiwygNodeViews,f=s.markdownCommands,d=s.wysiwygCommands,m=s.toolbarItems;return l&&(t.toHTMLRenderers=dn(t.toHTMLRenderers,l)),c&&(t.toMarkdownRenderers=dn(t.toMarkdownRenderers,c)),u&&(t.mdPlugins=t.mdPlugins.concat(u)),h&&(t.wwPlugins=t.wwPlugins.concat(h)),p&&(t.wwNodeViews=e(e({},t.wwNodeViews),p)),f&&(t.mdCommands=e(e({},t.mdCommands),f)),d&&(t.wwCommands=e(e({},t.wwCommands),d)),m&&(t.toolbarItems=t.toolbarItems.concat(m)),a&&(t.markdownParsers=e(e({},t.markdownParsers),a)),t},{toHTMLRenderers:{},toMarkdownRenderers:{},mdPlugins:[],wwPlugins:[],wwNodeViews:{},mdCommands:{},wwCommands:{},toolbarItems:[],markdownParsers:{}})}({plugins:this.options.plugins,eventEmitter:this.eventEmitter,usageStatistics:this.options.usageStatistics,instance:this})||{},s=o.toHTMLRenderers,a=o.markdownParsers,l=this.options,c=l.customHTMLRenderer,u=l.extendedAutolinks,h=l.referenceDefinition,p=l.frontMatter,f=l.customHTMLSanitizer,d={linkAttributes:i,customHTMLRenderer:e(e({},s),c),extendedAutolinks:u,referenceDefinition:h,frontMatter:p,sanitizer:f||Ln};r=d.customHTMLRenderer,["htmlBlock","htmlInline"].forEach(function(e){r[e]&&Object.keys(r[e]).forEach(function(e){var t;hn(Dn,t=e)&&An.push(t.toLowerCase())})}),this.options.events&&Object.entries(this.options.events).forEach(function(e){var t=e[0],r=e[1];n.on(t,r)});var m=this.options,g=m.el,v=m.initialValue,y=m.theme,b=g.innerHTML;"light"!==y&&g.classList.add(bn(y)),g.innerHTML="",this.toastMark=new Qt("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:u,referenceDefinition:h,disallowDeepHeading:!0,frontMatter:p,customParser:a}),this.preview=new $n(this.eventEmitter,e(e({},d),{isViewer:!0})),this.preview.previewContent.addEventListener("mousedown",this.toggleTask.bind(this)),v?this.setMarkdown(v):b&&this.preview.setHTML(b),g.appendChild(this.preview.previewContent),this.eventEmitter.emit("load",this)}return t.prototype.toggleTask=function(e){var t=e.target,n=getComputedStyle(t,":before");!t.hasAttribute("data-task-disabled")&&t.hasAttribute("data-task")&&function(e,t,n){var r=parseInt(e.left,10),i=parseInt(e.top,10),o=parseInt(e.width,10)+parseInt(e.paddingLeft,10)+parseInt(e.paddingRight,10),s=parseInt(e.height,10)+parseInt(e.paddingTop,10)+parseInt(e.paddingBottom,10);return t>=r&&t<=r+o&&n>=i&&n<=i+s}(n,e.offsetX,e.offsetY)&&(wn(t,"checked"),this.eventEmitter.emit("change",{source:"viewer",date:e}))},t.prototype.setMarkdown=function(e){var t,n=this.toastMark.getLineTexts(),r=[n.length,(t=n)[t.length-1].length+1],i=this.toastMark.editMarkdown([1,1],r,e||"");this.eventEmitter.emit("updatePreview",i)},t.prototype.on=function(e,t){this.eventEmitter.listen(e,t)},t.prototype.off=function(e){this.eventEmitter.removeEventHandler(e)},t.prototype.addHook=function(e,t){this.eventEmitter.removeEventHandler(e),this.eventEmitter.listen(e,t)},t.prototype.destroy=function(){this.preview.el.removeEventListener("mousedown",this.toggleTask.bind(this)),this.preview.destroy(),this.eventEmitter.emit("destroy")},t.prototype.isViewer=function(){return!0},t.prototype.isMarkdownMode=function(){return!1},t.prototype.isWysiwygMode=function(){return!1},t}(),ar=sr}(),l.default}()},e.exports=r(n(3),n(679),n(473),n(565),n(347))},355(e){function t(e){this.content=e}t.prototype={constructor:t,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,n,r){var i=r&&r!=e?this.remove(r):this,o=i.find(e),s=i.content.slice();return-1==o?s.push(r||e,n):(s[o+1]=n,r&&(s[o]=r)),new t(s)},remove:function(e){var n=this.find(e);if(-1==n)return this;var r=this.content.slice();return r.splice(n,2),new t(r)},addToStart:function(e,n){return new t([e,n].concat(this.remove(e).content))},addToEnd:function(e,n){var r=this.remove(e).content.slice();return r.push(e,n),new t(r)},addBefore:function(e,n,r){var i=this.remove(n),o=i.content.slice(),s=i.find(e);return o.splice(-1==s?o.length:s,0,n,r),new t(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=t.from(e)).size?new t(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=t.from(e)).size?new t(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var n=this;e=t.from(e);for(var r=0;r<e.content.length;r+=2)n=n.remove(e.content[r]);return n},get size(){return this.content.length>>1}},t.from=function(e){if(e instanceof t)return e;var n=[];if(e)for(var r in e)n.push(r,e[r]);return new t(n)},e.exports=t},3(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(565),o=n(256),s=(r=function e(t,n){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.match=t,this.match=t,this.handler="string"==typeof n?(r=n,function(e,t,n,i){var o=r;if(t[1]){var s=t[0].lastIndexOf(t[1]);o+=t[0].slice(s+t[1].length);var a=(n+=s)-i;a>0&&(o=t[0].slice(s-a,s)+o,n=i)}return e.tr.insertText(o,n,i)}):n},Object.defineProperty(r,"prototype",{writable:!1}),r);function a(e,t,n,r,i,o){if(e.composing)return!1;var s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;for(var l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r,c=0;c<i.length;c++){var u=i[c].match.exec(l),h=u&&i[c].handler(s,u,t-(u[0].length-r.length),n);if(h)return e.dispatch(h.setMeta(o,{transform:h,from:t,to:n,text:r})),!0}return!1}var l=new s(/--$/,"—"),c=new s(/\.\.\.$/,"…"),u=new s(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),h=new s(/"$/,"”"),p=new s(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),f=new s(/'$/,"’"),d=[u,h,p,f];t.InputRule=s,t.closeDoubleQuote=h,t.closeSingleQuote=f,t.ellipsis=c,t.emDash=l,t.inputRules=function(e){var t=e.rules,n=new i.Plugin({state:{init:function(){return null},apply:function(e,t){return e.getMeta(this)||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,r,i,o){return a(e,r,i,o,t,n)},handleDOMEvents:{compositionend:function(e){setTimeout(function(){var r=e.state.selection.$cursor;r&&a(e,r.pos,r.pos,"",t,n)})}}},isInputRules:!0});return n},t.openDoubleQuote=u,t.openSingleQuote=p,t.smartQuotes=d,t.textblockTypeInputRule=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new s(e,function(e,r,i,o){var s=e.doc.resolve(i),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(i,o).setBlockType(i,i,t,a):null})},t.undoInputRule=function(e,t){for(var n=e.plugins,r=0;r<n.length;r++){var i=n[r],o=void 0;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){for(var s=e.tr,a=o.transform,l=a.steps.length-1;l>=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(o.text){var c=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,e.schema.text(o.text,c))}else s.delete(o.from,o.to);t(s)}return!0}}return!1},t.wrappingInputRule=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return new s(e,function(e,i,s,a){var l=n instanceof Function?n(i):n,c=e.tr.delete(s,a),u=c.doc.resolve(s).blockRange(),h=u&&o.findWrapping(u,t,l);if(!h)return null;c.wrap(u,h);var p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==t&&o.canJoin(c.doc,s-1)&&(!r||r(i,p))&&c.join(s-1),c})}},679(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(462),i=n(565),o="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function s(e){var t,n,r,i,s=e.split(/-(?!$)/),a=s[s.length-1];"Space"==a&&(a=" ");for(var l=0;l<s.length-1;l++){var c=s[l];if(/^(cmd|meta|m)$/i.test(c))i=!0;else if(/^a(lt)?$/i.test(c))t=!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);o?i=!0:n=!0}}return t&&(a="Alt-"+a),n&&(a="Ctrl-"+a),i&&(a="Meta-"+a),r&&(a="Shift-"+a),a}function a(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function l(e){var t=function(e){var t=Object.create(null);for(var n in e)t[s(n)]=e[n];return t}(e);return function(e,n){var i,o=r.keyName(n),s=1==o.length&&" "!=o,l=t[a(o,n,!s)];if(l&&l(e.state,e.dispatch,e))return!0;if(s&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(i=r.base[n.keyCode])&&i!=o){var c=t[a(i,n,!0)];if(c&&c(e.state,e.dispatch,e))return!0}else if(s&&n.shiftKey){var u=t[a(o,n,!0)];if(u&&u(e.state,e.dispatch,e))return!0}return!1}}t.keydownHandler=l,t.keymap=function(e){return new i.Plugin({props:{handleKeyDown:l(e)}})}},473(e,t,n){function r(){return r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},r.apply(this,arguments)}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}function o(e){var t=l();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function s(e){var t="function"==typeof Map?new Map:void 0;return s=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return a(e,arguments,u(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,e)},s(e)}function a(e,t,n){return a=l()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&c(i,n.prototype),i},a.apply(null,arguments)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function c(e,t){return c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},c(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}Object.defineProperty(t,"__esModule",{value:!0});var m,g=(m=n(355))&&"object"===d(m)&&"default"in m?m:{default:m};function v(e,t,n){for(var r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;var i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(var s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){var a=v(i.content,o.content,n+1);if(null!=a)return a}n+=i.nodeSize}else n+=i.nodeSize}}function y(e,t,n,r){for(var i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};var s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){for(var c=0,u=Math.min(s.text.length,a.text.length);c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){var h=y(s.content,a.content,n-1,r-1);if(h)return h}n-=l,r-=l}else n-=l,r-=l}}var b=function(){function e(t,n){if(h(this,e),this.content=t,this.size=n||0,null==n)for(var r=0;r<t.length;r++)this.size+=t[r].nodeSize}return f(e,[{key:"nodesBetween",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0,o=0,s=0;s<t;o++){var a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){var c=s+1;a.nodesBetween(Math.max(0,e-c),Math.min(a.content.size,t-c),n,r+c)}s=l}}},{key:"descendants",value:function(e){this.nodesBetween(0,this.size,e)}},{key:"textBetween",value:function(e,t,n,r){var i="",o=!0;return this.nodesBetween(e,t,function(s,a){s.isText?(i+=s.text.slice(Math.max(e,a)-a,t-a),o=!n):s.isLeaf&&r?(i+="function"==typeof r?r(s):r,o=!n):!o&&s.isBlock&&(i+=n,o=!0)},0),i}},{key:"append",value:function(t){if(!t.size)return this;if(!this.size)return t;var n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new e(i,this.size+t.size)}},{key:"cut",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==t&&n==this.size)return this;var r=[],i=0;if(n>t)for(var o=0,s=0;s<n;o++){var a=this.content[o],l=s+a.nodeSize;l>t&&((s<t||l>n)&&(a=a.isText?a.cut(Math.max(0,t-s),Math.min(a.text.length,n-s)):a.cut(Math.max(0,t-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new e(r,i)}},{key:"cutByIndex",value:function(t,n){return t==n?e.empty:0==t&&n==this.content.length?this:new e(this.content.slice(t,n))}},{key:"replaceChild",value:function(t,n){var r=this.content[t];if(r==n)return this;var i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,o)}},{key:"addToStart",value:function(t){return new e([t].concat(this.content),this.size+t.nodeSize)}},{key:"addToEnd",value:function(t){return new e(this.content.concat(t),this.size+t.nodeSize)}},{key:"eq",value:function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}},{key:"firstChild",get:function(){return this.content.length?this.content[0]:null}},{key:"lastChild",get:function(){return this.content.length?this.content[this.content.length-1]:null}},{key:"childCount",get:function(){return this.content.length}},{key:"child",value:function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}},{key:"maybeChild",value:function(e){return this.content[e]||null}},{key:"forEach",value:function(e){for(var t=0,n=0;t<this.content.length;t++){var r=this.content[t];e(r,n,t),n+=r.nodeSize}}},{key:"findDiffStart",value:function(e){return v(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)}},{key:"findDiffEnd",value:function(e){return y(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.size)}},{key:"findIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==e)return w(0,e);if(e==this.size)return w(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position ".concat(e," outside of fragment (").concat(this,")"));for(var n=0,r=0;;n++){var i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?w(n+1,i):w(n,r);r=i}}},{key:"toString",value:function(){return"<"+this.toStringInner()+">"}},{key:"toStringInner",value:function(){return this.content.join(", ")}},{key:"toJSON",value:function(){return this.content.length?this.content.map(function(e){return e.toJSON()}):null}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new e(n.map(t.nodeFromJSON))}},{key:"fromArray",value:function(t){if(!t.length)return e.empty;for(var n,r=0,i=0;i<t.length;i++){var o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new e(n||t,r)}},{key:"from",value:function(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}]),e}();b.empty=new b([],0);var k={index:0,offset:0};function w(e,t){return k.index=e,k.offset=t,k}function x(e,t){if(e===t)return!0;if(!e||"object"!=d(e)||!t||"object"!=d(t))return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(!x(e[r],t[r]))return!1}else{for(var i in e)if(!(i in t)||!x(e[i],t[i]))return!1;for(var o in t)if(!(o in e))return!1}return!0}var C=function(){function e(t,n){h(this,e),this.type=t,this.attrs=n}return f(e,[{key:"addToSet",value:function(e){for(var t,n=!1,r=0;r<e.length;r++){var i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}},{key:"removeFromSet",value:function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}},{key:"isInSet",value:function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}},{key:"eq",value:function(e){return this==e||this.type==e.type&&x(this.attrs,e.attrs)}},{key:"toJSON",value:function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e}}],[{key:"fromJSON",value:function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type ".concat(t.type," in this schema"));return n.create(t.attrs)}},{key:"sameSet",value:function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}},{key:"setFrom",value:function(t){if(!t||Array.isArray(t)&&0==t.length)return e.none;if(t instanceof e)return[t];var n=t.slice();return n.sort(function(e,t){return e.type.rank-t.type.rank}),n}}]),e}();C.none=[];var S=function(e){i(n,e);var t=o(n);function n(){return h(this,n),t.apply(this,arguments)}return f(n)}(s(Error)),N=function(){function e(t,n,r){h(this,e),this.content=t,this.openStart=n,this.openEnd=r}return f(e,[{key:"size",get:function(){return this.content.size-this.openStart-this.openEnd}},{key:"insertAt",value:function(t,n){var r=O(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}},{key:"removeBetween",value:function(t,n){return new e(T(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}},{key:"eq",value:function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}},{key:"toString",value:function(){return this.content+"("+this.openStart+","+this.openEnd+")"}},{key:"toJSON",value:function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;var r=n.openStart||0,i=n.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new e(b.fromJSON(t,n.content),r,i)}},{key:"maxOpen",value:function(t){for(var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=0,i=0,o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(var s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new e(t,r,i)}}]),e}();function T(e,t,n){var r=e.findIndex(t),i=r.index,o=r.offset,s=e.maybeChild(i),a=e.findIndex(n),l=a.index,c=a.offset;if(o==t||s.isText){if(c!=n&&!e.child(l).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=l)throw new RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(T(s.content,t-o-1,n-o-1)))}function O(e,t,n,r){var i=e.findIndex(t),o=i.index,s=i.offset,a=e.maybeChild(o);if(s==t||a.isText)return r&&!r.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));var l=O(a.content,t-s-1,n);return l&&e.replaceChild(o,a.copy(l))}function M(e,t,n){if(n.openStart>e.depth)throw new S("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new S("Inconsistent open depths");return E(e,t,n,0)}function E(e,t,n,r){var i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){var s=E(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){var a=function(e,t){for(var n=t.depth-e.openStart,r=t.node(n).copy(e.content),i=n-1;i>=0;i--)r=t.node(i).copy(b.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return I(o,F(e,a.start,a.end,t,r))}var l=e.parent,c=l.content;return I(l,c.cut(0,e.parentOffset).append(n.content).append(c.cut(t.parentOffset)))}return I(o,P(e,t,r))}function D(e,t){if(!t.type.compatibleContent(e.type))throw new S("Cannot join "+t.type.name+" onto "+e.type.name)}function A(e,t,n){var r=e.node(n);return D(r,t.node(n)),r}function L(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function R(e,t,n,r){var i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(L(e.nodeAfter,r),o++));for(var a=o;a<s;a++)L(i.child(a),r);t&&t.depth==n&&t.textOffset&&L(t.nodeBefore,r)}function I(e,t){if(!e.type.validContent(t))throw new S("Invalid content for node "+e.type.name);return e.copy(t)}function F(e,t,n,r,i){var o=e.depth>i&&A(e,t,i+1),s=r.depth>i&&A(n,r,i+1),a=[];return R(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(D(o,s),L(I(o,F(e,t,n,r,i+1)),a)):(o&&L(I(o,P(e,t,i+1)),a),R(t,n,i,a),s&&L(I(s,P(n,r,i+1)),a)),R(r,null,i,a),new b(a)}function P(e,t,n){var r=[];return R(null,e,n,r),e.depth>n&&L(I(A(e,t,n+1),P(e,t,n+1)),r),R(t,null,n,r),new b(r)}N.empty=new N(b.empty,0,0);var B=function(){function e(t,n,r){h(this,e),this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}return f(e,[{key:"resolveDepth",value:function(e){return null==e?this.depth:e<0?this.depth+e:e}},{key:"parent",get:function(){return this.node(this.depth)}},{key:"doc",get:function(){return this.node(0)}},{key:"node",value:function(e){return this.path[3*this.resolveDepth(e)]}},{key:"index",value:function(e){return this.path[3*this.resolveDepth(e)+1]}},{key:"indexAfter",value:function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}},{key:"start",value:function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}},{key:"end",value:function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}},{key:"before",value:function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}},{key:"after",value:function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}},{key:"textOffset",get:function(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}},{key:"nodeBefore",get:function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}},{key:"posAtIndex",value:function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1,i=0;i<e;i++)r+=n.child(i).nodeSize;return r}},{key:"marks",value:function(){var e=this.parent,t=this.index();if(0==e.content.size)return C.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){var i=n;n=r,r=i}for(var o=n.marks,s=0;s<o.length;s++)!1!==o[s].type.spec.inclusive||r&&o[s].isInSet(r.marks)||(o=o[s--].removeFromSet(o));return o}},{key:"marksAcross",value:function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,r=e.parent.maybeChild(e.index()),i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}},{key:"sharedDepth",value:function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}},{key:"blockRange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,t=arguments.length>1?arguments[1]:void 0;if(e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new j(this,e,n);return null}},{key:"sameParent",value:function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}},{key:"max",value:function(e){return e.pos>this.pos?e:this}},{key:"min",value:function(e){return e.pos<this.pos?e:this}},{key:"toString",value:function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}}],[{key:"resolve",value:function(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");for(var r=[],i=0,o=n,s=t;;){var a=s.content.findIndex(o),l=a.index,c=a.offset,u=o-c;if(r.push(s,l,i+c),!u)break;if((s=s.child(l)).isText)break;o=u-1,i+=c+1}return new e(n,r,o)}},{key:"resolveCached",value:function(t,n){for(var r=0;r<z.length;r++){var i=z[r];if(i.pos==n&&i.doc==t)return i}var o=z[q]=e.resolve(t,n);return q=(q+1)%_,o}}]),e}(),z=[],q=0,_=12,j=function(){function e(t,n,r){h(this,e),this.$from=t,this.$to=n,this.depth=r}return f(e,[{key:"start",get:function(){return this.$from.before(this.depth+1)}},{key:"end",get:function(){return this.$to.after(this.depth+1)}},{key:"parent",get:function(){return this.$from.node(this.depth)}},{key:"startIndex",get:function(){return this.$from.index(this.depth)}},{key:"endIndex",get:function(){return this.$to.indexAfter(this.depth)}}]),e}(),H=Object.create(null),V=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:C.none;h(this,e),this.type=t,this.attrs=n,this.marks=i,this.content=r||b.empty}return f(e,[{key:"nodeSize",get:function(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function(){return this.content.childCount}},{key:"child",value:function(e){return this.content.child(e)}},{key:"maybeChild",value:function(e){return this.content.maybeChild(e)}},{key:"forEach",value:function(e){this.content.forEach(e)}},{key:"nodesBetween",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(e,t,n,r,this)}},{key:"descendants",value:function(e){this.nodesBetween(0,this.content.size,e)}},{key:"textContent",get:function(){return this.textBetween(0,this.content.size,"")}},{key:"textBetween",value:function(e,t,n,r){return this.content.textBetween(e,t,n,r)}},{key:"firstChild",get:function(){return this.content.firstChild}},{key:"lastChild",get:function(){return this.content.lastChild}},{key:"eq",value:function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}},{key:"sameMarkup",value:function(e){return this.hasMarkup(e.type,e.attrs,e.marks)}},{key:"hasMarkup",value:function(e,t,n){return this.type==e&&x(this.attrs,t||e.defaultAttrs||H)&&C.sameSet(this.marks,n||C.none)}},{key:"copy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}},{key:"mark",value:function(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}},{key:"cut",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e==t)return N.empty;var r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),a=r.node(o).content.cut(r.pos-s,i.pos-s);return new N(a,r.depth-o,i.depth-o)}},{key:"replace",value:function(e,t,n){return M(this.resolve(e),this.resolve(t),n)}},{key:"nodeAt",value:function(e){for(var t=this;;){var n=t.content.findIndex(e),r=n.index,i=n.offset;if(!(t=t.maybeChild(r)))return null;if(i==e||t.isText)return t;e-=i+1}}},{key:"childAfter",value:function(e){var t=this.content.findIndex(e),n=t.index,r=t.offset;return{node:this.content.maybeChild(n),index:n,offset:r}}},{key:"childBefore",value:function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,r=t.offset;if(r<e)return{node:this.content.child(n),index:n,offset:r};var i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}},{key:"resolve",value:function(e){return B.resolveCached(this,e)}},{key:"resolveNoCache",value:function(e){return B.resolve(this,e)}},{key:"rangeHasMark",value:function(e,t,n){var r=!1;return t>e&&this.nodesBetween(e,t,function(e){return n.isInSet(e.marks)&&(r=!0),!r}),r}},{key:"isBlock",get:function(){return this.type.isBlock}},{key:"isTextblock",get:function(){return this.type.isTextblock}},{key:"inlineContent",get:function(){return this.type.inlineContent}},{key:"isInline",get:function(){return this.type.isInline}},{key:"isText",get:function(){return this.type.isText}},{key:"isLeaf",get:function(){return this.type.isLeaf}},{key:"isAtom",get:function(){return this.type.isAtom}},{key:"toString",value:function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),U(this.marks,e)}},{key:"contentMatchAt",value:function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}},{key:"canReplace",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:b.empty,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.childCount,o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(var a=r;a<i;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0}},{key:"canReplaceWith",value:function(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;var i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}},{key:"canAppend",value:function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}},{key:"check",value:function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node ".concat(this.type.name,": ").concat(this.content.toString().slice(0,50)));for(var e=C.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!C.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map(function(e){return e.type.name})));this.content.forEach(function(e){return e.check()})}},{key:"toJSON",value:function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(function(e){return e.toJSON()})),e}}],[{key:"fromJSON",value:function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}var r=b.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}]),e}();V.prototype.text=void 0;var $=function(e){i(n,e);var t=o(n);function n(e,r,i,o){var s;if(h(this,n),s=t.call(this,e,r,null,o),!i)throw new RangeError("Empty text nodes are not allowed");return s.text=i,s}return f(n,[{key:"toString",value:function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):U(this.marks,JSON.stringify(this.text))}},{key:"textContent",get:function(){return this.text}},{key:"textBetween",value:function(e,t){return this.text.slice(e,t)}},{key:"nodeSize",get:function(){return this.text.length}},{key:"mark",value:function(e){return e==this.marks?this:new n(this.type,this.attrs,this.text,e)}},{key:"withText",value:function(e){return e==this.text?this:new n(this.type,this.attrs,e,this.marks)}},{key:"cut",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}},{key:"eq",value:function(e){return this.sameMarkup(e)&&this.text==e.text}},{key:"toJSON",value:function(){var e=r(u(n.prototype),"toJSON",this).call(this);return e.text=this.text,e}}]),n}(V);function U(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var J=function(){function e(t){h(this,e),this.validEnd=t,this.next=[],this.wrapCache=[]}return f(e,[{key:"matchType",value:function(e){for(var t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}},{key:"matchFragment",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.childCount,r=this,i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}},{key:"inlineContent",get:function(){return this.next.length&&this.next[0].type.isInline}},{key:"defaultType",get:function(){for(var e=0;e<this.next.length;e++){var t=this.next[e].type;if(!t.isText&&!t.hasRequiredAttrs())return t}return null}},{key:"compatible",value:function(e){for(var t=0;t<this.next.length;t++)for(var n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}},{key:"fillBefore",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=[this];return function i(o,s){var a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return b.from(s.map(function(e){return e.createAndFill()}));for(var l=0;l<o.next.length;l++){var c=o.next[l],u=c.type,h=c.next;if(!u.isText&&!u.hasRequiredAttrs()&&-1==r.indexOf(h)){r.push(h);var p=i(h,s.concat(u));if(p)return p}}return null}(this,[])}},{key:"findWrapping",value:function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}},{key:"computeWrapping",value:function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),i=r.match;if(i.matchType(e)){for(var o=[],s=r;s.type;s=s.via)o.push(s.type);return o.reverse()}for(var a=0;a<i.next.length;a++){var l=i.next[a],c=l.type,u=l.next;c.isLeaf||c.hasRequiredAttrs()||c.name in t||r.type&&!u.validEnd||(n.push({match:c.contentMatch,type:c,via:r}),t[c.name]=!0)}}return null}},{key:"edgeCount",get:function(){return this.next.length}},{key:"edge",value:function(e){if(e>=this.next.length)throw new RangeError("There's no ".concat(e,"th edge in this content match"));return this.next[e]}},{key:"toString",value:function(){var e=[];return function t(n){e.push(n);for(var r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(function(t,n){for(var r=n+(t.validEnd?"*":" ")+" ",i=0;i<t.next.length;i++)r+=(i?", ":"")+t.next[i].type.name+"->"+e.indexOf(t.next[i].next);return r}).join("\n")}}],[{key:"parse",value:function(t,n){var r=new W(t,n);if(null==r.next)return e.empty;var i=K(r);r.next&&r.err("Unexpected trailing text");var o=te(function(e){var t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce(function(t,n){return t.concat(e(n,o))},[]);if("seq"!=t.type){if("star"==t.type){var s=n();return r(o,s),i(e(t.expr,s),s),[r(s)]}if("plus"==t.type){var a=n();return i(e(t.expr,o),a),i(e(t.expr,a),a),[r(a)]}if("opt"==t.type)return[r(o)].concat(e(t.expr,o));if("range"==t.type){for(var l=o,c=0;c<t.min;c++){var u=n();i(e(t.expr,l),u),l=u}if(-1==t.max)i(e(t.expr,l),l);else for(var h=t.min;h<t.max;h++){var p=n();r(l,p),i(e(t.expr,l),p),l=p}return[r(l)]}if("name"==t.type)return[r(o,void 0,t.value)];throw new Error("Unknown expr type")}for(var f=0;;f++){var d=e(t.exprs[f],o);if(f==t.exprs.length-1)return d;i(d,o=n())}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){var i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(function(e){return e.to=t})}}(i));return function(e,t){for(var n=0,r=[e];n<r.length;n++){for(var i=r[n],o=!i.validEnd,s=[],a=0;a<i.next.length;a++){var l=i.next[a],c=l.type,u=l.next;s.push(c.name),!o||c.isText||c.hasRequiredAttrs()||(o=!1),-1==r.indexOf(u)&&r.push(u)}o&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,r),o}}]),e}();J.empty=new J(!0);var W=function(){function e(t,n){h(this,e),this.string=t,this.nodeTypes=n,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()}return f(e,[{key:"next",get:function(){return this.tokens[this.pos]}},{key:"eat",value:function(e){return this.next==e&&(this.pos++||!0)}},{key:"err",value:function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}]),e}();function K(e){var t=[];do{t.push(G(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function G(e){var t=[];do{t.push(Z(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Z(e){for(var t=function(e){if(e.eat("(")){var t=K(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,r=n[t];if(r)return[r];var i=[];for(var o in n){var s=n[o];s.groups.indexOf(t)>-1&&i.push(s)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i}(e,e.next).map(function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}});return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=Y(e,t)}return t}function X(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function Y(e,t){var n=X(e),r=n;return e.eat(",")&&(r="}"!=e.next?X(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Q(e,t){return t-e}function ee(e,t){var n=[];return function t(r){var i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(var o=0;o<i.length;o++){var s=i[o],a=s.term,l=s.to;a||-1!=n.indexOf(l)||t(l)}}(t),n.sort(Q)}function te(e){var t=Object.create(null);return function n(r){var i=[];r.forEach(function(t){e[t].forEach(function(t){var n=t.term,r=t.to;if(n){for(var o,s=0;s<i.length;s++)i[s][0]==n&&(o=i[s][1]);ee(e,r).forEach(function(e){o||i.push([n,o=[]]),-1==o.indexOf(e)&&o.push(e)})}})});for(var o=t[r.join(",")]=new J(r.indexOf(e.length-1)>-1),s=0;s<i.length;s++){var a=i[s][1].sort(Q);o.next.push({type:i[s][0],next:t[a.join(",")]||n(a)})}return o}(ee(e,0))}function ne(e){var t=Object.create(null);for(var n in e){var r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function re(e,t){var n=Object.create(null);for(var r in e){var i=t&&t[r];if(void 0===i){var o=e[r];if(!o.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=o.default}n[r]=i}return n}function ie(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new se(e[n]);return t}var oe=function(){function e(t,n,r){h(this,e),this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=ie(r.attrs),this.defaultAttrs=ne(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==t),this.isText="text"==t}return f(e,[{key:"isInline",get:function(){return!this.isBlock}},{key:"isTextblock",get:function(){return this.isBlock&&this.inlineContent}},{key:"isLeaf",get:function(){return this.contentMatch==J.empty}},{key:"isAtom",get:function(){return this.isLeaf||!!this.spec.atom}},{key:"whitespace",get:function(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}},{key:"hasRequiredAttrs",value:function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}},{key:"compatibleContent",value:function(e){return this==e||this.contentMatch.compatible(e.contentMatch)}},{key:"computeAttrs",value:function(e){return!e&&this.defaultAttrs?this.defaultAttrs:re(this.attrs,e)}},{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new V(this,this.computeAttrs(e),b.from(t),C.setFrom(n))}},{key:"createChecked",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(t=b.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new V(this,this.computeAttrs(e),t,C.setFrom(n))}},{key:"createAndFill",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(e=this.computeAttrs(e),(t=b.from(t)).size){var r=this.contentMatch.fillBefore(t);if(!r)return null;t=r.append(t)}var i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(b.empty,!0);return o?new V(this,e,t.append(o),C.setFrom(n)):null}},{key:"validContent",value:function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}},{key:"allowsMarkType",value:function(e){return null==this.markSet||this.markSet.indexOf(e)>-1}},{key:"allowsMarks",value:function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}},{key:"allowedMarks",value:function(e){if(null==this.markSet)return e;for(var t,n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:C.none:e}}],[{key:"compile",value:function(t,n){var r=Object.create(null);t.forEach(function(t,i){return r[t]=new e(t,n,i)});var i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(var o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}]),e}(),se=function(){function e(t){h(this,e),this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}return f(e,[{key:"isRequired",get:function(){return!this.hasDefault}}]),e}(),ae=function(){function e(t,n,r,i){h(this,e),this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=ie(i.attrs),this.excluded=null;var o=ne(this.attrs);this.instance=o?new C(this,o):null}return f(e,[{key:"create",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!e&&this.instance?this.instance:new C(this,re(this.attrs,e))}},{key:"removeFromSet",value:function(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}},{key:"isInSet",value:function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]}},{key:"excludes",value:function(e){return this.excluded.indexOf(e)>-1}}],[{key:"compile",value:function(t,n){var r=Object.create(null),i=0;return t.forEach(function(t,o){return r[t]=new e(t,i++,n,o)}),r}}]),e}(),le=function(){function e(t){h(this,e),this.cached=Object.create(null),this.spec={nodes:g.default.from(t.nodes),marks:g.default.from(t.marks||{}),topNode:t.topNode},this.nodes=oe.compile(this.spec.nodes,this),this.marks=ae.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var i=this.nodes[r],o=i.spec.content||"",s=i.spec.marks;i.contentMatch=n[o]||(n[o]=J.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==s?null:s?ce(this,s.split(" ")):""!=s&&i.inlineContent?null:[]}for(var a in this.marks){var l=this.marks[a],c=l.spec.excludes;l.excluded=null==c?[l]:""==c?[]:ce(this,c.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}return f(e,[{key:"node",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof oe))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}},{key:"text",value:function(e,t){var n=this.nodes.text;return new $(n,n.defaultAttrs,e,C.setFrom(t))}},{key:"mark",value:function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}},{key:"nodeFromJSON",value:function(e){return V.fromJSON(this,e)}},{key:"markFromJSON",value:function(e){return C.fromJSON(this,e)}},{key:"nodeType",value:function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}]),e}();function ce(e,t){for(var n=[],r=0;r<t.length;r++){var i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(var a in e.marks){var l=e.marks[a];("_"==i||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}var ue=function(){function e(t,n){var r=this;h(this,e),this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach(function(e){e.tag?r.tags.push(e):e.style&&r.styles.push(e)}),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)})}return f(e,[{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ge(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}},{key:"parseSlice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ge(this,t,!0);return n.addAll(e,t.from,t.to),N.maxOpen(n.finish())}},{key:"matchTag",value:function(e,t,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var i=this.tags[r];if(ve(e,i.tag)&&(void 0===i.namespace||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){var o=i.getAttrs(e);if(!1===o)continue;i.attrs=o||void 0}return i}}}},{key:"matchStyle",value:function(e,t,n,r){for(var i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){var o=this.styles[i],s=o.style;if(!(0!=s.indexOf(e)||o.context&&!n.matchesContext(o.context)||s.length>e.length&&(61!=s.charCodeAt(e.length)||s.slice(e.length+1)!=t))){if(o.getAttrs){var a=o.getAttrs(t);if(!1===a)continue;o.attrs=a||void 0}return o}}}}],[{key:"schemaRules",value:function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r<t.length;r++){var i=t[r];if((null==i.priority?50:i.priority)<n)break}t.splice(r,0,e)}var r=function(t){var r=e.marks[t].spec.parseDOM;r&&r.forEach(function(e){n(e=ye(e)),e.mark=t})};for(var i in e.marks)r(i);var o=function(t){var r=e.nodes[t].spec.parseDOM;r&&r.forEach(function(e){n(e=ye(e)),e.node=t})};for(var s in e.nodes)o(s);return t}},{key:"fromSchema",value:function(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}}]),e}(),he={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},pe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},fe={ol:!0,ul:!0};function de(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}var me=function(){function e(t,n,r,i,o,s,a){h(this,e),this.type=t,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=C.none,this.stashMarks=[],this.match=s||(4&a?null:t.contentMatch)}return f(e,[{key:"findWrapping",value:function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(b.from(e));if(!t){var n,r=this.type.contentMatch;return(n=r.findWrapping(e.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}},{key:"finish",value:function(e){if(!(1&this.options)){var t,n=this.content[this.content.length-1];if(n&&n.isText&&(t=/[ \t\r\n\u000c]+$/.exec(n.text))){var r=n;n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-t[0].length))}}var i=b.from(this.content);return!e&&this.match&&(i=i.append(this.match.fillBefore(b.empty,!0))),this.type?this.type.create(this.attrs,i,this.marks):i}},{key:"popFromStashMark",value:function(e){for(var t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}},{key:"applyPending",value:function(e){for(var t=0,n=this.pendingMarks;t<n.length;t++){var r=n[t];(this.type?this.type.allowsMarkType(r.type):be(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}},{key:"inlineContext",value:function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!he.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}]),e}(),ge=function(){function e(t,n,r){h(this,e),this.parser=t,this.options=n,this.isOpen=r,this.open=0;var i,o=n.topNode,s=de(null,n.preserveWhitespace,0)|(r?4:0);i=o?new me(o.type,o.attrs,C.none,C.none,!0,n.topMatch||o.type.contentMatch,s):new me(r?null:t.schema.topNodeType,null,C.none,C.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}return f(e,[{key:"top",get:function(){return this.nodes[this.open]}},{key:"addDOM",value:function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),n=t?this.readStyles(function(e){for(var t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(var i=0;i<n.length;i++)this.addPendingMark(n[i]);if(this.addElement(e),null!=n)for(var o=0;o<n.length;o++)this.removePendingMark(n[o],r)}}},{key:"addTextNode",value:function(e){var t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}},{key:"addElement",value:function(e,t){var n,r=e.nodeName.toLowerCase();fe.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var r=1==t.nodeType?t.nodeName.toLowerCase():null;r&&fe.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):"li"==r?n=t:r&&(n=null)}}(e);var i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(i?i.ignore:pe.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);var o,s=this.top,a=this.needsBlock;if(he.hasOwnProperty(r))o=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),o&&this.sync(s),this.needsBlock=a}else this.addElementByRule(e,i,!1===i.consuming?n:void 0)}},{key:"leafFallback",value:function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}},{key:"ignoreFallback",value:function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}},{key:"readStyles",value:function(e){var t=C.none;e:for(var n=0;n<e.length;n+=2)for(var r=void 0;;){var i=this.parser.matchStyle(e[n],e[n+1],this,r);if(!i)continue e;if(i.ignore)return null;if(t=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(t),!1!==i.consuming)break;r=i}return t}},{key:"addElementByRule",value:function(e,t,n){var r,i,o,s=this;t.node?(i=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));var a=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(function(e){return s.insertNode(e)});else{var l=e;"string"==typeof t.contentElement?l=e.querySelector(t.contentElement):"function"==typeof t.contentElement?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l)}r&&this.sync(a)&&this.open--,o&&this.removePendingMark(o,a)}},{key:"addAll",value:function(e,t,n){for(var r=t||0,i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}},{key:"findPlace",value:function(e){for(var t,n,r=this.open;r>=0;r--){var i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(var s=0;s<t.length;s++)this.enterInner(t[s],null,!1);return!0}},{key:"insertNode",value:function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));for(var r=n.activeMarks,i=0;i<e.marks.length;i++)n.type&&!n.type.allowsMarkType(e.marks[i].type)||(r=e.marks[i].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}},{key:"enter",value:function(e,t,n){var r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}},{key:"enterInner",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;this.closeExtra();var i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);var o=de(e,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new me(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}},{key:"closeExtra",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}},{key:"finish",value:function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}},{key:"sync",value:function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}},{key:"currentPos",get:function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,r=n.length-1;r>=0;r--)e+=n[r].nodeSize;t&&e++}return e}},{key:"findAtPoint",value:function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}},{key:"findInside",value:function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}},{key:"findAround",value:function(e,t,n){if(e!=t&&this.find)for(var r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}},{key:"findInText",value:function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}},{key:"matchesContext",value:function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,i=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1);return function e(s,a){for(;s>=0;s--){var l=n[s];if(""==l){if(s==n.length-1||0==s)continue;for(;a>=o;a--)if(e(s-1,a))return!0;return!1}var c=a>0||0==a&&i?t.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!c||c.name!=l&&-1==c.groups.indexOf(l))return!1;a--}return!0}(n.length-1,this.open)}},{key:"textblockFromContext",value:function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var i=this.parser.schema.nodes[r];if(i.isTextblock&&i.defaultAttrs)return i}}},{key:"addPendingMark",value:function(e){var t=function(e,t){for(var n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}},{key:"removePendingMark",value:function(e,t){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);var i=r.popFromStashMark(e);i&&r.type&&r.type.allowsMarkType(i.type)&&(r.activeMarks=i.addToSet(r.activeMarks))}if(r==t)break}}}]),e}();function ve(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ye(e){var t={};for(var n in e)t[n]=e[n];return t}function be(e,t){var n=t.schema.nodes,r=function(r){var i=n[r];if(!i.allowsMarkType(e))return"continue";var o=[];return function e(n){o.push(n);for(var r=0;r<n.edgeCount;r++){var i=n.edge(r),s=i.type,a=i.next;if(s==t)return!0;if(o.indexOf(a)<0&&e(a))return!0}}(i.contentMatch)?{v:!0}:void 0};for(var i in n){var o=r(i);if("continue"!==o&&"object"===d(o))return o.v}}var ke=function(){function e(t,n){h(this,e),this.nodes=t,this.marks=n}return f(e,[{key:"serializeFragment",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;r||(r=xe(n).createDocumentFragment());var i=r,o=[];return e.forEach(function(e){if(o.length||e.marks.length){for(var r=0,s=0;r<o.length&&s<e.marks.length;){var a=e.marks[s];if(t.marks[a.type.name]){if(!a.eq(o[r][0])||!1===a.type.spec.spanning)break;r++,s++}else s++}for(;r<o.length;)i=o.pop()[1];for(;s<e.marks.length;){var l=e.marks[s++],c=t.serializeMark(l,e.isInline,n);c&&(o.push([l,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(t.serializeNodeInner(e,n))}),r}},{key:"serializeNodeInner",value:function(t,n){var r=e.renderSpec(xe(n),this.nodes[t.type.name](t)),i=r.dom,o=r.contentDOM;if(o){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,o)}return i}},{key:"serializeNode",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(e,t),r=e.marks.length-1;r>=0;r--){var i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}},{key:"serializeMark",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.marks[t.type.name];return i&&e.renderSpec(xe(r),i(t,n))}}],[{key:"renderSpec",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("string"==typeof n)return{dom:t.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;var i,o=n[0],s=o.indexOf(" ");s>0&&(r=o.slice(0,s),o=o.slice(s+1));var a=r?t.createElementNS(r,o):t.createElement(o),l=n[1],c=1;if(l&&"object"==d(l)&&null==l.nodeType&&!Array.isArray(l))for(var u in c=2,l)if(null!=l[u]){var h=u.indexOf(" ");h>0?a.setAttributeNS(u.slice(0,h),u.slice(h+1),l[u]):a.setAttribute(u,l[u])}for(var p=c;p<n.length;p++){var f=n[p];if(0===f){if(p<n.length-1||p>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}var m=e.renderSpec(t,f,r),g=m.dom,v=m.contentDOM;if(a.appendChild(g),v){if(i)throw new RangeError("Multiple content holes");i=v}}return{dom:a,contentDOM:i}}},{key:"fromSchema",value:function(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}},{key:"nodesFromSchema",value:function(e){var t=we(e.nodes);return t.text||(t.text=function(e){return e.text}),t}},{key:"marksFromSchema",value:function(e){return we(e.marks)}}]),e}();function we(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function xe(e){return e.document||window.document}t.ContentMatch=J,t.DOMParser=ue,t.DOMSerializer=ke,t.Fragment=b,t.Mark=C,t.MarkType=ae,t.Node=V,t.NodeRange=j,t.NodeType=oe,t.ReplaceError=S,t.ResolvedPos=B,t.Schema=le,t.Slice=N},462(e,t){Object.defineProperty(t,"__esModule",{value:!0});for(var n={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:"'"},r={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},i="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),s=0;s<10;s++)n[48+s]=n[96+s]=String(s);for(s=1;s<=24;s++)n[s+111]="F"+s;for(s=65;s<=90;s++)n[s]=String.fromCharCode(s+32),r[s]=String.fromCharCode(s);for(var a in n)r.hasOwnProperty(a)||(r[a]=n[a]);t.base=n,t.keyName=function(e){var t=!(i&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||o&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?r:n)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t},t.shift=r},458(e,t,n){function r(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(i),s=t.child(i);if(o!=s){if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){for(let e=0;o.text[e]==s.text[e];e++)n++;return n}if(o.content.size||s.content.size){let e=r(o.content,s.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function i(e,t,n,r){for(let o=e.childCount,s=t.childCount;;){if(0==o||0==s)return o==s?null:{a:n,b:r};let a=e.child(--o),l=t.child(--s),c=a.nodeSize;if(a!=l){if(!a.sameMarkup(l))return{a:n,b:r};if(a.isText&&a.text!=l.text){let e=0,t=Math.min(a.text.length,l.text.length);for(;e<t&&a.text[a.text.length-e-1]==l.text[l.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(a.content.size||l.content.size){let e=i(a.content,l.content,n-1,r-1);if(e)return e}n-=c,r-=c}else n-=c,r-=c}}n.d(t,{CU:function(){return c},FK:function(){return o},Ji:function(){return h},S4:function(){return j},ZF:function(){return X},bP:function(){return E},sX:function(){return _},vI:function(){return u}});class o{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,(s,a)=>{s.isText?(i+=s.text.slice(Math.max(e,a)-a,t-a),o=!n):s.isLeaf&&r?(i+="function"==typeof r?r(s):r,o=!n):!o&&s.isBlock&&(i+=n,o=!0)},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new o(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new o(n,r)}cutByIndex(e,t){return e==t?o.empty:0==e&&t==this.content.length?this:new o(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new o(r,i)}addToStart(e){return new o([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new o(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return r(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return i(this,e,t,n)}findIndex(e,t=-1){if(0==e)return a(0,e);if(e==this.size)return a(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?a(n+1,i):a(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return o.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new o(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return o.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new o(t||e,n)}static from(e){if(!e)return o.empty;if(e instanceof o)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new o([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}o.empty=new o([],0);const s={index:0,offset:0};function a(e,t){return s.index=e,s.offset=t,s}function l(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!l(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!l(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class c{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&l(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return c.none;if(e instanceof c)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}c.none=[];class u extends Error{}class h{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=f(this.content,e+this.openStart,t);return n&&new h(n,this.openStart,this.openEnd)}removeBetween(e,t){return new h(p(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return h.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new h(o.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new h(e,n,r)}}function p(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(p(o.content,t-i-1,n-i-1)))}function f(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=f(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function d(e,t,n){if(n.openStart>e.depth)throw new u("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new u("Inconsistent open depths");return m(e,t,n,0)}function m(e,t,n,r){let i=e.index(r),s=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=m(e,t,n,r+1);return s.copy(s.content.replaceChild(i,o))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:i,end:a}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(o.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return k(s,w(e,i,a,t,r))}{let r=e.parent,i=r.content;return k(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return k(s,x(e,t,r))}function g(e,t){if(!t.type.compatibleContent(e.type))throw new u("Cannot join "+t.type.name+" onto "+e.type.name)}function v(e,t,n){let r=e.node(n);return g(r,t.node(n)),r}function y(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function b(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(y(e.nodeAfter,r),o++));for(let e=o;e<s;e++)y(i.child(e),r);t&&t.depth==n&&t.textOffset&&y(t.nodeBefore,r)}function k(e,t){if(!e.type.validContent(t))throw new u("Invalid content for node "+e.type.name);return e.copy(t)}function w(e,t,n,r,i){let s=e.depth>i&&v(e,t,i+1),a=r.depth>i&&v(n,r,i+1),l=[];return b(null,e,i,l),s&&a&&t.index(i)==n.index(i)?(g(s,a),y(k(s,w(e,t,n,r,i+1)),l)):(s&&y(k(s,x(e,t,i+1)),l),b(t,n,i,l),a&&y(k(a,x(n,r,i+1)),l)),b(r,null,i,l),new o(l)}function x(e,t,n){let r=[];return b(null,e,n,r),e.depth>n&&y(k(v(e,t,n+1),x(e,t,n+1)),r),b(t,null,n,r),new o(r)}h.empty=new h(o.empty,0,0);class C{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return c.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new O(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s)break;if(t=t.child(e),t.isText)break;i=s-1,r+=o+1}return new C(t,n,i)}static resolveCached(e,t){for(let n=0;n<S.length;n++){let r=S[n];if(r.pos==t&&r.doc==e)return r}let n=S[N]=C.resolve(e,t);return N=(N+1)%T,n}}let S=[],N=0,T=12;class O{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const M=Object.create(null);class E{constructor(e,t,n,r=c.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||o.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&l(this.attrs,t||e.defaultAttrs||M)&&c.sameSet(this.marks,n||c.none)}copy(e=null){return e==this.content?this:new E(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new E(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return h.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),a=r.node(o).content.cut(r.pos-s,i.pos-s);return new h(a,r.depth-o,i.depth-o)}replace(e,t,n){return d(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return C.resolveCached(this,e)}resolveNoCache(e){return C.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),function(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=o.empty,r=0,i=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,r,i),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){if(!this.type.validContent(this.content))throw new RangeError(`Invalid content for node ${this.type.name}: ${this.content.toString().slice(0,50)}`);let e=c.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!c.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=o.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}E.prototype.text=void 0;class D{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new A(e,t);if(null==n.next)return D.empty;let r=L(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);z(e,n).forEach(e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})})});let o=t[r.join(",")]=new D(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(B);o.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return o}(z(e,0))}(function(e){let t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,o)),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(o,s),i(e(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return i(e(t.expr,o),s),i(e(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(o)].concat(e(t.expr,o));if("range"==t.type){let s=o;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,s),r),s=r}if(-1==t.max)i(e(t.expr,s),s);else for(let o=t.min;o<t.max;o++){let o=n();r(s,o),i(e(t.expr,s),o),s=o}return[r(s)]}if("name"==t.type)return[r(o,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=e(t.exprs[r],o);if(r==t.exprs.length-1)return s;i(s,o=n())}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(s,a){let l=s.matchFragment(e,n);if(l&&(!t||l.validEnd))return o.from(a.map(e=>e.createAndFill()));for(let e=0;e<s.next.length;e++){let{type:t,next:n}=s.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,a.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r}).join("\n")}}D.empty=new D(!0);class A{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function L(e){let t=[];do{t.push(R(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function R(e){let t=[];do{t.push(I(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function I(e){let t=function(e){if(e.eat("(")){let t=L(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&i.push(r)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i}(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=P(e,t)}return t}function F(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function P(e,t){let n=F(e),r=n;return e.eat(",")&&(r="}"!=e.next?F(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function B(e,t){return t-e}function z(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(B)}class q{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class _{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=function(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new q(e[n]);return t}(r.attrs),this.excluded=null;let i=function(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}(this.attrs);this.instance=i?new c(this,i):null}create(e=null){return!e&&this.instance?this.instance:new c(this,function(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,i)=>n[e]=new _(e,r++,t,i)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class j{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new W(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new W(this,t,!0);return n.addAll(e,t.from,t.to),h.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(K(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(e)||r.context&&!n.matchesContext(r.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=G(e)),e.mark=t})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=G(e)),e.node=t})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new j(e,j.schemaRules(e)))}}const H={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},V={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},$={ol:!0,ul:!0};function U(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class J{constructor(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=c.none,this.stashMarks=[],this.match=o||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(o.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.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))}}let t=o.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(o.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):Z(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!H.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class W{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,i=t.topNode,o=U(null,t.preserveWhitespace,0)|(n?4:0);r=i?new J(i.type,i.attrs,c.none,c.none,!0,t.topMatch||i.type.contentMatch,o):new J(n?null:e.schema.topNodeType,null,c.none,c.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){let t=e.getAttribute("style"),n=t?this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null,r=this.top;if(null!=n)for(let e=0;e<n.length;e++)this.addPendingMark(n[e]);if(this.addElement(e),null!=n)for(let e=0;e<n.length;e++)this.removePendingMark(n[e],r)}}addTextNode(e){let t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();$.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&$.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(i?i.ignore:V.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let t,n=this.top,o=this.needsBlock;if(H.hasOwnProperty(r))t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),t&&this.sync(n),this.needsBlock=o}else this.addElementByRule(e,i,!1===i.consuming?n:void 0)}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=c.none;e:for(let n=0;n<e.length;n+=2)for(let r;;){let i=this.parser.matchStyle(e[n],e[n+1],this,r);if(!i)continue e;if(i.ignore)return null;if(t=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(t),!1!==i.consuming)break;r=i}return t}addElementByRule(e,t,n){let r,i,o;t.node?(i=this.parser.schema.nodes[t.node],i.isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace)):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(let e=0;e<t.length;e++)this.enterInner(t[e],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let o=U(e,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new J(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function K(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function G(e){let t={};for(let n in e)t[n]=e[n];return t}function Z(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(o.indexOf(i)<0&&s(i))return!0}};if(s(i.contentMatch))return!0}}class X{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Q(t).createDocumentFragment());let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=X.renderSpec(Q(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&X.renderSpec(Q(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?e.createElementNS(n,i):e.createElement(i),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let i=l;i<t.length;i++){let o=t[i];if(0===o){if(i<t.length-1||i>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:i}=X.renderSpec(e,o,n);if(s.appendChild(t),i){if(r)throw new RangeError("Multiple content holes");r=i}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new X(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Y(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Y(e.marks)}}function Y(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Q(e){return e.document||window.document}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{Editor:function(){return p},Viewer:function(){return g}});var i=function(){return(0,this._self._c)("div",{ref:"toastuiEditor"})};i._withStripped=!0;var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var s=require("@techie_doubts/tui.editor.2026"),a=n.n(s),l=["load","change","caretChange","focus","blur","keydown","keyup","beforePreviewRender","beforeConvertWysiwygToMarkdown"],c={initialEditType:"markdown",initialValue:"",height:"300px",previewStyle:"vertical"},u={data:function(){var e=this,t={};l.forEach(function(n){t[n]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];e.$emit.apply(e,function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([n],t))}});var n=o(o({},this.options),{initialEditType:this.initialEditType,initialValue:this.initialValue,height:this.height,previewStyle:this.previewStyle,events:t});return Object.keys(c).forEach(function(e){n[e]||(n[e]=c[e])}),{editor:null,computedOptions:n}},methods:{invoke:function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=null;return this.editor[e]&&(i=(t=this.editor)[e].apply(t,n)),i}},destroyed:function(){var e=this;l.forEach(function(t){e.editor.off(t)}),this.editor.destroy()}};function h(e,t,n,r,i,o,s,a){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),s?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):i&&(l=a?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}var p=h({name:"ToastuiEditor",mixins:[u],props:{previewStyle:{type:String},height:{type:String},initialEditType:{type:String},initialValue:{type:String},options:{type:Object}},watch:{previewStyle:function(e){this.editor.changePreviewStyle(e)},height:function(e){this.editor.height(e)}},mounted:function(){var e=o(o({},this.computedOptions),{el:this.$refs.toastuiEditor});this.editor=new(a())(e)},methods:{getRootElement:function(){return this.$refs.toastuiEditor}}},i,[],!1,null,null,null).exports,f=function(){return(0,this._self._c)("div",{ref:"toastuiEditorViewer"})};f._withStripped=!0;var d=n(504),m=n.n(d),g=h({name:"ToastuiEditorViewer",mixins:[u],props:{height:{type:String},initialValue:{type:String},options:{type:Object}},mounted:function(){var e=o(o({},this.computedOptions),{el:this.$refs.toastuiEditorViewer});this.editor=new(m())(e)},methods:{getRootElement:function(){return this.$refs.toastuiEditorViewer}}},f,[],!1,null,null,null).exports;module.exports=r}();
|