text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Editor=t():(e.SmartBlock=e.SmartBlock||{},e.SmartBlock.Editor=t())}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="bundle",n(n.s=79)}([function(e,t,n){"use strict";n.r(t);var r,o,i,a,s,c,l={},u=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function f(e,t){for(var n in t)e[n]=t[n];return e}function h(e){var t=e.parentNode;t&&t.removeChild(e)}function d(e,t,n){var r,o=arguments,i={};for(r in t)"key"!==r&&"ref"!==r&&(i[r]=t[r]);if(arguments.length>3)for(n=[n],r=3;r<arguments.length;r++)n.push(o[r]);if(null!=n&&(i.children=n),"function"==typeof e&&null!=e.defaultProps)for(r in e.defaultProps)void 0===i[r]&&(i[r]=e.defaultProps[r]);return m(e,i,t&&t.key,t&&t.ref)}function m(e,t,n,o){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:null,__c:null,constructor:void 0};return r.vnode&&r.vnode(i),i}function v(){return{}}function g(e){return e.children}function y(e,t){this.props=e,this.context=t}function b(e,t){if(null==t)return e.__?b(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?b(e):null}function w(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return w(e)}}function k(e){(!e.__d&&(e.__d=!0)&&1===o.push(e)||a!==r.debounceRendering)&&((a=r.debounceRendering)||i)(_)}function _(){var e,t,n,r,i,a,s;for(o.sort(function(e,t){return t.__v.__b-e.__v.__b});e=o.pop();)e.__d&&(n=void 0,r=void 0,a=(i=(t=e).__v).__e,(s=t.__P)&&(n=[],r=E(s,i,f({},i),t.__n,void 0!==s.ownerSVGElement,null,n,null==a?b(i):a),N(n,i),r!=a&&w(i)))}function x(e,t,n,r,o,i,a,s,c){var p,f,d,m,v,g,y,w=n&&n.__k||u,k=w.length;if(s==l&&(s=null!=i?i[0]:k?b(n,0):null),p=0,t.__k=S(t.__k,function(n){if(null!=n){if(n.__=t,n.__b=t.__b+1,null===(d=w[p])||d&&n.key==d.key&&n.type===d.type)w[p]=void 0;else for(f=0;f<k;f++){if((d=w[f])&&n.key==d.key&&n.type===d.type){w[f]=void 0;break}d=null}if(m=E(e,n,d=d||l,r,o,i,a,s,c),(f=n.ref)&&d.ref!=f&&(y||(y=[]),d.ref&&y.push(d.ref,null,n),y.push(f,n.__c||m,n)),null!=m){if(null==g&&(g=m),null!=n.__d)m=n.__d,n.__d=null;else if(i==d||m!=s||null==m.parentNode){e:if(null==s||s.parentNode!==e)e.appendChild(m);else{for(v=s,f=0;(v=v.nextSibling)&&f<k;f+=2)if(v==m)break e;e.insertBefore(m,s)}"option"==t.type&&(e.value="")}s=m.nextSibling,"function"==typeof t.type&&(t.__d=m)}}return p++,n}),t.__e=g,null!=i&&"function"!=typeof t.type)for(p=i.length;p--;)null!=i[p]&&h(i[p]);for(p=k;p--;)null!=w[p]&&P(w[p],w[p]);if(y)for(p=0;p<y.length;p++)A(y[p],y[++p],y[++p])}function S(e,t,n){if(null==n&&(n=[]),null==e||"boolean"==typeof e)t&&n.push(t(null));else if(Array.isArray(e))for(var r=0;r<e.length;r++)S(e[r],t,n);else n.push(t?t("string"==typeof e||"number"==typeof e?m(null,e,null,null):null!=e.__e||null!=e.__c?m(e.type,e.props,e.key,null):e):e);return n}function O(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]="number"==typeof n&&!1===p.test(t)?n+"px":null==n?"":n}function C(e,t,n,r,o){var i,a,s,c,l;if(o?"className"===t&&(t="class"):"class"===t&&(t="className"),"key"===t||"children"===t);else if("style"===t)if(i=e.style,"string"==typeof n)i.cssText=n;else{if("string"==typeof r&&(i.cssText="",r=null),r)for(a in r)n&&a in n||O(i,a,"");if(n)for(s in n)r&&n[s]===r[s]||O(i,s,n[s])}else"o"===t[0]&&"n"===t[1]?(c=t!==(t=t.replace(/Capture$/,"")),l=t.toLowerCase(),t=(l in e?l:t).slice(2),n?(r||e.addEventListener(t,M,c),(e.l||(e.l={}))[t]=n):e.removeEventListener(t,M,c)):"list"!==t&&"tagName"!==t&&"form"!==t&&"type"!==t&&!o&&t in e?e[t]=null==n?"":n:"function"!=typeof n&&"dangerouslySetInnerHTML"!==t&&(t!==(t=t.replace(/^xlink:?/,""))?null==n||!1===n?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),n):null==n||!1===n?e.removeAttribute(t):e.setAttribute(t,n))}function M(e){this.l[e.type](r.event?r.event(e):e)}function E(e,t,n,o,i,a,s,c,l){var u,p,h,d,m,v,b,w,k,_,O=t.type;if(void 0!==t.constructor)return null;(u=r.__b)&&u(t);try{e:if("function"==typeof O){if(w=t.props,k=(u=O.contextType)&&o[u.__c],_=u?k?k.props.value:u.__:o,n.__c?b=(p=t.__c=n.__c).__=p.__E:("prototype"in O&&O.prototype.render?t.__c=p=new O(w,_):(t.__c=p=new y(w,_),p.constructor=O,p.render=D),k&&k.sub(p),p.props=w,p.state||(p.state={}),p.context=_,p.__n=o,h=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=O.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=f({},p.__s)),f(p.__s,O.getDerivedStateFromProps(w,p.__s))),d=p.props,m=p.state,h)null==O.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==O.getDerivedStateFromProps&&w!==d&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,_),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,_)){for(p.props=w,p.state=p.__s,p.__d=!1,p.__v=t,t.__e=n.__e,t.__k=n.__k,p.__h.length&&s.push(p),u=0;u<t.__k.length;u++)t.__k[u]&&(t.__k[u].__=t);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,_),null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(d,m,v)})}p.context=_,p.props=w,p.state=p.__s,(u=r.__r)&&u(t),p.__d=!1,p.__v=t,p.__P=e,u=p.render(p.props,p.state,p.context),t.__k=S(null!=u&&u.type==g&&null==u.key?u.props.children:u),null!=p.getChildContext&&(o=f(f({},o),p.getChildContext())),h||null==p.getSnapshotBeforeUpdate||(v=p.getSnapshotBeforeUpdate(d,m)),x(e,t,n,o,i,a,s,c,l),p.base=t.__e,p.__h.length&&s.push(p),b&&(p.__E=p.__=null),p.__e=null}else t.__e=T(n.__e,t,n,o,i,a,s,l);(u=r.diffed)&&u(t)}catch(e){r.__e(e,t,n)}return t.__e}function N(e,t){r.__c&&r.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){r.__e(e,t.__v)}})}function T(e,t,n,r,o,i,a,s){var c,p,f,h,d,m=n.props,v=t.props;if(o="svg"===t.type||o,null==e&&null!=i)for(c=0;c<i.length;c++)if(null!=(p=i[c])&&(null===t.type?3===p.nodeType:p.localName===t.type)){e=p,i[c]=null;break}if(null==e){if(null===t.type)return document.createTextNode(v);e=o?document.createElementNS("http://www.w3.org/2000/svg",t.type):document.createElement(t.type),i=null}if(null===t.type)null!=i&&(i[i.indexOf(e)]=null),m!==v&&(e.data=v);else if(t!==n){if(null!=i&&(i=u.slice.call(e.childNodes)),f=(m=n.props||l).dangerouslySetInnerHTML,h=v.dangerouslySetInnerHTML,!s){if(m===l)for(m={},d=0;d<e.attributes.length;d++)m[e.attributes[d].name]=e.attributes[d].value;(h||f)&&(h&&f&&h.__html==f.__html||(e.innerHTML=h&&h.__html||""))}(function(e,t,n,r,o){var i;for(i in n)i in t||C(e,i,null,n[i],r);for(i in t)o&&"function"!=typeof t[i]||"value"===i||"checked"===i||n[i]===t[i]||C(e,i,t[i],n[i],r)})(e,v,m,o,s),t.__k=t.props.children,h||x(e,t,n,r,"foreignObject"!==t.type&&o,i,a,l,s),s||("value"in v&&void 0!==v.value&&v.value!==e.value&&(e.value=null==v.value?"":v.value),"checked"in v&&void 0!==v.checked&&v.checked!==e.checked&&(e.checked=v.checked))}return e}function A(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){r.__e(e,n)}}function P(e,t,n){var o,i,a;if(r.unmount&&r.unmount(e),(o=e.ref)&&A(o,null,t),n||"function"==typeof e.type||(n=null!=(i=e.__e)),e.__e=e.__d=null,null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){r.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(a=0;a<o.length;a++)o[a]&&P(o[a],t,n);null!=i&&h(i)}function D(e,t,n){return this.constructor(e,n)}function z(e,t,n){var o,i,a;r.__&&r.__(e,t),i=(o=n===s)?null:n&&n.__k||t.__k,e=d(g,null,[e]),a=[],E(t,(o?t:n||t).__k=e,i||l,l,void 0!==t.ownerSVGElement,n&&!o?[n]:i?null:u.slice.call(t.childNodes),a,n||l,o),N(a,e)}function j(e){var t={},n={__c:"__cC"+c++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,o=this;return this.getChildContext||(r=[],this.getChildContext=function(){return t[n.__c]=o,t},this.shouldComponentUpdate=function(t){e.value!==t.value&&r.some(function(e){e.context=t.value,k(e)})},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Consumer.contextType=n,n}r={__e:function(e,t){for(var n;t=t.__;)if((n=t.__c)&&!n.__)try{if(n.constructor&&null!=n.constructor.getDerivedStateFromError)n.setState(n.constructor.getDerivedStateFromError(e));else{if(null==n.componentDidCatch)continue;n.componentDidCatch(e)}return k(n.__E=n)}catch(t){e=t}throw e}},y.prototype.setState=function(e,t){var n;n=this.__s!==this.state?this.__s:this.__s=f({},this.state),"function"==typeof e&&(e=e(n,this.props)),e&&f(n,e),null!=e&&this.__v&&(this.__e=!1,t&&this.__h.push(t),k(this))},y.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),k(this))},y.prototype.render=g,o=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=l,c=0;var R,I,B,F=[],$=r.__r,V=r.diffed,L=r.__c,H=r.unmount;function q(e){r.__h&&r.__h(I);var t=I.__H||(I.__H={t:[],u:[]});return e>=t.t.length&&t.t.push({}),t.t[e]}function W(e){return J(ie,e)}function J(e,t,n){var r=q(R++);return r.__c||(r.__c=I,r.i=[n?n(t):ie(void 0,t),function(t){var n=e(r.i[0],t);r.i[0]!==n&&(r.i[0]=n,r.__c.setState({}))}]),r.i}function K(e,t){var n=q(R++);oe(n.o,t)&&(n.i=e,n.o=t,I.__H.u.push(n))}function U(e,t){var n=q(R++);oe(n.o,t)&&(n.i=e,n.o=t,I.__h.push(n))}function Q(e){return Z(function(){return{current:e}},[])}function G(e,t,n){U(function(){"function"==typeof e?e(t()):e&&(e.current=t())},null==n?n:n.concat(e))}function Z(e,t){var n=q(R++);return oe(n.o,t)?(n.o=t,n.v=e,n.i=e()):n.i}function X(e,t){return Z(function(){return e},t)}function Y(e){var t=I.context[e.__c];if(!t)return e.__;var n=q(R++);return null==n.i&&(n.i=!0,t.sub(I)),t.props.value}function ee(e,t){r.useDebugValue&&r.useDebugValue(t?t(e):e)}function te(){F.some(function(e){e.__P&&(e.__H.u.forEach(ne),e.__H.u.forEach(re),e.__H.u=[])}),F=[]}function ne(e){e.m&&e.m()}function re(e){var t=e.i();"function"==typeof t&&(e.m=t)}function oe(e,t){return!e||t.some(function(t,n){return t!==e[n]})}function ie(e,t){return"function"==typeof t?t(e):t}function ae(e,t){for(var n in t)e[n]=t[n];return e}function se(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}r.__r=function(e){$&&$(e),R=0,(I=e.__c).__H&&(I.__H.u.forEach(ne),I.__H.u.forEach(re),I.__H.u=[])},r.diffed=function(e){V&&V(e);var t=e.__c;if(t){var n=t.__H;n&&n.u.length&&(1!==F.push(t)&&B===r.requestAnimationFrame||((B=r.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);"undefined"!=typeof window&&(t=requestAnimationFrame(n))})(te))}},r.__c=function(e,t){t.some(function(e){e.__h.forEach(ne),e.__h=e.__h.filter(function(e){return!e.i||re(e)})}),L&&L(e,t)},r.unmount=function(e){H&&H(e);var t=e.__c;if(t){var n=t.__H;n&&n.t.forEach(function(e){return e.m&&e.m()})}},n.d(t,"version",function(){return Ae}),n.d(t,"Children",function(){return he}),n.d(t,"render",function(){return Ce}),n.d(t,"hydrate",function(){return Ce}),n.d(t,"unmountComponentAtNode",function(){return je}),n.d(t,"createPortal",function(){return xe}),n.d(t,"createFactory",function(){return Pe}),n.d(t,"cloneElement",function(){return ze}),n.d(t,"isValidElement",function(){return De}),n.d(t,"findDOMNode",function(){return Re}),n.d(t,"PureComponent",function(){return ce}),n.d(t,"memo",function(){return le}),n.d(t,"forwardRef",function(){return pe}),n.d(t,"unstable_batchedUpdates",function(){return Ie}),n.d(t,"Suspense",function(){return ve}),n.d(t,"SuspenseList",function(){return be}),n.d(t,"lazy",function(){return ye}),n.d(t,"useState",function(){return W}),n.d(t,"useReducer",function(){return J}),n.d(t,"useEffect",function(){return K}),n.d(t,"useLayoutEffect",function(){return U}),n.d(t,"useRef",function(){return Q}),n.d(t,"useImperativeHandle",function(){return G}),n.d(t,"useMemo",function(){return Z}),n.d(t,"useCallback",function(){return X}),n.d(t,"useContext",function(){return Y}),n.d(t,"useDebugValue",function(){return ee}),n.d(t,"createElement",function(){return d}),n.d(t,"createContext",function(){return j}),n.d(t,"createRef",function(){return v}),n.d(t,"Fragment",function(){return g}),n.d(t,"Component",function(){return y});var ce=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).isPureReactComponent=!0,n}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r.prototype.shouldComponentUpdate=function(e,t){return se(this.props,e)||se(this.state,t)},r}(y);function le(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:se(this.props,e)}function r(t){return this.shouldComponentUpdate=n,d(e,ae({},t))}return r.prototype.isReactComponent=!0,r.displayName="Memo("+(e.displayName||e.name)+")",r.t=!0,r}var ue=r.vnode;function pe(e){function t(t){var n=ae({},t);return delete n.ref,e(n,t.ref)}return t.prototype.isReactComponent=!0,t.t=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}r.vnode=function(e){e.type&&e.type.t&&e.ref&&(e.props.ref=e.ref,e.ref=null),ue&&ue(e)};var fe=function(e,t){return e?S(e).map(t):null},he={map:fe,forEach:fe,count:function(e){return e?S(e).length:0},only:function(e){if(1!==(e=S(e)).length)throw new Error("Children.only() expects only one child.");return e[0]},toArray:S},de=r.__e;function me(e){return e&&((e=ae({},e)).__c=null,e.__k=e.__k&&e.__k.map(me)),e}function ve(e){this.__u=0,this.__b=null}function ge(e){var t=e.__.__c;return t&&t.o&&t.o(e)}function ye(e){var t,n,r;function o(o){if(t||(t=e()).then(function(e){n=e.default},function(e){r=e}),r)throw r;if(!n)throw t;return d(n,o)}return o.displayName="Lazy",o.t=!0,o}function be(){this.u=null,this.i=null}r.__e=function(e,t,n){if(e.then)for(var r,o=t;o=o.__;)if((r=o.__c)&&r.l)return r.l(e,t.__c);de(e,t,n)},(ve.prototype=new y).l=function(e,t){var n=this,r=ge(n.__v),o=!1,i=function(){o||(o=!0,r?r(a):a())};t.__c=t.componentWillUnmount,t.componentWillUnmount=function(){i(),t.__c&&t.__c()};var a=function(){--n.__u||(n.__v.__k[0]=n.state.o,n.setState({o:n.__b=null}))};n.__u++||n.setState({o:n.__b=n.__v.__k[0]}),e.then(i,i)},ve.prototype.render=function(e,t){return this.__b&&(this.__v.__k[0]=me(this.__b),this.__b=null),[d(y,null,t.o?null:e.children),t.o&&e.fallback]};var we=function(e,t,n){if(++n[1]===n[0]&&e.i.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.i.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};(be.prototype=new y).o=function(e){var t=this,n=ge(t.__v),r=t.i.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),we(t,e,r)):o()};n?n(i):i()}},be.prototype.render=function(e){this.u=null,this.i=new Map;var t=S(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.i.set(t[n],this.u=[1,0,this.u]);return e.children},be.prototype.componentDidUpdate=be.prototype.componentDidMount=function(){var e=this;e.i.forEach(function(t,n){we(e,n,t)})};var ke=function(){function e(){}var t=e.prototype;return t.getChildContext=function(){return this.props.context},t.render=function(e){return e.children},e}();function _e(e){var t=this,n=e.container,r=d(ke,{context:t.context},e.vnode);return t.s&&t.s!==n&&(t.h.parentNode&&t.s.removeChild(t.h),P(t.v),t.p=!1),e.vnode?t.p?(n.__k=t.__k,z(r,n),t.__k=n.__k):(t.h=document.createTextNode(""),function(e,t){z(e,t,s)}("",n),n.appendChild(t.h),t.p=!0,t.s=n,z(r,n,t.h),t.__k=this.h.__k):t.p&&(t.h.parentNode&&t.s.removeChild(t.h),P(t.v)),t.v=r,t.componentWillUnmount=function(){t.h.parentNode&&t.s.removeChild(t.h),P(t.v)},null}function xe(e,t){return d(_e,{vnode:e,container:t})}var Se=/^(?:accent|alignment|arabic|baseline|cap|clip|color|fill|flood|font|glyph|horiz|marker|overline|paint|stop|strikethrough|stroke|text|underline|unicode|units|v|vector|vert|word|writing|x)[A-Z]/;y.prototype.isReactComponent={};var Oe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;function Ce(e,t,n){if(null==t.__k)for(;t.firstChild;)t.removeChild(t.firstChild);return z(e,t),"function"==typeof n&&n(),e?e.__c:null}var Me=r.event;function Ee(e,t){e["UNSAFE_"+t]&&!e[t]&&Object.defineProperty(e,t,{configurable:!1,get:function(){return this["UNSAFE_"+t]},set:function(e){this["UNSAFE_"+t]=e}})}r.event=function(e){return Me&&(e=Me(e)),e.persist=function(){},e.nativeEvent=e};var Ne={configurable:!0,get:function(){return this.class}},Te=r.vnode;r.vnode=function(e){e.$$typeof=Oe;var t=e.type,n=e.props;if("function"!=typeof t){var r,o,i;for(i in n.defaultValue&&(n.value||0===n.value||(n.value=n.defaultValue),delete n.defaultValue),Array.isArray(n.value)&&n.multiple&&"select"===t&&(S(n.children).forEach(function(e){-1!=n.value.indexOf(e.props.value)&&(e.props.selected=!0)}),delete n.value),n)if(r=Se.test(i))break;if(r)for(i in o=e.props={},n)o[Se.test(i)?i.replace(/([A-Z0-9])/,"-$1").toLowerCase():i]=n[i]}(n.class||n.className)&&(Ne.enumerable="className"in n,n.className&&(n.class=n.className),Object.defineProperty(n,"className",Ne)),function(t){var n=e.type,r=e.props;if(r&&"string"==typeof n){var o={};for(var i in r)/^on(Ani|Tra|Tou)/.test(i)&&(r[i.toLowerCase()]=r[i],delete r[i]),o[i.toLowerCase()]=i;if(o.ondoubleclick&&(r.ondblclick=r[o.ondoubleclick],delete r[o.ondoubleclick]),o.onbeforeinput&&(r.onbeforeinput=r[o.onbeforeinput],delete r[o.onbeforeinput]),o.onchange&&("textarea"===n||"input"===n.toLowerCase()&&!/^fil|che|ra/i.test(r.type))){var a=o.oninput||"oninput";r[a]||(r[a]=r[o.onchange],delete r[o.onchange])}}}(),"function"==typeof t&&!t.m&&t.prototype&&(Ee(t.prototype,"componentWillMount"),Ee(t.prototype,"componentWillReceiveProps"),Ee(t.prototype,"componentWillUpdate"),t.m=!0),Te&&Te(e)};var Ae="16.8.0";function Pe(e){return d.bind(null,e)}function De(e){return!!e&&e.$$typeof===Oe}function ze(e){return De(e)?function(e,t){return t=f(f({},e.props),t),arguments.length>2&&(t.children=u.slice.call(arguments,2)),m(e.type,t,t.key||e.key,t.ref||e.ref)}.apply(null,arguments):e}function je(e){return!!e.__k&&(z(null,e),!0)}function Re(e){return e&&(e.base||1===e.nodeType&&e)||null}var Ie=function(e,t){return e(t)};t.default={useState:W,useReducer:J,useEffect:K,useLayoutEffect:U,useRef:Q,useImperativeHandle:G,useMemo:Z,useCallback:X,useContext:Y,useDebugValue:ee,version:"16.8.0",Children:he,render:Ce,hydrate:Ce,unmountComponentAtNode:je,createPortal:xe,createElement:d,createContext:j,createFactory:Pe,cloneElement:ze,createRef:v,Fragment:g,isValidElement:De,findDOMNode:Re,Component:y,PureComponent:ce,memo:le,forwardRef:pe,unstable_batchedUpdates:Ie,Suspense:ve,SuspenseList:be,lazy:ye}},function(e,t,n){"use strict";function r(e){this.content=e}n.r(t),r.prototype={constructor:r,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var o=n&&n!=e?this.remove(n):this,i=o.find(e),a=o.content.slice();return-1==i?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new r(a)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new r(n)},addToStart:function(e,t){return new r([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new r(n)},addBefore:function(e,t,n){var o=this.remove(t),i=o.content.slice(),a=o.find(e);return i.splice(-1==a?i.length:a,0,t,n),new r(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=r.from(e)).size?new r(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=r.from(e)).size?new r(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=r.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},r.from=function(e){if(e instanceof r)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new r(t)};var o=r;n.d(t,"ContentMatch",function(){return D}),n.d(t,"DOMParser",function(){return ee}),n.d(t,"DOMSerializer",function(){return fe}),n.d(t,"Fragment",function(){return i}),n.d(t,"Mark",function(){return u}),n.d(t,"MarkType",function(){return Z}),n.d(t,"Node",function(){return N}),n.d(t,"NodeRange",function(){return C}),n.d(t,"NodeType",function(){return K}),n.d(t,"ReplaceError",function(){return p}),n.d(t,"ResolvedPos",function(){return k}),n.d(t,"Schema",function(){return X}),n.d(t,"Slice",function(){return f});var i=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var n=0;n<e.length;n++)this.size+=e[n].nodeSize},a={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};i.prototype.nodesBetween=function(e,t,n,r,o){void 0===r&&(r=0);for(var i=0,a=0;a<t;i++){var s=this.content[i],c=a+s.nodeSize;if(c>e&&!1!==n(s,r+a,o,i)&&s.content.size){var l=a+1;s.nodesBetween(Math.max(0,e-l),Math.min(s.content.size,t-l),n,r+l)}a=c}},i.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},i.prototype.textBetween=function(e,t,n,r){var o="",i=!0;return this.nodesBetween(e,t,function(a,s){a.isText?(o+=a.text.slice(Math.max(e,s)-s,t-s),i=!n):a.isLeaf&&r?(o+=r,i=!n):!i&&a.isBlock&&(o+=n,i=!0)},0),o},i.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new i(r,this.size+e.size)},i.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var n=[],r=0;if(t>e)for(var o=0,a=0;a<t;o++){var s=this.content[o],c=a+s.nodeSize;c>e&&((a<e||c>t)&&(s=s.isText?s.cut(Math.max(0,e-a),Math.min(s.text.length,t-a)):s.cut(Math.max(0,e-a-1),Math.min(s.content.size,t-a-1))),n.push(s),r+=s.nodeSize),a=c}return new i(n,r)},i.prototype.cutByIndex=function(e,t){return e==t?i.empty:0==e&&t==this.content.length?this:new i(this.content.slice(e,t))},i.prototype.replaceChild=function(e,t){var n=this.content[e];if(n==t)return this;var r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new i(r,o)},i.prototype.addToStart=function(e){return new i([e].concat(this.content),this.size+e.nodeSize)},i.prototype.addToEnd=function(e){return new i(this.content.concat(e),this.size+e.nodeSize)},i.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0},a.firstChild.get=function(){return this.content.length?this.content[0]:null},a.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},a.childCount.get=function(){return this.content.length},i.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},i.prototype.maybeChild=function(e){return this.content[e]},i.prototype.forEach=function(e){for(var t=0,n=0;t<this.content.length;t++){var r=this.content[t];e(r,n,t),n+=r.nodeSize}},i.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,n,r){for(var o=0;;o++){if(o==t.childCount||o==n.childCount)return t.childCount==n.childCount?null:r;var i=t.child(o),a=n.child(o);if(i!=a){if(!i.sameMarkup(a))return r;if(i.isText&&i.text!=a.text){for(var s=0;i.text[s]==a.text[s];s++)r++;return r}if(i.content.size||a.content.size){var c=e(i.content,a.content,r+1);if(null!=c)return c}r+=i.nodeSize}else r+=i.nodeSize}}(this,e,t)},i.prototype.findDiffEnd=function(e,t,n){return void 0===t&&(t=this.size),void 0===n&&(n=e.size),function e(t,n,r,o){for(var i=t.childCount,a=n.childCount;;){if(0==i||0==a)return i==a?null:{a:r,b:o};var s=t.child(--i),c=n.child(--a),l=s.nodeSize;if(s!=c){if(!s.sameMarkup(c))return{a:r,b:o};if(s.isText&&s.text!=c.text){for(var u=0,p=Math.min(s.text.length,c.text.length);u<p&&s.text[s.text.length-u-1]==c.text[c.text.length-u-1];)u++,r--,o--;return{a:r,b:o}}if(s.content.size||c.content.size){var f=e(s.content,c.content,r-1,o-1);if(f)return f}r-=l,o-=l}else r-=l,o-=l}}(this,e,t,n)},i.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return c(0,e);if(e==this.size)return c(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=e)return o==e||t>0?c(n+1,o):c(n,r);r=o}},i.prototype.toString=function(){return"<"+this.toStringInner()+">"},i.prototype.toStringInner=function(){return this.content.join(", ")},i.prototype.toJSON=function(){return this.content.length?this.content.map(function(e){return e.toJSON()}):null},i.fromJSON=function(e,t){if(!t)return i.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new i(t.map(e.nodeFromJSON))},i.fromArray=function(e){if(!e.length)return i.empty;for(var t,n=0,r=0;r<e.length;r++){var o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new i(t||e,n)},i.from=function(e){if(!e)return i.empty;if(e instanceof i)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new i([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(i.prototype,a);var s={index:0,offset:0};function c(e,t){return s.index=e,s.offset=t,s}function l(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(!l(e[r],t[r]))return!1}else{for(var o in e)if(!(o in t&&l(e[o],t[o])))return!1;for(var i in t)if(!(i in e))return!1}return!0}i.empty=new i([],0);var u=function(e,t){this.type=e,this.attrs=t};function p(e){var t=Error.call(this,e);return t.__proto__=p.prototype,t}u.prototype.addToSet=function(e){for(var t,n=!1,r=0;r<e.length;r++){var o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t},u.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e},u.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},u.prototype.eq=function(e){return this==e||this.type==e.type&&l(this.attrs,e.attrs)},u.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},u.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type "+t.type+" in this schema");return n.create(t.attrs)},u.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0},u.setFrom=function(e){if(!e||0==e.length)return u.none;if(e instanceof u)return[e];var t=e.slice();return t.sort(function(e,t){return e.type.rank-t.type.rank}),t},u.none=[],p.prototype=Object.create(Error.prototype),p.prototype.constructor=p,p.prototype.name="ReplaceError";var f=function(e,t,n){this.content=e,this.openStart=t,this.openEnd=n},h={size:{configurable:!0}};function d(e,t,n){if(n.openStart>e.depth)throw new p("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new p("Inconsistent open depths");return function e(t,n,r,o){var a=t.index(o),s=t.node(o);if(a==n.index(o)&&o<t.depth-r.openStart){var c=e(t,n,r,o+1);return s.copy(s.content.replaceChild(a,c))}if(r.content.size){if(r.openStart||r.openEnd||t.depth!=o||n.depth!=o){var l=function(e,t){for(var n=t.depth-e.openStart,r=t.node(n).copy(e.content),o=n-1;o>=0;o--)r=t.node(o).copy(i.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t),u=l.start,p=l.end;return b(s,function e(t,n,r,o,a){var s=t.depth>a&&v(t,n,a+1);var c=o.depth>a&&v(r,o,a+1);var l=[];y(null,t,a,l);s&&c&&n.index(a)==r.index(a)?(m(s,c),g(b(s,e(t,n,r,o,a+1)),l)):(s&&g(b(s,w(t,n,a+1)),l),y(n,r,a,l),c&&g(b(c,w(r,o,a+1)),l));y(o,null,a,l);return new i(l)}(t,u,p,n,o))}var f=t.parent,h=f.content;return b(f,h.cut(0,t.parentOffset).append(r.content).append(h.cut(n.parentOffset)))}return b(s,w(t,n,o))}(e,t,n,0)}function m(e,t){if(!t.type.compatibleContent(e.type))throw new p("Cannot join "+t.type.name+" onto "+e.type.name)}function v(e,t,n){var r=e.node(n);return m(r,t.node(n)),r}function g(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function y(e,t,n,r){var o=(t||e).node(n),i=0,a=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(g(e.nodeAfter,r),i++));for(var s=i;s<a;s++)g(o.child(s),r);t&&t.depth==n&&t.textOffset&&g(t.nodeBefore,r)}function b(e,t){if(!e.type.validContent(t))throw new p("Invalid content for node "+e.type.name);return e.copy(t)}function w(e,t,n){var r=[];(y(null,e,n,r),e.depth>n)&&g(b(v(e,t,n+1),w(e,t,n+1)),r);return y(t,null,n,r),new i(r)}h.size.get=function(){return this.content.size-this.openStart-this.openEnd},f.prototype.insertAt=function(e,t){var n=function e(t,n,r,o){var i=t.findIndex(n);var a=i.index;var s=i.offset;var c=t.maybeChild(a);if(s==n||c.isText)return o&&!o.canReplace(a,a,r)?null:t.cut(0,n).append(r).append(t.cut(n));var l=e(c.content,n-s-1,r);return l&&t.replaceChild(a,c.copy(l))}(this.content,e+this.openStart,t,null);return n&&new f(n,this.openStart,this.openEnd)},f.prototype.removeBetween=function(e,t){return new f(function e(t,n,r){var o=t.findIndex(n);var i=o.index;var a=o.offset;var s=t.maybeChild(i);var c=t.findIndex(r);var l=c.index;var u=c.offset;if(a==n||s.isText){if(u!=r&&!t.child(l).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=l)throw new RangeError("Removing non-flat range");return t.replaceChild(i,s.copy(e(s.content,n-a-1,r-a-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},f.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},f.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},f.prototype.toJSON=function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e},f.fromJSON=function(e,t){if(!t)return f.empty;var n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new f(i.fromJSON(e,t.content),t.openStart||0,t.openEnd||0)},f.maxOpen=function(e,t){void 0===t&&(t=!0);for(var n=0,r=0,o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)r++;return new f(e,n,r)},Object.defineProperties(f.prototype,h),f.empty=new f(i.empty,0,0);var k=function(e,t,n){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=n},_={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};k.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},_.parent.get=function(){return this.node(this.depth)},_.doc.get=function(){return this.node(0)},k.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},k.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},k.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},k.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},k.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},k.prototype.before=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]},k.prototype.after=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize},_.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},_.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r},_.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)},k.prototype.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return u.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){var o=n;n=r,r=o}for(var i=n.marks,a=0;a<i.length;a++)!1!==i[a].type.spec.inclusive||r&&i[a].isInSet(r.marks)||(i=i[a--].removeFromSet(i));return i},k.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,r=e.parent.maybeChild(e.index()),o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n},k.prototype.sharedDepth=function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0},k.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new C(this,e,n)},k.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},k.prototype.max=function(e){return e.pos>this.pos?e:this},k.prototype.min=function(e){return e.pos<this.pos?e:this},k.prototype.toString=function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset},k.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var n=[],r=0,o=t,i=e;;){var a=i.content.findIndex(o),s=a.index,c=a.offset,l=o-c;if(n.push(i,s,r+c),!l)break;if((i=i.child(s)).isText)break;o=l-1,r+=c+1}return new k(t,n,o)},k.resolveCached=function(e,t){for(var n=0;n<x.length;n++){var r=x[n];if(r.pos==t&&r.doc==e)return r}var o=x[S]=k.resolve(e,t);return S=(S+1)%O,o},Object.defineProperties(k.prototype,_);var x=[],S=0,O=12,C=function(e,t,n){this.$from=e,this.$to=t,this.depth=n},M={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};M.start.get=function(){return this.$from.before(this.depth+1)},M.end.get=function(){return this.$to.after(this.depth+1)},M.parent.get=function(){return this.$from.node(this.depth)},M.startIndex.get=function(){return this.$from.index(this.depth)},M.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(C.prototype,M);var E=Object.create(null),N=function(e,t,n,r){this.type=e,this.attrs=t,this.content=n||i.empty,this.marks=r||u.none},T={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};T.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},T.childCount.get=function(){return this.content.childCount},N.prototype.child=function(e){return this.content.child(e)},N.prototype.maybeChild=function(e){return this.content.maybeChild(e)},N.prototype.forEach=function(e){this.content.forEach(e)},N.prototype.nodesBetween=function(e,t,n,r){void 0===r&&(r=0),this.content.nodesBetween(e,t,n,r,this)},N.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},T.textContent.get=function(){return this.textBetween(0,this.content.size,"")},N.prototype.textBetween=function(e,t,n,r){return this.content.textBetween(e,t,n,r)},T.firstChild.get=function(){return this.content.firstChild},T.lastChild.get=function(){return this.content.lastChild},N.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},N.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},N.prototype.hasMarkup=function(e,t,n){return this.type==e&&l(this.attrs,t||e.defaultAttrs||E)&&u.sameSet(this.marks,n||u.none)},N.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},N.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},N.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},N.prototype.slice=function(e,t,n){if(void 0===t&&(t=this.content.size),void 0===n&&(n=!1),e==t)return f.empty;var r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),a=r.start(i),s=r.node(i).content.cut(r.pos-a,o.pos-a);return new f(s,r.depth-i,o.depth-i)},N.prototype.replace=function(e,t,n){return d(this.resolve(e),this.resolve(t),n)},N.prototype.nodeAt=function(e){for(var t=this;;){var n=t.content.findIndex(e),r=n.index,o=n.offset;if(!(t=t.maybeChild(r)))return null;if(o==e||t.isText)return t;e-=o+1}},N.prototype.childAfter=function(e){var t=this.content.findIndex(e),n=t.index,r=t.offset;return{node:this.content.maybeChild(n),index:n,offset:r}},N.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,r=t.offset;if(r<e)return{node:this.content.child(n),index:n,offset:r};var o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}},N.prototype.resolve=function(e){return k.resolveCached(this,e)},N.prototype.resolveNoCache=function(e){return k.resolve(this,e)},N.prototype.rangeHasMark=function(e,t,n){var r=!1;return t>e&&this.nodesBetween(e,t,function(e){return n.isInSet(e.marks)&&(r=!0),!r}),r},T.isBlock.get=function(){return this.type.isBlock},T.isTextblock.get=function(){return this.type.isTextblock},T.inlineContent.get=function(){return this.type.inlineContent},T.isInline.get=function(){return this.type.isInline},T.isText.get=function(){return this.type.isText},T.isLeaf.get=function(){return this.type.isLeaf},T.isAtom.get=function(){return this.type.isAtom},N.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),P(this.marks,e)},N.prototype.contentMatchAt=function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t},N.prototype.canReplace=function(e,t,n,r,o){void 0===n&&(n=i.empty),void 0===r&&(r=0),void 0===o&&(o=n.childCount);var a=this.contentMatchAt(e).matchFragment(n,r,o),s=a&&a.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(var c=r;c<o;c++)if(!this.type.allowsMarks(n.child(c).marks))return!1;return!0},N.prototype.canReplaceWith=function(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;var o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd},N.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},N.prototype.defaultContentType=function(e){return this.contentMatchAt(e).defaultType},N.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));this.content.forEach(function(e){return e.check()})},N.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(function(e){return e.toJSON()})),e},N.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}var r=i.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)},Object.defineProperties(N.prototype,T);var A=function(e){function t(t,n,r,o){if(e.call(this,t,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={textContent:{configurable:!0},nodeSize:{configurable:!0}};return t.prototype.toString=function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):P(this.marks,JSON.stringify(this.text))},n.textContent.get=function(){return this.text},t.prototype.textBetween=function(e,t){return this.text.slice(e,t)},n.nodeSize.get=function(){return this.text.length},t.prototype.mark=function(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)},t.prototype.withText=function(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)},t.prototype.cut=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.text.length),0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))},t.prototype.eq=function(e){return this.sameMarkup(e)&&this.text==e.text},t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.text=this.text,t},Object.defineProperties(t.prototype,n),t}(N);function P(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var D=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},z={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};D.parse=function(e,t){var n=new j(e,t);if(null==n.next)return D.empty;var r=I(n);n.next&&n.err("Unexpected trailing text");var o=function(e){var t=Object.create(null);return function n(r){var o=[];r.forEach(function(t){e[t].forEach(function(t){var n=t.term,r=t.to;if(n){var i=o.indexOf(n),a=i>-1&&o[i+1];H(e,r).forEach(function(e){a||o.push(n,a=[]),-1==a.indexOf(e)&&a.push(e)})}})});var i=t[r.join(",")]=new D(r.indexOf(e.length-1)>-1);for(var a=0;a<o.length;a+=2){var s=o[a+1].sort(L);i.next.push(o[a],t[s.join(",")]||n(s))}return i}(H(e,0))}(function(e){var t=[[]];return o(function e(t,i){if("choice"==t.type)return t.exprs.reduce(function(t,n){return t.concat(e(n,i))},[]);if("seq"==t.type)for(var a=0;;a++){var s=e(t.exprs[a],i);if(a==t.exprs.length-1)return s;o(s,i=n())}else{if("star"==t.type){var c=n();return r(i,c),o(e(t.expr,c),c),[r(c)]}if("plus"==t.type){var l=n();return o(e(t.expr,i),l),o(e(t.expr,l),l),[r(l)]}if("opt"==t.type)return[r(i)].concat(e(t.expr,i));if("range"==t.type){for(var u=i,p=0;p<t.min;p++){var f=n();o(e(t.expr,u),f),u=f}if(-1==t.max)o(e(t.expr,u),u);else for(var h=t.min;h<t.max;h++){var d=n();r(u,d),o(e(t.expr,u),d),u=d}return[r(u)]}if("name"==t.type)return[r(i,null,t.value)]}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){var o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach(function(e){return e.to=t})}}(r));return function(e,t){for(var n=0,r=[e];n<r.length;n++){for(var o=r[n],i=!o.validEnd,a=[],s=0;s<o.next.length;s+=2){var c=o.next[s],l=o.next[s+1];a.push(c.name),!i||c.isText||c.hasRequiredAttrs()||(i=!1),-1==r.indexOf(l)&&r.push(l)}i&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position")}}(o,n),o},D.prototype.matchType=function(e){for(var t=0;t<this.next.length;t+=2)if(this.next[t]==e)return this.next[t+1];return null},D.prototype.matchFragment=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.childCount);for(var r=this,o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r},z.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},z.defaultType.get=function(){for(var e=0;e<this.next.length;e+=2){var t=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}},D.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var n=0;n<e.next.length;n+=2)if(this.next[t]==e.next[n])return!0;return!1},D.prototype.fillBefore=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=0);var r=[this];return function o(a,s){var c=a.matchFragment(e,n);if(c&&(!t||c.validEnd))return i.from(s.map(function(e){return e.createAndFill()}));for(var l=0;l<a.next.length;l+=2){var u=a.next[l],p=a.next[l+1];if(!u.isText&&!u.hasRequiredAttrs()&&-1==r.indexOf(p)){r.push(p);var f=o(p,s.concat(u));if(f)return f}}}(this,[])},D.prototype.findWrapping=function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n},D.prototype.computeWrapping=function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),o=r.match;if(o.matchType(e)){for(var i=[],a=r;a.type;a=a.via)i.push(a.type);return i.reverse()}for(var s=0;s<o.next.length;s+=2){var c=o.next[s];c.isLeaf||c.hasRequiredAttrs()||c.name in t||r.type&&!o.next[s+1].validEnd||(n.push({match:c.contentMatch,type:c,via:r}),t[c.name]=!0)}}},z.edgeCount.get=function(){return this.next.length>>1},D.prototype.edge=function(e){var t=e<<1;if(t>=this.next.length)throw new RangeError("There's no "+e+"th edge in this content match");return{type:this.next[t],next:this.next[t+1]}},D.prototype.toString=function(){var e=[];return function t(n){e.push(n);for(var r=1;r<n.next.length;r+=2)-1==e.indexOf(n.next[r])&&t(n.next[r])}(this),e.map(function(t,n){for(var r=n+(t.validEnd?"*":" ")+" ",o=0;o<t.next.length;o+=2)r+=(o?", ":"")+t.next[o].name+"->"+e.indexOf(t.next[o+1]);return r}).join("\n")},Object.defineProperties(D.prototype,z),D.empty=new D(!0);var j=function(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.unshift()},R={next:{configurable:!0}};function I(e){var t=[];do{t.push(B(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function B(e){var t=[];do{t.push(F(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function F(e){for(var t=function(e){if(e.eat("(")){var t=I(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,r=n[t];if(r)return[r];var o=[];for(var i in n){var a=n[i];a.groups.indexOf(t)>-1&&o.push(a)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map(function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}});return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=V(e,t)}return t}function $(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function V(e,t){var n=$(e),r=n;return e.eat(",")&&(r="}"!=e.next?$(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function L(e,t){return t-e}function H(e,t){var n=[];return function t(r){var o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(var i=0;i<o.length;i++){var a=o[i],s=a.term,c=a.to;s||-1!=n.indexOf(c)||t(c)}}(t),n.sort(L)}function q(e){var t=Object.create(null);for(var n in e){var r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function W(e,t){var n=Object.create(null);for(var r in e){var o=t&&t[r];if(void 0===o){var i=e[r];if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=i.default}n[r]=o}return n}function J(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new Q(e[n]);return t}R.next.get=function(){return this.tokens[this.pos]},j.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},j.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(j.prototype,R);var K=function(e,t,n){this.name=e,this.schema=t,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=J(n.attrs),this.defaultAttrs=q(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e},U={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};U.isInline.get=function(){return!this.isBlock},U.isTextblock.get=function(){return this.isBlock&&this.inlineContent},U.isLeaf.get=function(){return this.contentMatch==D.empty},U.isAtom.get=function(){return this.isLeaf||this.spec.atom},K.prototype.hasRequiredAttrs=function(e){for(var t in this.attrs)if(this.attrs[t].isRequired&&(!e||!(t in e)))return!0;return!1},K.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},K.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:W(this.attrs,e)},K.prototype.create=function(e,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new N(this,this.computeAttrs(e),i.from(t),u.setFrom(n))},K.prototype.createChecked=function(e,t,n){if(t=i.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new N(this,this.computeAttrs(e),t,u.setFrom(n))},K.prototype.createAndFill=function(e,t,n){if(e=this.computeAttrs(e),(t=i.from(t)).size){var r=this.contentMatch.fillBefore(t);if(!r)return null;t=r.append(t)}var o=this.contentMatch.matchFragment(t).fillBefore(i.empty,!0);return o?new N(this,e,t.append(o),u.setFrom(n)):null},K.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0},K.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},K.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0},K.prototype.allowedMarks=function(e){if(null==this.markSet)return e;for(var t,n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:u.empty:e},K.compile=function(e,t){var n=Object.create(null);e.forEach(function(e,r){return n[e]=new K(e,t,r)});var r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(K.prototype,U);var Q=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},G={isRequired:{configurable:!0}};G.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(Q.prototype,G);var Z=function(e,t,n,r){this.name=e,this.schema=n,this.spec=r,this.attrs=J(r.attrs),this.rank=t,this.excluded=null;var o=q(this.attrs);this.instance=o&&new u(this,o)};Z.prototype.create=function(e){return!e&&this.instance?this.instance:new u(this,W(this.attrs,e))},Z.compile=function(e,t){var n=Object.create(null),r=0;return e.forEach(function(e,o){return n[e]=new Z(e,r++,t,o)}),n},Z.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e.slice(0,t).concat(e.slice(t+1));return e},Z.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},Z.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var X=function(e){for(var t in this.spec={},e)this.spec[t]=e[t];this.spec.nodes=o.from(e.nodes),this.spec.marks=o.from(e.marks),this.nodes=K.compile(this.spec.nodes,this),this.marks=Z.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var i=this.nodes[r],a=i.spec.content||"",s=i.spec.marks;i.contentMatch=n[a]||(n[a]=D.parse(a,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==s?null:s?Y(this,s.split(" ")):""!=s&&i.inlineContent?null:[]}for(var c in this.marks){var l=this.marks[c],u=l.spec.excludes;l.excluded=null==u?[l]:""==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=Object.create(null),this.cached.wrappings=Object.create(null)};function Y(e,t){for(var n=[],r=0;r<t.length;r++){var o=t[r],i=e.marks[o],a=i;if(i)n.push(i);else for(var s in e.marks){var c=e.marks[s];("_"==o||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}X.prototype.node=function(e,t,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof K))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)},X.prototype.text=function(e,t){var n=this.nodes.text;return new A(n,n.defaultAttrs,e,u.setFrom(t))},X.prototype.mark=function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)},X.prototype.nodeFromJSON=function(e){return N.fromJSON(this,e)},X.prototype.markFromJSON=function(e){return u.fromJSON(this,e)},X.prototype.nodeType=function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t};var ee=function(e,t){var n=this;this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(function(e){e.tag?n.tags.push(e):e.style&&n.styles.push(e)})};ee.prototype.parse=function(e,t){void 0===t&&(t={});var n=new ce(this,t,!1);return n.addAll(e,null,t.from,t.to),n.finish()},ee.prototype.parseSlice=function(e,t){void 0===t&&(t={});var n=new ce(this,t,!0);return n.addAll(e,null,t.from,t.to),f.maxOpen(n.finish())},ee.prototype.matchTag=function(e,t){for(var n=0;n<this.tags.length;n++){var r=this.tags[n];if(ue(e,r.tag)&&(void 0===r.namespace||e.namespaceURI==r.namespace)&&(!r.context||t.matchesContext(r.context))){if(r.getAttrs){var o=r.getAttrs(e);if(!1===o)continue;r.attrs=o}return r}}},ee.prototype.matchStyle=function(e,t,n){for(var r=0;r<this.styles.length;r++){var o=this.styles[r];if(!(0!=o.style.indexOf(e)||o.context&&!n.matchesContext(o.context)||o.style.length>e.length&&(61!=o.style.charCodeAt(e.length)||o.style.slice(e.length+1)!=t))){if(o.getAttrs){var i=o.getAttrs(t);if(!1===i)continue;o.attrs=i}return o}}},ee.schemaRules=function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r<t.length;r++){var o=t[r];if((null==o.priority?50:o.priority)<n)break}t.splice(r,0,e)}var r=function(t){var r=e.marks[t].spec.parseDOM;r&&r.forEach(function(e){n(e=pe(e)),e.mark=t})};for(var o in e.marks)r(o);var i;for(var a in e.nodes)i=void 0,(i=e.nodes[a].spec.parseDOM)&&i.forEach(function(e){n(e=pe(e)),e.node=a});return t},ee.fromSchema=function(e){return e.cached.domParser||(e.cached.domParser=new ee(e,ee.schemaRules(e)))};var te={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},ne={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},re={ol:!0,ul:!0},oe=1,ie=2;function ae(e){return(e?oe:0)|("full"===e?ie:0)}var se=function(e,t,n,r,o,i){this.type=e,this.attrs=t,this.solid=r,this.match=o||(4&i?null:e.contentMatch),this.options=i,this.content=[],this.marks=n,this.activeMarks=u.none};se.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(i.from(e));if(!t){var n,r=this.type.contentMatch;return(n=r.findWrapping(e.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},se.prototype.finish=function(e){if(!(this.options&oe)){var t,n=this.content[this.content.length-1];n&&n.isText&&(t=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length)))}var r=i.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r};var ce=function(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.pendingMarks=[];var r,o=t.topNode,i=ae(t.preserveWhitespace)|(n?4:0);r=o?new se(o.type,o.attrs,u.none,!0,t.topMatch||o.type.contentMatch,i):new se(n?null:e.schema.topNodeType,null,u.none,!0,null,i),this.nodes=[r],this.open=0,this.find=t.findPositions,this.needsBlock=!1},le={top:{configurable:!0},currentPos:{configurable:!0}};function ue(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function pe(e){var t={};for(var n in e)t[n]=e[n];return t}le.top.get=function(){return this.nodes[this.open]},ce.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),n=t?this.readStyles(function(e){var t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(t)):null;if(null!=n)for(var r=0;r<n.length;r++)this.addPendingMark(n[r]);if(this.addElement(e),null!=n)for(var o=0;o<n.length;o++)this.removePendingMark(n[o])}},ce.prototype.addTextNode=function(e){var t=e.nodeValue,n=this.top;if((n.type?n.type.inlineContent:n.content.length&&n.content[0].isInline)||/[^ \t\r\n\u000c]/.test(t)){if(n.options&oe)n.options&ie||(t=t.replace(/\r?\n|\r/g," "));else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],o=e.previousSibling;(!r||o&&"BR"==o.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)},ce.prototype.addElement=function(e){var t=e.nodeName.toLowerCase();re.hasOwnProperty(t)&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var r=1==t.nodeType?t.nodeName.toLowerCase():null;r&&re.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):"li"==r?n=t:r&&(n=null)}}(e);var n=this.options.ruleFromNode&&this.options.ruleFromNode(e)||this.parser.matchTag(e,this);if(n?n.ignore:ne.hasOwnProperty(t))this.findInside(e);else if(!n||n.skip){n&&n.skip.nodeType&&(e=n.skip);var r,o=this.top,i=this.needsBlock;if(te.hasOwnProperty(t))r=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),r&&this.sync(o),this.needsBlock=i}else this.addElementByRule(e,n)},ce.prototype.leafFallback=function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))},ce.prototype.readStyles=function(e){for(var t=u.none,n=0;n<e.length;n+=2){var r=this.parser.matchStyle(e[n],e[n+1],this);if(r){if(r.ignore)return null;t=this.parser.schema.marks[r.mark].create(r.attrs).addToSet(t)}}return t},ce.prototype.addElementByRule=function(e,t){var n,r,o,i=this;t.node?(r=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(r.create(t.attrs))||this.leafFallback(e):n=this.enter(r,t.attrs,t.preserveWhitespace):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));var a=this.top;if(r&&r.isLeaf)this.findInside(e);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(function(e){return i.insertNode(e)});else{var s=t.contentElement;"string"==typeof s?s=e.querySelector(s):"function"==typeof s&&(s=s(e)),s||(s=e),this.findAround(e,s,!0),this.addAll(s,n)}n&&(this.sync(a),this.open--),o&&this.removePendingMark(o)},ce.prototype.addAll=function(e,t,n,r){for(var o=n||0,i=n?e.childNodes[n]:e.firstChild,a=null==r?null:e.childNodes[r];i!=a;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i),t&&te.hasOwnProperty(i.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,o)},ce.prototype.findPlace=function(e){for(var t,n,r=this.open;r>=0;r--){var o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(var a=0;a<t.length;a++)this.enterInner(t[a],null,!1);return!0},ce.prototype.insertNode=function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var n=this.top;this.applyPendingMarks(n),n.match&&(n.match=n.match.matchType(e.type));for(var r=n.activeMarks,o=0;o<e.marks.length;o++)n.type&&!n.type.allowsMarkType(e.marks[o].type)||(r=e.marks[o].addToSet(r));return n.content.push(e.mark(r)),!0}return!1},ce.prototype.applyPendingMarks=function(e){for(var t=0;t<this.pendingMarks.length;t++){var n=this.pendingMarks[t];e.type&&!e.type.allowsMarkType(n.type)||n.isInSet(e.activeMarks)||(e.activeMarks=n.addToSet(e.activeMarks),this.pendingMarks.splice(t--,1))}},ce.prototype.enter=function(e,t,n){var r=this.findPlace(e.create(t));return r&&(this.applyPendingMarks(this.top),this.enterInner(e,t,!0,n)),r},ce.prototype.enterInner=function(e,t,n,r){this.closeExtra();var o=this.top;o.match=o.match&&o.match.matchType(e,t);var i=null==r?-5&o.options:ae(r);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new se(e,t,o.activeMarks,n,null,i)),this.open++},ce.prototype.closeExtra=function(e){var t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}},ce.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},ce.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},ce.prototype.addPendingMark=function(e){this.pendingMarks.push(e)},ce.prototype.removePendingMark=function(e){var t=this.pendingMarks.lastIndexOf(e);if(t>-1)this.pendingMarks.splice(t,1);else{var n=this.top;n.activeMarks=e.removeFromSet(n.activeMarks)}},le.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,r=n.length-1;r>=0;r--)e+=n[r].nodeSize;t&&e++}return e},ce.prototype.findAtPoint=function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)},ce.prototype.findInside=function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)},ce.prototype.findAround=function(e,t,n){if(e!=t&&this.find)for(var r=0;r<this.find.length;r++){if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node))t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}},ce.prototype.findInText=function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))},ce.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),a=function(e,s){for(;e>=0;e--){var c=n[e];if(""==c){if(e==n.length-1||0==e)continue;for(;s>=i;s--)if(a(e-1,s))return!0;return!1}var l=s>0||0==s&&o?t.nodes[s].type:r&&s>=i?r.node(s-i).type:null;if(!l||l.name!=c&&-1==l.groups.indexOf(c))return!1;s--}return!0};return a(n.length-1,this.open)},ce.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},Object.defineProperties(ce.prototype,le);var fe=function(e,t){this.nodes=e||{},this.marks=t||{}};function he(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function de(e){return e.document||window.document}fe.prototype.serializeFragment=function(e,t,n){var r=this;void 0===t&&(t={}),n||(n=de(t).createDocumentFragment());var o=n,i=null;return e.forEach(function(e){if(i||e.marks.length){i||(i=[]);for(var n=0,a=0;n<i.length&&a<e.marks.length;){var s=e.marks[a];if(r.marks[s.type.name]){if(!s.eq(i[n])||!1===s.type.spec.spanning)break;n+=2,a++}else a++}for(;n<i.length;)o=i.pop(),i.pop();for(;a<e.marks.length;){var c=e.marks[a++],l=r.serializeMark(c,e.isInline,t);l&&(i.push(c,o),o.appendChild(l.dom),o=l.contentDOM||l.dom)}}o.appendChild(r.serializeNode(e,t))}),n},fe.prototype.serializeNode=function(e,t){void 0===t&&(t={});var n=fe.renderSpec(de(t),this.nodes[e.type.name](e)),r=n.dom,o=n.contentDOM;if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");t.onContent?t.onContent(e,o,t):this.serializeFragment(e.content,t,o)}return r},fe.prototype.serializeNodeAndMarks=function(e,t){void 0===t&&(t={});for(var n=this.serializeNode(e,t),r=e.marks.length-1;r>=0;r--){var o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},fe.prototype.serializeMark=function(e,t,n){void 0===n&&(n={});var r=this.marks[e.type.name];return r&&fe.renderSpec(de(n),r(e,t))},fe.renderSpec=function(e,t){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};var n=e.createElement(t[0]),r=null,o=t[1],i=1;if(o&&"object"==typeof o&&null==o.nodeType&&!Array.isArray(o))for(var a in i=2,o)null!=o[a]&&n.setAttribute(a,o[a]);for(var s=i;s<t.length;s++){var c=t[s];if(0===c){if(s<t.length-1||s>i)throw new RangeError("Content hole must be the only child of its parent node");return{dom:n,contentDOM:n}}var l=fe.renderSpec(e,c),u=l.dom,p=l.contentDOM;if(n.appendChild(u),p){if(r)throw new RangeError("Multiple content holes");r=p}}return{dom:n,contentDOM:r}},fe.fromSchema=function(e){return e.cached.domSerializer||(e.cached.domSerializer=new fe(this.nodesFromSchema(e),this.marksFromSchema(e)))},fe.nodesFromSchema=function(e){var t=he(e.nodes);return t.text||(t.text=function(e){return e.text}),t},fe.marksFromSchema=function(e){return he(e.marks)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(3),i=Object.create(null),a=function(e,t,n){this.ranges=n||[new c(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},s={anchor:{},head:{},from:{},to:{},$from:{},$to:{},empty:{}};s.anchor.get=function(){return this.$anchor.pos},s.head.get=function(){return this.$head.pos},s.from.get=function(){return this.$from.pos},s.to.get=function(){return this.$to.pos},s.$from.get=function(){return this.ranges[0].$from},s.$to.get=function(){return this.ranges[0].$to},s.empty.get=function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0},a.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},a.prototype.replace=function(e,t){void 0===t&&(t=r.Slice.empty);for(var n=t.content.lastChild,o=null,i=0;i<t.openEnd;i++)o=n,n=n.lastChild;for(var a=e.steps.length,s=this.ranges,c=0;c<s.length;c++){var l=s[c],u=l.$from,p=l.$to,f=e.mapping.slice(a);e.replaceRange(f.map(u.pos),f.map(p.pos),c?r.Slice.empty:t),0==c&&v(e,a,(n?n.isInline:o&&o.isTextblock)?-1:1)}},a.prototype.replaceWith=function(e,t){for(var n=e.steps.length,r=this.ranges,o=0;o<r.length;o++){var i=r[o],a=i.$from,s=i.$to,c=e.mapping.slice(n),l=c.map(a.pos),u=c.map(s.pos);o?e.deleteRange(l,u):(e.replaceRangeWith(l,u,t),v(e,n,t.isInline?-1:1))}},a.findFrom=function(e,t,n){var r=e.parent.inlineContent?new l(e):m(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(var o=e.depth-1;o>=0;o--){var i=t<0?m(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):m(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(i)return i}},a.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new h(e.node(0))},a.atStart=function(e){return m(e,e,0,0,1)||new h(e)},a.atEnd=function(e){return m(e,e,e.content.size,e.childCount,-1)||new h(e)},a.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=i[t.type];if(!n)throw new RangeError("No selection type "+t.type+" defined");return n.fromJSON(e,t)},a.jsonID=function(e,t){if(e in i)throw new RangeError("Duplicate use of selection JSON ID "+e);return i[e]=t,t.prototype.jsonID=e,t},a.prototype.getBookmark=function(){return l.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(a.prototype,s),a.prototype.visible=!0;var c=function(e,t){this.$from=e,this.$to=t},l=function(e){function t(t,n){void 0===n&&(n=t),e.call(this,t,n)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={$cursor:{}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return e.near(o);var i=n.resolve(r.map(this.anchor));return new t(i.parent.inlineContent?i:o,o)},t.prototype.replace=function(t,n){if(void 0===n&&(n=r.Slice.empty),e.prototype.replace.call(this,t,n),n==r.Slice.empty){var o=this.$from.marksAcross(this.$to);o&&t.ensureMarks(o)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new u(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,t,n){void 0===n&&(n=t);var r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))},t.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var a=e.findFrom(r,o,!0)||e.findFrom(r,-o,!0);if(!a)return e.near(r,o);r=a.$head}return n.parent.inlineContent||(0==i?n=r:(n=(e.findFrom(n,-o,!0)||e.findFrom(n,o,!0)).$anchor).pos<r.pos!=i<0&&(n=r)),new t(n,r)},Object.defineProperties(t.prototype,n),t}(a);a.jsonID("text",l);var u=function(e,t){this.anchor=e,this.head=t};u.prototype.map=function(e){return new u(e.map(this.anchor),e.map(this.head))},u.prototype.resolve=function(e){return l.between(e.resolve(this.anchor),e.resolve(this.head))};var p=function(e){function t(t){var n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);e.call(this,t,r),this.node=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,r){var o=r.mapResult(this.anchor),i=o.deleted,a=o.pos,s=n.resolve(a);return i?e.near(s):new t(s)},t.prototype.content=function(){return new r.Slice(r.Fragment.from(this.node),0,0)},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor},t.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},t.prototype.getBookmark=function(){return new f(this.anchor)},t.fromJSON=function(e,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(n.anchor))},t.create=function(e,t){return new this(e.resolve(t))},t.isSelectable=function(e){return!e.isText&&!1!==e.type.spec.selectable},t}(a);p.prototype.visible=!1,a.jsonID("node",p);var f=function(e){this.anchor=e};f.prototype.map=function(e){var t=e.mapResult(this.anchor),n=t.deleted,r=t.pos;return n?new u(r,r):new f(r)},f.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&p.isSelectable(n)?new p(t):a.near(t)};var h=function(e){function t(t){e.call(this,t.resolve(0),t.resolve(t.content.size))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toJSON=function(){return{type:"all"}},t.fromJSON=function(e){return new t(e)},t.prototype.map=function(e){return new t(e)},t.prototype.eq=function(e){return e instanceof t},t.prototype.getBookmark=function(){return d},t}(a);a.jsonID("all",h);var d={map:function(){return this},resolve:function(e){return new h(e)}};function m(e,t,n,r,o,i){if(t.inlineContent)return l.create(e,n);for(var a=r-(o>0?0:1);o>0?a<t.childCount:a>=0;a+=o){var s=t.child(a);if(s.isAtom){if(!i&&p.isSelectable(s))return p.create(e,n-(o<0?s.nodeSize:0))}else{var c=m(e,s,n+o,o<0?s.childCount:0,o,i);if(c)return c}n+=s.nodeSize*o}}function v(e,t,n){var r=e.steps.length-1;if(!(r<t)){var i,s=e.steps[r];if(s instanceof o.ReplaceStep||s instanceof o.ReplaceAroundStep)e.mapping.maps[r].forEach(function(e,t,n,r){null==i&&(i=r)}),e.setSelection(a.near(e.doc.resolve(i),n))}}var g=function(e){function t(t){e.call(this,t.doc),this.time=Date.now(),this.curSelection=t.selection,this.curSelectionFor=0,this.storedMarks=t.storedMarks,this.updated=0,this.meta=Object.create(null)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={selection:{},selectionSet:{},storedMarksSet:{},isGeneric:{},scrolledIntoView:{}};return n.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},t.prototype.setSelection=function(e){return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},n.selectionSet.get=function(){return(1&this.updated)>0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return r.Mark.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,n){e.prototype.addStep.call(this,t,n),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var n=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.Mark.none))),n.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,n){void 0===n&&(n=t);var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(t);o=n==t?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(a.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},n.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,n),t}(o.Transform);function y(e,t){return t&&e?e.bind(t):e}var b=function(e,t,n){this.name=e,this.init=y(t.init,n),this.apply=y(t.apply,n)},w=[new b("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new b("selection",{init:function(e,t){return e.selection||a.atStart(t.doc)},apply:function(e){return e.selection}}),new b("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new b("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],k=function(e,t){var n=this;this.schema=e,this.fields=w.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach(function(e){if(n.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");n.plugins.push(e),n.pluginsByKey[e.key]=e,e.spec.state&&n.fields.push(new b(e.key,e.spec.state,e))})},_=function(e){this.config=e},x={schema:{},plugins:{},tr:{}};x.schema.get=function(){return this.config.schema},x.plugins.get=function(){return this.config.plugins},_.prototype.apply=function(e){return this.applyTransaction(e).state},_.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=t){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0},_.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),r=null;;){for(var o=!1,i=0;i<this.config.plugins.length;i++){var a=this.config.plugins[i];if(a.spec.appendTransaction){var s=r?r[i].n:0,c=r?r[i].state:this,l=s<t.length&&a.spec.appendTransaction.call(a,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,i)){if(l.setMeta("appendedTransaction",e),!r){r=[];for(var u=0;u<this.config.plugins.length;u++)r.push(u<i?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}},_.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new _(this.config),n=this.config.fields,r=0;r<n.length;r++){var o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}for(var i=0;i<S.length;i++)S[i](this,e,t);return t},x.tr.get=function(){return new g(this)},_.create=function(e){for(var t=new k(e.schema||e.doc.type.schema,e.plugins),n=new _(t),r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n},_.prototype.reconfigure=function(e){for(var t=new k(e.schema||this.schema,e.plugins),n=t.fields,r=new _(t),o=0;o<n.length;o++){var i=n[o].name;r[i]=this.hasOwnProperty(i)?this[i]:n[o].init(e,r)}return r},_.prototype.toJSON=function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(function(e){return e.toJSON()})),e&&"object"==typeof e)for(var n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t},_.fromJSON=function(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var o=new k(e.schema,e.plugins),i=new _(o);return o.fields.forEach(function(o){if("doc"==o.name)i.doc=r.Node.fromJSON(e.schema,t.doc);else if("selection"==o.name)i.selection=a.fromJSON(i.doc,t.selection);else if("storedMarks"==o.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(var s in n){var c=n[s],l=c.spec.state;if(c.key==o.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,s))return void(i[o.name]=l.fromJSON.call(c,e,t[s],i))}i[o.name]=o.init(e,i)}}),i},_.addApplyListener=function(e){S.push(e)},_.removeApplyListener=function(e){var t=S.indexOf(e);t>-1&&S.splice(t,1)},Object.defineProperties(_.prototype,x);var S=[];var O=function(e){this.props={},e.props&&function e(t,n,r){for(var o in t){var i=t[o];i instanceof Function?i=i.bind(n):"handleDOMEvents"==o&&(i=e(i,n,{})),r[o]=i}return r}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:M("plugin")};O.prototype.getState=function(e){return e[this.key]};var C=Object.create(null);function M(e){return e in C?e+"$"+ ++C[e]:(C[e]=0,e+"$")}var E=function(e){void 0===e&&(e="key"),this.key=M(e)};E.prototype.get=function(e){return e.config.pluginsByKey[this.key]},E.prototype.getState=function(e){return e[this.key]},t.Selection=a,t.SelectionRange=c,t.TextSelection=l,t.NodeSelection=p,t.AllSelection=h,t.Transaction=g,t.EditorState=_,t.Plugin=O,t.PluginKey=E},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=65535,i=Math.pow(2,16);function a(e){return e&o}var s=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=null),this.pos=e,this.deleted=t,this.recover=n},c=function(e,t){void 0===t&&(t=!1),this.ranges=e,this.inverted=t};c.prototype.recover=function(e){var t=0,n=a(e);if(!this.inverted)for(var r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(e&o))/i}(e)},c.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},c.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},c.prototype._map=function(e,t,n){for(var r=0,o=this.inverted?2:1,a=this.inverted?1:2,c=0;c<this.ranges.length;c+=3){var l=this.ranges[c]-(this.inverted?r:0);if(l>e)break;var u=this.ranges[c+o],p=this.ranges[c+a],f=l+u;if(e<=f){var h=l+r+((u?e==l?-1:e==f?1:t:t)<0?0:p);if(n)return h;var d=c/3+(e-l)*i;return new s(h,t<0?e!=l:e!=f,d)}r+=p-u}return n?e+r:new s(e+r)},c.prototype.touches=function(e,t){for(var n=0,r=a(t),o=this.inverted?2:1,i=this.inverted?1:2,s=0;s<this.ranges.length;s+=3){var c=this.ranges[s]-(this.inverted?n:0);if(c>e)break;var l=this.ranges[s+o];if(e<=c+l&&s==3*r)return!0;n+=this.ranges[s+i]-l}return!1},c.prototype.forEach=function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r<this.ranges.length;r+=3){var i=this.ranges[r],a=i-(this.inverted?o:0),s=i+(this.inverted?0:o),c=this.ranges[r+t],l=this.ranges[r+n];e(a,a+c,s,s+l),o+=l-c}},c.prototype.invert=function(){return new c(this.ranges,!this.inverted)},c.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},c.offset=function(e){return 0==e?c.empty:new c(e<0?[0,-e,0]:[0,0,e])},c.empty=new c([]);var l=function(e,t,n,r){this.maps=e||[],this.from=n||0,this.to=null==r?this.maps.length:r,this.mirror=t};function u(e){var t=Error.call(this,e);return t.__proto__=u.prototype,t}l.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new l(this.maps,this.mirror,e,t)},l.prototype.copy=function(){return new l(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},l.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},l.prototype.appendMapping=function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:null)}},l.prototype.getMirror=function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]},l.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},l.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:null)}},l.prototype.invert=function(){var e=new l;return e.appendMappingInverted(this),e},l.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e},l.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},l.prototype._map=function(e,t,n){for(var r=!1,o=null,i=this.from;i<this.to;i++){var a=this.maps[i],c=o&&o[i];if(null!=c&&a.touches(e,c))e=a.recover(c);else{var l=a.mapResult(e,t);if(null!=l.recover){var u=this.getMirror(i);if(null!=u&&u>i&&u<this.to){if(l.deleted){i=u,e=this.maps[u].recover(l.recover);continue}(o||(o=Object.create(null)))[u]=l.recover}}l.deleted&&(r=!0),e=l.pos}}return n?e:new s(e,r)},u.prototype=Object.create(Error.prototype),u.prototype.constructor=u,u.prototype.name="TransformError";var p=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new l},f={before:{},docChanged:{}};function h(){throw new Error("Override me")}f.before.get=function(){return this.docs.length?this.docs[0]:this.doc},p.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new u(t.failed);return this},p.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},f.docChanged.get=function(){return this.steps.length>0},p.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(p.prototype,f);var d=Object.create(null),m=function(){};m.prototype.apply=function(e){return h()},m.prototype.getMap=function(){return c.empty},m.prototype.invert=function(e){return h()},m.prototype.map=function(e){return h()},m.prototype.merge=function(e){return null},m.prototype.toJSON=function(){return h()},m.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=d[t.stepType];if(!n)throw new RangeError("No step type "+t.stepType+" defined");return n.fromJSON(e,t)},m.jsonID=function(e,t){if(e in d)throw new RangeError("Duplicate use of step JSON ID "+e);return d[e]=t,t.prototype.jsonID=e,t};var v=function(e,t){this.doc=e,this.failed=t};v.ok=function(e){return new v(e,null)},v.fail=function(e){return new v(null,e)},v.fromReplace=function(e,t,n,o){try{return v.ok(e.replace(t,n,o))}catch(e){if(e instanceof r.ReplaceError)return v.fail(e.message);throw e}};var g=function(e){function t(t,n,r,o){e.call(this),this.from=t,this.to=n,this.slice=r,this.structure=!!o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&b(e,this.from,this.to)?v.fail("Structure replace would overwrite content"):v.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new c([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new t(n.pos,Math.max(n.pos,r.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure!=this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var n=this.slice.size+e.slice.size==0?r.Slice.empty:new r.Slice(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var o=this.slice.size+e.slice.size==0?r.Slice.empty:new r.Slice(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),o,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,r.Slice.fromJSON(e,n.slice),!!n.structure)},t}(m);m.jsonID("replace",g);var y=function(e){function t(t,n,r,o,i,a,s){e.call(this),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=a,this.structure=!!s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(b(e,this.from,this.gapFrom)||b(e,this.gapTo,this.to)))return v.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return v.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?v.fromReplace(e,this.from,this.to,n):v.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new c([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return n.deleted&&r.deleted||o<n.pos||i>r.pos?null:new t(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(n.from,n.to,n.gapFrom,n.gapTo,r.Slice.fromJSON(e,n.slice),n.insert,!!n.structure)},t}(m);function b(e,t,n){for(var r=e.resolve(t),o=n-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var a=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}return!1}function w(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function k(e){return{type:e,attrs:null}}function _(e,t){return e&&t&&!e.isLeaf&&e.canAppend(t)}function x(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var a=r.depth-1;a>=0;a--){var s=r.indexAfter(a);if(r.node(a).canReplaceWith(s,s,n))return r.after(a+1);if(s<r.node(a).childCount)return null}}function S(e,t,n){for(var o=[],i=0;i<e.childCount;i++){var a=e.child(i);a.content.size&&(a=a.copy(S(a.content,t,a))),a.isInline&&(a=t(a,n,i)),o.push(a)}return r.Fragment.fromArray(o)}m.jsonID("replaceAround",y),p.prototype.lift=function(e,t){for(var n=e.$from,o=e.$to,i=e.depth,a=n.before(i+1),s=o.after(i+1),c=a,l=s,u=r.Fragment.empty,p=0,f=i,h=!1;f>t;f--)h||n.index(f)>0?(h=!0,u=r.Fragment.from(n.node(f).copy(u)),p++):c--;for(var d=r.Fragment.empty,m=0,v=i,g=!1;v>t;v--)g||o.after(v+1)<o.end(v)?(g=!0,d=r.Fragment.from(o.node(v).copy(d)),m++):l++;return this.step(new y(c,l,a,s,new r.Slice(u.append(d),p,m),u.size-p,!0))},p.prototype.wrap=function(e,t){for(var n=r.Fragment.empty,o=t.length-1;o>=0;o--)n=r.Fragment.from(t[o].type.create(t[o].attrs,n));var i=e.start,a=e.end;return this.step(new y(i,a,i,a,new r.Slice(n,0,0),t.length,!0))},p.prototype.setBlockType=function(e,t,n,o){var i=this;if(void 0===t&&(t=e),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var a=this.steps.length;return this.doc.nodesBetween(e,t,function(e,t){if(e.isTextblock&&!e.hasMarkup(n,o)&&function(e,t,n){var r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(i.doc,i.mapping.slice(a).map(t),n)){i.clearIncompatible(i.mapping.slice(a).map(t,1),n);var s=i.mapping.slice(a),c=s.map(t,1),l=s.map(t+e.nodeSize,1);return i.step(new y(c,l,c+1,l-1,new r.Slice(r.Fragment.from(n.create(o,null,e.marks)),0,0),1,!0)),!1}}),this},p.prototype.setNodeMarkup=function(e,t,n,o){var i=this.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);var a=t.create(n,null,o||i.marks);if(i.isLeaf)return this.replaceWith(e,e+i.nodeSize,a);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new y(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new r.Slice(r.Fragment.from(a),0,0),1,!0))},p.prototype.split=function(e,t,n){void 0===t&&(t=1);for(var o=this.doc.resolve(e),i=r.Fragment.empty,a=r.Fragment.empty,s=o.depth,c=o.depth-t,l=t-1;s>c;s--,l--){i=r.Fragment.from(o.node(s).copy(i));var u=n&&n[l];a=r.Fragment.from(u?u.type.create(u.attrs,a):o.node(s).copy(a))}return this.step(new g(e,e,new r.Slice(i.append(a),t,t,!0)))},p.prototype.join=function(e,t){void 0===t&&(t=1);var n=new g(e-t,e+t,r.Slice.empty,!0);return this.step(n)};var O=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),o=e.resolve(this.from),i=o.node(o.sharedDepth(this.to)),a=new r.Slice(S(n.content,function(e,n){return n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e},i),n.openStart,n.openEnd);return v.fromReplace(e,this.from,this.to,a)},t.prototype.invert=function(){return new C(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(m);m.jsonID("addMark",O);var C=function(e){function t(t,n,r){e.call(this),this.from=t,this.to=n,this.mark=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),o=new r.Slice(S(n.content,function(e){return e.mark(t.mark.removeFromSet(e.marks))}),n.openStart,n.openEnd);return v.fromReplace(e,this.from,this.to,o)},t.prototype.invert=function(){return new O(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new t(n.pos,r.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(m);function M(e,t,n,o){if(void 0===n&&(n=t),void 0===o&&(o=r.Slice.empty),t==n&&!o.size)return null;var i=e.resolve(t),a=e.resolve(n);if(T(i,a,o))return new g(t,n,o);var s=function(e,t){var n=function e(t,n,o,i){var a=r.Fragment.empty,s=0,c=o[n];if(t.depth>n){var l=e(t,n+1,o,i||c);s=l.openEnd+1,a=r.Fragment.from(t.node(n+1).copy(l.content))}c&&(a=a.append(c.content),s=c.openEnd);i&&(a=a.append(t.node(n).contentMatchAt(t.indexAfter(n)).fillBefore(r.Fragment.empty,!0)),s=0);return{content:a,openEnd:s}}(e,0,t,!1),o=n.content,i=n.openEnd;return new r.Slice(o,e.depth,i||0)}(i,function(e,t){for(var n=new A(e),r=1;t.size&&r<=3;r++)t=n.placeSlice(t.content,t.openStart,t.openEnd,r);for(;n.open.length;)n.closeNode();return n.placed}(i,o)),c=N(i,a,s);if(!c)return null;if(s.size!=c.size&&function(e,t,n){if(!t.parent.isTextblock)return!1;var r,o=n.openEnd?function(e,t){for(var n=1;n<t;n++)e=e.lastChild.content;return e.lastChild}(n.content,n.openEnd):e.node(e.depth-(n.openStart-n.openEnd));if(!o.isTextblock)return!1;for(var i=t.index();i<t.parent.childCount;i++)if(!o.type.allowsMarks(t.parent.child(i).marks))return!1;n.openEnd?r=o.contentMatchAt(o.childCount):(r=o.contentMatchAt(o.childCount),n.size&&(r=r.matchFragment(n.content,n.openStart?1:0)));return(r=r.matchFragment(t.parent.content,t.index()))&&r.validEnd}(i,a,s)){for(var l=a.depth,u=a.after(l);l>1&&u==a.end(--l);)++u;var p=N(i,e.resolve(u),s);if(p)return new y(t,u,n,a.end(),p,s.size)}return c.size||t!=n?new g(t,n,c):null}function E(e,t,n,o,i,a,s){var c,l=e.childCount,u=l-(s>0?1:0),p=a<0?t:n.node(i);c=a<0?p.contentMatchAt(u):1==l&&s>0?p.contentMatchAt(a?n.index(i):n.indexAfter(i)):p.contentMatchAt(n.indexAfter(i)).matchFragment(e,l>0&&a?1:0,u);var f=o.node(i);if(s>0&&i<o.depth){var h=f.content.cutByIndex(o.indexAfter(i)).addToStart(e.lastChild),d=c.fillBefore(h,!0);if(d&&d.size&&a>0&&1==l&&(d=null),d){var m=E(e.lastChild.content,e.lastChild,n,o,i+1,1==l?a-1:-1,s-1);if(m){var v=e.lastChild.copy(m);return d.size?e.cutByIndex(0,l-1).append(d).addToEnd(v):e.replaceChild(l-1,v)}}}s>0&&(c=c.matchType((1==l&&a>0?n.node(i+1):e.lastChild).type));var g=o.index(i);if(g==f.childCount&&!f.type.compatibleContent(t.type))return null;for(var y=c.fillBefore(f.content,!0,g),b=g;y&&b<f.content.childCount;b++)p.type.allowsMarks(f.content.child(b).marks)||(y=null);if(!y)return null;if(s>0){var w=function e(t,n,o,i,a){var s,c=t.content,l=c.childCount;s=a>=0?o.node(i).contentMatchAt(o.indexAfter(i)).matchFragment(c,a>0?1:0,l):t.contentMatchAt(l);if(n>0){var u=e(c.lastChild,n-1,o,i+1,1==l?a-1:-1);c=c.replaceChild(l-1,u)}return t.copy(c.append(s.fillBefore(r.Fragment.empty,!0)))}(e.lastChild,s-1,n,i+1,1==l?a-1:-1);e=e.replaceChild(l-1,w)}return e=e.append(y),o.depth>i&&(e=e.addToEnd(function e(t,n){var r=t.node(n);var o=r.contentMatchAt(0).fillBefore(r.content,!0,t.index(n));t.depth>n&&(o=o.addToEnd(e(t,n+1)));return r.copy(o)}(o,i+1))),e}function N(e,t,n){var o=E(n.content,e.node(0),e,t,0,n.openStart,n.openEnd);return o?function(e,t,n){for(;t>0&&n>0&&1==e.childCount;)e=e.firstChild.content,t--,n--;return new r.Slice(e,t,n)}(o,n.openStart,t.depth):null}function T(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}m.jsonID("removeMark",C),p.prototype.addMark=function(e,t,n){var r=this,o=[],i=[],a=null,s=null;return this.doc.nodesBetween(e,t,function(r,c,l){if(r.isInline){var u=r.marks;if(!n.isInSet(u)&&l.type.allowsMarkType(n.type)){for(var p=Math.max(c,e),f=Math.min(c+r.nodeSize,t),h=n.addToSet(u),d=0;d<u.length;d++)u[d].isInSet(h)||(a&&a.to==p&&a.mark.eq(u[d])?a.to=f:o.push(a=new C(p,f,u[d])));s&&s.to==p?s.to=f:i.push(s=new O(p,f,n))}}}),o.forEach(function(e){return r.step(e)}),i.forEach(function(e){return r.step(e)}),this},p.prototype.removeMark=function(e,t,n){var o=this;void 0===n&&(n=null);var i=[],a=0;return this.doc.nodesBetween(e,t,function(o,s){if(o.isInline){a++;var c=null;if(n instanceof r.MarkType){var l=n.isInSet(o.marks);l&&(c=[l])}else n?n.isInSet(o.marks)&&(c=[n]):c=o.marks;if(c&&c.length)for(var u=Math.min(s+o.nodeSize,t),p=0;p<c.length;p++){for(var f=c[p],h=void 0,d=0;d<i.length;d++){var m=i[d];m.step==a-1&&f.eq(i[d].style)&&(h=m)}h?(h.to=u,h.step=a):i.push({style:f,from:Math.max(s,e),to:u,step:a})}}}),i.forEach(function(e){return o.step(new C(e.from,e.to,e.style))}),this},p.prototype.clearIncompatible=function(e,t,n){void 0===n&&(n=t.contentMatch);for(var o=this.doc.nodeAt(e),i=[],a=e+1,s=0;s<o.childCount;s++){var c=o.child(s),l=a+c.nodeSize,u=n.matchType(c.type,c.attrs);if(u){n=u;for(var p=0;p<c.marks.length;p++)t.allowsMarkType(c.marks[p].type)||this.step(new C(a,l,c.marks[p]))}else i.push(new g(a,l,r.Slice.empty));a=l}if(!n.validEnd){var f=n.fillBefore(r.Fragment.empty,!0);this.replace(a,a,new r.Slice(f,0,0))}for(var h=i.length-1;h>=0;h--)this.step(i[h]);return this},p.prototype.replace=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=r.Slice.empty);var o=M(this.doc,e,t,n);return o&&this.step(o),this},p.prototype.replaceWith=function(e,t,n){return this.replace(e,t,new r.Slice(r.Fragment.from(n),0,0))},p.prototype.delete=function(e,t){return this.replace(e,t,r.Slice.empty)},p.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var A=function(e){this.open=[];for(var t=0;t<=e.depth;t++){var n=e.node(t),o=n.contentMatchAt(e.indexAfter(t));this.open.push({parent:n,match:o,content:r.Fragment.empty,wrapper:!1,openEnd:0,depth:t})}this.placed=[]};function P(e,t,n){var r=e.content;if(t>1){var o=P(e.firstChild,t-1,1==e.childCount?n-1:0);r=e.content.replaceChild(0,o)}var i=e.type.contentMatch.fillBefore(r,0==n);return e.copy(i.append(r))}function D(e,t,n,r,o){if(t<n){var i=e.firstChild;e=e.replaceChild(0,i.copy(D(i.content,t+1,n,r,i)))}return t>r&&(e=o.contentMatchAt(0).fillBefore(e,!0).append(e)),e}function z(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;o==t.start(r)&&n.push(r)}return n}A.prototype.placeSlice=function(e,t,n,o,i){if(t>0){var a=e.firstChild,s=this.placeSlice(a.content,Math.max(0,t-1),n&&1==e.childCount?n-1:0,o,a);s.content!=a.content&&(s.content.size?(e=e.replaceChild(0,a.copy(s.content)),t=s.openStart+1):(1==e.childCount&&(n=0),e=e.cutByIndex(1),t=0))}var c=this.placeContent(e,t,n,o,i);if(o>2&&c.size&&0==t){for(var l=0;l<c.content.childCount;l++){var u=c.content.child(l);this.placeContent(u.content,0,n&&l==c.content.childCount.length-1?n-1:0,o,u)}c=r.Fragment.empty}return c},A.prototype.placeContent=function(e,t,n,o,i){for(var a=0;a<e.childCount;a++){for(var s=e.child(a),c=!1,l=a==e.childCount-1,u=this.open.length-1;u>=0;u--){var p=this.open[u],f=void 0;if(o>1&&(f=p.match.findWrapping(s.type))&&(!i||!f.length||f[f.length-1]!=i.type)){for(;this.open.length-1>u;)this.closeNode();for(var h=0;h<f.length;h++)p.match=p.match.matchType(f[h]),u++,p={parent:f[h].create(),match:f[h].contentMatch,content:r.Fragment.empty,wrapper:!0,openEnd:0,depth:u+h},this.open.push(p)}var d=p.match.matchType(s.type);if(!d){var m=p.match.fillBefore(r.Fragment.from(s));if(!m){if(i&&p.match.matchType(i.type))break;continue}for(var v=0;v<m.childCount;v++){var g=m.child(v);this.addNode(p,g,0),d=p.match.matchFragment(g)}}for(;this.open.length-1>u;)this.closeNode();s=s.mark(p.parent.type.allowedMarks(s.marks)),t&&(s=P(s,t,l?n:0),t=0),this.addNode(p,s,l?n:0),p.match=d,l&&(n=0),c=!0;break}if(!c)break}return this.open.length>1&&(a>0&&a==e.childCount||i&&this.open[this.open.length-1].parent.type==i.type)&&this.closeNode(),new r.Slice(e.cutByIndex(a),t,n)},A.prototype.addNode=function(e,t,n){var o,i;e.content=(o=e.content,i=e.openEnd,i?o.replaceChild(o.childCount-1,function e(t,n){var o=t.content;if(n>1){var i=e(t.lastChild,n-1);o=t.content.replaceChild(t.childCount-1,i)}var a=t.contentMatchAt(t.childCount).fillBefore(r.Fragment.empty,!0);return t.copy(o.append(a))}(o.lastChild,i)):o).addToEnd(t),e.openEnd=n},A.prototype.closeNode=function(){var e=this.open.pop();0==e.content.size||(e.wrapper?this.addNode(this.open[this.open.length-1],e.parent.copy(e.content),e.openEnd+1):this.placed[e.depth]={depth:e.depth,content:e.content,openEnd:e.openEnd})},p.prototype.replaceRange=function(e,t,n){if(!n.size)return this.deleteRange(e,t);var o=this.doc.resolve(e),i=this.doc.resolve(t);if(T(o,i,n))return this.step(new g(e,t,n));var a=z(o,this.doc.resolve(t));0==a[a.length-1]&&a.pop();var s=-(o.depth+1);a.unshift(s);for(var c=o.depth,l=o.pos-1;c>0;c--,l--){var u=o.node(c).type.spec;if(u.defining||u.isolating)break;a.indexOf(c)>-1?s=c:o.before(c)==l&&a.splice(1,0,-c)}for(var p=a.indexOf(s),f=[],h=n.openStart,d=n.content,m=0;;m++){var v=d.firstChild;if(f.push(v),m==n.openStart)break;d=v.content}h>0&&f[h-1].type.spec.defining&&o.node(p).type!=f[h-1].type?h-=1:h>=2&&f[h-1].isTextblock&&f[h-2].type.spec.defining&&o.node(p).type!=f[h-2].type&&(h-=2);for(var y=n.openStart;y>=0;y--){var b=(y+h+1)%(n.openStart+1),w=f[b];if(w)for(var k=0;k<a.length;k++){var _=a[(k+p)%a.length],x=!0;_<0&&(x=!1,_=-_);var S=o.node(_-1),O=o.index(_-1);if(S.canReplaceWith(O,O,w.type,w.marks))return this.replace(o.before(_),x?i.after(_):t,new r.Slice(D(n.content,0,n.openStart,b),b,n.openEnd))}}return this.replace(e,t,n)},p.prototype.replaceRangeWith=function(e,t,n){if(!n.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var o=x(this.doc,e,n.type);null!=o&&(e=t=o)}return this.replaceRange(e,t,new r.Slice(r.Fragment.from(n),0,0))},p.prototype.deleteRange=function(e,t){for(var n=this.doc.resolve(e),r=this.doc.resolve(t),o=z(n,r),i=0;i<o.length;i++){var a=o[i],s=i==o.length-1;if(s&&0==a||n.node(a).type.contentMatch.validEnd)return this.delete(n.start(a),r.end(a));if(a>0&&(s||n.node(a-1).canReplace(n.index(a-1),r.indexAfter(a-1))))return this.delete(n.before(a),r.after(a))}for(var c=1;c<=n.depth;c++)if(e-n.start(c)==n.depth-c&&t>n.end(c))return this.delete(n.before(c),t);return this.delete(e,t)},t.Transform=p,t.TransformError=u,t.Step=m,t.StepResult=v,t.joinPoint=function(e,t,n){void 0===n&&(n=-1);for(var r=e.resolve(t),o=r.depth;;o--){var i=void 0,a=void 0;if(o==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(o+1),a=r.node(o).maybeChild(r.index(o)+1)):(i=r.node(o).maybeChild(r.index(o)-1),a=r.node(o+1)),i&&!i.isTextblock&&_(i,a))return t;if(0==o)break;t=n<0?r.before(o):r.after(o)}},t.canJoin=function(e,t){var n=e.resolve(t),r=n.index();return _(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)},t.canSplit=function(e,t,n,r){void 0===n&&(n=1);var o=e.resolve(t),i=o.depth-n,a=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var s=o.depth-1,c=n-2;s>i;s--,c--){var l=o.node(s),u=o.index(s);if(l.type.spec.isolating)return!1;var p=l.content.cutByIndex(u,l.childCount),f=r&&r[c]||l;if(f!=l&&(p=p.replaceChild(0,f.type.create(f.attrs))),!l.canReplace(u+1,l.childCount)||!f.type.validContent(p))return!1}var h=o.indexAfter(i),d=r&&r[0];return o.node(i).canReplaceWith(h,h,d?d.type:o.node(i+1).type)},t.insertPoint=x,t.dropPoint=function(e,t,n){var r=e.resolve(t);if(!n.content.size)return t;for(var o=n.content,i=0;i<n.openStart;i++)o=o.firstChild.content;for(var a=1;a<=(0==n.openStart&&n.size?2:1);a++)for(var s=r.depth;s>=0;s--){var c=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(c>0?1:0);if(1==a?r.node(s).canReplace(l,l,o):r.node(s).contentMatchAt(l).findWrapping(o.firstChild.type))return 0==c?r.pos:c<0?r.before(s+1):r.after(s+1)}return null},t.liftTarget=function(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(o,i,t))return n;if(0==n||r.type.spec.isolating||!w(r,o,i))break}},t.findWrapping=function(e,t,n,r){void 0===r&&(r=e);var o=function(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;var a=i.length?i[0]:t;return n.canReplaceWith(r,o,a)?i:null}(e,t),i=o&&function(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.child(r),a=t.contentMatch.findWrapping(i.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:t).contentMatch,c=r;s&&c<o;c++)s=s.matchType(n.child(c).type);return s&&s.validEnd?a:null}(r,t);return i?o.map(k).concat({type:t,attrs:n}).concat(i.map(k)):null},t.StepMap=c,t.MapResult=s,t.Mapping=l,t.AddMarkStep=O,t.RemoveMarkStep=C,t.ReplaceStep=g,t.ReplaceAroundStep=y,t.replaceStep=M},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),o=n(1),i=n(3);t.getScrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},t.getScrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},t.getOffset=function(e){var n=e.getBoundingClientRect();return{top:n.top+t.getScrollTop(),left:n.left+t.getScrollLeft()}},t.isInput=function(e){return e.isContentEditable},t.getViewport=function(){if(window.visualViewport&&/Android/.test(navigator.userAgent))return{left:window.visualViewport.pageLeft,top:window.visualViewport.pageTop,width:window.visualViewport.width,height:window.visualViewport.height};var e={left:window.pageXOffset,top:window.pageYOffset,width:window.innerWidth||window.documentElement.clientWidth,height:window.innerHeight||window.documentElement.clientHeight};return/iPod|iPhone|iPad/.test(navigator.platform)&&t.isInput(document.activeElement)?{left:e.left,top:e.top,width:e.width,height:e.height*(e.height>e.width?.66:.45),keyboardHeight:e.height*(e.height>e.width?.34:.55)}:e},t.markActive=function(e){return function(t){var n=t.selection,r=n.from,o=n.$from,i=n.to;return n.empty?e.isInSet(t.storedMarks||o.marks()):t.doc.rangeHasMark(r,i,e)}},t.getMarkInSelection=function(e,t){var n=t.selection.$anchor.nodeAfter;return n?n.marks.find(function(t){if(t.type.name===e)return!0}):null},t.blockActive=function(e){return function(t){var n=t.selection,o=t.selection,i=o.$from,a=o.to,s=n.$anchor,c=t.doc.resolve(s.pos).path[1],l=0,u=r.findChildren(t.doc,function(){return c===l||(l++,!1)},!1)[0];return!!u&&(a<=i.end()&&u.node.type.name===e.name)}},t.canInsert=function(e){return function(t){for(var n=t.selection.$from,r=n.depth;r>=0;r--){var o=n.index(r);if(n.node(r).canReplaceWith(o,o,e))return!0}return!1}},t.findNodePosition=function(e,t){var n=-1;return e.descendants(function(e,r){e.eq(t)&&(n=r)}),n},t.getRootNodeWithPosByIndex=function(e,t){var n=0;return r.findChildren(e.doc,function(){return n===t?(n++,!0):(n++,!1)},!1)[0]},t.getRootNodeCountFromState=function(e){return e.doc.content.childCount},t.getParentNodeWithPosFromState=function(e){var t=e.selection.$anchor,n=e.doc.resolve(t.pos).path[1],o=0;return r.findChildren(e.doc,function(){return n===o?(o++,!0):(o++,!1)},!1)[0]},t.getParentNodeIndexFromState=function(e){var t=e.selection.$anchor;return e.doc.resolve(t.pos).path[1]},t.getParentNodeFromState=function(e){return t.getParentNodeWithPosFromState(e).node},t.getParentNodePosFromState=function(e){var n=t.getParentNodeFromState(e);return t.findNodePosition(e.doc,n)+n.nodeSize},t.findSelectedNodeWithType=function(e,t){var n=t.selection,r=n.from,o=n.to,i=null;return t.doc.nodesBetween(r,o,function(t){t.type===e&&(i=t)}),i},t.liftListItem=function(e){return function(t,n){var r=t.selection,a=r.$from,s=r.$to,c=a.blockRange(s,function(t){return t.childCount&&t.firstChild.type===e});return!!c&&(!n||(a.node(c.depth-1).type===e?function(e,t,n,r){var a=e.tr,s=r.end,c=r.$to.end(r.depth);return s<c&&(a.step(new i.ReplaceAroundStep(s-1,c,s,c,new o.Slice(o.Fragment.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new o.NodeRange(a.doc.resolve(r.$from.pos),a.doc.resolve(c),r.depth)),t(a.lift(r,i.liftTarget(r)-1).scrollIntoView()),!0}(t,n,e,c):function(e,t,n){for(var r=e.tr,a=n.parent,s=n.end,c=n.endIndex-1,l=n.startIndex;c>l;c--)s-=a.child(c).nodeSize,r.delete(s-1,s+1);var u=r.doc.resolve(n.start),p=u.nodeAfter,f=0===n.startIndex,h=n.endIndex===a.childCount,d=u.node(-1),m=u.index(-1);if(!d.canReplace(m+(f?0:1),m+1,p.content.append(h?o.Fragment.empty:o.Fragment.from(a))))return!1;var v=u.pos,g=v+p.nodeSize;return r.step(new i.ReplaceAroundStep(v-(f?1:0),g+(h?1:0),v+1,g-1,new o.Slice((f?o.Fragment.empty:o.Fragment.from(a.copy(o.Fragment.empty))).append(h?o.Fragment.empty:o.Fragment.from(a.copy(o.Fragment.empty))),f?0:1,h?0:1),f?0:1)),t(r.scrollIntoView()),!0}(t,n,c)))}};var a=function(e,t){return void 0===t&&(t=null),t?e.createChecked(null,t):e.createAndFill()};t.createTable=function(e,t,n,r,o,i){void 0===n&&(n=3),void 0===r&&(r=3),void 0===o&&(o=!0),void 0===i&&(i=null);for(var s=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;var t={};return Object.keys(e.nodes).forEach(function(n){var r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}(e),c=s.cell,l=s.header_cell,u=s.row,p=s.table,f=[],h=[],d=0;d<r;d++)f.push(a(c,i)),o&&h.push(a(l,i));var m=[];for(d=0;d<n;d++)m.push(u.createChecked(null,o&&0===d?h:f));return p.createChecked(t,m)},t.calculateStyle=function(e,n){void 0===n&&(n={top:0,left:0});var r=e.state.selection,o=e.domAtPos(r.$anchor.pos),i=o.node instanceof Element?o.node:o.node.parentElement,a=t.getOffset(i).top,s=e.coordsAtPos(r.$anchor.pos),c=t.getOffset(e.dom).top;return window.innerWidth<=767?{left:n.left,top:a-c+n.top}:{left:s.left+n.left,top:a-c+n.top}},t.isDescendant=function(e,t){for(var n=t.parentNode;null!==n;){if(n===e)return!0;n=n.parentNode}return!1};t.stripPtag=function(e){var t=document.createElement("div");t.innerHTML=e;var n=t.querySelectorAll("li > p");return[].forEach.call(n,function(e){!function(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}(e)}),t.innerHTML},t.getHtmlFromNode=function(e,n){var r=o.DOMSerializer.fromSchema(n).serializeFragment(e.content),i=document.createElement("div");return i.appendChild(r),t.stripPtag(i.innerHTML)},t.getBrowser=function(){var e=window.navigator.userAgent.toLowerCase(),t=window.navigator.appVersion.toLowerCase(),n="unknown";return-1!==e.indexOf("msie")?n=-1!==t.indexOf("msie 6.")?"ie6":-1!==t.indexOf("msie 7.")?"ie7":-1!==t.indexOf("msie 8.")?"ie8":-1!==t.indexOf("msie 9.")?"ie9":-1!==t.indexOf("msie 10.")?"ie10":"ie":-1!==e.indexOf("trident/7")?n="ie11":-1!==e.indexOf("edge")?n="edge":-1!==e.indexOf("chrome")?n="chrome":-1!==e.indexOf("safari")?n="safari":-1!==e.indexOf("opera")?n="opera":-1!==e.indexOf("firefox")&&(n="firefox"),n},t.getUniqId=function(){return(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),o=n(1),i=n(2);function a(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)}function s(e,t,n){var o=e.selection.$cursor;if(!o||(n?!n.endOfTextblock("backward",e):o.parentOffset>0))return!1;var a=u(o);if(!a){var s=o.blockRange(),l=s&&r.liftTarget(s);return null!=l&&(t&&t(e.tr.lift(s,l).scrollIntoView()),!0)}var p=a.nodeBefore;if(!p.type.spec.isolating&&w(e,a,t))return!0;if(0==o.parent.content.size&&(c(p,"end")||i.NodeSelection.isSelectable(p))){if(t){var f=e.tr.deleteRange(o.before(),o.after());f.setSelection(c(p,"end")?i.Selection.findFrom(f.doc.resolve(f.mapping.map(a.pos,-1)),-1):i.NodeSelection.create(f.doc,a.pos-p.nodeSize)),t(f.scrollIntoView())}return!0}return!(!p.isAtom||a.depth!=o.depth-1)&&(t&&t(e.tr.delete(a.pos-p.nodeSize,a.pos).scrollIntoView()),!0)}function c(e,t){for(;e;e="start"==t?e.firstChild:e.lastChild)if(e.isTextblock)return!0;return!1}function l(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;var o=u(r),a=o&&o.nodeBefore;return!(!a||!i.NodeSelection.isSelectable(a))&&(t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)}function u(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function p(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;var o=h(r);if(!o)return!1;var a=o.nodeAfter;if(w(e,o,t))return!0;if(0==r.parent.content.size&&(c(a,"start")||i.NodeSelection.isSelectable(a))){if(t){var s=e.tr.deleteRange(r.before(),r.after());s.setSelection(c(a,"start")?i.Selection.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):i.NodeSelection.create(s.doc,s.mapping.map(o.pos))),t(s.scrollIntoView())}return!0}return!(!a.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos,o.pos+a.nodeSize).scrollIntoView()),!0)}function f(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size))return!1;var o=h(r),a=o&&o.nodeAfter;return!(!a||!i.NodeSelection.isSelectable(a))&&(t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,o.pos)).scrollIntoView()),!0)}function h(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function d(e,t){var n=e.selection,r=n.$head,o=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(o))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)}function m(e,t){var n=e.selection,r=n.$head,o=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(o))return!1;var a=r.node(-1),s=r.indexAfter(-1),c=a.contentMatchAt(s).defaultType;if(!a.canReplaceWith(s,s,c))return!1;if(t){var l=r.after(),u=e.tr.replaceWith(l,l,c.createAndFill());u.setSelection(i.Selection.near(u.doc.resolve(l),1)),t(u.scrollIntoView())}return!0}function v(e,t){var n=e.selection,r=n.$from,o=n.$to;if(r.parent.inlineContent||o.parent.inlineContent)return!1;var a=r.parent.contentMatchAt(o.indexAfter()).defaultType;if(!a||!a.isTextblock)return!1;if(t){var s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,c=e.tr.insert(s,a.createAndFill());c.setSelection(i.TextSelection.create(c.doc,s+1)),t(c.scrollIntoView())}return!0}function g(e,t){var n=e.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var o=n.before();if(r.canSplit(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}var i=n.blockRange(),a=i&&r.liftTarget(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)}function y(e,t){var n=e.selection,a=n.$from,s=n.$to;if(e.selection instanceof i.NodeSelection&&e.selection.node.isBlock)return!(!a.parentOffset||!r.canSplit(e.doc,a.pos))&&(t&&t(e.tr.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(t){var c=s.parentOffset==s.parent.content.size,l=e.tr;e.selection instanceof i.TextSelection&&l.deleteSelection();var u=0==a.depth?null:a.node(-1).contentMatchAt(a.indexAfter(-1)).defaultType,p=c&&u?[{type:u}]:null,f=r.canSplit(l.doc,l.mapping.map(a.pos),1,p);p||f||!r.canSplit(l.doc,l.mapping.map(a.pos),1,u&&[{type:u}])||(p=[{type:u}],f=!0),f&&(l.split(l.mapping.map(a.pos),1,p),c||a.parentOffset||a.parent.type==u||!a.node(-1).canReplace(a.index(-1),a.indexAfter(-1),o.Fragment.from(u.create(),a.parent))||l.setNodeMarkup(l.mapping.map(a.before()),u)),t(l.scrollIntoView())}return!0}function b(e,t){return t&&t(e.tr.setSelection(new i.AllSelection(e.doc))),!0}function w(e,t,n){var a,s,c=t.nodeBefore,l=t.nodeAfter;if(c.type.spec.isolating||l.type.spec.isolating)return!1;if(function(e,t,n){var o=t.nodeBefore,i=t.nodeAfter,a=t.index();return!(!(o&&i&&o.type.compatibleContent(i.type))||(!o.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(a,a+1)||!i.isTextblock&&!r.canJoin(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,o.type,o.contentMatchAt(o.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;if(t.parent.canReplace(t.index(),t.index()+1)&&(a=(s=c.contentMatchAt(c.childCount)).findWrapping(l.type))&&s.matchType(a[0]||l.type).validEnd){if(n){for(var u=t.pos+l.nodeSize,p=o.Fragment.empty,f=a.length-1;f>=0;f--)p=o.Fragment.from(a[f].create(null,p));p=o.Fragment.from(c.copy(p));var h=e.tr.step(new r.ReplaceAroundStep(t.pos-1,u,t.pos,u,new o.Slice(p,1,0),a.length,!0)),d=u+2*a.length;r.canJoin(h.doc,d)&&h.join(d),n(h.scrollIntoView())}return!0}var m=i.Selection.findFrom(t,1),v=m&&m.$from.blockRange(m.$to),g=v&&r.liftTarget(v);return null!=g&&g>=t.depth&&(n&&n(e.tr.lift(v,g).scrollIntoView()),!0)}function k(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(t,n,r){for(var o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}var _=k(a,s,l),x=k(a,p,f),S={Enter:k(d,v,g,y),"Mod-Enter":m,Backspace:_,"Mod-Backspace":_,Delete:x,"Mod-Delete":x,"Mod-a":b},O={"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"]};for(var C in S)O[C]=S[C];var M=("undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?O:S;t.deleteSelection=a,t.joinBackward=s,t.selectNodeBackward=l,t.joinForward=p,t.selectNodeForward=f,t.joinUp=function(e,t){var n,o=e.selection,a=o instanceof i.NodeSelection;if(a){if(o.node.isTextblock||!r.canJoin(e.doc,o.from))return!1;n=o.from}else if(null==(n=r.joinPoint(e.doc,o.from,-1)))return!1;if(t){var s=e.tr.join(n);a&&s.setSelection(i.NodeSelection.create(s.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(s.scrollIntoView())}return!0},t.joinDown=function(e,t){var n,o=e.selection;if(o instanceof i.NodeSelection){if(o.node.isTextblock||!r.canJoin(e.doc,o.to))return!1;n=o.to}else if(null==(n=r.joinPoint(e.doc,o.to,1)))return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0},t.lift=function(e,t){var n=e.selection,o=n.$from,i=n.$to,a=o.blockRange(i),s=a&&r.liftTarget(a);return null!=s&&(t&&t(e.tr.lift(a,s).scrollIntoView()),!0)},t.newlineInCode=d,t.exitCode=m,t.createParagraphNear=v,t.liftEmptyBlock=g,t.splitBlock=y,t.splitBlockKeepMarks=function(e,t){return y(e,t&&function(n){var r=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();r&&n.ensureMarks(r),t(n)})},t.selectParentNode=function(e,t){var n,r=e.selection,o=r.$from,a=r.to,s=o.sharedDepth(a);return 0!=s&&(n=o.before(s),t&&t(e.tr.setSelection(i.NodeSelection.create(e.doc,n))),!0)},t.selectAll=b,t.wrapIn=function(e,t){return function(n,o){var i=n.selection,a=i.$from,s=i.$to,c=a.blockRange(s),l=c&&r.findWrapping(c,e,t);return!!l&&(o&&o(n.tr.wrap(c,l).scrollIntoView()),!0)}},t.setBlockType=function(e,t){return function(n,r){var o=n.selection,i=o.from,a=o.to,s=!1;return n.doc.nodesBetween(i,a,function(r,o){if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{var i=n.doc.resolve(o),a=i.index();s=i.parent.canReplaceWith(a,a+1,e)}}),!!s&&(r&&r(n.tr.setBlockType(i,a,e,t).scrollIntoView()),!0)}},t.toggleMark=function(e,t){return function(n,r){var o=n.selection,i=o.empty,a=o.$cursor,s=o.ranges;if(i&&!a||!function(e,t,n){for(var r=function(r){var o=t[r],i=o.$from,a=o.$to,s=0==i.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(i.pos,a.pos,function(e){if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)}),s)return{v:!0}},o=0;o<t.length;o++){var i=r(o);if(i)return i.v}return!1}(n.doc,s,e))return!1;if(r)if(a)e.isInSet(n.storedMarks||a.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{for(var c=!1,l=n.tr,u=0;!c&&u<s.length;u++){var p=s[u],f=p.$from,h=p.$to;c=n.doc.rangeHasMark(f.pos,h.pos,e)}for(var d=0;d<s.length;d++){var m=s[d],v=m.$from,g=m.$to;c?l.removeMark(v.pos,g.pos,e):l.addMark(v.pos,g.pos,e.create(t))}r(l.scrollIntoView())}return!0}},t.autoJoin=function(e,t){if(Array.isArray(t)){var n=t;t=function(e){return n.indexOf(e.type.name)>-1}}return function(n,o){return e(n,o&&function(e,t){return function(n){if(!n.isGeneric)return e(n);for(var o=[],i=0;i<n.mapping.maps.length;i++){for(var a=n.mapping.maps[i],s=0;s<o.length;s++)o[s]=a.map(o[s]);a.forEach(function(e,t,n,r){return o.push(n,r)})}for(var c=[],l=0;l<o.length;l+=2)for(var u=o[l],p=o[l+1],f=n.doc.resolve(u),h=f.sharedDepth(p),d=f.node(h),m=f.indexAfter(h),v=f.after(h+1);v<=p;++m){var g=d.maybeChild(m);if(!g)break;if(m&&-1==c.indexOf(v)){var y=d.child(m-1);y.type==g.type&&t(y,g)&&c.push(v)}v+=g.nodeSize}c.sort(function(e,t){return e-t});for(var b=c.length-1;b>=0;b--)r.canJoin(n.doc,c[b])&&n.join(c[b]);e(n)}}(o,t))}},t.chainCommands=k,t.pcBaseKeymap=S,t.macBaseKeymap=O,t.baseKeymap=M},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e){e&&(this.className=e.className,this.customSchema=e.schema,this.tagName=e.tagName,this.customIcon=e.icon,this.customName=e.customName)}}();t.Extension=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=n(1),i=n(9),a=function(e,t){return function(n){Array.isArray(e)||(e=[e]);for(var r=0,o=e.length;r<o;r++){var i=S(e[r])(n.selection);if(i){var a=f(i.pos,t)(n);if(a!==n)return a}}return n}},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return function(n){var o=r.Selection.findFrom(n.doc.resolve(e),t,!0);return o?n.setSelection(o):n}},c=function(e,t){return function(n){var r="number"==typeof t,o=n.selection.$from,i=r?n.doc.resolve(t):l(n.selection)?n.doc.resolve(o.pos+1):o,c=i.parent;i.depth;if(g(c)&&n!==(n=a(c.type,e)(n)))return s(i.pos)(n);if(v(i,e))return n.insert(i.pos,e),p(s(r?i.pos:n.selection.$anchor.pos)(n));for(var u=i.depth;u>0;u--){var f=i.after(u),h=n.doc.resolve(f);if(v(h,e))return n.insert(f,e),p(s(f)(n))}return n}},l=function(e){return e instanceof r.NodeSelection},u=function(e,t){return Array.isArray(e)&&e.indexOf(t.type)>-1||t.type===e},p=function(e){return Object.assign(Object.create(e),e).setTime(Date.now())},f=function(e,t){return function(n){var r=n.doc.nodeAt(e),o=n.doc.resolve(e);if(h(o,t)){var i=(n=n.replaceWith(e,e+r.nodeSize,t)).selection.$from.pos-1;return n=s(Math.max(i,0),-1)(n),n=s(n.selection.$from.start())(n),p(n)}return n}},h=function(e,t){var n=e.node(e.depth);return n&&n.type.validContent(t instanceof o.Fragment?t:o.Fragment.from(t))},d=function(e){return function(t){var n=t.doc.nodeAt(e);return p(t.delete(e,e+n.nodeSize))}},m=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;var t={};return Object.keys(e.nodes).forEach(function(n){var r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t},v=function(e,t){var n=e.index();return t instanceof o.Fragment?e.parent.canReplace(n,n,t):t instanceof o.Node&&e.parent.canReplaceWith(n,n,t.type)},g=function(e){return!e||"paragraph"===e.type.name&&2===e.nodeSize},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t?e.createChecked(null,t):e.createAndFill()},b=function(e){return function(t){for(var n=i.TableMap.get(t.$anchorCell.node(-1)),r=t.$anchorCell.start(-1),o=n.cellsInRect(e),a=n.cellsInRect(n.rectBetween(t.$anchorCell.pos-r,t.$headCell.pos-r)),s=0,c=o.length;s<c;s++)if(-1===a.indexOf(o[s]))return!1;return!0}},w=function(e){return function(t){var n=t.$from;return k(n,e)}},k=function(e,t){for(var n=e.depth;n>0;n--){var r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}},_=function(e,t){return function(n){var r=w(e)(n);if(r)return C(r.pos,t)}},x=function(e){return function(t){return!!w(e)(t)}},S=function(e){return function(t){return w(function(t){return u(e,t)})(t)}},O=function(e){var t=e.$from.nodeBefore,n=r.Selection.findFrom(e.$from,-1);if(n&&t){var o=S(t.type)(n);return o?o.pos:n.$from.pos}},C=function(e,t){var n=t(e),r=n.node.childNodes[n.offset];return n.node.nodeType===Node.TEXT_NODE?n.node.parentNode:r&&r.nodeType!==Node.TEXT_NODE?r:n.node},M=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)throw new Error('Invalid "node" parameter');var n=[];return e.descendants(function(e,r){if(n.push({node:e,pos:r}),!t)return!1}),n},E=function(e,t,n){if(!e)throw new Error('Invalid "node" parameter');if(!t)throw new Error('Invalid "predicate" parameter');return M(e,n).filter(function(e){return t(e.node)})},N=function(e,t,n){return E(e,function(e){return e.type===t},n)};var T=function(e){return w(function(e){return e.type.spec.tableRole&&"table"===e.type.spec.tableRole})(e)},A=function(e){return e instanceof i.CellSelection},P=function(e){if(A(e)){var t=i.TableMap.get(e.$anchorCell.node(-1));return b({left:0,right:t.width,top:0,bottom:t.height})(e)}return!1},D=function(e){return function(t){var n=T(t);if(n){var r=i.TableMap.get(n.node);return(Array.isArray(e)?e:Array.from([e])).reduce(function(e,t){if(t>=0&&t<=r.width-1){var o=r.cellsInRect({left:t,right:t+1,top:0,bottom:r.height});return e.concat(o.map(function(e){var t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t}}))}},[])}}},z=function(e){return function(t){var n=T(t);if(n){var r=i.TableMap.get(n.node);return(Array.isArray(e)?e:Array.from([e])).reduce(function(e,t){if(t>=0&&t<=r.height-1){var o=r.cellsInRect({left:0,right:r.width,top:t,bottom:t+1});return e.concat(o.map(function(e){var t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t}}))}},[])}}},j=function(e){var t=T(e);if(t){var n=i.TableMap.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(function(e){var n=t.node.nodeAt(e),r=e+t.start;return{pos:r,start:r+1,node:n}})}},R=function(e){return function(t){var n=T(t.selection);if(n){var r=i.TableMap.get(n.node);if(e>=0&&e<=r.height){for(var o=n.node,a=m(o.type.schema),s=n.start,l=0;l<e+1;l++)s+=o.child(l).nodeSize;var u=o.child(e),p=[],f=0;if(u.forEach(function(e){1===e.attrs.rowspan&&(f+=e.attrs.colspan,p.push(a[e.type.spec.tableRole].createAndFill(e.attrs,e.marks)))}),f<r.width){for(var h=[],d=function(n){var r=H(n,function(t,r){var o=t.node.attrs.rowspan;return o>1&&n+o>e})(t);h.push.apply(h,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(r))},v=e;v>=0;v--)d(v);h.length&&h.forEach(function(e){t=$(e,{rowspan:e.node.attrs.rowspan+1})(t)})}return c(a.row.create(u.attrs,p),s)(t)}}return t}},I=function(e){return function(t){var n=T(t.selection);if(n){var r=i.TableMap.get(n.node);if(0===e&&1===r.width)return F(t);if(e>=0&&e<=r.width)return i.removeColumn(t,{map:r,tableStart:n.start,table:n.node},e),p(t)}return t}},B=function(e){return function(t){var n=T(t.selection);if(n){var r=i.TableMap.get(n.node);if(0===e&&1===r.height)return F(t);if(e>=0&&e<=r.height)return i.removeRow(t,{map:r,tableStart:n.start,table:n.node},e),p(t)}return t}},F=function(e){for(var t=e.selection.$from,n=t.depth;n>0;n--){if("table"===t.node(n).type.spec.tableRole)return p(e.delete(t.before(n),t.after(n)))}return e},$=function(e,t){return function(n){return e?(n.setNodeMarkup(e.pos,null,Object.assign({},e.node.attrs,t)),p(n)):n}},V=function(e){return k(e,function(e){return e.type.spec.tableRole&&/cell/i.test(e.type.spec.tableRole)})},L=function(e){var t=V(e);if(t){var n=function(e){return k(e,function(e){return e.type.spec.tableRole&&/table/i.test(e.type.spec.tableRole)})}(e),r=i.TableMap.get(n.node),o=t.pos-n.start;return r.rectBetween(o,o)}},H=function(e,t){return function(n){var r=[],o=z(e)(n.selection);if(o)for(var i=o.length-1;i>=0;i--)t(o[i],n)&&r.push(o[i]);return r}};t.isNodeSelection=l,t.canInsert=v,t.findParentNode=w,t.findParentNodeClosestToPos=k,t.findParentDomRef=_,t.hasParentNode=x,t.findParentNodeOfType=S,t.findParentNodeOfTypeClosestToPos=function(e,t){return k(e,function(e){return u(t,e)})},t.hasParentNodeOfType=function(e){return function(t){return x(function(t){return u(e,t)})(t)}},t.findParentDomRefOfType=function(e,t){return function(n){return _(function(t){return u(e,t)},t)(n)}},t.findSelectedNodeOfType=function(e){return function(t){if(l(t)){var n=t.node,r=t.$from;if(u(e,n))return{node:n,pos:r.pos,depth:r.depth}}}},t.findPositionOfNodeBefore=O,t.findDomRefAtPos=C,t.flatten=M,t.findChildren=E,t.findTextNodes=function(e,t){return E(e,function(e){return e.isText},t)},t.findInlineNodes=function(e,t){return E(e,function(e){return e.isInline},t)},t.findBlockNodes=function(e,t){return E(e,function(e){return e.isBlock},t)},t.findChildrenByAttr=function(e,t,n){return E(e,function(e){return!!t(e.attrs)},n)},t.findChildrenByType=N,t.findChildrenByMark=function(e,t,n){return E(e,function(e){return t.isInSet(e.marks)},n)},t.contains=function(e,t){return!!N(e,t).length},t.findTable=T,t.isCellSelection=A,t.getSelectionRect=function(e){if(A(e)){var t=e.$anchorCell.start(-1);return i.TableMap.get(e.$anchorCell.node(-1)).rectBetween(e.$anchorCell.pos-t,e.$headCell.pos-t)}},t.isColumnSelected=function(e){return function(t){if(A(t)){var n=i.TableMap.get(t.$anchorCell.node(-1));return b({left:e,right:e+1,top:0,bottom:n.height})(t)}return!1}},t.isRowSelected=function(e){return function(t){if(A(t)){var n=i.TableMap.get(t.$anchorCell.node(-1));return b({left:0,right:n.width,top:e,bottom:e+1})(t)}return!1}},t.isTableSelected=P,t.getCellsInColumn=D,t.getCellsInRow=z,t.getCellsInTable=j,t.selectColumn=function(e){return function(t){var n=D(e)(t.selection);if(n){var r=t.doc.resolve(n[0].pos),o=t.doc.resolve(n[n.length-1].pos);return p(t.setSelection(new i.CellSelection(r,o)))}return t}},t.selectRow=function(e){return function(t){var n=z(e)(t.selection);if(n){var r=t.doc.resolve(n[0].pos),o=t.doc.resolve(n[n.length-1].pos);return p(t.setSelection(new i.CellSelection(r,o)))}return t}},t.selectTable=function(e){var t=j(e.selection);if(t){var n=e.doc.resolve(t[0].pos),r=e.doc.resolve(t[t.length-1].pos);return p(e.setSelection(new i.CellSelection(n,r)))}return e},t.emptyCell=function(e,t){return function(n){if(e){var r=m(t).cell.createAndFill().content;if(!e.node.content.eq(r))return n.replaceWith(e.pos,e.pos+e.node.nodeSize-1,new o.Slice(r,0,0)),p(n)}return n}},t.addColumnAt=function(e){return function(t){var n=T(t.selection);if(n){var r=i.TableMap.get(n.node);if(e>=0&&e<=r.width)return p(i.addColumn(t,{map:r,tableStart:n.start,table:n.node},e))}return t}},t.addRowAt=function(e,t){return function(n){var r=T(n.selection);if(r){var o=i.TableMap.get(r.node),a=e-1;if(t&&a>=0)return p(R(a)(n));if(e>=0&&e<=o.height)return p(i.addRow(n,{map:o,tableStart:r.start,table:r.node},e))}return n}},t.cloneRowAt=R,t.removeColumnAt=I,t.removeRowAt=B,t.removeTable=F,t.removeSelectedColumns=function(e){var t=e.selection;if(P(t))return F(e);if(A(t)){var n=T(t);if(n){var r=i.TableMap.get(n.node),o=r.rectBetween(t.$anchorCell.pos-n.start,t.$headCell.pos-n.start);if(0==o.left&&o.right==r.width)return!1;for(var a=Object.assign({},o,{map:r,table:n.node,tableStart:n.start}),s=a.right-1;i.removeColumn(e,a,s),s!==a.left;s--)a.table=a.tableStart?e.doc.nodeAt(a.tableStart-1):e.doc,a.map=i.TableMap.get(a.table);return p(e)}}return e},t.removeSelectedRows=function(e){var t=e.selection;if(P(t))return F(e);if(A(t)){var n=T(t);if(n){var r=i.TableMap.get(n.node),o=r.rectBetween(t.$anchorCell.pos-n.start,t.$headCell.pos-n.start);if(0==o.top&&o.bottom==r.height)return!1;for(var a=Object.assign({},o,{map:r,table:n.node,tableStart:n.start}),s=a.bottom-1;i.removeRow(e,a,s),s!==a.top;s--)a.table=a.tableStart?e.doc.nodeAt(a.tableStart-1):e.doc,a.map=i.TableMap.get(a.table);return p(e)}}return e},t.removeColumnClosestToPos=function(e){return function(t){var n=L(e);return n?I(n.left)(s(e.pos)(t)):t}},t.removeRowClosestToPos=function(e){return function(t){var n=L(e);return n?B(n.top)(s(e.pos)(t)):t}},t.forEachCellInColumn=function(e,t,n){return function(o){var i=D(e)(o.selection);if(i){for(var a=i.length-1;a>=0;a--)o=t(i[a],o);if(n){var s=o.doc.resolve(o.mapping.map(i[i.length-1].pos));o.setSelection(r.Selection.near(s))}return p(o)}return o}},t.forEachCellInRow=function(e,t,n){return function(o){var i=z(e)(o.selection);if(i){for(var a=i.length-1;a>=0;a--)o=t(i[a],o);if(n){var s=o.doc.resolve(o.mapping.map(i[i.length-1].pos));o.setSelection(r.Selection.near(s))}}return o}},t.setCellAttrs=$,t.createTable=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=m(e),a=i.cell,s=i.header_cell,c=i.row,l=i.table,u=[],p=[],f=0;f<n;f++)u.push(y(a,o)),r&&p.push(y(s,o));for(var h=[],d=0;d<t;d++)h.push(c.createChecked(null,r&&0===d?p:u));return l.createChecked(null,h)},t.findCellClosestToPos=V,t.findCellRectClosestToPos=L,t.getSelectionRangeInColumn=function(e){return function(t){for(var n=e,r=e,o=function(e){D(e)(t.selection).forEach(function(t){var o=t.node.attrs.colspan+e-1;o>=n&&(n=e),o>r&&(r=o)})},i=e;i>=0;i--)o(i);var a=function(e){D(e)(t.selection).forEach(function(t){var n=t.node.attrs.colspan+e-1;t.node.attrs.colspan>1&&n>r&&(r=n)})};for(i=e;i<=r;i++)a(i);var s=[];for(i=n;i<=r;i++){var c=D(i)(t.selection);c&&c.length&&s.push(i)}n=s[0],r=s[s.length-1];for(var l=D(n)(t.selection),u=z(0)(t.selection),p=t.doc.resolve(l[l.length-1].pos),f=void 0,h=r;h>=n;h--){var d=D(h)(t.selection);if(d&&d.length){for(var m=u.length-1;m>=0;m--)if(u[m].pos===d[0].pos){f=d[0];break}if(f)break}}return{$anchor:p,$head:t.doc.resolve(f.pos),indexes:s}}},t.getSelectionRangeInRow=function(e){return function(t){for(var n=e,r=e,o=function(e){z(e)(t.selection).forEach(function(t){var o=t.node.attrs.rowspan+e-1;o>=n&&(n=e),o>r&&(r=o)})},i=e;i>=0;i--)o(i);var a=function(e){z(e)(t.selection).forEach(function(t){var n=t.node.attrs.rowspan+e-1;t.node.attrs.rowspan>1&&n>r&&(r=n)})};for(i=e;i<=r;i++)a(i);var s=[];for(i=n;i<=r;i++){var c=z(i)(t.selection);c&&c.length&&s.push(i)}n=s[0],r=s[s.length-1];for(var l=z(n)(t.selection),u=D(0)(t.selection),p=t.doc.resolve(l[l.length-1].pos),f=void 0,h=r;h>=n;h--){var d=z(h)(t.selection);if(d&&d.length){for(var m=u.length-1;m>=0;m--)if(u[m].pos===d[0].pos){f=d[0];break}if(f)break}}return{$anchor:p,$head:t.doc.resolve(f.pos),indexes:s}}},t.removeParentNodeOfType=function(e){return function(t){var n=S(e)(t.selection);return n?d(n.pos)(t):t}},t.replaceParentNodeOfType=a,t.removeSelectedNode=function(e){if(l(e.selection)){var t=e.selection.$from.pos,n=e.selection.$to.pos;return p(e.delete(t,n))}return e},t.replaceSelectedNode=function(e){return function(t){if(l(t.selection)){var n=t.selection,r=n.$from,o=n.$to;if(r.parent.canReplaceWith(r.index(),r.indexAfter(),e.type))return p(t.replaceWith(r.pos,o.pos,e))}return t}},t.setTextSelection=s,t.safeInsert=c,t.setParentNodeMarkup=function(e,t,n,r){return function(o){var i=S(e)(o.selection);return i?p(o.setNodeMarkup(i.pos,t,Object.assign({},i.node.attrs,n),r)):o}},t.selectParentNodeOfType=function(e){return function(t){if(!l(t.selection)){var n=S(e)(t.selection);if(n)return p(t.setSelection(r.NodeSelection.create(t.doc,n.pos)))}return t}},t.removeNodeBefore=function(e){var t=O(e.selection);return"number"==typeof t?d(t)(e):e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(2),i=n(3),a={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var s=/Edge\/(\d+)/.exec(navigator.userAgent),c=/MSIE \d/.test(navigator.userAgent),l=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);a.mac=/Mac/.test(navigator.platform);var u=a.ie=!!(c||l||s);a.ie_version=c?document.documentMode||6:l?+l[1]:s?+s[1]:null,a.gecko=!u&&/gecko\/(\d+)/i.test(navigator.userAgent),a.gecko_version=a.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var p=!u&&/Chrome\/(\d+)/.exec(navigator.userAgent);a.chrome=!!p,a.chrome_version=p&&+p[1],a.ios=!u&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),a.android=/Android \d/.test(navigator.userAgent),a.webkit=!u&&"WebkitAppearance"in document.documentElement.style,a.safari=/Apple Computer/.test(navigator.vendor),a.webkit_version=a.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var f=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},h=function(e){var t=e.parentNode;return t&&11==t.nodeType?t.host:t},d=function(e,t,n){var r=document.createRange();return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},m=function(e,t,n,r){return n&&(g(e,t,n,r,-1)||g(e,t,n,r,1))},v=/^(img|br|input|textarea|hr)$/i;function g(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:y(e))||3==e.nodeType&&"\ufeff"==e.nodeValue){var i=e.parentNode;if(1!=i.nodeType||(a=void 0,(a=e.pmViewDesc)&&a.node&&a.node.isBlock)||v.test(e.nodeName)||"false"==e.contentEditable)return!1;t=f(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;e=e.childNodes[t+(o<0?-1:0)],t=o<0?y(e):0}}var a}function y(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}var b=function(e){var t=e.isCollapsed;return t&&a.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function w(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function k(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function _(e,t){return"number"==typeof e?e:e[t]}function x(e,t,n){for(var r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,a=i.defaultView,s=n||e.dom;s;s=h(s))if(1==s.nodeType){var c=s==i.body||1!=s.nodeType,l=c?k(a):s.getBoundingClientRect(),u=0,p=0;if(t.top<l.top+_(r,"top")?p=-(l.top-t.top+_(o,"top")):t.bottom>l.bottom-_(r,"bottom")&&(p=t.bottom-l.bottom+_(o,"bottom")),t.left<l.left+_(r,"left")?u=-(l.left-t.left+_(o,"left")):t.right>l.right-_(r,"right")&&(u=t.right-l.right+_(o,"right")),(u||p)&&(c?a.scrollBy(u,p):(p&&(s.scrollTop+=p),u&&(s.scrollLeft+=u))),c)break}}function S(e,t){for(var n,r,o=2e8,i=0,a=t.top,s=t.top,c=e.firstChild,l=0;c;c=c.nextSibling,l++){var u=void 0;if(1==c.nodeType)u=c.getClientRects();else{if(3!=c.nodeType)continue;u=d(c).getClientRects()}for(var p=0;p<u.length;p++){var f=u[p];if(f.top<=a&&f.bottom>=s){a=Math.max(f.bottom,a),s=Math.min(f.top,s);var h=f.left>t.left?f.left-t.left:f.right<t.left?t.left-f.right:0;if(h<o){n=c,o=h,r=h&&3==n.nodeType?{left:f.right<t.left?f.right:f.left,top:t.top}:t,1==c.nodeType&&h&&(i=l+(t.left>=(f.left+f.right)/2?1:0));continue}}!n&&(t.left>=f.right&&t.top>=f.top||t.left>=f.left&&t.top>=f.bottom)&&(i=l+1)}}return n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);var i=M(r,1);if(i.top!=i.bottom&&O(t,i))return{node:e,offset:o+(t.left>=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:i}:S(n,r)}function O(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function C(e,t){var n,r,o=e.root;if(o.caretPositionFromPoint){var i,a=o.caretPositionFromPoint(t.left,t.top);if(a)n=(i=a).offsetNode,r=i.offset}if(!n&&o.caretRangeFromPoint){var s,c=o.caretRangeFromPoint(t.left,t.top);if(c)n=(s=c).startContainer,r=s.startOffset}var l,u=o.elementFromPoint(t.left,t.top+1);if(!u||!e.dom.contains(1!=u.nodeType?u.parentNode:u)){var p=e.dom.getBoundingClientRect();if(!O(t,p))return null;if(!(u=function e(t,n,r){var o=t.childNodes.length;if(o&&r.top<r.bottom)for(var i=Math.max(0,Math.floor(o*(n.top-r.top)/(r.bottom-r.top))-2),a=i;;){var s=t.childNodes[a];if(1==s.nodeType)for(var c=s.getClientRects(),l=0;l<c.length;l++){var u=c[l];if(O(n,u))return e(s,n,u)}if((a=(a+1)%o)==i)break}return t}(e.dom,t,p)))return null}u=function(e,t){var n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(u,t),n&&(n==e.dom&&r==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?l=e.state.doc.content.size:0!=r&&1==n.nodeType&&"BR"==n.childNodes[r-1].nodeName||(l=function(e,t,n,r){for(var o=-1,i=t;i!=e.dom;){var a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.node.isBlock&&a.parent){var s=a.dom.getBoundingClientRect();if(s.left>r.left||s.top>r.top)o=a.posBefore;else{if(!(s.right<r.left||s.bottom<r.top))break;o=a.posAfter}}i=a.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n)}(e,n,r,t))),null==l&&(l=function(e,t,n){var r=S(t,n),o=r.node,i=r.offset,a=-1;if(1==o.nodeType&&!o.firstChild){var s=o.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(o,i,a)}(e,u,t));var f=e.docView.nearestDesc(u,!0);return{pos:l,inside:f?f.posAtStart-f.border:-1}}function M(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}function E(e,t){var n=e.docView.domFromPos(t),r=n.node,o=n.offset;if(3==r.nodeType&&(a.chrome||a.gecko)){var i=M(d(r,o,o),0);if(a.gecko&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){var s=M(d(r,o-1,o-1),-1);if(Math.abs(s.left-i.left)<1&&s.top==i.top){var c=M(d(r,o,o+1),-1);return N(c,c.left<s.left)}}return i}if(1==r.nodeType&&!e.state.doc.resolve(t).parent.inlineContent){var l,u=!0;if(o<r.childNodes.length){var p=r.childNodes[o];1==p.nodeType&&(l=p.getBoundingClientRect())}if(!l&&o){var f=r.childNodes[o-1];1==f.nodeType&&(l=f.getBoundingClientRect(),u=!1)}return function(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}(l||parent.getBoundingClientRect(),u)}for(var h=-1;h<2;h+=2)if(h<0&&o){var m=void 0,v=3==r.nodeType?d(r,o-1,o):3==(m=r.childNodes[o-1]).nodeType?d(m):1==m.nodeType&&"BR"!=m.nodeName?m:null;if(v){var g=M(v,1);if(g.top<g.bottom)return N(g,!1)}}else if(h>0&&o<y(r)){var b=void 0,w=3==r.nodeType?d(r,o,o+1):3==(b=r.childNodes[o]).nodeType?d(b):1==b.nodeType?b:null;if(w){var k=M(w,-1);if(k.top<k.bottom)return N(k,!0)}}return N(M(3==r.nodeType?d(r):r,0),!1)}function N(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function T(e,t,n){var r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o.focus()}}var A=/[\u0590-\u08ac]/;var P=null,D=null,z=!1;function j(e,t,n){return P==t&&D==n?z:(P=t,D=n,z="up"==n||"down"==n?function(e,t,n){var r=t.selection,o="up"==n?r.$anchor.min(r.$head):r.$anchor.max(r.$head);return T(e,t,function(){for(var t=e.docView.domFromPos(o.pos).node;;){var r=e.docView.nearestDesc(t,!0);if(!r)break;if(r.node.isBlock){t=r.dom;break}t=r.dom.parentNode}for(var i=E(e,o.pos),a=t.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=d(a,0,a.nodeValue.length).getClientRects()}for(var c=0;c<s.length;c++){var l=s[c];if(l.bottom>l.top&&("up"==n?l.bottom<i.top+1:l.top>i.bottom-1))return!1}}return!0})}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,a=o==r.parent.content.size,s=getSelection();return A.test(r.parent.textContent)&&s.modify?T(e,t,function(){var t=s.getRangeAt(0),o=s.focusNode,i=s.focusOffset;s.modify("move",n,"character");var a=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==s.focusNode.nodeType?s.focusNode:s.focusNode.parentNode)||o==s.focusNode&&i==s.focusOffset;return s.removeAllRanges(),s.addRange(t),a}):"left"==n||"backward"==n?i:a}(e,t,n))}var R=function(e,t,n,r){this.parent=e,this.children=t,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},I={beforePosition:{},size:{},border:{},posBefore:{},posAtStart:{},posAfter:{},posAtEnd:{},contentLost:{}};R.prototype.matchesWidget=function(){return!1},R.prototype.matchesMark=function(){return!1},R.prototype.matchesNode=function(){return!1},R.prototype.matchesHack=function(){return!1},I.beforePosition.get=function(){return!1},R.prototype.parseRule=function(){return null},R.prototype.stopEvent=function(){return!1},I.size.get=function(){for(var e=0,t=0;t<this.children.length;t++)e+=this.children[t].size;return e},I.border.get=function(){return 0},R.prototype.destroy=function(){this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var e=0;e<this.children.length;e++)this.children[e].destroy()},R.prototype.posBeforeChild=function(e){for(var t=0,n=this.posAtStart;t<this.children.length;t++){var r=this.children[t];if(r==e)return n;n+=r.size}},I.posBefore.get=function(){return this.parent.posBeforeChild(this)},I.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},I.posAfter.get=function(){return this.posBefore+this.size},I.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},R.prototype.localPosFromDOM=function(e,t,n){var r;if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){var o,i;if(e==this.contentDOM)o=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&(!(i=o.pmViewDesc)||i.parent!=this);)o=o.previousSibling;return o?this.posBeforeChild(i)+i.size:this.posAtStart}var a,s;if(e==this.contentDOM)a=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;a=e.nextSibling}for(;a&&(!(s=a.pmViewDesc)||s.parent!=this);)a=a.nextSibling;return a?this.posBeforeChild(s):this.posAtEnd}if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var c=e;;c=c.parentNode){if(c==this.dom){r=!1;break}if(c.parentNode.firstChild!=c)break}if(null==r&&t==e.childNodes.length)for(var l=e;;l=l.parentNode){if(l==this.dom){r=!0;break}if(l.parentNode.lastChild!=l)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart},R.prototype.nearestDesc=function(e,t){for(var n=!0,r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!o.nodeDOM||(1==o.nodeDOM.nodeType?o.nodeDOM.contains(e):o.nodeDOM==e))return o;n=!1}}},R.prototype.getDesc=function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t},R.prototype.posFromDOM=function(e,t,n){for(var r=e;;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}},R.prototype.descAt=function(e){for(var t=0,n=0;t<this.children.length;t++){var r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<o)return r.descAt(e-n-r.border);n=o}},R.prototype.domFromPos=function(e){if(!this.contentDOM)return{node:this.dom,offset:0};for(var t=0,n=0;;n++){if(t==e){for(;n<this.children.length&&this.children[n].beforePosition;)n++;return{node:this.contentDOM,offset:n}}if(n==this.children.length)throw new Error("Invalid position "+e);var r=this.children[n],o=t+r.size;if(e<o)return r.domFromPos(e-t-r.border);t=o}},R.prototype.parseRange=function(e,t,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=0,a=0;;a++){var s=this.children[a],c=i+s.size;if(-1==r&&e<=c){var l=i+s.border;if(e>=l&&t<=c-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(e-l,t-l,n+l);e=n+i;for(var u=a;u>0;u--){var p=this.children[u-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){r=f(p.dom)+1;break}e-=p.size}-1==r&&(r=0)}if(r>-1&&t<=c){t=n+c;for(var h=a+1;h<this.children.length;h++){var d=this.children[h];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){o=f(d.dom);break}t+=d.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}},R.prototype.emptyChildAt=function(e){if(this.border||!this.contentDOM||!this.children.length)return!1;var t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)},R.prototype.domAfterPos=function(e){var t=this.domFromPos(e),n=t.node,r=t.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]},R.prototype.setSelection=function(e,t,n,r){for(var o=Math.min(e,t),i=Math.max(e,t),a=0,s=0;a<this.children.length;a++){var c=this.children[a],l=s+c.size;if(o>s&&i<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}var u=this.domFromPos(e),p=this.domFromPos(t),f=n.getSelection(),h=document.createRange();if(r||!m(u.node,u.offset,f.anchorNode,f.anchorOffset)||!m(p.node,p.offset,f.focusNode,f.focusOffset)){if(f.extend)h.setEnd(u.node,u.offset),h.collapse(!1);else{if(e>t){var d=u;u=p,p=d}h.setEnd(p.node,p.offset),h.setStart(u.node,u.offset)}f.removeAllRanges(),f.addRange(h),f.extend&&f.extend(p.node,p.offset)}},R.prototype.ignoreMutation=function(e){return!this.contentDOM},I.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},R.prototype.markDirty=function(e,t){for(var n=0,r=0;r<this.children.length;r++){var o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){var a=n+o.border,s=i-o.border;if(e>=a&&t<=s)return this.dirty=e==n||t==i?2:1,void(e==a&&t==s&&o.contentLost?o.dirty=3:o.markDirty(e-a,t-a));o.dirty=3}n=i}this.dirty=2},R.prototype.markParentsDirty=function(){for(var e=this.parent;e;e=e.parent){e.dirty<2&&(e.dirty=2)}},Object.defineProperties(R.prototype,I);var B=[],F=function(e){function t(t,n,r,o){var i,a=n.type.toDOM;if("function"==typeof a&&(a=a(r,function(){return i?i.parent?i.parent.posBeforeChild(i):void 0:o})),!n.type.spec.raw){if(1!=a.nodeType){var s=document.createElement("span");s.appendChild(a),a=s}a.contentEditable=!1,a.classList.add("ProseMirror-widget")}e.call(this,t,B,a,null),this.widget=n,i=this}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={beforePosition:{}};return n.beforePosition.get=function(){return this.widget.type.side<0},t.prototype.matchesWidget=function(e){return 0==this.dirty&&e.type.eq(this.widget.type)},t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.stopEvent=function(e){var t=this.widget.spec.stopEvent;return!!t&&t(e)},Object.defineProperties(t.prototype,n),t}(R),$=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.parseRule=function(){return{skip:ie(this.dom)}},t.prototype.ignoreMutation=function(){return!1},t}(F),V=function(e){function t(t,n,r,o){e.call(this,t,B,n,null),this.textDOM=r,this.text=o}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={size:{}};return n.size.get=function(){return this.text.length},t.prototype.parseRule=function(){return{skip:ie(this.dom)}},t.prototype.localPosFromDOM=function(e,t){if(e!=this.textDOM)return this.posAtStart+(t?this.size:0);var n=this.textDOM.nodeValue.indexOf("\ufeff");return this.posAtStart+t-(n>-1&&n<t?1:0)},t.prototype.domFromPos=function(e){var t=this.textDOM.nodeValue.indexOf("\ufeff");return{node:this.textDOM,offset:e+(t>-1&&t<=e?1:0)}},t.prototype.ignoreMutation=function(){return!1},Object.defineProperties(t.prototype,n),t}(R),L=function(e){function t(t,n,r,o){e.call(this,t,[],r,o),this.mark=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.create=function(e,n,o,i){var a=i.nodeViews[n.type.name],s=a&&a(n,i,o);return s&&s.dom||(s=r.DOMSerializer.renderSpec(document,n.type.spec.toDOM(n,o))),new t(e,n,s.dom,s.contentDOM||s.dom)},t.prototype.parseRule=function(){return{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},t.prototype.matchesMark=function(e){return 3!=this.dirty&&this.mark.eq(e)},t.prototype.markDirty=function(t,n){if(e.prototype.markDirty.call(this,t,n),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}},t.prototype.slice=function(e,n,r){var o=t.create(this.parent,this.mark,!0,r),i=this.children,a=this.size;n<a&&(i=oe(i,n,a,r)),e>0&&(i=oe(i,0,e,r));for(var s=0;s<i.length;s++)i[s].parent=o;return o.children=i,o},t}(R),H=function(e){function t(t,n,r,o,i,a,s,c,l){e.call(this,t,n.isLeaf?B:[],i,a),this.nodeDOM=s,this.node=n,this.outerDeco=r,this.innerDeco=o,a&&this.updateChildren(c,l)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={size:{},border:{}};return t.create=function(e,n,o,i,a,s){var c,l=a.nodeViews[n.type.name],u=l&&l(n,a,function(){return c?c.parent?c.parent.posBeforeChild(c):void 0:s},o),p=u&&u.dom,f=u&&u.contentDOM;if(n.isText)if(p){if(3!=p.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else p=document.createTextNode(n.text);else if(!p){var h;p=(h=r.DOMSerializer.renderSpec(document,n.type.spec.toDOM(n))).dom,f=h.contentDOM}f||n.isText||"BR"==p.nodeName||(p.hasAttribute("contenteditable")||(p.contentEditable=!1),n.type.spec.draggable&&(p.draggable=!0));var d=p;return p=Y(p,o,n),u?c=new K(e,n,o,i,p,f,d,u,a,s+1):n.isText?new W(e,n,o,i,p,d,a):new t(e,n,o,i,p,f,d,a,s+1)},t.prototype.parseRule=function(){var e=this;if(this.node.type.spec.reparseInView)return null;var t={node:this.node.type.name,attrs:this.node.attrs};return this.node.type.spec.code&&(t.preserveWhitespace="full"),this.contentDOM&&!this.contentLost?t.contentElement=this.contentDOM:t.getContent=function(){return e.contentDOM?r.Fragment.empty:e.node.content},t},t.prototype.matchesNode=function(e,t,n){return 0==this.dirty&&e.eq(this.node)&&ee(t,this.outerDeco)&&n.eq(this.innerDeco)},n.size.get=function(){return this.node.nodeSize},n.border.get=function(){return this.node.isLeaf?0:1},t.prototype.updateChildren=function(e,t){var n=this,o=this.node.inlineContent,i=t,a=o&&e.composing&&this.localCompositionNode(e,t),s=new ne(this,a&&a.node);!function(e,t,n,r){var o=t.locals(e),i=0;if(0==o.length){for(var a=0;a<e.childCount;a++){var s=e.child(a);r(s,o,t.forChild(i,s),a),i+=s.nodeSize}return}for(var c=0,l=[],u=null,p=0;;){if(c<o.length&&o[c].to==i){for(var f=o[c++],h=void 0;c<o.length&&o[c].to==i;)(h||(h=[f])).push(o[c++]);if(h){h.sort(re);for(var d=0;d<h.length;d++)n(h[d],p)}else n(f,p)}var m=void 0,v=void 0;if(u)v=-1,m=u,u=null;else{if(!(p<e.childCount))break;v=p,m=e.child(p++)}for(var g=0;g<l.length;g++)l[g].to<=i&&l.splice(g--,1);for(;c<o.length&&o[c].from==i;)l.push(o[c++]);var y=i+m.nodeSize;if(m.isText){var b=y;c<o.length&&o[c].from<b&&(b=o[c].from);for(var w=0;w<l.length;w++)l[w].to<b&&(b=l[w].to);b<y&&(u=m.cut(b-i),m=m.cut(0,b-i),y=b,v=-1)}r(m,l.length?l.slice():B,t.forChild(i,m),v),i=y}}(this.node,this.innerDeco,function(t,a){t.spec.marks?s.syncToMarks(t.spec.marks,o,e):t.type.side>=0&&s.syncToMarks(a==n.node.childCount?r.Mark.none:n.node.child(a).marks,o,e),s.placeWidget(t,e,i)},function(t,n,r,a){s.syncToMarks(t.marks,o,e),s.findNodeMatch(t,n,r,a)||s.updateNextNode(t,n,r,e,a)||s.addNode(t,n,r,e,i),i+=t.nodeSize}),s.syncToMarks(B,o,e),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),this.renderChildren())},t.prototype.renderChildren=function(){!function e(t,n){var r=t.firstChild;for(var o=0;o<n.length;o++){var i=n[o],a=i.dom;if(a.parentNode==t){for(;a!=r;)r=te(r);r=r.nextSibling}else t.insertBefore(a,r);if(i instanceof L){var s=r?r.previousSibling:t.lastChild;e(i.contentDOM,i.children),r=s?s.nextSibling:t.firstChild}}for(;r;)r=te(r)}(this.contentDOM,this.children,t.is),a.ios&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom)},t.prototype.localCompositionNode=function(e,t){var n=e.state.selection,r=n.from,i=n.to;if(!(!(e.state.selection instanceof o.TextSelection)||r<t||i>t+this.node.content.size)){var a=e.root.getSelection(),s=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0)e=e.childNodes[t-1],t=y(e);else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(a.focusNode,a.focusOffset);if(s&&this.dom.contains(s.parentNode)){var c=s.nodeValue.replace(/\ufeff/g,""),l=function(e,t,n,r){for(var o="",i=0,a=0;i<e.childCount;i++){var s=e.child(i),c=a+s.nodeSize;if(s.isText){if(o+=s.text,c>=r){for(var l=c-o.length,u=o.lastIndexOf(t);u>-1&&l+u>n;)u=o.lastIndexOf(t,u-1);if(u>-1&&l+u+t.length>=r)return l+u;if(c>r-t.length)break}}else o="";a=c}return-1}(this.node.content,c,r-t,i-t);return l<0?null:{node:s,pos:l,text:c}}}},t.prototype.protectLocalComposition=function(e,t){var n=t.node,r=t.pos,o=t.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=null)}var a=new V(this,i,n,o);e.compositionNodes.push(a),this.children=oe(this.children,r,r+o.length,e,a)}},t.prototype.update=function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)},t.prototype.updateInner=function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},t.prototype.updateOuterDeco=function(e){if(!ee(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Z(this.dom,this.nodeDOM,G(this.outerDeco,this.node,t),G(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=e}},t.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},t.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!1)},Object.defineProperties(t.prototype,n),t}(R);function q(e,t,n,r,o){return Y(r,t,e),new H(null,e,t,n,r,r,r,o,0)}var W=function(e){function t(t,n,r,o,i,a,s){e.call(this,t,n,r,o,i,null,a,s)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.parseRule=function(){var e=this.nodeDOM.parentNode;return e?{skip:e}:{ignore:!0}},t.prototype.update=function(e,t){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text),this.node=e,this.dirty=0,!0)},t.prototype.inParent=function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1},t.prototype.domFromPos=function(e){return{node:this.nodeDOM,offset:e}},t.prototype.localPosFromDOM=function(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):e.prototype.localPosFromDOM.call(this,t,n,r)},t.prototype.ignoreMutation=function(e){return"characterData"!=e.type},t.prototype.slice=function(e,n,r){var o=this.node.cut(e,n),i=document.createTextNode(o.text);return new t(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)},t}(H),J=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.matchesHack=function(){return 0==this.dirty},t}(R),K=function(e){function t(t,n,r,o,i,a,s,c,l,u){e.call(this,t,n,r,o,i,a,s,l,u),this.spec=c}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.update=function(t,n,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(t,n);return i&&this.updateInner(t,n,r,o),i}return!(!this.contentDOM&&!t.isLeaf)&&e.prototype.update.call(this,t,n,r,o)},t.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():e.prototype.selectNode.call(this)},t.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():e.prototype.deselectNode.call(this)},t.prototype.setSelection=function(t,n,r,o){this.spec.setSelection?this.spec.setSelection(t,n,r):e.prototype.setSelection.call(this,t,n,r,o)},t.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),e.prototype.destroy.call(this)},t.prototype.stopEvent=function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)},t.prototype.ignoreMutation=function(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):e.prototype.ignoreMutation.call(this,t)},t}(H);function U(e){e&&(this.nodeName=e)}U.prototype=Object.create(null);var Q=[new U];function G(e,t,n){if(0==e.length)return Q;for(var r=n?Q[0]:new U,o=[r],i=0;i<e.length;i++){var a=e[i].type.attrs,s=r;if(a)for(var c in a.nodeName&&o.push(s=new U(a.nodeName)),a){var l=a[c];null!=l&&(n&&1==o.length&&o.push(s=r=new U(t.isInline?"span":"div")),"class"==c?s.class=(s.class?s.class+" ":"")+l:"style"==c?s.style=(s.style?s.style+";":"")+l:"nodeName"!=c&&(s[c]=l))}}return o}function Z(e,t,n,r){if(n==Q&&r==Q)return t;for(var o=t,i=0;i<r.length;i++){var a=r[i],s=n[i];if(i){var c=void 0;s&&s.nodeName==a.nodeName&&o!=e&&(c=t.parentNode)&&c.tagName.toLowerCase()==a.nodeName?o=c:((c=document.createElement(a.nodeName)).appendChild(o),o=c)}X(o,s||Q[0],a)}return o}function X(e,t,n){for(var r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=t[o]&&e.setAttribute(o,n[o]);if(t.class!=n.class){for(var i=t.class?t.class.split(" "):B,a=n.class?n.class.split(" "):B,s=0;s<i.length;s++)-1==a.indexOf(i[s])&&e.classList.remove(i[s]);for(var c=0;c<a.length;c++)-1==i.indexOf(a[c])&&e.classList.add(a[c])}if(t.style!=n.style){if(t.style)for(var l,u=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;l=u.exec(t.style);)e.style[l[1].toLowerCase()]="";n.style&&(e.style.cssText+=n.style)}}function Y(e,t,n){return Z(e,e,Q,G(t,n,1!=e.nodeType))}function ee(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function te(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var ne=function(e,t){this.top=e,this.lock=t,this.index=0,this.stack=[],this.changed=!1;var n=function(e,t){for(var n=[],r=e.childCount,o=t.length-1;r>0&&o>=0;o--){var i=t[o],a=i.node;if(a){if(a!=e.child(r-1))break;n.push(i),--r}}return{nodes:n.reverse(),offset:r}}(e.node.content,e.children);this.preMatched=n.nodes,this.preMatchOffset=n.offset};function re(e,t){return e.type.side-t.type.side}function oe(e,t,n,r,o){for(var i=[],a=0,s=0;a<e.length;a++){var c=e[a],l=s,u=s+=c.size;l>=n||u<=t?i.push(c):(l<t&&i.push(c.slice(0,t-l,r)),o&&(i.push(o),o=null),u>n&&i.push(c.slice(n-l,c.size,r)))}return i}function ie(e){var t=e.cloneNode(!0);return function e(t){if(1==t.nodeType)for(var n=t.firstChild;n;n=n.nextSibling)e(n);else 3==t.nodeType&&(t.nodeValue=t.nodeValue.replace(/\ufeff/g,""))}(t),t}function ae(e,t){var n=e.selection,r=n.$anchor,i=n.$head,a=t>0?r.max(i):r.min(i),s=a.parent.inlineContent?a.depth?e.doc.resolve(t>0?a.after():a.before()):null:a;return s&&o.Selection.findFrom(s,t)}function se(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function ce(e,t,n){var r=e.state.selection;if(r instanceof o.TextSelection){if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var i=ae(e.state,t);return!!(i&&i instanceof o.NodeSelection)&&se(e,i)}var a,s=r.$head,c=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(c&&o.NodeSelection.isSelectable(c)){var l=t<0?s.pos-c.nodeSize:s.pos;if(c.isAtom||(a=e.docView.descAt(l))&&!a.contentDOM)return se(e,new o.NodeSelection(t<0?e.state.doc.resolve(s.pos-c.nodeSize):s))}return!1}if(r instanceof o.NodeSelection&&r.node.isInline)return se(e,new o.TextSelection(t>0?r.$to:r.$from));var u=ae(e.state,t);return!!u&&se(e,u)}function le(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function ue(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function pe(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,s=!1;for(a.gecko&&1==n.nodeType&&r<le(n)&&ue(n.childNodes[r])&&(s=!0);;)if(r>0)if(1!=n.nodeType){if(3!=n.nodeType||"\ufeff"!=n.nodeValue.charAt(r-1))break;a.ie&&a.ie_version<=11&&(s=!0),o=n,i=--r}else{var c=n.childNodes[r-1];if(ue(c))o=n,i=--r;else{if(3!=c.nodeType)break;r=(n=c).nodeValue.length}}else{if(he(n))break;for(var l=n.previousSibling;l&&ue(l);)o=n.parentNode,i=f(l),l=l.previousSibling;if(l)r=le(n=l);else{if((n=n.parentNode)==e.dom)break;r=0}}s?de(e,t,n,r):o&&de(e,t,o,i)}}function fe(e){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,a=le(n);;)if(r<a){if(1!=n.nodeType)break;if(!ue(n.childNodes[r]))break;o=n,i=++r}else{if(he(n))break;for(var s=n.nextSibling;s&&ue(s);)o=s.parentNode,i=f(s)+1,s=s.nextSibling;if(s)r=0,a=le(n=s);else{if((n=n.parentNode)==e.dom)break;r=a=0}}o&&de(e,t,o,i)}}function he(e){var t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function de(e,t,n,r){if(b(t)){var o=document.createRange();o.setEnd(n,r),o.setStart(n,r),t.removeAllRanges(),t.addRange(o)}else t.extend&&t.extend(n,r);e.domObserver.setCurSelection()}function me(e,t,n){var r=e.state.selection;if(r instanceof o.TextSelection&&!r.empty||n.indexOf("s")>-1)return!1;var i=r.$from,a=r.$to;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var s=ae(e.state,t);if(s&&s instanceof o.NodeSelection)return se(e,s)}if(!i.parent.inlineContent){var c=o.Selection.findFrom(t<0?i:a,t);return!c||se(e,c)}return!1}function ve(e,t){if(!(e.state.selection instanceof o.TextSelection))return!0;var n=e.state.selection,r=n.$head,i=n.$anchor,a=n.empty;if(!r.sameParent(i))return!0;if(!a)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var s=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){var c=e.state.tr;return t<0?c.delete(r.pos-s.nodeSize,r.pos):c.delete(r.pos,r.pos+s.nodeSize),e.dispatch(c),!0}return!1}function ge(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ye(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||a.mac&&72==n&&"c"==r?ve(e,-1)||pe(e):46==n||a.mac&&68==n&&"c"==r?ve(e,1)||fe(e):13==n||27==n||(37==n?ce(e,-1,r)||pe(e):39==n?ce(e,1,r)||fe(e):38==n?me(e,-1,r)||pe(e):40==n?function(e){if(a.chrome&&!(e.state.selection.$head.parentOffset>0)){var t=e.root.getSelection(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;ge(e,o,!0),setTimeout(function(){return ge(e,o,!1)},20)}}}(e)||me(e,1,r)||fe(e):r==(a.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function be(e,t,n){var r=e.state.selection;if(_e(e,r),e.editable&&!e.hasFocus()){if(!t)return;a.gecko&&a.gecko_version<=55&&(e.domObserver.disconnectSelection(),e.dom.focus(),e.domObserver.connectSelection())}else if(!e.editable&&!Oe(e)&&!t)return;if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){var t=e.root.getSelection(),n=document.createRange(),r=e.cursorWrapper.dom;n.setEnd(r,r.childNodes.length),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!e.state.selection.visible&&a.ie&&a.ie_version<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{var i,s,c=r.anchor,l=r.head;!we||r instanceof o.TextSelection||(r.$from.parent.inlineContent||(i=ke(e,r.from)),r.empty||r.$from.parent.inlineContent||(s=ke(e,r.to))),e.docView.setSelection(c,l,e.root,n),we&&(i&&(i.contentEditable="false"),s&&(s.contentEditable="false")),r.visible?e.dom.classList.remove("ProseMirror-hideselection"):c!=l&&(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){var t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.hideSelectionGuard);var n=e.root.getSelection(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.hideSelectionGuard),e.dom.classList.remove("ProseMirror-hideselection"))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}ne.prototype.getPreMatch=function(e){return e>=this.preMatchOffset?this.preMatched[e-this.preMatchOffset]:null},ne.prototype.destroyBetween=function(e,t){if(e!=t){for(var n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}},ne.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},ne.prototype.syncToMarks=function(e,t,n){for(var r=0,o=this.stack.length>>1,i=Math.min(o,e.length);r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);for(var a=-1,s=this.index;s<Math.min(this.index+3,this.top.children.length);s++)if(this.top.children[s].matchesMark(e[o])){a=s;break}if(a>-1)a>this.index&&(this.changed=!0,this.top.children.splice(this.index,a-this.index)),this.top=this.top.children[this.index];else{var c=L.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}},ne.prototype.findNodeMatch=function(e,t,n,r){var o=-1,i=r<0?void 0:this.getPreMatch(r),a=this.top.children;if(i&&i.matchesNode(e,t,n))o=a.indexOf(i);else for(var s=this.index,c=Math.min(a.length,s+5);s<c;s++){var l=a[s];if(l.matchesNode(e,t,n)&&this.preMatched.indexOf(l)<0){o=s;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)},ne.prototype.updateNextNode=function(e,t,n,r,o){if(this.index==this.top.children.length)return!1;var i=this.top.children[this.index];if(i instanceof H){var a=this.preMatched.indexOf(i);if(a>-1&&a+this.preMatchOffset!=o)return!1;var s=i.dom;if(!(this.lock&&(s==this.lock||1==s.nodeType&&s.contains(this.lock.parentNode))&&!(e.isText&&i.node&&i.node.isText&&i.nodeDOM.nodeValue==e.text&&3!=i.dirty&&ee(t,i.outerDeco)))&&i.update(e,t,n,r))return i.dom!=s&&(this.changed=!0),this.index++,!0}return!1},ne.prototype.addNode=function(e,t,n,r,o){this.top.children.splice(this.index++,0,H.create(this.top,e,t,n,r,o)),this.changed=!0},ne.prototype.placeWidget=function(e,t,n){if(this.index<this.top.children.length&&this.top.children[this.index].matchesWidget(e))this.index++;else{var r=new(e.spec.isCursorWrapper?$:F)(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}},ne.prototype.placeComposition=function(e,t){this.syncToMarks(B,!0,e),this.top.children[this.index]==t?this.index++:(this.top.children.splice(this.index++,0,t),this.changed=!0)},ne.prototype.addTextblockHacks=function(){for(var e=this.top.children[this.index-1];e instanceof L;)e=e.children[e.children.length-1];if(!e||!(e instanceof W)||/\n$/.test(e.node.text))if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack())this.index++;else{var t=document.createElement("br");this.top.children.splice(this.index++,0,new J(this.top,B,t,null)),this.changed=!0}};var we=a.safari||a.chrome&&a.chrome_version<63;function ke(e,t){var n=e.docView.domFromPos(t),r=n.node,o=n.offset,i=o<r.childNodes.length?r.childNodes[o]:null,a=o?r.childNodes[o-1]:null;if(!(i&&"false"!=i.contentEditable||a&&"false"!=a.contentEditable)){if(i)return i.contentEditable="true",i;if(a)return a.contentEditable="true",a}}function _e(e,t){if(t instanceof o.NodeSelection){var n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(xe(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else xe(e)}function xe(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=null)}function Se(e,t,n,r){return e.someProp("createSelectionBetween",function(r){return r(e,t,n)})||o.TextSelection.between(t,n,r)}function Oe(e){var t=e.root.getSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function Ce(e){return!1===e.type.spec.inclusive}function Me(e){var t=e.selection,n=t.$head,r=t.$anchor,o=t.visible,i=n.pos!=r.pos||o&&!n.parent.inlineContent?null:n;return i&&(!o||e.storedMarks||0==i.parent.content.length||i.parentOffset&&!i.textOffset&&i.nodeBefore.marks.some(Ce))?i:null}function Ee(e,t){return function(n){var r=n.pmViewDesc;if(r)return r.parseRule();if("BR"==n.nodeName&&n.parentNode){if(a.safari&&/^(ul|ol)$/i.test(n.parentNode.nodeName))return e.matchTag(document.createElement("li"),t);if(n.parentNode.lastChild==n||a.safari&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}}}function Ne(e,t,n,i){if(t<0){var s=e.lastSelectionTime>Date.now()-50?e.lastSelectionOrigin:null,c=function(e,t){var n,r,i=e.root.getSelection(),a=e.state.doc,s=e.docView.nearestDesc(i.focusNode),c=s&&0==s.size,l=e.docView.posFromDOM(i.focusNode,i.focusOffset),u=a.resolve(l);if(b(i)){for(n=u;s&&!s.node;)s=s.parent;if(s&&s.node.isAtom&&o.NodeSelection.isSelectable(s.node)&&s.parent){var p=s.posBefore;r=new o.NodeSelection(l==p?u:a.resolve(p))}}else n=a.resolve(e.docView.posFromDOM(i.anchorNode,i.anchorOffset));return r||(r=Se(e,n,u,"pointer"==t||e.state.selection.head<u.pos&&!c?1:-1)),r}(e,s);if(!e.state.selection.eq(c)){var l=e.state.tr.setSelection(c);"pointer"==s?l.setMeta("pointer",!0):"key"==s&&l.scrollIntoView(),e.dispatch(l)}}else{var u=e.state.doc.resolve(t),p=u.sharedDepth(n);t=u.before(p+1),n=e.state.doc.resolve(n).after(p+1);var f,h,d=e.state.selection,m=function(e,t,n){var o=e.docView.parseRange(t,n),i=o.node,s=o.fromOffset,c=o.toOffset,l=o.from,u=o.to,p=e.root.getSelection(),f=null,h=p.anchorNode;if(h&&e.dom.contains(1==h.nodeType?h:h.parentNode)&&(f=[{node:h,offset:p.anchorOffset}],b(p)||f.push({node:p.focusNode,offset:p.focusOffset})),a.chrome&&8===e.lastKeyCode)for(var d=c;d>s;d--){var m=i.childNodes[d-1],v=m.pmViewDesc;if("BR"==m.nodeType&&!v){c=d;break}if(!v||v.size)break}var g=e.state.doc,y=e.someProp("domParser")||r.DOMParser.fromSchema(e.state.schema),w=g.resolve(l),k=null,_=y.parse(i,{topNode:w.parent,topMatch:w.parent.contentMatchAt(w.index()),topOpen:!0,from:s,to:c,preserveWhitespace:!w.parent.type.spec.code||"full",editableContent:!0,findPositions:f,ruleFromNode:Ee(y,w),context:w});if(f&&null!=f[0].pos){var x=f[0].pos,S=f[1]&&f[1].pos;null==S&&(S=x),k={anchor:x+l,head:S+l}}return{doc:_,sel:k,from:l,to:u}}(e,t,n),v=e.state.doc,g=v.slice(m.from,m.to);8===e.lastKeyCode&&Date.now()-100<e.lastKeyCodeTime?(f=e.state.selection.to,h="end"):(f=e.state.selection.from,h="start"),e.lastKeyCode=null;var y=function(e,t,n,r,o){var i=e.findDiffStart(t,n);if(null==i)return null;var a=e.findDiffEnd(t,n+e.size,n+t.size),s=a.a,c=a.b;if("end"==o){var l=Math.max(0,i-Math.min(s,c));r-=s+l-i}if(s<i&&e.size<t.size){var u=r<=i&&r>=s?i-r:0;c=(i-=u)+(c-s),s=i}else if(c<i){var p=r<=i&&r>=c?i-r:0;s=(i-=p)+(s-c),c=i}return{start:i,endA:s,endB:c}}(g.content,m.doc.content,m.from,f,h);if(y){e.domChangeCount++,e.state.selection.from<e.state.selection.to&&y.start==y.endB&&e.state.selection instanceof o.TextSelection&&(y.start>e.state.selection.from&&y.start<=e.state.selection.from+2?y.start=e.state.selection.from:y.endA<e.state.selection.to&&y.endA>=e.state.selection.to-2&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to));var k,_=m.doc.resolveNoCache(y.start-m.from),x=m.doc.resolveNoCache(y.endB-m.from);if(!(!_.sameParent(x)&&_.pos<m.doc.content.size&&(k=o.Selection.findFrom(m.doc.resolve(_.pos+1),1,!0))&&k.head==x.pos&&e.someProp("handleKeyDown",function(t){return t(e,w(13,"Enter"))})))if(e.state.selection.anchor>y.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||Ae(r,!0,!1)<o.pos)return!1;var i=e.resolve(t);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var a=e.resolve(Ae(i,!0,!0));if(!a.parent.isTextblock||a.pos>n||Ae(a,!0,!1)<n)return!1;return r.parent.content.cut(r.parentOffset).eq(a.parent.content)}(v,y.start,y.endA,_,x)&&e.someProp("handleKeyDown",function(t){return t(e,w(8,"Backspace"))}))a.android&&a.chrome&&(e.domObserver.suppressSelectionUpdates=!0,setTimeout(function(){return e.domObserver.suppressSelectionUpdates=!1},50));else{var S,O,C,M,E=y.start,N=y.endA;if(_.sameParent(x)&&_.parent.inlineContent)if(_.pos==x.pos)S=e.state.tr.delete(E,N),O=v.resolve(y.start).marksAcross(v.resolve(y.endA));else if(y.endA==y.endB&&(M=v.resolve(y.start))&&(C=function(e,t){for(var n,o,i,a=e.firstChild.marks,s=t.firstChild.marks,c=a,l=s,u=0;u<s.length;u++)c=s[u].removeFromSet(c);for(var p=0;p<a.length;p++)l=a[p].removeFromSet(l);if(1==c.length&&0==l.length)o=c[0],n="add",i=function(e){return e.mark(o.addToSet(e.marks))};else{if(0!=c.length||1!=l.length)return null;o=l[0],n="remove",i=function(e){return e.mark(o.removeFromSet(e.marks))}}for(var f=[],h=0;h<t.childCount;h++)f.push(i(t.child(h)));if(r.Fragment.from(f).eq(e))return{mark:o,type:n}}(_.parent.content.cut(_.parentOffset,x.parentOffset),M.parent.content.cut(M.parentOffset,y.endA-M.start()))))S=e.state.tr,"add"==C.type?S.addMark(E,N,C.mark):S.removeMark(E,N,C.mark);else if(_.parent.child(_.index()).isText&&_.index()==x.index()-(x.textOffset?0:1)){var T=_.parent.textBetween(_.parentOffset,x.parentOffset);if(e.someProp("handleTextInput",function(t){return t(e,E,N,T)}))return;S=e.state.tr.insertText(T,E,N)}if(S||(S=e.state.tr.replace(E,N,m.doc.slice(y.start-m.from,y.endB-m.from))),m.sel){var A=Te(e,S.doc,m.sel);A&&S.setSelection(A)}O&&S.ensureMarks(O),e.dispatch(S.scrollIntoView())}}else if(!(i&&d instanceof o.TextSelection&&!d.empty&&d.$head.sameParent(d.$anchor))||e.composing||m.sel&&m.sel.anchor!=m.sel.head){if(m.sel){var P=Te(e,e.state.doc,m.sel);P&&!P.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(P))}}else{var D=e.state,z=D.selection;e.dispatch(D.tr.replaceSelectionWith(D.schema.text(D.doc.textBetween(z.from,z.to)),!0).scrollIntoView())}}}function Te(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Se(e,t.resolve(n.anchor),t.resolve(n.head))}function Ae(e,t,n){for(var r=e.depth,o=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n)for(var i=e.node(r).maybeChild(e.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function Pe(e,t){for(var n=[],o=t.content,i=t.openStart,a=t.openEnd;i>1&&a>1&&1==o.childCount&&1==o.firstChild.childCount;){i--,a--;var s=o.firstChild;n.push(s.type.name,s.type.hasRequiredAttrs()?s.attrs:null),o=s.content}var c=e.someProp("clipboardSerializer")||r.DOMSerializer.fromSchema(e.state.schema),l=document.createElement("div");l.appendChild(c.serializeFragment(o));for(var u,p=l.firstChild;p&&1==p.nodeType&&(u=je[p.nodeName.toLowerCase()]);){for(var f=u.length-1;f>=0;f--){for(var h=document.createElement(u[f]);l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h)}p=l.firstChild}return p&&1==p.nodeType&&p.setAttribute("data-pm-slice",i+" "+a+" "+JSON.stringify(n)),{dom:l,text:e.someProp("clipboardTextSerializer",function(e){return e(t)})||t.content.textBetween(0,t.content.size,"\n\n")}}function De(e,t,n,o,i){var a,s,c=i.parent.type.spec.code;if(!n&&!t)return null;var l=t&&(o||c||!n);if(l){if(e.someProp("transformPastedText",function(e){t=e(t)}),c)return new r.Slice(r.Fragment.from(e.state.schema.text(t)),0,0);var u=e.someProp("clipboardTextParser",function(e){return e(t,i)});u?s=u:(a=document.createElement("div"),t.trim().split(/(?:\r\n?|\n)+/).forEach(function(e){a.appendChild(document.createElement("p")).textContent=e}))}else e.someProp("transformPastedHTML",function(e){n=e(n)}),a=function(e){var t=/(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=(Re||(Re=document.implementation.createHTMLDocument("title"))).createElement("div"),o=/(?:<meta [^>]*>)*<([a-z][^>\s]+)/i.exec(e),i=0;(n=o&&je[o[1].toLowerCase()])&&(e=n.map(function(e){return"<"+e+">"}).join("")+e+n.map(function(e){return"</"+e+">"}).reverse().join(""),i=n.length);r.innerHTML=e;for(var a=0;a<i;a++)r=r.firstChild;return r}(n);var p=a&&a.querySelector("[data-pm-slice]"),f=p&&/^(\d+) (\d+) (.*)/.exec(p.getAttribute("data-pm-slice"));if(!s){var h=e.someProp("clipboardParser")||e.someProp("domParser")||r.DOMParser.fromSchema(e.state.schema);s=h.parseSlice(a,{preserveWhitespace:!(!l&&!f),context:i})}return s=f?function(e,t){if(!e.size)return e;var n,o=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}for(var i=e.content,a=e.openStart,s=e.openEnd,c=n.length-2;c>=0;c-=2){var l=o.nodes[n[c]];if(!l||l.hasRequiredAttrs())break;i=r.Fragment.from(l.create(n[c+1],i)),a++,s++}return new r.Slice(i,a,s)}(new r.Slice(s.content,Math.min(s.openStart,+f[1]),Math.min(s.openEnd,+f[2])),f[3]):r.Slice.maxOpen(function(e,t){if(e.childCount<2)return e;for(var n=function(n){var o=t.node(n),i=o.contentMatchAt(t.index(n)),a=void 0,s=[];if(e.forEach(function(e){if(s){var t,n=i.findWrapping(e.type);if(!n)return s=null;if(t=s.length&&a.length&&function e(t,n,o,i,a){if(a<t.length&&a<n.length&&t[a]==n[a]){var s=e(t,n,o,i.lastChild,a+1);if(s)return i.copy(i.content.replaceChild(i.childCount-1,s));var c=i.contentMatchAt(i.childCount);if(c.matchType(a==t.length-1?o.type:t[a+1]))return i.copy(i.content.append(r.Fragment.from(ze(o,t,a+1))))}}(n,a,e,s[s.length-1],0))s[s.length-1]=t;else{s.length&&(s[s.length-1]=function e(t,n){if(0==n)return t;var o=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1));var i=t.contentMatchAt(t.childCount).fillBefore(r.Fragment.empty,!0);return t.copy(o.append(i))}(s[s.length-1],a.length));var o=ze(e,n);s.push(o),i=i.matchType(o.type,o.attrs),a=n}}}),s)return{v:r.Fragment.from(s)}},o=t.depth;o>=0;o--){var i=n(o);if(i)return i.v}return e}(s.content,i),!1),e.someProp("transformPasted",function(e){s=e(s)}),s}function ze(e,t,n){void 0===n&&(n=0);for(var o=t.length-1;o>=n;o--)e=t[o].create(null,r.Fragment.from(e));return e}var je={thead:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Re=null;var Ie={childList:!0,characterData:!0,attributes:!0,subtree:!0,characterDataOldValue:!0},Be=a.ie&&a.ie_version<=11,Fe=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};Fe.prototype.set=function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset},Fe.prototype.eq=function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset};var $e=function(e,t){var n=this;this.view=e,this.handleDOMChange=t,this.observer=window.MutationObserver&&new window.MutationObserver(function(e){return n.flush(e)}),this.currentSelection=new Fe,this.charDataQueue=[],Be&&(this.onCharData=function(e){n.charDataQueue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),window.setTimeout(function(){return n.flush()},20)}),this.onSelectionChange=this.onSelectionChange.bind(this)};$e.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,Ie),Be&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},$e.prototype.stop=function(){this.observer&&this.observer.disconnect(),Be&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()},$e.prototype.connectSelection=function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)},$e.prototype.disconnectSelection=function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)},$e.prototype.onSelectionChange=function(){var e;if((!(e=this.view).editable||e.root.activeElement==e.dom)&&Oe(e))return this.suppressSelectionUpdates?be(this.view):void this.flush()},$e.prototype.setCurSelection=function(){this.currentSelection.set(this.view.root.getSelection())},$e.prototype.flush=function(e){e||(e=this.observer.takeRecords()),this.charDataQueue.length&&(e=this.charDataQueue.concat(e),this.charDataQueue.length=0);var t=this.view.root.getSelection(),n=!this.currentSelection.eq(t)&&Oe(this.view),r=-1,o=-1,i=!1;if(this.view.editable)for(var a=0;a<e.length;a++){var s=this.registerMutation(e[a]);s&&(r=r<0?s.from:Math.min(s.from,r),o=o<0?s.to:Math.max(s.to,o),s.typeOver&&(i=!0))}(r>-1||n)&&(r>-1&&this.view.docView.markDirty(r,o),this.handleDOMChange(r,o,i),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||be(this.view))},$e.prototype.registerMutation=function(e){var t=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(t==this.view.docView||"contenteditable"==e.attributeName))return null;if(!t||t.ignoreMutation(e))return null;if("childList"==e.type){var n=e.previousSibling&&e.previousSibling.parentNode==e.target?f(e.previousSibling)+1:0,r=t.localPosFromDOM(e.target,n,-1),o=e.nextSibling&&e.nextSibling.parentNode==e.target?f(e.nextSibling):e.target.childNodes.length;return{from:r,to:t.localPosFromDOM(e.target,o,1)}}return"attributes"==e.type?{from:t.posAtStart-t.border,to:t.posAtEnd+t.border}:{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}};var Ve={},Le={};function He(e,t){e.lastSelectionOrigin=t,e.lastSelectionTime=Date.now()}function qe(e){e.someProp("handleDOMEvents",function(t){for(var n in t)e.eventHandlers[n]||e.dom.addEventListener(n,e.eventHandlers[n]=function(t){return We(e,t)})})}function We(e,t){return e.someProp("handleDOMEvents",function(n){var r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function Je(e){return{left:e.clientX,top:e.clientY}}function Ke(e,t,n,r,o){if(-1==r)return!1;for(var i=e.state.doc.resolve(r),a=function(r){if(e.someProp(t,function(t){return r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)}))return{v:!0}},s=i.depth+1;s>0;s--){var c=a(s);if(c)return c.v}return!1}function Ue(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Qe(e,t,n,r,i){return Ke(e,"handleClickOn",t,n,r)||e.someProp("handleClick",function(n){return n(e,t,r)})||(i?function(e,t){if(-1==t)return!1;var n,r,i=e.state.selection;i instanceof o.NodeSelection&&(n=i.node);for(var a=e.state.doc.resolve(t),s=a.depth+1;s>0;s--){var c=s>a.depth?a.nodeAfter:a.node(s);if(o.NodeSelection.isSelectable(c)){r=n&&i.$from.depth>0&&s>=i.$from.depth&&a.before(i.$from.depth+1)==i.$from.pos?a.before(i.$from.depth):a.before(s);break}}return null!=r&&(Ue(e,o.NodeSelection.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&o.NodeSelection.isSelectable(r))&&(Ue(e,new o.NodeSelection(n),"pointer"),!0)}(e,n))}function Ge(e,t,n,r){return Ke(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",function(n){return n(e,t,r)})||function(e,t){var n=e.state.doc;if(-1==t)return!!n.inlineContent&&(Ue(e,o.TextSelection.create(n,0,n.content.size),"pointer"),!0);for(var r=n.resolve(t),i=r.depth+1;i>0;i--){var a=i>r.depth?r.nodeAfter:r.node(i),s=r.before(i);if(a.inlineContent)Ue(e,o.TextSelection.create(n,s+1,s+1+a.content.size),"pointer");else{if(!o.NodeSelection.isSelectable(a))continue;Ue(e,o.NodeSelection.create(n,s),"pointer")}return!0}}(e,n)}function Ze(e){return rt(e)}Le.keydown=function(e,t){e.shiftKey=16==t.keyCode||t.shiftKey,et(e,t)||(e.lastKeyCode=t.keyCode,e.lastKeyCodeTime=Date.now(),e.someProp("handleKeyDown",function(n){return n(e,t)})||ye(e,t)?t.preventDefault():He(e,"key"))},Le.keyup=function(e,t){16==t.keyCode&&(e.shiftKey=!1)},Le.keypress=function(e,t){if(!(et(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||a.mac&&t.metaKey))if(e.someProp("handleKeyPress",function(n){return n(e,t)}))t.preventDefault();else{var n=e.state.selection;if(!(n instanceof o.TextSelection&&n.$from.sameParent(n.$to))){var r=String.fromCharCode(t.charCode);e.someProp("handleTextInput",function(t){return t(e,n.$from.pos,n.$to.pos,r)})||e.dispatch(e.state.tr.insertText(r).scrollIntoView()),t.preventDefault()}}};var Xe=a.mac?"metaKey":"ctrlKey";Ve.mousedown=function(e,t){e.shiftKey=t.shiftKey;var n=Ze(e),r=Date.now(),o="singleClick";r-e.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(t,e.lastClick)&&!t[Xe]&&("singleClick"==e.lastClick.type?o="doubleClick":"doubleClick"==e.lastClick.type&&(o="tripleClick")),e.lastClick={time:r,x:t.clientX,y:t.clientY,type:o};var i=e.posAtCoords(Je(t));i&&("singleClick"==o?e.mouseDown=new Ye(e,i,t,n):("doubleClick"==o?function(e,t,n,r){return Ke(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",function(n){return n(e,t,r)})}:Ge)(e,i.pos,i.inside,t)?t.preventDefault():He(e,"pointer"))};var Ye=function(e,t,n,r){var i,s,c=this;if(this.view=e,this.startDoc=e.state.doc,this.pos=t,this.event=n,this.flushed=r,this.selectNode=n[Xe],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),s=t.inside;else{var l=e.state.doc.resolve(t.pos);i=l.parent,s=l.depth?l.before():0}this.mightDrag=null;var u=r?null:n.target,p=u?e.docView.nearestDesc(u,!0):null;this.target=p?p.dom:null,(i.type.spec.draggable&&!1!==i.type.spec.selectable||e.state.selection instanceof o.NodeSelection&&s==e.state.selection.from)&&(this.mightDrag={node:i,pos:s,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&a.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(function(){return c.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),He(e,"pointer")};function et(e,t){return!!e.composing||!!(a.safari&&Math.abs(t.timeStamp-e.compositionEndedAt)<500)&&(e.compositionEndedAt=-2e8,!0)}Ye.prototype.done=function(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!1),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.view.mouseDown=null},Ye.prototype.up=function(e){if(this.done(),this.view.dom.contains(3==e.target.nodeType?e.target.parentNode:e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Je(e))),this.allowDefault||!t?(a.ie&&Me(this.view.state)&&this.view.updateState(this.view.state),He(this.view,"pointer")):Qe(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():!this.flushed&&(!a.chrome||this.view.state.selection instanceof o.TextSelection||t.pos!=this.view.state.selection.from&&t.pos!=this.view.state.selection.to)?He(this.view,"pointer"):(Ue(this.view,o.Selection.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault())}},Ye.prototype.move=function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),He(this.view,"pointer")},Ve.touchdown=function(e){Ze(e),He(e,"pointer")},Ve.contextmenu=function(e){return Ze(e)};var tt=a.android?5e3:-1;function nt(e,t){clearTimeout(e.composingTimeout),t>-1&&(e.composingTimeout=setTimeout(function(){return rt(e)},t))}function rt(e){for(e.composing=!1;e.compositionNodes.length>0;)e.compositionNodes.pop().markParentsDirty();return!!e.docView.dirty&&(e.updateState(e.state),!0)}Le.compositionstart=Le.compositionupdate=function(e){e.composing||(e.domObserver.flush(),rt(e),e.composing=!0),nt(e,tt)},Le.compositionend=function(e,t){e.composing&&(e.composing=!1,e.compositionEndedAt=t.timeStamp,nt(e,20))};var ot=a.ie&&a.ie_version<15||a.ios&&a.webkit_version<604;function it(e,t,n,o){var i=De(e,t,n,e.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",function(t){return t(e,o,i||r.Slice.empty)})||!i)return!0;var a=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=a?e.state.tr.replaceSelectionWith(a,e.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Ve.copy=Le.cut=function(e,t){var n=e.state.selection,r="cut"==t.type;if(!n.empty){var o=ot?null:t.clipboardData,i=Pe(e,n.content()),a=i.dom,s=i.text;o?(t.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",s)):function(e,t){var n=t.ownerDocument,r=n.body.appendChild(n.createElement("div"));r.appendChild(t),r.style.cssText="position: fixed; left: -10000px; top: 10px";var o=getSelection(),i=n.createRange();i.selectNodeContents(t),e.dom.blur(),o.removeAllRanges(),o.addRange(i),setTimeout(function(){n.body.removeChild(r),e.focus()},50)}(e,a),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},Le.paste=function(e,t){var n=ot?null:t.clipboardData;n&&(it(e,n.getData("text/plain"),n.getData("text/html"),t)||n.files.length>0)?t.preventDefault():function(e,t){var n=e.dom.ownerDocument,r=e.shiftKey||e.state.selection.$from.parent.type.spec.code,o=n.body.appendChild(n.createElement(r?"textarea":"div"));r||(o.contentEditable="true"),o.style.cssText="position: fixed; left: -10000px; top: 10px",o.focus(),setTimeout(function(){e.focus(),n.body.removeChild(o),r?it(e,o.value,null,t):it(e,o.textContent,o.innerHTML,t)},50)}(e,t)};var at=function(e,t){this.slice=e,this.move=t},st=a.mac?"altKey":"ctrlKey";for(var ct in Ve.dragstart=function(e,t){var n=e.mouseDown;if(n&&n.done(),t.dataTransfer){var r=e.state.selection,i=r.empty?null:e.posAtCoords(Je(t));if(i&&i.pos>=r.from&&i.pos<=(r instanceof o.NodeSelection?r.to-1:r.to));else if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(o.NodeSelection.create(e.state.doc,n.mightDrag.pos)));else if(t.target&&1==t.target.nodeType){var a=e.docView.nearestDesc(t.target,!0);if(!a||!a.node.type.spec.draggable||a==e.docView)return;e.dispatch(e.state.tr.setSelection(o.NodeSelection.create(e.state.doc,a.posBefore)))}var s=e.state.selection.content(),c=Pe(e,s),l=c.dom,u=c.text;t.dataTransfer.clearData(),t.dataTransfer.setData(ot?"Text":"text/html",l.innerHTML),ot||t.dataTransfer.setData("text/plain",u),e.dragging=new at(s,!t[st])}},Ve.dragend=function(e){window.setTimeout(function(){return e.dragging=null},50)},Le.dragover=Le.dragenter=function(e,t){return t.preventDefault()},Le.drop=function(e,t){var n=e.dragging;if(e.dragging=null,t.dataTransfer){var r=e.posAtCoords(Je(t));if(r){var a=e.state.doc.resolve(r.pos);if(a){var s=n&&n.slice||De(e,t.dataTransfer.getData(ot?"Text":"text/plain"),ot?null:t.dataTransfer.getData("text/html"),!1,a);if(s&&(t.preventDefault(),!e.someProp("handleDrop",function(r){return r(e,t,s,n&&n.move)}))){var c=s?i.dropPoint(e.state.doc,a.pos,s):a.pos;null==c&&(c=a.pos);var l=e.state.tr;n&&n.move&&l.deleteSelection();var u=l.mapping.map(c),p=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,f=l.doc;if(p?l.replaceRangeWith(u,u,s.content.firstChild):l.replaceRange(u,u,s),!l.doc.eq(f)){var h=l.doc.resolve(u);p&&o.NodeSelection.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild)?l.setSelection(new o.NodeSelection(h)):l.setSelection(Se(e,h,l.doc.resolve(l.mapping.map(c)))),e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}}}}}},Ve.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0)},Ve.blur=function(e){e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),e.focused=!1)},Ve.beforeinput=function(e,t){if(a.chrome&&a.android&&"deleteContentBackward"==t.inputType){var n=e.domChangeCount;setTimeout(function(){if(e.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",function(t){return t(e,w(8,"Backspace"))}))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}},50)}},Le)Ve[ct]=Le[ct];function lt(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var ut=function(e,t){this.spec=t||vt,this.side=this.spec.side||0,this.toDOM=e};ut.prototype.map=function(e,t,n,r){var o=e.mapResult(t.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new ht(i-n,i-n,this)},ut.prototype.valid=function(){return!0},ut.prototype.eq=function(e){return this==e||e instanceof ut&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&lt(this.spec,e.spec))};var pt=function(e,t){this.spec=t||vt,this.attrs=e};pt.prototype.map=function(e,t,n,r){var o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new ht(o,i,this)},pt.prototype.valid=function(e,t){return t.from<t.to},pt.prototype.eq=function(e){return this==e||e instanceof pt&&lt(this.attrs,e.attrs)&&lt(this.spec,e.spec)},pt.is=function(e){return e.type instanceof pt};var ft=function(e,t){this.spec=t||vt,this.attrs=e};ft.prototype.map=function(e,t,n,r){var o=e.mapResult(t.from+r,1);if(o.deleted)return null;var i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new ht(o.pos-n,i.pos-n,this)},ft.prototype.valid=function(e,t){var n=e.content.findIndex(t.from),r=n.index,o=n.offset;return o==t.from&&o+e.child(r).nodeSize==t.to},ft.prototype.eq=function(e){return this==e||e instanceof ft&&lt(this.attrs,e.attrs)&&lt(this.spec,e.spec)};var ht=function(e,t,n){this.from=e,this.to=t,this.type=n},dt={spec:{}};ht.prototype.copy=function(e,t){return new ht(e,t,this.type)},ht.prototype.eq=function(e){return this.type.eq(e.type)&&this.from==e.from&&this.to==e.to},ht.prototype.map=function(e,t,n){return this.type.map(e,this,t,n)},ht.widget=function(e,t,n){return new ht(e,e,new ut(t,n))},ht.inline=function(e,t,n,r){return new ht(e,t,new pt(n,r))},ht.node=function(e,t,n,r){return new ht(e,t,new ft(n,r))},dt.spec.get=function(){return this.type.spec},Object.defineProperties(ht.prototype,dt);var mt=[],vt={},gt=function(e,t){this.local=e&&e.length?e:mt,this.children=t&&t.length?t:mt};gt.create=function(e,t){return t.length?xt(t,e,0,vt):yt},gt.prototype.find=function(e,t,n){var r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r},gt.prototype.findInner=function(e,t,n,r,o){for(var i=0;i<this.local.length;i++){var a=this.local[i];a.from<=t&&a.to>=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){var c=this.children[s]+1;this.children[s+2].findInner(e-c,t-c,n,r+c,o)}},gt.prototype.map=function(e,t,n){return this==yt||0==e.maps.length?this:this.mapInner(e,t,0,0,n||vt)},gt.prototype.mapInner=function(e,t,n,r,o){for(var i,a=0;a<this.local.length;a++){var s=this.local[a].map(e,n,r);s&&s.type.valid(t,s)?(i||(i=[])).push(s):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?function(e,t,n,r,o,i,a){for(var s=e.slice(),c=function(e,t,n,r){for(var a=0;a<s.length;a+=3){var c=s[a+1],l=void 0;-1==c||e>c+i||(t>=s[a]+i?s[a+1]=-1:(l=r-n-(t-e)+(i-o))&&(s[a]+=l,s[a+1]+=l))}},l=0;l<n.maps.length;l++)n.maps[l].forEach(c);for(var u=!1,p=0;p<s.length;p+=3)if(-1==s[p+1]){var f=n.map(s[p]+i),h=f-o;if(h<0||h>=r.content.size){u=!0;continue}var d=n.map(e[p+1]+i,-1),m=d-o,v=r.content.findIndex(h),g=v.index,y=v.offset,b=r.maybeChild(g);if(b&&y==h&&y+b.nodeSize==m){var w=s[p+2].mapInner(n,b,f+1,s[p]+i+1,a);w!=yt?(s[p]=h,s[p+1]=m,s[p+2]=w):(s[p+1]=-2,u=!0)}else u=!0}if(u){var k=function(e,t,n,r,o,i,a){function s(e,t){for(var i=0;i<e.local.length;i++){var c=e.local[i].map(r,o,t);c?n.push(c):a.onRemove&&a.onRemove(e.local[i].spec)}for(var l=0;l<e.children.length;l+=3)s(e.children[l+2],e.children[l]+t+1)}for(var c=0;c<e.length;c+=3)-1==e[c+1]&&s(e[c+2],t[c]+i+1);return n}(s,e,t||[],n,o,i,a),_=xt(k,r,0,a);t=_.local;for(var x=0;x<s.length;x+=3)s[x+1]<0&&(s.splice(x,3),x-=3);for(var S=0,O=0;S<_.children.length;S+=3){for(var C=_.children[S];O<s.length&&s[O]<C;)O+=3;s.splice(O,0,_.children[S],_.children[S+1],_.children[S+2])}}return new gt(t&&t.sort(St),s)}(this.children,i,e,t,n,r,o):i?new gt(i.sort(St)):yt},gt.prototype.add=function(e,t){return t.length?this==yt?gt.create(e,t):this.addInner(e,t,0):this},gt.prototype.addInner=function(e,t,n){var r,o=this,i=0;e.forEach(function(e,a){var s,c=a+n;if(s=kt(t,e,c)){for(r||(r=o.children.slice());i<r.length&&r[i]<a;)i+=3;r[i]==a?r[i+2]=r[i+2].addInner(e,s,c+1):r.splice(i,0,a,a+e.nodeSize,xt(s,e,c+1,vt)),i+=3}});var a=wt(i?_t(t):t,-n);return new gt(a.length?this.local.concat(a).sort(St):this.local,r||this.children)},gt.prototype.remove=function(e){return 0==e.length||this==yt?this:this.removeInner(e,0)},gt.prototype.removeInner=function(e,t){for(var n=this.children,r=this.local,o=0;o<n.length;o+=3){for(var i=void 0,a=n[o]+t,s=n[o+1]+t,c=0,l=void 0;c<e.length;c++)(l=e[c])&&l.from>a&&l.to<s&&(e[c]=null,(i||(i=[])).push(l));if(i){n==this.children&&(n=this.children.slice());var u=n[o+2].removeInner(i,a+1);u!=yt?n[o+2]=u:(n.splice(o,3),o-=3)}}if(r.length)for(var p=0,f=void 0;p<e.length;p++)if(f=e[p])for(var h=0;h<r.length;h++)r[h].type.eq(f.type)&&(r==this.local&&(r=this.local.slice()),r.splice(h--,1));return n==this.children&&r==this.local?this:r.length||n.length?new gt(r,n):yt},gt.prototype.forChild=function(e,t){var n,r;if(this==yt)return this;if(t.isLeaf)return gt.empty;for(var o=0;o<this.children.length;o+=3)if(this.children[o]>=e){this.children[o]==e&&(n=this.children[o+2]);break}for(var i=e+1,a=i+t.content.size,s=0;s<this.local.length;s++){var c=this.local[s];if(c.from<a&&c.to>i&&c.type instanceof pt){var l=Math.max(i,c.from)-i,u=Math.min(a,c.to)-i;l<u&&(r||(r=[])).push(c.copy(l,u))}}if(r){var p=new gt(r.sort(St));return n?new bt([p,n]):p}return n||yt},gt.prototype.eq=function(e){if(this==e)return!0;if(!(e instanceof gt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(var t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(var n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!1},gt.prototype.locals=function(e){return Ot(this.localsInner(e))},gt.prototype.localsInner=function(e){if(this==yt)return mt;if(e.inlineContent||!this.local.some(pt.is))return this.local;for(var t=[],n=0;n<this.local.length;n++)this.local[n].type instanceof pt||t.push(this.local[n]);return t};var yt=new gt;gt.empty=yt,gt.removeOverlap=Ot;var bt=function(e){this.members=e};function wt(e,t){if(!t||!e.length)return e;for(var n=[],r=0;r<e.length;r++){var o=e[r];n.push(new ht(o.from+t,o.to+t,o.type))}return n}function kt(e,t,n){if(t.isLeaf)return null;for(var r=n+t.nodeSize,o=null,i=0,a=void 0;i<e.length;i++)(a=e[i])&&a.from>n&&a.to<r&&((o||(o=[])).push(a),e[i]=null);return o}function _t(e){for(var t=[],n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function xt(e,t,n,r){var o=[],i=!1;t.forEach(function(t,a){var s=kt(e,t,a+n);if(s){i=!0;var c=xt(s,t,n+a+1,r);c!=yt&&o.push(a,a+t.nodeSize,c)}});for(var a=wt(i?_t(e):e,-n).sort(St),s=0;s<a.length;s++)a[s].type.valid(t,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||o.length?new gt(a,o):yt}function St(e,t){return e.from-t.from||e.to-t.to}function Ot(e){for(var t=e,n=0;n<t.length-1;n++){var r=t[n];if(r.from!=r.to)for(var o=n+1;o<t.length;o++){var i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),Ct(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),Ct(t,o+1,i.copy(r.to,i.to)))}}return t}function Ct(e,t,n){for(;t<e.length&&St(n,e[t])>0;)t++;e.splice(t,0,n)}function Mt(e){var t=[];return e.someProp("decorations",function(n){var r=n(e.state);r&&r!=yt&&t.push(r)}),e.cursorWrapper&&t.push(gt.create(e.state.doc,[e.cursorWrapper.deco])),bt.from(t)}bt.prototype.forChild=function(e,t){if(t.isLeaf)return gt.empty;for(var n=[],r=0;r<this.members.length;r++){var o=this.members[r].forChild(e,t);o!=yt&&(o instanceof bt?n=n.concat(o.members):n.push(o))}return bt.from(n)},bt.prototype.eq=function(e){if(!(e instanceof bt)||e.members.length!=this.members.length)return!1;for(var t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0},bt.prototype.locals=function(e){for(var t,n=!0,r=0;r<this.members.length;r++){var o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(var i=0;i<o.length;i++)t.push(o[i])}else t=o}return t?Ot(n?t:t.sort(St)):mt},bt.from=function(e){switch(e.length){case 0:return yt;case 1:return e[0];default:return new bt(e)}};var Et=function(e,t){this._props=t,this.state=t.state,this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):e.apply?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Pt(this),this.cursorWrapper=null,At(this),this.nodeViews=zt(this),this.docView=q(this.state.doc,Tt(this),Mt(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,function(e){e.shiftKey=!1,e.mouseDown=null,e.lastKeyCode=null,e.lastKeyCodeTime=0,e.lastClick={time:0,x:0,y:0,type:""},e.lastSelectionOrigin=null,e.lastSelectionTime=0,e.composing=!1,e.composingTimeout=null,e.compositionNodes=[],e.compositionEndedAt=-2e8,e.domObserver=new $e(e,function(t,n,r){return Ne(e,t,n,r)}),e.domObserver.start(),e.domChangeCount=0,e.eventHandlers=Object.create(null);var t=function(t){var n=Ve[t];e.dom.addEventListener(t,e.eventHandlers[t]=function(t){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||We(e,t)||!e.editable&&t.type in Le||n(e,t)})};for(var n in Ve)t(n);a.safari&&e.dom.addEventListener("input",function(){return null}),qe(e)}(this),this.pluginViews=[],this.updatePluginViews()},Nt={props:{},root:{}};function Tt(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var r in n)"class"==r?t.class+=" "+n[r]:t[r]||"contenteditable"==r||"nodeName"==r||(t[r]=String(n[r]))}),[ht.node(0,e.state.doc.content.size,t)]}function At(e){var t=Me(e.state);if(!t||a.ie&&e.mouseDown)e.cursorWrapper=null;else{var n,o=e.state.selection.visible,i=e.state.storedMarks||t.marks();e.cursorWrapper&&r.Mark.sameSet(e.cursorWrapper.deco.spec.marks,i)&&"\ufeff"==e.cursorWrapper.dom.textContent&&e.cursorWrapper.deco.spec.visible==o?e.cursorWrapper.deco.pos!=t.pos&&(n=e.cursorWrapper.dom):n=function(e){var t=document.createElement("span");return t.textContent="\ufeff",e||(t.style.position="absolute",t.style.left="-100000px"),t}(o),n&&(e.cursorWrapper={dom:n,deco:ht.widget(t.pos,n,{isCursorWrapper:!0,marks:i,raw:!0,visible:o})})}}function Pt(e){return!e.someProp("editable",function(t){return!1===t(e.state)})}function Dt(e){var t=e.getSelection(),n=t.focusOffset,r=t.focusNode;return r&&3!=r.nodeType?[r,n,1==r.nodeType?r.childNodes[n-1]:null,1==r.nodeType?r.childNodes[n]:null]:null}function zt(e){var t={};return e.someProp("nodeViews",function(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}),t}Nt.props.get=function(){if(this._props.state!=this.state){var e=this._props;for(var t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props},Et.prototype.update=function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&qe(this),this._props=e,this.updateStateInner(e.state,!0)},Et.prototype.setProps=function(e){var t={};for(var n in this._props)t[n]=this._props[n];for(var r in t.state=this.state,e)t[r]=e[r];this.update(t)},Et.prototype.updateState=function(e){this.updateStateInner(e,this.state.plugins!=e.plugins)},Et.prototype.updateStateInner=function(e,t){var n=this,r=this.state,i=!1;if(this.state=e,t){var s=zt(this);(function(e,t){var n=0,r=0;for(var o in e){if(e[o]!=t[o])return!0;n++}for(var i in t)r++;return n!=r})(s,this.nodeViews)&&(this.nodeViews=s,i=!0),qe(this)}this.editable=Pt(this),At(this);var c,l,u,p=Mt(this),f=Tt(this),d=t?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",v=i||!this.docView.matchesNode(e.doc,f,p),g=v||!e.selection.eq(r.selection),y="preserve"==d&&g&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=e.dom.ownerDocument,a=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){var c=e.root.elementFromPoint(a,s);if(c!=e.dom&&e.dom.contains(c)){var l=c.getBoundingClientRect();if(l.top>=o-20){t=c,n=l.top;break}}}for(var u=[],p=e.dom;p&&(u.push({dom:p,top:p.scrollTop,left:p.scrollLeft}),p!=i.body);p=h(p));return{refDOM:t,refTop:n,stack:u}}(this);if(g){this.domObserver.stop();var b=!1;if(v){var w=a.chrome&&Dt(this.root);!i&&this.docView.update(e.doc,f,p,this)||(this.docView.destroy(),this.docView=q(e.doc,f,p,this.dom,this)),w&&(b=function(e,t){var n=Dt(t);if(!n||3==n[0].nodeType)return!1;for(var r=0;r<e.length;r++)if(n[r]!=e[r])return!0;return!1}(w,this.root))}b||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(c=this,l=c.docView.domFromPos(c.state.selection.anchor),u=c.root.getSelection(),m(l.node,l.offset,u.anchorNode,u.anchorOffset)))?be(this,!1,b):(_e(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),"reset"==d)this.dom.scrollTop=0;else if("to selection"==d){var k=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",function(e){return e(n)})||(e.selection instanceof o.NodeSelection?x(this,this.docView.domAfterPos(e.selection.from).getBoundingClientRect(),k):x(this,this.coordsAtPos(e.selection.head),k))}else y&&function(e){for(var t=e.refDOM,n=e.refTop,r=e.stack,o=t?t.getBoundingClientRect().top:0,i=0==o?0:o-n,a=0;a<r.length;a++){var s=r[a],c=s.dom,l=s.top,u=s.left;c.scrollTop!=l+i&&(c.scrollTop=l+i),c.scrollLeft!=u&&(c.scrollLeft=u)}}(y)},Et.prototype.destroyPluginViews=function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()},Et.prototype.updatePluginViews=function(e){if(e&&e.plugins==this.state.plugins)for(var t=0;t<this.pluginViews.length;t++){var n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.destroyPluginViews();for(var r=0;r<this.state.plugins.length;r++){var o=this.state.plugins[r];o.spec.view&&this.pluginViews.push(o.spec.view(this))}}},Et.prototype.someProp=function(e,t){var n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;var o=this.state.plugins;if(o)for(var i=0;i<o.length;i++){var a=o[i].props[e];if(null!=a&&(n=t?t(a):a))return n}},Et.prototype.hasFocus=function(){return this.root.activeElement==this.dom},Et.prototype.focus=function(){this.domObserver.stop(),be(this,!0),this.domObserver.start(),this.editable&&this.dom.focus()},Nt.root.get=function(){var e=this._root;if(null==e)for(var t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return this._root=t;return e||document},Et.prototype.posAtCoords=function(e){return C(this,e)},Et.prototype.coordsAtPos=function(e){return E(this,e)},Et.prototype.domAtPos=function(e){return this.docView.domFromPos(e)},Et.prototype.nodeDOM=function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null},Et.prototype.posAtDOM=function(e,t,n){void 0===n&&(n=-1);var r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r},Et.prototype.endOfTextblock=function(e,t){return j(this,t||this.state,e)},Et.prototype.destroy=function(){this.docView&&(!function(e){for(var t in e.domObserver.stop(),e.eventHandlers)e.dom.removeEventListener(t,e.eventHandlers[t]);clearTimeout(e.composingTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Mt(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},Et.prototype.dispatchEvent=function(e){return function(e,t){We(e,t)||!Ve[t.type]||!e.editable&&t.type in Le||Ve[t.type](e,t)}(this,e)},Et.prototype.dispatch=function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))},Object.defineProperties(Et.prototype,Nt),t.EditorView=Et,t.Decoration=ht,t.DecorationSet=gt,t.__serializeForClipboard=Pe,t.__parseFromClipboard=De,t.__endComposition=rt},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,i=n(2),a=n(8),s=n(1),c=n(3),l=n(10);if("undefined"!=typeof WeakMap){var u=new WeakMap;r=function(e){return u.get(e)},o=function(e,t){return u.set(e,t),t}}else{var p=[],f=0;r=function(e){for(var t=0;t<p.length;t+=2)if(p[t]==e)return p[t+1]},o=function(e,t){return 10==f&&(f=0),p[f++]=e,p[f++]=t}}var h=function(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r},d=function(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r};function m(e){if(e.colwidth)return e.colwidth.slice();for(var t=[],n=0;n<e.colspan;n++)t.push(0);return t}d.prototype.findCell=function(e){for(var t=0;t<this.map.length;t++){var n=this.map[t];if(n==e){for(var r=t%this.width,o=t/this.width|0,i=r+1,a=o+1,s=1;i<this.width&&this.map[t+s]==n;s++)i++;for(var c=1;a<this.height&&this.map[t+this.width*c]==n;c++)a++;return new h(r,o,i,a)}}throw new RangeError("No cell with offset "+e+" found")},d.prototype.colCount=function(e){for(var t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError("No cell with offset "+e+" found")},d.prototype.nextCell=function(e,t,n){var r=this.findCell(e),o=r.left,i=r.right,a=r.top,s=r.bottom;return"horiz"==t?(n<0?0==o:i==this.width)?null:this.map[a*this.width+(n<0?o-1:i)]:(n<0?0==a:s==this.height)?null:this.map[o+this.width*(n<0?a-1:s)]},d.prototype.rectBetween=function(e,t){var n=this.findCell(e),r=n.left,o=n.right,i=n.top,a=n.bottom,s=this.findCell(t),c=s.left,l=s.right,u=s.top,p=s.bottom;return new h(Math.min(r,c),Math.min(i,u),Math.max(o,l),Math.max(a,p))},d.prototype.cellsInRect=function(e){for(var t=[],n={},r=e.top;r<e.bottom;r++)for(var o=e.left;o<e.right;o++){var i=r*this.width+o,a=this.map[i];n[a]||(n[a]=!0,o==e.left&&o&&this.map[i-1]==a||r==e.top&&r&&this.map[i-this.width]==a||t.push(a))}return t},d.prototype.positionAt=function(e,t,n){for(var r=0,o=0;;r++){var i=o+n.child(r).nodeSize;if(r==e){for(var a=t+e*this.width,s=(e+1)*this.width;a<s&&this.map[a]<o;)a++;return a==s?i-1:this.map[a]}o=i}},d.get=function(e){return r(e)||o(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);for(var t=function(e){for(var t=-1,n=!1,r=0;r<e.childCount;r++){var o=e.child(r),i=0;if(n)for(var a=0;a<r;a++)for(var s=e.child(a),c=0;c<s.childCount;c++){var l=s.child(c);a+l.attrs.rowspan>r&&(i+=l.attrs.colspan)}for(var u=0;u<o.childCount;u++){var p=o.child(u);i+=p.attrs.colspan,p.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,a=[],s=0,c=t*n;s<c;s++)r[s]=0;for(var l=0,u=0;l<n;l++){var p=e.child(l);u++;for(var f=0;;f++){for(;o<r.length&&0!=r[o];)o++;if(f==p.childCount)break;for(var h=p.child(f),v=h.attrs,g=v.colspan,y=v.rowspan,b=v.colwidth,w=0;w<y;w++){if(w+l>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:y-w});break}for(var k=o+w*t,_=0;_<g;_++){0==r[k+_]?r[k+_]=u:(i||(i=[])).push({type:"collision",row:l,pos:u,n:g-_});var x=b&&b[_];if(x){var S=(k+_)%t*2,O=a[S];null==O||O!=x&&1==a[S+1]?(a[S]=x,a[S+1]=1):O==x&&a[S+1]++}}}o+=g,u+=h.nodeSize}for(var C=(l+1)*t,M=0;o<C;)0==r[o++]&&M++;M&&(i||(i=[])).push({type:"missing",row:l,n:M}),u++}for(var E=new d(t,n,r,i),N=!1,T=0;!N&&T<a.length;T+=2)null!=a[T]&&a[T+1]<n&&(N=!0);N&&function(e,t,n){e.problems||(e.problems=[]);for(var r=0,o={};r<e.map.length;r++){var i=e.map[r];if(!o[i]){o[i]=!0;for(var a=n.nodeAt(i),s=null,c=0;c<a.attrs.colspan;c++){var l=(r+c)%e.width,u=t[2*l];null==u||a.attrs.colwidth&&a.attrs.colwidth[c]==u||((s||(s=m(a.attrs)))[c]=u)}s&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:s})}}}(E,a,e);return E}(e))};var v=new i.PluginKey("selectingCells");function g(e){for(var t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function y(e){for(var t=e.selection.$head,n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function b(e){var t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:g(t.$head)||function(e){for(var t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){var r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(var o=e.nodeBefore,i=e.pos;o;o=o.lastChild,i--){var a=o.type.spec.tableRole;if("cell"==a||"header_cell"==a)return e.doc.resolve(i-o.nodeSize)}}(t.$head)}function w(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function k(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function _(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function x(e,t,n){var r=e.start(-1),o=d.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==o?null:e.node(0).resolve(r+o)}function S(e,t,n){var r={};for(var o in e)r[o]=e[o];return r[t]=n,r}function O(e,t,n){void 0===n&&(n=1);var r=S(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(function(e){return e>0})||(r.colwidth=null)),r}function C(e,t,n){void 0===n&&(n=1);var r=S(e,"colspan",e.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(var o=0;o<n;o++)r.colwidth.splice(t,0,0)}return r}var M=function(e){function t(t,n){void 0===n&&(n=t);var r=t.node(-1),o=d.get(r),a=t.start(-1),s=o.rectBetween(t.pos-a,n.pos-a),c=t.node(0),l=o.cellsInRect(s).filter(function(e){return e!=n.pos-a});l.unshift(n.pos-a);var u=l.map(function(e){var t=r.nodeAt(e),n=e+a+1;return new i.SelectionRange(c.resolve(n),c.resolve(n+t.content.size))});e.call(this,u[0].$from,u[0].$to,u),this.$anchorCell=t,this.$headCell=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(e,n){var r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(w(r)&&w(o)&&_(r,o)){var a=this.$anchorCell.node(-1)!=r.node(-1);return a&&this.isRowSelection()?t.rowSelection(r,o):a&&this.isColSelection()?t.colSelection(r,o):new t(r,o)}return i.TextSelection.between(r,o)},t.prototype.content=function(){for(var e=this.$anchorCell.node(-1),t=d.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[],a=r.top;a<r.bottom;a++){for(var c=[],l=a*t.width+r.left,u=r.left;u<r.right;u++,l++){var p=t.map[l];if(!o[p]){o[p]=!0;var f=t.findCell(p),h=e.nodeAt(p),m=r.left-f.left,v=f.right-r.right;if(m>0||v>0){var g=h.attrs;m>0&&(g=O(g,0,m)),v>0&&(g=O(g,g.colspan-v,v)),h=f.left<r.left?h.type.createAndFill(g):h.type.create(g,h.content)}if(f.top<r.top||f.bottom>r.bottom){var y=S(h.attrs,"rowspan",Math.min(f.bottom,r.bottom)-Math.max(f.top,r.top));h=f.top<r.top?h.type.createAndFill(y):h.type.create(y,h.content)}c.push(h)}}i.push(e.child(a).copy(s.Fragment.from(c)))}var b=this.isColSelection()&&this.isRowSelection()?e:i;return new s.Slice(s.Fragment.from(b),1,1)},t.prototype.replace=function(t,n){void 0===n&&(n=s.Slice.empty);for(var r=t.steps.length,o=this.ranges,i=0;i<o.length;i++){var a=o[i],c=a.$from,l=a.$to,u=t.mapping.slice(r);t.replace(u.map(c.pos),u.map(l.pos),i?s.Slice.empty:n)}var p=e.findFrom(t.doc.resolve(t.mapping.slice(r).map(this.to)),-1);p&&t.setSelection(p)},t.prototype.replaceWith=function(e,t){this.replace(e,new s.Slice(s.Fragment.from(t),0,0))},t.prototype.forEachCell=function(e){for(var t=this.$anchorCell.node(-1),n=d.get(t),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r)),i=0;i<o.length;i++)e(t.nodeAt(o[i]),r+o[i])},t.prototype.isColSelection=function(){var e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;var n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount},t.colSelection=function(e,n){void 0===n&&(n=e);var r=d.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),a=r.findCell(n.pos-o),s=e.node(0);return i.top<=a.top?(i.top>0&&(e=s.resolve(o+r.map[i.left])),a.bottom<r.height&&(n=s.resolve(o+r.map[r.width*(r.height-1)+a.right-1]))):(a.top>0&&(n=s.resolve(o+r.map[a.left])),i.bottom<r.height&&(e=s.resolve(o+r.map[r.width*(r.height-1)+i.right-1]))),new t(e,n)},t.prototype.isRowSelection=function(){var e=d.get(this.$anchorCell.node(-1)),t=this.$anchorCell.start(-1),n=e.colCount(this.$anchorCell.pos-t),r=e.colCount(this.$headCell.pos-t);if(Math.min(n,r)>0)return!1;var o=n+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,i)==e.width},t.prototype.eq=function(e){return e instanceof t&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos},t.rowSelection=function(e,n){void 0===n&&(n=e);var r=d.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),a=r.findCell(n.pos-o),s=e.node(0);return i.left<=a.left?(i.left>0&&(e=s.resolve(o+r.map[i.top*r.width])),a.right<r.width&&(n=s.resolve(o+r.map[r.width*(a.top+1)-1]))):(a.left>0&&(n=s.resolve(o+r.map[a.top*r.width])),i.right<r.width&&(e=s.resolve(o+r.map[r.width*(i.top+1)-1]))),new t(e,n)},t.prototype.toJSON=function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}},t.fromJSON=function(e,n){return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,n,r){return void 0===r&&(r=n),new t(e.resolve(n),e.resolve(r))},t.prototype.getBookmark=function(){return new E(this.$anchorCell.pos,this.$headCell.pos)},t}(i.Selection);M.prototype.visible=!1,i.Selection.jsonID("cell",M);var E=function(e,t){this.anchor=e,this.head=t};function N(e){if(!(e.selection instanceof M))return null;var t=[];return e.selection.forEachCell(function(e,n){t.push(a.Decoration.node(n,n+e.nodeSize,{class:"selectedCell"}))}),a.DecorationSet.create(e.doc,t)}function T(e,t){var n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(function(e){return Number(e)}):null,o=Number(e.getAttribute("colspan")||1),i={colspan:o,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==o?r:null};for(var a in t){var s=t[a].getFromDOM,c=s&&s(e);null!=c&&(i[a]=c)}return i}function A(e,t){var n={};for(var r in 1!=e.attrs.colspan&&(n.colspan=e.attrs.colspan),1!=e.attrs.rowspan&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(",")),t){var o=t[r].setDOMAttr;o&&o(e.attrs[r],n)}return n}function P(e){var t=e.cached.tableNodeTypes;if(!t)for(var n in t=e.cached.tableNodeTypes={},e.nodes){var r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}return t}function D(e){if(!e.size)return null;for(var t=e.content,n=e.openStart,r=e.openEnd;1==t.childCount&&(n>0&&r>0||"table"==t.firstChild.type.spec.tableRole);)n--,r--,t=t.firstChild.content;var o=t.firstChild,i=o.type.spec.tableRole,a=o.type.schema,c=[];if("row"==i)for(var l=0;l<t.childCount;l++){var u=t.child(l).content,p=l?0:Math.max(0,n-1),f=l<t.childCount-1?0:Math.max(0,r-1);(p||f)&&(u=z(P(a).row,new s.Slice(u,p,f)).content),c.push(u)}else{if("cell"!=i&&"header_cell"!=i)return null;c.push(n||r?z(P(a).row,new s.Slice(t,n,r)).content:t)}return function(e,t){for(var n=[],r=0;r<t.length;r++)for(var o=t[r],i=o.childCount-1;i>=0;i--)for(var a=o.child(i).attrs,c=a.rowspan,l=a.colspan,u=r;u<r+c;u++)n[u]=(n[u]||0)+l;for(var p=0,f=0;f<n.length;f++)p=Math.max(p,n[f]);for(var h=0;h<n.length;h++)if(h>=t.length&&t.push(s.Fragment.empty),n[h]<p){for(var d=P(e).cell.createAndFill(),m=[],v=n[h];v<p;v++)m.push(d);t[h]=t[h].append(s.Fragment.from(m))}return{height:t.length,width:p,rows:t}}(a,c)}function z(e,t){var n=e.createAndFill();return new c.Transform(n).replace(0,n.content.size,t).doc}function j(e,t,n){var r=e.width,o=e.height,i=e.rows;if(r!=t){for(var a=[],c=[],l=0;l<i.length;l++){for(var u=i[l],p=[],f=a[l]||0,h=0;f<t;h++){var d=u.child(h%u.childCount);f+d.attrs.colspan>t&&(d=d.type.create(O(d.attrs,d.attrs.colspan,f+d.attrs.colspan-t),d.content)),p.push(d),f+=d.attrs.colspan;for(var m=1;m<d.attrs.rowspan;m++)a[l+m]=(a[l+m]||0)+d.attrs.colspan}c.push(s.Fragment.from(p))}i=c,r=t}if(o!=n){for(var v=[],g=0,y=0;g<n;g++,y++){for(var b=[],w=i[y%o],k=0;k<w.childCount;k++){var _=w.child(k);g+_.attrs.rowspan>n&&(_=_.type.create(S(_.attrs,"rowspan",n-_.attrs.rowspan),_.content)),b.push(_)}v.push(s.Fragment.from(b))}i=v,o=n}return{width:r,height:o,rows:i}}function R(e,t,n,r,o,i,a,s){if(0==a||a==t.height)return!1;for(var c=!1,l=o;l<i;l++){var u=a*t.width+l,p=t.map[u];if(t.map[u-t.width]==p){c=!0;var f=n.nodeAt(p),h=t.findCell(p),d=h.top,m=h.left;e.setNodeMarkup(e.mapping.slice(s).map(p+r),null,S(f.attrs,"rowspan",a-d)),e.insert(e.mapping.slice(s).map(t.positionAt(a,m,n)),f.type.createAndFill(S(f.attrs,"rowspan",d+f.attrs.rowspan-a))),l+=f.attrs.colspan-1}}return c}function I(e,t,n,r,o,i,a,s){if(0==a||a==t.width)return!1;for(var c=!1,l=o;l<i;l++){var u=l*t.width+a,p=t.map[u];if(t.map[u-1]==p){c=!0;var f=n.nodeAt(p),h=t.colCount(p),d=e.mapping.slice(s).map(p+r);e.setNodeMarkup(d,null,O(f.attrs,a-h,f.attrs.colspan-(a-h))),e.insert(d+f.nodeSize,f.type.createAndFill(O(f.attrs,0,a-h))),l+=f.attrs.rowspan-1}}return c}function B(e,t,n,r,o){var i=n?e.doc.nodeAt(n-1):e.doc,a=d.get(i),c=r.top,l=r.left,u=l+o.width,p=c+o.height,f=e.tr,h=0;function m(){i=n?f.doc.nodeAt(n-1):f.doc,a=d.get(i),h=f.mapping.maps.length}(function(e,t,n,r,o,i,a){var c,l,u=P(e.doc.type.schema);if(o>t.width)for(var p=0,f=0;p<t.height;p++){var h=n.child(p);f+=h.nodeSize;var d=[],m=void 0;m=null==h.lastChild||h.lastChild.type==u.cell?c||(c=u.cell.createAndFill()):l||(l=u.header_cell.createAndFill());for(var v=t.width;v<o;v++)d.push(m);e.insert(e.mapping.slice(a).map(f-1+r),d)}if(i>t.height){for(var g=[],y=0,b=(t.height-1)*t.width;y<Math.max(t.width,o);y++){var w=!(y>=t.width)&&n.nodeAt(t.map[b+y]).type==u.header_cell;g.push(w?l||(l=u.header_cell.createAndFill()):c||(c=u.cell.createAndFill()))}for(var k=u.row.create(null,s.Fragment.from(g)),_=[],x=t.height;x<i;x++)_.push(k);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),_)}return!(!c&&!l)})(f,a,i,n,u,p,h)&&m(),R(f,a,i,n,l,u,c,h)&&m(),R(f,a,i,n,l,u,p,h)&&m(),I(f,a,i,n,c,p,l,h)&&m(),I(f,a,i,n,c,p,u,h)&&m();for(var v=c;v<p;v++){var g=a.positionAt(v,l,i),y=a.positionAt(v,u,i);f.replace(f.mapping.slice(h).map(g+n),f.mapping.slice(h).map(y+n),new s.Slice(o.rows[v-c],0,0))}m(),f.setSelection(new M(f.doc.resolve(n+a.positionAt(c,l,i)),f.doc.resolve(n+a.positionAt(p-1,u-1,i)))),t(f)}E.prototype.map=function(e){return new E(e.map(this.anchor),e.map(this.head))},E.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&_(t,n)?new M(t,n):i.Selection.near(n,1)};var F=l.keydownHandler({ArrowLeft:V("horiz",-1),ArrowRight:V("horiz",1),ArrowUp:V("vert",-1),ArrowDown:V("vert",1),"Shift-ArrowLeft":L("horiz",-1),"Shift-ArrowRight":L("horiz",1),"Shift-ArrowUp":L("vert",-1),"Shift-ArrowDown":L("vert",1),Backspace:H,"Mod-Backspace":H,Delete:H,"Mod-Delete":H});function $(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function V(e,t){return function(n,r,o){var a=n.selection;if(a instanceof M)return $(n,r,i.Selection.near(a.$headCell,t));if("horiz"!=e&&!a.empty)return!1;var s=K(o,e,t);if(null==s)return!1;if("horiz"==e)return $(n,r,i.Selection.near(n.doc.resolve(a.head+t),t));var c,l=n.doc.resolve(s),u=x(l,e,t);return c=u?i.Selection.near(u,1):t<0?i.Selection.near(n.doc.resolve(l.before(-1)),-1):i.Selection.near(n.doc.resolve(l.after(-1)),1),$(n,r,c)}}function L(e,t){return function(n,r,o){var i=n.selection;if(!(i instanceof M)){var a=K(o,e,t);if(null==a)return!1;i=new M(n.doc.resolve(a))}var s=x(i.$headCell,e,t);return!!s&&$(n,r,new M(i.$anchorCell,s))}}function H(e,t){var n=e.selection;if(!(n instanceof M))return!1;if(t){var r=e.tr,o=P(e.schema).cell.createAndFill().content;n.forEachCell(function(e,t){e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new s.Slice(o,0,0))}),r.docChanged&&t(r)}return!0}function q(e,t){var n=g(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new M(n))),!0)}function W(e,t,n){if(!y(e.state))return!1;var r=D(n),o=e.state.selection;if(o instanceof M){r||(r={width:1,height:1,rows:[s.Fragment.from(z(P(e.state.schema).cell,n))]});var i=o.$anchorCell.node(-1),a=o.$anchorCell.start(-1),c=d.get(i).rectBetween(o.$anchorCell.pos-a,o.$headCell.pos-a);return r=j(r,c.right-c.left,c.bottom-c.top),B(e.state,e.dispatch,a,c,r),!0}if(r){var l=b(e.state),u=l.start(-1);return B(e.state,e.dispatch,u,d.get(l.node(-1)).findCell(l.pos-u),r),!0}return!1}function J(e,t){if(!t.ctrlKey&&!t.metaKey){var n,r=U(e,t.target);if(t.shiftKey&&e.state.selection instanceof M)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(n=g(e.state.selection.$anchor))&&Q(e,t).pos!=n.pos)o(n,t),t.preventDefault();else if(!r)return;e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",a)}function o(t,n){var r=Q(e,n),o=null==v.getState(e.state);if(!r||!_(t,r)){if(!o)return;r=t}var i=new M(t,r);if(o||!e.state.selection.eq(i)){var a=e.state.tr.setSelection(i);o&&a.setMeta(v,t.pos),e.dispatch(a)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",a),null!=v.getState(e.state)&&e.dispatch(e.state.tr.setMeta(v,-1))}function a(n){var a,s=v.getState(e.state);if(null!=s)a=e.state.doc.resolve(s);else if(U(e,n.target)!=r&&!(a=Q(e,t)))return i();a&&o(a,n)}}function K(e,t,n){if(!(e.state.selection instanceof i.TextSelection))return null;for(var r=e.state.selection.$head,o=r.depth-1;o>=0;o--){var a=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:a.childCount))return null;if("cell"==a.type.spec.tableRole||"header_cell"==a.type.spec.tableRole){var s=r.before(o),c="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(c)?s:null}}return null}function U(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function Q(e,t){var n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?g(e.state.doc.resolve(n.pos)):null}function G(e,t){var n,r=function(t,r){"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){var o=d.get(t);if(!o.problems)return r;r||(r=e.tr);for(var i,a,s=[],c=0;c<o.height;c++)s.push(0);for(var l=0;l<o.problems.length;l++){var u=o.problems[l];if("collision"==u.type){for(var p=t.nodeAt(u.pos),f=0;f<p.attrs.rowspan;f++)s[u.row+f]+=u.n;r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,O(p.attrs,p.attrs.colspan-u.n,u.n))}else if("missing"==u.type)s[u.row]+=u.n;else if("overlong_rowspan"==u.type){var h=t.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,S(h.attrs,"rowspan",h.attrs.rowspan-u.n))}else if("colwidth mismatch"==u.type){var m=t.nodeAt(u.pos);r.setNodeMarkup(r.mapping.map(n+1+u.pos),null,S(m.attrs,"colwidth",u.colwidth))}}for(var v=0;v<s.length;v++)s[v]&&(null==i&&(i=v),a=v);for(var g=0,y=n+1;g<o.height;g++){var b=t.child(g),w=y+b.nodeSize,k=s[g];if(k>0){var _="cell";b.firstChild&&(_=b.firstChild.type.spec.tableRole);for(var x=[],C=0;C<k;C++)x.push(P(e.schema)[_].createAndFill());var M=0!=g&&i!=g-1||a!=g?w-1:y+1;r.insert(r.mapping.map(M),x)}y=w}return r}(e,t,r,n))};return t?t.doc!=e.doc&&function e(t,n,r,o){var i=t.childCount,a=n.childCount;e:for(var s=0,c=0;s<a;s++){for(var l=n.child(s),u=c,p=Math.min(i,s+3);u<p;u++)if(t.child(u)==l){c=u+1,r+=l.nodeSize;continue e}o(l,r),c<i&&t.child(c).sameMarkup(l)?e(t.child(c),l,r+1,o):l.nodesBetween(0,l.content.size,o,r+1),r+=l.nodeSize}}(t.doc,e.doc,0,r):e.doc.descendants(r),n}function Z(e){var t,n=e.selection,r=b(e),o=r.node(-1),i=r.start(-1),a=d.get(o);return(t=n instanceof M?a.rectBetween(n.$anchorCell.pos-i,n.$headCell.pos-i):a.findCell(r.pos-i)).tableStart=i,t.map=a,t.table=o,t}function X(e,t,n){var r=t.map,o=t.tableStart,i=t.table,a=n>0?-1:0;(function(e,t,n){for(var r=P(t.type.schema).header_cell,o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0})(r,i,n+a)&&(a=0==n||n==r.width?null:0);for(var s=0;s<r.height;s++){var c=s*r.width+n;if(n>0&&n<r.width&&r.map[c-1]==r.map[c]){var l=r.map[c],u=i.nodeAt(l);e.setNodeMarkup(e.mapping.map(o+l),null,C(u.attrs,n-r.colCount(l))),s+=u.attrs.rowspan-1}else{var p=null==a?P(i.type.schema).cell:i.nodeAt(r.map[c+a]).type,f=r.positionAt(s,n,i);e.insert(e.mapping.map(o+f),p.createAndFill())}}return e}function Y(e,t,n){for(var r=t.map,o=t.table,i=t.tableStart,a=e.mapping.maps.length,s=0;s<r.height;){var c=s*r.width+n,l=r.map[c],u=o.nodeAt(l);if(n>0&&r.map[c-1]==l||n<r.width-1&&r.map[c+1]==l)e.setNodeMarkup(e.mapping.slice(a).map(i+l),null,O(u.attrs,n-r.colCount(l)));else{var p=e.mapping.slice(a).map(i+l);e.delete(p,p+u.nodeSize)}s+=u.attrs.rowspan}}function ee(e,t,n){for(var r=t.map,o=t.tableStart,i=t.table,a=o,s=0;s<n;s++)a+=i.child(s).nodeSize;var c=[],l=n>0?-1:0;(function(e,t,n){for(var r=P(t.type.schema).header_cell,o=0;o<e.width;o++)if(t.nodeAt(e.map[o+n*e.width]).type!=r)return!1;return!0})(r,i,n+l)&&(l=0==n||n==r.height?null:0);for(var u=0,p=r.width*n;u<r.width;u++,p++)if(n>0&&n<r.height&&r.map[p]==r.map[p-r.width]){var f=r.map[p],h=i.nodeAt(f).attrs;e.setNodeMarkup(o+f,null,S(h,"rowspan",h.rowspan+1)),u+=h.colspan-1}else{var d=null==l?P(i.type.schema).cell:i.nodeAt(r.map[p+l*r.width]).type;c.push(d.createAndFill())}return e.insert(a,P(i.type.schema).row.create(null,c)),e}function te(e,t,n){for(var r=t.map,o=t.table,i=t.tableStart,a=0,s=0;s<n;s++)a+=o.child(s).nodeSize;var c=a+o.child(n).nodeSize,l=e.mapping.maps.length;e.delete(a+i,c+i);for(var u=0,p=n*r.width;u<r.width;u++,p++){var f=r.map[p];if(n>0&&f==r.map[p-r.width]){var h=o.nodeAt(f).attrs;e.setNodeMarkup(e.mapping.slice(l).map(f+i),null,S(h,"rowspan",h.rowspan-1)),u+=h.colspan-1}else if(n<r.width&&f==r.map[p+r.width]){var d=o.nodeAt(f),m=d.type.create(S(d.attrs,"rowspan",d.attrs.rowspan-1),d.content),v=r.positionAt(n+1,u,o);e.insert(e.mapping.slice(l).map(i+v),m),u+=d.attrs.colspan-1}}}function ne(e){var t=e.content;return 1==t.childCount&&t.firstChild.isTextblock&&0==t.firstChild.childCount}function re(e,t,n){for(var r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1}),o=0;o<r.length;o++){var i=t.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function oe(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!y(t))return!1;if(n){for(var r=P(t.schema),o=Z(t),i=t.tr,a=o.map.cellsInRect("column"==e?new h(o.left,0,o.right,o.map.height):"row"==e?new h(0,o.top,o.map.width,o.bottom):o),s=a.map(function(e){return o.table.nodeAt(e)}),c=0;c<a.length;c++)s[c].type==r.header_cell&&i.setNodeMarkup(o.tableStart+a[c],r.cell,s[c].attrs);if(0==i.steps.length)for(var l=0;l<a.length;l++)i.setNodeMarkup(o.tableStart+a[l],r.header_cell,s[l].attrs);n(i)}return!0}}(e):function(t,n){if(!y(t))return!1;if(n){var r=P(t.schema),o=Z(t),i=t.tr,a=re("row",o,r),s=re("column",o,r),c=("column"===e?a:"row"===e&&s)?1:0,l="column"==e?new h(0,c,1,o.map.height):"row"==e?new h(c,0,o.map.width,1):o,u="column"==e?s?r.cell:r.header_cell:"row"==e?a?r.cell:r.header_cell:r.cell;o.map.cellsInRect(l).forEach(function(e){var t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,u,n.attrs)}),n(i)}return!0}}var ie=oe("row",{useDeprecatedLogic:!0}),ae=oe("column",{useDeprecatedLogic:!0}),se=oe("cell",{useDeprecatedLogic:!0});var ce=function(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),le(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))};function le(e,t,n,r,o,i){for(var a=0,s=!0,c=t.firstChild,l=e.firstChild,u=0,p=0;u<l.childCount;u++)for(var f=l.child(u).attrs,h=f.colspan,d=f.colwidth,m=0;m<h;m++,p++){var v=o==p?i:d&&d[m],g=v?v+"px":"";a+=v||r,v||(s=!1),c?(c.style.width!=g&&(c.style.width=g),c=c.nextSibling):t.appendChild(document.createElement("col")).style.width=g}for(;c;){var y=c.nextSibling;c.parentNode.removeChild(c),c=y}s?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}ce.prototype.update=function(e){return e.type==this.node.type&&(this.node=e,le(e,this.colgroup,this.table,this.cellMinWidth),!0)},ce.prototype.ignoreMutation=function(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))};var ue=new i.PluginKey("tableColumnResizing");var pe=function(e,t){this.activeHandle=e,this.dragging=t};function fe(e,t,n){var r=e.posAtCoords({left:t.clientX,top:t.clientY}).pos,o=g(e.state.doc.resolve(r));if(!o)return-1;if("right"==n)return o.pos;var i=d.get(o.node(-1)),a=o.start(-1),s=i.map.indexOf(o.pos-a);return s%i.width==0?-1:a+i.map[s-1]}function he(e,t,n){var r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function de(e,t){e.dispatch(e.state.tr.setMeta(ue,{setHandle:t}))}function me(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}pe.prototype.apply=function(e){var t=this,n=e.getMeta(ue);if(n&&null!=n.setHandle)return new pe(n.setHandle,null);if(n&&void 0!==n.setDragging)return new pe(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){var r=e.mapping.map(t.activeHandle,-1);w(e.doc.resolve(r))||(r=null),t=new pe(r,t.dragging)}return t},t.tableEditing=function(e){void 0===e&&(e={});var t=e.allowTableNodeSelection;return void 0===t&&(t=!1),new i.Plugin({key:v,state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(v);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;var r=e.mapping.mapResult(t),o=r.deleted,i=r.pos;return o?null:i}},props:{decorations:N,handleDOMEvents:{mousedown:J},createSelectionBetween:function(e){if(null!=v.getState(e.state))return e.state.selection},handleTripleClick:q,handleKeyDown:F,handlePaste:W},appendTransaction:function(e,n,r){return function(e,t,n){var r,o,a=(t||e).selection,s=(t||e).doc;if(a instanceof i.NodeSelection&&(o=a.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)r=M.create(s,a.from);else if("row"==o){var c=s.resolve(a.from+1);r=M.rowSelection(c,c)}else if(!n){var l=d.get(a.node),u=a.from+1,p=u+l.map[l.width*l.height-1];r=M.create(s,u+1,p)}}else a instanceof i.TextSelection&&function(e){var t=e.$from,n=e.$to;if(t.pos==n.pos||t.pos<t.pos-6)return!1;for(var r=t.pos,o=n.pos,i=t.depth;i>=0&&!(t.after(i+1)<t.end(i));i--,r++);for(var a=n.depth;a>=0&&!(n.before(a+1)>n.start(a));a--,o--);return r==o&&/row|table/.test(t.node(i).type.spec.tableRole)}(a)?r=i.TextSelection.create(s,a.from):a instanceof i.TextSelection&&function(e){for(var t,n,r=e.$from,o=e.$to,i=r.depth;i>0;i--){var a=r.node(i);if("cell"===a.type.spec.tableRole||"header_cell"===a.type.spec.tableRole){t=a;break}}for(var s=o.depth;s>0;s--){var c=o.node(s);if("cell"===c.type.spec.tableRole||"header_cell"===c.type.spec.tableRole){n=c;break}}return t!==n&&0===o.parentOffset}(a)&&(r=i.TextSelection.create(s,a.$from.start(),a.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}(r,G(r,n),t)}})},t.fixTables=G,t.handlePaste=W,t.cellAround=g,t.isInTable=y,t.selectionCell=b,t.moveCellForward=k,t.inSameTable=_,t.findCell=function(e){return d.get(e.node(-1)).findCell(e.pos-e.start(-1))},t.colCount=function(e){return d.get(e.node(-1)).colCount(e.pos-e.start(-1))},t.nextCell=x,t.tableNodes=function(e){var t=e.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(var r in t)n[r]={default:t[r].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.tableGroup,parseDOM:[{tag:"table"}],toDOM:function(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM:function(){return["tr",0]}},table_cell:{content:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:function(e){return T(e,t)}}],toDOM:function(e){return["td",A(e,t),0]}},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:function(e){return T(e,t)}}],toDOM:function(e){return["th",A(e,t),0]}}}},t.CellSelection=M,t.TableMap=d,t.columnResizing=function(e){void 0===e&&(e={});var t=e.handleWidth;void 0===t&&(t=5);var n=e.cellMinWidth;void 0===n&&(n=25);var r=e.View;void 0===r&&(r=ce);var o=e.lastColumnResizable;return void 0===o&&(o=!0),new i.Plugin({key:ue,state:{init:function(e,t){return this.spec.props.nodeViews[P(t.schema).table.name]=function(e,t){return new r(e,n,t)},new pe(-1,!1)},apply:function(e,t){return t.apply(e)}},props:{attributes:function(e){return ue.getState(e).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(e,n){!function(e,t,n,r,o){var i=ue.getState(e.state);if(!i.dragging){var a=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),s=-1;if(a){var c=a.getBoundingClientRect(),l=c.left,u=c.right;t.clientX-l<=n?s=fe(e,t,"left"):u-t.clientX<=n&&(s=fe(e,t,"right"))}if(s!=i.activeHandle){if(!o&&-1!==s){var p=e.state.doc.resolve(s),f=p.node(-1),h=d.get(f),m=p.start(-1),v=h.colCount(p.pos-m)+p.nodeAfter.attrs.colspan-1;if(v==h.width-1)return}de(e,s)}}}(e,n,t,0,o)},mouseleave:function(e){!function(e){var t=ue.getState(e.state);t.activeHandle>-1&&!t.dragging&&de(e,-1)}(e)},mousedown:function(e,t){!function(e,t,n){var r=ue.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;var o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,n){var r=n.colspan,o=n.colwidth,i=o&&o[o.length-1];if(i)return i;var a=e.domAtPos(t),s=a.node.childNodes[a.offset].offsetWidth,c=r;if(o)for(var l=0;l<r;l++)o[l]&&(s-=o[l],c--);return s/c}(e,r.activeHandle,o.attrs);function a(t){window.removeEventListener("mouseup",a),window.removeEventListener("mousemove",s);var r=ue.getState(e.state);r.dragging&&(function(e,t,n){for(var r=e.state.doc.resolve(t),o=r.node(-1),i=d.get(o),a=r.start(-1),s=i.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,c=e.state.tr,l=0;l<i.height;l++){var u=l*i.width+s;if(!l||i.map[u]!=i.map[u-i.width]){var p=i.map[u],f=o.nodeAt(p),h=f.attrs,m=1==h.colspan?0:s-i.colCount(p);if(!h.colwidth||h.colwidth[m]!=n){var v=h.colwidth?h.colwidth.slice():me(h.colspan);v[m]=n,c.setNodeMarkup(a+p,null,S(h,"colwidth",v))}}}c.docChanged&&e.dispatch(c)}(e,r.activeHandle,he(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(ue,{setDragging:null})))}function s(t){if(!t.which)return a(t);var r=ue.getState(e.state),o=he(r.dragging,t,n);!function(e,t,n,r){for(var o=e.state.doc.resolve(t),i=o.node(-1),a=o.start(-1),s=d.get(i).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1,c=e.domAtPos(o.start(-1)).node;"TABLE"!=c.nodeName;)c=c.parentNode;le(i,c.firstChild,c,r,s,n)}(e,r.activeHandle,o,n)}e.dispatch(e.state.tr.setMeta(ue,{setDragging:{startX:t.clientX,startWidth:i}})),window.addEventListener("mouseup",a),window.addEventListener("mousemove",s),t.preventDefault()}(e,t,n)}},decorations:function(e){var t=ue.getState(e);if(t.activeHandle>-1)return function(e,t){for(var n=[],r=e.doc.resolve(t),o=r.node(-1),i=d.get(o),s=r.start(-1),c=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan,l=0;l<i.height;l++){var u=c+l*i.width-1;if(!(c!=i.width&&i.map[u]==i.map[u+1]||0!=l&&i.map[u-1]==i.map[u-1-i.width])){var p=i.map[u],f=s+p+o.nodeAt(p).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",n.push(a.Decoration.widget(f,h))}}return a.DecorationSet.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}})},t.columnResizingPluginKey=ue,t.updateColumnsOnResize=le,t.__pastedCells=D,t.__insertCells=B,t.__clipCells=j,t.addColumn=X,t.addColumnBefore=function(e,t){if(!y(e))return!1;if(t){var n=Z(e);t(X(e.tr,n,n.left))}return!0},t.addColumnAfter=function(e,t){if(!y(e))return!1;if(t){var n=Z(e);t(X(e.tr,n,n.right))}return!0},t.removeColumn=Y,t.deleteColumn=function(e,t){if(!y(e))return!1;if(t){var n=Z(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(var o=n.right-1;Y(r,n,o),o!=n.left;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=d.get(n.table);t(r)}return!0},t.addRow=ee,t.addRowBefore=function(e,t){if(!y(e))return!1;if(t){var n=Z(e);t(ee(e.tr,n,n.top))}return!0},t.addRowAfter=function(e,t){if(!y(e))return!1;if(t){var n=Z(e);t(ee(e.tr,n,n.bottom))}return!0},t.removeRow=te,t.deleteRow=function(e,t){if(!y(e))return!1;if(t){var n=Z(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(var o=n.bottom-1;te(r,n,o),o!=n.top;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=d.get(n.table);t(r)}return!0},t.mergeCells=function(e,t){var n=e.selection;if(!(n instanceof M)||n.$anchorCell.pos==n.$headCell.pos)return!1;var r=Z(e),o=r.map;if(function(e,t){for(var n=e.width,r=e.height,o=e.map,i=t.top*n+t.left,a=i,s=(t.bottom-1)*n+t.left,c=i+(t.right-t.left-1),l=t.top;l<t.bottom;l++){if(t.left>0&&o[a]==o[a-1]||t.right<n&&o[c]==o[c+1])return!0;a+=n,c+=n}for(var u=t.left;u<t.right;u++){if(t.top>0&&o[i]==o[i-n]||t.bottom<r&&o[s]==o[s+n])return!0;i++,s++}return!1}(o,r))return!1;if(t){for(var i,a,c=e.tr,l={},u=s.Fragment.empty,p=r.top;p<r.bottom;p++)for(var f=r.left;f<r.right;f++){var h=o.map[p*o.width+f],d=r.table.nodeAt(h);if(!l[h])if(l[h]=!0,null==i)i=h,a=d;else{ne(d)||(u=u.append(d.content));var m=c.mapping.map(h+r.tableStart);c.delete(m,m+d.nodeSize)}}if(c.setNodeMarkup(i+r.tableStart,null,S(C(a.attrs,a.attrs.colspan,r.right-r.left-a.attrs.colspan),"rowspan",r.bottom-r.top)),u.size){var v=i+1+a.content.size,g=ne(a)?i+1:v;c.replaceWith(g+r.tableStart,v+r.tableStart,u)}c.setSelection(new M(c.doc.resolve(i+r.tableStart))),t(c)}return!0},t.splitCell=function(e,t){var n,r,o=e.selection;if(o instanceof M){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;n=o.$anchorCell.nodeAfter,r=o.$anchorCell.pos}else{if(!(n=function(e){for(var t=e.depth-1;t>0;t--){var n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(o.$from)))return!1;r=g(o.$from).pos}if(1==n.attrs.colspan&&1==n.attrs.rowspan)return!1;if(t){var i=n.attrs,a=[],s=i.colwidth;i.rowspan>1&&(i=S(i,"rowspan",1)),i.colspan>1&&(i=S(i,"colspan",1));for(var c=Z(e),l=e.tr,u=0;u<c.right-c.left;u++)a.push(s?S(i,"colwidth",s&&s[u]?[s[u]]:null):i);for(var p,f=P(e.schema)[n.type.spec.tableRole],h=0;h<c.bottom;h++)if(h>=c.top){var d=c.map.positionAt(h,c.left,c.table);h==c.top&&(d+=n.nodeSize);for(var m=c.left,v=0;m<c.right;m++,v++)m==c.left&&h==c.top||l.insert(p=l.mapping.map(d+c.tableStart,1),f.createAndFill(a[v]))}l.setNodeMarkup(r,null,a[0]),o instanceof M&&l.setSelection(new M(l.doc.resolve(o.$anchorCell.pos),p&&l.doc.resolve(p))),t(l)}return!0},t.setCellAttr=function(e,t){return function(n,r){if(!y(n))return!1;var o=b(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){var i=n.tr;n.selection instanceof M?n.selection.forEachCell(function(n,r){n.attrs[e]!==t&&i.setNodeMarkup(r,null,S(n.attrs,e,t))}):i.setNodeMarkup(o.pos,null,S(o.nodeAfter.attrs,e,t)),r(i)}return!0}},t.toggleHeader=oe,t.toggleHeaderRow=ie,t.toggleHeaderColumn=ae,t.toggleHeaderCell=se,t.goToNextCell=function(e){return function(t,n){if(!y(t))return!1;var r=function(e,t){if(t<0){var n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(var r=e.index(-1)-1,o=e.before();r>=0;r--){var i=e.node(-1).child(r);if(i.childCount)return o-1-i.lastChild.nodeSize;o-=i.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;for(var a=e.node(-1),s=e.indexAfter(-1),c=e.after();s<a.childCount;s++){var l=a.child(s);if(l.childCount)return c+1;c+=l.nodeSize}}}(b(t),e);if(null!=r){if(n){var o=t.doc.resolve(r);n(t.tr.setSelection(i.TextSelection.between(o,k(o))).scrollIntoView())}return!0}}},t.deleteTable=function(e,t){for(var n=e.selection.$anchor,r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(11))&&"object"==typeof r&&"default"in r?r.default:r,i=n(2),a="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);function s(e){var t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(var c=0;c<i.length-1;c++){var l=i[c];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else if(/^s(hift)?$/i.test(l))r=!0;else{if(!/^mod$/i.test(l))throw new Error("Unrecognized modifier name: "+l);a?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function c(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function l(e){var t=function(e){var t=Object.create(null);for(var n in e)t[s(n)]=e[n];return t}(e);return function(e,n){var r,i=o(n),a=1==i.length&&" "!=i,s=t[c(i,n,!a)];if(s&&s(e.state,e.dispatch,e))return!0;if(a&&(n.shiftKey||n.altKey||n.metaKey)&&(r=o.base[n.keyCode])&&r!=i){var l=t[c(r,n,!0)];if(l&&l(e.state,e.dispatch,e))return!0}return!1}}t.keymap=function(e){return new i.Plugin({props:{handleKeyDown:l(e)}})},t.keydownHandler=l},function(e,t){for(var n={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},r={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:";",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},o="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),i="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),a="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),s="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),c=o&&(s||+o[1]<57)||a&&s,l=0;l<10;l++)n[48+l]=n[96+l]=String(l);for(l=1;l<=24;l++)n[l+111]="F"+l;for(l=65;l<=90;l++)n[l]=String.fromCharCode(l+32),r[l]=String.fromCharCode(l);for(var u in n)r.hasOwnProperty(u)||(r[u]=n[u]);function p(e){var t=!(c&&(e.ctrlKey||e.altKey||e.metaKey)||i&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?r:n)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}e.exports=p,p.base=n,p.shift=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(14);t.default=function(e){return"label"===e.tag?r.createElement("label",{style:e.style,className:o.default(e.className,"smartblock-btn",{"is-active":e.active,"is-black":"black"===e.color,"is-disabled":e.disabled})},e.children):r.createElement("button",{type:e.type,style:e.style,onClick:e.onClick,className:o.default(e.className,"smartblock-btn",{"is-active":e.active,"is-black":"black"===e.color,"is-disabled":e.disabled})},e.children)}},function(e,t,n){var r=n(15),o=n(16);e.exports=function(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||r)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var s=0;s<16;++s)t[i+s]=a[s];return t||o(a)}},function(e,t,n){var r;
  /*!
    Copyright (c) 2017 Jed Watson.
    Licensed under the MIT License (MIT), see
    http://jedwatson.github.io/classnames
  */
  /*!
    Copyright (c) 2017 Jed Watson.
    Licensed under the MIT License (MIT), see
    http://jedwatson.github.io/classnames
  */
  !function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var a=o.apply(null,r);a&&e.push(a)}else if("object"===i)for(var s in r)n.call(r,s)&&r[s]&&e.push(s)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var o=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},function(e,t){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"left"),o.createElement("g",{id:"a8ace68f-5ddd-4a81-982f-c99649c8d782","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("rect",{width:1792,height:256}),o.createElement("rect",{y:512,width:1152,height:256}),o.createElement("rect",{y:1536,width:1152,height:256}),o.createElement("rect",{y:1024,width:1792,height:256})))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"center"),o.createElement("g",{id:"bfe5ce98-ed3f-4197-9845-64f060ce92c6","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("rect",{width:1792,height:256}),o.createElement("rect",{x:320,y:512,width:1152,height:256}),o.createElement("rect",{x:320,y:1536,width:1152,height:256}),o.createElement("rect",{y:1024,width:1792,height:256})))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"right"),o.createElement("g",{id:"b944651b-fd76-4b8a-8459-b94e3d6fe7d4","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("rect",{width:1792,height:256}),o.createElement("rect",{x:640,y:512,width:1152,height:256}),o.createElement("rect",{x:640,y:1536,width:1152,height:256}),o.createElement("rect",{y:1024,width:1792,height:256})))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),o=n(1),i=["ol",0],a=["ul",0],s=["li",0],c={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:function(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1}}}],toDOM:function(e){return 1==e.attrs.order?i:["ol",{start:e.attrs.order},0]}},l={parseDOM:[{tag:"ul"}],toDOM:function(){return a}},u={parseDOM:[{tag:"li"}],toDOM:function(){return s},defining:!0};function p(e,t){var n={};for(var r in e)n[r]=e[r];for(var o in t)n[o]=t[o];return n}t.orderedList=c,t.bulletList=l,t.listItem=u,t.addListNodes=function(e,t,n){return e.append({ordered_list:p(c,{content:"list_item+",group:n}),bullet_list:p(l,{content:"list_item+",group:n}),list_item:p(u,{content:t})})},t.wrapInList=function(e,t){return function(n,i){var a=n.selection,s=a.$from,c=a.$to,l=s.blockRange(c),u=!1,p=l;if(!l)return!1;if(l.depth>=2&&s.node(l.depth-1).type.compatibleContent(e)&&0==l.startIndex){if(0==s.index(l.depth-1))return!1;var f=n.doc.resolve(l.start-2);p=new o.NodeRange(f,f,l.depth),l.endIndex<l.parent.childCount&&(l=new o.NodeRange(s,n.doc.resolve(c.end(l.depth)),l.depth)),u=!0}var h=r.findWrapping(p,e,t,l);return!!h&&(i&&i(function(e,t,n,i,a){for(var s=o.Fragment.empty,c=n.length-1;c>=0;c--)s=o.Fragment.from(n[c].type.create(n[c].attrs,s));e.step(new r.ReplaceAroundStep(t.start-(i?2:0),t.end,t.start,t.end,new o.Slice(s,0,0),n.length,!0));for(var l=0,u=0;u<n.length;u++)n[u].type==a&&(l=u+1);for(var p=n.length-l,f=t.start+n.length-(i?2:0),h=t.parent,d=t.startIndex,m=t.endIndex,v=!0;d<m;d++,v=!1)!v&&r.canSplit(e.doc,f,p)&&(e.split(f,p),f+=2*p),f+=h.child(d).nodeSize;return e}(n.tr,l,h,u,e).scrollIntoView()),!0)}},t.splitListItem=function(e){return function(t,n){var i=t.selection,a=i.$from,s=i.$to,c=i.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(s))return!1;var l=a.node(-1);if(l.type!=e)return!1;if(0==a.parent.content.size){if(2==a.depth||a.node(-3).type!=e||a.index(-2)!=a.node(-2).childCount-1)return!1;if(n){for(var u=o.Fragment.empty,p=a.index(-1)>0,f=a.depth-(p?1:2);f>=a.depth-3;f--)u=o.Fragment.from(a.node(f).copy(u));u=u.append(o.Fragment.from(e.createAndFill()));var h=t.tr.replace(a.before(p?null:-1),a.after(-3),new o.Slice(u,p?3:2,2));h.setSelection(t.selection.constructor.near(h.doc.resolve(a.pos+(p?3:2)))),n(h.scrollIntoView())}return!0}var d=s.pos==a.end()?l.contentMatchAt(a.indexAfter(-1)).defaultType:null,m=t.tr.delete(a.pos,s.pos),v=d&&[null,{type:d}];return!!r.canSplit(m.doc,a.pos,2,v)&&(n&&n(m.split(a.pos,2,v).scrollIntoView()),!0)}},t.liftListItem=function(e){return function(t,n){var i=t.selection,a=i.$from,s=i.$to,c=a.blockRange(s,function(t){return t.childCount&&t.firstChild.type==e});return!!c&&(!n||(a.node(c.depth-1).type==e?function(e,t,n,i){var a=e.tr,s=i.end,c=i.$to.end(i.depth);return s<c&&(a.step(new r.ReplaceAroundStep(s-1,c,s,c,new o.Slice(o.Fragment.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new o.NodeRange(a.doc.resolve(i.$from.pos),a.doc.resolve(c),i.depth)),t(a.lift(i,r.liftTarget(i)).scrollIntoView()),!0}(t,n,e,c):function(e,t,n){for(var i=e.tr,a=n.parent,s=n.end,c=n.endIndex-1,l=n.startIndex;c>l;c--)s-=a.child(c).nodeSize,i.delete(s-1,s+1);var u=i.doc.resolve(n.start),p=u.nodeAfter,f=0==n.startIndex,h=n.endIndex==a.childCount,d=u.node(-1),m=u.index(-1);if(!d.canReplace(m+(f?0:1),m+1,p.content.append(h?o.Fragment.empty:o.Fragment.from(a))))return!1;var v=u.pos,g=v+p.nodeSize;return i.step(new r.ReplaceAroundStep(v-(f?1:0),g+(h?1:0),v+1,g-1,new o.Slice((f?o.Fragment.empty:o.Fragment.from(a.copy(o.Fragment.empty))).append(h?o.Fragment.empty:o.Fragment.from(a.copy(o.Fragment.empty))),f?0:1,h?0:1),f?0:1)),t(i.scrollIntoView()),!0}(t,n,c)))}},t.sinkListItem=function(e){return function(t,n){var i=t.selection,a=i.$from,s=i.$to,c=a.blockRange(s,function(t){return t.childCount&&t.firstChild.type==e});if(!c)return!1;var l=c.startIndex;if(0==l)return!1;var u=c.parent,p=u.child(l-1);if(p.type!=e)return!1;if(n){var f=p.lastChild&&p.lastChild.type==u.type,h=o.Fragment.from(f?e.create():null),d=new o.Slice(o.Fragment.from(e.create(null,o.Fragment.from(u.type.create(null,h)))),f?3:1,0),m=c.start,v=c.end;n(t.tr.step(new r.ReplaceAroundStep(m-(f?3:1),v,m,v,d,1,!0)).scrollIntoView())}return!0}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=(r=n(26))&&"object"==typeof r&&"default"in r?r.default:r,i=n(3),a=n(2),s=function(e,t){this.items=e,this.eventCount=t};s.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var r,o,i=this.items.length;;i--){if(n.items.get(i-1).selection){--i;break}}t&&(r=this.remapping(i,this.items.length),o=r.maps.length);var a,l,u=e.tr,p=[],f=[];return this.items.forEach(function(e,t){if(!e.step)return r||(r=n.remapping(i,t+1),o=r.maps.length),o--,void f.push(e);if(r){f.push(new c(e.map));var h,d=e.step.map(r.slice(o));d&&u.maybeStep(d).doc&&(h=u.mapping.maps[u.mapping.maps.length-1],p.push(new c(h,null,null,p.length+f.length))),o--,h&&r.appendMap(h,o)}else u.maybeStep(e.step);return e.selection?(a=r?e.selection.map(r.slice(o)):e.selection,l=new s(n.items.slice(0,i).append(f.reverse().concat(p)),n.eventCount-1),!1):void 0},this.items.length,0),{remaining:l,transform:u,selection:a}},s.prototype.addTransform=function(e,t,n,r){for(var o=[],i=this.eventCount,a=this.items,l=!r&&a.length?a.get(a.length-1):null,p=0;p<e.steps.length;p++){var f,h=e.steps[p].invert(e.docs[p]),d=new c(e.mapping.maps[p],h,t);(f=l&&l.merge(d))&&(d=f,p?o.pop():a=a.slice(0,a.length-1)),o.push(d),t&&(i++,t=null),r||(l=d)}var m,v,g,y=i-n.depth;return y>u&&(v=y,(m=a).forEach(function(e,t){if(e.selection&&0==v--)return g=t,!1}),a=m.slice(g),i-=y),new s(a.append(o),i)},s.prototype.remapping=function(e,t){var n=new i.Mapping;return this.items.forEach(function(t,r){var o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?o=n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,o)},e,t),n},s.prototype.addMaps=function(e){return 0==this.eventCount?this:new s(this.items.append(e.map(function(e){return new c(e)})),this.eventCount)},s.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,a=this.eventCount;this.items.forEach(function(e){e.selection&&a--},r);var l=t;this.items.forEach(function(t){var r=o.getMirror(--l);if(null!=r){i=Math.min(i,r);var s=o.maps[r];if(t.step){var u=e.steps[r].invert(e.docs[r]),p=t.selection&&t.selection.map(o.slice(l+1,r));p&&a++,n.push(new c(s,u,p))}else n.push(new c(s))}},r);for(var u=[],p=t;p<i;p++)u.push(new c(o.maps[p]));var f=this.items.slice(0,r).append(u).append(n),h=new s(f,a);return h.emptyItemCount()>500&&(h=h.compress(this.items.length-n.length)),h},s.prototype.emptyItemCount=function(){var e=0;return this.items.forEach(function(t){t.step||e++}),e},s.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(function(o,a){if(a>=e)r.push(o),o.selection&&i++;else if(o.step){var s=o.step.map(t.slice(n)),l=s&&s.getMap();if(n--,l&&t.appendMap(l,n),s){var u=o.selection&&o.selection.map(t.slice(n));u&&i++;var p,f=new c(l.invert(),s,u),h=r.length-1;(p=r.length&&r[h].merge(f))?r[h]=p:r.push(f)}}else o.map&&n--},this.items.length,0),new s(o.from(r.reverse()),i)},s.empty=new s(o.empty,0);var c=function(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r};c.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new c(t.getMap().invert(),t,this.selection)}};var l=function(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r},u=20;function p(e){var t=[];return e.forEach(function(e,n,r,o){return t.push(r,o)}),t}function f(e,t){if(!e)return null;for(var n=[],r=0;r<e.length;r+=2){var o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}function h(e,t,n,r){var o=v(t),i=g.get(t).spec.config,a=(r?e.undone:e.done).popEvent(t,o);if(a){var s=a.selection.resolve(a.transform.doc),c=(r?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,o),u=new l(r?c:a.remaining,r?a.remaining:c,null,0);n(a.transform.setSelection(s).setMeta(g,{redo:r,historyState:u}).scrollIntoView())}}var d=!1,m=null;function v(e){var t=e.plugins;if(m!=t){d=!1,m=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){d=!0;break}}return d}var g=new a.PluginKey("history"),y=new a.PluginKey("closeHistory");t.HistoryState=l,t.closeHistory=function(e){return e.setMeta(y,!0)},t.history=function(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new a.Plugin({key:g,state:{init:function(){return new l(s.empty,s.empty,null,0)},apply:function(t,n,r){return function(e,t,n,r){var o,i=n.getMeta(g);if(i)return i.historyState;n.getMeta(y)&&(e=new l(e.done,e.undone,null,0));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(a&&a.getMeta(g))return a.getMeta(g).redo?new l(e.done.addTransform(n,null,r,v(t)),e.undone,p(n.mapping.maps[n.steps.length-1]),e.prevTime):new l(e.done,e.undone.addTransform(n,null,r,v(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new l(e.done.rebased(n,o),e.undone.rebased(n,o),f(e.prevRanges,n.mapping),e.prevTime):new l(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),f(e.prevRanges,n.mapping),e.prevTime);var c=e.prevTime<(n.time||0)-r.newGroupDelay||!a&&!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach(function(e,r){for(var o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)}),n}(n,e.prevRanges),u=a?f(e.prevRanges,n.mapping):p(n.mapping.maps[n.steps.length-1]);return new l(e.done.addTransform(n,c?t.selection.getBookmark():null,r,v(t)),s.empty,u,n.time)}(n,r,t,e)}},config:e})},t.undo=function(e,t){var n=g.getState(e);return!(!n||0==n.done.eventCount||(t&&h(n,e,t,!1),0))},t.redo=function(e,t){var n=g.getState(e);return!(!n||0==n.undone.eventCount||(t&&h(n,e,t,!0),0))},t.undoDepth=function(e){var t=g.getState(e);return t?t.done.eventCount:0},t.redoDepth=function(e){var t=g.getState(e);return t?t.undone.eventCount:0}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"undent"),o.createElement("g",{id:"a764fb61-3cf8-4b9f-a74f-23b3c42c41ce","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("rect",{width:1792,height:256}),o.createElement("rect",{x:768.29,y:512,width:1023.71,height:256}),o.createElement("rect",{x:768.29,y:1024.39,width:1023.71,height:256}),o.createElement("rect",{y:1536,width:1792,height:256}),o.createElement("polygon",{points:"512 901.03 512 1331.01 256 1116.02 0 901.03 256 686.04 512 471.05 512 901.03"})))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"indent"),o.createElement("g",{id:"ac1ed596-8266-4a57-ae73-f333649eaa23","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("rect",{width:1792,height:256}),o.createElement("rect",{x:768,y:512,width:1024,height:256}),o.createElement("rect",{x:768,y:1024.39,width:1024,height:256}),o.createElement("rect",{y:1536,width:1792,height:256}),o.createElement("polygon",{points:"0.14 897.51 0.14 467.54 256.13 682.52 512.13 897.51 256.13 1112.5 0.14 1327.49 0.14 897.51"})))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({x:"0px",y:"0px",width:"1792px",height:"1792px",viewBox:"0 0 1792 1792",enableBackground:"new 0 0 1792 1792",xmlSpace:"preserve"},e),o.createElement("g",{id:"Guide"}),o.createElement("g",{id:"Font",display:"none"}),o.createElement("g",{id:"\\u5185\\u5BB9"},o.createElement("g",null,o.createElement("path",{d:"M1543.609,519.916c0.051-0.052,0.104-0.101,0.156-0.152c74.98-74.98,74.98-196.547,0-271.527 c-74.981-74.981-196.548-74.982-271.53-0.001v0.001l-0.001-0.002L765.536,754.932C731.335,626.83,764.446,484.496,864.942,384 l271.529-271.529c149.96-149.961,393.096-149.961,543.058,0c149.961,149.961,149.961,393.098,0,543.059L1408,927.059 c-100.497,100.498-242.834,133.608-370.938,99.404L1543.609,519.916z"}),o.createElement("path",{d:"M112.47,1136.471L384,864.941c100.496-100.497,242.83-133.607,370.933-99.405l-330.226,330.226l0.001,0.001 l-176.473,176.473c-74.98,74.981-74.98,196.548,0,271.528c74.981,74.981,196.548,74.981,271.529,0l271.528-271.529v-0.001 l235.17-235.17c34.203,128.103,1.091,270.439-99.405,370.937l-271.53,271.529c-149.96,149.961-393.095,149.961-543.056,0 C-37.49,1529.567-37.49,1286.432,112.47,1136.471z"}),o.createElement("path",{d:"M1061.49,549.49c23.164-23.163,55.164-37.49,90.51-37.49c70.692,0,128,57.308,128,128c0,35.346-14.327,67.346-37.49,90.51 l-511.779,511.779l-0.004-0.003C707.547,1265.58,675.459,1280,640,1280c-70.693,0-128-57.308-128-128 c0-36.001,14.868-68.525,38.793-91.782l-0.015-0.016L1061.49,549.49z"}))),o.createElement("g",{id:"\\u30E9\\u30D9\\u30EB"}),o.createElement("g",{id:"Unicode",display:"none"},o.createElement("text",{transform:"matrix(1 0 0 1 437.0635 964.2812)",display:"inline",fill:"#ED1E79",fontFamily:"'ArialMT'",fontSize:256},"U+F724")))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:21.722,height:21.722,viewBox:"0 0 21.722 21.722"},e),o.createElement("path",{id:"\\u30D1\\u30B9_52","data-name":"\\u30D1\\u30B9 52",d:"M0,0V9.2H17.521",transform:"translate(1.414 13.803) rotate(-45)",fill:"none",stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2}))}},function(e,t){var n=function(){};n.prototype.append=function(e){return e.length?(e=n.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},n.prototype.prepend=function(e){return e.length?n.from(e).append(this):this},n.prototype.appendInner=function(e){return new o(this,e)},n.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?n.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},n.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},n.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},n.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},n.from=function(e){return e instanceof n?e:e&&e.length?new r(e):n.empty};var r=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{},depth:{}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(n);n.empty=new r([]);var o=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(n);e.exports=n},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(5),s=n(13),c=n(33),l=n(17),u=n(18),p=n(19),f=n(6),h=n(4),d=n(12),m=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"paragraph"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"group",{get:function(){return"block"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){var e=this;return this.customSchema?this.customSchema:{content:"inline*",group:"block",parseDOM:[{tag:"p",getAttrs:function(e){return{id:e.getAttribute("id")||s(),align:e.style.textAlign}}}],attrs:{align:{default:""},id:{default:""}},toDOM:function(t){return["p",t.attrs.align?{style:"text-align: "+t.attrs.align,class:e.className}:{class:e.className},0]}}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return i.createElement(c.default,{style:{width:"24px",height:"24px"}})},enumerable:!0,configurable:!0}),t.prototype.active=function(e){return h.blockActive(e.schema.nodes.paragraph)(e)},t.prototype.enable=function(e){return a.setBlockType(e.schema.nodes.paragraph)(e)},t.prototype.customMenu=function(e){var t=e.state,n=e.dispatch,r=h.getParentNodeFromState(t);return i.createElement(i.Fragment,null,i.createElement(d.default,{type:"button",active:r&&"left"===r.attrs.align,onClick:function(){a.setBlockType(t.schema.nodes.paragraph,{align:"left"})(t,n)}},i.createElement(l.default,{style:{width:"24px",height:"24px"}})),i.createElement(d.default,{type:"button",active:r&&"center"===r.attrs.align,onClick:function(){a.setBlockType(t.schema.nodes.paragraph,{align:"center"})(t,n)}},i.createElement(u.default,{style:{width:"24px",height:"24px"}})),i.createElement(d.default,{type:"button",active:r&&"right"===r.attrs.align,onClick:function(){a.setBlockType(t.schema.nodes.paragraph,{align:"right"})(t,n)}},i.createElement(p.default,{style:{width:"24px",height:"24px"}})))},t.prototype.onClick=function(e,t){a.setBlockType(e.schema.nodes.paragraph)(e,t)},t}(f.Extension);t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(7),i=n(34),a=n(35),s=function(){function e(e){void 0===e&&(e={}),this.i18n={remove_block:"Are you sure you want to remove the block?"},e&&e.i18n&&(this.i18n=e.i18n)}return Object.defineProperty(e.prototype,"name",{get:function(){return"trash"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"group",{get:function(){return"edit"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icon",{get:function(){return r.createElement(i.default,{style:{width:"18px",height:"18px"}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"btnColor",{get:function(){return"black"},enumerable:!0,configurable:!0}),e.prototype.onClick=function(e,t){var n=e.selection.$anchor,r=e.doc.resolve(n.pos).path[1],i=0,s=o.findChildren(e.doc,function(e){return r===i?(i++,!0):(i++,!1)},!1)[0],c=s.pos,l=e.tr.delete(c,c+s.node.content.size+2);a.default()?confirm(this.i18n.remove_block)&&t(l):t(l)},e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(7),i=n(36),a=n(4),s=function(){function e(){}return Object.defineProperty(e.prototype,"name",{get:function(){return"move-up"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"group",{get:function(){return"edit"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icon",{get:function(){return r.createElement(i.default,{style:{width:"24px",height:"24px"}})},enumerable:!0,configurable:!0}),e.prototype.enable=function(e){return a.getParentNodeIndexFromState(e)>=1},e.prototype.onClick=function(e,t,n){var r=n.state,i=a.getParentNodeIndexFromState(r),s=a.getRootNodeWithPosByIndex(r,i-1),c=a.getRootNodeWithPosByIndex(r,i);if(s){var l=s.pos,u=c.pos,p=r.tr.delete(l,u);n.dispatch(p);var f=p.doc.content.child(i-1),h=a.findNodePosition(p.doc,f),d=n.state.tr.insert(h+f.nodeSize,s.node);n.dispatch(d),n.dispatch(o.setTextSelection(h)(n.state.tr).scrollIntoView())}},e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(7),i=n(37),a=n(4),s=function(){function e(){}return Object.defineProperty(e.prototype,"name",{get:function(){return"move-down"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"group",{get:function(){return"edit"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icon",{get:function(){return r.createElement(i.default,{style:{width:"24px",height:"24px"}})},enumerable:!0,configurable:!0}),e.prototype.enable=function(e){var t=a.getRootNodeCountFromState(e);return a.getParentNodeIndexFromState(e)<t-1},e.prototype.onClick=function(e,t,n){var r=n.state,i=a.getParentNodeIndexFromState(r),s=a.getRootNodeWithPosByIndex(r,i),c=a.getRootNodeWithPosByIndex(r,i+1);if(c){var l=s.pos,u=c.pos,p=r.tr.delete(l,u);n.dispatch(p);var f=p.doc.content.child(i),h=a.findNodePosition(p.doc,f),d=n.state.tr.insert(h+f.nodeSize,s.node);n.dispatch(d),n.dispatch(o.setTextSelection(h+f.nodeSize)(n.state.tr).scrollIntoView())}},e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(38),o=n(21),i=n(9),a=n(2),s=n(5),c=n(4),l=function(e,t){var n=e.schema.nodes.hard_break.create();return t(e.tr.replaceSelectionWith(n).scrollIntoView()),!0},u={Enter:function(e,t,n){var r=e.selection.$anchor.nodeBefore,o=c.getParentNodeFromState(e);if("table"!==o.type.name)return"paragraph"!==o.type.name&&"blockquote"!==o.type.name&&"code"!==o.type.name||!r?(s.baseKeymap.Enter(e,t,n),!0):r&&r.type&&"hard_break"===r.type.name?!!function(e,t){var n=e.selection,r=n.$from,o=n.$to,i=r.parent.contentMatchAt(o.indexAfter()).defaultType;if(t){var s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,c=e.tr.delete(n.from-1,n.from);t((c=(c=(c=c.insert(s,i.createAndFill())).setSelection(a.TextSelection.create(c.doc,s+1))).delete(s+1,s+2)).scrollIntoView())}return!0}(e,t):(l(e,t),!0);l(e,t)},"Mod-z":o.undo,"Shift-Mod-z":o.redo,Backspace:r.undoInputRule,"Mod-y":o.redo,"Alt-ArrowUp":s.joinUp,"Alt-ArrowDown":s.joinDown,"Mod-BracketLeft":s.lift,Escape:s.selectParentNode,"Mod-Enter":s.chainCommands(s.exitCode,l),"Shift-Enter":s.chainCommands(s.exitCode,l),"Ctrl-Enter":s.chainCommands(s.exitCode,l),"Mod-_":function(e,t){var n=e.schema.nodes.horizontal_rule.create();return t(e.tr.replaceSelectionWith(n).scrollIntoView()),!0},Tab:i.goToNextCell(1),"Shift-Tab":i.goToNextCell(-1)};Object.keys(s.baseKeymap).forEach(function(e){u[e]?"Enter"!==e&&(u[e]=s.chainCommands(u[e],s.baseKeymap[e])):u[e]=s.baseKeymap[e]});var p=function(){function e(){}return Object.defineProperty(e.prototype,"name",{get:function(){return"default-keys"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showMenu",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype.keys=function(){return u},e}();t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(21),o=n(39),i=n(2),a=n(8),s=function(){function e(e){this.placeholder=e.placeholder}return Object.defineProperty(e.prototype,"name",{get:function(){return"default-plugins"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"showMenu",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"plugins",{get:function(){return[new i.Plugin({props:{decorations:function(e){var t=e.selection,n=[];return e.doc.nodesBetween(t.from,t.to,function(e,t){e.isBlock&&n.push(a.Decoration.node(t,t+e.nodeSize,{class:"selected"}))}),a.DecorationSet.create(e.doc,n)}}}),new i.Plugin({props:{decorations:function(e){var t=[],n=e.doc;return e.doc.descendants(function(e,r){1==n.childCount&&n.firstChild.isTextblock&&0==n.firstChild.content.size&&t.push(a.Decoration.node(r,r+e.nodeSize,{class:"empty-node"}))}),a.DecorationSet.create(e.doc,t)}}}),o.gapCursor(),r.history()]},enumerable:!0,configurable:!0}),e}();t.default=s},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"paragraph"),o.createElement("g",{id:"a4130921-6bd7-457e-b4c5-91ddb25bdaa4","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("path",{d:"M1558.45.27H778.13a544.68,544.68,0,0,0-212,1046.3,541.36,541.36,0,0,0,212,42.85h.75l87.12-1v703.34h256V256.27h100.87V1791.73h256V256.27h79.58Z"})))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({x:"0px",y:"0px",width:"1792px",height:"1792px",viewBox:"0 0 1792 1792",enableBackground:"new 0 0 1792 1792",xmlSpace:"preserve"},e),o.createElement("g",{id:"Guide"}),o.createElement("g",{id:"Font",display:"none"}),o.createElement("g",{id:"\\u5185\\u5BB9"},o.createElement("g",null,o.createElement("path",{d:"M268.117,512c10.808,27.987,28.523,54.127,51.883,77.551V1664c0,70.692,57.308,128,128,128h896 c70.692,0,128-57.308,128-128V589.551c23.36-23.424,41.075-49.563,51.883-77.551H268.117z M768,1536c0,35.347-28.654,64-64,64 c-35.347,0-64-28.653-64-64V832c0-35.347,28.653-64,64-64c35.346,0,64,28.653,64,64V1536z M1152,1536c0,35.347-28.654,64-64,64 c-35.347,0-64-28.653-64-64V832c0-35.347,28.653-64,64-64c35.346,0,64,28.653,64,64V1536z"}),o.createElement("path",{d:"M1152,192h3V64c0-35.347-28.654-64-64-64c-2.024,0-4.023,0.105-6,0.289V0H704c-35.347,0-64,28.653-64,64v128 c-212.077,0-384,114.615-384,256h1280C1536,306.615,1364.077,192,1152,192z M1027,192H768v-64h259V192z"}))),o.createElement("g",{id:"\\u30EC\\u30A4\\u30E4\\u30FC_5",display:"none"}),o.createElement("g",{id:"Unicode",display:"none"},o.createElement("text",{transform:"matrix(1 0 0 1 437.063 964.2812)",display:"inline",fill:"#ED1E79",fontFamily:"'ArialMT'",fontSize:256},"U+F722")))}},function(e,t,n){"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;var r=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,o=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i;function i(e){e||(e={});var t=e.ua;return t||"undefined"==typeof navigator||(t=navigator.userAgent),t&&t.headers&&"string"==typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),"string"==typeof t&&(e.tablet?o.test(t):r.test(t))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"switch (bottom)"),o.createElement("g",{id:"ab70919b-6878-4a79-bb69-55678e0e3bbe","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("polygon",{points:"448.1 763.79 784.68 427.21 784.68 1082.06 1007.89 1082.06 1007.89 427.21 1344.48 763.79 1502.31 605.96 896.35 0 896.29 0.06 896.23 0 290.27 605.96 448.1 763.79"}),o.createElement("rect",{y:1352,width:1792,height:440})))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"switch (top)"),o.createElement("g",{id:"a03b19b5-be1e-427a-b872-29e082246f7b","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("polygon",{points:"1344.19 1028.21 1007.61 1364.79 1007.61 709.94 784.4 709.94 784.4 1364.79 447.81 1028.21 289.98 1186.04 895.94 1792 896 1791.94 896.06 1792 1502.02 1186.04 1344.19 1028.21"}),o.createElement("rect",{width:1792,height:440})))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=n(3),i=function(e,t){var n;this.match=e,this.handler="string"==typeof t?(n=t,function(e,t,r,o){var i=n;if(t[1]){var a=t[0].lastIndexOf(t[1]);i+=t[0].slice(a+t[1].length);var s=(r+=a)-o;s>0&&(i=t[0].slice(a-s,a)+i,r=o)}return e.tr.insertText(i,r,o)}):t};var a=500;function s(e,t,n,r,o,i){if(e.composing)return!1;var s=e.state,c=s.doc.resolve(t);if(c.parent.type.spec.code)return!1;for(var l=c.parent.textBetween(Math.max(0,c.parentOffset-a),c.parentOffset,null,"￼")+r,u=0;u<o.length;u++){var p=o[u].match.exec(l),f=p&&o[u].handler(s,p,t-(p[0].length-r.length),n);if(f)return e.dispatch(f.setMeta(i,{transform:f,from:t,to:n,text:r})),!0}return!1}var c=new i(/--$/,"—"),l=new i(/\.\.\.$/,"…"),u=new i(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),p=new i(/"$/,"”"),f=new i(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),h=new i(/'$/,"’"),d=[u,p,f,h];t.InputRule=i,t.inputRules=function(e){var t=e.rules,n=new r.Plugin({state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,r,o,i){return s(e,r,o,i,t,n)},handleDOMEvents:{compositionend:function(e){setTimeout(function(){var r=e.state.selection.$cursor;r&&s(e,r.pos,r.pos,"",t,n)})}}},isInputRules:!0});return n},t.undoInputRule=function(e,t){for(var n=e.plugins,r=0;r<n.length;r++){var o=n[r],i=void 0;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){for(var a=e.tr,s=i.transform,c=s.steps.length-1;c>=0;c--)a.step(s.steps[c].invert(s.docs[c]));var l=a.doc.resolve(i.from).marks();t(a.replaceWith(i.from,i.to,e.schema.text(i.text,l)))}return!0}}return!1},t.emDash=c,t.ellipsis=l,t.openDoubleQuote=u,t.closeDoubleQuote=p,t.openSingleQuote=f,t.closeSingleQuote=h,t.smartQuotes=d,t.wrappingInputRule=function(e,t,n,r){return new i(e,function(e,i,a,s){var c=n instanceof Function?n(i):n,l=e.tr.delete(a,s),u=l.doc.resolve(a).blockRange(),p=u&&o.findWrapping(u,t,c);if(!p)return null;l.wrap(u,p);var f=l.doc.resolve(a-1).nodeBefore;return f&&f.type==t&&o.canJoin(l.doc,a-1)&&(!r||r(i,f))&&l.join(a-1),l})},t.textblockTypeInputRule=function(e,t,n){return new i(e,function(e,r,o,i){var a=e.doc.resolve(o),s=n instanceof Function?n(r):n;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?e.tr.delete(o,i).setBlockType(o,o,t,s):null})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),o=n(2),i=n(8),a=n(1),s=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));return t.valid(o)?new t(o):e.near(o)},t.prototype.content=function(){return a.Slice.empty},t.prototype.eq=function(e){return e instanceof t&&e.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))},t.prototype.getBookmark=function(){return new c(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var n=e.index(t);if(0!=n)for(var r=e.node(t).child(n-1);;r=r.lastChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(var o=r.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock},t.findFrom=function(e,n,r){if(!r&&t.valid(e))return e;for(var o=e.pos,i=null,a=e.depth;;a--){var s=e.node(a);if(n>0?e.indexAfter(a)<s.childCount:e.index(a)>0){i=s.maybeChild(n>0?e.indexAfter(a):e.index(a)-1);break}if(0==a)return null;o+=n;var c=e.doc.resolve(o);if(t.valid(c))return c}for(;i=n>0?i.firstChild:i.lastChild;){o+=n;var l=e.doc.resolve(o);if(t.valid(l))return l}return null},t}(o.Selection);s.prototype.visible=!1,o.Selection.jsonID("gapcursor",s);var c=function(e){this.pos=e};c.prototype.map=function(e){return new c(e.map(this.pos))},c.prototype.resolve=function(e){var t=e.resolve(this.pos);return s.valid(t)?new s(t):o.Selection.near(t)};var l=r.keydownHandler({ArrowLeft:u("horiz",-1),ArrowRight:u("horiz",1),ArrowUp:u("vert",-1),ArrowDown:u("vert",1)});function u(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){var a=e.selection,c=t>0?a.$to:a.$from,l=a.empty;if(a instanceof o.TextSelection){if(!i.endOfTextblock(n))return!1;l=!1,c=e.doc.resolve(t>0?c.after():c.before())}var u=s.findFrom(c,t,l);return!!u&&(r&&r(e.tr.setSelection(new s(u))),!0)}}function p(e,t,n){var r=e.state.doc.resolve(t);if(!s.valid(r))return!1;var i=e.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(i>-1&&o.NodeSelection.isSelectable(e.state.doc.nodeAt(i)))&&(e.dispatch(e.state.tr.setSelection(new s(r))),!0)}function f(e){if(!(e.selection instanceof s))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",i.DecorationSet.create(e.doc,[i.Decoration.widget(e.selection.head,t,{key:"gapcursor"})])}t.gapCursor=function(){return new o.Plugin({props:{decorations:f,createSelectionBetween:function(e,t,n){if(t.pos==n.pos&&s.valid(n))return new s(n)},handleClick:p,handleKeyDown:l}})},t.GapCursor=s},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(5),s=n(13),c=n(41),l=n(17),u=n(18),p=n(19),f=n(6),h=n(4),d=n(12),m=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"heading2"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"group",{get:function(){return"block"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return this.customSchema?this.customSchema:{content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h2",getAttrs:function(e){return{id:e.getAttribute("id")||s()}}}],attrs:{align:{default:""},id:{default:""}},toDOM:function(e){return["h2",e.attrs.align?{style:"text-align: "+e.attrs.align,class:this.className}:{class:this.className},0]}}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return i.createElement(c.default,{style:{width:"24px",height:"24px"}})},enumerable:!0,configurable:!0}),t.prototype.active=function(e){return h.blockActive(e.schema.nodes.heading2)(e)},t.prototype.enable=function(e){return a.setBlockType(e.schema.nodes.heading2)(e)},t.prototype.customMenu=function(e){var t=e.state,n=e.dispatch,r=h.getParentNodeFromState(t);return i.createElement(i.Fragment,null,i.createElement(d.default,{active:r&&"left"===r.attrs.align,type:"button",onClick:function(){a.setBlockType(t.schema.nodes.heading2,{align:"left"})(t,n)}},i.createElement(l.default,{style:{width:"24px",height:"24px"}})),i.createElement(d.default,{type:"button",active:r&&"center"===r.attrs.align,onClick:function(){a.setBlockType(t.schema.nodes.heading2,{align:"center"})(t,n)}},i.createElement(u.default,{style:{width:"24px",height:"24px"}})),i.createElement(d.default,{type:"button",active:r&&"right"===r.attrs.align,onClick:function(){a.setBlockType(t.schema.nodes.heading2,{align:"right"})(t,n)}},i.createElement(p.default,{style:{width:"24px",height:"24px"}})))},t.prototype.onClick=function(e,t){a.setBlockType(e.schema.nodes.heading2)(e,t)},t}(f.Extension);t.default=m},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"heading２"),o.createElement("g",{id:"aa20b165-3acd-433f-82f0-1d83abd1dec9","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("path",{d:"M818.8,1013H285.45v610.9H0V164.5H285.45V758.43H818.8V164.5h285.45V1623.87H818.8Z"}),o.createElement("path",{d:"M1270.81,1456.45q134-101,201.08-162.57t88-98.54a157.52,157.52,0,0,0,21-79q0-75-85-75-75,0-195.08,75l-50-160.07q51-34,129-57t146.06-23q125,0,192.58,58.52T1786,1096.3q0,82-52,156.06t-203.08,202.09v2H1791v160.06H1270.81Z"})))}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(5),s=n(13),c=n(43),l=n(17),u=n(18),p=n(19),f=n(6),h=n(4),d=n(12),m=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"heading3"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"group",{get:function(){return"block"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return this.customSchema?this.customSchema:{content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h3",getAttrs:function(e){return{id:e.getAttribute("id")||s()}}}],attrs:{align:{default:""},id:{default:""}},toDOM:function(e){return["h3",e.attrs.align?{style:"text-align: "+e.attrs.align,class:this.className}:{class:this.className},0]}}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return i.createElement(c.default,{style:{width:"24px",height:"24px"}})},enumerable:!0,configurable:!0}),t.prototype.active=function(e){return h.blockActive(e.schema.nodes.heading3)(e)},t.prototype.enable=function(e){return a.setBlockType(e.schema.nodes.heading3)(e)},t.prototype.customMenu=function(e){var t=e.state,n=e.dispatch,r=h.getParentNodeFromState(t);return i.createElement(i.Fragment,null,i.createElement(d.default,{active:r&&"left"===r.attrs.align,type:"button",onClick:function(){a.setBlockType(t.schema.nodes.heading3,{align:"left"})(t,n)}},i.createElement(l.default,{style:{width:"24px",height:"24px"}})),i.createElement(d.default,{type:"button",active:r&&"center"===r.attrs.align,onClick:function(){a.setBlockType(t.schema.nodes.heading3,{align:"center"})(t,n)}},i.createElement(u.default,{style:{width:"24px",height:"24px"}})),i.createElement(d.default,{type:"button",active:r&&"right"===r.attrs.align,onClick:function(){a.setBlockType(t.schema.nodes.heading3,{align:"right"})(t,n)}},i.createElement(p.default,{style:{width:"24px",height:"24px"}})))},t.prototype.onClick=function(e,t){a.setBlockType(e.schema.nodes.heading3)(e,t)},t}(f.Extension);t.default=m},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"heading３"),o.createElement("g",{id:"b5ff5b4d-a20b-455f-8138-4c7eb6020abc","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("path",{d:"M818.8,1013H285.45v610.9H0V164.5H285.45V758.43H818.8V164.5h285.45V1623.87H818.8Z"}),o.createElement("path",{d:"M1594,1188h10q81.9,0,133.36,54.45t51.45,145.35q0,116.9-71.93,178.33T1509,1627.54q-133.87,0-249.75-59.94l49-149.85q104.89,52,180.82,52,51,0,77.92-20.48t27-56.44q0-30-14-45t-52.45-22.47q-38.46-7.5-113.38-7.5h-40V1188L1544,1050.12v-2H1274.27V888.28h504.49v159.84L1594,1186Z"})))}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(20),a=n(5),s=n(6),c=n(4),l=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"list_item"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showMenu",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return this.customSchema?this.customSchema:{content:"paragraph block*",group:"block",parseDOM:[{tag:"li",getAttrs:function(e){return{id:e.getAttribute("id")}}}],attrs:{id:{default:""}},toDOM:function(e){return["li",0]},defining:!0}},enumerable:!0,configurable:!0}),t.prototype.keys=function(e){return{Enter:i.splitListItem(e.nodes.list_item),Tab:i.sinkListItem(e.nodes.list_item),"Shift-Tab":a.chainCommands(c.liftListItem(e.nodes.list_item))}},t}(s.Extension);t.default=l},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(20),s=n(22),c=n(23),l=n(46),u=n(4),p=n(6),f=n(12),h=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"bullet_list"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"group",{get:function(){return"block"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){if(!this.customSchema)return{content:"list_item+",group:"block",parseDOM:[{tag:"ul",getAttrs:function(e){return{id:e.getAttribute("id")}}}],attrs:{id:{default:""}},toDOM:function(e){return["ul",{class:this.className},0]}}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return i.createElement(l.default,{style:{width:"24px",height:"24px"}})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hideBlockMenuOnFocus",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype.active=function(e){return u.blockActive(e.schema.nodes.bullet_list)(e)},t.prototype.enable=function(e){return"paragraph"===u.getParentNodeFromState(e).type.name&&a.wrapInList(e.schema.nodes.bullet_list)(e)},t.prototype.onClick=function(e,t){if("paragraph"!==u.getParentNodeFromState(e).type.name)return!1;a.wrapInList(e.schema.nodes.bullet_list)(e,t)},t.prototype.customMenu=function(e){var t=e.state,n=e.dispatch;return i.createElement(i.Fragment,null,i.createElement(f.default,{type:"button",disabled:!u.liftListItem(t.schema.nodes.list_item)(t),onClick:function(){u.liftListItem(t.schema.nodes.list_item)(t,n)}},i.createElement(s.default,{style:{width:"24px",height:"24px"}})),i.createElement(f.default,{type:"button",disabled:!a.sinkListItem(t.schema.nodes.list_item)(t),onClick:function(){a.sinkListItem(t.schema.nodes.list_item)(t,n)}},i.createElement(c.default,{style:{width:"24px",height:"24px"}})))},t}(p.Extension);t.default=h},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"list"),o.createElement("g",{id:"ed077df1-2ad6-4b84-9b12-8279e9916ad9","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("rect",{x:552,y:220,width:1240,height:256}),o.createElement("rect",{x:552,y:758,width:1240,height:256}),o.createElement("rect",{x:552,y:1298,width:1240,height:256}),o.createElement("rect",{y:216.49,width:256,height:256}),o.createElement("rect",{y:757.62,width:256,height:256}),o.createElement("rect",{y:1298.76,width:256,height:256})))}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(20),s=n(48),c=n(23),l=n(22),u=n(4),p=n(6),f=n(12),h=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"ordered_list"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"group",{get:function(){return"block"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return this.customSchema?this.customSchema:{content:"list_item+",group:"block",parseDOM:[{tag:"ol",getAttrs:function(e){return{id:e.getAttribute("id")}}}],attrs:{id:{default:""}},toDOM:function(e){return["ol",{class:this.className},0]}}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return i.createElement(s.default,{style:{width:"24px",height:"24px"}})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hideBlockMenuOnFocus",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype.active=function(e){return u.blockActive(e.schema.nodes.ordered_list)(e)},t.prototype.enable=function(e){return"paragraph"===u.getParentNodeFromState(e).type.name&&a.wrapInList(e.schema.nodes.ordered_list)(e)},t.prototype.onClick=function(e,t){if("paragraph"!==u.getParentNodeFromState(e).type.name)return!1;a.wrapInList(e.schema.nodes.ordered_list)(e,t)},t.prototype.customMenu=function(e){var t=e.state,n=e.dispatch;return i.createElement(i.Fragment,null,i.createElement(f.default,{type:"button",onClick:function(){u.liftListItem(t.schema.nodes.list_item)(t,n)}},i.createElement(l.default,{style:{width:"24px",height:"24px"}})),i.createElement(f.default,{type:"button",onClick:function(){a.sinkListItem(t.schema.nodes.list_item)(t,n)}},i.createElement(c.default,{style:{width:"24px",height:"24px"}})))},t}(p.Extension);t.default=h},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"orderedlist"),o.createElement("g",{id:"b3b81f28-1e36-4bd8-9f72-6ca2ae0e4ff1","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("rect",{x:552,y:216.49,width:1240,height:256}),o.createElement("rect",{x:552,y:757.63,width:1240,height:256}),o.createElement("rect",{x:552,y:1298.76,width:1240,height:256}),o.createElement("path",{d:"M115.3,279.37h-.55L32.94,356.24,0,262.9,115.3,153.09H230.6V553.9H115.3Z"}),o.createElement("path",{d:"M23.51,1009.93q73.57-55.45,110.36-89.22t48.32-54.08a86.57,86.57,0,0,0,11.53-43.38q0-41.18-46.67-41.18-41.19,0-107.07,41.18L12.53,735.4q28-18.66,70.83-31.3t80.16-12.62q68.63,0,105.69,32.12t37.06,88.67q0,45-28.55,85.65T166.26,1008.83v1.1H309v87.85H23.51Z"}),o.createElement("path",{d:"M199.21,1397.33h5.49q45,0,73.3,29.92t28.27,79.89q0,64.24-39.53,98t-114.2,33.76Q79,1638.91,15.27,1606l26.91-82.36q57.64,28.56,99.38,28.55,28,0,42.82-11.25t14.83-31q0-16.47-7.69-24.7t-28.83-12.36q-21.13-4.11-62.31-4.11h-22v-71.38l93.33-75.77v-1.1H23.51v-87.85H300.78v87.85l-101.57,75.77Z"})))}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(0),s=n(5),c=n(6),l=n(4),u=n(24),p=n(50),f=n(51),h=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"embed"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"group",{get:function(){return"block"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hideInlineMenuOnFocus",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return this.customSchema?this.customSchema:{group:"block",content:"text*",selectable:!0,isolating:!0,attrs:{type:{default:"youtube"},src:{default:""}},parseDOM:[{tag:"iframe",getAttrs:function(e){return{src:e.getAttribute("src")}}},{tag:"div.embed-wrap",getAttrs:function(e){return{src:e.querySelector("a").getAttribute("href")}}}],toDOM:function(e){if(-1!==e.attrs.src.indexOf("youtube")){var t=e.attrs.src,n="",r=/www\.youtube\.com\/watch\?v=(.*?)$/.exec(t);if(r&&r[1]&&(n=r[1]),!n){var o=/www\.youtube\.com\/embed\/(.*?)$/.exec(t);o&&o[1]&&(n=o[1])}if(n)return["div",{contenteditable:!0,class:"youtube-frame-wrap"},["div",{class:"youtube-frame"},["iframe",{src:"https://www.youtube.com/embed/"+n}]]]}return["div",{class:"embed-wrap"},["a",{class:"embed",href:e.attrs.src},["div",{class:"embed-inner"},0]]]}}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return i.createElement(u.default,{style:{width:"24px",height:"24px"}})},enumerable:!0,configurable:!0}),t.prototype.active=function(e){return l.blockActive(e.schema.nodes.embed)(e)},t.prototype.enable=function(e){return s.setBlockType(e.schema.nodes.embed)(e)},t.prototype.onClick=function(e,t){var n=document.createElement("div");document.body.appendChild(n),a.render(i.createElement(p.default,{onClose:function(){a.unmountComponentAtNode(n)},onDone:function(r){var o=e.selection.$anchor.pos,i=e.schema.text(r),s=e.schema.nodes.embed.createAndFill({src:r},i);t(e.tr.insert(o,s)),a.unmountComponentAtNode(n)}}),n)},Object.defineProperty(t.prototype,"plugins",{get:function(){return[f.default()]},enumerable:!0,configurable:!0}),t}(c.Extension);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(0),i=n(25),a=r.useState,s=r.useEffect,c=r.useRef;var l=function(e){var t,n=(t=r.useRef(document.createElement("div")),s(function(){var e=document.createElement("div");return document.body.appendChild(e),e.appendChild(t.current),function(){e.removeChild(t.current)}},[]),t.current);return o.createPortal(e.children,n)};t.default=function(e){var t=a(e.url),n=t[0],o=t[1],u=c();return s(function(){u.current.focus()}),r.createElement(l,null,r.createElement("div",{className:"smartblock-popup",id:"smartblock-popup",onClick:function(t){"smartblock-popup"===t.target.id&&e.onClose&&e.onClose()}},r.createElement("div",{className:"smartblock-popup-inner"},r.createElement("div",{className:"smartblock-popup-text"},"Enter URL here..."),r.createElement("div",{className:"smartblock-popup-field"},r.createElement("input",{ref:u,type:"text",value:n,placeholder:"https://",onKeyDown:function(t){13===t.keyCode&&e.onDone&&e.onDone(n)},onChange:function(e){o(e.target.value)}}),r.createElement("button",{className:"smartblock-popup-btn",onClick:function(t){e.onDone&&e.onDone(n)}},r.createElement(i.default,{style:{width:"24px",height:"24px",overflow:"hidden"}}))))))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=n(5),i=n(4);t.default=function(){return new r.Plugin({props:{handleTextInput:function(e,t,n,r){var a=e.state,s=i.getParentNodeFromState(a);return"embed"===s.type.name&&(o.setBlockType(a.schema.nodes.embed,{src:s.textContent+r})(a,e.dispatch),!1)}}})}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),s=n(9),c=n(5),l=n(13),u=n(53),p=n(54),f=n(55),h=n(56),d=n(57),m=n(58),v=n(59),g=n(60),y=n(61),b=n(62),w=n(4),k=n(6),_=n(12),x=s.tableNodes({group:"block",tableGroup:"block",cellContent:"block+",cellAttributes:{background:{default:null,getFromDOM:function(e){return e.style.backgroundColor||null},setDOMAttr:function(e,t){e&&(t.style=(t.style||"")+"background-color: "+e+";")}}}}),S=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"table"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"group",{get:function(){return"block"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){var e=this;return this.customSchema?this.customSchema:(x.table.parseDOM=[{tag:"table",getAttrs:function(e){return{id:e.getAttribute("id")||l()}}}],x.table.toDOM=function(t){return["table",{class:e.className},["tbody",0]]},x.table.attrs={id:{default:""}},x.table)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schemaDependencies",{get:function(){x.table;return i(x,["table"])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return a.createElement(p.default,{style:{width:"24px",height:"24px"}})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hideBlockMenuOnFocus",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"plugins",{get:function(){return[s.tableEditing()]},enumerable:!0,configurable:!0}),t.prototype.active=function(e){return w.blockActive(e.schema.nodes.table)(e)},t.prototype.enable=function(e){return c.setBlockType(e.schema.nodes.table)(e)},t.prototype.onClick=function(e,t){var n=w.createTable(e.schema,{id:l()});t(e.tr.replaceSelectionWith(n))},t.prototype.customInlineMenu=function(e){var t=e.state,n=e.dispatch;return a.createElement(a.Fragment,null,a.createElement(_.default,{type:"button",className:"smartblock-cell-btn",onClick:function(){s.mergeCells(t,n)}},a.createElement(g.default,{style:{width:"24px",height:"24px"}})),a.createElement(_.default,{type:"button",className:"smartblock-cell-btn",onClick:function(){s.splitCell(t,n)}},a.createElement(v.default,{style:{width:"24px",height:"24px"}})),a.createElement(_.default,{type:"button",className:"smartblock-cell-btn",onClick:function(){u.toggleCell("th")(t,n)}},a.createElement("span",{style:{display:"inline-block",verticalAlign:"text-bottom"}},"th")),a.createElement(_.default,{type:"button",className:"smartblock-cell-btn",onClick:function(){u.toggleCell("td")(t,n)}},a.createElement("span",{style:{display:"inline-block",verticalAlign:"text-bottom"}},"td")))},t.prototype.customMenu=function(e){var t=e.state,n=e.dispatch;return a.createElement(a.Fragment,null,a.createElement(_.default,{type:"button",onClick:function(){s.addColumnAfter(t,n)}},a.createElement(h.default,{style:{width:"24px",height:"24px"}})),a.createElement(_.default,{type:"button",onClick:function(){s.addColumnBefore(t,n)}},a.createElement(f.default,{style:{width:"24px",height:"24px"}})),a.createElement(_.default,{type:"button",onClick:function(){s.addRowBefore(t,n)}},a.createElement(d.default,{style:{width:"24px",height:"24px"}})),a.createElement(_.default,{type:"button",onClick:function(){s.addRowAfter(t,n)}},a.createElement(m.default,{style:{width:"24px",height:"24px"}})),a.createElement(_.default,{type:"button",onClick:function(){s.deleteColumn(t,n)}},a.createElement(b.default,{style:{width:"24px",height:"24px"}})),a.createElement(_.default,{type:"button",onClick:function(){s.deleteRow(t,n)}},a.createElement(y.default,{style:{width:"24px",height:"24px"}})))},t.prototype.keys=function(){return{Tab:s.goToNextCell(1),"Shift-Tab":s.goToNextCell(-1)}},t}(k.Extension);t.default=S},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9);t.toggleCell=function(e){return function(t,n){if(!function(e){for(var t=e.selection.$head,n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}(t))return!1;if(n){var o=function(e){var t=e.cached.tableNodeTypes;if(!t)for(var n in t=e.cached.tableNodeTypes={},e.nodes){var r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}return t}(t.schema),i=function(e){var t,n=e.selection,o=r.selectionCell(e),i=o.node(-1),a=o.start(-1),s=r.TableMap.get(i);return(t=n instanceof r.CellSelection?s.rectBetween(n.$anchorCell.pos-a,n.$headCell.pos-a):s.findCell(o.pos-a)).tableStart=a,t.map=s,t.table=i,t}(t),a=t.tr,s=i,c=o.cell;"th"===e&&(c=o.header_cell),i.map.cellsInRect(s).forEach(function(e){var t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,c,n.attrs)}),n(a)}return!0}}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({x:"0px",y:"0px",width:"1792px",height:"1792px",viewBox:"0 0 1792 1792",enableBackground:"new 0 0 1792 1792",xmlSpace:"preserve"},e),o.createElement("g",{id:"Guide"}),o.createElement("g",{id:"Font",display:"none"},o.createElement("path",{display:"inline",d:"M746.667,224v149.333h298.667V224H746.667z M746.667,1120H0V522.667 c0-82.133,67.2-149.333,149.333-149.333h448V224c0-82.133,67.2-149.333,149.333-149.333h298.667 c82.134,0,149.333,67.2,149.333,149.333v149.333h448c82.133,0,149.333,67.2,149.333,149.333V1120h-746.667V970.667H746.667V1120z  M0,1568v-298.667h1792V1568c0,82.133-67.2,149.333-149.333,149.333H149.333C67.2,1717.333,0,1650.133,0,1568z"})),o.createElement("g",{id:"\\u5185\\u5BB9"},o.createElement("g",null,o.createElement("path",{d:"M960,0v832h832V0H960z M1664,704h-576V128h576V704z"}),o.createElement("path",{d:"M0,832h832V0H0V832z M128,128h576v576H128V128z"}),o.createElement("path",{d:"M960,1792h832V960H960V1792z M1088,1088h576v576h-576V1088z"}),o.createElement("path",{d:"M0,1792h832V960H0V1792z M128,1088h576v576H128V1088z"}))),o.createElement("g",{id:"\\u30E9\\u30D9\\u30EB"}),o.createElement("g",{id:"Unicode",display:"none"},o.createElement("text",{transform:"matrix(1 0 0 1 437.0627 964.2812)",display:"inline",fill:"#ED1E79",fontFamily:"'ArialMT'",fontSize:256},"U+F709")))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("g",{"data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("path",{d:"M1652.13 142.2v1512h-550v-1512h550m140-140h-830v1792h830V2.2zM.13 1633.2h160v160H.13zM160.13 1555.78H.13v-154.84h160zm0-232.26H.13v-154.84h160zm0-232.26H.13V936.42h160zm0-232.27H.13V704.15h160zm0-232.26H.13V471.89h160zm0-232.26H.13V239.63h160zM.13 2.2h160v160H.13zM627.28 162.2H471.56V2.2h155.72zm-233.57 0H238V2.2h155.71zM705.13 2.2h160v160h-160zM865.13 1555.78h-160v-154.84h160zm0-232.26h-160v-154.84h160zm0-232.26h-160V936.42h160zm0-232.27h-160V704.15h160zm0-232.26h-160V471.89h160zm0-232.26h-160V239.63h160zM705.13 1633.2h160v160h-160zM627.28 1793.2H471.56v-160h155.72zm-233.57 0H238v-160h155.71zM677.13 834.21h-165v-165h-150v165h-165v150h165v164.99h150V984.21h165v-150z"})))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("g",{"data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("path",{d:"M690 141.73v1512H140v-1512h550m140-140H0v1792h830V1.73zM1632 2.73h160v160h-160zM1792 1556.3h-160v-154.84h160zm0-232.26h-160V1169.2h160zm0-232.26h-160V936.94h160zm0-232.26h-160V704.67h160zm0-232.27h-160V472.41h160zm0-232.25h-160V240.15h160zM1632 1633.73h160v160h-160zM1554.14 1793.73h-155.71v-160h155.71zm-233.57 0h-155.71v-160h155.71zM927 1633.73h160v160H927zM1087 1556.3H927v-154.84h160zm0-232.26H927V1169.2h160zm0-232.26H927V936.94h160zm0-232.26H927V704.67h160zm0-232.27H927V472.41h160zm0-232.25H927V240.15h160zM927 2.73h160v160H927zM1554.14 162.73h-155.71v-160h155.71zm-233.57 0h-155.71v-160h155.71zM1595 811.73h-165v-165h-150v165h-165v150h165v165h150v-165h165v-150z"})))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("g",{"data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("path",{d:"M1638.26 1103.73v550h-1512v-550h1512m140-140h-1792v830h1792v-830zM-12.74 1.73h160v160h-160zM1540.84 161.73H1386v-160h154.84zm-232.26 0h-154.84v-160h154.84zm-232.27 0H921.47v-160h154.84zm-232.26 0H689.21v-160h154.84zm-232.26 0H457v-160h154.79zm-232.26 0H224.68v-160h154.85zM1618.26 1.73h160v160h-160zM1778.26 628.87h-160V473.15h160zm0-233.57h-160V239.58h160zM1618.26 706.73h160v160h-160zM1540.84 866.73H1386v-160h154.84zm-232.26 0h-154.84v-160h154.84zm-232.27 0H921.47v-160h154.84zm-232.26 0H689.21v-160h154.84zm-232.26 0H457v-160h154.79zm-232.27 0H224.68v-160h154.84zM-12.74 706.73h160v160h-160zM147.26 628.87h-160V473.15h160zm0-233.57h-160V239.58h160zM1111.26 363.73h-165v-165h-150v165h-165v150h165v165h150v-165h165v-150z"})))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("g",{"data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("path",{d:"M1662.55 141.73v550h-1512v-550h1512m140-140h-1792v830h1792v-830zM1641.55 1633.73h160v160h-160zM1564.13 1793.73h-154.84v-160h154.84zm-232.26 0H1177v-160h154.85zm-232.27 0H944.76v-160h154.84zm-232.26 0H712.5v-160h154.84zm-232.26 0H480.23v-160h154.85zm-232.27 0H248v-160h154.81zM10.55 1633.73h160v160h-160zM170.55 1555.87h-160v-155.72h160zm0-233.57h-160v-155.72h160zM10.55 928.73h160v160h-160zM1564.13 1088.73h-154.84v-160h154.84zm-232.26 0H1177v-160h154.85zm-232.27 0H944.76v-160h154.84zm-232.26 0H712.5v-160h154.84zm-232.26 0H480.23v-160h154.85zm-232.27 0H248v-160h154.81zM1641.55 928.73h160v160h-160zM1801.55 1555.87h-160v-155.72h160zm0-233.57h-160v-155.72h160zM1157.55 1281.73h-165v-165h-150v165h-165v150h165v165h150v-165h165v-150z"})))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"split"),o.createElement("g",{id:"b1d8cdf3-334a-4ea0-8201-7742f35526ee","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("path",{d:"M1692,100V1692H100V100H1692M1792,0H0V1792H1792V0Z"}),o.createElement("polygon",{points:"1536 896 1176 1196 1176 596 1536 896"}),o.createElement("polygon",{points:"256 896 616 1196 616 596 256 896"}),o.createElement("rect",{x:846,width:100,height:1792})))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"merge"),o.createElement("g",{id:"a6e86b8f-02bd-4744-89fd-00d642cba97e","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("polygon",{points:"896 0 896 633.99 960 576 960 100 1692 100 1692 1692 960 1692 960 1216 896 1158.01 896 1792 1792 1792 1792 0 896 0"}),o.createElement("polygon",{points:"896 0 896 633.99 832 576 832 100 100 100 100 1692 832 1692 832 1216 896 1158.01 896 1792 0 1792 0 0 896 0"}),o.createElement("polygon",{points:"1024 896 1384 1196 1384 596 1024 896"}),o.createElement("polygon",{points:"768 896 408 1196 408 596 768 896"})))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("g",{"data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("path",{d:"M-18.45 415.79h160v160h-160zM1536.08 575.79h-154.95v-160h154.95zm-232.42 0h-155v-160h155zm-232.43 0H916.29v-160h154.94zm-232.42 0H683.87v-160h154.94zm-232.42 0H451.44v-160h155zm-232.42 0H219v-160h155zM1613.55 415.79h160v160h-160zM1773.55 1124.36h-160V941.5h160zm0-274.29h-160V667.22h160zM1613.55 1215.79h160v160h-160zM1536.08 1375.79h-154.95v-160h154.95zm-232.42 0h-155v-160h155zm-232.43 0H916.29v-160h154.94zm-232.42 0H683.87v-160h154.94zm-232.42 0H451.44v-160h155zm-232.42 0H219v-160h155zM-18.45 1215.79h160v160h-160zM141.55 1124.36h-160V941.5h160zm0-274.29h-160V667.22h160zM632.21 820.31h490v150h-490z"})))}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("g",{"data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("path",{d:"M1199.55-.21h160v160h-160zM1359.55 1554.32h-160v-155h160zm0-232.43h-160V1167h160zm0-232.42h-160V934.53h160zm0-232.42h-160V702.11h160zm0-232.42h-160V469.68h160zm0-232.42h-160V237.26h160zM1199.55 1631.79h160v160h-160zM1108.12 1791.79H925.26v-160h182.86zm-274.28 0H651v-160h182.84zM399.55 1631.79h160v160h-160zM559.55 1554.32h-160v-155h160zm0-232.43h-160V1167h160zm0-232.42h-160V934.53h160zm0-232.42h-160V702.11h160zm0-232.42h-160V469.68h160zm0-232.42h-160V237.26h160zM399.55-.21h160v160h-160zM1108.12 159.79H925.27v-160h182.85zm-274.28 0H651v-160h182.84zM644.8 822.73h460v150h-460z"})))}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(5),s=n(13),c=n(64),l=n(6),u=n(4),p=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"blockquote"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"group",{get:function(){return"block"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){var e=this;return this.customSchema?this.customSchema:{content:"inline*",group:"block",parseDOM:[{tag:"blockquote",getAttrs:function(e){return{id:e.getAttribute("id")||s()}}}],attrs:{align:{default:"left"},id:{default:""}},toDOM:function(t){return["blockquote",{class:e.className},0]}}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return i.createElement(c.default,{style:{width:"24px",height:"24px"}})},enumerable:!0,configurable:!0}),t.prototype.active=function(e){return u.blockActive(e.schema.nodes.blockquote)(e)},t.prototype.enable=function(e){return a.setBlockType(e.schema.nodes.blockquote)(e)},t.prototype.onClick=function(e,t){a.setBlockType(e.schema.nodes.blockquote)(e,t)},t}(l.Extension);t.default=p},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({id:"\\u30B0\\u30EB\\u30FC\\u30D7\\u5316_174","data-name":"\\u30B0\\u30EB\\u30FC\\u30D7\\u5316 174",width:24,height:16.446,viewBox:"0 0 24 16.446"},e),o.createElement("path",{id:"\\u30D1\\u30B9_1329","data-name":"\\u30D1\\u30B9 1329",d:"M130.834,465.741l2.981-7.053h-4.265s-5.644,8.544-5.756,8.72a4.954,4.954,0,0,0-.778,2.669,5.17,5.17,0,0,0,10.337,0A5.029,5.029,0,0,0,130.834,465.741Z",transform:"translate(-123.017 -458.688)"}),o.createElement("path",{id:"\\u30D1\\u30B9_1330","data-name":"\\u30D1\\u30B9 1330",d:"M165.515,465.741l2.981-7.053h-4.265s-5.644,8.544-5.756,8.72a4.951,4.951,0,0,0-.778,2.669,5.17,5.17,0,0,0,10.337,0A5.029,5.029,0,0,0,165.515,465.741Z",transform:"translate(-144.497 -458.688)"}))}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(5),s=n(66),c=n(6),l=n(4),u=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"strong"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"group",{get:function(){return"mark"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return this.customSchema?this.customSchema:{group:"mark",parseDOM:[{tag:"strong"},{style:"font-weight=bold"}],toDOM:function(){return["strong",{style:"font-weight:bold"}]}}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return i.createElement(s.default,{style:{width:"24px",height:"24px"}})},enumerable:!0,configurable:!0}),t.prototype.active=function(e){return l.markActive(e.schema.marks.strong)(e)},t.prototype.onClick=function(e,t){a.toggleMark(e.schema.marks.strong)(e,t)},t}(c.Extension);t.default=u},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"bold"),o.createElement("g",{id:"a5473643-9da8-4ded-814a-fc4f596f9c7a","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("path",{d:"M1455.78,430.37A532.41,532.41,0,0,1,1439.6,559.8,355.56,355.56,0,0,1,1386.09,678q-37.33,53.55-97.07,94.58t-144.35,61v14.94a585.31,585.31,0,0,1,141.86,42.31,364.25,364.25,0,0,1,117,82.13q49.76,52.27,78.4,126.93t28.62,176.72q0,134.4-57.24,232.71t-153.07,160.53q-95.84,62.23-217.78,92.09T831.07,1791.8H722.8q-66,0-141.87-3.74t-154.31-11.2q-78.39-7.47-143.11-22.4V37.13q47.25-7.47,108.27-14.94T522.45,9.75q69.64-5,143.11-7.47T811.16-.2a1491.47,1491.47,0,0,1,237.69,18.66q115.73,18.67,206.57,66T1401,216.33Q1455.74,301,1455.78,430.37Zm-734.22,326q34.82,0,80.89-2.45t75.91-7.39q94.56-29.52,163-88.67t68.44-155.17q0-64-24.89-105.89a188.49,188.49,0,0,0-66-66.5q-41.07-24.62-93.34-34.46A590.21,590.21,0,0,0,816.13,286q-64.74,0-119.46,2.49t-84.62,7.35V756.42Zm112,749.15a490.28,490.28,0,0,0,120.71-14.77q58.44-14.76,103.29-45.58a240.54,240.54,0,0,0,72.17-77.62q27.36-46.78,27.38-110.88,0-81.32-32.35-128.1t-84.63-72.68q-52.26-25.9-117-33.29a1146.62,1146.62,0,0,0-129.43-7.39H612.05V1490.8q12.42,5,39.82,7.38t58.49,3.7q31.08,1.27,64.71,2.49T833.56,1505.57Z"})))}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(5),s=n(68),c=n(6),l=n(4),u=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"em"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"group",{get:function(){return"mark"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){var e=this;return this.customSchema?this.customSchema:{group:"mark",parseDOM:[{tag:"em"},{style:"font-style=italic"}],toDOM:function(){return["span",{class:e.className,style:"font-style:italic"}]}}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return i.createElement(s.default,{style:{width:"24px",height:"24px"}})},enumerable:!0,configurable:!0}),t.prototype.active=function(e){return l.markActive(e.schema.marks.em)(e)},t.prototype.onClick=function(e,t){a.toggleMark(e.schema.marks.em)(e,t)},t}(c.Extension);t.default=u},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"emphasis"),o.createElement("g",{id:"aac5153c-aa10-4b5d-a4a4-c366cc71b33f","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("rect",{y:1531.8,width:1250,height:260.2}),o.createElement("path",{d:"M1792,249.69C1768.56,88.74,1619.07-22.74,1458.12.7L857.65,805.87l333.88,249L1792,249.69"}),o.createElement("polygon",{points:"937.11 1396.16 413.09 1402.06 774.55 917.32 1108.49 1166.33 937.11 1396.16"})))}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(5),s=n(70),c=n(6),l=n(4),u=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"underline"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"group",{get:function(){return"mark"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){var e=this;return this.customSchema?this.customSchema:{group:"mark",parseDOM:[{tag:"u"},{style:"text-decoration=underline"}],toDOM:function(){return["span",{style:"text-decoration:underline",class:e.className}]}}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return i.createElement(s.default,{style:{width:"24px",height:"24px"}})},enumerable:!0,configurable:!0}),t.prototype.active=function(e){return l.markActive(e.schema.marks.underline)(e)},t.prototype.onClick=function(e,t){a.toggleMark(e.schema.marks.underline)(e,t)},t}(c.Extension);t.default=u},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"underline"),o.createElement("g",{id:"b9648317-2b4a-4fc1-b757-c99f167223ab","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("path",{d:"M1208,0h320.75V744.07q0,167.82-44.41,288.67T1361,1232.59q-79,79-192.44,116t-249.2,37Q263,1385.56,263,786V0h338V719.4q0,101.19,18.5,171.47t58,113.5q39.45,43.19,98.69,61.68t138.17,18.5q155.43,0,224.52-86.35T1208,719.4Z"}),o.createElement("rect",{x:265.39,y:1581.26,width:1265.7,height:210.95})))}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(5),s=n(72),c=n(6),l=n(4),u=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"strike"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"group",{get:function(){return"mark"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){var e=this;return this.customSchema?this.customSchema:{group:"mark",parseDOM:[{tag:"strike"},{style:"text-decoration=line-through"},{style:"text-decoration-line=line-through"}],toDOM:function(){return["span",{style:"text-decoration-line:line-through",class:e.className}]}}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return i.createElement(s.default,{style:{width:"24px",height:"24px"}})},enumerable:!0,configurable:!0}),t.prototype.active=function(e){return l.markActive(e.schema.marks.strike)(e)},t.prototype.onClick=function(e,t){a.toggleMark(e.schema.marks.strike)(e,t)},t}(c.Extension);t.default=u},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"strikethrough"),o.createElement("g",{id:"b9bc1bbe-05e0-4535-8a25-40617985e9ea","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("polygon",{points:"1422.66 992 1422.66 992 1600 992 1600 800 1600 800 1600 992 1422.66 992",fill:"none"}),o.createElement("path",{d:"M964.35,1076.72q87.35,40.62,145.23,89.84t57.85,128q0,103.39-80,153.85t-230.15,50.46A769.32,769.32,0,0,1,733,1489a1111.74,1111.74,0,0,1-114.46-24.62q-54.18-14.78-97.23-32t-70.16-32l-108.31,288q66.46,34.5,206.77,68.92t324.93,34.47q140.31,0,257.23-32t199.38-98.46q82.44-66.45,128-166.15t45.54-237.54q0-109.53-36.55-190.32H944Q954.27,1072,964.35,1076.72Z"}),o.createElement("path",{d:"M922.51,679.18q-87.4-41.83-145.23-91.08T719.43,465q0-78.75,62.77-125.54t180.92-46.77q125.53,0,233.85,28.31t162.46,62.77l105.85-283.08q-86.21-49.21-219.08-75.08T963.12-.2q-130.5,0-236.31,29.53T543.43,120.41Q465.9,182,424,274.26T382.2,492.1q0,140.51,54.11,232.58h583.94Q969.25,701.58,922.51,679.18Z"}),o.createElement("polygon",{points:"1184.35 800 490.37 800 192 800 192 992 772.42 992 1422.66 992 1600 992 1600 800 1184.35 800"}),o.createElement("polygon",{points:"490.37 800 490.37 800 192 800 192 992 192 992 192 800 490.37 800",fill:"#fff"})))}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),a=n(5),s=n(24),c=n(6),l=n(4),u=n(74),p=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return"link"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"group",{get:function(){return"mark"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showMenu",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){if(this.customSchema)return this.customSchema;var e=this.className;return{group:"mark",attrs:{href:{},editing:{default:!0},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]:not(.embed)",getAttrs:function(e){return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:function(t){var n=t.attrs;return["a",{href:n.href,title:n.title,class:e},0]}}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return i.createElement(s.default,{style:{width:"24px",height:"24px"}})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"plugins",{get:function(){return[u.default()]},enumerable:!0,configurable:!0}),t.prototype.active=function(e){return l.markActive(e.schema.marks.link)(e)},t.prototype.onClick=function(e,t){if(l.markActive(e.schema.marks.link)(e)){var n=l.getMarkInSelection("link",e),r=e.selection,o=r.$anchor,i=o.nodeBefore,s=o.nodeAfter,c=o.pos,u=r.from,p=r.to;u===p&&i&&s&&(u=c-i.nodeSize,p=c+s.nodeSize);var f=e.tr;return f.removeMark(u,p,e.schema.marks.link),f.addMark(u,p,e.schema.marks.link.create({href:n.attrs.href,editing:!0})),t(f.scrollIntoView()),!0}a.toggleMark(e.schema.marks.link,{href:"",editing:!0})(e,t)},t}(c.Extension);t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(2),i=n(0),a=n(75),s=n(4),c=r.useRef,l=function(e){var t=e.view,n=c(null),o=function(e){var t=e.state.selection,n=e.dom,r=e.state.selection.$anchor.nodeAfter,o=null;if(r&&(o=r.marks.find(function(e){if("link"===e.type.name)return!0})),!t||t.empty||!n||!o)return{left:-1e3,top:0};var i=e.coordsAtPos(t.$head.pos),a=i.top+s.getScrollTop()+30,c=i.left-50;return c+320>window.innerWidth?{top:a,left:window.innerWidth-320}:{left:c,top:a}}(t),i=t.state.selection,l=i.$anchor,u=l.nodeBefore,p=l.nodeAfter,f=l.pos,h=null,d=!1;p&&(h=p.marks.find(function(e){if("link"===e.type.name)return!0}));var m="";h&&(m=h.attrs.href),h&&(d=h.attrs.editing);var v=i.from,g=i.to;v===g&&u&&p&&(v=f-u.nodeSize,g=f+p.nodeSize);var y=function(e){var t=e.state.selection,n=e.dom,r=e.state.selection.$anchor.nodeAfter,o=null;if(r&&(o=r.marks.find(function(e){return"link"===e.type.name})),!t||t.empty||!n||!o)return 20;var i=e.coordsAtPos(t.$head.pos).left-50;return i+320>window.innerWidth?i-window.innerWidth+320:20}(t);return r.createElement("div",{className:"smartblock-tooltip-wrap",ref:n,style:o},r.createElement("div",{className:"smartblock-tooltip-arrow",style:{left:y+"px"}}),r.createElement(a.default,{url:m,editing:d,onClick:function(e){var n=t.state.tr;n.removeMark(v,g,t.state.schema.marks.link),e?(n.addMark(v,g,t.state.schema.marks.link.create({href:e,editing:!1})),t.dispatch(n)):t.dispatch(n)}}))},u=function(){function e(e){this.tooltip=document.createElement("div"),document.body.appendChild(this.tooltip),this.update(e)}return e.prototype.render=function(e){i.render(r.createElement(l,{view:e}),this.tooltip)},e.prototype.update=function(e){this.render(e)},e.prototype.destroy=function(){i.unmountComponentAtNode(this.tooltip),document.body.removeChild(this.tooltip)},e}();t.default=function(){return new o.Plugin({view:function(e){return new u(e)}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(25);t.default=function(e){var t=r.useState(""),n=t[0],i=t[1],a=e.editing;return r.useEffect(function(){i(e.url)},[e.url]),a?r.createElement("div",{className:"smartblock-tooltip"},r.createElement("div",{className:"smartblock-tooltip-inner"},r.createElement("input",{className:"smartblock-tooltip-input",type:"text",value:n,placeholder:"https://~",onKeyDown:function(t){"Enter"===t.key&&e.onClick(n)},onChange:function(e){i(e.target.value)}}),r.createElement("button",{className:"smartblock-tooltip-btn",onClick:function(){e.onClick(n)},style:{paddingLeft:"7px"}},r.createElement(o.default,{style:{width:"24px",height:"24px",overflow:"hidden"}})))):null}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){switch(n.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!=e?"nan":e&&1===e.nodeType?"element":typeof(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(27),o=n(28),i=n(29),a=n(30),s=n(40),c=n(42),l=n(44),u=n(45),p=n(47),f=n(49),h=n(52),d=n(63),m=n(65),v=n(67),g=n(69),y=n(71),b=n(73),w=n(31),k=n(32);t.default=[new r.default,new s.default,new c.default,new l.default,new u.default,new p.default,new f.default,new h.default,new d.default,new m.default,new v.default,new g.default,new y.default,new b.default,new a.default,new i.default,new o.default,new w.default,new k.default({placeholder:"Content here..."})]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(2),i=n(8),a=n(4);t.useForceUpdate=function(){var e=r.useState(0)[1];return function(){e(function(e){return e+1})}},t.useView=function(e){var n=t.useForceUpdate();return r.useMemo(function(){var t=new i.EditorView(null,{state:o.EditorState.create(e.options),dispatchTransaction:function(r){var o=t.state.applyTransaction(r),i=o.state,a=o.transactions;t.updateState(i),a.some(function(e){return e.docChanged})&&e.onChange(i,t.dispatch),n()},attributes:e.attributes,nodeViews:e.nodeViews});return e.onChange(t.state,t.dispatch),t},[])},t.useScroll=function(){var e=r.useState(a.getScrollTop()),t=e[0],n=e[1];return r.useEffect(function(){var e=function(){n(a.getScrollTop())};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}},[t]),t},t.useScrolling=function(e,t){var n=r.useState(!1),o=n[0],i=n[1];return r.useEffect(function(){var n=null,r=0;if(e.current){var a=e.current.getBoundingClientRect().top,s=setInterval(function(){var s=e.current.getBoundingClientRect().top;s!==a&&(a=s,3==++r&&!1===o&&(r=0,i(!0)),clearTimeout(n),n=setTimeout(function(){i(!1),r=0},t))},100);return function(){clearInterval(s)}}},[]),o}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),i=n(0),a=n(80),s=n(77);t.default=function(e,t){var n="string"==typeof e?document.querySelector(e):e;t.extensions||(t.extensions=s.default),i.render(o.createElement(o.Fragment,null,o.createElement(a.default,r({},t))),n)}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),i=n(1),a=n(10),s=n(5),c=n(81),l=n(14),u=n(13),p=n(87),f=n(88),h=n(89),d=n(90),m=n(91),v=n(93),g=n(96),y=n(4),b=n(97),w=o.useState,k=o.useEffect,_=o.useRef,x=function(e){return e.filter(function(e){return"mark"===e.group})},S=function(e){var t=function(e){return e.filter(function(e){return!(!e.schema||"block"!==e.schema.group)}).reduce(function(e,t,n){var o,i=((o={})[t.name]=r({},t.schema),o);return r({},e,i)},{})}(e),n=function(e){return e.reduce(function(e,t){return t.schemaDependencies?Object.assign({},e,t.schemaDependencies):e},{})}(e);t=r({},t,{doc:{content:"block+"},text:{group:"inline"},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:function(){return["br"]}}},n);var o=function(e){return x(e).reduce(function(e,t,n){var o,i=((o={})[t.name]=r({},t.schema),o);return r({},e,i)},{})}(e);return new i.Schema({nodes:t,marks:o})},O=function(e){return e.filter(function(e){return e.showMenu})},C=function(e,t){var n=[];e.forEach(function(e){e.plugins&&(n=n.concat(e.plugins))});var r=function(e,t){var n={};e.forEach(function(e){if(e.keys){var r=e.keys(t);Object.keys(r).forEach(function(e){n[e]||(n[e]=[]),n[e].push(r[e])})}});var r={};return Object.keys(n).forEach(function(e){r[e]=s.chainCommands.apply(void 0,n[e])}),a.keymap(r)}(e,t);return n.concat([r])};t.default=function(e){var t={extensions:b.default,offsetTop:0,showBackBtn:!1,autoSave:!1,showTitle:!1,titleText:"",full:!1},n=(e=Object.assign({},t,e)).html,r=e.json,a=e.extensions,s=e.showBackBtn,M=e.showTitle,E=e.markdown,N=e.showdown,T=e.titleText,A=S(e.extensions),P=n;if(r){var D=i.Node.fromJSON(A,r);P=y.getHtmlFromNode(D,A)}if(E&&N){var z=new N.Converter;z.setFlavor("github"),P=z.makeHtml(E)}if(e.autoSave){var j=location.pathname,R=localStorage.getItem("smartblock:"+j);R&&(P=R),M&&(T=localStorage.getItem("smartblock-title:"+j))}var I=w(null),B=I[0],F=I[1],$=_(null);k(function(){var t=document.createElement("div");t.innerHTML=P;var n=i.DOMParser.fromSchema(A).parse(t,{preserveWhitespace:!0});e.onInit&&e.onInit({schema:A}),e.getEditorRef&&e.getEditorRef($);var r={schema:A,plugins:C(a,A),doc:n};F(r)},[]);var V=w(!0),L=V[0],H=V[1],q=o.useMemo(function(){return u()},[]),W=_(null),J=function(e){return e.filter(function(e){return"block"===e.group})}(a),K=x(a),U=function(e){return e.filter(function(e){return"edit"===e.group})}(a),Q=function(e){var t={};return e.forEach(function(e){e.view&&(t[e.name]=function(t,n,r){return e.view(t,n,r)})}),t}(a);return o.createElement("div",{id:q,onClick:function(e){e.target.getAttribute("id")===q?H(!1):H(!0)},ref:$},o.createElement("div",{className:l.default("smartblock-container",{"is-full":e.full})},e.showTitle&&o.createElement(g.default,{onChange:function(t){!function(e,t){var n=location.pathname;localStorage.setItem("smartblock-title:"+n,e),t.onTitleChange&&t.onTitleChange(e)}(t,e)},defaultValue:T,placeholder:e.titlePlaceholder}),o.createElement("div",{className:"smartblock-inner"},o.createElement("div",{className:L?"":"ProseMirrorHideSelection",ref:W},o.createElement("div",{className:"smartblock-input-area"},B&&o.createElement(p.default,{options:B,nodeViews:Q,onChange:function(t,n){(function(e,t,n,r,o,i){var a=e.doc;if(o&&o.current){var s=o.current.querySelector(".selected");if(s){var l=y.getViewport(),u=y.getScrollTop()+l.height,p=y.getOffset(s).top;if(p+80>=u){if(!/iPod|iPhone|iPad/.test(navigator.platform)||!document.activeElement)return c.default(0,p-80,{duration:300}),!0;if(document.activeElement.isContentEditable)return c.default(0,p-80,{duration:300}),!0}}}if(n.onChange){var f=y.getHtmlFromNode(a,r),h={json:a.toJSON(),html:f,schema:r};if(n.outputMarkdown&&i){var d=new i.Converter;d.setFlavor("github"),h.markdown=d.makeMd(f)}n.onChange(h)}if(n.autoSave){var m=location.pathname;f=y.getHtmlFromNode(a,r),localStorage.setItem("smartblock:"+m,f)}var v=a.content.childCount,g=a.content.child(v-1);if("paragraph"!==g.type.name){var b=e.schema.nodes.paragraph;t(e.tr.insert(e.doc.content.size,b.createAndFill()))}else 0!==g.textContent.length&&(b=e.schema.nodes.paragraph,t(e.tr.insert(e.doc.content.size,b.createAndFill())));return!1})(t,n,e,A,W,N)&&setTimeout(function(){H(!0)},700)},render:function(e){var t=e.editor,n=e.view;return e.scrolling&&H(!1),o.createElement(o.Fragment,null,L&&o.createElement(o.Fragment,null,o.createElement(d.default,{view:n,menu:O(J)}),o.createElement(h.default,{view:n,menu:O(U)}),function(e,t){var n=y.getParentNodeFromState(e.state),r=t.find(function(e){return e.name===n.type.name});return!r||!r.hideInlineMenuOnFocus}(n,J)&&o.createElement(f.default,{menu:O(K),blockMenu:O(J),view:n}),o.createElement(v.default,{view:n,menu:O(J)}),s&&o.createElement(m.default,{view:n})),t)}}))))))}},function(e,t,n){var r=n(82),o=n(86);e.exports=function(e,t,n){n=n||{};var i=function(){var e=window.pageYOffset||document.documentElement.scrollTop,t=window.pageXOffset||document.documentElement.scrollLeft;return{top:e,left:t}}(),a=r(i).ease(n.ease||"out-circ").to({top:t,left:e}).duration(n.duration||1e3);function s(){o(s),a.update()}return a.update(function(e){window.scrollTo(0|e.left,0|e.top)}),a.on("end",function(){s=function(){}}),s(),a}},function(e,t,n){var r=n(83),o=n(84),i=n(76),a=n(85);function s(e){if(!(this instanceof s))return new s(e);this._from=e,this.ease("linear"),this.duration(500)}e.exports=s,r(s.prototype),s.prototype.reset=function(){return this.isArray="array"===i(this._from),this._curr=o(this._from),this._done=!1,this._start=Date.now(),this},s.prototype.to=function(e){return this.reset(),this._to=e,this},s.prototype.duration=function(e){return this._duration=e,this},s.prototype.ease=function(e){if(!(e="function"==typeof e?e:a[e]))throw new TypeError("invalid easing function");return this._ease=e,this},s.prototype.stop=function(){return this.stopped=!0,this._done=!0,this.emit("stop"),this.emit("end"),this},s.prototype.step=function(){if(!this._done){var e=this._duration,t=Date.now();if(t-this._start>=e)return this._from=this._to,this._update(this._to),this._done=!0,this.emit("end"),this;var n=this._from,r=this._to,o=this._curr,i=(0,this._ease)((t-this._start)/e);if(this.isArray){for(var a=0;a<n.length;++a)o[a]=n[a]+(r[a]-n[a])*i;return this._update(o),this}for(var s in n)o[s]=n[s]+(r[s]-n[s])*i;return this._update(o),this}},s.prototype.update=function(e){return 0==arguments.length?this.step():(this._update=e,this)}},function(e,t){function n(e){if(e)return function(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}(e)}e.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},n.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return this},n.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var r=0,o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t);return this},n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,n){var r;try{r=n(76)}catch(e){r=n(76)}e.exports=function e(t){switch(r(t)){case"object":var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=e(t[o]));return n;case"array":for(var n=new Array(t.length),i=0,a=t.length;i<a;i++)n[i]=e(t[i]);return n;case"regexp":var s="";return s+=t.multiline?"m":"",s+=t.global?"g":"",s+=t.ignoreCase?"i":"",new RegExp(t.source,s);case"date":return new Date(t.getTime());default:return t}}},function(e,t){t.linear=function(e){return e},t.inQuad=function(e){return e*e},t.outQuad=function(e){return e*(2-e)},t.inOutQuad=function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},t.inCube=function(e){return e*e*e},t.outCube=function(e){return--e*e*e+1},t.inOutCube=function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},t.inQuart=function(e){return e*e*e*e},t.outQuart=function(e){return 1- --e*e*e*e},t.inOutQuart=function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},t.inQuint=function(e){return e*e*e*e*e},t.outQuint=function(e){return--e*e*e*e*e+1},t.inOutQuint=function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},t.inSine=function(e){return 1-Math.cos(e*Math.PI/2)},t.outSine=function(e){return Math.sin(e*Math.PI/2)},t.inOutSine=function(e){return.5*(1-Math.cos(Math.PI*e))},t.inExpo=function(e){return 0==e?0:Math.pow(1024,e-1)},t.outExpo=function(e){return 1==e?e:1-Math.pow(2,-10*e)},t.inOutExpo=function(e){return 0==e?0:1==e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))},t.inCirc=function(e){return 1-Math.sqrt(1-e*e)},t.outCirc=function(e){return Math.sqrt(1- --e*e)},t.inOutCirc=function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},t.inBack=function(e){var t=1.70158;return e*e*((t+1)*e-t)},t.outBack=function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},t.inOutBack=function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)},t.inBounce=function(e){return 1-t.outBounce(1-e)},t.outBounce=function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},t.inOutBounce=function(e){return e<.5?.5*t.inBounce(2*e):.5*t.outBounce(2*e-1)+.5},t["in-quad"]=t.inQuad,t["out-quad"]=t.outQuad,t["in-out-quad"]=t.inOutQuad,t["in-cube"]=t.inCube,t["out-cube"]=t.outCube,t["in-out-cube"]=t.inOutCube,t["in-quart"]=t.inQuart,t["out-quart"]=t.outQuart,t["in-out-quart"]=t.inOutQuart,t["in-quint"]=t.inQuint,t["out-quint"]=t.outQuint,t["in-out-quint"]=t.inOutQuint,t["in-sine"]=t.inSine,t["out-sine"]=t.outSine,t["in-out-sine"]=t.inOutSine,t["in-expo"]=t.inExpo,t["out-expo"]=t.outExpo,t["in-out-expo"]=t.inOutExpo,t["in-circ"]=t.inCirc,t["out-circ"]=t.outCirc,t["in-out-circ"]=t.inOutCirc,t["in-back"]=t.inBack,t["out-back"]=t.outBack,t["in-out-back"]=t.inOutBack,t["in-bounce"]=t.inBounce,t["out-bounce"]=t.outBounce,t["in-out-bounce"]=t.inOutBounce},function(e,t){t=e.exports=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){var t=(new Date).getTime(),r=Math.max(0,16-(t-n)),o=setTimeout(e,r);return n=t,o};var n=(new Date).getTime();var r=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.clearTimeout;t.cancel=function(e){r.call(window,e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(78),i=r.useRef,a=r.useEffect;t.default=function(e){var t=i(null),n=o.useView(e);a(function(){t.current&&t.current.appendChild(n.dom),e.autoFocus&&n.focus()},[]);var s=o.useScrolling(t,300),c=r.createElement("div",{ref:t});return e.render({editor:c,view:n,scrolling:s})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(4),i=n(12),a=r.useRef;t.default=function(e){var t=e.menu,n=e.blockMenu,s=e.children,c=e.view,l=c.state,u=c.dispatch,p=c.state.selection,f=a(null),h=function(e,t){var n=e.state.selection,r=o.getOffset(e.dom).left,i=e.coordsAtPos(n.$head.pos),a=o.getOffset(e.dom).top,s=i.top+o.getScrollTop()+25-a,c=i.left-50-r;if(t&&t.current&&t.current.offsetWidth){var l=t.current.offsetWidth;if(c+l>window.innerWidth)return{top:s,left:window.innerWidth-l}}return{left:c,top:s}}(c,f),d=function(e,t){var n=e.state.selection,r=o.getOffset(e.dom).left,i=e.coordsAtPos(n.$head.pos).left-50-r,a=t.current?t.current.offsetWidth:0;return t&&t.current&&t.current.offsetWidth&&i+a>window.innerWidth?i-window.innerWidth+a:20}(c,f),m=function(e){var t=e.blockMenu,n=e.view,o=n.state,i=t.find(function(e){return!(!e.active||!e.active(o))});return!(!i||!i.customInlineMenu)&&r.createElement(r.Fragment,null,i.customInlineMenu(n))}({blockMenu:n,view:c});return!p||p.empty?r.createElement(r.Fragment,null):0===t.length?r.createElement(r.Fragment,null):r.createElement("div",{style:h,ref:f,className:"smartblock-inline-menu"},r.createElement("div",{className:"smartblock-inline-menu-arrow",style:{left:d+"px"}}),r.createElement("div",{className:"smartblock-inline-menu-inner"},s,t.map(function(e,t){return r.createElement(i.default,{key:"inline-"+t,type:"button",active:e.active&&e.active(l),disabled:e.enable&&!e.enable(l),onClick:function(t){t.preventDefault(),e.onClick(l,u)}},"string"!=typeof e.icon?e.icon:r.createElement("span",{dangerouslySetInnerHTML:{__html:e.icon}}))}),m&&m.props&&m.props.children&&r.createElement(r.Fragment,null,m)))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(7),i=n(4),a=n(12),s=r.useState,c=r.useEffect,l=function(e){var t=e.view,n=t.state,r=n.selection;if(!r)return{top:-1e3};var a=r.$anchor,s=n.doc.resolve(a.pos).path[1],c=0;if(0===a.pos)return{top:-1e3};var l=o.findChildren(n.doc,function(e){return s===c||s+1===c?(c++,!0):(c++,!1)},!1)[0];if(!l)return{top:-1e3};var u,p=t.coordsAtPos(l.pos),f=t.nodeDOM(l.pos),h=i.getOffset(f).top,d=(u=t.dom,i.getOffset(u).top);return 0===p.top?{top:-1e3}:{right:20,top:h-d-40}};t.default=function(e){var t=s({right:20,top:0}),n=t[0],o=t[1],i=e.menu,u=e.view,p=u.state,f=u.dispatch;return c(function(){var t=l(e);o(t)},[e]),r.createElement("div",{style:n,className:"smartblock-edit-menu"},i.map(function(e,t){return r.createElement(a.default,{className:"smartblock-edit-btn",key:"edit-"+t,type:"button",color:e.btnColor,active:e.active&&e.active(p),disabled:e.enable&&!e.enable(p),onClick:function(t){t.preventDefault(),e.onClick(p,f,u)}},e.icon)}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(7),i=n(4),a=n(12),s=r.useState,c=r.useEffect;t.default=function(e){var t=e.menu,n=e.view,l=n.state,u=n.dispatch,p=function(e){var t=e.menu,n=e.view,o=n.state,i=t.find(function(e){return!(!e.active||!e.active(o))});return i&&i.customMenu?r.createElement(r.Fragment,null,i.customMenu(n)):r.createElement(r.Fragment,null)}(e),f=function(e){var t=e.menu,n=e.view,r=i.getParentNodeFromState(n.state);if(r&&t&&t.length){var o=r.type.name,a=t.find(function(e){return e.name===o});return!a||!a.hideMenuOnFocus}}(e),h=s({left:0,top:0}),d=h[0],m=h[1];if(c(function(){var t=function(e){var t=e.view,n=t.state,r=n.selection;if(!r||!r.empty)return{top:-1e3,right:0};var a=r.$anchor;if(0===a.pos)return{top:-1e3,right:0};var s=n.doc.resolve(a.pos).path[1],c=0,l=o.findChildren(n.doc,function(e){return s===c||s+1===c?(c++,!0):(c++,!1)},!1)[0];if(!l)return{top:-1e3};var u=t.coordsAtPos(l.pos),p=t.nodeDOM(l.pos),f=i.getOffset(p).top,h=i.getOffset(t.dom).top;return 0===u.top?{top:-1e3}:p&&p.offsetHeight?{left:5,top:f+p.offsetHeight-h+20}:{left:5,top:f-h+20}}(e);m(t)},[e]),!f)return null;var v=!1,g=t.find(function(e){return!(!e.active||!e.active(l))});return g&&g.hideBlockMenuOnFocus&&(v=!0),r.createElement("div",{style:d,className:"smartblock-menu"},r.createElement("div",{className:"smartblock-menu-top"},t.map(function(e,t){return e.customButton?e.customButton({state:l,dispatch:u}):r.createElement(a.default,{key:t,type:"button",active:e.active&&e.active(l),disabled:e.enable&&!e.enable(l)||v,onClick:function(t){t.preventDefault(),e.onClick(l,u,n)}},"string"!=typeof e.icon?e.icon:r.createElement("span",{dangerouslySetInnerHTML:{__html:e.icon}}))})),p&&p.props&&p.props.children&&r.createElement("div",{className:"smartblock-custom-menu"},p))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(21),i=n(92);t.default=function(e){var t=e.view,n=t.state,a=t.dispatch;return o.undoDepth(n)?r.createElement("button",{className:"smartblock-backbtn",onClick:function(){o.undo(n,a)}},r.createElement(i.default,{style:{width:"24px",height:"24px"}})):r.createElement(r.Fragment,null)}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function(e){return o.createElement("svg",r({width:1792,height:1792,viewBox:"0 0 1792 1792"},e),o.createElement("title",null,"undo"),o.createElement("g",{id:"bebf11ee-5e4c-414b-9c0e-9afbb64c0153","data-name":"\\u30E9\\u30D9\\u30EB"},o.createElement("path",{d:"M715.62,1146.77v412.47L0,843.62,715.62,128V510.8l356.57,39.61c395.14,43.91,676.64,243.79,716.86,492,31.48,194.23-94.21,351.37-190.3,420.9-106.64,77.16-245,118.33-401.49,76.89,119.27-39.75,212.14-134.61,207.69-214.79-7-125.53-148.89-178.63-452-178.63Z"})))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(94),i=n(4),a=r.useState,s=r.useEffect;t.default=function(e){var t=function(e){var t=e.menu,n=e.view,r=i.getParentNodeFromState(n.state);if(r&&t&&t.length){var o=r.type.name,a=t.find(function(e){return e.name===o});return a&&a.customLayout?a.customLayout:null}}(e);if(!t)return null;var n=e.view,c=i.calculateStyle(e.view),l=i.getParentNodeFromState(n.state),u=i.findNodePosition(n.state.doc,l),p=n.nodeDOM(u),f={position:"absolute",zIndex:10,top:c.top,left:0,right:0};return function(e){var t=a({top:0,left:0,width:0,height:0}),n=t[0],r=t[1];return s(function(){o.default(e,function(){var t=e.getBoundingClientRect();n.height!==t.height&&r(t)})}),n}(p).height?r.createElement("div",{style:f},t(e.view,p)):null}},function(e,t,n){var r,o;
  /*!
   * imagesLoaded v4.1.4
   * JavaScript is all like "You images are done yet or what?"
   * MIT License
   */
  /*!
   * imagesLoaded v4.1.4
   * JavaScript is all like "You images are done yet or what?"
   * MIT License
   */
  !function(i,a){"use strict";r=[n(95)],void 0===(o=function(e){return function(e,t){var n=e.jQuery,r=e.console;function o(e,t){for(var n in t)e[n]=t[n];return e}var i=Array.prototype.slice;function a(e,t,s){if(!(this instanceof a))return new a(e,t,s);var c=e;"string"==typeof e&&(c=document.querySelectorAll(e)),c?(this.elements=function(e){if(Array.isArray(e))return e;if("object"==typeof e&&"number"==typeof e.length)return i.call(e);return[e]}(c),this.options=o({},this.options),"function"==typeof t?s=t:o(this.options,t),s&&this.on("always",s),this.getImages(),n&&(this.jqDeferred=new n.Deferred),setTimeout(this.check.bind(this))):r.error("Bad element for imagesLoaded "+(c||e))}a.prototype=Object.create(t.prototype),a.prototype.options={},a.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},a.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),!0===this.options.background&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&s[t]){for(var n=e.querySelectorAll("img"),r=0;r<n.length;r++){var o=n[r];this.addImage(o)}if("string"==typeof this.options.background){var i=e.querySelectorAll(this.options.background);for(r=0;r<i.length;r++){var a=i[r];this.addElementBackgroundImages(a)}}}};var s={1:!0,9:!0,11:!0};function c(e){this.img=e}function l(e,t){this.url=e,this.element=t,this.img=new Image}return a.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var n=/url\((['"])?(.*?)\1\)/gi,r=n.exec(t.backgroundImage);null!==r;){var o=r&&r[2];o&&this.addBackground(o,e),r=n.exec(t.backgroundImage)}},a.prototype.addImage=function(e){var t=new c(e);this.images.push(t)},a.prototype.addBackground=function(e,t){var n=new l(e,t);this.images.push(n)},a.prototype.check=function(){var e=this;function t(t,n,r){setTimeout(function(){e.progress(t,n,r)})}this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?this.images.forEach(function(e){e.once("progress",t),e.check()}):this.complete()},a.prototype.progress=function(e,t,n){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&r&&r.log("progress: "+n,e,t)},a.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},c.prototype=Object.create(t.prototype),c.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.src)},c.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},c.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},c.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},c.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},l.prototype=Object.create(c.prototype),l.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},l.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},l.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},a.makeJQueryPlugin=function(t){(t=t||e.jQuery)&&((n=t).fn.imagesLoaded=function(e,t){return new a(this,e,t).jqDeferred.promise(n(this))})},a.makeJQueryPlugin(),a}(i,e)}.apply(t,r))||(e.exports=o)}("undefined"!=typeof window?window:this)},function(e,t,n){var r,o;"undefined"!=typeof window&&window,void 0===(o="function"==typeof(r=function(){"use strict";function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var n=this._events=this._events||{},r=n[e]=n[e]||[];return-1==r.indexOf(t)&&r.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var n=this._onceEvents=this._onceEvents||{};return(n[e]=n[e]||{})[t]=!0,this}},t.off=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){var r=n.indexOf(t);return-1!=r&&n.splice(r,1),this}},t.emitEvent=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){n=n.slice(0),t=t||[];for(var r=this._onceEvents&&this._onceEvents[e],o=0;o<n.length;o++){var i=n[o];r&&r[i]&&(this.off(e,i),delete r[i]),i.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e})?r.call(t,n,t,e):r)||(e.exports=o)},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),i=n(1),a=n(2),s=n(8),c=n(4),l=n(78),u=o.useRef,p=o.useEffect,f={nodes:{doc:{content:"block"},text:{group:"inline"},title:{group:"block",content:"text*",selectable:!1,parseDOM:[{tag:"h1"}],toDOM:function(){return["h1",0]}}}};t.default=function(e){e=Object.assign({},{placeholder:"Title here...",defaultValue:""},e);var t=u(null),n=new i.Schema(r({},f)),h=document.createElement("div");h.innerHTML=e.defaultValue;var d=i.DOMParser.fromSchema(n).parse(h),m={onChange:function(t){if(e.onChange){var r=c.getHtmlFromNode(t.doc,n);r=r.replace(/<h1>(.*)<\/h1>/,"$1"),e.onChange(r)}},options:{schema:n,doc:d,plugins:[new a.Plugin({props:{decorations:function(e){var t=[];return e.doc.descendants(function(e,n){e.type.isBlock&&0===e.childCount&&t.push(s.Decoration.node(n,n+e.nodeSize,{class:"empty-node"}))}),s.DecorationSet.create(e.doc,t)}}})]}},v=l.useView(m);return p(function(){t.current&&t.current.appendChild(v.dom)},[]),o.createElement("div",{ref:t,className:"smartblock-title"})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(27),o=n(28),i=n(29),a=n(30),s=n(31),c=n(32);t.default=[new r.default,new a.default,new i.default,new o.default,new s.default,new c.default({placeholder:"Content here..."})]}]).default});