Website : rimsha.abasa.com
backdoor
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
talha_silentcontent
/
.next
/
static
/
chunks
/
Filename :
6504-818ac5ed5fd8ae78.js
back
Copy
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6504],{9504:function(t,e){"use strict";var n,r;Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0,(r=n=e.ElementType||(e.ElementType={})).Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype",e.isTag=function(t){return t.type===n.Tag||t.type===n.Script||t.type===n.Style},e.Root=n.Root,e.Text=n.Text,e.Directive=n.Directive,e.Comment=n.Comment,e.Script=n.Script,e.Style=n.Style,e.Tag=n.Tag,e.CDATA=n.CDATA,e.Doctype=n.Doctype},3390:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var o=n(9504),s=n(8471);i(n(8471),e);var a={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},l=function(){function t(t,e,n){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof e&&(n=e,e=a),"object"==typeof t&&(e=t,t=void 0),this.callback=null!=t?t:null,this.options=null!=e?e:a,this.elementCB=null!=n?n:null}return t.prototype.onparserinit=function(t){this.parser=t},t.prototype.onreset=function(){this.dom=[],this.root=new s.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},t.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},t.prototype.onerror=function(t){this.handleCallback(t)},t.prototype.onclosetag=function(){this.lastNode=null;var t=this.tagStack.pop();this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(t)},t.prototype.onopentag=function(t,e){var n=this.options.xmlMode?o.ElementType.Tag:void 0,r=new s.Element(t,e,void 0,n);this.addNode(r),this.tagStack.push(r)},t.prototype.ontext=function(t){var e=this.lastNode;if(e&&e.type===o.ElementType.Text)e.data+=t,this.options.withEndIndices&&(e.endIndex=this.parser.endIndex);else{var n=new s.Text(t);this.addNode(n),this.lastNode=n}},t.prototype.oncomment=function(t){if(this.lastNode&&this.lastNode.type===o.ElementType.Comment){this.lastNode.data+=t;return}var e=new s.Comment(t);this.addNode(e),this.lastNode=e},t.prototype.oncommentend=function(){this.lastNode=null},t.prototype.oncdatastart=function(){var t=new s.Text(""),e=new s.CDATA([t]);this.addNode(e),t.parent=e,this.lastNode=t},t.prototype.oncdataend=function(){this.lastNode=null},t.prototype.onprocessinginstruction=function(t,e){var n=new s.ProcessingInstruction(t,e);this.addNode(n)},t.prototype.handleCallback=function(t){if("function"==typeof this.callback)this.callback(t,this.dom);else if(t)throw t},t.prototype.addNode=function(t){var e=this.tagStack[this.tagStack.length-1],n=e.children[e.children.length-1];this.options.withStartIndices&&(t.startIndex=this.parser.startIndex),this.options.withEndIndices&&(t.endIndex=this.parser.endIndex),e.children.push(t),n&&(t.prev=n,n.next=t),t.parent=e,this.lastNode=null},t}();e.DomHandler=l,e.default=l},8471:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.cloneNode=e.hasChildren=e.isDocument=e.isDirective=e.isComment=e.isText=e.isCDATA=e.isTag=e.Element=e.Document=e.CDATA=e.NodeWithChildren=e.ProcessingInstruction=e.Comment=e.Text=e.DataNode=e.Node=void 0;var s=n(9504),a=function(){function t(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.parent},set:function(t){this.parent=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"previousSibling",{get:function(){return this.prev},set:function(t){this.prev=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextSibling",{get:function(){return this.next},set:function(t){this.next=t},enumerable:!1,configurable:!0}),t.prototype.cloneNode=function(t){return void 0===t&&(t=!1),b(this,t)},t}();e.Node=a;var l=function(t){function e(e){var n=t.call(this)||this;return n.data=e,n}return i(e,t),Object.defineProperty(e.prototype,"nodeValue",{get:function(){return this.data},set:function(t){this.data=t},enumerable:!1,configurable:!0}),e}(a);e.DataNode=l;var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=s.ElementType.Text,e}return i(e,t),Object.defineProperty(e.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),e}(l);e.Text=c;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=s.ElementType.Comment,e}return i(e,t),Object.defineProperty(e.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),e}(l);e.Comment=h;var p=function(t){function e(e,n){var r=t.call(this,n)||this;return r.name=e,r.type=s.ElementType.Directive,r}return i(e,t),Object.defineProperty(e.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),e}(l);e.ProcessingInstruction=p;var u=function(t){function e(e){var n=t.call(this)||this;return n.children=e,n}return i(e,t),Object.defineProperty(e.prototype,"firstChild",{get:function(){var t;return null!==(t=this.children[0])&&void 0!==t?t:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childNodes",{get:function(){return this.children},set:function(t){this.children=t},enumerable:!1,configurable:!0}),e}(a);e.NodeWithChildren=u;var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=s.ElementType.CDATA,e}return i(e,t),Object.defineProperty(e.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),e}(u);e.CDATA=d;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=s.ElementType.Root,e}return i(e,t),Object.defineProperty(e.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),e}(u);e.Document=f;var m=function(t){function e(e,n,r,i){void 0===r&&(r=[]),void 0===i&&(i="script"===e?s.ElementType.Script:"style"===e?s.ElementType.Style:s.ElementType.Tag);var o=t.call(this,r)||this;return o.name=e,o.attribs=n,o.type=i,o}return i(e,t),Object.defineProperty(e.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.name},set:function(t){this.name=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"attributes",{get:function(){var t=this;return Object.keys(this.attribs).map(function(e){var n,r;return{name:e,value:t.attribs[e],namespace:null===(n=t["x-attribsNamespace"])||void 0===n?void 0:n[e],prefix:null===(r=t["x-attribsPrefix"])||void 0===r?void 0:r[e]}})},enumerable:!1,configurable:!0}),e}(u);function g(t){return(0,s.isTag)(t)}function y(t){return t.type===s.ElementType.CDATA}function k(t){return t.type===s.ElementType.Text}function v(t){return t.type===s.ElementType.Comment}function x(t){return t.type===s.ElementType.Directive}function w(t){return t.type===s.ElementType.Root}function b(t,e){if(void 0===e&&(e=!1),k(t))n=new c(t.data);else if(v(t))n=new h(t.data);else if(g(t)){var n,r=e?S(t.children):[],i=new m(t.name,o({},t.attribs),r);r.forEach(function(t){return t.parent=i}),null!=t.namespace&&(i.namespace=t.namespace),t["x-attribsNamespace"]&&(i["x-attribsNamespace"]=o({},t["x-attribsNamespace"])),t["x-attribsPrefix"]&&(i["x-attribsPrefix"]=o({},t["x-attribsPrefix"])),n=i}else if(y(t)){var r=e?S(t.children):[],s=new d(r);r.forEach(function(t){return t.parent=s}),n=s}else if(w(t)){var r=e?S(t.children):[],a=new f(r);r.forEach(function(t){return t.parent=a}),t["x-mode"]&&(a["x-mode"]=t["x-mode"]),n=a}else if(x(t)){var l=new p(t.name,t.data);null!=t["x-name"]&&(l["x-name"]=t["x-name"],l["x-publicId"]=t["x-publicId"],l["x-systemId"]=t["x-systemId"]),n=l}else throw Error("Not implemented yet: ".concat(t.type));return n.startIndex=t.startIndex,n.endIndex=t.endIndex,null!=t.sourceCodeLocation&&(n.sourceCodeLocation=t.sourceCodeLocation),n}function S(t){for(var e=t.map(function(t){return b(t,!0)}),n=1;n<e.length;n++)e[n].prev=e[n-1],e[n-1].next=e[n];return e}e.Element=m,e.isTag=g,e.isCDATA=y,e.isText=k,e.isComment=v,e.isDirective=x,e.isDocument=w,e.hasChildren=function(t){return Object.prototype.hasOwnProperty.call(t,"children")},e.cloneNode=b},3752:function(t,e){e.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"]},5426:function(t){var e,n="html",r="head",i="body",o=/<([a-zA-Z]+[0-9]?)/,s=/<head[^]*>/i,a=/<body[^]*>/i,l=function(){throw Error("This browser does not support `document.implementation.createHTMLDocument`")},c=function(){throw Error("This browser does not support `DOMParser.prototype.parseFromString`")},h="object"==typeof window&&window.DOMParser;if("function"==typeof h){var p=new h;l=c=function(t,e){return e&&(t="<"+e+">"+t+"</"+e+">"),p.parseFromString(t,"text/html")}}if("object"==typeof document&&document.implementation){var u=document.implementation.createHTMLDocument();l=function(t,e){return e?u.documentElement.querySelector(e).innerHTML=t:u.documentElement.innerHTML=t,u}}var d="object"==typeof document?document.createElement("template"):{};d.content&&(e=function(t){return d.innerHTML=t,d.content.childNodes}),t.exports=function(t){var h,p,u,d,f=t.match(o);switch(f&&f[1]&&(h=f[1].toLowerCase()),h){case n:return p=c(t),!s.test(t)&&(u=p.querySelector(r))&&u.parentNode.removeChild(u),!a.test(t)&&(u=p.querySelector(i))&&u.parentNode.removeChild(u),p.querySelectorAll(n);case r:case i:if(d=(p=l(t)).querySelectorAll(h),a.test(t)&&s.test(t))return d[0].parentNode.childNodes;return d;default:if(e)return e(t);return(u=l(t,i).querySelector(i)).childNodes}}},3082:function(t,e,n){var r=n(5426),i=n(6373).formatDOM,o=/<(![a-zA-Z\s]+)>/;t.exports=function(t){if("string"!=typeof t)throw TypeError("First argument must be a string");if(""===t)return[];var e,n=t.match(o);return n&&n[1]&&(e=n[1]),i(r(t),null,e)}},6373:function(t,e,n){for(var r,i=n(3390),o=n(3752).CASE_SENSITIVE_TAG_NAMES,s=i.Comment,a=i.Element,l=i.ProcessingInstruction,c=i.Text,h={},p=0,u=o.length;p<u;p++)h[(r=o[p]).toLowerCase()]=r;function d(t){for(var e,n={},r=0,i=t.length;r<i;r++)n[(e=t[r]).name]=e.value;return n}e.formatAttributes=d,e.formatDOM=function t(e,n,r){n=n||null;for(var i=[],o=0,p=e.length;o<p;o++){var u,f,m,g=e[o];switch(g.nodeType){case 1:(m=new a(f=h[u=(u=g.nodeName).toLowerCase()]||u,d(g.attributes))).children=t("template"===f?g.content.childNodes:g.childNodes,m);break;case 3:m=new c(g.nodeValue);break;case 8:m=new s(g.nodeValue);break;default:continue}var y=i[o-1]||null;y&&(y.next=m),m.parent=n,m.prev=y,m.next=null,i.push(m)}return r&&((m=new l(r.substring(0,r.indexOf(" ")).toLowerCase(),r)).next=i[0]||null,m.parent=n,i.unshift(m),i[1]&&(i[1].prev=i[0])),i}},4948:function(t,e,n){var r=n(3390),i=n(3082),o=n(7642),s=n(4471);i="function"==typeof i.default?i.default:i;var a={lowerCaseAttributeNames:!1};function l(t,e){if("string"!=typeof t)throw TypeError("First argument must be a string");return""===t?[]:s(i(t,(e=e||{}).htmlparser2||a),e)}l.domToReact=s,l.htmlToDOM=i,l.attributesToProps=o,l.Comment=r.Comment,l.Element=r.Element,l.ProcessingInstruction=r.ProcessingInstruction,l.Text=r.Text,t.exports=l,l.default=l},7642:function(t,e,n){var r=n(9455),i=n(9355),o=["checked","value"],s=["input","select","textarea"],a={reset:!0,submit:!0};function l(t){return r.possibleStandardNames[t]}t.exports=function(t,e){var n,c,h,p,u,d={},f=(t=t||{}).type&&a[t.type];for(n in t){if(h=t[n],r.isCustomAttribute(n)){d[n]=h;continue}if(p=l(c=n.toLowerCase())){switch(u=r.getPropertyInfo(p),-1===o.indexOf(p)||-1===s.indexOf(e)||f||(p=l("default"+c)),d[p]=h,u&&u.type){case r.BOOLEAN:d[p]=!0;break;case r.OVERLOADED_BOOLEAN:""===h&&(d[p]=!0)}continue}i.PRESERVE_CUSTOM_ATTRIBUTES&&(d[n]=h)}return i.setStyleProp(t.style,d),d}},4471:function(t,e,n){var r=n(2265),i=n(7642),o=n(9355),s=o.setStyleProp,a=o.canTextBeChildOfNode;t.exports=function t(e,n){for(var l,c,h,p,u,d=(n=n||{}).library||r,f=d.cloneElement,m=d.createElement,g=d.isValidElement,y=[],k="function"==typeof n.replace,v=n.transform||o.returnFirstArg,x=n.trim,w=0,b=e.length;w<b;w++){if(l=e[w],k&&g(h=n.replace(l))){b>1&&(h=f(h,{key:h.key||w})),y.push(v(h,l,w));continue}if("text"===l.type){if((c=!l.data.trim().length)&&l.parent&&!a(l.parent)||x&&c)continue;y.push(v(l.data,l,w));continue}switch(p=l.attribs,o.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===l.type&&o.isCustomComponent(l.name,l.attribs)?s(p.style,p):p&&(p=i(p,l.name)),u=null,l.type){case"script":case"style":l.children[0]&&(p.dangerouslySetInnerHTML={__html:l.children[0].data});break;case"tag":"textarea"===l.name&&l.children[0]?p.defaultValue=l.children[0].data:l.children&&l.children.length&&(u=t(l.children,n));break;default:continue}b>1&&(p.key=w),y.push(v(m(l.name,p,u),l,w))}return 1===y.length?y[0]:y}},9355:function(t,e,n){var r=n(2265),i=n(5693).default,o=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]),s={reactCompat:!0},a=r.version.split(".")[0]>=16,l=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);t.exports={PRESERVE_CUSTOM_ATTRIBUTES:a,ELEMENTS_WITH_NO_TEXT_CHILDREN:l,invertObject:function(t,e){if(!t||"object"!=typeof t)throw TypeError("First argument must be an object");var n="function"==typeof e,r={},i={};for(var o in t){var s=t[o];if(n&&(r=e(o,s))&&2===r.length){i[r[0]]=r[1];continue}"string"==typeof s&&(i[s]=o)}return i},isCustomComponent:function(t,e){return -1===t.indexOf("-")?e&&"string"==typeof e.is:!o.has(t)},setStyleProp:function(t,e){if(null!=t)try{e.style=i(t,s)}catch(t){e.style={}}},canTextBeChildOfNode:function(t){return!l.has(t.name)},returnFirstArg:function(t){return t}}},662:function(t){var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,l=/^\s+|\s+$/g;function c(t){return t?t.replace(l,""):""}t.exports=function(t,l){if("string"!=typeof t)throw TypeError("First argument must be a string");if(!t)return[];l=l||{};var h=1,p=1;function u(t){var e=t.match(n);e&&(h+=e.length);var r=t.lastIndexOf("\n");p=~r?t.length-r:p+t.length}function d(){var t={line:h,column:p};return function(e){return e.position=new f(t),y(r),e}}function f(t){this.start=t,this.end={line:h,column:p},this.source=l.source}f.prototype.content=t;var m=[];function g(e){var n=Error(l.source+":"+h+":"+p+": "+e);if(n.reason=e,n.filename=l.source,n.line=h,n.column=p,n.source=t,l.silent)m.push(n);else throw n}function y(e){var n=e.exec(t);if(n){var r=n[0];return u(r),t=t.slice(r.length),n}}function k(t){var e;for(t=t||[];e=v();)!1!==e&&t.push(e);return t}function v(){var e=d();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var n=2;""!=t.charAt(n)&&("*"!=t.charAt(n)||"/"!=t.charAt(n+1));)++n;if(n+=2,""===t.charAt(n-1))return g("End of comment missing");var r=t.slice(2,n-2);return p+=2,u(r),t=t.slice(n),p+=2,e({type:"comment",comment:r})}}return y(r),function(){var t,n=[];for(k(n);t=function(){var t=d(),n=y(i);if(n){if(v(),!y(o))return g("property missing ':'");var r=y(s),l=t({type:"declaration",property:c(n[0].replace(e,"")),value:r?c(r[0].replace(e,"")):""});return y(a),l}}();)!1!==t&&(n.push(t),k(n));return n}()}},9763:function(t,e,n){"use strict";n.d(e,{Z:function(){return s}});var r=n(2265),i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),s=(t,e)=>{let n=(0,r.forwardRef)((n,s)=>{let{color:a="currentColor",size:l=24,strokeWidth:c=2,absoluteStrokeWidth:h,children:p,...u}=n;return(0,r.createElement)("svg",{ref:s,...i,width:l,height:l,stroke:a,strokeWidth:h?24*Number(c)/Number(l):c,className:"lucide lucide-".concat(o(t)),...u},[...e.map(t=>{let[e,n]=t;return(0,r.createElement)(e,n)}),...(Array.isArray(p)?p:[p])||[]])});return n.displayName="".concat(t),n}},8310:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("AlignCenter",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"17",x2:"7",y1:"12",y2:"12",key:"rsh8ii"}],["line",{x1:"19",x2:"5",y1:"18",y2:"18",key:"1t0tuv"}]])},3720:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("AlignJustify",[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["line",{x1:"3",x2:"21",y1:"12",y2:"12",key:"10d38w"}],["line",{x1:"3",x2:"21",y1:"18",y2:"18",key:"kwyyxn"}]])},1734:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("AlignLeft",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}],["line",{x1:"17",x2:"3",y1:"18",y2:"18",key:"1awlsn"}]])},7881:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("AlignRight",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}],["line",{x1:"21",x2:"7",y1:"18",y2:"18",key:"1g9eri"}]])},1328:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("Bold",[["path",{d:"M14 12a4 4 0 0 0 0-8H6v8",key:"v2sylx"}],["path",{d:"M15 20a4 4 0 0 0 0-8H6v8Z",key:"1ef5ya"}]])},4519:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]])},9747:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]])},9022:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]])},7921:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("Heading4",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 10v4h4",key:"13sv97"}],["path",{d:"M21 10v8",key:"1kdml4"}]])},5413:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("Heading5",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 13v-3h4",key:"1nvgqp"}],["path",{d:"M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17",key:"2nebdn"}]])},4514:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("Heading6",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["circle",{cx:"19",cy:"16",r:"2",key:"15mx69"}],["path",{d:"M20 10c-2 2-3 3.5-3 6",key:"f35dl0"}]])},332:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("ImagePlus",[["path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"31hg93"}],["line",{x1:"16",x2:"22",y1:"5",y2:"5",key:"ez7e4s"}],["line",{x1:"19",x2:"19",y1:"2",y2:"8",key:"1gkr8c"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},9680:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]])},8645:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]])},7586:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]])},1047:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]])},8778:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]])},3271:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(9763).Z)("TextQuote",[["path",{d:"M17 6H3",key:"16j9eg"}],["path",{d:"M21 12H8",key:"scolzb"}],["path",{d:"M21 18H8",key:"1wfozv"}],["path",{d:"M3 12v6",key:"fv4c87"}]])},9376:function(t,e,n){"use strict";var r=n(5475);n.o(r,"useParams")&&n.d(e,{useParams:function(){return r.useParams}}),n.o(r,"useRouter")&&n.d(e,{useRouter:function(){return r.useRouter}}),n.o(r,"useSearchParams")&&n.d(e,{useSearchParams:function(){return r.useSearchParams}})},9455:function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function i(t,e,n,r,i,o,s){this.acceptsBooleans=2===e||3===e||4===e,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}Object.defineProperty(e,"__esModule",{value:!0});var o={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(function(t){o[t]=new i(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n,r,i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var o=[],s=!0,a=!1;try{for(i=i.call(t);!(s=(n=i.next()).done)&&(o.push(n.value),2!==o.length);s=!0);}catch(t){a=!0,r=t}finally{try{s||null==i.return||i.return()}finally{if(a)throw r}}return o}}(t,2)||function(t,e){if(t){if("string"==typeof t)return r(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(t,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=e[0],s=e[1];o[n]=new i(n,1,!1,s,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){o[t]=new i(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){o[t]=new i(t,2,!1,t,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(t){o[t]=new i(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){o[t]=new i(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){o[t]=new i(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){o[t]=new i(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){o[t]=new i(t,5,!1,t.toLowerCase(),null,!1,!1)});var s=/[\-\:]([a-z])/g,a=function(t){return t[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(t){var e=t.replace(s,a);o[e]=new i(e,1,!1,t,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(t){var e=t.replace(s,a);o[e]=new i(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(s,a);o[e]=new i(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){o[t]=new i(t,1,!1,t.toLowerCase(),null,!1,!1)}),o.xlinkHref=new i("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){o[t]=new i(t,1,!1,t.toLowerCase(),null,!0,!0)});var l=n(6626),c=l.CAMELCASE,h=l.SAME,p=l.possibleStandardNames,u=RegExp.prototype.test.bind(RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),d=Object.keys(p).reduce(function(t,e){var n=p[e];return n===h?t[e]=e:n===c?t[e.toLowerCase()]=e:t[e]=n,t},{});e.BOOLEAN=3,e.BOOLEANISH_STRING=2,e.NUMERIC=5,e.OVERLOADED_BOOLEAN=4,e.POSITIVE_NUMERIC=6,e.RESERVED=0,e.STRING=1,e.getPropertyInfo=function(t){return o.hasOwnProperty(t)?o[t]:null},e.isCustomAttribute=u,e.possibleStandardNames=d},6626:function(t,e){e.SAME=0,e.CAMELCASE=1,e.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}},5693:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(7745)),o=n(6172);e.default=function(t,e){var n={};return t&&"string"==typeof t&&(0,i.default)(t,function(t,r){t&&r&&(n[(0,o.camelCase)(t,e)]=r)}),n}},6172:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var n=/^--[a-zA-Z0-9-]+$/,r=/-([a-z])/g,i=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(t,e){return e.toUpperCase()},l=function(t,e){return"".concat(e,"-")};e.camelCase=function(t,e){var c;return(void 0===e&&(e={}),!(c=t)||i.test(c)||n.test(c))?t:(t=t.toLowerCase(),(t=e.reactCompat?t.replace(s,l):t.replace(o,l)).replace(r,a))}},7745:function(t,e,n){var r=n(662);function i(t,e){var n,i,o,s=null;if(!t||"string"!=typeof t)return s;for(var a=r(t),l="function"==typeof e,c=0,h=a.length;c<h;c++)i=(n=a[c]).property,o=n.value,l?e(i,o,n):o&&(s||(s={}),s[i]=o);return s}t.exports=i,t.exports.default=i},1119:function(t,e,n){"use strict";function r(){return(r=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(null,arguments)}n.d(e,{Z:function(){return r}})},6741:function(t,e,n){"use strict";function r(t,e,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==t||t(r),!1===n||!r.defaultPrevented)return null==e?void 0:e(r)}}n.d(e,{M:function(){return r}})},8575:function(t,e,n){"use strict";n.d(e,{F:function(){return i},e:function(){return o}});var r=n(2265);function i(...t){return e=>t.forEach(t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)})}function o(...t){return(0,r.useCallback)(i(...t),t)}},6394:function(t,e,n){"use strict";n.d(e,{_:function(){return s},f:function(){return a}});var r=n(1119),i=n(2265),o=n(2912);let s=(0,i.forwardRef)((t,e)=>(0,i.createElement)(o.WV.label,(0,r.Z)({},t,{ref:e,onMouseDown:e=>{var n;null===(n=t.onMouseDown)||void 0===n||n.call(t,e),!e.defaultPrevented&&e.detail>1&&e.preventDefault()}}))),a=s},2912:function(t,e,n){"use strict";n.d(e,{WV:function(){return p},jH:function(){return u}});var r=n(1119),i=n(2265),o=n(4887),s=n(8575);let a=(0,i.forwardRef)((t,e)=>{let{children:n,...o}=t,s=i.Children.toArray(n),a=s.find(h);if(a){let t=a.props.children,n=s.map(e=>e!==a?e:i.Children.count(t)>1?i.Children.only(null):(0,i.isValidElement)(t)?t.props.children:null);return(0,i.createElement)(l,(0,r.Z)({},o,{ref:e}),(0,i.isValidElement)(t)?(0,i.cloneElement)(t,void 0,n):null)}return(0,i.createElement)(l,(0,r.Z)({},o,{ref:e}),n)});a.displayName="Slot";let l=(0,i.forwardRef)((t,e)=>{let{children:n,...r}=t;return(0,i.isValidElement)(n)?(0,i.cloneElement)(n,{...function(t,e){let n={...e};for(let r in e){let i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...t)=>{o(...t),i(...t)}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}(r,n.props),ref:e?(0,s.F)(e,n.ref):n.ref}):i.Children.count(n)>1?i.Children.only(null):null});l.displayName="SlotClone";let c=({children:t})=>(0,i.createElement)(i.Fragment,null,t);function h(t){return(0,i.isValidElement)(t)&&t.type===c}let p=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((t,e)=>{let n=(0,i.forwardRef)((t,n)=>{let{asChild:o,...s}=t,l=o?a:e;return(0,i.useEffect)(()=>{window[Symbol.for("radix-ui")]=!0},[]),(0,i.createElement)(l,(0,r.Z)({},s,{ref:n}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function u(t,e){t&&(0,o.flushSync)(()=>t.dispatchEvent(e))}},9987:function(t,e,n){"use strict";n.d(e,{f:function(){return l}});var r=n(1119),i=n(2265),o=n(6741),s=n(886),a=n(2912);let l=(0,i.forwardRef)((t,e)=>{let{pressed:n,defaultPressed:l=!1,onPressedChange:c,...h}=t,[p=!1,u]=(0,s.T)({prop:n,onChange:c,defaultProp:l});return(0,i.createElement)(a.WV.button,(0,r.Z)({type:"button","aria-pressed":p,"data-state":p?"on":"off","data-disabled":t.disabled?"":void 0},h,{ref:e,onClick:(0,o.M)(t.onClick,()=>{t.disabled||u(!p)})}))})},6606:function(t,e,n){"use strict";n.d(e,{W:function(){return i}});var r=n(2265);function i(t){let e=(0,r.useRef)(t);return(0,r.useEffect)(()=>{e.current=t}),(0,r.useMemo)(()=>(...t)=>{var n;return null===(n=e.current)||void 0===n?void 0:n.call(e,...t)},[])}},886:function(t,e,n){"use strict";n.d(e,{T:function(){return o}});var r=n(2265),i=n(6606);function o({prop:t,defaultProp:e,onChange:n=()=>{}}){let[o,s]=function({defaultProp:t,onChange:e}){let n=(0,r.useState)(t),[o]=n,s=(0,r.useRef)(o),a=(0,i.W)(e);return(0,r.useEffect)(()=>{s.current!==o&&(a(o),s.current=o)},[o,s,a]),n}({defaultProp:e,onChange:n}),a=void 0!==t,l=a?t:o,c=(0,i.W)(n);return[l,(0,r.useCallback)(e=>{if(a){let n="function"==typeof e?e(t):e;n!==t&&c(n)}else s(e)},[a,t,s,c])]}},6962:function(t,e,n){"use strict";n.d(e,{ML:function(){return tD},hj:function(){return ts},vc:function(){return tq},NB:function(){return tW},nU:function(){return q},Nl:function(){return j},Jo:function(){return tT},eE:function(){return tw},Cf:function(){return t$},K9:function(){return tY},P1:function(){return V},x2:function(){return tV},zK:function(){return tJ},S0:function(){return t_}});var r=n(7213),i=n(9006),o=n(258),s=n(121),a=n(4536);let l=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0),c=(t,e,n)=>{let i=function(t,e){let{$cursor:n}=t.selection;return n&&(e?e.endOfTextblock("backward",t):!(n.parentOffset>0))?n:null}(t,n);if(!i)return!1;let o=u(i);if(!o){let n=i.blockRange(),r=n&&(0,a.k9)(n);return null!=r&&(e&&e(t.tr.lift(n,r).scrollIntoView()),!0)}let l=o.nodeBefore;if(!l.type.spec.isolating&&C(t,o,e))return!0;if(0==i.parent.content.size&&(h(l,"end")||r.qv.isSelectable(l))){let n=(0,a.dR)(t.doc,i.before(),i.after(),s.p2.empty);if(n&&n.slice.size<n.to-n.from){if(e){let i=t.tr.step(n);i.setSelection(h(l,"end")?r.Y1.findFrom(i.doc.resolve(i.mapping.map(o.pos,-1)),-1):r.qv.create(i.doc,o.pos-l.nodeSize)),e(i.scrollIntoView())}return!0}}return!!l.isAtom&&o.depth==i.depth-1&&(e&&e(t.tr.delete(o.pos-l.nodeSize,o.pos).scrollIntoView()),!0)};function h(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break}return!1}let p=(t,e,n)=>{let{$head:i,empty:o}=t.selection,s=i;if(!o)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):i.parentOffset>0)return!1;s=u(i)}let a=s&&s.nodeBefore;return!!(a&&r.qv.isSelectable(a))&&(e&&e(t.tr.setSelection(r.qv.create(t.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)};function u(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}let d=(t,e,n)=>{let i=function(t,e){let{$cursor:n}=t.selection;return n&&(e?e.endOfTextblock("forward",t):!(n.parentOffset<n.parent.content.size))?n:null}(t,n);if(!i)return!1;let o=m(i);if(!o)return!1;let l=o.nodeAfter;if(C(t,o,e))return!0;if(0==i.parent.content.size&&(h(l,"start")||r.qv.isSelectable(l))){let n=(0,a.dR)(t.doc,i.before(),i.after(),s.p2.empty);if(n&&n.slice.size<n.to-n.from){if(e){let i=t.tr.step(n);i.setSelection(h(l,"start")?r.Y1.findFrom(i.doc.resolve(i.mapping.map(o.pos)),1):r.qv.create(i.doc,i.mapping.map(o.pos))),e(i.scrollIntoView())}return!0}}return!!l.isAtom&&o.depth==i.depth-1&&(e&&e(t.tr.delete(o.pos,o.pos+l.nodeSize).scrollIntoView()),!0)},f=(t,e,n)=>{let{$head:i,empty:o}=t.selection,s=i;if(!o)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):i.parentOffset<i.parent.content.size)return!1;s=m(i)}let a=s&&s.nodeAfter;return!!(a&&r.qv.isSelectable(a))&&(e&&e(t.tr.setSelection(r.qv.create(t.doc,s.pos)).scrollIntoView()),!0)};function m(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}let g=(t,e)=>{let n=t.selection,i=n instanceof r.qv,o;if(i){if(n.node.isTextblock||!(0,a.Mn)(t.doc,n.from))return!1;o=n.from}else if(null==(o=(0,a.GJ)(t.doc,n.from,-1)))return!1;if(e){let n=t.tr.join(o);i&&n.setSelection(r.qv.create(n.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(n.scrollIntoView())}return!0},y=(t,e)=>{let n=t.selection,i;if(n instanceof r.qv){if(n.node.isTextblock||!(0,a.Mn)(t.doc,n.to))return!1;i=n.to}else if(null==(i=(0,a.GJ)(t.doc,n.to,1)))return!1;return e&&e(t.tr.join(i).scrollIntoView()),!0},k=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&(0,a.k9)(i);return null!=o&&(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},v=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!!(n.parent.type.spec.code&&n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)};function x(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let w=(t,e)=>{let{$head:n,$anchor:i}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let o=n.node(-1),s=n.indexAfter(-1),a=x(o.contentMatchAt(s));if(!a||!o.canReplaceWith(s,s,a))return!1;if(e){let i=n.after(),o=t.tr.replaceWith(i,i,a.createAndFill());o.setSelection(r.Y1.near(o.doc.resolve(i),1)),e(o.scrollIntoView())}return!0},b=(t,e)=>{let n=t.selection,{$from:i,$to:o}=n;if(n instanceof r.C1||i.parent.inlineContent||o.parent.inlineContent)return!1;let s=x(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let n=(!i.parentOffset&&o.index()<o.parent.childCount?i:o).pos,a=t.tr.insert(n,s.createAndFill());a.setSelection(r.Bs.create(a.doc,n+1)),e(a.scrollIntoView())}return!0},S=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if((0,a.Ax)(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&(0,a.k9)(r);return null!=i&&(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},M=(t,e)=>{let{$from:n,to:i}=t.selection,o,s=n.sharedDepth(i);return 0!=s&&(o=n.before(s),e&&e(t.tr.setSelection(r.qv.create(t.doc,o))),!0)};function C(t,e,n){let i,o,l,c=e.nodeBefore,p=e.nodeAfter,u,d;if(c.type.spec.isolating||p.type.spec.isolating)return!1;if(i=e.nodeBefore,o=e.nodeAfter,l=e.index(),i&&o&&i.type.compatibleContent(o.type)&&(!i.content.size&&e.parent.canReplace(l-1,l)?(n&&n(t.tr.delete(e.pos-i.nodeSize,e.pos).scrollIntoView()),!0):!!(e.parent.canReplace(l,l+1)&&(o.isTextblock||(0,a.Mn)(t.doc,e.pos)))&&(n&&n(t.tr.clearIncompatible(e.pos,i.type,i.contentMatchAt(i.childCount)).join(e.pos).scrollIntoView()),!0)))return!0;let f=e.parent.canReplace(e.index(),e.index()+1);if(f&&(u=(d=c.contentMatchAt(c.childCount)).findWrapping(p.type))&&d.matchType(u[0]||p.type).validEnd){if(n){let r=e.pos+p.nodeSize,i=s.HY.empty;for(let t=u.length-1;t>=0;t--)i=s.HY.from(u[t].create(null,i));i=s.HY.from(c.copy(i));let o=t.tr.step(new a.FC(e.pos-1,r,e.pos,r,new s.p2(i,1,0),u.length,!0)),l=r+2*u.length;(0,a.Mn)(o.doc,l)&&o.join(l),n(o.scrollIntoView())}return!0}let m=r.Y1.findFrom(e,1),g=m&&m.$from.blockRange(m.$to),y=g&&(0,a.k9)(g);if(null!=y&&y>=e.depth)return n&&n(t.tr.lift(g,y).scrollIntoView()),!0;if(f&&h(p,"start",!0)&&h(c,"end")){let r=c,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let o=p,l=1;for(;!o.isTextblock;o=o.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,o.content)){if(n){let r=s.HY.empty;for(let t=i.length-1;t>=0;t--)r=s.HY.from(i[t].copy(r));n(t.tr.step(new a.FC(e.pos-i.length,e.pos+p.nodeSize,e.pos+l,e.pos+p.nodeSize-l,new s.p2(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function T(t){return function(e,n){let i=e.selection,o=t<0?i.$from:i.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return!!o.node(s).isTextblock&&(n&&n(e.tr.setSelection(r.Bs.create(e.doc,t<0?o.start(s):o.end(s)))),!0)}}let E=T(-1),A=T(1);function O(t,e=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(o,s,(r,o)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(t,e))){if(r.type==t)i=!0;else{let e=n.doc.resolve(o),r=e.index();i=e.parent.canReplaceWith(r,r+1,t)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(o,s,t,e)}r(i.scrollIntoView())}return!0}}function N(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}let I=N(l,c,p),R=N(l,d,f),P={Enter:N(v,b,S,(t,e)=>{let{$from:n,$to:i}=t.selection;if(t.selection instanceof r.qv&&t.selection.node.isBlock)return!!(n.parentOffset&&(0,a.Ax)(t.doc,n.pos))&&(e&&e(t.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(e){let o=i.parentOffset==i.parent.content.size,s=t.tr;(t.selection instanceof r.Bs||t.selection instanceof r.C1)&&s.deleteSelection();let l=0==n.depth?null:x(n.node(-1).contentMatchAt(n.indexAfter(-1))),c,h=c?[c]:o&&l?[{type:l}]:void 0,p=(0,a.Ax)(s.doc,s.mapping.map(n.pos),1,h);if(!h&&!p&&(0,a.Ax)(s.doc,s.mapping.map(n.pos),1,l?[{type:l}]:void 0)&&(l&&(h=[{type:l}]),p=!0),p&&(s.split(s.mapping.map(n.pos),1,h),!o&&!n.parentOffset&&n.parent.type!=l)){let t=s.mapping.map(n.before()),e=s.doc.resolve(t);l&&n.node(-1).canReplaceWith(e.index(),e.index()+1,l)&&s.setNodeMarkup(s.mapping.map(n.before()),l)}e(s.scrollIntoView())}return!0}),"Mod-Enter":w,Backspace:I,"Mod-Backspace":I,"Shift-Backspace":I,Delete:R,"Mod-Delete":R,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new r.C1(t.doc))),!0)},z={"Ctrl-h":P.Backspace,"Alt-Backspace":P["Mod-Backspace"],"Ctrl-d":P.Delete,"Ctrl-Alt-Backspace":P["Mod-Delete"],"Alt-Delete":P["Mod-Delete"],"Alt-d":P["Mod-Delete"],"Ctrl-a":E,"Ctrl-e":A};for(let t in P)z[t]=P[t];function L(t){let{state:e,transaction:n}=t,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();class B{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([t,e])=>[t,(...t)=>{let n=e(...t)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!t,l=t||i.tr,c={...Object.fromEntries(Object.entries(n).map(([t,n])=>[t,(...t)=>{let r=this.buildProps(l,e),i=n(...t)(r);return s.push(i),c}])),run:()=>(a||!e||l.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(l),s.every(t=>!0===t))};return c}createCan(t){let{rawCommands:e,state:n}=this,r=t||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(e).map(([t,e])=>[t,(...t)=>e(...t)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(t,e=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:t,editor:r,view:o,state:L({state:i,transaction:t}),dispatch:e?()=>void 0:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([t,e])=>[t,(...t)=>e(...t)(s)]))}};return s}}class H{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){let n=this.callbacks[t];return n&&n.forEach(t=>t.apply(this,e)),this}off(t,e){let n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(t=>t!==e):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function j(t,e,n){return void 0===t.config[e]&&t.parent?j(t.parent,e,n):"function"==typeof t.config[e]?t.config[e].bind({...n,parent:t.parent?j(t.parent,e,n):null}):t.config[e]}function F(t){return{baseExtensions:t.filter(t=>"extension"===t.type),nodeExtensions:t.filter(t=>"node"===t.type),markExtensions:t.filter(t=>"mark"===t.type)}}function D(t){let e=[],{nodeExtensions:n,markExtensions:r}=F(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(t=>{let n={name:t.name,options:t.options,storage:t.storage},r=j(t,"addGlobalAttributes",n);r&&r().forEach(t=>{t.types.forEach(n=>{Object.entries(t.attributes).forEach(([t,r])=>{e.push({type:n,name:t,attribute:{...o,...r}})})})})}),i.forEach(t=>{let n={name:t.name,options:t.options,storage:t.storage},r=j(t,"addAttributes",n);r&&Object.entries(r()).forEach(([n,r])=>{let i={...o,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&(null==i?void 0:i.default)===void 0&&delete i.default,e.push({type:t.name,name:n,attribute:i})})}),e}function $(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function V(...t){return t.filter(t=>!!t).reduce((t,e)=>{let n={...t};return Object.entries(e).forEach(([t,e])=>{if(!n[t]){n[t]=e;return}if("class"===t){let r=e?e.split(" "):[],i=n[t]?n[t].split(" "):[],o=r.filter(t=>!i.includes(t));n[t]=[...i,...o].join(" ")}else"style"===t?n[t]=[n[t],e].join("; "):n[t]=e}),n},{})}function J(t,e){return e.filter(t=>t.attribute.rendered).map(e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]}).reduce((t,e)=>V(t,e),{})}function _(t){return"function"==typeof t}function q(t,e,...n){return _(t)?e?t.bind(e)(...n):t(...n):t}function W(t,e){return t.style?t:{...t,getAttrs:n=>{let r=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===r)return!1;let i=e.reduce((t,e)=>{var r;let i=e.attribute.parseHTML?e.attribute.parseHTML(n):"string"!=typeof(r=n.getAttribute(e.name))?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):"true"===r||"false"!==r&&r;return null==i?t:{...t,[e.name]:i}},{});return{...r,...i}}}}function Y(t){return Object.fromEntries(Object.entries(t).filter(([t,e])=>!("attrs"===t&&function(t={}){return 0===Object.keys(t).length&&t.constructor===Object}(e))&&null!=e))}function K(t,e){return e.nodes[t]||e.marks[t]||null}function U(t,e){return Array.isArray(e)?e.some(e=>("string"==typeof e?e:e.name)===t.name):e}let Z=(t,e=500)=>{let n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(t,e,i,o)=>{var s,a;let l=(null===(a=(s=t.type.spec).toText)||void 0===a?void 0:a.call(s,{node:t,pos:e,parent:i,index:o}))||t.textContent||"%leaf%";n+=l.slice(0,Math.max(0,r-e))}),n};function G(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class X{constructor(t){this.find=t.find,this.handler=t.handler}}let Q=(t,e)=>{if(G(e))return e.exec(t);let n=e(t);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function tt(t){var e;let{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;let c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(e=c.nodeBefore||c.nodeAfter)||void 0===e?void 0:e.marks.find(t=>t.type.spec.code)))return!1;let h=!1,p=Z(c)+o;return s.forEach(t=>{if(h)return;let e=Q(p,t.find);if(!e)return;let s=l.state.tr,c=L({state:l.state,transaction:s}),u={from:r-(e[0].length-o.length),to:i},{commands:d,chain:f,can:m}=new B({editor:n,state:c});null!==t.handler({state:c,range:u,match:e,commands:d,chain:f,can:m})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:i,text:o}),l.dispatch(s),h=!0)}),h}class te{constructor(t){this.find=t.find,this.handler=t.handler}}let tn=(t,e)=>{if(G(e))return[...t.matchAll(e)];let n=e(t);return n?n.map(e=>{let n=[e.text];return n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n}):[]};class tr{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=tr.resolve(t),this.schema=function(t,e){var n;let r=D(t),{nodeExtensions:i,markExtensions:o}=F(t),a=null===(n=i.find(t=>j(t,"topNode")))||void 0===n?void 0:n.name,l=Object.fromEntries(i.map(n=>{let i=r.filter(t=>t.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:e},s=Y({...t.reduce((t,e)=>{let r=j(e,"extendNodeSchema",o);return{...t,...r?r(n):{}}},{}),content:q(j(n,"content",o)),marks:q(j(n,"marks",o)),group:q(j(n,"group",o)),inline:q(j(n,"inline",o)),atom:q(j(n,"atom",o)),selectable:q(j(n,"selectable",o)),draggable:q(j(n,"draggable",o)),code:q(j(n,"code",o)),defining:q(j(n,"defining",o)),isolating:q(j(n,"isolating",o)),attrs:Object.fromEntries(i.map(t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]}))}),a=q(j(n,"parseHTML",o));a&&(s.parseDOM=a.map(t=>W(t,i)));let l=j(n,"renderHTML",o);l&&(s.toDOM=t=>l({node:t,HTMLAttributes:J(t,i)}));let c=j(n,"renderText",o);return c&&(s.toText=c),[n.name,s]})),c=Object.fromEntries(o.map(n=>{let i=r.filter(t=>t.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:e},s=Y({...t.reduce((t,e)=>{let r=j(e,"extendMarkSchema",o);return{...t,...r?r(n):{}}},{}),inclusive:q(j(n,"inclusive",o)),excludes:q(j(n,"excludes",o)),group:q(j(n,"group",o)),spanning:q(j(n,"spanning",o)),code:q(j(n,"code",o)),attrs:Object.fromEntries(i.map(t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]}))}),a=q(j(n,"parseHTML",o));a&&(s.parseDOM=a.map(t=>W(t,i)));let l=j(n,"renderHTML",o);return l&&(s.toDOM=t=>l({mark:t,HTMLAttributes:J(t,i)})),[n.name,s]}));return new s.V_({topNode:a,nodes:l,marks:c})}(this.extensions,e),this.extensions.forEach(t=>{var e;this.editor.extensionStorage[t.name]=t.storage;let n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:K(t.name,this.schema)};"mark"===t.type&&(null===(e=q(j(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name);let r=j(t,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);let i=j(t,"onCreate",n);i&&this.editor.on("create",i);let o=j(t,"onUpdate",n);o&&this.editor.on("update",o);let s=j(t,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);let a=j(t,"onTransaction",n);a&&this.editor.on("transaction",a);let l=j(t,"onFocus",n);l&&this.editor.on("focus",l);let c=j(t,"onBlur",n);c&&this.editor.on("blur",c);let h=j(t,"onDestroy",n);h&&this.editor.on("destroy",h)})}static resolve(t){var e;let n=tr.sort(tr.flatten(t)),r=[...new Set((e=n.map(t=>t.name)).filter((t,n)=>e.indexOf(t)!==n))];return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(t=>`'${t}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(t=>{let e={name:t.name,options:t.options,storage:t.storage},n=j(t,"addExtensions",e);return n?[t,...this.flatten(n())]:t}).flat(10)}static sort(t){return t.sort((t,e)=>{let n=j(t,"priority")||100,r=j(e,"priority")||100;return n>r?-1:n<r?1:0})}get commands(){return this.extensions.reduce((t,e)=>{let n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:K(e.name,this.schema)},r=j(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){let{editor:t}=this,e=tr.sort([...this.extensions].reverse()),n=[],i=[],s=e.map(e=>{let r={name:e.name,options:e.options,storage:e.storage,editor:t,type:K(e.name,this.schema)},s=[],a=j(e,"addKeyboardShortcuts",r),l={};if("mark"===e.type&&e.config.exitable&&(l.ArrowRight=()=>tq.handleExit({editor:t,mark:e})),a){let e=Object.fromEntries(Object.entries(a()).map(([e,n])=>[e,()=>n({editor:t})]));l={...l,...e}}let c=(0,o.h)(l);s.push(c);let h=j(e,"addInputRules",r);U(e,t.options.enableInputRules)&&h&&n.push(...h());let p=j(e,"addPasteRules",r);U(e,t.options.enablePasteRules)&&p&&i.push(...p());let u=j(e,"addProseMirrorPlugins",r);if(u){let t=u();s.push(...t)}return s}).flat();return[function(t){let{editor:e,rules:n}=t,i=new r.Sy({state:{init:()=>null,apply:(t,e)=>t.getMeta(i)||(t.selectionSet||t.docChanged?null:e)},props:{handleTextInput:(t,r,o,s)=>tt({editor:e,from:r,to:o,text:s,rules:n,plugin:i}),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{let{$cursor:r}=t.state.selection;r&&tt({editor:e,from:r.pos,to:r.pos,text:"",rules:n,plugin:i})}),!1)},handleKeyDown(t,r){if("Enter"!==r.key)return!1;let{$cursor:o}=t.state.selection;return!!o&&tt({editor:e,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:i})}},isInputRules:!0});return i}({editor:t,rules:n}),...function(t){let{editor:e,rules:n}=t,i=null,o=!1,s=!1,a=new ClipboardEvent("paste"),l=new DragEvent("drop");return n.map(t=>new r.Sy({view(t){let e=e=>{var n;i=(null===(n=t.dom.parentElement)||void 0===n?void 0:n.contains(e.target))?t.dom.parentElement:null};return window.addEventListener("dragstart",e),{destroy(){window.removeEventListener("dragstart",e)}}},props:{handleDOMEvents:{drop:(t,e)=>(s=i===t.dom.parentElement,l=e,!1),paste:(t,e)=>{var n;let r=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html");return a=e,o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,i)=>{let c=n[0],h="paste"===c.getMeta("uiEvent")&&!o,p="drop"===c.getMeta("uiEvent")&&!s;if(!h&&!p)return;let u=r.doc.content.findDiffStart(i.doc.content),d=r.doc.content.findDiffEnd(i.doc.content);if("number"!=typeof u||!d||u===d.b)return;let f=i.tr;if(function(t){let{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:h}=new B({editor:e,state:n}),p=[];return n.doc.nodesBetween(r,i,(t,e)=>{if(!t.isTextblock||t.type.spec.code)return;let u=Math.max(r,e),d=Math.min(i,e+t.content.size);tn(t.textBetween(u-e,d-e,void 0,""),o.find).forEach(t=>{if(void 0===t.index)return;let e=u+t.index+1,r=e+t[0].length,i={from:n.tr.mapping.map(e),to:n.tr.mapping.map(r)},d=o.handler({state:n,range:i,match:t,commands:l,chain:c,can:h,pasteEvent:s,dropEvent:a});p.push(d)})}),p.every(t=>null!==t)}({editor:e,state:L({state:i,transaction:f}),from:Math.max(u-1,0),to:d.b-1,rule:t,pasteEvent:a,dropEvent:l})&&f.steps.length)return l=new DragEvent("drop"),a=new ClipboardEvent("paste"),f}}))}({editor:t,rules:i}),...s]}get attributes(){return D(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:e}=F(this.extensions);return Object.fromEntries(e.filter(t=>!!j(t,"addNodeView")).map(e=>{let n=this.attributes.filter(t=>t.type===e.name),r={name:e.name,options:e.options,storage:e.storage,editor:t,type:$(e.name,this.schema)},i=j(e,"addNodeView",r);return i?[e.name,(r,o,s,a)=>{let l=J(r,n);return i()({editor:t,node:r,getPos:s,decorations:a,HTMLAttributes:l,extension:e})}]:[]}))}}function ti(t){return"Object"===Object.prototype.toString.call(t).slice(8,-1)&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function to(t,e){let n={...t};return ti(t)&&ti(e)&&Object.keys(e).forEach(r=>{ti(e[r])&&r in t?n[r]=to(t[r],e[r]):Object.assign(n,{[r]:e[r]})}),n}class ts{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=q(j(this,"addOptions",{name:this.name}))),this.storage=q(j(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ts(t)}configure(t={}){let e=this.extend();return e.options=to(this.options,t),e.storage=q(j(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){let e=new ts(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=q(j(e,"addOptions",{name:e.name})),e.storage=q(j(e,"addStorage",{name:e.name,options:e.options})),e}}function ta(t,e,n){let{from:r,to:i}=e,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{},a="",l=!0;return t.nodesBetween(r,i,(t,n,c,h)=>{var p;let u=null==s?void 0:s[t.type.name];u?(t.isBlock&&!l&&(a+=o,l=!0),c&&(a+=u({node:t,pos:n,parent:c,index:h,range:e}))):t.isText?(a+=null===(p=null==t?void 0:t.text)||void 0===p?void 0:p.slice(Math.max(r,n)-n,i-n),l=!1):t.isBlock&&!l&&(a+=o,l=!0)}),a}function tl(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,t])=>t.spec.toText).map(([t,e])=>[t,e.spec.toText]))}let tc=ts.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new r.Sy({key:new r.H$("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(t=>t.$from.pos));return ta(r,{from:s,to:Math.max(...o.map(t=>t.$to.pos))},{textSerializers:tl(n)})}}})]}});function th(t,e,n={strict:!0}){let r=Object.keys(e);return!r.length||r.every(r=>n.strict?e[r]===t[r]:G(e[r])?e[r].test(t[r]):e[r]===t[r])}function tp(t,e,n={}){return t.find(t=>t.type===e&&th(t.attrs,n))}function tu(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&0!==r.offset&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;let i=tp([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(tp([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;a<t.parent.childCount&&function(t,e,n={}){return!!tp(t,e,n)}([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function td(t,e){if("string"==typeof t){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function tf(t){return t instanceof r.Bs}function tm(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function tg(t,e=null){if(!e)return null;let n=r.Y1.atStart(t),i=r.Y1.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return i;let o=n.from,s=i.to;return"all"===e?r.Bs.create(t,tm(0,o,s),tm(t.content.size,o,s)):r.Bs.create(t,tm(e,o,s),tm(e,o,s))}function ty(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function tk(t){let e=`<body>${t}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function tv(t,e,n){if(n={slice:!0,parseOptions:{},...n},"object"==typeof t&&null!==t)try{if(Array.isArray(t)&&t.length>0)return s.HY.fromArray(t.map(t=>e.nodeFromJSON(t)));return e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),tv("",e,n)}if("string"==typeof t){let r=s.aw.fromSchema(e);return n.slice?r.parseSlice(tk(t),n.parseOptions).content:r.parse(tk(t),n.parseOptions)}return tv("",e,n)}let tx=t=>t.toString().startsWith("<");function tw(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function tb(t,e,n={}){let{from:r,to:i,empty:o}=t.selection,s=e?$(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(t,e)=>{if(t.isText)return;let n=Math.max(r,e),o=Math.min(i,e+t.nodeSize);a.push({node:t,from:n,to:o})});let l=i-r,c=a.filter(t=>!s||s.name===t.node.type.name).filter(t=>th(t.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((t,e)=>t+e.to-e.from,0)>=l}function tS(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function tM(t,e){let n="string"==typeof e?[e]:e;return Object.keys(t).reduce((e,r)=>(n.includes(r)||(e[r]=t[r]),e),{})}function tC(t,e,n={}){return tv(t,e,{slice:!1,parseOptions:n})}function tT(t,e){let n=td(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,t=>{s.push(...t.marks)});let a=s.find(t=>t.type.name===n.name);return a?{...a.attrs}:{}}function tE(t){return e=>(function(t,e){for(let n=t.depth;n>0;n-=1){let r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}})(e.$from,t)}function tA(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(e=>{let i=tu(n.resolve(t-1),e.type);i&&r.push({mark:e,...i})}):n.nodesBetween(t,e,(t,e)=>{r.push(...t.marks.map(n=>({from:e,to:e+t.nodeSize,mark:n})))}),r}function tO(t,e,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=t.find(t=>t.type===e&&t.name===n);return!!r&&r.attribute.keepOnSplit}))}function tN(t,e,n={}){let{empty:r,ranges:i}=t.selection,o=e?td(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(t=>!o||o.name===t.type.name).find(t=>th(t.attrs,n,{strict:!1}));let s=0,a=[];if(i.forEach(({$from:e,$to:n})=>{let r=e.pos,i=n.pos;t.doc.nodesBetween(r,i,(t,e)=>{if(!t.isText&&!t.marks.length)return;let n=Math.max(r,e),o=Math.min(i,e+t.nodeSize);s+=o-n,a.push(...t.marks.map(t=>({mark:t,from:n,to:o})))})}),0===s)return!1;let l=a.filter(t=>!o||o.name===t.mark.type.name).filter(t=>th(t.mark.attrs,n,{strict:!1})).reduce((t,e)=>t+e.to-e.from,0),c=a.filter(t=>!o||t.mark.type!==o&&t.mark.type.excludes(o)).reduce((t,e)=>t+e.to-e.from,0);return(l>0?l+c:l)>=s}function tI(t,e){let{nodeExtensions:n}=F(e),r=n.find(e=>e.name===t);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=q(j(r,"group",i));return"string"==typeof o&&o.split(" ").includes("list")}function tR(t,e){let n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){let r=n.filter(t=>null==e?void 0:e.includes(t.type.name));t.tr.ensureMarks(r)}}let tP=(t,e)=>{let n=tE(t=>t.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;let i=t.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&(0,a.Mn)(t.doc,n.pos))||(t.join(n.pos),!0)},tz=(t,e)=>{let n=tE(t=>t.type===e)(t.selection);if(!n)return!0;let r=t.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;let i=t.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&(0,a.Mn)(t.doc,r))||(t.join(r),!0)};var tL=Object.freeze({__proto__:null,blur:()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),null===(n=null==window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())}),!0),clearContent:(t=!1)=>({commands:e})=>e.setContent("",t),clearNodes:()=>({state:t,tr:e,dispatch:n})=>{let{selection:r}=e,{ranges:i}=r;return!n||(i.forEach(({$from:n,$to:r})=>{t.doc.nodesBetween(n.pos,r.pos,(t,n)=>{if(t.type.isText)return;let{doc:r,mapping:i}=e,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+t.nodeSize)),l=o.blockRange(s);if(!l)return;let c=(0,a.k9)(l);if(t.type.isTextblock){let{defaultType:t}=o.parent.contentMatchAt(o.index());e.setNodeMarkup(l.start,t)}(c||0===c)&&e.lift(l,c)})}),!0)},command:t=>e=>t(e),createParagraphNear:()=>({state:t,dispatch:e})=>b(t,e),cut:(t,e)=>({editor:n,tr:i})=>{let{state:o}=n,s=o.doc.slice(t.from,t.to);i.deleteRange(t.from,t.to);let a=i.mapping.map(e);return i.insert(a,s.content),i.setSelection(new r.Bs(i.doc.resolve(a-1))),!0},deleteCurrentNode:()=>({tr:t,dispatch:e})=>{let{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;let i=t.selection.$anchor;for(let n=i.depth;n>0;n-=1)if(i.node(n).type===r.type){if(e){let e=i.before(n),r=i.after(n);t.delete(e,r).scrollIntoView()}return!0}return!1},deleteNode:t=>({tr:e,state:n,dispatch:r})=>{let i=$(t,n.schema),o=e.selection.$anchor;for(let t=o.depth;t>0;t-=1)if(o.node(t).type===i){if(r){let n=o.before(t),r=o.after(t);e.delete(n,r).scrollIntoView()}return!0}return!1},deleteRange:t=>({tr:e,dispatch:n})=>{let{from:r,to:i}=t;return n&&e.delete(r,i),!0},deleteSelection:()=>({state:t,dispatch:e})=>l(t,e),enter:()=>({commands:t})=>t.keyboardShortcut("Enter"),exitCode:()=>({state:t,dispatch:e})=>w(t,e),extendMarkRange:(t,e={})=>({tr:n,state:i,dispatch:o})=>{let s=td(t,i.schema),{doc:a,selection:l}=n,{$from:c,from:h,to:p}=l;if(o){let t=tu(c,s,e);if(t&&t.from<=h&&t.to>=p){let e=r.Bs.create(a,t.from,t.to);n.setSelection(e)}}return!0},first:t=>e=>{let n="function"==typeof t?t(e):t;for(let t=0;t<n.length;t+=1)if(n[t](e))return!0;return!1},focus:(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};let s=()=>{ty()&&r.dom.focus(),requestAnimationFrame(()=>{!n.isDestroyed&&(r.focus(),(null==e?void 0:e.scrollIntoView)&&n.commands.scrollIntoView())})};if(r.hasFocus()&&null===t||!1===t)return!0;if(o&&null===t&&!tf(n.state.selection))return s(),!0;let a=tg(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},forEach:(t,e)=>n=>t.every((t,r)=>e(t,{...n,index:r})),insertContent:(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),insertContentAt:(t,e,n)=>({tr:i,dispatch:o,editor:s})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};let o=tv(e,s.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===o.toString())return!0;let{from:l,to:c}="number"==typeof t?{from:t,to:t}:{from:t.from,to:t.to},h=!0,p=!0;if((tx(o)?o:[o]).forEach(t=>{t.check(),h=!!h&&t.isText&&0===t.marks.length,p=!!p&&t.isBlock}),l===c&&p){let{parent:t}=i.doc.resolve(l);!t.isTextblock||t.type.spec.code||t.childCount||(l-=1,c+=1)}h?Array.isArray(e)?i.insertText(e.map(t=>t.text||"").join(""),l,c):"object"==typeof e&&e&&e.text?i.insertText(e.text,l,c):i.insertText(e,l,c):i.replaceWith(l,c,o),n.updateSelection&&function(t,e,n){let i=t.steps.length-1;if(i<e)return;let o=t.steps[i];if(!(o instanceof a.Pu||o instanceof a.FC))return;let s=t.mapping.maps[i],l=0;s.forEach((t,e,n,r)=>{0===l&&(l=r)}),t.setSelection(r.Y1.near(t.doc.resolve(l),-1))}(i,i.steps.length-1,0)}return!0},joinUp:()=>({state:t,dispatch:e})=>g(t,e),joinDown:()=>({state:t,dispatch:e})=>y(t,e),joinBackward:()=>({state:t,dispatch:e})=>c(t,e),joinForward:()=>({state:t,dispatch:e})=>d(t,e),joinItemBackward:()=>({tr:t,state:e,dispatch:n})=>{try{let r=(0,a.GJ)(e.doc,e.selection.$from.pos,-1);if(null==r)return!1;return t.join(r,2),n&&n(t),!0}catch{return!1}},joinItemForward:()=>({state:t,dispatch:e,tr:n})=>{try{let r=(0,a.GJ)(t.doc,t.selection.$from.pos,1);if(null==r)return!1;return n.join(r,2),e&&e(n),!0}catch(t){return!1}},keyboardShortcut:t=>({editor:e,view:n,tr:r,dispatch:i})=>{let o=(function(t){let e,n,r,i;let o=t.split(/-(?!$)/),s=o[o.length-1];"Space"===s&&(s=" ");for(let t=0;t<o.length-1;t+=1){let s=o[t];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))ty()||tw()?i=!0:n=!0;else throw Error(`Unrecognized modifier name: ${s}`)}return e&&(s=`Alt-${s}`),n&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),r&&(s=`Shift-${s}`),s})(t).split(/-(?!$)/),s=o.find(t=>!["Alt","Ctrl","Meta","Shift"].includes(t)),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",t=>t(n,a))});return null==l||l.steps.forEach(t=>{let e=t.map(r.mapping);e&&i&&r.maybeStep(e)}),!0},lift:(t,e={})=>({state:n,dispatch:r})=>{let i=$(t,n.schema);return!!tb(n,i,e)&&k(n,r)},liftEmptyBlock:()=>({state:t,dispatch:e})=>S(t,e),liftListItem:t=>({state:e,dispatch:n})=>{var r;return(r=$(t,e.schema),function(t,e){let{$from:n,$to:i}=t.selection,o=n.blockRange(i,t=>t.childCount>0&&t.firstChild.type==r);return!!o&&(!e||(n.node(o.depth-1).type==r?function(t,e,n,r){let i=t.tr,o=r.end,l=r.$to.end(r.depth);o<l&&(i.step(new a.FC(o-1,l,o,l,new s.p2(s.HY.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new s.Ts(i.doc.resolve(r.$from.pos),i.doc.resolve(l),r.depth));let c=(0,a.k9)(r);if(null==c)return!1;i.lift(r,c);let h=i.mapping.map(o,-1)-1;return(0,a.Mn)(i.doc,h)&&i.join(h),e(i.scrollIntoView()),!0}(t,e,r,o):function(t,e,n){let r=t.tr,i=n.parent;for(let t=n.end,e=n.endIndex-1,o=n.startIndex;e>o;e--)t-=i.child(e).nodeSize,r.delete(t-1,t+1);let o=r.doc.resolve(n.start),l=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let c=0==n.startIndex,h=n.endIndex==i.childCount,p=o.node(-1),u=o.index(-1);if(!p.canReplace(u+(c?0:1),u+1,l.content.append(h?s.HY.empty:s.HY.from(i))))return!1;let d=o.pos,f=d+l.nodeSize;return r.step(new a.FC(d-(c?1:0),f+(h?1:0),d+1,f-1,new s.p2((c?s.HY.empty:s.HY.from(i.copy(s.HY.empty))).append(h?s.HY.empty:s.HY.from(i.copy(s.HY.empty))),c?0:1,h?0:1),c?0:1)),e(r.scrollIntoView()),!0}(t,e,o)))})(e,n)},newlineInCode:()=>({state:t,dispatch:e})=>v(t,e),resetAttributes:(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=tS("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(o=$(t,r.schema)),"mark"===a&&(s=td(t,r.schema)),i&&n.selection.ranges.forEach(t=>{r.doc.nodesBetween(t.$from.pos,t.$to.pos,(t,r)=>{o&&o===t.type&&n.setNodeMarkup(r,void 0,tM(t.attrs,e)),s&&t.marks.length&&t.marks.forEach(i=>{s===i.type&&n.addMark(r,r+t.nodeSize,s.create(tM(i.attrs,e)))})})}),!0)},scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),selectAll:()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),selectNodeBackward:()=>({state:t,dispatch:e})=>p(t,e),selectNodeForward:()=>({state:t,dispatch:e})=>f(t,e),selectParentNode:()=>({state:t,dispatch:e})=>M(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>A(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>E(t,e),setContent:(t,e=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{let{doc:s}=r,a=tC(t,i.schema,n);return o&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0},setMark:(t,e={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:a}=o,l=td(t,r.schema);if(i){if(s){let t=tT(r,l);n.addStoredMark(l.create({...t,...e}))}else a.forEach(t=>{let i=t.$from.pos,o=t.$to.pos;r.doc.nodesBetween(i,o,(t,r)=>{let s=Math.max(r,i),a=Math.min(r+t.nodeSize,o);t.marks.find(t=>t.type===l)?t.marks.forEach(t=>{l===t.type&&n.addMark(s,a,l.create({...t.attrs,...e}))}):n.addMark(s,a,l.create(e))})})}return function(t,e,n){var r;let{selection:i}=e,o=null;if(tf(i)&&(o=i.$cursor),o){let e=null!==(r=t.storedMarks)&&void 0!==r?r:o.marks();return!!n.isInSet(e)||!e.some(t=>t.type.excludes(n))}let{ranges:s}=i;return s.some(({$from:e,$to:r})=>{let i=0===e.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(e.pos,r.pos,(t,e,r)=>{if(i)return!1;if(t.isInline){let e=!r||r.type.allowsMarkType(n),o=!!n.isInSet(t.marks)||!t.marks.some(t=>t.type.excludes(n));i=e&&o}return!i}),i})}(r,n,l)},setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),setNode:(t,e={})=>({state:n,dispatch:r,chain:i})=>{let o=$(t,n.schema);return o.isTextblock?i().command(({commands:t})=>!!O(o,e)(n)||t.clearNodes()).command(({state:t})=>O(o,e)(t,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:t=>({tr:e,dispatch:n})=>{if(n){let{doc:n}=e,i=tm(t,0,n.content.size),o=r.qv.create(n,i);e.setSelection(o)}return!0},setTextSelection:t=>({tr:e,dispatch:n})=>{if(n){let{doc:n}=e,{from:i,to:o}="number"==typeof t?{from:t,to:t}:t,s=r.Bs.atStart(n).from,a=r.Bs.atEnd(n).to,l=tm(i,s,a),c=tm(o,s,a),h=r.Bs.create(n,l,c);e.setSelection(h)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{var r;return(r=$(t,e.schema),function(t,e){let{$from:n,$to:i}=t.selection,o=n.blockRange(i,t=>t.childCount>0&&t.firstChild.type==r);if(!o)return!1;let l=o.startIndex;if(0==l)return!1;let c=o.parent,h=c.child(l-1);if(h.type!=r)return!1;if(e){let n=h.lastChild&&h.lastChild.type==c.type,i=s.HY.from(n?r.create():null),l=new s.p2(s.HY.from(r.create(null,s.HY.from(c.type.create(null,i)))),n?3:1,0),p=o.start,u=o.end;e(t.tr.step(new a.FC(p-(n?3:1),u,p,u,l,1,!0)).scrollIntoView())}return!0})(e,n)},splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:i,editor:o})=>{let{selection:s,doc:l}=e,{$from:c,$to:h}=s,p=tO(o.extensionManager.attributes,c.node().type.name,c.node().attrs);if(s instanceof r.qv&&s.node.isBlock)return!!(c.parentOffset&&(0,a.Ax)(l,c.pos))&&(i&&(t&&tR(n,o.extensionManager.splittableMarks),e.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;if(i){let i=h.parentOffset===h.parent.content.size;s instanceof r.Bs&&e.deleteSelection();let l=0===c.depth?void 0:function(t){for(let e=0;e<t.edgeCount;e+=1){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(c.node(-1).contentMatchAt(c.indexAfter(-1))),u=i&&l?[{type:l,attrs:p}]:void 0,d=(0,a.Ax)(e.doc,e.mapping.map(c.pos),1,u);if(!u&&!d&&(0,a.Ax)(e.doc,e.mapping.map(c.pos),1,l?[{type:l}]:void 0)&&(d=!0,u=l?[{type:l,attrs:p}]:void 0),d&&(e.split(e.mapping.map(c.pos),1,u),l&&!i&&!c.parentOffset&&c.parent.type!==l)){let t=e.mapping.map(c.before()),n=e.doc.resolve(t);c.node(-1).canReplaceWith(n.index(),n.index()+1,l)&&e.setNodeMarkup(e.mapping.map(c.before()),l)}t&&tR(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},splitListItem:t=>({tr:e,state:n,dispatch:i,editor:o})=>{var l;let c=$(t,n.schema),{$from:h,$to:p}=n.selection,u=n.selection.node;if(u&&u.isBlock||h.depth<2||!h.sameParent(p))return!1;let d=h.node(-1);if(d.type!==c)return!1;let f=o.extensionManager.attributes;if(0===h.parent.content.size&&h.node(-1).childCount===h.indexAfter(-1)){if(2===h.depth||h.node(-3).type!==c||h.index(-2)!==h.node(-2).childCount-1)return!1;if(i){let t=s.HY.empty,n=h.index(-1)?1:h.index(-2)?2:3;for(let e=h.depth-n;e>=h.depth-3;e-=1)t=s.HY.from(h.node(e).copy(t));let i=h.indexAfter(-1)<h.node(-2).childCount?1:h.indexAfter(-2)<h.node(-3).childCount?2:3,o=tO(f,h.node().type.name,h.node().attrs),a=(null===(l=c.contentMatch.defaultType)||void 0===l?void 0:l.createAndFill(o))||void 0;t=t.append(s.HY.from(c.createAndFill(null,a)||void 0));let p=h.before(h.depth-(n-1));e.replace(p,h.after(-i),new s.p2(t,4-n,0));let u=-1;e.doc.nodesBetween(p,e.doc.content.size,(t,e)=>{if(u>-1)return!1;t.isTextblock&&0===t.content.size&&(u=e+1)}),u>-1&&e.setSelection(r.Bs.near(e.doc.resolve(u))),e.scrollIntoView()}return!0}let m=p.pos===h.end()?d.contentMatchAt(0).defaultType:null,g=tO(f,d.type.name,d.attrs),y=tO(f,h.node().type.name,h.node().attrs);if(e.delete(h.pos,p.pos),!(0,a.Ax)(e.doc,h.pos,2))return!1;if(i){let{selection:t,storedMarks:r}=n,{splittableMarks:s}=o.extensionManager,a=r||t.$to.parentOffset&&t.$from.marks();if(e.split(h.pos,2,m?[{type:c,attrs:g},{type:m,attrs:y}]:[{type:c,attrs:g}]).scrollIntoView(),!a||!i)return!0;let l=a.filter(t=>s.includes(t.type.name));e.ensureMarks(l)}return!0},toggleList:(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:c,can:h})=>{let{extensions:p,splittableMarks:u}=i.extensionManager,d=$(t,s.schema),f=$(e,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:k}=m,v=y.blockRange(k),x=g||m.$to.parentOffset&&m.$from.marks();if(!v)return!1;let w=tE(t=>tI(t.type.name,p))(m);if(v.depth>=1&&w&&v.depth-w.depth<=1){if(w.node.type===d)return c.liftListItem(f);if(tI(w.node.type.name,p)&&d.validContent(w.node.content)&&a)return l().command(()=>(o.setNodeMarkup(w.pos,d),!0)).command(()=>tP(o,d)).command(()=>tz(o,d)).run()}return n&&x&&a?l().command(()=>{let t=h().wrapInList(d,r),e=x.filter(t=>u.includes(t.type.name));return o.ensureMarks(e),!!t||c.clearNodes()}).wrapInList(d,r).command(()=>tP(o,d)).command(()=>tz(o,d)).run():l().command(()=>!!h().wrapInList(d,r)||c.clearNodes()).wrapInList(d,r).command(()=>tP(o,d)).command(()=>tz(o,d)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=td(t,r.schema);return tN(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:i})=>{let o=$(t,r.schema),s=$(e,r.schema);return tb(r,o,n)?i.setNode(s):i.setNode(o,n)},toggleWrap:(t,e={})=>({state:n,commands:r})=>{let i=$(t,n.schema);return tb(n,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:t,dispatch:e})=>{let n=t.plugins;for(let r=0;r<n.length;r+=1){let i;let o=n[r];if(o.spec.isInputRules&&(i=o.getState(t))){if(e){let e=t.tr,n=i.transform;for(let t=n.steps.length-1;t>=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(i.text){let n=e.doc.resolve(i.from).marks();e.replaceWith(i.from,i.to,t.schema.text(i.text,n))}else e.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{let{selection:n}=t,{empty:r,ranges:i}=n;return!!r||(e&&i.forEach(e=>{t.removeMark(e.$from.pos,e.$to.pos)}),!0)},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=td(t,r.schema),{$from:c,empty:h,ranges:p}=a;if(!i)return!0;if(h&&s){let{from:t,to:e}=a,r=null===(o=c.marks().find(t=>t.type===l))||void 0===o?void 0:o.attrs,i=tu(c,l,r);i&&(t=i.from,e=i.to),n.removeMark(t,e,l)}else p.forEach(t=>{n.removeMark(t.$from.pos,t.$to.pos,l)});return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=tS("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(o=$(t,r.schema)),"mark"===a&&(s=td(t,r.schema)),i&&n.selection.ranges.forEach(t=>{let i=t.$from.pos,a=t.$to.pos;r.doc.nodesBetween(i,a,(t,r)=>{o&&o===t.type&&n.setNodeMarkup(r,void 0,{...t.attrs,...e}),s&&t.marks.length&&t.marks.forEach(o=>{if(s===o.type){let l=Math.max(r,i),c=Math.min(r+t.nodeSize,a);n.addMark(l,c,s.create({...o.attrs,...e}))}})})}),!0)},wrapIn:(t,e={})=>({state:n,dispatch:r})=>(function(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&(0,a.nd)(s,t,e);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}})($(t,n.schema),e)(n,r),wrapInList:(t,e={})=>({state:n,dispatch:r})=>(function(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,l=i.blockRange(o),c=!1,h=l;if(!l)return!1;if(l.depth>=2&&i.node(l.depth-1).type.compatibleContent(t)&&0==l.startIndex){if(0==i.index(l.depth-1))return!1;let t=n.doc.resolve(l.start-2);h=new s.Ts(t,t,l.depth),l.endIndex<l.parent.childCount&&(l=new s.Ts(i,n.doc.resolve(o.end(l.depth)),l.depth)),c=!0}let p=(0,a.nd)(h,t,e,l);return!!p&&(r&&r((function(t,e,n,r,i){let o=s.HY.empty;for(let t=n.length-1;t>=0;t--)o=s.HY.from(n[t].type.create(n[t].attrs,o));t.step(new a.FC(e.start-(r?2:0),e.end,e.start,e.end,new s.p2(o,0,0),n.length,!0));let l=0;for(let t=0;t<n.length;t++)n[t].type==i&&(l=t+1);let c=n.length-l,h=e.start+n.length-(r?2:0),p=e.parent;for(let n=e.startIndex,r=e.endIndex,i=!0;n<r;n++,i=!1)!i&&(0,a.Ax)(t.doc,h,c)&&(t.split(h,c),h+=2*c),h+=p.child(n).nodeSize;return t})(n.tr,l,p,c,t).scrollIntoView()),!0)}})($(t,n.schema),e)(n,r)});let tB=ts.create({name:"commands",addCommands:()=>({...tL})}),tH=ts.create({name:"editable",addProseMirrorPlugins(){return[new r.Sy({key:new r.H$("editable"),props:{editable:()=>this.editor.options.editable}})]}});var tj=Object.freeze({__proto__:null,ClipboardTextSerializer:tc,Commands:tB,Editable:tH,FocusEvents:ts.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new r.Sy({key:new r.H$("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Keymap:ts.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:t})=>[()=>t.undoInputRule(),()=>t.command(({tr:e})=>{let{selection:n,doc:i}=e,{empty:o,$anchor:s}=n,{pos:a,parent:l}=s,c=s.parent.isTextblock?e.doc.resolve(a-1):s,h=c.parent.type.spec.isolating,p=s.pos-s.parentOffset,u=h&&1===c.parent.childCount?p===s.pos:r.Y1.atStart(i).from===a;return!!o&&!!u&&!!l.type.isTextblock&&!l.textContent.length&&t.clearNodes()}),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},o={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return ty()||tw()?o:i},addProseMirrorPlugins(){return[new r.Sy({key:new r.H$("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(t=>t.docChanged)&&!e.doc.eq(n.doc)))return;let{empty:i,from:o,to:s}=e.selection,a=r.Y1.atStart(e.doc).from,l=r.Y1.atEnd(e.doc).to;if(i||!(o===a&&s===l)||0!==n.doc.textBetween(0,n.doc.content.size," "," ").length)return;let c=n.tr,h=L({state:n,transaction:c}),{commands:p}=new B({editor:this.editor,state:h});if(p.clearNodes(),c.steps.length)return c}})]}}),Tabindex:ts.create({name:"tabindex",addProseMirrorPlugins(){return[new r.Sy({key:new r.H$("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}})});let tF=`.ProseMirror { position: relative; } .ProseMirror { word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; -webkit-font-variant-ligatures: none; font-variant-ligatures: none; font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ } .ProseMirror [contenteditable="false"] { white-space: normal; } .ProseMirror [contenteditable="false"] [contenteditable="true"] { white-space: pre-wrap; } .ProseMirror pre { white-space: pre-wrap; } img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; width: 1px !important; height: 1px !important; } .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; margin: 0; } .ProseMirror-gapcursor:after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid black; animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; } @keyframes ProseMirror-cursor-blink { to { visibility: hidden; } } .ProseMirror-hideselection *::selection { background: transparent; } .ProseMirror-hideselection *::-moz-selection { background: transparent; } .ProseMirror-hideselection * { caret-color: transparent; } .ProseMirror-focused .ProseMirror-gapcursor { display: block; } .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0 }`;class tD extends H{constructor(t={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(t,e,n){let r=document.querySelector("style[data-tiptap-style]");if(null!==r)return r;let i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}(tF,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){let n=_(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(t){if(this.isDestroyed)return;let e="string"==typeof t?`${t}$`:t.key,n=this.state.reconfigure({plugins:this.state.plugins.filter(t=>!t.key.startsWith(e))});this.view.updateState(n)}createExtensionManager(){let t=[...this.options.enableCoreExtensions?Object.values(tj):[],...this.options.extensions].filter(t=>["extension","node","mark"].includes(null==t?void 0:t.type));this.extensionManager=new tr(t,this)}createCommandManager(){this.commandManager=new B({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let t=tC(this.options.content,this.schema,this.options.parseOptions),e=tg(t,this.options.autofocus);this.view=new i.tk(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:r.yy.create({doc:t,selection:e||void 0})});let n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.prependClass(),this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;let e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(t=>{var e;return null===(e=this.capturedTransaction)||void 0===e?void 0:e.step(t)});return}let e=this.state.apply(t),n=!this.state.selection.eq(e.selection);this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});let r=t.getMeta("focus"),i=t.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:t}),i&&this.emit("blur",{editor:this,event:i.event,transaction:t}),!t.docChanged||t.getMeta("preventUpdate")||this.emit("update",{editor:this,transaction:t})}getAttributes(t){return function(t,e){let n=tS("string"==typeof e?e:e.name,t.schema);return"node"===n?function(t,e){let n=$(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,t=>{o.push(t)});let s=o.reverse().find(t=>t.type.name===n.name);return s?{...s.attrs}:{}}(t,e):"mark"===n?tT(t,e):{}}(this.state,t)}isActive(t,e){let n="string"==typeof t?t:null,r="string"==typeof t?e:t;return function(t,e,n={}){if(!e)return tb(t,null,n)||tN(t,null,n);let r=tS(e,t.schema);return"node"===r?tb(t,e,n):"mark"===r&&tN(t,e,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(t,e){let n=s.PW.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}(this.state.doc.content,this.schema)}getText(t){let{blockSeparator:e="\n\n",textSerializers:n={}}=t||{};return function(t,e){let n={from:0,to:t.content.size};return ta(t,n,e)}(this.state.doc,{blockSeparator:e,textSerializers:{...tl(this.schema),...n}})}get isEmpty(){return function(t){var e;let n=null===(e=t.type.createAndFill())||void 0===e?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var t;return!(null===(t=this.view)||void 0===t?void 0:t.docView)}}function t$(t){return new X({find:t.find,handler:({state:e,range:n,match:r})=>{let i=q(t.getAttributes,void 0,r);if(!1===i||null===i)return null;let{tr:o}=e,s=r[r.length-1],a=r[0];if(s){let r=a.search(/\S/),l=n.from+a.indexOf(s),c=l+s.length;if(tA(n.from,n.to,e.doc).filter(e=>e.mark.type.excluded.find(n=>n===t.type&&n!==e.mark.type)).filter(t=>t.to>l).length)return null;c<n.to&&o.delete(c,n.to),l>n.from&&o.delete(n.from+r,l);let h=n.from+r+s.length;o.addMark(n.from+r,h,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function tV(t){return new X({find:t.find,handler:({state:e,range:n,match:r})=>{let i=q(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from,a=n.to,l=t.type.create(i);if(r[1]){let t=s+r[0].lastIndexOf(r[1]);t>a?t=a:a=t+r[1].length;let e=r[0][r[0].length-1];o.insertText(e,s+r[0].length-1),o.replaceWith(t,a,l)}else r[0]&&o.insert(s-1,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a));o.scrollIntoView()}})}function tJ(t){return new X({find:t.find,handler:({state:e,range:n,match:r})=>{let i=e.doc.resolve(n.from),o=q(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function t_(t){return new X({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{let o=q(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&(0,a.nd)(l,t.type,o);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){let{selection:n,storedMarks:r}=e,{splittableMarks:i}=t.editor.extensionManager,o=r||n.$to.parentOffset&&n.$from.marks();if(o){let t=o.filter(t=>i.includes(t.type.name));s.ensureMarks(t)}}if(t.keepAttributes){let e="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";i().updateAttributes(e,o).run()}let h=s.doc.resolve(n.from-1).nodeBefore;h&&h.type===t.type&&(0,a.Mn)(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,h))&&s.join(n.from-1)}})}class tq{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=q(j(this,"addOptions",{name:this.name}))),this.storage=q(j(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new tq(t)}configure(t={}){let e=this.extend();return e.options=to(this.options,t),e.storage=q(j(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){let e=new tq(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=q(j(e,"addOptions",{name:e.name})),e.storage=q(j(e,"addStorage",{name:e.name,options:e.options})),e}static handleExit({editor:t,mark:e}){let{tr:n}=t.state,r=t.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(t=>(null==t?void 0:t.type.name)===e.name))return!1;let o=i.find(t=>(null==t?void 0:t.type.name)===e.name);return o&&n.removeStoredMark(o),n.insertText(" ",r.pos),t.view.dispatch(n),!0}return!1}}class tW{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=q(j(this,"addOptions",{name:this.name}))),this.storage=q(j(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new tW(t)}configure(t={}){let e=this.extend();return e.options=to(this.options,t),e.storage=q(j(e,"addStorage",{name:e.name,options:e.options})),e}extend(t={}){let e=new tW(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=q(j(e,"addOptions",{name:e.name})),e.storage=q(j(e,"addStorage",{name:e.name,options:e.options})),e}}function tY(t){return new te({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{let o=q(t.getAttributes,void 0,r,i);if(!1===o||null===o)return null;let{tr:s}=e,a=r[r.length-1],l=r[0],c=n.to;if(a){let r=l.search(/\S/),i=n.from+l.indexOf(a),h=i+a.length;if(tA(n.from,n.to,e.doc).filter(e=>e.mark.type.excluded.find(n=>n===t.type&&n!==e.mark.type)).filter(t=>t.to>i).length)return null;h<n.to&&s.delete(h,n.to),i>n.from&&s.delete(n.from+r,i),c=n.from+r+a.length,s.addMark(n.from+r,c,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}},3676:function(t,e,n){"use strict";n.d(e,{ZP:function(){return o}});var r=n(6962);let i=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,o=r.NB.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",(0,r.P1)(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[(0,r.x2)({find:i,type:this.type,getAttributes:t=>{let[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}})},5318:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=n(6962).hj.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>!!this.options.alignments.includes(t)&&this.options.types.every(n=>e.updateAttributes(n,{textAlign:t})),unsetTextAlign:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}})},5015:function(t,e,n){"use strict";n.d(e,{jE:function(){return h},kg:function(){return l}});var r=n(2265),i=n(4887),o=n(6962);let s=({renderers:t})=>r.createElement(r.Fragment,null,Object.entries(t).map(([t,e])=>i.createPortal(e.reactElement,e.element,t)));class a extends r.Component{constructor(t){super(t),this.editorContentRef=r.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let{editor:t}=this.props;if(t&&t.options.element){if(t.contentComponent)return;let e=this.editorContentRef.current;e.append(...t.options.element.childNodes),t.setOptions({element:e}),t.contentComponent=this,t.createNodeViews(),this.initialized=!0}}maybeFlushSync(t){this.initialized?(0,i.flushSync)(t):t()}setRenderer(t,e){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>({renderers:{...n,[t]:e}}))})}removeRenderer(t){this.maybeFlushSync(()=>{this.setState(({renderers:e})=>{let n={...e};return delete n[t],{renderers:n}})})}componentWillUnmount(){let{editor:t}=this.props;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild))return;let e=document.createElement("div");e.append(...t.options.element.childNodes),t.setOptions({element:e})}render(){let{editor:t,...e}=this.props;return r.createElement(r.Fragment,null,r.createElement("div",{ref:this.editorContentRef,...e}),r.createElement(s,{renderers:this.state.renderers}))}}let l=r.memo(t=>{let e=r.useMemo(()=>Math.floor(4294967295*Math.random()).toString(),[t.editor]);return r.createElement(a,{key:e,...t})});class c extends o.ML{constructor(){super(...arguments),this.contentComponent=null}}let h=(t={},e=[])=>{let[n,i]=(0,r.useState)(null),o=function(){let[,t]=(0,r.useState)(0);return()=>t(t=>t+1)}(),{onBeforeCreate:s,onBlur:a,onCreate:l,onDestroy:h,onFocus:p,onSelectionUpdate:u,onTransaction:d,onUpdate:f}=t,m=(0,r.useRef)(s),g=(0,r.useRef)(a),y=(0,r.useRef)(l),k=(0,r.useRef)(h),v=(0,r.useRef)(p),x=(0,r.useRef)(u),w=(0,r.useRef)(d),b=(0,r.useRef)(f);return(0,r.useEffect)(()=>{n&&(s&&(n.off("beforeCreate",m.current),n.on("beforeCreate",s),m.current=s),a&&(n.off("blur",g.current),n.on("blur",a),g.current=a),l&&(n.off("create",y.current),n.on("create",l),y.current=l),h&&(n.off("destroy",k.current),n.on("destroy",h),k.current=h),p&&(n.off("focus",v.current),n.on("focus",p),v.current=p),u&&(n.off("selectionUpdate",x.current),n.on("selectionUpdate",u),x.current=u),d&&(n.off("transaction",w.current),n.on("transaction",d),w.current=d),f&&(n.off("update",b.current),n.on("update",f),b.current=f))},[s,a,l,h,p,u,d,f,n]),(0,r.useEffect)(()=>{let e=!0,n=new c(t);return i(n),n.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{e&&o()})})}),()=>{e=!1}},e),(0,r.useEffect)(()=>()=>{null==n||n.destroy()},[n]),n};(0,r.createContext)({editor:null}).Consumer;let p=(0,r.createContext)({onDragStart:void 0}),u=()=>(0,r.useContext)(p);r.forwardRef((t,e)=>{let{onDragStart:n}=u(),i=t.as||"div";return r.createElement(i,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})})},4603:function(t,e,n){"use strict";n.d(e,{Z:function(){return tv}});var r=n(6962);let i=/^\s*>\s$/,o=r.NB.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:t}){return["blockquote",(0,r.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[(0,r.S0)({find:i,type:this.type})]}}),s=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,a=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,l=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,c=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,h=r.vc.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],renderHTML({HTMLAttributes:t}){return["strong",(0,r.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,r.Cf)({find:s,type:this.type}),(0,r.Cf)({find:l,type:this.type})]},addPasteRules(){return[(0,r.K9)({find:a,type:this.type}),(0,r.K9)({find:c,type:this.type})]}}),p=r.NB.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",(0,r.P1)(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),u=r.vc.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",(0,r.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>!!Object.entries((0,r.Jo)(t,this.type)).some(([,t])=>!!t)||e.unsetMark(this.name)}}}),d=/^\s*([-+*])\s$/,f=r.NB.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",(0,r.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(p.name,this.editor.getAttributes(u.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=(0,r.S0)({find:d,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,r.S0)({find:d,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(u.name),editor:this.editor})),[t]}}),m=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,g=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,y=r.vc.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:t}){return["code",(0,r.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[(0,r.Cf)({find:m,type:this.type})]},addPasteRules(){return[(0,r.K9)({find:g,type:this.type})]}});var k=n(7213);let v=/^```([a-z]+)?[\s\n]$/,x=/^~~~([a-z]+)?[\s\n]$/,w=r.NB.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options;return[...(null===(e=t.firstElementChild)||void 0===e?void 0:e.classList)||[]].filter(t=>t.startsWith(n)).map(t=>t.replace(n,""))[0]||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:e}){return["pre",(0,r.P1)(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=1===e.pos;return!!t&&e.parent.type.name===this.name&&(!!n||!e.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!!o&&!!s&&t.chain().command(({tr:t})=>(t.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let s=i.after();return!(void 0===s||r.nodeAt(s))&&t.commands.exitCode()}}},addInputRules(){return[(0,r.zK)({find:v,type:this.type,getAttributes:t=>({language:t[1]})}),(0,r.zK)({find:x,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new k.Sy({key:new k.H$("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;let{tr:s}=t.state;return s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(k.Bs.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,"\n")),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),b=r.NB.create({name:"doc",topNode:!0,content:"block+"});var S=n(4536);class M{constructor(t,e){var n;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=e.width)&&void 0!==n?n:1,this.color=!1===e.color?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map(e=>{let n=t=>{this[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}})}destroy(){this.handlers.forEach(({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e))}update(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t,e,n=this.editorView.state.doc.resolve(this.cursorPos),r=!n.parent.inlineContent,i;if(r){let t=n.nodeBefore,e=n.nodeAfter;if(t||e){let n=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(n){let r=n.getBoundingClientRect(),o=t?r.bottom:r.top;t&&e&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),i={left:r.left,right:r.right,top:o-this.width/2,bottom:o+this.width/2}}}}if(!i){let t=this.editorView.coordsAtPos(this.cursorPos);i={left:t.left-this.width/2,right:t.left+this.width/2,top:t.top,bottom:t.bottom}}let o=this.editorView.dom.offsetParent;if(!this.element&&(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r),o&&(o!=document.body||"static"!=getComputedStyle(o).position)){let n=o.getBoundingClientRect();t=n.left-o.scrollLeft,e=n.top-o.scrollTop}else t=-pageXOffset,e=-pageYOffset;this.element.style.left=i.left-t+"px",this.element.style.top=i.top-e+"px",this.element.style.width=i.right-i.left+"px",this.element.style.height=i.bottom-i.top+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,e,t):r;if(e&&!i){let t=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=(0,S.nj)(this.editorView.state.doc,t,this.editorView.dragging.slice);null!=e&&(t=e)}this.setCursor(t),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}let C=r.hj.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[function(t={}){return new k.Sy({view:e=>new M(e,t)})}(this.options)]}});var T=n(258),E=n(121),A=n(9006);class O extends k.Y1{constructor(t){super(t,t)}map(t,e){let n=t.resolve(e.map(this.head));return O.valid(n)?new O(n):k.Y1.near(n)}content(){return E.p2.empty}eq(t){return t instanceof O&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new O(t.resolve(e.pos))}getBookmark(){return new N(this.anchor)}static valid(t){let e=t.parent;if(e.isTextblock||!function(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let t=r.child(n-1);;t=t.lastChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}}return!0}(t)||!function(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let t=r.child(n);;t=t.firstChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}}return!0}(t))return!1;let n=e.type.spec.allowGapCursor;if(null!=n)return n;let r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,e,n=!1){t:for(;;){if(!n&&O.valid(t))return t;let r=t.pos,i=null;for(let n=t.depth;;n--){let o=t.node(n);if(e>0?t.indexAfter(n)<o.childCount:t.index(n)>0){i=o.child(e>0?t.indexAfter(n):t.index(n)-1);break}if(0==n)return null;r+=e;let s=t.doc.resolve(r);if(O.valid(s))return s}for(;;){let o=e>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!k.qv.isSelectable(i)){t=t.doc.resolve(r+i.nodeSize*e),n=!1;continue t}break}i=o,r+=e;let s=t.doc.resolve(r);if(O.valid(s))return s}return null}}}O.prototype.visible=!1,O.findFrom=O.findGapCursorFrom,k.Y1.jsonID("gapcursor",O);class N{constructor(t){this.pos=t}map(t){return new N(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return O.valid(e)?new O(e):k.Y1.near(e)}}let I=(0,T.$)({ArrowLeft:R("horiz",-1),ArrowRight:R("horiz",1),ArrowUp:R("vert",-1),ArrowDown:R("vert",1)});function R(t,e){let n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,i){let o=t.selection,s=e>0?o.$to:o.$from,a=o.empty;if(o instanceof k.Bs){if(!i.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=t.doc.resolve(e>0?s.after():s.before())}let l=O.findGapCursorFrom(s,e,a);return!!l&&(r&&r(t.tr.setSelection(new O(l))),!0)}}function P(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!O.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&k.qv.isSelectable(t.state.doc.nodeAt(i.inside)))&&(t.dispatch(t.state.tr.setSelection(new O(r))),!0)}function z(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof O))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=E.HY.empty;for(let t=r.length-1;t>=0;t--)i=E.HY.from(r[t].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new E.p2(i,0,0));return o.setSelection(k.Bs.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function L(t){if(!(t.selection instanceof O))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",A.EH.create(t.doc,[A.p.widget(t.selection.head,e,{key:"gapcursor"})])}let B=r.hj.create({name:"gapCursor",addProseMirrorPlugins:()=>[new k.Sy({props:{decorations:L,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&O.valid(n)?new O(n):null,handleClick:P,handleKeyDown:I,handleDOMEvents:{beforeinput:z}}})],extendNodeSchema(t){var e;let n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:null!==(e=(0,r.nU)((0,r.Nl)(t,"allowGapCursor",n)))&&void 0!==e?e:null}}}),H=r.NB.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",(0,r.P1)(this.options.HTMLAttributes,t)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:t,storedMarks:i}=n;if(t.$from.parent.type.spec.isolating)return!1;let{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,a=i||t.$to.parentOffset&&t.$from.marks();return e().insertContent({type:this.name}).command(({tr:t,dispatch:e})=>{if(e&&a&&o){let e=a.filter(t=>s.includes(t.type.name));t.ensureMarks(e)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),j=r.NB.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){let n=this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0];return[`h${n}`,(0,r.P1)(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>(0,r.zK)({find:RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var F=function(){};F.prototype.append=function(t){return t.length?(t=F.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},F.prototype.prepend=function(t){return t.length?F.from(t).append(this):this},F.prototype.appendInner=function(t){return new $(this,t)},F.prototype.slice=function(t,e){return(void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e)?F.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},F.prototype.get=function(t){if(!(t<0)&&!(t>=this.length))return this.getInner(t)},F.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},F.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(e,n){return r.push(t(e,n))},e,n),r},F.from=function(t){return t instanceof F?t:t&&t.length?new D(t):F.empty};var D=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var i=e;i<n;i++)if(!1===t(this.values[i],r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var i=e-1;i>=n;i--)if(!1===t(this.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(F);F.empty=new D([]);var $=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var i=this.left.length;if(e<i&&!1===this.left.forEachInner(t,e,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;if(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(t,Math.min(e,i),n,r))return!1},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(F);class V{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){let n,r,i,o;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}e&&(r=(n=this.remapping(s,this.items.length)).maps.length);let a=t.tr,l=[],c=[];return this.items.forEach((t,e)=>{if(!t.step){n||(r=(n=this.remapping(s,e+1)).maps.length),r--,c.push(t);return}if(n){c.push(new J(t.map));let e=t.step.map(n.slice(r)),i;e&&a.maybeStep(e).doc&&(i=a.mapping.maps[a.mapping.maps.length-1],l.push(new J(i,void 0,void 0,l.length+c.length))),r--,i&&n.appendMap(i,r)}else a.maybeStep(t.step);if(t.selection)return i=n?t.selection.map(n.slice(r)):t.selection,o=new V(this.items.slice(0,s).append(c.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:a,selection:i}}addTransform(t,e,n,r){var i,o;let s,a=[],l=this.eventCount,c=this.items,h=!r&&c.length?c.get(c.length-1):null;for(let n=0;n<t.steps.length;n++){let i=t.steps[n].invert(t.docs[n]),o=new J(t.mapping.maps[n],i,e),s;(s=h&&h.merge(o))&&(o=s,n?a.pop():c=c.slice(0,c.length-1)),a.push(o),e&&(l++,e=void 0),r||(h=o)}let p=l-n.depth;return p>q&&(i=c,o=p,i.forEach((t,e)=>{if(t.selection&&0==o--)return s=e,!1}),c=i.slice(s),l-=p),new V(c.append(a),l)}remapping(t,e){let n=new S.vs;return this.items.forEach((e,r)=>{let i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)},t,e),n}addMaps(t){return 0==this.eventCount?this:new V(this.items.append(t.map(t=>new J(t))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),i=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(t=>{t.selection&&s--},r);let a=e;this.items.forEach(e=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(e.step){let o=t.steps[r].invert(t.docs[r]),c=e.selection&&e.selection.map(i.slice(a+1,r));c&&s++,n.push(new J(l,o,c))}else n.push(new J(l))},r);let l=[];for(let t=e;t<o;t++)l.push(new J(i.maps[t]));let c=new V(this.items.slice(0,r).append(l).append(n),s);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let t=0;return this.items.forEach(e=>{!e.step&&t++}),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],i=0;return this.items.forEach((o,s)=>{if(s>=t)r.push(o),o.selection&&i++;else if(o.step){let t=o.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let a=o.selection&&o.selection.map(e.slice(n));a&&i++;let l=new J(s.invert(),t,a),c,h=r.length-1;(c=r.length&&r[h].merge(l))?r[h]=c:r.push(l)}}else o.map&&n--},this.items.length,0),new V(F.from(r.reverse()),i)}}V.empty=new V(F.empty,0);class J{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new J(e.getMap().invert(),e,this.selection)}}}class _{constructor(t,e,n,r,i){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let q=20;function W(t){let e=[];return t.forEach((t,n,r,i)=>e.push(r,i)),e}function Y(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function K(t,e,n,r){let i=G(e),o=X.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,i);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),o,i),c=new _(r?l:s.remaining,r?s.remaining:l,null,0,-1);n(s.transform.setSelection(a).setMeta(X,{redo:r,historyState:c}).scrollIntoView())}let U=!1,Z=null;function G(t){let e=t.plugins;if(Z!=e){U=!1,Z=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){U=!0;break}}return U}let X=new k.H$("history"),Q=new k.H$("closeHistory"),tt=(t,e)=>{let n=X.getState(t);return!!n&&0!=n.done.eventCount&&(e&&K(n,t,e,!1),!0)},te=(t,e)=>{let n=X.getState(t);return!!n&&0!=n.undone.eventCount&&(e&&K(n,t,e,!0),!0)},tn=r.hj.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>tt(t,e),redo:()=>({state:t,dispatch:e})=>te(t,e)}),addProseMirrorPlugins(){return[function(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new k.Sy({key:X,state:{init:()=>new _(V.empty,V.empty,null,0,-1),apply:(e,n,r)=>(function(t,e,n,r){let i=n.getMeta(X),o;if(i)return i.historyState;n.getMeta(Q)&&(t=new _(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(X))return s.getMeta(X).redo?new _(t.done.addTransform(n,void 0,r,G(e)),t.undone,W(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new _(t.done,t.undone.addTransform(n,void 0,r,G(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new _(t.done.rebased(n,o),t.undone.rebased(n,o),Y(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new _(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Y(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let i=n.getMeta("composition"),o=0==t.prevTime||!s&&t.prevComposition!=i&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((t,r)=>{for(let i=0;i<e.length;i+=2)t<=e[i+1]&&r>=e[i]&&(n=!0)}),n}(n,t.prevRanges)),a=s?Y(t.prevRanges,n.mapping):W(n.mapping.maps[n.steps.length-1]);return new _(t.done.addTransform(n,o?e.selection.getBookmark():void 0,r,G(e)),V.empty,a,n.time,null==i?t.prevComposition:i)}})(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?tt:"historyRedo"==n?te:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),tr=r.NB.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:t}){return["hr",(0,r.P1)(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{let{$to:n}=e.selection,r=t();return 0===n.parentOffset?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:t,dispatch:e})=>{var n;if(e){let{$to:e}=t.selection,r=e.end();if(e.nodeAfter)e.nodeAfter.isTextblock?t.setSelection(k.Bs.create(t.doc,e.pos+1)):e.nodeAfter.isBlock?t.setSelection(k.qv.create(t.doc,e.pos)):t.setSelection(k.Bs.create(t.doc,e.pos));else{let i=null===(n=e.parent.type.contentMatch.defaultType)||void 0===n?void 0:n.create();i&&(t.insert(r,i),t.setSelection(k.Bs.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[(0,r.x2)({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),ti=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,to=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,ts=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,ta=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,tl=r.vc.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:t}){return["em",(0,r.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,r.Cf)({find:ti,type:this.type}),(0,r.Cf)({find:ts,type:this.type})]},addPasteRules(){return[(0,r.K9)({find:to,type:this.type}),(0,r.K9)({find:ta,type:this.type})]}}),tc=r.NB.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",(0,r.P1)(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),th=r.NB.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",(0,r.P1)(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),tp=r.vc.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:t}){return["span",(0,r.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>!!Object.entries((0,r.Jo)(t,this.type)).some(([,t])=>!!t)||e.unsetMark(this.name)}}}),tu=/^(\d+)\.\s$/,td=r.NB.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){let{start:e,...n}=t;return 1===e?["ol",(0,r.P1)(this.options.HTMLAttributes,n),0]:["ol",(0,r.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(th.name,this.editor.getAttributes(tp.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=(0,r.S0)({find:tu,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,r.S0)({find:tu,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(tp.name)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[t]}}),tf=r.NB.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",(0,r.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),tm=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,tg=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,ty=r.vc.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("line-through")&&{}}],renderHTML({HTMLAttributes:t}){return["s",(0,r.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){let t={};return(0,r.eE)()?t["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():t["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),t},addInputRules(){return[(0,r.Cf)({find:tm,type:this.type})]},addPasteRules(){return[(0,r.K9)({find:tg,type:this.type})]}}),tk=r.NB.create({name:"text",group:"inline"}),tv=r.hj.create({name:"starterKit",addExtensions(){var t,e,n,r,i,s,a,l,c,p,u,d,m,g,k,v,x,S;let M=[];return!1!==this.options.blockquote&&M.push(o.configure(null===(t=this.options)||void 0===t?void 0:t.blockquote)),!1!==this.options.bold&&M.push(h.configure(null===(e=this.options)||void 0===e?void 0:e.bold)),!1!==this.options.bulletList&&M.push(f.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&M.push(y.configure(null===(r=this.options)||void 0===r?void 0:r.code)),!1!==this.options.codeBlock&&M.push(w.configure(null===(i=this.options)||void 0===i?void 0:i.codeBlock)),!1!==this.options.document&&M.push(b.configure(null===(s=this.options)||void 0===s?void 0:s.document)),!1!==this.options.dropcursor&&M.push(C.configure(null===(a=this.options)||void 0===a?void 0:a.dropcursor)),!1!==this.options.gapcursor&&M.push(B.configure(null===(l=this.options)||void 0===l?void 0:l.gapcursor)),!1!==this.options.hardBreak&&M.push(H.configure(null===(c=this.options)||void 0===c?void 0:c.hardBreak)),!1!==this.options.heading&&M.push(j.configure(null===(p=this.options)||void 0===p?void 0:p.heading)),!1!==this.options.history&&M.push(tn.configure(null===(u=this.options)||void 0===u?void 0:u.history)),!1!==this.options.horizontalRule&&M.push(tr.configure(null===(d=this.options)||void 0===d?void 0:d.horizontalRule)),!1!==this.options.italic&&M.push(tl.configure(null===(m=this.options)||void 0===m?void 0:m.italic)),!1!==this.options.listItem&&M.push(tc.configure(null===(g=this.options)||void 0===g?void 0:g.listItem)),!1!==this.options.orderedList&&M.push(td.configure(null===(k=this.options)||void 0===k?void 0:k.orderedList)),!1!==this.options.paragraph&&M.push(tf.configure(null===(v=this.options)||void 0===v?void 0:v.paragraph)),!1!==this.options.strike&&M.push(ty.configure(null===(x=this.options)||void 0===x?void 0:x.strike)),!1!==this.options.text&&M.push(tk.configure(null===(S=this.options)||void 0===S?void 0:S.text)),M}})},7602:function(t,e,n){"use strict";var r=n(4948);r.domToReact,r.htmlToDOM,r.attributesToProps,r.Comment,r.Element,r.ProcessingInstruction,r.Text,e.ZP=r},258:function(t,e,n){"use strict";n.d(e,{$:function(){return d},h:function(){return u}});for(var r={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},o="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),s="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=0;a<10;a++)r[48+a]=r[96+a]=String(a);for(var a=1;a<=24;a++)r[a+111]="F"+a;for(var a=65;a<=90;a++)r[a]=String.fromCharCode(a+32),i[a]=String.fromCharCode(a);for(var l in r)i.hasOwnProperty(l)||(i[l]=r[l]);var c=n(7213);let h="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function p(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function u(t){return new c.Sy({props:{handleKeyDown:d(t)}})}function d(t){let e=function(t){let e=Object.create(null);for(let n in t)e[function(t){let e,n,r,i,o=t.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let t=0;t<o.length-1;t++){let s=o[t];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))e=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))h?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+s)}return e&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}(n)]=t[n];return e}(t);return function(t,n){var a;let l=("Esc"==(a=!(o&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||s&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?i:r)[n.keyCode]||n.key||"Unidentified")&&(a="Escape"),"Del"==a&&(a="Delete"),"Left"==a&&(a="ArrowLeft"),"Up"==a&&(a="ArrowUp"),"Right"==a&&(a="ArrowRight"),"Down"==a&&(a="ArrowDown"),a),c,h=e[p(l,n)];if(h&&h(t.state,t.dispatch,t))return!0;if(1==l.length&&" "!=l){if(n.shiftKey){let r=e[p(l,n,!1)];if(r&&r(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||l.charCodeAt(0)>127)&&(c=r[n.keyCode])&&c!=l){let r=e[p(c,n)];if(r&&r(t.state,t.dispatch,t))return!0}}return!1}}},121:function(t,e,n){"use strict";function r(t){this.content=t}n.d(e,{aw:function(){return F},PW:function(){return Y},HY:function(){return i},vc:function(){return l},ZU:function(){return B},NB:function(){return S},Ts:function(){return w},e4:function(){return c},V_:function(){return H},p2:function(){return h}}),r.prototype={constructor:r,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return -1},get:function(t){var e=this.find(t);return -1==e?void 0:this.content[e+1]},update:function(t,e,n){var i=n&&n!=t?this.remove(n):this,o=i.find(t),s=i.content.slice();return -1==o?s.push(n||t,e):(s[o+1]=e,n&&(s[o]=n)),new r(s)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new r(n)},addToStart:function(t,e){return new r([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new r(n)},addBefore:function(t,e,n){var i=this.remove(e),o=i.content.slice(),s=i.find(t);return o.splice(-1==s?o.length:s,0,e,n),new r(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=r.from(t)).size?new r(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=r.from(t)).size?new r(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=r.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},r.from=function(t){if(t instanceof r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new r(e)};class i{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;e<t.length;e++)this.size+=t[e].nodeSize}nodesBetween(t,e,n,r=0,i){for(let o=0,s=0;s<e;o++){let a=this.content[o],l=s+a.nodeSize;if(l>t&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,t-i),Math.min(a.content.size,e-i),n,r+i)}s=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let i="",o=!0;return this.nodesBetween(t,e,(s,a)=>{s.isText?(i+=s.text.slice(Math.max(t,a)-a,e-a),o=!n):s.isLeaf?(r?i+="function"==typeof r?r(s):r:s.type.spec.leafText&&(i+=s.type.spec.leafText(s)),o=!n):!o&&s.isBlock&&(i+=n,o=!0)},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);o<t.content.length;o++)r.push(t.content[o]);return new i(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let i=0,o=0;o<e;i++){let s=this.content[i],a=o+s.nodeSize;a>t&&((o<t||a>e)&&(s=s.isText?s.cut(Math.max(0,t-o),Math.min(s.text.length,e-o)):s.cut(Math.max(0,t-o-1),Math.min(s.content.size,e-o-1))),n.push(s),r+=s.nodeSize),o=a}return new i(n,r)}cutByIndex(t,e){return t==e?i.empty:0==t&&e==this.content.length?this:new i(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new i(r,o)}addToStart(t){return new i([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new i(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return function t(e,n,r){for(let i=0;;i++){if(i==e.childCount||i==n.childCount)return e.childCount==n.childCount?null:r;let o=e.child(i),s=n.child(i);if(o==s){r+=o.nodeSize;continue}if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){for(let t=0;o.text[t]==s.text[t];t++)r++;return r}if(o.content.size||s.content.size){let e=t(o.content,s.content,r+1);if(null!=e)return e}r+=o.nodeSize}}(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return function t(e,n,r,i){for(let o=e.childCount,s=n.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};let a=e.child(--o),l=n.child(--s),c=a.nodeSize;if(a==l){r-=c,i-=c;continue}if(!a.sameMarkup(l))return{a:r,b:i};if(a.isText&&a.text!=l.text){let t=0,e=Math.min(a.text.length,l.text.length);for(;t<e&&a.text[a.text.length-t-1]==l.text[l.text.length-t-1];)t++,r--,i--;return{a:r,b:i}}if(a.content.size||l.content.size){let e=t(a.content,l.content,r-1,i-1);if(e)return e}r-=c,i-=c}}(this,t,e,n)}findIndex(t,e=-1){if(0==t)return s(0,t);if(t==this.size)return s(this.content.length,t);if(t>this.size||t<0)throw RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=t){if(i==t||e>0)return s(n+1,i);return s(n,r)}r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return i.empty;if(!Array.isArray(e))throw RangeError("Invalid input for Fragment.fromJSON");return new i(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return i.empty;let e,n=0;for(let r=0;r<t.length;r++){let i=t[r];n+=i.nodeSize,r&&i.isText&&t[r-1].sameMarkup(i)?(e||(e=t.slice(0,r)),e[e.length-1]=i.withText(e[e.length-1].text+i.text)):e&&e.push(i)}return new i(e||t,n)}static from(t){if(!t)return i.empty;if(t instanceof i)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new i([t],t.nodeSize);throw RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}i.empty=new i([],0);let o={index:0,offset:0};function s(t,e){return o.index=t,o.offset=e,o}function a(t,e){if(t===e)return!0;if(!(t&&"object"==typeof t)||!(e&&"object"==typeof e))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!a(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!a(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class l{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))e||(e=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!n&&i.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&a(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw RangeError(`There is no mark type ${e.type} in this schema`);return n.create(e.attrs)}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return l.none;if(t instanceof l)return[t];let e=t.slice();return e.sort((t,e)=>t.type.rank-e.type.rank),e}}l.none=[];class c extends Error{}class h{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=function t(e,n,r,i){let{index:o,offset:s}=e.findIndex(n),a=e.maybeChild(o);if(s==n||a.isText)return i&&!i.canReplace(o,o,r)?null:e.cut(0,n).append(r).append(e.cut(n));let l=t(a.content,n-s-1,r);return l&&e.replaceChild(o,a.copy(l))}(this.content,t+this.openStart,e);return n&&new h(n,this.openStart,this.openEnd)}removeBetween(t,e){return new h(function t(e,n,r){let{index:i,offset:o}=e.findIndex(n),s=e.maybeChild(i),{index:a,offset:l}=e.findIndex(r);if(o==n||s.isText){if(l!=r&&!e.child(a).isText)throw RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(r))}if(i!=a)throw RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(t(s.content,n-o-1,r-o-1)))}(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return h.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new h(i.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)r++;return new h(t,n,r)}}function p(t,e){if(!e.type.compatibleContent(t.type))throw new c("Cannot join "+e.type.name+" onto "+t.type.name)}function u(t,e,n){let r=t.node(n);return p(r,e.node(n)),r}function d(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function f(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(d(t.nodeAfter,r),o++));for(let t=o;t<s;t++)d(i.child(t),r);e&&e.depth==n&&e.textOffset&&d(e.nodeBefore,r)}function m(t,e){return t.type.checkContent(e),t.copy(e)}function g(t,e,n){let r=[];return f(null,t,n,r),t.depth>n&&d(m(u(t,e,n+1),g(t,e,n+1)),r),f(e,null,n,r),new i(r)}h.empty=new h(i.empty,0,0);class y{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let e=0;e<t;e++)r+=n.child(e).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return l.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new w(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let e=t;;){let{index:t,offset:o}=e.content.findIndex(i),s=i-o;if(n.push(e,t,r+o),!s||(e=e.child(t)).isText)break;i=s-1,r+=o+1}return new y(e,n,i)}static resolveCached(t,e){for(let n=0;n<k.length;n++){let r=k[n];if(r.pos==e&&r.doc==t)return r}let n=k[v]=y.resolve(t,e);return v=(v+1)%x,n}}let k=[],v=0,x=12;class w{constructor(t,e,n){this.$from=t,this.$to=e,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let b=Object.create(null);class S{constructor(t,e,n,r=l.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||i.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&a(this.attrs,e||t.defaultAttrs||b)&&l.sameSet(this.marks,n||l.none)}copy(t=null){return t==this.content?this:new S(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new S(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return h.empty;let r=this.resolve(t),i=this.resolve(e),o=n?0:r.sharedDepth(e),s=r.start(o);return new h(r.node(o).content.cut(r.pos-s,i.pos-s),r.depth-o,i.depth-o)}replace(t,e,n){return function(t,e,n){if(n.openStart>t.depth)throw new c("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new c("Inconsistent open depths");return function t(e,n,r,o){let s=e.index(o),a=e.node(o);if(s==n.index(o)&&o<e.depth-r.openStart){let i=t(e,n,r,o+1);return a.copy(a.content.replaceChild(s,i))}if(!r.content.size)return m(a,g(e,n,o));if(r.openStart||r.openEnd||e.depth!=o||n.depth!=o){let{start:t,end:s}=function(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let t=n-1;t>=0;t--)r=e.node(t).copy(i.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(r,e);return m(a,function t(e,n,r,o,s){let a=e.depth>s&&u(e,n,s+1),l=o.depth>s&&u(r,o,s+1),c=[];return f(null,e,s,c),a&&l&&n.index(s)==r.index(s)?(p(a,l),d(m(a,t(e,n,r,o,s+1)),c)):(a&&d(m(a,g(e,n,s+1)),c),f(n,r,s,c),l&&d(m(l,g(r,o,s+1)),c)),f(o,null,s,c),new i(c)}(e,t,s,n,o))}{let t=e.parent,i=t.content;return m(t,i.cut(0,e.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(t,e,n,0)}(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(!(e=e.maybeChild(n)))return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return y.resolveCached(this,t)}resolveNoCache(t){return y.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,t=>(n.isInSet(t.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),C(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=i.empty,r=0,o=n.childCount){let s=this.contentMatchAt(t).matchFragment(n,r,o),a=s&&s.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(let t=r;t<o;t++)if(!this.type.allowsMarks(n.child(t).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(t).matchType(n),o=i&&i.matchFragment(this.content,e);return!!o&&o.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content);let t=l.none;for(let e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!l.sameSet(t,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(t=>t.toJSON())),t}static fromJSON(t,e){if(!e)throw RangeError("Invalid input for Node.fromJSON");let n=null;if(e.marks){if(!Array.isArray(e.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=i.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}S.prototype.text=void 0;class M extends S{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):C(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new M(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new M(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function C(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class T{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){var n;let r,i=new E(t,e);if(null==i.next)return T.empty;let o=function t(e){let n=[];do n.push(function(e){let n=[];do n.push(function(e){let n=function(e){if(e.eat("(")){let n=t(e);return e.eat(")")||e.err("Missing closing paren"),n}if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=(function(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let t in n){let r=n[t];r.groups.indexOf(e)>-1&&i.push(r)}return 0==i.length&&t.err("No node type or group '"+e+"' found"),i})(e,e.next).map(t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}}(e);for(;;)if(e.eat("+"))n={type:"plus",expr:n};else if(e.eat("*"))n={type:"star",expr:n};else if(e.eat("?"))n={type:"opt",expr:n};else if(e.eat("{"))n=function(t,e){let n=A(t),r=n;return t.eat(",")&&(r="}"!=t.next?A(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}(e,n);else break;return n}(e));while(e.next&&")"!=e.next&&"|"!=e.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(e));while(e.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let s=(n=function(t){let e=[[]];return i(function t(e,o){if("choice"==e.type)return e.exprs.reduce((e,n)=>e.concat(t(n,o)),[]);if("seq"==e.type)for(let r=0;;r++){let s=t(e.exprs[r],o);if(r==e.exprs.length-1)return s;i(s,o=n())}else if("star"==e.type){let s=n();return r(o,s),i(t(e.expr,s),s),[r(s)]}else if("plus"==e.type){let s=n();return i(t(e.expr,o),s),i(t(e.expr,s),s),[r(s)]}else if("opt"==e.type)return[r(o)].concat(t(e.expr,o));else if("range"==e.type){let s=o;for(let r=0;r<e.min;r++){let r=n();i(t(e.expr,s),r),s=r}if(-1==e.max)i(t(e.expr,s),s);else for(let o=e.min;o<e.max;o++){let o=n();r(s,o),i(t(e.expr,s),o),s=o}return[r(s)]}else if("name"==e.type)return[r(o,void 0,e.value)];else throw Error("Unknown expr type")}(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let i={term:r,to:n};return e[t].push(i),i}function i(t,e){t.forEach(t=>t.to=e)}}(o),r=Object.create(null),function t(e){let i=[];e.forEach(t=>{n[t].forEach(({term:t,to:e})=>{let r;if(t){for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);N(n,e).forEach(e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)})}})});let o=r[e.join(",")]=new T(e.indexOf(n.length-1)>-1);for(let e=0;e<i.length;e++){let n=i[e][1].sort(O);o.next.push({type:i[e][0],next:r[n.join(",")]||t(n)})}return o}(N(n,0)));return function(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],i=!t.validEnd,o=[];for(let e=0;e<t.next.length;e++){let{type:n,next:s}=t.next[e];o.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,i),s}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let i=e;r&&i<n;i++)r=r.matchType(t.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!(e.isText||e.hasRequiredAttrs()))return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];return function o(s,a){let l=s.matchFragment(t,n);if(l&&(!e||l.validEnd))return i.from(a.map(t=>t.createAndFill()));for(let t=0;t<s.next.length;t++){let{type:e,next:n}=s.next[t];if(!(e.isText||e.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let t=o(n,a.concat(e));if(t)return t}}return null}(this,[])}findWrapping(t){for(let e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<i.next.length;t++){let{type:o,next:s}=i.next[t];o.isLeaf||o.hasRequiredAttrs()||o.name in e||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),e[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return!function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n<e.next.length;n++)r+=(n?", ":"")+e.next[n].type.name+"->"+t.indexOf(e.next[n].next);return r}).join("\n")}}T.empty=new T(!0);class E{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw SyntaxError(t+" (in content expression '"+this.string+"')")}}function A(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function O(t,e){return e-t}function N(t,e){let n=[];return function e(r){let i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(let t=0;t<i.length;t++){let{term:r,to:o}=i[t];r||-1!=n.indexOf(o)||e(o)}}(e),n.sort(O)}function I(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function R(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(void 0===i){let e=t[r];if(e.hasDefault)i=e.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function P(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new L(t[n]);return e}class z{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=P(n.attrs),this.defaultAttrs=I(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==T.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:R(this.attrs,t)}create(t=null,e,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new S(this,this.computeAttrs(t),i.from(e),l.setFrom(n))}createChecked(t=null,e,n){return e=i.from(e),this.checkContent(e),new S(this,this.computeAttrs(t),e,l.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=i.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),o=r&&r.fillBefore(i.empty,!0);return o?new S(this,t,e.append(o),l.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e<t.childCount;e++)if(!this.allowsMarks(t.child(e).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){let e;if(null==this.markSet)return t;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:l.none:t}static compile(t,e){let n=Object.create(null);t.forEach((t,r)=>n[t]=new z(t,e,r));let r=e.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let t in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class L{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class B{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=P(r.attrs),this.excluded=null;let i=I(this.attrs);this.instance=i?new l(this,i):null}create(t=null){return!t&&this.instance?this.instance:new l(this,R(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach((t,i)=>n[t]=new B(t,r++,e,i)),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}excludes(t){return this.excluded.indexOf(t)>-1}}class H{constructor(t){this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];e.nodes=r.from(t.nodes),e.marks=r.from(t.marks||{}),this.nodes=z.compile(this.spec.nodes,this),this.marks=B.compile(this.spec.marks,this);let n=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],r=e.spec.content||"",i=e.spec.marks;e.contentMatch=n[r]||(n[r]=T.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==i?null:i?j(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:j(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else if(t instanceof z){if(t.schema!=this)throw RangeError("Node type from different schema used ("+t.name+")")}else throw RangeError("Invalid node type: "+t);return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new M(n,n.defaultAttrs,t,l.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeFromJSON(t){return S.fromJSON(this,t)}markFromJSON(t){return l.fromJSON(this,t)}nodeType(t){let e=this.nodes[t];if(!e)throw RangeError("Unknown node type: "+t);return e}}function j(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let e in t.marks){let r=t.marks[e];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class F{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach(t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)}),this.normalizeLists=!this.tags.some(e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)})}parse(t,e={}){let n=new q(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new q(this,e,!0);return n.addAll(t,e.from,e.to),h.maxOpen(n.finish())}matchTag(t,e,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){var r;let n=this.tags[i];if(r=n.tag,(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,r)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(0==o.indexOf(t)&&(!r.context||n.matchesContext(r.context))&&(!(o.length>t.length)||61==o.charCodeAt(t.length)&&o.slice(t.length+1)==e)){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let e in t.marks){let r=t.marks[e].spec.parseDOM;r&&r.forEach(t=>{n(t=W(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)})}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach(t=>{n(t=W(t)),t.node||t.ignore||t.mark||(t.node=e)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new F(t,F.schemaRules(t)))}}let D={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},$={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},V={ol:!0,ul:!0};function J(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class _{constructor(t,e,n,r,i,o,s){this.type=t,this.attrs=e,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=l.none,this.stashMarks=[],this.match=o||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(i.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let e=this.type.contentMatch,n;return(n=e.findWrapping(t.type))?(this.match=e,n):null}}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t=this.content[this.content.length-1],e;t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))&&(t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=t.withText(t.text.slice(0,t.text.length-e[0].length)))}let e=i.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}applyPending(t){for(let e=0,n=this.pendingMarks;e<n.length;e++){let r=n[e];(this.type?this.type.allowsMarkType(r.type):function(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=t=>{o.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:i}=t.edge(n);if(r==e||0>o.indexOf(i)&&s(i))return!0}};if(s(i.contentMatch))return!0}}(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!D.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class q{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0;let r=e.topNode,i,o=J(null,e.preserveWhitespace,0)|(n?4:0);i=r?new _(r.type,r.attrs,l.none,l.none,!0,e.topMatch||r.type.contentMatch,o):n?new _(null,null,l.none,l.none,!0,null,o):new _(t.schema.topNodeType,null,l.none,l.none,!0,null,o),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t){3==t.nodeType?this.addTextNode(t):1==t.nodeType&&this.addElement(t)}withStyleRules(t,e){let n=t.getAttribute("style");if(!n)return e();let r=this.readStyles(function(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}(n));if(!r)return;let[i,o]=r,s=this.top;for(let t=0;t<o.length;t++)this.removePendingMark(o[t],s);for(let t=0;t<i.length;t++)this.addPendingMark(i[t]);e();for(let t=0;t<i.length;t++)this.removePendingMark(i[t],s);for(let t=0;t<o.length;t++)this.addPendingMark(o[t])}addTextNode(t){let e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=t.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)}addElement(t,e){let n=t.nodeName.toLowerCase(),r;V.hasOwnProperty(n)&&this.parser.normalizeLists&&function(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&V.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}(t);let i=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(r=this.parser.matchTag(t,this,e));if(i?i.ignore:$.hasOwnProperty(n))this.findInside(t),this.ignoreFallback(t);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(t=i.skip);let e,r=this.top,o=this.needsBlock;if(D.hasOwnProperty(n))r.content.length&&r.content[0].isInline&&this.open&&(this.open--,r=this.top),e=!0,r.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}i&&i.skip?this.addAll(t):this.withStyleRules(t,()=>this.addAll(t)),e&&this.sync(r),this.needsBlock=o}else this.withStyleRules(t,()=>{this.addElementByRule(t,i,!1===i.consuming?r:void 0)})}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let e=l.none,n=l.none;for(let r=0;r<t.length;r+=2)for(let i;;){let o=this.parser.matchStyle(t[r],t[r+1],this,i);if(!o)break;if(o.ignore)return null;if(o.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(t=>{o.clearMark(t)&&(n=t.addToSet(n))}):e=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(e),!1===o.consuming)i=o;else break}return[e,n]}addElementByRule(t,e,n){let r,i,o;e.node?(i=this.parser.schema.nodes[e.node]).isLeaf?this.insertNode(i.create(e.attrs))||this.leafFallback(t):r=this.enter(i,e.attrs||null,e.preserveWhitespace):(o=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(o));let s=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t));else{let n=t;"string"==typeof e.contentElement?n=t.querySelector(e.contentElement):"function"==typeof e.contentElement?n=e.contentElement(t):e.contentElement&&(n=e.contentElement),this.findAround(t,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(t,e,n){let r=e||0;for(let i=e?t.childNodes[e]:t.firstChild,o=null==n?null:t.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(i);this.findAtPoint(t,r)}findPlace(t){let e,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(t);if(o&&(!e||e.length>o.length)&&(e=o,n=i,!o.length)||i.solid)break}if(!e)return!1;this.sync(n);for(let t=0;t<e.length;t++)this.enterInner(e[t],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(t)){this.closeExtra();let e=this.top;e.applyPending(t.type),e.match&&(e.match=e.match.matchType(t.type));let n=e.activeMarks;for(let r=0;r<t.marks.length;r++)(!e.type||e.type.allowsMarkType(t.marks[r].type))&&(n=t.marks[r].addToSet(n));return e.content.push(t.mark(n)),!0}return!1}enter(t,e,n){let r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r}enterInner(t,e=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(t),i.match=i.match&&i.match.matchType(t);let o=J(t,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new _(t,e,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(t,s)=>{for(;t>=0;t--){let a=e[t];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=i;s--)if(o(t-1,s))return!0;return!1}{let t=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return o(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(t){let e=function(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}removePendingMark(t,e){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);let e=r.popFromStashMark(t);e&&r.type&&r.type.allowsMarkType(e.type)&&(r.activeMarks=e.addToSet(r.activeMarks))}if(r==e)break}}}function W(t){let e={};for(let n in t)e[n]=t[n];return e}class Y{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=U(e).createDocumentFragment());let r=n,i=[];return t.forEach(t=>{if(i.length||t.marks.length){let n=0,o=0;for(;n<i.length&&o<t.marks.length;){let e=t.marks[o];if(!this.marks[e.type.name]){o++;continue}if(!e.eq(i[n][0])||!1===e.type.spec.spanning)break;n++,o++}for(;n<i.length;)r=i.pop()[1];for(;o<t.marks.length;){let n=t.marks[o++],s=this.serializeMark(n,t.isInline,e);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(t,e))}),n}serializeNodeInner(t,e){let{dom:n,contentDOM:r}=Y.renderSpec(U(e),this.nodes[t.type.name](t));if(r){if(t.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&Y.renderSpec(U(n),r(t,e))}static renderSpec(t,e,n=null){let r;if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let i=e[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?t.createElementNS(n,i):t.createElement(i),a=e[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){for(let t in l=2,a)if(null!=a[t]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):s.setAttribute(t,a[t])}}for(let i=l;i<e.length;i++){let o=e[i];if(0===o){if(i<e.length-1||i>l)throw RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:i}=Y.renderSpec(t,o,n);if(s.appendChild(e),i){if(r)throw RangeError("Multiple content holes");r=i}}}return{dom:s,contentDOM:r}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Y(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=K(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return K(t.marks)}}function K(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function U(t){return t.document||window.document}},7213:function(t,e,n){"use strict";n.d(e,{Bs:function(){return h},C1:function(){return f},H$:function(){return E},Sy:function(){return M},Y1:function(){return s},qv:function(){return u},yy:function(){return S}});var r=n(121),i=n(4536);let o=Object.create(null);class s{constructor(t,e,n){this.$anchor=t,this.$head=e,this.ranges=n||[new a(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=r.p2.empty){let n=e.content.lastChild,i=null;for(let t=0;t<e.openEnd;t++)i=n,n=n.lastChild;let o=t.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],h=t.mapping.slice(o);t.replaceRange(h.map(l.pos),h.map(c.pos),a?r.p2.empty:e),0==a&&y(t,o,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,e){let n=t.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=t.mapping.slice(n),l=a.map(o.pos),c=a.map(s.pos);i?t.deleteRange(l,c):(t.replaceRangeWith(l,c,e),y(t,n,e.isInline?-1:1))}}static findFrom(t,e,n=!1){let r=t.parent.inlineContent?new h(t):g(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(let r=t.depth-1;r>=0;r--){let i=e<0?g(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):g(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(i)return i}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new f(t.node(0))}static atStart(t){return g(t,t,0,0,1)||new f(t)}static atEnd(t){return g(t,t,t.content.size,t.childCount,-1)||new f(t)}static fromJSON(t,e){if(!e||!e.type)throw RangeError("Invalid input for Selection.fromJSON");let n=o[e.type];if(!n)throw RangeError(`No selection type ${e.type} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in o)throw RangeError("Duplicate use of selection JSON ID "+t);return o[t]=e,e.prototype.jsonID=t,e}getBookmark(){return h.between(this.$anchor,this.$head).getBookmark()}}s.prototype.visible=!0;class a{constructor(t,e){this.$from=t,this.$to=e}}let l=!1;function c(t){l||t.parent.inlineContent||(l=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class h extends s{constructor(t,e=t){c(t),c(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let n=t.resolve(e.map(this.head));if(!n.parent.inlineContent)return s.near(n);let r=t.resolve(e.map(this.anchor));return new h(r.parent.inlineContent?r:n,n)}replace(t,e=r.p2.empty){if(super.replace(t,e),e==r.p2.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof h&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new p(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new h(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){let r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}static between(t,e,n){let r=t.pos-e.pos;if((!n||r)&&(n=r>=0?1:-1),!e.parent.inlineContent){let t=s.findFrom(e,n,!0)||s.findFrom(e,-n,!0);if(!t)return s.near(e,n);e=t.$head}return t.parent.inlineContent||(0==r?t=e:(t=(s.findFrom(t,-n,!0)||s.findFrom(t,n,!0)).$anchor).pos<e.pos==r<0||(t=e)),new h(t,e)}}s.jsonID("text",h);class p{constructor(t,e){this.anchor=t,this.head=e}map(t){return new p(t.map(this.anchor),t.map(this.head))}resolve(t){return h.between(t.resolve(this.anchor),t.resolve(this.head))}}class u extends s{constructor(t){let e=t.nodeAfter;super(t,t.node(0).resolve(t.pos+e.nodeSize)),this.node=e}map(t,e){let{deleted:n,pos:r}=e.mapResult(this.anchor),i=t.resolve(r);return n?s.near(i):new u(i)}content(){return new r.p2(r.HY.from(this.node),0,0)}eq(t){return t instanceof u&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new d(this.anchor)}static fromJSON(t,e){if("number"!=typeof e.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new u(t.resolve(e.anchor))}static create(t,e){return new u(t.resolve(e))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}u.prototype.visible=!1,s.jsonID("node",u);class d{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:n}=t.mapResult(this.anchor);return e?new p(n,n):new d(n)}resolve(t){let e=t.resolve(this.anchor),n=e.nodeAfter;return n&&u.isSelectable(n)?new u(e):s.near(e)}}class f extends s{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=r.p2.empty){if(e==r.p2.empty){t.delete(0,t.doc.content.size);let e=s.atStart(t.doc);e.eq(t.selection)||t.setSelection(e)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new f(t)}map(t){return new f(t)}eq(t){return t instanceof f}getBookmark(){return m}}s.jsonID("all",f);let m={map(){return this},resolve:t=>new f(t)};function g(t,e,n,r,i,o=!1){if(e.inlineContent)return h.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let r=e.child(s);if(r.isAtom){if(!o&&u.isSelectable(r))return u.create(t,n-(i<0?r.nodeSize:0))}else{let e=g(t,r,n+i,i<0?r.childCount:0,i,o);if(e)return e}n+=r.nodeSize*i}return null}function y(t,e,n){let r,o=t.steps.length-1;if(o<e)return;let a=t.steps[o];(a instanceof i.Pu||a instanceof i.FC)&&(t.mapping.maps[o].forEach((t,e,n,i)=>{null==r&&(r=i)}),t.setSelection(s.near(t.doc.resolve(r),n)))}class k extends i.wx{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return r.vc.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.vc.none))),n.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,n){let r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(null==n&&(n=e),n=null==n?e:n,!t)return this.deleteRange(e,n);let i=this.storedMarks;if(!i){let t=this.doc.resolve(e);i=n==e?t.marks():t.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.setSelection(s.near(this.selection.$to)),this}}setMeta(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function v(t,e){return e&&t?t.bind(e):t}class x{constructor(t,e,n){this.name=t,this.init=v(e.init,n),this.apply=v(e.apply,n)}}let w=[new x("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new x("selection",{init:(t,e)=>t.selection||s.atStart(e.doc),apply:t=>t.selection}),new x("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,r)=>r.selection.$cursor?t.storedMarks:null}),new x("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class b{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=w.slice(),e&&e.forEach(t=>{if(this.pluginsByKey[t.key])throw RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new x(t.key,t.spec.state,t))})}}class S{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=e){let e=this.config.plugins[n];if(e.spec.filterTransaction&&!e.spec.filterTransaction.call(e,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let e=[t],n=this.applyInner(t),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,l=r?r[o].state:this,c=a<e.length&&s.spec.appendTransaction.call(s,a?e.slice(a):e,l,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",t),!r){r=[];for(let t=0;t<this.config.plugins.length;t++)r.push(t<o?{state:n,n:e.length}:{state:this,n:0})}e.push(c),n=n.applyInner(c),i=!0}r&&(r[o]={state:n,n:e.length})}}if(!i)return{state:n,transactions:e}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let e=new S(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];e[i.name]=i.apply(t,this[i.name],this,e)}return e}get tr(){return new k(this)}static create(t){let e=new b(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new S(e);for(let r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n}reconfigure(t){let e=new b(this.schema,t.plugins),n=e.fields,r=new S(e);for(let e=0;e<n.length;e++){let i=n[e].name;r[i]=this.hasOwnProperty(i)?this[i]:n[e].init(t,r)}return r}toJSON(t){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(t=>t.toJSON())),t&&"object"==typeof t)for(let n in t){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[n],i=r.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,n){if(!e)throw RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw RangeError("Required config field 'schema' missing");let i=new b(t.schema,t.plugins),o=new S(i);return i.fields.forEach(i=>{if("doc"==i.name)o.doc=r.NB.fromJSON(t.schema,e.doc);else if("selection"==i.name)o.selection=s.fromJSON(o.doc,e.selection);else if("storedMarks"==i.name)e.storedMarks&&(o.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(let r in n){let s=n[r],a=s.spec.state;if(s.key==i.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,r)){o[i.name]=a.fromJSON.call(s,t,e[r],o);return}}o[i.name]=i.init(t,o)}}),o}}class M{constructor(t){this.spec=t,this.props={},t.props&&function t(e,n,r){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=t(o,n,{})),r[i]=o}return r}(t.props,this,this.props),this.key=t.key?t.key.key:T("plugin")}getState(t){return t[this.key]}}let C=Object.create(null);function T(t){return t in C?t+"$"+ ++C[t]:(C[t]=0,t+"$")}class E{constructor(t="key"){this.key=T(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}},4536:function(t,e,n){"use strict";n.d(e,{Ax:function(){return w},FC:function(){return g},GJ:function(){return M},Mn:function(){return b},Pu:function(){return m},dR:function(){return T},k9:function(){return k},nd:function(){return v},nj:function(){return C},vs:function(){return s},wx:function(){return H}});var r=n(121);class i{constructor(t,e,n){this.pos=t,this.delInfo=e,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class o{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&o.empty)return o.empty}recover(t){let e=0,n=65535&t;if(!this.inverted)for(let t=0;t<n;t++)e+=this.ranges[3*t+2]-this.ranges[3*t+1];return this.ranges[3*n]+e+(t-(65535&t))/65536}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,n){let r=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let c=this.ranges[a+o],h=this.ranges[a+s],p=l+c;if(t<=p){let o=c?t==l?-1:t==p?1:e:e,s=l+r+(o<0?0:h);if(n)return s;let u=t==(e<0?l:p)?null:a/3+(t-l)*65536,d=t==l?2:t==p?1:4;return(e<0?t!=l:t!=p)&&(d|=8),new i(s,d,u)}r+=h-c}return n?t+r:new i(t+r,0,null)}touches(t,e){let n=0,r=65535&e,i=this.inverted?2:1,o=this.inverted?1:2;for(let e=0;e<this.ranges.length;e+=3){let s=this.ranges[e]-(this.inverted?n:0);if(s>t)break;let a=this.ranges[e+i];if(t<=s+a&&e==3*r)return!0;n+=this.ranges[e+o]-a}return!1}forEach(t){let e=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+e],c=this.ranges[r+n];t(s,s+l,a,a+c),i+=c-l}}invert(){return new o(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?o.empty:new o(t<0?[0,-t,0]:[0,0,t])}}o.empty=new o([]);class s{constructor(t=[],e,n=0,r=t.length){this.maps=t,this.mirror=e,this.from=n,this.to=r}slice(t=0,e=this.maps.length){return new s(this.maps,this.mirror,t,e)}copy(){return new s(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}appendMapping(t){for(let e=0,n=this.maps.length;e<t.maps.length;e++){let r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}getMirror(t){if(this.mirror){for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}invert(){let t=new s;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this.maps[n].mapResult(t,e);if(null!=i.recover){let e=this.getMirror(n);if(null!=e&&e>n&&e<this.to){n=e,t=this.maps[e].recover(i.recover);continue}}r|=i.delInfo,t=i.pos}return n?t:new i(t,r,null)}}let a=Object.create(null);class l{getMap(){return o.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=a[e.stepType];if(!n)throw RangeError(`No step type ${e.stepType} defined`);return n.fromJSON(t,e)}static jsonID(t,e){if(t in a)throw RangeError("Duplicate use of step JSON ID "+t);return a[t]=e,e.prototype.jsonID=t,e}}class c{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new c(t,null)}static fail(t){return new c(null,t)}static fromReplace(t,e,n,i){try{return c.ok(t.replace(e,n,i))}catch(t){if(t instanceof r.e4)return c.fail(t.message);throw t}}}function h(t,e,n){let i=[];for(let r=0;r<t.childCount;r++){let o=t.child(r);o.content.size&&(o=o.copy(h(o.content,e,o))),o.isInline&&(o=e(o,n,r)),i.push(o)}return r.HY.fromArray(i)}class p extends l{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=t.resolve(this.from),i=n.node(n.sharedDepth(this.to)),o=new r.p2(h(e.content,(t,e)=>t.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t,i),e.openStart,e.openEnd);return c.fromReplace(t,this.from,this.to,o)}invert(){return new u(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new p(e.pos,n.pos,this.mark)}merge(t){return t instanceof p&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new p(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new p(e.from,e.to,t.markFromJSON(e.mark))}}l.jsonID("addMark",p);class u extends l{constructor(t,e,n){super(),this.from=t,this.to=e,this.mark=n}apply(t){let e=t.slice(this.from,this.to),n=new r.p2(h(e.content,t=>t.mark(this.mark.removeFromSet(t.marks)),t),e.openStart,e.openEnd);return c.fromReplace(t,this.from,this.to,n)}invert(){return new p(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deleted&&n.deleted||e.pos>=n.pos?null:new u(e.pos,n.pos,this.mark)}merge(t){return t instanceof u&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new u(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new u(e.from,e.to,t.markFromJSON(e.mark))}}l.jsonID("removeMark",u);class d extends l{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return c.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return c.fromReplace(t,this.pos,this.pos+1,new r.p2(r.HY.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let n=0;n<e.marks.length;n++)if(!e.marks[n].isInSet(t))return new d(this.pos,e.marks[n]);return new d(this.pos,this.mark)}}return new f(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new d(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new d(e.pos,t.markFromJSON(e.mark))}}l.jsonID("addNodeMark",d);class f extends l{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return c.fail("No node at mark step's position");let n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return c.fromReplace(t,this.pos,this.pos+1,new r.p2(r.HY.from(n),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new d(this.pos,this.mark):this}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new f(e.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if("number"!=typeof e.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new f(e.pos,t.markFromJSON(e.mark))}}l.jsonID("removeNodeMark",f);class m extends l{constructor(t,e,n,r=!1){super(),this.from=t,this.to=e,this.slice=n,this.structure=r}apply(t){return this.structure&&y(t,this.from,this.to)?c.fail("Structure replace would overwrite content"):c.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new o([this.from,this.to-this.from,this.slice.size])}invert(t){return new m(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1);return e.deletedAcross&&n.deletedAcross?null:new m(e.pos,Math.max(e.pos,n.pos),this.slice)}merge(t){if(!(t instanceof m)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let e=this.slice.size+t.slice.size==0?r.p2.empty:new r.p2(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new m(t.from,this.to,e,this.structure)}}{let e=this.slice.size+t.slice.size==0?r.p2.empty:new r.p2(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new m(this.from,this.to+(t.to-t.from),e,this.structure)}}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new m(e.from,e.to,r.p2.fromJSON(t,e.slice),!!e.structure)}}l.jsonID("replace",m);class g extends l{constructor(t,e,n,r,i,o,s=!1){super(),this.from=t,this.to=e,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(t){if(this.structure&&(y(t,this.from,this.gapFrom)||y(t,this.gapTo,this.to)))return c.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return c.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,e.content);return n?c.fromReplace(t,this.from,this.to,n):c.fail("Content does not fit in gap")}getMap(){return new o([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new g(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),n=t.mapResult(this.to,-1),r=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return e.deletedAcross&&n.deletedAcross||r<e.pos||i>n.pos?null:new g(e.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new g(e.from,e.to,e.gapFrom,e.gapTo,r.p2.fromJSON(t,e.slice),e.insert,!!e.structure)}}function y(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let t=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,i--}}return!1}function k(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(i,o,e))return n;if(0==n||r.type.spec.isolating||!((0==i||r.canReplace(i,r.childCount))&&(o==r.childCount||r.canReplace(0,o))))break}return null}function v(t,e,n=null,r=t){let i=function(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}(t,e),o=i&&function(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let t=r;a&&t<i;t++)a=a.matchType(n.child(t).type);return a&&a.validEnd?s:null}(r,e);return o?i.map(x).concat({type:e,attrs:n}).concat(o.map(x)):null}function x(t){return{type:t,attrs:null}}function w(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let t=i.depth-1,e=n-2;t>o;t--,e--){let n=i.node(t),o=i.index(t);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=r&&r[e+1];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let l=r&&r[e]||n;if(!n.canReplace(o+1,n.childCount)||!l.type.validContent(s))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function b(t,e){let n=t.resolve(e),r=n.index();return S(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function S(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function M(t,e,n=-1){let r=t.resolve(e);for(let t=r.depth;;t--){let i,o,s=r.index(t);if(t==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(t+1),s++,o=r.node(t).maybeChild(s)):(i=r.node(t).maybeChild(s-1),o=r.node(t+1)),i&&!i.isTextblock&&S(i,o)&&r.node(t).canReplace(s,s+1))return e;if(0==t)break;e=n<0?r.before(t):r.after(t)}}function C(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let t=0;t<n.openStart;t++)i=i.firstChild.content;for(let t=1;t<=(0==n.openStart&&n.size?2:1);t++)for(let e=r.depth;e>=0;e--){let n=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,o=r.index(e)+(n>0?1:0),s=r.node(e),a=!1;if(1==t)a=s.canReplace(o,o,i);else{let t=s.contentMatchAt(o).findWrapping(i.firstChild.type);a=t&&s.canReplaceWith(o,o,t[0])}if(a)return 0==n?r.pos:n<0?r.before(e+1):r.after(e+1)}return null}function T(t,e,n=e,i=r.p2.empty){if(e==n&&!i.size)return null;let o=t.resolve(e),s=t.resolve(n);return E(o,s,i)?new m(e,n,i):new A(o,s,i).fit()}function E(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}l.jsonID("replaceAround",g);class A{constructor(t,e,n){this.$from=t,this.$to=e,this.unplaced=n,this.frontier=[],this.placed=r.HY.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=r.HY.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(t<0?this.$to:n.doc.resolve(t));if(!i)return null;let o=this.placed,s=n.depth,a=i.depth;for(;s&&a&&1==o.childCount;)o=o.firstChild.content,s--,a--;let l=new r.p2(o,s,a);return t>-1?new g(n.pos,t,this.$to.pos,this.$to.end(),l,e):l.size||n.pos!=this.$to.pos?new m(n.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<t;n++){let i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(let e=1;e<=2;e++)for(let n=1==e?t:this.unplaced.openStart;n>=0;n--){let t=null,i=(n?(t=I(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let o=this.depth;o>=0;o--){let{type:s,match:a}=this.frontier[o],l,c=null;if(1==e&&(i?a.matchType(i.type)||(c=a.fillBefore(r.HY.from(i),!1)):t&&s.compatibleContent(t.type)))return{sliceDepth:n,frontierDepth:o,parent:t,inject:c};if(2==e&&i&&(l=a.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:t,wrap:l};if(t&&a.matchType(t.type))break}}}openMore(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=I(t,e);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new r.p2(t,e+1,Math.max(n,i.size+e>=t.size-n?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:n}=this.unplaced,i=I(t,e);if(i.childCount<=1&&e>0){let o=t.size-e<=e+i.size;this.unplaced=new r.p2(O(t,e-1,1),e-1,o?e-1:n)}else this.unplaced=new r.p2(O(t,e,1),e,n)}placeNodes({sliceDepth:t,frontierDepth:e,parent:n,inject:i,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let t=0;t<o.length;t++)this.openFrontierNode(o[t]);let s=this.unplaced,a=n?n.content:s.content,l=s.openStart-t,c=0,h=[],{match:p,type:u}=this.frontier[e];if(i){for(let t=0;t<i.childCount;t++)h.push(i.child(t));p=p.matchFragment(i)}let d=a.size+t-(s.content.size-s.openEnd);for(;c<a.childCount;){let t=a.child(c),e=p.matchType(t.type);if(!e)break;(++c>1||0==l||t.content.size)&&(p=e,h.push(function t(e,n,i){if(n<=0)return e;let o=e.content;return n>1&&(o=o.replaceChild(0,t(o.firstChild,n-1,1==o.childCount?i-1:0))),n>0&&(o=e.type.contentMatch.fillBefore(o).append(o),i<=0&&(o=o.append(e.type.contentMatch.matchFragment(o).fillBefore(r.HY.empty,!0)))),e.copy(o)}(t.mark(u.allowedMarks(t.marks)),1==c?l:0,c==a.childCount?d:-1)))}let f=c==a.childCount;f||(d=-1),this.placed=N(this.placed,e,r.HY.from(h)),this.frontier[e].match=p,f&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=a;t<d;t++){let t=e.lastChild;this.frontier.push({type:t.type,match:t.contentMatchAt(t.childCount)}),e=t.content}this.unplaced=f?0==t?r.p2.empty:new r.p2(O(s.content,t-1,1),t-1,d<0?s.openEnd:t-1):new r.p2(O(s.content,t,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let t=this.frontier[this.depth],e;if(!t.type.isTextblock||!R(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return -1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(t){e:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:n,type:r}=this.frontier[e],i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),o=R(t,e,r,n,i);if(o){for(let n=e-1;n>=0;n--){let{match:e,type:r}=this.frontier[n],i=R(t,n,r,e,!0);if(!i||i.childCount)continue e}return{depth:e,fit:o,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=N(this.placed,e.depth,e.fit)),t=e.move;for(let n=e.depth+1;n<=t.depth;n++){let e=t.node(n),r=e.type.contentMatch.fillBefore(e.content,!0,t.index(n));this.openFrontierNode(e.type,e.attrs,r)}return t}openFrontierNode(t,e=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=N(this.placed,this.depth,r.HY.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(r.HY.empty,!0);t.childCount&&(this.placed=N(this.placed,this.frontier.length,t))}}function O(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(O(t.firstChild.content,e-1,n)))}function N(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(N(t.lastChild.content,e-1,n)))}function I(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function R(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function P(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let r=t.start(i);if(r<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(r==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==r-1)&&n.push(i)}return n}class z extends l{constructor(t,e,n){super(),this.pos=t,this.attr=e,this.value=n}apply(t){let e=t.nodeAt(this.pos);if(!e)return c.fail("No node at attribute step's position");let n=Object.create(null);for(let t in e.attrs)n[t]=e.attrs[t];n[this.attr]=this.value;let i=e.type.create(n,null,e.marks);return c.fromReplace(t,this.pos,this.pos+1,new r.p2(r.HY.from(i),0,e.isLeaf?0:1))}getMap(){return o.empty}invert(t){return new z(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new z(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new z(e.pos,e.attr,e.value)}}l.jsonID("attr",z);class L extends l{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let n in t.attrs)e[n]=t.attrs[n];e[this.attr]=this.value;let n=t.type.create(e,t.content,t.marks);return c.ok(n)}getMap(){return o.empty}invert(t){return new L(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if("string"!=typeof e.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new L(e.attr,e.value)}}l.jsonID("docAttr",L);let B=class extends Error{};(B=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n}).prototype=Object.create(Error.prototype),B.prototype.constructor=B,B.prototype.name="TransformError";class H{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new s}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new B(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,n=r.p2.empty){let i=T(this.doc,t,e,n);return i&&this.step(i),this}replaceWith(t,e,n){return this.replace(t,e,new r.p2(r.HY.from(n),0,0))}delete(t,e){return this.replace(t,e,r.p2.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,n){return!function(t,e,n,i){if(!i.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(E(o,s,i))return t.step(new m(e,n,i));let a=P(o,t.doc.resolve(n));0==a[a.length-1]&&a.pop();let l=-(o.depth+1);a.unshift(l);for(let t=o.depth,e=o.pos-1;t>0;t--,e--){let n=o.node(t).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;a.indexOf(t)>-1?l=t:o.before(t)==e&&a.splice(1,0,-t)}let c=a.indexOf(l),h=[],p=i.openStart;for(let t=i.content,e=0;;e++){let n=t.firstChild;if(h.push(n),e==i.openStart)break;t=n.content}for(let t=p-1;t>=0;t--){var u;let e=h[t],n=(u=e.type).spec.defining||u.spec.definingForContent;if(n&&!e.sameMarkup(o.node(Math.abs(l)-1)))p=t;else if(n||!e.type.isTextblock)break}for(let e=i.openStart;e>=0;e--){let l=(e+p+1)%(i.openStart+1),u=h[l];if(u)for(let e=0;e<a.length;e++){let h=a[(e+c)%a.length],p=!0;h<0&&(p=!1,h=-h);let d=o.node(h-1),f=o.index(h-1);if(d.canReplaceWith(f,f,u.type,u.marks))return t.replace(o.before(h),p?s.after(h):n,new r.p2(function t(e,n,i,o,s){if(n<i){let r=e.firstChild;e=e.replaceChild(0,r.copy(t(r.content,n+1,i,o,r)))}if(n>o){let t=s.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.HY.empty,!0))}return e}(i.content,0,i.openStart,l),l,i.openEnd))}}let d=t.steps.length;for(let r=a.length-1;r>=0&&(t.replace(e,n,i),!(t.steps.length>d));r--){let t=a[r];t<0||(e=o.before(t),n=s.after(t))}}(this,t,e,n),this}replaceRangeWith(t,e,n){return!function(t,e,n,i){if(!i.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let r=function(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(let t=r.depth-1;t>=0;t--){let e=r.index(t);if(r.node(t).canReplaceWith(e,e,n))return r.before(t+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let t=r.depth-1;t>=0;t--){let e=r.indexAfter(t);if(r.node(t).canReplaceWith(e,e,n))return r.after(t+1);if(e<r.node(t).childCount)break}return null}(t.doc,e,i.type);null!=r&&(e=n=r)}t.replaceRange(e,n,new r.p2(r.HY.from(i),0,0))}(this,t,e,n),this}deleteRange(t,e){return!function(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=P(r,i);for(let e=0;e<o.length;e++){let n=o[e],s=e==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return t.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return t.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o)return t.delete(r.before(o),n);t.delete(e,n)}(this,t,e),this}lift(t,e){return!function(t,e,n){let{$from:i,$to:o,depth:s}=e,a=i.before(s+1),l=o.after(s+1),c=a,h=l,p=r.HY.empty,u=0;for(let t=s,e=!1;t>n;t--)e||i.index(t)>0?(e=!0,p=r.HY.from(i.node(t).copy(p)),u++):c--;let d=r.HY.empty,f=0;for(let t=s,e=!1;t>n;t--)e||o.after(t+1)<o.end(t)?(e=!0,d=r.HY.from(o.node(t).copy(d)),f++):h++;t.step(new g(c,h,a,l,new r.p2(p.append(d),u,f),p.size-u,!0))}(this,t,e),this}join(t,e=1){return!function(t,e,n){let i=new m(e-n,e+n,r.p2.empty,!0);t.step(i)}(this,t,e),this}wrap(t,e){return!function(t,e,n){let i=r.HY.empty;for(let t=n.length-1;t>=0;t--){if(i.size){let e=n[t].type.contentMatch.matchFragment(i);if(!e||!e.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.HY.from(n[t].type.create(n[t].attrs,i))}let o=e.start,s=e.end;t.step(new g(o,s,o,s,new r.p2(i,0,0),n.length,!0))}(this,t,e),this}setBlockType(t,e=t,n,i=null){return!function(t,e,n,i,o){if(!i.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(e,n)=>{var a,l;let c,h;if(e.isTextblock&&!e.hasMarkup(i,o)&&(a=t.doc,l=t.mapping.slice(s).map(n),h=(c=a.resolve(l)).index(),c.parent.canReplaceWith(h,h+1,i))){t.clearIncompatible(t.mapping.slice(s).map(n,1),i);let a=t.mapping.slice(s),l=a.map(n,1),c=a.map(n+e.nodeSize,1);return t.step(new g(l,c,l+1,c-1,new r.p2(r.HY.from(i.create(o,null,e.marks)),0,0),1,!0)),!1}})}(this,t,e,n,i),this}setNodeMarkup(t,e,n=null,i){return!function(t,e,n,i,o){let s=t.doc.nodeAt(e);if(!s)throw RangeError("No node at given position");n||(n=s.type);let a=n.create(i,null,o||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,a);if(!n.validContent(s.content))throw RangeError("Invalid content for node type "+n.name);t.step(new g(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new r.p2(r.HY.from(a),0,0),1,!0))}(this,t,e,n,i),this}setNodeAttribute(t,e,n){return this.step(new z(t,e,n)),this}setDocAttribute(t,e){return this.step(new L(t,e)),this}addNodeMark(t,e){return this.step(new d(t,e)),this}removeNodeMark(t,e){if(!(e instanceof r.vc)){let n=this.doc.nodeAt(t);if(!n)throw RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new f(t,e)),this}split(t,e=1,n){return!function(t,e,n=1,i){let o=t.doc.resolve(e),s=r.HY.empty,a=r.HY.empty;for(let t=o.depth,e=o.depth-n,l=n-1;t>e;t--,l--){s=r.HY.from(o.node(t).copy(s));let e=i&&i[l];a=r.HY.from(e?e.type.create(e.attrs,a):o.node(t).copy(a))}t.step(new m(e,e,new r.p2(s.append(a),n,n),!0))}(this,t,e,n),this}addMark(t,e,n){var r;let i,o,s,a;return r=this,s=[],a=[],r.doc.nodesBetween(t,e,(r,l,c)=>{if(!r.isInline)return;let h=r.marks;if(!n.isInSet(h)&&c.type.allowsMarkType(n.type)){let c=Math.max(l,t),d=Math.min(l+r.nodeSize,e),f=n.addToSet(h);for(let t=0;t<h.length;t++)h[t].isInSet(f)||(i&&i.to==c&&i.mark.eq(h[t])?i.to=d:s.push(i=new u(c,d,h[t])));o&&o.to==c?o.to=d:a.push(o=new p(c,d,n))}}),s.forEach(t=>r.step(t)),a.forEach(t=>r.step(t)),this}removeMark(t,e,n){var i;let o,s;return i=this,o=[],s=0,i.doc.nodesBetween(t,e,(i,a)=>{if(!i.isInline)return;s++;let l=null;if(n instanceof r.ZU){let t=i.marks,e;for(;e=n.isInSet(t);)(l||(l=[])).push(e),t=e.removeFromSet(t)}else n?n.isInSet(i.marks)&&(l=[n]):l=i.marks;if(l&&l.length){let n=Math.min(a+i.nodeSize,e);for(let e=0;e<l.length;e++){let r=l[e],i;for(let t=0;t<o.length;t++){let e=o[t];e.step==s-1&&r.eq(o[t].style)&&(i=e)}i?(i.to=n,i.step=s):o.push({style:r,from:Math.max(a,t),to:n,step:s})}}}),o.forEach(t=>i.step(new u(t.from,t.to,t.style))),this}clearIncompatible(t,e,n){return!function(t,e,n,i=n.contentMatch){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let e=0;e<o.childCount;e++){let l=o.child(e),c=a+l.nodeSize,h=i.matchType(l.type);if(h){i=h;for(let e=0;e<l.marks.length;e++)n.allowsMarkType(l.marks[e].type)||t.step(new u(a,c,l.marks[e]));if(l.isText&&!n.spec.code){let t,e=/\r?\n|\r/g,i;for(;t=e.exec(l.text);)i||(i=new r.p2(r.HY.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),s.push(new m(a+t.index,a+t.index+t[0].length,i))}}else s.push(new m(a,c,r.p2.empty));a=c}if(!i.validEnd){let e=i.fillBefore(r.HY.empty,!0);t.replace(a,a,new r.p2(e,0,0))}for(let e=s.length-1;e>=0;e--)t.step(s[e])}(this,t,e,n),this}}}}]);