1!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="3d8927a6-3de4-43b7-808e-a41f0a87fdf0",t._sentryDebugIdIdentifier="sentry-dbid-3d8927a6-3de4-43b7-808e-a41f0a87fdf0")}catch(t){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7157],{6865:(t,e,n)=>{"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}}).apply(this,arguments)}function o(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var n,i=l(t);return n=e?Reflect.construct(i,arguments,l(this).constructor):i.apply(this,arguments),function(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");var n=t;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,n)}}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}Object.defineProperty(e,"__esModule",{value:!0});var p=n(11901),f=n(17936),d=Object.create(null),m=function(){function t(e,n,r){h(this,t),this.$anchor=e,this.$head=n,this.ranges=r||[new v(e.min(n),e.max(n))]}return u(t,[{key:"anchor",get:function(){return this.$anchor.pos}},{key:"head",get:function(){return this.$head.pos}},{key:"from",get:function(){return this.$from.pos}},{key:"to",get:function(){return this.$to.pos}},{key:"$from",get:function(){return this.ranges[0].$from}},{key:"$to",get:function(){return this.ranges[0].$to}},{key:"empty",get:function(){for(var t=this.ranges,e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}},{key:"content",value:function(){return this.$from.doc.slice(this.from,this.to,!0)}},{key:"replace",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p.Slice.empty,n=e.content.lastChild,r=null,i=0;i<e.openEnd;i++)r=n,n=n.lastChild;for(var o=t.steps.length,s=this.ranges,a=0;a<s.length;a++){var l=s[a],h=l.$from,c=l.$to,u=t.mapping.slice(o);t.replaceRange(u.map(h.pos),u.map(c.pos),a?p.Slice.empty:e),0==a&&O(t,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}},{key:"replaceWith",value:function(t,e){for(var n=t.steps.length,r=this.ranges,i=0;i<r.length;i++){var o=r[i],s=o.$from,a=o.$to,l=t.mapping.slice(n),h=l.map(s.pos),c=l.map(a.pos);i?t.deleteRange(h,c):(t.replaceRangeWith(h,c,e),O(t,n,e.isInline?-1:1))}}},{key:"getBookmark",value:function(){return k.between(this.$anchor,this.$head).getBookmark()}}],[{key:"findFrom",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.parent.inlineContent?new k(t):C(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(var i=t.depth-1;i>=0;i--){var o=e<0?C(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):C(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(o)return o}return null}},{key:"near",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;
1return this.findFrom(t,e)||this.findFrom(t,-e)||new b(t.node(0))}},{key:"atStart",value:function(t){return C(t,t,0,0,1)||new b(t)}},{key:"atEnd",value:function(t){return C(t,t,t.content.size,t.childCount,-1)||new b(t)}},{key:"fromJSON",value:function(t,e){if(!e||!e.type)throw RangeError("Invalid input for Selection.fromJSON");var n=d[e.type];if(!n)throw RangeError("No selection type ".concat(e.type," defined"));return n.fromJSON(t,e)}},{key:"jsonID",value:function(t,e){if(t in d)throw RangeError("Duplicate use of selection JSON ID "+t);return d[t]=e,e.prototype.jsonID=t,e}}]),t}();m.prototype.visible=!0;var v=u(function t(e,n){h(this,t),this.$from=e,this.$to=n}),y=!1;function g(t){y||t.parent.inlineContent||(y=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var k=function(t){o(n,t);var e=a(n);function n(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return h(this,n),g(t),g(r),e.call(this,t,r)}return u(n,[{key:"$cursor",get:function(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function(t,e){var r=t.resolve(e.map(this.head));if(!r.parent.inlineContent)return m.near(r);var i=t.resolve(e.map(this.anchor));return new n(i.parent.inlineContent?i:r,r)}},{key:"replace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p.Slice.empty;if(i(l(n.prototype),"replace",this).call(this,t,e),e==p.Slice.empty){var r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}},{key:"eq",value:function(t){return t instanceof n&&t.anchor==this.anchor&&t.head==this.head}},{key:"getBookmark",value:function(){return new w(this.anchor,this.head)}},{key:"toJSON",value:function(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new n(t.resolve(e.anchor),t.resolve(e.head))}},{key:"create",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}},{key:"between",value:function(t,e,r){var i=t.pos-e.pos;if((!r||i)&&(r=i>=0?1:-1),!e.parent.inlineContent){var o=m.findFrom(e,r,!0)||m.findFrom(e,-r,!0);if(!o)return m.near(e,r);e=o.$head}return t.parent.inlineContent||(0==i?t=e:(t=(m.findFrom(t,-r,!0)||m.findFrom(t,r,!0)).$anchor).pos<e.pos!=i<0&&(t=e)),new n(t,e)}}]),n}(m);m.jsonID("text",k);var w=function(){function t(e,n){h(this,t),this.anchor=e,this.head=n}return u(t,[{key:"map",value:function(e){return new t(e.map(this.anchor),e.map(this.head))}},{key:"resolve",value:function(t){return k.between(t.resolve(this.anchor),t.resolve(this.head))}}]),t}(),x=function(t){o(n,t);var e=a(n);function n(t){h(this,n);var r,i=t.nodeAfter,o=t.node(0).resolve(t.pos+i.nodeSize);return(r=e.call(this,t,o)).node=i,r}return u(n,[{key:"map",value:function(t,e){var r=e.mapResult(this.anchor),i=r.deleted,o=r.pos,s=t.resolve(o);return i?m.near(s):new n(s)}},{key:"content",value:function(){return new p.Slice(p.Fragment.from(this.node),0,0)}},{key:"eq",value:function(t){return t instanceof n&&t.anchor==this.anchor}},{key:"toJSON",value:function(){return{type:"node",anchor:this.anchor}}},{key:"getBookmark",value:function(){return new S(this.anchor)}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new n(t.resolve(e.anchor))}},{key:"create",value:function(t,e){return new n(t.resolve(e))}},{key:"isSelectable",value:function(t){return!t.isText&&!1!==t.type.spec.selectable}}]),n}(m);x.prototype.visible=!1,m.jsonID("node",x);var S=function(){function t(e){h(this,t),this.anchor=e}return u(t,[{key:"map",value:function(e){var n=e.mapResult(this.anchor),r=n.deleted,i=n.pos;return r?new w(i,i):new t(i)}},{key:"resolve",value:function(t){var e=t.resolve(this.anchor),n=e.nodeAfter;return n&&x.isSelectable(n)?new x(e):m.near(e)}}]),t}(),b=function(t){o(n,t);var e=a(n);function n(t){return h(this,n),e.call(this,t.resolve(0),t.resolve(t.content.size))}return u(n,[{key:"replace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p.Slice.empty;if(e==p.Slice.empty){t.delete(0,t.doc.content.size);var r=m.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else i(l(n.prototype),"replace",this).call(this,t,e)}},{key:"toJSON",value:function(){return{type:"all"}}},{key:"map",value:function(t){return new n(t)}},{key:"eq",value:function(t){return t instanceof n}},{key:"getBookmark",value:function(){return M}}],[{key:"fromJSON",value:function(t){return new n(t)}}]),n}(m);m.jsonID("all",b);var M={map:function(){return this},resolve:function(t){return new b(t)}};function C(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e.inlineContent)return k.create(t,n);for(var s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){var a=e.child(s);if(a.isAtom){if(!o&&x.isSelectable(a))return x.create(t,n-(i<0?a.nodeSize:0))}else{var l=C(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function O(t,e,n){var r,i=t.steps.length-1;if(!(i<e)){var o=t.steps[i];(o instanceof f.ReplaceStep||o instanceof f.ReplaceAroundStep)&&(t.mapping.maps[i].forEac
1h(function(t,e,n,i){null==r&&(r=i)}),t.setSelection(m.near(t.doc.resolve(r),n)))}}var E=function(t){o(n,t);var e=a(n);function n(t){var r;return h(this,n),(r=e.call(this,t.doc)).curSelectionFor=0,r.updated=0,r.meta=Object.create(null),r.time=Date.now(),r.curSelection=t.selection,r.storedMarks=t.storedMarks,r}return u(n,[{key:"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}},{key:"setSelection",value:function(t){if(t.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}},{key:"selectionSet",get:function(){return(1&this.updated)>0}},{key:"setStoredMarks",value:function(t){return this.storedMarks=t,this.updated|=2,this}},{key:"ensureMarks",value:function(t){return p.Mark.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}},{key:"addStoredMark",value:function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function(){return(2&this.updated)>0}},{key:"addStep",value:function(t,e){i(l(n.prototype),"addStep",this).call(this,t,e),this.updated=-3&this.updated,this.storedMarks=null}},{key:"setTime",value:function(t){return this.time=t,this}},{key:"replaceSelection",value:function(t){return this.selection.replace(this,t),this}},{key:"replaceSelectionWith",value:function(t){var e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||p.Mark.none))),n.replaceWith(this,t),this}},{key:"deleteSelection",value:function(){return this.selection.replace(this),this}},{key:"insertText",value:function(t,e,n){var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);var i=this.storedMarks;if(!i){var o=this.doc.resolve(e);i=n==e?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.setSelection(m.near(this.selection.$to)),this}},{key:"setMeta",value:function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}},{key:"getMeta",value:function(t){return this.meta["string"==typeof t?t:t.key]}},{key:"isGeneric",get:function(){for(var t in this.meta)return!1;return!0}},{key:"scrollIntoView",value:function(){return this.updated|=4,this}},{key:"scrolledIntoView",get:function(){return(4&this.updated)>0}}]),n}(f.Transform);function T(t,e){return e&&t?t.bind(e):t}var R=u(function t(e,n,r){h(this,t),this.name=e,this.init=T(n.init,r),this.apply=T(n.apply,r)}),N=[new R("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new R("selection",{init:function(t,e){return t.selection||m.atStart(e.doc)},apply:function(t){return t.selection}}),new R("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new R("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],I=u(function t(e,n){var r=this;h(this,t),this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=N.slice(),n&&n.forEach(function(t){if(r.pluginsByKey[t.key])throw RangeError("Adding different instances of a keyed plugin ("+t.key+")");r.plugins.push(t),r.pluginsByKey[t.key]=t,t.spec.state&&r.fields.push(new R(t.key,t.spec.state,t))})}),A=function(){function t(e){h(this,t),this.config=e}return u(t,[{key:"schema",get:function(){return this.config.schema}},{key:"plugins",get:function(){return this.config.plugins}},{key:"apply",value:function(t){return this.applyTransaction(t).state}},{key:"filterTransaction",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0;n<this.config.plugins.length;n++)if(n!=e){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,t,this))return!1}return!0}},{key:"applyTransaction",value:function(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};for(var e=[t],n=this.applyInner(t),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,h=a<e.length&&s.spec.appendTransaction.call(s,a?e.slice(a):e,l,n);if(h&&n.filterTransaction(h,o)){if(h.setMeta("appendedTransaction",t),!r){r=[];for(var c=0;c<this.config.plugins.length;c++)r.push(c<o?{state:n,n:e.length}:{state:this,n:0})}e.push(h),n=n.applyInner(h),i=!0}r&&(r[o]={state:n,n:e.length})}}if(!i)return{state:n,transactions:e}}}},{key:"applyInner",value:function(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");for(var n=new t(this.config),r=this.config.fields,i=0;i<r.length;i++){var o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}},{key:"tr",get:function(){return new E(this)}},{key:"reconfigure",value:function(e){for(var n=new I(this.schema,e.plugins),r=n.fields,i=new t(n),o=0;o<r.length;o++){var s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}},{key:"toJSON",value:function(t){var e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(function(t){return t.toJSON()})),t&&"object"==r(t))for(var n in t){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");var i=t[n],o=i.spec.state;o&&o.toJSON&&(e[n]=o.toJSON.call(i,this[i.key]))}return e}}],[{key:"create",value:function(e){for(var n=new I(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new t(n),i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}},{key:"fromJSON",value:function(e,n,r){if(!n)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");var i=new I(e.schema,e.plugins),o=new t(i);return i.fields.forEach(function(t){if("doc"==t.name)o.doc=p.Node.fromJSON(e.schema,n.doc);else if("selection"==t.name)o.selection=m.fromJSON(o.doc,n.selection);else if("storedMarks"==t.name)n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(var i in r){var s=r[i],a=s.spec.state;if(s.key==t.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){o[t.name]=a.fromJSON.call(s,e,n[i],o);return}}o[t.name]=t.init(e,o)}}),o}}]),t}(),z=function(){function t(e){h(this,t),this.spec=e,this.props={},e.props&&function t(e,n,r){for(var i in e){var o=e[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=t(o,n,{})),r[i]=o}return r}(e.props,this,this.props),this.key=e.key?e.key.key:J("plugin")}return u(t,[{key:"getState",value:function(t){return t[this.key]}}]),t}(),F=Object.create(null);function J(t){return t in F?t+"$"+ ++F[t]:(F[t]=0,t+"$")}var B=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";h(this,t),this.key=J(e)}return u(t,[{key:"get",value:function(t){return t.config.pluginsByKey[this.key]}},{key:"getState",value:function(t){return t[this.key]}}]),t}();e.AllSelection=b,e.EditorState=A,e.NodeSelection=x,e.Plugin=z,e.PluginKey=B,e.Selection=m,e.SelectionRange=v,e.TextSelection=k,e.Transaction=E},11901:(t,e,n)=>{"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function i(){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}}).apply(this,arguments)}function o(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}function s(t){var e=h();return function(){var n,r=u(t);return n=e?Reflect.construct(r,arguments,u(this).constructor):r.apply(this,arguments),function(t,e){if(e&&("object"===p(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");var n=t;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,n)}}function a(t){var e="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||!function(t){try{return -1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return l(t,arguments,u(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,t)})(t)}function l(t,e,n){return(l=h()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&c(i,n.prototype),i}).apply(null,arguments)}function h(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}
1function c(t,e){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function d(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==p(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==p(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===p(e)?e:String(e)}(r.key),r)}}function m(t,e,n){return e&&d(t.prototype,e),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var v=n(41684),y=function(){function t(e,n){if(f(this,t),this.content=e,this.size=n||0,null==n)for(var r=0;r<e.length;r++)this.size+=e[r].nodeSize}return m(t,[{key:"nodesBetween",value:function(t,e,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<e;o++){var a=this.content[o],l=s+a.nodeSize;if(l>t&&!1!==n(a,r+s,i||null,o)&&a.content.size){var h=s+1;a.nodesBetween(Math.max(0,t-h),Math.min(a.content.size,e-h),n,r+h)}s=l}}},{key:"descendants",value:function(t){this.nodesBetween(0,this.size,t)}},{key:"textBetween",value:function(t,e,n,r){var i="",o=!0;return this.nodesBetween(t,e,function(s,a){var l=s.isText?s.text.slice(Math.max(t,a)-a,e-a):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=l},0),i}},{key:"append",value:function(e){if(!e.size)return this;if(!this.size)return e;var n=this.lastChild,r=e.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<e.content.length;o++)i.push(e.content[o]);return new t(i,this.size+e.size)}},{key:"cut",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==e&&n==this.size)return this;var r=[],i=0;if(n>e)for(var o=0,s=0;s<n;o++){var a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a=a.isText?a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new t(r,i)}},{key:"cutByIndex",value:function(e,n){return e==n?t.empty:0==e&&n==this.content.length?this:new t(this.content.slice(e,n))}},{key:"replaceChild",value:function(e,n){var r=this.content[e];if(r==n)return this;var i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new t(i,o)}},{key:"addToStart",value:function(e){return new t([e].concat(this.content),this.size+e.nodeSize)}},{key:"addToEnd",value:function(e){return new t(this.content.concat(e),this.size+e.nodeSize)}},{key:"eq",value:function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}},{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(t){var e=this.content[t];if(!e)throw RangeError("Index "+t+" out of range for "+this);return e}},{key:"maybeChild",value:function(t){return this.content[t]||null}},{key:"forEach",value:function(t){for(var e=0,n=0;e<this.content.length;e++){var r=this.content[e];t(r,n,e),n+=r.nodeSize}}},{key:"findDiffStart",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function t(e,n,r){for(var i=0;;i++){if(i==e.childCount||i==n.childCount)return e.childCount==n.childCount?null:r;var o=e.child(i),s=n.child(i);if(o==s){r+=o.nodeSize;continue}if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){for(var a=0;o.text[a]==s.text[a];a++)r++;return r}
1if(o.content.size||s.content.size){var l=t(o.content,s.content,r+1);if(null!=l)return l}r+=o.nodeSize}}(this,t,e)}},{key:"findDiffEnd",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.size;return function t(e,n,r,i){for(var o=e.childCount,s=n.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};var a=e.child(--o),l=n.child(--s),h=a.nodeSize;if(a==l){r-=h,i-=h;continue}if(!a.sameMarkup(l))return{a:r,b:i};if(a.isText&&a.text!=l.text){for(var c=0,u=Math.min(a.text.length,l.text.length);c<u&&a.text[a.text.length-c-1]==l.text[l.text.length-c-1];)c++,r--,i--;return{a:r,b:i}}if(a.content.size||l.content.size){var p=t(a.content,l.content,r-1,i-1);if(p)return p}r-=h,i-=h}}(this,t,e,n)}},{key:"findIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==t)return k(0,t);if(t==this.size)return k(this.content.length,t);if(t>this.size||t<0)throw RangeError("Position ".concat(t," outside of fragment (").concat(this,")"));for(var n=0,r=0;;n++){var i=r+this.child(n).nodeSize;if(i>=t){if(i==t||e>0)return k(n+1,i);return k(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(t){return t.toJSON()}):null}}],[{key:"fromJSON",value:function(e,n){if(!n)return t.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new t(n.map(e.nodeFromJSON))}},{key:"fromArray",value:function(e){if(!e.length)return t.empty;for(var n,r=0,i=0;i<e.length;i++){var o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new t(n||e,r)}},{key:"from",value:function(e){if(!e)return t.empty;if(e instanceof t)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new t([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}]),t}();y.empty=new y([],0);var g={index:0,offset:0};function k(t,e){return g.index=t,g.offset=e,g}function w(t,e){if(t===e)return!0;if(!(t&&"object"==p(t))||!(e&&"object"==p(e)))return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(!w(t[r],e[r]))return!1}else{for(var i in t)if(!(i in e)||!w(t[i],e[i]))return!1;for(var o in e)if(!(o in t))return!1}return!0}var x=function(){function t(e,n){f(this,t),this.type=e,this.attrs=n}return m(t,[{key:"addToSet",value:function(t){for(var e,n=!1,r=0;r<t.length;r++){var i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))e||(e=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!n&&i.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}},{key:"removeFromSet",value:function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}},{key:"isInSet",value:function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}},{key:"eq",value:function(t){return this==t||this.type==t.type&&w(this.attrs,t.attrs)}},{key:"toJSON",value:function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return t}}],[{key:"fromJSON",value:function(t,e){if(!e)throw RangeError("Invalid input for Mark.fromJSON");var n=t.marks[e.type];if(!n)throw RangeError("There is no mark type ".concat(e.type," in this schema"));return n.create(e.attrs)}},{key:"sameSet",value:function(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}},{key:"setFrom",value:function(e){if(!e||Array.isArray(e)&&0==e.length)return t.none;if(e instanceof t)return[e];var n=e.slice();return n.sort(function(t,e){return t.type.rank-e.type.rank}),n}}]),t}();x.none=[];var S=function(t){o(n,t);var e=s(n);function n(){return f(this,n),e.apply(this,arguments)}return m(n)}(a(Error)),b=function(){function t(e,n,r){f(this,t),this.content=e,this.openStart=n,this.openEnd=r}return m(t,[{key:"size",get:function(){return this.content.size-this.openStart-this.openEnd}},{key:"insertAt",value:function(e,n){var r=function t(e,n,r,i){var o=e.findIndex(n),s=o.index,a=o.offset,l=e.maybeChild(s);if(a==n||l.isText)return i&&!i.canReplace(s,s,r)?null:e.cut(0,n).append(r).append(e.cut(n));var h=t(l.content,n-a-1,r);return h&&e.replaceChild(s,l.copy(h))}(this.content,e+this.openStart,n);return r&&new t(r,this.openStart,this.openEnd)}},{key:"removeBetween",value:function(e,n){return new t(function t(e,n,r){var i=e.findIndex(n),o=i.index,s=i.offset,a=e.maybeChild(o),l=e.findIndex(r),h=l.index,c=l.offset;if(s==n||a.isText){if(c!=r&&!e.child(h).isText)throw RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(r))}if(o!=h)throw RangeError("Removing non-flat range");return e.replaceChild(o,a.copy(t(a.content,n-s-1,r-s-1)))}(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}},{key:"eq",value:function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}},{key:"toString",value:function(){return this.content+"("+this.openStart+","+this.openEnd+")"}},{key:"toJSON",value:function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}}],[{key:"fromJSON",value:function(e,n){if(!n)return t.empty;var r=n.openStart||0,i=n.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid input for Slice.fromJSON");return new t(y.fromJSON(e,n.content),r,i)}},{key:"maxOpen",value:function(e){for(var n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=0,i=0,o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(var s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new t(e,r,i)}}]),t}();function M(t,e){if(!e.type.compatibleContent(t.type))throw new S("Cannot join "+e.type.n
1ame+" onto "+t.type.name)}function C(t,e,n){var r=t.node(n);return M(r,e.node(n)),r}function O(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function E(t,e,n,r){var i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(O(t.nodeAfter,r),o++));for(var a=o;a<s;a++)O(i.child(a),r);e&&e.depth==n&&e.textOffset&&O(e.nodeBefore,r)}function T(t,e){return t.type.checkContent(e),t.copy(e)}function R(t,e,n){var r=[];return E(null,t,n,r),t.depth>n&&O(T(C(t,e,n+1),R(t,e,n+1)),r),E(e,null,n,r),new y(r)}b.empty=new b(y.empty,0,0);var N=function(){function t(e,n,r){f(this,t),this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}return m(t,[{key:"resolveDepth",value:function(t){return null==t?this.depth:t<0?this.depth+t:t}},{key:"parent",get:function(){return this.node(this.depth)}},{key:"doc",get:function(){return this.node(0)}},{key:"node",value:function(t){return this.path[3*this.resolveDepth(t)]}},{key:"index",value:function(t){return this.path[3*this.resolveDepth(t)+1]}},{key:"indexAfter",value:function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}},{key:"start",value:function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}},{key:"end",value:function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}},{key:"before",value:function(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}},{key:"after",value:function(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}},{key:"textOffset",get:function(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}},{key:"nodeBefore",get:function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}},{key:"posAtIndex",value:function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1,i=0;i<t;i++)r+=n.child(i).nodeSize;return r}},{key:"marks",value:function(){var t=this.parent,e=this.index();if(0==t.content.size)return x.none;if(this.textOffset)return t.child(e).marks;var n=t.maybeChild(e-1),r=t.maybeChild(e);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(t){var e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;for(var n=e.marks,r=t.parent.maybeChild(t.index()),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(t){for(var e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}},{key:"blockRange",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,e=arguments.length>1?arguments[1]:void 0;if(t.pos<this.pos)return t.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new F(this,t,n);return null}},{key:"sameParent",value:function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}},{key:"max",value:function(t){return t.pos>this.pos?t:this}},{key:"min",value:function(t){return t.pos<this.pos?t:this}},{key:"toString",value:function(){for(var t="",e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}}],[{key:"resolve",value:function(e,n){if(!(n>=0&&n<=e.content.size))throw RangeError("Position "+n+" out of range");for(var r=[],i=0,o=n,s=e;;){var a=s.content.findIndex(o),l=a.index,h=a.offset,c=o-h;if(r.push(s,l,i+h),!c||(s=s.child(l)).isText)break;o=c-1,i+=h+1}return new t(n,r,o)}},{key:"resolveCached",value:function(e,n){for(var r=0;r<I.length;r++){var i=I[r];if(i.pos==n&&i.doc==e)return i}var o=I[A]=t.resolve(e,n);return A=(A+1)%z,o}}]),t}(),I=[],A=0,z=12,F=function(){function t(e,n,r){f(this,t),this.$from=e,this.$to=n,this.depth=r}return m(t,[{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)}}]),t}(),J=Object.create(null),B=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:x.none;f(this,t),this.type=e,this.attrs=n,this.marks=i,this.content=r||y.empty}return m(t,[{key:"nodeSize",get:function(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function(){return this.content.childCount}},{key:"child",value:function(t){return this.content.child(t)}},{key:"maybeChild",value:function(t){return this.content.maybeChild(t)}}
1,{key:"forEach",value:function(t){this.content.forEach(t)}},{key:"nodesBetween",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(t,e,n,r,this)}},{key:"descendants",value:function(t){this.nodesBetween(0,this.content.size,t)}},{key:"textContent",get:function(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}},{key:"textBetween",value:function(t,e,n,r){return this.content.textBetween(t,e,n,r)}},{key:"firstChild",get:function(){return this.content.firstChild}},{key:"lastChild",get:function(){return this.content.lastChild}},{key:"eq",value:function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}},{key:"sameMarkup",value:function(t){return this.hasMarkup(t.type,t.attrs,t.marks)}},{key:"hasMarkup",value:function(t,e,n){return this.type==t&&w(this.attrs,e||t.defaultAttrs||J)&&x.sameSet(this.marks,n||x.none)}},{key:"copy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e==this.content?this:new t(this.type,this.attrs,e,this.marks)}},{key:"mark",value:function(e){return e==this.marks?this:new t(this.type,this.attrs,this.content,e)}},{key:"cut",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}},{key:"slice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t==e)return b.empty;var r=this.resolve(t),i=this.resolve(e),o=n?0:r.sharedDepth(e),s=r.start(o);return new b(r.node(o).content.cut(r.pos-s,i.pos-s),r.depth-o,i.depth-o)}},{key:"replace",value:function(t,e,n){var r=this.resolve(t),i=this.resolve(e);if(n.openStart>r.depth)throw new S("Inserted content deeper than insertion position");if(r.depth-n.openStart!=i.depth-n.openEnd)throw new S("Inconsistent open depths");return function t(e,n,r,i){var o=e.index(i),s=e.node(i);if(o==n.index(i)&&i<e.depth-r.openStart){var a=t(e,n,r,i+1);return s.copy(s.content.replaceChild(o,a))}if(!r.content.size)return T(s,R(e,n,i));if(r.openStart||r.openEnd||e.depth!=i||n.depth!=i){var l=function(t,e){for(var n=e.depth-t.openStart,r=e.node(n).copy(t.content),i=n-1;i>=0;i--)r=e.node(i).copy(y.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(r,e);return T(s,function t(e,n,r,i,o){var s=e.depth>o&&C(e,n,o+1),a=i.depth>o&&C(r,i,o+1),l=[];return E(null,e,o,l),s&&a&&n.index(o)==r.index(o)?(M(s,a),O(T(s,t(e,n,r,i,o+1)),l)):(s&&O(T(s,R(e,n,o+1)),l),E(n,r,o,l),a&&O(T(a,R(r,i,o+1)),l)),E(i,null,o,l),new y(l)}(e,l.start,l.end,n,i))}var h=e.parent,c=h.content;return T(h,c.cut(0,e.parentOffset).append(r.content).append(c.cut(n.parentOffset)))}(r,i,n,0)}},{key:"nodeAt",value:function(t){for(var e=this;;){var n=e.content.findIndex(t),r=n.index,i=n.offset;if(!(e=e.maybeChild(r)))return null;if(i==t||e.isText)return e;t-=i+1}}},{key:"childAfter",value:function(t){var e=this.content.findIndex(t),n=e.index,r=e.offset;return{node:this.content.maybeChild(n),index:n,offset:r}}},{key:"childBefore",value:function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,r=e.offset;if(r<t)return{node:this.content.child(n),index:n,offset:r};var i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}},{key:"resolve",value:function(t){return N.resolveCached(this,t)}},{key:"resolveNoCache",value:function(t){return N.resolve(this,t)}},{key:"rangeHasMark",value:function(t,e,n){var r=!1;return e>t&&this.nodesBetween(t,e,function(t){return n.isInSet(t.marks)&&(r=!0),!r}),r}},{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}}
1,{key:"toString",value:function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),P(this.marks,t)}},{key:"contentMatchAt",value:function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw Error("Called contentMatchAt on a node with invalid content");return e}},{key:"canReplace",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:y.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(t).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,e);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(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;var i=this.contentMatchAt(t).matchType(n),o=i&&i.matchFragment(this.content,e);return!!o&&o.validEnd}},{key:"canAppend",value:function(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}},{key:"check",value:function(){this.type.checkContent(this.content);for(var t=x.none,e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!x.sameSet(t,this.marks))throw RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map(function(t){return t.type.name})));this.content.forEach(function(t){return t.check()})}},{key:"toJSON",value:function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(function(t){return t.toJSON()})),t}}],[{key:"fromJSON",value:function(t,e){if(!e)throw RangeError("Invalid input for Node.fromJSON");var n=null;if(e.marks){if(!Array.isArray(e.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw RangeError("Invalid text node in JSON");return t.text(e.text,n)}var r=y.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}]),t}();B.prototype.text=void 0;var D=function(t){o(n,t);var e=s(n);function n(t,r,i,o){var s;if(f(this,n),s=e.call(this,t,r,null,o),!i)throw RangeError("Empty text nodes are not allowed");return s.text=i,s}return m(n,[{key:"toString",value:function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):P(this.marks,JSON.stringify(this.text))}},{key:"textContent",get:function(){return this.text}},{key:"textBetween",value:function(t,e){return this.text.slice(t,e)}},{key:"nodeSize",get:function(){return this.text.length}},{key:"mark",value:function(t){return t==this.marks?this:new n(this.type,this.attrs,this.text,t)}},{key:"withText",value:function(t){return t==this.text?this:new n(this.type,this.attrs,t,this.marks)}},{key:"cut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}},{key:"eq",value:function(t){return this.sameMarkup(t)&&this.text==t.text}},{key:"toJSON",value:function(){var t=i(u(n.prototype),"toJSON",this).call(this);return t.text=this.text,t}}]),n}(B);function P(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var j=function(){function t(e){f(this,t),this.validEnd=e,this.next=[],this.wrapCache=[]}return m(t,[{key:"matchType",value:function(t){for(var e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}},{key:"matchFragment",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.childCount,r=this,i=e;r&&i<n;i++)r=r.matchType(t.child(i).type);return r}},{key:"inlineContent",get:function(){return 0!=this.next.length&&this.next[0].type.isInline}},{key:"defaultType",get:function(){for(var t=0;t<this.next.length;t++){var e=this.next[t].type;if(!(e.isText||e.hasRequiredAttrs()))return e}return null}},{key:"compatible",value:function(t){for(var e=0;e<this.next.length;e++)for(var n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}},{key:"fillBefore",value:function(t){var e=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(t,n);if(a&&(!e||a.validEnd))return y.from(s.map(function(t){return t.createAndFill()}));for(var l=0;l<o.next.length;l++){var h=o.next[l],c=h.type,u=h.next;if(!(c.isText||c.hasRequiredAttrs())&&-1==r.indexOf(u)){r.push(u);var p=i(u,s.concat(c));if(p)return p}}return null}(this,[])}},{key:"findWrapping",value:function(t){for(var e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];var n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}},{key:"computeWrapping",value:function(t){for(var e=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),i=r.match;if(i.matchType(t)){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],h=l.type,c=l.next;h.isLeaf||h.hasRequiredAttrs()||h.name in e||r.type&&!c.validEnd||(n.push({match:h.contentMatch,type:h,via:r}),e[h.name]=!0)}}return null}},{key:"edgeCount",get:function(){return this.next.length}},{key:"edge",value:function(t){if(t>=this.next.length)throw RangeError("There's no ".concat(t,"th edge in this content match"));return this.next[t]}},{key:"toString",value:function(){var t=[];return!function e(n){t.push(n);for(var r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map(function(e,n){for(var r=n+(e.validEnd?"*":" ")+" ",i=0;i<e.next.length;i++)r+=(i?", ":"")+e.next[i].type.name+"->"+t.indexOf(e.next[i].next);return r}).join("\n")}}],[{key:"parse",value:function(e,n){var r,i,o=new $(e,n);if(null==o.next)return t.empty;var s=function t(e){var n=[];do n.push(function(e){var n=[];do n.push(function(e){for(var n=function(e){if(e.eat("(")){var n=t(e);return e.eat(")")||e.err("Missing closing paren"),n}if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{var r=(function(t,e){var n=t.nodeTypes,r=n[e];if(r)return[r];var i=[];for(var o in n){var s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return 0==i.length&&t.err("No node type or group '"+e+"' 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==r.length?r[0]:{type:"choice",exprs:r}}}(e);;)if(e.eat("+"))n={type:"plus",expr:n};else if(e.eat("*"))n={type:"star",expr:n};else if(e.eat("?"))n={type:"opt",expr:n};else if(e.eat("{"))n=function(t,e){var n=_(t),r=n;return t.eat(",")&&(r="}"!=t.next?_(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}(e,n);else break;return n}(e));while(e.next&&")"!=e.next&&"|"!=e.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(e));while(e.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(o);o.next&&o.err("Unexpected trailing text");var a=(r=function(t){var e=[[]];return i(function t(e,o){if("choice"==e.type)return e.exprs.reduce(function(e,n){return e.concat(t(n,o))},[]);if("seq"==e.type)for(var s=0;;s++){var a=t(e.exprs[s],o);if(s==e.exprs.length-1)return a;i(a,o=n())}else if("star"==e.type){var l=n();return r(o,l),i(t(e.expr,l),l),[r(l)]}else if("plus"==e.type){var h=n();return i(t(e.expr,o),h),i(t(e.expr,h),h),[r(h)]}else if("opt"==e.type)return[r(o)].concat(t(e.expr,o));else if("range"==e.type){for(var c=o,u=0;u<e.min;u++){var p=n();i(t(e.expr,c),p),c=p}if(-1==e.max)i(t(e.expr,c),c);else for(var f=e.min;f<e.max;f++){var d=n();r(c,d),i(t(e.expr,c),d),c=d}return[r(c)]}else if("name"==e.type)return[r(o,void 0,e.value)];else throw Error("Unknown expr type")}(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){var i={term:r,to:n};return e[t].push(i),i}function i(t,e){t.forEach(function(t){return t.to=e})}}(s),i=Object.create(null),function t(e){var n=[];e.forEach(function(t){r[t].forEach(function(t){var e,i=t.term,o=t.to;if(i){for(var s=0;s<n.length;s++)n[s][0]==i&&(e=n[s][1]);
1W(r,o).forEach(function(t){e||n.push([i,e=[]]),-1==e.indexOf(t)&&e.push(t)})}})});for(var o=i[e.join(",")]=new j(e.indexOf(r.length-1)>-1),s=0;s<n.length;s++){var a=n[s][1].sort(L);o.next.push({type:n[s][0],next:i[a.join(",")]||t(a)})}return o}(W(r,0)));return function(t,e){for(var n=0,r=[t];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],h=l.type,c=l.next;s.push(h.name),o&&!(h.isText||h.hasRequiredAttrs())&&(o=!1),-1==r.indexOf(c)&&r.push(c)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(a,o),a}}]),t}();j.empty=new j(!0);var $=function(){function t(e,n){f(this,t),this.string=e,this.nodeTypes=n,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()}return m(t,[{key:"next",get:function(){return this.tokens[this.pos]}},{key:"eat",value:function(t){return this.next==t&&(this.pos++||!0)}},{key:"err",value:function(t){throw SyntaxError(t+" (in content expression '"+this.string+"')")}}]),t}();function _(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function L(t,e){return e-t}function W(t,e){var n=[];return function e(r){var i=t[r];if(1==i.length&&!i[0].term)return e(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)||e(l)}}(e),n.sort(L)}function K(t){var e=Object.create(null);for(var n in t){var r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function q(t,e){var n=Object.create(null);for(var r in t){var i=e&&e[r];if(void 0===i){var o=t[r];if(o.hasDefault)i=o.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function V(t){var e=Object.create(null);if(t)for(var n in t)e[n]=new Z(t[n]);return e}var U=function(){function t(e,n,r){f(this,t),this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=V(r.attrs),this.defaultAttrs=K(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==e),this.isText="text"==e}return m(t,[{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 t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}},{key:"compatibleContent",value:function(t){return this==t||this.contentMatch.compatible(t.contentMatch)}},{key:"computeAttrs",value:function(t){return!t&&this.defaultAttrs?this.defaultAttrs:q(this.attrs,t)}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(this.isText)throw Error("NodeType.create can't construct text nodes");return new B(this,this.computeAttrs(t),y.from(e),x.setFrom(n))}},{key:"createChecked",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return e=y.from(e),this.checkContent(e),new B(this,this.computeAttrs(t),e,x.setFrom(n))}},{key:"createAndFill",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(t=this.computeAttrs(t),(e=y.from(e)).size){var r=this.contentMatch.fillBefore(e);if(!r)return null;e=r.append(e)}var i=this.contentMatch.matchFragment(e),o=i&&i.fillBefore(y.empty,!0);return o?new B(this,t,e.append(o),x.setFrom(n)):null}},{key:"validContent",value:function(t){var e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(var n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0}},{key:"checkContent",value:function(t){if(!this.validContent(t))throw RangeError("Invalid content for node ".concat(this.name,": ").concat(t.toString().slice(0,50)))}},{key:"allowsMarkType",value:function(t){return null==this.markSet||this.markSet.indexOf(t)>-1}},{key:"allowsMarks",value:function(t){if(null==this.markSet)return!0;for(var e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}},{key:"allowedMarks",value:function(t){if(null==this.markSet)return t;for(var e,n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:x.none:t}}
1],[{key:"compile",value:function(e,n){var r=Object.create(null);e.forEach(function(e,i){return r[e]=new t(e,n,i)});var i=n.spec.topNode||"doc";if(!r[i])throw RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw RangeError("Every schema needs a 'text' type");for(var o in r.text.attrs)throw RangeError("The text node type should not have attributes");return r}}]),t}(),Z=function(){function t(e){f(this,t),this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}return m(t,[{key:"isRequired",get:function(){return!this.hasDefault}}]),t}(),H=function(){function t(e,n,r,i){f(this,t),this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=V(i.attrs),this.excluded=null;var o=K(this.attrs);this.instance=o?new x(this,o):null}return m(t,[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!t&&this.instance?this.instance:new x(this,q(this.attrs,t))}},{key:"removeFromSet",value:function(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}},{key:"isInSet",value:function(t){for(var e=0;e<t.length;e++)if(t[e].type==this)return t[e]}},{key:"excludes",value:function(t){return this.excluded.indexOf(t)>-1}}],[{key:"compile",value:function(e,n){var r=Object.create(null),i=0;return e.forEach(function(e,o){return r[e]=new t(e,i++,n,o)}),r}}]),t}(),X=function(){function t(e){f(this,t),this.linebreakReplacement=null,this.cached=Object.create(null);var n=this.spec={};for(var r in e)n[r]=e[r];n.nodes=v.from(e.nodes),n.marks=v.from(e.marks||{}),this.nodes=U.compile(this.spec.nodes,this),this.marks=H.compile(this.spec.marks,this);var i=Object.create(null);for(var o in this.nodes){if(o in this.marks)throw RangeError(o+" can not be both a node and a mark");var s=this.nodes[o],a=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=i[a]||(i[a]=j.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet="_"==l?null:l?Y(this,l.split(" ")):""!=l&&s.inlineContent?null:[]}for(var h in this.marks){var c=this.marks[h],u=c.spec.excludes;c.excluded=null==u?[c]:""==u?[]:Y(this,u.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 m(t,[{key:"node",value:function(t){var e=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 t)t=this.nodeType(t);else if(t instanceof U){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(e,n,r)}},{key:"text",value:function(t,e){var n=this.nodes.text;return new D(n,n.defaultAttrs,t,x.setFrom(e))}},{key:"mark",value:function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}},{key:"nodeFromJSON",value:function(t){return B.fromJSON(this,t)}},{key:"markFromJSON",value:function(t){return x.fromJSON(this,t)}},{key:"nodeType",value:function(t){var e=this.nodes[t];if(!e)throw RangeError("Unknown node type: "+t);return e}}]),t}();function Y(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(var a in t.marks){var l=t.marks[a];("_"==i||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}var G=function(){function t(e,n){var r=this;f(this,t),this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(function(t){null!=t.tag?r.tags.push(t):null!=t.style&&r.styles.push(t)}),this.normalizeLists=!this.tags.some(function(t){if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;var n=e.nodes[t.node];return n.contentMatch.matchType(n)})}return m(t,[{key:"parse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ti(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}},{key:"parseSlice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ti(this,e,!0);return n.addAll(t,e.from,e.to),b.maxOpen(n.finish())}},{key:"matchTag",value:function(t,e,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var i,o,s=this.tags[r];if(i=t,o=s.tag,(i.matches||i.msMatchesSelector||i.webkitMatchesSelector||i.mozMatchesSelector).call(i,o)&&(void 0===s.namespace||t.namespaceURI==s.namespace)&&(!s.context||e.matchesContext(s.context))){if(s.getAttrs
1){var a=s.getAttrs(t);if(!1===a)continue;s.attrs=a||void 0}return s}}}},{key:"matchStyle",value:function(t,e,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(t)&&(!o.context||n.matchesContext(o.context))&&(!(s.length>t.length)||61==s.charCodeAt(t.length)&&s.slice(t.length+1)==e)){if(o.getAttrs){var a=o.getAttrs(e);if(!1===a)continue;o.attrs=a||void 0}return o}}}}],[{key:"schemaRules",value:function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,r=0;r<e.length;r++){var i=e[r];if((null==i.priority?50:i.priority)<n)break}e.splice(r,0,t)}var r=function(e){var r=t.marks[e].spec.parseDOM;r&&r.forEach(function(t){n(t=to(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)})};for(var i in t.marks)r(i);var o=function(e){var r=t.nodes[e].spec.parseDOM;r&&r.forEach(function(t){n(t=to(t)),t.node||t.ignore||t.mark||(t.node=e)})};for(var s in t.nodes)o(s);return e}},{key:"fromSchema",value:function(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}}]),t}(),Q={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},tt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},te={ol:!0,ul:!0};function tn(t,e,n){return null!=e?!!e|2*("full"===e):t&&"pre"==t.whitespace?3:-5&n}var tr=function(){function t(e,n,r,i,o,s,a){f(this,t),this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=x.none,this.stashMarks=[],this.match=s||(4&a?null:e.contentMatch)}return m(t,[{key:"findWrapping",value:function(t){if(!this.match){if(!this.type)return[];var e=this.type.contentMatch.fillBefore(y.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{var n,r=this.type.contentMatch;return(n=r.findWrapping(t.type))?(this.match=r,n):null}}return this.match.findWrapping(t.type)}},{key:"finish",value:function(t){if(!(1&this.options)){var e,n=this.content[this.content.length-1];n&&n.isText&&(e=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length)))}var r=y.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(y.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}},{key:"popFromStashMark",value:function(t){for(var e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}},{key:"applyPending",value:function(t){for(var e=0,n=this.pendingMarks;e<n.length;e++){var r=n[e];(this.type?this.type.allowsMarkType(r.type):function(t,e){var n,r=e.schema.nodes;for(var i in r)if(0!==(n=function(){var n=r[i];if(!n.allowsMarkType(t))return 0;var o=[];if(function t(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==e||0>o.indexOf(a)&&t(a))return!0}}(n.contentMatch))return{v:!0}}())&&n)return n.v}(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}},{key:"inlineContext",value:function(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Q.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}]),t}(),ti=function(){function t(e,n,r){f(this,t),this.parser=e,this.options=n,this.isOpen=r,this.open=0;var i,o=n.topNode,s=tn(null,n.preserveWhitespace,0)|4*!!r;i=o?new tr(o.type,o.attrs,x.none,x.none,!0,n.topMatch||o.type.contentMatch,s):r?new tr(null,null,x.none,x.none,!0,null,s):new tr(e.schema.topNodeType,null,x.none,x.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}return m(t,[{key:"top",get:function(){return this.nodes[this.open]}},{key:"addDOM",value:function(t){3==t.nodeType?this.addTextNode(t):1==t.nodeType&&this.addElement(t)}},{key:"withStyleRules",value:function(t,e){var n=t.style;if(!n||!n.length)return e();var i=this.readStyles(t.style);if(i){for(var o=function(t){if(Array.isArray(t))return t}(i)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],l=!0,h=!1;try{o=(n=n.call(t)).next,!1;for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(t){h=!0,i=t}
1finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return a}}(i,2)||function(t,e){if(t){if("string"==typeof t)return r(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,e)}}(i,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=o[0],a=o[1],l=this.top,h=0;h<a.length;h++)this.removePendingMark(a[h],l);for(var c=0;c<s.length;c++)this.addPendingMark(s[c]);e();for(var u=0;u<s.length;u++)this.removePendingMark(s[u],l);for(var p=0;p<a.length;p++)this.addPendingMark(a[p])}}},{key:"addTextNode",value:function(t){var e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],i=t.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)}},{key:"addElement",value:function(t,e){var n,r=this,i=t.nodeName.toLowerCase();te.hasOwnProperty(i)&&this.parser.normalizeLists&&function(t){for(var e=t.firstChild,n=null;e;e=e.nextSibling){var r=1==e.nodeType?e.nodeName.toLowerCase():null;r&&te.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):"li"==r?n=e:r&&(n=null)}}(t);var o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(o?o.ignore:tt.hasOwnProperty(i))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);var s,a=this.top,l=this.needsBlock;if(Q.hasOwnProperty(i))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);o&&o.skip?this.addAll(t):this.withStyleRules(t,function(){return r.addAll(t)}),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(t,function(){r.addElementByRule(t,o,!1===o.consuming?n:void 0)})}},{key:"leafFallback",value:function(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}},{key:"ignoreFallback",value:function(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}},{key:"readStyles",value:function(t){for(var e=this,n=x.none,r=x.none,i=0,o=t.length;i<o;i++)for(var s,a=t.item(i),l=void 0;0!==(s=function(i){var o=e.parser.matchStyle(a,t.getPropertyValue(a),e,i);return o?o.ignore?{v:null}:(o.clearMark?e.top.pendingMarks.concat(e.top.activeMarks).forEach(function(t){o.clearMark(t)&&(r=t.addToSet(r))}):n=e.parser.schema.marks[o.mark].create(o.attrs).addToSet(n),!1!==o.consuming)?(l=i,0):void(l=i=o):(l=i,0)}(l));)if(s)return s.v;return[n,r]}},{key:"addElementByRule",value:function(t,e,n){var r,i,o,s=this;e.node?(i=this.parser.schema.nodes[e.node]).isLeaf?this.insertNode(i.create(e.attrs))||this.leafFallback(t):r=this.enter(i,e.attrs||null,e.preserveWhitespace):(o=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(o));var a=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(function(t){return s.insertNode(t)});else{var l=t;"string"==typeof e.contentElement?l=t.querySelector(e.contentElement):"function"==typeof e.contentElement?l=e.contentElement(t):e.contentElement&&(l=e.contentElement),this.findAround(t,l,!0),this.addAll(l)}r&&this.sync(a)&&this.open--,o&&this.removePendingMark(o,a)}},{key:"addAll",value:function(t,e,n){for(var r=e||0,i=e?t.childNodes[e]:t.firstChild,o=null==n?null:t.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(i);this.findAtPoint(t,r)}},{key:"findPlace",value:function(t){for(var e,n,r=this.open;r>=0;r--){var i=this.nodes[r],o=i.findWrapping(t);if(o&&(!e||e.length>
1o.length)&&(e=o,n=i,!o.length)||i.solid)break}if(!e)return!1;this.sync(n);for(var s=0;s<e.length;s++)this.enterInner(e[s],null,!1);return!0}},{key:"insertNode",value:function(t){if(t.isInline&&this.needsBlock&&!this.top.type){var e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(t)){this.closeExtra();var n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));for(var r=n.activeMarks,i=0;i<t.marks.length;i++)(!n.type||n.type.allowsMarkType(t.marks[i].type))&&(r=t.marks[i].addToSet(r));return n.content.push(t.mark(r)),!0}return!1}},{key:"enter",value:function(t,e,n){var r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r}},{key:"enterInner",value:function(t){var e=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(t),i.match=i.match&&i.match.matchType(t);var o=tn(t,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new tr(t,e,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}},{key:"closeExtra",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}},{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(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}},{key:"currentPos",get:function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t}},{key:"findAtPoint",value:function(t,e){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}},{key:"findInside",value:function(t){if(this.find)for(var e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}},{key:"findAround",value:function(t,e,n){if(t!=e&&this.find)for(var r=0;r<this.find.length;r++)null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}},{key:"findInText",value:function(t){if(this.find)for(var e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}},{key:"matchesContext",value:function(t){var e=this;if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+ +!i;return function t(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(t(s-1,a))return!0;return!1}var h=a>0||0==a&&i?e.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!h||h.name!=l&&-1==h.groups.indexOf(l))return!1;a--}return!0}(n.length-1,this.open)}},{key:"textblockFromContext",value:function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var i=this.parser.schema.nodes[r];if(i.isTextblock&&i.defaultAttrs)return i}}},{key:"addPendingMark",value:function(t){var e=function(t,e){for(var n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}},{key:"removePendingMark",value:function(t,e){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);var i=r.popFromStashMark(t);i&&r.type&&r.type.allowsMarkType(i.type)&&(r.activeMarks=i.addToSet(r.activeMarks))}if(r==e)break}}}]),t}();function to(t){var e={};for(var n in t)e[n]=t[n];return e}var ts=function(){function t(e,n){f(this,t),this.nodes=e,this.marks=n}return m(t,[{key:"serializeFragment",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;r||(r=tl(n).createDocumentFragment());var i=r,o=[];return t.forEach(function(t){if(o.length||t.marks.length){for(var r=0,s=0;r<o.length&&s<t.marks.length;){var a=t.marks[s];if(!e.marks[a.type.name]){s++;continue}if(!a.eq(o[r][0])||!1===a.type.spec.spanning)break;r++,s++}for(;r<o.length;)i=o.pop()[1];for(;s<t.marks.length;){var l=t.marks[s++],h=e.serializeMark(l,t.isInline,n);h&&(o.push([l,i]),i.appendChild(h.dom),i=h.contentDOM||h.dom)}}i.appendChild(e.serializeNodeInner(t,n))}),r}}
1,{key:"serializeNodeInner",value:function(e,n){var r=t.renderSpec(tl(n),this.nodes[e.type.name](e)),i=r.dom,o=r.contentDOM;if(o){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return i}},{key:"serializeNode",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(t,e),r=t.marks.length-1;r>=0;r--){var i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}},{key:"serializeMark",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.marks[e.type.name];return i&&t.renderSpec(tl(r),i(e,n))}}],[{key:"renderSpec",value:function(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("string"==typeof n)return{dom:e.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;var o=n[0],s=o.indexOf(" ");s>0&&(i=o.slice(0,s),o=o.slice(s+1));var a=i?e.createElementNS(i,o):e.createElement(o),l=n[1],h=1;if(l&&"object"==p(l)&&null==l.nodeType&&!Array.isArray(l)){for(var c in h=2,l)if(null!=l[c]){var u=c.indexOf(" ");u>0?a.setAttributeNS(c.slice(0,u),c.slice(u+1),l[c]):a.setAttribute(c,l[c])}}for(var f=h;f<n.length;f++){var d=n[f];if(0===d){if(f<n.length-1||f>h)throw RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}var m=t.renderSpec(e,d,i),v=m.dom,y=m.contentDOM;if(a.appendChild(v),y){if(r)throw RangeError("Multiple content holes");r=y}}return{dom:a,contentDOM:r}}},{key:"fromSchema",value:function(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}},{key:"nodesFromSchema",value:function(t){var e=ta(t.nodes);return e.text||(e.text=function(t){return t.text}),e}},{key:"marksFromSchema",value:function(t){return ta(t.marks)}}]),t}();function ta(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function tl(t){return t.document||window.document}e.ContentMatch=j,e.DOMParser=G,e.DOMSerializer=ts,e.Fragment=y,e.Mark=x,e.MarkType=H,e.Node=B,e.NodeRange=F,e.NodeType=U,e.ReplaceError=S,e.ResolvedPos=N,e.Schema=X,e.Slice=b},14929:(t,e,n)=>{"use strict";n.d(e,{Sd:()=>d,ZW:()=>f,wn:()=>m});var r=n(18407),i=n(73656),o=n(51772);let s=["ol",0],a=["ul",0],l=["li",0],h={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1==t.attrs.order?s:["ol",{start:t.attrs.order},0]},c={parseDOM:[{tag:"ul"}],toDOM:()=>a},u={parseDOM:[{tag:"li"}],toDOM:()=>l,defining:!0};function p(t,e){let n={};for(let e in t)n[e]=t[e];for(let t in e)n[t]=e[t];return n}function f(t,e,n){return t.append({ordered_list:p(h,{content:"list_item+",group:n}),bullet_list:p(c,{content:"list_item+",group:n}),list_item:p(u,{content:e})})}function d(t,e=null){return function(n,o){let{$from:s,$to:a}=n.selection,l=s.blockRange(a),h=!1,c=l;if(!l)return!1;if(l.depth>=2&&s.node(l.depth-1).type.compatibleContent(t)&&0==l.startIndex){if(0==s.index(l.depth-1))return!1;let t=n.doc.resolve(l.start-2);c=new i.u$(t,t,l.depth),l.endIndex<l.parent.childCount&&(l=new i.u$(s,n.doc.resolve(a.end(l.depth)),l.depth)),h=!0}let u=(0,r.oM)(c,t,e,l);return!!u&&(o&&o((function(t,e,n,o,s){let a=i.FK.empty;for(let t=n.length-1;t>=0;t--)a=i.FK.from(n[t].type.create(n[t].attrs,a));t.step(new r.Wg(e.start-2*!!o,e.end,e.start,e.end,new i.Ji(a,0,0),n.length,!0));let l=0;for(let t=0;t<n.length;t++)n[t].type==s&&(l=t+1);let h=n.length-l,c=e.start+n.length-2*!!o,u=e.parent;for(let n=e.startIndex,i=e.endIndex,o=!0;n<i;n++,o=!1)!o&&(0,r.zy)(t.doc,c,h)&&(t.split(c,h),c+=2*h),c+=u.child(n).nodeSize;return t})(n.tr,l,u,h,t).scrollIntoView()),!0)}}function m(t,e){return function(n,s){let{$from:a,$to:l,node:h}=n.selection;if(h&&h.isBlock||a.depth<2||!a.sameParent(l))return!1;let c=a.node(-1);if(c.type!=t)return!1;if(0==a.parent.content.size&&a.node(-1).childCount==a.indexAfter(-1)){if(3==a.depth||a.node(-3).type!=t||a.index(-2)!=a.node(-2).childCount-1)return!1;if(s){let e=i.FK.empty,r=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-r;t>=a.depth-3;t--)e=i.FK.from(a.node(t).copy(e));let l=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3;e=e.append(i.FK.from(t.createAndFill()));let h=a.before(a.depth-(r-1)),c=n.tr.replace(h,a.after(-l),new i.Ji(e,4-r,0)),u=-1;c.doc.nodesBetween(h,c.doc.content.size,(t,e)=>{if(u>-1)return!1;t.isTextblock&&0==t.content.size&&(u=e+1)}),u>-1&&c.setSelection(o.LN.near(c.doc.resolve(u))),s(c.scrollIntoView())}return!0}let u=l.pos==a.end()?c.contentMatchAt(0).defaultType:null,p=n.tr.delete(a.pos,l.pos),f=u?[e?{type:t,attrs:e}:null,{type:u}]:void 0;return!!(0,r.zy)(p.doc,a.pos,2,f)&&(s&&s(p.split(a.pos,2,f).scrollIntoView()),!0)}}},15831:function(t,e,n){var r,i;"undefined"!=typeof self&&self,void 0===(i="function"==typeof(r=function(){"function"!=typeof Promise&&function(e){function n(t,e){return function(){t.apply(e,arguments)}}function r(t){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");if("function"!=typeof t)throw TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],h(t,n(o,this),n(s,this))}function i(t){var e=this;return null===this._state?void this._deferreds.push(t):void u(function(){var n,r=e._state?t.onFulfilled:t.onRejected;if(null===r)return void(e._state?t.resolve:t.reject)(e._value);try{n=r(e._value)}catch(e){return void t.reject(e)}t.resolve(n)})}function o(t){try{if(t===this)throw TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void h(n(e,t),n(o,this),n(s,this))}this._state=!0,this._value=t,a.call(this)}catch(t){s.call(this,t)}}function s(t){this._state=!1,this._value=t,a.call(this)}function a(){for(var t=0,e=this._deferreds.length;e>t;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function l(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function h(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(t){if(r)return;r=!0,n(t)}}var c=setTimeout,u="function"==typeof setImmediate&&setImmediate||function(t){c(t,1)},p=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};r.prototype.catch=function(t){return this.then(null,t)},r.prototype.then=function(t,e){var n=this;return new r(function(r,o){i.call(n,new l(t,e,r,o))})},r.all=function(){var t=Array.prototype.slice.call(1==arguments.length&&p(arguments[0])?arguments[0]:arguments);return new r(function(e,n){if(0===t.length)return e([]);for(var r=t.length,i=0;i<t.length;i++)!function i(o,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,function(t){i(o,t)},n)}t[o]=s,0==--r&&e(t)}
1catch(t){n(t)}}(i,t[i])})},r.resolve=function(t){return t&&"object"==typeof t&&t.constructor===r?t:new r(function(e){e(t)})},r.reject=function(t){return new r(function(e,n){n(t)})},r.race=function(t){return new r(function(e,n){for(var r=0,i=t.length;i>r;r++)t[r].then(e,n)})},r._setImmediateFn=function(t){u=t},t.exports?t.exports=r:e.Promise||(e.Promise=r)}(this),"undefined"!=typeof window&&"function"!=typeof window.CustomEvent&&function(){function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}t.prototype=window.Event.prototype,window.CustomEvent=t}(),"undefined"==typeof HTMLCanvasElement||HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(t,e,n){for(var r=atob(this.toDataURL(e,n).split(",")[1]),i=r.length,o=new Uint8Array(i),s=0;s<i;s++)o[s]=r.charCodeAt(s);t(new Blob([o],{type:e||"image/png"}))}});var e,n,r,i,o,s=["Webkit","Moz","ms"],a="undefined"!=typeof document?document.createElement("div").style:{},l=[1,8,3,6],h=[2,7,4,5];function c(t){if(t in a)return t;for(var e=t[0].toUpperCase()+t.slice(1),n=s.length;n--;)if((t=s[n]+e)in a)return t}function u(t,e){for(var n in t=t||{},e)e[n]&&e[n].constructor&&e[n].constructor===Object?(t[n]=t[n]||{},u(t[n],e[n])):t[n]=e[n];return t}i=c("transform"),r=c("transformOrigin"),o=c("userSelect");function p(t){if("createEvent"in document){var e=document.createEvent("HTMLEvents");e.initEvent("change",!1,!0),t.dispatchEvent(e)}else t.fireEvent("onchange")}function f(t,e,n){if("string"==typeof e){var r=e;(e={})[r]=n}for(var i in e)t.style[i]=e[i]}function d(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function m(t,e){for(var n in e)t.setAttribute(n,e[n])}function v(t){return parseInt(t,10)}function y(t,e){var n=t.naturalWidth,r=t.naturalHeight,i=e||x(t);if(i&&i>=5){var o=n;n=r,r=o}return{width:n,height:r}}var g={translate3d:{suffix:", 0px"},translate:{suffix:""}},k=function(t,e,n){this.x=parseFloat(t),this.y=parseFloat(e),this.scale=parseFloat(n)};k.parse=function(t){return t.style?k.parse(t.style[i]):t.indexOf("matrix")>-1||t.indexOf("none")>-1?k.fromMatrix(t):k.fromString(t)},k.fromMatrix=function(t){var e=t.substring(7).split(",");return e.length&&"none"!==t||(e=[1,0,0,1,0,0]),new k(v(e[4]),v(e[5]),parseFloat(e[0]))},k.fromString=function(t){var e=t.split(") "),n=e[0].substring(tn.globals.translate.length+1).split(","),r=e.length>1?e[1].substring(6):1;return new k(n.length>1?n[0]:0,n.length>1?n[1]:0,r)},k.prototype.toString=function(){var t=g[tn.globals.translate].suffix||"";return tn.globals.translate+"("+this.x+"px, "+this.y+"px"+t+") scale("+this.scale+")"};var w=function(t){if(!t||!t.style[r]){this.x=0,this.y=0;return}var e=t.style[r].split(" ");this.x=parseFloat(e[0]),this.y=parseFloat(e[1])};function x(t){return t.exifdata&&t.exifdata.Orientation?v(t.exifdata.Orientation):1}function S(t,e,n){var r=e.width,i=e.height,o=t.getContext("2d");switch(t.width=e.width,t.height=e.height,o.save(),n){case 2:o.translate(r,0),o.scale(-1,1);break;case 3:o.translate(r,i),o.rotate(180*Math.PI/180);break;case 4:o.translate(0,i),o.scale(1,-1);break;case 5:t.width=i,t.height=r,o.rotate(90*Math.PI/180),o.scale(1,-1);break;case 6:t.width=i,t.height=r,o.rotate(90*Math.PI/180),o.translate(0,-i);break;case 7:t.width=i,t.height=r,o.rotate(-90*Math.PI/180),o.translate(-r,i),o.scale(1,-1);break;case 8:t.width=i,t.height=r,o.translate(0,r),o.rotate(-90*Math.PI/180)}o.drawImage(e,0,0,r,i),o.restore()}function b(){var t,e,n,r,i,o,s=this.options.viewport.type?"cr-vp-"+this.options.viewport.type:null;this.options.useCanvas=this.options.enableOrientation||M.call(this),this.data={},this.elements={},t=this.elements.boundary=document.createElement("div"),n=this.elements.viewport=document.createElement("div"),e=this.elements.img=document.createElement("img"),r=this.elements.overlay=document.createElement("div"),this.options.useCanvas?(this.elements.canvas=document.createElement("canvas"),this.elements.preview=this.elements.canvas):this.elements.preview=e,d(t,"cr-boundary"),t.setAttribute("aria-dropeffect","none"),i=this.options.boundary.width,o=this.options.boundary.height,f(t,{width:i+(isNaN(i)?"":"px"),height:o+(isNaN(o)?"":"px")}),d(n,"cr-viewport"),s&&d(n,s),f(n,{width:this.options.viewport.width+"px",height:this.options.viewport.height+"px"}),n.setAttribute("tabindex",0),d(this.elements.preview,"cr-image"),m(this.elements.preview,{alt:"preview","aria-grabbed":"false"}),d(r,"cr-overlay"),this.element.appendChild(t),t.appendChild(this.elements.preview),t.appendChild(n),t.appendChild(r),d(this.element,"croppie-container"),this.options.customClass&&d(this.element,this.options.customClass),I.call(this),this.options.enableZoom&&E.call(this),this.options.enableResize&&C.call(this)}function M(){return this.options.enableExif&&window.EXIF}function C(){var t,e,n,r,i,s,a,l=this,h=document.createElement("div"),c=!1;function u(s){if((void 0===s.button||0===s.button)&&(s.preventDefault(),!c)){var a=l.elements.overlay.getBoundingClientRect();if(c=!0,e=s.pageX,n=s.pageY,t=-1!==s.currentTarget.className.indexOf("vertical")?"v":"h",r=a.width,i=a.height,s.touches){var h=s.touches[0];e=h.pageX,n=h.pageY}window.addEventListener("mousemove",p),window.addEventListener("touchmove",p),window.addEventListener("mouseup",m),window.addEventListener("touchend",m),document.body.style[o]="none"}}function p(o){var s=o.pageX,a=o.pageY;if(o.preventDefault(),o.touches){var c=o.touches[0];s=c.pageX,a=c.pageY}var u=s-e,p=a-n,d=l.options.viewport.height+p,m=l.options.viewport.width+u;"v"===t&&d>=50&&d<=i?(f(h,{height:d+"px"}),l.options.boundary.height+=p,f(l.elements.boundary,{height:l.options.boundary.height+"px"}),l.options.viewport.height+=p,f(l.elements.viewport,{height:l.options.viewport.height+"px"})):"h"===t&&m>=50&&m<=r&&(f(h,{width:m+"px"}),l.options.boundary.width+=u,f(l.elements.boundary,{width:l.options.boundary.width+"px"}),l.options.viewport.width+=u,f(l.elements.viewport,{width:l.options.viewport.width+"px"})),A.call(l),D.call(l),N.call(l),F.call(l),n=a,e=s}function m(){c=!1,window.removeEventListener("mousemove",p),window.removeEventListener("touchmove",p),window.removeEventListener("mouseup",m),window.removeEventListener("touchend",m),document.body.style[o]=""}d(h,"cr-resizer"),f(h,{width:this.options.viewport.width+"px",height:this.options.viewport.height+"px"}),this.options.resizeControls.height&&(d(s=document.createElement("div"),"cr-resizer-vertical"),h.appendChild(s)),this.options.resizeControls.width&&(d(a=document.createElement("div"),"cr-resizer-horisontal"),h.appendChild(a)),s&&(s.addEventListener("mousedown",u),s.addEventListener("touchstart",u)),a&&(a.addEventListener("mousedown",u),a.addEventListener("touchstart",u)),this.elements.boundary.appendChild(h)}function O(t){if(this.options.enableZoom){var e=this.elements.zoomer,n=U(t,4);e.value=Math.max(parseFloat(e.min),Math.min(parseFloat(e.max),n)).toString()}}function E(){var t=this,e=t.elements.zoomerWrap=document.createElement("div"),n=t.elements.zoomer=document.createElement("input");function r(){T.call(t,{value:parseFloat(n.value),origin:new w(t.elements.preview),viewportRect:t.elements.viewport.getBoundingClientRect(),transform:k.parse(t.elements.preview)})}function i(e){var n,i;if("ctrl"===t.options.mouseWheelZoom&&!0!==e.ctrlKey)return 0;n=e.wheelDelta?e.wheelDelta/1200:e.deltaY?e.deltaY/1060:e.detail?-(e.detail/60):0,i=t._currentZoom+n*t._currentZoom,e.preventDefault(),O.call(t,i),r.call(t)}d(e,"cr-slider-wrap"),d(n,"cr-slider"),n.type="range",n.step="0.0001",n.value="1",n.style.display=t.options.showZoomer?"":"none",n.setAttribute("aria-label","zoom"),t.element.appendChild(e),e.appendChild(n),t._currentZoom=1,t.elements.zoomer.addEventListener("input",r),t.elements.zoomer.addEventListener("change",r),t.options.mouseWheelZoom&&(t.elements.boundary.addEventListener("mousewheel",i),t.elements.boundary.addEventListener("DOMMouseScroll",i))}function T(t){var e=this,n=t?t.transform:k.parse(e.elements.preview),o=t?t.viewportRect:e.elements.viewport.getBoundingClientRect(),s=t?t.origin:new w(e.elements.preview);function a(){var t={};t[i]=n.toString(),t[r]=s.toString(),f(e.elements.preview,t)}if(e._currentZoom=t?t.value:e._currentZoom,n.scale=e._currentZoom,e.elements.zoomer.setAttribute("aria-valuenow",e._currentZoom),a(),e.options.enforceBoundary){var l=R.call(e,o),h=l.translate,c=l.origin;n.x>=h.maxX&&(s.x=c.minX,n.x=h.maxX),n.x<=h.minX&&(s.x=c.maxX,n.x=h.minX),n.y>=h.maxY&&(s.y=c.minY,n.y=h.maxY),n.y<=h.minY&&(s.y=c.maxY,n.y=h.minY)}a(),z.call(e),F.call(e)}function R(t){var e=this._currentZoom,n=t.width,r=t.height,i=this.elements.boundary.clientWidth/2,o=this.elements.boundary.clientHeight/2,s=this.elements.preview.getBoundingClientRect(),a=s.width,l=s.height,h=n/2,c=r/2,u=-((h/e-i)*1),p=-((c/e-o)*1),f=1/e*h,d=1/e*c;return{translate:{maxX:u,minX:u-(1/e*a-1/e*n),maxY:p,minY:p-(1/e*l-1/e*r)},origin:{maxX:1/e*a-f,minX:f,maxY:1/e*l-d,minY:d}}}function N(t){var e=this._currentZoom,n=this.elements.preview.getBoundingClientRect(),o=this.elements.viewport.getBoundingClientRect(),s=k.parse(this.elements.preview.style[i]),a=new w(this.elements.preview),l=o.top-n.top+o.height/2,h=o.left-n.left+o.width/2,c={},u={};if(t){var p=a.x,d=a.y,m=s.x,v=s.y;c.y=p,c.x=d,s.y=m,s.x=v}else c.y=l/e,c.x=h/e,u.y=(c.y-a.y)*(1-e),u.x=(c.x-a.x)*(1-e),s.x-=u.x,s.y-=u.y;var y={};y[r]=c.x+"px "+c.y+"px",y[i]=s.toString(),f(this.elements.preview,y)}function I(){var t,e,n,r,s,a=this,l=!1;function h(t,e){var n=a.elements.preview.getBoundingClientRect(),i=s.y+e,o=s.x+t;a.options.enforceBoundary?(r.top>n.top+e&&r.bottom<n.bottom+e&&(s.y=i),r.left>
1n.left+t&&r.right<n.right+t&&(s.x=o)):(s.y=i,s.x=o)}function c(t){a.elements.preview.setAttribute("aria-grabbed",t),a.elements.boundary.setAttribute("aria-dropeffect",t?"move":"none")}function u(n){if((void 0===n.button||0===n.button)&&(n.preventDefault(),!l)){if(l=!0,t=n.pageX,e=n.pageY,n.touches){var i=n.touches[0];t=i.pageX,e=i.pageY}c(l),s=k.parse(a.elements.preview),window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),window.addEventListener("mouseup",m),window.addEventListener("touchend",m),document.body.style[o]="none",r=a.elements.viewport.getBoundingClientRect()}}function d(r){r.preventDefault();var o=r.pageX,l=r.pageY;if(r.touches){var c=r.touches[0];o=c.pageX,l=c.pageY}var u=o-t,d=l-e,m={};if("touchmove"===r.type&&r.touches.length>1){var v=r.touches[0],y=r.touches[1],g=Math.sqrt((v.pageX-y.pageX)*(v.pageX-y.pageX)+(v.pageY-y.pageY)*(v.pageY-y.pageY));n||(n=g/a._currentZoom);var k=g/n;O.call(a,k),p(a.elements.zoomer);return}h(u,d),m[i]=s.toString(),f(a.elements.preview,m),A.call(a),e=l,t=o}function m(){c(l=!1),window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",m),window.removeEventListener("touchend",m),document.body.style[o]="",N.call(a),F.call(a),n=0}a.elements.overlay.addEventListener("mousedown",u),a.elements.viewport.addEventListener("keydown",function(t){var e;if(t.shiftKey&&(38===t.keyCode||40===t.keyCode))e=38===t.keyCode?parseFloat(a.elements.zoomer.value)+parseFloat(a.elements.zoomer.step):parseFloat(a.elements.zoomer.value)-parseFloat(a.elements.zoomer.step),a.setZoom(e);else if(a.options.enableKeyMovement&&t.keyCode>=37&&t.keyCode<=40){t.preventDefault();var l,c,u,p,d=function(t){switch(t){case 37:return[1,0];case 38:return[0,1];case 39:return[-1,0];case 40:return[0,-1]}}(t.keyCode);s=k.parse(a.elements.preview),document.body.style[o]="none",r=a.elements.viewport.getBoundingClientRect(),c=(l=d)[0],u=l[1],p={},h(c,u),p[i]=s.toString(),f(a.elements.preview,p),A.call(a),document.body.style[o]="",N.call(a),F.call(a),n=0}}),a.elements.overlay.addEventListener("touchstart",u)}function A(){if(this.elements){var t=this.elements.boundary.getBoundingClientRect(),e=this.elements.preview.getBoundingClientRect();f(this.elements.overlay,{width:e.width+"px",height:e.height+"px",top:e.top-t.top+"px",left:e.left-t.left+"px"})}}w.prototype.toString=function(){return this.x+"px "+this.y+"px"};var z=function(){var t=this,r=arguments,i=e&&!n;clearTimeout(n),n=setTimeout(function(){n=null,e||A.apply(t,r)},500),i&&A.apply(t,r)};function F(){var t,e=this.get();J.call(this)&&(this.options.update.call(this,e),this.$&&"undefined"==typeof Prototype?this.$(this.element).trigger("update.croppie",e):(window.CustomEvent?t=new CustomEvent("update",{detail:e}):(t=document.createEvent("CustomEvent")).initCustomEvent("update",!0,!0,e),this.element.dispatchEvent(t)))}function J(){return this.elements.preview.offsetHeight>0&&this.elements.preview.offsetWidth>0}function B(){var t,e={},n=this.elements.preview,o=new k(0,0,1),s=new w;J.call(this)&&!this.data.bound&&(this.data.bound=!0,e[i]=o.toString(),e[r]=s.toString(),e.opacity=1,f(n,e),t=this.elements.preview.getBoundingClientRect(),this._originalImageWidth=t.width,this._originalImageHeight=t.height,this.data.orientation=M.call(this)?x(this.elements.img):this.data.orientation,this.options.enableZoom?D.call(this,!0):this._currentZoom=1,o.scale=this._currentZoom,e[i]=o.toString(),f(n,e),this.data.points.length?P.call(this,this.data.points):j.call(this),N.call(this),A.call(this))}function D(t){var e,n,r=Math.max(this.options.minZoom,0)||0,i=this.options.maxZoom||1.5,o=this.elements.zoomer,s=parseFloat(o.value),a=this.elements.boundary.getBoundingClientRect(),l=y(this.elements.img,this.data.orientation),h=this.elements.viewport.getBoundingClientRect();this.options.enforceBoundary&&(r=Math.max(h.width/l.width,h.height/l.height)),r>=i&&(i=r+1),o.min=U(r,4),o.max=U(i,4),!t&&(s<o.min||s>o.max)?O.call(this,s<o.min?o.min:o.max):t&&(n=Math.max(a.width/l.width,a.height/l.height),e=null!==this.data.boundZoom?this.data.boundZoom:n,O.call(this,e)),p(o)}function P(t){if(4!==t.length)throw"Croppie - Invalid number of points supplied: "+t;var e=t[2]-t[0],n=this.elements.viewport.getBoundingClientRect(),o=this.elements.boundary.getBoundingClientRect(),s={left:n.left-o.left,top:n.top-o.top},a=n.width/e,l=t[1],h=t[0],c=-1*t[1]+s.top,u=-1*t[0]+s.left,p={};p[r]=h+"px "+l+"px",p[i]=new k(u,c,a).toString(),f(this.elements.preview,p),O.call(this,a),this._currentZoom=a}function j(){var t=this.elements.preview.getBoundingClientRect(),e=this.elements.viewport.getBoundingClientRect(),n=this.elements.boundary.getBoundingClientRect(),r=e.left-n.left,o=e.top-n.top,s=new k(r-(t.width-e.width)/2,o-(t.height-e.height)/2,this._currentZoom);f(this.elements.preview,i,s.toString())}function $(t){var e=this.elements.canvas,n=this.elements.img;e.getContext("2d").clearRect(0,0,e.width,e.height),e.width=n.width,e.height=n.height;var r=this.options.enableOrientation&&t||x(n);S(e,n,r)}function _(t){var e=t.points,n=v(e[0]),r=v(e[1]),i=v(e[2]),o=v(e[3]),s=i-n,a=o-r,l=t.circle,h=document.createElement("canvas"),c=h.getContext("2d"),u=t.outputWidth||s,p=t.outputHeight||a;h.width=u,h.height=p,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,u,p));var f=n,d=r,m=s,y=a,g=0,k=0,w=u,x=p;return n<0&&(f=0,g=Math.abs(n)/s*u),m+f>this._originalImageWidth&&(w=(m=this._originalImageWidth-f)/s*u),r<0&&(d=0,k=Math.abs(r)/a*p),y+d>this._originalImageHeight&&(x=(y=this._originalImageHeight-d)/a*p),c.drawImage(this.elements.preview,f,d,m,y,g,k,w,x),l&&(c.fillStyle="#fff",c.globalCompositeOperation="destination-in",c.beginPath(),c.arc(h.width/2,h.height/2,h.width/2,0,2*Math.PI,!0),c.closePath(),c.fill()),h}function L(t){var e=t.points,n=document.createElement("div"),r=document.createElement("img"),i=e[2]-e[0],o=e[3]-e[1];return d(n,"croppie-result"),n.appendChild(r),f(r,{left:-1*e[0]+"px",top:-1*e[1]+"px"}),r.src=t.url,f(n,{width:i+"px",height:o+"px"}),n}function W(t){return _.call(this,t).toDataURL(t.format,t.quality)}function K(t){var e=this;return new Promise(function(n){_.call(e,t).toBlob(function(t){n(t)},t.format,t.quality)})}function q(t){this.elements.img.parentNode&&(Array.prototype.forEach.call(this.elements.img.classList,function(e){t.classList.add(e)}),this.elements.img.parentNode.replaceChild(t,this.elements.img),this.elements.preview=t),this.elements.img=t}function V(t,e){var n,r=this,i=[],o=null,s=M.call(r);if("string"==typeof t)n=t,t={};else if(Array.isArray(t))i=t.slice();else{if(void 0===t&&r.data.url)return B.call(r),F.call(r),null;n=t.url,i=t.points||[],o=void 0===t.zoom?null:t.zoom}return r.data.bound=!1,r.data.url=n||r.data.url,r.data.boundZoom=o,(function(t,e){if(!t)throw"Source image missing";var n=new Image;return n.style.opacity="0",new Promise(function(r,i){function o(){n.style.opacity="1",setTimeout(function(){r(n)},1)}n.removeAttribute("crossOrigin"),t.match(/^https?:\/\/|^\/\//)&&n.setAttribute("crossOrigin","anonymous"),n.onload=function(){e?EXIF.getData(n,function(){o()}):o()},n.onerror=function(t){n.style.opacity=1,setTimeout(function(){i(t)},1)},n.src=t})}
1)(n,s).then(function(n){if(q.call(r,n),i.length)r.options.relative&&(i=[i[0]*n.naturalWidth/100,i[1]*n.naturalHeight/100,i[2]*n.naturalWidth/100,i[3]*n.naturalHeight/100]);else{var o,s,a=y(n),l=r.elements.viewport.getBoundingClientRect(),h=l.width/l.height;a.width/a.height>h?o=(s=a.height)*h:(o=a.width,s=a.height/h);var c=(a.width-o)/2,u=(a.height-s)/2,p=c+o,f=u+s;r.data.points=[c,u,p,f]}r.data.orientation=t.orientation||1,r.data.points=i.map(function(t){return parseFloat(t)}),r.options.useCanvas&&$.call(r,r.data.orientation),B.call(r),F.call(r),e&&e()})}function U(t,e){return parseFloat(t).toFixed(e||0)}function Z(){var t=this.elements.preview.getBoundingClientRect(),e=this.elements.viewport.getBoundingClientRect(),n=e.left-t.left,r=e.top-t.top,i=(e.width-this.elements.viewport.offsetWidth)/2,o=(e.height-this.elements.viewport.offsetHeight)/2,s=n+this.elements.viewport.offsetWidth+i,a=r+this.elements.viewport.offsetHeight+o,l=this._currentZoom;(l===1/0||isNaN(l))&&(l=1);var h=this.options.enforceBoundary?0:-1/0;return n=Math.max(h,n/l),r=Math.max(h,r/l),s=Math.max(h,s/l),a=Math.max(h,a/l),{points:[U(n),U(r),U(s),U(a)],zoom:l,orientation:this.data.orientation}}var H={type:"canvas",format:"png",quality:1},X=["jpeg","webp","png"];function Y(t){var e=this,n=Z.call(e),r=u(u({},H),u({},t)),i="string"==typeof t?t:r.type||"base64",o=r.size||"viewport",s=r.format,a=r.quality,l=r.backgroundColor,h="boolean"==typeof r.circle?r.circle:"circle"===e.options.viewport.type,c=e.elements.viewport.getBoundingClientRect(),p=c.width/c.height;return"viewport"===o?(n.outputWidth=c.width,n.outputHeight=c.height):"object"==typeof o&&(o.width&&o.height?(n.outputWidth=o.width,n.outputHeight=o.height):o.width?(n.outputWidth=o.width,n.outputHeight=o.width/p):o.height&&(n.outputWidth=o.height*p,n.outputHeight=o.height)),X.indexOf(s)>-1&&(n.format="image/"+s,n.quality=a),n.circle=h,n.url=e.data.url,n.backgroundColor=l,new Promise(function(t){switch(i.toLowerCase()){case"rawcanvas":t(_.call(e,n));break;case"canvas":case"base64":t(W.call(e,n));break;case"blob":K.call(e,n).then(t);break;default:t(L.call(e,n))}})}function G(){B.call(this)}function Q(t){if(!this.options.useCanvas||!this.options.enableOrientation)throw"Croppie: Cannot rotate without enableOrientation && EXIF.js included";var e,n,r,i,o=this.elements.canvas;if(this.data.orientation=(e=this.data.orientation,r=(n=l.indexOf(e)>-1?l:h).indexOf(e),i=t/90%n.length,n[(n.length+r+i%n.length)%n.length]),S(o,this.elements.img,this.data.orientation),N.call(this,!0),D.call(this),Math.abs(t)/90%2==1){var s=this._originalImageHeight,a=this._originalImageWidth;this._originalImageWidth=s,this._originalImageHeight=a}}function tt(){var t;this.element.removeChild(this.elements.boundary),t=this.element,t.classList?t.classList.remove("croppie-container"):t.className=t.className.replace("croppie-container",""),this.options.enableZoom&&this.element.removeChild(this.elements.zoomerWrap),delete this.elements}if("undefined"!=typeof window&&window.jQuery){var te=window.jQuery;te.fn.croppie=function(t){if("string"!=typeof t)return this.each(function(){var e=new tn(this,t);e.$=te,te(this).data("croppie",e)});var e=Array.prototype.slice.call(arguments,1),n=te(this).data("croppie");return"get"===t?n.get():"result"===t?n.result.apply(n,e):"bind"===t?n.bind.apply(n,e):this.each(function(){var n=te(this).data("croppie");if(n){var r=n[t];if(te.isFunction(r))r.apply(n,e),"destroy"===t&&te(this).removeData("croppie");else throw"Croppie "+t+" method not found"}})}}function tn(t,e){if(t.className.indexOf("croppie-container")>-1)throw Error("Croppie: Can't initialize croppie more than once");if(this.element=t,this.options=u(u({},tn.defaults),e),"img"===this.element.tagName.toLowerCase()){var n=this.element;d(n,"cr-original-image"),m(n,{"aria-hidden":"true",alt:""});var r=document.createElement("div");this.element.parentNode.appendChild(r),r.appendChild(n),this.element=r,this.options.url=this.options.url||n.src}if(b.call(this),this.options.url){var i={url:this.options.url,points:this.options.points};delete this.options.url,delete this.options.points,V.call(this,i)}}return tn.defaults={viewport:{width:100,height:100,type:"square"},boundary:{},orientationControls:{enabled:!0,leftClass:"",rightClass:""},resizeControls:{width:!0,height:!0},customClass:"",showZoomer:!0,enableZoom:!0,enableResize:!1,mouseWheelZoom:!0,enableExif:!1,enforceBoundary:!0,enableOrientation:!1,enableKeyMovement:!0,update:function(){}},tn.globals={translate:"translate3d"},u(tn.prototype,{bind:function(t,e){return V.call(this,t,e)},get:function(){var t=Z.call(this),e=t.points;return this.options.relative&&(e[0]/=this.elements.img.naturalWi
1dth/100,e[1]/=this.elements.img.naturalHeight/100,e[2]/=this.elements.img.naturalWidth/100,e[3]/=this.elements.img.naturalHeight/100),t},result:function(t){return Y.call(this,t)},refresh:function(){return G.call(this)},setZoom:function(t){O.call(this,t),p(this.elements.zoomer)},rotate:function(t){Q.call(this,t)},destroy:function(){return tt.call(this)}}),tn})?r.call(e,n,e,t):r)||(t.exports=i)},17936:(t,e,n)=>{"use strict";function r(t){var e="function"==typeof Map?new Map:void 0;return(r=function(t){if(null===t||!function(t){try{return -1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return i(t,arguments,h(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),s(n,t)})(t)}function i(t,e,n){return(i=l()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&s(i,n.prototype),i}).apply(null,arguments)}function o(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function a(t){var e=l();return function(){var n,r=h(t);return n=e?Reflect.construct(r,arguments,h(this).constructor):r.apply(this,arguments),function(t,e){if(e&&("object"===c(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");var n=t;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,n)}}function l(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,function(t){var e=function(t,e){if("object"!==c(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==c(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===c(e)?e:String(e)}(r.key),r)}}function f(t,e,n){return e&&p(t.prototype,e),n&&p(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var d=n(11901),m=function(){function t(e,n,r){u(this,t),this.pos=e,this.delInfo=n,this.recover=r}return f(t,[{key:"deleted",get:function(){return(8&this.delInfo)>0}},{key:"deletedBefore",get:function(){return(5&this.delInfo)>0}},{key:"deletedAfter",get:function(){return(6&this.delInfo)>0}},{key:"deletedAcross",get:function(){return(4&this.delInfo)>0}}]),t}(),v=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(u(this,t),this.ranges=e,this.inverted=n,!e.length&&t.empty)return t.empty}return f(t,[{key:"recover",value:function(t){var e=0,n=65535&t;if(!this.inverted)for(var r=0;r<n;r++)e+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+e+(t-(65535&t))/65536}},{key:"mapResult",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!1)}},{key:"map",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!0)}},{key:"_map",value:function(t,e,n){for(var r=0,i=this.inverted?2:1,o=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var a=this.ranges[s]-(this.inverted?r:0);if(a>t)break;var l=this.ranges[s+i],h=this.ranges[s+o],c=a+l;if(t<=c){var u=l?t==a?-1:t==c?1:e:e,p=a+r+(u<0?0:h);if(n)return p;var f=t==(e<0?a:c)?null:s/3+(t-a)*65536,d=t==a?2:t==c?1:4;return(e<0?t!=a:t!=c)&&(d|=8),new m(p,d,f)}r+=h-l}return n?t+r:new m(t+r,0,null)}},{key:"touches",value:function(t,e){for(var n=0,r=65535&e,i=this.inverted?2:1,o=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var a=this.ranges[s]-(this.inverted?n:0);if(a>t)break;var l=this.ranges[s+i];if(t<=a+l&&s==3*r)return!0;n+=this.ranges[s+o]-l}return!1}}
1,{key:"forEach",value:function(t){for(var e=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+e],h=this.ranges[r+n];t(s,s+l,a,a+h),i+=h-l}}},{key:"invert",value:function(){return new t(this.ranges,!this.inverted)}},{key:"toString",value:function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}}],[{key:"offset",value:function(e){return 0==e?t.empty:new t(e<0?[0,-e,0]:[0,0,e])}}]),t}();v.empty=new v([]);var y=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length;u(this,t),this.maps=e,this.mirror=n,this.from=r,this.to=i}return f(t,[{key:"slice",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.maps.length;return new t(this.maps,this.mirror,e,n)}},{key:"copy",value:function(){return new t(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}},{key:"appendMap",value:function(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}},{key:"appendMapping",value:function(t){for(var e=0,n=this.maps.length;e<t.maps.length;e++){var r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}},{key:"getMirror",value:function(t){if(this.mirror){for(var e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}}},{key:"setMirror",value:function(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}},{key:"appendMappingInverted",value:function(t){for(var e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){var r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}},{key:"invert",value:function(){var e=new t;return e.appendMappingInverted(this),e}},{key:"map",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(t,e,!0);for(var n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}},{key:"mapResult",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!1)}},{key:"_map",value:function(t,e,n){for(var r=0,i=this.from;i<this.to;i++){var o=this.maps[i].mapResult(t,e);if(null!=o.recover){var s=this.getMirror(i);if(null!=s&&s>i&&s<this.to){i=s,t=this.maps[s].recover(o.recover);continue}}
1r|=o.delInfo,t=o.pos}return n?t:new m(t,r,null)}}]),t}(),g=Object.create(null),k=function(){function t(){u(this,t)}return f(t,[{key:"getMap",value:function(){return v.empty}},{key:"merge",value:function(t){return null}}],[{key:"fromJSON",value:function(t,e){if(!e||!e.stepType)throw RangeError("Invalid input for Step.fromJSON");var n=g[e.stepType];if(!n)throw RangeError("No step type ".concat(e.stepType," defined"));return n.fromJSON(t,e)}},{key:"jsonID",value:function(t,e){if(t in g)throw RangeError("Duplicate use of step JSON ID "+t);return g[t]=e,e.prototype.jsonID=t,e}}]),t}(),w=function(){function t(e,n){u(this,t),this.doc=e,this.failed=n}return f(t,null,[{key:"ok",value:function(e){return new t(e,null)}},{key:"fail",value:function(e){return new t(null,e)}},{key:"fromReplace",value:function(e,n,r,i){try{return t.ok(e.replace(n,r,i))}catch(e){if(e instanceof d.ReplaceError)return t.fail(e.message);throw e}}}]),t}();function x(t,e,n){for(var r=[],i=0;i<t.childCount;i++){var o=t.child(i);o.content.size&&(o=o.copy(x(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return d.Fragment.fromArray(r)}var S=function(t){o(n,t);var e=a(n);function n(t,r,i){var o;return u(this,n),(o=e.call(this)).from=t,o.to=r,o.mark=i,o}return f(n,[{key:"apply",value:function(t){var e=this,n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.no
1de(r.sharedDepth(this.to)),o=new d.Slice(x(n.content,function(t,n){return t.isAtom&&n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t},i),n.openStart,n.openEnd);return w.fromReplace(t,this.from,this.to,o)}},{key:"invert",value:function(){return new b(this.from,this.to,this.mark)}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new n(e.pos,r.pos,this.mark)}},{key:"merge",value:function(t){return t instanceof n&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new n(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new n(e.from,e.to,t.markFromJSON(e.mark))}}]),n}(k);k.jsonID("addMark",S);var b=function(t){o(n,t);var e=a(n);function n(t,r,i){var o;return u(this,n),(o=e.call(this)).from=t,o.to=r,o.mark=i,o}return f(n,[{key:"apply",value:function(t){var e=this,n=t.slice(this.from,this.to),r=new d.Slice(x(n.content,function(t){return t.mark(e.mark.removeFromSet(t.marks))},t),n.openStart,n.openEnd);return w.fromReplace(t,this.from,this.to,r)}},{key:"invert",value:function(){return new S(this.from,this.to,this.mark)}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new n(e.pos,r.pos,this.mark)}},{key:"merge",value:function(t){return t instanceof n&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new n(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new n(e.from,e.to,t.markFromJSON(e.mark))}}]),n}(k);k.jsonID("removeMark",b);var M=function(t){o(n,t);var e=a(n);function n(t,r){var i;return u(this,n),(i=e.call(this)).pos=t,i.mark=r,i}return f(n,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return w.fail("No node at mark step's position");var n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return w.fromReplace(t,this.pos,this.pos+1,new d.Slice(d.Fragment.from(n),0,+!e.isLeaf))}},{key:"invert",value:function(t){var e=t.nodeAt(this.pos);if(e){var r=this.mark.addToSet(e.marks);if(r.length==e.marks.length){for(var i=0;i<e.marks.length;i++)if(!e.marks[i].isInSet(r))return new n(this.pos,e.marks[i]);return new n(this.pos,this.mark)}}return new C(this.pos,this.mark)}},{key:"map",value:function(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new n(e.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new n(e.pos,t.markFromJSON(e.mark))}}]),n}(k);k.jsonID("addNodeMark",M);var C=function(t){o(n,t);var e=a(n);function n(t,r){var i;return u(this,n),(i=e.call(this)).pos=t,i.mark=r,i}return f(n,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return w.fail("No node at mark step's position");var n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return w.fromReplace(t,this.pos,this.pos+1,new d.Slice(d.Fragment.from(n),0,+!e.isLeaf))}},{key:"invert",value:function(t){var e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new M(this.pos,this.mark):this}},{key:"map",value:function(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new n(e.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new n(e.pos,t.markFromJSON(e.mark))}}]),n}(k);
1k.jsonID("removeNodeMark",C);var O=function(t){o(n,t);var e=a(n);function n(t,r,i){var o,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return u(this,n),(o=e.call(this)).from=t,o.to=r,o.slice=i,o.structure=s,o}return f(n,[{key:"apply",value:function(t){return this.structure&&T(t,this.from,this.to)?w.fail("Structure replace would overwrite content"):w.fromReplace(t,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new v([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function(t){return new n(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deletedAcross&&r.deletedAcross?null:new n(e.pos,Math.max(e.pos,r.pos),this.slice)}},{key:"merge",value:function(t){if(!(t instanceof n)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart)if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;else{var e=this.slice.size+t.slice.size==0?d.Slice.empty:new d.Slice(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new n(t.from,this.to,e,this.structure)}var r=this.slice.size+t.slice.size==0?d.Slice.empty:new d.Slice(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new n(this.from,this.to+(t.to-t.from),r,this.structure)}},{key:"toJSON",value:function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new n(e.from,e.to,d.Slice.fromJSON(t,e.slice),!!e.structure)}}]),n}(k);k.jsonID("replace",O);var E=function(t){o(n,t);var e=a(n);function n(t,r,i,o,s,a){var l,h=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return u(this,n),(l=e.call(this)).from=t,l.to=r,l.gapFrom=i,l.gapTo=o,l.slice=s,l.insert=a,l.structure=h,l}return f(n,[{key:"apply",value:function(t){if(this.structure&&(T(t,this.from,this.gapFrom)||T(t,this.gapTo,this.to)))return w.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return w.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?w.fromReplace(t,this.from,this.to,n):w.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new v([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function(t){var e=this.gapTo-this.gapFrom;return new n(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||i<e.pos||o>r.pos?null:new n(e.pos,r.pos,i,o,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new n(e.from,e.to,e.gapFrom,e.gapTo,d.Slice.fromJSON(t,e.slice),e.insert,!!e.structure)}}]),n}(k);function T(t,e,n){for(var r=t.resolve(e),i=n-e,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 R(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.contentMatch,i=!(arguments.length>4)||void 0===arguments[4]||arguments[4],o=t.doc.nodeAt(e),s=[],a=e+1,l=0;l<o.childCount;l++){var h=o.child(l),c=a+h.nodeSize,u=r.matchType(h.type);if(u){r=u;for(var p=0;p<h.marks.length;p++)n.allowsMarkType(h.marks[p].type)||t.step(new b(a,c,h.marks[p]));if(i&&h.isText&&"pre"!=n.whitespace)for(var f=void 0,m=/\r?\n|\r/g,v=void 0;f=m.exec(h.text);)v||(v=new d.Slice(d.Fragment.from(n.schema.text(" ",n.allowedMarks(h.marks))),0,0)),s.push(new O(a+f.index,a+f.index+f[0].length,v))}else s.push(new O(a,c,d.Slice.empty));a=c}if(!r.validEnd){var y=r.fillBefore(d.Fragment.empty,!0);t.replace(a,a,new d.Slice(y,0,0))}for(var g=s.length-1;g>=0;g--)t.step(s[g])}function N(t){return{type:t,attrs:null}}function I(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function A(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(var 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)break}return null}function z(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:d.Slice.empty;if(e==n&&!r.size)return null;var i=t.resolve(e),o=t.resolve(n);return F(i,o,r)?new O(e,n,r):new J(i,o,r).fit()}function F(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}k.jsonID("replaceAround",E);var J=function(){function t(e,n,r){u(this,t),this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=d.Fragment.empty;for(var i=0;i<=e.depth;
1i++){var o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(var s=e.depth;s>0;s--)this.placed=d.Fragment.from(e.node(s).copy(this.placed))}return f(t,[{key:"depth",get:function(){return this.frontier.length-1}},{key:"fit",value:function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;for(var o=this.placed,s=r.depth,a=i.depth;s&&a&&1==o.childCount;)o=o.firstChild.content,s--,a--;var l=new d.Slice(o,s,a);return e>-1?new E(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new O(r.pos,i.pos,l):null}},{key:"findFittable",value:function(){for(var t=this.unplaced.openStart,e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<t;n++){var i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(var o=1;o<=2;o++)for(var s=1==o?t:this.unplaced.openStart;s>=0;s--)for(var a=void 0,l=null,h=(s?(l=P(this.unplaced.content,s-1).firstChild).content:this.unplaced.content).firstChild,c=this.depth;c>=0;c--){var u=this.frontier[c],p=u.type,f=u.match,m=void 0,v=null;if(1==o&&(h?f.matchType(h.type)||(v=f.fillBefore(d.Fragment.from(h),!1)):l&&p.compatibleContent(l.type)))return{sliceDepth:s,frontierDepth:c,parent:l,inject:v};if(2==o&&h&&(m=f.findWrapping(h.type)))return{sliceDepth:s,frontierDepth:c,parent:l,wrap:m};if(l&&f.matchType(l.type))break}}},{key:"openMore",value:function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,i=P(e,n);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new d.Slice(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}},{key:"dropNode",value:function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,i=P(e,n);if(i.childCount<=1&&n>0){var o=e.size-n<=n+i.size;this.unplaced=new d.Slice(B(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new d.Slice(B(e,n,1),n,r)}},{key:"placeNodes",value:function(t){for(var e=t.sliceDepth,n=t.frontierDepth,r=t.parent,i=t.inject,o=t.wrap;this.depth>n;)this.closeFrontierNode();if(o)for(var s=0;s<o.length;s++)this.openFrontierNode(o[s]);var a=this.unplaced,l=r?r.content:a.content,h=a.openStart-e,c=0,u=[],p=this.frontier[n],f=p.match,m=p.type;if(i){for(var v=0;v<i.childCount;v++)u.push(i.child(v));f=f.matchFragment(i)}for(var y=l.size+e-(a.content.size-a.openEnd);c<l.childCount;){var g=l.child(c),k=f.matchType(g.type);if(!k)break;(++c>1||0==h||g.content.size)&&(f=k,u.push(function t(e,n,r){if(n<=0)return e;var i=e.content;return n>1&&(i=i.replaceChild(0,t(i.firstChild,n-1,1==i.childCount?r-1:0))),n>0&&(i=e.type.contentMatch.fillBefore(i).append(i),r<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(d.Fragment.empty,!0)))),e.copy(i)}(g.mark(m.allowedMarks(g.marks)),1==c?h:0,c==l.childCount?y:-1)))}var w=c==l.childCount;w||(y=-1),this.placed=D(this.placed,n,d.Fragment.from(u)),this.frontier[n].match=f,w&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var x=0,S=l;x<y;x++){var b=S.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),S=b.content}this.unplaced=w?0==e?d.Slice.empty:new d.Slice(B(a.content,e-1,1),e-1,y<0?a.openEnd:e-1):new d.Slice(B(a.content,e,c),a.openStart,a.openEnd)}},{key:"mustMoveInline",value:function(){if(!this.$to.parent.isTextblock)return -1;var t,e=this.frontier[this.depth];if(!e.type.isTextblock||!j(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return -1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r}},{key:"findCloseLevel",value:function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],r=n.match,i=n.type,o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),s=j(t,e,i,r,o);if(s){for(var a=e-1;a>=0;a--){var l=this.frontier[a],h=l.match,c=j(t,a,l.type,h,!0);if(!c||c.childCount)continue t}return{depth:e,fit:s,move:o?t.doc.resolve(t.after(e+1)):t}}}}},{key:"close",value:function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=D(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;
1n++){var r=t.node(n),i=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,i)}return t}},{key:"openFrontierNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=D(this.placed,this.depth,d.Fragment.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}},{key:"closeFrontierNode",value:function(){var t=this.frontier.pop().match.fillBefore(d.Fragment.empty,!0);t.childCount&&(this.placed=D(this.placed,this.frontier.length,t))}}]),t}();function B(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(B(t.firstChild.content,e-1,n)))}function D(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(D(t.lastChild.content,e-1,n)))}function P(t,e){for(var n=0;n<e;n++)t=t.firstChild.content;return t}function j(t,e,n,r,i){var o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;var a=r.fillBefore(o.content,!0,s);return a&&!function(t,e,n){for(var r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function $(t,e){for(var n=[],r=Math.min(t.depth,e.depth),i=r;i>=0;i--){var o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}var _=function(t){o(n,t);var e=a(n);function n(t,r,i){var o;return u(this,n),(o=e.call(this)).pos=t,o.attr=r,o.value=i,o}return f(n,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return w.fail("No node at attribute step's position");var n=Object.create(null);for(var r in e.attrs)n[r]=e.attrs[r];n[this.attr]=this.value;var i=e.type.create(n,null,e.marks);return w.fromReplace(t,this.pos,this.pos+1,new d.Slice(d.Fragment.from(i),0,+!e.isLeaf))}},{key:"getMap",value:function(){return v.empty}},{key:"invert",value:function(t){return new n(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}},{key:"map",value:function(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new n(e.pos,this.attr,this.value)}},{key:"toJSON",value:function(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new n(e.pos,e.attr,e.value)}}]),n}(k);k.jsonID("attr",_);var L=function(t){o(n,t);var e=a(n);function n(t,r){var i;return u(this,n),(i=e.call(this)).attr=t,i.value=r,i}return f(n,[{key:"apply",value:function(t){var e=Object.create(null);for(var n in t.attrs)e[n]=t.attrs[n];e[this.attr]=this.value;var r=t.type.create(e,t.content,t.marks);return w.ok(r)}},{key:"getMap",value:function(){return v.empty}},{key:"invert",value:function(t){return new n(this.attr,t.attrs[this.attr])}},{key:"map",value:function(t){return this}},{key:"toJSON",value:function(){return{stepType:"docAttr",attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(t,e){if("string"!=typeof e.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new n(e.attr,e.value)}}]),n}(k);k.jsonID("docAttr",L),e.TransformError=function(t){o(n,t);var e=a(n);function n(){return u(this,n),e.apply(this,arguments)}return f(n)}(r(Error)),e.TransformError=function t(e){var n=Error.call(this,e);return n.__proto__=t.prototype,n},e.TransformError.prototype=Object.create(Error.prototype),e.TransformError.prototype.constructor=e.TransformError,e.TransformError.prototype.name="TransformError";var W=function(){function t(e){u(this,t),this.doc=e,this.steps=[],this.docs=[],this.mapping=new y}return f(t,[{key:"before",get:function(){return this.docs.length?this.docs[0]:this.doc}},{key:"step",value:function(t){var n=this.maybeStep(t);if(n.failed)throw new e.TransformError(n.failed);return this}},{key:"maybeStep",value:function(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}},{key:"docChanged",get:function(){return this.steps.length>0}},{key:"addStep",value:function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}},{key:"replace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:d.Slice.empty,r=z(this.doc,t,e,n);return r&&this.step(r),this}},{key:"replaceWith",value:function(t,e,n){return this.replace(t,e,new d.Slice(d.Fragment.from(n),0,0))}},{key:"delete",value:function(t,e){return this.replace(t,e,d.Slice.empty)}},{key:"insert",value:function(t,e){return this.replaceWith(t,t,e)}},{key:"replaceRange",value:function(t,e,n){return!function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);var i=t.doc.resolve(e),o=t.doc.resolve(n);if(F(i,o,r))return t.step(new O(e,n,r));var s=$(i,t.doc.resolve(n));0==s[s.length-1]&&s.pop();var a=-(i.depth+1);s.unshift(a);for(var l=i.depth,h=i.pos-1;l>0;l--,h--){var c=i.node(l).type.spec;if(c.defining||c.definingAsContext||c.isolating)break;s.indexOf(l)>-1?a=l:i.before(l)==h&&s.splice(1,0,-l)}for(var u=s.indexOf(a),p=[],f=r.openStart,m=r.content,v=0;;v++){var y=m.firstChild;if(p.push(y),v==r.openStart)break;m=y.content}for(var g=f-1;g>=0;g--){var k,w=p[g],x=(k=w.type).spec.defining||k.spec.definingForContent;if(x&&!w.sameMarkup(i.node(Math.abs(a)-1)))f=g;else if(x||!w.type.isTextblock)break}for(var S=r.openStart;S>=0;S--){var b=(S+f+1)%(r.openStart+1),M=p[b];
1if(M)for(var C=0;C<s.length;C++){var E=s[(C+u)%s.length],T=!0;E<0&&(T=!1,E=-E);var R=i.node(E-1),N=i.index(E-1);if(R.canReplaceWith(N,N,M.type,M.marks))return t.replace(i.before(E),T?o.after(E):n,new d.Slice(function t(e,n,r,i,o){if(n<r){var s=e.firstChild;e=e.replaceChild(0,s.copy(t(s.content,n+1,r,i,s)))}if(n>i){var a=o.contentMatchAt(0),l=a.fillBefore(e).append(e);e=l.append(a.matchFragment(l).fillBefore(d.Fragment.empty,!0))}return e}(r.content,0,r.openStart,b),b,r.openEnd))}}for(var I=t.steps.length,A=s.length-1;A>=0&&(t.replace(e,n,r),!(t.steps.length>I));A--){var z=s[A];z<0||(e=i.before(z),n=o.after(z))}}(this,t,e,n),this}},{key:"replaceRangeWith",value:function(t,e,n){var r=t,i=e;if(!n.isInline&&r==i&&this.doc.resolve(r).parent.content.size){var o=A(this.doc,r,n.type);null!=o&&(r=i=o)}return this.replaceRange(r,i,new d.Slice(d.Fragment.from(n),0,0)),this}},{key:"deleteRange",value:function(t,e){return!function(t,e,n){for(var r=t.doc.resolve(e),i=t.doc.resolve(n),o=$(r,i),s=0;s<o.length;s++){var a=o[s],l=s==o.length-1;if(l&&0==a||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(var h=1;h<=r.depth&&h<=i.depth;h++)if(e-r.start(h)==r.depth-h&&n>r.end(h)&&i.end(h)-n!=i.depth-h)return t.delete(r.before(h),n);t.delete(e,n)}(this,t,e),this}},{key:"lift",value:function(t,e){return!function(t,e,n){for(var r=e.$from,i=e.$to,o=e.depth,s=r.before(o+1),a=i.after(o+1),l=s,h=a,c=d.Fragment.empty,u=0,p=o,f=!1;p>n;p--)f||r.index(p)>0?(f=!0,c=d.Fragment.from(r.node(p).copy(c)),u++):l--;for(var m=d.Fragment.empty,v=0,y=o,g=!1;y>n;y--)g||i.after(y+1)<i.end(y)?(g=!0,m=d.Fragment.from(i.node(y).copy(m)),v++):h++;t.step(new E(l,h,s,a,new d.Slice(c.append(m),u,v),c.size-u,!0))}(this,t,e),this}},{key:"join",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e=new O(t-n,t+n,d.Slice.empty,!0),this.step(e),this}},{key:"wrap",value:function(t,e){return!function(t,e,n){for(var r=d.Fragment.empty,i=n.length-1;i>=0;i--){if(r.size){var o=n[i].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=d.Fragment.from(n[i].type.create(n[i].attrs,r))}var s=e.start,a=e.end;t.step(new E(s,a,s,a,new d.Slice(r,0,0),n.length,!0))}(this,t,e),this}},{key:"setBlockType",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=this;if(!n.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");var o=i.steps.length;return i.doc.nodesBetween(t,e,function(t,e){if(t.isTextblock&&!t.hasMarkup(n,r)&&(s=i.doc,a=i.mapping.slice(o).map(e),l=n,c=(h=s.resolve(a)).index(),h.parent.canReplaceWith(c,c+1,l))){var s,a,l,h,c,u,p,f,m,v,y,g,k,w=null;if(n.schema.linebreakReplacement){var x="pre"==n.whitespace,S=!!n.contentMatch.matchType(n.schema.linebreakReplacement);x&&!S?w=!1:!x&&S&&(w=!0)}!1===w&&(u=i,p=t,f=e,m=o,p.forEach(function(t,e){if(t.type==t.type.schema.linebreakReplacement){var n=u.mapping.slice(m).map(f+1+e);u.replaceWith(n,n+1,p.type.schema.text("\n"))}})),R(i,i.mapping.slice(o).map(e,1),n,void 0,null===w);var b=i.mapping.slice(o),M=b.map(e,1),C=b.map(e+t.nodeSize,1);return i.step(new E(M,C,M+1,C-1,new d.Slice(d.Fragment.from(n.create(r,null,t.marks)),0,0),1,!0)),!0===w&&(v=i,y=t,g=e,k=o,y.forEach(function(t,e){if(t.isText)for(var n,r=/\r?\n|\r/g;n=r.exec(t.text);){var i=v.mapping.slice(k).map(g+1+e+n.index);v.replaceWith(i,i+1,y.type.schema.linebreakReplacement.create())}})),!1}}),this}},{key:"setNodeMarkup",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return!function(t,e,n,r,i){var o=t.doc.nodeAt(e);if(!o)throw RangeError("No node at given position");n||(n=o.type);var s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw RangeError("Invalid content for node type "+n.name);t.step(new E(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new d.Slice(d.Fragment.from(s),0,0),1,!0))}(this,t,e,n,r),this}},{key:"setNodeAttribute",value:function(t,e,n){return this.step(new _(t,e,n)),this}},{key:"setDocAttribute",value:function(t,e){return this.step(new L(t,e)),this}},{key:"addNodeMark",value:function(t,e){return this.step(new M(t,e)),this}}
1,{key:"removeNodeMark",value:function(t,e){if(!(e instanceof d.Mark)){var n=this.doc.nodeAt(t);if(!n)throw RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new C(t,e)),this}},{key:"split",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0;return!function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,i=t.doc.resolve(e),o=d.Fragment.empty,s=d.Fragment.empty,a=i.depth,l=i.depth-n,h=n-1;a>l;a--,h--){o=d.Fragment.from(i.node(a).copy(o));var c=r&&r[h];s=d.Fragment.from(c?c.type.create(c.attrs,s):i.node(a).copy(s))}t.step(new O(e,e,new d.Slice(o.append(s),n,n),!0))}(this,t,e,n),this}},{key:"addMark",value:function(t,e,n){var r,i,o,s,a;return r=this,s=[],a=[],r.doc.nodesBetween(t,e,function(r,l,h){if(r.isInline){var c=r.marks;if(!n.isInSet(c)&&h.type.allowsMarkType(n.type)){for(var u=Math.max(l,t),p=Math.min(l+r.nodeSize,e),f=n.addToSet(c),d=0;d<c.length;d++)c[d].isInSet(f)||(i&&i.to==u&&i.mark.eq(c[d])?i.to=p:s.push(i=new b(u,p,c[d])));o&&o.to==u?o.to=p:a.push(o=new S(u,p,n))}}}),s.forEach(function(t){return r.step(t)}),a.forEach(function(t){return r.step(t)}),this}},{key:"removeMark",value:function(t,e,n){var r,i,o;return r=this,i=[],o=0,r.doc.nodesBetween(t,e,function(r,s){if(r.isInline){o++;var a=null;if(n instanceof d.MarkType)for(var l,h=r.marks;l=n.isInSet(h);)(a||(a=[])).push(l),h=l.removeFromSet(h);else n?n.isInSet(r.marks)&&(a=[n]):a=r.marks;if(a&&a.length)for(var c=Math.min(s+r.nodeSize,e),u=0;u<a.length;u++){for(var p=a[u],f=void 0,m=0;m<i.length;m++){var v=i[m];v.step==o-1&&p.eq(i[m].style)&&(f=v)}f?(f.to=c,f.step=o):i.push({style:p,from:Math.max(s,t),to:c,step:o})}}}
1),i.forEach(function(t){return r.step(new b(t.from,t.to,t.style))}),this}},{key:"clearIncompatible",value:function(t,e,n){return R(this,t,e,n),this}}]),t}();e.AddMarkStep=S,e.AddNodeMarkStep=M,e.AttrStep=_,e.DocAttrStep=L,e.MapResult=m,e.Mapping=y,e.RemoveMarkStep=b,e.RemoveNodeMarkStep=C,e.ReplaceAroundStep=E,e.ReplaceStep=O,e.Step=k,e.StepMap=v,e.StepResult=w,e.Transform=W,e.canJoin=function(t,e){var n=t.resolve(e),r=n.index();return I(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)},e.canSplit=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,i=t.resolve(e),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 h=i.node(a),c=i.index(a);if(h.type.spec.isolating)return!1;var u=h.content.cutByIndex(c,h.childCount),p=r&&r[l+1];p&&(u=u.replaceChild(0,p.type.create(p.attrs)));var f=r&&r[l]||h;if(!h.canReplace(c+1,h.childCount)||!f.type.validContent(u))return!1}var d=i.indexAfter(o),m=r&&r[0];return i.node(o).canReplaceWith(d,d,m?m.type:i.node(o+1).type)},e.dropPoint=function(t,e,n){var r=t.resolve(e);if(!n.content.size)return e;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,h=r.index(a)+ +(l>0),c=r.node(a),u=!1;if(1==s)u=c.canReplace(h,h,i);else{var p=c.contentMatchAt(h).findWrapping(i.firstChild.type);u=p&&c.canReplaceWith(h,h,p[0])}if(u)return 0==l?r.pos:l<0?r.before(a+1):r.after(a+1)}return null},e.findWrapping=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,i=function(t,e){var n=t.parent,r=t.startIndex,i=t.endIndex,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;var s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}(t,e),o=i&&function(t,e){var n=t.parent,r=t.startIndex,i=t.endIndex,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;for(var a=(s.length?s[s.length-1]:e).contentMatch,l=r;a&&l<i;l++)a=a.matchType(n.child(l).type);return a&&a.validEnd?s:null}(r,e);return o?i.map(N).concat({type:e,attrs:n}).concat(o.map(N)):null},e.insertPoint=A,e.joinPoint=function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=t.resolve(e),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&&I(o,s)&&r.node(i).canReplace(a,a+1))return e;if(0==i)break;e=n<0?r.before(i):r.after(i)}},e.liftTarget=function(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(i,o,e))return n;if(0==n||r.type.spec.isolating||!((0==i||r.canReplace(i,r.childCount))&&(o==r.childCount||r.canReplace(0,o))))break}return null},e.replaceStep=z},18407:(t,e,n)=>{"use strict";n.d(e,{$L:()=>M,Ln:()=>m,Wg:()=>v,X9:()=>s,dL:()=>J,jP:()=>k,n9:()=>b,oM:()=>w,zy:()=>S});var r=n(73656);class i{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class o{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&o.empty)return o.empty}recover(t){let e=0,n=65535&t;if(!this.inverted)for(let t=0;t<n;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*n]+e+(t-(65535&t))/65536}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let h=this.ranges[a+o],c=this.ranges[a+s],u=l+h;if(t<=u){let o=h?t==l?-1:t==u?1:e:e,s=l+r+(o<0?0:c);if(n)return s;let p=t==(e<0?l:u)?null:a/3+(t-l)*65536,f=t==l?2:t==u?1:4;return(e<0?t!=l:t!=u)&&(f|=8),new i(s,f,p)}r+=c-h}return n?t+r:new i(t+r,0,null)}touches(t,e){let n=0,r=65535&e,i=this.inverted?2:1,o=this.inverted?1:2;
1for(let e=0;e<this.ranges.length;e+=3){let s=this.ranges[e]-(this.inverted?n:0);if(s>t)break;let a=this.ranges[e+i];if(t<=s+a&&e==3*r)return!0;n+=this.ranges[e+o]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+e],h=this.ranges[r+n];t(s,s+l,a,a+h),i+=h-l}}invert(){return new o(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?o.empty:new o(t<0?[0,-t,0]:[0,0,t])}}o.empty=new o([]);class s{constructor(t=[],e,n=0,r=t.length){this.maps=t,this.mirror=e,this.from=n,this.to=r}slice(t=0,e=this.maps.length){return new s(this.maps,this.mirror,t,e)}copy(){return new s(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}appendMapping(t){for(let e=0,n=this.maps.length;e<t.maps.length;e++){let r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror){for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new s;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this.maps[n].mapResult(t,e);if(null!=i.recover){let e=this.getMirror(n);if(null!=e&&e>n&&e<this.to){n=e,t=this.maps[e].recover(i.recover);continue}}r|=i.delInfo,t=i.pos}return n?t:new i(t,r,null)}}let a=Object.create(null);class l{getMap(){return o.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=a[e.stepType];if(!n)throw RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in a)throw RangeError("Duplicate use of step JSON ID "+t);return a[t]=e,e.prototype.jsonID=t,e}}class h{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new h(t,null)}static fail(t){return new h(null,t)}static fromReplace(t,e,n,i){try{return h.ok(t.replace(e,n,i))}catch(t){if(t instanceof r.vI)return h.fail(t.message);throw t}}}function c(t,e,n){let i=[];for(let r=0;r<t.childCount;r++){let o=t.child(r);o.content.size&&(o=o.copy(c(o.content,e,o))),o.isInline&&(o=e(o,n,r)),i.push(o)}return r.FK.fromArray(i)}class u extends l{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=t.resolve(this.from),i=n.node(n.sharedDepth(this.to)),o=new r.Ji(c(e.content,(t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,i),e.openStart,e.openEnd);return h.fromReplace(t,this.from,this.to,o)}invert(){return new p(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new u(e.pos,n.pos,this.mark)}merge(t){return t instanceof u&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new u(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new u(e.from,e.to,t.markFromJSON(e.mark))}}l.jsonID("addMark",u);class p extends l{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new r.Ji(c(e.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),e.openStart,e.openEnd);return h.fromReplace(t,this.from,this.to,n)}invert(){return new u(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new p(e.pos,n.pos,this.mark)}merge(t){return t instanceof p&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new p(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new p(e.from,e.to,t.markFromJSON(e.mark))}}l.jsonID("removeMark",p);class f extends l{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return h.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return h.fromReplace(t,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,+!e.isLeaf))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;n<e.marks.length;n++)if(!e.marks[n].isInSet(t))return new f(this.pos,e.marks[n]);return new f(this.pos,this.mark)}}return new d(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new f(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new f(e.pos,t.markFromJSON(e.mark))}}l.jsonID("addNodeMark",f);class d extends l{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return h.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return h.fromReplace(t,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,+!e.isLeaf))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new f(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new d(e.pos,this.mark)}
1toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new d(e.pos,t.markFromJSON(e.mark))}}l.jsonID("removeNodeMark",d);class m extends l{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&y(t,this.from,this.to)?h.fail("Structure replace would overwrite content"):h.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new o([this.from,this.to-this.from,this.slice.size])}invert(t){return new m(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new m(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof m)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart)if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;else{let e=this.slice.size+t.slice.size==0?r.Ji.empty:new r.Ji(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new m(t.from,this.to,e,this.structure)}{let e=this.slice.size+t.slice.size==0?r.Ji.empty:new r.Ji(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new m(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new m(e.from,e.to,r.Ji.fromJSON(t,e.slice),!!e.structure)}}l.jsonID("replace",m);class v extends l{constructor(t,e,n,r,i,o,s=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(t){if(this.structure&&(y(t,this.from,this.gapFrom)||y(t,this.gapTo,this.to)))return h.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return h.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?h.fromReplace(t,this.from,this.to,n):h.fail("Content does not fit in gap")}getMap(){return new o([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new v(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||i>n.pos?null:new v(e.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new v(e.from,e.to,e.gapFrom,e.gapTo,r.Ji.fromJSON(t,e.slice),e.insert,!!e.structure)}}function y(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let t=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,i--}}return!1}function g(t,e,n,i=n.contentMatch,o=!0){let s=t.doc.nodeAt(e),a=[],l=e+1;for(let e=0;e<s.childCount;e++){let h=s.child(e),c=l+h.nodeSize,u=i.matchType(h.type);if(u){i=u;for(let e=0;e<h.marks.length;e++)n.allowsMarkType(h.marks[e].type)||t.step(new p(l,c,h.marks[e]));if(o&&h.isText&&"pre"!=n.whitespace){let t,e=/\r?\n|\r/g,i;for(;t=e.exec(h.text);)i||(i=new r.Ji(r.FK.from(n.schema.text(" ",n.allowedMarks(h.marks))),0,0)),a.push(new m(l+t.index,l+t.index+t[0].length,i))}}else a.push(new m(l,c,r.Ji.empty));l=c}if(!i.validEnd){let e=i.fillBefore(r.FK.empty,!0);t.replace(l,l,new r.Ji(e,0,0))}for(let e=a.length-1;e>=0;
1e--)t.step(a[e])}function k(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(i,o,e))return n;if(0==n||r.type.spec.isolating||!((0==i||r.canReplace(i,r.childCount))&&(o==r.childCount||r.canReplace(0,o))))break}return null}function w(t,e,n=null,r=t){let i=function(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}(t,e),o=i&&function(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let t=r;a&&t<i;t++)a=a.matchType(n.child(t).type);return a&&a.validEnd?s:null}(r,e);return o?i.map(x).concat({type:e,attrs:n}).concat(o.map(x)):null}function x(t){return{type:t,attrs:null}}function S(t,e,n=1,r){let i=t.resolve(e),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(let t=i.depth-1,e=n-2;t>o;t--,e--){let n=i.node(t),o=i.index(t);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=r&&r[e+1];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let l=r&&r[e]||n;if(!n.canReplace(o+1,n.childCount)||!l.type.validContent(s))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function b(t,e){var n,r;let i=t.resolve(e),o=i.index();return n=i.nodeBefore,r=i.nodeAfter,!!(n&&r&&!n.isLeaf&&n.canAppend(r))&&i.parent.canReplace(o,o+1)}function M(t,e,n=e,i=r.Ji.empty){if(e==n&&!i.size)return null;let o=t.resolve(e),s=t.resolve(n);return C(o,s,i)?new m(e,n,i):new O(o,s,i).fit()}function C(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}l.jsonID("replaceAround",v);class O{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=r.FK.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=r.FK.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(t<0?this.$to:n.doc.resolve(t));if(!i)return null;let o=this.placed,s=n.depth,a=i.depth;for(;s&&a&&1==o.childCount;)o=o.firstChild.content,s--,a--;let l=new r.Ji(o,s,a);return t>-1?new v(n.pos,t,this.$to.pos,this.$to.end(),l,e):l.size||n.pos!=this.$to.pos?new m(n.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<t;n++){let i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t=null,i=(n?(t=R(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let o=this.depth;o>=0;o--){let{type:s,match:a}=this.frontier[o],l,h=null;if(1==e&&(i?a.matchType(i.type)||(h=a.fillBefore(r.FK.from(i),!1)):t&&s.compatibleContent(t.type)))return{sliceDepth:n,frontierDepth:o,parent:t,inject:h};if(2==e&&i&&(l=a.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:t,wrap:l};if(t&&a.matchType(t.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=R(t,e);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new r.Ji(t,e+1,Math.max(n,i.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=R(t,e);if(i.childCount<=1&&e>0){let o=t.size-e<=e+i.size;this.unplaced=new r.Ji(E(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new r.Ji(E(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:i,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let t=0;t<o.length;t++)this.openFrontierNode(o[t]);let s=this.unplaced,a=n?n.content:s.content,l=s.openStart-t,h=0,
1c=[],{match:u,type:p}=this.frontier[e];if(i){for(let t=0;t<i.childCount;t++)c.push(i.child(t));u=u.matchFragment(i)}let f=a.size+t-(s.content.size-s.openEnd);for(;h<a.childCount;){let t=a.child(h),e=u.matchType(t.type);if(!e)break;(++h>1||0==l||t.content.size)&&(u=e,c.push(function t(e,n,i){if(n<=0)return e;let o=e.content;return n>1&&(o=o.replaceChild(0,t(o.firstChild,n-1,1==o.childCount?i-1:0))),n>0&&(o=e.type.contentMatch.fillBefore(o).append(o),i<=0&&(o=o.append(e.type.contentMatch.matchFragment(o).fillBefore(r.FK.empty,!0)))),e.copy(o)}(t.mark(p.allowedMarks(t.marks)),1==h?l:0,h==a.childCount?f:-1)))}let d=h==a.childCount;d||(f=-1),this.placed=T(this.placed,e,r.FK.from(c)),this.frontier[e].match=u,d&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=a;t<f;t++){let t=e.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),e=t.content}this.unplaced=d?0==t?r.Ji.empty:new r.Ji(E(s.content,t-1,1),t-1,f<0?s.openEnd:t-1):new r.Ji(E(s.content,t,h),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let t=this.frontier[this.depth],e;if(!t.type.isTextblock||!N(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;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),o=N(t,e,r,n,i);if(o){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],i=N(t,n,r,e,!0);if(!i||i.childCount)continue t}return{depth:e,fit:o,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=T(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=T(this.placed,this.depth,r.FK.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(r.FK.empty,!0);t.childCount&&(this.placed=T(this.placed,this.frontier.length,t))}}function E(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(E(t.firstChild.content,e-1,n)))}function T(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(T(t.lastChild.content,e-1,n)))}function R(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function N(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function I(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let r=t.start(i);if(r<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(r==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==r-1)&&n.push(i)}return n}class A extends l{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return h.fail("No node at attribute step's position");let n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;let i=e.type.create(n,null,e.marks);return h.fromReplace(t,this.pos,this.pos+1,new r.Ji(r.FK.from(i),0,+!e.isLeaf))}getMap(){return o.empty}invert(t){return new A(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new A(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new A(e.pos,e.attr,e.value)}}l.jsonID("attr",A);class z extends l{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let n in t.attrs)e[n]=t.attrs[n];e[this.attr]=this.value;let n=t.type.create(e,t.content,t.marks);return h.ok(n)}getMap(){return o.empty}invert(t){return new z(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new z(e.attr,e.value)}}l.jsonID("docAttr",z);
1let F=class extends Error{};(F=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n}).prototype=Object.create(Error.prototype),F.prototype.constructor=F,F.prototype.name="TransformError";class J{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new s}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new F(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=r.Ji.empty){let i=M(this.doc,t,e,n);return i&&this.step(i),this}replaceWith(t,e,n){return this.replace(t,e,new r.Ji(r.FK.from(n),0,0))}delete(t,e){return this.replace(t,e,r.Ji.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return!function(t,e,n,i){if(!i.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(C(o,s,i))return t.step(new m(e,n,i));let a=I(o,t.doc.resolve(n));0==a[a.length-1]&&a.pop();let l=-(o.depth+1);a.unshift(l);for(let t=o.depth,e=o.pos-1;t>0;t--,e--){let n=o.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;a.indexOf(t)>-1?l=t:o.before(t)==e&&a.splice(1,0,-t)}let h=a.indexOf(l),c=[],u=i.openStart;for(let t=i.content,e=0;;e++){let n=t.firstChild;if(c.push(n),e==i.openStart)break;t=n.content}for(let t=u-1;t>=0;t--){var p;let e=c[t],n=(p=e.type).spec.defining||p.spec.definingForContent;if(n&&!e.sameMarkup(o.node(Math.abs(l)-1)))u=t;else if(n||!e.type.isTextblock)break}for(let e=i.openStart;e>=0;e--){let l=(e+u+1)%(i.openStart+1),p=c[l];if(p)for(let e=0;e<a.length;e++){let c=a[(e+h)%a.length],u=!0;c<0&&(u=!1,c=-c);let f=o.node(c-1),d=o.index(c-1);if(f.canReplaceWith(d,d,p.type,p.marks))return t.replace(o.before(c),u?s.after(c):n,new r.Ji(function t(e,n,i,o,s){if(n<i){let r=e.firstChild;e=e.replaceChild(0,r.copy(t(r.content,n+1,i,o,r)))}if(n>o){let t=s.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.FK.empty,!0))}return e}(i.content,0,i.openStart,l),l,i.openEnd))}}let f=t.steps.length;for(let r=a.length-1;r>=0&&(t.replace(e,n,i),!(t.steps.length>f));r--){let t=a[r];t<0||(e=o.before(t),n=s.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){var i=t,o=e;if(!n.isInline&&i==o&&this.doc.resolve(i).parent.content.size){let t=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let t=r.depth-1;t>=0;t--){let e=r.index(t);if(r.node(t).canReplaceWith(e,e,n))return r.before(t+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let t=r.depth-1;t>=0;t--){let e=r.indexAfter(t);if(r.node(t).canReplaceWith(e,e,n))return r.after(t+1);if(e<r.node(t).childCount)break}return null}(this.doc,i,n.type);null!=t&&(i=o=t)}return this.replaceRange(i,o,new r.Ji(r.FK.from(n),0,0)),this}deleteRange(t,e){return!function(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=I(r,i);for(let e=0;e<o.length;e++){let n=o[e],s=e==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return t.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return t.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o)return t.delete(r.before(o),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return!function(t,e,n){let{$from:i,$to:o,depth:s}=e,a=i.before(s+1),l=o.after(s+1),h=a,c=l,u=r.FK.empty,p=0;for(let t=s,e=!1;t>n;t--)e||i.index(t)>0?(e=!0,u=r.FK.from(i.node(t).copy(u)),p++):h--;let f=r.FK.empty,d=0;for(let t=s,e=!1;t>n;t--)e||o.after(t+1)<o.end(t)?(e=!0,f=r.FK.from(o.node(t).copy(f)),d++):c++;t.step(new v(h,c,a,l,new r.Ji(u.append(f),p,d),u.size-p,!0))}(this,t,e),this}join(t,e=1){let n;return n=new m(t-e,t+e,r.Ji.empty,!0),this.step(n),this}wrap(t,e){return!function(t,e,n){let i=r.FK.empty;for(let t=n.length-1;t>=0;t--){if(i.size){let e=n[t].type.contentMatch.matchFragment(i);if(!e||!e.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.FK.from(n[t].type.create(n[t].attrs,i))}let o=e.start,s=e.end;t.step(new v(o,s,o,s,new r.Ji(i,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,i=null){var o=this;if(!n.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let s=o.steps.length;return o.doc.nodesBetween(t,e,(t,e)=>{var a,l,h,c,u,p,f,d,m,y,k;let w,x;if(t.isTextblock&&!t.hasMarkup(n,i)&&(a=o.doc,l=o.mapping.slice(s).map(e),h=n,x=(w=a.resolve(l)).index(),w.parent.canReplaceWith(x,x+1,h))){let a=null;if(n.schema.linebreakReplacement){let t="pre"==n.whitespace,e=!!n.contentMatch.matchType(n.schema.linebreakReplacement);t&&!e?a=!1:!t&&e&&(a=!0)}!1===a&&(c=o,u=t,p=e,f=s,u.forEach((t,e)=>{if(t.type==t.type.schema.linebreakReplacement){let t=c.mapping.slice(f).map(p+1+e);c.replaceWith(t,t+1,u.type.schema.text("\n"))}})),g(o,o.mapping.slice(s).map(e,1),n,void 0,null===a);let l=o.mapping.slice(s),h=l.map(e,1),w=l.map(e+t.nodeSize,1);return o.step(new v(h,w,h+1,w-1,new r.Ji(r.FK.from(n.create(i,null,t.marks)),0,0),1,!0)),!0===a&&(d=o,m=t,y=e,k=s,m.forEach((t,e)=>{if(t.isText){let n,r=/\r?\n|\r/g;
1for(;n=r.exec(t.text);){let t=d.mapping.slice(k).map(y+1+e+n.index);d.replaceWith(t,t+1,m.type.schema.linebreakReplacement.create())}}})),!1}}),this}setNodeMarkup(t,e,n=null,i){return!function(t,e,n,i,o){let s=t.doc.nodeAt(e);if(!s)throw RangeError("No node at given position");n||(n=s.type);let a=n.create(i,null,o||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,a);if(!n.validContent(s.content))throw RangeError("Invalid content for node type "+n.name);t.step(new v(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new r.Ji(r.FK.from(a),0,0),1,!0))}(this,t,e,n,i),this}setNodeAttribute(t,e,n){return this.step(new A(t,e,n)),this}setDocAttribute(t,e){return this.step(new z(t,e)),this}addNodeMark(t,e){return this.step(new f(t,e)),this}removeNodeMark(t,e){if(!(e instanceof r.CU)){let n=this.doc.nodeAt(t);if(!n)throw RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new d(t,e)),this}split(t,e=1,n){return!function(t,e,n=1,i){let o=t.doc.resolve(e),s=r.FK.empty,a=r.FK.empty;for(let t=o.depth,e=o.depth-n,l=n-1;t>e;t--,l--){s=r.FK.from(o.node(t).copy(s));let e=i&&i[l];a=r.FK.from(e?e.type.create(e.attrs,a):o.node(t).copy(a))}t.step(new m(e,e,new r.Ji(s.append(a),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){var r;let i,o,s,a;return r=this,s=[],a=[],r.doc.nodesBetween(t,e,(r,l,h)=>{if(!r.isInline)return;let c=r.marks;if(!n.isInSet(c)&&h.type.allowsMarkType(n.type)){let h=Math.max(l,t),f=Math.min(l+r.nodeSize,e),d=n.addToSet(c);for(let t=0;t<c.length;t++)c[t].isInSet(d)||(i&&i.to==h&&i.mark.eq(c[t])?i.to=f:s.push(i=new p(h,f,c[t])));o&&o.to==h?o.to=f:a.push(o=new u(h,f,n))}}),s.forEach(t=>r.step(t)),a.forEach(t=>r.step(t)),this}removeMark(t,e,n){var i;let o,s;return i=this,o=[],s=0,i.doc.nodesBetween(t,e,(i,a)=>{if(!i.isInline)return;s++;let l=null;if(n instanceof r.sX){let t=i.marks,e;for(;e=n.isInSet(t);)(l||(l=[])).push(e),t=e.removeFromSet(t)}else n?n.isInSet(i.marks)&&(l=[n]):l=i.marks;if(l&&l.length){let n=Math.min(a+i.nodeSize,e);for(let e=0;e<l.length;e++){let r=l[e],i;for(let t=0;t<o.length;t++){let e=o[t];e.step==s-1&&r.eq(o[t].style)&&(i=e)}i?(i.to=n,i.step=s):o.push({style:r,from:Math.max(a,t),to:n,step:s})}}}),o.forEach(t=>i.step(new p(t.from,t.to,t.style))),this}clearIncompatible(t,e,n){return g(this,t,e,n),this}}},19457:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});let r=n(14232),i=n(6865);e.default=function(t){return r.useState(()=>i.EditorState.create(t))}},20376:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},s=this&&this.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)0>e.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};Object.defineProperty(e,"__esModule",{value:!0});let a=o(n(14232)),l=n(1807);e.default=a.forwardRef(function(t,e){var n,r;let i=a.useRef(null),o=a.useRef(t),h=a.useRef(null),{state:c}=t,u=s(t,["state"]);return null==(n=h.current)||n.updateState(c),null==(r=h.current)||r.setProps(p(u)),a.useEffect(()=>{let{editorViewFactory:t}=o.current,e=Object.assign({state:o.current.state},p(o.current)),n=(null==t?void 0:t(i.current,e,o.current))||new l.EditorView(i.current,e);return h.current=n,()=>{n.destroy()}},[]),a.useImperativeHandle(e,()=>({get view(){return h.current}})),a.default.createElement("div",{ref:i,style:t.style,className:t.className});function p(t){return Object.assign(Object.assign({},t),{dispatchTransaction:e=>{t.dispatchTransaction?t.dispatchTransaction(e):t.onChange&&h.current&&t.onChange(h.current.state.apply(e))}})}})},27284:(t,e,n)=>{"use strict";n.d(e,{Fr:()=>f,P8:()=>h,dv:()=>l,gO:()=>c,sM:()=>s,tG:()=>d});var r=n(51772),i=n(18407);class o{constructor(t,e,n={}){var r;this.match=t,this.match=t,this.handler="string"==typeof e?(r=e,function(t,e,n,i){let o=r;if(e[1]){let t=e[0].lastIndexOf(e[1]);o+=e[0].slice(t+e[1].length);let r=(n+=t)-i;r>0&&(o=e[0].slice(t-r,t)+o,n=i)}return t.tr.insertText(o,n,i)}):e,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1}}function s({rules:t}){let e=new r.k_({state:{init:()=>null,apply(t,e){let n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:(n,r,i,o)=>a(n,r,i,o,t,e),handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&a(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}function a(t,e,n,r,i,o){if(t.composing)return!1;let s=t.state,a=s.doc.resolve(e),l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r;for(let h=0;h<i.length;h++){let c=i[h];if(a.parent.type.spec.code){if(!c.inCode)continue}else if("only"===c.inCode)continue;let u=c.match.exec(l),p=u&&c.handler(s,u,e-(u[0].length-r.length),n);if(p)return c.undoable&&p.setMeta(o,{transform:p,from:e,to:n,text:r}),t.dispatch(p),!0}return!1}let l=(t,e)=>{let n=t.plugins;for(let r=0;r<n.length;r++){let i=n[r],o;
1if(i.spec.isInputRules&&(o=i.getState(t))){if(e){let n=t.tr,r=o.transform;for(let t=r.steps.length-1;t>=0;t--)n.step(r.steps[t].invert(r.docs[t]));if(o.text){let e=n.doc.resolve(o.from).marks();n.replaceWith(o.from,o.to,t.schema.text(o.text,e))}else n.delete(o.from,o.to);e(n)}return!0}}return!1},h=new o(/--$/,"â"),c=new o(/\.\.\.$/,"â¦"),u=new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"â"),p=new o(/"$/,"â"),f=[u,p,new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"â"),new o(/'$/,"â")];function d(t,e,n=null,r){return new o(t,(t,o,s,a)=>{let l=n instanceof Function?n(o):n,h=t.tr.delete(s,a),c=h.doc.resolve(s).blockRange(),u=c&&(0,i.oM)(c,e,l);if(!u)return null;h.wrap(c,u);let p=h.doc.resolve(s-1).nodeBefore;return p&&p.type==e&&(0,i.n9)(h.doc,s-1)&&(!r||r(o,p))&&h.join(s-1),h})}},39529:(t,e,n)=>{"use strict";n.d(e,{b6:()=>k,ZS:()=>S,tN:()=>x});var r=function(){};r.prototype.append=function(t){return t.length?(t=r.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},r.prototype.prepend=function(t){return t.length?r.from(t).append(this):this},r.prototype.appendInner=function(t){return new o(this,t)},r.prototype.slice=function(t,e){return(void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e)?r.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},r.prototype.get=function(t){if(!(t<0)&&!(t>=this.length))return this.getInner(t)},r.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},r.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(e,n){return r.push(t(e,n))},e,n),r},r.from=function(t){return t instanceof r?t:t&&t.length?new i(t):r.empty};var i=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var i=e;i<n;i++)if(!1===t(this.values[i],r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var i=e-1;i>=n;i--)if(!1===t(this.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(r);r.empty=new i([]);var o=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var i=this.left.length;if(e<i&&!1===this.left.forEachInner(t,e,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;if(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(t,Math.min(e,i),n,r))return!1},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(r),s=n(18407),a=n(51772);class l{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){let n,r,i,o;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}e&&(r=(n=this.remapping(s,this.items.length)).maps.length);let a=t.tr,c=[],u=[];
1return this.items.forEach((t,e)=>{if(!t.step){n||(r=(n=this.remapping(s,e+1)).maps.length),r--,u.push(t);return}if(n){u.push(new h(t.map));let e=t.step.map(n.slice(r)),i;e&&a.maybeStep(e).doc&&(i=a.mapping.maps[a.mapping.maps.length-1],c.push(new h(i,void 0,void 0,c.length+u.length))),r--,i&&n.appendMap(i,r)}else a.maybeStep(t.step);if(t.selection)return i=n?t.selection.map(n.slice(r)):t.selection,o=new l(this.items.slice(0,s).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:a,selection:i}}addTransform(t,e,n,r){var i,o;let s,a=[],c=this.eventCount,p=this.items,f=!r&&p.length?p.get(p.length-1):null;for(let n=0;n<t.steps.length;n++){let i=t.steps[n].invert(t.docs[n]),o=new h(t.mapping.maps[n],i,e),s;(s=f&&f.merge(o))&&(o=s,n?a.pop():p=p.slice(0,p.length-1)),a.push(o),e&&(c++,e=void 0),r||(f=o)}let d=c-n.depth;return d>u&&(i=p,o=d,i.forEach((t,e)=>{if(t.selection&&0==o--)return s=e,!1}),p=i.slice(s),c-=d),new l(p.append(a),c)}remapping(t,e){let n=new s.X9;return this.items.forEach((e,r)=>{let i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)},t,e),n}addMaps(t){return 0==this.eventCount?this:new l(this.items.append(t.map(t=>new h(t))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),i=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(t=>{t.selection&&s--},r);let a=e;this.items.forEach(e=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(e.step){let o=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(i.slice(a+1,r));c&&s++,n.push(new h(l,o,c))}else n.push(new h(l))},r);let c=[];for(let t=e;t<o;t++)c.push(new h(i.maps[t]));let u=new l(this.items.slice(0,r).append(c).append(n),s);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let t=0;return this.items.forEach(e=>{!e.step&&t++}),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,i=[],o=0;return this.items.forEach((r,s)=>{if(s>=t)i.push(r),r.selection&&o++;else if(r.step){let t=r.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=r.selection&&r.selection.map(e.slice(n));a&&o++;let l=new h(s.invert(),t,a),c,u=i.length-1;(c=i.length&&i[u].merge(l))?i[u]=c:i.push(l)}}else r.map&&n--},this.items.length,0),new l(r.from(i.reverse()),o)}}l.empty=new l(r.empty,0);class h{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new h(e.getMap().invert(),e,this.selection)}}}class c{constructor(t,e,n,r,i){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let u=20;function p(t){let e=[];return t.forEach((t,n,r,i)=>e.push(r,i)),e}function f(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}let d=!1,m=null;function v(t){let e=t.plugins;if(m!=e){d=!1,m=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){d=!0;break}}return d}let y=new a.hs("history"),g=new a.hs("closeHistory");function k(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new a.k_({key:y,state:{init:()=>new c(l.empty,l.empty,null,0,-1),apply:(e,n,r)=>(function(t,e,n,r){let i=n.getMeta(y),o;if(i)return i.historyState;n.getMeta(g)&&(t=new c(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(y))if(s.getMeta(y).redo)return new c(t.done.addTransform(n,void 0,r,v(e)),t.undone,p(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition);else return new c(t.done,t.undone.addTransform(n,void 0,r,v(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))if(o=n.getMeta("rebased"))return new c(t.done.rebased(n,o),t.undone.rebased(n,o),f(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);else return new c(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),f(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let i=n.getMeta("composition"),o=0==t.prevTime||!s&&t.prevComposition!=i&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;
1return t.mapping.maps[0].forEach((t,r)=>{for(let i=0;i<e.length;i+=2)t<=e[i+1]&&r>=e[i]&&(n=!0)}),n}(n,t.prevRanges)),a=s?f(t.prevRanges,n.mapping):p(n.mapping.maps[n.steps.length-1]);return new c(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,v(e)),l.empty,a,n.time,null==i?t.prevComposition:i)}})(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?x:"historyRedo"==n?S:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}function w(t,e){return(n,r)=>{let i=y.getState(n);if(!i||0==(t?i.undone:i.done).eventCount)return!1;if(r){let o=function(t,e,n){let r=v(e),i=y.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),l=new c(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(y,{redo:n,historyState:l})}(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}let x=w(!1,!0),S=w(!0,!0);w(!1,!1),w(!0,!1)},41684:t=>{"use strict";function e(t){this.content=t}e.prototype={constructor:e,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return -1},get:function(t){var e=this.find(t);return -1==e?void 0:this.content[e+1]},update:function(t,n,r){var i=r&&r!=t?this.remove(r):this,o=i.find(t),s=i.content.slice();return -1==o?s.push(r||t,n):(s[o+1]=n,r&&(s[o]=r)),new e(s)},remove:function(t){var n=this.find(t);if(-1==n)return this;var r=this.content.slice();return r.splice(n,2),new e(r)},addToStart:function(t,n){return new e([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var r=this.remove(t).content.slice();return r.push(t,n),new e(r)},addBefore:function(t,n,r){var i=this.remove(n),o=i.content.slice(),s=i.find(t);return o.splice(-1==s?o.length:s,0,n,r),new e(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=e.from(t)).size?new e(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=e.from(t)).size?new e(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=e.from(t);for(var r=0;r<t.content.length;r+=2)n=n.remove(t.content[r]);return n},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},e.from=function(t){if(t instanceof e)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new e(n)},t.exports=e},44216:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ProseMirror=e.useProseMirror=void 0;var i=n(19457);Object.defineProperty(e,"useProseMirror",{enumerable:!0,get:function(){return r(i).default}});var o=n(20376);Object.defineProperty(e,"ProseMirror",{enumerable:!0,get:function(){return r(o).default}})},51772:(t,e,n)=>{"use strict";n.d(e,{LN:()=>s,U3:()=>c,hs:()=>b,i5:()=>d,k_:()=>w,nh:()=>p});var r=n(73656),i=n(18407);let o=Object.create(null);class s{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new a(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=r.Ji.empty){let n=e.content.lastChild,i=null;for(let t=0;t<e.openEnd;t++)i=n,n=n.lastChild;let o=t.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:h}=s[a],c=t.mapping.slice(o);t.replaceRange(c.map(l.pos),c.map(h.pos),a?r.Ji.empty:e),0==a&&y(t,o,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=t.mapping.slice(n),l=a.map(o.pos),h=a.map(s.pos);i?t.deleteRange(l,h):(t.replaceRangeWith(l,h,e),y(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new c(t):v(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let r=t.depth-1;r>=0;
1r--){let i=e<0?v(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):v(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(i)return i}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new d(t.node(0))}static atStart(t){return v(t,t,0,0,1)||new d(t)}static atEnd(t){return v(t,t,t.content.size,t.childCount,-1)||new d(t)}static fromJSON(t,e){if(!e||!e.type)throw RangeError("Invalid input for Selection.fromJSON");let n=o[e.type];if(!n)throw RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in o)throw RangeError("Duplicate use of selection JSON ID "+t);return o[t]=e,e.prototype.jsonID=t,e}getBookmark(){return c.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class a{constructor(t,e){this.$from=t,this.$to=e}}let l=!1;function h(t){l||t.parent.inlineContent||(l=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class c extends s{constructor(t,e=t){h(t),h(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return s.near(n);let r=t.resolve(e.map(this.anchor));return new c(r.parent.inlineContent?r:n,n)}replace(t,e=r.Ji.empty){if(super.replace(t,e),e==r.Ji.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof c&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new u(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new c(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if((!n||r)&&(n=r>=0?1:-1),!e.parent.inlineContent){let t=s.findFrom(e,n,!0)||s.findFrom(e,-n,!0);if(!t)return s.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r?t=e:(t=(s.findFrom(t,-n,!0)||s.findFrom(t,n,!0)).$anchor).pos<e.pos!=r<0&&(t=e)),new c(t,e)}}s.jsonID("text",c);class u{constructor(t,e){this.anchor=t,this.head=e}map(t){return new u(t.map(this.anchor),t.map(this.head))}resolve(t){return c.between(t.resolve(this.anchor),t.resolve(this.head))}}class p extends s{constructor(t){let e=t.nodeAfter;super(t,t.node(0).resolve(t.pos+e.nodeSize)),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),i=t.resolve(r);return n?s.near(i):new p(i)}content(){return new r.Ji(r.FK.from(this.node),0,0)}eq(t){return t instanceof p&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new f(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new p(t.resolve(e.anchor))}static create(t,e){return new p(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}p.prototype.visible=!1,s.jsonID("node",p);class f{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new u(n,n):new f(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&p.isSelectable(n)?new p(e):s.near(e)}}class d extends s{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=r.Ji.empty){if(e==r.Ji.empty){t.delete(0,t.doc.content.size);let e=s.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new d(t)}map(t){return new d(t)}eq(t){return t instanceof d}getBookmark(){return m}}s.jsonID("all",d);let m={map(){return this},resolve:t=>new d(t)};function v(t,e,n,r,i,o=!1){if(e.inlineContent)return c.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let r=e.child(s);if(r.isAtom){if(!o&&p.isSelectable(r))return p.create(t,n-(i<0?r.nodeSize:0))}else{let e=v(t,r,n+i,i<0?r.childCount:0,i,o);if(e)return e}n+=r.nodeSize*i}return null}function y(t,e,n){let r,o=t.steps.length-1;if(o<e)return;let a=t.steps[o];(a instanceof i.Ln||a instanceof i.Wg)&&(t.mapping.maps[o].forEac
1h((t,e,n,i)=>{null==r&&(r=i)}),t.setSelection(s.near(t.doc.resolve(r),n)))}function g(t,e){return e&&t?t.bind(e):t}i.dL;class k{constructor(t,e,n){this.name=t,this.init=g(e.init,n),this.apply=g(e.apply,n)}}new k("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new k("selection",{init:(t,e)=>t.selection||s.atStart(e.doc),apply:t=>t.selection}),new k("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new k("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e});class w{constructor(t){this.spec=t,this.props={},t.props&&function t(e,n,r){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=t(o,n,{})),r[i]=o}return r}(t.props,this,this.props),this.key=t.key?t.key.key:S("plugin")}getState(t){return t[this.key]}}let x=Object.create(null);function S(t){return t in x?t+"$"+ ++x[t]:(x[t]=0,t+"$")}class b{constructor(t="key"){this.key=S(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}},53007:(t,e,n)=>{"use strict";n.d(e,{A:()=>p});var r=n(66702),i=n(14232);function o(t){return t&&t.stopPropagation&&t.stopPropagation(),t&&t.preventDefault&&t.preventDefault(),!1}function s(t){return null==t?[]:Array.isArray(t)?t.slice():[t]}function a(t){return null!==t&&1===t.length?t[0]:t.slice()}function l(t){Object.keys(t).forEach(e=>{"undefined"!=typeof document&&document.addEventListener(e,t[e],!1)})}function h(t,e){let n;return c(((n=t)<=e.min&&(n=e.min),n>=e.max&&(n=e.max),n),e)}function c(t,e){let n=(t-e.min)%e.step,r=t-n;return 2*Math.abs(n)>=e.step&&(r+=n>0?e.step:-e.step),parseFloat(r.toFixed(5))}let u=function(t){function e(e){var n;(n=t.call(this,e)||this).onKeyUp=()=>{n.onEnd()},n.onMouseUp=()=>{n.onEnd(n.getMouseEventMap())},n.onTouchEnd=t=>{t.preventDefault(),n.onEnd(n.getTouchEventMap())},n.onBlur=()=>{n.setState({index:-1},n.onEnd(n.getKeyDownEventMap()))},n.onMouseMove=t=>{n.setState({pending:!0});let e=n.getMousePosition(t),r=n.getDiffPosition(e[0]),i=n.getValueFromPosition(r);n.move(i)},n.onTouchMove=t=>{if(t.touches.length>1)return;n.setState({pending:!0});let e=n.getTouchPosition(t);if(void 0===n.isScrolling){let t=e[0]-n.startPosition[0],r=e[1]-n.startPosition[1];n.isScrolling=Math.abs(r)>Math.abs(t)}if(n.isScrolling)return void n.setState({index:-1});let r=n.getDiffPosition(e[0]),i=n.getValueFromPosition(r);n.move(i)},n.onKeyDown=t=>{if(!(t.ctrlKey||t.shiftKey||t.altKey||t.metaKey))switch(n.setState({pending:!0}),t.key){case"ArrowLeft":case"ArrowDown":case"Left":case"Down":t.preventDefault(),n.moveDownByStep();break;case"ArrowRight":case"ArrowUp":case"Right":case"Up":t.preventDefault(),n.moveUpByStep();break;case"Home":t.preventDefault(),n.move(n.props.min);break;case"End":t.preventDefault(),n.move(n.props.max);break;case"PageDown":t.preventDefault(),n.moveDownByStep(n.props.pageFn(n.props.step));break;case"PageUp":t.preventDefault(),n.moveUpByStep(n.props.pageFn(n.props.step))}},n.onSliderMouseDown=t=>{if(!n.props.disabled&&2!==t.button){if(n.setState({pending:!0}),!n.props.snapDragDisabled){let e=n.getMousePosition(t);n.forceValueFromPosition(e[0],t=>{n.start(t,e[0]),l(n.getMouseEventMap())})}o(t)}},n.onSliderClick=t=>{if(!n.props.disabled&&n.props.onSliderClick&&!n.hasMoved){let e=n.getMousePosition(t),r=h(n.calcValue(n.calcOffsetFromPosition(e[0])),n.props);n.props.onSliderClick(r)}},n.createOnKeyDown=t=>e=>{n.props.disabled||(n.start(t),l(n.getKeyDownEventMap()),o(e))},n.createOnMouseDown=t=>e=>{if(n.props.disabled||2===e.button)return;n.setState({pending:!0});let r=n.getMousePosition(e);n.start(t,r[0]),l(n.getMouseEventMap()),o(e)},n.createOnTouchStart=t=>e=>{if(n.props.disabled||e.touches.length>1)return;n.setState({pending:!0});let r=n.getTouchPosition(e);n.startPosition=r,n.isScrolling=void 0,n.start(t,r[0]),l(n.getTouchEventMap()),e.stopPropagation&&e.stopPropagation()},n.handleResize=()=>{let t=window.setTimeout(()=>{n.pendingResizeTimeouts.shift(),n.resize()},0);n.pendingResizeTimeouts.push(t)},n.renderThumb=(t,e)=>{let r=n.props.thumbClassName+" "+n.props.thumbClassName+"-"+e+" "+(n.state.index===e?n.props.thumbActiveClassName:""),i={ref:t=>{n["thumb"+e]=t},key:n.props.thumbClassName+"-"+e,className:r,style:t,onMouseDown:n.createOnMouseDown(e),onTouchStart:n.createOnTouchStart(e),onFocus:n.createOnKeyDown(e),tabIndex:0,role:"slider","aria-orientation":n.props.orientation,"aria-valuenow":n.state.value[e],"aria-valuemin":n.props.min,"aria-valuemax":n.props.max,"aria-label":Array.isArray(n.props.ariaLabel)?n.props.ariaLabel[e]:n.props.ariaLabel,"aria-labelledby":Array.isArray(n.props.ariaLabelledby)?n.props.ariaLabelledby[e]:n.props.ariaLabelledby,"aria-disabled":n.props.disabled},o={index:e,value:a(n.state.value),valueNow:n.state.value[e]};return n.props.ariaValuetext&&(i["aria-valuetext"]="string"==typeof n.props.ariaValuetext?n.props.ariaValuetext:n.props.ariaValuetext(o)),n.props.renderThumb(i,o)},n.renderTrack=(t,e,r)=>{let i={key:n.props.trackClassName+"-"+t,className:n.props.trackClassName+" "+n.props.trackClassName+"-"+t,style:n.buildTrackStyle(e,n.state.upperBound-r)},o={index:t,value:a(n.state.value)};return n.props.renderTrack(i,o)};let r=s(e.value);r.length||(r=s(e.defaultValue)),n.pendingResizeTimeouts=[];let c=[];for(let t=0;t<r.length;
1t+=1)r[t]=h(r[t],e),c.push(t);return n.resizeObserver=null,n.resizeElementRef=i.createRef(),n.state={index:-1,upperBound:0,sliderLength:0,value:r,zIndices:c},n}(0,r.A)(e,t);var n=e.prototype;return n.componentDidMount=function(){"undefined"!=typeof window&&(this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.resizeElementRef.current),this.resize())},e.getDerivedStateFromProps=function(t,e){let n=s(t.value);return n.length?e.pending?null:{value:n.map(e=>h(e,t))}:null},n.componentDidUpdate=function(){0===this.state.upperBound&&this.resize()},n.componentWillUnmount=function(){this.clearPendingResizeTimeouts(),this.resizeObserver&&this.resizeObserver.disconnect()},n.onEnd=function(t){t&&Object.keys(t).forEach(e=>{"undefined"!=typeof document&&document.removeEventListener(e,t[e],!1)}),this.hasMoved&&this.fireChangeEvent("onAfterChange"),this.setState({pending:!1}),this.hasMoved=!1},n.getValue=function(){return a(this.state.value)},n.getClosestIndex=function(t){let e=Number.MAX_VALUE,n=-1,{value:r}=this.state,i=r.length;for(let o=0;o<i;o+=1){let i=Math.abs(t-this.calcOffset(r[o]));i<e&&(e=i,n=o)}return n},n.getMousePosition=function(t){return[t["page"+this.axisKey()],t["page"+this.orthogonalAxisKey()]]},n.getTouchPosition=function(t){let e=t.touches[0];return[e["page"+this.axisKey()],e["page"+this.orthogonalAxisKey()]]},n.getKeyDownEventMap=function(){return{keydown:this.onKeyDown,keyup:this.onKeyUp,focusout:this.onBlur}},n.getMouseEventMap=function(){return{mousemove:this.onMouseMove,mouseup:this.onMouseUp}},n.getTouchEventMap=function(){return{touchmove:this.onTouchMove,touchend:this.onTouchEnd}},n.getValueFromPosition=function(t){let e=t/(this.state.sliderLength-this.state.thumbSize)*(this.props.max-this.props.min);return h(this.state.startValue+e,this.props)},n.getDiffPosition=function(t){let e=t-this.state.startPosition;return this.props.invert&&(e*=-1),e},n.resize=function(){let{slider:t,thumb0:e}=this;if(!t||!e)return;let n=this.sizeKey(),r=t.getBoundingClientRect(),i=t[n],o=r[this.posMaxKey()],s=r[this.posMinKey()],a=e.getBoundingClientRect()[n.replace("client","").toLowerCase()],l=i-a,h=Math.abs(o-s);this.state.upperBound===l&&this.state.sliderLength===h&&this.state.thumbSize===a||this.setState({upperBound:l,sliderLength:h,thumbSize:a})},n.calcOffset=function(t){let e=this.props.max-this.props.min;return 0===e?0:(t-this.props.min)/e*this.state.upperBound},n.calcValue=function(t){return t/this.state.upperBound*(this.props.max-this.props.min)+this.props.min},n.calcOffsetFromPosition=function(t){let{slider:e}=this,n=e.getBoundingClientRect(),r=n[this.posMaxKey()],i=n[this.posMinKey()],o=t-(window["page"+this.axisKey()+"Offset"]+(this.props.invert?r:i));return this.props.invert&&(o=this.state.sliderLength-o),o-=this.state.thumbSize/2},n.forceValueFromPosition=function(t,e){let n=this.calcOffsetFromPosition(t),r=this.getClosestIndex(n),i=h(this.calcValue(n),this.props),o=this.state.value.slice();o[r]=i;for(let t=0;t<o.length-1;t+=1)if(o[t+1]-o[t]<this.props.minDistance)return;this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0,this.setState({value:o},()=>{e(r),this.fireChangeEvent("onChange")})},n.clearPendingResizeTimeouts=function(){do clearTimeout(this.pendingResizeTimeouts.shift());while(this.pendingResizeTimeouts.length)},n.start=function(t,e){let n=this["thumb"+t];n&&n.focus();let{zIndices:r}=this.state;r.splice(r.indexOf(t),1),r.push(t),this.setState(n=>({startValue:n.value[t],startPosition:void 0!==e?e:n.startPosition,index:t,zIndices:r}))},n.moveUpByStep=function(t){void 0===t&&(t=this.props.step);let e=this.state.value[this.state.index],n=h(this.props.invert&&"horizontal"===this.props.orientation?e-t:e+t,this.props);
1this.move(Math.min(n,this.props.max))},n.moveDownByStep=function(t){void 0===t&&(t=this.props.step);let e=this.state.value[this.state.index],n=h(this.props.invert&&"horizontal"===this.props.orientation?e+t:e-t,this.props);this.move(Math.max(n,this.props.min))},n.move=function(t){let e=this.state.value.slice(),{index:n}=this.state,{length:r}=e,i=e[n];if(t===i)return;this.hasMoved||this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0;let{pearling:o,max:s,min:a,minDistance:l}=this.props;if(!o){if(n>0){let r=e[n-1];t<r+l&&(t=r+l)}if(n<r-1){let r=e[n+1];t>r-l&&(t=r-l)}}e[n]=t,o&&r>1&&(t>i?(this.pushSucceeding(e,l,n),function(t,e,n,r){for(let i=0;i<t;i+=1){let o=r-i*n;e[t-1-i]>o&&(e[t-1-i]=o)}}(r,e,l,s)):t<i&&(this.pushPreceding(e,l,n),function(t,e,n,r){for(let i=0;i<t;i+=1){let t=r+i*n;e[i]<t&&(e[i]=t)}}(r,e,l,a))),this.setState({value:e},this.fireChangeEvent.bind(this,"onChange"))},n.pushSucceeding=function(t,e,n){let r,i;for(i=t[r=n]+e;null!==t[r+1]&&i>t[r+1];r+=1,i=t[r]+e)t[r+1]=c(i,this.props)},n.pushPreceding=function(t,e,n){for(let r=n,i=t[r]-e;null!==t[r-1]&&i<t[r-1];r-=1,i=t[r]-e)t[r-1]=c(i,this.props)},n.axisKey=function(){return"vertical"===this.props.orientation?"Y":"X"},n.orthogonalAxisKey=function(){return"vertical"===this.props.orientation?"X":"Y"},n.posMinKey=function(){return"vertical"===this.props.orientation?this.props.invert?"bottom":"top":this.props.invert?"right":"left"},n.posMaxKey=function(){return"vertical"===this.props.orientation?this.props.invert?"top":"bottom":this.props.invert?"left":"right"},n.sizeKey=function(){return"vertical"===this.props.orientation?"clientHeight":"clientWidth"},n.fireChangeEvent=function(t){this.props[t]&&this.props[t](a(this.state.value),this.state.index)},n.buildThumbStyle=function(t,e){let n={position:"absolute",touchAction:"none",willChange:this.state.index>=0?this.posMinKey():void 0,zIndex:this.state.zIndices.indexOf(e)+1};return n[this.posMinKey()]=t+"px",n},n.buildTrackStyle=function(t,e){let n={position:"absolute",willChange:this.state.index>=0?this.posMinKey()+","+this.posMaxKey():void 0};return n[this.posMinKey()]=t,n[this.posMaxKey()]=e,n},n.buildMarkStyle=function(t){var e;return(e={position:"absolute"})[this.posMinKey()]=t,e},n.renderThumbs=function(t){let{length:e}=t,n=[];for(let r=0;r<e;r+=1)n[r]=this.buildThumbStyle(t[r],r);let r=[];for(let t=0;t<e;t+=1)r[t]=this.renderThumb(n[t],t);return r},n.renderTracks=function(t){let e=[],n=t.length-1;e.push(this.renderTrack(0,0,t[0]));for(let r=0;r<n;r+=1)e.push(this.renderTrack(r+1,t[r],t[r+1]));return e.push(this.renderTrack(n+1,t[n],this.state.upperBound)),e},n.renderMarks=function(){let{marks:t}=this.props,e=this.props.max-this.props.min+1;return"boolean"==typeof t?t=Array.from({length:e}).map((t,e)=>e):"number"==typeof t&&(t=Array.from({length:e}).map((t,e)=>e).filter(e=>e%t==0)),t.map(parseFloat).sort((t,e)=>t-e).map(t=>{let e=this.calcOffset(t),n={key:t,className:this.props.markClassName,style:this.buildMarkStyle(e)};return this.props.renderMark(n)})},n.render=function(){let t=[],{value:e}=this.state,n=e.length;for(let r=0;r<n;r+=1)t[r]=this.calcOffset(e[r],r);let r=this.props.withTracks?this.renderTracks(t):null,o=this.renderThumbs(t),s=this.props.marks?this.renderMarks():null;return i.createElement("div",{ref:t=>{this.slider=t,this.resizeElementRef.current=t},style:{position:"relative"},className:this.props.className+(this.props.disabled?" disabled":""),onMouseDown:this.onSliderMouseDown,onClick:this.onSliderClick},r,o,s)},e}(i.Component);u.displayName="ReactSlider",u.defaultProps={min:0,max:100,step:1,pageFn:t=>10*t,minDistance:0,defaultValue:0,orientation:"horizontal",className:"slider",thumbClassName:"thumb",thumbActiveClassName:"active",trackClassName:"track",markClassName:"mark",withTracks:!0,pearling:!1,disabled:!1,snapDragDisabled:!1,invert:!1,marks:[],renderThumb:t=>i.createElement("div",t),renderTrack:t=>i.createElement("div",t),renderMark:t=>i.createElement("span",t)};var p=u},53760:(t,e,n)=>{"use strict";n.d(e,{I$:()=>p,Im:()=>y,RV:()=>M,st:()=>k,wh:()=>g,yY:()=>c});var r=n(18407),i=n(73656),o=n(51772);let s=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function a(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;
1if(n&&1!=r.childCount)break}return!1}function l(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function h(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}let c=(t,e)=>{let{$from:n,$to:i}=t.selection,o=n.blockRange(i),s=o&&(0,r.jP)(o);return null!=s&&(e&&e(t.tr.lift(o,s).scrollIntoView()),!0)};function u(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let p=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),a=u(i.contentMatchAt(s));if(!a||!i.canReplaceWith(s,s,a))return!1;if(e){let r=n.after(),i=t.tr.replaceWith(r,r,a.createAndFill());i.setSelection(o.LN.near(i.doc.resolve(r),1)),e(i.scrollIntoView())}return!0};function f(t,e,n){let s,l,h,c=e.nodeBefore,u=e.nodeAfter,p,f;if(c.type.spec.isolating||u.type.spec.isolating)return!1;if(s=e.nodeBefore,l=e.nodeAfter,h=e.index(),s&&l&&s.type.compatibleContent(l.type)&&(!s.content.size&&e.parent.canReplace(h-1,h)?(n&&n(t.tr.delete(e.pos-s.nodeSize,e.pos).scrollIntoView()),!0):!!e.parent.canReplace(h,h+1)&&!!(l.isTextblock||(0,r.n9)(t.doc,e.pos))&&(n&&n(t.tr.clearIncompatible(e.pos,s.type,s.contentMatchAt(s.childCount)).join(e.pos).scrollIntoView()),!0)))return!0;let d=e.parent.canReplace(e.index(),e.index()+1);if(d&&(p=(f=c.contentMatchAt(c.childCount)).findWrapping(u.type))&&f.matchType(p[0]||u.type).validEnd){if(n){let o=e.pos+u.nodeSize,s=i.FK.empty;for(let t=p.length-1;t>=0;t--)s=i.FK.from(p[t].create(null,s));s=i.FK.from(c.copy(s));let a=t.tr.step(new r.Wg(e.pos-1,o,e.pos,o,new i.Ji(s,1,0),p.length,!0)),l=o+2*p.length;(0,r.n9)(a.doc,l)&&a.join(l),n(a.scrollIntoView())}return!0}let m=o.LN.findFrom(e,1),v=m&&m.$from.blockRange(m.$to),y=v&&(0,r.jP)(v);if(null!=y&&y>=e.depth)return n&&n(t.tr.lift(v,y).scrollIntoView()),!0;if(d&&a(u,"start",!0)&&a(c,"end")){let o=c,s=[];for(;s.push(o),!o.isTextblock;)o=o.lastChild;let a=u,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(o.canReplace(o.childCount,o.childCount,a.content)){if(n){let o=i.FK.empty;for(let t=s.length-1;t>=0;t--)o=i.FK.from(s[t].copy(o));n(t.tr.step(new r.Wg(e.pos-s.length,e.pos+u.nodeSize,e.pos+l,e.pos+u.nodeSize-l,new i.Ji(o,s.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function d(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return!!i.node(s).isTextblock&&(n&&n(e.tr.setSelection(o.U3.create(e.doc,t<0?i.start(s):i.end(s)))),!0)}}let m=d(-1),v=d(1);function y(t,e=null){return function(n,i){let{$from:o,$to:s}=n.selection,a=o.blockRange(s),l=a&&(0,r.oM)(a,t,e);return!!l&&(i&&i(n.tr.wrap(a,l).scrollIntoView()),!0)}}function g(t,e=null){return function(n,r){let{empty:i,$cursor:o,ranges:s}=n.selection;if(i&&!o||!function(t,e,n){for(let r=0;r<e.length;r++){let{$from:i,$to:o}=e[r],s=0==i.depth&&t.inlineContent&&t.type.allowsMarkType(n);if(t.nodesBetween(i.pos,o.pos,t=>{if(s)return!1;s=t.inlineContent&&t.type.allowsMarkType(n)}),s)return!0}return!1}(n.doc,s,t))return!1;if(r)if(o)r(t.isInSet(n.storedMarks||o.marks())?n.tr.removeStoredMark(t):n.tr.addStoredMark(t.create(e)));else{let i=!1,o=n.tr;for(let e=0;!i&&e<s.length;e++){let{$from:r,$to:o}=s[e];i=n.doc.rangeHasMark(r.pos,o.pos,t)}for(let n=0;n<s.length;n++){let{$from:r,$to:a}=s[n];if(i)o.removeMark(r.pos,a.pos,t);else{let n=r.pos,i=a.pos,s=r.nodeAfter,l=a.nodeBefore,h=s&&s.isText?/^\s*/.exec(s.text)[0].length:0,c=l&&l.isText?/\s*$/.exec(l.text)[0].length:0;n+h<i&&(n+=h,i-=c),o.addMark(n,i,t.create(e))}}r(o.scrollIntoView())}return!0}}function k(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}let w=k(s,(t,e,n)=>{let s=function(t,e){let{$cursor:n}=t.selection;return n&&(e?e.endOfTextblock("backward",t):!(n.parentOffset>0))?n:null}(t,n);if(!s)return!1;let h=l(s);if(!h){let n=s.blockRange(),i=n&&(0,r.jP)(n);return null!=i&&(e&&e(t.tr.lift(n,i).scrollIntoView()),!0)}let c=h.nodeBefore;if(!c.type.spec.isolating&&f(t,h,e))return!0;
1if(0==s.parent.content.size&&(a(c,"end")||o.nh.isSelectable(c))){let n=(0,r.$L)(t.doc,s.before(),s.after(),i.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(a(c,"end")?o.LN.findFrom(r.doc.resolve(r.mapping.map(h.pos,-1)),-1):o.nh.create(r.doc,h.pos-c.nodeSize)),e(r.scrollIntoView())}return!0}}return!!c.isAtom&&h.depth==s.depth-1&&(e&&e(t.tr.delete(h.pos-c.nodeSize,h.pos).scrollIntoView()),!0)},(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=l(r)}let a=s&&s.nodeBefore;return!!a&&!!o.nh.isSelectable(a)&&(e&&e(t.tr.setSelection(o.nh.create(t.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)}),x=k(s,(t,e,n)=>{let s=function(t,e){let{$cursor:n}=t.selection;return n&&(e?e.endOfTextblock("forward",t):!(n.parentOffset<n.parent.content.size))?n:null}(t,n);if(!s)return!1;let l=h(s);if(!l)return!1;let c=l.nodeAfter;if(f(t,l,e))return!0;if(0==s.parent.content.size&&(a(c,"start")||o.nh.isSelectable(c))){let n=(0,r.$L)(t.doc,s.before(),s.after(),i.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(e){let r=t.tr.step(n);r.setSelection(a(c,"start")?o.LN.findFrom(r.doc.resolve(r.mapping.map(l.pos)),1):o.nh.create(r.doc,r.mapping.map(l.pos))),e(r.scrollIntoView())}return!0}}return!!c.isAtom&&l.depth==s.depth-1&&(e&&e(t.tr.delete(l.pos,l.pos+c.nodeSize).scrollIntoView()),!0)},(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=h(r)}let a=s&&s.nodeAfter;return!!a&&!!o.nh.isSelectable(a)&&(e&&e(t.tr.setSelection(o.nh.create(t.doc,s.pos)).scrollIntoView()),!0)}),S={Enter:k((t,e)=>{let{$head:n,$anchor:r}=t.selection;return!!n.parent.type.spec.code&&!!n.sameParent(r)&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)},(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof o.i5||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=u(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(n,s.createAndFill());a.setSelection(o.U3.create(a.doc,n+1)),e(a.scrollIntoView())}return!0},(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if((0,r.zy)(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),o=i&&(0,r.jP)(i);return null!=o&&(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},(t,e)=>{let{$from:n,$to:i}=t.selection;if(t.selection instanceof o.nh&&t.selection.node.isBlock)return!!n.parentOffset&&!!(0,r.zy)(t.doc,n.pos)&&(e&&e(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(e){let s=i.parentOffset==i.parent.content.size,a=t.tr;(t.selection instanceof o.U3||t.selection instanceof o.i5)&&a.deleteSelection();let l=0==n.depth?null:u(n.node(-1).contentMatchAt(n.indexAfter(-1))),h,c=h?[h]:s&&l?[{type:l}]:void 0,p=(0,r.zy)(a.doc,a.mapping.map(n.pos),1,c);if(!c&&!p&&(0,r.zy)(a.doc,a.mapping.map(n.pos),1,l?[{type:l}]:void 0)&&(l&&(c=[{type:l}]),p=!0),p&&(a.split(a.mapping.map(n.pos),1,c),!s&&!n.parentOffset&&n.parent.type!=l)){let t=a.mapping.map(n.before()),e=a.doc.resolve(t);l&&n.node(-1).canReplaceWith(e.index(),e.index()+1,l)&&a.setNodeMarkup(a.mapping.map(n.before()),l)}e(a.scrollIntoView())}return!0}),"Mod-Enter":p,Backspace:w,"Mod-Backspace":w,"Shift-Backspace":w,Delete:x,"Mod-Delete":x,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new o.i5(t.doc))),!0)},b={"Ctrl-h":S.Backspace,"Alt-Backspace":S["Mod-Backspace"],"Ctrl-d":S.Delete,"Ctrl-Alt-Backspace":S["Mod-Delete"],"Alt-Delete":S["Mod-Delete"],"Alt-d":S["Mod-Delete"],"Ctrl-a":m,"Ctrl-e":v};for(let t in S)b[t]=S[t];let M=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&!!os.platform&&"darwin"==os.platform())?b:S},56517:(t,e,n)=>{"use strict";n.d(e,{w:()=>p});for(var r={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:"'"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},o="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),s="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=0;a<10;a++)r[48+a]=r[96+a]=String(a);for(var a=1;a<=24;a++)r[a+111]="F"+a;for(var a=65;a<=90;a++)r[a]=String.fromCharCode(a+32),i[a]=String.fromCharCode(a);for(var l in r)i.hasOwnProperty(l)||(i[l]=r[l]);var h=n(51772);let c="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);
1function u(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function p(t){let e;return new h.k_({props:{handleKeyDown:(e=function(t){let e=Object.create(null);for(let n in t)e[function(t){let e,n,r,i,o=t.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let t=0;t<o.length-1;t++){let s=o[t];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))c?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+s)}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}(n)]=t[n];return e}(t),function(t,n){var a;let l=("Esc"==(a=!(o&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||s&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?i:r)[n.keyCode]||n.key||"Unidentified")&&(a="Escape"),"Del"==a&&(a="Delete"),"Left"==a&&(a="ArrowLeft"),"Up"==a&&(a="ArrowUp"),"Right"==a&&(a="ArrowRight"),"Down"==a&&(a="ArrowDown"),a),h,c=e[u(l,n)];if(c&&c(t.state,t.dispatch,t))return!0;if(1==l.length&&" "!=l){if(n.shiftKey){let r=e[u(l,n,!1)];if(r&&r(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||l.charCodeAt(0)>127)&&(h=r[n.keyCode])&&h!=l){let r=e[u(h,n)];if(r&&r(t.state,t.dispatch,t))return!0}}return!1})}})}},73656:(t,e,n)=>{"use strict";function r(t){this.content=t}n.d(e,{S4:()=>j,ZF:()=>U,FK:()=>i,CU:()=>l,sX:()=>B,u$:()=>x,vI:()=>h,Sj:()=>D,Ji:()=>c}),r.prototype={constructor:r,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return -1},get:function(t){var e=this.find(t);return -1==e?void 0:this.content[e+1]},update:function(t,e,n){var i=n&&n!=t?this.remove(n):this,o=i.find(t),s=i.content.slice();return -1==o?s.push(n||t,e):(s[o+1]=e,n&&(s[o]=n)),new r(s)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new r(n)},addToStart:function(t,e){return new r([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new r(n)},addBefore:function(t,e,n){var i=this.remove(e),o=i.content.slice(),s=i.find(t);return o.splice(-1==s?o.length:s,0,e,n),new r(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=r.from(t)).size?new r(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=r.from(t)).size?new r(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=r.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},r.from=function(t){if(t instanceof r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new r(e)};class i{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;e<t.length;e++)this.size+=t[e].nodeSize}nodesBetween(t,e,n,r=0,i){for(let o=0,s=0;s<e;o++){let a=this.content[o],l=s+a.nodeSize;if(l>t&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,t-i),Math.min(a.content.size,e-i),n,r+i)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let i="",o=!0;return this.nodesBetween(t,e,(s,a)=>{let l=s.isText?s.text.slice(Math.max(t,a)-a,e-a):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=l},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new i(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let i=0,o=0;o<e;i++){let s=this.content[i],a=o+s.nodeSize;a>t&&((o<t||a>e)&&(s=s.isText?s.cut(Math.max(0,t-o),Math.min(s.text.length,e-o)):s.cut(Math.max(0,t-o-1),Math.min(s.content.size,e-o-1))),n.push(s),r+=s.nodeSize),o=a}return new i(n,r)}cutByIndex(t,e){return t==e?i.empty:0==t&&e==this.content.length?this:new i(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new i(r,o)}addToStart(t){return new i([t].concat(this.content),this.size+t.no
1deSize)}addToEnd(t){return new i(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))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(t){let e=this.content[t];if(!e)throw RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return function t(e,n,r){for(let i=0;;i++){if(i==e.childCount||i==n.childCount)return e.childCount==n.childCount?null:r;let o=e.child(i),s=n.child(i);if(o==s){r+=o.nodeSize;continue}if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){for(let t=0;o.text[t]==s.text[t];t++)r++;return r}if(o.content.size||s.content.size){let e=t(o.content,s.content,r+1);if(null!=e)return e}r+=o.nodeSize}}(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return function t(e,n,r,i){for(let o=e.childCount,s=n.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};let a=e.child(--o),l=n.child(--s),h=a.nodeSize;if(a==l){r-=h,i-=h;continue}if(!a.sameMarkup(l))return{a:r,b:i};if(a.isText&&a.text!=l.text){let t=0,e=Math.min(a.text.length,l.text.length);for(;t<e&&a.text[a.text.length-t-1]==l.text[l.text.length-t-1];)t++,r--,i--;return{a:r,b:i}}if(a.content.size||l.content.size){let e=t(a.content,l.content,r-1,i-1);if(e)return e}r-=h,i-=h}}(this,t,e,n)}findIndex(t,e=-1){if(0==t)return s(0,t);if(t==this.size)return s(this.content.length,t);if(t>this.size||t<0)throw RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=t){if(i==t||e>0)return s(n+1,i);return s(n,r)}r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return i.empty;if(!Array.isArray(e))throw RangeError("Invalid input for Fragment.fromJSON");return new i(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return i.empty;let e,n=0;for(let r=0;r<t.length;r++){let i=t[r];n+=i.nodeSize,r&&i.isText&&t[r-1].sameMarkup(i)?(e||(e=t.slice(0,r)),e[e.length-1]=i.withText(e[e.length-1].text+i.text)):e&&e.push(i)}return new i(e||t,n)}static from(t){if(!t)return i.empty;if(t instanceof i)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new i([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}i.empty=new i([],0);let o={index:0,offset:0};function s(t,e){return o.index=t,o.offset=e,o}function a(t,e){if(t===e)return!0;if(!(t&&"object"==typeof t)||!(e&&"object"==typeof e))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!a(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!a(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class l{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))e||(e=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!n&&i.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&a(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw RangeError(`There is no mark type ${e.type} in this schema`);return n.create(e.attrs)}static sameSet(t,e){if(t==e)return!0;
1if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return l.none;if(t instanceof l)return[t];let e=t.slice();return e.sort((t,e)=>t.type.rank-e.type.rank),e}}l.none=[];class h extends Error{}class c{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=function t(e,n,r,i){let{index:o,offset:s}=e.findIndex(n),a=e.maybeChild(o);if(s==n||a.isText)return i&&!i.canReplace(o,o,r)?null:e.cut(0,n).append(r).append(e.cut(n));let l=t(a.content,n-s-1,r);return l&&e.replaceChild(o,a.copy(l))}(this.content,t+this.openStart,e);return n&&new c(n,this.openStart,this.openEnd)}removeBetween(t,e){return new c(function t(e,n,r){let{index:i,offset:o}=e.findIndex(n),s=e.maybeChild(i),{index:a,offset:l}=e.findIndex(r);if(o==n||s.isText){if(l!=r&&!e.child(a).isText)throw RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(r))}if(i!=a)throw RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(t(s.content,n-o-1,r-o-1)))}(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return c.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new c(i.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)r++;return new c(t,n,r)}}function u(t,e){if(!e.type.compatibleContent(t.type))throw new h("Cannot join "+e.type.name+" onto "+t.type.name)}function p(t,e,n){let r=t.node(n);return u(r,e.node(n)),r}function f(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function d(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(f(t.nodeAfter,r),o++));for(let t=o;t<s;t++)f(i.child(t),r);e&&e.depth==n&&e.textOffset&&f(e.nodeBefore,r)}function m(t,e){return t.type.checkContent(e),t.copy(e)}function v(t,e,n){let r=[];return d(null,t,n,r),t.depth>n&&f(m(p(t,e,n+1),v(t,e,n+1)),r),d(e,null,n,r),new i(r)}c.empty=new c(i.empty,0,0);class y{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let e=0;e<t;e++)r+=n.child(e).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return l.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}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(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.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(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new x(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let e=t;;){let{index:t,offset:o}=e.content.findIndex(i),s=i-o;if(n.push(e,t,r+o),!s||(e=e.child(t)).isText)break;
1i=s-1,r+=o+1}return new y(e,n,i)}static resolveCached(t,e){for(let n=0;n<g.length;n++){let r=g[n];if(r.pos==e&&r.doc==t)return r}let n=g[k]=y.resolve(t,e);return k=(k+1)%w,n}}let g=[],k=0,w=12;class x{constructor(t,e,n){this.$from=t,this.$to=e,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)}}let S=Object.create(null);class b{constructor(t,e,n,r=l.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||i.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&a(this.attrs,e||t.defaultAttrs||S)&&l.sameSet(this.marks,n||l.none)}copy(t=null){return t==this.content?this:new b(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new b(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return c.empty;let r=this.resolve(t),i=this.resolve(e),o=n?0:r.sharedDepth(e),s=r.start(o);return new c(r.node(o).content.cut(r.pos-s,i.pos-s),r.depth-o,i.depth-o)}replace(t,e,n){var r=this.resolve(t),o=this.resolve(e);if(n.openStart>r.depth)throw new h("Inserted content deeper than insertion position");if(r.depth-n.openStart!=o.depth-n.openEnd)throw new h("Inconsistent open depths");return function t(e,n,r,o){let s=e.index(o),a=e.node(o);if(s==n.index(o)&&o<e.depth-r.openStart){let i=t(e,n,r,o+1);return a.copy(a.content.replaceChild(s,i))}if(!r.content.size)return m(a,v(e,n,o));if(r.openStart||r.openEnd||e.depth!=o||n.depth!=o){let{start:t,end:s}=function(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let t=n-1;t>=0;t--)r=e.node(t).copy(i.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(r,e);return m(a,function t(e,n,r,o,s){let a=e.depth>s&&p(e,n,s+1),l=o.depth>s&&p(r,o,s+1),h=[];return d(null,e,s,h),a&&l&&n.index(s)==r.index(s)?(u(a,l),f(m(a,t(e,n,r,o,s+1)),h)):(a&&f(m(a,v(e,n,s+1)),h),d(n,r,s,h),l&&f(m(l,v(r,o,s+1)),h)),d(o,null,s,h),new i(h)}(e,t,s,n,o))}{let t=e.parent,i=t.content;return m(t,i.cut(0,e.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(r,o,n,0)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(!(e=e.maybeChild(n)))return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return y.resolveCached(this,t)}resolveNoCache(t){return y.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,t=>(n.isInSet(t.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);
1let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),C(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=i.empty,r=0,o=n.childCount){let s=this.contentMatchAt(t).matchFragment(n,r,o),a=s&&s.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(let t=r;t<o;t++)if(!this.type.allowsMarks(n.child(t).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(t).matchType(n),o=i&&i.matchFragment(this.content,e);return!!o&&o.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=l.none;for(let e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!l.sameSet(t,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(t=>t.toJSON())),t}static fromJSON(t,e){if(!e)throw RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=i.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}b.prototype.text=void 0;class M extends b{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):C(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new M(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new M(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function C(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class O{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){var n;let r,i=new E(t,e);if(null==i.next)return O.empty;let o=function t(e){let n=[];do n.push(function(e){let n=[];do n.push(function(e){let n=function(e){if(e.eat("(")){let n=t(e);return e.eat(")")||e.err("Missing closing paren"),n}if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=(function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let t in n){let r=n[t];r.groups.indexOf(e)>-1&&i.push(r)}return 0==i.length&&t.err("No node type or group '"+e+"' 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);for(;;)if(e.eat("+"))n={type:"plus",expr:n};else if(e.eat("*"))n={type:"star",expr:n};else if(e.eat("?"))n={type:"opt",expr:n};else if(e.eat("{"))n=function(t,e){let n=T(t),r=n;return t.eat(",")&&(r="}"!=t.next?T(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}(e,n);else break;return n}(e));while(e.next&&")"!=e.next&&"|"!=e.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(e));while(e.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let s=(n=function(t){let e=[[]];return i(function t(e,o){if("choice"==e.type)return e.exprs.reduce((e,n)=>e.concat(t(n,o)),[]);if("seq"==e.type)for(let r=0;;r++){let s=t(e.exprs[r],o);if(r==e.exprs.length-1)return s;i(s,o=n())}else if("star"==e.type){let s=n();return r(o,s),i(t(e.expr,s),s),[r(s)]}else if("plus"==e.type){let s=n();return i(t(e.expr,o),s),i(t(e.expr,s),s),[r(s)]}else if("opt"==e.type)return[r(o)].concat(t(e.expr,o));else if("range"==e.type){let s=o;for(let r=0;r<e.min;r++){let r=n();i(t(e.expr,s),r),s=r}if(-1==e.max)i(t(e.expr,s),s);else for(let o=e.min;o<e.max;o++){let o=n();r(s,o),i(t(e.expr,s),o),s=o}return[r(s)]}else if("name"==e.type)return[r(o,void 0,e.value)];else throw Error("Unknown expr type")}(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let i={term:r,to:n};return e[t].push(i),i}function i(t,e){t.forEach(t=>t.to=e)}}(o),r=Object.create(null),function t(e){let i=[];e.forEach(t=>{n[t].forEach(({term:t,to:e})=>{let r;if(t){for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);
1N(n,e).forEach(e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})}})});let o=r[e.join(",")]=new O(e.indexOf(n.length-1)>-1);for(let e=0;e<i.length;e++){let n=i[e][1].sort(R);o.next.push({type:i[e][0],next:r[n.join(",")]||t(n)})}return o}(N(n,0)));return function(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],i=!t.validEnd,o=[];for(let e=0;e<t.next.length;e++){let{type:n,next:s}=t.next[e];o.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,i),s}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let i=e;r&&i<n;i++)r=r.matchType(t.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!(e.isText||e.hasRequiredAttrs()))return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];return function o(s,a){let l=s.matchFragment(t,n);if(l&&(!e||l.validEnd))return i.from(a.map(t=>t.createAndFill()));for(let t=0;t<s.next.length;t++){let{type:e,next:n}=s.next[t];if(!(e.isText||e.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let t=o(n,a.concat(e));if(t)return t}}return null}(this,[])}findWrapping(t){for(let e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<i.next.length;t++){let{type:o,next:s}=i.next[t];o.isLeaf||o.hasRequiredAttrs()||o.name in e||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),e[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return!function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n<e.next.length;n++)r+=(n?", ":"")+e.next[n].type.name+"->"+t.indexOf(e.next[n].next);return r}).join("\n")}}O.empty=new O(!0);class E{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw SyntaxError(t+" (in content expression '"+this.string+"')")}}function T(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function R(t,e){return e-t}function N(t,e){let n=[];return function e(r){let i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(let t=0;t<i.length;t++){let{term:r,to:o}=i[t];r||-1!=n.indexOf(o)||e(o)}}(e),n.sort(R)}function I(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function A(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(void 0===i){let e=t[r];if(e.hasDefault)i=e.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function z(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new J(t[n]);return e}class F{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=z(n.attrs),this.defaultAttrs=I(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==O.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:A(this.attrs,t)}create(t=null,e,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new b(this,this.computeAttrs(t),i.from(e),l.setFrom(n))}createChecked(t=null,e,n){return e=i.from(e),this.checkContent(e),new b(this,this.computeAttrs(t),e,l.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=i.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),o=r&&r.fillBefore(i.empty,!0);return o?new b(this,t,e.append(o),l.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e<t.childCount;e++)if(!this.allowsMarks(t.child(e).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){let e;if(null==this.markSet)return t;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:l.none:t}static compile(t,e){let n=Object.create(null);t.forEach((t,r)=>n[t]=new F(t,e,r));let r=e.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");
1if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let t in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class J{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class B{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=z(r.attrs),this.excluded=null;let i=I(this.attrs);this.instance=i?new l(this,i):null}create(t=null){return!t&&this.instance?this.instance:new l(this,A(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach((t,i)=>n[t]=new B(t,r++,e,i)),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}excludes(t){return this.excluded.indexOf(t)>-1}}class D{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];e.nodes=r.from(t.nodes),e.marks=r.from(t.marks||{}),this.nodes=F.compile(this.spec.nodes,this),this.marks=B.compile(this.spec.marks,this);let n=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],r=e.spec.content||"",i=e.spec.marks;if(e.contentMatch=n[r]||(n[r]=O.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!e.isInline||!e.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=e}e.markSet="_"==i?null:i?P(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:P(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else if(t instanceof F){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new M(n,n.defaultAttrs,t,l.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return b.fromJSON(this,t)}markFromJSON(t){return l.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw RangeError("Unknown node type: "+t);return e}}function P(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let e in t.marks){let r=t.marks[e];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class j{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach(t=>{null!=t.tag?this.tags.push(t):null!=t.style&&this.styles.push(t)}),this.normalizeLists=!this.tags.some(e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)})}parse(t,e={}){let n=new q(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new q(this,e,!0);return n.addAll(t,e.from,e.to),c.maxOpen(n.finish())}matchTag(t,e,n){for(let o=n?this.tags.indexOf(n)+1:0;o<this.tags.length;o++){var r,i;let n=this.tags[o];if(r=t,i=n.tag,(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,i)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,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(t)&&(!r.context||n.matchesContext(r.context))&&(!(o.length>t.length)||61==o.charCodeAt(t.length)&&o.slice(t.length+1)==e)){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let e in t.marks){let r=t.marks[e].spec.parseDOM;r&&r.forEach(t=>{n(t=V(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)})}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach(t=>
1{n(t=V(t)),t.node||t.ignore||t.mark||(t.node=e)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new j(t,j.schemaRules(t)))}}let $={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},_={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},L={ol:!0,ul:!0};function W(t,e,n){return null!=e?!!e|2*("full"===e):t&&"pre"==t.whitespace?3:-5&n}class K{constructor(t,e,n,r,i,o,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=l.none,this.stashMarks=[],this.match=o||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(i.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let e=this.type.contentMatch,n;return(n=e.findWrapping(t.type))?(this.match=e,n):null}}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t=this.content[this.content.length-1],e;t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))&&(t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=t.withText(t.text.slice(0,t.text.length-e[0].length)))}let e=i.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;e<n.length;e++){let r=n[e];(this.type?this.type.allowsMarkType(r.type):function(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=t=>{o.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:i}=t.edge(n);if(r==e||0>o.indexOf(i)&&s(i))return!0}};if(s(i.contentMatch))return!0}}(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!$.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class q{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r=e.topNode,i,o=W(null,e.preserveWhitespace,0)|4*!!n;i=r?new K(r.type,r.attrs,l.none,l.none,!0,e.topMatch||r.type.contentMatch,o):n?new K(null,null,l.none,l.none,!0,null,o):new K(t.schema.topNodeType,null,l.none,l.none,!0,null,o),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){3==t.nodeType?this.addTextNode(t):1==t.nodeType&&this.addElement(t)}withStyleRules(t,e){let n=t.style;if(!n||!n.length)return e();let r=this.readStyles(t.style);if(!r)return;let[i,o]=r,s=this.top;for(let t=0;t<o.length;t++)this.removePendingMark(o[t],s);for(let t=0;t<i.length;t++)this.addPendingMark(i[t]);e();for(let t=0;t<i.length;t++)this.removePendingMark(i[t],s);for(let t=0;t<o.length;t++)this.addPendingMark(o[t])}
1addTextNode(t){let e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=t.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)}addElement(t,e){let n=t.nodeName.toLowerCase(),r;L.hasOwnProperty(n)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&L.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let i=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(r=this.parser.matchTag(t,this,e));if(i?i.ignore:_.hasOwnProperty(n))this.findInside(t),this.ignoreFallback(t);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(t=i.skip);let e,r=this.top,o=this.needsBlock;if($.hasOwnProperty(n))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),e=!0,r.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);i&&i.skip?this.addAll(t):this.withStyleRules(t,()=>this.addAll(t)),e&&this.sync(r),this.needsBlock=o}else this.withStyleRules(t,()=>{this.addElementByRule(t,i,!1===i.consuming?r:void 0)})}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let e=l.none,n=l.none;for(let r=0,i=t.length;r<i;r++){let i=t.item(r);for(let r;;){let o=this.parser.matchStyle(i,t.getPropertyValue(i),this,r);if(!o)break;if(o.ignore)return null;if(o.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(t=>{o.clearMark(t)&&(n=t.addToSet(n))}):e=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(e),!1===o.consuming)r=o;else break}}return[e,n]}addElementByRule(t,e,n){let r,i,o;e.node?(i=this.parser.schema.nodes[e.node]).isLeaf?this.insertNode(i.create(e.attrs))||this.leafFallback(t):r=this.enter(i,e.attrs||null,e.preserveWhitespace):(o=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(o));let s=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(t,e,n){let r=e||0;for(let i=e?t.childNodes[e]:t.firstChild,o=null==n?null:t.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(i);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(t);if(o&&(!e||e.length>o.length)&&(e=o,n=i,!o.length)||i.solid)break}if(!e)return!1;this.sync(n);for(let t=0;t<e.length;t++)this.enterInner(e[t],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(t)){this.closeExtra();let e=this.top;e.applyPending(t.type),e.match&&(e.match=e.match.matchType(t.type));let n=e.activeMarks;for(let r=0;r<t.marks.length;r++)(!e.type||e.type.allowsMarkType(t.marks[r].type))&&(n=t.marks[r].addToSet(n));return e.content.push(t.mark(n)),!0}return!1}enter(t,e,n){let r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r}enterInner(t,e=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(t),i.match=i.match&&i.match.matchType(t);let o=W(t,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new K(t,e,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,o=(t,s)=>{for(;t>=0;t--){let a=e[t];
1if(""==a){if(t==e.length-1||0==t)continue;for(;s>=i;s--)if(o(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return o(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(t){let e=function(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,e){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function V(t){let e={};for(let n in t)e[n]=t[n];return e}class U{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=H(e).createDocumentFragment());let r=n,i=[];return t.forEach(t=>{if(i.length||t.marks.length){let n=0,o=0;for(;n<i.length&&o<t.marks.length;){let e=t.marks[o];if(!this.marks[e.type.name]){o++;continue}if(!e.eq(i[n][0])||!1===e.type.spec.spanning)break;n++,o++}for(;n<i.length;)r=i.pop()[1];for(;o<t.marks.length;){let n=t.marks[o++],s=this.serializeMark(n,t.isInline,e);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(t,e))}),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=U.renderSpec(H(e),this.nodes[t.type.name](t));if(r){if(t.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&U.renderSpec(H(n),r(t,e))}static renderSpec(t,e,n=null){let r;if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let i=e[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?t.createElementNS(n,i):t.createElement(i),a=e[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){for(let t in l=2,a)if(null!=a[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):s.setAttribute(t,a[t])}}for(let i=l;i<e.length;i++){let o=e[i];if(0===o){if(i<e.length-1||i>l)throw RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:i}=U.renderSpec(t,o,n);if(s.appendChild(e),i){if(r)throw RangeError("Multiple content holes");r=i}}}return{dom:s,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new U(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=Z(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return Z(t.marks)}}function Z(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function H(t){return t.document||window.document}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.