var nc=Object.defineProperty,oc=Object.defineProperties;var ic=Object.getOwnPropertyDescriptors;var Mr=Object.getOwnPropertySymbols;var Ko=Object.prototype.hasOwnProperty,$o=Object.prototype.propertyIsEnumerable;var Uo=(e,t,r)=>t in e?nc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,S=(e,t)=>{for(var r in t||(t={}))Ko.call(t,r)&&Uo(e,r,t[r]);if(Mr)for(var r of Mr(t))$o.call(t,r)&&Uo(e,r,t[r]);return e},Tt=(e,t)=>oc(e,ic(t));var Go=(e,t)=>{var r={};for(var n in e)Ko.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Mr)for(var n of Mr(e))t.indexOf(n)<0&&$o.call(e,n)&&(r[n]=e[n]);return r};import{bf as sc,a8 as ac,bg as $e,B as xr,D as sn,b1 as Cr,E as ye,bh as cc,a7 as lc,be as uc,u as fc,al as pc,a0 as dc,bi as hc,bj as mc,o as gt,e as Mt,h as A,ai as vc,bk as gc,bl as yc,bm as bc,b6 as kc,C as Sc,aS as Mc,r as Q,l as xc,w as an,f as V,m as L,j as Cc}from"./vendor.d12b5734.js";import{_ as At}from"./main.465728e1.js";function ft(e){this.content=e}ft.prototype={constructor:ft,find:function(e){for(var t=0;t>1}};ft.from=function(e){if(e instanceof ft)return e;var t=[];if(e)for(var r in e)t.push(r,e[r]);return new ft(t)};var Yo=ft;function Xo(e,t,r){for(var n=0;;n++){if(n==e.childCount||n==t.childCount)return e.childCount==t.childCount?null:r;var o=e.child(n),i=t.child(n);if(o==i){r+=o.nodeSize;continue}if(!o.sameMarkup(i))return r;if(o.isText&&o.text!=i.text){for(var s=0;o.text[s]==i.text[s];s++)r++;return r}if(o.content.size||i.content.size){var a=Xo(o.content,i.content,r+1);if(a!=null)return a}r+=o.nodeSize}}function Qo(e,t,r,n){for(var o=e.childCount,i=t.childCount;;){if(o==0||i==0)return o==i?null:{a:r,b:n};var s=e.child(--o),a=t.child(--i),c=s.nodeSize;if(s==a){r-=c,n-=c;continue}if(!s.sameMarkup(a))return{a:r,b:n};if(s.isText&&s.text!=a.text){for(var l=0,u=Math.min(s.text.length,a.text.length);lt&&n(c,o+a,i,s)!==!1&&c.content.size){var u=a+1;c.nodesBetween(Math.max(0,t-u),Math.min(c.content.size,r-u),n,o+u)}a=l}};k.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)};k.prototype.textBetween=function(t,r,n,o){var i="",s=!0;return this.nodesBetween(t,r,function(a,c){a.isText?(i+=a.text.slice(Math.max(t,c)-c,r-c),s=!n):a.isLeaf&&o?(i+=o,s=!n):!s&&a.isBlock&&(i+=n,s=!0)},0),i};k.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var r=this.lastChild,n=t.firstChild,o=this.content.slice(),i=0;for(r.isText&&r.sameMarkup(n)&&(o[o.length-1]=r.withText(r.text+n.text),i=1);it)for(var i=0,s=0;st&&((sr)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,r-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,r-s-1))),n.push(a),o+=a.nodeSize),s=c}return new k(n,o)};k.prototype.cutByIndex=function(t,r){return t==r?k.empty:t==0&&r==this.content.length?this:new k(this.content.slice(t,r))};k.prototype.replaceChild=function(t,r){var n=this.content[t];if(n==r)return this;var o=this.content.slice(),i=this.size+r.nodeSize-n.nodeSize;return o[t]=r,new k(o,i)};k.prototype.addToStart=function(t){return new k([t].concat(this.content),this.size+t.nodeSize)};k.prototype.addToEnd=function(t){return new k(this.content.concat(t),this.size+t.nodeSize)};k.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var r=0;rthis.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var n=0,o=0;;n++){var i=this.child(n),s=o+i.nodeSize;if(s>=t)return s==t||r>0?wr(n+1,s):wr(n,o);o=s}};k.prototype.toString=function(){return"<"+this.toStringInner()+">"};k.prototype.toStringInner=function(){return this.content.join(", ")};k.prototype.toJSON=function(){return this.content.length?this.content.map(function(t){return t.toJSON()}):null};k.fromJSON=function(t,r){if(!r)return k.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new k(r.map(t.nodeFromJSON))};k.fromArray=function(t){if(!t.length)return k.empty;for(var r,n=0,o=0;othis.type.rank&&(r||(r=t.slice(0,o)),r.push(this),n=!0),r&&r.push(i)}}return r||(r=t.slice()),n||r.push(this),r};P.prototype.removeFromSet=function(t){for(var r=0;r0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t};C.fromJSON=function(t,r){if(!r)return C.empty;var n=r.openStart||0,o=r.openEnd||0;if(typeof n!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new C(k.fromJSON(t,r.content),n,o)};C.maxOpen=function(t,r){r===void 0&&(r=!0);for(var n=0,o=0,i=t.firstChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.firstChild)n++;for(var s=t.lastChild;s&&!s.isLeaf&&(r||!s.type.spec.isolating);s=s.lastChild)o++;return new C(t,n,o)};Object.defineProperties(C.prototype,Zo);function ti(e,t,r){var n=e.findIndex(t),o=n.index,i=n.offset,s=e.maybeChild(o),a=e.findIndex(r),c=a.index,l=a.offset;if(i==t||s.isText){if(l!=r&&!e.child(c).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(r))}if(o!=c)throw new RangeError("Removing non-flat range");return e.replaceChild(o,s.copy(ti(s.content,t-i-1,r-i-1)))}function ei(e,t,r,n){var o=e.findIndex(t),i=o.index,s=o.offset,a=e.maybeChild(i);if(s==t||a.isText)return n&&!n.canReplace(i,i,r)?null:e.cut(0,t).append(r).append(e.cut(t));var c=ei(a.content,t-s-1,r);return c&&e.replaceChild(i,a.copy(c))}C.empty=new C(k.empty,0,0);function Oc(e,t,r){if(r.openStart>e.depth)throw new Jt("Inserted content deeper than insertion position");if(e.depth-r.openStart!=t.depth-r.openEnd)throw new Jt("Inconsistent open depths");return ri(e,t,r,0)}function ri(e,t,r,n){var o=e.index(n),i=e.node(n);if(o==t.index(n)&&n=0&&e.isText&&e.sameMarkup(t[r])?t[r]=e.withText(t[r].text+e.text):t.push(e)}function Ue(e,t,r,n){var o=(t||e).node(r),i=0,s=t?t.index(r):o.childCount;e&&(i=e.index(r),e.depth>r?i++:e.textOffset&&(be(e.nodeAfter,n),i++));for(var a=i;ao&&ln(e,t,o+1),s=n.depth>o&&ln(r,n,o+1),a=[];return Ue(null,e,o,a),i&&s&&t.index(o)==r.index(o)?(ni(i,s),be(ke(i,oi(e,t,r,n,o+1)),a)):(i&&be(ke(i,Ar(e,t,o+1)),a),Ue(t,r,o,a),s&&be(ke(s,Ar(r,n,o+1)),a)),Ue(n,null,o,a),new k(a)}function Ar(e,t,r){var n=[];if(Ue(null,e,r,n),e.depth>r){var o=ln(e,t,r+1);be(ke(o,Ar(e,t,r+1)),n)}return Ue(t,null,r,n),new k(n)}function wc(e,t){for(var r=t.depth-e.openStart,n=t.node(r),o=n.copy(e.content),i=r-1;i>=0;i--)o=t.node(i).copy(k.from(o));return{start:o.resolveNoCache(e.openStart+r),end:o.resolveNoCache(o.content.size-e.openEnd-r)}}var $=function(t,r,n){this.pos=t,this.path=r,this.depth=r.length/3-1,this.parentOffset=n},De={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};$.prototype.resolveDepth=function(t){return t==null?this.depth:t<0?this.depth+t:t};De.parent.get=function(){return this.node(this.depth)};De.doc.get=function(){return this.node(0)};$.prototype.node=function(t){return this.path[this.resolveDepth(t)*3]};$.prototype.index=function(t){return this.path[this.resolveDepth(t)*3+1]};$.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)};$.prototype.start=function(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1};$.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size};$.prototype.before=function(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]};$.prototype.after=function(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize};De.textOffset.get=function(){return this.pos-this.path[this.path.length-1]};De.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var r=this.pos-this.path[this.path.length-1],n=e.child(t);return r?e.child(t).cut(r):n};De.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)};$.prototype.posAtIndex=function(t,r){r=this.resolveDepth(r);for(var n=this.path[r*3],o=r==0?0:this.path[r*3-1]+1,i=0;i0;r--)if(this.start(r)<=t&&this.end(r)>=t)return r;return 0};$.prototype.blockRange=function(t,r){if(t===void 0&&(t=this),t.pos=0;n--)if(t.pos<=this.end(n)&&(!r||r(this.node(n))))return new Ge(this,t,n)};$.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset};$.prototype.max=function(t){return t.pos>this.pos?t:this};$.prototype.min=function(t){return t.pos=0&&r<=t.content.size))throw new RangeError("Position "+r+" out of range");for(var n=[],o=0,i=r,s=t;;){var a=s.content.findIndex(i),c=a.index,l=a.offset,u=i-l;if(n.push(s,c,o+l),!u||(s=s.child(c),s.isText))break;i=u-1,o+=l+1}return new $(r,n,i)};$.resolveCached=function(t,r){for(var n=0;nt&&this.nodesBetween(t,r,function(i){return n.isInSet(i.marks)&&(o=!0),!o}),o};_t.isBlock.get=function(){return this.type.isBlock};_t.isTextblock.get=function(){return this.type.isTextblock};_t.inlineContent.get=function(){return this.type.inlineContent};_t.isInline.get=function(){return this.type.isInline};_t.isText.get=function(){return this.type.isText};_t.isLeaf.get=function(){return this.type.isLeaf};_t.isAtom.get=function(){return this.type.isAtom};B.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),ii(this.marks,t)};B.prototype.contentMatchAt=function(t){var r=this.type.contentMatch.matchFragment(this.content,0,t);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r};B.prototype.canReplace=function(t,r,n,o,i){n===void 0&&(n=k.empty),o===void 0&&(o=0),i===void 0&&(i=n.childCount);var s=this.contentMatchAt(t).matchFragment(n,o,i),a=s&&s.matchFragment(this.content,r);if(!a||!a.validEnd)return!1;for(var c=o;c=0;r--)t=e[r].type.name+"("+t+")";return t}var pt=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},_r={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};pt.parse=function(t,r){var n=new Nr(t,r);if(n.next==null)return pt.empty;var o=ai(n);n.next&&n.err("Unexpected trailing text");var i=Bc(Pc(o));return zc(i,n),i};pt.prototype.matchType=function(t){for(var r=0;r>1};pt.prototype.edge=function(t){var r=t<<1;if(r>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[r],next:this.next[r+1]}};pt.prototype.toString=function(){var t=[];function r(n){t.push(n);for(var o=1;o"+t.indexOf(n.next[s+1]);return i}).join(` `)};Object.defineProperties(pt.prototype,_r);pt.empty=new pt(!0);var Nr=function(t,r){this.string=t,this.nodeTypes=r,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()},si={next:{configurable:!0}};si.next.get=function(){return this.tokens[this.pos]};Nr.prototype.eat=function(t){return this.next==t&&(this.pos++||!0)};Nr.prototype.err=function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")};Object.defineProperties(Nr.prototype,si);function ai(e){var t=[];do t.push(Nc(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function Nc(e){var t=[];do t.push(Ec(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function Ec(e){for(var t=Rc(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=Dc(e,t);else break;return t}function ci(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function Dc(e,t){var r=ci(e),n=r;return e.eat(",")&&(e.next!="}"?n=ci(e):n=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:t}}function Ic(e,t){var r=e.nodeTypes,n=r[t];if(n)return[n];var o=[];for(var i in r){var s=r[i];s.groups.indexOf(t)>-1&&o.push(s)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function Rc(e){if(e.eat("(")){var t=ai(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{var r=Ic(e,e.next).map(function(n){return e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}});return e.pos++,r.length==1?r[0]:{type:"choice",exprs:r}}}function Pc(e){var t=[[]];return o(i(e,0),r()),t;function r(){return t.push([])-1}function n(s,a,c){var l={term:c,to:a};return t[s].push(l),l}function o(s,a){s.forEach(function(c){return c.to=a})}function i(s,a){if(s.type=="choice")return s.exprs.reduce(function(M,y){return M.concat(i(y,a))},[]);if(s.type=="seq")for(var c=0;;c++){var l=i(s.exprs[c],a);if(c==s.exprs.length-1)return l;o(l,a=r())}else if(s.type=="star"){var u=r();return n(a,u),o(i(s.expr,u),u),[n(u)]}else if(s.type=="plus"){var f=r();return o(i(s.expr,a),f),o(i(s.expr,f),f),[n(f)]}else{if(s.type=="opt")return[n(a)].concat(i(s.expr,a));if(s.type=="range"){for(var p=a,d=0;d-1&&o[p+1];ui(e,f).forEach(function(h){d||o.push(u,d=[]),d.indexOf(h)==-1&&d.push(h)})}})});for(var i=t[n.join(",")]=new pt(n.indexOf(e.length-1)>-1),s=0;s-1};yt.prototype.allowsMarks=function(t){if(this.markSet==null)return!0;for(var r=0;r-1};var Se=function(t){this.spec={};for(var r in t)this.spec[r]=t[r];this.spec.nodes=Yo.from(t.nodes),this.spec.marks=Yo.from(t.marks),this.nodes=yt.compile(this.spec.nodes,this),this.marks=ie.compile(this.spec.marks,this);var n=Object.create(null);for(var o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");var i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=pt.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?vi(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(var c in this.marks){var l=this.marks[c],u=l.spec.excludes;l.excluded=u==null?[l]:u==""?[]:vi(this,u.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};Se.prototype.node=function(t,r,n,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof yt){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(r,n,o)};Se.prototype.text=function(t,r){var n=this.nodes.text;return new _c(n,n.defaultAttrs,t,P.setFrom(r))};Se.prototype.mark=function(t,r){return typeof t=="string"&&(t=this.marks[t]),t.create(r)};Se.prototype.nodeFromJSON=function(t){return B.fromJSON(this,t)};Se.prototype.markFromJSON=function(t){return P.fromJSON(this,t)};Se.prototype.nodeType=function(t){var r=this.nodes[t];if(!r)throw new RangeError("Unknown node type: "+t);return r};function vi(e,t){for(var r=[],n=0;n-1)&&r.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[n]+"'")}return r}var Lt=function(t,r){var n=this;this.schema=t,this.rules=r,this.tags=[],this.styles=[],r.forEach(function(o){o.tag?n.tags.push(o):o.style&&n.styles.push(o)}),this.normalizeLists=!this.tags.some(function(o){if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;var i=t.nodes[o.node];return i.contentMatch.matchType(i)})};Lt.prototype.parse=function(t,r){r===void 0&&(r={});var n=new K(this,r,!1);return n.addAll(t,null,r.from,r.to),n.finish()};Lt.prototype.parseSlice=function(t,r){r===void 0&&(r={});var n=new K(this,r,!0);return n.addAll(t,null,r.from,r.to),C.maxOpen(n.finish())};Lt.prototype.matchTag=function(t,r,n){for(var o=n?this.tags.indexOf(n)+1:0;ot.length&&(s.style.charCodeAt(t.length)!=61||s.style.slice(t.length+1)!=r))){if(s.getAttrs){var a=s.getAttrs(r);if(a===!1)continue;s.attrs=a}return s}}};Lt.schemaRules=function(t){var r=[];function n(c){for(var l=c.priority==null?50:c.priority,u=0;u=0;r--)if(t.eq(this.stashMarks[r]))return this.stashMarks.splice(r,1)[0]};Zt.prototype.applyPending=function(t){for(var r=0,n=this.pendingMarks;r=0;o--){var i=this.nodes[o],s=i.findWrapping(t);if(s&&(!r||r.length>s.length)&&(r=s,n=i,!s.length)||i.solid)break}if(!r)return!1;this.sync(n);for(var a=0;athis.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(t));this.nodes.length=this.open+1}};K.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)};K.prototype.sync=function(t){for(var r=this.open;r>=0;r--)if(this.nodes[r]==t){this.open=r;return}};mn.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var r=this.nodes[t].content,n=r.length-1;n>=0;n--)e+=r[n].nodeSize;t&&e++}return e};K.prototype.findAtPoint=function(t,r){if(this.find)for(var n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),o=this.options.context,i=!this.isOpen&&(!o||o.parent.type==this.nodes[0].type),s=-(o?o.depth+1:0)+(i?0:1),a=function(c,l){for(;c>=0;c--){var u=n[c];if(u==""){if(c==n.length-1||c==0)continue;for(;l>=s;l--)if(a(c-1,l))return!0;return!1}else{var f=l>0||l==0&&i?r.nodes[l].type:o&&l>=s?o.node(l-s).type:null;if(!f||f.name!=u&&f.groups.indexOf(u)==-1)return!1;l--}}return!0};return a(n.length-1,this.open)};K.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var r=t.depth;r>=0;r--){var n=t.node(r).contentMatchAt(t.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var o in this.parser.schema.nodes){var i=this.parser.schema.nodes[o];if(i.isTextblock&&i.defaultAttrs)return i}};K.prototype.addPendingMark=function(t){var r=qc(t,this.top.pendingMarks);r&&this.top.stashMarks.push(r),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)};K.prototype.removePendingMark=function(t,r){for(var n=this.open;n>=0;n--){var o=this.nodes[n],i=o.pendingMarks.lastIndexOf(t);if(i>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);var s=o.popFromStashMark(t);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==r)break}};Object.defineProperties(K.prototype,mn);function Fc(e){for(var t=e.firstChild,r=null;t;t=t.nextSibling){var n=t.nodeType==1?t.nodeName.toLowerCase():null;n&&gi.hasOwnProperty(n)&&r?(r.appendChild(t),t=r):n=="li"?r=t:n&&(r=null)}}function Vc(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Hc(e){for(var t=/\s*([\w-]+)\s*:\s*([^;]+)/g,r,n=[];r=t.exec(e);)n.push(r[1],r[2].trim());return n}function bi(e){var t={};for(var r in e)t[r]=e[r];return t}function jc(e,t){var r=t.schema.nodes,n=function(s){var a=r[s];if(!!a.allowsMarkType(e)){var c=[],l=function(u){c.push(u);for(var f=0;f=0;o--){var i=this.serializeMark(t.marks[o],t.isInline,r);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n};ot.prototype.serializeMark=function(t,r,n){n===void 0&&(n={});var o=this.marks[t.type.name];return o&&ot.renderSpec(vn(n),o(t,r))};ot.renderSpec=function(t,r,n){if(n===void 0&&(n=null),typeof r=="string")return{dom:t.createTextNode(r)};if(r.nodeType!=null)return{dom:r};if(r.dom&&r.dom.nodeType!=null)return r;var o=r[0],i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));var s=null,a=n?t.createElementNS(n,o):t.createElement(o),c=r[1],l=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){l=2;for(var u in c)if(c[u]!=null){var f=u.indexOf(" ");f>0?a.setAttributeNS(u.slice(0,f),u.slice(f+1),c[u]):a.setAttribute(u,c[u])}}for(var p=l;pl)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{var h=ot.renderSpec(t,d,n),v=h.dom,g=h.contentDOM;if(a.appendChild(v),g){if(s)throw new RangeError("Multiple content holes");s=g}}}return{dom:a,contentDOM:s}};ot.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new ot(this.nodesFromSchema(t),this.marksFromSchema(t)))};ot.nodesFromSchema=function(t){var r=ki(t.nodes);return r.text||(r.text=function(n){return n.text}),r};ot.marksFromSchema=function(t){return ki(t.marks)};function ki(e){var t={};for(var r in e){var n=e[r].spec.toDOM;n&&(t[r]=n)}return t}function vn(e){return e.document||window.document}var Si=65535,Mi=Math.pow(2,16);function Jc(e,t){return e+t*Mi}function xi(e){return e&Si}function Wc(e){return(e-(e&Si))/Mi}var gn=function(t,r,n){r===void 0&&(r=!1),n===void 0&&(n=null),this.pos=t,this.deleted=r,this.recover=n},it=function(t,r){r===void 0&&(r=!1),this.ranges=t,this.inverted=r};it.prototype.recover=function(t){var r=0,n=xi(t);if(!this.inverted)for(var o=0;ot)break;var l=this.ranges[a+i],u=this.ranges[a+s],f=c+l;if(t<=f){var p=l?t==c?-1:t==f?1:r:r,d=c+o+(p<0?0:u);if(n)return d;var h=t==(r<0?c:f)?null:Jc(a/3,t-c);return new gn(d,r<0?t!=c:t!=f,h)}o+=u-l}return n?t+o:new gn(t+o)};it.prototype.touches=function(t,r){for(var n=0,o=xi(r),i=this.inverted?2:1,s=this.inverted?1:2,a=0;at)break;var l=this.ranges[a+i],u=c+l;if(t<=u&&a==o*3)return!0;n+=this.ranges[a+s]-l}return!1};it.prototype.forEach=function(t){for(var r=this.inverted?2:1,n=this.inverted?1:2,o=0,i=0;o=0;r--){var o=t.getMirror(r);this.appendMap(t.maps[r].invert(),o!=null&&o>r?n-o-1:null)}};dt.prototype.invert=function(){var t=new dt;return t.appendMappingInverted(this),t};dt.prototype.map=function(t,r){if(r===void 0&&(r=1),this.mirror)return this._map(t,r,!0);for(var n=this.from;ni&&c0};X.prototype.addStep=function(t,r){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=r};Object.defineProperties(X.prototype,yn);function Er(){throw new Error("Override me")}var bn=Object.create(null),ht=function(){};ht.prototype.apply=function(t){return Er()};ht.prototype.getMap=function(){return it.empty};ht.prototype.invert=function(t){return Er()};ht.prototype.map=function(t){return Er()};ht.prototype.merge=function(t){return null};ht.prototype.toJSON=function(){return Er()};ht.fromJSON=function(t,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=bn[r.stepType];if(!n)throw new RangeError("No step type "+r.stepType+" defined");return n.fromJSON(t,r)};ht.jsonID=function(t,r){if(t in bn)throw new RangeError("Duplicate use of step JSON ID "+t);return bn[t]=r,r.prototype.jsonID=t,r};var bt=function(t,r){this.doc=t,this.failed=r};bt.ok=function(t){return new bt(t,null)};bt.fail=function(t){return new bt(null,t)};bt.fromReplace=function(t,r,n,o){try{return bt.ok(t.replace(r,n,o))}catch(i){if(i instanceof Jt)return bt.fail(i.message);throw i}};var te=function(e){function t(r,n,o,i){e.call(this),this.from=r,this.to=n,this.slice=o,this.structure=!!i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(n){return this.structure&&kn(n,this.from,this.to)?bt.fail("Structure replace would overwrite content"):bt.fromReplace(n,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new it([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(n){return new t(this.from,this.from+this.slice.size,n.slice(this.from,this.to))},t.prototype.map=function(n){var o=n.mapResult(this.from,1),i=n.mapResult(this.to,-1);return o.deleted&&i.deleted?null:new t(o.pos,Math.max(o.pos,i.pos),this.slice)},t.prototype.merge=function(n){if(!(n instanceof t)||n.structure||this.structure)return null;if(this.from+this.slice.size==n.from&&!this.slice.openEnd&&!n.slice.openStart){var o=this.slice.size+n.slice.size==0?C.empty:new C(this.slice.content.append(n.slice.content),this.slice.openStart,n.slice.openEnd);return new t(this.from,this.to+(n.to-n.from),o,this.structure)}else if(n.to==this.from&&!this.slice.openStart&&!n.slice.openEnd){var i=this.slice.size+n.slice.size==0?C.empty:new C(n.slice.content.append(this.slice.content),n.slice.openStart,this.slice.openEnd);return new t(n.from,this.to,i,this.structure)}else return null},t.prototype.toJSON=function(){var n={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n},t.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(o.from,o.to,C.fromJSON(n,o.slice),!!o.structure)},t}(ht);ht.jsonID("replace",te);var xt=function(e){function t(r,n,o,i,s,a,c){e.call(this),this.from=r,this.to=n,this.gapFrom=o,this.gapTo=i,this.slice=s,this.insert=a,this.structure=!!c}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(n){if(this.structure&&(kn(n,this.from,this.gapFrom)||kn(n,this.gapTo,this.to)))return bt.fail("Structure gap-replace would overwrite content");var o=n.slice(this.gapFrom,this.gapTo);if(o.openStart||o.openEnd)return bt.fail("Gap is not a flat range");var i=this.slice.insertAt(this.insert,o.content);return i?bt.fromReplace(n,this.from,this.to,i):bt.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new it([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(n){var o=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+o,this.from+this.insert,this.from+this.insert+o,n.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(n){var o=n.mapResult(this.from,1),i=n.mapResult(this.to,-1),s=n.map(this.gapFrom,-1),a=n.map(this.gapTo,1);return o.deleted&&i.deleted||si.pos?null:new t(o.pos,i.pos,s,a,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var n={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n},t.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number"||typeof o.gapFrom!="number"||typeof o.gapTo!="number"||typeof o.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new t(o.from,o.to,o.gapFrom,o.gapTo,C.fromJSON(n,o.slice),o.insert,!!o.structure)},t}(ht);ht.jsonID("replaceAround",xt);function kn(e,t,r){for(var n=e.resolve(t),o=r-t,i=n.depth;o>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,o--;if(o>0)for(var s=n.node(i).maybeChild(n.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function Kc(e,t,r){return(t==0||e.canReplace(t,e.childCount))&&(r==e.childCount||e.canReplace(0,r))}function Pe(e){for(var t=e.parent,r=t.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var o=e.$from.node(n),i=e.$from.index(n),s=e.$to.indexAfter(n);if(nt;f--)p||r.index(f)>0?(p=!0,l=k.from(r.node(f).copy(l)),u++):a--;for(var d=k.empty,h=0,v=o,g=!1;v>t;v--)g||n.after(v+1)=0;n--)r=k.from(t[n].type.create(t[n].attrs,r));var o=e.start,i=e.end;return this.step(new xt(o,i,o,i,new C(r,0,0),t.length,!0))};X.prototype.setBlockType=function(e,t,r,n){var o=this;if(t===void 0&&(t=e),!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=this.steps.length;return this.doc.nodesBetween(e,t,function(s,a){if(s.isTextblock&&!s.hasMarkup(r,n)&&Gc(o.doc,o.mapping.slice(i).map(a),r)){o.clearIncompatible(o.mapping.slice(i).map(a,1),r);var c=o.mapping.slice(i),l=c.map(a,1),u=c.map(a+s.nodeSize,1);return o.step(new xt(l,u,l+1,u-1,new C(k.from(r.create(n,null,s.marks)),0,0),1,!0)),!1}}),this};function Gc(e,t,r){var n=e.resolve(t),o=n.index();return n.parent.canReplaceWith(o,o+1,r)}X.prototype.setNodeMarkup=function(e,t,r,n){var o=this.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);var i=t.create(r,null,n||o.marks);if(o.isLeaf)return this.replaceWith(e,e+o.nodeSize,i);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new xt(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new C(k.from(i),0,0),1,!0))};function ee(e,t,r,n){r===void 0&&(r=1);var o=e.resolve(t),i=o.depth-r,s=n&&n[n.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var a=o.depth-1,c=r-2;a>i;a--,c--){var l=o.node(a),u=o.index(a);if(l.type.spec.isolating)return!1;var f=l.content.cutByIndex(u,l.childCount),p=n&&n[c]||l;if(p!=l&&(f=f.replaceChild(0,p.type.create(p.attrs))),!l.canReplace(u+1,l.childCount)||!p.type.validContent(f))return!1}var d=o.indexAfter(i),h=n&&n[0];return o.node(i).canReplaceWith(d,d,h?h.type:o.node(i+1).type)}X.prototype.split=function(e,t,r){t===void 0&&(t=1);for(var n=this.doc.resolve(e),o=k.empty,i=k.empty,s=n.depth,a=n.depth-t,c=t-1;s>a;s--,c--){o=k.from(n.node(s).copy(o));var l=r&&r[c];i=k.from(l?l.type.create(l.attrs,i):n.node(s).copy(i))}return this.step(new te(e,e,new C(o.append(i),t,t),!0))};function Mn(e,t){var r=e.resolve(t),n=r.index();return Yc(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function Yc(e,t){return e&&t&&!e.isLeaf&&e.canAppend(t)}X.prototype.join=function(e,t){t===void 0&&(t=1);var r=new te(e-t,e+t,C.empty,!0);return this.step(r)};function Xc(e,t,r){var n=e.resolve(t);if(n.parent.canReplaceWith(n.index(),n.index(),r))return t;if(n.parentOffset==0)for(var o=n.depth-1;o>=0;o--){var i=n.index(o);if(n.node(o).canReplaceWith(i,i,r))return n.before(o+1);if(i>0)return null}if(n.parentOffset==n.parent.content.size)for(var s=n.depth-1;s>=0;s--){var a=n.indexAfter(s);if(n.node(s).canReplaceWith(a,a,r))return n.after(s+1);if(a=0;a--){var c=a==n.depth?0:n.pos<=(n.start(a+1)+n.end(a+1))/2?-1:1,l=n.index(a)+(c>0?1:0),u=n.node(a),f=!1;if(s==1)f=u.canReplace(l,l,o);else{var p=u.contentMatchAt(l).findWrapping(o.firstChild.type);f=p&&u.canReplaceWith(l,l,p[0])}if(f)return c==0?n.pos:c<0?n.before(a+1):n.after(a+1)}return null}function xn(e,t,r){for(var n=[],o=0;o=i.pos?null:new t(o.pos,i.pos,this.mark)},t.prototype.merge=function(n){if(n instanceof t&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from)return new t(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(o.from,o.to,n.markFromJSON(o.mark))},t}(ht);ht.jsonID("addMark",Cn);var Qe=function(e){function t(r,n,o){e.call(this),this.from=r,this.to=n,this.mark=o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(n){var o=this,i=n.slice(this.from,this.to),s=new C(xn(i.content,function(a){return a.mark(o.mark.removeFromSet(a.marks))}),i.openStart,i.openEnd);return bt.fromReplace(n,this.from,this.to,s)},t.prototype.invert=function(){return new Cn(this.from,this.to,this.mark)},t.prototype.map=function(n){var o=n.mapResult(this.from,1),i=n.mapResult(this.to,-1);return o.deleted&&i.deleted||o.pos>=i.pos?null:new t(o.pos,i.pos,this.mark)},t.prototype.merge=function(n){if(n instanceof t&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from)return new t(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(n,o){if(typeof o.from!="number"||typeof o.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(o.from,o.to,n.markFromJSON(o.mark))},t}(ht);ht.jsonID("removeMark",Qe);X.prototype.addMark=function(e,t,r){var n=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(e,t,function(c,l,u){if(!!c.isInline){var f=c.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){for(var p=Math.max(l,e),d=Math.min(l+c.nodeSize,t),h=r.addToSet(f),v=0;v=0;p--)this.step(o[p]);return this};function Qc(e,t,r,n){if(r===void 0&&(r=t),n===void 0&&(n=C.empty),t==r&&!n.size)return null;var o=e.resolve(t),i=e.resolve(r);return wi(o,i,n)?new te(t,r,n):new It(o,i,n).fit()}X.prototype.replace=function(e,t,r){t===void 0&&(t=e),r===void 0&&(r=C.empty);var n=Qc(this.doc,e,t,r);return n&&this.step(n),this};X.prototype.replaceWith=function(e,t,r){return this.replace(e,t,new C(k.from(r),0,0))};X.prototype.delete=function(e,t){return this.replace(e,t,C.empty)};X.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};function wi(e,t,r){return!r.openStart&&!r.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),r.content)}var It=function(t,r,n){this.$to=r,this.$from=t,this.unplaced=n,this.frontier=[];for(var o=0;o<=t.depth;o++){var i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}this.placed=k.empty;for(var s=t.depth;s>0;s--)this.placed=k.from(t.node(s).copy(this.placed))},Ti={depth:{configurable:!0}};Ti.depth.get=function(){return this.frontier.length-1};It.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var r=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(r<0?this.$to:o.doc.resolve(r));if(!i)return null;for(var s=this.placed,a=o.depth,c=i.depth;a&&c&&s.childCount==1;)s=s.firstChild.content,a--,c--;var l=new C(s,a,c);if(r>-1)return new xt(o.pos,r,this.$to.pos,this.$to.end(),l,n);if(l.size||o.pos!=this.$to.pos)return new te(o.pos,i.pos,l)};It.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var r=this.unplaced.openStart;r>=0;r--){var n=void 0,o=void 0;r?(o=On(this.unplaced.content,r-1).firstChild,n=o.content):n=this.unplaced.content;for(var i=n.firstChild,s=this.depth;s>=0;s--){var a=this.frontier[s],c=a.type,l=a.match,u=void 0,f=void 0;if(t==1&&(i?l.matchType(i.type)||(f=l.fillBefore(k.from(i),!1)):c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:f};if(t==2&&i&&(u=l.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:u};if(o&&l.matchType(o.type))break}}};It.prototype.openMore=function(){var t=this.unplaced,r=t.content,n=t.openStart,o=t.openEnd,i=On(r,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new C(r,n+1,Math.max(o,i.size+n>=r.size-o?n+1:0)),!0)};It.prototype.dropNode=function(){var t=this.unplaced,r=t.content,n=t.openStart,o=t.openEnd,i=On(r,n);if(i.childCount<=1&&n>0){var s=r.size-n<=n+i.size;this.unplaced=new C(Ze(r,n-1,1),n-1,s?n-1:o)}else this.unplaced=new C(Ze(r,n,1),n,o)};It.prototype.placeNodes=function(t){for(var r=t.sliceDepth,n=t.frontierDepth,o=t.parent,i=t.inject,s=t.wrap;this.depth>n;)this.closeFrontierNode();if(s)for(var a=0;a1||u==0||y.content.size)&&(h=R,p.push(Ai(y.mark(v.allowedMarks(y.marks)),f==1?u:0,f==l.childCount?M:-1)))}var m=f==l.childCount;m||(M=-1),this.placed=tr(this.placed,n,k.from(p)),this.frontier[n].match=h,m&&M<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var I=0,O=l;I1&&i==this.$to.end(--o);)++i;return i};It.prototype.findCloseLevel=function(t){t:for(var r=Math.min(this.depth,t.depth);r>=0;r--){var n=this.frontier[r],o=n.match,i=n.type,s=r=0;c--){var l=this.frontier[c],u=l.match,f=l.type,p=wn(t,c,f,u,!0);if(!p||p.childCount)continue t}return{depth:r,fit:a,move:s?t.doc.resolve(t.after(r+1)):t}}}};It.prototype.close=function(t){var r=this.findCloseLevel(t);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=tr(this.placed,r.depth,r.fit)),t=r.move;for(var n=r.depth+1;n<=t.depth;n++){var o=t.node(n),i=o.type.contentMatch.fillBefore(o.content,!0,t.index(n));this.openFrontierNode(o.type,o.attrs,i)}return t};It.prototype.openFrontierNode=function(t,r,n){var o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=tr(this.placed,this.depth,k.from(t.create(r,n))),this.frontier.push({type:t,match:t.contentMatch})};It.prototype.closeFrontierNode=function(){var t=this.frontier.pop(),r=t.match.fillBefore(k.empty,!0);r.childCount&&(this.placed=tr(this.placed,this.frontier.length,r))};Object.defineProperties(It.prototype,Ti);function Ze(e,t,r){return t==0?e.cutByIndex(r):e.replaceChild(0,e.firstChild.copy(Ze(e.firstChild.content,t-1,r)))}function tr(e,t,r){return t==0?e.append(r):e.replaceChild(e.childCount-1,e.lastChild.copy(tr(e.lastChild.content,t-1,r)))}function On(e,t){for(var r=0;r1&&(n=n.replaceChild(0,Ai(n.firstChild,t-1,n.childCount==1?r-1:0))),t>0&&(n=e.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(e.type.contentMatch.matchFragment(n).fillBefore(k.empty,!0)))),e.copy(n)}function wn(e,t,r,n,o){var i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!r.compatibleContent(i.type))return null;var a=n.fillBefore(i.content,!0,s);return a&&!Zc(r,i.content,s)?a:null}function Zc(e,t,r){for(var n=r;n0;a--,c--){var l=n.node(a).type.spec;if(l.defining||l.isolating)break;i.indexOf(a)>-1?s=a:n.before(a)==c&&i.splice(1,0,-a)}for(var u=i.indexOf(s),f=[],p=r.openStart,d=r.content,h=0;;h++){var v=d.firstChild;if(f.push(v),h==r.openStart)break;d=v.content}p>0&&f[p-1].type.spec.defining&&n.node(u).type!=f[p-1].type?p-=1:p>=2&&f[p-1].isTextblock&&f[p-2].type.spec.defining&&n.node(u).type!=f[p-2].type&&(p-=2);for(var g=r.openStart;g>=0;g--){var M=(g+p+1)%(r.openStart+1),y=f[M];if(!!y)for(var R=0;R=0&&(this.replace(e,t,r),!(this.steps.length>J));U--){var T=i[U];T<0||(e=n.before(T),t=o.after(T))}return this};function _i(e,t,r,n,o){if(tn){var s=o.contentMatchAt(0),a=s.fillBefore(e).append(e);e=a.append(s.matchFragment(a).fillBefore(k.empty,!0))}return e}X.prototype.replaceRangeWith=function(e,t,r){if(!r.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var n=Xc(this.doc,e,r.type);n!=null&&(e=t=n)}return this.replaceRange(e,t,new C(k.from(r),0,0))};X.prototype.deleteRange=function(e,t){for(var r=this.doc.resolve(e),n=this.doc.resolve(t),o=Ni(r,n),i=0;i0&&(a||r.node(s-1).canReplace(r.index(s-1),n.indexAfter(s-1))))return this.delete(r.before(s),n.after(s))}for(var c=1;c<=r.depth&&c<=n.depth;c++)if(e-r.start(c)==r.depth-c&&t>r.end(c)&&n.end(c)-t!=n.depth-c)return this.delete(r.before(c),t);return this.delete(e,t)};function Ni(e,t){for(var r=[],n=Math.min(e.depth,t.depth),o=n;o>=0;o--){var i=e.start(o);if(it.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;i==t.start(o)&&r.push(o)}return r}var Tn=Object.create(null),D=function(t,r,n){this.ranges=n||[new tl(t.min(r),t.max(r))],this.$anchor=t,this.$head=r},se={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};se.anchor.get=function(){return this.$anchor.pos};se.head.get=function(){return this.$head.pos};se.from.get=function(){return this.$from.pos};se.to.get=function(){return this.$to.pos};se.$from.get=function(){return this.ranges[0].$from};se.$to.get=function(){return this.ranges[0].$to};se.empty.get=function(){for(var e=this.ranges,t=0;t=0;i--){var s=r<0?Be(t.node(0),t.node(i),t.before(i+1),t.index(i),r,n):Be(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,r,n);if(s)return s}};D.near=function(t,r){return r===void 0&&(r=1),this.findFrom(t,r)||this.findFrom(t,-r)||new re(t.node(0))};D.atStart=function(t){return Be(t,t,0,0,1)||new re(t)};D.atEnd=function(t){return Be(t,t,t.content.size,t.childCount,-1)||new re(t)};D.fromJSON=function(t,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=Tn[r.type];if(!n)throw new RangeError("No selection type "+r.type+" defined");return n.fromJSON(t,r)};D.jsonID=function(t,r){if(t in Tn)throw new RangeError("Duplicate use of selection JSON ID "+t);return Tn[t]=r,r.prototype.jsonID=t,r};D.prototype.getBookmark=function(){return H.between(this.$anchor,this.$head).getBookmark()};Object.defineProperties(D.prototype,se);D.prototype.visible=!0;var tl=function(t,r){this.$from=t,this.$to=r},H=function(e){function t(n,o){o===void 0&&(o=n),e.call(this,n,o)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={$cursor:{configurable:!0}};return r.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(o,i){var s=o.resolve(i.map(this.head));if(!s.parent.inlineContent)return e.near(s);var a=o.resolve(i.map(this.anchor));return new t(a.parent.inlineContent?a:s,s)},t.prototype.replace=function(o,i){if(i===void 0&&(i=C.empty),e.prototype.replace.call(this,o,i),i==C.empty){var s=this.$from.marksAcross(this.$to);s&&o.ensureMarks(s)}},t.prototype.eq=function(o){return o instanceof t&&o.anchor==this.anchor&&o.head==this.head},t.prototype.getBookmark=function(){return new er(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(o,i){if(typeof i.anchor!="number"||typeof i.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(o.resolve(i.anchor),o.resolve(i.head))},t.create=function(o,i,s){s===void 0&&(s=i);var a=o.resolve(i);return new this(a,s==i?a:o.resolve(s))},t.between=function(o,i,s){var a=o.pos-i.pos;if((!s||a)&&(s=a>=0?1:-1),!i.parent.inlineContent){var c=e.findFrom(i,s,!0)||e.findFrom(i,-s,!0);if(c)i=c.$head;else return e.near(i,s)}return o.parent.inlineContent||(a==0?o=i:(o=(e.findFrom(o,-s,!0)||e.findFrom(o,s,!0)).$anchor,o.pos0?0:1);o>0?s=0;s+=o){var a=t.child(s);if(a.isAtom){if(!i&&E.isSelectable(a))return E.create(e,r-(o<0?a.nodeSize:0))}else{var c=Be(e,a,r+o,o<0?a.childCount:0,o,i);if(c)return c}r+=a.nodeSize*o}}function Ei(e,t,r){var n=e.steps.length-1;if(!(n0},t.prototype.setStoredMarks=function(o){return this.storedMarks=o,this.updated|=Ir,this},t.prototype.ensureMarks=function(o){return P.sameSet(this.storedMarks||this.selection.$from.marks(),o)||this.setStoredMarks(o),this},t.prototype.addStoredMark=function(o){return this.ensureMarks(o.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(o){return this.ensureMarks(o.removeFromSet(this.storedMarks||this.selection.$head.marks()))},r.storedMarksSet.get=function(){return(this.updated&Ir)>0},t.prototype.addStep=function(o,i){e.prototype.addStep.call(this,o,i),this.updated=this.updated&~Ir,this.storedMarks=null},t.prototype.setTime=function(o){return this.time=o,this},t.prototype.replaceSelection=function(o){return this.selection.replace(this,o),this},t.prototype.replaceSelectionWith=function(o,i){var s=this.selection;return i!==!1&&(o=o.mark(this.storedMarks||(s.empty?s.$from.marks():s.$from.marksAcross(s.$to)||P.none))),s.replaceWith(this,o),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(o,i,s){s===void 0&&(s=i);var a=this.doc.type.schema;if(i==null)return o?this.replaceSelectionWith(a.text(o),!0):this.deleteSelection();if(!o)return this.deleteRange(i,s);var c=this.storedMarks;if(!c){var l=this.doc.resolve(i);c=s==i?l.marks():l.marksAcross(this.doc.resolve(s))}return this.replaceRangeWith(i,s,a.text(o,c)),this.selection.empty||this.setSelection(D.near(this.selection.$to)),this},t.prototype.setMeta=function(o,i){return this.meta[typeof o=="string"?o:o.key]=i,this},t.prototype.getMeta=function(o){return this.meta[typeof o=="string"?o:o.key]},r.isGeneric.get=function(){for(var n in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=Ii,this},r.scrolledIntoView.get=function(){return(this.updated&Ii)>0},Object.defineProperties(t.prototype,r),t}(X);function Ri(e,t){return!t||!e?e:e.bind(t)}var rr=function(t,r,n){this.name=t,this.init=Ri(r.init,n),this.apply=Ri(r.apply,n)},nl=[new rr("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new rr("selection",{init:function(t,r){return t.selection||D.atStart(r.doc)},apply:function(t){return t.selection}}),new rr("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,r,n,o){return o.selection.$cursor?t.storedMarks:null}}),new rr("scrollToSelection",{init:function(){return 0},apply:function(t,r){return t.scrolledIntoView?r+1:r}})],An=function(t,r){var n=this;this.schema=t,this.fields=nl.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),r&&r.forEach(function(o){if(n.pluginsByKey[o.key])throw new RangeError("Adding different instances of a keyed plugin ("+o.key+")");n.plugins.push(o),n.pluginsByKey[o.key]=o,o.spec.state&&n.fields.push(new rr(o.key,o.spec.state,o))})},mt=function(t){this.config=t},Rr={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};Rr.schema.get=function(){return this.config.schema};Rr.plugins.get=function(){return this.config.plugins};mt.prototype.apply=function(t){return this.applyTransaction(t).state};mt.prototype.filterTransaction=function(t,r){r===void 0&&(r=-1);for(var n=0;n-1&&nr.splice(r,1)};Object.defineProperties(mt.prototype,Rr);var nr=[];function Pi(e,t,r){for(var n in e){var o=e[n];o instanceof Function?o=o.bind(t):n=="handleDOMEvents"&&(o=Pi(o,t,{})),r[n]=o}return r}var Rt=function(t){this.props={},t.props&&Pi(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:Bi("plugin")};Rt.prototype.getState=function(t){return t[this.key]};var _n=Object.create(null);function Bi(e){return e in _n?e+"$"+ ++_n[e]:(_n[e]=0,e+"$")}var Wt=function(t){t===void 0&&(t="key"),this.key=Bi(t)};Wt.prototype.get=function(t){return t.config.pluginsByKey[this.key]};Wt.prototype.getState=function(t){return t[this.key]};var x={};if(typeof navigator!="undefined"&&typeof document!="undefined"){var Nn=/Edge\/(\d+)/.exec(navigator.userAgent),zi=/MSIE \d/.test(navigator.userAgent),En=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);x.mac=/Mac/.test(navigator.platform);var Dn=x.ie=!!(zi||En||Nn);x.ie_version=zi?document.documentMode||6:En?+En[1]:Nn?+Nn[1]:null,x.gecko=!Dn&&/gecko\/(\d+)/i.test(navigator.userAgent),x.gecko_version=x.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var In=!Dn&&/Chrome\/(\d+)/.exec(navigator.userAgent);x.chrome=!!In,x.chrome_version=In&&+In[1],x.safari=!Dn&&/Apple Computer/.test(navigator.vendor),x.ios=x.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),x.android=/Android \d/.test(navigator.userAgent),x.webkit="webkitFontSmoothing"in document.documentElement.style,x.webkit_version=x.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var Pt=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Rn=function(e){var t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Li=null,ne=function(e,t,r){var n=Li||(Li=document.createRange());return n.setEnd(e,r==null?e.nodeValue.length:r),n.setStart(e,t||0),n},Pr=function(e,t,r,n){return r&&(Fi(e,t,r,n,-1)||Fi(e,t,r,n,1))},ol=/^(img|br|input|textarea|hr)$/i;function Fi(e,t,r,n,o){for(;;){if(e==r&&t==n)return!0;if(t==(o<0?0:Kt(e))){var i=e.parentNode;if(i.nodeType!=1||sl(e)||ol.test(e.nodeName)||e.contentEditable=="false")return!1;t=Pt(e)+(o<0?0:1),e=i}else if(e.nodeType==1){if(e=e.childNodes[t+(o<0?-1:0)],e.contentEditable=="false")return!1;t=o<0?Kt(e):0}else return!1}}function Kt(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function il(e,t,r){for(var n=t==0,o=t==Kt(e);n||o;){if(e==r)return!0;var i=Pt(e);if(e=e.parentNode,!e)return!1;n=n&&i==0,o=o&&i==Kt(e)}}function sl(e){for(var t,r=e;r&&!(t=r.pmViewDesc);r=r.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var Pn=function(e){var t=e.isCollapsed;return t&&x.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function ze(e,t){var r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=e,r.key=r.code=t,r}function al(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function ae(e,t){return typeof e=="number"?e:e[t]}function cl(e){var t=e.getBoundingClientRect(),r=t.width/e.offsetWidth||1,n=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*r,top:t.top,bottom:t.top+e.clientHeight*n}}function Vi(e,t,r){for(var n=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,s=r||e.dom;s;s=Rn(s))if(s.nodeType==1){var a=s==i.body||s.nodeType!=1,c=a?al(i):cl(s),l=0,u=0;if(t.topc.bottom-ae(n,"bottom")&&(u=t.bottom-c.bottom+ae(o,"bottom")),t.leftc.right-ae(n,"right")&&(l=t.right-c.right+ae(o,"right")),l||u)if(a)i.defaultView.scrollBy(l,u);else{var f=s.scrollLeft,p=s.scrollTop;u&&(s.scrollTop+=u),l&&(s.scrollLeft+=l);var d=s.scrollLeft-f,h=s.scrollTop-p;t={left:t.left-d,top:t.top-h,right:t.right-d,bottom:t.bottom-h}}if(a)break}}function ll(e){for(var t=e.dom.getBoundingClientRect(),r=Math.max(0,t.top),n,o,i=(t.left+t.right)/2,s=r+1;s=r-20){n=a,o=c.top;break}}}return{refDOM:n,refTop:o,stack:Hi(e.dom)}}function Hi(e){for(var t=[],r=e.ownerDocument;e&&(t.push({dom:e,top:e.scrollTop,left:e.scrollLeft}),e!=r);e=Rn(e));return t}function ul(e){var t=e.refDOM,r=e.refTop,n=e.stack,o=t?t.getBoundingClientRect().top:0;ji(n,o==0?0:o-r)}function ji(e,t){for(var r=0;r=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);var d=p.left>t.left?p.left-t.left:p.right=(p.left+p.right)/2?1:0));continue}}!r&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(i=l+1)}}return r&&r.nodeType==3?pl(r,o):!r||n&&r.nodeType==1?{node:e,offset:i}:qi(r,o)}function pl(e,t){for(var r=e.nodeValue.length,n=document.createRange(),o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}function Bn(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function dl(e,t){var r=e.parentNode;return r&&/^li$/i.test(r.nodeName)&&t.left(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(o,i,s)}function ml(e,t,r,n){for(var o=-1,i=t;i!=e.dom;){var s=e.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>n.left||a.top>n.top)o=s.posBefore;else if(a.right-1?o:e.docView.posFromDOM(t,r)}function Ji(e,t,r){var n=e.childNodes.length;if(n&&r.topt.top&&s++}i==e.dom&&s==i.childNodes.length-1&&i.lastChild.nodeType==1&&t.top>i.lastChild.getBoundingClientRect().bottom?u=e.state.doc.content.size:(s==0||i.nodeType!=1||i.childNodes[s-1].nodeName!="BR")&&(u=ml(e,i,s,t))}u==null&&(u=hl(e,l,t));var v=e.docView.nearestDesc(l,!0);return{pos:u,inside:v?v.posAtStart-v.border:-1}}function ce(e,t){var r=e.getClientRects();return r.length?r[t<0?0:r.length-1]:e.getBoundingClientRect()}var gl=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Wi(e,t,r){var n=e.docView.domFromPos(t,r<0?-1:1),o=n.node,i=n.offset,s=x.webkit||x.gecko;if(o.nodeType==3)if(s&&(gl.test(o.nodeValue)||(r<0?!i:i==o.nodeValue.length))){var a=ce(ne(o,i,i),r);if(x.gecko&&i&&/\s/.test(o.nodeValue[i-1])&&i=0&&i==o.nodeValue.length?(u--,p=1):r<0?u--:f++,or(ce(ne(o,u,f),p),p<0)}if(!e.state.doc.resolve(t).parent.inlineContent){if(i&&(r<0||i==Kt(o))){var d=o.childNodes[i-1];if(d.nodeType==1)return zn(d.getBoundingClientRect(),!1)}if(i=0)}if(i&&(r<0||i==Kt(o))){var v=o.childNodes[i-1],g=v.nodeType==3?ne(v,Kt(v)-(s?0:1)):v.nodeType==1&&(v.nodeName!="BR"||!v.nextSibling)?v:null;if(g)return or(ce(g,1),!1)}if(i=0)}function or(e,t){if(e.width==0)return e;var r=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:r,right:r}}function zn(e,t){if(e.height==0)return e;var r=t?e.top:e.bottom;return{top:r,bottom:r,left:e.left,right:e.right}}function Ki(e,t,r){var n=e.state,o=e.root.activeElement;n!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return r()}finally{n!=t&&e.updateState(n),o!=e.dom&&o&&o.focus()}}function yl(e,t,r){var n=t.selection,o=r=="up"?n.$from:n.$to;return Ki(e,t,function(){for(var i=e.docView.domFromPos(o.pos,r=="up"?-1:1),s=i.node;;){var a=e.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.dom;break}s=a.dom.parentNode}for(var c=Wi(e,o.pos,1),l=s.firstChild;l;l=l.nextSibling){var u=void 0;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=ne(l,0,l.nodeValue.length).getClientRects();else continue;for(var f=0;fp.top&&(r=="up"?p.bottomc.bottom-1))return!1}}return!0})}var bl=/[\u0590-\u08ac]/;function kl(e,t,r){var n=t.selection,o=n.$head;if(!o.parent.isTextblock)return!1;var i=o.parentOffset,s=!i,a=i==o.parent.content.size,c=e.root.getSelection();return!bl.test(o.parent.textContent)||!c.modify?r=="left"||r=="backward"?s:a:Ki(e,t,function(){var l=c.getRangeAt(0),u=c.focusNode,f=c.focusOffset,p=c.caretBidiLevel;c.modify("move",r,"character");var d=o.depth?e.docView.domAfterPos(o.before()):e.dom,h=!d.contains(c.focusNode.nodeType==1?c.focusNode:c.focusNode.parentNode)||u==c.focusNode&&f==c.focusOffset;return c.removeAllRanges(),c.addRange(l),p!=null&&(c.caretBidiLevel=p),h})}var $i=null,Ui=null,Gi=!1;function Sl(e,t,r){return $i==t&&Ui==r?Gi:($i=t,Ui=r,Gi=r=="up"||r=="down"?yl(e,t,r):kl(e,t,r))}var Ft=0,Yi=1,ir=2,le=3,W=function(t,r,n,o){this.parent=t,this.children=r,this.dom=n,n.pmViewDesc=this,this.contentDOM=o,this.dirty=Ft},$t={beforePosition:{configurable:!0},size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0},domAtom:{configurable:!0}};W.prototype.matchesWidget=function(){return!1};W.prototype.matchesMark=function(){return!1};W.prototype.matchesNode=function(){return!1};W.prototype.matchesHack=function(t){return!1};$t.beforePosition.get=function(){return!1};W.prototype.parseRule=function(){return null};W.prototype.stopEvent=function(){return!1};$t.size.get=function(){for(var e=0,t=0;tPt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))c=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(var l=t;;l=l.parentNode){if(l==this.dom){c=!1;break}if(l.parentNode.firstChild!=l)break}if(c==null&&r==t.childNodes.length)for(var u=t;;u=u.parentNode){if(u==this.dom){c=!0;break}if(u.parentNode.lastChild!=u)break}}return(c==null?n>0:c)?this.posAtEnd:this.posAtStart};W.prototype.nearestDesc=function(t,r){for(var n=!0,o=t;o;o=o.parentNode){var i=this.getDesc(o);if(i&&(!r||i.node))if(n&&i.nodeDOM&&!(i.nodeDOM.nodeType==1?i.nodeDOM.contains(t.nodeType==1?t:t.parentNode):i.nodeDOM==t))n=!1;else return i}};W.prototype.getDesc=function(t){for(var r=t.pmViewDesc,n=r;n;n=n.parent)if(n==this)return r};W.prototype.posFromDOM=function(t,r,n){for(var o=t;o;o=o.parentNode){var i=this.getDesc(o);if(i)return i.localPosFromDOM(t,r,n)}return-1};W.prototype.descAt=function(t){for(var r=0,n=0;r=t:a>t)&&(a>t||o+1>=this.children.length||!this.children[o+1].beforePosition))return s.domFromPos(t-n-s.border,r);n=a}};W.prototype.parseRange=function(t,r,n){if(n===void 0&&(n=0),this.children.length==0)return{node:this.contentDOM,from:t,to:r,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var o=-1,i=-1,s=n,a=0;;a++){var c=this.children[a],l=s+c.size;if(o==-1&&t<=l){var u=s+c.border;if(t>=u&&r<=l-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(t,r,u);t=s;for(var f=a;f>0;f--){var p=this.children[f-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){o=Pt(p.dom)+1;break}t-=p.size}o==-1&&(o=0)}if(o>-1&&(l>r||a==this.children.length-1)){r=l;for(var d=a+1;dc&&sr){var F=f;f=p,p=F}var J=document.createRange();J.setEnd(p.node,p.offset),J.setStart(f.node,f.offset),d.removeAllRanges(),d.addRange(J)}}};W.prototype.ignoreMutation=function(t){return!this.contentDOM&&t.type!="selection"};$t.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)};W.prototype.markDirty=function(t,r){for(var n=0,o=0;o=n:tn){var a=n+i.border,c=s-i.border;if(t>=a&&r<=c){this.dirty=t==n||r==s?ir:Yi,t==a&&r==c&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=le:i.markDirty(t-a,r-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM?ir:le}n=s}this.dirty=ir};W.prototype.markParentsDirty=function(){for(var t=1,r=this.parent;r;r=r.parent,t++){var n=t==1?ir:Yi;r.dirty0&&(a=Hn(a,0,n,i));for(var l=0;l-1?l:null,f=l&&l.pos<0,p=new Bt(this,u&&u.node);_l(this.node,this.innerDeco,function(d,h,v){d.spec.marks?p.syncToMarks(d.spec.marks,a,o):d.type.side>=0&&!v&&p.syncToMarks(h==s.node.childCount?P.none:s.node.child(h).marks,a,o),p.placeWidget(d,o,c)},function(d,h,v,g){p.syncToMarks(d.marks,a,o);var M;p.findNodeMatch(d,h,v,g)||f&&o.state.selection.from>c&&o.state.selection.to-1&&p.updateNodeAt(d,h,v,M,o)||p.updateNextNode(d,h,v,o,g)||p.addNode(d,h,v,o,c),c+=d.nodeSize}),p.syncToMarks(ue,a,o),this.node.isTextblock&&p.addTextblockHacks(),p.destroyRest(),(p.changed||this.dirty==ir)&&(u&&this.protectLocalComposition(o,u),Zi(this.contentDOM,this.children,o),x.ios&&Nl(this.dom))},t.prototype.localCompositionInfo=function(o,i){var s=o.state.selection,a=s.from,c=s.to;if(!(!(o.state.selection instanceof H)||ai+this.node.content.size)){var l=o.root.getSelection(),u=El(l.focusNode,l.focusOffset);if(!(!u||!this.dom.contains(u.parentNode)))if(this.node.inlineContent){var f=u.nodeValue,p=Dl(this.node.content,f,a-i,c-i);return p<0?null:{node:u,pos:p,text:f}}else return{node:u,pos:-1}}},t.prototype.protectLocalComposition=function(o,i){var s=i.node,a=i.pos,c=i.text;if(!this.getDesc(s)){for(var l=s;l.parentNode!=this.contentDOM;l=l.parentNode){for(;l.previousSibling;)l.parentNode.removeChild(l.previousSibling);for(;l.nextSibling;)l.parentNode.removeChild(l.nextSibling);l.pmViewDesc&&(l.pmViewDesc=null)}var u=new xl(this,l,s,c);o.compositionNodes.push(u),this.children=Hn(this.children,a,a+c.length,o,u)}},t.prototype.update=function(o,i,s,a){return this.dirty==le||!o.sameMarkup(this.node)?!1:(this.updateInner(o,i,s,a),!0)},t.prototype.updateInner=function(o,i,s,a){this.updateOuterDeco(i),this.node=o,this.innerDeco=s,this.contentDOM&&this.updateChildren(a,this.posAtStart),this.dirty=Ft},t.prototype.updateOuterDeco=function(o){if(!Vn(o,this.outerDeco)){var i=this.nodeDOM.nodeType!=1,s=this.dom;this.dom=ts(this.dom,this.nodeDOM,Fn(this.outerDeco,this.node,i),Fn(o,this.node,i)),this.dom!=s&&(s.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=o}},t.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)},t.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")},r.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(t.prototype,r),t}(W);function Xi(e,t,r,n,o){return es(n,t,e),new sr(null,e,t,r,n,n,n,o,0)}var Qi=function(e){function t(n,o,i,s,a,c,l){e.call(this,n,o,i,s,a,null,c,l)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={domAtom:{configurable:!0}};return t.prototype.parseRule=function(){for(var o=this.nodeDOM.parentNode;o&&o!=this.dom&&!o.pmIsDeco;)o=o.parentNode;return{skip:o||!0}},t.prototype.update=function(o,i,s,a){return this.dirty==le||this.dirty!=Ft&&!this.inParent()||!o.sameMarkup(this.node)?!1:(this.updateOuterDeco(i),(this.dirty!=Ft||o.text!=this.node.text)&&o.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=o.text,a.trackWrites==this.nodeDOM&&(a.trackWrites=null)),this.node=o,this.dirty=Ft,!0)},t.prototype.inParent=function(){for(var o=this.parent.contentDOM,i=this.nodeDOM;i;i=i.parentNode)if(i==o)return!0;return!1},t.prototype.domFromPos=function(o){return{node:this.nodeDOM,offset:o}},t.prototype.localPosFromDOM=function(o,i,s){return o==this.nodeDOM?this.posAtStart+Math.min(i,this.node.text.length):e.prototype.localPosFromDOM.call(this,o,i,s)},t.prototype.ignoreMutation=function(o){return o.type!="characterData"&&o.type!="selection"},t.prototype.slice=function(o,i,s){var a=this.node.cut(o,i),c=document.createTextNode(a.text);return new t(this.parent,a,this.outerDeco,this.innerDeco,c,c,s)},t.prototype.markDirty=function(o,i){e.prototype.markDirty.call(this,o,i),this.dom!=this.nodeDOM&&(o==0||i==this.nodeDOM.nodeValue.length)&&(this.dirty=le)},r.domAtom.get=function(){return!1},Object.defineProperties(t.prototype,r),t}(sr),Cl=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={domAtom:{configurable:!0}};return t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.matchesHack=function(o){return this.dirty==Ft&&this.dom.nodeName==o},r.domAtom.get=function(){return!0},Object.defineProperties(t.prototype,r),t}(W),Ol=function(e){function t(r,n,o,i,s,a,c,l,u,f){e.call(this,r,n,o,i,s,a,c,u,f),this.spec=l}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.update=function(n,o,i,s){if(this.dirty==le)return!1;if(this.spec.update){var a=this.spec.update(n,o,i);return a&&this.updateInner(n,o,i,s),a}else return!this.contentDOM&&!n.isLeaf?!1:e.prototype.update.call(this,n,o,i,s)},t.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():e.prototype.selectNode.call(this)},t.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():e.prototype.deselectNode.call(this)},t.prototype.setSelection=function(n,o,i,s){this.spec.setSelection?this.spec.setSelection(n,o,i):e.prototype.setSelection.call(this,n,o,i,s)},t.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),e.prototype.destroy.call(this)},t.prototype.stopEvent=function(n){return this.spec.stopEvent?this.spec.stopEvent(n):!1},t.prototype.ignoreMutation=function(n){return this.spec.ignoreMutation?this.spec.ignoreMutation(n):e.prototype.ignoreMutation.call(this,n)},t}(sr);function Zi(e,t,r){for(var n=e.firstChild,o=!1,i=0;i>1,s=Math.min(i,t.length);o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var l=Ln.create(this.top,t[i],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}};Bt.prototype.findNodeMatch=function(t,r,n,o){var i=this.top.children,s=-1;if(o>=this.preMatch.index){for(var a=this.index;a0&&n>0;n--){var i=t[n-1],s=i.node;if(!!s){if(s!=e.child(r-1))break;--r,o.set(i,r)}}return{index:r,matched:o}}function Al(e,t){return e.type.side-t.type.side}function _l(e,t,r,n){var o=t.locals(e),i=0;if(o.length==0){for(var s=0;si;)l.push(o[c++]);var y=i+v.nodeSize;if(v.isText){var R=y;c0){if(e.childNodes.length>t&&e.childNodes[t].nodeType==3)return e.childNodes[t];e=e.childNodes[t-1],t=Kt(e)}else if(e.nodeType==1&&t=r){var u=c.lastIndexOf(t,n-a);if(u>=0&&u+t.length+a>=r)return a+u}}}return-1}function Hn(e,t,r,n,o){for(var i=[],s=0,a=0;s=r||u<=t?i.push(c):(lr&&i.push(c.slice(r-l,c.size,n)))}return i}function ns(e,t){var r=e.root.getSelection(),n=e.state.doc;if(!r.focusNode)return null;var o=e.docView.nearestDesc(r.focusNode),i=o&&o.size==0,s=e.docView.posFromDOM(r.focusNode,r.focusOffset);if(s<0)return null;var a=n.resolve(s),c,l;if(Pn(r)){for(c=a;o&&!o.node;)o=o.parent;if(o&&o.node.isAtom&&E.isSelectable(o.node)&&o.parent&&!(o.node.isInline&&il(r.focusNode,r.focusOffset,o.dom))){var u=o.posBefore;l=new E(s==u?a:n.resolve(u))}}else{var f=e.docView.posFromDOM(r.anchorNode,r.anchorOffset);if(f<0)return null;c=n.resolve(f)}if(!l){var p=t=="pointer"||e.state.selection.head0?n.max(o):n.min(o),s=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return s&&D.findFrom(s,t)}function xe(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function fs(e,t,r){var n=e.state.selection;if(n instanceof H){if(!n.empty||r.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var o=Wn(e.state,t);return o&&o instanceof E?xe(e,o):!1}else if(!(x.mac&&r.indexOf("m")>-1)){var i=n.$head,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!s||s.isText)return!1;var c=t<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(a=e.docView.descAt(c))&&!a.contentDOM?E.isSelectable(s)?xe(e,new E(t<0?e.state.doc.resolve(i.pos-s.nodeSize):i)):x.webkit?xe(e,new H(e.state.doc.resolve(t<0?c:c+s.nodeSize))):!1:!1}}else{if(n instanceof E&&n.node.isInline)return xe(e,new H(t>0?n.$to:n.$from));var l=Wn(e.state,t);return l?xe(e,l):!1}}function Br(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function cr(e){var t=e.pmViewDesc;return t&&t.size==0&&(e.nextSibling||e.nodeName!="BR")}function Kn(e){var t=e.root.getSelection(),r=t.focusNode,n=t.focusOffset;if(!!r){var o,i,s=!1;for(x.gecko&&r.nodeType==1&&n0){if(r.nodeType!=1)break;var a=r.childNodes[n-1];if(cr(a))o=r,i=--n;else if(a.nodeType==3)r=a,n=r.nodeValue.length;else break}else{if(ps(r))break;for(var c=r.previousSibling;c&&cr(c);)o=r.parentNode,i=Pt(c),c=c.previousSibling;if(c)r=c,n=Br(r);else{if(r=r.parentNode,r==e.dom)break;n=0}}s?Un(e,t,r,n):o&&Un(e,t,o,i)}}function $n(e){var t=e.root.getSelection(),r=t.focusNode,n=t.focusOffset;if(!!r){for(var o=Br(r),i,s;;)if(n-1||x.mac&&r.indexOf("m")>-1)return!1;var o=n.$from,i=n.$to;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var s=Wn(e.state,t);if(s&&s instanceof E)return xe(e,s)}if(!o.parent.inlineContent){var a=t<0?o:i,c=n instanceof re?D.near(a,t):D.findFrom(a,t);return c?xe(e,c):!1}return!1}function hs(e,t){if(!(e.state.selection instanceof H))return!0;var r=e.state.selection,n=r.$head,o=r.$anchor,i=r.empty;if(!n.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){var a=e.state.tr;return t<0?a.delete(n.pos-s.nodeSize,n.pos):a.delete(n.pos,n.pos+s.nodeSize),e.dispatch(a),!0}return!1}function ms(e,t,r){e.domObserver.stop(),t.contentEditable=r,e.domObserver.start()}function zl(e){if(!(!x.safari||e.state.selection.$head.parentOffset>0)){var t=e.root.getSelection(),r=t.focusNode,n=t.focusOffset;if(r&&r.nodeType==1&&n==0&&r.firstChild&&r.firstChild.contentEditable=="false"){var o=r.firstChild;ms(e,o,!0),setTimeout(function(){return ms(e,o,!1)},20)}}}function Ll(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function Fl(e,t){var r=t.keyCode,n=Ll(t);return r==8||x.mac&&r==72&&n=="c"?hs(e,-1)||Kn(e):r==46||x.mac&&r==68&&n=="c"?hs(e,1)||$n(e):r==13||r==27?!0:r==37?fs(e,-1,n)||Kn(e):r==39?fs(e,1,n)||$n(e):r==38?ds(e,-1,n)||Kn(e):r==40?zl(e)||ds(e,1,n)||$n(e):n==(x.mac?"m":"c")&&(r==66||r==73||r==89||r==90)}function Vl(e,t,r){var n=e.docView.parseRange(t,r),o=n.node,i=n.fromOffset,s=n.toOffset,a=n.from,c=n.to,l=e.root.getSelection(),u=null,f=l.anchorNode;if(f&&e.dom.contains(f.nodeType==1?f:f.parentNode)&&(u=[{node:f,offset:l.anchorOffset}],Pn(l)||u.push({node:l.focusNode,offset:l.focusOffset})),x.chrome&&e.lastKeyCode===8)for(var p=s;p>i;p--){var d=o.childNodes[p-1],h=d.pmViewDesc;if(d.nodeName=="BR"&&!h){s=p;break}if(!h||h.size)break}var v=e.state.doc,g=e.someProp("domParser")||Lt.fromSchema(e.state.schema),M=v.resolve(a),y=null,R=g.parse(o,{topNode:M.parent,topMatch:M.parent.contentMatchAt(M.index()),topOpen:!0,from:i,to:s,preserveWhitespace:M.parent.type.spec.code?"full":!0,editableContent:!0,findPositions:u,ruleFromNode:Hl,context:M});if(u&&u[0].pos!=null){var m=u[0].pos,I=u[1]&&u[1].pos;I==null&&(I=m),y={anchor:m+a,head:I+a}}return{doc:R,sel:y,from:a,to:c}}function Hl(e){var t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(x.safari&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||x.safari&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0}}function jl(e,t,r,n,o){if(t<0){var i=e.lastSelectionTime>Date.now()-50?e.lastSelectionOrigin:null,s=ns(e,i);if(s&&!e.state.selection.eq(s)){var a=e.state.tr.setSelection(s);i=="pointer"?a.setMeta("pointer",!0):i=="key"&&a.scrollIntoView(),e.dispatch(a)}return}var c=e.state.doc.resolve(t),l=c.sharedDepth(r);t=c.before(l+1),r=e.state.doc.resolve(r).after(l+1);var u=e.state.selection,f=Vl(e,t,r);if(x.chrome&&e.cursorWrapper&&f.sel&&f.sel.anchor==e.cursorWrapper.deco.from){var p=e.cursorWrapper.deco.type.toDOM.nextSibling,d=p&&p.nodeValue?p.nodeValue.length:1;f.sel={anchor:f.sel.anchor+d,head:f.sel.anchor+d}}var h=e.state.doc,v=h.slice(f.from,f.to),g,M;e.lastKeyCode===8&&Date.now()-100Date.now()-225||x.android)&&o.some(function(Y){return Y.nodeName=="DIV"||Y.nodeName=="P"})&&e.someProp("handleKeyDown",function(Y){return Y(e,ze(13,"Enter"))})){e.lastIOSEnter=0;return}else{if(f.sel){var R=vs(e,e.state.doc,f.sel);R&&!R.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(R))}return}e.domChangeCount++,e.state.selection.frome.state.selection.from&&y.start<=e.state.selection.from+2?y.start=e.state.selection.from:y.endA=e.state.selection.to-2&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to)),x.ie&&x.ie_version<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>f.from&&f.doc.textBetween(y.start-f.from-1,y.start-f.from+1)==" \xA0"&&(y.start--,y.endA--,y.endB--);var m=f.doc.resolveNoCache(y.start-f.from),I=f.doc.resolveNoCache(y.endB-f.from),O=m.sameParent(I)&&m.parent.inlineContent,F;if((x.ios&&e.lastIOSEnter>Date.now()-225&&(!O||o.some(function(Y){return Y.nodeName=="DIV"||Y.nodeName=="P"}))||!O&&m.posy.start&&Jl(h,y.start,y.endA,m,I)&&e.someProp("handleKeyDown",function(Y){return Y(e,ze(8,"Backspace"))})){x.android&&x.chrome&&e.domObserver.suppressSelectionUpdates();return}x.chrome&&x.android&&y.toB==y.from&&(e.lastAndroidDelete=Date.now()),x.android&&!O&&m.start()!=I.start()&&I.parentOffset==0&&m.depth==I.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==y.endA&&(y.endB-=2,I=f.doc.resolveNoCache(y.endB-f.from),setTimeout(function(){e.someProp("handleKeyDown",function(Y){return Y(e,ze(13,"Enter"))})},20));var J=y.start,U=y.endA,T,Qt,rt,ut;if(O){if(m.pos==I.pos)x.ie&&x.ie_version<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(function(){return fe(e)},20)),T=e.state.tr.delete(J,U),Qt=h.resolve(y.start).marksAcross(h.resolve(y.endA));else if(y.endA==y.endB&&(ut=h.resolve(y.start))&&(rt=ql(m.parent.content.cut(m.parentOffset,I.parentOffset),ut.parent.content.cut(ut.parentOffset,y.endA-ut.start()))))T=e.state.tr,rt.type=="add"?T.addMark(J,U,rt.mark):T.removeMark(J,U,rt.mark);else if(m.parent.child(m.index()).isText&&m.index()==I.index()-(I.textOffset?0:1)){var qt=m.parent.textBetween(m.parentOffset,I.parentOffset);if(e.someProp("handleTextInput",function(Y){return Y(e,J,U,qt)}))return;T=e.state.tr.insertText(qt,J,U)}}if(T||(T=e.state.tr.replace(J,U,f.doc.slice(y.start-f.from,y.endB-f.from))),f.sel){var G=vs(e,T.doc,f.sel);G&&!(x.chrome&&x.android&&e.composing&&G.empty&&(y.start!=y.endB||e.lastAndroidDeletet.content.size?null:qn(e,t.resolve(r.anchor),t.resolve(r.head))}function ql(e,t){for(var r=e.firstChild.marks,n=t.firstChild.marks,o=r,i=n,s,a,c,l=0;lr||Gn(s,!0,!1)0&&(t||e.indexAfter(n)==e.node(n).childCount);)n--,o++,t=!1;if(r)for(var i=e.node(n).maybeChild(e.indexAfter(n));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function Wl(e,t,r,n,o){var i=e.findDiffStart(t,r);if(i==null)return null;var s=e.findDiffEnd(t,r+e.size,r+t.size),a=s.a,c=s.b;if(o=="end"){var l=Math.max(0,i-Math.min(a,c));n-=a+l-i}if(a=a?i-n:0;i-=u,c=i+(c-a),a=i}else if(c=c?i-n:0;i-=f,a=i+(a-c),c=i}return{start:i,endA:a,endB:c}}function gs(e,t){for(var r=[],n=t.content,o=t.openStart,i=t.openEnd;o>1&&i>1&&n.childCount==1&&n.firstChild.childCount==1;){o--,i--;var s=n.firstChild;r.push(s.type.name,s.attrs!=s.type.defaultAttrs?s.attrs:null),n=s.content}var a=e.someProp("clipboardSerializer")||ot.fromSchema(e.state.schema),c=Cs(),l=c.createElement("div");l.appendChild(a.serializeFragment(n,{document:c}));for(var u=l.firstChild,f;u&&u.nodeType==1&&(f=Ms[u.nodeName.toLowerCase()]);){for(var p=f.length-1;p>=0;p--){for(var d=c.createElement(f[p]);l.firstChild;)d.appendChild(l.firstChild);l.appendChild(d),f[p]!="tbody"&&(o++,i++)}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",o+" "+i+" "+JSON.stringify(r));var h=e.someProp("clipboardTextSerializer",function(v){return v(t)})||t.content.textBetween(0,t.content.size,` `);return{dom:l,text:h}}function ys(e,t,r,n,o){var i,s=o.parent.type.spec.code,a;if(!r&&!t)return null;var c=t&&(n||s||!r);if(c){if(e.someProp("transformPastedText",function(M){t=M(t,s||n)}),s)return new C(k.from(e.state.schema.text(t.replace(/\r\n?/g,` `))),0,0);var l=e.someProp("clipboardTextParser",function(M){return M(t,o,n)});if(l)a=l;else{var u=o.marks(),f=e.state,p=f.schema,d=ot.fromSchema(p);i=document.createElement("div"),t.trim().split(/(?:\r\n?|\n)+/).forEach(function(M){i.appendChild(document.createElement("p")).appendChild(d.serializeNode(p.text(M,u)))})}}else e.someProp("transformPastedHTML",function(M){r=M(r)}),i=Ul(r),x.webkit&&Gl(i);var h=i&&i.querySelector("[data-pm-slice]"),v=h&&/^(\d+) (\d+) (.*)/.exec(h.getAttribute("data-pm-slice"));if(!a){var g=e.someProp("clipboardParser")||e.someProp("domParser")||Lt.fromSchema(e.state.schema);a=g.parseSlice(i,{preserveWhitespace:!!(c||v),context:o})}return v?a=Yl($l(a,+v[1],+v[2]),v[3]):a=C.maxOpen(Kl(a.content,o),!1),e.someProp("transformPasted",function(M){a=M(a)}),a}function Kl(e,t){if(e.childCount<2)return e;for(var r=function(i){var s=t.node(i),a=s.contentMatchAt(t.index(i)),c=void 0,l=[];if(e.forEach(function(u){if(!!l){var f=a.findWrapping(u.type),p;if(!f)return l=null;if(p=l.length&&c.length&&ks(f,c,u,l[l.length-1],0))l[l.length-1]=p;else{l.length&&(l[l.length-1]=Ss(l[l.length-1],c.length));var d=bs(u,f);l.push(d),a=a.matchType(d.type,d.attrs),c=f}}}),l)return{v:k.from(l)}},n=t.depth;n>=0;n--){var o=r(n);if(o)return o.v}return e}function bs(e,t,r){r===void 0&&(r=0);for(var n=t.length-1;n>=r;n--)e=t[n].create(null,k.from(e));return e}function ks(e,t,r,n,o){if(o=r&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(k.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function $l(e,t,r){return t]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var r=Cs().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(e),o;if((o=n&&Ms[n[1].toLowerCase()])&&(e=o.map(function(s){return"<"+s+">"}).join("")+e+o.map(function(s){return""}).reverse().join("")),r.innerHTML=e,o)for(var i=0;i=0;a-=2){var c=r.nodes[n[a]];if(!c||c.hasRequiredAttrs())break;o=k.from(c.create(n[a+1],o)),i++,s++}return new C(o,i,s)}var Xl={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Xn=x.ie&&x.ie_version<=11,Qn=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};Qn.prototype.set=function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset};Qn.prototype.eq=function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset};var Nt=function(t,r){var n=this;this.view=t,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver(function(o){for(var i=0;is.target.nodeValue.length})?n.flushSoon():n.flush()}),this.currentSelection=new Qn,Xn&&(this.onCharData=function(o){n.queue.push({target:o.target,type:"characterData",oldValue:o.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};Nt.prototype.flushSoon=function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(function(){t.flushingSoon=-1,t.flush()},20))};Nt.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())};Nt.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,Xl),Xn&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()};Nt.prototype.stop=function(){var t=this;if(this.observer){var r=this.observer.takeRecords();if(r.length){for(var n=0;n-1)){var t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);var r=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Jn(this.view)&&!this.ignoreSelectionChange(r),o=-1,i=-1,s=!1,a=[];if(this.view.editable)for(var c=0;c1){var u=a.filter(function(d){return d.nodeName=="BR"});if(u.length==2){var f=u[0],p=u[1];f.parentNode&&f.parentNode.parentNode==p.parentNode?p.remove():f.remove()}}(o>-1||n)&&(o>-1&&(this.view.docView.markDirty(o,i),Ql(this.view)),this.handleDOMChange(o,i,s,a),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(r)||fe(this.view),this.currentSelection.set(r))}};Nt.prototype.registerMutation=function(t,r){if(r.indexOf(t.target)>-1)return null;var n=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(n==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!n||n.ignoreMutation(t))return null;if(t.type=="childList"){for(var o=0;oi.depth?u(e,r,i.nodeAfter,i.before(l),o,!0):u(e,r,i.node(l),i.before(l),o,!1)}))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function Fe(e,t,r){e.focused||e.focus();var n=e.state.tr.setSelection(t);r=="pointer"&&n.setMeta("pointer",!0),e.dispatch(n)}function ou(e,t){if(t==-1)return!1;var r=e.state.doc.resolve(t),n=r.nodeAfter;return n&&n.isAtom&&E.isSelectable(n)?(Fe(e,new E(r),"pointer"),!0):!1}function iu(e,t){if(t==-1)return!1;var r=e.state.selection,n,o;r instanceof E&&(n=r.node);for(var i=e.state.doc.resolve(t),s=i.depth+1;s>0;s--){var a=s>i.depth?i.nodeAfter:i.node(s);if(E.isSelectable(a)){n&&r.$from.depth>0&&s>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?o=i.before(r.$from.depth):o=i.before(s);break}}return o!=null?(Fe(e,E.create(e.state.doc,o),"pointer"),!0):!1}function su(e,t,r,n,o){return eo(e,"handleClickOn",t,r,n)||e.someProp("handleClick",function(i){return i(e,t,n)})||(o?iu(e,r):ou(e,r))}function au(e,t,r,n){return eo(e,"handleDoubleClickOn",t,r,n)||e.someProp("handleDoubleClick",function(o){return o(e,t,n)})}function cu(e,t,r,n){return eo(e,"handleTripleClickOn",t,r,n)||e.someProp("handleTripleClick",function(o){return o(e,t,n)})||lu(e,r,n)}function lu(e,t,r){if(r.button!=0)return!1;var n=e.state.doc;if(t==-1)return n.inlineContent?(Fe(e,H.create(n,0,n.content.size),"pointer"),!0):!1;for(var o=n.resolve(t),i=o.depth+1;i>0;i--){var s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)Fe(e,H.create(n,a+1,a+1+s.content.size),"pointer");else if(E.isSelectable(s))Fe(e,E.create(n,a),"pointer");else continue;return!0}}function ro(e){return Fr(e)}var ws=x.mac?"metaKey":"ctrlKey";Ct.mousedown=function(e,t){e.shiftKey=t.shiftKey;var r=ro(e),n=Date.now(),o="singleClick";n-e.lastClick.time<500&&nu(t,e.lastClick)&&!t[ws]&&(e.lastClick.type=="singleClick"?o="doubleClick":e.lastClick.type=="doubleClick"&&(o="tripleClick")),e.lastClick={time:n,x:t.clientX,y:t.clientY,type:o};var i=e.posAtCoords(zr(t));!i||(o=="singleClick"?(e.mouseDown&&e.mouseDown.done(),e.mouseDown=new Lr(e,i,t,r)):(o=="doubleClick"?au:cu)(e,i.pos,i.inside,t)?t.preventDefault():Ce(e,"pointer"))};var Lr=function(t,r,n,o){var i=this;this.view=t,this.startDoc=t.state.doc,this.pos=r,this.event=n,this.flushed=o,this.selectNode=n[ws],this.allowDefault=n.shiftKey,this.delayedSelectionSync=!1;var s,a;if(r.inside>-1)s=t.state.doc.nodeAt(r.inside),a=r.inside;else{var c=t.state.doc.resolve(r.pos);s=c.parent,a=c.depth?c.before():0}this.mightDrag=null;var l=o?null:n.target,u=l?t.docView.nearestDesc(l,!0):null;this.target=u?u.dom:null;var f=t.state,p=f.selection;(n.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||p instanceof E&&p.from<=a&&p.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&x.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(function(){i.view.mouseDown==i&&i.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ce(t,"pointer")};Lr.prototype.done=function(){var t=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(function(){return fe(t.view)}),this.view.mouseDown=null};Lr.prototype.up=function(t){if(this.done(),!!this.view.dom.contains(t.target.nodeType==3?t.target.parentNode:t.target)){var r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(zr(t))),this.allowDefault||!r?Ce(this.view,"pointer"):su(this.view,r.pos,r.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||x.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||x.chrome&&!(this.view.state.selection instanceof H)&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(Fe(this.view,D.near(this.view.state.doc.resolve(r.pos)),"pointer"),t.preventDefault()):Ce(this.view,"pointer")}};Lr.prototype.move=function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),Ce(this.view,"pointer"),t.buttons==0&&this.done()};Ct.touchdown=function(e){ro(e),Ce(e,"pointer")};Ct.contextmenu=function(e){return ro(e)};function Ts(e,t){return e.composing?!0:x.safari&&Math.abs(t.timeStamp-e.compositionEndedAt)<500?(e.compositionEndedAt=-2e8,!0):!1}var uu=x.android?5e3:-1;kt.compositionstart=kt.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,r=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(function(a){return a.type.spec.inclusive===!1})))e.markCursor=e.state.storedMarks||r.marks(),Fr(e,!0),e.markCursor=null;else if(Fr(e),x.gecko&&t.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length)for(var n=e.root.getSelection(),o=n.focusNode,i=n.focusOffset;o&&o.nodeType==1&&i!=0;){var s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){n.collapse(s,s.nodeValue.length);break}else o=s,i=-1}e.composing=!0}As(e,uu)};kt.compositionend=function(e,t){e.composing&&(e.composing=!1,e.compositionEndedAt=t.timeStamp,As(e,20))};function As(e,t){clearTimeout(e.composingTimeout),t>-1&&(e.composingTimeout=setTimeout(function(){return Fr(e)},t))}function _s(e){for(e.composing&&(e.composing=!1,e.compositionEndedAt=fu());e.compositionNodes.length>0;)e.compositionNodes.pop().markParentsDirty()}function fu(){var e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Fr(e,t){if(e.domObserver.forceFlush(),_s(e),t||e.docView.dirty){var r=ns(e);return r&&!r.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(r)):e.updateState(e.state),!0}return!1}function pu(e,t){if(!!e.dom.parentNode){var r=e.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(t),r.style.cssText="position: fixed; left: -10000px; top: 10px";var n=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),n.removeAllRanges(),n.addRange(o),setTimeout(function(){r.parentNode&&r.parentNode.removeChild(r),e.focus()},50)}}var Ve=x.ie&&x.ie_version<15||x.ios&&x.webkit_version<604;Ct.copy=kt.cut=function(e,t){var r=e.state.selection,n=t.type=="cut";if(!r.empty){var o=Ve?null:t.clipboardData,i=r.content(),s=gs(e,i),a=s.dom,c=s.text;o?(t.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",c)):pu(e,a),n&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}};function du(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function hu(e,t){if(!!e.dom.parentNode){var r=e.shiftKey||e.state.selection.$from.parent.type.spec.code,n=e.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(function(){e.focus(),n.parentNode&&n.parentNode.removeChild(n),r?no(e,n.value,null,t):no(e,n.textContent,n.innerHTML,t)},50)}}function no(e,t,r,n){var o=ys(e,t,r,e.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",function(a){return a(e,n,o||C.empty)}))return!0;if(!o)return!1;var i=du(o),s=i?e.state.tr.replaceSelectionWith(i,e.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}kt.paste=function(e,t){var r=Ve?null:t.clipboardData;r&&no(e,r.getData("text/plain"),r.getData("text/html"),t)?t.preventDefault():hu(e,t)};var mu=function(t,r){this.slice=t,this.move=r},Ns=x.mac?"altKey":"ctrlKey";Ct.dragstart=function(e,t){var r=e.mouseDown;if(r&&r.done(),!!t.dataTransfer){var n=e.state.selection,o=n.empty?null:e.posAtCoords(zr(t));if(!(o&&o.pos>=n.from&&o.pos<=(n instanceof E?n.to-1:n.to))){if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(E.create(e.state.doc,r.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){var i=e.docView.nearestDesc(t.target,!0);i&&i.node.type.spec.draggable&&i!=e.docView&&e.dispatch(e.state.tr.setSelection(E.create(e.state.doc,i.posBefore)))}}var s=e.state.selection.content(),a=gs(e,s),c=a.dom,l=a.text;t.dataTransfer.clearData(),t.dataTransfer.setData(Ve?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",Ve||t.dataTransfer.setData("text/plain",l),e.dragging=new mu(s,!t[Ns])}};Ct.dragend=function(e){var t=e.dragging;window.setTimeout(function(){e.dragging==t&&(e.dragging=null)},50)};kt.dragover=kt.dragenter=function(e,t){return t.preventDefault()};kt.drop=function(e,t){var r=e.dragging;if(e.dragging=null,!!t.dataTransfer){var n=e.posAtCoords(zr(t));if(!!n){var o=e.state.doc.resolve(n.pos);if(!!o){var i=r&&r.slice;i?e.someProp("transformPasted",function(h){i=h(i)}):i=ys(e,t.dataTransfer.getData(Ve?"Text":"text/plain"),Ve?null:t.dataTransfer.getData("text/html"),!1,o);var s=r&&!t[Ns];if(e.someProp("handleDrop",function(h){return h(e,t,i||C.empty,s)})){t.preventDefault();return}if(!!i){t.preventDefault();var a=i?Oi(e.state.doc,o.pos,i):o.pos;a==null&&(a=o.pos);var c=e.state.tr;s&&c.deleteSelection();var l=c.mapping.map(a),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,f=c.doc;if(u?c.replaceRangeWith(l,l,i.content.firstChild):c.replaceRange(l,l,i),!c.doc.eq(f)){var p=c.doc.resolve(l);if(u&&E.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new E(p));else{var d=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach(function(h,v,g,M){return d=M}),c.setSelection(qn(e,p,c.doc.resolve(d)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}}}}}};Ct.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.root.getSelection())&&fe(e)},20))};Ct.blur=function(e,t){e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.set({}),e.focused=!1)};Ct.beforeinput=function(e,t){if(x.chrome&&x.android&&t.inputType=="deleteContentBackward"){var r=e.domChangeCount;setTimeout(function(){if(e.domChangeCount==r&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",function(i){return i(e,ze(8,"Backspace"))}))){var n=e.state.selection,o=n.$cursor;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())}},50)}};for(var Es in kt)Ct[Es]=kt[Es];function lr(e,t){if(e==t)return!0;for(var r in e)if(e[r]!==t[r])return!1;for(var n in t)if(!(n in e))return!1;return!0}var ur=function(t,r){this.spec=r||Oe,this.side=this.spec.side||0,this.toDOM=t};ur.prototype.map=function(t,r,n,o){var i=t.mapResult(r.from+o,this.side<0?-1:1),s=i.pos,a=i.deleted;return a?null:new nt(s-n,s-n,this)};ur.prototype.valid=function(){return!0};ur.prototype.eq=function(t){return this==t||t instanceof ur&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&lr(this.spec,t.spec))};var Vt=function(t,r){this.spec=r||Oe,this.attrs=t};Vt.prototype.map=function(t,r,n,o){var i=t.map(r.from+o,this.spec.inclusiveStart?-1:1)-n,s=t.map(r.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new nt(i,s,this)};Vt.prototype.valid=function(t,r){return r.from=t&&(!i||i(a.spec))&&n.push(a.copy(a.from+o,a.to+o))}for(var c=0;ct){var l=this.children[c]+1;this.children[c+2].findInner(t-l,r-l,n,o+l,i)}};q.prototype.map=function(t,r,n){return this==st||t.maps.length==0?this:this.mapInner(t,r,0,0,n||Oe)};q.prototype.mapInner=function(t,r,n,o,i){for(var s,a=0;aa&&u.to=t){this.children[i]==t&&(n=this.children[i+2]);break}for(var s=t+1,a=s+r.content.size,c=0;cs&&l.type instanceof Vt){var u=Math.max(s,l.from)-s,f=Math.min(a,l.to)-s;uY+i||(rt>=a[G]+i?a[G+1]=-1:ut>=o&&(oe=qt-ut-(rt-Qt))&&(a[G]+=oe,a[G+1]+=oe))}},l=0;l=n.content.size){u=!0;continue}var h=r.map(e[f+1]+i,-1),v=h-o,g=n.content.findIndex(d),M=g.index,y=g.offset,R=n.maybeChild(M);if(R&&y==d&&y+R.nodeSize==v){var m=a[f+2].mapInner(r,R,p+1,e[f]+i+1,s);m!=st?(a[f]=d,a[f+1]=v,a[f+2]=m):(a[f+1]=-2,u=!0)}else u=!0}if(u){var I=gu(a,e,t||[],r,o,i,s),O=Hr(I,n,0,s);t=O.local;for(var F=0;Fr&&s.to0;)t++;e.splice(t,0,r)}function so(e){var t=[];return e.someProp("decorations",function(r){var n=r(e.state);n&&n!=st&&t.push(n)}),e.cursorWrapper&&t.push(q.create(e.state.doc,[e.cursorWrapper.deco])),zt.from(t)}var Z=function(t,r){this._props=r,this.state=r.state,this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):t.apply?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Ls(this),this.markCursor=null,this.cursorWrapper=null,zs(this),this.nodeViews=Fs(this),this.docView=Xi(this.state.doc,Bs(this),so(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,Zl(this),this.pluginViews=[],this.updatePluginViews()},ao={props:{configurable:!0},root:{configurable:!0}};ao.props.get=function(){if(this._props.state!=this.state){var e=this._props;this._props={};for(var t in e)this._props[t]=e[t];this._props.state=this.state}return this._props};Z.prototype.update=function(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Zn(this),this._props=t,this.updateStateInner(t.state,!0)};Z.prototype.setProps=function(t){var r={};for(var n in this._props)r[n]=this._props[n];r.state=this.state;for(var o in t)r[o]=t[o];this.update(r)};Z.prototype.updateState=function(t){this.updateStateInner(t,this.state.plugins!=t.plugins)};Z.prototype.updateStateInner=function(t,r){var n=this,o=this.state,i=!1,s=!1;if(t.storedMarks&&this.composing&&(_s(this),s=!0),this.state=t,r){var a=Fs(this);bu(a,this.nodeViews)&&(this.nodeViews=a,i=!0),Zn(this)}this.editable=Ls(this),zs(this);var c=so(this),l=Bs(this),u=r?"reset":t.scrollToSelection>o.scrollToSelection?"to selection":"preserve",f=i||!this.docView.matchesNode(t.doc,l,c);(f||!t.selection.eq(o.selection))&&(s=!0);var p=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&ll(this);if(s){this.domObserver.stop();var d=f&&(x.ie||x.chrome)&&!this.composing&&!o.selection.empty&&!t.selection.empty&&yu(o.selection,t.selection);if(f){var h=x.chrome?this.trackWrites=this.root.getSelection().focusNode:null;(i||!this.docView.update(t.doc,l,c,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Xi(t.doc,l,c,this.dom,this)),h&&!this.trackWrites&&(d=!0)}d||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&Bl(this))?fe(this,d):(ls(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(o),u=="reset")this.dom.scrollTop=0;else if(u=="to selection"){var v=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",function(g){return g(n)})||(t.selection instanceof E?Vi(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect(),v):Vi(this,this.coordsAtPos(t.selection.head,1),v))}else p&&ul(p)};Z.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()};Z.prototype.updatePluginViews=function(t){if(!t||t.plugins!=this.state.plugins){this.destroyPluginViews();for(var r=0;r",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Vs=typeof navigator!="undefined"&&/Chrome\/(\d+)/.exec(navigator.userAgent),ku=typeof navigator!="undefined"&&/Apple Computer/.test(navigator.vendor),Su=typeof navigator!="undefined"&&/Gecko\/\d+/.test(navigator.userAgent),Hs=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),Mu=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),xu=Vs&&(Hs||+Vs[1]<57)||Su&&Hs;for(var at=0;at<10;at++)pe[48+at]=pe[96+at]=String(at);for(var at=1;at<=24;at++)pe[at+111]="F"+at;for(var at=65;at<=90;at++)pe[at]=String.fromCharCode(at+32),jr[at]=String.fromCharCode(at);for(var co in pe)jr.hasOwnProperty(co)||(jr[co]=pe[co]);function Cu(e){var t=xu&&(e.ctrlKey||e.altKey||e.metaKey)||(ku||Mu)&&e.shiftKey&&e.key&&e.key.length==1,r=!t&&e.key||(e.shiftKey?jr:pe)[e.keyCode]||e.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}var Ou=typeof navigator!="undefined"?/Mac/.test(navigator.platform):!1;function wu(e){var t=e.split(/-(?!$)/),r=t[t.length-1];r=="Space"&&(r=" ");for(var n,o,i,s,a=0;a127)&&(s=pe[n.keyCode])&&s!=o){var c=t[lo(s,n,!0)];if(c&&c(r.state,r.dispatch,r))return!0}else if(i&&n.shiftKey){var l=t[lo(o,n,!0)];if(l&&l(r.state,r.dispatch,r))return!0}return!1}}var Ut=function(t,r){this.match=t,this.handler=typeof r=="string"?_u(r):r};function _u(e){return function(t,r,n,o){var i=e;if(r[1]){var s=r[0].lastIndexOf(r[1]);i+=r[0].slice(s+r[1].length),n+=s;var a=n-o;a>0&&(i=r[0].slice(s-a,s)+i,n=o)}return t.tr.insertText(i,n,o)}}var Nu=500;function Eu(e){var t=e.rules,r=new Rt({state:{init:function(){return null},apply:function(o,i){var s=o.getMeta(this);return s||(o.selectionSet||o.docChanged?null:i)}},props:{handleTextInput:function(o,i,s,a){return qs(o,i,s,a,t,r)},handleDOMEvents:{compositionend:function(n){setTimeout(function(){var o=n.state.selection,i=o.$cursor;i&&qs(n,i.pos,i.pos,"",t,r)})}}},isInputRules:!0});return r}function qs(e,t,r,n,o,i){if(e.composing)return!1;var s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;for(var c=a.parent.textBetween(Math.max(0,a.parentOffset-Nu),a.parentOffset,null,"\uFFFC")+n,l=0;l=0;c--)s.step(a.steps[c].invert(a.docs[c]));if(i.text){var l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,l))}else s.delete(i.from,i.to);t(s)}return!0}}return!1}new Ut(/--$/,"\u2014");new Ut(/\.\.\.$/,"\u2026");new Ut(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201C");new Ut(/"$/,"\u201D");new Ut(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018");new Ut(/'$/,"\u2019");function uo(e,t,r,n){return new Ut(e,function(o,i,s,a){var c=r instanceof Function?r(i):r,l=o.tr.delete(s,a),u=l.doc.resolve(s),f=u.blockRange(),p=f&&Sn(f,t,c);if(!p)return null;l.wrap(f,p);var d=l.doc.resolve(s-1).nodeBefore;return d&&d.type==t&&Mn(l.doc,s-1)&&(!n||n(i,d))&&l.join(s-1),l})}function fo(e,t,r){return new Ut(e,function(n,o,i,s){var a=n.doc.resolve(i),c=r instanceof Function?r(o):r;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?n.tr.delete(i,s).setBlockType(i,i,t,c):null})}function po(e,t){return e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)}function Js(e,t,r){var n=e.selection,o=n.$cursor;if(!o||(r?!r.endOfTextblock("backward",e):o.parentOffset>0))return!1;var i=Ks(o);if(!i){var s=o.blockRange(),a=s&&Pe(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}var c=i.nodeBefore;if(!c.type.spec.isolating&&ra(e,i,t))return!0;if(o.parent.content.size==0&&(He(c,"end")||E.isSelectable(c))){if(t){var l=e.tr.deleteRange(o.before(),o.after());l.setSelection(He(c,"end")?D.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):E.create(l.doc,i.pos-c.nodeSize)),t(l.scrollIntoView())}return!0}return c.isAtom&&i.depth==o.depth-1?(t&&t(e.tr.delete(i.pos-c.nodeSize,i.pos).scrollIntoView()),!0):!1}function He(e,t,r){for(;e;e=t=="start"?e.firstChild:e.lastChild){if(e.isTextblock)return!0;if(r&&e.childCount!=1)return!1}return!1}function Ws(e,t,r){var n=e.selection,o=n.$head,i=n.empty,s=o;if(!i)return!1;if(o.parent.isTextblock){if(r?!r.endOfTextblock("backward",e):o.parentOffset>0)return!1;s=Ks(o)}var a=s&&s.nodeBefore;return!a||!E.isSelectable(a)?!1:(t&&t(e.tr.setSelection(E.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)}function Ks(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function $s(e,t,r){var n=e.selection,o=n.$cursor;if(!o||(r?!r.endOfTextblock("forward",e):o.parentOffset=0;t--){var r=e.node(t);if(e.index(t)+11&&n.after()!=n.end(-1)){var o=n.before();if(ee(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}var i=n.blockRange(),s=i&&Pe(i);return s==null?!1:(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)}function Iu(e,t){var r=e.selection,n=r.$from,o=r.$to;if(e.selection instanceof E&&e.selection.node.isBlock)return!n.parentOffset||!ee(e.doc,n.pos)?!1:(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(t){var i=o.parentOffset==o.parent.content.size,s=e.tr;(e.selection instanceof H||e.selection instanceof re)&&s.deleteSelection();var a=n.depth==0?null:ho(n.node(-1).contentMatchAt(n.indexAfter(-1))),c=i&&a?[{type:a}]:null,l=ee(s.doc,s.mapping.map(n.pos),1,c);if(!c&&!l&&ee(s.doc,s.mapping.map(n.pos),1,a&&[{type:a}])&&(c=[{type:a}],l=!0),l&&(s.split(s.mapping.map(n.pos),1,c),!i&&!n.parentOffset&&n.parent.type!=a)){var u=s.mapping.map(n.before()),f=s.doc.resolve(u);n.node(-1).canReplaceWith(f.index(),f.index()+1,a)&&s.setNodeMarkup(s.mapping.map(n.before()),a)}t(s.scrollIntoView())}return!0}function Ru(e,t){var r=e.selection,n=r.$from,o=r.to,i,s=n.sharedDepth(o);return s==0?!1:(i=n.before(s),t&&t(e.tr.setSelection(E.create(e.doc,i))),!0)}function ea(e,t){return t&&t(e.tr.setSelection(new re(e.doc))),!0}function Pu(e,t,r){var n=t.nodeBefore,o=t.nodeAfter,i=t.index();return!n||!o||!n.type.compatibleContent(o.type)?!1:!n.content.size&&t.parent.canReplace(i-1,i)?(r&&r(e.tr.delete(t.pos-n.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(o.isTextblock||Mn(e.doc,t.pos))?!1:(r&&r(e.tr.clearIncompatible(t.pos,n.type,n.contentMatchAt(n.childCount)).join(t.pos).scrollIntoView()),!0)}function ra(e,t,r){var n=t.nodeBefore,o=t.nodeAfter,i,s;if(n.type.spec.isolating||o.type.spec.isolating)return!1;if(Pu(e,t,r))return!0;var a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(i=(s=n.contentMatchAt(n.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(r){for(var c=t.pos+o.nodeSize,l=k.empty,u=i.length-1;u>=0;u--)l=k.from(i[u].create(null,l));l=k.from(n.copy(l));var f=e.tr.step(new xt(t.pos-1,c,t.pos,c,new C(l,1,0),i.length,!0)),p=c+2*i.length;Mn(f.doc,p)&&f.join(p),r(f.scrollIntoView())}return!0}var d=D.findFrom(t,1),h=d&&d.$from.blockRange(d.$to),v=h&&Pe(h);if(v!=null&&v>=t.depth)return r&&r(e.tr.lift(h,v).scrollIntoView()),!0;if(a&&He(o,"start",!0)&&He(n,"end")){for(var g=n,M=[];M.push(g),!g.isTextblock;)g=g.lastChild;for(var y=o,R=1;!y.isTextblock;y=y.firstChild)R++;if(g.canReplace(g.childCount,g.childCount,y.content)){if(r){for(var m=k.empty,I=M.length-1;I>=0;I--)m=k.from(M[I].copy(m));var O=e.tr.step(new xt(t.pos-M.length,t.pos+o.nodeSize,t.pos+R,t.pos+o.nodeSize-R,new C(m,M.length,0),0,!0));r(O.scrollIntoView())}return!0}}return!1}function na(e,t){return function(r,n){var o=r.selection,i=o.$from,s=o.$to,a=i.blockRange(s),c=a&&Sn(a,e,t);return c?(n&&n(r.tr.wrap(a,c).scrollIntoView()),!0):!1}}function Bu(e,t){return function(r,n){var o=r.selection,i=o.from,s=o.to,a=!1;return r.doc.nodesBetween(i,s,function(c,l){if(a)return!1;if(!(!c.isTextblock||c.hasMarkup(e,t)))if(c.type==e)a=!0;else{var u=r.doc.resolve(l),f=u.index();a=u.parent.canReplaceWith(f,f+1,e)}}),a?(n&&n(r.tr.setBlockType(i,s,e,t).scrollIntoView()),!0):!1}}function mo(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(r,n,o){for(var i=0;i=2&&i.node(a.depth-1).type.compatibleContent(e)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;var u=r.doc.resolve(a.start-2);l=new Ge(u,u,a.depth),a.endIndex=0;s--)i=k.from(r[s].type.create(r[s].attrs,i));e.step(new xt(t.start-(n?2:0),t.end,t.start,t.end,new C(i,0,0),r.length,!0));for(var a=0,c=0;ca;s--)i-=o.child(s).nodeSize,n.delete(i-1,i+1);var c=n.doc.resolve(r.start),l=c.nodeAfter,u=r.startIndex==0,f=r.endIndex==o.childCount,p=c.node(-1),d=c.index(-1);if(!p.canReplace(d+(u?0:1),d+1,l.content.append(f?k.empty:k.from(o))))return!1;var h=c.pos,v=h+l.nodeSize;return n.step(new xt(h-(u?1:0),v+(f?1:0),h+1,v-1,new C((u?k.empty:k.from(o.copy(k.empty))).append(f?k.empty:k.from(o.copy(k.empty))),u?0:1,f?0:1),u?0:1)),t(n.scrollIntoView()),!0}function qu(e){return function(t,r){var n=t.selection,o=n.$from,i=n.$to,s=o.blockRange(i,function(v){return v.childCount&&v.firstChild.type==e});if(!s)return!1;var a=s.startIndex;if(a==0)return!1;var c=s.parent,l=c.child(a-1);if(l.type!=e)return!1;if(r){var u=l.lastChild&&l.lastChild.type==c.type,f=k.from(u?e.create():null),p=new C(k.from(e.create(null,k.from(c.type.create(null,f)))),u?3:1,0),d=s.start,h=s.end;r(t.tr.step(new xt(d-(u?3:1),h,d,h,p,1,!0)).scrollIntoView())}return!0}}function qr(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function tt(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function Ju(e,t){const r=tt(t,e.schema),{from:n,to:o}=e.selection;let i=[];e.doc.nodesBetween(n,o,a=>{i=[...i,a]});const s=i.reverse().find(a=>a.type.name===r.name);return s?S({},s.attrs):{}}function he(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function aa(e,t){const r=he(t,e.schema),{from:n,to:o,empty:i}=e.selection;let s=[];i?s=e.selection.$head.marks():e.doc.nodesBetween(n,o,c=>{s=[...s,...c.marks]});const a=s.find(c=>c.type.name===r.name);return a?S({},a.attrs):{}}function Wu(e,t){const r=qr(typeof t=="string"?t:t.name,e.schema);return r==="node"?Ju(e,t):r==="mark"?aa(e,t):{}}function pr(e,t){const r=Object.keys(t);return r.length?!!r.filter(n=>t[n]===e[n]).length:!0}function je(e,t,r={}){const{from:n,to:o,empty:i}=e.selection,s=t?tt(t,e.schema):null;let a=[];if(e.doc.nodesBetween(n,o,(u,f)=>{if(!u.isText){const p=Math.max(n,f),d=Math.min(o,f+u.nodeSize);a=[...a,{node:u,from:p,to:d}]}}),i)return!!a.filter(u=>s?s.name===u.node.type.name:!0).find(u=>pr(u.node.attrs,r));const c=o-n;return a.filter(u=>s?s.name===u.node.type.name:!0).filter(u=>pr(u.node.attrs,r)).reduce((u,f)=>{const p=f.to-f.from;return u+p},0)>=c}function vo(e,t,r={}){const{from:n,to:o,empty:i}=e.selection,s=t?he(t,e.schema):null;if(i)return!!(e.storedMarks||e.selection.$from.marks()).filter(p=>s?s.name===p.type.name:!0).find(p=>pr(p.attrs,r));let a=0,c=[];if(e.doc.nodesBetween(n,o,(p,d)=>{if(p.isText){const h=Math.max(n,d),v=Math.min(o,d+p.nodeSize);a+=v-h,c=[...c,...p.marks.map(M=>({mark:M,from:h,to:v}))]}}),a===0)return!1;const l=c.filter(p=>s?s.name===p.mark.type.name:!0).filter(p=>pr(p.mark.attrs,r)).reduce((p,d)=>{const h=d.to-d.from;return p+h},0),u=c.filter(p=>s?p.mark.type!==s&&p.mark.type.excludes(s):!0).reduce((p,d)=>{const h=d.to-d.from;return p+h},0);return(l>0?l+u:l)>=a}function Ku(e,t,r={}){if(!t)return je(e,null,r)||vo(e,null,r);const n=qr(t,e.schema);return n==="node"?je(e,t,r):n==="mark"?vo(e,t,r):!1}function $u(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ca(e){const t=`${e}`;return new window.DOMParser().parseFromString(t,"text/html").body}function Jr(e,t,r){if(r=S({slice:!0,parseOptions:{}},r),typeof e=="object"&&e!==null)try{return Array.isArray(e)?k.fromArray(e.map(n=>t.nodeFromJSON(n))):t.nodeFromJSON(e)}catch(n){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",n),Jr("",t,r)}if(typeof e=="string"){const n=Lt.fromSchema(t);return r.slice?n.parseSlice(ca(e),r.parseOptions).content:n.parse(ca(e),r.parseOptions)}return Jr("",t,r)}function la(e,t,r={}){return Jr(e,t,{slice:!1,parseOptions:r})}function Uu(e,t){const r=ot.fromSchema(t).serializeFragment(e.content),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(r),o.innerHTML}function Gu(e){var t;const r=(t=e.type.createAndFill())===null||t===void 0?void 0:t.toJSON(),n=e.toJSON();return JSON.stringify(r)===JSON.stringify(n)}function Yu(e){const t=document.querySelector("style[data-tiptap-style]");if(t!==null)return t;const r=document.createElement("style");return r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}class Xu{constructor(t,r){this.editor=t,this.commands=r}createCommands(){const{commands:t,editor:r}=this,{state:n,view:o}=r,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([a,c])=>[a,(...u)=>{const f=c(...u)(s);return i.getMeta("preventDispatch")||o.dispatch(i),f}]))}createChain(t,r=!0){const{commands:n,editor:o}=this,{state:i,view:s}=o,a=[],c=!!t,l=t||i.tr,u=()=>(!c&&r&&!l.getMeta("preventDispatch")&&s.dispatch(l),a.every(p=>p===!0)),f=Tt(S({},Object.fromEntries(Object.entries(n).map(([p,d])=>[p,(...v)=>{const g=this.buildProps(l,r),M=d(...v)(g);return a.push(M),f}]))),{run:u});return f}createCan(t){const{commands:r,editor:n}=this,{state:o}=n,i=void 0,s=t||o.tr,a=this.buildProps(s,i),c=Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...f)=>u(...f)(Tt(S({},a),{dispatch:i}))]));return Tt(S({},c),{chain:()=>this.createChain(s,i)})}buildProps(t,r=!0){const{editor:n,commands:o}=this,{state:i,view:s}=n;i.storedMarks&&t.setStoredMarks(i.storedMarks);const a={tr:t,editor:n,view:s,state:this.chainableState(t,i),dispatch:r?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(o).map(([c,l])=>[c,(...u)=>l(...u)(a)]))}};return a}chainableState(t,r){let{selection:n}=t,{doc:o}=t,{storedMarks:i}=t;return Tt(S({},r),{schema:r.schema,plugins:r.plugins,apply:r.apply.bind(r),applyTransaction:r.applyTransaction.bind(r),reconfigure:r.reconfigure.bind(r),toJSON:r.toJSON.bind(r),get storedMarks(){return i},get selection(){return n},get doc(){return o},get tr(){return n=t.selection,o=t.doc,i=t.storedMarks,t}})}}function _(e,t,r={}){return e.config[t]===void 0&&e.parent?_(e.parent,t,r):typeof e.config[t]=="function"?e.config[t].bind(Tt(S({},r),{parent:e.parent?_(e.parent,t,r):null})):e.config[t]}function dr(e){const t=e.filter(o=>o.type==="extension"),r=e.filter(o=>o.type==="node"),n=e.filter(o=>o.type==="mark");return{baseExtensions:t,nodeExtensions:r,markExtensions:n}}function ua(e){const t=[],{nodeExtensions:r,markExtensions:n}=dr(e),o=[...r,...n],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0};return e.forEach(s=>{const a={name:s.name,options:s.options},c=_(s,"addGlobalAttributes",a);if(!c)return;c().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([p,d])=>{t.push({type:f,name:p,attribute:S(S({},i),d)})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options},c=_(s,"addAttributes",a);if(!c)return;const l=c();Object.entries(l).forEach(([u,f])=>{t.push({type:s.name,name:u,attribute:S(S({},i),f)})})}),t}function Ot(...e){return e.filter(t=>!!t).reduce((t,r)=>{const n=S({},t);return Object.entries(r).forEach(([o,i])=>{if(!n[o]){n[o]=i;return}o==="class"?n[o]=[n[o],i].join(" "):o==="style"?n[o]=[n[o],i].join("; "):n[o]=i}),n},{})}function go(e,t){return t.filter(r=>r.attribute.rendered).map(r=>r.attribute.renderHTML?r.attribute.renderHTML(e.attrs)||{}:{[r.name]:e.attrs[r.name]}).reduce((r,n)=>Ot(r,n),{})}function Qu(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Zu(e){return typeof e!="string"?e:e.match(/^\d*(\.\d+)?$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function fa(e,t){return e.style?e:Tt(S({},e),{getAttrs:r=>{const n=e.getAttrs?e.getAttrs(r):e.attrs;if(n===!1)return!1;const o=t.filter(i=>i.attribute.rendered).reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(r)||{}:{[s.name]:Zu(r.getAttribute(s.name))},c=Object.fromEntries(Object.entries(a).filter(([,l])=>l!=null));return S(S({},i),c)},{});return S(S({},n),o)}})}function et(e,t=void 0,...r){return typeof e=="function"?t?e.bind(t)(...r):e(...r):e}function pa(e){return Object.fromEntries(Object.entries(e).filter(([t,r])=>t==="attrs"&&Qu(r)?!1:r!=null))}function tf(e){var t;const r=ua(e),{nodeExtensions:n,markExtensions:o}=dr(e),i=(t=n.find(c=>_(c,"topNode")))===null||t===void 0?void 0:t.name,s=Object.fromEntries(n.map(c=>{const l=r.filter(v=>v.type===c.name),u={name:c.name,options:c.options},f=e.reduce((v,g)=>{const M=_(g,"extendNodeSchema",u);return S(S({},v),M?M(c):{})},{}),p=pa(Tt(S({},f),{content:et(_(c,"content",u)),marks:et(_(c,"marks",u)),group:et(_(c,"group",u)),inline:et(_(c,"inline",u)),atom:et(_(c,"atom",u)),selectable:et(_(c,"selectable",u)),draggable:et(_(c,"draggable",u)),code:et(_(c,"code",u)),defining:et(_(c,"defining",u)),isolating:et(_(c,"isolating",u)),attrs:Object.fromEntries(l.map(v=>{var g;return[v.name,{default:(g=v==null?void 0:v.attribute)===null||g===void 0?void 0:g.default}]}))})),d=et(_(c,"parseHTML",u));d&&(p.parseDOM=d.map(v=>fa(v,l)));const h=_(c,"renderHTML",u);return h&&(p.toDOM=v=>h({node:v,HTMLAttributes:go(v,l)})),[c.name,p]})),a=Object.fromEntries(o.map(c=>{const l=r.filter(v=>v.type===c.name),u={name:c.name,options:c.options},f=e.reduce((v,g)=>{const M=_(g,"extendMarkSchema",u);return S(S({},v),M?M(c):{})},{}),p=pa(Tt(S({},f),{inclusive:et(_(c,"inclusive",u)),excludes:et(_(c,"excludes",u)),group:et(_(c,"group",u)),spanning:et(_(c,"spanning",u)),attrs:Object.fromEntries(l.map(v=>{var g;return[v.name,{default:(g=v==null?void 0:v.attribute)===null||g===void 0?void 0:g.default}]}))})),d=et(_(c,"parseHTML",u));d&&(p.parseDOM=d.map(v=>fa(v,l)));const h=_(c,"renderHTML",u);return h&&(p.toDOM=v=>h({mark:v,HTMLAttributes:go(v,l)})),[c.name,p]}));return new Se({topNode:i,nodes:s,marks:a})}function yo(e,t){return t.nodes[e]?t.nodes[e]:t.marks[e]?t.marks[e]:null}class hr{constructor(t,r){this.splittableMarks=[],this.editor=r,this.extensions=hr.resolve(t),this.schema=tf(this.extensions),this.extensions.forEach(n=>{var o;const i={name:n.name,options:n.options,editor:this.editor,type:yo(n.name,this.schema)};n.type==="mark"&&((o=et(_(n,"keepOnSplit",i)))!==null&&o!==void 0?o:!0)&&this.splittableMarks.push(n.name);const s=_(n,"onBeforeCreate",i);s&&this.editor.on("beforeCreate",s);const a=_(n,"onCreate",i);a&&this.editor.on("create",a);const c=_(n,"onUpdate",i);c&&this.editor.on("update",c);const l=_(n,"onSelectionUpdate",i);l&&this.editor.on("selectionUpdate",l);const u=_(n,"onTransaction",i);u&&this.editor.on("transaction",u);const f=_(n,"onFocus",i);f&&this.editor.on("focus",f);const p=_(n,"onBlur",i);p&&this.editor.on("blur",p);const d=_(n,"onDestroy",i);d&&this.editor.on("destroy",d)})}static resolve(t){return hr.sort(hr.flatten(t))}static flatten(t){return t.map(r=>{const n={name:r.name,options:r.options},o=_(r,"addExtensions",n);return o?[r,...this.flatten(o())]:r}).flat(10)}static sort(t){const r=100;return t.sort((n,o)=>{const i=_(n,"priority")||r,s=_(o,"priority")||r;return i>s?-1:i{const n={name:r.name,options:r.options,editor:this.editor,type:yo(r.name,this.schema)},o=_(r,"addCommands",n);return o?S(S({},t),o()):t},{})}get plugins(){return[...this.extensions].reverse().map(t=>{const r={name:t.name,options:t.options,editor:this.editor,type:yo(t.name,this.schema)},n=[],o=_(t,"addKeyboardShortcuts",r);if(o){const c=Object.fromEntries(Object.entries(o()).map(([u,f])=>[u,()=>f({editor:this.editor})])),l=Au(c);n.push(l)}const i=_(t,"addInputRules",r);if(this.editor.options.enableInputRules&&i){const c=i(),l=c.length?[Eu({rules:c})]:[];n.push(...l)}const s=_(t,"addPasteRules",r);if(this.editor.options.enablePasteRules&&s){const c=s();n.push(...c)}const a=_(t,"addProseMirrorPlugins",r);if(a){const c=a();n.push(...c)}return n}).flat()}get attributes(){return ua(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:r}=dr(this.extensions);return Object.fromEntries(r.filter(n=>!!_(n,"addNodeView")).map(n=>{const o=this.attributes.filter(c=>c.type===n.name),i={name:n.name,options:n.options,editor:t,type:tt(n.name,this.schema)},s=_(n,"addNodeView",i);if(!s)return[];const a=(c,l,u,f)=>{const p=go(c,o);return s()({editor:t,node:c,getPos:u,decorations:f,HTMLAttributes:p,extension:n})};return[n.name,a]}))}get textSerializers(){const{editor:t}=this,{nodeExtensions:r}=dr(this.extensions);return Object.fromEntries(r.filter(n=>!!_(n,"renderText")).map(n=>{const o={name:n.name,options:n.options,editor:t,type:tt(n.name,this.schema)},i=_(n,"renderText",o);if(!i)return[];const s=a=>i(a);return[n.name,s]}))}}class ef{constructor(){this.callbacks={}}on(t,r){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(r),this}emit(t,...r){const n=this.callbacks[t];return n&&n.forEach(o=>o.apply(this,r)),this}off(t,r){const n=this.callbacks[t];return n&&(r?this.callbacks[t]=n.filter(o=>o!==r):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}function rf(e){return Object.prototype.toString.call(e).slice(8,-1)}function bo(e){return rf(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Wr(e,t){const r=S({},e);return bo(e)&&bo(t)&&Object.keys(t).forEach(n=>{bo(t[n])?n in e?r[n]=Wr(e[n],t[n]):Object.assign(r,{[n]:t[n]}):Object.assign(r,{[n]:t[n]})}),r}class St{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=S(S({},this.config),t),this.name=this.config.name,this.options=this.config.defaultOptions}static create(t={}){return new St(t)}configure(t={}){const r=this.extend();return r.options=Wr(this.options,t),r}extend(t={}){const r=new St(t);return r.parent=this,this.child=r,r.name=t.name?t.name:r.parent.name,r.options=t.defaultOptions?t.defaultOptions:r.parent.options,r}}const nf=(e,t,r,n,o)=>{let i="",s=!0;return e.state.doc.nodesBetween(t,r,(a,c)=>{var l;const u=e.extensionManager.textSerializers[a.type.name];u?(i+=u({node:a}),s=!n):a.isText?(i+=(l=a==null?void 0:a.text)===null||l===void 0?void 0:l.slice(Math.max(t,c)-c,r-c),s=!n):a.isLeaf&&o?(i+=o,s=!n):!s&&a.isBlock&&(i+=n,s=!0)},0),i},of=St.create({name:"editable",addProseMirrorPlugins(){return[new Rt({key:new Wt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{from:t,to:r}=e.state.selection;return nf(e,t,r,` `)}}})]}}),sf=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{e.isDestroyed||t.dom.blur()}),!0);var af=Object.freeze({__proto__:null,blur:sf});const cf=(e=!1)=>({commands:t})=>t.setContent("",e);var lf=Object.freeze({__proto__:null,clearContent:cf});const uf=()=>({state:e,tr:t,dispatch:r})=>{const{selection:n}=t,{ranges:o}=n;return o.forEach(i=>{e.doc.nodesBetween(i.$from.pos,i.$to.pos,(s,a)=>{if(s.type.isText)return;const c=t.doc.resolve(t.mapping.map(a)),l=t.doc.resolve(t.mapping.map(a+s.nodeSize)),u=c.blockRange(l);if(!u)return;const f=Pe(u);if(s.type.isTextblock&&r){const{defaultType:p}=c.parent.contentMatchAt(c.index());t.setNodeMarkup(u.start,p)}(f||f===0)&&r&&t.lift(u,f)})}),!0};var ff=Object.freeze({__proto__:null,clearNodes:uf});const pf=e=>t=>e(t);var df=Object.freeze({__proto__:null,command:pf});const hf=()=>({state:e,dispatch:t})=>Zs(e,t);var mf=Object.freeze({__proto__:null,createParagraphNear:hf});const vf=e=>({tr:t,state:r,dispatch:n})=>{const o=tt(e,r.schema),i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(n){const c=i.before(s),l=i.after(s);t.delete(c,l).scrollIntoView()}return!0}return!1};var gf=Object.freeze({__proto__:null,deleteNode:vf});const yf=e=>({tr:t,dispatch:r})=>{const{from:n,to:o}=e;return r&&t.delete(n,o),!0};var bf=Object.freeze({__proto__:null,deleteRange:yf});const kf=()=>({state:e,dispatch:t})=>po(e,t);var Sf=Object.freeze({__proto__:null,deleteSelection:kf});const Mf=()=>({commands:e})=>e.keyboardShortcut("Enter");var xf=Object.freeze({__proto__:null,enter:Mf});const Cf=()=>({state:e,dispatch:t})=>Qs(e,t);var Of=Object.freeze({__proto__:null,exitCode:Cf});function ko(e,t,r={}){return e.find(n=>n.type===t&&pr(n.attrs,r))}function wf(e,t,r={}){return!!ko(e,t,r)}function da(e,t,r={}){if(!e||!t)return;const n=e.parent.childAfter(e.parentOffset);if(!n.node)return;const o=ko(n.node.marks,t,r);if(!o)return;let i=e.index(),s=e.start()+n.offset,a=i+1,c=s+n.node.nodeSize;for(ko(n.node.marks,t,r);i>0&&o.isInSet(e.parent.child(i-1).marks);)i-=1,s-=e.parent.child(i).nodeSize;for(;a({tr:r,state:n,dispatch:o})=>{const i=he(e,n.schema),{doc:s,selection:a}=r,{$from:c,from:l,to:u}=a;if(o){const f=da(c,i,t);if(f&&f.from<=l&&f.to>=u){const p=H.create(s,f.from,f.to);r.setSelection(p)}}return!0};var Af=Object.freeze({__proto__:null,extendMarkRange:Tf});const _f=e=>t=>{const r=typeof e=="function"?e(t):e;for(let n=0;n({editor:t,view:r,tr:n,dispatch:o})=>{const i=()=>{requestAnimationFrame(()=>{t.isDestroyed||r.focus()})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!ma(t.state.selection))return i(),!0;const{from:s,to:a}=Df(t.state,e)||t.state.selection,{doc:c,storedMarks:l}=n,u=D.atStart(c).from,f=D.atEnd(c).to,p=mr(s,u,f),d=mr(a,u,f),h=H.create(c,p,d),v=t.state.selection.eq(h);return o&&(v||n.setSelection(h),v&&l&&n.setStoredMarks(l),i()),!0};var Rf=Object.freeze({__proto__:null,focus:If});const Pf=(e,t)=>r=>e.every((n,o)=>t(n,Tt(S({},r),{index:o})));var Bf=Object.freeze({__proto__:null,forEach:Pf});const zf=(e,t)=>({tr:r,commands:n})=>n.insertContentAt({from:r.selection.from,to:r.selection.to},e,t);var Lf=Object.freeze({__proto__:null,insertContent:zf});function Ff(e,t,r){const n=e.steps.length-1;if(n{s===0&&(s=u)}),e.setSelection(D.near(e.doc.resolve(s),r))}const Vf=(e,t,r)=>({tr:n,dispatch:o,editor:i})=>{if(o){const s=Jr(t,i.schema,S({parseOptions:{preserveWhitespace:"full"}},r||{}));if(s.toString()==="<>")return!0;const{from:a,to:c}=typeof e=="number"?{from:e,to:e}:e;n.replaceWith(a,c,s),Ff(n,n.steps.length-1,1)}return!0};var Hf=Object.freeze({__proto__:null,insertContentAt:Vf});const jf=()=>({state:e,dispatch:t})=>Js(e,t);var qf=Object.freeze({__proto__:null,joinBackward:jf});const Jf=()=>({state:e,dispatch:t})=>$s(e,t);var Wf=Object.freeze({__proto__:null,joinForward:Jf});const Kf=typeof navigator!="undefined"?/Mac/.test(navigator.platform):!1;function $f(e){const t=e.split(/-(?!$)/);let r=t[t.length-1];r==="Space"&&(r=" ");let n,o,i,s;for(let a=0;a({editor:t,view:r,tr:n,dispatch:o})=>{const i=$f(e).split(/-(?!$)/),s=i.find(l=>!["Alt","Ctrl","Meta","Shift"].includes(l)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{r.someProp("handleKeyDown",l=>l(r,a))});return c==null||c.steps.forEach(l=>{const u=l.map(n.mapping);u&&o&&n.maybeStep(u)}),!0};var Gf=Object.freeze({__proto__:null,keyboardShortcut:Uf});const Yf=(e,t={})=>({state:r,dispatch:n})=>{const o=tt(e,r.schema);return je(r,o,t)?Ys(r,n):!1};var Xf=Object.freeze({__proto__:null,lift:Yf});const Qf=()=>({state:e,dispatch:t})=>ta(e,t);var Zf=Object.freeze({__proto__:null,liftEmptyBlock:Qf});const tp=e=>({state:t,dispatch:r})=>{const n=tt(e,t.schema);return Vu(n)(t,r)};var ep=Object.freeze({__proto__:null,liftListItem:tp});const rp=()=>({state:e,dispatch:t})=>Xs(e,t);var np=Object.freeze({__proto__:null,newlineInCode:rp});function va(e,t){const r=typeof t=="string"?[t]:t;return Object.keys(e).reduce((n,o)=>(r.includes(o)||(n[o]=e[o]),n),{})}const op=(e,t)=>({tr:r,state:n,dispatch:o})=>{let i=null,s=null;const a=qr(typeof e=="string"?e:e.name,n.schema);return a?(a==="node"&&(i=tt(e,n.schema)),a==="mark"&&(s=he(e,n.schema)),o&&r.selection.ranges.forEach(c=>{n.doc.nodesBetween(c.$from.pos,c.$to.pos,(l,u)=>{i&&i===l.type&&r.setNodeMarkup(u,void 0,va(l.attrs,t)),s&&l.marks.length&&l.marks.forEach(f=>{s===f.type&&r.addMark(u,u+l.nodeSize,s.create(va(f.attrs,t)))})})}),!0):!1};var ip=Object.freeze({__proto__:null,resetAttributes:op});const sp=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0);var ap=Object.freeze({__proto__:null,scrollIntoView:sp});const cp=()=>({state:e,dispatch:t})=>ea(e,t);var lp=Object.freeze({__proto__:null,selectAll:cp});const up=()=>({state:e,dispatch:t})=>Ws(e,t);var fp=Object.freeze({__proto__:null,selectNodeBackward:up});const pp=()=>({state:e,dispatch:t})=>Us(e,t);var dp=Object.freeze({__proto__:null,selectNodeForward:pp});const hp=()=>({state:e,dispatch:t})=>Ru(e,t);var mp=Object.freeze({__proto__:null,selectParentNode:hp});const vp=(e,t=!1,r={})=>({tr:n,editor:o,dispatch:i})=>{const{doc:s}=n,a=la(e,o.schema,r),c=H.create(s,0,s.content.size);return i&&n.setSelection(c).replaceSelectionWith(a,!1).setMeta("preventUpdate",!t),!0};var gp=Object.freeze({__proto__:null,setContent:vp});const yp=(e,t={})=>({tr:r,state:n,dispatch:o})=>{const{selection:i}=r,{empty:s,ranges:a}=i,c=he(e,n.schema);if(o)if(s){const l=aa(n,c);r.addStoredMark(c.create(S(S({},l),t)))}else a.forEach(l=>{const u=l.$from.pos,f=l.$to.pos;n.doc.nodesBetween(u,f,(p,d)=>{const h=Math.max(d,u),v=Math.min(d+p.nodeSize,f);p.marks.find(M=>M.type===c)?p.marks.forEach(M=>{c===M.type&&r.addMark(h,v,c.create(S(S({},M.attrs),t)))}):r.addMark(h,v,c.create(t))})});return!0};var bp=Object.freeze({__proto__:null,setMark:yp});const kp=(e,t)=>({tr:r})=>(r.setMeta(e,t),!0);var Sp=Object.freeze({__proto__:null,setMeta:kp});const Mp=(e,t={})=>({state:r,dispatch:n})=>{const o=tt(e,r.schema);return Bu(o,t)(r,n)};var xp=Object.freeze({__proto__:null,setNode:Mp});const Cp=e=>({tr:t,dispatch:r})=>{if(r){const{doc:n}=t,o=D.atStart(n).from,i=D.atEnd(n).to,s=mr(e,o,i),a=E.create(n,s);t.setSelection(a)}return!0};var Op=Object.freeze({__proto__:null,setNodeSelection:Cp});const wp=e=>({tr:t,dispatch:r})=>{if(r){const{doc:n}=t,{from:o,to:i}=typeof e=="number"?{from:e,to:e}:e,s=D.atStart(n).from,a=D.atEnd(n).to,c=mr(o,s,a),l=mr(i,s,a),u=H.create(n,c,l);t.setSelection(u)}return!0};var Tp=Object.freeze({__proto__:null,setTextSelection:wp});const Ap=e=>({state:t,dispatch:r})=>{const n=tt(e,t.schema);return qu(n)(t,r)};var _p=Object.freeze({__proto__:null,sinkListItem:Ap});function Kr(e,t,r){return Object.fromEntries(Object.entries(r).filter(([n])=>{const o=e.find(i=>i.type===t&&i.name===n);return o?o.attribute.keepOnSplit:!1}))}function Np(e){for(let t=0;tt==null?void 0:t.includes(o.type.name));e.tr.ensureMarks(n)}}const Ep=({keepMarks:e=!0}={})=>({tr:t,state:r,dispatch:n,editor:o})=>{const{selection:i,doc:s}=t,{$from:a,$to:c}=i,l=o.extensionManager.attributes,u=Kr(l,a.node().type.name,a.node().attrs);if(i instanceof E&&i.node.isBlock)return!a.parentOffset||!ee(s,a.pos)?!1:(n&&(e&&ga(r,o.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(n){const f=c.parentOffset===c.parent.content.size;i instanceof H&&t.deleteSelection();const p=a.depth===0?void 0:Np(a.node(-1).contentMatchAt(a.indexAfter(-1)));let d=f&&p?[{type:p,attrs:u}]:void 0,h=ee(t.doc,t.mapping.map(a.pos),1,d);if(!d&&!h&&ee(t.doc,t.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(h=!0,d=p?[{type:p,attrs:u}]:void 0),h&&(t.split(t.mapping.map(a.pos),1,d),p&&!f&&!a.parentOffset&&a.parent.type!==p)){const v=t.mapping.map(a.before()),g=t.doc.resolve(v);a.node(-1).canReplaceWith(g.index(),g.index()+1,p)&&t.setNodeMarkup(t.mapping.map(a.before()),p)}e&&ga(r,o.extensionManager.splittableMarks),t.scrollIntoView()}return!0};var Dp=Object.freeze({__proto__:null,splitBlock:Ep});const Ip=e=>({tr:t,state:r,dispatch:n,editor:o})=>{var i;const s=tt(e,r.schema),{$from:a,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||a.depth<2||!a.sameParent(c))return!1;const u=a.node(-1);if(u.type!==s)return!1;const f=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(n){let g=k.empty;const M=a.index(-1)?1:a.index(-2)?2:3;for(let F=a.depth-M;F>=a.depth-3;F-=1)g=k.from(a.node(F).copy(g));const y=a.indexAfter(-1){if(O>-1)return!1;F.isTextblock&&F.content.size===0&&(O=J+1)}),O>-1&&t.setSelection(H.near(t.doc.resolve(O))),t.scrollIntoView()}return!0}const p=c.pos===a.end()?u.contentMatchAt(0).defaultType:null,d=Kr(f,u.type.name,u.attrs),h=Kr(f,a.node().type.name,a.node().attrs);t.delete(a.pos,c.pos);const v=p?[{type:s,attrs:d},{type:p,attrs:h}]:[{type:s,attrs:d}];return ee(t.doc,a.pos,2)?(n&&t.split(a.pos,2,v).scrollIntoView(),!0):!1};var Rp=Object.freeze({__proto__:null,splitListItem:Ip});function Pp(e,t){for(let r=e.depth;r>0;r-=1){const n=e.node(r);if(t(n))return{pos:r>0?e.before(r):0,start:e.start(r),depth:r,node:n}}}function Bp(e){return t=>Pp(t.$from,e)}function ya(e,t){const{nodeExtensions:r}=dr(t),n=r.find(s=>s.name===e);if(!n)return!1;const o={name:n.name,options:n.options},i=et(_(n,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}const zp=(e,t)=>({editor:r,tr:n,state:o,dispatch:i,chain:s,commands:a,can:c})=>{const{extensions:l}=r.extensionManager,u=tt(e,o.schema),f=tt(t,o.schema),{selection:p}=o,{$from:d,$to:h}=p,v=d.blockRange(h);if(!v)return!1;const g=Bp(y=>ya(y.type.name,l))(p);if(v.depth>=1&&g&&v.depth-g.depth<=1){if(g.node.type===u)return a.liftListItem(f);if(ya(g.node.type.name,l)&&u.validContent(g.node.content)&&i)return n.setNodeMarkup(g.pos,u),!0}return c().wrapInList(u)?a.wrapInList(u):s().clearNodes().wrapInList(u).run()};var Lp=Object.freeze({__proto__:null,toggleList:zp});const Fp=(e,t={})=>({state:r,commands:n})=>{const o=he(e,r.schema);return vo(r,o,t)?n.unsetMark(o):n.setMark(o,t)};var Vp=Object.freeze({__proto__:null,toggleMark:Fp});const Hp=(e,t,r={})=>({state:n,commands:o})=>{const i=tt(e,n.schema),s=tt(t,n.schema);return je(n,i,r)?o.setNode(s):o.setNode(i,r)};var jp=Object.freeze({__proto__:null,toggleNode:Hp});const qp=(e,t={})=>({state:r,dispatch:n})=>{const o=tt(e,r.schema);return je(r,o,t)?Ys(r,n):na(o,t)(r,n)};var Jp=Object.freeze({__proto__:null,toggleWrap:qp});const Wp=()=>({state:e,dispatch:t})=>Du(e,t);var Kp=Object.freeze({__proto__:null,undoInputRule:Wp});const $p=()=>({tr:e,state:t,dispatch:r})=>{const{selection:n}=e,{empty:o,ranges:i}=n;return o||r&&Object.entries(t.schema.marks).forEach(([,s])=>{i.forEach(a=>{e.removeMark(a.$from.pos,a.$to.pos,s)})}),!0};var Up=Object.freeze({__proto__:null,unsetAllMarks:$p});const Gp=e=>({tr:t,state:r,dispatch:n})=>{const{selection:o}=t,i=he(e,r.schema),{$from:s,empty:a,ranges:c}=o;if(n){if(a){let{from:l,to:u}=o;const f=da(s,i);f&&(l=f.from,u=f.to),t.removeMark(l,u,i)}else c.forEach(l=>{t.removeMark(l.$from.pos,l.$to.pos,i)});t.removeStoredMark(i)}return!0};var Yp=Object.freeze({__proto__:null,unsetMark:Gp});const Xp=(e,t={})=>({tr:r,state:n,dispatch:o})=>{let i=null,s=null;const a=qr(typeof e=="string"?e:e.name,n.schema);return a?(a==="node"&&(i=tt(e,n.schema)),a==="mark"&&(s=he(e,n.schema)),o&&r.selection.ranges.forEach(c=>{const l=c.$from.pos,u=c.$to.pos;n.doc.nodesBetween(l,u,(f,p)=>{i&&i===f.type&&r.setNodeMarkup(p,void 0,S(S({},f.attrs),t)),s&&f.marks.length&&f.marks.forEach(d=>{if(s===d.type){const h=Math.max(p,l),v=Math.min(p+f.nodeSize,u);r.addMark(h,v,s.create(S(S({},d.attrs),t)))}})})}),!0):!1};var Qp=Object.freeze({__proto__:null,updateAttributes:Xp});const Zp=(e,t={})=>({state:r,dispatch:n})=>{const o=tt(e,r.schema);return je(r,o,t)?!1:na(o,t)(r,n)};var td=Object.freeze({__proto__:null,wrapIn:Zp});const ed=(e,t={})=>({state:r,dispatch:n})=>{const o=tt(e,r.schema);return Lu(o,t)(r,n)};var rd=Object.freeze({__proto__:null,wrapInList:ed});const nd=St.create({name:"commands",addCommands(){return S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S(S({},af),lf),ff),df),mf),gf),bf),Sf),xf),Of),Af),Nf),Rf),Bf),Lf),Hf),qf),Wf),Gf),Xf),Zf),ep),np),ip),ap),lp),fp),dp),mp),gp),bp),Sp),xp),Op),Tp),_p),Dp),Rp),Lp),Vp),jp),Jp),Kp),Up),Yp),Qp),td),rd)}}),od=St.create({name:"editable",addProseMirrorPlugins(){return[new Rt({key:new Wt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),id=St.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Rt({key:new Wt("focusEvents"),props:{attributes:{tabindex:"0"},handleDOMEvents:{focus:(t,r)=>{e.isFocused=!0;const n=e.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return t.dispatch(n),!1},blur:(t,r)=>{e.isFocused=!1;const n=e.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return t.dispatch(n),!1}}}})]}}),sd=St.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:r})=>[()=>r.undoInputRule(),()=>r.deleteSelection(),()=>r.joinBackward(),()=>r.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:r})=>[()=>r.deleteSelection(),()=>r.joinForward(),()=>r.selectNodeForward()]);return{Enter:()=>this.editor.commands.first(({commands:r})=>[()=>r.newlineInCode(),()=>r.createParagraphNear(),()=>r.liftEmptyBlock(),()=>r.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:()=>e(),"Mod-Backspace":()=>e(),Delete:()=>t(),"Mod-Delete":()=>t()}}});var ad=Object.freeze({__proto__:null,ClipboardTextSerializer:of,Commands:nd,Editable:od,FocusEvents:id,Keymap:sd});const cd=`.ProseMirror { position: relative; } .ProseMirror { word-wrap: break-word; white-space: pre-wrap; -webkit-font-variant-ligatures: none; font-variant-ligatures: none; } .ProseMirror [contenteditable="false"] { white-space: normal; } .ProseMirror [contenteditable="false"] [contenteditable="true"] { white-space: pre-wrap; } .ProseMirror pre { white-space: pre-wrap; } .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; } .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 ld extends ef{constructor(t={}){super();this.isFocused=!1,this.options={element:document.createElement("div"),content:"",injectCSS:!0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!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 commands(){return this.commandManager.createCommands()}chain(){return this.commandManager.createChain()}can(){return this.commandManager.createCan()}injectCSS(){this.options.injectCSS&&document&&(this.css=Yu(cd))}setOptions(t={}){this.options=S(S({},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){this.setOptions({editable:t})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,r){const n=typeof r=="function"?r(t,this.state.plugins):[...this.state.plugins,t],o=this.state.reconfigure({plugins:n});this.view.updateState(o)}unregisterPlugin(t){if(this.isDestroyed)return;const r=typeof t=="string"?`${t}$`:t.key,n=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(r))});this.view.updateState(n)}createExtensionManager(){const r=[...Object.entries(ad).map(([,n])=>n),...this.options.extensions].filter(n=>["extension","node","mark"].includes(n==null?void 0:n.type));this.extensionManager=new hr(r,this)}createCommandManager(){this.commandManager=new Xu(this,this.extensionManager.commands)}createSchema(){this.schema=this.extensionManager.schema}createView(){this.view=new Z(this.options.element,Tt(S({},this.options.editorProps),{dispatchTransaction:this.dispatchTransaction.bind(this),state:mt.create({doc:la(this.options.content,this.schema,this.options.parseOptions)})}));const t=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(t),this.createNodeViews();const r=this.view.dom;r.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const r=this.capturedTransaction;return this.capturedTransaction=null,r}dispatchTransaction(t){if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const r=this.state.apply(t),n=!this.state.selection.eq(r.selection);this.view.updateState(r),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=t.getMeta("focus"),i=t.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.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 Wu(this.state,t)}isActive(t,r){const n=typeof t=="string"?t:null,o=typeof t=="string"?r:t;return Ku(this.state,n,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Uu(this.state.doc,this.schema)}get isEmpty(){return Gu(this.state.doc)}getCharacterCount(){return this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners(),$u(this.css)}get isDestroyed(){var t;return!((t=this.view)===null||t===void 0?void 0:t.docView)}}class wt{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=S(S({},this.config),t),this.name=this.config.name,this.options=this.config.defaultOptions}static create(t={}){return new wt(t)}configure(t={}){const r=this.extend();return r.options=Wr(this.options,t),r}extend(t={}){const r=new wt(t);return r.parent=this,this.child=r,r.name=t.name?t.name:r.parent.name,r.options=t.defaultOptions?t.defaultOptions:r.parent.options,r}}class Te{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=S(S({},this.config),t),this.name=this.config.name,this.options=this.config.defaultOptions}static create(t={}){return new Te(t)}configure(t={}){const r=this.extend();return r.options=Wr(this.options,t),r}extend(t={}){const r=new Te(t);return r.parent=this,this.child=r,r.name=t.name?t.name:r.parent.name,r.options=t.defaultOptions?t.defaultOptions:r.parent.options,r}}function ud(e,t,r){return new Ut(e,(n,o,i,s)=>{const a=r instanceof Function?r(o):r,{tr:c}=n;return o[0]&&c.replaceWith(i-1,s,t.create(a)),c})}function fd(e,t,r){let n=[];return r.doc.nodesBetween(e,t,(o,i)=>{n=[...n,...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s}))]}),n}function qe(e,t,r){return new Ut(e,(n,o,i,s)=>{const a=r instanceof Function?r(o):r,{tr:c}=n,l=o[o.length-1],u=o[0];let f=s;if(l){const p=u.search(/\S/),d=i+u.indexOf(l),h=d+l.length;if(fd(i,s,n).filter(g=>{const{excluded:M}=g.mark.type;return M.find(y=>y.name===t.name)}).filter(g=>g.to>d).length)return null;hi&&c.delete(i+p,d),f=i+p+l.length,c.addMark(i+p,f,t.create(a)),c.removeStoredMark(t)}return c})}function Je(e,t,r){const n=(o,i)=>{const s=[];return o.forEach(a=>{if(a.isText&&a.text){const{text:c}=a;let l=0,u;for(;(u=e.exec(c))!==null;){const f=Math.max(u.length-2,0),p=Math.max(u.length-1,0);if(i==null?void 0:i.type.allowsMarkType(t)){const h=u.index+u[0].indexOf(u[f]),v=h+u[f].length,g=h+u[f].lastIndexOf(u[p]),M=g+u[p].length,y=r instanceof Function?r(u):r;if(!y&&y!==void 0)continue;h>0&&s.push(a.cut(l,h)),s.push(a.cut(g,M).mark(t.create(y).addToSet(a.marks))),l=v}}lnew C(n(o.content),o.openStart,o.openEnd)}})}function pd(e){return ha(e)&&e instanceof E}function ba(e,t,r){const n=e.coordsAtPos(t),o=e.coordsAtPos(r,-1),i=Math.min(n.top,o.top),s=Math.max(n.bottom,o.bottom),a=Math.min(n.left,o.left),c=Math.max(n.right,o.right),l=c-a,u=s-i,d={top:i,bottom:s,left:a,right:c,width:l,height:u,x:a,y:i};return Tt(S({},d),{toJSON:()=>d})}var dd="tippy-box",ka="tippy-content",hd="tippy-backdrop",Sa="tippy-arrow",Ma="tippy-svg-arrow",Ae={passive:!0,capture:!0};function So(e,t,r){if(Array.isArray(e)){var n=e[t];return n==null?Array.isArray(r)?r[t]:r:n}return e}function Mo(e,t){var r={}.toString.call(e);return r.indexOf("[object")===0&&r.indexOf(t+"]")>-1}function xa(e,t){return typeof e=="function"?e.apply(void 0,t):e}function Ca(e,t){if(t===0)return e;var r;return function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)}}function md(e){return e.split(/\s+/).filter(Boolean)}function vr(e){return[].concat(e)}function Oa(e,t){e.indexOf(t)===-1&&e.push(t)}function vd(e){return e.filter(function(t,r){return e.indexOf(t)===r})}function gd(e){return e.split("-")[0]}function $r(e){return[].slice.call(e)}function yd(e){return Object.keys(e).reduce(function(t,r){return e[r]!==void 0&&(t[r]=e[r]),t},{})}function gr(){return document.createElement("div")}function Ur(e){return["Element","Fragment"].some(function(t){return Mo(e,t)})}function bd(e){return Mo(e,"NodeList")}function kd(e){return Mo(e,"MouseEvent")}function Sd(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function Md(e){return Ur(e)?[e]:bd(e)?$r(e):Array.isArray(e)?e:$r(document.querySelectorAll(e))}function xo(e,t){e.forEach(function(r){r&&(r.style.transitionDuration=t+"ms")})}function wa(e,t){e.forEach(function(r){r&&r.setAttribute("data-state",t)})}function xd(e){var t,r=vr(e),n=r[0];return(n==null||(t=n.ownerDocument)==null?void 0:t.body)?n.ownerDocument:document}function Cd(e,t){var r=t.clientX,n=t.clientY;return e.every(function(o){var i=o.popperRect,s=o.popperState,a=o.props,c=a.interactiveBorder,l=gd(s.placement),u=s.modifiersData.offset;if(!u)return!0;var f=l==="bottom"?u.top.y:0,p=l==="top"?u.bottom.y:0,d=l==="right"?u.left.x:0,h=l==="left"?u.right.x:0,v=i.top-n+f>c,g=n-i.bottom-p>c,M=i.left-r+d>c,y=r-i.right-h>c;return v||g||M||y})}function Co(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){e[n](o,r)})}var Gt={isTouch:!1},Ta=0;function Od(){Gt.isTouch||(Gt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Aa))}function Aa(){var e=performance.now();e-Ta<20&&(Gt.isTouch=!1,document.removeEventListener("mousemove",Aa)),Ta=e}function wd(){var e=document.activeElement;if(Sd(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function Td(){document.addEventListener("touchstart",Od,Ae),window.addEventListener("blur",wd)}var Ad=typeof window!="undefined"&&typeof document!="undefined",_d=Ad?navigator.userAgent:"",Nd=/MSIE |Trident\//.test(_d),Ed={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Dd={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ht=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Ed,{},Dd),Id=Object.keys(Ht),Rd=function(t){var r=Object.keys(t);r.forEach(function(n){Ht[n]=t[n]})};function _a(e){var t=e.plugins||[],r=t.reduce(function(n,o){var i=o.name,s=o.defaultValue;return i&&(n[i]=e[i]!==void 0?e[i]:s),n},{});return Object.assign({},e,{},r)}function Pd(e,t){var r=t?Object.keys(_a(Object.assign({},Ht,{plugins:t}))):Id,n=r.reduce(function(o,i){var s=(e.getAttribute("data-tippy-"+i)||"").trim();if(!s)return o;if(i==="content")o[i]=s;else try{o[i]=JSON.parse(s)}catch{o[i]=s}return o},{});return n}function Na(e,t){var r=Object.assign({},t,{content:xa(t.content,[e])},t.ignoreAttributes?{}:Pd(e,t.plugins));return r.aria=Object.assign({},Ht.aria,{},r.aria),r.aria={expanded:r.aria.expanded==="auto"?t.interactive:r.aria.expanded,content:r.aria.content==="auto"?t.interactive?null:"describedby":r.aria.content},r}var Bd=function(){return"innerHTML"};function Oo(e,t){e[Bd()]=t}function Ea(e){var t=gr();return e===!0?t.className=Sa:(t.className=Ma,Ur(e)?t.appendChild(e):Oo(t,e)),t}function Da(e,t){Ur(t.content)?(Oo(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?Oo(e,t.content):e.textContent=t.content)}function wo(e){var t=e.firstElementChild,r=$r(t.children);return{box:t,content:r.find(function(n){return n.classList.contains(ka)}),arrow:r.find(function(n){return n.classList.contains(Sa)||n.classList.contains(Ma)}),backdrop:r.find(function(n){return n.classList.contains(hd)})}}function Ia(e){var t=gr(),r=gr();r.className=dd,r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=gr();n.className=ka,n.setAttribute("data-state","hidden"),Da(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props);function o(i,s){var a=wo(t),c=a.box,l=a.content,u=a.arrow;s.theme?c.setAttribute("data-theme",s.theme):c.removeAttribute("data-theme"),typeof s.animation=="string"?c.setAttribute("data-animation",s.animation):c.removeAttribute("data-animation"),s.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?c.setAttribute("role",s.role):c.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&Da(l,e.props),s.arrow?u?i.arrow!==s.arrow&&(c.removeChild(u),c.appendChild(Ea(s.arrow))):c.appendChild(Ea(s.arrow)):u&&c.removeChild(u)}return{popper:t,onUpdate:o}}Ia.$$tippy=!0;var zd=1,Gr=[],To=[];function Ld(e,t){var r=Na(e,Object.assign({},Ht,{},_a(yd(t)))),n,o,i,s=!1,a=!1,c=!1,l=!1,u,f,p,d=[],h=Ca(Lo,r.interactiveDebounce),v,g=zd++,M=null,y=vd(r.plugins),R={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},m={id:g,reference:e,popper:gr(),popperInstance:M,props:r,state:R,plugins:y,clearDelayTimeouts:Ua,setProps:Ga,setContent:Ya,show:Xa,hide:Qa,hideWithInteractivity:Za,enable:Ka,disable:$a,unmount:tc,destroy:ec};if(!r.render)return m;var I=r.render(m),O=I.popper,F=I.onUpdate;O.setAttribute("data-tippy-root",""),O.id="tippy-"+m.id,m.popper=O,e._tippy=m,O._tippy=m;var J=y.map(function(b){return b.fn(m)}),U=e.hasAttribute("aria-expanded");return Po(),Ke(),oe(),Et("onCreate",[m]),r.showOnCreate&&Jo(),O.addEventListener("mouseenter",function(){m.props.interactive&&m.state.isVisible&&m.clearDelayTimeouts()}),O.addEventListener("mouseleave",function(b){m.props.interactive&&m.props.trigger.indexOf("mouseenter")>=0&&(qt().addEventListener("mousemove",h),h(b))}),m;function T(){var b=m.props.touch;return Array.isArray(b)?b:[b,0]}function Qt(){return T()[0]==="hold"}function rt(){var b;return!!((b=m.props.render)==null?void 0:b.$$tippy)}function ut(){return v||e}function qt(){var b=ut().parentNode;return b?xd(b):document}function G(){return wo(O)}function Y(b){return m.state.isMounted&&!m.state.isVisible||Gt.isTouch||u&&u.type==="focus"?0:So(m.props.delay,b?0:1,Ht.delay)}function oe(){O.style.pointerEvents=m.props.interactive&&m.state.isVisible?"":"none",O.style.zIndex=""+m.props.zIndex}function Et(b,w,N){if(N===void 0&&(N=!0),J.forEach(function(z){z[b]&&z[b].apply(void 0,w)}),N){var j;(j=m.props)[b].apply(j,w)}}function No(){var b=m.props.aria;if(!!b.content){var w="aria-"+b.content,N=O.id,j=vr(m.props.triggerTarget||e);j.forEach(function(z){var vt=z.getAttribute(w);if(m.state.isVisible)z.setAttribute(w,vt?vt+" "+N:N);else{var Dt=vt&&vt.replace(N,"").trim();Dt?z.setAttribute(w,Dt):z.removeAttribute(w)}})}}function Ke(){if(!(U||!m.props.aria.expanded)){var b=vr(m.props.triggerTarget||e);b.forEach(function(w){m.props.interactive?w.setAttribute("aria-expanded",m.state.isVisible&&w===ut()?"true":"false"):w.removeAttribute("aria-expanded")})}}function tn(){qt().removeEventListener("mousemove",h),Gr=Gr.filter(function(b){return b!==h})}function yr(b){if(!(Gt.isTouch&&(c||b.type==="mousedown"))&&!(m.props.interactive&&O.contains(b.target))){if(ut().contains(b.target)){if(Gt.isTouch||m.state.isVisible&&m.props.trigger.indexOf("click")>=0)return}else Et("onClickOutside",[m,b]);m.props.hideOnClick===!0&&(m.clearDelayTimeouts(),m.hide(),a=!0,setTimeout(function(){a=!1}),m.state.isMounted||en())}}function Eo(){c=!0}function Do(){c=!1}function Io(){var b=qt();b.addEventListener("mousedown",yr,!0),b.addEventListener("touchend",yr,Ae),b.addEventListener("touchstart",Do,Ae),b.addEventListener("touchmove",Eo,Ae)}function en(){var b=qt();b.removeEventListener("mousedown",yr,!0),b.removeEventListener("touchend",yr,Ae),b.removeEventListener("touchstart",Do,Ae),b.removeEventListener("touchmove",Eo,Ae)}function qa(b,w){Ro(b,function(){!m.state.isVisible&&O.parentNode&&O.parentNode.contains(O)&&w()})}function Ja(b,w){Ro(b,w)}function Ro(b,w){var N=G().box;function j(z){z.target===N&&(Co(N,"remove",j),w())}if(b===0)return w();Co(N,"remove",f),Co(N,"add",j),f=j}function _e(b,w,N){N===void 0&&(N=!1);var j=vr(m.props.triggerTarget||e);j.forEach(function(z){z.addEventListener(b,w,N),d.push({node:z,eventType:b,handler:w,options:N})})}function Po(){Qt()&&(_e("touchstart",zo,{passive:!0}),_e("touchend",Fo,{passive:!0})),md(m.props.trigger).forEach(function(b){if(b!=="manual")switch(_e(b,zo),b){case"mouseenter":_e("mouseleave",Fo);break;case"focus":_e(Nd?"focusout":"blur",Vo);break;case"focusin":_e("focusout",Vo);break}})}function Bo(){d.forEach(function(b){var w=b.node,N=b.eventType,j=b.handler,z=b.options;w.removeEventListener(N,j,z)}),d=[]}function zo(b){var w,N=!1;if(!(!m.state.isEnabled||Ho(b)||a)){var j=((w=u)==null?void 0:w.type)==="focus";u=b,v=b.currentTarget,Ke(),!m.state.isVisible&&kd(b)&&Gr.forEach(function(z){return z(b)}),b.type==="click"&&(m.props.trigger.indexOf("mouseenter")<0||s)&&m.props.hideOnClick!==!1&&m.state.isVisible?N=!0:Jo(b),b.type==="click"&&(s=!N),N&&!j&&br(b)}}function Lo(b){var w=b.target,N=ut().contains(w)||O.contains(w);if(!(b.type==="mousemove"&&N)){var j=rn().concat(O).map(function(z){var vt,Dt=z._tippy,Ne=(vt=Dt.popperInstance)==null?void 0:vt.state;return Ne?{popperRect:z.getBoundingClientRect(),popperState:Ne,props:r}:null}).filter(Boolean);Cd(j,b)&&(tn(),br(b))}}function Fo(b){var w=Ho(b)||m.props.trigger.indexOf("click")>=0&&s;if(!w){if(m.props.interactive){m.hideWithInteractivity(b);return}br(b)}}function Vo(b){m.props.trigger.indexOf("focusin")<0&&b.target!==ut()||m.props.interactive&&b.relatedTarget&&O.contains(b.relatedTarget)||br(b)}function Ho(b){return Gt.isTouch?Qt()!==b.type.indexOf("touch")>=0:!1}function jo(){qo();var b=m.props,w=b.popperOptions,N=b.placement,j=b.offset,z=b.getReferenceClientRect,vt=b.moveTransition,Dt=rt()?wo(O).arrow:null,Ne=z?{getBoundingClientRect:z,contextElement:z.contextElement||ut()}:e,Wo={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(kr){var Ee=kr.state;if(rt()){var rc=G(),on=rc.box;["placement","reference-hidden","escaped"].forEach(function(Sr){Sr==="placement"?on.setAttribute("data-placement",Ee.placement):Ee.attributes.popper["data-popper-"+Sr]?on.setAttribute("data-"+Sr,""):on.removeAttribute("data-"+Sr)}),Ee.attributes.popper={}}}},ge=[{name:"offset",options:{offset:j}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!vt}},Wo];rt()&&Dt&&ge.push({name:"arrow",options:{element:Dt,padding:3}}),ge.push.apply(ge,(w==null?void 0:w.modifiers)||[]),m.popperInstance=ac(Ne,O,Object.assign({},w,{placement:N,onFirstUpdate:p,modifiers:ge}))}function qo(){m.popperInstance&&(m.popperInstance.destroy(),m.popperInstance=null)}function Wa(){var b=m.props.appendTo,w,N=ut();m.props.interactive&&b===Ht.appendTo||b==="parent"?w=N.parentNode:w=xa(b,[N]),w.contains(O)||w.appendChild(O),jo()}function rn(){return $r(O.querySelectorAll("[data-tippy-root]"))}function Jo(b){m.clearDelayTimeouts(),b&&Et("onTrigger",[m,b]),Io();var w=Y(!0),N=T(),j=N[0],z=N[1];Gt.isTouch&&j==="hold"&&z&&(w=z),w?n=setTimeout(function(){m.show()},w):m.show()}function br(b){if(m.clearDelayTimeouts(),Et("onUntrigger",[m,b]),!m.state.isVisible){en();return}if(!(m.props.trigger.indexOf("mouseenter")>=0&&m.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(b.type)>=0&&s)){var w=Y(!1);w?o=setTimeout(function(){m.state.isVisible&&m.hide()},w):i=requestAnimationFrame(function(){m.hide()})}}function Ka(){m.state.isEnabled=!0}function $a(){m.hide(),m.state.isEnabled=!1}function Ua(){clearTimeout(n),clearTimeout(o),cancelAnimationFrame(i)}function Ga(b){if(!m.state.isDestroyed){Et("onBeforeUpdate",[m,b]),Bo();var w=m.props,N=Na(e,Object.assign({},m.props,{},b,{ignoreAttributes:!0}));m.props=N,Po(),w.interactiveDebounce!==N.interactiveDebounce&&(tn(),h=Ca(Lo,N.interactiveDebounce)),w.triggerTarget&&!N.triggerTarget?vr(w.triggerTarget).forEach(function(j){j.removeAttribute("aria-expanded")}):N.triggerTarget&&e.removeAttribute("aria-expanded"),Ke(),oe(),F&&F(w,N),m.popperInstance&&(jo(),rn().forEach(function(j){requestAnimationFrame(j._tippy.popperInstance.forceUpdate)})),Et("onAfterUpdate",[m,b])}}function Ya(b){m.setProps({content:b})}function Xa(){var b=m.state.isVisible,w=m.state.isDestroyed,N=!m.state.isEnabled,j=Gt.isTouch&&!m.props.touch,z=So(m.props.duration,0,Ht.duration);if(!(b||w||N||j)&&!ut().hasAttribute("disabled")&&(Et("onShow",[m],!1),m.props.onShow(m)!==!1)){if(m.state.isVisible=!0,rt()&&(O.style.visibility="visible"),oe(),Io(),m.state.isMounted||(O.style.transition="none"),rt()){var vt=G(),Dt=vt.box,Ne=vt.content;xo([Dt,Ne],0)}p=function(){var ge;if(!(!m.state.isVisible||l)){if(l=!0,O.offsetHeight,O.style.transition=m.props.moveTransition,rt()&&m.props.animation){var nn=G(),kr=nn.box,Ee=nn.content;xo([kr,Ee],z),wa([kr,Ee],"visible")}No(),Ke(),Oa(To,m),(ge=m.popperInstance)==null||ge.forceUpdate(),m.state.isMounted=!0,Et("onMount",[m]),m.props.animation&&rt()&&Ja(z,function(){m.state.isShown=!0,Et("onShown",[m])})}},Wa()}}function Qa(){var b=!m.state.isVisible,w=m.state.isDestroyed,N=!m.state.isEnabled,j=So(m.props.duration,1,Ht.duration);if(!(b||w||N)&&(Et("onHide",[m],!1),m.props.onHide(m)!==!1)){if(m.state.isVisible=!1,m.state.isShown=!1,l=!1,s=!1,rt()&&(O.style.visibility="hidden"),tn(),en(),oe(),rt()){var z=G(),vt=z.box,Dt=z.content;m.props.animation&&(xo([vt,Dt],j),wa([vt,Dt],"hidden"))}No(),Ke(),m.props.animation?rt()&&qa(j,m.unmount):m.unmount()}}function Za(b){qt().addEventListener("mousemove",h),Oa(Gr,h),h(b)}function tc(){m.state.isVisible&&m.hide(),!!m.state.isMounted&&(qo(),rn().forEach(function(b){b._tippy.unmount()}),O.parentNode&&O.parentNode.removeChild(O),To=To.filter(function(b){return b!==m}),m.state.isMounted=!1,Et("onHidden",[m]))}function ec(){m.state.isDestroyed||(m.clearDelayTimeouts(),m.unmount(),Bo(),delete e._tippy,m.state.isDestroyed=!0,Et("onDestroy",[m]))}}function We(e,t){t===void 0&&(t={});var r=Ht.plugins.concat(t.plugins||[]);Td();var n=Object.assign({},t,{plugins:r}),o=Md(e),i=o.reduce(function(s,a){var c=a&&Ld(a,n);return c&&s.push(c),s},[]);return Ur(e)?i[0]:i}We.defaultProps=Ht;We.setDefaultProps=Rd;We.currentInput=Gt;Object.assign({},sc,{effect:function(t){var r=t.state,n={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(r.elements.popper.style,n.popper),r.styles=n,r.elements.arrow&&Object.assign(r.elements.arrow.style,n.arrow)}});We.setDefaultProps({render:Ia});class Fd{constructor({editor:t,element:r,view:n,tippyOptions:o,shouldShow:i}){this.preventHide=!1,this.shouldShow=({state:s,from:a,to:c})=>{const{doc:l,selection:u}=s,{empty:f}=u,p=!l.textBetween(a,c).length&&ma(s.selection);return!(f||p)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var a;if(this.preventHide){this.preventHide=!1;return}(s==null?void 0:s.relatedTarget)&&((a=this.element.parentNode)===null||a===void 0?void 0:a.contains(s.relatedTarget))||this.hide()},this.editor=t,this.element=r,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.element.style.visibility="visible",requestAnimationFrame(()=>{this.createTooltip(o)})}createTooltip(t={}){this.tippy=We(this.editor.options.element,S({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle"},t))}update(t,r){var n;const{state:o,composing:i}=t,{doc:s,selection:a}=o,c=r&&r.doc.eq(s)&&r.selection.eq(a);if(i||c)return;const{ranges:l}=a,u=Math.min(...l.map(d=>d.$from.pos)),f=Math.max(...l.map(d=>d.$to.pos));if(!this.shouldShow({editor:this.editor,view:t,state:o,oldState:r,from:u,to:f})){this.hide();return}(n=this.tippy)===null||n===void 0||n.setProps({getReferenceClientRect:()=>{if(pd(o.selection)){const d=t.nodeDOM(u);if(d)return d.getBoundingClientRect()}return ba(t,u,f)}}),this.show()}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t;(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Ra=e=>new Rt({key:typeof e.pluginKey=="string"?new Wt(e.pluginKey):e.pluginKey,view:t=>new Fd(S({view:t},e))});St.create({name:"bubbleMenu",defaultOptions:{element:null,tippyOptions:{},pluginKey:"bubbleMenu",shouldShow:null},addProseMirrorPlugins(){return this.options.element?[Ra({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});class Vd{constructor({editor:t,element:r,view:n,tippyOptions:o,shouldShow:i}){this.preventHide=!1,this.shouldShow=({state:s})=>{const{selection:a}=s,{$anchor:c,empty:l}=a,u=c.depth===1,f=c.parent.isTextblock&&!c.parent.type.spec.code&&!c.parent.textContent;return!(!l||!u||!f)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var a;if(this.preventHide){this.preventHide=!1;return}(s==null?void 0:s.relatedTarget)&&((a=this.element.parentNode)===null||a===void 0?void 0:a.contains(s.relatedTarget))||this.hide()},this.editor=t,this.element=r,this.view=n,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.element.style.visibility="visible",requestAnimationFrame(()=>{this.createTooltip(o)})}createTooltip(t={}){this.tippy=We(this.editor.options.element,S({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle"},t))}update(t,r){var n;const{state:o,composing:i}=t,{doc:s,selection:a}=o,{from:c,to:l}=a,u=r&&r.doc.eq(s)&&r.selection.eq(a);if(i||u)return;if(!this.shouldShow({editor:this.editor,view:t,state:o,oldState:r})){this.hide();return}(n=this.tippy)===null||n===void 0||n.setProps({getReferenceClientRect:()=>ba(t,c,l)}),this.show()}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t;(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Pa=e=>new Rt({key:typeof e.pluginKey=="string"?new Wt(e.pluginKey):e.pluginKey,view:t=>new Vd(S({view:t},e))});St.create({name:"floatingMenu",defaultOptions:{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null},addProseMirrorPlugins(){return this.options.element?[Pa({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});$e({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(e,{slots:t}){const r=xr(null);return sn(()=>{const{pluginKey:n,editor:o,tippyOptions:i,shouldShow:s}=e;o.registerPlugin(Ra({pluginKey:n,editor:o,element:r.value,tippyOptions:i,shouldShow:s}))}),Cr(()=>{const{pluginKey:n,editor:o}=e;o.unregisterPlugin(n)}),()=>{var n;return ye("div",{ref:r},(n=t.default)===null||n===void 0?void 0:n.call(t))}}});function Hd(e){return hc((t,r)=>({get(){return t(),e},set(n){e=n,requestAnimationFrame(()=>{requestAnimationFrame(()=>{r()})})}}))}class jd extends ld{constructor(t={}){super(t);return this.vueRenderers=dc(new Map),this.contentComponent=null,this.reactiveState=Hd(this.view.state),this.on("transaction",()=>{this.reactiveState.value=this.view.state}),mc(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}registerPlugin(t,r){super.registerPlugin(t,r),this.reactiveState.value=this.view.state}unregisterPlugin(t){super.unregisterPlugin(t),this.reactiveState.value=this.view.state}}const qd=$e({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=xr(),r=cc();return lc(()=>{const n=e.editor;n&&n.options.element&&t.value&&uc(()=>{if(!t.value||!n.options.element.firstChild)return;const o=fc(t.value);t.value.append(...n.options.element.childNodes),n.contentComponent=r.ctx._,n.setOptions({element:o}),n.createNodeViews()})}),Cr(()=>{const n=e.editor;if(!n||(n.isDestroyed||n.view.setProps({nodeViews:{}}),n.contentComponent=null,!n.options.element.firstChild))return;const o=document.createElement("div");o.append(...n.options.element.childNodes),n.setOptions({element:o})}),{rootEl:t}},render(){const e=[];return this.editor&&this.editor.vueRenderers.forEach(t=>{const r=ye(pc,{to:t.teleportElement,key:t.id},ye(t.component,S({ref:t.id},t.props)));e.push(r)}),ye("div",{ref:t=>{this.rootEl=t}},...e)}});$e({name:"FloatingMenu",props:{pluginKey:{type:[String,Object],default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(e,{slots:t}){const r=xr(null);return sn(()=>{const{pluginKey:n,editor:o,tippyOptions:i,shouldShow:s}=e;o.registerPlugin(Pa({pluginKey:n,editor:o,element:r.value,tippyOptions:i,shouldShow:s}))}),Cr(()=>{const{pluginKey:n,editor:o}=e;o.unregisterPlugin(n)}),()=>{var n;return ye("div",{ref:r},(n=t.default)===null||n===void 0?void 0:n.call(t))}}});const Jd=(e={})=>{const t=xr();return sn(()=>{t.value=new jd(e)}),Cr(()=>{var r;(r=t.value)===null||r===void 0||r.destroy()}),t};$e({props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var e,t;return ye(this.as,{class:this.decorationClasses.value,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragStart:this.onDragStart},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))}});$e({props:{as:{type:String,default:"div"}},render(){return ye(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}});const Wd=/^\s*>\s$/gm,Kd=wt.create({name:"blockquote",defaultOptions:{HTMLAttributes:{}},content:"block*",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return["blockquote",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn("blockquote"),toggleBlockquote:()=>({commands:e})=>e.toggleWrap("blockquote"),unsetBlockquote:()=>({commands:e})=>e.lift("blockquote")}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[uo(Wd,this.type)]}}),$d=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/gm,Ud=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/gm,Gd=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/gm,Yd=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/gm,Xd=Te.create({name:"bold",defaultOptions:{HTMLAttributes:{}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark("bold"),toggleBold:()=>({commands:e})=>e.toggleMark("bold"),unsetBold:()=>({commands:e})=>e.unsetMark("bold")}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold()}},addInputRules(){return[qe($d,this.type),qe(Gd,this.type)]},addPasteRules(){return[Je(Ud,this.type),Je(Yd,this.type)]}}),Qd=/^\s*([-+*])\s$/,Zd=wt.create({name:"bulletList",defaultOptions:{HTMLAttributes:{}},group:"block list",content:"listItem+",parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e})=>e.toggleList("bulletList","listItem")}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[uo(Qd,this.type)]}}),th=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/gm,eh=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/gm,rh=Te.create({name:"code",defaultOptions:{HTMLAttributes:{}},excludes:"_",parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark("code"),toggleCode:()=>({commands:e})=>e.toggleMark("code"),unsetCode:()=>({commands:e})=>e.unsetMark("code")}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[qe(th,this.type)]},addPasteRules(){return[Je(eh,this.type)]}}),nh=/^```(?[a-z]*)? $/,oh=/^~~~(?[a-z]*)? $/,ih=wt.create({name:"codeBlock",defaultOptions:{languageClassPrefix:"language-",HTMLAttributes:{}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:e=>{var t;const r=(t=e.firstElementChild)===null||t===void 0?void 0:t.getAttribute("class");if(!r)return null;const n=new RegExp(`^(${this.options.languageClassPrefix})`);return{language:r.replace(n,"")}},renderHTML:e=>e.language?{class:this.options.languageClassPrefix+e.language}:null}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){return["pre",this.options.HTMLAttributes,["code",e,0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode("codeBlock",e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode("codeBlock","paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,r=t.pos===1;return!e||t.parent.type.name!==this.name?!1:r||!t.parent.textContent.length?this.editor.commands.clearNodes():!1}}},addInputRules(){return[fo(nh,this.type,({groups:e})=>e),fo(oh,this.type,({groups:e})=>e)]}}),sh=wt.create({name:"doc",topNode:!0,content:"block+"});function ah(e){return e===void 0&&(e={}),new Rt({view:function(r){return new Yt(r,e)}})}var Yt=function(t,r){var n=this;this.editorView=t,this.width=r.width||1,this.color=r.color||"black",this.class=r.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map(function(o){var i=function(s){return n[o](s)};return t.dom.addEventListener(o,i),{name:o,handler:i}})};Yt.prototype.destroy=function(){var t=this;this.handlers.forEach(function(r){var n=r.name,o=r.handler;return t.editorView.dom.removeEventListener(n,o)})};Yt.prototype.update=function(t,r){this.cursorPos!=null&&r.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())};Yt.prototype.setCursor=function(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())};Yt.prototype.updateOverlay=function(){var t=this.editorView.state.doc.resolve(this.cursorPos),r;if(!t.parent.inlineContent){var n=t.nodeBefore,o=t.nodeAfter;if(n||o){var i=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),s=n?i.bottom:i.top;n&&o&&(s=(s+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:i.left,right:i.right,top:s-this.width/2,bottom:s+this.width/2}}}if(!r){var a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}var c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color);var l,u;if(!c||c==document.body&&getComputedStyle(c).position=="static")l=-pageXOffset,u=-pageYOffset;else{var f=c.getBoundingClientRect();l=f.left-c.scrollLeft,u=f.top-c.scrollTop}this.element.style.left=r.left-l+"px",this.element.style.top=r.top-u+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"};Yt.prototype.scheduleRemoval=function(t){var r=this;clearTimeout(this.timeout),this.timeout=setTimeout(function(){return r.setCursor(null)},t)};Yt.prototype.dragover=function(t){if(!!this.editorView.editable){var r=this.editorView.posAtCoords({left:t.clientX,top:t.clientY});if(r){var n=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&(n=Oi(this.editorView.state.doc,n,this.editorView.dragging.slice),n==null))return this.setCursor(null);this.setCursor(n),this.scheduleRemoval(5e3)}}};Yt.prototype.dragend=function(){this.scheduleRemoval(20)};Yt.prototype.drop=function(){this.scheduleRemoval(20)};Yt.prototype.dragleave=function(t){(t.target==this.editorView.dom||!this.editorView.dom.contains(t.relatedTarget))&&this.setCursor(null)};const ch=St.create({name:"dropCursor",defaultOptions:{color:"currentColor",width:1,class:null},addProseMirrorPlugins(){return[ah(this.options)]}});var jt=function(e){function t(r){e.call(this,r,r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,o){var i=n.resolve(o.map(this.head));return t.valid(i)?new t(i):e.near(i)},t.prototype.content=function(){return C.empty},t.prototype.eq=function(n){return n instanceof t&&n.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(n,o){if(typeof o.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(n.resolve(o.pos))},t.prototype.getBookmark=function(){return new Yr(this.anchor)},t.valid=function(n){var o=n.parent;if(o.isTextblock||!lh(n)||!uh(n))return!1;var i=o.type.spec.allowGapCursor;if(i!=null)return i;var s=o.contentMatchAt(n.index()).defaultType;return s&&s.isTextblock},t.findFrom=function(n,o,i){t:for(;;){if(!i&&t.valid(n))return n;for(var s=n.pos,a=null,c=n.depth;;c--){var l=n.node(c);if(o>0?n.indexAfter(c)0){a=l.child(o>0?n.indexAfter(c):n.index(c)-1);break}else if(c==0)return null;s+=o;var u=n.doc.resolve(s);if(t.valid(u))return u}for(;;){var f=o>0?a.firstChild:a.lastChild;if(!f){if(a.isAtom&&!a.isText&&!E.isSelectable(a)){n=n.doc.resolve(s+a.nodeSize*o),i=!1;continue t}break}a=f,s+=o;var p=n.doc.resolve(s);if(t.valid(p))return p}return null}},t}(D);jt.prototype.visible=!1;D.jsonID("gapcursor",jt);var Yr=function(t){this.pos=t};Yr.prototype.map=function(t){return new Yr(t.map(this.pos))};Yr.prototype.resolve=function(t){var r=t.resolve(this.pos);return jt.valid(r)?new jt(r):D.near(r)};function lh(e){for(var t=e.depth;t>=0;t--){var r=e.index(t);if(r!=0)for(var n=e.node(t).child(r-1);;n=n.lastChild){if(n.childCount==0&&!n.inlineContent||n.isAtom||n.type.spec.isolating)return!0;if(n.inlineContent)return!1}}return!0}function uh(e){for(var t=e.depth;t>=0;t--){var r=e.indexAfter(t),n=e.node(t);if(r!=n.childCount)for(var o=n.child(r);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}var fh=function(){return new Rt({props:{decorations:hh,createSelectionBetween:function(t,r,n){if(r.pos==n.pos&&jt.valid(n))return new jt(n)},handleClick:dh,handleKeyDown:ph}})},ph=js({ArrowLeft:Xr("horiz",-1),ArrowRight:Xr("horiz",1),ArrowUp:Xr("vert",-1),ArrowDown:Xr("vert",1)});function Xr(e,t){var r=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(n,o,i){var s=n.selection,a=t>0?s.$to:s.$from,c=s.empty;if(s instanceof H){if(!i.endOfTextblock(r)||a.depth==0)return!1;c=!1,a=n.doc.resolve(t>0?a.after():a.before())}var l=jt.findFrom(a,t,c);return l?(o&&o(n.tr.setSelection(new jt(l))),!0):!1}}function dh(e,t,r){if(!e.editable)return!1;var n=e.state.doc.resolve(t);if(!jt.valid(n))return!1;var o=e.posAtCoords({left:r.clientX,top:r.clientY}),i=o.inside;return i>-1&&E.isSelectable(e.state.doc.nodeAt(i))?!1:(e.dispatch(e.state.tr.setSelection(new jt(n))),!0)}function hh(e){if(!(e.selection instanceof jt))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",q.create(e.doc,[nt.widget(e.selection.head,t,{key:"gapcursor"})])}const mh=St.create({name:"gapCursor",addProseMirrorPlugins(){return[fh()]},extendNodeSchema(e){var t;const r={name:e.name,options:e.options};return{allowGapCursor:(t=et(_(e,"allowGapCursor",r)))!==null&&t!==void 0?t:null}}}),vh=wt.create({name:"hardBreak",defaultOptions:{HTMLAttributes:{}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",Ot(this.options.HTMLAttributes,e)]},addCommands(){return{setHardBreak:()=>({commands:e})=>e.first([()=>e.exitCode(),()=>e.insertContent({type:this.name})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),gh=wt.create({name:"heading",defaultOptions:{levels:[1,2,3,4,5,6],HTMLAttributes:{}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Ot(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode("heading",e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode("heading","paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>Tt(S({},e),{[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>fo(new RegExp(`^(#{1,${e}})\\s$`),this.type,{level:e}))}});var Qr=200,ct=function(){};ct.prototype.append=function(t){return t.length?(t=ct.from(t),!this.length&&t||t.length=r?ct.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,r))};ct.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};ct.prototype.forEach=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(t,r,n,0):this.forEachInvertedInner(t,r,n,0)};ct.prototype.map=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},r,n),o};ct.from=function(t){return t instanceof ct?t:t&&t.length?new Ba(t):ct.empty};var Ba=function(e){function t(n){e.call(this),this.values=n}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new t(this.values.slice(o,i))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,i,s,a){for(var c=i;c=s;c--)if(o(this.values[c],a+c)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=Qr)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=Qr)return new t(o.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(t.prototype,r),t}(ct);ct.empty=new Ba([]);var yh=function(e){function t(r,n){e.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(n){return na&&this.right.forEachInner(n,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(n,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(n,o-a,Math.max(i,a)-a,s+a)===!1||i=i?this.right.slice(n-i,o-i):this.left.slice(n,i).append(this.right.slice(0,o-i))},t.prototype.leafAppend=function(n){var o=this.right.leafAppend(n);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(n){var o=this.left.leafPrepend(n);if(o)return new t(o,this.right)},t.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new t(this.left,new t(this.right,n)):new t(this,n)},t}(ct),za=ct,bh=500,lt=function(t,r){this.items=t,this.eventCount=r};lt.prototype.popEvent=function(t,r){var n=this;if(this.eventCount==0)return null;for(var o=this.items.length;;o--){var i=this.items.get(o-1);if(i.selection){--o;break}}var s,a;r&&(s=this.remapping(o,this.items.length),a=s.maps.length);var c=t.tr,l,u,f=[],p=[];return this.items.forEach(function(d,h){if(!d.step){s||(s=n.remapping(o,h+1),a=s.maps.length),a--,p.push(d);return}if(s){p.push(new Xt(d.map));var v=d.step.map(s.slice(a)),g;v&&c.maybeStep(v).doc&&(g=c.mapping.maps[c.mapping.maps.length-1],f.push(new Xt(g,null,null,f.length+p.length))),a--,g&&s.appendMap(g,a)}else c.maybeStep(d.step);if(d.selection)return l=s?d.selection.map(s.slice(a)):d.selection,u=new lt(n.items.slice(0,o).append(p.reverse().concat(f)),n.eventCount-1),!1},this.items.length,0),{remaining:u,transform:c,selection:l}};lt.prototype.addTransform=function(t,r,n,o){for(var i=[],s=this.eventCount,a=this.items,c=!o&&a.length?a.get(a.length-1):null,l=0;lSh&&(a=kh(a,d),s-=d),new lt(a.append(i),s)};lt.prototype.remapping=function(t,r){var n=new dt;return this.items.forEach(function(o,i){var s=o.mirrorOffset!=null&&i-o.mirrorOffset>=t?n.maps.length-o.mirrorOffset:null;n.appendMap(o.map,s)},t,r),n};lt.prototype.addMaps=function(t){return this.eventCount==0?this:new lt(this.items.append(t.map(function(r){return new Xt(r)})),this.eventCount)};lt.prototype.rebased=function(t,r){if(!this.eventCount)return this;var n=[],o=Math.max(0,this.items.length-r),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(function(d){d.selection&&a--},o);var c=r;this.items.forEach(function(d){var h=i.getMirror(--c);if(h!=null){s=Math.min(s,h);var v=i.maps[h];if(d.step){var g=t.steps[h].invert(t.docs[h]),M=d.selection&&d.selection.map(i.slice(c+1,h));M&&a++,n.push(new Xt(v,g,M))}else n.push(new Xt(v))}},o);for(var l=[],u=r;ubh&&(p=p.compress(this.items.length-n.length)),p};lt.prototype.emptyItemCount=function(){var t=0;return this.items.forEach(function(r){r.step||t++}),t};lt.prototype.compress=function(t){t===void 0&&(t=this.items.length);var r=this.remapping(0,t),n=r.maps.length,o=[],i=0;return this.items.forEach(function(s,a){if(a>=t)o.push(s),s.selection&&i++;else if(s.step){var c=s.step.map(r.slice(n)),l=c&&c.getMap();if(n--,l&&r.appendMap(l,n),c){var u=s.selection&&s.selection.map(r.slice(n));u&&i++;var f=new Xt(l.invert(),c,u),p,d=o.length-1;(p=o.length&&o[d].merge(f))?o[d]=p:o.push(f)}}else s.map&&n--},this.items.length,0),new lt(za.from(o.reverse()),i)};lt.empty=new lt(za.empty,0);function kh(e,t){var r;return e.forEach(function(n,o){if(n.selection&&t--==0)return r=o,!1}),e.slice(r)}var Xt=function(t,r,n,o){this.map=t,this.step=r,this.selection=n,this.mirrorOffset=o};Xt.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var r=t.step.merge(this.step);if(r)return new Xt(r.getMap().invert(),r,this.selection)}};var me=function(t,r,n,o){this.done=t,this.undone=r,this.prevRanges=n,this.prevTime=o},Sh=20;function Mh(e,t,r,n){var o=r.getMeta(ve),i;if(o)return o.historyState;r.getMeta(Ch)&&(e=new me(e.done,e.undone,null,0));var s=r.getMeta("appendedTransaction");if(r.steps.length==0)return e;if(s&&s.getMeta(ve))return s.getMeta(ve).redo?new me(e.done.addTransform(r,null,n,Zr(t)),e.undone,La(r.mapping.maps[r.steps.length-1]),e.prevTime):new me(e.done,e.undone.addTransform(r,null,n,Zr(t)),null,e.prevTime);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){var a=e.prevTime==0||!s&&(e.prevTime<(r.time||0)-n.newGroupDelay||!xh(r,e.prevRanges)),c=s?Ao(e.prevRanges,r.mapping):La(r.mapping.maps[r.steps.length-1]);return new me(e.done.addTransform(r,a?t.selection.getBookmark():null,n,Zr(t)),lt.empty,c,r.time)}else return(i=r.getMeta("rebased"))?new me(e.done.rebased(r,i),e.undone.rebased(r,i),Ao(e.prevRanges,r.mapping),e.prevTime):new me(e.done.addMaps(r.mapping.maps),e.undone.addMaps(r.mapping.maps),Ao(e.prevRanges,r.mapping),e.prevTime)}function xh(e,t){if(!t)return!1;if(!e.docChanged)return!0;var r=!1;return e.mapping.maps[0].forEach(function(n,o){for(var i=0;i=t[i]&&(r=!0)}),r}function La(e){var t=[];return e.forEach(function(r,n,o,i){return t.push(o,i)}),t}function Ao(e,t){if(!e)return null;for(var r=[],n=0;n({state:e,dispatch:t})=>Ha(e,t),redo:()=>({state:e,dispatch:t})=>ja(e,t)}},addProseMirrorPlugins(){return[Oh(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}}),Th=wt.create({name:"horizontalRule",defaultOptions:{HTMLAttributes:{}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",Ot(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e})=>e().command(({tr:t,dispatch:r})=>{const{selection:n}=t,{empty:o,$anchor:i}=n,s=i.parent.isTextblock&&!i.parent.type.spec.code&&!i.parent.textContent;if(!o||!s||!r)return!0;const a=i.before();return t.deleteRange(a,a+1),!0}).insertContent({type:this.name}).command(({tr:t,dispatch:r})=>{var n;if(r){const{parent:o,pos:i}=t.selection.$from,s=i+1;if(!t.doc.nodeAt(s)){const c=(n=o.type.contentMatch.defaultType)===null||n===void 0?void 0:n.create();c&&(t.insert(s,c),t.setSelection(H.create(t.doc,s)))}t.scrollIntoView()}return!0}).run()}},addInputRules(){return[ud(/^(?:---|—-|___\s|\*\*\*\s)$/,this.type)]}}),Ah=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/gm,_h=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/gm,Nh=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/gm,Eh=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/gm,Dh=Te.create({name:"italic",defaultOptions:{HTMLAttributes:{}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark("italic"),toggleItalic:()=>({commands:e})=>e.toggleMark("italic"),unsetItalic:()=>({commands:e})=>e.unsetMark("italic")}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[qe(Ah,this.type),qe(Nh,this.type)]},addPasteRules(){return[Je(_h,this.type),Je(Eh,this.type)]}}),Ih=wt.create({name:"listItem",defaultOptions:{HTMLAttributes:{}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",Ot(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem("listItem"),Tab:()=>this.editor.commands.sinkListItem("listItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("listItem")}}}),Rh=/^(\d+)\.\s$/,Ph=wt.create({name:"orderedList",defaultOptions:{HTMLAttributes:{}},group:"block list",content:"listItem+",addAttributes(){return{start:{default:1,parseHTML:e=>({start:e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1})}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const n=e,{start:t}=n,r=Go(n,["start"]);return t===1?["ol",Ot(this.options.HTMLAttributes,r),0]:["ol",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e})=>e.toggleList("orderedList","listItem")}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[uo(Rh,this.type,e=>({start:+e[1]}),(e,t)=>t.childCount+t.attrs.start===+e[1])]}}),Bh=wt.create({name:"paragraph",priority:1e3,defaultOptions:{HTMLAttributes:{}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode("paragraph")}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),zh=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/gm,Lh=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/gm,Fh=Te.create({name:"strike",defaultOptions:{HTMLAttributes:{}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",Ot(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark("strike"),toggleStrike:()=>({commands:e})=>e.toggleMark("strike"),unsetStrike:()=>({commands:e})=>e.unsetMark("strike")}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[qe(zh,this.type)]},addPasteRules(){return[Je(Lh,this.type)]}}),Vh=wt.create({name:"text",group:"inline"}),Hh=St.create({name:"starterKit",addExtensions(){var e,t,r,n,o,i,s,a,c,l,u,f,p,d,h,v,g,M;const y=[];return this.options.blockquote!==!1&&y.push(Kd.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bold!==!1&&y.push(Xd.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.bulletList!==!1&&y.push(Zd.configure((r=this.options)===null||r===void 0?void 0:r.bulletList)),this.options.code!==!1&&y.push(rh.configure((n=this.options)===null||n===void 0?void 0:n.code)),this.options.codeBlock!==!1&&y.push(ih.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&y.push(sh.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&y.push(ch.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&y.push(mh.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&y.push(vh.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&y.push(gh.configure((l=this.options)===null||l===void 0?void 0:l.heading)),this.options.history!==!1&&y.push(wh.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&y.push(Th.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&y.push(Dh.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&y.push(Ih.configure((d=this.options)===null||d===void 0?void 0:d.listItem)),this.options.orderedList!==!1&&y.push(Ph.configure((h=this.options)===null||h===void 0?void 0:h.orderedList)),this.options.paragraph!==!1&&y.push(Bh.configure((v=this.options)===null||v===void 0?void 0:v.paragraph)),this.options.strike!==!1&&y.push(Fh.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&y.push(Vh.configure((M=this.options)===null||M===void 0?void 0:M.text)),y}}),jh=St.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>e.style.textAlign||this.options.defaultAlignment,renderHTML:e=>e.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${e.textAlign}`}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.every(r=>t.updateAttributes(r,{textAlign:e})):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.every(t=>e.resetAttributes(t,"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")}}}),qh={},Jh={viewBox:"0 0 24 24"},Wh=A("path",{d:"M17.194 10.962A6.271 6.271 0 0012.844.248H4.3a1.25 1.25 0 000 2.5h1.013a.25.25 0 01.25.25V21a.25.25 0 01-.25.25H4.3a1.25 1.25 0 100 2.5h9.963a6.742 6.742 0 002.93-12.786zm-4.35-8.214a3.762 3.762 0 010 7.523H8.313a.25.25 0 01-.25-.25V3a.25.25 0 01.25-.25zm1.42 18.5H8.313a.25.25 0 01-.25-.25v-7.977a.25.25 0 01.25-.25h5.951a4.239 4.239 0 010 8.477z"},null,-1),Kh=[Wh];function $h(e,t){return gt(),Mt("svg",Jh,Kh)}var Uh=At(qh,[["render",$h]]);const Gh={},Yh={viewBox:"0 0 24 24"},Xh=A("path",{d:"M9.147 21.552a1.244 1.244 0 01-.895-.378L.84 13.561a2.257 2.257 0 010-3.125l7.412-7.613a1.25 1.25 0 011.791 1.744l-6.9 7.083a.5.5 0 000 .7l6.9 7.082a1.25 1.25 0 01-.9 2.122zm5.707 0a1.25 1.25 0 01-.9-2.122l6.9-7.083a.5.5 0 000-.7l-6.9-7.082a1.25 1.25 0 011.791-1.744l7.411 7.612a2.257 2.257 0 010 3.125l-7.412 7.614a1.244 1.244 0 01-.89.38zm6.514-9.373z"},null,-1),Qh=[Xh];function Zh(e,t){return gt(),Mt("svg",Yh,Qh)}var tm=At(Gh,[["render",Zh]]);const em={},rm={viewBox:"0 0 24 24"},nm=A("path",{d:"M22.5.248h-7.637a1.25 1.25 0 000 2.5h1.086a.25.25 0 01.211.384L4.78 21.017a.5.5 0 01-.422.231H1.5a1.25 1.25 0 000 2.5h7.637a1.25 1.25 0 000-2.5H8.051a.25.25 0 01-.211-.384L19.22 2.98a.5.5 0 01.422-.232H22.5a1.25 1.25 0 000-2.5z"},null,-1),om=[nm];function im(e,t){return gt(),Mt("svg",rm,om)}var sm=At(em,[["render",im]]);const am={},cm={viewBox:"0 0 24 24"},lm=A("path",{d:"M7.75 4.5h15a1 1 0 000-2h-15a1 1 0 000 2zm15 6.5h-15a1 1 0 100 2h15a1 1 0 000-2zm0 8.5h-15a1 1 0 000 2h15a1 1 0 000-2zM2.212 17.248a2 2 0 00-1.933 1.484.75.75 0 101.45.386.5.5 0 11.483.63.75.75 0 100 1.5.5.5 0 11-.482.635.75.75 0 10-1.445.4 2 2 0 103.589-1.648.251.251 0 010-.278 2 2 0 00-1.662-3.111zm2.038-6.5a2 2 0 00-4 0 .75.75 0 001.5 0 .5.5 0 011 0 1.031 1.031 0 01-.227.645L.414 14.029A.75.75 0 001 15.248h2.5a.75.75 0 000-1.5h-.419a.249.249 0 01-.195-.406L3.7 12.33a2.544 2.544 0 00.55-1.582zM4 5.248h-.25A.25.25 0 013.5 5V1.623A1.377 1.377 0 002.125.248H1.5a.75.75 0 000 1.5h.25A.25.25 0 012 2v3a.25.25 0 01-.25.25H1.5a.75.75 0 000 1.5H4a.75.75 0 000-1.5z"},null,-1),um=[lm];function fm(e,t){return gt(),Mt("svg",cm,um)}var pm=At(am,[["render",fm]]);const dm={},hm={viewBox:"0 0 24 24"},mm=vc('',6),vm=[mm];function gm(e,t){return gt(),Mt("svg",hm,vm)}var ym=At(dm,[["render",gm]]);const bm={},km={viewBox:"0 0 24 24"},Sm=A("path",{d:"M22.5.248H7.228a6.977 6.977 0 100 13.954h2.318a.25.25 0 01.25.25V22.5a1.25 1.25 0 002.5 0V3a.25.25 0 01.25-.25h3.682a.25.25 0 01.25.25v19.5a1.25 1.25 0 002.5 0V3a.249.249 0 01.25-.25H22.5a1.25 1.25 0 000-2.5zM9.8 11.452a.25.25 0 01-.25.25H7.228a4.477 4.477 0 110-8.954h2.318A.25.25 0 019.8 3z"},null,-1),Mm=[Sm];function xm(e,t){return gt(),Mt("svg",km,Mm)}var Cm=At(bm,[["render",xm]]);const Om={},wm={viewBox:"0 0 24 24"},Tm=A("path",{d:"M18.559 3.932a4.942 4.942 0 100 9.883 4.609 4.609 0 001.115-.141.25.25 0 01.276.368 6.83 6.83 0 01-5.878 3.523 1.25 1.25 0 000 2.5 9.71 9.71 0 009.428-9.95V8.873a4.947 4.947 0 00-4.941-4.941zm-12.323 0a4.942 4.942 0 000 9.883 4.6 4.6 0 001.115-.141.25.25 0 01.277.368 6.83 6.83 0 01-5.878 3.523 1.25 1.25 0 000 2.5 9.711 9.711 0 009.428-9.95V8.873a4.947 4.947 0 00-4.942-4.941z"},null,-1),Am=[Tm];function _m(e,t){return gt(),Mt("svg",wm,Am)}var Nm=At(Om,[["render",_m]]);const Em={},Dm={viewBox:"0 0 24 24"},Im=A("path",{d:"M23.75 12.952A1.25 1.25 0 0022.5 11.7h-8.936a.492.492 0 01-.282-.09c-.722-.513-1.482-.981-2.218-1.432-2.8-1.715-4.5-2.9-4.5-4.863 0-2.235 2.207-2.569 3.523-2.569a4.54 4.54 0 013.081.764 2.662 2.662 0 01.447 1.99v.3a1.25 1.25 0 102.5 0v-.268a4.887 4.887 0 00-1.165-3.777C13.949.741 12.359.248 10.091.248c-3.658 0-6.023 1.989-6.023 5.069 0 2.773 1.892 4.512 4 5.927a.25.25 0 01-.139.458H1.5a1.25 1.25 0 000 2.5h10.977a.251.251 0 01.159.058 4.339 4.339 0 011.932 3.466c0 3.268-3.426 3.522-4.477 3.522-1.814 0-3.139-.405-3.834-1.173a3.394 3.394 0 01-.65-2.7 1.25 1.25 0 00-2.488-.246A5.76 5.76 0 004.4 21.753c1.2 1.324 3.114 2 5.688 2 4.174 0 6.977-2.42 6.977-6.022a6.059 6.059 0 00-.849-3.147.25.25 0 01.216-.377H22.5a1.25 1.25 0 001.25-1.255z"},null,-1),Rm=[Im];function Pm(e,t){return gt(),Mt("svg",Dm,Rm)}var Bm=At(Em,[["render",Pm]]);const zm={},Lm={viewBox:"0 0 24 24"},Fm=A("path",{d:"M17.786 3.77a12.542 12.542 0 00-12.965-.865.249.249 0 01-.292-.045L1.937.269A.507.507 0 001.392.16a.5.5 0 00-.308.462v6.7a.5.5 0 00.5.5h6.7a.5.5 0 00.354-.854L6.783 5.115a.253.253 0 01-.068-.228.249.249 0 01.152-.181 10 10 0 019.466 1.1 9.759 9.759 0 01.094 15.809 1.25 1.25 0 001.473 2.016 12.122 12.122 0 005.013-9.961 12.125 12.125 0 00-5.127-9.9z"},null,-1),Vm=[Fm];function Hm(e,t){return gt(),Mt("svg",Lm,Vm)}var jm=At(zm,[["render",Hm]]);const qm={},Jm={viewBox:"0 0 24 24"},Wm=A("path",{d:"M22.608.161a.5.5 0 00-.545.108L19.472 2.86a.25.25 0 01-.292.045 12.537 12.537 0 00-12.966.865A12.259 12.259 0 006.1 23.632a1.25 1.25 0 001.476-2.018 9.759 9.759 0 01.091-15.809 10 10 0 019.466-1.1.25.25 0 01.084.409l-1.85 1.85a.5.5 0 00.354.853h6.7a.5.5 0 00.5-.5V.623a.5.5 0 00-.313-.462z"},null,-1),Km=[Wm];function $m(e,t){return gt(),Mt("svg",Jm,Km)}var Um=At(qm,[["render",$m]]);const Gm={},Ym={viewBox:"0 0 24 24"},Xm=A("path",{d:"M9.147 21.552a1.244 1.244 0 01-.895-.378L.84 13.561a2.257 2.257 0 010-3.125l7.412-7.613a1.25 1.25 0 011.791 1.744l-6.9 7.083a.5.5 0 000 .7l6.9 7.082a1.25 1.25 0 01-.9 2.122zm5.707 0a1.25 1.25 0 01-.9-2.122l6.9-7.083a.5.5 0 000-.7l-6.9-7.082a1.25 1.25 0 011.791-1.744l7.411 7.612a2.257 2.257 0 010 3.125l-7.412 7.614a1.244 1.244 0 01-.89.38zm6.514-9.373z"},null,-1),Qm=[Xm];function Zm(e,t){return gt(),Mt("svg",Ym,Qm)}var tv=At(Gm,[["render",Zm]]);const ev={},rv={viewBox:"0 0 24 24"},nv=A("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.75 5.25h16.5a.75.75 0 1 1 0 1.5H3.75a.75.75 0 0 1 0-1.5zm4 4h8.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5zm-4 4h16.5a.75.75 0 1 1 0 1.5H3.75a.75.75 0 1 1 0-1.5zm4 4h8.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5z"},null,-1),ov=[nv];function iv(e,t){return gt(),Mt("svg",rv,ov)}var sv=At(ev,[["render",iv]]);const av={components:{EditorContent:qd,BoldIcon:Uh,CodingIcon:tm,ItalicIcon:sm,ListIcon:pm,ListUlIcon:ym,ParagraphIcon:Cm,QuoteIcon:Nm,StrikethroughIcon:Bm,UndoIcon:jm,RedoIcon:Um,CodeBlockIcon:tv,DotsVerticalIcon:gc,MenuCenterIcon:sv,MenuAlt2Icon:yc,MenuAlt3Icon:bc,MenuIcon:kc},props:{modelValue:{type:String,default:""},contentLoading:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const r=Jd({content:e.modelValue,extensions:[Hh,jh.configure({types:["heading","paragraph"],alignments:["left","right","center","justify"]})],onUpdate:()=>{t("update:modelValue",r.value.getHTML())}});return Sc(()=>e.modelValue,n=>{r.value.getHTML()!==n&&r.value.commands.setContent(e.modelValue,!1)}),Mc(()=>{setTimeout(()=>{r.value.destroy()},500)}),{editor:r}}},cv={key:1,class:"box-border w-full text-sm leading-8 text-left bg-white border border-gray-200 rounded-md min-h-[200px] overflow-hidden"},lv={key:0,class:"editor-content"},uv={class:"flex justify-end p-2 border-b border-gray-200 md:hidden"},fv={class:"flex items-center justify-center w-6 h-6 ml-2 text-sm text-black bg-white rounded-sm md:h-9 md:w-9"},pv={class:"flex flex-wrap space-x-1"},dv={class:"hidden p-2 border-b border-gray-200 md:flex"},hv={class:"flex flex-wrap space-x-1"};function mv(e,t,r,n,o,i){const s=Q("BaseContentPlaceholdersBox"),a=Q("BaseContentPlaceholders"),c=Q("dots-vertical-icon"),l=Q("bold-icon"),u=Q("italic-icon"),f=Q("strikethrough-icon"),p=Q("coding-icon"),d=Q("paragraph-icon"),h=Q("list-ul-icon"),v=Q("list-icon"),g=Q("quote-icon"),M=Q("code-block-icon"),y=Q("undo-icon"),R=Q("redo-icon"),m=Q("BaseDropdown"),I=Q("menu-alt2-icon"),O=Q("menu-alt3-icon"),F=Q("menu-icon"),J=Q("menu-center-icon"),U=Q("editor-content");return r.contentLoading?(gt(),xc(a,{key:0},{default:an(()=>[V(s,{rounded:!0,class:"w-full",style:{height:"200px"}})]),_:1})):(gt(),Mt("div",cv,[n.editor?(gt(),Mt("div",lv,[A("div",uv,[V(m,{"width-class":"w-48"},{activator:an(()=>[A("div",fv,[V(c,{class:"w-6 h-6 text-gray-600"})])]),default:an(()=>[A("div",pv,[A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bold")}]),onClick:t[0]||(t[0]=T=>n.editor.chain().focus().toggleBold().run())},[V(l,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("italic")}]),onClick:t[1]||(t[1]=T=>n.editor.chain().focus().toggleItalic().run())},[V(u,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("strike")}]),onClick:t[2]||(t[2]=T=>n.editor.chain().focus().toggleStrike().run())},[V(f,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("code")}]),onClick:t[3]||(t[3]=T=>n.editor.chain().focus().toggleCode().run())},[V(p,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("paragraph")}]),onClick:t[4]||(t[4]=T=>n.editor.chain().focus().setParagraph().run())},[V(d,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:1})}]),onClick:t[5]||(t[5]=T=>n.editor.chain().focus().toggleHeading({level:1}).run())}," H1 ",2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:2})}]),onClick:t[6]||(t[6]=T=>n.editor.chain().focus().toggleHeading({level:2}).run())}," H2 ",2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:3})}]),onClick:t[7]||(t[7]=T=>n.editor.chain().focus().toggleHeading({level:3}).run())}," H3 ",2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bulletList")}]),onClick:t[8]||(t[8]=T=>n.editor.chain().focus().toggleBulletList().run())},[V(h,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("orderedList")}]),onClick:t[9]||(t[9]=T=>n.editor.chain().focus().toggleOrderedList().run())},[V(v,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("blockquote")}]),onClick:t[10]||(t[10]=T=>n.editor.chain().focus().toggleBlockquote().run())},[V(g,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("codeBlock")}]),onClick:t[11]||(t[11]=T=>n.editor.chain().focus().toggleCodeBlock().run())},[V(M,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("undo")}]),onClick:t[12]||(t[12]=T=>n.editor.chain().focus().undo().run())},[V(y,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("redo")}]),onClick:t[13]||(t[13]=T=>n.editor.chain().focus().redo().run())},[V(R,{class:"h-3 cursor-pointer fill-current"})],2)])]),_:1})]),A("div",dv,[A("div",hv,[A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bold")}]),onClick:t[14]||(t[14]=T=>n.editor.chain().focus().toggleBold().run())},[V(l,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("italic")}]),onClick:t[15]||(t[15]=T=>n.editor.chain().focus().toggleItalic().run())},[V(u,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("strike")}]),onClick:t[16]||(t[16]=T=>n.editor.chain().focus().toggleStrike().run())},[V(f,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("code")}]),onClick:t[17]||(t[17]=T=>n.editor.chain().focus().toggleCode().run())},[V(p,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("paragraph")}]),onClick:t[18]||(t[18]=T=>n.editor.chain().focus().setParagraph().run())},[V(d,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:1})}]),onClick:t[19]||(t[19]=T=>n.editor.chain().focus().toggleHeading({level:1}).run())}," H1 ",2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:2})}]),onClick:t[20]||(t[20]=T=>n.editor.chain().focus().toggleHeading({level:2}).run())}," H2 ",2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("heading",{level:3})}]),onClick:t[21]||(t[21]=T=>n.editor.chain().focus().toggleHeading({level:3}).run())}," H3 ",2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("bulletList")}]),onClick:t[22]||(t[22]=T=>n.editor.chain().focus().toggleBulletList().run())},[V(h,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("orderedList")}]),onClick:t[23]||(t[23]=T=>n.editor.chain().focus().toggleOrderedList().run())},[V(v,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("blockquote")}]),onClick:t[24]||(t[24]=T=>n.editor.chain().focus().toggleBlockquote().run())},[V(g,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("codeBlock")}]),onClick:t[25]||(t[25]=T=>n.editor.chain().focus().toggleCodeBlock().run())},[V(M,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("undo")}]),onClick:t[26]||(t[26]=T=>n.editor.chain().focus().undo().run())},[V(y,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive("redo")}]),onClick:t[27]||(t[27]=T=>n.editor.chain().focus().redo().run())},[V(R,{class:"h-3 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"left"})}]),onClick:t[28]||(t[28]=T=>n.editor.chain().focus().setTextAlign("left").run())},[V(I,{class:"h-5 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"right"})}]),onClick:t[29]||(t[29]=T=>n.editor.chain().focus().setTextAlign("right").run())},[V(O,{class:"h-5 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"justify"})}]),onClick:t[30]||(t[30]=T=>n.editor.chain().focus().setTextAlign("justify").run())},[V(F,{class:"h-5 cursor-pointer fill-current"})],2),A("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-sm cursor-pointer hover:bg-gray-100",{"bg-gray-200":n.editor.isActive({textAlign:"center"})}]),onClick:t[31]||(t[31]=T=>n.editor.chain().focus().setTextAlign("center").run())},[V(J,{class:"h-5 cursor-pointer fill-current"})],2)])]),V(U,{editor:n.editor,class:"box-border relative w-full text-sm leading-8 text-left editor__content"},null,8,["editor"])])):Cc("",!0)]))}var bv=At(av,[["render",mv]]);export{bv as default};