diff --git a/dist/tiptap.umd.js b/dist/tiptap.umd.js index 98c6a1c..92bfa0f 100644 --- a/dist/tiptap.umd.js +++ b/dist/tiptap.umd.js @@ -1 +1 @@ -var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,n)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,__spreadValues=(t,e)=>{for(var n in e||(e={}))__hasOwnProp.call(e,n)&&__defNormalProp(t,n,e[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(e))__propIsEnum.call(e,n)&&__defNormalProp(t,n,e[n]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e)),__objRest=(t,e)=>{var n={};for(var r in t)__hasOwnProp.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))e.indexOf(r)<0&&__propIsEnum.call(t,r)&&(n[r]=t[r]);return n},__vite_style__=document.createElement("style");__vite_style__.innerHTML=".ProseMirror div,.ProseMirror li>p:first-child{display:inline}ul[data-type=taskList]{list-style:none;padding:0}ul[data-type=taskList] li{display:flex;align-items:center}ul[data-type=taskList] li>label{flex:0 0 auto;margin-right:.5rem}",document.head.appendChild(__vite_style__),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Vue)}(this,(function(t){"use strict";function e(t){this.content=t}e.prototype={constructor:e,find:function(t){for(var e=0;e>1}},e.from=function(t){if(t instanceof e)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new e(n)};var n=e;function r(t,e,n){for(var o=0;;o++){if(o==t.childCount||o==e.childCount)return t.childCount==e.childCount?null:n;var i=t.child(o),s=e.child(o);if(i!=s){if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(var a=0;i.text[a]==s.text[a];a++)n++;return n}if(i.content.size||s.content.size){var c=r(i.content,s.content,n+1);if(null!=c)return c}n+=i.nodeSize}else n+=i.nodeSize}}function o(t,e,n,r){for(var i=t.childCount,s=e.childCount;;){if(0==i||0==s)return i==s?null:{a:n,b:r};var a=t.child(--i),c=e.child(--s),p=a.nodeSize;if(a!=c){if(!a.sameMarkup(c))return{a:n,b:r};if(a.isText&&a.text!=c.text){for(var l=0,d=Math.min(a.text.length,c.text.length);lt&&!1!==n(a,r+s,o,i)&&a.content.size){var p=s+1;a.nodesBetween(Math.max(0,t-p),Math.min(a.content.size,e-p),n,r+p)}s=c}},i.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},i.prototype.textBetween=function(t,e,n,r){var o="",i=!0;return this.nodesBetween(t,e,(function(s,a){s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf&&r?(o+=r,i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o},i.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);ot)for(var o=0,s=0;st&&((se)&&(a=a.isText?a.cut(Math.max(0,t-s),Math.min(a.text.length,e-s)):a.cut(Math.max(0,t-s-1),Math.min(a.content.size,e-s-1))),n.push(a),r+=a.nodeSize),s=c}return new i(n,r)},i.prototype.cutByIndex=function(t,e){return t==e?i.empty:0==t&&e==this.content.length?this:new i(this.content.slice(t,e))},i.prototype.replaceChild=function(t,e){var n=this.content[t];if(n==e)return this;var r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new i(r,o)},i.prototype.addToStart=function(t){return new i([t].concat(this.content),this.size+t.nodeSize)},i.prototype.addToEnd=function(t){return new i(this.content.concat(t),this.size+t.nodeSize)},i.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;ethis.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?c(n+1,o):c(n,r);r=o}},i.prototype.toString=function(){return"<"+this.toStringInner()+">"},i.prototype.toStringInner=function(){return this.content.join(", ")},i.prototype.toJSON=function(){return this.content.length?this.content.map((function(t){return t.toJSON()})):null},i.fromJSON=function(t,e){if(!e)return i.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new i(e.map(t.nodeFromJSON))},i.fromArray=function(t){if(!t.length)return i.empty;for(var e,n=0,r=0;rthis.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e},l.prototype.removeFromSet=function(t){for(var e=0;et.depth)throw new d("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new d("Inconsistent open depths");return g(t,e,n,0)}function g(t,e,n,r){var o=t.index(r),s=t.node(r);if(o==e.index(r)&&r=0;o--)r=e.node(o).copy(i.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return x(s,M(t,c.start,c.end,e,r))}var p=t.parent,l=p.content;return x(p,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}return x(s,S(t,e,r))}function y(t,e){if(!e.type.compatibleContent(t.type))throw new d("Cannot join "+e.type.name+" onto "+t.type.name)}function b(t,e,n){var r=t.node(n);return y(r,e.node(n)),r}function w(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function k(t,e,n,r){var o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(w(t.nodeAfter,r),i++));for(var a=i;ao&&b(t,e,o+1),a=r.depth>o&&b(n,r,o+1),c=[];return k(null,t,o,c),s&&a&&e.index(o)==n.index(o)?(y(s,a),w(x(s,M(t,e,n,r,o+1)),c)):(s&&w(x(s,S(t,e,o+1)),c),k(e,n,o,c),a&&w(x(a,S(n,r,o+1)),c)),k(r,null,o,c),new i(c)}function S(t,e,n){var r=[];(k(null,t,n,r),t.depth>n)&&w(x(b(t,e,n+1),S(t,e,n+1)),r);return k(e,null,n,r),new i(r)}h.size.get=function(){return this.content.size-this.openStart-this.openEnd},u.prototype.insertAt=function(t,e){var n=m(this.content,t+this.openStart,e,null);return n&&new u(n,this.openStart,this.openEnd)},u.prototype.removeBetween=function(t,e){return new u(f(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)},u.prototype.eq=function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd},u.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},u.prototype.toJSON=function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},u.fromJSON=function(t,e){if(!e)return u.empty;var n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new u(i.fromJSON(t,e.content),n,r)},u.maxOpen=function(t,e){void 0===e&&(e=!0);for(var n=0,r=0,o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new u(t,n,r)},Object.defineProperties(u.prototype,h),u.empty=new u(i.empty,0,0);var O=function(t,e,n){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=n},C={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};O.prototype.resolveDepth=function(t){return null==t?this.depth:t<0?this.depth+t:t},C.parent.get=function(){return this.node(this.depth)},C.doc.get=function(){return this.node(0)},O.prototype.node=function(t){return this.path[3*this.resolveDepth(t)]},O.prototype.index=function(t){return this.path[3*this.resolveDepth(t)+1]},O.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)},O.prototype.start=function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1},O.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},O.prototype.before=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]},O.prototype.after=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize},C.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},C.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r},C.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)},O.prototype.posAtIndex=function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1,o=0;o0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},O.prototype.blockRange=function(t,e){if(void 0===t&&(t=this),t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new V(this,t,n)},O.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},O.prototype.max=function(t){return t.pos>this.pos?t:this},O.prototype.min=function(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var n=[],r=0,o=e,i=t;;){var s=i.content.findIndex(o),a=s.index,c=s.offset,p=o-c;if(n.push(i,a,r+c),!p)break;if((i=i.child(a)).isText)break;o=p-1,r+=c+1}return new O(e,n,o)},O.resolveCached=function(t,e){for(var n=0;nt&&this.nodesBetween(t,e,(function(t){return n.isInSet(t.marks)&&(r=!0),!r})),r},R.isBlock.get=function(){return this.type.isBlock},R.isTextblock.get=function(){return this.type.isTextblock},R.inlineContent.get=function(){return this.type.inlineContent},R.isInline.get=function(){return this.type.isInline},R.isText.get=function(){return this.type.isText},R.isLeaf.get=function(){return this.type.isLeaf},R.isAtom.get=function(){return this.type.isAtom},D.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()+")"),I(this.marks,t)},D.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},D.prototype.canReplace=function(t,e,n,r,o){void 0===n&&(n=i.empty),void 0===r&&(r=0),void 0===o&&(o=n.childCount);var s=this.contentMatchAt(t).matchFragment(n,r,o),a=s&&s.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(var c=r;c=0;n--)e=t[n].type.name+"("+e+")";return e}var B=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},L={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};B.parse=function(t,e){var n=new P(t,e);if(null==n.next)return B.empty;var r=$(n);n.next&&n.err("Unexpected trailing text");var o=function(t){var e=Object.create(null);return n(U(t,0));function n(r){var o=[];r.forEach((function(e){t[e].forEach((function(e){var n=e.term,r=e.to;if(n){var i=o.indexOf(n),s=i>-1&&o[i+1];U(t,r).forEach((function(t){s||o.push(n,s=[]),-1==s.indexOf(t)&&s.push(t)}))}}))}));for(var i=e[r.join(",")]=new B(r.indexOf(t.length-1)>-1),s=0;s>1},B.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},B.prototype.toString=function(){var t=[];return function e(n){t.push(n);for(var r=1;r"+t.indexOf(e.next[o+1]);return r})).join("\n")},Object.defineProperties(B.prototype,L),B.empty=new B(!0);var P=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},j={next:{configurable:!0}};function $(t){var e=[];do{e.push(F(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function F(t){var e=[];do{e.push(H(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function H(t){for(var e=function(t){if(t.eat("(")){var e=$(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){var n=function(t,e){var n=t.nodeTypes,r=n[e];if(r)return[r];var o=[];for(var i in n){var s=n[i];s.groups.indexOf(e)>-1&&o.push(s)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((function(e){return null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}}));return t.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}t.err("Unexpected token '"+t.next+"'")}(t);;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=J(t,e)}return e}function q(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function J(t,e){var n=q(t),r=n;return t.eat(",")&&(r="}"!=t.next?q(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function W(t,e){return e-t}function U(t,e){var n=[];return function e(r){var o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(var i=0;i-1},Y.prototype.allowsMarks=function(t){if(null==this.markSet)return!0;for(var e=0;e-1};var nt=function(t){for(var e in this.spec={},t)this.spec[e]=t[e];this.spec.nodes=n.from(t.nodes),this.spec.marks=n.from(t.marks),this.nodes=Y.compile(this.spec.nodes,this),this.marks=et.compile(this.spec.marks,this);var r=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=r[s]||(r[s]=B.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==a?null:a?rt(this,a.split(" ")):""!=a&&i.inlineContent?null:[]}for(var c in this.marks){var p=this.marks[c],l=p.spec.excludes;p.excluded=null==l?[p]:""==l?[]:rt(this,l.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};function rt(t,e){for(var n=[],r=0;r-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}nt.prototype.node=function(t,e,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof Y))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)},nt.prototype.text=function(t,e){var n=this.nodes.text;return new z(n,n.defaultAttrs,t,l.setFrom(e))},nt.prototype.mark=function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)},nt.prototype.nodeFromJSON=function(t){return D.fromJSON(this,t)},nt.prototype.markFromJSON=function(t){return l.fromJSON(this,t)},nt.prototype.nodeType=function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e};var ot=function(t,e){var n=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((function(t){t.tag?n.tags.push(t):t.style&&n.styles.push(t)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))};ot.prototype.parse=function(t,e){void 0===e&&(e={});var n=new lt(this,e,!1);return n.addAll(t,null,e.from,e.to),n.finish()},ot.prototype.parseSlice=function(t,e){void 0===e&&(e={});var n=new lt(this,e,!0);return n.addAll(t,null,e.from,e.to),u.maxOpen(n.finish())},ot.prototype.matchTag=function(t,e,n){for(var r=n?this.tags.indexOf(n)+1:0;rt.length&&(61!=i.style.charCodeAt(t.length)||i.style.slice(t.length+1)!=e))){if(i.getAttrs){var s=i.getAttrs(e);if(!1===s)continue;i.attrs=s}return i}}},ot.schemaRules=function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,r=0;r=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]},pt.prototype.applyPending=function(t){for(var e=0,n=this.pendingMarks;e=0;r--){var o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(var s=0;sthis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},lt.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},lt.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return void(this.open=e)},dt.currentPos.get=function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t},lt.prototype.findAtPoint=function(t,e){if(this.find)for(var n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=function(t,a){for(;t>=0;t--){var c=n[t];if(""==c){if(t==n.length-1||0==t)continue;for(;a>=i;a--)if(s(t-1,a))return!0;return!1}var p=a>0||0==a&&o?e.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!p||p.name!=c&&-1==p.groups.indexOf(c))return!1;a--}return!0};return s(n.length-1,this.open)},lt.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},lt.prototype.addPendingMark=function(t){var e=function(t,e){for(var n=0;n=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);var o=r.popFromStashMark(t);o&&r.type&&r.type.allowsMarkType(o.type)&&(r.activeMarks=o.addToSet(r.activeMarks))}if(r==e)break}},Object.defineProperties(lt.prototype,dt);var mt=function(t,e){this.nodes=t||{},this.marks=e||{}};function vt(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function gt(t){return t.document||window.document}mt.prototype.serializeFragment=function(t,e,n){var r=this;void 0===e&&(e={}),n||(n=gt(e).createDocumentFragment());var o=n,i=null;return t.forEach((function(t){if(i||t.marks.length){i||(i=[]);for(var n=0,s=0;n=0;r--){var o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},mt.prototype.serializeMark=function(t,e,n){void 0===n&&(n={});var r=this.marks[t.type.name];return r&&mt.renderSpec(gt(n),r(t,e))},mt.renderSpec=function(t,e,n){if(void 0===n&&(n=null),"string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;var r=e[0],o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));var i=null,s=n?t.createElementNS(n,r):t.createElement(r),a=e[1],c=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a))for(var p in c=2,a)if(null!=a[p]){var l=p.indexOf(" ");l>0?s.setAttributeNS(p.slice(0,l),p.slice(l+1),a[p]):s.setAttribute(p,a[p])}for(var d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var h=mt.renderSpec(t,u,n),f=h.dom,m=h.contentDOM;if(s.appendChild(f),m){if(i)throw new RangeError("Multiple content holes");i=m}}return{dom:s,contentDOM:i}},mt.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new mt(this.nodesFromSchema(t),this.marksFromSchema(t)))},mt.nodesFromSchema=function(t){var e=vt(t.nodes);return e.text||(e.text=function(t){return t.text}),e},mt.marksFromSchema=function(t){return vt(t.marks)};var yt=Math.pow(2,16);function bt(t){return 65535&t}var wt=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.pos=t,this.deleted=e,this.recover=n},kt=function(t,e){void 0===e&&(e=!1),this.ranges=t,this.inverted=e};kt.prototype.recover=function(t){var e=0,n=bt(t);if(!this.inverted)for(var r=0;rt)break;var c=this.ranges[s+o],p=this.ranges[s+i],l=a+c;if(t<=l){var d=a+r+((c?t==a?-1:t==l?1:e:e)<0?0:p);if(n)return d;var u=t==(e<0?a:l)?null:s/3+(t-a)*yt;return new wt(d,e<0?t!=a:t!=l,u)}r+=p-c}return n?t+r:new wt(t+r)},kt.prototype.touches=function(t,e){for(var n=0,r=bt(e),o=this.inverted?2:1,i=this.inverted?1:2,s=0;st)break;var c=this.ranges[s+o];if(t<=a+c&&s==3*r)return!0;n+=this.ranges[s+i]-c}return!1},kt.prototype.forEach=function(t){for(var e=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r=0;e--){var r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:null)}},xt.prototype.invert=function(){var t=new xt;return t.appendMappingInverted(this),t},xt.prototype.map=function(t,e){if(void 0===e&&(e=1),this.mirror)return this._map(t,e,!0);for(var n=this.from;no&&s0},St.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(St.prototype,Ot);var Nt=Object.create(null),_t=function(){};_t.prototype.apply=function(t){return Ct()},_t.prototype.getMap=function(){return kt.empty},_t.prototype.invert=function(t){return Ct()},_t.prototype.map=function(t){return Ct()},_t.prototype.merge=function(t){return null},_t.prototype.toJSON=function(){return Ct()},_t.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=Nt[e.stepType];if(!n)throw new RangeError("No step type "+e.stepType+" defined");return n.fromJSON(t,e)},_t.jsonID=function(t,e){if(t in Nt)throw new RangeError("Duplicate use of step JSON ID "+t);return Nt[t]=e,e.prototype.jsonID=t,e};var Tt=function(t,e){this.doc=t,this.failed=e};Tt.ok=function(t){return new Tt(t,null)},Tt.fail=function(t){return new Tt(null,t)},Tt.fromReplace=function(t,e,n,r){try{return Tt.ok(t.replace(e,n,r))}catch(o){if(o instanceof d)return Tt.fail(o.message);throw o}};var Vt=function(t){function e(e,n,r,o){t.call(this),this.from=e,this.to=n,this.slice=r,this.structure=!!o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){return this.structure&&Et(t,this.from,this.to)?Tt.fail("Structure replace would overwrite content"):Tt.fromReplace(t,this.from,this.to,this.slice)},e.prototype.getMap=function(){return new kt([this.from,this.to-this.from,this.slice.size])},e.prototype.invert=function(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)},e.prototype.merge=function(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var n=this.slice.size+t.slice.size==0?u.empty:new u(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}var r=this.slice.size+t.slice.size==0?u.empty:new u(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),r,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,u.fromJSON(t,n.slice),!!n.structure)},e}(_t);_t.jsonID("replace",Vt);var At=function(t){function e(e,n,r,o,i,s,a){t.call(this),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=!!a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){if(this.structure&&(Et(t,this.from,this.gapFrom)||Et(t,this.gapTo,this.to)))return Tt.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return Tt.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?Tt.fromReplace(t,this.from,this.to,n):Tt.fail("Content does not fit in gap")},e.prototype.getMap=function(){return new kt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},e.prototype.invert=function(t){var n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deleted&&r.deleted||or.pos?null:new e(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,u.fromJSON(t,n.slice),n.insert,!!n.structure)},e}(_t);function Et(t,e,n){for(var r=t.resolve(e),o=n-e,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function Dt(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Rt(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(ni;a--,c--){var p=o.node(a),l=o.index(a);if(p.type.spec.isolating)return!1;var d=p.content.cutByIndex(l,p.childCount),u=r&&r[c]||p;if(u!=p&&(d=d.replaceChild(0,u.type.create(u.attrs))),!p.canReplace(l+1,p.childCount)||!u.type.validContent(d))return!1}var h=o.indexAfter(i),f=r&&r[0];return o.node(i).canReplaceWith(h,h,f?f.type:o.node(i+1).type)}function Lt(t,e){var n,r,o=t.resolve(e),i=o.index();return n=o.nodeBefore,r=o.nodeAfter,n&&r&&!n.isLeaf&&n.canAppend(r)&&o.parent.canReplace(i,i+1)}function Pt(t,e,n){var r=t.resolve(e);if(!n.content.size)return e;for(var o=n.content,i=0;i=0;a--){var c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,p=r.index(a)+(c>0?1:0),l=r.node(a),d=!1;if(1==s)d=l.canReplace(p,p,o);else{var u=l.contentMatchAt(p).findWrapping(o.firstChild.type);d=u&&l.canReplaceWith(p,p,u[0])}if(d)return 0==c?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function jt(t,e,n){for(var r=[],o=0;oe;h--)f||n.index(h)>0?(f=!0,l=i.from(n.node(h).copy(l)),d++):c--;for(var m=i.empty,v=0,g=o,y=!1;g>e;g--)y||r.after(g+1)=0;r--)n=i.from(e[r].type.create(e[r].attrs,n));var o=t.start,s=t.end;return this.step(new At(o,s,o,s,new u(n,0,0),e.length,!0))},St.prototype.setBlockType=function(t,e,n,r){var o=this;if(void 0===e&&(e=t),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var s=this.steps.length;return this.doc.nodesBetween(t,e,(function(t,e){if(t.isTextblock&&!t.hasMarkup(n,r)&&function(t,e,n){var r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(o.doc,o.mapping.slice(s).map(e),n)){o.clearIncompatible(o.mapping.slice(s).map(e,1),n);var a=o.mapping.slice(s),c=a.map(e,1),p=a.map(e+t.nodeSize,1);return o.step(new At(c,p,c+1,p-1,new u(i.from(n.create(r,null,t.marks)),0,0),1,!0)),!1}})),this},St.prototype.setNodeMarkup=function(t,e,n,r){var o=this.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");e||(e=o.type);var s=e.create(n,null,r||o.marks);if(o.isLeaf)return this.replaceWith(t,t+o.nodeSize,s);if(!e.validContent(o.content))throw new RangeError("Invalid content for node type "+e.name);return this.step(new At(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new u(i.from(s),0,0),1,!0))},St.prototype.split=function(t,e,n){void 0===e&&(e=1);for(var r=this.doc.resolve(t),o=i.empty,s=i.empty,a=r.depth,c=r.depth-e,p=e-1;a>c;a--,p--){o=i.from(r.node(a).copy(o));var l=n&&n[p];s=i.from(l?l.type.create(l.attrs,s):r.node(a).copy(s))}return this.step(new Vt(t,t,new u(o.append(s),e,e),!0))},St.prototype.join=function(t,e){void 0===e&&(e=1);var n=new Vt(t-e,t+e,u.empty,!0);return this.step(n)};var $t=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=t.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new u(jt(n.content,(function(t,n){return t.isAtom&&n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t}),o),n.openStart,n.openEnd);return Tt.fromReplace(t,this.from,this.to,i)},e.prototype.invert=function(){return new Ft(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(_t);_t.jsonID("addMark",$t);var Ft=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=new u(jt(n.content,(function(t){return t.mark(e.mark.removeFromSet(t.marks))})),n.openStart,n.openEnd);return Tt.fromReplace(t,this.from,this.to,r)},e.prototype.invert=function(){return new $t(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(_t);function Ht(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}_t.jsonID("removeMark",Ft),St.prototype.addMark=function(t,e,n){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(t,e,(function(r,c,p){if(r.isInline){var l=r.marks;if(!n.isInSet(l)&&p.type.allowsMarkType(n.type)){for(var d=Math.max(c,t),u=Math.min(c+r.nodeSize,e),h=n.addToSet(l),f=0;f=0;f--)this.step(o[f]);return this},St.prototype.replace=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=u.empty);var r=function(t,e,n,r){if(void 0===n&&(n=e),void 0===r&&(r=u.empty),e==n&&!r.size)return null;var o=t.resolve(e),i=t.resolve(n);return Ht(o,i,r)?new Vt(e,n,r):new qt(o,i,r).fit()}(this.doc,t,e,n);return r&&this.step(r),this},St.prototype.replaceWith=function(t,e,n){return this.replace(t,e,new u(i.from(n),0,0))},St.prototype.delete=function(t,e){return this.replace(t,e,u.empty)},St.prototype.insert=function(t,e){return this.replaceWith(t,t,e)};var qt=function(t,e,n){this.$to=e,this.$from=t,this.unplaced=n,this.frontier=[];for(var r=0;r<=t.depth;r++){var o=t.node(r);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(r))})}this.placed=i.empty;for(var s=t.depth;s>0;s--)this.placed=i.from(t.node(s).copy(this.placed))},Jt={depth:{configurable:!0}};function Wt(t,e,n){return 0==e?t.cutByIndex(n):t.replaceChild(0,t.firstChild.copy(Wt(t.firstChild.content,e-1,n)))}function Ut(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ut(t.lastChild.content,e-1,n)))}function Kt(t,e){for(var n=0;n1&&(r=r.replaceChild(0,Gt(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(i.empty,!0)))),t.copy(r)}function Xt(t,e,n,r,o){var i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;var a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(var r=n;rr){var a=o.contentMatchAt(0),c=a.fillBefore(t).append(t);t=c.append(a.matchFragment(c).fillBefore(i.empty,!0))}return t}function Qt(t,e){for(var n=[],r=Math.min(t.depth,e.depth);r>=0;r--){var o=t.start(r);if(oe.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;o==e.start(r)&&n.push(r)}return n}Jt.depth.get=function(){return this.frontier.length-1},qt.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;for(var i=this.placed,s=r.depth,a=o.depth;s&&a&&1==i.childCount;)i=i.firstChild.content,s--,a--;var c=new u(i,s,a);return e>-1?new At(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new Vt(r.pos,o.pos,c):void 0},qt.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var e=this.unplaced.openStart;e>=0;e--)for(var n=void 0,r=(e?(n=Kt(this.unplaced.content,e-1).firstChild).content:this.unplaced.content).firstChild,o=this.depth;o>=0;o--){var s=this.frontier[o],a=s.type,c=s.match,p=void 0,l=void 0;if(1==t&&(r?c.matchType(r.type)||(l=c.fillBefore(i.from(r),!1)):a.compatibleContent(n.type)))return{sliceDepth:e,frontierDepth:o,parent:n,inject:l};if(2==t&&r&&(p=c.findWrapping(r.type)))return{sliceDepth:e,frontierDepth:o,parent:n,wrap:p};if(n&&c.matchType(n.type))break}},qt.prototype.openMore=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,o=Kt(e,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new u(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)},qt.prototype.dropNode=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,o=Kt(e,n);if(o.childCount<=1&&n>0){var i=e.size-n<=n+o.size;this.unplaced=new u(Wt(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new u(Wt(e,n,1),n,r)},qt.prototype.placeNodes=function(t){for(var e=t.sliceDepth,n=t.frontierDepth,r=t.parent,o=t.inject,s=t.wrap;this.depth>n;)this.closeFrontierNode();if(s)for(var a=0;a1||0==l||b.content.size)&&(m=w,h.push(Gt(b.mark(v.allowedMarks(b.marks)),1==d?l:0,d==p.childCount?y:-1)))}var k=d==p.childCount;k||(y=-1),this.placed=Ut(this.placed,n,i.from(h)),this.frontier[n].match=m,k&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var x=0,M=p;x1&&r==this.$to.end(--n);)++r;return r},qt.prototype.findCloseLevel=function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],r=n.match,o=n.type,i=e=0;a--){var c=this.frontier[a],p=c.match,l=Xt(t,a,c.type,p,!0);if(!l||l.childCount)continue t}return{depth:e,fit:s,move:i?t.doc.resolve(t.after(e+1)):t}}}},qt.prototype.close=function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Ut(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;n++){var r=t.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,o)}return t},qt.prototype.openFrontierNode=function(t,e,n){var r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Ut(this.placed,this.depth,i.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})},qt.prototype.closeFrontierNode=function(){var t=this.frontier.pop().match.fillBefore(i.empty,!0);t.childCount&&(this.placed=Ut(this.placed,this.frontier.length,t))},Object.defineProperties(qt.prototype,Jt),St.prototype.replaceRange=function(t,e,n){if(!n.size)return this.deleteRange(t,e);var r=this.doc.resolve(t),o=this.doc.resolve(e);if(Ht(r,o,n))return this.step(new Vt(t,e,n));var i=Qt(r,this.doc.resolve(e));0==i[i.length-1]&&i.pop();var s=-(r.depth+1);i.unshift(s);for(var a=r.depth,c=r.pos-1;a>0;a--,c--){var p=r.node(a).type.spec;if(p.defining||p.isolating)break;i.indexOf(a)>-1?s=a:r.before(a)==c&&i.splice(1,0,-a)}for(var l=i.indexOf(s),d=[],h=n.openStart,f=n.content,m=0;;m++){var v=f.firstChild;if(d.push(v),m==n.openStart)break;f=v.content}h>0&&d[h-1].type.spec.defining&&r.node(l).type!=d[h-1].type?h-=1:h>=2&&d[h-1].isTextblock&&d[h-2].type.spec.defining&&r.node(l).type!=d[h-2].type&&(h-=2);for(var g=n.openStart;g>=0;g--){var y=(g+h+1)%(n.openStart+1),b=d[y];if(b)for(var w=0;w=0&&(this.replace(t,e,n),!(this.steps.length>O));C--){var N=i[C];N<0||(t=r.before(N),e=o.after(N))}return this},St.prototype.replaceRangeWith=function(t,e,n){if(!n.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var r=function(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,n))return r.after(s+1);if(a0&&(a||n.node(s-1).canReplace(n.index(s-1),r.indexAfter(s-1))))return this.delete(n.before(s),r.after(s))}for(var c=1;c<=n.depth&&c<=r.depth;c++)if(t-n.start(c)==n.depth-c&&e>n.end(c)&&r.end(c)-e!=r.depth-c)return this.delete(n.before(c),e);return this.delete(t,e)};var Zt=Object.create(null),te=function(t,e,n){this.ranges=n||[new ne(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},ee={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};ee.anchor.get=function(){return this.$anchor.pos},ee.head.get=function(){return this.$head.pos},ee.from.get=function(){return this.$from.pos},ee.to.get=function(){return this.$to.pos},ee.$from.get=function(){return this.ranges[0].$from},ee.$to.get=function(){return this.ranges[0].$to},ee.empty.get=function(){for(var t=this.ranges,e=0;e=0;o--){var i=e<0?pe(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):pe(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(i)return i}},te.near=function(t,e){return void 0===e&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new ae(t.node(0))},te.atStart=function(t){return pe(t,t,0,0,1)||new ae(t)},te.atEnd=function(t){return pe(t,t,t.content.size,t.childCount,-1)||new ae(t)},te.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=Zt[e.type];if(!n)throw new RangeError("No selection type "+e.type+" defined");return n.fromJSON(t,e)},te.jsonID=function(t,e){if(t in Zt)throw new RangeError("Duplicate use of selection JSON ID "+t);return Zt[t]=e,e.prototype.jsonID=t,e},te.prototype.getBookmark=function(){return re.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(te.prototype,ee),te.prototype.visible=!0;var ne=function(t,e){this.$from=t,this.$to=e},re=function(t){function e(e,n){void 0===n&&(n=e),t.call(this,e,n)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return t.near(o);var i=n.resolve(r.map(this.anchor));return new e(i.parent.inlineContent?i:o,o)},e.prototype.replace=function(e,n){if(void 0===n&&(n=u.empty),t.prototype.replace.call(this,e,n),n==u.empty){var r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head},e.prototype.getBookmark=function(){return new oe(this.anchor,this.head)},e.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,e,n){void 0===n&&(n=e);var r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))},e.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var s=t.findFrom(r,o,!0)||t.findFrom(r,-o,!0);if(!s)return t.near(r,o);r=s.$head}return n.parent.inlineContent||(0==i||(n=(t.findFrom(n,-o,!0)||t.findFrom(n,o,!0)).$anchor).pos0?0:1);o>0?s=0;s+=o){var a=e.child(s);if(a.isAtom){if(!i&&ie.isSelectable(a))return ie.create(t,n-(o<0?a.nodeSize:0))}else{var c=pe(t,a,n+o,o<0?a.childCount:0,o,i);if(c)return c}n+=a.nodeSize*o}}function le(t,e,n){var r=t.steps.length-1;if(!(r0},e.prototype.setStoredMarks=function(t){return this.storedMarks=t,this.updated|=2,this},e.prototype.ensureMarks=function(t){return l.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this},e.prototype.addStoredMark=function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))},e.prototype.removeStoredMark=function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},e.prototype.addStep=function(e,n){t.prototype.addStep.call(this,e,n),this.updated=-3&this.updated,this.storedMarks=null},e.prototype.setTime=function(t){return this.time=t,this},e.prototype.replaceSelection=function(t){return this.selection.replace(this,t),this},e.prototype.replaceSelectionWith=function(t,e){var n=this.selection;return!1!==e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||l.none))),n.replaceWith(this,t),this},e.prototype.deleteSelection=function(){return this.selection.replace(this),this},e.prototype.insertText=function(t,e,n){void 0===n&&(n=e);var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(!t)return this.deleteRange(e,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(e);o=n==e?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.setSelection(te.near(this.selection.$to)),this},e.prototype.setMeta=function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this},e.prototype.getMeta=function(t){return this.meta["string"==typeof t?t:t.key]},n.isGeneric.get=function(){for(var t in this.meta)return!1;return!0},e.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(e.prototype,n),e}(St);function ue(t,e){return e&&t?t.bind(e):t}var he=function(t,e,n){this.name=t,this.init=ue(e.init,n),this.apply=ue(e.apply,n)},fe=[new he("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new he("selection",{init:function(t,e){return t.selection||te.atStart(e.doc)},apply:function(t){return t.selection}}),new he("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new he("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],me=function(t,e){var n=this;this.schema=t,this.fields=fe.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach((function(t){if(n.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");n.plugins.push(t),n.pluginsByKey[t.key]=t,t.spec.state&&n.fields.push(new he(t.key,t.spec.state,t))}))},ve=function(t){this.config=t},ge={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};ge.schema.get=function(){return this.config.schema},ge.plugins.get=function(){return this.config.plugins},ve.prototype.apply=function(t){return this.applyTransaction(t).state},ve.prototype.filterTransaction=function(t,e){void 0===e&&(e=-1);for(var n=0;n-1&&ye.splice(e,1)},Object.defineProperties(ve.prototype,ge);var ye=[];function be(t,e,n){for(var r in t){var o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=be(o,e,{})),n[r]=o}return n}var we=function(t){this.props={},t.props&&be(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:xe("plugin")};we.prototype.getState=function(t){return t[this.key]};var ke=Object.create(null);function xe(t){return t in ke?t+"$"+ ++ke[t]:(ke[t]=0,t+"$")}var Me=function(t){void 0===t&&(t="key"),this.key=xe(t)};Me.prototype.get=function(t){return t.config.pluginsByKey[this.key]},Me.prototype.getState=function(t){return t[this.key]};var Se={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var Oe=/Edge\/(\d+)/.exec(navigator.userAgent),Ce=/MSIE \d/.test(navigator.userAgent),Ne=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);Se.mac=/Mac/.test(navigator.platform);var _e=Se.ie=!!(Ce||Ne||Oe);Se.ie_version=Ce?document.documentMode||6:Ne?+Ne[1]:Oe?+Oe[1]:null,Se.gecko=!_e&&/gecko\/(\d+)/i.test(navigator.userAgent),Se.gecko_version=Se.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var Te=!_e&&/Chrome\/(\d+)/.exec(navigator.userAgent);Se.chrome=!!Te,Se.chrome_version=Te&&+Te[1],Se.safari=!_e&&/Apple Computer/.test(navigator.vendor),Se.ios=Se.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),Se.android=/Android \d/.test(navigator.userAgent),Se.webkit="webkitFontSmoothing"in document.documentElement.style,Se.webkit_version=Se.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var Ve=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},Ae=function(t){var e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e},Ee=null,De=function(t,e,n){var r=Ee||(Ee=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},Re=function(t,e,n,r){return n&&(Ie(t,e,n,r,-1)||Ie(t,e,n,r,1))},ze=/^(img|br|input|textarea|hr)$/i;function Ie(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Be(t))){var i=t.parentNode;if(1!=i.nodeType||Le(t)||ze.test(t.nodeName)||"false"==t.contentEditable)return!1;e=Ve(t)+(o<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?Be(t):0}}}function Be(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Le(t){for(var e,n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var Pe=function(t){var e=t.isCollapsed;return e&&Se.chrome&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function je(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function $e(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Fe(t,e){return"number"==typeof t?t:t[e]}function He(t){var e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function qe(t,e,n){for(var r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument,s=n||t.dom;s;s=Ae(s))if(1==s.nodeType){var a=s==i.body||1!=s.nodeType,c=a?$e(i):He(s),p=0,l=0;if(e.topc.bottom-Fe(r,"bottom")&&(l=e.bottom-c.bottom+Fe(o,"bottom")),e.leftc.right-Fe(r,"right")&&(p=e.right-c.right+Fe(o,"right")),p||l)if(a)i.defaultView.scrollBy(p,l);else{var d=s.scrollLeft,u=s.scrollTop;l&&(s.scrollTop+=l),p&&(s.scrollLeft+=p);var h=s.scrollLeft-d,f=s.scrollTop-u;e={left:e.left-h,top:e.top-f,right:e.right-h,bottom:e.bottom-f}}if(a)break}}function Je(t){for(var e=[],n=t.ownerDocument;t&&(e.push({dom:t,top:t.scrollTop,left:t.scrollLeft}),t!=n);t=Ae(t));return e}function We(t,e){for(var n=0;n=a){s=Math.max(u.bottom,s),a=Math.min(u.top,a);var h=u.left>e.left?u.left-e.left:u.right=(u.left+u.right)/2?1:0));continue}}!n&&(e.left>=u.right&&e.top>=u.top||e.left>=u.left&&e.top>=u.bottom)&&(i=p+1)}}return n&&3==n.nodeType?function(t,e){for(var n=t.nodeValue.length,r=document.createRange(),o=0;o=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:t,offset:i}:Ke(n,r)}function Ge(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Xe(t,e,n){var r=t.childNodes.length;if(r&&n.tope.top&&i++}o==t.dom&&i==o.childNodes.length-1&&1==o.lastChild.nodeType&&e.top>o.lastChild.getBoundingClientRect().bottom?p=t.state.doc.content.size:0!=i&&1==o.nodeType&&"BR"==o.childNodes[i-1].nodeName||(p=function(t,e,n,r){for(var o=-1,i=e;i!=t.dom;){var s=t.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>r.left||a.top>r.top)o=s.posBefore;else{if(!(a.right-1?o:t.docView.posFromDOM(e,n)}(t,o,i,e))}null==p&&(p=function(t,e,n){var r=Ke(e,n),o=r.node,i=r.offset,s=-1;if(1==o.nodeType&&!o.firstChild){var a=o.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(o,i,s)}(t,l,e));var m=t.docView.nearestDesc(l,!0);return{pos:p,inside:m?m.posAtStart-m.border:-1}}function Qe(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}var Ze=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function tn(t,e,n){var r=t.docView.domFromPos(e,n<0?-1:1),o=r.node,i=r.offset,s=Se.webkit||Se.gecko;if(3==o.nodeType){if(!s||!Ze.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){var a=i,c=i,p=n<0?1:-1;return n<0&&!i?(c++,p=-1):n>=0&&i==o.nodeValue.length?(a--,p=1):n<0?a--:c++,en(Qe(De(o,a,c),p),p<0)}var l=Qe(De(o,i,i),n);if(Se.gecko&&i&&/\s/.test(o.nodeValue[i-1])&&i=0)}if(i&&(n<0||i==Be(o))){var m=o.childNodes[i-1],v=3==m.nodeType?De(m,Be(m)-(s?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(v)return en(Qe(v,1),!1)}if(i=0)}function en(t,e){if(0==t.width)return t;var n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function nn(t,e){if(0==t.height)return t;var n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function rn(t,e,n){var r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}var on=/[\u0590-\u08ac]/;var sn=null,an=null,cn=!1;function pn(t,e,n){return sn==e&&an==n?cn:(sn=e,an=n,cn="up"==n||"down"==n?function(t,e,n){var r=e.selection,o="up"==n?r.$from:r.$to;return rn(t,e,(function(){for(var e=t.docView.domFromPos(o.pos,"up"==n?-1:1).node;;){var r=t.docView.nearestDesc(e,!0);if(!r)break;if(r.node.isBlock){e=r.dom;break}e=r.dom.parentNode}for(var i=tn(t,o.pos,1),s=e.firstChild;s;s=s.nextSibling){var a=void 0;if(1==s.nodeType)a=s.getClientRects();else{if(3!=s.nodeType)continue;a=De(s,0,s.nodeValue.length).getClientRects()}for(var c=0;cp.top&&("up"==n?p.bottomi.bottom-1))return!1}}return!0}))}(t,e,n):function(t,e,n){var r=e.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=getSelection();return on.test(r.parent.textContent)&&a.modify?rn(t,e,(function(){var e=a.getRangeAt(0),o=a.focusNode,i=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");var c=!(r.depth?t.docView.domAfterPos(r.before()):t.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(e),null!=s&&(a.caretBidiLevel=s),c})):"left"==n||"backward"==n?i:s}(t,e,n))}var ln=function(t,e,n,r){this.parent=t,this.children=e,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},dn={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}};ln.prototype.matchesWidget=function(){return!1},ln.prototype.matchesMark=function(){return!1},ln.prototype.matchesNode=function(){return!1},ln.prototype.matchesHack=function(t){return!1},dn.beforePosition.get=function(){return!1},ln.prototype.parseRule=function(){return null},ln.prototype.stopEvent=function(){return!1},dn.size.get=function(){for(var t=0,e=0;eVe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))a=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var c=t;;c=c.parentNode){if(c==this.dom){a=!1;break}if(c.parentNode.firstChild!=c)break}if(null==a&&e==t.childNodes.length)for(var p=t;;p=p.parentNode){if(p==this.dom){a=!0;break}if(p.parentNode.lastChild!=p)break}}return(null==a?n>0:a)?this.posAtEnd:this.posAtStart},ln.prototype.nearestDesc=function(t,e){for(var n=!0,r=t;r;r=r.parentNode){var o=this.getDesc(r);if(o&&(!e||o.node)){if(!n||!o.nodeDOM||(1==o.nodeDOM.nodeType?o.nodeDOM.contains(1==t.nodeType?t:t.parentNode):o.nodeDOM==t))return o;n=!1}}},ln.prototype.getDesc=function(t){for(var e=t.pmViewDesc,n=e;n;n=n.parent)if(n==this)return e},ln.prototype.posFromDOM=function(t,e,n){for(var r=t;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(t,e,n)}return-1},ln.prototype.descAt=function(t){for(var e=0,n=0;e=t:s>t)&&(s>t||r+1>=this.children.length||!this.children[r+1].beforePosition))return i.domFromPos(t-n-i.border,e);n=s}},ln.prototype.parseRange=function(t,e,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,s=0;;s++){var a=this.children[s],c=i+a.size;if(-1==r&&t<=c){var p=i+a.border;if(t>=p&&e<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(t,e,p);t=i;for(var l=s;l>0;l--){var d=this.children[l-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){r=Ve(d.dom)+1;break}t-=d.size}-1==r&&(r=0)}if(r>-1&&(c>e||s==this.children.length-1)){e=c;for(var u=s+1;ua&&ie){var x=l;l=d,d=x}var M=document.createRange();M.setEnd(d.node,d.offset),M.setStart(l.node,l.offset),u.removeAllRanges(),u.addRange(M)}}},ln.prototype.ignoreMutation=function(t){return!this.contentDOM&&"selection"!=t.type},dn.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},ln.prototype.markDirty=function(t,e){for(var n=0,r=0;r=n:tn){var s=n+o.border,a=i-o.border;if(t>=s&&e<=a)return this.dirty=t==n||e==i?2:1,void(t!=s||e!=a||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-s,e-s):o.dirty=3);o.dirty=3}n=i}this.dirty=2},ln.prototype.markParentsDirty=function(){for(var t=1,e=this.parent;e;e=e.parent,t++){var n=1==t?2:1;e.dirty0&&(i=En(i,0,t,r));for(var a=0;ai;)p.push(o[c++]);var y=i+m.nodeSize;if(m.isText){var b=y;c=0&&!a&&s.syncToMarks(i==n.node.childCount?l.none:n.node.child(i).marks,r,t),s.placeWidget(e,t,o)}),(function(e,n,i,a){s.syncToMarks(e.marks,r,t),s.findNodeMatch(e,n,i,a)||s.updateNextNode(e,n,i,t,a)||s.addNode(e,n,i,t,o),o+=e.nodeSize})),s.syncToMarks(un,r,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||2==this.dirty)&&(i&&this.protectLocalComposition(t,i),kn(this.contentDOM,this.children,t),Se.ios&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))},e.prototype.localCompositionNode=function(t,e){var n=t.state.selection,r=n.from,o=n.to;if(!(!(t.state.selection instanceof re)||re+this.node.content.size)){var i=t.root.getSelection(),s=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];e=Be(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e=n){var l=c.lastIndexOf(e,r-a);if(l>=0&&l+e.length+a>=n)return a+l}}}return-1}(this.node.content,a,r-e,o-e);return c<0?null:{node:s,pos:c,text:a}}}},e.prototype.protectLocalComposition=function(t,e){var n=e.node,r=e.pos,o=e.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=null)}var s=new fn(this,i,n,o);t.compositionNodes.push(s),this.children=En(this.children,r,r+o.length,t,s)}},e.prototype.update=function(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)},e.prototype.updateInner=function(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},e.prototype.updateOuterDeco=function(t){if(!_n(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=On(this.dom,this.nodeDOM,Sn(this.outerDeco,this.node,e),Sn(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=t}},e.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},e.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")},n.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(e.prototype,n),e}(ln);function gn(t,e,n,r,o){return Nn(r,e,t),new vn(null,t,e,n,r,r,r,o,0)}var yn=function(t){function e(e,n,r,o,i,s,a){t.call(this,e,n,r,o,i,null,s,a)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.parseRule=function(){for(var t=this.nodeDOM.parentNode;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}},e.prototype.update=function(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)},e.prototype.inParent=function(){for(var t=this.parent.contentDOM,e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1},e.prototype.domFromPos=function(t){return{node:this.nodeDOM,offset:t}},e.prototype.localPosFromDOM=function(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):t.prototype.localPosFromDOM.call(this,e,n,r)},e.prototype.ignoreMutation=function(t){return"characterData"!=t.type&&"selection"!=t.type},e.prototype.slice=function(t,n,r){var o=this.node.cut(t,n),i=document.createTextNode(o.text);return new e(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)},e.prototype.markDirty=function(e,n){t.prototype.markDirty.call(this,e,n),this.dom==this.nodeDOM||0!=e&&n!=this.nodeDOM.nodeValue.length||(this.dirty=3)},n.domAtom.get=function(){return!1},Object.defineProperties(e.prototype,n),e}(vn),bn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.matchesHack=function(t){return 0==this.dirty&&this.dom.nodeName==t},n.domAtom.get=function(){return!0},Object.defineProperties(e.prototype,n),e}(ln),wn=function(t){function e(e,n,r,o,i,s,a,c,p,l){t.call(this,e,n,r,o,i,s,a,p,l),this.spec=c}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(e,n,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}return!(!this.contentDOM&&!e.isLeaf)&&t.prototype.update.call(this,e,n,r,o)},e.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():t.prototype.selectNode.call(this)},e.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():t.prototype.deselectNode.call(this)},e.prototype.setSelection=function(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):t.prototype.setSelection.call(this,e,n,r,o)},e.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),t.prototype.destroy.call(this)},e.prototype.stopEvent=function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)},e.prototype.ignoreMutation=function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):t.prototype.ignoreMutation.call(this,e)},e}(vn);function kn(t,e,n){for(var r=t.firstChild,o=!1,i=0;i0&&r>0;r--){var i=e[r-1],s=i.node;if(s){if(s!=t.child(n-1))break;--n,o.set(i,n)}}return{index:n,matched:o}}(t.node.content,t.children)};function An(t,e){return t.type.side-e.type.side}function En(t,e,n,r,o){for(var i=[],s=0,a=0;s=n||l<=e?i.push(c):(pn&&i.push(c.slice(n-p,c.size,r)))}return i}function Dn(t,e){var n=t.root.getSelection(),r=t.state.doc;if(!n.focusNode)return null;var o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset);if(s<0)return null;var a,c,p=r.resolve(s);if(Pe(n)){for(a=p;o&&!o.node;)o=o.parent;if(o&&o.node.isAtom&&ie.isSelectable(o.node)&&o.parent&&(!o.node.isInline||!function(t,e,n){for(var r=0==e,o=e==Be(t);r||o;){if(t==n)return!0;var i=Ve(t);if(!(t=t.parentNode))return!1;r=r&&0==i,o=o&&i==Be(t)}}(n.focusNode,n.focusOffset,o.dom))){var l=o.posBefore;c=new ie(s==l?p:r.resolve(l))}}else{var d=t.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(d<0)return null;a=r.resolve(d)}c||(c=Fn(t,a,p,"pointer"==e||t.state.selection.head>1,i=Math.min(o,t.length);r-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{var c=mn.create(this.top,t[o],e,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}},Vn.prototype.findNodeMatch=function(t,e,n,r){var o=this.top.children,i=-1;if(r>=this.preMatch.index){for(var s=this.index;s0?r.max(o):r.min(o),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&te.findFrom(s,e)}function Jn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Wn(t,e,n){var r=t.state.selection;if(!(r instanceof re)){if(r instanceof ie&&r.node.isInline)return Jn(t,new re(e>0?r.$to:r.$from));var o=qn(t.state,e);return!!o&&Jn(t,o)}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){var i=qn(t.state,e);return!!(i&&i instanceof ie)&&Jn(t,i)}if(!(Se.mac&&n.indexOf("m")>-1)){var s,a=r.$head,c=a.textOffset?null:e<0?a.nodeBefore:a.nodeAfter;if(!c||c.isText)return!1;var p=e<0?a.pos-c.nodeSize:a.pos;return!!(c.isAtom||(s=t.docView.descAt(p))&&!s.contentDOM)&&(ie.isSelectable(c)?Jn(t,new ie(e<0?t.state.doc.resolve(a.pos-c.nodeSize):a)):!!Se.webkit&&Jn(t,new re(t.state.doc.resolve(e<0?p:p+c.nodeSize))))}}function Un(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Kn(t){var e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Gn(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){var o,i,s=!1;for(Se.gecko&&1==n.nodeType&&r0){if(1!=n.nodeType)break;var a=n.childNodes[r-1];if(Kn(a))o=n,i=--r;else{if(3!=a.nodeType)break;r=(n=a).nodeValue.length}}else{if(Yn(n))break;for(var c=n.previousSibling;c&&Kn(c);)o=n.parentNode,i=Ve(c),c=c.previousSibling;if(c)r=Un(n=c);else{if((n=n.parentNode)==t.dom)break;r=0}}s?Qn(t,e,n,r):o&&Qn(t,e,o,i)}}function Xn(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){for(var o,i,s=Un(n);;)if(r-1)return!1;if(Se.mac&&n.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){var s=qn(t.state,e);if(s&&s instanceof ie)return Jn(t,s)}if(!o.parent.inlineContent){var a=e<0?o:i,c=r instanceof ae?te.near(a,e):te.findFrom(a,e);return!!c&&Jn(t,c)}return!1}function tr(t,e){if(!(t.state.selection instanceof re))return!0;var n=t.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var s=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){var a=t.state.tr;return e<0?a.delete(r.pos-s.nodeSize,r.pos):a.delete(r.pos,r.pos+s.nodeSize),t.dispatch(a),!0}return!1}function er(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function nr(t,e){var n=e.keyCode,r=function(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||Se.mac&&72==n&&"c"==r?tr(t,-1)||Gn(t):46==n||Se.mac&&68==n&&"c"==r?tr(t,1)||Xn(t):13==n||27==n||(37==n?Wn(t,-1,r)||Gn(t):39==n?Wn(t,1,r)||Xn(t):38==n?Zn(t,-1,r)||Gn(t):40==n?function(t){if(Se.safari&&!(t.state.selection.$head.parentOffset>0)){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;er(t,o,!0),setTimeout((function(){return er(t,o,!1)}),20)}}}(t)||Zn(t,1,r)||Xn(t):r==(Se.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function rr(t){var e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(Se.safari&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(t.parentNode.lastChild==t||Se.safari&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0}}function or(t,e,n,r,o){if(e<0){var s=t.lastSelectionTime>Date.now()-50?t.lastSelectionOrigin:null,a=Dn(t,s);if(a&&!t.state.selection.eq(a)){var c=t.state.tr.setSelection(a);"pointer"==s?c.setMeta("pointer",!0):"key"==s&&c.scrollIntoView(),t.dispatch(c)}}else{var p=t.state.doc.resolve(e),l=p.sharedDepth(n);e=p.before(l+1),n=t.state.doc.resolve(n).after(l+1);var d=t.state.selection,u=function(t,e,n){var r=t.docView.parseRange(e,n),o=r.node,i=r.fromOffset,s=r.toOffset,a=r.from,c=r.to,p=t.root.getSelection(),l=null,d=p.anchorNode;if(d&&t.dom.contains(1==d.nodeType?d:d.parentNode)&&(l=[{node:d,offset:p.anchorOffset}],Pe(p)||l.push({node:p.focusNode,offset:p.focusOffset})),Se.chrome&&8===t.lastKeyCode)for(var u=s;u>i;u--){var h=o.childNodes[u-1],f=h.pmViewDesc;if("BR"==h.nodeName&&!f){s=u;break}if(!f||f.size)break}var m=t.state.doc,v=t.someProp("domParser")||ot.fromSchema(t.state.schema),g=m.resolve(a),y=null,b=v.parse(o,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:s,preserveWhitespace:!g.parent.type.spec.code||"full",editableContent:!0,findPositions:l,ruleFromNode:rr,context:g});if(l&&null!=l[0].pos){var w=l[0].pos,k=l[1]&&l[1].pos;null==k&&(k=w),y={anchor:w+a,head:k+a}}return{doc:b,sel:y,from:a,to:c}}(t,e,n);if(Se.chrome&&t.cursorWrapper&&u.sel&&u.sel.anchor==t.cursorWrapper.deco.from){var h=t.cursorWrapper.deco.type.toDOM.nextSibling,f=h&&h.nodeValue?h.nodeValue.length:1;u.sel={anchor:u.sel.anchor+f,head:u.sel.anchor+f}}var m,v,g=t.state.doc,y=g.slice(u.from,u.to);8===t.lastKeyCode&&Date.now()-100=a?i-r:0)+(c-a),a=i}else if(c=c?i-r:0)+(a-c),c=i}return{start:i,endA:a,endB:c}}(y.content,u.doc.content,u.from,m,v);if(!b){if(!(r&&d instanceof re&&!d.empty&&d.$head.sameParent(d.$anchor))||t.composing||u.sel&&u.sel.anchor!=u.sel.head){if((Se.ios&&t.lastIOSEnter>Date.now()-225||Se.android)&&o.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName}))&&t.someProp("handleKeyDown",(function(e){return e(t,je(13,"Enter"))})))return void(t.lastIOSEnter=0);if(u.sel){var w=ir(t,t.state.doc,u.sel);w&&!w.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(w))}return}b={start:d.from,endA:d.to,endB:d.to}}t.domChangeCount++,t.state.selection.fromt.state.selection.from&&b.start<=t.state.selection.from+2?b.start=t.state.selection.from:b.endA=t.state.selection.to-2&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),Se.ie&&Se.ie_version<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>u.from&&"  "==u.doc.textBetween(b.start-u.from-1,b.start-u.from+1)&&(b.start--,b.endA--,b.endB--);var k,x=u.doc.resolveNoCache(b.start-u.from),M=u.doc.resolveNoCache(b.endB-u.from),S=x.sameParent(M)&&x.parent.inlineContent;if((Se.ios&&t.lastIOSEnter>Date.now()-225&&(!S||o.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName})))||!S&&x.posb.start&&function(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||sr(r,!0,!1)n||sr(s,!0,!1)e.content.size?null:Fn(t,e.resolve(n.anchor),e.resolve(n.head))}function sr(t,e,n){for(var r=t.depth,o=e?t.end():t.pos;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n)for(var i=t.node(r).maybeChild(t.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function ar(t,e){for(var n=[],r=e.content,o=e.openStart,i=e.openEnd;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;var s=r.firstChild;n.push(s.type.name,s.attrs!=s.type.defaultAttrs?s.attrs:null),r=s.content}var a=t.someProp("clipboardSerializer")||mt.fromSchema(t.state.schema),c=mr(),p=c.createElement("div");p.appendChild(a.serializeFragment(r,{document:c}));for(var l,d=p.firstChild;d&&1==d.nodeType&&(l=hr[d.nodeName.toLowerCase()]);){for(var u=l.length-1;u>=0;u--){for(var h=c.createElement(l[u]);p.firstChild;)h.appendChild(p.firstChild);p.appendChild(h)}d=p.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",o+" "+i+" "+JSON.stringify(n)),{dom:p,text:t.someProp("clipboardTextSerializer",(function(t){return t(e)}))||e.content.textBetween(0,e.content.size,"\n\n")}}function cr(t,e,n,r,o){var s,a,c=o.parent.type.spec.code;if(!n&&!e)return null;var p=e&&(r||c||!n);if(p){if(t.someProp("transformPastedText",(function(t){e=t(e,c||r)})),c)return new u(i.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0);var l=t.someProp("clipboardTextParser",(function(t){return t(e,o,r)}));l?a=l:(s=document.createElement("div"),e.trim().split(/(?:\r\n?|\n)+/).forEach((function(t){s.appendChild(document.createElement("p")).textContent=t})))}else t.someProp("transformPastedHTML",(function(t){n=t(n)})),s=function(t){var e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,r=mr().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);(n=o&&hr[o[1].toLowerCase()])&&(t=n.map((function(t){return"<"+t+">"})).join("")+t+n.map((function(t){return""})).reverse().join(""));if(r.innerHTML=t,n)for(var i=0;i=0;c-=2){var p=r.nodes[n[c]];if(!p||p.hasRequiredAttrs())break;o=i.from(p.create(n[c+1],o)),s++,a++}return new u(o,s,a)}(function(t,e,n){e=0;r--){var o=n(r);if(o)return o.v}return t}(a.content,o),!1),t.someProp("transformPasted",(function(t){a=t(a)})),a}function pr(t,e,n){void 0===n&&(n=0);for(var r=e.length-1;r>=n;r--)t=e[r].create(null,i.from(t));return t}function lr(t,e,n,r,o){if(o=n&&(c=e<0?a.contentMatchAt(0).fillBefore(c,t.childCount>1||s<=o).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(i.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(c))}var hr={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},fr=null;function mr(){return fr||(fr=document.implementation.createHTMLDocument("title"))}var vr={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},gr=Se.ie&&Se.ie_version<=11,yr=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};yr.prototype.set=function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset},yr.prototype.eq=function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset};var br=function(t,e){var n=this;this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver((function(t){for(var e=0;et.target.nodeValue.length}))?n.flushSoon():n.flush()})),this.currentSelection=new yr,gr&&(this.onCharData=function(t){n.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};br.prototype.flushSoon=function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){t.flushingSoon=-1,t.flush()}),20))},br.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},br.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,vr),gr&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},br.prototype.stop=function(){var t=this;if(this.observer){var e=this.observer.takeRecords();if(e.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 e=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&Hn(this.view)&&!this.ignoreSelectionChange(e),r=-1,o=-1,i=!1,s=[];if(this.view.editable)for(var a=0;a1){var p=s.filter((function(t){return"BR"==t.nodeName}));if(2==p.length){var l=p[0],d=p[1];l.parentNode&&l.parentNode.parentNode==d.parentNode?d.remove():l.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(t){if(wr)return;wr=!0,"normal"==getComputedStyle(t.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(r,o,i,s),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(e)||zn(this.view),this.currentSelection.set(e))}},br.prototype.registerMutation=function(t,e){if(e.indexOf(t.target)>-1)return null;var n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(var r=0;ri.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function _r(t,e,n){t.focused||t.focus();var r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function Tr(t,e,n,r,o){return Nr(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(function(n){return n(t,e,r)}))||(o?function(t,e){if(-1==e)return!1;var n,r,o=t.state.selection;o instanceof ie&&(n=o.node);for(var i=t.state.doc.resolve(e),s=i.depth+1;s>0;s--){var a=s>i.depth?i.nodeAfter:i.node(s);if(ie.isSelectable(a)){r=n&&o.$from.depth>0&&s>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(s);break}}return null!=r&&(_r(t,ie.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&ie.isSelectable(r))&&(_r(t,new ie(n),"pointer"),!0)}(t,n))}function Vr(t,e,n,r){return Nr(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(function(n){return n(t,e,r)}))}function Ar(t,e,n,r){return Nr(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(function(n){return n(t,e,r)}))||function(t,e,n){if(0!=n.button)return!1;var r=t.state.doc;if(-1==e)return!!r.inlineContent&&(_r(t,re.create(r,0,r.content.size),"pointer"),!0);for(var o=r.resolve(e),i=o.depth+1;i>0;i--){var s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)_r(t,re.create(r,a+1,a+1+s.content.size),"pointer");else{if(!ie.isSelectable(s))continue;_r(t,ie.create(r,a),"pointer")}return!0}}(t,n,r)}function Er(t){return Pr(t)}xr.keydown=function(t,e){if(t.shiftKey=16==e.keyCode||e.shiftKey,!zr(t,e))if(229!=e.keyCode&&t.domObserver.forceFlush(),t.lastKeyCode=e.keyCode,t.lastKeyCodeTime=Date.now(),!Se.ios||13!=e.keyCode||e.ctrlKey||e.altKey||e.metaKey)t.someProp("handleKeyDown",(function(n){return n(t,e)}))||nr(t,e)?e.preventDefault():Mr(t,"key");else{var n=Date.now();t.lastIOSEnter=n,t.lastIOSEnterFallbackTimeout=setTimeout((function(){t.lastIOSEnter==n&&(t.someProp("handleKeyDown",(function(e){return e(t,je(13,"Enter"))})),t.lastIOSEnter=0)}),200)}},xr.keyup=function(t,e){16==e.keyCode&&(t.shiftKey=!1)},xr.keypress=function(t,e){if(!(zr(t,e)||!e.charCode||e.ctrlKey&&!e.altKey||Se.mac&&e.metaKey))if(t.someProp("handleKeyPress",(function(n){return n(t,e)})))e.preventDefault();else{var n=t.state.selection;if(!(n instanceof re&&n.$from.sameParent(n.$to))){var r=String.fromCharCode(e.charCode);t.someProp("handleTextInput",(function(e){return e(t,n.$from.pos,n.$to.pos,r)}))||t.dispatch(t.state.tr.insertText(r).scrollIntoView()),e.preventDefault()}}};var Dr=Se.mac?"metaKey":"ctrlKey";kr.mousedown=function(t,e){t.shiftKey=e.shiftKey;var n=Er(t),r=Date.now(),o="singleClick";r-t.lastClick.time<500&&function(t,e){var n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(e,t.lastClick)&&!e[Dr]&&("singleClick"==t.lastClick.type?o="doubleClick":"doubleClick"==t.lastClick.type&&(o="tripleClick")),t.lastClick={time:r,x:e.clientX,y:e.clientY,type:o};var i=t.posAtCoords(Cr(e));i&&("singleClick"==o?(t.mouseDown&&t.mouseDown.done(),t.mouseDown=new Rr(t,i,e,n)):("doubleClick"==o?Vr:Ar)(t,i.pos,i.inside,e)?e.preventDefault():Mr(t,"pointer"))};var Rr=function(t,e,n,r){var o,i,s=this;if(this.view=t,this.startDoc=t.state.doc,this.pos=e,this.event=n,this.flushed=r,this.selectNode=n[Dr],this.allowDefault=n.shiftKey||0!=n.button,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{var a=t.state.doc.resolve(e.pos);o=a.parent,i=a.depth?a.before():0}this.mightDrag=null;var c=r?null:n.target,p=c?t.docView.nearestDesc(c,!0):null;this.target=p?p.dom:null;var l=t.state.selection;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof ie&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&Se.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(){s.view.mouseDown==s&&s.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)),Mr(t,"pointer")};function zr(t,e){return!!t.composing||!!(Se.safari&&Math.abs(e.timeStamp-t.compositionEndedAt)<500)&&(t.compositionEndedAt=-2e8,!0)}Rr.prototype.done=function(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.view.mouseDown=null},Rr.prototype.up=function(t){if(this.done(),this.view.dom.contains(3==t.target.nodeType?t.target.parentNode:t.target)){var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Cr(t))),this.allowDefault||!e?Mr(this.view,"pointer"):Tr(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():this.flushed||Se.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||Se.chrome&&!(this.view.state.selection instanceof re)&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2?(_r(this.view,te.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):Mr(this.view,"pointer")}},Rr.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),Mr(this.view,"pointer"),0==t.buttons&&this.done()},kr.touchdown=function(t){Er(t),Mr(t,"pointer")},kr.contextmenu=function(t){return Er(t)};var Ir=Se.android?5e3:-1;function Br(t,e){clearTimeout(t.composingTimeout),e>-1&&(t.composingTimeout=setTimeout((function(){return Pr(t)}),e))}function Lr(t){for(t.composing=!1;t.compositionNodes.length>0;)t.compositionNodes.pop().markParentsDirty()}function Pr(t,e){if(t.domObserver.forceFlush(),Lr(t),e||t.docView.dirty){var n=Dn(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}xr.compositionstart=xr.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var e=t.state,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(t){return!1===t.type.spec.inclusive}))))t.markCursor=t.state.storedMarks||n.marks(),Pr(t,!0),t.markCursor=null;else if(Pr(t),Se.gecko&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=t.root.getSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(3==s.nodeType){r.collapse(s,s.nodeValue.length);break}o=s,i=-1}t.composing=!0}Br(t,Ir)},xr.compositionend=function(t,e){t.composing&&(t.composing=!1,t.compositionEndedAt=e.timeStamp,Br(t,20))};var jr=Se.ie&&Se.ie_version<15||Se.ios&&Se.webkit_version<604;function $r(t,e,n,r){var o=cr(t,e,n,t.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(function(e){return e(t,r,o||u.empty)})))return!0;if(!o)return!1;var i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),s=i?t.state.tr.replaceSelectionWith(i,t.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}kr.copy=xr.cut=function(t,e){var n=t.state.selection,r="cut"==e.type;if(!n.empty){var o=jr?null:e.clipboardData,i=ar(t,n.content()),s=i.dom,a=i.text;o?(e.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",a)):function(t,e){if(t.dom.parentNode){var n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}}(t,s),r&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},xr.paste=function(t,e){var n=jr?null:e.clipboardData;n&&$r(t,n.getData("text/plain"),n.getData("text/html"),e)?e.preventDefault():function(t,e){if(t.dom.parentNode){var n=t.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?$r(t,r.value,null,e):$r(t,r.textContent,r.innerHTML,e)}),50)}}(t,e)};var Fr=function(t,e){this.slice=t,this.move=e},Hr=Se.mac?"altKey":"ctrlKey";for(var qr in kr.dragstart=function(t,e){var n=t.mouseDown;if(n&&n.done(),e.dataTransfer){var r=t.state.selection,o=r.empty?null:t.posAtCoords(Cr(e));if(o&&o.pos>=r.from&&o.pos<=(r instanceof ie?r.to-1:r.to));else if(n&&n.mightDrag)t.dispatch(t.state.tr.setSelection(ie.create(t.state.doc,n.mightDrag.pos)));else if(e.target&&1==e.target.nodeType){var i=t.docView.nearestDesc(e.target,!0);if(!i||!i.node.type.spec.draggable||i==t.docView)return;t.dispatch(t.state.tr.setSelection(ie.create(t.state.doc,i.posBefore)))}var s=t.state.selection.content(),a=ar(t,s),c=a.dom,p=a.text;e.dataTransfer.clearData(),e.dataTransfer.setData(jr?"Text":"text/html",c.innerHTML),e.dataTransfer.effectAllowed="copyMove",jr||e.dataTransfer.setData("text/plain",p),t.dragging=new Fr(s,!e[Hr])}},kr.dragend=function(t){var e=t.dragging;window.setTimeout((function(){t.dragging==e&&(t.dragging=null)}),50)},xr.dragover=xr.dragenter=function(t,e){return e.preventDefault()},xr.drop=function(t,e){var n=t.dragging;if(t.dragging=null,e.dataTransfer){var r=t.posAtCoords(Cr(e));if(r){var o=t.state.doc.resolve(r.pos);if(o){var i=n&&n.slice;i?t.someProp("transformPasted",(function(t){i=t(i)})):i=cr(t,e.dataTransfer.getData(jr?"Text":"text/plain"),jr?null:e.dataTransfer.getData("text/html"),!1,o);var s=n&&!e[Hr];if(t.someProp("handleDrop",(function(n){return n(t,e,i||u.empty,s)})))e.preventDefault();else if(i){e.preventDefault();var a=i?Pt(t.state.doc,o.pos,i):o.pos;null==a&&(a=o.pos);var c=t.state.tr;s&&c.deleteSelection();var p=c.mapping.map(a),l=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,d=c.doc;if(l?c.replaceRangeWith(p,p,i.content.firstChild):c.replaceRange(p,p,i),!c.doc.eq(d)){var h=c.doc.resolve(p);if(l&&ie.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new ie(h));else{var f=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((function(t,e,n,r){return f=r})),c.setSelection(Fn(t,h,c.doc.resolve(f)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))}}}}}},kr.focus=function(t){t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.root.getSelection())&&zn(t)}),20))},kr.blur=function(t){t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),t.domObserver.currentSelection.set({}),t.focused=!1)},kr.beforeinput=function(t,e){if(Se.chrome&&Se.android&&"deleteContentBackward"==e.inputType){var n=t.domChangeCount;setTimeout((function(){if(t.domChangeCount==n&&(t.dom.blur(),t.focus(),!t.someProp("handleKeyDown",(function(e){return e(t,je(8,"Backspace"))})))){var e=t.state.selection.$cursor;e&&e.pos>0&&t.dispatch(t.state.tr.delete(e.pos-1,e.pos).scrollIntoView())}}),50)}},xr)kr[qr]=xr[qr];function Jr(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var r in e)if(!(r in t))return!1;return!0}var Wr=function(t,e){this.spec=e||Qr,this.side=this.spec.side||0,this.toDOM=t};Wr.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new Gr(i-n,i-n,this)},Wr.prototype.valid=function(){return!0},Wr.prototype.eq=function(t){return this==t||t instanceof Wr&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Jr(this.spec,t.spec))};var Ur=function(t,e){this.spec=e||Qr,this.attrs=t};Ur.prototype.map=function(t,e,n,r){var o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Gr(o,i,this)},Ur.prototype.valid=function(t,e){return e.from=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;at){var c=this.children[a]+1;this.children[a+2].findInner(t-c,e-c,n,r+c,o)}},Zr.prototype.map=function(t,e,n){return this==to||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Qr)},Zr.prototype.mapInner=function(t,e,n,r,o){for(var i,s=0;sc+i||(e>=a[s]+i?a[s+1]=-1:n>=o&&(p=r-n-(e-t))&&(a[s]+=p,a[s+1]+=p))}},p=0;p=r.content.size){l=!0;continue}var f=n.map(t[d+1]+i,-1)-o,m=r.content.findIndex(h),v=m.index,g=m.offset,y=r.maybeChild(v);if(y&&g==h&&g+y.nodeSize==f){var b=a[d+2].mapInner(n,y,u+1,t[d]+i+1,s);b!=to?(a[d]=h,a[d+1]=f,a[d+2]=b):(a[d+1]=-2,l=!0)}else l=!0}if(l){var w=io(function(t,e,n,r,o,i,s){function a(t,e){for(var i=0;is&&p.to=t){this.children[o]==t&&(n=this.children[o+2]);break}for(var i=t+1,s=i+e.content.size,a=0;ai&&c.type instanceof Ur){var p=Math.max(i,c.from)-i,l=Math.min(s,c.to)-i;pn&&s.to0;)e++;t.splice(e,0,n)}function po(t){var e=[];return t.someProp("decorations",(function(n){var r=n(t.state);r&&r!=to&&e.push(r)})),t.cursorWrapper&&e.push(Zr.create(t.state.doc,[t.cursorWrapper.deco])),eo.from(e)}eo.prototype.forChild=function(t,e){if(e.isLeaf)return Zr.empty;for(var n=[],r=0;rr.scrollToSelection?"to selection":"preserve",l=o||!this.docView.matchesNode(t.doc,c,a);!l&&t.selection.eq(r.selection)||(i=!0);var d,u,h,f,m,v,g,y,b,w,k,x="preserve"==p&&i&&null==this.dom.style.overflowAnchor&&function(t){for(var e,n,r=t.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,s=o+1;s=o-20){e=a,n=c.top;break}}}return{refDOM:e,refTop:n,stack:Je(t.dom)}}(this);if(i){this.domObserver.stop();var M=l&&(Se.ie||Se.chrome)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&(f=r.selection,m=t.selection,v=Math.min(f.$anchor.sharedDepth(f.head),m.$anchor.sharedDepth(m.head)),f.$anchor.start(v)!=m.$anchor.start(v));if(l){var S=Se.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!o&&this.docView.update(t.doc,c,a,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=gn(t.doc,c,a,this.dom,this)),S&&!this.trackWrites&&(M=!0)}M||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(d=this,u=d.docView.domFromPos(d.state.selection.anchor,0),h=d.root.getSelection(),Re(u.node,u.offset,h.anchorNode,h.anchorOffset)))?zn(this,M):(jn(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),"reset"==p)this.dom.scrollTop=0;else if("to selection"==p){var O=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",(function(t){return t(n)}))||(t.selection instanceof ie?qe(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect(),O):qe(this,this.coordsAtPos(t.selection.head,1),O))}else x&&(y=(g=x).refDOM,b=g.refTop,w=g.stack,k=y?y.getBoundingClientRect().top:0,We(w,0==k?0:k-b))},lo.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()},lo.prototype.updatePluginViews=function(t){if(t&&t.plugins==this.state.plugins)for(var e=0;e",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},bo="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),wo="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),ko="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),xo="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Mo="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),So=bo&&(xo||+bo[1]<57)||ko&&xo,Oo=0;Oo<10;Oo++)go[48+Oo]=go[96+Oo]=String(Oo);for(Oo=1;Oo<=24;Oo++)go[Oo+111]="F"+Oo;for(Oo=65;Oo<=90;Oo++)go[Oo]=String.fromCharCode(Oo+32),yo[Oo]=String.fromCharCode(Oo);for(var Co in go)yo.hasOwnProperty(Co)||(yo[Co]=go[Co]);var No="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);function _o(t){var e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(var a=0;a127)&&(r=go[n.keyCode])&&r!=o){var a=e[To(r,n,!0)];if(a&&a(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){var c=e[To(o,n,!0)];if(c&&c(t.state,t.dispatch,t))return!0}return!1}}var Ao=function(t,e){var n;this.match=t,this.handler="string"==typeof e?(n=e,function(t,e,r,o){var i=n;if(e[1]){var s=e[0].lastIndexOf(e[1]);i+=e[0].slice(s+e[1].length);var a=(r+=s)-o;a>0&&(i=e[0].slice(s-a,s)+i,r=o)}return t.tr.insertText(i,r,o)}):e};function Eo(t,e,n,r,o,i){if(t.composing)return!1;var s=t.state,a=s.doc.resolve(e);if(a.parent.type.spec.code)return!1;for(var c=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r,p=0;p0))return!1;var o=Po(r);if(!o){var i=r.blockRange(),s=i&&Rt(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}var a=o.nodeBefore;if(!a.type.spec.isolating&&Xo(t,o,e))return!0;if(0==r.parent.content.size&&(Bo(a,"end")||ie.isSelectable(a))){if(e){var c=t.tr.deleteRange(r.before(),r.after());c.setSelection(Bo(a,"end")?te.findFrom(c.doc.resolve(c.mapping.map(o.pos,-1)),-1):ie.create(c.doc,o.pos-a.nodeSize)),e(c.scrollIntoView())}return!0}return!(!a.isAtom||o.depth!=r.depth-1)&&(e&&e(t.tr.delete(o.pos-a.nodeSize,o.pos).scrollIntoView()),!0)}function Bo(t,e){for(;t;t="start"==e?t.firstChild:t.lastChild)if(t.isTextblock)return!0;return!1}function Lo(t,e,n){var r=t.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):o.parentOffset>0)return!1;i=Po(o)}var s=i&&i.nodeBefore;return!(!s||!ie.isSelectable(s))&&(e&&e(t.tr.setSelection(ie.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)}function Po(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function jo(t,e,n){var r=t.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){var n=t.node(e);if(t.index(e)+11&&n.after()!=n.end(-1)){var r=n.before();if(Bt(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&Rt(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)}function Go(t,e){return e&&e(t.tr.setSelection(new ae(t.doc))),!0}function Xo(t,e,n){var r,o,s=e.nodeBefore,a=e.nodeAfter;if(s.type.spec.isolating||a.type.spec.isolating)return!1;if(function(t,e,n){var r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(i,i+1)||!o.isTextblock&&!Lt(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;var c=e.parent.canReplace(e.index(),e.index()+1);if(c&&(r=(o=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&o.matchType(r[0]||a.type).validEnd){if(n){for(var p=e.pos+a.nodeSize,l=i.empty,d=r.length-1;d>=0;d--)l=i.from(r[d].create(null,l));l=i.from(s.copy(l));var h=t.tr.step(new At(e.pos-1,p,e.pos,p,new u(l,1,0),r.length,!0)),f=p+2*r.length;Lt(h.doc,f)&&h.join(f),n(h.scrollIntoView())}return!0}var m=te.findFrom(e,1),v=m&&m.$from.blockRange(m.$to),g=v&&Rt(v);if(null!=g&&g>=e.depth)return n&&n(t.tr.lift(v,g).scrollIntoView()),!0;if(c&&a.isTextblock&&Bo(s,"end")){for(var y=s,b=[];b.push(y),!y.isTextblock;)y=y.lastChild;if(y.canReplace(y.childCount,y.childCount,a.content)){if(n){for(var w=i.empty,k=b.length-1;k>=0;k--)w=i.from(b[k].copy(w));n(t.tr.step(new At(e.pos-b.length,e.pos+a.nodeSize,e.pos+1,e.pos+a.nodeSize-1,new u(w,b.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Yo(t,e){return function(n,r){var o=n.selection,i=o.$from,s=o.$to,a=i.blockRange(s),c=a&&zt(a,t,e);return!!c&&(r&&r(n.tr.wrap(a,c).scrollIntoView()),!0)}}function Qo(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(e,n,r){for(var o=0;o=2&&s.node(c.depth-1).type.compatibleContent(t)&&0==c.startIndex){if(0==s.index(c.depth-1))return!1;var d=n.doc.resolve(c.start-2);l=new V(d,d,c.depth),c.endIndex=0;a--)s=i.from(n[a].type.create(n[a].attrs,s));t.step(new At(e.start-(r?2:0),e.end,e.start,e.end,new u(s,0,0),n.length,!0));for(var c=0,p=0;pc;a--)s-=o.child(a).nodeSize,r.delete(s-1,s+1);var p=r.doc.resolve(n.start),l=p.nodeAfter,d=0==n.startIndex,h=n.endIndex==o.childCount,f=p.node(-1),m=p.index(-1);if(!f.canReplace(m+(d?0:1),m+1,l.content.append(h?i.empty:i.from(o))))return!1;var v=p.pos,g=v+l.nodeSize;return r.step(new At(v-(d?1:0),g+(h?1:0),v+1,g-1,new u((d?i.empty:i.from(o.copy(i.empty))).append(h?i.empty:i.from(o.copy(i.empty))),d?0:1,h?0:1),d?0:1)),e(r.scrollIntoView()),!0}(e,n,a)))}}function ei(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function ni(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function ri(t,e){const n=ni(e,t.schema),{from:r,to:o}=t.selection;let i=[];t.doc.nodesBetween(r,o,(t=>{i=[...i,t]}));const s=i.reverse().find((t=>t.type.name===n.name));return s?__spreadValues({},s.attrs):{}}function oi(t,e){if("string"==typeof t){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function ii(t,e){const n=oi(e,t.schema),{from:r,to:o,empty:i}=t.selection;let s=[];i?s=t.selection.$head.marks():t.doc.nodesBetween(r,o,(t=>{s=[...s,...t.marks]}));const a=s.find((t=>t.type.name===n.name));return a?__spreadValues({},a.attrs):{}}function si(t,e){const n=Object.keys(e);return!n.length||!!n.filter((n=>e[n]===t[n])).length}function ai(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?ni(e,t.schema):null;let a=[];if(t.doc.nodesBetween(r,o,((t,e)=>{if(!t.isText){const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);a=[...a,{node:t,from:n,to:i}]}})),i)return!!a.filter((t=>!s||s.name===t.node.type.name)).find((t=>si(t.node.attrs,n)));const c=o-r;return a.filter((t=>!s||s.name===t.node.type.name)).filter((t=>si(t.node.attrs,n))).reduce(((t,e)=>t+(e.to-e.from)),0)>=c}function ci(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?oi(e,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter((t=>!s||s.name===t.type.name)).find((t=>si(t.attrs,n)));let a=0,c=[];if(t.doc.nodesBetween(r,o,((t,e)=>{if(t.isText){const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);a+=i-n,c=[...c,...t.marks.map((t=>({mark:t,from:n,to:i})))]}})),0===a)return!1;const p=c.filter((t=>!s||s.name===t.mark.type.name)).filter((t=>si(t.mark.attrs,n))).reduce(((t,e)=>t+(e.to-e.from)),0),l=c.filter((t=>!s||t.mark.type!==s&&t.mark.type.excludes(s))).reduce(((t,e)=>t+(e.to-e.from)),0);return(p>0?p+l:p)>=a}function pi(t){const e=`${t}`;return(new window.DOMParser).parseFromString(e,"text/html").body}function li(t,e,n){if(n=__spreadValues({slice:!0,parseOptions:{}},n),"object"==typeof t&&null!==t)try{return Array.isArray(t)?i.fromArray(t.map((t=>e.nodeFromJSON(t)))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),li("",e,n)}if("string"==typeof t){const r=ot.fromSchema(e);return n.slice?r.parseSlice(pi(t),n.parseOptions).content:r.parse(pi(t),n.parseOptions)}return li("",e,n)}function di(t,e,n={}){return li(t,e,{slice:!1,parseOptions:n})}Qo(qo,Uo,Ko,(function(t,e){var n=t.selection,r=n.$from,o=n.$to;if(t.selection instanceof ie&&t.selection.node.isBlock)return!(!r.parentOffset||!Bt(t.doc,r.pos))&&(e&&e(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(e){var i=o.parentOffset==o.parent.content.size,s=t.tr;(t.selection instanceof re||t.selection instanceof ae)&&s.deleteSelection();var a=0==r.depth?null:Jo(r.node(-1).contentMatchAt(r.indexAfter(-1))),c=i&&a?[{type:a}]:null,p=Bt(s.doc,s.mapping.map(r.pos),1,c);if(c||p||!Bt(s.doc,s.mapping.map(r.pos),1,a&&[{type:a}])||(c=[{type:a}],p=!0),p&&(s.split(s.mapping.map(r.pos),1,c),!i&&!r.parentOffset&&r.parent.type!=a)){var l=s.mapping.map(r.before()),d=s.doc.resolve(l);r.node(-1).canReplaceWith(d.index(),d.index()+1,a)&&s.setNodeMarkup(s.mapping.map(r.before()),a)}e(s.scrollIntoView())}return!0})),"undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&os.platform();class ui{constructor(t,e){this.editor=t,this.commands=e}createCommands(){const{commands:t,editor:e}=this,{state:n,view:r}=e,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,(...t)=>{const n=e(...t)(i);return o.getMeta("preventDispatch")||r.dispatch(o),n}])))}createChain(t,e=!0){const{commands:n,editor:r}=this,{state:o,view:i}=r,s=[],a=!!t,c=t||o.tr,p=__spreadProps(__spreadValues({},Object.fromEntries(Object.entries(n).map((([t,n])=>[t,(...t)=>{const r=this.buildProps(c,e),o=n(...t)(r);return s.push(o),p}])))),{run:()=>(a||!e||c.getMeta("preventDispatch")||i.dispatch(c),s.every((t=>!0===t)))});return p}createCan(t){const{commands:e,editor:n}=this,{state:r}=n,o=void 0,i=t||r.tr,s=this.buildProps(i,o),a=Object.fromEntries(Object.entries(e).map((([t,e])=>[t,(...t)=>e(...t)(__spreadProps(__spreadValues({},s),{dispatch:o}))])));return __spreadProps(__spreadValues({},a),{chain:()=>this.createChain(i,o)})}buildProps(t,e=!0){const{editor:n,commands:r}=this,{state:o,view:i}=n;o.storedMarks&&t.setStoredMarks(o.storedMarks);const s={tr:t,editor:n,view:i,state:this.chainableState(t,o),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map((([t,e])=>[t,(...t)=>e(...t)(s)])))}};return s}chainableState(t,e){let{selection:n}=t,{doc:r}=t,{storedMarks:o}=t;return __spreadProps(__spreadValues({},e),{schema:e.schema,plugins:e.plugins,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return n},get doc(){return r},get tr(){return n=t.selection,r=t.doc,o=t.storedMarks,t}})}}function hi(t,e,n={}){if(void 0===t.config[e]&&t.parent)return hi(t.parent,e,n);if("function"==typeof t.config[e]){return t.config[e].bind(__spreadProps(__spreadValues({},n),{parent:t.parent?hi(t.parent,e,n):null}))}return t.config[e]}function fi(t){return{baseExtensions:t.filter((t=>"extension"===t.type)),nodeExtensions:t.filter((t=>"node"===t.type)),markExtensions:t.filter((t=>"mark"===t.type))}}function mi(t){const e=[],{nodeExtensions:n,markExtensions:r}=fi(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0};return t.forEach((t=>{const n=hi(t,"addGlobalAttributes",{name:t.name,options:t.options});if(!n)return;n().forEach((t=>{t.types.forEach((n=>{Object.entries(t.attributes).forEach((([t,r])=>{e.push({type:n,name:t,attribute:__spreadValues(__spreadValues({},i),r)})}))}))}))})),o.forEach((t=>{const n={name:t.name,options:t.options},r=hi(t,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{e.push({type:t.name,name:n,attribute:__spreadValues(__spreadValues({},i),r)})}))})),e}function vi(...t){return t.filter((t=>!!t)).reduce(((t,e)=>{const n=__spreadValues({},t);return Object.entries(e).forEach((([t,e])=>{n[t]?n[t]="class"===t?[n[t],e].join(" "):"style"===t?[n[t],e].join("; "):e:n[t]=e})),n}),{})}function gi(t,e){return e.filter((t=>t.attribute.rendered)).map((e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]})).reduce(((t,e)=>vi(t,e)),{})}function yi(t,e){return t.style?t:__spreadProps(__spreadValues({},t),{getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===r)return!1;const o=e.filter((t=>t.attribute.rendered)).reduce(((t,e)=>{const r=e.attribute.parseHTML?e.attribute.parseHTML(n)||{}:{[e.name]:(o=n.getAttribute(e.name),"string"!=typeof o?o:o.match(/^\d*(\.\d+)?$/)?Number(o):"true"===o||"false"!==o&&o)};var o;const i=Object.fromEntries(Object.entries(r).filter((([,t])=>null!=t)));return __spreadValues(__spreadValues({},t),i)}),{});return __spreadValues(__spreadValues({},r),o)}})}function bi(t,e,...n){return"function"==typeof t?e?t.bind(e)(...n):t(...n):t}function wi(t){return Object.fromEntries(Object.entries(t).filter((([t,e])=>("attrs"!==t||!function(t={}){return 0===Object.keys(t).length&&t.constructor===Object}(e))&&null!=e)))}function ki(t,e){return e.nodes[t]?e.nodes[t]:e.marks[t]?e.marks[t]:null}class xi{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=xi.resolve(t),this.schema=function(t){var e;const n=mi(t),{nodeExtensions:r,markExtensions:o}=fi(t),i=null===(e=r.find((t=>hi(t,"topNode"))))||void 0===e?void 0:e.name,s=Object.fromEntries(r.map((e=>{const r=n.filter((t=>t.type===e.name)),o={name:e.name,options:e.options},i=t.reduce(((t,n)=>{const r=hi(n,"extendNodeSchema",o);return __spreadValues(__spreadValues({},t),r?r(e):{})}),{}),s=wi(__spreadProps(__spreadValues({},i),{content:bi(hi(e,"content",o)),marks:bi(hi(e,"marks",o)),group:bi(hi(e,"group",o)),inline:bi(hi(e,"inline",o)),atom:bi(hi(e,"atom",o)),selectable:bi(hi(e,"selectable",o)),draggable:bi(hi(e,"draggable",o)),code:bi(hi(e,"code",o)),defining:bi(hi(e,"defining",o)),isolating:bi(hi(e,"isolating",o)),attrs:Object.fromEntries(r.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))})),a=bi(hi(e,"parseHTML",o));a&&(s.parseDOM=a.map((t=>yi(t,r))));const c=hi(e,"renderHTML",o);return c&&(s.toDOM=t=>c({node:t,HTMLAttributes:gi(t,r)})),[e.name,s]}))),a=Object.fromEntries(o.map((e=>{const r=n.filter((t=>t.type===e.name)),o={name:e.name,options:e.options},i=t.reduce(((t,n)=>{const r=hi(n,"extendMarkSchema",o);return __spreadValues(__spreadValues({},t),r?r(e):{})}),{}),s=wi(__spreadProps(__spreadValues({},i),{inclusive:bi(hi(e,"inclusive",o)),excludes:bi(hi(e,"excludes",o)),group:bi(hi(e,"group",o)),spanning:bi(hi(e,"spanning",o)),attrs:Object.fromEntries(r.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))})),a=bi(hi(e,"parseHTML",o));a&&(s.parseDOM=a.map((t=>yi(t,r))));const c=hi(e,"renderHTML",o);return c&&(s.toDOM=t=>c({mark:t,HTMLAttributes:gi(t,r)})),[e.name,s]})));return new nt({topNode:i,nodes:s,marks:a})}(this.extensions),this.extensions.forEach((t=>{var e;const n={name:t.name,options:t.options,editor:this.editor,type:ki(t.name,this.schema)};if("mark"===t.type){(null===(e=bi(hi(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name)}const r=hi(t,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const o=hi(t,"onCreate",n);o&&this.editor.on("create",o);const i=hi(t,"onUpdate",n);i&&this.editor.on("update",i);const s=hi(t,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=hi(t,"onTransaction",n);a&&this.editor.on("transaction",a);const c=hi(t,"onFocus",n);c&&this.editor.on("focus",c);const p=hi(t,"onBlur",n);p&&this.editor.on("blur",p);const l=hi(t,"onDestroy",n);l&&this.editor.on("destroy",l)}))}static resolve(t){return xi.sort(xi.flatten(t))}static flatten(t){return t.map((t=>{const e=hi(t,"addExtensions",{name:t.name,options:t.options});return e?[t,...this.flatten(e())]:t})).flat(10)}static sort(t){return t.sort(((t,e)=>{const n=hi(t,"priority")||100,r=hi(e,"priority")||100;return n>r?-1:n{const n=hi(e,"addCommands",{name:e.name,options:e.options,editor:this.editor,type:ki(e.name,this.schema)});return n?__spreadValues(__spreadValues({},t),n()):t}),{})}get plugins(){return[...this.extensions].reverse().map((t=>{const e={name:t.name,options:t.options,editor:this.editor,type:ki(t.name,this.schema)},n=[],r=hi(t,"addKeyboardShortcuts",e);if(r){const t=function(t){return new we({props:{handleKeyDown:Vo(t)}})}(Object.fromEntries(Object.entries(r()).map((([t,e])=>[t,()=>e({editor:this.editor})]))));n.push(t)}const o=hi(t,"addInputRules",e);if(this.editor.options.enableInputRules&&o){const t=o(),e=t.length?[(i={rules:t},s=i.rules,a=new we({state:{init:function(){return null},apply:function(t,e){var n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:function(t,e,n,r){return Eo(t,e,n,r,s,a)},handleDOMEvents:{compositionend:function(t){setTimeout((function(){var e=t.state.selection.$cursor;e&&Eo(t,e.pos,e.pos,"",s,a)}))}}},isInputRules:!0}),a)]:[];n.push(...e)}var i,s,a;const c=hi(t,"addPasteRules",e);if(this.editor.options.enablePasteRules&&c){const t=c();n.push(...t)}const p=hi(t,"addProseMirrorPlugins",e);if(p){const t=p();n.push(...t)}return n})).flat()}get attributes(){return mi(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=fi(this.extensions);return Object.fromEntries(e.filter((t=>!!hi(t,"addNodeView"))).map((e=>{const n=this.attributes.filter((t=>t.type===e.name)),r={name:e.name,options:e.options,editor:t,type:ni(e.name,this.schema)},o=hi(e,"addNodeView",r);if(!o)return[];return[e.name,(r,i,s,a)=>{const c=gi(r,n);return o()({editor:t,node:r,getPos:s,decorations:a,HTMLAttributes:c,extension:e})}]})))}get textSerializers(){const{editor:t}=this,{nodeExtensions:e}=fi(this.extensions);return Object.fromEntries(e.filter((t=>!!hi(t,"renderText"))).map((e=>{const n=hi(e,"renderText",{name:e.name,options:e.options,editor:t,type:ni(e.name,this.schema)});if(!n)return[];return[e.name,t=>n(t)]})))}}function Mi(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function Si(t,e){const n=__spreadValues({},t);return Mi(t)&&Mi(e)&&Object.keys(e).forEach((r=>{Mi(e[r])?r in t?n[r]=Si(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})})),n}class Oi{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=__spreadValues(__spreadValues({},this.config),t),this.name=this.config.name,this.options=this.config.defaultOptions}static create(t={}){return new Oi(t)}configure(t={}){const e=this.extend();return e.options=Si(this.options,t),e}extend(t={}){const e=new Oi(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,e.options=t.defaultOptions?t.defaultOptions:e.parent.options,e}}const Ci=Oi.create({name:"editable",addProseMirrorPlugins(){return[new we({key:new Me("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{from:e,to:n}=t.state.selection;return((t,e,n,r,o)=>{let i="",s=!0;return t.state.doc.nodesBetween(e,n,((a,c)=>{var p;const l=t.extensionManager.textSerializers[a.type.name];l?(i+=l({node:a}),s=!r):a.isText?(i+=null===(p=null==a?void 0:a.text)||void 0===p?void 0:p.slice(Math.max(e,c)-c,n-c),s=!r):a.isLeaf&&o?(i+=o,s=!r):!s&&a.isBlock&&(i+=r,s=!0)}),0),i})(t,e,n,"\n")}}})]}});var Ni=Object.freeze({__proto__:null,blur:()=>({view:t})=>(t.dom.blur(),!0)});var _i=Object.freeze({__proto__:null,clearContent:(t=!1)=>({commands:e})=>e.setContent("",t)});var Ti=Object.freeze({__proto__:null,clearNodes:()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return o.forEach((r=>{t.doc.nodesBetween(r.$from.pos,r.$to.pos,((t,r)=>{if(t.type.isText)return;const o=e.doc.resolve(e.mapping.map(r)),i=e.doc.resolve(e.mapping.map(r+t.nodeSize)),s=o.blockRange(i);if(!s)return;const a=Rt(s);if(t.type.isTextblock&&n){const{defaultType:t}=o.parent.contentMatchAt(o.index());e.setNodeMarkup(s.start,t)}(a||0===a)&&n&&e.lift(s,a)}))})),!0}});var Vi=Object.freeze({__proto__:null,command:t=>e=>t(e)});var Ai=Object.freeze({__proto__:null,createParagraphNear:()=>({state:t,dispatch:e})=>Uo(t,e)});var Ei=Object.freeze({__proto__:null,deleteRange:t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0}});var Di=Object.freeze({__proto__:null,deleteSelection:()=>({state:t,dispatch:e})=>zo(t,e)});var Ri=Object.freeze({__proto__:null,enter:()=>({commands:t})=>t.keyboardShortcut("Enter")});var zi=Object.freeze({__proto__:null,exitCode:()=>({state:t,dispatch:e})=>Wo(t,e)});function Ii(t,e,n={}){return t.find((t=>t.type===e&&si(t.attrs,n)))}function Bi(t,e,n={}){return!!Ii(t,e,n)}function Li(t,e,n={}){if(!t||!e)return;const r=t.parent.childAfter(t.parentOffset);if(!r.node)return;const o=Ii(r.node.marks,e,n);if(!o)return;let i=t.index(),s=t.start()+r.offset,a=i+1,c=s+r.node.nodeSize;for(Ii(r.node.marks,e,n);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,s-=t.parent.child(i).nodeSize;for(;a({tr:n,state:r,dispatch:o})=>{const i=oi(t,r.schema),{doc:s,selection:a}=n,{$from:c,from:p,to:l}=a;if(o){const t=Li(c,i,e);if(t&&t.from<=p&&t.to>=l){const e=re.create(s,t.from,t.to);n.setSelection(e)}}return!0}});var ji=Object.freeze({__proto__:null,first:t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t({editor:e,view:n,tr:r,dispatch:o})=>{if(n.hasFocus()&&null===t||!1===t)return!0;if(o&&null===t&&!Hi(e.state.selection))return n.focus(),!0;const{from:i,to:s}=function(t,e=null){if(!e)return null;if("start"===e||!0===e)return{from:0,to:0};if("end"===e){const{size:e}=t.doc.content;return{from:e,to:e}}return{from:e,to:e}}(e.state,t)||e.state.selection,{doc:a,storedMarks:c}=r,p=$i(i,0,a.content.size),l=$i(s,0,a.content.size),d=re.create(a,p,l),u=e.state.selection.eq(d);return o&&(r.setSelection(d),u&&c&&r.setStoredMarks(c),n.focus()),!0}});var Ji=Object.freeze({__proto__:null,forEach:(t,e)=>n=>t.every(((t,r)=>e(t,__spreadProps(__spreadValues({},n),{index:r}))))});var Wi=Object.freeze({__proto__:null,insertContent:t=>({tr:e,commands:n})=>n.insertContentAt({from:e.selection.from,to:e.selection.to},t)});var Ui=Object.freeze({__proto__:null,insertContentAt:(t,e)=>({tr:n,dispatch:r,editor:o})=>{if(r){const r=li(e,o.schema,{parseOptions:{preserveWhitespace:"full"}});if("<>"===r.toString())return!0;const{from:i,to:s}="number"==typeof t?{from:t,to:t}:t;n.replaceWith(i,s,r),function(t,e,n){const r=t.steps.length-1;if(r{0===s&&(s=r)})),t.setSelection(te.near(t.doc.resolve(s),n))}(n,n.steps.length-1,1)}return!0}});var Ki=Object.freeze({__proto__:null,joinBackward:()=>({state:t,dispatch:e})=>Io(t,e)});var Gi=Object.freeze({__proto__:null,joinForward:()=>({state:t,dispatch:e})=>jo(t,e)});const Xi="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);var Yi=Object.freeze({__proto__:null,keyboardShortcut:t=>({editor:e,view:n,tr:r,dispatch:o})=>{const i=function(t){const e=t.split(/-(?!$)/);let n,r,o,i,s=e[e.length-1];"Space"===s&&(s=" ");for(let a=0;a!["Alt","Ctrl","Meta","Shift"].includes(t))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction((()=>{n.someProp("handleKeyDown",(t=>t(n,a)))}));return null==c||c.steps.forEach((t=>{const e=t.map(r.mapping);e&&o&&r.maybeStep(e)})),!0}});var Qi=Object.freeze({__proto__:null,lift:(t,e={})=>({state:n,dispatch:r})=>!!ai(n,ni(t,n.schema),e)&&Ho(n,r)});var Zi=Object.freeze({__proto__:null,liftEmptyBlock:()=>({state:t,dispatch:e})=>Ko(t,e)});var ts=Object.freeze({__proto__:null,liftListItem:t=>({state:e,dispatch:n})=>ti(ni(t,e.schema))(e,n)});var es=Object.freeze({__proto__:null,newlineInCode:()=>({state:t,dispatch:e})=>qo(t,e)});var ns=Object.freeze({__proto__:null,replace:(t,e={})=>({state:n,commands:r})=>{console.warn("[tiptap warn]: replace() is deprecated. please use insertContent() instead.");const{from:o,to:i}=n.selection,s={from:o,to:i};return r.replaceRange(s,t,e)}});var rs=Object.freeze({__proto__:null,replaceRange:(t,e,n={})=>({tr:r,state:o,dispatch:i})=>{console.warn("[tiptap warn]: replaceRange() is deprecated. please use insertContent() instead.");const s=ni(e,o.schema),{from:a,to:c}=t;return i&&r.replaceRangeWith(a,c,s.create(n)),!0}});function is(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce(((e,r)=>(n.includes(r)||(e[r]=t[r]),e)),{})}var ss=Object.freeze({__proto__:null,resetAttributes:(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=ei("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=ni(t,r.schema)),"mark"===a&&(s=oi(t,r.schema)),o&&n.selection.ranges.forEach((t=>{r.doc.nodesBetween(t.$from.pos,t.$to.pos,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,is(t.attrs,e)),s&&t.marks.length&&t.marks.forEach((o=>{s===o.type&&n.addMark(r,r+t.nodeSize,s.create(is(o.attrs,e)))}))}))})),!0)}});var as=Object.freeze({__proto__:null,scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0)});var cs=Object.freeze({__proto__:null,selectAll:()=>({state:t,dispatch:e})=>Go(t,e)});var ps=Object.freeze({__proto__:null,selectNodeBackward:()=>({state:t,dispatch:e})=>Lo(t,e)});var ls=Object.freeze({__proto__:null,selectNodeForward:()=>({state:t,dispatch:e})=>$o(t,e)});var ds=Object.freeze({__proto__:null,selectParentNode:()=>({state:t,dispatch:e})=>function(t,e){var n,r=t.selection,o=r.$from,i=r.to,s=o.sharedDepth(i);return 0!=s&&(n=o.before(s),e&&e(t.tr.setSelection(ie.create(t.doc,n))),!0)}(t,e)});var us=Object.freeze({__proto__:null,setContent:(t,e=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=di(t,o.schema,n),c=re.create(s,0,s.content.size);return i&&r.setSelection(c).replaceSelectionWith(a,!1).setMeta("preventUpdate",!e),!0}});var hs=Object.freeze({__proto__:null,setMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,c=oi(t,r.schema);if(o)if(s){const t=ii(r,c);n.addStoredMark(c.create(__spreadValues(__spreadValues({},t),e)))}else a.forEach((t=>{const o=t.$from.pos,i=t.$to.pos;r.doc.nodesBetween(o,i,((t,r)=>{const s=Math.max(r,o),a=Math.min(r+t.nodeSize,i);t.marks.find((t=>t.type===c))?t.marks.forEach((t=>{c===t.type&&n.addMark(s,a,c.create(__spreadValues(__spreadValues({},t.attrs),e)))})):n.addMark(s,a,c.create(e))}))}));return!0}});var fs=Object.freeze({__proto__:null,setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0)});var ms=Object.freeze({__proto__:null,setNode:(t,e={})=>({state:n,dispatch:r})=>{const o=ni(t,n.schema);return(i=o,s=e,function(t,e){var n=t.selection,r=n.from,o=n.to,a=!1;return t.doc.nodesBetween(r,o,(function(e,n){if(a)return!1;if(e.isTextblock&&!e.hasMarkup(i,s))if(e.type==i)a=!0;else{var r=t.doc.resolve(n),o=r.index();a=r.parent.canReplaceWith(o,o+1,i)}})),!!a&&(e&&e(t.tr.setBlockType(r,o,i,s).scrollIntoView()),!0)})(n,r);var i,s}});var vs=Object.freeze({__proto__:null,setNodeSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,r=$i(t,0,n.content.size),o=ie.create(n,r);e.setSelection(o)}return!0}});var gs=Object.freeze({__proto__:null,setTextSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,{from:r,to:o}="number"==typeof t?{from:t,to:t}:t,i=$i(r,0,n.content.size),s=$i(o,0,n.content.size),a=re.create(n,i,s);e.setSelection(a)}return!0}});var ys=Object.freeze({__proto__:null,sinkListItem:t=>({state:e,dispatch:n})=>{const r=ni(t,e.schema);return(o=r,function(t,e){var n=t.selection,r=n.$from,s=n.$to,a=r.blockRange(s,(function(t){return t.childCount&&t.firstChild.type==o}));if(!a)return!1;var c=a.startIndex;if(0==c)return!1;var p=a.parent,l=p.child(c-1);if(l.type!=o)return!1;if(e){var d=l.lastChild&&l.lastChild.type==p.type,h=i.from(d?o.create():null),f=new u(i.from(o.create(null,i.from(p.type.create(null,h)))),d?3:1,0),m=a.start,v=a.end;e(t.tr.step(new At(m-(d?3:1),v,m,v,f,1,!0)).scrollIntoView())}return!0})(e,n);var o}});function bs(t,e,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=t.find((t=>t.type===e&&t.name===n));return!!r&&r.attribute.keepOnSplit})))}function ws(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter((t=>null==e?void 0:e.includes(t.type.name)));t.tr.ensureMarks(r)}}var ks=Object.freeze({__proto__:null,splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:c}=i,p=bs(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof ie&&i.node.isBlock)return!(!a.parentOffset||!Bt(s,a.pos))&&(r&&(t&&ws(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=c.parentOffset===c.parent.content.size;i instanceof re&&e.deleteSelection();const s=0===a.depth?void 0:function(t){for(let e=0;e({tr:e,state:n,dispatch:r,editor:o})=>{var s;const a=ni(t,n.schema),{$from:c,$to:p}=n.selection,l=n.selection.node;if(l&&l.isBlock||c.depth<2||!c.sameParent(p))return!1;const d=c.node(-1);if(d.type!==a)return!1;const h=o.extensionManager.attributes;if(0===c.parent.content.size&&c.node(-1).childCount===c.indexAfter(-1)){if(2===c.depth||c.node(-3).type!==a||c.index(-2)!==c.node(-2).childCount-1)return!1;if(r){let t=i.empty;const n=c.index(-1)>0;for(let e=c.depth-(n?1:2);e>=c.depth-3;e-=1)t=i.from(c.node(e).copy(t));const r=bs(h,c.node().type.name,c.node().attrs),o=(null===(s=a.contentMatch.defaultType)||void 0===s?void 0:s.createAndFill(r))||void 0;t=t.append(i.from(a.createAndFill(null,o)||void 0)),e.replace(c.before(n?void 0:-1),c.after(-3),new u(t,n?3:2,2)).setSelection(re.near(e.doc.resolve(c.pos+(n?3:2)))).scrollIntoView()}return!0}const f=p.pos===c.end()?d.contentMatchAt(0).defaultType:null,m=bs(h,d.type.name,d.attrs),v=bs(h,c.node().type.name,c.node().attrs);e.delete(c.pos,p.pos);const g=f?[{type:a,attrs:m},{type:f,attrs:v}]:[{type:a,attrs:m}];return!!Bt(e.doc,c.pos,2)&&(r&&e.split(c.pos,2,g).scrollIntoView(),!0)}});function Ms(t,e){const{nodeExtensions:n}=fi(e),r=n.find((e=>e.name===t));if(!r)return!1;const o=bi(hi(r,"group",{name:r.name,options:r.options}));return"string"==typeof o&&o.split(" ").includes("list")}var Ss=Object.freeze({__proto__:null,toggleList:(t,e)=>({editor:n,tr:r,state:o,dispatch:i,chain:s,commands:a,can:c})=>{const{extensions:p}=n.extensionManager,l=ni(t,o.schema),d=ni(e,o.schema),{selection:u}=o,{$from:h,$to:f}=u,m=h.blockRange(f);if(!m)return!1;const v=(g=t=>Ms(t.type.name,p),t=>function(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}(t.$from,g))(u);var g;if(m.depth>=1&&v&&m.depth-v.depth<=1){if(v.node.type===l)return a.liftListItem(d);if(Ms(v.node.type.name,p)&&l.validContent(v.node.content)&&i)return r.setNodeMarkup(v.pos,l),!0}return c().wrapInList(l)?a.wrapInList(l):s().clearNodes().wrapInList(l).run()}});var Os=Object.freeze({__proto__:null,toggleMark:(t,e={})=>({state:n,commands:r})=>{const o=oi(t,n.schema);return ci(n,o,e)?r.unsetMark(o):r.setMark(o,e)}});var Cs=Object.freeze({__proto__:null,toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const i=ni(t,r.schema),s=ni(e,r.schema);return ai(r,i,n)?o.setNode(s):o.setNode(i,n)}});var Ns=Object.freeze({__proto__:null,toggleWrap:(t,e={})=>({state:n,dispatch:r})=>{const o=ni(t,n.schema);return ai(n,o,e)?Ho(n,r):Yo(o,e)(n,r)}});var _s=Object.freeze({__proto__:null,undoInputRule:()=>({state:t,dispatch:e})=>function(t,e){for(var n=t.plugins,r=0;r=0;c--)s.step(a.steps[c].invert(a.docs[c]));if(i.text){var p=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,p))}else s.delete(i.from,i.to);e(s)}return!0}}return!1}(t,e)});var Ts=Object.freeze({__proto__:null,unsetAllMarks:()=>({tr:t,state:e,dispatch:n})=>{const{selection:r}=t,{empty:o,ranges:i}=r;return o||n&&Object.entries(e.schema.marks).forEach((([,e])=>{i.forEach((n=>{t.removeMark(n.$from.pos,n.$to.pos,e)}))})),!0}});var Vs=Object.freeze({__proto__:null,unsetMark:t=>({tr:e,state:n,dispatch:r})=>{const{selection:o}=e,i=oi(t,n.schema),{$from:s,empty:a,ranges:c}=o;if(r){if(a){let{from:t,to:n}=o;const r=Li(s,i);r&&(t=r.from,n=r.to),e.removeMark(t,n,i)}else c.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos,i)}));e.removeStoredMark(i)}return!0}});var As=Object.freeze({__proto__:null,updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=ei("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=ni(t,r.schema)),"mark"===a&&(s=oi(t,r.schema)),o&&n.selection.ranges.forEach((t=>{const o=t.$from.pos,a=t.$to.pos;r.doc.nodesBetween(o,a,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,__spreadValues(__spreadValues({},t.attrs),e)),s&&t.marks.length&&t.marks.forEach((i=>{if(s===i.type){const c=Math.max(r,o),p=Math.min(r+t.nodeSize,a);n.addMark(c,p,s.create(__spreadValues(__spreadValues({},i.attrs),e)))}}))}))})),!0)}});var Es=Object.freeze({__proto__:null,wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const o=ni(t,n.schema);return!ai(n,o,e)&&Yo(o,e)(n,r)}});var Ds=Object.freeze({__proto__:null,wrapInList:(t,e={})=>({state:n,dispatch:r})=>Zo(ni(t,n.schema),e)(n,r)});const Rs=Oi.create({name:"commands",addCommands:()=>__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({},Ni),_i),Ti),Vi),Ai),Ei),Di),Ri),zi),Pi),ji),qi),Ji),Wi),Ui),Ki),Gi),Yi),Qi),Zi),ts),es),ns),rs),ss),as),cs),ps),ls),ds),us),hs),fs),ms),vs),gs),ys),ks),xs),Ss),Os),Cs),Ns),_s),Ts),Vs),As),Es),Ds)}),zs=Oi.create({name:"editable",addProseMirrorPlugins(){return[new we({key:new Me("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Is=Oi.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new we({key:new Me("focusEvents"),props:{attributes:{tabindex:"0"},handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Bs=Oi.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first((({commands:t})=>[()=>t.undoInputRule(),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()])),e=()=>this.editor.commands.first((({commands:t})=>[()=>t.deleteSelection(),()=>t.joinForward(),()=>t.selectNodeForward()]));return{Enter:()=>this.editor.commands.first((({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:()=>t(),"Mod-Backspace":()=>t(),Delete:()=>e(),"Mod-Delete":()=>e()}}});var Ls=Object.freeze({__proto__:null,ClipboardTextSerializer:Ci,Commands:Rs,Editable:zs,FocusEvents:Is,Keymap:Bs});class Ps{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=__spreadValues(__spreadValues({},this.config),t),this.name=this.config.name,this.options=this.config.defaultOptions}static create(t={}){return new Ps(t)}configure(t={}){const e=this.extend();return e.options=Si(this.options,t),e}extend(t={}){const e=new Ps(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,e.options=t.defaultOptions?t.defaultOptions:e.parent.options,e}}class js{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=__spreadValues(__spreadValues({},this.config),t),this.name=this.config.name,this.options=this.config.defaultOptions}static create(t={}){return new js(t)}configure(t={}){const e=this.extend();return e.options=Si(this.options,t),e}extend(t={}){const e=new js(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,e.options=t.defaultOptions?t.defaultOptions:e.parent.options,e}}function $s(t,e,n){return new Ao(t,((t,r,o,i)=>{const s=n instanceof Function?n(r):n,{tr:a}=t;return r[0]&&a.replaceWith(o-1,i,e.create(s)),a}))}function Fs(t,e,n){return new Ao(t,((t,r,o,i)=>{const s=n instanceof Function?n(r):n,{tr:a}=t,c=r[r.length-1],p=r[0];let l=i;if(c){const n=p.search(/\S/),r=o+p.indexOf(c),d=r+c.length;if(function(t,e,n){let r=[];return n.doc.nodesBetween(t,e,((t,e)=>{r=[...r,...t.marks.map((n=>({from:e,to:e+t.nodeSize,mark:n})))]})),r}(o,i,t).filter((t=>{const{excluded:n}=t.mark.type;return n.find((t=>t.name===e.name))})).filter((t=>t.to>r)).length)return null;do&&a.delete(o+n,r),l=o+n+c.length,a.addMark(o+n,l,e.create(s)),a.removeStoredMark(e)}return a}))}function Hs(t,e,n){const r=(o,s)=>{const a=[];return o.forEach((o=>{if(o.isText&&o.text){const{text:r}=o;let i,c=0;for(;null!==(i=t.exec(r));){const t=Math.max(i.length-2,0),r=Math.max(i.length-1,0);if(null==s?void 0:s.type.allowsMarkType(e)){const s=i.index+i[0].indexOf(i[t]),p=s+i[t].length,l=s+i[t].lastIndexOf(i[r]),d=l+i[r].length,u=n instanceof Function?n(i):n;s>0&&a.push(o.cut(c,s)),a.push(o.cut(l,d).mark(e.create(u).addToSet(o.marks))),c=p}}cnew u(r(t.content),t.openStart,t.openEnd)}})}function qs(t,e,n){const r=t.coordsAtPos(e),o=t.coordsAtPos(n,-1),i=Math.min(r.top,o.top),s=Math.max(r.bottom,o.bottom),a=Math.min(r.left,o.left),c=Math.max(r.right,o.right),p={top:i,bottom:s,left:a,right:c,width:c-a,height:s-i,x:a,y:i};return __spreadProps(__spreadValues({},p),{toJSON:()=>p})}var Js="top",Ws="bottom",Us="right",Ks="left",Gs="auto",Xs=[Js,Ws,Us,Ks],Ys="start",Qs="end",Zs="viewport",ta="popper",ea=Xs.reduce((function(t,e){return t.concat([e+"-"+Ys,e+"-"+Qs])}),[]),na=[].concat(Xs,[Gs]).reduce((function(t,e){return t.concat([e,e+"-"+Ys,e+"-"+Qs])}),[]),ra=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function oa(t){return t?(t.nodeName||"").toLowerCase():null}function ia(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function sa(t){return t instanceof ia(t).Element||t instanceof Element}function aa(t){return t instanceof ia(t).HTMLElement||t instanceof HTMLElement}function ca(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ia(t).ShadowRoot||t instanceof ShadowRoot)}var pa={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},r=e.attributes[t]||{},o=e.elements[t];aa(o)&&oa(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(t){var e=r[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var r=e.elements[t],o=e.attributes[t]||{},i=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});aa(r)&&oa(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(t){r.removeAttribute(t)})))}))}},requires:["computeStyles"]};function la(t){return t.split("-")[0]}function da(t){var e=t.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function ua(t){var e=da(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function ha(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&ca(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function fa(t){return ia(t).getComputedStyle(t)}function ma(t){return["table","td","th"].indexOf(oa(t))>=0}function va(t){return((sa(t)?t.ownerDocument:t.document)||window.document).documentElement}function ga(t){return"html"===oa(t)?t:t.assignedSlot||t.parentNode||(ca(t)?t.host:null)||va(t)}function ya(t){return aa(t)&&"fixed"!==fa(t).position?t.offsetParent:null}function ba(t){for(var e=ia(t),n=ya(t);n&&ma(n)&&"static"===fa(n).position;)n=ya(n);return n&&("html"===oa(n)||"body"===oa(n)&&"static"===fa(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&aa(t)&&"fixed"===fa(t).position)return null;for(var n=ga(t);aa(n)&&["html","body"].indexOf(oa(n))<0;){var r=fa(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||e&&"filter"===r.willChange||e&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(t)||e}function wa(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var ka=Math.max,xa=Math.min,Ma=Math.round;function Sa(t,e,n){return ka(t,xa(e,n))}function Oa(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Ca(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}var Na={top:"auto",right:"auto",bottom:"auto",left:"auto"};function _a(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.offsets,s=t.position,a=t.gpuAcceleration,c=t.adaptive,p=t.roundOffsets,l=!0===p?function(t){var e=t.x,n=t.y,r=window.devicePixelRatio||1;return{x:Ma(Ma(e*r)/r)||0,y:Ma(Ma(n*r)/r)||0}}(i):"function"==typeof p?p(i):i,d=l.x,u=void 0===d?0:d,h=l.y,f=void 0===h?0:h,m=i.hasOwnProperty("x"),v=i.hasOwnProperty("y"),g=Ks,y=Js,b=window;if(c){var w=ba(n),k="clientHeight",x="clientWidth";w===ia(n)&&"static"!==fa(w=va(n)).position&&(k="scrollHeight",x="scrollWidth"),w=w,o===Js&&(y=Ws,f-=w[k]-r.height,f*=a?1:-1),o===Ks&&(g=Us,u-=w[x]-r.width,u*=a?1:-1)}var M,S=Object.assign({position:s},c&&Na);return a?Object.assign({},S,((M={})[y]=v?"0":"",M[g]=m?"0":"",M.transform=(b.devicePixelRatio||1)<2?"translate("+u+"px, "+f+"px)":"translate3d("+u+"px, "+f+"px, 0)",M)):Object.assign({},S,((e={})[y]=v?f+"px":"",e[g]=m?u+"px":"",e.transform="",e))}var Ta={passive:!0};var Va={left:"right",right:"left",bottom:"top",top:"bottom"};function Aa(t){return t.replace(/left|right|bottom|top/g,(function(t){return Va[t]}))}var Ea={start:"end",end:"start"};function Da(t){return t.replace(/start|end/g,(function(t){return Ea[t]}))}function Ra(t){var e=ia(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function za(t){return da(va(t)).left+Ra(t).scrollLeft}function Ia(t){var e=fa(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Ba(t){return["html","body","#document"].indexOf(oa(t))>=0?t.ownerDocument.body:aa(t)&&Ia(t)?t:Ba(ga(t))}function La(t,e){var n;void 0===e&&(e=[]);var r=Ba(t),o=r===(null==(n=t.ownerDocument)?void 0:n.body),i=ia(r),s=o?[i].concat(i.visualViewport||[],Ia(r)?r:[]):r,a=e.concat(s);return o?a:a.concat(La(ga(s)))}function Pa(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ja(t,e){return e===Zs?Pa(function(t){var e=ia(t),n=va(t),r=e.visualViewport,o=n.clientWidth,i=n.clientHeight,s=0,a=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:o,height:i,x:s+za(t),y:a}}(t)):aa(e)?function(t){var e=da(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):Pa(function(t){var e,n=va(t),r=Ra(t),o=null==(e=t.ownerDocument)?void 0:e.body,i=ka(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=ka(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+za(t),c=-r.scrollTop;return"rtl"===fa(o||n).direction&&(a+=ka(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:c}}(va(t)))}function $a(t,e,n){var r="clippingParents"===e?function(t){var e=La(ga(t)),n=["absolute","fixed"].indexOf(fa(t).position)>=0&&aa(t)?ba(t):t;return sa(n)?e.filter((function(t){return sa(t)&&ha(t,n)&&"body"!==oa(t)})):[]}(t):[].concat(e),o=[].concat(r,[n]),i=o[0],s=o.reduce((function(e,n){var r=ja(t,n);return e.top=ka(r.top,e.top),e.right=xa(r.right,e.right),e.bottom=xa(r.bottom,e.bottom),e.left=ka(r.left,e.left),e}),ja(t,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Fa(t){return t.split("-")[1]}function Ha(t){var e,n=t.reference,r=t.element,o=t.placement,i=o?la(o):null,s=o?Fa(o):null,a=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(i){case Js:e={x:a,y:n.y-r.height};break;case Ws:e={x:a,y:n.y+n.height};break;case Us:e={x:n.x+n.width,y:c};break;case Ks:e={x:n.x-r.width,y:c};break;default:e={x:n.x,y:n.y}}var p=i?wa(i):null;if(null!=p){var l="y"===p?"height":"width";switch(s){case Ys:e[p]=e[p]-(n[l]/2-r[l]/2);break;case Qs:e[p]=e[p]+(n[l]/2-r[l]/2)}}return e}function qa(t,e){void 0===e&&(e={});var n=e,r=n.placement,o=void 0===r?t.placement:r,i=n.boundary,s=void 0===i?"clippingParents":i,a=n.rootBoundary,c=void 0===a?Zs:a,p=n.elementContext,l=void 0===p?ta:p,d=n.altBoundary,u=void 0!==d&&d,h=n.padding,f=void 0===h?0:h,m=Oa("number"!=typeof f?f:Ca(f,Xs)),v=l===ta?"reference":ta,g=t.elements.reference,y=t.rects.popper,b=t.elements[u?v:l],w=$a(sa(b)?b:b.contextElement||va(t.elements.popper),s,c),k=da(g),x=Ha({reference:k,element:y,strategy:"absolute",placement:o}),M=Pa(Object.assign({},y,x)),S=l===ta?M:k,O={top:w.top-S.top+m.top,bottom:S.bottom-w.bottom+m.bottom,left:w.left-S.left+m.left,right:S.right-w.right+m.right},C=t.modifiersData.offset;if(l===ta&&C){var N=C[o];Object.keys(O).forEach((function(t){var e=[Us,Ws].indexOf(t)>=0?1:-1,n=[Js,Ws].indexOf(t)>=0?"y":"x";O[t]+=N[n]*e}))}return O}function Ja(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Wa(t){return[Js,Us,Ws,Ks].some((function(e){return t[e]>=0}))}function Ua(t,e,n){void 0===n&&(n=!1);var r,o,i=va(e),s=da(t),a=aa(e),c={scrollLeft:0,scrollTop:0},p={x:0,y:0};return(a||!a&&!n)&&(("body"!==oa(e)||Ia(i))&&(c=(r=e)!==ia(r)&&aa(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:Ra(r)),aa(e)?((p=da(e)).x+=e.clientLeft,p.y+=e.clientTop):i&&(p.x=za(i))),{x:s.left+c.scrollLeft-p.x,y:s.top+c.scrollTop-p.y,width:s.width,height:s.height}}function Ka(t){var e=new Map,n=new Set,r=[];function o(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var r=e.get(t);r&&o(r)}})),r.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||o(t)})),r}var Ga={placement:"bottom",modifiers:[],strategy:"absolute"};function Xa(){for(var t=arguments.length,e=new Array(t),n=0;n=0?-1:1,i="function"==typeof n?n(Object.assign({},e,{placement:t})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Ks,Us].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,e.rects,i),t}),{}),a=s[e.placement],c=a.x,p=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=p),e.modifiersData[r]=s}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0===s||s,c=n.fallbackPlacements,p=n.padding,l=n.boundary,d=n.rootBoundary,u=n.altBoundary,h=n.flipVariations,f=void 0===h||h,m=n.allowedAutoPlacements,v=e.options.placement,g=la(v),y=c||(g===v||!f?[Aa(v)]:function(t){if(la(t)===Gs)return[];var e=Aa(t);return[Da(t),e,Da(e)]}(v)),b=[v].concat(y).reduce((function(t,n){return t.concat(la(n)===Gs?function(t,e){void 0===e&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,p=void 0===c?na:c,l=Fa(r),d=l?a?ea:ea.filter((function(t){return Fa(t)===l})):Xs,u=d.filter((function(t){return p.indexOf(t)>=0}));0===u.length&&(u=d);var h=u.reduce((function(e,n){return e[n]=qa(t,{placement:n,boundary:o,rootBoundary:i,padding:s})[la(n)],e}),{});return Object.keys(h).sort((function(t,e){return h[t]-h[e]}))}(e,{placement:n,boundary:l,rootBoundary:d,padding:p,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),w=e.rects.reference,k=e.rects.popper,x=new Map,M=!0,S=b[0],O=0;O=0,V=T?"width":"height",A=qa(e,{placement:C,boundary:l,rootBoundary:d,altBoundary:u,padding:p}),E=T?_?Us:Ks:_?Ws:Js;w[V]>k[V]&&(E=Aa(E));var D=Aa(E),R=[];if(i&&R.push(A[N]<=0),a&&R.push(A[E]<=0,A[D]<=0),R.every((function(t){return t}))){S=C,M=!1;break}x.set(C,R)}if(M)for(var z=function(t){var e=b.find((function(e){var n=x.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return S=e,"break"},I=f?3:1;I>0;I--){if("break"===z(I))break}e.placement!==S&&(e.modifiersData[r]._skip=!0,e.placement=S,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0!==s&&s,c=n.boundary,p=n.rootBoundary,l=n.altBoundary,d=n.padding,u=n.tether,h=void 0===u||u,f=n.tetherOffset,m=void 0===f?0:f,v=qa(e,{boundary:c,rootBoundary:p,padding:d,altBoundary:l}),g=la(e.placement),y=Fa(e.placement),b=!y,w=wa(g),k="x"===w?"y":"x",x=e.modifiersData.popperOffsets,M=e.rects.reference,S=e.rects.popper,O="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,C={x:0,y:0};if(x){if(i||a){var N="y"===w?Js:Ks,_="y"===w?Ws:Us,T="y"===w?"height":"width",V=x[w],A=x[w]+v[N],E=x[w]-v[_],D=h?-S[T]/2:0,R=y===Ys?M[T]:S[T],z=y===Ys?-S[T]:-M[T],I=e.elements.arrow,B=h&&I?ua(I):{width:0,height:0},L=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},P=L[N],j=L[_],$=Sa(0,M[T],B[T]),F=b?M[T]/2-D-$-P-O:R-$-P-O,H=b?-M[T]/2+D+$+j+O:z+$+j+O,q=e.elements.arrow&&ba(e.elements.arrow),J=q?"y"===w?q.clientTop||0:q.clientLeft||0:0,W=e.modifiersData.offset?e.modifiersData.offset[e.placement][w]:0,U=x[w]+F-W-J,K=x[w]+H-W;if(i){var G=Sa(h?xa(A,U):A,V,h?ka(E,K):E);x[w]=G,C[w]=G-V}if(a){var X="x"===w?Js:Ks,Y="x"===w?Ws:Us,Q=x[k],Z=Q+v[X],tt=Q-v[Y],et=Sa(h?xa(Z,U):Z,Q,h?ka(tt,K):tt);x[k]=et,C[k]=et-Q}}e.modifiersData[r]=C}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=la(n.placement),c=wa(a),p=[Ks,Us].indexOf(a)>=0?"height":"width";if(i&&s){var l=function(t,e){return Oa("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Ca(t,Xs))}(o.padding,n),d=ua(i),u="y"===c?Js:Ks,h="y"===c?Ws:Us,f=n.rects.reference[p]+n.rects.reference[c]-s[c]-n.rects.popper[p],m=s[c]-n.rects.reference[c],v=ba(i),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=f/2-m/2,b=l[u],w=g-d[p]-l[h],k=g/2-d[p]/2+y,x=Sa(b,k,w),M=c;n.modifiersData[r]=((e={})[M]=x,e.centerOffset=x-k,e)}},effect:function(t){var e=t.state,n=t.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=e.elements.popper.querySelector(r)))&&ha(e.elements.popper,r)&&(e.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=qa(e,{elementContext:"reference"}),a=qa(e,{altBoundary:!0}),c=Ja(s,r),p=Ja(a,o,i),l=Wa(c),d=Wa(p);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:p,isReferenceHidden:l,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":d})}}]}),Za="tippy-content",tc="tippy-arrow",ec="tippy-svg-arrow",nc={passive:!0,capture:!0};function rc(t,e,n){if(Array.isArray(t)){var r=t[e];return null==r?Array.isArray(n)?n[e]:n:r}return t}function oc(t,e){var n={}.toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function ic(t,e){return"function"==typeof t?t.apply(void 0,e):t}function sc(t,e){return 0===e?t:function(r){clearTimeout(n),n=setTimeout((function(){t(r)}),e)};var n}function ac(t){return[].concat(t)}function cc(t,e){-1===t.indexOf(e)&&t.push(e)}function pc(t){return[].slice.call(t)}function lc(){return document.createElement("div")}function dc(t){return["Element","Fragment"].some((function(e){return oc(t,e)}))}function uc(t){return dc(t)?[t]:function(t){return oc(t,"NodeList")}(t)?pc(t):Array.isArray(t)?t:pc(document.querySelectorAll(t))}function hc(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function fc(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function mc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[r](e,n)}))}var vc={isTouch:!1},gc=0;function yc(){vc.isTouch||(vc.isTouch=!0,window.performance&&document.addEventListener("mousemove",bc))}function bc(){var t=performance.now();t-gc<20&&(vc.isTouch=!1,document.removeEventListener("mousemove",bc)),gc=t}function wc(){var t,e=document.activeElement;if((t=e)&&t._tippy&&t._tippy.reference===t){var n=e._tippy;e.blur&&!n.state.isVisible&&e.blur()}}var kc="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",xc=/MSIE |Trident\//.test(kc),Mc=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},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Sc=Object.keys(Mc);function Oc(t){var e=(t.plugins||[]).reduce((function(e,n){var r=n.name,o=n.defaultValue;return r&&(e[r]=void 0!==t[r]?t[r]:o),e}),{});return Object.assign({},t,{},e)}function Cc(t,e){var n=Object.assign({},e,{content:ic(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(Oc(Object.assign({},Mc,{plugins:e}))):Sc).reduce((function(e,n){var r=(t.getAttribute("data-tippy-"+n)||"").trim();if(!r)return e;if("content"===n)e[n]=r;else try{e[n]=JSON.parse(r)}catch(o){e[n]=r}return e}),{})}(t,e.plugins));return n.aria=Object.assign({},Mc.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?e.interactive:n.aria.expanded,content:"auto"===n.aria.content?e.interactive?null:"describedby":n.aria.content},n}function Nc(t,e){t.innerHTML=e}function _c(t){var e=lc();return!0===t?e.className=tc:(e.className=ec,dc(t)?e.appendChild(t):Nc(e,t)),e}function Tc(t,e){dc(e.content)?(Nc(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Nc(t,e.content):t.textContent=e.content)}function Vc(t){var e=t.firstElementChild,n=pc(e.children);return{box:e,content:n.find((function(t){return t.classList.contains(Za)})),arrow:n.find((function(t){return t.classList.contains(tc)||t.classList.contains(ec)})),backdrop:n.find((function(t){return t.classList.contains("tippy-backdrop")}))}}function Ac(t){var e=lc(),n=lc();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=lc();function o(n,r){var o=Vc(e),i=o.box,s=o.content,a=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Tc(s,t.props),r.arrow?a?n.arrow!==r.arrow&&(i.removeChild(a),i.appendChild(_c(r.arrow))):i.appendChild(_c(r.arrow)):a&&i.removeChild(a)}return r.className=Za,r.setAttribute("data-state","hidden"),Tc(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props),{popper:e,onUpdate:o}}Ac.$$tippy=!0;var Ec=1,Dc=[],Rc=[];function zc(t,e){var n,r,o,i,s,a,c,p,l,d=Cc(t,Object.assign({},Mc,{},Oc((n=e,Object.keys(n).reduce((function(t,e){return void 0!==n[e]&&(t[e]=n[e]),t}),{}))))),u=!1,h=!1,f=!1,m=!1,v=[],g=sc(K,d.interactiveDebounce),y=Ec++,b=(l=d.plugins).filter((function(t,e){return l.indexOf(t)===e})),w={id:y,reference:t,popper:lc(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)},setProps:function(e){if(w.state.isDestroyed)return;R("onBeforeUpdate",[w,e]),W();var n=w.props,r=Cc(t,Object.assign({},w.props,{},e,{ignoreAttributes:!0}));w.props=r,J(),n.interactiveDebounce!==r.interactiveDebounce&&(B(),g=sc(K,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?ac(n.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):r.triggerTarget&&t.removeAttribute("aria-expanded");I(),D(),M&&M(n,r);w.popperInstance&&(Q(),tt().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})));R("onAfterUpdate",[w,e])},setContent:function(t){w.setProps({content:t})},show:function(){var t=w.state.isVisible,e=w.state.isDestroyed,n=!w.state.isEnabled,r=vc.isTouch&&!w.props.touch,o=rc(w.props.duration,0,Mc.duration);if(t||e||n||r)return;if(T().hasAttribute("disabled"))return;if(R("onShow",[w],!1),!1===w.props.onShow(w))return;w.state.isVisible=!0,_()&&(x.style.visibility="visible");D(),$(),w.state.isMounted||(x.style.transition="none");if(_()){var i=A(),s=i.box,a=i.content;hc([s,a],0)}c=function(){var t;if(w.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=w.props.moveTransition,_()&&w.props.animation){var e=A(),n=e.box,r=e.content;hc([n,r],o),fc([n,r],"visible")}z(),I(),cc(Rc,w),null==(t=w.popperInstance)||t.forceUpdate(),w.state.isMounted=!0,R("onMount",[w]),w.props.animation&&_()&&function(t,e){H(t,e)}(o,(function(){w.state.isShown=!0,R("onShown",[w])}))}},function(){var t,e=w.props.appendTo,n=T();t=w.props.interactive&&e===Mc.appendTo||"parent"===e?n.parentNode:ic(e,[n]);t.contains(x)||t.appendChild(x);Q()}()},hide:function(){var t=!w.state.isVisible,e=w.state.isDestroyed,n=!w.state.isEnabled,r=rc(w.props.duration,1,Mc.duration);if(t||e||n)return;if(R("onHide",[w],!1),!1===w.props.onHide(w))return;w.state.isVisible=!1,w.state.isShown=!1,m=!1,u=!1,_()&&(x.style.visibility="hidden");if(B(),F(),D(),_()){var o=A(),i=o.box,s=o.content;w.props.animation&&(hc([i,s],r),fc([i,s],"hidden"))}z(),I(),w.props.animation?_()&&function(t,e){H(t,(function(){!w.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&e()}))}(r,w.unmount):w.unmount()},hideWithInteractivity:function(t){V().addEventListener("mousemove",g),cc(Dc,g),g(t)},enable:function(){w.state.isEnabled=!0},disable:function(){w.hide(),w.state.isEnabled=!1},unmount:function(){w.state.isVisible&&w.hide();if(!w.state.isMounted)return;Z(),tt().forEach((function(t){t._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);Rc=Rc.filter((function(t){return t!==w})),w.state.isMounted=!1,R("onHidden",[w])},destroy:function(){if(w.state.isDestroyed)return;w.clearDelayTimeouts(),w.unmount(),W(),delete t._tippy,w.state.isDestroyed=!0,R("onDestroy",[w])}};if(!d.render)return w;var k=d.render(w),x=k.popper,M=k.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+w.id,w.popper=x,t._tippy=w,x._tippy=w;var S=b.map((function(t){return t.fn(w)})),O=t.hasAttribute("aria-expanded");return J(),I(),D(),R("onCreate",[w]),d.showOnCreate&&et(),x.addEventListener("mouseenter",(function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(t){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&(V().addEventListener("mousemove",g),g(t))})),w;function C(){var t=w.props.touch;return Array.isArray(t)?t:[t,0]}function N(){return"hold"===C()[0]}function _(){var t;return!!(null==(t=w.props.render)?void 0:t.$$tippy)}function T(){return p||t}function V(){var t,e,n=T().parentNode;return n?(null==(e=ac(n)[0])||null==(t=e.ownerDocument)?void 0:t.body)?e.ownerDocument:document:document}function A(){return Vc(x)}function E(t){return w.state.isMounted&&!w.state.isVisible||vc.isTouch||s&&"focus"===s.type?0:rc(w.props.delay,t?0:1,Mc.delay)}function D(){x.style.pointerEvents=w.props.interactive&&w.state.isVisible?"":"none",x.style.zIndex=""+w.props.zIndex}function R(t,e,n){var r;(void 0===n&&(n=!0),S.forEach((function(n){n[t]&&n[t].apply(void 0,e)})),n)&&(r=w.props)[t].apply(r,e)}function z(){var e=w.props.aria;if(e.content){var n="aria-"+e.content,r=x.id;ac(w.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(n);if(w.state.isVisible)t.setAttribute(n,e?e+" "+r:r);else{var o=e&&e.replace(r,"").trim();o?t.setAttribute(n,o):t.removeAttribute(n)}}))}}function I(){!O&&w.props.aria.expanded&&ac(w.props.triggerTarget||t).forEach((function(t){w.props.interactive?t.setAttribute("aria-expanded",w.state.isVisible&&t===T()?"true":"false"):t.removeAttribute("aria-expanded")}))}function B(){V().removeEventListener("mousemove",g),Dc=Dc.filter((function(t){return t!==g}))}function L(t){if(!(vc.isTouch&&(f||"mousedown"===t.type)||w.props.interactive&&x.contains(t.target))){if(T().contains(t.target)){if(vc.isTouch)return;if(w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[w,t]);!0===w.props.hideOnClick&&(w.clearDelayTimeouts(),w.hide(),h=!0,setTimeout((function(){h=!1})),w.state.isMounted||F())}}function P(){f=!0}function j(){f=!1}function $(){var t=V();t.addEventListener("mousedown",L,!0),t.addEventListener("touchend",L,nc),t.addEventListener("touchstart",j,nc),t.addEventListener("touchmove",P,nc)}function F(){var t=V();t.removeEventListener("mousedown",L,!0),t.removeEventListener("touchend",L,nc),t.removeEventListener("touchstart",j,nc),t.removeEventListener("touchmove",P,nc)}function H(t,e){var n=A().box;function r(t){t.target===n&&(mc(n,"remove",r),e())}if(0===t)return e();mc(n,"remove",a),mc(n,"add",r),a=r}function q(e,n,r){void 0===r&&(r=!1),ac(w.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,n,r),v.push({node:t,eventType:e,handler:n,options:r})}))}function J(){var t;N()&&(q("touchstart",U,{passive:!0}),q("touchend",G,{passive:!0})),(t=w.props.trigger,t.split(/\s+/).filter(Boolean)).forEach((function(t){if("manual"!==t)switch(q(t,U),t){case"mouseenter":q("mouseleave",G);break;case"focus":q(xc?"focusout":"blur",X);break;case"focusin":q("focusout",X)}}))}function W(){v.forEach((function(t){var e=t.node,n=t.eventType,r=t.handler,o=t.options;e.removeEventListener(n,r,o)})),v=[]}function U(t){var e,n=!1;if(w.state.isEnabled&&!Y(t)&&!h){var r="focus"===(null==(e=s)?void 0:e.type);s=t,p=t.currentTarget,I(),!w.state.isVisible&&oc(t,"MouseEvent")&&Dc.forEach((function(e){return e(t)})),"click"===t.type&&(w.props.trigger.indexOf("mouseenter")<0||u)&&!1!==w.props.hideOnClick&&w.state.isVisible?n=!0:et(t),"click"===t.type&&(u=!n),n&&!r&&nt(t)}}function K(t){var e=t.target,n=T().contains(e)||x.contains(e);"mousemove"===t.type&&n||function(t,e){var n=e.clientX,r=e.clientY;return t.every((function(t){var e=t.popperRect,o=t.popperState,i=t.props.interactiveBorder,s=o.placement.split("-")[0],a=o.modifiersData.offset;if(!a)return!0;var c="bottom"===s?a.top.y:0,p="top"===s?a.bottom.y:0,l="right"===s?a.left.x:0,d="left"===s?a.right.x:0,u=e.top-r+c>i,h=r-e.bottom-p>i,f=e.left-n+l>i,m=n-e.right-d>i;return u||h||f||m}))}(tt().concat(x).map((function(t){var e,n=null==(e=t._tippy.popperInstance)?void 0:e.state;return n?{popperRect:t.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean),t)&&(B(),nt(t))}function G(t){Y(t)||w.props.trigger.indexOf("click")>=0&&u||(w.props.interactive?w.hideWithInteractivity(t):nt(t))}function X(t){w.props.trigger.indexOf("focusin")<0&&t.target!==T()||w.props.interactive&&t.relatedTarget&&x.contains(t.relatedTarget)||nt(t)}function Y(t){return!!vc.isTouch&&N()!==t.type.indexOf("touch")>=0}function Q(){Z();var e=w.props,n=e.popperOptions,r=e.placement,o=e.offset,i=e.getReferenceClientRect,s=e.moveTransition,a=_()?Vc(x).arrow:null,p=i?{getBoundingClientRect:i,contextElement:i.contextElement||T()}:t,l=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(_()){var n=A().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?n.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?n.setAttribute("data-"+t,""):n.removeAttribute("data-"+t)})),e.attributes.popper={}}}}];_()&&a&&l.push({name:"arrow",options:{element:a,padding:3}}),l.push.apply(l,(null==n?void 0:n.modifiers)||[]),w.popperInstance=Qa(p,x,Object.assign({},n,{placement:r,onFirstUpdate:c,modifiers:l}))}function Z(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function tt(){return pc(x.querySelectorAll("[data-tippy-root]"))}function et(t){w.clearDelayTimeouts(),t&&R("onTrigger",[w,t]),$();var e=E(!0),n=C(),o=n[0],i=n[1];vc.isTouch&&"hold"===o&&i&&(e=i),e?r=setTimeout((function(){w.show()}),e):w.show()}function nt(t){if(w.clearDelayTimeouts(),R("onUntrigger",[w,t]),w.state.isVisible){if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&u)){var e=E(!1);e?o=setTimeout((function(){w.state.isVisible&&w.hide()}),e):i=requestAnimationFrame((function(){w.hide()}))}}else F()}}function Ic(t,e){void 0===e&&(e={});var n=Mc.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",yc,nc),window.addEventListener("blur",wc);var r=Object.assign({},e,{plugins:n}),o=uc(t).reduce((function(t,e){var n=e&&zc(e,r);return n&&t.push(n),t}),[]);return dc(t)?o[0]:o}Ic.defaultProps=Mc,Ic.setDefaultProps=function(t){Object.keys(t).forEach((function(e){Mc[e]=t[e]}))},Ic.currentInput=vc,Object.assign({},pa,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}}),Ic.setDefaultProps({render:Ac});class Bc{constructor({editor:t,element:e,view:n,tippyOptions:r}){this.preventHide=!1,this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:t})=>{var e;this.preventHide?this.preventHide=!1:(null==t?void 0:t.relatedTarget)&&(null===(e=this.element.parentNode)||void 0===e?void 0:e.contains(t.relatedTarget))||this.hide()},this.editor=t,this.element=e,this.view=n,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.createTooltip(r),this.element.style.visibility="visible"}createTooltip(t={}){this.tippy=Ic(this.view.dom,__spreadValues({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle"},t))}update(t,e){const{state:n,composing:r}=t,{doc:o,selection:i}=n,s=e&&e.doc.eq(o)&&e.selection.eq(i);if(r||s)return;const{empty:a,ranges:c}=i,p=Math.min(...c.map((t=>t.$from.pos))),l=Math.max(...c.map((t=>t.$to.pos))),d=!o.textBetween(p,l).length&&Hi(t.state.selection);a||d?this.hide():(this.tippy.setProps({getReferenceClientRect:()=>{if(Fi(e=t.state.selection)&&e instanceof ie){const e=t.nodeDOM(p);if(e)return e.getBoundingClientRect()}var e;return qs(t,p,l)}}),this.show())}show(){this.tippy.show()}hide(){this.tippy.hide()}destroy(){this.tippy.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 Lc=new Me("menuBubble"),Pc=t=>new we({key:Lc,view:e=>new Bc(__spreadValues({view:e},t))});Oi.create({name:"bubbleMenu",defaultOptions:{element:null,tippyOptions:{}},addProseMirrorPlugins(){return this.options.element?[Pc({editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions})]:[]}});class jc{constructor({editor:t,element:e,view:n,tippyOptions:r}){this.preventHide=!1,this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:t})=>{var e;this.preventHide?this.preventHide=!1:(null==t?void 0:t.relatedTarget)&&(null===(e=this.element.parentNode)||void 0===e?void 0:e.contains(t.relatedTarget))||this.hide()},this.editor=t,this.element=e,this.view=n,this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.createTooltip(r),this.element.style.visibility="visible"}createTooltip(t={}){this.tippy=Ic(this.view.dom,__spreadValues({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle"},t))}update(t,e){const{state:n,composing:r}=t,{doc:o,selection:i}=n,s=e&&e.doc.eq(o)&&e.selection.eq(i);if(r||s)return;const{$anchor:a,empty:c,from:p,to:l}=i,d=1===a.depth,u=!i.$anchor.parent.isLeaf&&!i.$anchor.parent.textContent;c&&(d&&u)?(this.tippy.setProps({getReferenceClientRect:()=>qs(t,p,l)}),this.show()):this.hide()}show(){this.tippy.show()}hide(){this.tippy.hide()}destroy(){this.tippy.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const $c=new Me("menuFloating"),Fc=t=>new we({key:$c,view:e=>new jc(__spreadValues({view:e},t))});Oi.create({name:"floatingMenu",defaultOptions:{element:null,tippyOptions:{}},addProseMirrorPlugins(){return this.options.element?[Fc({editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions})]:[]}});const Hc=t.defineComponent({name:"BubbleMenu",props:{editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})}},setup(e,{slots:n}){const r=t.ref(null);return t.onMounted((()=>{const{editor:t,tippyOptions:n}=e;t.registerPlugin(Pc({editor:t,element:r.value,tippyOptions:n}))})),t.onBeforeUnmount((()=>{const{editor:t}=e;t.unregisterPlugin(Lc)})),()=>{var e;return t.h("div",{ref:r},null===(e=n.default)||void 0===e?void 0:e.call(n))}}});class qc extends class extends class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach((t=>t.apply(this,e))),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter((t=>t!==e)):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}{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=function(t){const e=document.querySelector("style[data-tiptap-style]");if(null!==e)return e;const n=document.createElement("style");return n.setAttribute("data-tiptap-style",""),n.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(n),n}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}'))}setOptions(t={}){this.options=__spreadValues(__spreadValues({},this.options),t)}setEditable(t){this.setOptions({editable:t}),this.view&&this.state&&!this.isDestroyed&&this.view.updateState(this.state)}get isEditable(){return this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const n="function"==typeof e?e(t,this.state.plugins):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(t){if(this.isDestroyed)return;const e="string"==typeof t?`${t}$`:t.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((t=>!t.key.startsWith(e)))});this.view.updateState(n)}createExtensionManager(){const t=[...Object.entries(Ls).map((([,t])=>t)),...this.options.extensions].filter((t=>["extension","node","mark"].includes(null==t?void 0:t.type)));this.extensionManager=new xi(t,this)}createCommandManager(){this.commandManager=new ui(this,this.extensionManager.commands)}createSchema(){this.schema=this.extensionManager.schema}createView(){this.view=new lo(this.options.element,__spreadProps(__spreadValues({},this.options.editorProps),{dispatchTransaction:this.dispatchTransaction.bind(this),state:ve.create({doc:di(this.options.content,this.schema,this.options.parseOptions)})}));const t=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(t),this.createNodeViews();this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach((t=>{var e;return null===(e=this.capturedTransaction)||void 0===e?void 0:e.step(t)})):void(this.capturedTransaction=t);const e=this.state.apply(t),n=!this.state.selection.eq(e.selection);this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this});const r=t.getMeta("focus"),o=t.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event}),o&&this.emit("blur",{editor:this,event:o.event}),t.docChanged&&!t.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return function(t,e){const n=ei("string"==typeof e?e:e.name,t.schema);return"node"===n?ri(t,e):"mark"===n?ii(t,e):{}}(this.state,t)}getNodeAttributes(t){return console.warn("[tiptap warn]: editor.getNodeAttributes() is deprecated. please use editor.getAttributes() instead."),ri(this.state,t)}getMarkAttributes(t){return console.warn("[tiptap warn]: editor.getMarkAttributes() is deprecated. please use editor.getAttributes() instead."),ii(this.state,t)}isActive(t,e){const n="string"==typeof t?t:null,r="string"==typeof t?e:t;return function(t,e,n={}){if(!e)return ai(t,null,n)||ci(t,null,n);const r=ei(e,t.schema);return"node"===r?ai(t,e,n):"mark"===r&&ci(t,e,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(t,e){const n=mt.fromSchema(e).serializeFragment(t.content),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}(this.state.doc,this.schema)}get isEmpty(){return function(t){var e;const n=null===(e=t.type.createAndFill())||void 0===e?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}getCharacterCount(){return this.state.doc.content.size-2}destroy(){var t;this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners(),(t=this.css)&&t.parentNode&&t.parentNode.removeChild(t)}get isDestroyed(){var t;return!(null===(t=this.view)||void 0===t?void 0:t.docView)}}{constructor(e={}){var n;return super(e),this.vueRenderers=t.reactive(new Map),this.contentComponent=null,this.reactiveState=(n=this.view.state,t.customRef(((t,e)=>({get:()=>(t(),n),set(t){n=t,requestAnimationFrame((()=>{requestAnimationFrame((()=>{e()}))}))}})))),this.on("transaction",(()=>{this.reactiveState.value=this.view.state})),t.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}registerPlugin(t,e){super.registerPlugin(t,e),this.reactiveState.value=this.view.state}unregisterPlugin(t){super.unregisterPlugin(t),this.reactiveState.value=this.view.state}}const Jc=t.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const n=t.ref(),r=t.getCurrentInstance();return t.watchEffect((()=>{const o=e.editor;o&&o.options.element&&n.value&&t.nextTick((()=>{if(!n.value||!o.options.element.firstChild)return;const e=t.unref(n.value);n.value.append(...o.options.element.childNodes),o.contentComponent=r.ctx._,o.setOptions({element:e}),o.createNodeViews()}))})),t.onBeforeUnmount((()=>{const t=e.editor;if(!t)return;if(t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild)return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})})),{rootEl:n}},render(){const e=[];return this.editor&&this.editor.vueRenderers.forEach((n=>{const r=t.h(t.Teleport,{to:n.teleportElement,key:n.id},t.h(n.component,__spreadValues({ref:n.id},n.props)));e.push(r)})),t.h("div",{ref:t=>{this.rootEl=t}},...e)}});t.defineComponent({name:"FloatingMenu",props:{editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})}},setup(e,{slots:n}){const r=t.ref(null);return t.onMounted((()=>{const{editor:t,tippyOptions:n}=e;t.registerPlugin(Fc({editor:t,element:r.value,tippyOptions:n}))})),t.onBeforeUnmount((()=>{const{editor:t}=e;t.unregisterPlugin($c)})),()=>{var e;return t.h("div",{ref:r},null===(e=n.default)||void 0===e?void 0:e.call(n))}}}),t.defineComponent({props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var e,n;return t.h(this.as,{class:this.decorationClasses.value,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragStart:this.onDragStart},null===(n=(e=this.$slots).default)||void 0===n?void 0:n.call(e))}}),t.defineComponent({props:{as:{type:String,default:"div"}},render(){return t.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}});const Wc=/^```(?[a-z]*)? $/,Uc=/^~~~(?[a-z]*)? $/,Kc=Ps.create({name:"codeBlock",defaultOptions:{languageClassPrefix:"language-",HTMLAttributes:{}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const n=null===(e=t.firstElementChild)||void 0===e?void 0:e.getAttribute("class");if(!n)return null;const r=new RegExp(`^(${this.options.languageClassPrefix})`);return{language:n.replace(r,"")}},renderHTML:t=>t.language?{class:this.options.languageClassPrefix+t.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:t}){return["pre",this.options.HTMLAttributes,["code",t,0]]},addCommands:()=>({setCodeBlock:t=>({commands:e})=>e.setNode("codeBlock",t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode("codeBlock","paragraph",t)}),addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=1===e.pos;return!(!t||e.parent.type.name!==this.name)&&(!(!n&&e.parent.textContent.length)&&this.editor.commands.clearNodes())}}},addInputRules(){return[Ro(Wc,this.type,(({groups:t})=>t)),Ro(Uc,this.type,(({groups:t})=>t))]}}),Gc=js.create({name:"underline",defaultOptions:{HTMLAttributes:{}},parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("underline")&&{}}],renderHTML({HTMLAttributes:t}){return["u",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({setUnderline:()=>({commands:t})=>t.setMark("underline"),toggleUnderline:()=>({commands:t})=>t.toggleMark("underline"),unsetUnderline:()=>({commands:t})=>t.unsetMark("underline")}),addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline()}}});function Xc(t,e,n){for(var r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;var o=t.child(r),i=e.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(var s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){var a=Xc(o.content,i.content,n+1);if(null!=a)return a}n+=o.nodeSize}else n+=o.nodeSize}}function Yc(t,e,n,r){for(var o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};var s=t.child(--o),a=e.child(--i),c=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){for(var p=0,l=Math.min(s.text.length,a.text.length);pt&&!1!==n(a,r+s,o,i)&&a.content.size){var p=s+1;a.nodesBetween(Math.max(0,t-p),Math.min(a.content.size,e-p),n,r+p)}s=c}},Qc.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},Qc.prototype.textBetween=function(t,e,n,r){var o="",i=!0;return this.nodesBetween(t,e,(function(s,a){s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf&&r?(o+=r,i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o},Qc.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);ot)for(var o=0,i=0;it&&((ie)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),n.push(s),r+=s.nodeSize),i=a}return new Qc(n,r)},Qc.prototype.cutByIndex=function(t,e){return t==e?Qc.empty:0==t&&e==this.content.length?this:new Qc(this.content.slice(t,e))},Qc.prototype.replaceChild=function(t,e){var n=this.content[t];if(n==e)return this;var r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new Qc(r,o)},Qc.prototype.addToStart=function(t){return new Qc([t].concat(this.content),this.size+t.nodeSize)},Qc.prototype.addToEnd=function(t){return new Qc(this.content.concat(t),this.size+t.nodeSize)},Qc.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;ethis.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?ep(n+1,o):ep(n,r);r=o}},Qc.prototype.toString=function(){return"<"+this.toStringInner()+">"},Qc.prototype.toStringInner=function(){return this.content.join(", ")},Qc.prototype.toJSON=function(){return this.content.length?this.content.map((function(t){return t.toJSON()})):null},Qc.fromJSON=function(t,e){if(!e)return Qc.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new Qc(e.map(t.nodeFromJSON))},Qc.fromArray=function(t){if(!t.length)return Qc.empty;for(var e,n=0,r=0;rthis.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e},rp.prototype.removeFromSet=function(t){for(var e=0;et.depth)throw new op("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new op("Inconsistent open depths");return lp(t,e,n,0)}function lp(t,e,n,r){var o=t.index(r),i=t.node(r);if(o==e.index(r)&&r=0;o--)r=e.node(o).copy(Qc.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return mp(i,vp(t,a.start,a.end,e,r))}var c=t.parent,p=c.content;return mp(c,p.cut(0,t.parentOffset).append(n.content).append(p.cut(e.parentOffset)))}return mp(i,gp(t,e,r))}function dp(t,e){if(!e.type.compatibleContent(t.type))throw new op("Cannot join "+e.type.name+" onto "+t.type.name)}function up(t,e,n){var r=t.node(n);return dp(r,e.node(n)),r}function hp(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function fp(t,e,n,r){var o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(hp(t.nodeAfter,r),i++));for(var a=i;ao&&up(t,e,o+1),s=r.depth>o&&up(n,r,o+1),a=[];return fp(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(dp(i,s),hp(mp(i,vp(t,e,n,r,o+1)),a)):(i&&hp(mp(i,gp(t,e,o+1)),a),fp(e,n,o,a),s&&hp(mp(s,gp(n,r,o+1)),a)),fp(r,null,o,a),new Qc(a)}function gp(t,e,n){var r=[];(fp(null,t,n,r),t.depth>n)&&hp(mp(up(t,e,n+1),gp(t,e,n+1)),r);return fp(e,null,n,r),new Qc(r)}sp.size.get=function(){return this.content.size-this.openStart-this.openEnd},ip.prototype.insertAt=function(t,e){var n=cp(this.content,t+this.openStart,e,null);return n&&new ip(n,this.openStart,this.openEnd)},ip.prototype.removeBetween=function(t,e){return new ip(ap(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)},ip.prototype.eq=function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd},ip.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},ip.prototype.toJSON=function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},ip.fromJSON=function(t,e){if(!e)return ip.empty;var n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new ip(Qc.fromJSON(t,e.content),n,r)},ip.maxOpen=function(t,e){void 0===e&&(e=!0);for(var n=0,r=0,o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new ip(t,n,r)},Object.defineProperties(ip.prototype,sp),ip.empty=new ip(Qc.empty,0,0);var yp=function(t,e,n){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=n},bp={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};yp.prototype.resolveDepth=function(t){return null==t?this.depth:t<0?this.depth+t:t},bp.parent.get=function(){return this.node(this.depth)},bp.doc.get=function(){return this.node(0)},yp.prototype.node=function(t){return this.path[3*this.resolveDepth(t)]},yp.prototype.index=function(t){return this.path[3*this.resolveDepth(t)+1]},yp.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)},yp.prototype.start=function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1},yp.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},yp.prototype.before=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]},yp.prototype.after=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize},bp.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},bp.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r},bp.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)},yp.prototype.posAtIndex=function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1,o=0;o0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},yp.prototype.blockRange=function(t,e){if(void 0===t&&(t=this),t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new Mp(this,t,n)},yp.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},yp.prototype.max=function(t){return t.pos>this.pos?t:this},yp.prototype.min=function(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var n=[],r=0,o=e,i=t;;){var s=i.content.findIndex(o),a=s.index,c=s.offset,p=o-c;if(n.push(i,a,r+c),!p)break;if((i=i.child(a)).isText)break;o=p-1,r+=c+1}return new yp(e,n,o)},yp.resolveCached=function(t,e){for(var n=0;nt&&this.nodesBetween(t,e,(function(t){return n.isInSet(t.marks)&&(r=!0),!r})),r},Np.isBlock.get=function(){return this.type.isBlock},Np.isTextblock.get=function(){return this.type.isTextblock},Np.inlineContent.get=function(){return this.type.inlineContent},Np.isInline.get=function(){return this.type.isInline},Np.isText.get=function(){return this.type.isText},Np.isLeaf.get=function(){return this.type.isLeaf},Np.isAtom.get=function(){return this.type.isAtom},Cp.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()+")"),function(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}(this.marks,t)},Cp.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},Cp.prototype.canReplace=function(t,e,n,r,o){void 0===n&&(n=Qc.empty),void 0===r&&(r=0),void 0===o&&(o=n.childCount);var i=this.contentMatchAt(t).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(var a=r;a-1&&o[i+1];Lp(t,r).forEach((function(t){s||o.push(n,s=[]),-1==s.indexOf(t)&&s.push(t)}))}}))}));for(var i=e[r.join(",")]=new _p(r.indexOf(t.length-1)>-1),s=0;s>1},_p.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},_p.prototype.toString=function(){var t=[];return function e(n){t.push(n);for(var r=1;r"+t.indexOf(e.next[o+1]);return r})).join("\n")},Object.defineProperties(_p.prototype,Tp),_p.empty=new _p(!0);var Vp=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},Ap={next:{configurable:!0}};function Ep(t){var e=[];do{e.push(Dp(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function Dp(t){var e=[];do{e.push(Rp(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function Rp(t){for(var e=function(t){if(t.eat("(")){var e=Ep(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){var n=function(t,e){var n=t.nodeTypes,r=n[e];if(r)return[r];var o=[];for(var i in n){var s=n[i];s.groups.indexOf(e)>-1&&o.push(s)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((function(e){return null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}}));return t.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}t.err("Unexpected token '"+t.next+"'")}(t);;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=Ip(t,e)}return e}function zp(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function Ip(t,e){var n=zp(t),r=n;return t.eat(",")&&(r="}"!=t.next?zp(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Bp(t,e){return e-t}function Lp(t,e){var n=[];return function e(r){var o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(var i=0;i-1},Fp.prototype.allowsMarks=function(t){if(null==this.markSet)return!0;for(var e=0;e-1};var Up=function(t,e){var n=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((function(t){t.tag?n.tags.push(t):t.style&&n.styles.push(t)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))};Up.prototype.parse=function(t,e){void 0===e&&(e={});var n=new Zp(this,e,!1);return n.addAll(t,null,e.from,e.to),n.finish()},Up.prototype.parseSlice=function(t,e){void 0===e&&(e={});var n=new Zp(this,e,!0);return n.addAll(t,null,e.from,e.to),ip.maxOpen(n.finish())},Up.prototype.matchTag=function(t,e,n){for(var r=n?this.tags.indexOf(n)+1:0;rt.length&&(61!=i.style.charCodeAt(t.length)||i.style.slice(t.length+1)!=e))){if(i.getAttrs){var s=i.getAttrs(e);if(!1===s)continue;i.attrs=s}return i}}},Up.schemaRules=function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,r=0;r=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]},Qp.prototype.applyPending=function(t){for(var e=0,n=this.pendingMarks;e=0;r--){var o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(var s=0;sthis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},Zp.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},Zp.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return void(this.open=e)},tl.currentPos.get=function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t},Zp.prototype.findAtPoint=function(t,e){if(this.find)for(var n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=function(t,a){for(;t>=0;t--){var c=n[t];if(""==c){if(t==n.length-1||0==t)continue;for(;a>=i;a--)if(s(t-1,a))return!0;return!1}var p=a>0||0==a&&o?e.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!p||p.name!=c&&-1==p.groups.indexOf(c))return!1;a--}return!0};return s(n.length-1,this.open)},Zp.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},Zp.prototype.addPendingMark=function(t){var e=function(t,e){for(var n=0;n=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);var o=r.popFromStashMark(t);o&&r.type&&r.type.allowsMarkType(o.type)&&(r.activeMarks=o.addToSet(r.activeMarks))}if(r==e)break}},Object.defineProperties(Zp.prototype,tl);var ol=function(t,e){this.nodes=t||{},this.marks=e||{}};function il(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function sl(t){return t.document||window.document}ol.prototype.serializeFragment=function(t,e,n){var r=this;void 0===e&&(e={}),n||(n=sl(e).createDocumentFragment());var o=n,i=null;return t.forEach((function(t){if(i||t.marks.length){i||(i=[]);for(var n=0,s=0;n=0;r--){var o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},ol.prototype.serializeMark=function(t,e,n){void 0===n&&(n={});var r=this.marks[t.type.name];return r&&ol.renderSpec(sl(n),r(t,e))},ol.renderSpec=function(t,e,n){if(void 0===n&&(n=null),"string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;var r=e[0],o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));var i=null,s=n?t.createElementNS(n,r):t.createElement(r),a=e[1],c=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a))for(var p in c=2,a)if(null!=a[p]){var l=p.indexOf(" ");l>0?s.setAttributeNS(p.slice(0,l),p.slice(l+1),a[p]):s.setAttribute(p,a[p])}for(var d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var h=ol.renderSpec(t,u,n),f=h.dom,m=h.contentDOM;if(s.appendChild(f),m){if(i)throw new RangeError("Multiple content holes");i=m}}return{dom:s,contentDOM:i}},ol.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new ol(this.nodesFromSchema(t),this.marksFromSchema(t)))},ol.nodesFromSchema=function(t){var e=il(t.nodes);return e.text||(e.text=function(t){return t.text}),e},ol.marksFromSchema=function(t){return il(t.marks)};var al=Math.pow(2,16);function cl(t){return 65535&t}var pl=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.pos=t,this.deleted=e,this.recover=n},ll=function(t,e){void 0===e&&(e=!1),this.ranges=t,this.inverted=e};ll.prototype.recover=function(t){var e=0,n=cl(t);if(!this.inverted)for(var r=0;rt)break;var c=this.ranges[s+o],p=this.ranges[s+i],l=a+c;if(t<=l){var d=a+r+((c?t==a?-1:t==l?1:e:e)<0?0:p);if(n)return d;var u=t==(e<0?a:l)?null:s/3+(t-a)*al;return new pl(d,e<0?t!=a:t!=l,u)}r+=p-c}return n?t+r:new pl(t+r)},ll.prototype.touches=function(t,e){for(var n=0,r=cl(e),o=this.inverted?2:1,i=this.inverted?1:2,s=0;st)break;var c=this.ranges[s+o];if(t<=a+c&&s==3*r)return!0;n+=this.ranges[s+i]-c}return!1},ll.prototype.forEach=function(t){for(var e=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r=0;e--){var r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:null)}},dl.prototype.invert=function(){var t=new dl;return t.appendMappingInverted(this),t},dl.prototype.map=function(t,e){if(void 0===e&&(e=1),this.mirror)return this._map(t,e,!0);for(var n=this.from;no&&s0},hl.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(hl.prototype,fl);var vl=Object.create(null),gl=function(){};gl.prototype.apply=function(t){return ml()},gl.prototype.getMap=function(){return ll.empty},gl.prototype.invert=function(t){return ml()},gl.prototype.map=function(t){return ml()},gl.prototype.merge=function(t){return null},gl.prototype.toJSON=function(){return ml()},gl.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=vl[e.stepType];if(!n)throw new RangeError("No step type "+e.stepType+" defined");return n.fromJSON(t,e)},gl.jsonID=function(t,e){if(t in vl)throw new RangeError("Duplicate use of step JSON ID "+t);return vl[t]=e,e.prototype.jsonID=t,e};var yl=function(t,e){this.doc=t,this.failed=e};yl.ok=function(t){return new yl(t,null)},yl.fail=function(t){return new yl(null,t)},yl.fromReplace=function(t,e,n,r){try{return yl.ok(t.replace(e,n,r))}catch(o){if(o instanceof op)return yl.fail(o.message);throw o}};var bl=function(t){function e(e,n,r,o){t.call(this),this.from=e,this.to=n,this.slice=r,this.structure=!!o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){return this.structure&&kl(t,this.from,this.to)?yl.fail("Structure replace would overwrite content"):yl.fromReplace(t,this.from,this.to,this.slice)},e.prototype.getMap=function(){return new ll([this.from,this.to-this.from,this.slice.size])},e.prototype.invert=function(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)},e.prototype.merge=function(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var n=this.slice.size+t.slice.size==0?ip.empty:new ip(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}var r=this.slice.size+t.slice.size==0?ip.empty:new ip(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),r,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,ip.fromJSON(t,n.slice),!!n.structure)},e}(gl);gl.jsonID("replace",bl);var wl=function(t){function e(e,n,r,o,i,s,a){t.call(this),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=!!a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){if(this.structure&&(kl(t,this.from,this.gapFrom)||kl(t,this.gapTo,this.to)))return yl.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return yl.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?yl.fromReplace(t,this.from,this.to,n):yl.fail("Content does not fit in gap")},e.prototype.getMap=function(){return new ll([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},e.prototype.invert=function(t){var n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deleted&&r.deleted||or.pos?null:new e(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,ip.fromJSON(t,n.slice),n.insert,!!n.structure)},e}(gl);function kl(t,e,n){for(var r=t.resolve(e),o=n-e,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function xl(t,e,n){for(var r=[],o=0;oe;d--)u||n.index(d)>0?(u=!0,p=Qc.from(n.node(d).copy(p)),l++):a--;for(var h=Qc.empty,f=0,m=o,v=!1;m>e;m--)v||r.after(m+1)=0;r--)n=Qc.from(e[r].type.create(e[r].attrs,n));var o=t.start,i=t.end;return this.step(new wl(o,i,o,i,new ip(n,0,0),e.length,!0))},hl.prototype.setBlockType=function(t,e,n,r){var o=this;if(void 0===e&&(e=t),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=this.steps.length;return this.doc.nodesBetween(t,e,(function(t,e){if(t.isTextblock&&!t.hasMarkup(n,r)&&function(t,e,n){var r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(o.doc,o.mapping.slice(i).map(e),n)){o.clearIncompatible(o.mapping.slice(i).map(e,1),n);var s=o.mapping.slice(i),a=s.map(e,1),c=s.map(e+t.nodeSize,1);return o.step(new wl(a,c,a+1,c-1,new ip(Qc.from(n.create(r,null,t.marks)),0,0),1,!0)),!1}})),this},hl.prototype.setNodeMarkup=function(t,e,n,r){var o=this.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");e||(e=o.type);var i=e.create(n,null,r||o.marks);if(o.isLeaf)return this.replaceWith(t,t+o.nodeSize,i);if(!e.validContent(o.content))throw new RangeError("Invalid content for node type "+e.name);return this.step(new wl(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new ip(Qc.from(i),0,0),1,!0))},hl.prototype.split=function(t,e,n){void 0===e&&(e=1);for(var r=this.doc.resolve(t),o=Qc.empty,i=Qc.empty,s=r.depth,a=r.depth-e,c=e-1;s>a;s--,c--){o=Qc.from(r.node(s).copy(o));var p=n&&n[c];i=Qc.from(p?p.type.create(p.attrs,i):r.node(s).copy(i))}return this.step(new bl(t,t,new ip(o.append(i),e,e),!0))},hl.prototype.join=function(t,e){void 0===e&&(e=1);var n=new bl(t-e,t+e,ip.empty,!0);return this.step(n)};var Ml=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=t.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new ip(xl(n.content,(function(t,n){return t.isAtom&&n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t}),o),n.openStart,n.openEnd);return yl.fromReplace(t,this.from,this.to,i)},e.prototype.invert=function(){return new Sl(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(gl);gl.jsonID("addMark",Ml);var Sl=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=new ip(xl(n.content,(function(t){return t.mark(e.mark.removeFromSet(t.marks))})),n.openStart,n.openEnd);return yl.fromReplace(t,this.from,this.to,r)},e.prototype.invert=function(){return new Ml(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(gl);function Ol(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}gl.jsonID("removeMark",Sl),hl.prototype.addMark=function(t,e,n){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(t,e,(function(r,c,p){if(r.isInline){var l=r.marks;if(!n.isInSet(l)&&p.type.allowsMarkType(n.type)){for(var d=Math.max(c,t),u=Math.min(c+r.nodeSize,e),h=n.addToSet(l),f=0;f=0;u--)this.step(o[u]);return this},hl.prototype.replace=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=ip.empty);var r=function(t,e,n,r){if(void 0===n&&(n=e),void 0===r&&(r=ip.empty),e==n&&!r.size)return null;var o=t.resolve(e),i=t.resolve(n);return Ol(o,i,r)?new bl(e,n,r):new Cl(o,i,r).fit()}(this.doc,t,e,n);return r&&this.step(r),this},hl.prototype.replaceWith=function(t,e,n){return this.replace(t,e,new ip(Qc.from(n),0,0))},hl.prototype.delete=function(t,e){return this.replace(t,e,ip.empty)},hl.prototype.insert=function(t,e){return this.replaceWith(t,t,e)};var Cl=function(t,e,n){this.$to=e,this.$from=t,this.unplaced=n,this.frontier=[];for(var r=0;r<=t.depth;r++){var o=t.node(r);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(r))})}this.placed=Qc.empty;for(var i=t.depth;i>0;i--)this.placed=Qc.from(t.node(i).copy(this.placed))},Nl={depth:{configurable:!0}};function _l(t,e,n){return 0==e?t.cutByIndex(n):t.replaceChild(0,t.firstChild.copy(_l(t.firstChild.content,e-1,n)))}function Tl(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Tl(t.lastChild.content,e-1,n)))}function Vl(t,e){for(var n=0;n1&&(r=r.replaceChild(0,Al(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(Qc.empty,!0)))),t.copy(r)}function El(t,e,n,r,o){var i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;var a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(var r=n;rr){var s=o.contentMatchAt(0),a=s.fillBefore(t).append(t);t=a.append(s.matchFragment(a).fillBefore(Qc.empty,!0))}return t}function Rl(t,e){for(var n=[],r=Math.min(t.depth,e.depth);r>=0;r--){var o=t.start(r);if(oe.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;o==e.start(r)&&n.push(r)}return n}Nl.depth.get=function(){return this.frontier.length-1},Cl.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;for(var i=this.placed,s=r.depth,a=o.depth;s&&a&&1==i.childCount;)i=i.firstChild.content,s--,a--;var c=new ip(i,s,a);return e>-1?new wl(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new bl(r.pos,o.pos,c):void 0},Cl.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var e=this.unplaced.openStart;e>=0;e--)for(var n=void 0,r=(e?(n=Vl(this.unplaced.content,e-1).firstChild).content:this.unplaced.content).firstChild,o=this.depth;o>=0;o--){var i=this.frontier[o],s=i.type,a=i.match,c=void 0,p=void 0;if(1==t&&(r?a.matchType(r.type)||(p=a.fillBefore(Qc.from(r),!1)):s.compatibleContent(n.type)))return{sliceDepth:e,frontierDepth:o,parent:n,inject:p};if(2==t&&r&&(c=a.findWrapping(r.type)))return{sliceDepth:e,frontierDepth:o,parent:n,wrap:c};if(n&&a.matchType(n.type))break}},Cl.prototype.openMore=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,o=Vl(e,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new ip(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)},Cl.prototype.dropNode=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,o=Vl(e,n);if(o.childCount<=1&&n>0){var i=e.size-n<=n+o.size;this.unplaced=new ip(_l(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new ip(_l(e,n,1),n,r)},Cl.prototype.placeNodes=function(t){for(var e=t.sliceDepth,n=t.frontierDepth,r=t.parent,o=t.inject,i=t.wrap;this.depth>n;)this.closeFrontierNode();if(i)for(var s=0;s1||0==p||g.content.size)&&(h=y,d.push(Al(g.mark(f.allowedMarks(g.marks)),1==l?p:0,l==c.childCount?v:-1)))}var b=l==c.childCount;b||(v=-1),this.placed=Tl(this.placed,n,Qc.from(d)),this.frontier[n].match=h,b&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var w=0,k=c;w1&&r==this.$to.end(--n);)++r;return r},Cl.prototype.findCloseLevel=function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],r=n.match,o=n.type,i=e=0;a--){var c=this.frontier[a],p=c.match,l=El(t,a,c.type,p,!0);if(!l||l.childCount)continue t}return{depth:e,fit:s,move:i?t.doc.resolve(t.after(e+1)):t}}}},Cl.prototype.close=function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Tl(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;n++){var r=t.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,o)}return t},Cl.prototype.openFrontierNode=function(t,e,n){var r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Tl(this.placed,this.depth,Qc.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})},Cl.prototype.closeFrontierNode=function(){var t=this.frontier.pop().match.fillBefore(Qc.empty,!0);t.childCount&&(this.placed=Tl(this.placed,this.frontier.length,t))},Object.defineProperties(Cl.prototype,Nl),hl.prototype.replaceRange=function(t,e,n){if(!n.size)return this.deleteRange(t,e);var r=this.doc.resolve(t),o=this.doc.resolve(e);if(Ol(r,o,n))return this.step(new bl(t,e,n));var i=Rl(r,this.doc.resolve(e));0==i[i.length-1]&&i.pop();var s=-(r.depth+1);i.unshift(s);for(var a=r.depth,c=r.pos-1;a>0;a--,c--){var p=r.node(a).type.spec;if(p.defining||p.isolating)break;i.indexOf(a)>-1?s=a:r.before(a)==c&&i.splice(1,0,-a)}for(var l=i.indexOf(s),d=[],u=n.openStart,h=n.content,f=0;;f++){var m=h.firstChild;if(d.push(m),f==n.openStart)break;h=m.content}u>0&&d[u-1].type.spec.defining&&r.node(l).type!=d[u-1].type?u-=1:u>=2&&d[u-1].isTextblock&&d[u-2].type.spec.defining&&r.node(l).type!=d[u-2].type&&(u-=2);for(var v=n.openStart;v>=0;v--){var g=(v+u+1)%(n.openStart+1),y=d[g];if(y)for(var b=0;b=0&&(this.replace(t,e,n),!(this.steps.length>S));O--){var C=i[O];C<0||(t=r.before(C),e=o.after(C))}return this},hl.prototype.replaceRangeWith=function(t,e,n){if(!n.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var r=function(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,n))return r.after(s+1);if(a0&&(a||n.node(s-1).canReplace(n.index(s-1),r.indexAfter(s-1))))return this.delete(n.before(s),r.after(s))}for(var c=1;c<=n.depth&&c<=r.depth;c++)if(t-n.start(c)==n.depth-c&&e>n.end(c)&&r.end(c)-e!=r.depth-c)return this.delete(n.before(c),e);return this.delete(t,e)};var zl=Object.create(null),Il=function(t,e,n){this.ranges=n||[new Ll(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},Bl={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};Bl.anchor.get=function(){return this.$anchor.pos},Bl.head.get=function(){return this.$head.pos},Bl.from.get=function(){return this.$from.pos},Bl.to.get=function(){return this.$to.pos},Bl.$from.get=function(){return this.ranges[0].$from},Bl.$to.get=function(){return this.ranges[0].$to},Bl.empty.get=function(){for(var t=this.ranges,e=0;e=0;o--){var i=e<0?Jl(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):Jl(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(i)return i}},Il.near=function(t,e){return void 0===e&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new Hl(t.node(0))},Il.atStart=function(t){return Jl(t,t,0,0,1)||new Hl(t)},Il.atEnd=function(t){return Jl(t,t,t.content.size,t.childCount,-1)||new Hl(t)},Il.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=zl[e.type];if(!n)throw new RangeError("No selection type "+e.type+" defined");return n.fromJSON(t,e)},Il.jsonID=function(t,e){if(t in zl)throw new RangeError("Duplicate use of selection JSON ID "+t);return zl[t]=e,e.prototype.jsonID=t,e},Il.prototype.getBookmark=function(){return Pl.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(Il.prototype,Bl),Il.prototype.visible=!0;var Ll=function(t,e){this.$from=t,this.$to=e},Pl=function(t){function e(e,n){void 0===n&&(n=e),t.call(this,e,n)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return t.near(o);var i=n.resolve(r.map(this.anchor));return new e(i.parent.inlineContent?i:o,o)},e.prototype.replace=function(e,n){if(void 0===n&&(n=ip.empty),t.prototype.replace.call(this,e,n),n==ip.empty){var r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head},e.prototype.getBookmark=function(){return new jl(this.anchor,this.head)},e.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,e,n){void 0===n&&(n=e);var r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))},e.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var s=t.findFrom(r,o,!0)||t.findFrom(r,-o,!0);if(!s)return t.near(r,o);r=s.$head}return n.parent.inlineContent||(0==i||(n=(t.findFrom(n,-o,!0)||t.findFrom(n,o,!0)).$anchor).pos0?0:1);o>0?s=0;s+=o){var a=e.child(s);if(a.isAtom){if(!i&&$l.isSelectable(a))return $l.create(t,n-(o<0?a.nodeSize:0))}else{var c=Jl(t,a,n+o,o<0?a.childCount:0,o,i);if(c)return c}n+=a.nodeSize*o}}function Wl(t,e,n){var r=t.steps.length-1;if(!(r0},e.prototype.setStoredMarks=function(t){return this.storedMarks=t,this.updated|=2,this},e.prototype.ensureMarks=function(t){return rp.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this},e.prototype.addStoredMark=function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))},e.prototype.removeStoredMark=function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},e.prototype.addStep=function(e,n){t.prototype.addStep.call(this,e,n),this.updated=-3&this.updated,this.storedMarks=null},e.prototype.setTime=function(t){return this.time=t,this},e.prototype.replaceSelection=function(t){return this.selection.replace(this,t),this},e.prototype.replaceSelectionWith=function(t,e){var n=this.selection;return!1!==e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||rp.none))),n.replaceWith(this,t),this},e.prototype.deleteSelection=function(){return this.selection.replace(this),this},e.prototype.insertText=function(t,e,n){void 0===n&&(n=e);var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(!t)return this.deleteRange(e,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(e);o=n==e?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.setSelection(Il.near(this.selection.$to)),this},e.prototype.setMeta=function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this},e.prototype.getMeta=function(t){return this.meta["string"==typeof t?t:t.key]},n.isGeneric.get=function(){for(var t in this.meta)return!1;return!0},e.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(e.prototype,n),e}(hl);function Kl(t,e){return e&&t?t.bind(e):t}var Gl=function(t,e,n){this.name=t,this.init=Kl(e.init,n),this.apply=Kl(e.apply,n)},Xl=[new Gl("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new Gl("selection",{init:function(t,e){return t.selection||Il.atStart(e.doc)},apply:function(t){return t.selection}}),new Gl("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Gl("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],Yl=function(t,e){var n=this;this.schema=t,this.fields=Xl.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach((function(t){if(n.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");n.plugins.push(t),n.pluginsByKey[t.key]=t,t.spec.state&&n.fields.push(new Gl(t.key,t.spec.state,t))}))},Ql=function(t){this.config=t},Zl={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};Zl.schema.get=function(){return this.config.schema},Zl.plugins.get=function(){return this.config.plugins},Ql.prototype.apply=function(t){return this.applyTransaction(t).state},Ql.prototype.filterTransaction=function(t,e){void 0===e&&(e=-1);for(var n=0;n-1&&td.splice(e,1)},Object.defineProperties(Ql.prototype,Zl);var td=[];function ed(t,e,n){for(var r in t){var o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=ed(o,e,{})),n[r]=o}return n}var nd=function(t){this.props={},t.props&&ed(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:od("plugin")};nd.prototype.getState=function(t){return t[this.key]};var rd=Object.create(null);function od(t){return t in rd?t+"$"+ ++rd[t]:(rd[t]=0,t+"$")}var id=function(t){void 0===t&&(t="key"),this.key=od(t)};id.prototype.get=function(t){return t.config.pluginsByKey[this.key]},id.prototype.getState=function(t){return t[this.key]};const sd=new id("characterLimit"),ad=Oi.create({name:"characterCount",defaultOptions:{limit:0},addProseMirrorPlugins(){const{options:t}=this;return[new nd({key:sd,appendTransaction:(e,n,r)=>{const o=r.doc.content.size;if(t.limit&&o>t.limit)return r.tr.insertText("",t.limit+1,o)}})]}}),cd=Oi.create({name:"textAlign",defaultOptions:{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>({textAlign:t.style.textAlign||this.options.defaultAlignment}),renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>!!this.options.alignments.includes(t)&&this.options.types.every((n=>e.updateAttributes(n,{textAlign:t}))),unsetTextAlign:()=>({commands:t})=>this.options.types.every((e=>t.resetAttributes(e,"textAlign")))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),pd=Ps.create({name:"horizontalRule",defaultOptions:{HTMLAttributes:{}},group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:t}){return["hr",vi(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t})=>t().insertContent({type:this.name}).command((({tr:t,dispatch:e})=>{var n;if(e){const{parent:e,pos:r}=t.selection.$from,o=r+1;if(!t.doc.nodeAt(o)){const r=null===(n=e.type.contentMatch.defaultType)||void 0===n?void 0:n.create();r&&(t.insert(o,r),t.setSelection(re.create(t.doc,o)))}t.scrollIntoView()}return!0})).run()}},addInputRules(){return[$s(/^(?:---|—-|___\s|\*\*\*\s)$/,this.type)]}}),ld=/!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/;Ps.create({name:"image",defaultOptions:{inline:!1,HTMLAttributes:{}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML:()=>[{tag:"img[src]"}],renderHTML({HTMLAttributes:t}){return["img",vi(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[$s(ld,this.type,(t=>{const[,e,n,r]=t;return{src:n,alt:e,title:r}}))]}});const dd=/^\s*([-+*])\s$/,ud=Ps.create({name:"bulletList",defaultOptions:{HTMLAttributes:{}},group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({toggleBulletList:()=>({commands:t})=>t.toggleList("bulletList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[Do(dd,this.type)]}}),hd=/^(\d+)\.\s$/,fd=Ps.create({name:"orderedList",defaultOptions:{HTMLAttributes:{}},group:"block list",content:"listItem+",addAttributes:()=>({start:{default:1,parseHTML:t=>({start:t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1})}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){const e=t,{start:n}=e,r=__objRest(e,["start"]);return 1===n?["ol",vi(this.options.HTMLAttributes,r),0]:["ol",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({toggleOrderedList:()=>({commands:t})=>t.toggleList("orderedList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[Do(hd,this.type,(t=>({order:+t[1]})),((t,e)=>e.childCount+e.attrs.order===+t[1]))]}}),md=Ps.create({name:"taskList",defaultOptions:{HTMLAttributes:{}},group:"block list",content:"taskItem+",parseHTML:()=>[{tag:'ul[data-type="taskList"]',priority:51}],renderHTML:({HTMLAttributes:t})=>["ul",vi(t,{"data-type":"taskList"}),0],addCommands:()=>({toggleTaskList:()=>({commands:t})=>t.toggleList("taskList","taskItem")}),addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),vd=/^\s*(\[([ |x])\])\s$/,gd=Ps.create({name:"taskItem",defaultOptions:{nested:!1,HTMLAttributes:{}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,parseHTML:t=>({checked:"true"===t.getAttribute("data-checked")}),renderHTML:t=>({"data-checked":t.checked}),keepOnSplit:!1}}),parseHTML:()=>[{tag:'li[data-type="taskItem"]',priority:51}],renderHTML({HTMLAttributes:t}){return["li",vi(this.options.HTMLAttributes,t,{"data-type":"taskItem"}),0]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem("taskItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("taskItem")};return this.options.nested?__spreadProps(__spreadValues({},t),{Tab:()=>this.editor.commands.sinkListItem("taskItem")}):t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),c=document.createElement("div");return i.contentEditable="false",a.type="checkbox",a.addEventListener("change",(t=>{if(!r.isEditable)return void(a.checked=!a.checked);const{checked:e}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus().command((({tr:t})=>(t.setNodeMarkup(n(),void 0,{checked:e}),!0))).run()})),t.attrs.checked&&a.setAttribute("checked","checked"),i.append(a,s),o.append(i,c),Object.entries(e).forEach((([t,e])=>{o.setAttribute(t,e)})),{dom:o,contentDOM:c,update:t=>t.type===this.type&&(t.attrs.checked?a.setAttribute("checked","checked"):a.removeAttribute("checked"),!0)}}},addInputRules(){return[Do(vd,this.type,(t=>({checked:"x"===t[t.length-1]})))]}});var yd=function(t,e){var n=this;this.editorView=t,this.width=e.width||1,this.color=e.color||"black",this.class=e.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var r=function(t){return n[e](t)};return t.dom.addEventListener(e,r),{name:e,handler:r}}))};yd.prototype.destroy=function(){var t=this;this.handlers.forEach((function(e){var n=e.name,r=e.handler;return t.editorView.dom.removeEventListener(n,r)}))},yd.prototype.update=function(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())},yd.prototype.setCursor=function(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},yd.prototype.updateOverlay=function(){var t,e=this.editorView.state.doc.resolve(this.cursorPos);if(!e.parent.inlineContent){var n=e.nodeBefore,r=e.nodeAfter;if(n||r){var o=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!t){var s=this.editorView.coordsAtPos(this.cursorPos);t={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}var a,c,p=this.editorView.dom.offsetParent;if(this.element||(this.element=p.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),!p||p==document.body&&"static"==getComputedStyle(p).position)a=-pageXOffset,c=-pageYOffset;else{var l=p.getBoundingClientRect();a=l.left-p.scrollLeft,c=l.top-p.scrollTop}this.element.style.left=t.left-a+"px",this.element.style.top=t.top-c+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"},yd.prototype.scheduleRemoval=function(t){var e=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return e.setCursor(null)}),t)},yd.prototype.dragover=function(t){if(this.editorView.editable){var e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY});if(e){var n=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(n=Pt(this.editorView.state.doc,n,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(n),this.scheduleRemoval(5e3)}}},yd.prototype.dragend=function(){this.scheduleRemoval(20)},yd.prototype.drop=function(){this.scheduleRemoval(20)},yd.prototype.dragleave=function(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)};const bd=Oi.create({name:"dropCursor",defaultOptions:{color:"currentColor",width:1,class:null},addProseMirrorPlugins(){return[(t=this.options,void 0===t&&(t={}),new we({view:function(e){return new yd(e,t)}}))];var t}});var wd=function(t){function e(e){t.call(this,e,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));return e.valid(o)?new e(o):t.near(o)},e.prototype.content=function(){return u.empty},e.prototype.eq=function(t){return t instanceof e&&t.head==this.head},e.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new e(t.resolve(n.pos))},e.prototype.getBookmark=function(){return new kd(this.anchor)},e.valid=function(t){var e=t.parent;if(e.isTextblock||!function(t){for(var e=t.depth;e>=0;e--){var n=t.index(e);if(0!=n)for(var r=t.node(e).child(n-1);;r=r.lastChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}(t)||!function(t){for(var e=t.depth;e>=0;e--){var n=t.indexAfter(e),r=t.node(e);if(n!=r.childCount)for(var o=r.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}(t))return!1;var n=e.type.spec.allowGapCursor;if(null!=n)return n;var r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock},e.findFrom=function(t,n,r){t:for(;;){if(!r&&e.valid(t))return t;for(var o=t.pos,i=null,s=t.depth;;s--){var a=t.node(s);if(n>0?t.indexAfter(s)0){i=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}if(0==s)return null;o+=n;var c=t.doc.resolve(o);if(e.valid(c))return c}for(;;){var p=n>0?i.firstChild:i.lastChild;if(!p){if(i.isAtom&&!i.isText&&!ie.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*n),r=!1;continue t}break}i=p,o+=n;var l=t.doc.resolve(o);if(e.valid(l))return l}return null}},e}(te);wd.prototype.visible=!1,te.jsonID("gapcursor",wd);var kd=function(t){this.pos=t};kd.prototype.map=function(t){return new kd(t.map(this.pos))},kd.prototype.resolve=function(t){var e=t.resolve(this.pos);return wd.valid(e)?new wd(e):te.near(e)};var xd=Vo({ArrowLeft:Md("horiz",-1),ArrowRight:Md("horiz",1),ArrowUp:Md("vert",-1),ArrowDown:Md("vert",1)});function Md(t,e){var n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,o){var i=t.selection,s=e>0?i.$to:i.$from,a=i.empty;if(i instanceof re){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=t.doc.resolve(e>0?s.after():s.before())}var c=wd.findFrom(s,e,a);return!!c&&(r&&r(t.tr.setSelection(new wd(c))),!0)}}function Sd(t,e,n){if(!t.editable)return!1;var r=t.state.doc.resolve(e);if(!wd.valid(r))return!1;var o=t.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(o>-1&&ie.isSelectable(t.state.doc.nodeAt(o)))&&(t.dispatch(t.state.tr.setSelection(new wd(r))),!0)}function Od(t){if(!(t.selection instanceof wd))return null;var e=document.createElement("div");return e.className="ProseMirror-gapcursor",Zr.create(t.doc,[Gr.widget(t.selection.head,e,{key:"gapcursor"})])}const Cd=Oi.create({name:"gapCursor",addProseMirrorPlugins:()=>[new we({props:{decorations:Od,createSelectionBetween:function(t,e,n){if(e.pos==n.pos&&wd.valid(n))return new wd(n)},handleClick:Sd,handleKeyDown:xd}})],extendNodeSchema(t){var e;return{allowGapCursor:null!==(e=bi(hi(t,"allowGapCursor",{name:t.name,options:t.options})))&&void 0!==e?e:null}}}),Nd=Ps.create({name:"doc",topNode:!0,content:"block+"}),_d=Ps.create({name:"paragraph",priority:1e3,defaultOptions:{HTMLAttributes:{}},group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({setParagraph:()=>({commands:t})=>t.toggleNode("paragraph","paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Td=Ps.create({name:"text",group:"inline"});var Vd=200,Ad=function(){};Ad.prototype.append=function(t){return t.length?(t=Ad.from(t),!this.length&&t||t.length=e?Ad.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Ad.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Ad.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Ad.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Ad.from=function(t){return t instanceof Ad?t:t&&t.length?new Ed(t):Ad.empty};var Ed=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=Vd)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=Vd)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Ad);Ad.empty=new Ed([]);var Dd=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return to&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Ad),Rd=Ad,zd=function(t,e){this.items=t,this.eventCount=e};zd.prototype.popEvent=function(t,e){var n=this;if(0==this.eventCount)return null;for(var r,o,i=this.items.length;;i--){if(this.items.get(i-1).selection){--i;break}}e&&(r=this.remapping(i,this.items.length),o=r.maps.length);var s,a,c=t.tr,p=[],l=[];return this.items.forEach((function(t,e){if(!t.step)return r||(r=n.remapping(i,e+1),o=r.maps.length),o--,void l.push(t);if(r){l.push(new Id(t.map));var d,u=t.step.map(r.slice(o));u&&c.maybeStep(u).doc&&(d=c.mapping.maps[c.mapping.maps.length-1],p.push(new Id(d,null,null,p.length+l.length))),o--,d&&r.appendMap(d,o)}else c.maybeStep(t.step);return t.selection?(s=r?t.selection.map(r.slice(o)):t.selection,a=new zd(n.items.slice(0,i).append(l.reverse().concat(p)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:a,transform:c,selection:s}},zd.prototype.addTransform=function(t,e,n,r){for(var o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null,c=0;cLd&&(h=m,(u=s).forEach((function(t,e){if(t.selection&&0==h--)return f=e,!1})),s=u.slice(f),i-=m),new zd(s.append(o),i)},zd.prototype.remapping=function(t,e){var n=new xt;return this.items.forEach((function(e,r){var o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:null;n.appendMap(e.map,o)}),t,e),n},zd.prototype.addMaps=function(t){return 0==this.eventCount?this:new zd(this.items.append(t.map((function(t){return new Id(t)}))),this.eventCount)},zd.prototype.rebased=function(t,e){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((function(t){t.selection&&s--}),r);var a=e;this.items.forEach((function(e){var r=o.getMirror(--a);if(null!=r){i=Math.min(i,r);var c=o.maps[r];if(e.step){var p=t.steps[r].invert(t.docs[r]),l=e.selection&&e.selection.map(o.slice(a+1,r));l&&s++,n.push(new Id(c,p,l))}else n.push(new Id(c))}}),r);for(var c=[],p=e;p500&&(d=d.compress(this.items.length-n.length)),d},zd.prototype.emptyItemCount=function(){var t=0;return this.items.forEach((function(e){e.step||t++})),t},zd.prototype.compress=function(t){void 0===t&&(t=this.items.length);var e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach((function(i,s){if(s>=t)r.push(i),i.selection&&o++;else if(i.step){var a=i.step.map(e.slice(n)),c=a&&a.getMap();if(n--,c&&e.appendMap(c,n),a){var p=i.selection&&i.selection.map(e.slice(n));p&&o++;var l,d=new Id(c.invert(),a,p),u=r.length-1;(l=r.length&&r[u].merge(d))?r[u]=l:r.push(d)}}else i.map&&n--}),this.items.length,0),new zd(Rd.from(r.reverse()),o)},zd.empty=new zd(Rd.empty,0);var Id=function(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r};Id.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var e=t.step.merge(this.step);if(e)return new Id(e.getMap().invert(),e,this.selection)}};var Bd=function(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r},Ld=20;function Pd(t){var e=[];return t.forEach((function(t,n,r,o){return e.push(r,o)})),e}function jd(t,e){if(!t)return null;for(var n=[],r=0;r=e[o]&&(n=!0)})),n}(n,t.prevRanges)),c=s?jd(t.prevRanges,n.mapping):Pd(n.mapping.maps[n.steps.length-1]);return new Bd(t.done.addTransform(n,a?e.selection.getBookmark():null,r,qd(e)),zd.empty,c,n.time)}(n,r,e,t)}},config:t})}const Kd=Oi.create({name:"history",defaultOptions:{depth:100,newGroupDelay:500},addCommands:()=>({undo:()=>({state:t,dispatch:e})=>function(t,e){var n=Jd.getState(t);return!(!n||0==n.done.eventCount||(e&&$d(n,t,e,!1),0))}(t,e),redo:()=>({state:t,dispatch:e})=>function(t,e){var n=Jd.getState(t);return!(!n||0==n.undone.eventCount||(e&&$d(n,t,e,!0),0))}(t,e)}),addProseMirrorPlugins(){return[Ud(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}}}),Gd=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/gm,Xd=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/gm,Yd=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/gm,Qd=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/gm,Zd=js.create({name:"bold",defaultOptions:{HTMLAttributes:{}},parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],renderHTML({HTMLAttributes:t}){return["strong",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({setBold:()=>({commands:t})=>t.setMark("bold"),toggleBold:()=>({commands:t})=>t.toggleMark("bold"),unsetBold:()=>({commands:t})=>t.unsetMark("bold")}),addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Fs(Gd,this.type),Fs(Yd,this.type)]},addPasteRules(){return[Hs(Xd,this.type),Hs(Qd,this.type)]}}),tu=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/gm,eu=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/gm,nu=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/gm,ru=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/gm,ou=js.create({name:"italic",defaultOptions:{HTMLAttributes:{}},parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:t}){return["em",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({setItalic:()=>({commands:t})=>t.setMark("italic"),toggleItalic:()=>({commands:t})=>t.toggleMark("italic"),unsetItalic:()=>({commands:t})=>t.unsetMark("italic")}),addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Fs(tu,this.type),Fs(nu,this.type)]},addPasteRules(){return[Hs(eu,this.type),Hs(ru,this.type)]}}),iu=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/gm,su=js.create({name:"code",defaultOptions:{HTMLAttributes:{}},excludes:"_",parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:t}){return["code",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({setCode:()=>({commands:t})=>t.setMark("code"),toggleCode:()=>({commands:t})=>t.toggleMark("code"),unsetCode:()=>({commands:t})=>t.unsetMark("code")}),addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Fs(iu,this.type)]},addPasteRules(){return[Hs(iu,this.type)]}}),au=Ps.create({name:"heading",defaultOptions:{levels:[1,2,3,4,5,6],HTMLAttributes:{}},content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}})))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,vi(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode("heading",t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode("heading","paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce(((t,e)=>__spreadValues(__spreadValues({},t),{[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})})),{})},addInputRules(){return this.options.levels.map((t=>Ro(new RegExp(`^(#{1,${t}})\\s$`),this.type,{level:t})))}}),cu=Ps.create({name:"hardBreak",defaultOptions:{HTMLAttributes:{}},inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",vi(this.options.HTMLAttributes,t)]},addCommands(){return{setHardBreak:()=>({commands:t})=>t.first([()=>t.exitCode(),()=>t.insertContent({type:this.name})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),pu=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/gm,lu=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/gm,du=js.create({name:"strike",defaultOptions:{HTMLAttributes:{}},parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("line-through")&&{}}],renderHTML({HTMLAttributes:t}){return["s",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({setStrike:()=>({commands:t})=>t.setMark("strike"),toggleStrike:()=>({commands:t})=>t.toggleMark("strike"),unsetStrike:()=>({commands:t})=>t.unsetMark("strike")}),addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Fs(pu,this.type)]},addPasteRules(){return[Hs(lu,this.type)]}}),uu=/^\s*>\s$/gm,hu=Ps.create({name:"blockquote",defaultOptions:{HTMLAttributes:{}},content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:t}){return["blockquote",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({setBlockquote:()=>({commands:t})=>t.wrapIn("blockquote"),toggleBlockquote:()=>({commands:t})=>t.toggleWrap("blockquote"),unsetBlockquote:()=>({commands:t})=>t.lift("blockquote")}),addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Do(uu,this.type)]}}),fu=Ps.create({name:"listItem",defaultOptions:{HTMLAttributes:{}},content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",vi(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem("listItem"),Tab:()=>this.editor.commands.sinkListItem("listItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("listItem")}}}),mu=Oi.create({name:"starterKit",addExtensions(){var t,e,n,r,o,i,s,a,c,p,l,d,u,h,f,m,v,g;const y=[];return!1!==this.options.blockquote&&y.push(hu.configure(null===(t=this.options)||void 0===t?void 0:t.blockquote)),!1!==this.options.bold&&y.push(Zd.configure(null===(e=this.options)||void 0===e?void 0:e.bold)),!1!==this.options.bulletList&&y.push(ud.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&y.push(su.configure(null===(r=this.options)||void 0===r?void 0:r.code)),!1!==this.options.codeBlock&&y.push(Kc.configure(null===(o=this.options)||void 0===o?void 0:o.codeBlock)),!1!==this.options.document&&y.push(Nd.configure(null===(i=this.options)||void 0===i?void 0:i.document)),!1!==this.options.dropcursor&&y.push(bd.configure(null===(s=this.options)||void 0===s?void 0:s.dropcursor)),!1!==this.options.gapcursor&&y.push(Cd.configure(null===(a=this.options)||void 0===a?void 0:a.gapcursor)),!1!==this.options.hardBreak&&y.push(cu.configure(null===(c=this.options)||void 0===c?void 0:c.hardBreak)),!1!==this.options.heading&&y.push(au.configure(null===(p=this.options)||void 0===p?void 0:p.heading)),!1!==this.options.history&&y.push(Kd.configure(null===(l=this.options)||void 0===l?void 0:l.history)),!1!==this.options.horizontalRule&&y.push(pd.configure(null===(d=this.options)||void 0===d?void 0:d.horizontalRule)),!1!==this.options.italic&&y.push(ou.configure(null===(u=this.options)||void 0===u?void 0:u.italic)),!1!==this.options.listItem&&y.push(fu.configure(null===(h=this.options)||void 0===h?void 0:h.listItem)),!1!==this.options.orderedList&&y.push(fd.configure(null===(f=this.options)||void 0===f?void 0:f.orderedList)),!1!==this.options.paragraph&&y.push(_d.configure(null===(m=this.options)||void 0===m?void 0:m.paragraph)),!1!==this.options.strike&&y.push(du.configure(null===(v=this.options)||void 0===v?void 0:v.strike)),!1!==this.options.text&&y.push(Td.configure(null===(g=this.options)||void 0===g?void 0:g.text)),y}});const vu={components:{EditorContent:Jc,BubbleMenu:Hc},props:{modelValue:{type:String,default:""},maxChars:{type:Number,default:0},bubbleMenu:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},bold:{type:Boolean,default:!0},italic:{type:Boolean,default:!0},strike:{type:Boolean,default:!0},underline:{type:Boolean,default:!0},code:{type:Boolean,default:!0},codeBlock:{type:Boolean,default:!0},blockquote:{type:Boolean,default:!0},bulletList:{type:Boolean,default:!0},orderedList:{type:Boolean,default:!0},taskList:{type:Boolean,default:!0},heading:{type:Boolean,default:!0},textAlign:{type:Boolean,default:!0},horizontalRule:{type:Boolean,default:!0},undoRedo:{type:Boolean,default:!0}},data:()=>({editor:null,headingOpen:!1,alignOpen:!1}),watch:{modelValue(t){this.editor.getHTML()!==t&&this.editor.commands.setContent(this.modelValue,!1)},disabled(t){this.editor&&this.editor.setEditable(!t)}},methods:{insertImageFromURL(t){this.editor.chain().focus().setImage({src:t},!1).run()}},computed:{extensions(){return[mu,Gc,cd,Kc,fd.configure({class:"inline-flex"}),ud.configure({class:"inline-flex"}),ad.configure({limit:this.maxChars}),md,gd]},hasTextAlign(){return this.editor.isActive({textAlign:"left"})||this.editor.isActive({textAlign:"right"})||this.editor.isActive({textAlign:"center"})||this.editor.isActive({textAlign:"justify"})},charPercentage(){return Math.round(100/this.maxChars*this.editor.getCharacterCount())}},mounted(){this.editor=new qc({content:this.modelValue,extensions:this.extensions,editorProps:{attributes:{class:"h-full overflow-y-auto input"}},editable:!this.disabled}).on("update",(({editor:t})=>{this.$emit("update:modelValue",t.getHTML())}))},beforeUnmount(){this.editor.destroy()}},gu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M7 5h6a3.5 3.5 0 0 1 0 7h-6z"}),t.createVNode("path",{d:"M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7"})],-1),yu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"11",y1:"5",x2:"17",y2:"5"}),t.createVNode("line",{x1:"7",y1:"19",x2:"13",y2:"19"}),t.createVNode("line",{x1:"14",y1:"5",x2:"10",y2:"19"})],-1),bu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M7 5v9a5 5 0 0 0 10 0v-9"}),t.createVNode("path",{d:"M4 12h16"})],-1),wu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M7 5v5a5 5 0 0 0 10 0v-5"}),t.createVNode("path",{d:"M5 19h14"})],-1),ku=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("polyline",{points:"7 8 3 12 7 16"}),t.createVNode("polyline",{points:"17 8 21 12 17 16"}),t.createVNode("line",{x1:"14",y1:"4",x2:"10",y2:"20"})],-1),xu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),t.createVNode("path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"}),t.createVNode("path",{d:"M10 13l-1 2l1 2"}),t.createVNode("path",{d:"M14 13l1 2l-1 2"})],-1),Mu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M6 15h15"}),t.createVNode("path",{d:"M21 19h-15"}),t.createVNode("path",{d:"M15 11h6"}),t.createVNode("path",{d:"M21 7h-6"}),t.createVNode("path",{d:"M9 9h1a1 1 0 1 1 -1 1v-2.5a2 2 0 0 1 2 -2"}),t.createVNode("path",{d:"M3 9h1a1 1 0 1 1 -1 1v-2.5a2 2 0 0 1 2 -2"})],-1),Su=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"9",y1:"6",x2:"20",y2:"6"}),t.createVNode("line",{x1:"9",y1:"12",x2:"20",y2:"12"}),t.createVNode("line",{x1:"9",y1:"18",x2:"20",y2:"18"}),t.createVNode("line",{x1:"5",y1:"6",x2:"5",y2:"6.01"}),t.createVNode("line",{x1:"5",y1:"12",x2:"5",y2:"12.01"}),t.createVNode("line",{x1:"5",y1:"18",x2:"5",y2:"18.01"})],-1),Ou=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M11 6h9"}),t.createVNode("path",{d:"M11 12h9"}),t.createVNode("path",{d:"M12 18h8"}),t.createVNode("path",{d:"M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4"}),t.createVNode("path",{d:"M6 10v-6l-2 2"})],-1),Cu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M3.5 5.5l1.5 1.5l2.5 -2.5"}),t.createVNode("path",{d:"M3.5 11.5l1.5 1.5l2.5 -2.5"}),t.createVNode("path",{d:"M3.5 17.5l1.5 1.5l2.5 -2.5"}),t.createVNode("line",{x1:"11",y1:"6",x2:"20",y2:"6"}),t.createVNode("line",{x1:"11",y1:"12",x2:"20",y2:"12"}),t.createVNode("line",{x1:"11",y1:"18",x2:"20",y2:"18"})],-1),Nu={key:10},_u=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M7 12h10"}),t.createVNode("path",{d:"M7 4v16"}),t.createVNode("path",{d:"M17 4v16"}),t.createVNode("path",{d:"M15 20h4"}),t.createVNode("path",{d:"M15 4h4"}),t.createVNode("path",{d:"M5 20h4"}),t.createVNode("path",{d:"M5 4h4"})],-1),Tu={key:0,class:"inline-flex"},Vu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M19 18v-8l-2 2"}),t.createVNode("path",{d:"M4 6v12"}),t.createVNode("path",{d:"M12 6v12"}),t.createVNode("path",{d:"M11 18h2"}),t.createVNode("path",{d:"M3 18h2"}),t.createVNode("path",{d:"M4 12h8"}),t.createVNode("path",{d:"M3 6h2"}),t.createVNode("path",{d:"M11 6h2"})],-1),Au=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M17 12a2 2 0 1 1 4 0c0 .591 -.417 1.318 -.816 1.858l-3.184 4.143l4 -.001"}),t.createVNode("path",{d:"M4 6v12"}),t.createVNode("path",{d:"M12 6v12"}),t.createVNode("path",{d:"M11 18h2"}),t.createVNode("path",{d:"M3 18h2"}),t.createVNode("path",{d:"M4 12h8"}),t.createVNode("path",{d:"M3 6h2"}),t.createVNode("path",{d:"M11 6h2"})],-1),Eu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M19 14a2 2 0 1 0 -2 -2"}),t.createVNode("path",{d:"M17 16a2 2 0 1 0 2 -2"}),t.createVNode("path",{d:"M4 6v12"}),t.createVNode("path",{d:"M12 6v12"}),t.createVNode("path",{d:"M11 18h2"}),t.createVNode("path",{d:"M3 18h2"}),t.createVNode("path",{d:"M4 12h8"}),t.createVNode("path",{d:"M3 6h2"}),t.createVNode("path",{d:"M11 6h2"})],-1),Du=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M20 18v-8l-4 6h5"}),t.createVNode("path",{d:"M4 6v12"}),t.createVNode("path",{d:"M12 6v12"}),t.createVNode("path",{d:"M11 18h2"}),t.createVNode("path",{d:"M3 18h2"}),t.createVNode("path",{d:"M4 12h8"}),t.createVNode("path",{d:"M3 6h2"}),t.createVNode("path",{d:"M11 6h2"})],-1),Ru=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M17 18h2a2 2 0 1 0 0 -4h-2v-4h4"}),t.createVNode("path",{d:"M4 6v12"}),t.createVNode("path",{d:"M12 6v12"}),t.createVNode("path",{d:"M11 18h2"}),t.createVNode("path",{d:"M3 18h2"}),t.createVNode("path",{d:"M4 12h8"}),t.createVNode("path",{d:"M3 6h2"}),t.createVNode("path",{d:"M11 6h2"})],-1),zu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("circle",{transform:"rotate(180 19 16)",cx:"19",cy:"16",r:"2"}),t.createVNode("path",{d:"M21 12a2 2 0 1 0 -4 0v4"}),t.createVNode("path",{d:"M4 6v12"}),t.createVNode("path",{d:"M12 6v12"}),t.createVNode("path",{d:"M11 18h2"}),t.createVNode("path",{d:"M3 18h2"}),t.createVNode("path",{d:"M4 12h8"}),t.createVNode("path",{d:"M3 6h2"}),t.createVNode("path",{d:"M11 6h2"})],-1),Iu={key:11},Bu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),t.createVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),t.createVNode("line",{x1:"6",y1:"18",x2:"18",y2:"18"})],-1),Lu={key:0,class:"inline-flex"},Pu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),t.createVNode("line",{x1:"4",y1:"12",x2:"14",y2:"12"}),t.createVNode("line",{x1:"4",y1:"18",x2:"18",y2:"18"})],-1),ju=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),t.createVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),t.createVNode("line",{x1:"6",y1:"18",x2:"18",y2:"18"})],-1),$u=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),t.createVNode("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),t.createVNode("line",{x1:"6",y1:"18",x2:"20",y2:"18"})],-1),Fu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),t.createVNode("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),t.createVNode("line",{x1:"4",y1:"18",x2:"16",y2:"18"})],-1),Hu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"4",y1:"7",x2:"20",y2:"7"}),t.createVNode("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),t.createVNode("line",{x1:"14",y1:"11",x2:"14",y2:"17"}),t.createVNode("path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"}),t.createVNode("path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"})],-1),qu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),t.createVNode("line",{x1:"4",y1:"4",x2:"4",y2:"4.01"}),t.createVNode("line",{x1:"8",y1:"4",x2:"8",y2:"4.01"}),t.createVNode("line",{x1:"12",y1:"4",x2:"12",y2:"4.01"}),t.createVNode("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),t.createVNode("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),t.createVNode("line",{x1:"4",y1:"8",x2:"4",y2:"8.01"}),t.createVNode("line",{x1:"12",y1:"8",x2:"12",y2:"8.01"}),t.createVNode("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),t.createVNode("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),t.createVNode("line",{x1:"12",y1:"16",x2:"12",y2:"16.01"}),t.createVNode("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),t.createVNode("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),t.createVNode("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),t.createVNode("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),t.createVNode("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),t.createVNode("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})],-1),Ju=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M9 13l-4 -4l4 -4m-4 4h11a4 4 0 0 1 0 8h-1"})],-1),Wu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M15 13l4 -4l-4 -4m4 4h-11a4 4 0 0 0 0 8h1"})],-1);vu.render=function(e,n,r,o,i,s){const a=t.resolveComponent("collapse-x-transition"),c=t.resolveComponent("editor-content"),p=t.resolveDirective("tooltip");return t.openBlock(),t.createBlock("div",null,[t.createVNode("div",null,[i.editor?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.bubbleMenu?"bubble-menu":"div"),{key:0,editor:i.editor,class:["flex-wrap space-x-1",r.bubbleMenu?"bg-gray-600 rounded dark p-1":"mb-2"]},{default:t.withCtx((()=>[r.bold?t.withDirectives((t.openBlock(),t.createBlock("button",{key:0,"aria-label":e.__("tiptap::tiptap.bold"),onClick:n[1]||(n[1]=t=>i.editor.chain().focus().toggleBold().run()),class:["button",{accent:i.editor.isActive("bold")}]},[gu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.bold")]]):t.createCommentVNode("",!0),r.italic?t.withDirectives((t.openBlock(),t.createBlock("button",{key:1,"aria-label":e.__("tiptap::tiptap.italic"),onClick:n[2]||(n[2]=t=>i.editor.chain().focus().toggleItalic().run()),class:["button",{accent:i.editor.isActive("italic")}]},[yu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.italic")]]):t.createCommentVNode("",!0),r.strike?t.withDirectives((t.openBlock(),t.createBlock("button",{key:2,"aria-label":e.__("tiptap::tiptap.strike"),onClick:n[3]||(n[3]=t=>i.editor.chain().focus().toggleStrike().run()),class:["button",{accent:i.editor.isActive("strike")}]},[bu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.strike")]]):t.createCommentVNode("",!0),r.underline?t.withDirectives((t.openBlock(),t.createBlock("button",{key:3,"aria-label":e.__("tiptap::tiptap.underline"),onClick:n[4]||(n[4]=t=>i.editor.chain().focus().toggleUnderline().run()),class:["button",{accent:i.editor.isActive("underline")}]},[wu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.underline")]]):t.createCommentVNode("",!0),r.code?t.withDirectives((t.openBlock(),t.createBlock("button",{key:4,"aria-label":e.__("tiptap::tiptap.code"),onClick:n[5]||(n[5]=t=>i.editor.chain().focus().toggleCode().run()),class:["button",{accent:i.editor.isActive("code")}]},[ku],10,["aria-label"])),[[p,e.__("tiptap::tiptap.code")]]):t.createCommentVNode("",!0),r.codeBlock?t.withDirectives((t.openBlock(),t.createBlock("button",{key:5,"aria-label":e.__("tiptap::tiptap.code_block"),onClick:n[6]||(n[6]=t=>i.editor.chain().focus().toggleCodeBlock().run()),class:["button",{accent:i.editor.isActive("codeBlock")}]},[xu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.code_block")]]):t.createCommentVNode("",!0),r.blockquote?t.withDirectives((t.openBlock(),t.createBlock("button",{key:6,"aria-label":e.__("tiptap::tiptap.blockquote"),onClick:n[7]||(n[7]=t=>i.editor.chain().focus().toggleBlockquote().run()),class:["button",{accent:i.editor.isActive("blockquote")}]},[Mu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.blockquote")]]):t.createCommentVNode("",!0),r.bulletList?t.withDirectives((t.openBlock(),t.createBlock("button",{key:7,"aria-label":e.__("tiptap::tiptap.bullet_list"),onClick:n[8]||(n[8]=t=>i.editor.chain().focus().toggleBulletList().run()),class:["button",{accent:i.editor.isActive("bulletList")}]},[Su],10,["aria-label"])),[[p,e.__("tiptap::tiptap.bullet_list")]]):t.createCommentVNode("",!0),r.orderedList?t.withDirectives((t.openBlock(),t.createBlock("button",{key:8,"aria-label":e.__("tiptap::tiptap.ordered_list"),onClick:n[9]||(n[9]=t=>i.editor.chain().focus().toggleOrderedList().run()),class:["button",{accent:i.editor.isActive("orderedList")}]},[Ou],10,["aria-label"])),[[p,e.__("tiptap::tiptap.ordered_list")]]):t.createCommentVNode("",!0),r.taskList?t.withDirectives((t.openBlock(),t.createBlock("button",{key:9,"aria-label":e.__("tiptap::tiptap.task_list"),onClick:n[10]||(n[10]=t=>i.editor.chain().focus().toggleTaskList().run()),class:["button",{accent:i.editor.isActive("taskList")}]},[Cu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.task_list")]]):t.createCommentVNode("",!0),r.heading?(t.openBlock(),t.createBlock("span",Nu,[t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive("heading")}],onClick:n[11]||(n[11]=t=>{i.headingOpen=!i.headingOpen,i.alignOpen=!1}),"aria-label":e.__("tiptap::tiptap.heading")},[_u],10,["aria-label"]),[[p,e.__("tiptap::tiptap.heading")]]),t.createVNode(a,null,{default:t.withCtx((()=>[i.headingOpen?(t.openBlock(),t.createBlock("div",Tu,[t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive("heading",{level:1})}],"aria-label":`${e.__("tiptap::tiptap.header")} 1`,onClick:n[12]||(n[12]=t=>i.editor.chain().focus().toggleHeading({level:1}).run())},[Vu],10,["aria-label"]),[[p,`${e.__("tiptap::tiptap.heading")} 1`]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive("heading",{level:2})}],"aria-label":`${e.__("tiptap::tiptap.header")} 2`,onClick:n[13]||(n[13]=t=>i.editor.chain().focus().toggleHeading({level:2}).run())},[Au],10,["aria-label"]),[[p,`${e.__("tiptap::tiptap.heading")} 2`]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive("heading",{level:3})}],"aria-label":`${e.__("tiptap::tiptap.header")} 3`,onClick:n[14]||(n[14]=t=>i.editor.chain().focus().toggleHeading({level:3}).run())},[Eu],10,["aria-label"]),[[p,`${e.__("tiptap::tiptap.heading")} 3`]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive("heading",{level:4})}],"aria-label":`${e.__("tiptap::tiptap.header")} 4`,onClick:n[15]||(n[15]=t=>i.editor.chain().focus().toggleHeading({level:4}).run())},[Du],10,["aria-label"]),[[p,`${e.__("tiptap::tiptap.heading")} 4`]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive("heading",{level:5})}],"aria-label":`${e.__("tiptap::tiptap.header")} 5`,onClick:n[16]||(n[16]=t=>i.editor.chain().focus().toggleHeading({level:5}).run())},[Ru],10,["aria-label"]),[[p,`${e.__("tiptap::tiptap.heading")} 5`]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive("heading",{level:6})}],"aria-label":`${e.__("tiptap::tiptap.header")} 6`,onClick:n[17]||(n[17]=t=>i.editor.chain().focus().toggleHeading({level:6}).run())},[zu],10,["aria-label"]),[[p,`${e.__("tiptap::tiptap.heading")} 6`]])])):t.createCommentVNode("",!0)])),_:1})])):t.createCommentVNode("",!0),r.textAlign?(t.openBlock(),t.createBlock("span",Iu,[t.withDirectives(t.createVNode("button",{class:["button",{accent:s.hasTextAlign}],onClick:n[18]||(n[18]=t=>{i.alignOpen=!i.alignOpen,i.headingOpen=!1}),"aria-label":e.__("tiptap::tiptap.text_align")},[Bu],10,["aria-label"]),[[p,e.__("tiptap::tiptap.text_align")]]),t.createVNode(a,null,{default:t.withCtx((()=>[i.alignOpen?(t.openBlock(),t.createBlock("div",Lu,[t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive({textAlign:"left"})}],"aria-label":e.__("tiptap::tiptap.left"),onClick:n[19]||(n[19]=t=>i.editor.chain().focus().setTextAlign("left").run())},[Pu],10,["aria-label"]),[[p,e.__("tiptap::tiptap.left")]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive({textAlign:"center"})}],"aria-label":e.__("tiptap::tiptap.center"),onClick:n[20]||(n[20]=t=>i.editor.chain().focus().setTextAlign("center").run())},[ju],10,["aria-label"]),[[p,e.__("tiptap::tiptap.center")]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive({textAlign:"right"})}],"aria-label":e.__("tiptap::tiptap.right"),onClick:n[21]||(n[21]=t=>i.editor.chain().focus().setTextAlign("right").run())},[$u],10,["aria-label"]),[[p,e.__("tiptap::tiptap.right")]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive({textAlign:"justify"})}],"aria-label":e.__("tiptap::tiptap.justify"),onClick:n[22]||(n[22]=t=>i.editor.chain().focus().setTextAlign("justify").run())},[Fu],10,["aria-label"]),[[p,e.__("tiptap::tiptap.justify")]]),t.withDirectives(t.createVNode("button",{class:"button","aria-label":e.__("tiptap::tiptap.clear"),onClick:n[23]||(n[23]=t=>i.editor.chain().focus().unsetTextAlign().run())},[Hu],8,["aria-label"]),[[p,e.__("tiptap::tiptap.clear")]])])):t.createCommentVNode("",!0)])),_:1})])):t.createCommentVNode("",!0),r.horizontalRule?t.withDirectives((t.openBlock(),t.createBlock("button",{key:12,"aria-label":e.__("tiptap::tiptap.horizontal_rule"),onClick:n[24]||(n[24]=t=>i.editor.chain().focus().setHorizontalRule().run()),class:"button"},[qu],8,["aria-label"])),[[p,e.__("tiptap::tiptap.horizontal_rule")]]):t.createCommentVNode("",!0),r.undoRedo?t.withDirectives((t.openBlock(),t.createBlock("button",{key:13,"aria-label":e.__("tiptap::tiptap.undo"),onClick:n[25]||(n[25]=t=>i.editor.chain().focus().undo().run()),class:"button"},[Ju],8,["aria-label"])),[[p,e.__("tiptap::tiptap.undo")]]):t.createCommentVNode("",!0),r.undoRedo?t.withDirectives((t.openBlock(),t.createBlock("button",{key:14,"aria-label":e.__("tiptap::tiptap.redo"),onClick:n[26]||(n[26]=t=>i.editor.chain().focus().redo().run()),class:"button"},[Wu],8,["aria-label"])),[[p,e.__("tiptap::tiptap.redo")]]):t.createCommentVNode("",!0)])),_:1},8,["editor","class"])):t.createCommentVNode("",!0)]),t.createVNode(c,{editor:i.editor,class:"min-h-64 h-64",onClick:n[27]||(n[27]=t=>{i.headingOpen=!1,i.alignOpen=!1})},null,8,["editor"]),i.editor&&r.maxChars>0?(t.openBlock(),t.createBlock("div",{key:0,class:["w-full",s.charPercentage>90?"text-red-500":s.charPercentage>75?"text-yellow-500":null]},t.toDisplayString(e.__("tiptap::tiptap.character_count",{chars:i.editor.getCharacterCount(),max:r.maxChars})),3)):t.createCommentVNode("",!0)])};const Uu={components:{Tiptap:vu},data:()=>({bubbleMenu:!1,maxChars:280,content:"

This is tiptap 2 in Voyager II using Vue 3 🎉

",disabled:!1,bold:!0,italic:!0,strike:!0,underline:!0,code:!0,codeBlock:!0,blockquote:!0,bulletList:!0,orderedList:!0,taskList:!0,heading:!0,textAlign:!0,horizontalRule:!0,undoRedo:!0})},Ku={class:"flex space-x-2"},Gu={class:"input-group"},Xu=t.createVNode("label",{for:"bubble",class:"label"},"Bubble menu",-1),Yu={class:"mt-1"},Qu={class:"input-group"},Zu=t.createVNode("label",{for:"maxChars",class:"label"},"Max characters (0 = infinite)",-1),th={class:"mt-1"},eh={class:"input-group"},nh=t.createVNode("label",{for:"disabled",class:"label"},"Disabled",-1),rh={class:"mt-1"},oh={class:"flex flex-wrap space-x-2 mt-4"},ih={class:"input-group"},sh={for:"bold",class:"label"},ah={class:"mt-1"},ch={class:"input-group"},ph={for:"italic",class:"label"},lh={class:"mt-1"},dh={class:"input-group"},uh={for:"strike",class:"label"},hh={class:"mt-1"},fh={class:"input-group"},mh={for:"underline",class:"label"},vh={class:"mt-1"},gh={class:"input-group"},yh={for:"code",class:"label"},bh={class:"mt-1"},wh={class:"input-group"},kh={for:"codeBlock",class:"label"},xh={class:"mt-1"},Mh={class:"input-group"},Sh={for:"blockquote",class:"label"},Oh={class:"mt-1"},Ch={class:"input-group"},Nh={for:"bulletList",class:"label"},_h={class:"mt-1"},Th={class:"input-group"},Vh={for:"orderedList",class:"label"},Ah={class:"mt-1"},Eh={class:"input-group"},Dh={for:"taskList",class:"label"},Rh={class:"mt-1"},zh={class:"input-group"},Ih={for:"heading",class:"label"},Bh={class:"mt-1"},Lh={class:"input-group"},Ph={for:"textAlign",class:"label"},jh={class:"mt-1"},$h={class:"input-group"},Fh={for:"horizontalRule",class:"label"},Hh={class:"mt-1"},qh={class:"input-group"},Jh={for:"undoRedo",class:"label"},Wh={class:"mt-1"};Uu.render=function(e,n,r,o,i,s){const a=t.resolveComponent("tiptap"),c=t.resolveComponent("collapsible");return t.openBlock(),t.createBlock(t.Fragment,null,[t.createVNode(a,{bubbleMenu:i.bubbleMenu,maxChars:i.maxChars,modelValue:i.content,"onUpdate:modelValue":n[1]||(n[1]=t=>i.content=t),disabled:i.disabled,bold:i.bold,italic:i.italic,strike:i.strike,underline:i.underline,code:i.code,codeBlock:i.codeBlock,blockquote:i.blockquote,bulletList:i.bulletList,orderedList:i.orderedList,taskList:i.taskList,heading:i.heading,textAlign:i.textAlign,horizontalRule:i.horizontalRule,undoRedo:i.undoRedo},null,8,["bubbleMenu","maxChars","modelValue","disabled","bold","italic","strike","underline","code","codeBlock","blockquote","bulletList","orderedList","taskList","heading","textAlign","horizontalRule","undoRedo"]),t.createVNode(c,{title:"Options"},{default:t.withCtx((()=>[t.createVNode("div",Ku,[t.createVNode("div",Gu,[Xu,t.createVNode("div",Yu,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[2]||(n[2]=t=>i.bubbleMenu=t),id:"bubble"},null,512),[[t.vModelCheckbox,i.bubbleMenu]])])]),t.createVNode("div",Qu,[Zu,t.createVNode("div",th,[t.withDirectives(t.createVNode("input",{type:"number",class:"input","onUpdate:modelValue":n[3]||(n[3]=t=>i.maxChars=t),min:"0",id:"maxChars"},null,512),[[t.vModelText,i.maxChars,void 0,{number:!0}]])])]),t.createVNode("div",eh,[nh,t.createVNode("div",rh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[4]||(n[4]=t=>i.disabled=t),id:"disabled"},null,512),[[t.vModelCheckbox,i.disabled]])])])]),t.createVNode("div",oh,[t.createVNode("div",ih,[t.createVNode("label",sh,t.toDisplayString(e.__("tiptap::tiptap.bold")),1),t.createVNode("div",ah,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[5]||(n[5]=t=>i.bold=t),id:"bold"},null,512),[[t.vModelCheckbox,i.bold]])])]),t.createVNode("div",ch,[t.createVNode("label",ph,t.toDisplayString(e.__("tiptap::tiptap.italic")),1),t.createVNode("div",lh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[6]||(n[6]=t=>i.italic=t),id:"italic"},null,512),[[t.vModelCheckbox,i.italic]])])]),t.createVNode("div",dh,[t.createVNode("label",uh,t.toDisplayString(e.__("tiptap::tiptap.strike")),1),t.createVNode("div",hh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[7]||(n[7]=t=>i.strike=t),id:"strike"},null,512),[[t.vModelCheckbox,i.strike]])])]),t.createVNode("div",fh,[t.createVNode("label",mh,t.toDisplayString(e.__("tiptap::tiptap.underline")),1),t.createVNode("div",vh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[8]||(n[8]=t=>i.underline=t),id:"underline"},null,512),[[t.vModelCheckbox,i.underline]])])]),t.createVNode("div",gh,[t.createVNode("label",yh,t.toDisplayString(e.__("tiptap::tiptap.code")),1),t.createVNode("div",bh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[9]||(n[9]=t=>i.code=t),id:"code"},null,512),[[t.vModelCheckbox,i.code]])])]),t.createVNode("div",wh,[t.createVNode("label",kh,t.toDisplayString(e.__("tiptap::tiptap.code_block")),1),t.createVNode("div",xh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[10]||(n[10]=t=>i.codeBlock=t),id:"codeBlock"},null,512),[[t.vModelCheckbox,i.codeBlock]])])]),t.createVNode("div",Mh,[t.createVNode("label",Sh,t.toDisplayString(e.__("tiptap::tiptap.blockquote")),1),t.createVNode("div",Oh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[11]||(n[11]=t=>i.blockquote=t),id:"blockquote"},null,512),[[t.vModelCheckbox,i.blockquote]])])]),t.createVNode("div",Ch,[t.createVNode("label",Nh,t.toDisplayString(e.__("tiptap::tiptap.bullet_list")),1),t.createVNode("div",_h,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[12]||(n[12]=t=>i.bulletList=t),id:"bulletList"},null,512),[[t.vModelCheckbox,i.bulletList]])])]),t.createVNode("div",Th,[t.createVNode("label",Vh,t.toDisplayString(e.__("tiptap::tiptap.ordered_list")),1),t.createVNode("div",Ah,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[13]||(n[13]=t=>i.orderedList=t),id:"orderedList"},null,512),[[t.vModelCheckbox,i.orderedList]])])]),t.createVNode("div",Eh,[t.createVNode("label",Dh,t.toDisplayString(e.__("tiptap::tiptap.task_list")),1),t.createVNode("div",Rh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[14]||(n[14]=t=>i.taskList=t),id:"taskList"},null,512),[[t.vModelCheckbox,i.taskList]])])]),t.createVNode("div",zh,[t.createVNode("label",Ih,t.toDisplayString(e.__("tiptap::tiptap.heading")),1),t.createVNode("div",Bh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[15]||(n[15]=t=>i.heading=t),id:"heading"},null,512),[[t.vModelCheckbox,i.heading]])])]),t.createVNode("div",Lh,[t.createVNode("label",Ph,t.toDisplayString(e.__("tiptap::tiptap.text_align")),1),t.createVNode("div",jh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[16]||(n[16]=t=>i.textAlign=t),id:"textAlign"},null,512),[[t.vModelCheckbox,i.textAlign]])])]),t.createVNode("div",$h,[t.createVNode("label",Fh,t.toDisplayString(e.__("tiptap::tiptap.horizontal_rule")),1),t.createVNode("div",Hh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[17]||(n[17]=t=>i.horizontalRule=t),id:"horizontalRule"},null,512),[[t.vModelCheckbox,i.horizontalRule]])])]),t.createVNode("div",qh,[t.createVNode("label",Jh,t.toDisplayString(e.__("tiptap::tiptap.undo"))+"/"+t.toDisplayString(e.__("tiptap::tiptap.redo")),1),t.createVNode("div",Wh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[18]||(n[18]=t=>i.undoRedo=t),id:"undoRedo"},null,512),[[t.vModelCheckbox,i.undoRedo]])])])])])),_:1}),t.createVNode(c,{title:"HTML Output"},{default:t.withCtx((()=>[t.withDirectives(t.createVNode("textarea",{class:"input w-full min-h-64","onUpdate:modelValue":n[19]||(n[19]=t=>i.content=t)},null,512),[[t.vModelText,i.content]])])),_:1})],64)};const Uh={mixins:[voyager.formfieldMixin]},Kh={key:1},Gh={key:2};Uh.render=function(e,n,r,o,i,s){const a=t.resolveComponent("tiptap");return"query"==e.action?t.renderSlot(e.$slots,"default",{key:0}):"add"==e.action||"edit"==e.action?(t.openBlock(),t.createBlock("div",Kh,[t.createVNode(a,{bubbleMenu:e.options.bubbleMenu,maxChars:e.options.maxChars,modelValue:e.modelValue,"onUpdate:modelValue":n[1]||(n[1]=t=>e.$emit("update:modelValue",t)),bold:e.options.bold,italic:e.options.italic,strike:e.options.strike,underline:e.options.underline,code:e.options.code,codeBlock:e.options.codeBlock,blockquote:e.options.blockquote,bulletList:e.options.bulletList,orderedList:e.options.orderedList,taskList:e.options.taskList,heading:e.options.heading,textAlign:e.options.textAlign,horizontalRule:e.options.horizontalRule,undoRedo:e.options.undoRedo},null,8,["bubbleMenu","maxChars","modelValue","bold","italic","strike","underline","code","codeBlock","blockquote","bulletList","orderedList","taskList","heading","textAlign","horizontalRule","undoRedo"])])):"browse"==e.action?(t.openBlock(),t.createBlock("div",Gh,t.toDisplayString(e.modelValue),1)):t.createCommentVNode("",!0)};const Xh={mixins:[voyager.formfieldBuilderMixin],computed:{defaultListOptions:()=>({display_length:150}),defaultViewOptions:()=>({bubbleMenu:!1,maxChars:0,bold:!0,italic:!0,strike:!0,underline:!0,code:!0,codeBlock:!0,blockquote:!0,bulletList:!0,orderedList:!0,taskList:!0,heading:!0,textAlign:!0,horizontalRule:!0,undoRedo:!0})}},Yh={key:0},Qh={for:"length",class:"label"},Zh={key:1},tf={class:"mt-2"},ef={for:"maxChars",class:"label"},nf={class:"grid grid-cols-3 lg:grid-cols-2 xl:grid-cols-3 gap-2 mt-2"},rf={class:"flex items-center space-x-1"},of={for:"bubble",class:"label"},sf={class:"flex items-center space-x-1"},af={for:"bold",class:"label"},cf={class:"flex items-center space-x-1"},pf={for:"italic",class:"label"},lf={class:"flex items-center space-x-1"},df={for:"strike",class:"label"},uf={class:"flex items-center space-x-1"},hf={for:"underline",class:"label"},ff={class:"flex items-center space-x-1"},mf={for:"code",class:"label"},vf={class:"flex items-center space-x-1"},gf={for:"codeBlock",class:"label"},yf={class:"flex items-center space-x-1"},bf={for:"blockquote",class:"label"},wf={class:"flex items-center space-x-1"},kf={for:"bulletList",class:"label"},xf={class:"flex items-center space-x-1"},Mf={for:"orderedList",class:"label"},Sf={class:"flex items-center space-x-1"},Of={for:"taskList",class:"label"},Cf={class:"flex items-center space-x-1"},Nf={for:"heading",class:"label"},_f={class:"flex items-center space-x-1"},Tf={for:"textAlign",class:"label"},Vf={class:"flex items-center space-x-1"},Af={for:"horizontalRule",class:"label"},Ef={class:"flex items-center space-x-1"},Df={for:"undoRedo",class:"label"},Rf={key:2};Xh.render=function(e,n,r,o,i,s){const a=t.resolveComponent("tiptap");return"list-options"==e.action?(t.openBlock(),t.createBlock("div",Yh,[t.createVNode("label",Qh,t.toDisplayString(e.__("voyager::generic.display_length")),1),t.withDirectives(t.createVNode("input",{type:"number",id:"length",class:"input w-full","onUpdate:modelValue":n[1]||(n[1]=t=>e.options.display_length=t)},null,512),[[t.vModelText,e.options.display_length,void 0,{number:!0}]])])):"view-options"==e.action?(t.openBlock(),t.createBlock("div",Zh,[t.createVNode("div",tf,[t.createVNode("label",ef,t.toDisplayString(e.__("tiptap::tiptap.max_characters")),1),t.withDirectives(t.createVNode("input",{type:"number",class:"input w-full","onUpdate:modelValue":n[2]||(n[2]=t=>e.options.maxChars=t),min:"0",id:"maxChars"},null,512),[[t.vModelText,e.options.maxChars,void 0,{number:!0}]])]),t.createVNode("div",nf,[t.createVNode("div",rf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[3]||(n[3]=t=>e.options.bubbleMenu=t),id:"bubble"},null,512),[[t.vModelCheckbox,e.options.bubbleMenu]]),t.createVNode("label",of,t.toDisplayString(e.__("tiptap::tiptap.bubble_menu")),1)]),t.createVNode("div",sf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[4]||(n[4]=t=>e.options.bold=t),id:"bold"},null,512),[[t.vModelCheckbox,e.options.bold]]),t.createVNode("label",af,t.toDisplayString(e.__("tiptap::tiptap.bold")),1)]),t.createVNode("div",cf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[5]||(n[5]=t=>e.options.italic=t),id:"italic"},null,512),[[t.vModelCheckbox,e.options.italic]]),t.createVNode("label",pf,t.toDisplayString(e.__("tiptap::tiptap.italic")),1)]),t.createVNode("div",lf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[6]||(n[6]=t=>e.options.strike=t),id:"strike"},null,512),[[t.vModelCheckbox,e.options.strike]]),t.createVNode("label",df,t.toDisplayString(e.__("tiptap::tiptap.strike")),1)]),t.createVNode("div",uf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[7]||(n[7]=t=>e.options.underline=t),id:"underline"},null,512),[[t.vModelCheckbox,e.options.underline]]),t.createVNode("label",hf,t.toDisplayString(e.__("tiptap::tiptap.underline")),1)]),t.createVNode("div",ff,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[8]||(n[8]=t=>e.options.code=t),id:"code"},null,512),[[t.vModelCheckbox,e.options.code]]),t.createVNode("label",mf,t.toDisplayString(e.__("tiptap::tiptap.code")),1)]),t.createVNode("div",vf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[9]||(n[9]=t=>e.options.codeBlock=t),id:"codeBlock"},null,512),[[t.vModelCheckbox,e.options.codeBlock]]),t.createVNode("label",gf,t.toDisplayString(e.__("tiptap::tiptap.code_block")),1)]),t.createVNode("div",yf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[10]||(n[10]=t=>e.options.blockquote=t),id:"blockquote"},null,512),[[t.vModelCheckbox,e.options.blockquote]]),t.createVNode("label",bf,t.toDisplayString(e.__("tiptap::tiptap.blockquote")),1)]),t.createVNode("div",wf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[11]||(n[11]=t=>e.options.bulletList=t),id:"bulletList"},null,512),[[t.vModelCheckbox,e.options.bulletList]]),t.createVNode("label",kf,t.toDisplayString(e.__("tiptap::tiptap.bullet_list")),1)]),t.createVNode("div",xf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[12]||(n[12]=t=>e.options.orderedList=t),id:"orderedList"},null,512),[[t.vModelCheckbox,e.options.orderedList]]),t.createVNode("label",Mf,t.toDisplayString(e.__("tiptap::tiptap.ordered_list")),1)]),t.createVNode("div",Sf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[13]||(n[13]=t=>e.options.taskList=t),id:"taskList"},null,512),[[t.vModelCheckbox,e.options.taskList]]),t.createVNode("label",Of,t.toDisplayString(e.__("tiptap::tiptap.task_list")),1)]),t.createVNode("div",Cf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[14]||(n[14]=t=>e.options.heading=t),id:"heading"},null,512),[[t.vModelCheckbox,e.options.heading]]),t.createVNode("label",Nf,t.toDisplayString(e.__("tiptap::tiptap.heading")),1)]),t.createVNode("div",_f,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[15]||(n[15]=t=>e.options.textAlign=t),id:"textAlign"},null,512),[[t.vModelCheckbox,e.options.textAlign]]),t.createVNode("label",Tf,t.toDisplayString(e.__("tiptap::tiptap.text_align")),1)]),t.createVNode("div",Vf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[16]||(n[16]=t=>e.options.horizontalRule=t),id:"horizontalRule"},null,512),[[t.vModelCheckbox,e.options.horizontalRule]]),t.createVNode("label",Af,t.toDisplayString(e.__("tiptap::tiptap.horizontal_rule")),1)]),t.createVNode("div",Ef,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[17]||(n[17]=t=>e.options.undoRedo=t),id:"undoRedo"},null,512),[[t.vModelCheckbox,e.options.undoRedo]]),t.createVNode("label",Df,t.toDisplayString(e.__("tiptap::tiptap.undo"))+"/"+t.toDisplayString(e.__("tiptap::tiptap.redo")),1)])])])):"view"==e.action?(t.openBlock(),t.createBlock("div",Rf,[t.createVNode(a,{bubbleMenu:e.options.bubbleMenu,maxChars:e.options.maxChars,value:"''",bold:e.options.bold,italic:e.options.italic,strike:e.options.strike,underline:e.options.underline,code:e.options.code,codeBlock:e.options.codeBlock,blockquote:e.options.blockquote,bulletList:e.options.bulletList,orderedList:e.options.orderedList,taskList:e.options.taskList,heading:e.options.heading,textAlign:e.options.textAlign,horizontalRule:e.options.horizontalRule,undoRedo:e.options.undoRedo},null,8,["bubbleMenu","maxChars","bold","italic","strike","underline","code","codeBlock","blockquote","bulletList","orderedList","taskList","heading","textAlign","horizontalRule","undoRedo"])])):t.createCommentVNode("",!0)},voyager.component("tiptap",vu),voyager.component("tiptap-demo",Uu),voyager.component("tiptap-formfield",Uh),voyager.component("tiptap-builder",Xh),voyager.addToUI("Tiptap","tiptap-demo")})); +var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,n)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,__spreadValues=(t,e)=>{for(var n in e||(e={}))__hasOwnProp.call(e,n)&&__defNormalProp(t,n,e[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(e))__propIsEnum.call(e,n)&&__defNormalProp(t,n,e[n]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e)),__objRest=(t,e)=>{var n={};for(var r in t)__hasOwnProp.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))e.indexOf(r)<0&&__propIsEnum.call(t,r)&&(n[r]=t[r]);return n},__vite_style__=document.createElement("style");__vite_style__.innerHTML=".ProseMirror div,.ProseMirror li>p:first-child{display:inline}ul[data-type=taskList]{list-style:none;padding:0}ul[data-type=taskList] li{display:flex;align-items:center}ul[data-type=taskList] li>label{flex:0 0 auto;margin-right:.5rem}",document.head.appendChild(__vite_style__),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Vue)}(this,(function(t){"use strict";function e(t){this.content=t}e.prototype={constructor:e,find:function(t){for(var e=0;e>1}},e.from=function(t){if(t instanceof e)return t;var n=[];if(t)for(var r in t)n.push(r,t[r]);return new e(n)};var n=e;function r(t,e,n){for(var o=0;;o++){if(o==t.childCount||o==e.childCount)return t.childCount==e.childCount?null:n;var i=t.child(o),s=e.child(o);if(i!=s){if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(var a=0;i.text[a]==s.text[a];a++)n++;return n}if(i.content.size||s.content.size){var c=r(i.content,s.content,n+1);if(null!=c)return c}n+=i.nodeSize}else n+=i.nodeSize}}function o(t,e,n,r){for(var i=t.childCount,s=e.childCount;;){if(0==i||0==s)return i==s?null:{a:n,b:r};var a=t.child(--i),c=e.child(--s),p=a.nodeSize;if(a!=c){if(!a.sameMarkup(c))return{a:n,b:r};if(a.isText&&a.text!=c.text){for(var l=0,d=Math.min(a.text.length,c.text.length);lt&&!1!==n(a,r+s,o,i)&&a.content.size){var p=s+1;a.nodesBetween(Math.max(0,t-p),Math.min(a.content.size,e-p),n,r+p)}s=c}},i.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},i.prototype.textBetween=function(t,e,n,r){var o="",i=!0;return this.nodesBetween(t,e,(function(s,a){s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf&&r?(o+=r,i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o},i.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);ot)for(var o=0,s=0;st&&((se)&&(a=a.isText?a.cut(Math.max(0,t-s),Math.min(a.text.length,e-s)):a.cut(Math.max(0,t-s-1),Math.min(a.content.size,e-s-1))),n.push(a),r+=a.nodeSize),s=c}return new i(n,r)},i.prototype.cutByIndex=function(t,e){return t==e?i.empty:0==t&&e==this.content.length?this:new i(this.content.slice(t,e))},i.prototype.replaceChild=function(t,e){var n=this.content[t];if(n==e)return this;var r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new i(r,o)},i.prototype.addToStart=function(t){return new i([t].concat(this.content),this.size+t.nodeSize)},i.prototype.addToEnd=function(t){return new i(this.content.concat(t),this.size+t.nodeSize)},i.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;ethis.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?c(n+1,o):c(n,r);r=o}},i.prototype.toString=function(){return"<"+this.toStringInner()+">"},i.prototype.toStringInner=function(){return this.content.join(", ")},i.prototype.toJSON=function(){return this.content.length?this.content.map((function(t){return t.toJSON()})):null},i.fromJSON=function(t,e){if(!e)return i.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new i(e.map(t.nodeFromJSON))},i.fromArray=function(t){if(!t.length)return i.empty;for(var e,n=0,r=0;rthis.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e},l.prototype.removeFromSet=function(t){for(var e=0;et.depth)throw new d("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new d("Inconsistent open depths");return g(t,e,n,0)}function g(t,e,n,r){var o=t.index(r),s=t.node(r);if(o==e.index(r)&&r=0;o--)r=e.node(o).copy(i.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return x(s,M(t,c.start,c.end,e,r))}var p=t.parent,l=p.content;return x(p,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}return x(s,S(t,e,r))}function y(t,e){if(!e.type.compatibleContent(t.type))throw new d("Cannot join "+e.type.name+" onto "+t.type.name)}function b(t,e,n){var r=t.node(n);return y(r,e.node(n)),r}function w(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function k(t,e,n,r){var o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(w(t.nodeAfter,r),i++));for(var a=i;ao&&b(t,e,o+1),a=r.depth>o&&b(n,r,o+1),c=[];return k(null,t,o,c),s&&a&&e.index(o)==n.index(o)?(y(s,a),w(x(s,M(t,e,n,r,o+1)),c)):(s&&w(x(s,S(t,e,o+1)),c),k(e,n,o,c),a&&w(x(a,S(n,r,o+1)),c)),k(r,null,o,c),new i(c)}function S(t,e,n){var r=[];(k(null,t,n,r),t.depth>n)&&w(x(b(t,e,n+1),S(t,e,n+1)),r);return k(e,null,n,r),new i(r)}h.size.get=function(){return this.content.size-this.openStart-this.openEnd},u.prototype.insertAt=function(t,e){var n=m(this.content,t+this.openStart,e,null);return n&&new u(n,this.openStart,this.openEnd)},u.prototype.removeBetween=function(t,e){return new u(f(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)},u.prototype.eq=function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd},u.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},u.prototype.toJSON=function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},u.fromJSON=function(t,e){if(!e)return u.empty;var n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new u(i.fromJSON(t,e.content),n,r)},u.maxOpen=function(t,e){void 0===e&&(e=!0);for(var n=0,r=0,o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new u(t,n,r)},Object.defineProperties(u.prototype,h),u.empty=new u(i.empty,0,0);var O=function(t,e,n){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=n},C={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};O.prototype.resolveDepth=function(t){return null==t?this.depth:t<0?this.depth+t:t},C.parent.get=function(){return this.node(this.depth)},C.doc.get=function(){return this.node(0)},O.prototype.node=function(t){return this.path[3*this.resolveDepth(t)]},O.prototype.index=function(t){return this.path[3*this.resolveDepth(t)+1]},O.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)},O.prototype.start=function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1},O.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},O.prototype.before=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]},O.prototype.after=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize},C.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},C.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r},C.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)},O.prototype.posAtIndex=function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1,o=0;o0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},O.prototype.blockRange=function(t,e){if(void 0===t&&(t=this),t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new V(this,t,n)},O.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},O.prototype.max=function(t){return t.pos>this.pos?t:this},O.prototype.min=function(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var n=[],r=0,o=e,i=t;;){var s=i.content.findIndex(o),a=s.index,c=s.offset,p=o-c;if(n.push(i,a,r+c),!p)break;if((i=i.child(a)).isText)break;o=p-1,r+=c+1}return new O(e,n,o)},O.resolveCached=function(t,e){for(var n=0;nt&&this.nodesBetween(t,e,(function(t){return n.isInSet(t.marks)&&(r=!0),!r})),r},R.isBlock.get=function(){return this.type.isBlock},R.isTextblock.get=function(){return this.type.isTextblock},R.inlineContent.get=function(){return this.type.inlineContent},R.isInline.get=function(){return this.type.isInline},R.isText.get=function(){return this.type.isText},R.isLeaf.get=function(){return this.type.isLeaf},R.isAtom.get=function(){return this.type.isAtom},D.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()+")"),I(this.marks,t)},D.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},D.prototype.canReplace=function(t,e,n,r,o){void 0===n&&(n=i.empty),void 0===r&&(r=0),void 0===o&&(o=n.childCount);var s=this.contentMatchAt(t).matchFragment(n,r,o),a=s&&s.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(var c=r;c=0;n--)e=t[n].type.name+"("+e+")";return e}var B=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},L={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};B.parse=function(t,e){var n=new P(t,e);if(null==n.next)return B.empty;var r=$(n);n.next&&n.err("Unexpected trailing text");var o=function(t){var e=Object.create(null);return n(U(t,0));function n(r){var o=[];r.forEach((function(e){t[e].forEach((function(e){var n=e.term,r=e.to;if(n){var i=o.indexOf(n),s=i>-1&&o[i+1];U(t,r).forEach((function(t){s||o.push(n,s=[]),-1==s.indexOf(t)&&s.push(t)}))}}))}));for(var i=e[r.join(",")]=new B(r.indexOf(t.length-1)>-1),s=0;s>1},B.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},B.prototype.toString=function(){var t=[];return function e(n){t.push(n);for(var r=1;r"+t.indexOf(e.next[o+1]);return r})).join("\n")},Object.defineProperties(B.prototype,L),B.empty=new B(!0);var P=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},j={next:{configurable:!0}};function $(t){var e=[];do{e.push(F(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function F(t){var e=[];do{e.push(H(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function H(t){for(var e=function(t){if(t.eat("(")){var e=$(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){var n=function(t,e){var n=t.nodeTypes,r=n[e];if(r)return[r];var o=[];for(var i in n){var s=n[i];s.groups.indexOf(e)>-1&&o.push(s)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((function(e){return null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}}));return t.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}t.err("Unexpected token '"+t.next+"'")}(t);;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=J(t,e)}return e}function q(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function J(t,e){var n=q(t),r=n;return t.eat(",")&&(r="}"!=t.next?q(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function W(t,e){return e-t}function U(t,e){var n=[];return function e(r){var o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(var i=0;i-1},Y.prototype.allowsMarks=function(t){if(null==this.markSet)return!0;for(var e=0;e-1};var nt=function(t){for(var e in this.spec={},t)this.spec[e]=t[e];this.spec.nodes=n.from(t.nodes),this.spec.marks=n.from(t.marks),this.nodes=Y.compile(this.spec.nodes,this),this.marks=et.compile(this.spec.marks,this);var r=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=r[s]||(r[s]=B.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==a?null:a?rt(this,a.split(" ")):""!=a&&i.inlineContent?null:[]}for(var c in this.marks){var p=this.marks[c],l=p.spec.excludes;p.excluded=null==l?[p]:""==l?[]:rt(this,l.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};function rt(t,e){for(var n=[],r=0;r-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}nt.prototype.node=function(t,e,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof Y))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)},nt.prototype.text=function(t,e){var n=this.nodes.text;return new z(n,n.defaultAttrs,t,l.setFrom(e))},nt.prototype.mark=function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)},nt.prototype.nodeFromJSON=function(t){return D.fromJSON(this,t)},nt.prototype.markFromJSON=function(t){return l.fromJSON(this,t)},nt.prototype.nodeType=function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e};var ot=function(t,e){var n=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((function(t){t.tag?n.tags.push(t):t.style&&n.styles.push(t)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))};ot.prototype.parse=function(t,e){void 0===e&&(e={});var n=new lt(this,e,!1);return n.addAll(t,null,e.from,e.to),n.finish()},ot.prototype.parseSlice=function(t,e){void 0===e&&(e={});var n=new lt(this,e,!0);return n.addAll(t,null,e.from,e.to),u.maxOpen(n.finish())},ot.prototype.matchTag=function(t,e,n){for(var r=n?this.tags.indexOf(n)+1:0;rt.length&&(61!=i.style.charCodeAt(t.length)||i.style.slice(t.length+1)!=e))){if(i.getAttrs){var s=i.getAttrs(e);if(!1===s)continue;i.attrs=s}return i}}},ot.schemaRules=function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,r=0;r=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]},pt.prototype.applyPending=function(t){for(var e=0,n=this.pendingMarks;e=0;r--){var o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(var s=0;sthis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},lt.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},lt.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return void(this.open=e)},dt.currentPos.get=function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t},lt.prototype.findAtPoint=function(t,e){if(this.find)for(var n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=function(t,a){for(;t>=0;t--){var c=n[t];if(""==c){if(t==n.length-1||0==t)continue;for(;a>=i;a--)if(s(t-1,a))return!0;return!1}var p=a>0||0==a&&o?e.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!p||p.name!=c&&-1==p.groups.indexOf(c))return!1;a--}return!0};return s(n.length-1,this.open)},lt.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},lt.prototype.addPendingMark=function(t){var e=function(t,e){for(var n=0;n=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);var o=r.popFromStashMark(t);o&&r.type&&r.type.allowsMarkType(o.type)&&(r.activeMarks=o.addToSet(r.activeMarks))}if(r==e)break}},Object.defineProperties(lt.prototype,dt);var mt=function(t,e){this.nodes=t||{},this.marks=e||{}};function vt(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function gt(t){return t.document||window.document}mt.prototype.serializeFragment=function(t,e,n){var r=this;void 0===e&&(e={}),n||(n=gt(e).createDocumentFragment());var o=n,i=null;return t.forEach((function(t){if(i||t.marks.length){i||(i=[]);for(var n=0,s=0;n=0;r--){var o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},mt.prototype.serializeMark=function(t,e,n){void 0===n&&(n={});var r=this.marks[t.type.name];return r&&mt.renderSpec(gt(n),r(t,e))},mt.renderSpec=function(t,e,n){if(void 0===n&&(n=null),"string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;var r=e[0],o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));var i=null,s=n?t.createElementNS(n,r):t.createElement(r),a=e[1],c=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a))for(var p in c=2,a)if(null!=a[p]){var l=p.indexOf(" ");l>0?s.setAttributeNS(p.slice(0,l),p.slice(l+1),a[p]):s.setAttribute(p,a[p])}for(var d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var h=mt.renderSpec(t,u,n),f=h.dom,m=h.contentDOM;if(s.appendChild(f),m){if(i)throw new RangeError("Multiple content holes");i=m}}return{dom:s,contentDOM:i}},mt.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new mt(this.nodesFromSchema(t),this.marksFromSchema(t)))},mt.nodesFromSchema=function(t){var e=vt(t.nodes);return e.text||(e.text=function(t){return t.text}),e},mt.marksFromSchema=function(t){return vt(t.marks)};var yt=Math.pow(2,16);function bt(t){return 65535&t}var wt=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.pos=t,this.deleted=e,this.recover=n},kt=function(t,e){void 0===e&&(e=!1),this.ranges=t,this.inverted=e};kt.prototype.recover=function(t){var e=0,n=bt(t);if(!this.inverted)for(var r=0;rt)break;var c=this.ranges[s+o],p=this.ranges[s+i],l=a+c;if(t<=l){var d=a+r+((c?t==a?-1:t==l?1:e:e)<0?0:p);if(n)return d;var u=t==(e<0?a:l)?null:s/3+(t-a)*yt;return new wt(d,e<0?t!=a:t!=l,u)}r+=p-c}return n?t+r:new wt(t+r)},kt.prototype.touches=function(t,e){for(var n=0,r=bt(e),o=this.inverted?2:1,i=this.inverted?1:2,s=0;st)break;var c=this.ranges[s+o];if(t<=a+c&&s==3*r)return!0;n+=this.ranges[s+i]-c}return!1},kt.prototype.forEach=function(t){for(var e=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r=0;e--){var r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:null)}},xt.prototype.invert=function(){var t=new xt;return t.appendMappingInverted(this),t},xt.prototype.map=function(t,e){if(void 0===e&&(e=1),this.mirror)return this._map(t,e,!0);for(var n=this.from;no&&s0},St.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(St.prototype,Ot);var Nt=Object.create(null),_t=function(){};_t.prototype.apply=function(t){return Ct()},_t.prototype.getMap=function(){return kt.empty},_t.prototype.invert=function(t){return Ct()},_t.prototype.map=function(t){return Ct()},_t.prototype.merge=function(t){return null},_t.prototype.toJSON=function(){return Ct()},_t.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=Nt[e.stepType];if(!n)throw new RangeError("No step type "+e.stepType+" defined");return n.fromJSON(t,e)},_t.jsonID=function(t,e){if(t in Nt)throw new RangeError("Duplicate use of step JSON ID "+t);return Nt[t]=e,e.prototype.jsonID=t,e};var Tt=function(t,e){this.doc=t,this.failed=e};Tt.ok=function(t){return new Tt(t,null)},Tt.fail=function(t){return new Tt(null,t)},Tt.fromReplace=function(t,e,n,r){try{return Tt.ok(t.replace(e,n,r))}catch(o){if(o instanceof d)return Tt.fail(o.message);throw o}};var Vt=function(t){function e(e,n,r,o){t.call(this),this.from=e,this.to=n,this.slice=r,this.structure=!!o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){return this.structure&&Et(t,this.from,this.to)?Tt.fail("Structure replace would overwrite content"):Tt.fromReplace(t,this.from,this.to,this.slice)},e.prototype.getMap=function(){return new kt([this.from,this.to-this.from,this.slice.size])},e.prototype.invert=function(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)},e.prototype.merge=function(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var n=this.slice.size+t.slice.size==0?u.empty:new u(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}var r=this.slice.size+t.slice.size==0?u.empty:new u(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),r,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,u.fromJSON(t,n.slice),!!n.structure)},e}(_t);_t.jsonID("replace",Vt);var At=function(t){function e(e,n,r,o,i,s,a){t.call(this),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=!!a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){if(this.structure&&(Et(t,this.from,this.gapFrom)||Et(t,this.gapTo,this.to)))return Tt.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return Tt.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?Tt.fromReplace(t,this.from,this.to,n):Tt.fail("Content does not fit in gap")},e.prototype.getMap=function(){return new kt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},e.prototype.invert=function(t){var n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deleted&&r.deleted||or.pos?null:new e(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,u.fromJSON(t,n.slice),n.insert,!!n.structure)},e}(_t);function Et(t,e,n){for(var r=t.resolve(e),o=n-e,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function Dt(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Rt(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(ni;a--,c--){var p=o.node(a),l=o.index(a);if(p.type.spec.isolating)return!1;var d=p.content.cutByIndex(l,p.childCount),u=r&&r[c]||p;if(u!=p&&(d=d.replaceChild(0,u.type.create(u.attrs))),!p.canReplace(l+1,p.childCount)||!u.type.validContent(d))return!1}var h=o.indexAfter(i),f=r&&r[0];return o.node(i).canReplaceWith(h,h,f?f.type:o.node(i+1).type)}function Lt(t,e){var n,r,o=t.resolve(e),i=o.index();return n=o.nodeBefore,r=o.nodeAfter,n&&r&&!n.isLeaf&&n.canAppend(r)&&o.parent.canReplace(i,i+1)}function Pt(t,e,n){var r=t.resolve(e);if(!n.content.size)return e;for(var o=n.content,i=0;i=0;a--){var c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,p=r.index(a)+(c>0?1:0),l=r.node(a),d=!1;if(1==s)d=l.canReplace(p,p,o);else{var u=l.contentMatchAt(p).findWrapping(o.firstChild.type);d=u&&l.canReplaceWith(p,p,u[0])}if(d)return 0==c?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function jt(t,e,n){for(var r=[],o=0;oe;h--)f||n.index(h)>0?(f=!0,l=i.from(n.node(h).copy(l)),d++):c--;for(var m=i.empty,v=0,g=o,y=!1;g>e;g--)y||r.after(g+1)=0;r--)n=i.from(e[r].type.create(e[r].attrs,n));var o=t.start,s=t.end;return this.step(new At(o,s,o,s,new u(n,0,0),e.length,!0))},St.prototype.setBlockType=function(t,e,n,r){var o=this;if(void 0===e&&(e=t),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var s=this.steps.length;return this.doc.nodesBetween(t,e,(function(t,e){if(t.isTextblock&&!t.hasMarkup(n,r)&&function(t,e,n){var r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(o.doc,o.mapping.slice(s).map(e),n)){o.clearIncompatible(o.mapping.slice(s).map(e,1),n);var a=o.mapping.slice(s),c=a.map(e,1),p=a.map(e+t.nodeSize,1);return o.step(new At(c,p,c+1,p-1,new u(i.from(n.create(r,null,t.marks)),0,0),1,!0)),!1}})),this},St.prototype.setNodeMarkup=function(t,e,n,r){var o=this.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");e||(e=o.type);var s=e.create(n,null,r||o.marks);if(o.isLeaf)return this.replaceWith(t,t+o.nodeSize,s);if(!e.validContent(o.content))throw new RangeError("Invalid content for node type "+e.name);return this.step(new At(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new u(i.from(s),0,0),1,!0))},St.prototype.split=function(t,e,n){void 0===e&&(e=1);for(var r=this.doc.resolve(t),o=i.empty,s=i.empty,a=r.depth,c=r.depth-e,p=e-1;a>c;a--,p--){o=i.from(r.node(a).copy(o));var l=n&&n[p];s=i.from(l?l.type.create(l.attrs,s):r.node(a).copy(s))}return this.step(new Vt(t,t,new u(o.append(s),e,e),!0))},St.prototype.join=function(t,e){void 0===e&&(e=1);var n=new Vt(t-e,t+e,u.empty,!0);return this.step(n)};var $t=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=t.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new u(jt(n.content,(function(t,n){return t.isAtom&&n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t}),o),n.openStart,n.openEnd);return Tt.fromReplace(t,this.from,this.to,i)},e.prototype.invert=function(){return new Ft(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(_t);_t.jsonID("addMark",$t);var Ft=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=new u(jt(n.content,(function(t){return t.mark(e.mark.removeFromSet(t.marks))})),n.openStart,n.openEnd);return Tt.fromReplace(t,this.from,this.to,r)},e.prototype.invert=function(){return new $t(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(_t);function Ht(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}_t.jsonID("removeMark",Ft),St.prototype.addMark=function(t,e,n){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(t,e,(function(r,c,p){if(r.isInline){var l=r.marks;if(!n.isInSet(l)&&p.type.allowsMarkType(n.type)){for(var d=Math.max(c,t),u=Math.min(c+r.nodeSize,e),h=n.addToSet(l),f=0;f=0;f--)this.step(o[f]);return this},St.prototype.replace=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=u.empty);var r=function(t,e,n,r){if(void 0===n&&(n=e),void 0===r&&(r=u.empty),e==n&&!r.size)return null;var o=t.resolve(e),i=t.resolve(n);return Ht(o,i,r)?new Vt(e,n,r):new qt(o,i,r).fit()}(this.doc,t,e,n);return r&&this.step(r),this},St.prototype.replaceWith=function(t,e,n){return this.replace(t,e,new u(i.from(n),0,0))},St.prototype.delete=function(t,e){return this.replace(t,e,u.empty)},St.prototype.insert=function(t,e){return this.replaceWith(t,t,e)};var qt=function(t,e,n){this.$to=e,this.$from=t,this.unplaced=n,this.frontier=[];for(var r=0;r<=t.depth;r++){var o=t.node(r);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(r))})}this.placed=i.empty;for(var s=t.depth;s>0;s--)this.placed=i.from(t.node(s).copy(this.placed))},Jt={depth:{configurable:!0}};function Wt(t,e,n){return 0==e?t.cutByIndex(n):t.replaceChild(0,t.firstChild.copy(Wt(t.firstChild.content,e-1,n)))}function Ut(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ut(t.lastChild.content,e-1,n)))}function Kt(t,e){for(var n=0;n1&&(r=r.replaceChild(0,Gt(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(i.empty,!0)))),t.copy(r)}function Xt(t,e,n,r,o){var i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;var a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(var r=n;rr){var a=o.contentMatchAt(0),c=a.fillBefore(t).append(t);t=c.append(a.matchFragment(c).fillBefore(i.empty,!0))}return t}function Qt(t,e){for(var n=[],r=Math.min(t.depth,e.depth);r>=0;r--){var o=t.start(r);if(oe.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;o==e.start(r)&&n.push(r)}return n}Jt.depth.get=function(){return this.frontier.length-1},qt.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;for(var i=this.placed,s=r.depth,a=o.depth;s&&a&&1==i.childCount;)i=i.firstChild.content,s--,a--;var c=new u(i,s,a);return e>-1?new At(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new Vt(r.pos,o.pos,c):void 0},qt.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var e=this.unplaced.openStart;e>=0;e--)for(var n=void 0,r=(e?(n=Kt(this.unplaced.content,e-1).firstChild).content:this.unplaced.content).firstChild,o=this.depth;o>=0;o--){var s=this.frontier[o],a=s.type,c=s.match,p=void 0,l=void 0;if(1==t&&(r?c.matchType(r.type)||(l=c.fillBefore(i.from(r),!1)):a.compatibleContent(n.type)))return{sliceDepth:e,frontierDepth:o,parent:n,inject:l};if(2==t&&r&&(p=c.findWrapping(r.type)))return{sliceDepth:e,frontierDepth:o,parent:n,wrap:p};if(n&&c.matchType(n.type))break}},qt.prototype.openMore=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,o=Kt(e,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new u(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)},qt.prototype.dropNode=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,o=Kt(e,n);if(o.childCount<=1&&n>0){var i=e.size-n<=n+o.size;this.unplaced=new u(Wt(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new u(Wt(e,n,1),n,r)},qt.prototype.placeNodes=function(t){for(var e=t.sliceDepth,n=t.frontierDepth,r=t.parent,o=t.inject,s=t.wrap;this.depth>n;)this.closeFrontierNode();if(s)for(var a=0;a1||0==l||b.content.size)&&(m=w,h.push(Gt(b.mark(v.allowedMarks(b.marks)),1==d?l:0,d==p.childCount?y:-1)))}var k=d==p.childCount;k||(y=-1),this.placed=Ut(this.placed,n,i.from(h)),this.frontier[n].match=m,k&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var x=0,M=p;x1&&r==this.$to.end(--n);)++r;return r},qt.prototype.findCloseLevel=function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],r=n.match,o=n.type,i=e=0;a--){var c=this.frontier[a],p=c.match,l=Xt(t,a,c.type,p,!0);if(!l||l.childCount)continue t}return{depth:e,fit:s,move:i?t.doc.resolve(t.after(e+1)):t}}}},qt.prototype.close=function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Ut(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;n++){var r=t.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,o)}return t},qt.prototype.openFrontierNode=function(t,e,n){var r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Ut(this.placed,this.depth,i.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})},qt.prototype.closeFrontierNode=function(){var t=this.frontier.pop().match.fillBefore(i.empty,!0);t.childCount&&(this.placed=Ut(this.placed,this.frontier.length,t))},Object.defineProperties(qt.prototype,Jt),St.prototype.replaceRange=function(t,e,n){if(!n.size)return this.deleteRange(t,e);var r=this.doc.resolve(t),o=this.doc.resolve(e);if(Ht(r,o,n))return this.step(new Vt(t,e,n));var i=Qt(r,this.doc.resolve(e));0==i[i.length-1]&&i.pop();var s=-(r.depth+1);i.unshift(s);for(var a=r.depth,c=r.pos-1;a>0;a--,c--){var p=r.node(a).type.spec;if(p.defining||p.isolating)break;i.indexOf(a)>-1?s=a:r.before(a)==c&&i.splice(1,0,-a)}for(var l=i.indexOf(s),d=[],h=n.openStart,f=n.content,m=0;;m++){var v=f.firstChild;if(d.push(v),m==n.openStart)break;f=v.content}h>0&&d[h-1].type.spec.defining&&r.node(l).type!=d[h-1].type?h-=1:h>=2&&d[h-1].isTextblock&&d[h-2].type.spec.defining&&r.node(l).type!=d[h-2].type&&(h-=2);for(var g=n.openStart;g>=0;g--){var y=(g+h+1)%(n.openStart+1),b=d[y];if(b)for(var w=0;w=0&&(this.replace(t,e,n),!(this.steps.length>O));C--){var N=i[C];N<0||(t=r.before(N),e=o.after(N))}return this},St.prototype.replaceRangeWith=function(t,e,n){if(!n.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var r=function(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,n))return r.after(s+1);if(a0&&(a||n.node(s-1).canReplace(n.index(s-1),r.indexAfter(s-1))))return this.delete(n.before(s),r.after(s))}for(var c=1;c<=n.depth&&c<=r.depth;c++)if(t-n.start(c)==n.depth-c&&e>n.end(c)&&r.end(c)-e!=r.depth-c)return this.delete(n.before(c),e);return this.delete(t,e)};var Zt=Object.create(null),te=function(t,e,n){this.ranges=n||[new ne(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},ee={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};ee.anchor.get=function(){return this.$anchor.pos},ee.head.get=function(){return this.$head.pos},ee.from.get=function(){return this.$from.pos},ee.to.get=function(){return this.$to.pos},ee.$from.get=function(){return this.ranges[0].$from},ee.$to.get=function(){return this.ranges[0].$to},ee.empty.get=function(){for(var t=this.ranges,e=0;e=0;o--){var i=e<0?pe(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):pe(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(i)return i}},te.near=function(t,e){return void 0===e&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new ae(t.node(0))},te.atStart=function(t){return pe(t,t,0,0,1)||new ae(t)},te.atEnd=function(t){return pe(t,t,t.content.size,t.childCount,-1)||new ae(t)},te.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=Zt[e.type];if(!n)throw new RangeError("No selection type "+e.type+" defined");return n.fromJSON(t,e)},te.jsonID=function(t,e){if(t in Zt)throw new RangeError("Duplicate use of selection JSON ID "+t);return Zt[t]=e,e.prototype.jsonID=t,e},te.prototype.getBookmark=function(){return re.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(te.prototype,ee),te.prototype.visible=!0;var ne=function(t,e){this.$from=t,this.$to=e},re=function(t){function e(e,n){void 0===n&&(n=e),t.call(this,e,n)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return t.near(o);var i=n.resolve(r.map(this.anchor));return new e(i.parent.inlineContent?i:o,o)},e.prototype.replace=function(e,n){if(void 0===n&&(n=u.empty),t.prototype.replace.call(this,e,n),n==u.empty){var r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head},e.prototype.getBookmark=function(){return new oe(this.anchor,this.head)},e.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,e,n){void 0===n&&(n=e);var r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))},e.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var s=t.findFrom(r,o,!0)||t.findFrom(r,-o,!0);if(!s)return t.near(r,o);r=s.$head}return n.parent.inlineContent||(0==i||(n=(t.findFrom(n,-o,!0)||t.findFrom(n,o,!0)).$anchor).pos0?0:1);o>0?s=0;s+=o){var a=e.child(s);if(a.isAtom){if(!i&&ie.isSelectable(a))return ie.create(t,n-(o<0?a.nodeSize:0))}else{var c=pe(t,a,n+o,o<0?a.childCount:0,o,i);if(c)return c}n+=a.nodeSize*o}}function le(t,e,n){var r=t.steps.length-1;if(!(r0},e.prototype.setStoredMarks=function(t){return this.storedMarks=t,this.updated|=2,this},e.prototype.ensureMarks=function(t){return l.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this},e.prototype.addStoredMark=function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))},e.prototype.removeStoredMark=function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},e.prototype.addStep=function(e,n){t.prototype.addStep.call(this,e,n),this.updated=-3&this.updated,this.storedMarks=null},e.prototype.setTime=function(t){return this.time=t,this},e.prototype.replaceSelection=function(t){return this.selection.replace(this,t),this},e.prototype.replaceSelectionWith=function(t,e){var n=this.selection;return!1!==e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||l.none))),n.replaceWith(this,t),this},e.prototype.deleteSelection=function(){return this.selection.replace(this),this},e.prototype.insertText=function(t,e,n){void 0===n&&(n=e);var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(!t)return this.deleteRange(e,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(e);o=n==e?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.setSelection(te.near(this.selection.$to)),this},e.prototype.setMeta=function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this},e.prototype.getMeta=function(t){return this.meta["string"==typeof t?t:t.key]},n.isGeneric.get=function(){for(var t in this.meta)return!1;return!0},e.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(e.prototype,n),e}(St);function ue(t,e){return e&&t?t.bind(e):t}var he=function(t,e,n){this.name=t,this.init=ue(e.init,n),this.apply=ue(e.apply,n)},fe=[new he("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new he("selection",{init:function(t,e){return t.selection||te.atStart(e.doc)},apply:function(t){return t.selection}}),new he("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new he("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],me=function(t,e){var n=this;this.schema=t,this.fields=fe.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach((function(t){if(n.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");n.plugins.push(t),n.pluginsByKey[t.key]=t,t.spec.state&&n.fields.push(new he(t.key,t.spec.state,t))}))},ve=function(t){this.config=t},ge={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};ge.schema.get=function(){return this.config.schema},ge.plugins.get=function(){return this.config.plugins},ve.prototype.apply=function(t){return this.applyTransaction(t).state},ve.prototype.filterTransaction=function(t,e){void 0===e&&(e=-1);for(var n=0;n-1&&ye.splice(e,1)},Object.defineProperties(ve.prototype,ge);var ye=[];function be(t,e,n){for(var r in t){var o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=be(o,e,{})),n[r]=o}return n}var we=function(t){this.props={},t.props&&be(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:xe("plugin")};we.prototype.getState=function(t){return t[this.key]};var ke=Object.create(null);function xe(t){return t in ke?t+"$"+ ++ke[t]:(ke[t]=0,t+"$")}var Me=function(t){void 0===t&&(t="key"),this.key=xe(t)};Me.prototype.get=function(t){return t.config.pluginsByKey[this.key]},Me.prototype.getState=function(t){return t[this.key]};var Se={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var Oe=/Edge\/(\d+)/.exec(navigator.userAgent),Ce=/MSIE \d/.test(navigator.userAgent),Ne=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);Se.mac=/Mac/.test(navigator.platform);var _e=Se.ie=!!(Ce||Ne||Oe);Se.ie_version=Ce?document.documentMode||6:Ne?+Ne[1]:Oe?+Oe[1]:null,Se.gecko=!_e&&/gecko\/(\d+)/i.test(navigator.userAgent),Se.gecko_version=Se.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var Te=!_e&&/Chrome\/(\d+)/.exec(navigator.userAgent);Se.chrome=!!Te,Se.chrome_version=Te&&+Te[1],Se.safari=!_e&&/Apple Computer/.test(navigator.vendor),Se.ios=Se.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),Se.android=/Android \d/.test(navigator.userAgent),Se.webkit="webkitFontSmoothing"in document.documentElement.style,Se.webkit_version=Se.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var Ve=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},Ae=function(t){var e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e},Ee=null,De=function(t,e,n){var r=Ee||(Ee=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},Re=function(t,e,n,r){return n&&(Ie(t,e,n,r,-1)||Ie(t,e,n,r,1))},ze=/^(img|br|input|textarea|hr)$/i;function Ie(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Be(t))){var i=t.parentNode;if(1!=i.nodeType||Le(t)||ze.test(t.nodeName)||"false"==t.contentEditable)return!1;e=Ve(t)+(o<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?Be(t):0}}}function Be(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Le(t){for(var e,n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var Pe=function(t){var e=t.isCollapsed;return e&&Se.chrome&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function je(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function $e(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Fe(t,e){return"number"==typeof t?t:t[e]}function He(t){var e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function qe(t,e,n){for(var r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument,s=n||t.dom;s;s=Ae(s))if(1==s.nodeType){var a=s==i.body||1!=s.nodeType,c=a?$e(i):He(s),p=0,l=0;if(e.topc.bottom-Fe(r,"bottom")&&(l=e.bottom-c.bottom+Fe(o,"bottom")),e.leftc.right-Fe(r,"right")&&(p=e.right-c.right+Fe(o,"right")),p||l)if(a)i.defaultView.scrollBy(p,l);else{var d=s.scrollLeft,u=s.scrollTop;l&&(s.scrollTop+=l),p&&(s.scrollLeft+=p);var h=s.scrollLeft-d,f=s.scrollTop-u;e={left:e.left-h,top:e.top-f,right:e.right-h,bottom:e.bottom-f}}if(a)break}}function Je(t){for(var e=[],n=t.ownerDocument;t&&(e.push({dom:t,top:t.scrollTop,left:t.scrollLeft}),t!=n);t=Ae(t));return e}function We(t,e){for(var n=0;n=a){s=Math.max(u.bottom,s),a=Math.min(u.top,a);var h=u.left>e.left?u.left-e.left:u.right=(u.left+u.right)/2?1:0));continue}}!n&&(e.left>=u.right&&e.top>=u.top||e.left>=u.left&&e.top>=u.bottom)&&(i=p+1)}}return n&&3==n.nodeType?function(t,e){for(var n=t.nodeValue.length,r=document.createRange(),o=0;o=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:t,offset:i}:Ke(n,r)}function Ge(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Xe(t,e,n){var r=t.childNodes.length;if(r&&n.tope.top&&i++}o==t.dom&&i==o.childNodes.length-1&&1==o.lastChild.nodeType&&e.top>o.lastChild.getBoundingClientRect().bottom?p=t.state.doc.content.size:0!=i&&1==o.nodeType&&"BR"==o.childNodes[i-1].nodeName||(p=function(t,e,n,r){for(var o=-1,i=e;i!=t.dom;){var s=t.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>r.left||a.top>r.top)o=s.posBefore;else{if(!(a.right-1?o:t.docView.posFromDOM(e,n)}(t,o,i,e))}null==p&&(p=function(t,e,n){var r=Ke(e,n),o=r.node,i=r.offset,s=-1;if(1==o.nodeType&&!o.firstChild){var a=o.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(o,i,s)}(t,l,e));var m=t.docView.nearestDesc(l,!0);return{pos:p,inside:m?m.posAtStart-m.border:-1}}function Qe(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}var Ze=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function tn(t,e,n){var r=t.docView.domFromPos(e,n<0?-1:1),o=r.node,i=r.offset,s=Se.webkit||Se.gecko;if(3==o.nodeType){if(!s||!Ze.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){var a=i,c=i,p=n<0?1:-1;return n<0&&!i?(c++,p=-1):n>=0&&i==o.nodeValue.length?(a--,p=1):n<0?a--:c++,en(Qe(De(o,a,c),p),p<0)}var l=Qe(De(o,i,i),n);if(Se.gecko&&i&&/\s/.test(o.nodeValue[i-1])&&i=0)}if(i&&(n<0||i==Be(o))){var m=o.childNodes[i-1],v=3==m.nodeType?De(m,Be(m)-(s?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(v)return en(Qe(v,1),!1)}if(i=0)}function en(t,e){if(0==t.width)return t;var n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function nn(t,e){if(0==t.height)return t;var n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function rn(t,e,n){var r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}var on=/[\u0590-\u08ac]/;var sn=null,an=null,cn=!1;function pn(t,e,n){return sn==e&&an==n?cn:(sn=e,an=n,cn="up"==n||"down"==n?function(t,e,n){var r=e.selection,o="up"==n?r.$from:r.$to;return rn(t,e,(function(){for(var e=t.docView.domFromPos(o.pos,"up"==n?-1:1).node;;){var r=t.docView.nearestDesc(e,!0);if(!r)break;if(r.node.isBlock){e=r.dom;break}e=r.dom.parentNode}for(var i=tn(t,o.pos,1),s=e.firstChild;s;s=s.nextSibling){var a=void 0;if(1==s.nodeType)a=s.getClientRects();else{if(3!=s.nodeType)continue;a=De(s,0,s.nodeValue.length).getClientRects()}for(var c=0;cp.top&&("up"==n?p.bottomi.bottom-1))return!1}}return!0}))}(t,e,n):function(t,e,n){var r=e.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=getSelection();return on.test(r.parent.textContent)&&a.modify?rn(t,e,(function(){var e=a.getRangeAt(0),o=a.focusNode,i=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");var c=!(r.depth?t.docView.domAfterPos(r.before()):t.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(e),null!=s&&(a.caretBidiLevel=s),c})):"left"==n||"backward"==n?i:s}(t,e,n))}var ln=function(t,e,n,r){this.parent=t,this.children=e,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},dn={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}};ln.prototype.matchesWidget=function(){return!1},ln.prototype.matchesMark=function(){return!1},ln.prototype.matchesNode=function(){return!1},ln.prototype.matchesHack=function(t){return!1},dn.beforePosition.get=function(){return!1},ln.prototype.parseRule=function(){return null},ln.prototype.stopEvent=function(){return!1},dn.size.get=function(){for(var t=0,e=0;eVe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))a=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var c=t;;c=c.parentNode){if(c==this.dom){a=!1;break}if(c.parentNode.firstChild!=c)break}if(null==a&&e==t.childNodes.length)for(var p=t;;p=p.parentNode){if(p==this.dom){a=!0;break}if(p.parentNode.lastChild!=p)break}}return(null==a?n>0:a)?this.posAtEnd:this.posAtStart},ln.prototype.nearestDesc=function(t,e){for(var n=!0,r=t;r;r=r.parentNode){var o=this.getDesc(r);if(o&&(!e||o.node)){if(!n||!o.nodeDOM||(1==o.nodeDOM.nodeType?o.nodeDOM.contains(1==t.nodeType?t:t.parentNode):o.nodeDOM==t))return o;n=!1}}},ln.prototype.getDesc=function(t){for(var e=t.pmViewDesc,n=e;n;n=n.parent)if(n==this)return e},ln.prototype.posFromDOM=function(t,e,n){for(var r=t;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(t,e,n)}return-1},ln.prototype.descAt=function(t){for(var e=0,n=0;e=t:s>t)&&(s>t||r+1>=this.children.length||!this.children[r+1].beforePosition))return i.domFromPos(t-n-i.border,e);n=s}},ln.prototype.parseRange=function(t,e,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,s=0;;s++){var a=this.children[s],c=i+a.size;if(-1==r&&t<=c){var p=i+a.border;if(t>=p&&e<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(t,e,p);t=i;for(var l=s;l>0;l--){var d=this.children[l-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){r=Ve(d.dom)+1;break}t-=d.size}-1==r&&(r=0)}if(r>-1&&(c>e||s==this.children.length-1)){e=c;for(var u=s+1;ua&&ie){var x=l;l=d,d=x}var M=document.createRange();M.setEnd(d.node,d.offset),M.setStart(l.node,l.offset),u.removeAllRanges(),u.addRange(M)}}},ln.prototype.ignoreMutation=function(t){return!this.contentDOM&&"selection"!=t.type},dn.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},ln.prototype.markDirty=function(t,e){for(var n=0,r=0;r=n:tn){var s=n+o.border,a=i-o.border;if(t>=s&&e<=a)return this.dirty=t==n||e==i?2:1,void(t!=s||e!=a||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-s,e-s):o.dirty=3);o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM?2:3}n=i}this.dirty=2},ln.prototype.markParentsDirty=function(){for(var t=1,e=this.parent;e;e=e.parent,t++){var n=1==t?2:1;e.dirty0&&(i=En(i,0,t,r));for(var a=0;a-1?i:null,a=i&&i.pos<0,c=new Vn(this,s&&s.node);!function(t,e,n,r){var o=e.locals(t),i=0;if(0==o.length){for(var s=0;si;)p.push(o[c++]);var y=i+m.nodeSize;if(m.isText){var b=y;c=0&&!s&&c.syncToMarks(i==n.node.childCount?l.none:n.node.child(i).marks,r,t),c.placeWidget(e,t,o)}),(function(e,n,s,p){var l;c.syncToMarks(e.marks,r,t),c.findNodeMatch(e,n,s,p)||a&&t.state.selection.from>o&&t.state.selection.to-1&&c.updateNodeAt(e,n,s,l,t)||c.updateNextNode(e,n,s,t,p)||c.addNode(e,n,s,t,o),o+=e.nodeSize})),c.syncToMarks(un,r,t),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||2==this.dirty)&&(s&&this.protectLocalComposition(t,s),kn(this.contentDOM,this.children,t),Se.ios&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))},e.prototype.localCompositionInfo=function(t,e){var n=t.state.selection,r=n.from,o=n.to;if(!(!(t.state.selection instanceof re)||re+this.node.content.size)){var i=t.root.getSelection(),s=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];e=Be(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e=n){var l=c.lastIndexOf(e,r-a);if(l>=0&&l+e.length+a>=n)return a+l}}}return-1}(this.node.content,a,r-e,o-e);return c<0?null:{node:s,pos:c,text:a}}return{node:s,pos:-1}}}},e.prototype.protectLocalComposition=function(t,e){var n=e.node,r=e.pos,o=e.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=null)}var s=new fn(this,i,n,o);t.compositionNodes.push(s),this.children=En(this.children,r,r+o.length,t,s)}},e.prototype.update=function(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)},e.prototype.updateInner=function(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},e.prototype.updateOuterDeco=function(t){if(!_n(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=On(this.dom,this.nodeDOM,Sn(this.outerDeco,this.node,e),Sn(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=t}},e.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},e.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")},n.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(e.prototype,n),e}(ln);function gn(t,e,n,r,o){return Nn(r,e,t),new vn(null,t,e,n,r,r,r,o,0)}var yn=function(t){function e(e,n,r,o,i,s,a){t.call(this,e,n,r,o,i,null,s,a)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.parseRule=function(){for(var t=this.nodeDOM.parentNode;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}},e.prototype.update=function(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)},e.prototype.inParent=function(){for(var t=this.parent.contentDOM,e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1},e.prototype.domFromPos=function(t){return{node:this.nodeDOM,offset:t}},e.prototype.localPosFromDOM=function(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):t.prototype.localPosFromDOM.call(this,e,n,r)},e.prototype.ignoreMutation=function(t){return"characterData"!=t.type&&"selection"!=t.type},e.prototype.slice=function(t,n,r){var o=this.node.cut(t,n),i=document.createTextNode(o.text);return new e(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)},e.prototype.markDirty=function(e,n){t.prototype.markDirty.call(this,e,n),this.dom==this.nodeDOM||0!=e&&n!=this.nodeDOM.nodeValue.length||(this.dirty=3)},n.domAtom.get=function(){return!1},Object.defineProperties(e.prototype,n),e}(vn),bn=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.matchesHack=function(t){return 0==this.dirty&&this.dom.nodeName==t},n.domAtom.get=function(){return!0},Object.defineProperties(e.prototype,n),e}(ln),wn=function(t){function e(e,n,r,o,i,s,a,c,p,l){t.call(this,e,n,r,o,i,s,a,p,l),this.spec=c}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(e,n,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}return!(!this.contentDOM&&!e.isLeaf)&&t.prototype.update.call(this,e,n,r,o)},e.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():t.prototype.selectNode.call(this)},e.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():t.prototype.deselectNode.call(this)},e.prototype.setSelection=function(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):t.prototype.setSelection.call(this,e,n,r,o)},e.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),t.prototype.destroy.call(this)},e.prototype.stopEvent=function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)},e.prototype.ignoreMutation=function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):t.prototype.ignoreMutation.call(this,e)},e}(vn);function kn(t,e,n){for(var r=t.firstChild,o=!1,i=0;i0&&r>0;r--){var i=e[r-1],s=i.node;if(s){if(s!=t.child(n-1))break;--n,o.set(i,n)}}return{index:n,matched:o}}(t.node.content,t.children)};function An(t,e){return t.type.side-e.type.side}function En(t,e,n,r,o){for(var i=[],s=0,a=0;s=n||l<=e?i.push(c):(pn&&i.push(c.slice(n-p,c.size,r)))}return i}function Dn(t,e){var n=t.root.getSelection(),r=t.state.doc;if(!n.focusNode)return null;var o=t.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(n.focusNode,n.focusOffset);if(s<0)return null;var a,c,p=r.resolve(s);if(Pe(n)){for(a=p;o&&!o.node;)o=o.parent;if(o&&o.node.isAtom&&ie.isSelectable(o.node)&&o.parent&&(!o.node.isInline||!function(t,e,n){for(var r=0==e,o=e==Be(t);r||o;){if(t==n)return!0;var i=Ve(t);if(!(t=t.parentNode))return!1;r=r&&0==i,o=o&&i==Be(t)}}(n.focusNode,n.focusOffset,o.dom))){var l=o.posBefore;c=new ie(s==l?p:r.resolve(l))}}else{var d=t.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(d<0)return null;a=r.resolve(d)}c||(c=Fn(t,a,p,"pointer"==e||t.state.selection.head>1,i=Math.min(o,t.length);r-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{var c=mn.create(this.top,t[o],e,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}},Vn.prototype.findNodeMatch=function(t,e,n,r){var o=this.top.children,i=-1;if(r>=this.preMatch.index){for(var s=this.index;s0?r.max(o):r.min(o),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&te.findFrom(s,e)}function Jn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Wn(t,e,n){var r=t.state.selection;if(!(r instanceof re)){if(r instanceof ie&&r.node.isInline)return Jn(t,new re(e>0?r.$to:r.$from));var o=qn(t.state,e);return!!o&&Jn(t,o)}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){var i=qn(t.state,e);return!!(i&&i instanceof ie)&&Jn(t,i)}if(!(Se.mac&&n.indexOf("m")>-1)){var s,a=r.$head,c=a.textOffset?null:e<0?a.nodeBefore:a.nodeAfter;if(!c||c.isText)return!1;var p=e<0?a.pos-c.nodeSize:a.pos;return!!(c.isAtom||(s=t.docView.descAt(p))&&!s.contentDOM)&&(ie.isSelectable(c)?Jn(t,new ie(e<0?t.state.doc.resolve(a.pos-c.nodeSize):a)):!!Se.webkit&&Jn(t,new re(t.state.doc.resolve(e<0?p:p+c.nodeSize))))}}function Un(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Kn(t){var e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Gn(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){var o,i,s=!1;for(Se.gecko&&1==n.nodeType&&r0){if(1!=n.nodeType)break;var a=n.childNodes[r-1];if(Kn(a))o=n,i=--r;else{if(3!=a.nodeType)break;r=(n=a).nodeValue.length}}else{if(Yn(n))break;for(var c=n.previousSibling;c&&Kn(c);)o=n.parentNode,i=Ve(c),c=c.previousSibling;if(c)r=Un(n=c);else{if((n=n.parentNode)==t.dom)break;r=0}}s?Qn(t,e,n,r):o&&Qn(t,e,o,i)}}function Xn(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){for(var o,i,s=Un(n);;)if(r-1)return!1;if(Se.mac&&n.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){var s=qn(t.state,e);if(s&&s instanceof ie)return Jn(t,s)}if(!o.parent.inlineContent){var a=e<0?o:i,c=r instanceof ae?te.near(a,e):te.findFrom(a,e);return!!c&&Jn(t,c)}return!1}function tr(t,e){if(!(t.state.selection instanceof re))return!0;var n=t.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var s=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){var a=t.state.tr;return e<0?a.delete(r.pos-s.nodeSize,r.pos):a.delete(r.pos,r.pos+s.nodeSize),t.dispatch(a),!0}return!1}function er(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function nr(t,e){var n=e.keyCode,r=function(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||Se.mac&&72==n&&"c"==r?tr(t,-1)||Gn(t):46==n||Se.mac&&68==n&&"c"==r?tr(t,1)||Xn(t):13==n||27==n||(37==n?Wn(t,-1,r)||Gn(t):39==n?Wn(t,1,r)||Xn(t):38==n?Zn(t,-1,r)||Gn(t):40==n?function(t){if(Se.safari&&!(t.state.selection.$head.parentOffset>0)){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;er(t,o,!0),setTimeout((function(){return er(t,o,!1)}),20)}}}(t)||Zn(t,1,r)||Xn(t):r==(Se.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function rr(t){var e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(Se.safari&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(t.parentNode.lastChild==t||Se.safari&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0}}function or(t,e,n,r,o){if(e<0){var s=t.lastSelectionTime>Date.now()-50?t.lastSelectionOrigin:null,a=Dn(t,s);if(a&&!t.state.selection.eq(a)){var c=t.state.tr.setSelection(a);"pointer"==s?c.setMeta("pointer",!0):"key"==s&&c.scrollIntoView(),t.dispatch(c)}}else{var p=t.state.doc.resolve(e),l=p.sharedDepth(n);e=p.before(l+1),n=t.state.doc.resolve(n).after(l+1);var d=t.state.selection,u=function(t,e,n){var r=t.docView.parseRange(e,n),o=r.node,i=r.fromOffset,s=r.toOffset,a=r.from,c=r.to,p=t.root.getSelection(),l=null,d=p.anchorNode;if(d&&t.dom.contains(1==d.nodeType?d:d.parentNode)&&(l=[{node:d,offset:p.anchorOffset}],Pe(p)||l.push({node:p.focusNode,offset:p.focusOffset})),Se.chrome&&8===t.lastKeyCode)for(var u=s;u>i;u--){var h=o.childNodes[u-1],f=h.pmViewDesc;if("BR"==h.nodeName&&!f){s=u;break}if(!f||f.size)break}var m=t.state.doc,v=t.someProp("domParser")||ot.fromSchema(t.state.schema),g=m.resolve(a),y=null,b=v.parse(o,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:s,preserveWhitespace:!g.parent.type.spec.code||"full",editableContent:!0,findPositions:l,ruleFromNode:rr,context:g});if(l&&null!=l[0].pos){var w=l[0].pos,k=l[1]&&l[1].pos;null==k&&(k=w),y={anchor:w+a,head:k+a}}return{doc:b,sel:y,from:a,to:c}}(t,e,n);if(Se.chrome&&t.cursorWrapper&&u.sel&&u.sel.anchor==t.cursorWrapper.deco.from){var h=t.cursorWrapper.deco.type.toDOM.nextSibling,f=h&&h.nodeValue?h.nodeValue.length:1;u.sel={anchor:u.sel.anchor+f,head:u.sel.anchor+f}}var m,v,g=t.state.doc,y=g.slice(u.from,u.to);8===t.lastKeyCode&&Date.now()-100=a?i-r:0)+(c-a),a=i}else if(c=c?i-r:0)+(a-c),c=i}return{start:i,endA:a,endB:c}}(y.content,u.doc.content,u.from,m,v);if(!b){if(!(r&&d instanceof re&&!d.empty&&d.$head.sameParent(d.$anchor))||t.composing||u.sel&&u.sel.anchor!=u.sel.head){if((Se.ios&&t.lastIOSEnter>Date.now()-225||Se.android)&&o.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName}))&&t.someProp("handleKeyDown",(function(e){return e(t,je(13,"Enter"))})))return void(t.lastIOSEnter=0);if(u.sel){var w=ir(t,t.state.doc,u.sel);w&&!w.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(w))}return}b={start:d.from,endA:d.to,endB:d.to}}t.domChangeCount++,t.state.selection.fromt.state.selection.from&&b.start<=t.state.selection.from+2?b.start=t.state.selection.from:b.endA=t.state.selection.to-2&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),Se.ie&&Se.ie_version<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>u.from&&"  "==u.doc.textBetween(b.start-u.from-1,b.start-u.from+1)&&(b.start--,b.endA--,b.endB--);var k,x=u.doc.resolveNoCache(b.start-u.from),M=u.doc.resolveNoCache(b.endB-u.from),S=x.sameParent(M)&&x.parent.inlineContent;if((Se.ios&&t.lastIOSEnter>Date.now()-225&&(!S||o.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName})))||!S&&x.posb.start&&function(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||sr(r,!0,!1)n||sr(s,!0,!1)e.content.size?null:Fn(t,e.resolve(n.anchor),e.resolve(n.head))}function sr(t,e,n){for(var r=t.depth,o=e?t.end():t.pos;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n)for(var i=t.node(r).maybeChild(t.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function ar(t,e){for(var n=[],r=e.content,o=e.openStart,i=e.openEnd;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;var s=r.firstChild;n.push(s.type.name,s.attrs!=s.type.defaultAttrs?s.attrs:null),r=s.content}var a=t.someProp("clipboardSerializer")||mt.fromSchema(t.state.schema),c=mr(),p=c.createElement("div");p.appendChild(a.serializeFragment(r,{document:c}));for(var l,d=p.firstChild;d&&1==d.nodeType&&(l=hr[d.nodeName.toLowerCase()]);){for(var u=l.length-1;u>=0;u--){for(var h=c.createElement(l[u]);p.firstChild;)h.appendChild(p.firstChild);p.appendChild(h)}d=p.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",o+" "+i+" "+JSON.stringify(n)),{dom:p,text:t.someProp("clipboardTextSerializer",(function(t){return t(e)}))||e.content.textBetween(0,e.content.size,"\n\n")}}function cr(t,e,n,r,o){var s,a,c=o.parent.type.spec.code;if(!n&&!e)return null;var p=e&&(r||c||!n);if(p){if(t.someProp("transformPastedText",(function(t){e=t(e,c||r)})),c)return new u(i.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0);var l=t.someProp("clipboardTextParser",(function(t){return t(e,o,r)}));if(l)a=l;else{var d=o.marks(),h=t.state.schema,f=mt.fromSchema(h);s=document.createElement("div"),e.trim().split(/(?:\r\n?|\n)+/).forEach((function(t){s.appendChild(document.createElement("p")).appendChild(f.serializeNode(h.text(t,d)))}))}}else t.someProp("transformPastedHTML",(function(t){n=t(n)})),s=function(t){var e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,r=mr().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(t);(n=o&&hr[o[1].toLowerCase()])&&(t=n.map((function(t){return"<"+t+">"})).join("")+t+n.map((function(t){return""})).reverse().join(""));if(r.innerHTML=t,n)for(var i=0;i=0;c-=2){var p=r.nodes[n[c]];if(!p||p.hasRequiredAttrs())break;o=i.from(p.create(n[c+1],o)),s++,a++}return new u(o,s,a)}(function(t,e,n){e=0;r--){var o=n(r);if(o)return o.v}return t}(a.content,o),!1),t.someProp("transformPasted",(function(t){a=t(a)})),a}function pr(t,e,n){void 0===n&&(n=0);for(var r=e.length-1;r>=n;r--)t=e[r].create(null,i.from(t));return t}function lr(t,e,n,r,o){if(o=n&&(c=e<0?a.contentMatchAt(0).fillBefore(c,t.childCount>1||s<=o).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(i.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(c))}var hr={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},fr=null;function mr(){return fr||(fr=document.implementation.createHTMLDocument("title"))}var vr={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},gr=Se.ie&&Se.ie_version<=11,yr=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};yr.prototype.set=function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset},yr.prototype.eq=function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset};var br=function(t,e){var n=this;this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver((function(t){for(var e=0;et.target.nodeValue.length}))?n.flushSoon():n.flush()})),this.currentSelection=new yr,gr&&(this.onCharData=function(t){n.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};br.prototype.flushSoon=function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){t.flushingSoon=-1,t.flush()}),20))},br.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},br.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,vr),gr&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},br.prototype.stop=function(){var t=this;if(this.observer){var e=this.observer.takeRecords();if(e.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 e=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&Hn(this.view)&&!this.ignoreSelectionChange(e),r=-1,o=-1,i=!1,s=[];if(this.view.editable)for(var a=0;a1){var p=s.filter((function(t){return"BR"==t.nodeName}));if(2==p.length){var l=p[0],d=p[1];l.parentNode&&l.parentNode.parentNode==d.parentNode?d.remove():l.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(t){if(wr)return;wr=!0,"normal"==getComputedStyle(t.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(r,o,i,s),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(e)||zn(this.view),this.currentSelection.set(e))}},br.prototype.registerMutation=function(t,e){if(e.indexOf(t.target)>-1)return null;var n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(var r=0;ri.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function _r(t,e,n){t.focused||t.focus();var r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function Tr(t,e,n,r,o){return Nr(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(function(n){return n(t,e,r)}))||(o?function(t,e){if(-1==e)return!1;var n,r,o=t.state.selection;o instanceof ie&&(n=o.node);for(var i=t.state.doc.resolve(e),s=i.depth+1;s>0;s--){var a=s>i.depth?i.nodeAfter:i.node(s);if(ie.isSelectable(a)){r=n&&o.$from.depth>0&&s>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(s);break}}return null!=r&&(_r(t,ie.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&ie.isSelectable(r))&&(_r(t,new ie(n),"pointer"),!0)}(t,n))}function Vr(t,e,n,r){return Nr(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(function(n){return n(t,e,r)}))}function Ar(t,e,n,r){return Nr(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(function(n){return n(t,e,r)}))||function(t,e,n){if(0!=n.button)return!1;var r=t.state.doc;if(-1==e)return!!r.inlineContent&&(_r(t,re.create(r,0,r.content.size),"pointer"),!0);for(var o=r.resolve(e),i=o.depth+1;i>0;i--){var s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)_r(t,re.create(r,a+1,a+1+s.content.size),"pointer");else{if(!ie.isSelectable(s))continue;_r(t,ie.create(r,a),"pointer")}return!0}}(t,n,r)}function Er(t){return Pr(t)}xr.keydown=function(t,e){if(t.shiftKey=16==e.keyCode||e.shiftKey,!zr(t,e))if(229!=e.keyCode&&t.domObserver.forceFlush(),t.lastKeyCode=e.keyCode,t.lastKeyCodeTime=Date.now(),!Se.ios||13!=e.keyCode||e.ctrlKey||e.altKey||e.metaKey)t.someProp("handleKeyDown",(function(n){return n(t,e)}))||nr(t,e)?e.preventDefault():Mr(t,"key");else{var n=Date.now();t.lastIOSEnter=n,t.lastIOSEnterFallbackTimeout=setTimeout((function(){t.lastIOSEnter==n&&(t.someProp("handleKeyDown",(function(e){return e(t,je(13,"Enter"))})),t.lastIOSEnter=0)}),200)}},xr.keyup=function(t,e){16==e.keyCode&&(t.shiftKey=!1)},xr.keypress=function(t,e){if(!(zr(t,e)||!e.charCode||e.ctrlKey&&!e.altKey||Se.mac&&e.metaKey))if(t.someProp("handleKeyPress",(function(n){return n(t,e)})))e.preventDefault();else{var n=t.state.selection;if(!(n instanceof re&&n.$from.sameParent(n.$to))){var r=String.fromCharCode(e.charCode);t.someProp("handleTextInput",(function(e){return e(t,n.$from.pos,n.$to.pos,r)}))||t.dispatch(t.state.tr.insertText(r).scrollIntoView()),e.preventDefault()}}};var Dr=Se.mac?"metaKey":"ctrlKey";kr.mousedown=function(t,e){t.shiftKey=e.shiftKey;var n=Er(t),r=Date.now(),o="singleClick";r-t.lastClick.time<500&&function(t,e){var n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(e,t.lastClick)&&!e[Dr]&&("singleClick"==t.lastClick.type?o="doubleClick":"doubleClick"==t.lastClick.type&&(o="tripleClick")),t.lastClick={time:r,x:e.clientX,y:e.clientY,type:o};var i=t.posAtCoords(Cr(e));i&&("singleClick"==o?(t.mouseDown&&t.mouseDown.done(),t.mouseDown=new Rr(t,i,e,n)):("doubleClick"==o?Vr:Ar)(t,i.pos,i.inside,e)?e.preventDefault():Mr(t,"pointer"))};var Rr=function(t,e,n,r){var o,i,s=this;if(this.view=t,this.startDoc=t.state.doc,this.pos=e,this.event=n,this.flushed=r,this.selectNode=n[Dr],this.allowDefault=n.shiftKey,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{var a=t.state.doc.resolve(e.pos);o=a.parent,i=a.depth?a.before():0}this.mightDrag=null;var c=r?null:n.target,p=c?t.docView.nearestDesc(c,!0):null;this.target=p?p.dom:null;var l=t.state.selection;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof ie&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&Se.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(){s.view.mouseDown==s&&s.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)),Mr(t,"pointer")};function zr(t,e){return!!t.composing||!!(Se.safari&&Math.abs(e.timeStamp-t.compositionEndedAt)<500)&&(t.compositionEndedAt=-2e8,!0)}Rr.prototype.done=function(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.view.mouseDown=null},Rr.prototype.up=function(t){if(this.done(),this.view.dom.contains(3==t.target.nodeType?t.target.parentNode:t.target)){var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Cr(t))),this.allowDefault||!e?Mr(this.view,"pointer"):Tr(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||Se.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||Se.chrome&&!(this.view.state.selection instanceof re)&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(_r(this.view,te.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):Mr(this.view,"pointer")}},Rr.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),Mr(this.view,"pointer"),0==t.buttons&&this.done()},kr.touchdown=function(t){Er(t),Mr(t,"pointer")},kr.contextmenu=function(t){return Er(t)};var Ir=Se.android?5e3:-1;function Br(t,e){clearTimeout(t.composingTimeout),e>-1&&(t.composingTimeout=setTimeout((function(){return Pr(t)}),e))}function Lr(t){for(t.composing=!1;t.compositionNodes.length>0;)t.compositionNodes.pop().markParentsDirty()}function Pr(t,e){if(t.domObserver.forceFlush(),Lr(t),e||t.docView.dirty){var n=Dn(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}xr.compositionstart=xr.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var e=t.state,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(t){return!1===t.type.spec.inclusive}))))t.markCursor=t.state.storedMarks||n.marks(),Pr(t,!0),t.markCursor=null;else if(Pr(t),Se.gecko&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=t.root.getSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(3==s.nodeType){r.collapse(s,s.nodeValue.length);break}o=s,i=-1}t.composing=!0}Br(t,Ir)},xr.compositionend=function(t,e){t.composing&&(t.composing=!1,t.compositionEndedAt=e.timeStamp,Br(t,20))};var jr=Se.ie&&Se.ie_version<15||Se.ios&&Se.webkit_version<604;function $r(t,e,n,r){var o=cr(t,e,n,t.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(function(e){return e(t,r,o||u.empty)})))return!0;if(!o)return!1;var i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),s=i?t.state.tr.replaceSelectionWith(i,t.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}kr.copy=xr.cut=function(t,e){var n=t.state.selection,r="cut"==e.type;if(!n.empty){var o=jr?null:e.clipboardData,i=ar(t,n.content()),s=i.dom,a=i.text;o?(e.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",a)):function(t,e){if(t.dom.parentNode){var n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}}(t,s),r&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},xr.paste=function(t,e){var n=jr?null:e.clipboardData;n&&$r(t,n.getData("text/plain"),n.getData("text/html"),e)?e.preventDefault():function(t,e){if(t.dom.parentNode){var n=t.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?$r(t,r.value,null,e):$r(t,r.textContent,r.innerHTML,e)}),50)}}(t,e)};var Fr=function(t,e){this.slice=t,this.move=e},Hr=Se.mac?"altKey":"ctrlKey";for(var qr in kr.dragstart=function(t,e){var n=t.mouseDown;if(n&&n.done(),e.dataTransfer){var r=t.state.selection,o=r.empty?null:t.posAtCoords(Cr(e));if(o&&o.pos>=r.from&&o.pos<=(r instanceof ie?r.to-1:r.to));else if(n&&n.mightDrag)t.dispatch(t.state.tr.setSelection(ie.create(t.state.doc,n.mightDrag.pos)));else if(e.target&&1==e.target.nodeType){var i=t.docView.nearestDesc(e.target,!0);i&&i.node.type.spec.draggable&&i!=t.docView&&t.dispatch(t.state.tr.setSelection(ie.create(t.state.doc,i.posBefore)))}var s=t.state.selection.content(),a=ar(t,s),c=a.dom,p=a.text;e.dataTransfer.clearData(),e.dataTransfer.setData(jr?"Text":"text/html",c.innerHTML),e.dataTransfer.effectAllowed="copyMove",jr||e.dataTransfer.setData("text/plain",p),t.dragging=new Fr(s,!e[Hr])}},kr.dragend=function(t){var e=t.dragging;window.setTimeout((function(){t.dragging==e&&(t.dragging=null)}),50)},xr.dragover=xr.dragenter=function(t,e){return e.preventDefault()},xr.drop=function(t,e){var n=t.dragging;if(t.dragging=null,e.dataTransfer){var r=t.posAtCoords(Cr(e));if(r){var o=t.state.doc.resolve(r.pos);if(o){var i=n&&n.slice;i?t.someProp("transformPasted",(function(t){i=t(i)})):i=cr(t,e.dataTransfer.getData(jr?"Text":"text/plain"),jr?null:e.dataTransfer.getData("text/html"),!1,o);var s=n&&!e[Hr];if(t.someProp("handleDrop",(function(n){return n(t,e,i||u.empty,s)})))e.preventDefault();else if(i){e.preventDefault();var a=i?Pt(t.state.doc,o.pos,i):o.pos;null==a&&(a=o.pos);var c=t.state.tr;s&&c.deleteSelection();var p=c.mapping.map(a),l=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,d=c.doc;if(l?c.replaceRangeWith(p,p,i.content.firstChild):c.replaceRange(p,p,i),!c.doc.eq(d)){var h=c.doc.resolve(p);if(l&&ie.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new ie(h));else{var f=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((function(t,e,n,r){return f=r})),c.setSelection(Fn(t,h,c.doc.resolve(f)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))}}}}}},kr.focus=function(t){t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.root.getSelection())&&zn(t)}),20))},kr.blur=function(t){t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),t.domObserver.currentSelection.set({}),t.focused=!1)},kr.beforeinput=function(t,e){if(Se.chrome&&Se.android&&"deleteContentBackward"==e.inputType){var n=t.domChangeCount;setTimeout((function(){if(t.domChangeCount==n&&(t.dom.blur(),t.focus(),!t.someProp("handleKeyDown",(function(e){return e(t,je(8,"Backspace"))})))){var e=t.state.selection.$cursor;e&&e.pos>0&&t.dispatch(t.state.tr.delete(e.pos-1,e.pos).scrollIntoView())}}),50)}},xr)kr[qr]=xr[qr];function Jr(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var r in e)if(!(r in t))return!1;return!0}var Wr=function(t,e){this.spec=e||Qr,this.side=this.spec.side||0,this.toDOM=t};Wr.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new Gr(i-n,i-n,this)},Wr.prototype.valid=function(){return!0},Wr.prototype.eq=function(t){return this==t||t instanceof Wr&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Jr(this.spec,t.spec))};var Ur=function(t,e){this.spec=e||Qr,this.attrs=t};Ur.prototype.map=function(t,e,n,r){var o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Gr(o,i,this)},Ur.prototype.valid=function(t,e){return e.from=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;at){var c=this.children[a]+1;this.children[a+2].findInner(t-c,e-c,n,r+c,o)}},Zr.prototype.map=function(t,e,n){return this==to||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Qr)},Zr.prototype.mapInner=function(t,e,n,r,o){for(var i,s=0;sc+i||(e>=a[s]+i?a[s+1]=-1:n>=o&&(p=r-n-(e-t))&&(a[s]+=p,a[s+1]+=p))}},p=0;p=r.content.size){l=!0;continue}var f=n.map(t[d+1]+i,-1)-o,m=r.content.findIndex(h),v=m.index,g=m.offset,y=r.maybeChild(v);if(y&&g==h&&g+y.nodeSize==f){var b=a[d+2].mapInner(n,y,u+1,t[d]+i+1,s);b!=to?(a[d]=h,a[d+1]=f,a[d+2]=b):(a[d+1]=-2,l=!0)}else l=!0}if(l){var w=io(function(t,e,n,r,o,i,s){function a(t,e){for(var i=0;is&&p.to=t){this.children[o]==t&&(n=this.children[o+2]);break}for(var i=t+1,s=i+e.content.size,a=0;ai&&c.type instanceof Ur){var p=Math.max(i,c.from)-i,l=Math.min(s,c.to)-i;pn&&s.to0;)e++;t.splice(e,0,n)}function po(t){var e=[];return t.someProp("decorations",(function(n){var r=n(t.state);r&&r!=to&&e.push(r)})),t.cursorWrapper&&e.push(Zr.create(t.state.doc,[t.cursorWrapper.deco])),eo.from(e)}eo.prototype.forChild=function(t,e){if(e.isLeaf)return Zr.empty;for(var n=[],r=0;rr.scrollToSelection?"to selection":"preserve",l=o||!this.docView.matchesNode(t.doc,c,a);!l&&t.selection.eq(r.selection)||(i=!0);var d,u,h,f,m,v,g,y,b,w,k,x="preserve"==p&&i&&null==this.dom.style.overflowAnchor&&function(t){for(var e,n,r=t.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,s=o+1;s=o-20){e=a,n=c.top;break}}}return{refDOM:e,refTop:n,stack:Je(t.dom)}}(this);if(i){this.domObserver.stop();var M=l&&(Se.ie||Se.chrome)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&(f=r.selection,m=t.selection,v=Math.min(f.$anchor.sharedDepth(f.head),m.$anchor.sharedDepth(m.head)),f.$anchor.start(v)!=m.$anchor.start(v));if(l){var S=Se.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!o&&this.docView.update(t.doc,c,a,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=gn(t.doc,c,a,this.dom,this)),S&&!this.trackWrites&&(M=!0)}M||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(d=this,u=d.docView.domFromPos(d.state.selection.anchor,0),h=d.root.getSelection(),Re(u.node,u.offset,h.anchorNode,h.anchorOffset)))?zn(this,M):(jn(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),"reset"==p)this.dom.scrollTop=0;else if("to selection"==p){var O=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",(function(t){return t(n)}))||(t.selection instanceof ie?qe(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect(),O):qe(this,this.coordsAtPos(t.selection.head,1),O))}else x&&(y=(g=x).refDOM,b=g.refTop,w=g.stack,k=y?y.getBoundingClientRect().top:0,We(w,0==k?0:k-b))},lo.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()},lo.prototype.updatePluginViews=function(t){if(t&&t.plugins==this.state.plugins)for(var e=0;e",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},bo="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),wo="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),ko="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),xo="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Mo="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),So=bo&&(xo||+bo[1]<57)||ko&&xo,Oo=0;Oo<10;Oo++)go[48+Oo]=go[96+Oo]=String(Oo);for(Oo=1;Oo<=24;Oo++)go[Oo+111]="F"+Oo;for(Oo=65;Oo<=90;Oo++)go[Oo]=String.fromCharCode(Oo+32),yo[Oo]=String.fromCharCode(Oo);for(var Co in go)yo.hasOwnProperty(Co)||(yo[Co]=go[Co]);var No="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);function _o(t){var e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(var a=0;a127)&&(r=go[n.keyCode])&&r!=o){var a=e[To(r,n,!0)];if(a&&a(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){var c=e[To(o,n,!0)];if(c&&c(t.state,t.dispatch,t))return!0}return!1}}var Ao=function(t,e){var n;this.match=t,this.handler="string"==typeof e?(n=e,function(t,e,r,o){var i=n;if(e[1]){var s=e[0].lastIndexOf(e[1]);i+=e[0].slice(s+e[1].length);var a=(r+=s)-o;a>0&&(i=e[0].slice(s-a,s)+i,r=o)}return t.tr.insertText(i,r,o)}):e};function Eo(t,e,n,r,o,i){if(t.composing)return!1;var s=t.state,a=s.doc.resolve(e);if(a.parent.type.spec.code)return!1;for(var c=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r,p=0;p0))return!1;var o=Po(r);if(!o){var i=r.blockRange(),s=i&&Rt(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}var a=o.nodeBefore;if(!a.type.spec.isolating&&Xo(t,o,e))return!0;if(0==r.parent.content.size&&(Bo(a,"end")||ie.isSelectable(a))){if(e){var c=t.tr.deleteRange(r.before(),r.after());c.setSelection(Bo(a,"end")?te.findFrom(c.doc.resolve(c.mapping.map(o.pos,-1)),-1):ie.create(c.doc,o.pos-a.nodeSize)),e(c.scrollIntoView())}return!0}return!(!a.isAtom||o.depth!=r.depth-1)&&(e&&e(t.tr.delete(o.pos-a.nodeSize,o.pos).scrollIntoView()),!0)}function Bo(t,e,n){for(;t;t="start"==e?t.firstChild:t.lastChild){if(t.isTextblock)return!0;if(n&&1!=t.childCount)return!1}return!1}function Lo(t,e,n){var r=t.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):o.parentOffset>0)return!1;i=Po(o)}var s=i&&i.nodeBefore;return!(!s||!ie.isSelectable(s))&&(e&&e(t.tr.setSelection(ie.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)}function Po(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function jo(t,e,n){var r=t.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){var n=t.node(e);if(t.index(e)+11&&n.after()!=n.end(-1)){var r=n.before();if(Bt(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&Rt(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)}function Go(t,e){return e&&e(t.tr.setSelection(new ae(t.doc))),!0}function Xo(t,e,n){var r,o,s=e.nodeBefore,a=e.nodeAfter;if(s.type.spec.isolating||a.type.spec.isolating)return!1;if(function(t,e,n){var r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(i,i+1)||!o.isTextblock&&!Lt(t.doc,e.pos)||(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,n))return!0;var c=e.parent.canReplace(e.index(),e.index()+1);if(c&&(r=(o=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&o.matchType(r[0]||a.type).validEnd){if(n){for(var p=e.pos+a.nodeSize,l=i.empty,d=r.length-1;d>=0;d--)l=i.from(r[d].create(null,l));l=i.from(s.copy(l));var h=t.tr.step(new At(e.pos-1,p,e.pos,p,new u(l,1,0),r.length,!0)),f=p+2*r.length;Lt(h.doc,f)&&h.join(f),n(h.scrollIntoView())}return!0}var m=te.findFrom(e,1),v=m&&m.$from.blockRange(m.$to),g=v&&Rt(v);if(null!=g&&g>=e.depth)return n&&n(t.tr.lift(v,g).scrollIntoView()),!0;if(c&&Bo(a,"start",!0)&&Bo(s,"end")){for(var y=s,b=[];b.push(y),!y.isTextblock;)y=y.lastChild;for(var w=a,k=1;!w.isTextblock;w=w.firstChild)k++;if(y.canReplace(y.childCount,y.childCount,w.content)){if(n){for(var x=i.empty,M=b.length-1;M>=0;M--)x=i.from(b[M].copy(x));n(t.tr.step(new At(e.pos-b.length,e.pos+a.nodeSize,e.pos+k,e.pos+a.nodeSize-k,new u(x,b.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Yo(t,e){return function(n,r){var o=n.selection,i=o.$from,s=o.$to,a=i.blockRange(s),c=a&&zt(a,t,e);return!!c&&(r&&r(n.tr.wrap(a,c).scrollIntoView()),!0)}}function Qo(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(e,n,r){for(var o=0;o=2&&s.node(c.depth-1).type.compatibleContent(t)&&0==c.startIndex){if(0==s.index(c.depth-1))return!1;var d=n.doc.resolve(c.start-2);l=new V(d,d,c.depth),c.endIndex=0;a--)s=i.from(n[a].type.create(n[a].attrs,s));t.step(new At(e.start-(r?2:0),e.end,e.start,e.end,new u(s,0,0),n.length,!0));for(var c=0,p=0;pc;a--)s-=o.child(a).nodeSize,r.delete(s-1,s+1);var p=r.doc.resolve(n.start),l=p.nodeAfter,d=0==n.startIndex,h=n.endIndex==o.childCount,f=p.node(-1),m=p.index(-1);if(!f.canReplace(m+(d?0:1),m+1,l.content.append(h?i.empty:i.from(o))))return!1;var v=p.pos,g=v+l.nodeSize;return r.step(new At(v-(d?1:0),g+(h?1:0),v+1,g-1,new u((d?i.empty:i.from(o.copy(i.empty))).append(h?i.empty:i.from(o.copy(i.empty))),d?0:1,h?0:1),d?0:1)),e(r.scrollIntoView()),!0}(e,n,a)))}}function ei(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function ni(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function ri(t,e){const n=ni(e,t.schema),{from:r,to:o}=t.selection;let i=[];t.doc.nodesBetween(r,o,(t=>{i=[...i,t]}));const s=i.reverse().find((t=>t.type.name===n.name));return s?__spreadValues({},s.attrs):{}}function oi(t,e){if("string"==typeof t){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function ii(t,e){const n=oi(e,t.schema),{from:r,to:o,empty:i}=t.selection;let s=[];i?s=t.selection.$head.marks():t.doc.nodesBetween(r,o,(t=>{s=[...s,...t.marks]}));const a=s.find((t=>t.type.name===n.name));return a?__spreadValues({},a.attrs):{}}function si(t,e){const n=Object.keys(e);return!n.length||!!n.filter((n=>e[n]===t[n])).length}function ai(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?ni(e,t.schema):null;let a=[];if(t.doc.nodesBetween(r,o,((t,e)=>{if(!t.isText){const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);a=[...a,{node:t,from:n,to:i}]}})),i)return!!a.filter((t=>!s||s.name===t.node.type.name)).find((t=>si(t.node.attrs,n)));const c=o-r;return a.filter((t=>!s||s.name===t.node.type.name)).filter((t=>si(t.node.attrs,n))).reduce(((t,e)=>t+(e.to-e.from)),0)>=c}function ci(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?oi(e,t.schema):null;if(i)return!!(t.storedMarks||t.selection.$from.marks()).filter((t=>!s||s.name===t.type.name)).find((t=>si(t.attrs,n)));let a=0,c=[];if(t.doc.nodesBetween(r,o,((t,e)=>{if(t.isText){const n=Math.max(r,e),i=Math.min(o,e+t.nodeSize);a+=i-n,c=[...c,...t.marks.map((t=>({mark:t,from:n,to:i})))]}})),0===a)return!1;const p=c.filter((t=>!s||s.name===t.mark.type.name)).filter((t=>si(t.mark.attrs,n))).reduce(((t,e)=>t+(e.to-e.from)),0),l=c.filter((t=>!s||t.mark.type!==s&&t.mark.type.excludes(s))).reduce(((t,e)=>t+(e.to-e.from)),0);return(p>0?p+l:p)>=a}function pi(t){const e=`${t}`;return(new window.DOMParser).parseFromString(e,"text/html").body}function li(t,e,n){if(n=__spreadValues({slice:!0,parseOptions:{}},n),"object"==typeof t&&null!==t)try{return Array.isArray(t)?i.fromArray(t.map((t=>e.nodeFromJSON(t)))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),li("",e,n)}if("string"==typeof t){const r=ot.fromSchema(e);return n.slice?r.parseSlice(pi(t),n.parseOptions).content:r.parse(pi(t),n.parseOptions)}return li("",e,n)}function di(t,e,n={}){return li(t,e,{slice:!1,parseOptions:n})}Qo(qo,Uo,Ko,(function(t,e){var n=t.selection,r=n.$from,o=n.$to;if(t.selection instanceof ie&&t.selection.node.isBlock)return!(!r.parentOffset||!Bt(t.doc,r.pos))&&(e&&e(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(e){var i=o.parentOffset==o.parent.content.size,s=t.tr;(t.selection instanceof re||t.selection instanceof ae)&&s.deleteSelection();var a=0==r.depth?null:Jo(r.node(-1).contentMatchAt(r.indexAfter(-1))),c=i&&a?[{type:a}]:null,p=Bt(s.doc,s.mapping.map(r.pos),1,c);if(c||p||!Bt(s.doc,s.mapping.map(r.pos),1,a&&[{type:a}])||(c=[{type:a}],p=!0),p&&(s.split(s.mapping.map(r.pos),1,c),!i&&!r.parentOffset&&r.parent.type!=a)){var l=s.mapping.map(r.before()),d=s.doc.resolve(l);r.node(-1).canReplaceWith(d.index(),d.index()+1,a)&&s.setNodeMarkup(s.mapping.map(r.before()),a)}e(s.scrollIntoView())}return!0})),"undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&os.platform();class ui{constructor(t,e){this.editor=t,this.commands=e}createCommands(){const{commands:t,editor:e}=this,{state:n,view:r}=e,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,(...t)=>{const n=e(...t)(i);return o.getMeta("preventDispatch")||r.dispatch(o),n}])))}createChain(t,e=!0){const{commands:n,editor:r}=this,{state:o,view:i}=r,s=[],a=!!t,c=t||o.tr,p=__spreadProps(__spreadValues({},Object.fromEntries(Object.entries(n).map((([t,n])=>[t,(...t)=>{const r=this.buildProps(c,e),o=n(...t)(r);return s.push(o),p}])))),{run:()=>(a||!e||c.getMeta("preventDispatch")||i.dispatch(c),s.every((t=>!0===t)))});return p}createCan(t){const{commands:e,editor:n}=this,{state:r}=n,o=void 0,i=t||r.tr,s=this.buildProps(i,o),a=Object.fromEntries(Object.entries(e).map((([t,e])=>[t,(...t)=>e(...t)(__spreadProps(__spreadValues({},s),{dispatch:o}))])));return __spreadProps(__spreadValues({},a),{chain:()=>this.createChain(i,o)})}buildProps(t,e=!0){const{editor:n,commands:r}=this,{state:o,view:i}=n;o.storedMarks&&t.setStoredMarks(o.storedMarks);const s={tr:t,editor:n,view:i,state:this.chainableState(t,o),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map((([t,e])=>[t,(...t)=>e(...t)(s)])))}};return s}chainableState(t,e){let{selection:n}=t,{doc:r}=t,{storedMarks:o}=t;return __spreadProps(__spreadValues({},e),{schema:e.schema,plugins:e.plugins,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return n},get doc(){return r},get tr(){return n=t.selection,r=t.doc,o=t.storedMarks,t}})}}function hi(t,e,n={}){if(void 0===t.config[e]&&t.parent)return hi(t.parent,e,n);if("function"==typeof t.config[e]){return t.config[e].bind(__spreadProps(__spreadValues({},n),{parent:t.parent?hi(t.parent,e,n):null}))}return t.config[e]}function fi(t){return{baseExtensions:t.filter((t=>"extension"===t.type)),nodeExtensions:t.filter((t=>"node"===t.type)),markExtensions:t.filter((t=>"mark"===t.type))}}function mi(t){const e=[],{nodeExtensions:n,markExtensions:r}=fi(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0};return t.forEach((t=>{const n=hi(t,"addGlobalAttributes",{name:t.name,options:t.options});if(!n)return;n().forEach((t=>{t.types.forEach((n=>{Object.entries(t.attributes).forEach((([t,r])=>{e.push({type:n,name:t,attribute:__spreadValues(__spreadValues({},i),r)})}))}))}))})),o.forEach((t=>{const n={name:t.name,options:t.options},r=hi(t,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{e.push({type:t.name,name:n,attribute:__spreadValues(__spreadValues({},i),r)})}))})),e}function vi(...t){return t.filter((t=>!!t)).reduce(((t,e)=>{const n=__spreadValues({},t);return Object.entries(e).forEach((([t,e])=>{n[t]?n[t]="class"===t?[n[t],e].join(" "):"style"===t?[n[t],e].join("; "):e:n[t]=e})),n}),{})}function gi(t,e){return e.filter((t=>t.attribute.rendered)).map((e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]})).reduce(((t,e)=>vi(t,e)),{})}function yi(t,e){return t.style?t:__spreadProps(__spreadValues({},t),{getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===r)return!1;const o=e.filter((t=>t.attribute.rendered)).reduce(((t,e)=>{const r=e.attribute.parseHTML?e.attribute.parseHTML(n)||{}:{[e.name]:(o=n.getAttribute(e.name),"string"!=typeof o?o:o.match(/^\d*(\.\d+)?$/)?Number(o):"true"===o||"false"!==o&&o)};var o;const i=Object.fromEntries(Object.entries(r).filter((([,t])=>null!=t)));return __spreadValues(__spreadValues({},t),i)}),{});return __spreadValues(__spreadValues({},r),o)}})}function bi(t,e,...n){return"function"==typeof t?e?t.bind(e)(...n):t(...n):t}function wi(t){return Object.fromEntries(Object.entries(t).filter((([t,e])=>("attrs"!==t||!function(t={}){return 0===Object.keys(t).length&&t.constructor===Object}(e))&&null!=e)))}function ki(t,e){return e.nodes[t]?e.nodes[t]:e.marks[t]?e.marks[t]:null}class xi{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=xi.resolve(t),this.schema=function(t){var e;const n=mi(t),{nodeExtensions:r,markExtensions:o}=fi(t),i=null===(e=r.find((t=>hi(t,"topNode"))))||void 0===e?void 0:e.name,s=Object.fromEntries(r.map((e=>{const r=n.filter((t=>t.type===e.name)),o={name:e.name,options:e.options},i=t.reduce(((t,n)=>{const r=hi(n,"extendNodeSchema",o);return __spreadValues(__spreadValues({},t),r?r(e):{})}),{}),s=wi(__spreadProps(__spreadValues({},i),{content:bi(hi(e,"content",o)),marks:bi(hi(e,"marks",o)),group:bi(hi(e,"group",o)),inline:bi(hi(e,"inline",o)),atom:bi(hi(e,"atom",o)),selectable:bi(hi(e,"selectable",o)),draggable:bi(hi(e,"draggable",o)),code:bi(hi(e,"code",o)),defining:bi(hi(e,"defining",o)),isolating:bi(hi(e,"isolating",o)),attrs:Object.fromEntries(r.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))})),a=bi(hi(e,"parseHTML",o));a&&(s.parseDOM=a.map((t=>yi(t,r))));const c=hi(e,"renderHTML",o);return c&&(s.toDOM=t=>c({node:t,HTMLAttributes:gi(t,r)})),[e.name,s]}))),a=Object.fromEntries(o.map((e=>{const r=n.filter((t=>t.type===e.name)),o={name:e.name,options:e.options},i=t.reduce(((t,n)=>{const r=hi(n,"extendMarkSchema",o);return __spreadValues(__spreadValues({},t),r?r(e):{})}),{}),s=wi(__spreadProps(__spreadValues({},i),{inclusive:bi(hi(e,"inclusive",o)),excludes:bi(hi(e,"excludes",o)),group:bi(hi(e,"group",o)),spanning:bi(hi(e,"spanning",o)),attrs:Object.fromEntries(r.map((t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]})))})),a=bi(hi(e,"parseHTML",o));a&&(s.parseDOM=a.map((t=>yi(t,r))));const c=hi(e,"renderHTML",o);return c&&(s.toDOM=t=>c({mark:t,HTMLAttributes:gi(t,r)})),[e.name,s]})));return new nt({topNode:i,nodes:s,marks:a})}(this.extensions),this.extensions.forEach((t=>{var e;const n={name:t.name,options:t.options,editor:this.editor,type:ki(t.name,this.schema)};if("mark"===t.type){(null===(e=bi(hi(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name)}const r=hi(t,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const o=hi(t,"onCreate",n);o&&this.editor.on("create",o);const i=hi(t,"onUpdate",n);i&&this.editor.on("update",i);const s=hi(t,"onSelectionUpdate",n);s&&this.editor.on("selectionUpdate",s);const a=hi(t,"onTransaction",n);a&&this.editor.on("transaction",a);const c=hi(t,"onFocus",n);c&&this.editor.on("focus",c);const p=hi(t,"onBlur",n);p&&this.editor.on("blur",p);const l=hi(t,"onDestroy",n);l&&this.editor.on("destroy",l)}))}static resolve(t){return xi.sort(xi.flatten(t))}static flatten(t){return t.map((t=>{const e=hi(t,"addExtensions",{name:t.name,options:t.options});return e?[t,...this.flatten(e())]:t})).flat(10)}static sort(t){return t.sort(((t,e)=>{const n=hi(t,"priority")||100,r=hi(e,"priority")||100;return n>r?-1:n{const n=hi(e,"addCommands",{name:e.name,options:e.options,editor:this.editor,type:ki(e.name,this.schema)});return n?__spreadValues(__spreadValues({},t),n()):t}),{})}get plugins(){return[...this.extensions].reverse().map((t=>{const e={name:t.name,options:t.options,editor:this.editor,type:ki(t.name,this.schema)},n=[],r=hi(t,"addKeyboardShortcuts",e);if(r){const t=function(t){return new we({props:{handleKeyDown:Vo(t)}})}(Object.fromEntries(Object.entries(r()).map((([t,e])=>[t,()=>e({editor:this.editor})]))));n.push(t)}const o=hi(t,"addInputRules",e);if(this.editor.options.enableInputRules&&o){const t=o(),e=t.length?[(i={rules:t},s=i.rules,a=new we({state:{init:function(){return null},apply:function(t,e){var n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:function(t,e,n,r){return Eo(t,e,n,r,s,a)},handleDOMEvents:{compositionend:function(t){setTimeout((function(){var e=t.state.selection.$cursor;e&&Eo(t,e.pos,e.pos,"",s,a)}))}}},isInputRules:!0}),a)]:[];n.push(...e)}var i,s,a;const c=hi(t,"addPasteRules",e);if(this.editor.options.enablePasteRules&&c){const t=c();n.push(...t)}const p=hi(t,"addProseMirrorPlugins",e);if(p){const t=p();n.push(...t)}return n})).flat()}get attributes(){return mi(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=fi(this.extensions);return Object.fromEntries(e.filter((t=>!!hi(t,"addNodeView"))).map((e=>{const n=this.attributes.filter((t=>t.type===e.name)),r={name:e.name,options:e.options,editor:t,type:ni(e.name,this.schema)},o=hi(e,"addNodeView",r);if(!o)return[];return[e.name,(r,i,s,a)=>{const c=gi(r,n);return o()({editor:t,node:r,getPos:s,decorations:a,HTMLAttributes:c,extension:e})}]})))}get textSerializers(){const{editor:t}=this,{nodeExtensions:e}=fi(this.extensions);return Object.fromEntries(e.filter((t=>!!hi(t,"renderText"))).map((e=>{const n=hi(e,"renderText",{name:e.name,options:e.options,editor:t,type:ni(e.name,this.schema)});if(!n)return[];return[e.name,t=>n(t)]})))}}function Mi(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function Si(t,e){const n=__spreadValues({},t);return Mi(t)&&Mi(e)&&Object.keys(e).forEach((r=>{Mi(e[r])?r in t?n[r]=Si(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})})),n}class Oi{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=__spreadValues(__spreadValues({},this.config),t),this.name=this.config.name,this.options=this.config.defaultOptions}static create(t={}){return new Oi(t)}configure(t={}){const e=this.extend();return e.options=Si(this.options,t),e}extend(t={}){const e=new Oi(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,e.options=t.defaultOptions?t.defaultOptions:e.parent.options,e}}const Ci=Oi.create({name:"editable",addProseMirrorPlugins(){return[new we({key:new Me("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{from:e,to:n}=t.state.selection;return((t,e,n,r,o)=>{let i="",s=!0;return t.state.doc.nodesBetween(e,n,((a,c)=>{var p;const l=t.extensionManager.textSerializers[a.type.name];l?(i+=l({node:a}),s=!r):a.isText?(i+=null===(p=null==a?void 0:a.text)||void 0===p?void 0:p.slice(Math.max(e,c)-c,n-c),s=!r):a.isLeaf&&o?(i+=o,s=!r):!s&&a.isBlock&&(i+=r,s=!0)}),0),i})(t,e,n,"\n")}}})]}});var Ni=Object.freeze({__proto__:null,blur:()=>({view:t})=>(t.dom.blur(),!0)});var _i=Object.freeze({__proto__:null,clearContent:(t=!1)=>({commands:e})=>e.setContent("",t)});var Ti=Object.freeze({__proto__:null,clearNodes:()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return o.forEach((r=>{t.doc.nodesBetween(r.$from.pos,r.$to.pos,((t,r)=>{if(t.type.isText)return;const o=e.doc.resolve(e.mapping.map(r)),i=e.doc.resolve(e.mapping.map(r+t.nodeSize)),s=o.blockRange(i);if(!s)return;const a=Rt(s);if(t.type.isTextblock&&n){const{defaultType:t}=o.parent.contentMatchAt(o.index());e.setNodeMarkup(s.start,t)}(a||0===a)&&n&&e.lift(s,a)}))})),!0}});var Vi=Object.freeze({__proto__:null,command:t=>e=>t(e)});var Ai=Object.freeze({__proto__:null,createParagraphNear:()=>({state:t,dispatch:e})=>Uo(t,e)});var Ei=Object.freeze({__proto__:null,deleteRange:t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0}});var Di=Object.freeze({__proto__:null,deleteSelection:()=>({state:t,dispatch:e})=>zo(t,e)});var Ri=Object.freeze({__proto__:null,enter:()=>({commands:t})=>t.keyboardShortcut("Enter")});var zi=Object.freeze({__proto__:null,exitCode:()=>({state:t,dispatch:e})=>Wo(t,e)});function Ii(t,e,n={}){return t.find((t=>t.type===e&&si(t.attrs,n)))}function Bi(t,e,n={}){return!!Ii(t,e,n)}function Li(t,e,n={}){if(!t||!e)return;const r=t.parent.childAfter(t.parentOffset);if(!r.node)return;const o=Ii(r.node.marks,e,n);if(!o)return;let i=t.index(),s=t.start()+r.offset,a=i+1,c=s+r.node.nodeSize;for(Ii(r.node.marks,e,n);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,s-=t.parent.child(i).nodeSize;for(;a({tr:n,state:r,dispatch:o})=>{const i=oi(t,r.schema),{doc:s,selection:a}=n,{$from:c,from:p,to:l}=a;if(o){const t=Li(c,i,e);if(t&&t.from<=p&&t.to>=l){const e=re.create(s,t.from,t.to);n.setSelection(e)}}return!0}});var ji=Object.freeze({__proto__:null,first:t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t({editor:e,view:n,tr:r,dispatch:o})=>{if(n.hasFocus()&&null===t||!1===t)return!0;if(o&&null===t&&!Hi(e.state.selection))return n.focus(),!0;const{from:i,to:s}=function(t,e=null){if(!e)return null;if("start"===e||!0===e)return{from:0,to:0};if("end"===e){const{size:e}=t.doc.content;return{from:e,to:e}}return{from:e,to:e}}(e.state,t)||e.state.selection,{doc:a,storedMarks:c}=r,p=$i(i,0,a.content.size),l=$i(s,0,a.content.size),d=re.create(a,p,l),u=e.state.selection.eq(d);return o&&(r.setSelection(d),u&&c&&r.setStoredMarks(c),n.focus()),!0}});var Ji=Object.freeze({__proto__:null,forEach:(t,e)=>n=>t.every(((t,r)=>e(t,__spreadProps(__spreadValues({},n),{index:r}))))});var Wi=Object.freeze({__proto__:null,insertContent:t=>({tr:e,commands:n})=>n.insertContentAt({from:e.selection.from,to:e.selection.to},t)});var Ui=Object.freeze({__proto__:null,insertContentAt:(t,e)=>({tr:n,dispatch:r,editor:o})=>{if(r){const r=li(e,o.schema,{parseOptions:{preserveWhitespace:"full"}});if("<>"===r.toString())return!0;const{from:i,to:s}="number"==typeof t?{from:t,to:t}:t;n.replaceWith(i,s,r),function(t,e,n){const r=t.steps.length-1;if(r{0===s&&(s=r)})),t.setSelection(te.near(t.doc.resolve(s),n))}(n,n.steps.length-1,1)}return!0}});var Ki=Object.freeze({__proto__:null,joinBackward:()=>({state:t,dispatch:e})=>Io(t,e)});var Gi=Object.freeze({__proto__:null,joinForward:()=>({state:t,dispatch:e})=>jo(t,e)});const Xi="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);var Yi=Object.freeze({__proto__:null,keyboardShortcut:t=>({editor:e,view:n,tr:r,dispatch:o})=>{const i=function(t){const e=t.split(/-(?!$)/);let n,r,o,i,s=e[e.length-1];"Space"===s&&(s=" ");for(let a=0;a!["Alt","Ctrl","Meta","Shift"].includes(t))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction((()=>{n.someProp("handleKeyDown",(t=>t(n,a)))}));return null==c||c.steps.forEach((t=>{const e=t.map(r.mapping);e&&o&&r.maybeStep(e)})),!0}});var Qi=Object.freeze({__proto__:null,lift:(t,e={})=>({state:n,dispatch:r})=>!!ai(n,ni(t,n.schema),e)&&Ho(n,r)});var Zi=Object.freeze({__proto__:null,liftEmptyBlock:()=>({state:t,dispatch:e})=>Ko(t,e)});var ts=Object.freeze({__proto__:null,liftListItem:t=>({state:e,dispatch:n})=>ti(ni(t,e.schema))(e,n)});var es=Object.freeze({__proto__:null,newlineInCode:()=>({state:t,dispatch:e})=>qo(t,e)});var ns=Object.freeze({__proto__:null,replace:(t,e={})=>({state:n,commands:r})=>{console.warn("[tiptap warn]: replace() is deprecated. please use insertContent() instead.");const{from:o,to:i}=n.selection,s={from:o,to:i};return r.replaceRange(s,t,e)}});var rs=Object.freeze({__proto__:null,replaceRange:(t,e,n={})=>({tr:r,state:o,dispatch:i})=>{console.warn("[tiptap warn]: replaceRange() is deprecated. please use insertContent() instead.");const s=ni(e,o.schema),{from:a,to:c}=t;return i&&r.replaceRangeWith(a,c,s.create(n)),!0}});function is(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce(((e,r)=>(n.includes(r)||(e[r]=t[r]),e)),{})}var ss=Object.freeze({__proto__:null,resetAttributes:(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=ei("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=ni(t,r.schema)),"mark"===a&&(s=oi(t,r.schema)),o&&n.selection.ranges.forEach((t=>{r.doc.nodesBetween(t.$from.pos,t.$to.pos,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,is(t.attrs,e)),s&&t.marks.length&&t.marks.forEach((o=>{s===o.type&&n.addMark(r,r+t.nodeSize,s.create(is(o.attrs,e)))}))}))})),!0)}});var as=Object.freeze({__proto__:null,scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0)});var cs=Object.freeze({__proto__:null,selectAll:()=>({state:t,dispatch:e})=>Go(t,e)});var ps=Object.freeze({__proto__:null,selectNodeBackward:()=>({state:t,dispatch:e})=>Lo(t,e)});var ls=Object.freeze({__proto__:null,selectNodeForward:()=>({state:t,dispatch:e})=>$o(t,e)});var ds=Object.freeze({__proto__:null,selectParentNode:()=>({state:t,dispatch:e})=>function(t,e){var n,r=t.selection,o=r.$from,i=r.to,s=o.sharedDepth(i);return 0!=s&&(n=o.before(s),e&&e(t.tr.setSelection(ie.create(t.doc,n))),!0)}(t,e)});var us=Object.freeze({__proto__:null,setContent:(t,e=!1,n={})=>({tr:r,editor:o,dispatch:i})=>{const{doc:s}=r,a=di(t,o.schema,n),c=re.create(s,0,s.content.size);return i&&r.setSelection(c).replaceSelectionWith(a,!1).setMeta("preventUpdate",!e),!0}});var hs=Object.freeze({__proto__:null,setMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,c=oi(t,r.schema);if(o)if(s){const t=ii(r,c);n.addStoredMark(c.create(__spreadValues(__spreadValues({},t),e)))}else a.forEach((t=>{const o=t.$from.pos,i=t.$to.pos;r.doc.nodesBetween(o,i,((t,r)=>{const s=Math.max(r,o),a=Math.min(r+t.nodeSize,i);t.marks.find((t=>t.type===c))?t.marks.forEach((t=>{c===t.type&&n.addMark(s,a,c.create(__spreadValues(__spreadValues({},t.attrs),e)))})):n.addMark(s,a,c.create(e))}))}));return!0}});var fs=Object.freeze({__proto__:null,setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0)});var ms=Object.freeze({__proto__:null,setNode:(t,e={})=>({state:n,dispatch:r})=>{const o=ni(t,n.schema);return(i=o,s=e,function(t,e){var n=t.selection,r=n.from,o=n.to,a=!1;return t.doc.nodesBetween(r,o,(function(e,n){if(a)return!1;if(e.isTextblock&&!e.hasMarkup(i,s))if(e.type==i)a=!0;else{var r=t.doc.resolve(n),o=r.index();a=r.parent.canReplaceWith(o,o+1,i)}})),!!a&&(e&&e(t.tr.setBlockType(r,o,i,s).scrollIntoView()),!0)})(n,r);var i,s}});var vs=Object.freeze({__proto__:null,setNodeSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,r=$i(t,0,n.content.size),o=ie.create(n,r);e.setSelection(o)}return!0}});var gs=Object.freeze({__proto__:null,setTextSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,{from:r,to:o}="number"==typeof t?{from:t,to:t}:t,i=$i(r,0,n.content.size),s=$i(o,0,n.content.size),a=re.create(n,i,s);e.setSelection(a)}return!0}});var ys=Object.freeze({__proto__:null,sinkListItem:t=>({state:e,dispatch:n})=>{const r=ni(t,e.schema);return(o=r,function(t,e){var n=t.selection,r=n.$from,s=n.$to,a=r.blockRange(s,(function(t){return t.childCount&&t.firstChild.type==o}));if(!a)return!1;var c=a.startIndex;if(0==c)return!1;var p=a.parent,l=p.child(c-1);if(l.type!=o)return!1;if(e){var d=l.lastChild&&l.lastChild.type==p.type,h=i.from(d?o.create():null),f=new u(i.from(o.create(null,i.from(p.type.create(null,h)))),d?3:1,0),m=a.start,v=a.end;e(t.tr.step(new At(m-(d?3:1),v,m,v,f,1,!0)).scrollIntoView())}return!0})(e,n);var o}});function bs(t,e,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=t.find((t=>t.type===e&&t.name===n));return!!r&&r.attribute.keepOnSplit})))}function ws(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter((t=>null==e?void 0:e.includes(t.type.name)));t.tr.ensureMarks(r)}}var ks=Object.freeze({__proto__:null,splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:c}=i,p=bs(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof ie&&i.node.isBlock)return!(!a.parentOffset||!Bt(s,a.pos))&&(r&&(t&&ws(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const r=c.parentOffset===c.parent.content.size;i instanceof re&&e.deleteSelection();const s=0===a.depth?void 0:function(t){for(let e=0;e({tr:e,state:n,dispatch:r,editor:o})=>{var s;const a=ni(t,n.schema),{$from:c,$to:p}=n.selection,l=n.selection.node;if(l&&l.isBlock||c.depth<2||!c.sameParent(p))return!1;const d=c.node(-1);if(d.type!==a)return!1;const h=o.extensionManager.attributes;if(0===c.parent.content.size&&c.node(-1).childCount===c.indexAfter(-1)){if(2===c.depth||c.node(-3).type!==a||c.index(-2)!==c.node(-2).childCount-1)return!1;if(r){let t=i.empty;const n=c.index(-1)?1:c.index(-2)?2:3;for(let e=c.depth-n;e>=c.depth-3;e-=1)t=i.from(c.node(e).copy(t));const r=c.indexAfter(-1){if(d>-1)return!1;t.isTextblock&&0===t.content.size&&(d=e+1)})),d>-1&&e.setSelection(re.near(e.doc.resolve(d))),e.scrollIntoView()}return!0}const f=p.pos===c.end()?d.contentMatchAt(0).defaultType:null,m=bs(h,d.type.name,d.attrs),v=bs(h,c.node().type.name,c.node().attrs);e.delete(c.pos,p.pos);const g=f?[{type:a,attrs:m},{type:f,attrs:v}]:[{type:a,attrs:m}];return!!Bt(e.doc,c.pos,2)&&(r&&e.split(c.pos,2,g).scrollIntoView(),!0)}});function Ms(t,e){const{nodeExtensions:n}=fi(e),r=n.find((e=>e.name===t));if(!r)return!1;const o=bi(hi(r,"group",{name:r.name,options:r.options}));return"string"==typeof o&&o.split(" ").includes("list")}var Ss=Object.freeze({__proto__:null,toggleList:(t,e)=>({editor:n,tr:r,state:o,dispatch:i,chain:s,commands:a,can:c})=>{const{extensions:p}=n.extensionManager,l=ni(t,o.schema),d=ni(e,o.schema),{selection:u}=o,{$from:h,$to:f}=u,m=h.blockRange(f);if(!m)return!1;const v=(g=t=>Ms(t.type.name,p),t=>function(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}(t.$from,g))(u);var g;if(m.depth>=1&&v&&m.depth-v.depth<=1){if(v.node.type===l)return a.liftListItem(d);if(Ms(v.node.type.name,p)&&l.validContent(v.node.content)&&i)return r.setNodeMarkup(v.pos,l),!0}return c().wrapInList(l)?a.wrapInList(l):s().clearNodes().wrapInList(l).run()}});var Os=Object.freeze({__proto__:null,toggleMark:(t,e={})=>({state:n,commands:r})=>{const o=oi(t,n.schema);return ci(n,o,e)?r.unsetMark(o):r.setMark(o,e)}});var Cs=Object.freeze({__proto__:null,toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const i=ni(t,r.schema),s=ni(e,r.schema);return ai(r,i,n)?o.setNode(s):o.setNode(i,n)}});var Ns=Object.freeze({__proto__:null,toggleWrap:(t,e={})=>({state:n,dispatch:r})=>{const o=ni(t,n.schema);return ai(n,o,e)?Ho(n,r):Yo(o,e)(n,r)}});var _s=Object.freeze({__proto__:null,undoInputRule:()=>({state:t,dispatch:e})=>function(t,e){for(var n=t.plugins,r=0;r=0;c--)s.step(a.steps[c].invert(a.docs[c]));if(i.text){var p=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,p))}else s.delete(i.from,i.to);e(s)}return!0}}return!1}(t,e)});var Ts=Object.freeze({__proto__:null,unsetAllMarks:()=>({tr:t,state:e,dispatch:n})=>{const{selection:r}=t,{empty:o,ranges:i}=r;return o||n&&Object.entries(e.schema.marks).forEach((([,e])=>{i.forEach((n=>{t.removeMark(n.$from.pos,n.$to.pos,e)}))})),!0}});var Vs=Object.freeze({__proto__:null,unsetMark:t=>({tr:e,state:n,dispatch:r})=>{const{selection:o}=e,i=oi(t,n.schema),{$from:s,empty:a,ranges:c}=o;if(r){if(a){let{from:t,to:n}=o;const r=Li(s,i);r&&(t=r.from,n=r.to),e.removeMark(t,n,i)}else c.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos,i)}));e.removeStoredMark(i)}return!0}});var As=Object.freeze({__proto__:null,updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=ei("string"==typeof t?t:t.name,r.schema);return!!a&&("node"===a&&(i=ni(t,r.schema)),"mark"===a&&(s=oi(t,r.schema)),o&&n.selection.ranges.forEach((t=>{const o=t.$from.pos,a=t.$to.pos;r.doc.nodesBetween(o,a,((t,r)=>{i&&i===t.type&&n.setNodeMarkup(r,void 0,__spreadValues(__spreadValues({},t.attrs),e)),s&&t.marks.length&&t.marks.forEach((i=>{if(s===i.type){const c=Math.max(r,o),p=Math.min(r+t.nodeSize,a);n.addMark(c,p,s.create(__spreadValues(__spreadValues({},i.attrs),e)))}}))}))})),!0)}});var Es=Object.freeze({__proto__:null,wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const o=ni(t,n.schema);return!ai(n,o,e)&&Yo(o,e)(n,r)}});var Ds=Object.freeze({__proto__:null,wrapInList:(t,e={})=>({state:n,dispatch:r})=>Zo(ni(t,n.schema),e)(n,r)});const Rs=Oi.create({name:"commands",addCommands:()=>__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({},Ni),_i),Ti),Vi),Ai),Ei),Di),Ri),zi),Pi),ji),qi),Ji),Wi),Ui),Ki),Gi),Yi),Qi),Zi),ts),es),ns),rs),ss),as),cs),ps),ls),ds),us),hs),fs),ms),vs),gs),ys),ks),xs),Ss),Os),Cs),Ns),_s),Ts),Vs),As),Es),Ds)}),zs=Oi.create({name:"editable",addProseMirrorPlugins(){return[new we({key:new Me("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Is=Oi.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new we({key:new Me("focusEvents"),props:{attributes:{tabindex:"0"},handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Bs=Oi.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first((({commands:t})=>[()=>t.undoInputRule(),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()])),e=()=>this.editor.commands.first((({commands:t})=>[()=>t.deleteSelection(),()=>t.joinForward(),()=>t.selectNodeForward()]));return{Enter:()=>this.editor.commands.first((({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:()=>t(),"Mod-Backspace":()=>t(),Delete:()=>e(),"Mod-Delete":()=>e()}}});var Ls=Object.freeze({__proto__:null,ClipboardTextSerializer:Ci,Commands:Rs,Editable:zs,FocusEvents:Is,Keymap:Bs});class Ps{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=__spreadValues(__spreadValues({},this.config),t),this.name=this.config.name,this.options=this.config.defaultOptions}static create(t={}){return new Ps(t)}configure(t={}){const e=this.extend();return e.options=Si(this.options,t),e}extend(t={}){const e=new Ps(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,e.options=t.defaultOptions?t.defaultOptions:e.parent.options,e}}class js{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=__spreadValues(__spreadValues({},this.config),t),this.name=this.config.name,this.options=this.config.defaultOptions}static create(t={}){return new js(t)}configure(t={}){const e=this.extend();return e.options=Si(this.options,t),e}extend(t={}){const e=new js(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,e.options=t.defaultOptions?t.defaultOptions:e.parent.options,e}}function $s(t,e,n){return new Ao(t,((t,r,o,i)=>{const s=n instanceof Function?n(r):n,{tr:a}=t;return r[0]&&a.replaceWith(o-1,i,e.create(s)),a}))}function Fs(t,e,n){return new Ao(t,((t,r,o,i)=>{const s=n instanceof Function?n(r):n,{tr:a}=t,c=r[r.length-1],p=r[0];let l=i;if(c){const n=p.search(/\S/),r=o+p.indexOf(c),d=r+c.length;if(function(t,e,n){let r=[];return n.doc.nodesBetween(t,e,((t,e)=>{r=[...r,...t.marks.map((n=>({from:e,to:e+t.nodeSize,mark:n})))]})),r}(o,i,t).filter((t=>{const{excluded:n}=t.mark.type;return n.find((t=>t.name===e.name))})).filter((t=>t.to>r)).length)return null;do&&a.delete(o+n,r),l=o+n+c.length,a.addMark(o+n,l,e.create(s)),a.removeStoredMark(e)}return a}))}function Hs(t,e,n){const r=(o,s)=>{const a=[];return o.forEach((o=>{if(o.isText&&o.text){const{text:r}=o;let i,c=0;for(;null!==(i=t.exec(r));){const t=Math.max(i.length-2,0),r=Math.max(i.length-1,0);if(null==s?void 0:s.type.allowsMarkType(e)){const s=i.index+i[0].indexOf(i[t]),p=s+i[t].length,l=s+i[t].lastIndexOf(i[r]),d=l+i[r].length,u=n instanceof Function?n(i):n;if(!u)continue;s>0&&a.push(o.cut(c,s)),a.push(o.cut(l,d).mark(e.create(u).addToSet(o.marks))),c=p}}cnew u(r(t.content),t.openStart,t.openEnd)}})}function qs(t,e,n){const r=t.coordsAtPos(e),o=t.coordsAtPos(n,-1),i=Math.min(r.top,o.top),s=Math.max(r.bottom,o.bottom),a=Math.min(r.left,o.left),c=Math.max(r.right,o.right),p={top:i,bottom:s,left:a,right:c,width:c-a,height:s-i,x:a,y:i};return __spreadProps(__spreadValues({},p),{toJSON:()=>p})}var Js="top",Ws="bottom",Us="right",Ks="left",Gs="auto",Xs=[Js,Ws,Us,Ks],Ys="start",Qs="end",Zs="viewport",ta="popper",ea=Xs.reduce((function(t,e){return t.concat([e+"-"+Ys,e+"-"+Qs])}),[]),na=[].concat(Xs,[Gs]).reduce((function(t,e){return t.concat([e,e+"-"+Ys,e+"-"+Qs])}),[]),ra=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function oa(t){return t?(t.nodeName||"").toLowerCase():null}function ia(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function sa(t){return t instanceof ia(t).Element||t instanceof Element}function aa(t){return t instanceof ia(t).HTMLElement||t instanceof HTMLElement}function ca(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ia(t).ShadowRoot||t instanceof ShadowRoot)}var pa={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},r=e.attributes[t]||{},o=e.elements[t];aa(o)&&oa(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(t){var e=r[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var r=e.elements[t],o=e.attributes[t]||{},i=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});aa(r)&&oa(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(t){r.removeAttribute(t)})))}))}},requires:["computeStyles"]};function la(t){return t.split("-")[0]}function da(t){var e=t.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function ua(t){var e=da(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function ha(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&ca(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function fa(t){return ia(t).getComputedStyle(t)}function ma(t){return["table","td","th"].indexOf(oa(t))>=0}function va(t){return((sa(t)?t.ownerDocument:t.document)||window.document).documentElement}function ga(t){return"html"===oa(t)?t:t.assignedSlot||t.parentNode||(ca(t)?t.host:null)||va(t)}function ya(t){return aa(t)&&"fixed"!==fa(t).position?t.offsetParent:null}function ba(t){for(var e=ia(t),n=ya(t);n&&ma(n)&&"static"===fa(n).position;)n=ya(n);return n&&("html"===oa(n)||"body"===oa(n)&&"static"===fa(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&aa(t)&&"fixed"===fa(t).position)return null;for(var n=ga(t);aa(n)&&["html","body"].indexOf(oa(n))<0;){var r=fa(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||e&&"filter"===r.willChange||e&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(t)||e}function wa(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var ka=Math.max,xa=Math.min,Ma=Math.round;function Sa(t,e,n){return ka(t,xa(e,n))}function Oa(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Ca(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}var Na={top:"auto",right:"auto",bottom:"auto",left:"auto"};function _a(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.offsets,s=t.position,a=t.gpuAcceleration,c=t.adaptive,p=t.roundOffsets,l=!0===p?function(t){var e=t.x,n=t.y,r=window.devicePixelRatio||1;return{x:Ma(Ma(e*r)/r)||0,y:Ma(Ma(n*r)/r)||0}}(i):"function"==typeof p?p(i):i,d=l.x,u=void 0===d?0:d,h=l.y,f=void 0===h?0:h,m=i.hasOwnProperty("x"),v=i.hasOwnProperty("y"),g=Ks,y=Js,b=window;if(c){var w=ba(n),k="clientHeight",x="clientWidth";w===ia(n)&&"static"!==fa(w=va(n)).position&&(k="scrollHeight",x="scrollWidth"),w=w,o===Js&&(y=Ws,f-=w[k]-r.height,f*=a?1:-1),o===Ks&&(g=Us,u-=w[x]-r.width,u*=a?1:-1)}var M,S=Object.assign({position:s},c&&Na);return a?Object.assign({},S,((M={})[y]=v?"0":"",M[g]=m?"0":"",M.transform=(b.devicePixelRatio||1)<2?"translate("+u+"px, "+f+"px)":"translate3d("+u+"px, "+f+"px, 0)",M)):Object.assign({},S,((e={})[y]=v?f+"px":"",e[g]=m?u+"px":"",e.transform="",e))}var Ta={passive:!0};var Va={left:"right",right:"left",bottom:"top",top:"bottom"};function Aa(t){return t.replace(/left|right|bottom|top/g,(function(t){return Va[t]}))}var Ea={start:"end",end:"start"};function Da(t){return t.replace(/start|end/g,(function(t){return Ea[t]}))}function Ra(t){var e=ia(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function za(t){return da(va(t)).left+Ra(t).scrollLeft}function Ia(t){var e=fa(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Ba(t){return["html","body","#document"].indexOf(oa(t))>=0?t.ownerDocument.body:aa(t)&&Ia(t)?t:Ba(ga(t))}function La(t,e){var n;void 0===e&&(e=[]);var r=Ba(t),o=r===(null==(n=t.ownerDocument)?void 0:n.body),i=ia(r),s=o?[i].concat(i.visualViewport||[],Ia(r)?r:[]):r,a=e.concat(s);return o?a:a.concat(La(ga(s)))}function Pa(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ja(t,e){return e===Zs?Pa(function(t){var e=ia(t),n=va(t),r=e.visualViewport,o=n.clientWidth,i=n.clientHeight,s=0,a=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:o,height:i,x:s+za(t),y:a}}(t)):aa(e)?function(t){var e=da(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):Pa(function(t){var e,n=va(t),r=Ra(t),o=null==(e=t.ownerDocument)?void 0:e.body,i=ka(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=ka(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+za(t),c=-r.scrollTop;return"rtl"===fa(o||n).direction&&(a+=ka(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:c}}(va(t)))}function $a(t,e,n){var r="clippingParents"===e?function(t){var e=La(ga(t)),n=["absolute","fixed"].indexOf(fa(t).position)>=0&&aa(t)?ba(t):t;return sa(n)?e.filter((function(t){return sa(t)&&ha(t,n)&&"body"!==oa(t)})):[]}(t):[].concat(e),o=[].concat(r,[n]),i=o[0],s=o.reduce((function(e,n){var r=ja(t,n);return e.top=ka(r.top,e.top),e.right=xa(r.right,e.right),e.bottom=xa(r.bottom,e.bottom),e.left=ka(r.left,e.left),e}),ja(t,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Fa(t){return t.split("-")[1]}function Ha(t){var e,n=t.reference,r=t.element,o=t.placement,i=o?la(o):null,s=o?Fa(o):null,a=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(i){case Js:e={x:a,y:n.y-r.height};break;case Ws:e={x:a,y:n.y+n.height};break;case Us:e={x:n.x+n.width,y:c};break;case Ks:e={x:n.x-r.width,y:c};break;default:e={x:n.x,y:n.y}}var p=i?wa(i):null;if(null!=p){var l="y"===p?"height":"width";switch(s){case Ys:e[p]=e[p]-(n[l]/2-r[l]/2);break;case Qs:e[p]=e[p]+(n[l]/2-r[l]/2)}}return e}function qa(t,e){void 0===e&&(e={});var n=e,r=n.placement,o=void 0===r?t.placement:r,i=n.boundary,s=void 0===i?"clippingParents":i,a=n.rootBoundary,c=void 0===a?Zs:a,p=n.elementContext,l=void 0===p?ta:p,d=n.altBoundary,u=void 0!==d&&d,h=n.padding,f=void 0===h?0:h,m=Oa("number"!=typeof f?f:Ca(f,Xs)),v=l===ta?"reference":ta,g=t.elements.reference,y=t.rects.popper,b=t.elements[u?v:l],w=$a(sa(b)?b:b.contextElement||va(t.elements.popper),s,c),k=da(g),x=Ha({reference:k,element:y,strategy:"absolute",placement:o}),M=Pa(Object.assign({},y,x)),S=l===ta?M:k,O={top:w.top-S.top+m.top,bottom:S.bottom-w.bottom+m.bottom,left:w.left-S.left+m.left,right:S.right-w.right+m.right},C=t.modifiersData.offset;if(l===ta&&C){var N=C[o];Object.keys(O).forEach((function(t){var e=[Us,Ws].indexOf(t)>=0?1:-1,n=[Js,Ws].indexOf(t)>=0?"y":"x";O[t]+=N[n]*e}))}return O}function Ja(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Wa(t){return[Js,Us,Ws,Ks].some((function(e){return t[e]>=0}))}function Ua(t,e,n){void 0===n&&(n=!1);var r,o,i=va(e),s=da(t),a=aa(e),c={scrollLeft:0,scrollTop:0},p={x:0,y:0};return(a||!a&&!n)&&(("body"!==oa(e)||Ia(i))&&(c=(r=e)!==ia(r)&&aa(r)?{scrollLeft:(o=r).scrollLeft,scrollTop:o.scrollTop}:Ra(r)),aa(e)?((p=da(e)).x+=e.clientLeft,p.y+=e.clientTop):i&&(p.x=za(i))),{x:s.left+c.scrollLeft-p.x,y:s.top+c.scrollTop-p.y,width:s.width,height:s.height}}function Ka(t){var e=new Map,n=new Set,r=[];function o(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var r=e.get(t);r&&o(r)}})),r.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||o(t)})),r}var Ga={placement:"bottom",modifiers:[],strategy:"absolute"};function Xa(){for(var t=arguments.length,e=new Array(t),n=0;n=0?-1:1,i="function"==typeof n?n(Object.assign({},e,{placement:t})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Ks,Us].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,e.rects,i),t}),{}),a=s[e.placement],c=a.x,p=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=p),e.modifiersData[r]=s}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0===s||s,c=n.fallbackPlacements,p=n.padding,l=n.boundary,d=n.rootBoundary,u=n.altBoundary,h=n.flipVariations,f=void 0===h||h,m=n.allowedAutoPlacements,v=e.options.placement,g=la(v),y=c||(g===v||!f?[Aa(v)]:function(t){if(la(t)===Gs)return[];var e=Aa(t);return[Da(t),e,Da(e)]}(v)),b=[v].concat(y).reduce((function(t,n){return t.concat(la(n)===Gs?function(t,e){void 0===e&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,p=void 0===c?na:c,l=Fa(r),d=l?a?ea:ea.filter((function(t){return Fa(t)===l})):Xs,u=d.filter((function(t){return p.indexOf(t)>=0}));0===u.length&&(u=d);var h=u.reduce((function(e,n){return e[n]=qa(t,{placement:n,boundary:o,rootBoundary:i,padding:s})[la(n)],e}),{});return Object.keys(h).sort((function(t,e){return h[t]-h[e]}))}(e,{placement:n,boundary:l,rootBoundary:d,padding:p,flipVariations:f,allowedAutoPlacements:m}):n)}),[]),w=e.rects.reference,k=e.rects.popper,x=new Map,M=!0,S=b[0],O=0;O=0,V=T?"width":"height",A=qa(e,{placement:C,boundary:l,rootBoundary:d,altBoundary:u,padding:p}),E=T?_?Us:Ks:_?Ws:Js;w[V]>k[V]&&(E=Aa(E));var D=Aa(E),R=[];if(i&&R.push(A[N]<=0),a&&R.push(A[E]<=0,A[D]<=0),R.every((function(t){return t}))){S=C,M=!1;break}x.set(C,R)}if(M)for(var z=function(t){var e=b.find((function(e){var n=x.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return S=e,"break"},I=f?3:1;I>0;I--){if("break"===z(I))break}e.placement!==S&&(e.modifiersData[r]._skip=!0,e.placement=S,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0!==s&&s,c=n.boundary,p=n.rootBoundary,l=n.altBoundary,d=n.padding,u=n.tether,h=void 0===u||u,f=n.tetherOffset,m=void 0===f?0:f,v=qa(e,{boundary:c,rootBoundary:p,padding:d,altBoundary:l}),g=la(e.placement),y=Fa(e.placement),b=!y,w=wa(g),k="x"===w?"y":"x",x=e.modifiersData.popperOffsets,M=e.rects.reference,S=e.rects.popper,O="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,C={x:0,y:0};if(x){if(i||a){var N="y"===w?Js:Ks,_="y"===w?Ws:Us,T="y"===w?"height":"width",V=x[w],A=x[w]+v[N],E=x[w]-v[_],D=h?-S[T]/2:0,R=y===Ys?M[T]:S[T],z=y===Ys?-S[T]:-M[T],I=e.elements.arrow,B=h&&I?ua(I):{width:0,height:0},L=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},P=L[N],j=L[_],$=Sa(0,M[T],B[T]),F=b?M[T]/2-D-$-P-O:R-$-P-O,H=b?-M[T]/2+D+$+j+O:z+$+j+O,q=e.elements.arrow&&ba(e.elements.arrow),J=q?"y"===w?q.clientTop||0:q.clientLeft||0:0,W=e.modifiersData.offset?e.modifiersData.offset[e.placement][w]:0,U=x[w]+F-W-J,K=x[w]+H-W;if(i){var G=Sa(h?xa(A,U):A,V,h?ka(E,K):E);x[w]=G,C[w]=G-V}if(a){var X="x"===w?Js:Ks,Y="x"===w?Ws:Us,Q=x[k],Z=Q+v[X],tt=Q-v[Y],et=Sa(h?xa(Z,U):Z,Q,h?ka(tt,K):tt);x[k]=et,C[k]=et-Q}}e.modifiersData[r]=C}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=la(n.placement),c=wa(a),p=[Ks,Us].indexOf(a)>=0?"height":"width";if(i&&s){var l=function(t,e){return Oa("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Ca(t,Xs))}(o.padding,n),d=ua(i),u="y"===c?Js:Ks,h="y"===c?Ws:Us,f=n.rects.reference[p]+n.rects.reference[c]-s[c]-n.rects.popper[p],m=s[c]-n.rects.reference[c],v=ba(i),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=f/2-m/2,b=l[u],w=g-d[p]-l[h],k=g/2-d[p]/2+y,x=Sa(b,k,w),M=c;n.modifiersData[r]=((e={})[M]=x,e.centerOffset=x-k,e)}},effect:function(t){var e=t.state,n=t.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=e.elements.popper.querySelector(r)))&&ha(e.elements.popper,r)&&(e.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=qa(e,{elementContext:"reference"}),a=qa(e,{altBoundary:!0}),c=Ja(s,r),p=Ja(a,o,i),l=Wa(c),d=Wa(p);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:p,isReferenceHidden:l,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":d})}}]}),Za="tippy-content",tc="tippy-arrow",ec="tippy-svg-arrow",nc={passive:!0,capture:!0};function rc(t,e,n){if(Array.isArray(t)){var r=t[e];return null==r?Array.isArray(n)?n[e]:n:r}return t}function oc(t,e){var n={}.toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function ic(t,e){return"function"==typeof t?t.apply(void 0,e):t}function sc(t,e){return 0===e?t:function(r){clearTimeout(n),n=setTimeout((function(){t(r)}),e)};var n}function ac(t){return[].concat(t)}function cc(t,e){-1===t.indexOf(e)&&t.push(e)}function pc(t){return[].slice.call(t)}function lc(){return document.createElement("div")}function dc(t){return["Element","Fragment"].some((function(e){return oc(t,e)}))}function uc(t){return dc(t)?[t]:function(t){return oc(t,"NodeList")}(t)?pc(t):Array.isArray(t)?t:pc(document.querySelectorAll(t))}function hc(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function fc(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function mc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[r](e,n)}))}var vc={isTouch:!1},gc=0;function yc(){vc.isTouch||(vc.isTouch=!0,window.performance&&document.addEventListener("mousemove",bc))}function bc(){var t=performance.now();t-gc<20&&(vc.isTouch=!1,document.removeEventListener("mousemove",bc)),gc=t}function wc(){var t,e=document.activeElement;if((t=e)&&t._tippy&&t._tippy.reference===t){var n=e._tippy;e.blur&&!n.state.isVisible&&e.blur()}}var kc="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",xc=/MSIE |Trident\//.test(kc),Mc=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},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Sc=Object.keys(Mc);function Oc(t){var e=(t.plugins||[]).reduce((function(e,n){var r=n.name,o=n.defaultValue;return r&&(e[r]=void 0!==t[r]?t[r]:o),e}),{});return Object.assign({},t,{},e)}function Cc(t,e){var n=Object.assign({},e,{content:ic(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(Oc(Object.assign({},Mc,{plugins:e}))):Sc).reduce((function(e,n){var r=(t.getAttribute("data-tippy-"+n)||"").trim();if(!r)return e;if("content"===n)e[n]=r;else try{e[n]=JSON.parse(r)}catch(o){e[n]=r}return e}),{})}(t,e.plugins));return n.aria=Object.assign({},Mc.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?e.interactive:n.aria.expanded,content:"auto"===n.aria.content?e.interactive?null:"describedby":n.aria.content},n}function Nc(t,e){t.innerHTML=e}function _c(t){var e=lc();return!0===t?e.className=tc:(e.className=ec,dc(t)?e.appendChild(t):Nc(e,t)),e}function Tc(t,e){dc(e.content)?(Nc(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?Nc(t,e.content):t.textContent=e.content)}function Vc(t){var e=t.firstElementChild,n=pc(e.children);return{box:e,content:n.find((function(t){return t.classList.contains(Za)})),arrow:n.find((function(t){return t.classList.contains(tc)||t.classList.contains(ec)})),backdrop:n.find((function(t){return t.classList.contains("tippy-backdrop")}))}}function Ac(t){var e=lc(),n=lc();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=lc();function o(n,r){var o=Vc(e),i=o.box,s=o.content,a=o.arrow;r.theme?i.setAttribute("data-theme",r.theme):i.removeAttribute("data-theme"),"string"==typeof r.animation?i.setAttribute("data-animation",r.animation):i.removeAttribute("data-animation"),r.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?i.setAttribute("role",r.role):i.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Tc(s,t.props),r.arrow?a?n.arrow!==r.arrow&&(i.removeChild(a),i.appendChild(_c(r.arrow))):i.appendChild(_c(r.arrow)):a&&i.removeChild(a)}return r.className=Za,r.setAttribute("data-state","hidden"),Tc(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props),{popper:e,onUpdate:o}}Ac.$$tippy=!0;var Ec=1,Dc=[],Rc=[];function zc(t,e){var n,r,o,i,s,a,c,p,l,d=Cc(t,Object.assign({},Mc,{},Oc((n=e,Object.keys(n).reduce((function(t,e){return void 0!==n[e]&&(t[e]=n[e]),t}),{}))))),u=!1,h=!1,f=!1,m=!1,v=[],g=sc(K,d.interactiveDebounce),y=Ec++,b=(l=d.plugins).filter((function(t,e){return l.indexOf(t)===e})),w={id:y,reference:t,popper:lc(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)},setProps:function(e){if(w.state.isDestroyed)return;R("onBeforeUpdate",[w,e]),W();var n=w.props,r=Cc(t,Object.assign({},w.props,{},e,{ignoreAttributes:!0}));w.props=r,J(),n.interactiveDebounce!==r.interactiveDebounce&&(B(),g=sc(K,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?ac(n.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):r.triggerTarget&&t.removeAttribute("aria-expanded");I(),D(),M&&M(n,r);w.popperInstance&&(Q(),tt().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})));R("onAfterUpdate",[w,e])},setContent:function(t){w.setProps({content:t})},show:function(){var t=w.state.isVisible,e=w.state.isDestroyed,n=!w.state.isEnabled,r=vc.isTouch&&!w.props.touch,o=rc(w.props.duration,0,Mc.duration);if(t||e||n||r)return;if(T().hasAttribute("disabled"))return;if(R("onShow",[w],!1),!1===w.props.onShow(w))return;w.state.isVisible=!0,_()&&(x.style.visibility="visible");D(),$(),w.state.isMounted||(x.style.transition="none");if(_()){var i=A(),s=i.box,a=i.content;hc([s,a],0)}c=function(){var t;if(w.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=w.props.moveTransition,_()&&w.props.animation){var e=A(),n=e.box,r=e.content;hc([n,r],o),fc([n,r],"visible")}z(),I(),cc(Rc,w),null==(t=w.popperInstance)||t.forceUpdate(),w.state.isMounted=!0,R("onMount",[w]),w.props.animation&&_()&&function(t,e){H(t,e)}(o,(function(){w.state.isShown=!0,R("onShown",[w])}))}},function(){var t,e=w.props.appendTo,n=T();t=w.props.interactive&&e===Mc.appendTo||"parent"===e?n.parentNode:ic(e,[n]);t.contains(x)||t.appendChild(x);Q()}()},hide:function(){var t=!w.state.isVisible,e=w.state.isDestroyed,n=!w.state.isEnabled,r=rc(w.props.duration,1,Mc.duration);if(t||e||n)return;if(R("onHide",[w],!1),!1===w.props.onHide(w))return;w.state.isVisible=!1,w.state.isShown=!1,m=!1,u=!1,_()&&(x.style.visibility="hidden");if(B(),F(),D(),_()){var o=A(),i=o.box,s=o.content;w.props.animation&&(hc([i,s],r),fc([i,s],"hidden"))}z(),I(),w.props.animation?_()&&function(t,e){H(t,(function(){!w.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&e()}))}(r,w.unmount):w.unmount()},hideWithInteractivity:function(t){V().addEventListener("mousemove",g),cc(Dc,g),g(t)},enable:function(){w.state.isEnabled=!0},disable:function(){w.hide(),w.state.isEnabled=!1},unmount:function(){w.state.isVisible&&w.hide();if(!w.state.isMounted)return;Z(),tt().forEach((function(t){t._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x);Rc=Rc.filter((function(t){return t!==w})),w.state.isMounted=!1,R("onHidden",[w])},destroy:function(){if(w.state.isDestroyed)return;w.clearDelayTimeouts(),w.unmount(),W(),delete t._tippy,w.state.isDestroyed=!0,R("onDestroy",[w])}};if(!d.render)return w;var k=d.render(w),x=k.popper,M=k.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+w.id,w.popper=x,t._tippy=w,x._tippy=w;var S=b.map((function(t){return t.fn(w)})),O=t.hasAttribute("aria-expanded");return J(),I(),D(),R("onCreate",[w]),d.showOnCreate&&et(),x.addEventListener("mouseenter",(function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(t){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&(V().addEventListener("mousemove",g),g(t))})),w;function C(){var t=w.props.touch;return Array.isArray(t)?t:[t,0]}function N(){return"hold"===C()[0]}function _(){var t;return!!(null==(t=w.props.render)?void 0:t.$$tippy)}function T(){return p||t}function V(){var t,e,n=T().parentNode;return n?(null==(e=ac(n)[0])||null==(t=e.ownerDocument)?void 0:t.body)?e.ownerDocument:document:document}function A(){return Vc(x)}function E(t){return w.state.isMounted&&!w.state.isVisible||vc.isTouch||s&&"focus"===s.type?0:rc(w.props.delay,t?0:1,Mc.delay)}function D(){x.style.pointerEvents=w.props.interactive&&w.state.isVisible?"":"none",x.style.zIndex=""+w.props.zIndex}function R(t,e,n){var r;(void 0===n&&(n=!0),S.forEach((function(n){n[t]&&n[t].apply(void 0,e)})),n)&&(r=w.props)[t].apply(r,e)}function z(){var e=w.props.aria;if(e.content){var n="aria-"+e.content,r=x.id;ac(w.props.triggerTarget||t).forEach((function(t){var e=t.getAttribute(n);if(w.state.isVisible)t.setAttribute(n,e?e+" "+r:r);else{var o=e&&e.replace(r,"").trim();o?t.setAttribute(n,o):t.removeAttribute(n)}}))}}function I(){!O&&w.props.aria.expanded&&ac(w.props.triggerTarget||t).forEach((function(t){w.props.interactive?t.setAttribute("aria-expanded",w.state.isVisible&&t===T()?"true":"false"):t.removeAttribute("aria-expanded")}))}function B(){V().removeEventListener("mousemove",g),Dc=Dc.filter((function(t){return t!==g}))}function L(t){if(!(vc.isTouch&&(f||"mousedown"===t.type)||w.props.interactive&&x.contains(t.target))){if(T().contains(t.target)){if(vc.isTouch)return;if(w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[w,t]);!0===w.props.hideOnClick&&(w.clearDelayTimeouts(),w.hide(),h=!0,setTimeout((function(){h=!1})),w.state.isMounted||F())}}function P(){f=!0}function j(){f=!1}function $(){var t=V();t.addEventListener("mousedown",L,!0),t.addEventListener("touchend",L,nc),t.addEventListener("touchstart",j,nc),t.addEventListener("touchmove",P,nc)}function F(){var t=V();t.removeEventListener("mousedown",L,!0),t.removeEventListener("touchend",L,nc),t.removeEventListener("touchstart",j,nc),t.removeEventListener("touchmove",P,nc)}function H(t,e){var n=A().box;function r(t){t.target===n&&(mc(n,"remove",r),e())}if(0===t)return e();mc(n,"remove",a),mc(n,"add",r),a=r}function q(e,n,r){void 0===r&&(r=!1),ac(w.props.triggerTarget||t).forEach((function(t){t.addEventListener(e,n,r),v.push({node:t,eventType:e,handler:n,options:r})}))}function J(){var t;N()&&(q("touchstart",U,{passive:!0}),q("touchend",G,{passive:!0})),(t=w.props.trigger,t.split(/\s+/).filter(Boolean)).forEach((function(t){if("manual"!==t)switch(q(t,U),t){case"mouseenter":q("mouseleave",G);break;case"focus":q(xc?"focusout":"blur",X);break;case"focusin":q("focusout",X)}}))}function W(){v.forEach((function(t){var e=t.node,n=t.eventType,r=t.handler,o=t.options;e.removeEventListener(n,r,o)})),v=[]}function U(t){var e,n=!1;if(w.state.isEnabled&&!Y(t)&&!h){var r="focus"===(null==(e=s)?void 0:e.type);s=t,p=t.currentTarget,I(),!w.state.isVisible&&oc(t,"MouseEvent")&&Dc.forEach((function(e){return e(t)})),"click"===t.type&&(w.props.trigger.indexOf("mouseenter")<0||u)&&!1!==w.props.hideOnClick&&w.state.isVisible?n=!0:et(t),"click"===t.type&&(u=!n),n&&!r&&nt(t)}}function K(t){var e=t.target,n=T().contains(e)||x.contains(e);"mousemove"===t.type&&n||function(t,e){var n=e.clientX,r=e.clientY;return t.every((function(t){var e=t.popperRect,o=t.popperState,i=t.props.interactiveBorder,s=o.placement.split("-")[0],a=o.modifiersData.offset;if(!a)return!0;var c="bottom"===s?a.top.y:0,p="top"===s?a.bottom.y:0,l="right"===s?a.left.x:0,d="left"===s?a.right.x:0,u=e.top-r+c>i,h=r-e.bottom-p>i,f=e.left-n+l>i,m=n-e.right-d>i;return u||h||f||m}))}(tt().concat(x).map((function(t){var e,n=null==(e=t._tippy.popperInstance)?void 0:e.state;return n?{popperRect:t.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean),t)&&(B(),nt(t))}function G(t){Y(t)||w.props.trigger.indexOf("click")>=0&&u||(w.props.interactive?w.hideWithInteractivity(t):nt(t))}function X(t){w.props.trigger.indexOf("focusin")<0&&t.target!==T()||w.props.interactive&&t.relatedTarget&&x.contains(t.relatedTarget)||nt(t)}function Y(t){return!!vc.isTouch&&N()!==t.type.indexOf("touch")>=0}function Q(){Z();var e=w.props,n=e.popperOptions,r=e.placement,o=e.offset,i=e.getReferenceClientRect,s=e.moveTransition,a=_()?Vc(x).arrow:null,p=i?{getBoundingClientRect:i,contextElement:i.contextElement||T()}:t,l=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(_()){var n=A().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?n.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?n.setAttribute("data-"+t,""):n.removeAttribute("data-"+t)})),e.attributes.popper={}}}}];_()&&a&&l.push({name:"arrow",options:{element:a,padding:3}}),l.push.apply(l,(null==n?void 0:n.modifiers)||[]),w.popperInstance=Qa(p,x,Object.assign({},n,{placement:r,onFirstUpdate:c,modifiers:l}))}function Z(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function tt(){return pc(x.querySelectorAll("[data-tippy-root]"))}function et(t){w.clearDelayTimeouts(),t&&R("onTrigger",[w,t]),$();var e=E(!0),n=C(),o=n[0],i=n[1];vc.isTouch&&"hold"===o&&i&&(e=i),e?r=setTimeout((function(){w.show()}),e):w.show()}function nt(t){if(w.clearDelayTimeouts(),R("onUntrigger",[w,t]),w.state.isVisible){if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&u)){var e=E(!1);e?o=setTimeout((function(){w.state.isVisible&&w.hide()}),e):i=requestAnimationFrame((function(){w.hide()}))}}else F()}}function Ic(t,e){void 0===e&&(e={});var n=Mc.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",yc,nc),window.addEventListener("blur",wc);var r=Object.assign({},e,{plugins:n}),o=uc(t).reduce((function(t,e){var n=e&&zc(e,r);return n&&t.push(n),t}),[]);return dc(t)?o[0]:o}Ic.defaultProps=Mc,Ic.setDefaultProps=function(t){Object.keys(t).forEach((function(e){Mc[e]=t[e]}))},Ic.currentInput=vc,Object.assign({},pa,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}}),Ic.setDefaultProps({render:Ac});class Bc{constructor({editor:t,element:e,view:n,tippyOptions:r}){this.preventHide=!1,this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:t})=>{var e;this.preventHide?this.preventHide=!1:(null==t?void 0:t.relatedTarget)&&(null===(e=this.element.parentNode)||void 0===e?void 0:e.contains(t.relatedTarget))||this.hide()},this.editor=t,this.element=e,this.view=n,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.createTooltip(r),this.element.style.visibility="visible"}createTooltip(t={}){this.tippy=Ic(this.view.dom,__spreadValues({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle"},t))}update(t,e){const{state:n,composing:r}=t,{doc:o,selection:i}=n,s=e&&e.doc.eq(o)&&e.selection.eq(i);if(r||s)return;const{empty:a,ranges:c}=i,p=Math.min(...c.map((t=>t.$from.pos))),l=Math.max(...c.map((t=>t.$to.pos))),d=!o.textBetween(p,l).length&&Hi(t.state.selection);a||d?this.hide():(this.tippy.setProps({getReferenceClientRect:()=>{if(Fi(e=t.state.selection)&&e instanceof ie){const e=t.nodeDOM(p);if(e)return e.getBoundingClientRect()}var e;return qs(t,p,l)}}),this.show())}show(){this.tippy.show()}hide(){this.tippy.hide()}destroy(){this.tippy.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 Lc=new Me("menuBubble"),Pc=t=>new we({key:Lc,view:e=>new Bc(__spreadValues({view:e},t))});Oi.create({name:"bubbleMenu",defaultOptions:{element:null,tippyOptions:{}},addProseMirrorPlugins(){return this.options.element?[Pc({editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions})]:[]}});class jc{constructor({editor:t,element:e,view:n,tippyOptions:r}){this.preventHide=!1,this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:t})=>{var e;this.preventHide?this.preventHide=!1:(null==t?void 0:t.relatedTarget)&&(null===(e=this.element.parentNode)||void 0===e?void 0:e.contains(t.relatedTarget))||this.hide()},this.editor=t,this.element=e,this.view=n,this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.createTooltip(r),this.element.style.visibility="visible"}createTooltip(t={}){this.tippy=Ic(this.view.dom,__spreadValues({duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle"},t))}update(t,e){const{state:n,composing:r}=t,{doc:o,selection:i}=n,s=e&&e.doc.eq(o)&&e.selection.eq(i);if(r||s)return;const{$anchor:a,empty:c,from:p,to:l}=i,d=1===a.depth,u=!i.$anchor.parent.isLeaf&&!i.$anchor.parent.textContent;c&&(d&&u)?(this.tippy.setProps({getReferenceClientRect:()=>qs(t,p,l)}),this.show()):this.hide()}show(){this.tippy.show()}hide(){this.tippy.hide()}destroy(){this.tippy.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const $c=new Me("menuFloating"),Fc=t=>new we({key:$c,view:e=>new jc(__spreadValues({view:e},t))});Oi.create({name:"floatingMenu",defaultOptions:{element:null,tippyOptions:{}},addProseMirrorPlugins(){return this.options.element?[Fc({editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions})]:[]}});const Hc=t.defineComponent({name:"BubbleMenu",props:{editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})}},setup(e,{slots:n}){const r=t.ref(null);return t.onMounted((()=>{const{editor:t,tippyOptions:n}=e;t.registerPlugin(Pc({editor:t,element:r.value,tippyOptions:n}))})),t.onBeforeUnmount((()=>{const{editor:t}=e;t.unregisterPlugin(Lc)})),()=>{var e;return t.h("div",{ref:r},null===(e=n.default)||void 0===e?void 0:e.call(n))}}});class qc extends class extends class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach((t=>t.apply(this,e))),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter((t=>t!==e)):delete this.callbacks[t]),this}removeAllListeners(){this.callbacks={}}}{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=function(t){const e=document.querySelector("style[data-tiptap-style]");if(null!==e)return e;const n=document.createElement("style");return n.setAttribute("data-tiptap-style",""),n.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(n),n}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}'))}setOptions(t={}){this.options=__spreadValues(__spreadValues({},this.options),t)}setEditable(t){this.setOptions({editable:t}),this.view&&this.state&&!this.isDestroyed&&this.view.updateState(this.state)}get isEditable(){return this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const n="function"==typeof e?e(t,this.state.plugins):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(t){if(this.isDestroyed)return;const e="string"==typeof t?`${t}$`:t.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((t=>!t.key.startsWith(e)))});this.view.updateState(n)}createExtensionManager(){const t=[...Object.entries(Ls).map((([,t])=>t)),...this.options.extensions].filter((t=>["extension","node","mark"].includes(null==t?void 0:t.type)));this.extensionManager=new xi(t,this)}createCommandManager(){this.commandManager=new ui(this,this.extensionManager.commands)}createSchema(){this.schema=this.extensionManager.schema}createView(){this.view=new lo(this.options.element,__spreadProps(__spreadValues({},this.options.editorProps),{dispatchTransaction:this.dispatchTransaction.bind(this),state:ve.create({doc:di(this.options.content,this.schema,this.options.parseOptions)})}));const t=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(t),this.createNodeViews();this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach((t=>{var e;return null===(e=this.capturedTransaction)||void 0===e?void 0:e.step(t)})):void(this.capturedTransaction=t);const e=this.state.apply(t),n=!this.state.selection.eq(e.selection);this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this});const r=t.getMeta("focus"),o=t.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event}),o&&this.emit("blur",{editor:this,event:o.event}),t.docChanged&&!t.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return function(t,e){const n=ei("string"==typeof e?e:e.name,t.schema);return"node"===n?ri(t,e):"mark"===n?ii(t,e):{}}(this.state,t)}getNodeAttributes(t){return console.warn("[tiptap warn]: editor.getNodeAttributes() is deprecated. please use editor.getAttributes() instead."),ri(this.state,t)}getMarkAttributes(t){return console.warn("[tiptap warn]: editor.getMarkAttributes() is deprecated. please use editor.getAttributes() instead."),ii(this.state,t)}isActive(t,e){const n="string"==typeof t?t:null,r="string"==typeof t?e:t;return function(t,e,n={}){if(!e)return ai(t,null,n)||ci(t,null,n);const r=ei(e,t.schema);return"node"===r?ai(t,e,n):"mark"===r&&ci(t,e,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return function(t,e){const n=mt.fromSchema(e).serializeFragment(t.content),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}(this.state.doc,this.schema)}get isEmpty(){return function(t){var e;const n=null===(e=t.type.createAndFill())||void 0===e?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}getCharacterCount(){return this.state.doc.content.size-2}destroy(){var t;this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners(),(t=this.css)&&t.parentNode&&t.parentNode.removeChild(t)}get isDestroyed(){var t;return!(null===(t=this.view)||void 0===t?void 0:t.docView)}}{constructor(e={}){var n;return super(e),this.vueRenderers=t.reactive(new Map),this.contentComponent=null,this.reactiveState=(n=this.view.state,t.customRef(((t,e)=>({get:()=>(t(),n),set(t){n=t,requestAnimationFrame((()=>{requestAnimationFrame((()=>{e()}))}))}})))),this.on("transaction",(()=>{this.reactiveState.value=this.view.state})),t.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}registerPlugin(t,e){super.registerPlugin(t,e),this.reactiveState.value=this.view.state}unregisterPlugin(t){super.unregisterPlugin(t),this.reactiveState.value=this.view.state}}const Jc=t.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const n=t.ref(),r=t.getCurrentInstance();return t.watchEffect((()=>{const o=e.editor;o&&o.options.element&&n.value&&t.nextTick((()=>{if(!n.value||!o.options.element.firstChild)return;const e=t.unref(n.value);n.value.append(...o.options.element.childNodes),o.contentComponent=r.ctx._,o.setOptions({element:e}),o.createNodeViews()}))})),t.onBeforeUnmount((()=>{const t=e.editor;if(!t)return;if(t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null,!t.options.element.firstChild)return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})})),{rootEl:n}},render(){const e=[];return this.editor&&this.editor.vueRenderers.forEach((n=>{const r=t.h(t.Teleport,{to:n.teleportElement,key:n.id},t.h(n.component,__spreadValues({ref:n.id},n.props)));e.push(r)})),t.h("div",{ref:t=>{this.rootEl=t}},...e)}});t.defineComponent({name:"FloatingMenu",props:{editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})}},setup(e,{slots:n}){const r=t.ref(null);return t.onMounted((()=>{const{editor:t,tippyOptions:n}=e;t.registerPlugin(Fc({editor:t,element:r.value,tippyOptions:n}))})),t.onBeforeUnmount((()=>{const{editor:t}=e;t.unregisterPlugin($c)})),()=>{var e;return t.h("div",{ref:r},null===(e=n.default)||void 0===e?void 0:e.call(n))}}}),t.defineComponent({props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var e,n;return t.h(this.as,{class:this.decorationClasses.value,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragStart:this.onDragStart},null===(n=(e=this.$slots).default)||void 0===n?void 0:n.call(e))}}),t.defineComponent({props:{as:{type:String,default:"div"}},render(){return t.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}});const Wc=/^```(?[a-z]*)? $/,Uc=/^~~~(?[a-z]*)? $/,Kc=Ps.create({name:"codeBlock",defaultOptions:{languageClassPrefix:"language-",HTMLAttributes:{}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const n=null===(e=t.firstElementChild)||void 0===e?void 0:e.getAttribute("class");if(!n)return null;const r=new RegExp(`^(${this.options.languageClassPrefix})`);return{language:n.replace(r,"")}},renderHTML:t=>t.language?{class:this.options.languageClassPrefix+t.language}:null}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({HTMLAttributes:t}){return["pre",this.options.HTMLAttributes,["code",t,0]]},addCommands:()=>({setCodeBlock:t=>({commands:e})=>e.setNode("codeBlock",t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode("codeBlock","paragraph",t)}),addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=1===e.pos;return!(!t||e.parent.type.name!==this.name)&&(!(!n&&e.parent.textContent.length)&&this.editor.commands.clearNodes())}}},addInputRules(){return[Ro(Wc,this.type,(({groups:t})=>t)),Ro(Uc,this.type,(({groups:t})=>t))]}}),Gc=js.create({name:"underline",defaultOptions:{HTMLAttributes:{}},parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("underline")&&{}}],renderHTML({HTMLAttributes:t}){return["u",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({setUnderline:()=>({commands:t})=>t.setMark("underline"),toggleUnderline:()=>({commands:t})=>t.toggleMark("underline"),unsetUnderline:()=>({commands:t})=>t.unsetMark("underline")}),addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline()}}});function Xc(t,e,n){for(var r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;var o=t.child(r),i=e.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(var s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){var a=Xc(o.content,i.content,n+1);if(null!=a)return a}n+=o.nodeSize}else n+=o.nodeSize}}function Yc(t,e,n,r){for(var o=t.childCount,i=e.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};var s=t.child(--o),a=e.child(--i),c=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){for(var p=0,l=Math.min(s.text.length,a.text.length);pt&&!1!==n(a,r+s,o,i)&&a.content.size){var p=s+1;a.nodesBetween(Math.max(0,t-p),Math.min(a.content.size,e-p),n,r+p)}s=c}},Qc.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},Qc.prototype.textBetween=function(t,e,n,r){var o="",i=!0;return this.nodesBetween(t,e,(function(s,a){s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf&&r?(o+=r,i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o},Qc.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);ot)for(var o=0,i=0;it&&((ie)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),n.push(s),r+=s.nodeSize),i=a}return new Qc(n,r)},Qc.prototype.cutByIndex=function(t,e){return t==e?Qc.empty:0==t&&e==this.content.length?this:new Qc(this.content.slice(t,e))},Qc.prototype.replaceChild=function(t,e){var n=this.content[t];if(n==e)return this;var r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new Qc(r,o)},Qc.prototype.addToStart=function(t){return new Qc([t].concat(this.content),this.size+t.nodeSize)},Qc.prototype.addToEnd=function(t){return new Qc(this.content.concat(t),this.size+t.nodeSize)},Qc.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;ethis.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?ep(n+1,o):ep(n,r);r=o}},Qc.prototype.toString=function(){return"<"+this.toStringInner()+">"},Qc.prototype.toStringInner=function(){return this.content.join(", ")},Qc.prototype.toJSON=function(){return this.content.length?this.content.map((function(t){return t.toJSON()})):null},Qc.fromJSON=function(t,e){if(!e)return Qc.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new Qc(e.map(t.nodeFromJSON))},Qc.fromArray=function(t){if(!t.length)return Qc.empty;for(var e,n=0,r=0;rthis.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e},rp.prototype.removeFromSet=function(t){for(var e=0;et.depth)throw new op("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new op("Inconsistent open depths");return lp(t,e,n,0)}function lp(t,e,n,r){var o=t.index(r),i=t.node(r);if(o==e.index(r)&&r=0;o--)r=e.node(o).copy(Qc.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return mp(i,vp(t,a.start,a.end,e,r))}var c=t.parent,p=c.content;return mp(c,p.cut(0,t.parentOffset).append(n.content).append(p.cut(e.parentOffset)))}return mp(i,gp(t,e,r))}function dp(t,e){if(!e.type.compatibleContent(t.type))throw new op("Cannot join "+e.type.name+" onto "+t.type.name)}function up(t,e,n){var r=t.node(n);return dp(r,e.node(n)),r}function hp(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function fp(t,e,n,r){var o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(hp(t.nodeAfter,r),i++));for(var a=i;ao&&up(t,e,o+1),s=r.depth>o&&up(n,r,o+1),a=[];return fp(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(dp(i,s),hp(mp(i,vp(t,e,n,r,o+1)),a)):(i&&hp(mp(i,gp(t,e,o+1)),a),fp(e,n,o,a),s&&hp(mp(s,gp(n,r,o+1)),a)),fp(r,null,o,a),new Qc(a)}function gp(t,e,n){var r=[];(fp(null,t,n,r),t.depth>n)&&hp(mp(up(t,e,n+1),gp(t,e,n+1)),r);return fp(e,null,n,r),new Qc(r)}sp.size.get=function(){return this.content.size-this.openStart-this.openEnd},ip.prototype.insertAt=function(t,e){var n=cp(this.content,t+this.openStart,e,null);return n&&new ip(n,this.openStart,this.openEnd)},ip.prototype.removeBetween=function(t,e){return new ip(ap(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)},ip.prototype.eq=function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd},ip.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},ip.prototype.toJSON=function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},ip.fromJSON=function(t,e){if(!e)return ip.empty;var n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new ip(Qc.fromJSON(t,e.content),n,r)},ip.maxOpen=function(t,e){void 0===e&&(e=!0);for(var n=0,r=0,o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new ip(t,n,r)},Object.defineProperties(ip.prototype,sp),ip.empty=new ip(Qc.empty,0,0);var yp=function(t,e,n){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=n},bp={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};yp.prototype.resolveDepth=function(t){return null==t?this.depth:t<0?this.depth+t:t},bp.parent.get=function(){return this.node(this.depth)},bp.doc.get=function(){return this.node(0)},yp.prototype.node=function(t){return this.path[3*this.resolveDepth(t)]},yp.prototype.index=function(t){return this.path[3*this.resolveDepth(t)+1]},yp.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)},yp.prototype.start=function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1},yp.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},yp.prototype.before=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]},yp.prototype.after=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize},bp.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},bp.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r},bp.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)},yp.prototype.posAtIndex=function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1,o=0;o0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},yp.prototype.blockRange=function(t,e){if(void 0===t&&(t=this),t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new Mp(this,t,n)},yp.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},yp.prototype.max=function(t){return t.pos>this.pos?t:this},yp.prototype.min=function(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var n=[],r=0,o=e,i=t;;){var s=i.content.findIndex(o),a=s.index,c=s.offset,p=o-c;if(n.push(i,a,r+c),!p)break;if((i=i.child(a)).isText)break;o=p-1,r+=c+1}return new yp(e,n,o)},yp.resolveCached=function(t,e){for(var n=0;nt&&this.nodesBetween(t,e,(function(t){return n.isInSet(t.marks)&&(r=!0),!r})),r},Np.isBlock.get=function(){return this.type.isBlock},Np.isTextblock.get=function(){return this.type.isTextblock},Np.inlineContent.get=function(){return this.type.inlineContent},Np.isInline.get=function(){return this.type.isInline},Np.isText.get=function(){return this.type.isText},Np.isLeaf.get=function(){return this.type.isLeaf},Np.isAtom.get=function(){return this.type.isAtom},Cp.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()+")"),function(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}(this.marks,t)},Cp.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},Cp.prototype.canReplace=function(t,e,n,r,o){void 0===n&&(n=Qc.empty),void 0===r&&(r=0),void 0===o&&(o=n.childCount);var i=this.contentMatchAt(t).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(var a=r;a-1&&o[i+1];Lp(t,r).forEach((function(t){s||o.push(n,s=[]),-1==s.indexOf(t)&&s.push(t)}))}}))}));for(var i=e[r.join(",")]=new _p(r.indexOf(t.length-1)>-1),s=0;s>1},_p.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},_p.prototype.toString=function(){var t=[];return function e(n){t.push(n);for(var r=1;r"+t.indexOf(e.next[o+1]);return r})).join("\n")},Object.defineProperties(_p.prototype,Tp),_p.empty=new _p(!0);var Vp=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},Ap={next:{configurable:!0}};function Ep(t){var e=[];do{e.push(Dp(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function Dp(t){var e=[];do{e.push(Rp(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function Rp(t){for(var e=function(t){if(t.eat("(")){var e=Ep(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){var n=function(t,e){var n=t.nodeTypes,r=n[e];if(r)return[r];var o=[];for(var i in n){var s=n[i];s.groups.indexOf(e)>-1&&o.push(s)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((function(e){return null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}}));return t.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}t.err("Unexpected token '"+t.next+"'")}(t);;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=Ip(t,e)}return e}function zp(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function Ip(t,e){var n=zp(t),r=n;return t.eat(",")&&(r="}"!=t.next?zp(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Bp(t,e){return e-t}function Lp(t,e){var n=[];return function e(r){var o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(var i=0;i-1},Fp.prototype.allowsMarks=function(t){if(null==this.markSet)return!0;for(var e=0;e-1};var Up={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Kp={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Gp={ol:!0,ul:!0};function Xp(t){return(t?1:0)|("full"===t?2:0)}var Yp=function(t,e,n,r,o,i,s){this.type=t,this.attrs=e,this.solid=o,this.match=i||(4&s?null:t.contentMatch),this.options=s,this.content=[],this.marks=n,this.activeMarks=rp.none,this.pendingMarks=r,this.stashMarks=[]};Yp.prototype.findWrapping=function(t){if(!this.match){if(!this.type)return[];var e=this.type.contentMatch.fillBefore(Qc.from(t));if(!e){var n,r=this.type.contentMatch;return(n=r.findWrapping(t.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)},Yp.prototype.finish=function(t){if(!(1&this.options)){var e,n=this.content[this.content.length-1];n&&n.isText&&(e=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length)))}var r=Qc.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(Qc.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r},Yp.prototype.popFromStashMark=function(t){for(var e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]},Yp.prototype.applyPending=function(t){for(var e=0,n=this.pendingMarks;e=0;r--){var o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(var s=0;sthis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},Qp.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},Qp.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return void(this.open=e)},Zp.currentPos.get=function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t},Qp.prototype.findAtPoint=function(t,e){if(this.find)for(var n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=function(t,a){for(;t>=0;t--){var c=n[t];if(""==c){if(t==n.length-1||0==t)continue;for(;a>=i;a--)if(s(t-1,a))return!0;return!1}var p=a>0||0==a&&o?e.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!p||p.name!=c&&-1==p.groups.indexOf(c))return!1;a--}return!0};return s(n.length-1,this.open)},Qp.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},Qp.prototype.addPendingMark=function(t){var e=function(t,e){for(var n=0;n=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);var o=r.popFromStashMark(t);o&&r.type&&r.type.allowsMarkType(o.type)&&(r.activeMarks=o.addToSet(r.activeMarks))}if(r==e)break}},Object.defineProperties(Qp.prototype,Zp);var el=Math.pow(2,16);function nl(t){return 65535&t}var rl=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.pos=t,this.deleted=e,this.recover=n},ol=function(t,e){void 0===e&&(e=!1),this.ranges=t,this.inverted=e};ol.prototype.recover=function(t){var e=0,n=nl(t);if(!this.inverted)for(var r=0;rt)break;var c=this.ranges[s+o],p=this.ranges[s+i],l=a+c;if(t<=l){var d=a+r+((c?t==a?-1:t==l?1:e:e)<0?0:p);if(n)return d;var u=t==(e<0?a:l)?null:s/3+(t-a)*el;return new rl(d,e<0?t!=a:t!=l,u)}r+=p-c}return n?t+r:new rl(t+r)},ol.prototype.touches=function(t,e){for(var n=0,r=nl(e),o=this.inverted?2:1,i=this.inverted?1:2,s=0;st)break;var c=this.ranges[s+o];if(t<=a+c&&s==3*r)return!0;n+=this.ranges[s+i]-c}return!1},ol.prototype.forEach=function(t){for(var e=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r=0;e--){var r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:null)}},il.prototype.invert=function(){var t=new il;return t.appendMappingInverted(this),t},il.prototype.map=function(t,e){if(void 0===e&&(e=1),this.mirror)return this._map(t,e,!0);for(var n=this.from;no&&s0},al.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(al.prototype,cl);var ll=Object.create(null),dl=function(){};dl.prototype.apply=function(t){return pl()},dl.prototype.getMap=function(){return ol.empty},dl.prototype.invert=function(t){return pl()},dl.prototype.map=function(t){return pl()},dl.prototype.merge=function(t){return null},dl.prototype.toJSON=function(){return pl()},dl.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=ll[e.stepType];if(!n)throw new RangeError("No step type "+e.stepType+" defined");return n.fromJSON(t,e)},dl.jsonID=function(t,e){if(t in ll)throw new RangeError("Duplicate use of step JSON ID "+t);return ll[t]=e,e.prototype.jsonID=t,e};var ul=function(t,e){this.doc=t,this.failed=e};ul.ok=function(t){return new ul(t,null)},ul.fail=function(t){return new ul(null,t)},ul.fromReplace=function(t,e,n,r){try{return ul.ok(t.replace(e,n,r))}catch(o){if(o instanceof op)return ul.fail(o.message);throw o}};var hl=function(t){function e(e,n,r,o){t.call(this),this.from=e,this.to=n,this.slice=r,this.structure=!!o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){return this.structure&&ml(t,this.from,this.to)?ul.fail("Structure replace would overwrite content"):ul.fromReplace(t,this.from,this.to,this.slice)},e.prototype.getMap=function(){return new ol([this.from,this.to-this.from,this.slice.size])},e.prototype.invert=function(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)},e.prototype.merge=function(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var n=this.slice.size+t.slice.size==0?ip.empty:new ip(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}var r=this.slice.size+t.slice.size==0?ip.empty:new ip(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),r,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,ip.fromJSON(t,n.slice),!!n.structure)},e}(dl);dl.jsonID("replace",hl);var fl=function(t){function e(e,n,r,o,i,s,a){t.call(this),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=!!a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){if(this.structure&&(ml(t,this.from,this.gapFrom)||ml(t,this.gapTo,this.to)))return ul.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return ul.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?ul.fromReplace(t,this.from,this.to,n):ul.fail("Content does not fit in gap")},e.prototype.getMap=function(){return new ol([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},e.prototype.invert=function(t){var n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deleted&&r.deleted||or.pos?null:new e(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,ip.fromJSON(t,n.slice),n.insert,!!n.structure)},e}(dl);function ml(t,e,n){for(var r=t.resolve(e),o=n-e,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function vl(t,e,n){for(var r=[],o=0;oe;d--)u||n.index(d)>0?(u=!0,p=Qc.from(n.node(d).copy(p)),l++):a--;for(var h=Qc.empty,f=0,m=o,v=!1;m>e;m--)v||r.after(m+1)=0;r--)n=Qc.from(e[r].type.create(e[r].attrs,n));var o=t.start,i=t.end;return this.step(new fl(o,i,o,i,new ip(n,0,0),e.length,!0))},al.prototype.setBlockType=function(t,e,n,r){var o=this;if(void 0===e&&(e=t),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=this.steps.length;return this.doc.nodesBetween(t,e,(function(t,e){if(t.isTextblock&&!t.hasMarkup(n,r)&&function(t,e,n){var r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(o.doc,o.mapping.slice(i).map(e),n)){o.clearIncompatible(o.mapping.slice(i).map(e,1),n);var s=o.mapping.slice(i),a=s.map(e,1),c=s.map(e+t.nodeSize,1);return o.step(new fl(a,c,a+1,c-1,new ip(Qc.from(n.create(r,null,t.marks)),0,0),1,!0)),!1}})),this},al.prototype.setNodeMarkup=function(t,e,n,r){var o=this.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");e||(e=o.type);var i=e.create(n,null,r||o.marks);if(o.isLeaf)return this.replaceWith(t,t+o.nodeSize,i);if(!e.validContent(o.content))throw new RangeError("Invalid content for node type "+e.name);return this.step(new fl(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new ip(Qc.from(i),0,0),1,!0))},al.prototype.split=function(t,e,n){void 0===e&&(e=1);for(var r=this.doc.resolve(t),o=Qc.empty,i=Qc.empty,s=r.depth,a=r.depth-e,c=e-1;s>a;s--,c--){o=Qc.from(r.node(s).copy(o));var p=n&&n[c];i=Qc.from(p?p.type.create(p.attrs,i):r.node(s).copy(i))}return this.step(new hl(t,t,new ip(o.append(i),e,e),!0))},al.prototype.join=function(t,e){void 0===e&&(e=1);var n=new hl(t-e,t+e,ip.empty,!0);return this.step(n)};var gl=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=t.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new ip(vl(n.content,(function(t,n){return t.isAtom&&n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t}),o),n.openStart,n.openEnd);return ul.fromReplace(t,this.from,this.to,i)},e.prototype.invert=function(){return new yl(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(dl);dl.jsonID("addMark",gl);var yl=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=new ip(vl(n.content,(function(t){return t.mark(e.mark.removeFromSet(t.marks))})),n.openStart,n.openEnd);return ul.fromReplace(t,this.from,this.to,r)},e.prototype.invert=function(){return new gl(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(dl);function bl(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}dl.jsonID("removeMark",yl),al.prototype.addMark=function(t,e,n){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(t,e,(function(r,c,p){if(r.isInline){var l=r.marks;if(!n.isInSet(l)&&p.type.allowsMarkType(n.type)){for(var d=Math.max(c,t),u=Math.min(c+r.nodeSize,e),h=n.addToSet(l),f=0;f=0;u--)this.step(o[u]);return this},al.prototype.replace=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=ip.empty);var r=function(t,e,n,r){if(void 0===n&&(n=e),void 0===r&&(r=ip.empty),e==n&&!r.size)return null;var o=t.resolve(e),i=t.resolve(n);return bl(o,i,r)?new hl(e,n,r):new wl(o,i,r).fit()}(this.doc,t,e,n);return r&&this.step(r),this},al.prototype.replaceWith=function(t,e,n){return this.replace(t,e,new ip(Qc.from(n),0,0))},al.prototype.delete=function(t,e){return this.replace(t,e,ip.empty)},al.prototype.insert=function(t,e){return this.replaceWith(t,t,e)};var wl=function(t,e,n){this.$to=e,this.$from=t,this.unplaced=n,this.frontier=[];for(var r=0;r<=t.depth;r++){var o=t.node(r);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(r))})}this.placed=Qc.empty;for(var i=t.depth;i>0;i--)this.placed=Qc.from(t.node(i).copy(this.placed))},kl={depth:{configurable:!0}};function xl(t,e,n){return 0==e?t.cutByIndex(n):t.replaceChild(0,t.firstChild.copy(xl(t.firstChild.content,e-1,n)))}function Ml(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ml(t.lastChild.content,e-1,n)))}function Sl(t,e){for(var n=0;n1&&(r=r.replaceChild(0,Ol(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(Qc.empty,!0)))),t.copy(r)}function Cl(t,e,n,r,o){var i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;var a=r.fillBefore(i.content,!0,s);return a&&!function(t,e,n){for(var r=n;rr){var s=o.contentMatchAt(0),a=s.fillBefore(t).append(t);t=a.append(s.matchFragment(a).fillBefore(Qc.empty,!0))}return t}function _l(t,e){for(var n=[],r=Math.min(t.depth,e.depth);r>=0;r--){var o=t.start(r);if(oe.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;o==e.start(r)&&n.push(r)}return n}kl.depth.get=function(){return this.frontier.length-1},wl.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;for(var i=this.placed,s=r.depth,a=o.depth;s&&a&&1==i.childCount;)i=i.firstChild.content,s--,a--;var c=new ip(i,s,a);return e>-1?new fl(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new hl(r.pos,o.pos,c):void 0},wl.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var e=this.unplaced.openStart;e>=0;e--)for(var n=void 0,r=(e?(n=Sl(this.unplaced.content,e-1).firstChild).content:this.unplaced.content).firstChild,o=this.depth;o>=0;o--){var i=this.frontier[o],s=i.type,a=i.match,c=void 0,p=void 0;if(1==t&&(r?a.matchType(r.type)||(p=a.fillBefore(Qc.from(r),!1)):s.compatibleContent(n.type)))return{sliceDepth:e,frontierDepth:o,parent:n,inject:p};if(2==t&&r&&(c=a.findWrapping(r.type)))return{sliceDepth:e,frontierDepth:o,parent:n,wrap:c};if(n&&a.matchType(n.type))break}},wl.prototype.openMore=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,o=Sl(e,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new ip(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)},wl.prototype.dropNode=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,o=Sl(e,n);if(o.childCount<=1&&n>0){var i=e.size-n<=n+o.size;this.unplaced=new ip(xl(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new ip(xl(e,n,1),n,r)},wl.prototype.placeNodes=function(t){for(var e=t.sliceDepth,n=t.frontierDepth,r=t.parent,o=t.inject,i=t.wrap;this.depth>n;)this.closeFrontierNode();if(i)for(var s=0;s1||0==p||g.content.size)&&(h=y,d.push(Ol(g.mark(f.allowedMarks(g.marks)),1==l?p:0,l==c.childCount?v:-1)))}var b=l==c.childCount;b||(v=-1),this.placed=Ml(this.placed,n,Qc.from(d)),this.frontier[n].match=h,b&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var w=0,k=c;w1&&r==this.$to.end(--n);)++r;return r},wl.prototype.findCloseLevel=function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],r=n.match,o=n.type,i=e=0;a--){var c=this.frontier[a],p=c.match,l=Cl(t,a,c.type,p,!0);if(!l||l.childCount)continue t}return{depth:e,fit:s,move:i?t.doc.resolve(t.after(e+1)):t}}}},wl.prototype.close=function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Ml(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;n++){var r=t.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,o)}return t},wl.prototype.openFrontierNode=function(t,e,n){var r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=Ml(this.placed,this.depth,Qc.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})},wl.prototype.closeFrontierNode=function(){var t=this.frontier.pop().match.fillBefore(Qc.empty,!0);t.childCount&&(this.placed=Ml(this.placed,this.frontier.length,t))},Object.defineProperties(wl.prototype,kl),al.prototype.replaceRange=function(t,e,n){if(!n.size)return this.deleteRange(t,e);var r=this.doc.resolve(t),o=this.doc.resolve(e);if(bl(r,o,n))return this.step(new hl(t,e,n));var i=_l(r,this.doc.resolve(e));0==i[i.length-1]&&i.pop();var s=-(r.depth+1);i.unshift(s);for(var a=r.depth,c=r.pos-1;a>0;a--,c--){var p=r.node(a).type.spec;if(p.defining||p.isolating)break;i.indexOf(a)>-1?s=a:r.before(a)==c&&i.splice(1,0,-a)}for(var l=i.indexOf(s),d=[],u=n.openStart,h=n.content,f=0;;f++){var m=h.firstChild;if(d.push(m),f==n.openStart)break;h=m.content}u>0&&d[u-1].type.spec.defining&&r.node(l).type!=d[u-1].type?u-=1:u>=2&&d[u-1].isTextblock&&d[u-2].type.spec.defining&&r.node(l).type!=d[u-2].type&&(u-=2);for(var v=n.openStart;v>=0;v--){var g=(v+u+1)%(n.openStart+1),y=d[g];if(y)for(var b=0;b=0&&(this.replace(t,e,n),!(this.steps.length>S));O--){var C=i[O];C<0||(t=r.before(C),e=o.after(C))}return this},al.prototype.replaceRangeWith=function(t,e,n){if(!n.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var r=function(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,n))return r.after(s+1);if(a0&&(a||n.node(s-1).canReplace(n.index(s-1),r.indexAfter(s-1))))return this.delete(n.before(s),r.after(s))}for(var c=1;c<=n.depth&&c<=r.depth;c++)if(t-n.start(c)==n.depth-c&&e>n.end(c)&&r.end(c)-e!=r.depth-c)return this.delete(n.before(c),e);return this.delete(t,e)};var Tl=Object.create(null),Vl=function(t,e,n){this.ranges=n||[new El(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},Al={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};Al.anchor.get=function(){return this.$anchor.pos},Al.head.get=function(){return this.$head.pos},Al.from.get=function(){return this.$from.pos},Al.to.get=function(){return this.$to.pos},Al.$from.get=function(){return this.ranges[0].$from},Al.$to.get=function(){return this.ranges[0].$to},Al.empty.get=function(){for(var t=this.ranges,e=0;e=0;o--){var i=e<0?Pl(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):Pl(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(i)return i}},Vl.near=function(t,e){return void 0===e&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new Bl(t.node(0))},Vl.atStart=function(t){return Pl(t,t,0,0,1)||new Bl(t)},Vl.atEnd=function(t){return Pl(t,t,t.content.size,t.childCount,-1)||new Bl(t)},Vl.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=Tl[e.type];if(!n)throw new RangeError("No selection type "+e.type+" defined");return n.fromJSON(t,e)},Vl.jsonID=function(t,e){if(t in Tl)throw new RangeError("Duplicate use of selection JSON ID "+t);return Tl[t]=e,e.prototype.jsonID=t,e},Vl.prototype.getBookmark=function(){return Dl.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(Vl.prototype,Al),Vl.prototype.visible=!0;var El=function(t,e){this.$from=t,this.$to=e},Dl=function(t){function e(e,n){void 0===n&&(n=e),t.call(this,e,n)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return t.near(o);var i=n.resolve(r.map(this.anchor));return new e(i.parent.inlineContent?i:o,o)},e.prototype.replace=function(e,n){if(void 0===n&&(n=ip.empty),t.prototype.replace.call(this,e,n),n==ip.empty){var r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head},e.prototype.getBookmark=function(){return new Rl(this.anchor,this.head)},e.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,e,n){void 0===n&&(n=e);var r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))},e.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var s=t.findFrom(r,o,!0)||t.findFrom(r,-o,!0);if(!s)return t.near(r,o);r=s.$head}return n.parent.inlineContent||(0==i||(n=(t.findFrom(n,-o,!0)||t.findFrom(n,o,!0)).$anchor).pos0?0:1);o>0?s=0;s+=o){var a=e.child(s);if(a.isAtom){if(!i&&zl.isSelectable(a))return zl.create(t,n-(o<0?a.nodeSize:0))}else{var c=Pl(t,a,n+o,o<0?a.childCount:0,o,i);if(c)return c}n+=a.nodeSize*o}}function jl(t,e,n){var r=t.steps.length-1;if(!(r0},e.prototype.setStoredMarks=function(t){return this.storedMarks=t,this.updated|=2,this},e.prototype.ensureMarks=function(t){return rp.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this},e.prototype.addStoredMark=function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))},e.prototype.removeStoredMark=function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},e.prototype.addStep=function(e,n){t.prototype.addStep.call(this,e,n),this.updated=-3&this.updated,this.storedMarks=null},e.prototype.setTime=function(t){return this.time=t,this},e.prototype.replaceSelection=function(t){return this.selection.replace(this,t),this},e.prototype.replaceSelectionWith=function(t,e){var n=this.selection;return!1!==e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||rp.none))),n.replaceWith(this,t),this},e.prototype.deleteSelection=function(){return this.selection.replace(this),this},e.prototype.insertText=function(t,e,n){void 0===n&&(n=e);var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(!t)return this.deleteRange(e,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(e);o=n==e?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.setSelection(Vl.near(this.selection.$to)),this},e.prototype.setMeta=function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this},e.prototype.getMeta=function(t){return this.meta["string"==typeof t?t:t.key]},n.isGeneric.get=function(){for(var t in this.meta)return!1;return!0},e.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(e.prototype,n),e}(al);function Fl(t,e){return e&&t?t.bind(e):t}var Hl=function(t,e,n){this.name=t,this.init=Fl(e.init,n),this.apply=Fl(e.apply,n)},ql=[new Hl("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new Hl("selection",{init:function(t,e){return t.selection||Vl.atStart(e.doc)},apply:function(t){return t.selection}}),new Hl("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Hl("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],Jl=function(t,e){var n=this;this.schema=t,this.fields=ql.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach((function(t){if(n.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");n.plugins.push(t),n.pluginsByKey[t.key]=t,t.spec.state&&n.fields.push(new Hl(t.key,t.spec.state,t))}))},Wl=function(t){this.config=t},Ul={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};Ul.schema.get=function(){return this.config.schema},Ul.plugins.get=function(){return this.config.plugins},Wl.prototype.apply=function(t){return this.applyTransaction(t).state},Wl.prototype.filterTransaction=function(t,e){void 0===e&&(e=-1);for(var n=0;n-1&&Kl.splice(e,1)},Object.defineProperties(Wl.prototype,Ul);var Kl=[];function Gl(t,e,n){for(var r in t){var o=t[r];o instanceof Function?o=o.bind(e):"handleDOMEvents"==r&&(o=Gl(o,e,{})),n[r]=o}return n}var Xl=function(t){this.props={},t.props&&Gl(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:Ql("plugin")};Xl.prototype.getState=function(t){return t[this.key]};var Yl=Object.create(null);function Ql(t){return t in Yl?t+"$"+ ++Yl[t]:(Yl[t]=0,t+"$")}var Zl=function(t){void 0===t&&(t="key"),this.key=Ql(t)};Zl.prototype.get=function(t){return t.config.pluginsByKey[this.key]},Zl.prototype.getState=function(t){return t[this.key]};const td=new Zl("characterLimit"),ed=Oi.create({name:"characterCount",defaultOptions:{limit:0},addProseMirrorPlugins(){const{options:t}=this;return[new Xl({key:td,appendTransaction:(e,n,r)=>{const o=r.doc.content.size;if(t.limit&&o>t.limit)return r.tr.insertText("",t.limit+1,o)}})]}}),nd=Oi.create({name:"textAlign",defaultOptions:{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>({textAlign:t.style.textAlign||this.options.defaultAlignment}),renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>!!this.options.alignments.includes(t)&&this.options.types.every((n=>e.updateAttributes(n,{textAlign:t}))),unsetTextAlign:()=>({commands:t})=>this.options.types.every((e=>t.resetAttributes(e,"textAlign")))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),rd=Ps.create({name:"horizontalRule",defaultOptions:{HTMLAttributes:{}},group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:t}){return["hr",vi(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t})=>t().insertContent({type:this.name}).command((({tr:t,dispatch:e})=>{var n;if(e){const{parent:e,pos:r}=t.selection.$from,o=r+1;if(!t.doc.nodeAt(o)){const r=null===(n=e.type.contentMatch.defaultType)||void 0===n?void 0:n.create();r&&(t.insert(o,r),t.setSelection(re.create(t.doc,o)))}t.scrollIntoView()}return!0})).run()}},addInputRules(){return[$s(/^(?:---|—-|___\s|\*\*\*\s)$/,this.type)]}}),od=/!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/;Ps.create({name:"image",defaultOptions:{inline:!1,HTMLAttributes:{}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null}}),parseHTML:()=>[{tag:"img[src]"}],renderHTML({HTMLAttributes:t}){return["img",vi(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[$s(od,this.type,(t=>{const[,e,n,r]=t;return{src:n,alt:e,title:r}}))]}});const id=/^\s*([-+*])\s$/,sd=Ps.create({name:"bulletList",defaultOptions:{HTMLAttributes:{}},group:"block list",content:"listItem+",parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({toggleBulletList:()=>({commands:t})=>t.toggleList("bulletList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[Do(id,this.type)]}}),ad=/^(\d+)\.\s$/,cd=Ps.create({name:"orderedList",defaultOptions:{HTMLAttributes:{}},group:"block list",content:"listItem+",addAttributes:()=>({start:{default:1,parseHTML:t=>({start:t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1})}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){const e=t,{start:n}=e,r=__objRest(e,["start"]);return 1===n?["ol",vi(this.options.HTMLAttributes,r),0]:["ol",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({toggleOrderedList:()=>({commands:t})=>t.toggleList("orderedList","listItem")}),addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[Do(ad,this.type,(t=>({start:+t[1]})),((t,e)=>e.childCount+e.attrs.start===+t[1]))]}}),pd=Ps.create({name:"taskList",defaultOptions:{HTMLAttributes:{}},group:"block list",content:"taskItem+",parseHTML:()=>[{tag:'ul[data-type="taskList"]',priority:51}],renderHTML:({HTMLAttributes:t})=>["ul",vi(t,{"data-type":"taskList"}),0],addCommands:()=>({toggleTaskList:()=>({commands:t})=>t.toggleList("taskList","taskItem")}),addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),ld=/^\s*(\[([ |x])\])\s$/,dd=Ps.create({name:"taskItem",defaultOptions:{nested:!1,HTMLAttributes:{}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,parseHTML:t=>({checked:"true"===t.getAttribute("data-checked")}),renderHTML:t=>({"data-checked":t.checked}),keepOnSplit:!1}}),parseHTML:()=>[{tag:'li[data-type="taskItem"]',priority:51}],renderHTML({HTMLAttributes:t}){return["li",vi(this.options.HTMLAttributes,t,{"data-type":"taskItem"}),0]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem("taskItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("taskItem")};return this.options.nested?__spreadProps(__spreadValues({},t),{Tab:()=>this.editor.commands.sinkListItem("taskItem")}):t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),c=document.createElement("div");return i.contentEditable="false",a.type="checkbox",a.addEventListener("change",(t=>{if(!r.isEditable)return void(a.checked=!a.checked);const{checked:e}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus().command((({tr:t})=>(t.setNodeMarkup(n(),void 0,{checked:e}),!0))).run()})),o.dataset.checked=t.attrs.checked,t.attrs.checked&&a.setAttribute("checked","checked"),i.append(a,s),o.append(i,c),Object.entries(e).forEach((([t,e])=>{o.setAttribute(t,e)})),{dom:o,contentDOM:c,update:t=>t.type===this.type&&(o.dataset.checked=t.attrs.checked,t.attrs.checked?a.setAttribute("checked","checked"):a.removeAttribute("checked"),!0)}}},addInputRules(){return[Do(ld,this.type,(t=>({checked:"x"===t[t.length-1]})))]}});var ud=function(t,e){var n=this;this.editorView=t,this.width=e.width||1,this.color=e.color||"black",this.class=e.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var r=function(t){return n[e](t)};return t.dom.addEventListener(e,r),{name:e,handler:r}}))};ud.prototype.destroy=function(){var t=this;this.handlers.forEach((function(e){var n=e.name,r=e.handler;return t.editorView.dom.removeEventListener(n,r)}))},ud.prototype.update=function(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())},ud.prototype.setCursor=function(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},ud.prototype.updateOverlay=function(){var t,e=this.editorView.state.doc.resolve(this.cursorPos);if(!e.parent.inlineContent){var n=e.nodeBefore,r=e.nodeAfter;if(n||r){var o=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!t){var s=this.editorView.coordsAtPos(this.cursorPos);t={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}var a,c,p=this.editorView.dom.offsetParent;if(this.element||(this.element=p.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),!p||p==document.body&&"static"==getComputedStyle(p).position)a=-pageXOffset,c=-pageYOffset;else{var l=p.getBoundingClientRect();a=l.left-p.scrollLeft,c=l.top-p.scrollTop}this.element.style.left=t.left-a+"px",this.element.style.top=t.top-c+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"},ud.prototype.scheduleRemoval=function(t){var e=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return e.setCursor(null)}),t)},ud.prototype.dragover=function(t){if(this.editorView.editable){var e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY});if(e){var n=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(n=Pt(this.editorView.state.doc,n,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(n),this.scheduleRemoval(5e3)}}},ud.prototype.dragend=function(){this.scheduleRemoval(20)},ud.prototype.drop=function(){this.scheduleRemoval(20)},ud.prototype.dragleave=function(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)};const hd=Oi.create({name:"dropCursor",defaultOptions:{color:"currentColor",width:1,class:null},addProseMirrorPlugins(){return[(t=this.options,void 0===t&&(t={}),new we({view:function(e){return new ud(e,t)}}))];var t}});var fd=function(t){function e(e){t.call(this,e,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));return e.valid(o)?new e(o):t.near(o)},e.prototype.content=function(){return u.empty},e.prototype.eq=function(t){return t instanceof e&&t.head==this.head},e.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new e(t.resolve(n.pos))},e.prototype.getBookmark=function(){return new md(this.anchor)},e.valid=function(t){var e=t.parent;if(e.isTextblock||!function(t){for(var e=t.depth;e>=0;e--){var n=t.index(e);if(0!=n)for(var r=t.node(e).child(n-1);;r=r.lastChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}(t)||!function(t){for(var e=t.depth;e>=0;e--){var n=t.indexAfter(e),r=t.node(e);if(n!=r.childCount)for(var o=r.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}(t))return!1;var n=e.type.spec.allowGapCursor;if(null!=n)return n;var r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock},e.findFrom=function(t,n,r){t:for(;;){if(!r&&e.valid(t))return t;for(var o=t.pos,i=null,s=t.depth;;s--){var a=t.node(s);if(n>0?t.indexAfter(s)0){i=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}if(0==s)return null;o+=n;var c=t.doc.resolve(o);if(e.valid(c))return c}for(;;){var p=n>0?i.firstChild:i.lastChild;if(!p){if(i.isAtom&&!i.isText&&!ie.isSelectable(i)){t=t.doc.resolve(o+i.nodeSize*n),r=!1;continue t}break}i=p,o+=n;var l=t.doc.resolve(o);if(e.valid(l))return l}return null}},e}(te);fd.prototype.visible=!1,te.jsonID("gapcursor",fd);var md=function(t){this.pos=t};md.prototype.map=function(t){return new md(t.map(this.pos))},md.prototype.resolve=function(t){var e=t.resolve(this.pos);return fd.valid(e)?new fd(e):te.near(e)};var vd=Vo({ArrowLeft:gd("horiz",-1),ArrowRight:gd("horiz",1),ArrowUp:gd("vert",-1),ArrowDown:gd("vert",1)});function gd(t,e){var n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,o){var i=t.selection,s=e>0?i.$to:i.$from,a=i.empty;if(i instanceof re){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=t.doc.resolve(e>0?s.after():s.before())}var c=fd.findFrom(s,e,a);return!!c&&(r&&r(t.tr.setSelection(new fd(c))),!0)}}function yd(t,e,n){if(!t.editable)return!1;var r=t.state.doc.resolve(e);if(!fd.valid(r))return!1;var o=t.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(o>-1&&ie.isSelectable(t.state.doc.nodeAt(o)))&&(t.dispatch(t.state.tr.setSelection(new fd(r))),!0)}function bd(t){if(!(t.selection instanceof fd))return null;var e=document.createElement("div");return e.className="ProseMirror-gapcursor",Zr.create(t.doc,[Gr.widget(t.selection.head,e,{key:"gapcursor"})])}const wd=Oi.create({name:"gapCursor",addProseMirrorPlugins:()=>[new we({props:{decorations:bd,createSelectionBetween:function(t,e,n){if(e.pos==n.pos&&fd.valid(n))return new fd(n)},handleClick:yd,handleKeyDown:vd}})],extendNodeSchema(t){var e;return{allowGapCursor:null!==(e=bi(hi(t,"allowGapCursor",{name:t.name,options:t.options})))&&void 0!==e?e:null}}}),kd=Ps.create({name:"doc",topNode:!0,content:"block+"}),xd=Ps.create({name:"paragraph",priority:1e3,defaultOptions:{HTMLAttributes:{}},group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({setParagraph:()=>({commands:t})=>t.toggleNode("paragraph","paragraph")}),addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Md=Ps.create({name:"text",group:"inline"});var Sd=200,Od=function(){};Od.prototype.append=function(t){return t.length?(t=Od.from(t),!this.length&&t||t.length=e?Od.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Od.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Od.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Od.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Od.from=function(t){return t instanceof Od?t:t&&t.length?new Cd(t):Od.empty};var Cd=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=Sd)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=Sd)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Od);Od.empty=new Cd([]);var Nd=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return to&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Od),_d=Od,Td=function(t,e){this.items=t,this.eventCount=e};Td.prototype.popEvent=function(t,e){var n=this;if(0==this.eventCount)return null;for(var r,o,i=this.items.length;;i--){if(this.items.get(i-1).selection){--i;break}}e&&(r=this.remapping(i,this.items.length),o=r.maps.length);var s,a,c=t.tr,p=[],l=[];return this.items.forEach((function(t,e){if(!t.step)return r||(r=n.remapping(i,e+1),o=r.maps.length),o--,void l.push(t);if(r){l.push(new Vd(t.map));var d,u=t.step.map(r.slice(o));u&&c.maybeStep(u).doc&&(d=c.mapping.maps[c.mapping.maps.length-1],p.push(new Vd(d,null,null,p.length+l.length))),o--,d&&r.appendMap(d,o)}else c.maybeStep(t.step);return t.selection?(s=r?t.selection.map(r.slice(o)):t.selection,a=new Td(n.items.slice(0,i).append(l.reverse().concat(p)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:a,transform:c,selection:s}},Td.prototype.addTransform=function(t,e,n,r){for(var o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null,c=0;cEd&&(h=m,(u=s).forEach((function(t,e){if(t.selection&&0==h--)return f=e,!1})),s=u.slice(f),i-=m),new Td(s.append(o),i)},Td.prototype.remapping=function(t,e){var n=new xt;return this.items.forEach((function(e,r){var o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:null;n.appendMap(e.map,o)}),t,e),n},Td.prototype.addMaps=function(t){return 0==this.eventCount?this:new Td(this.items.append(t.map((function(t){return new Vd(t)}))),this.eventCount)},Td.prototype.rebased=function(t,e){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((function(t){t.selection&&s--}),r);var a=e;this.items.forEach((function(e){var r=o.getMirror(--a);if(null!=r){i=Math.min(i,r);var c=o.maps[r];if(e.step){var p=t.steps[r].invert(t.docs[r]),l=e.selection&&e.selection.map(o.slice(a+1,r));l&&s++,n.push(new Vd(c,p,l))}else n.push(new Vd(c))}}),r);for(var c=[],p=e;p500&&(d=d.compress(this.items.length-n.length)),d},Td.prototype.emptyItemCount=function(){var t=0;return this.items.forEach((function(e){e.step||t++})),t},Td.prototype.compress=function(t){void 0===t&&(t=this.items.length);var e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach((function(i,s){if(s>=t)r.push(i),i.selection&&o++;else if(i.step){var a=i.step.map(e.slice(n)),c=a&&a.getMap();if(n--,c&&e.appendMap(c,n),a){var p=i.selection&&i.selection.map(e.slice(n));p&&o++;var l,d=new Vd(c.invert(),a,p),u=r.length-1;(l=r.length&&r[u].merge(d))?r[u]=l:r.push(d)}}else i.map&&n--}),this.items.length,0),new Td(_d.from(r.reverse()),o)},Td.empty=new Td(_d.empty,0);var Vd=function(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r};Vd.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var e=t.step.merge(this.step);if(e)return new Vd(e.getMap().invert(),e,this.selection)}};var Ad=function(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r},Ed=20;function Dd(t){var e=[];return t.forEach((function(t,n,r,o){return e.push(r,o)})),e}function Rd(t,e){if(!t)return null;for(var n=[],r=0;r=e[o]&&(n=!0)})),n}(n,t.prevRanges)),c=s?Rd(t.prevRanges,n.mapping):Dd(n.mapping.maps[n.steps.length-1]);return new Ad(t.done.addTransform(n,a?e.selection.getBookmark():null,r,Ld(e)),Td.empty,c,n.time)}(n,r,e,t)}},config:t})}const Fd=Oi.create({name:"history",defaultOptions:{depth:100,newGroupDelay:500},addCommands:()=>({undo:()=>({state:t,dispatch:e})=>function(t,e){var n=Pd.getState(t);return!(!n||0==n.done.eventCount||(e&&zd(n,t,e,!1),0))}(t,e),redo:()=>({state:t,dispatch:e})=>function(t,e){var n=Pd.getState(t);return!(!n||0==n.undone.eventCount||(e&&zd(n,t,e,!0),0))}(t,e)}),addProseMirrorPlugins(){return[$d(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Hd=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/gm,qd=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/gm,Jd=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/gm,Wd=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/gm,Ud=js.create({name:"bold",defaultOptions:{HTMLAttributes:{}},parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],renderHTML({HTMLAttributes:t}){return["strong",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({setBold:()=>({commands:t})=>t.setMark("bold"),toggleBold:()=>({commands:t})=>t.toggleMark("bold"),unsetBold:()=>({commands:t})=>t.unsetMark("bold")}),addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Fs(Hd,this.type),Fs(Jd,this.type)]},addPasteRules(){return[Hs(qd,this.type),Hs(Wd,this.type)]}}),Kd=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/gm,Gd=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/gm,Xd=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/gm,Yd=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/gm,Qd=js.create({name:"italic",defaultOptions:{HTMLAttributes:{}},parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:t}){return["em",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({setItalic:()=>({commands:t})=>t.setMark("italic"),toggleItalic:()=>({commands:t})=>t.toggleMark("italic"),unsetItalic:()=>({commands:t})=>t.unsetMark("italic")}),addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Fs(Kd,this.type),Fs(Xd,this.type)]},addPasteRules(){return[Hs(Gd,this.type),Hs(Yd,this.type)]}}),Zd=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/gm,tu=js.create({name:"code",defaultOptions:{HTMLAttributes:{}},excludes:"_",parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:t}){return["code",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({setCode:()=>({commands:t})=>t.setMark("code"),toggleCode:()=>({commands:t})=>t.toggleMark("code"),unsetCode:()=>({commands:t})=>t.unsetMark("code")}),addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Fs(Zd,this.type)]},addPasteRules(){return[Hs(Zd,this.type)]}}),eu=Ps.create({name:"heading",defaultOptions:{levels:[1,2,3,4,5,6],HTMLAttributes:{}},content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((t=>({tag:`h${t}`,attrs:{level:t}})))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,vi(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode("heading",t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode("heading","paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce(((t,e)=>__spreadValues(__spreadValues({},t),{[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})})),{})},addInputRules(){return this.options.levels.map((t=>Ro(new RegExp(`^(#{1,${t}})\\s$`),this.type,{level:t})))}}),nu=Ps.create({name:"hardBreak",defaultOptions:{HTMLAttributes:{}},inline:!0,group:"inline",selectable:!1,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",vi(this.options.HTMLAttributes,t)]},addCommands(){return{setHardBreak:()=>({commands:t})=>t.first([()=>t.exitCode(),()=>t.insertContent({type:this.name})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ru=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/gm,ou=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/gm,iu=js.create({name:"strike",defaultOptions:{HTMLAttributes:{}},parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("line-through")&&{}}],renderHTML({HTMLAttributes:t}){return["s",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({setStrike:()=>({commands:t})=>t.setMark("strike"),toggleStrike:()=>({commands:t})=>t.toggleMark("strike"),unsetStrike:()=>({commands:t})=>t.unsetMark("strike")}),addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Fs(ru,this.type)]},addPasteRules(){return[Hs(ou,this.type)]}}),su=/^\s*>\s$/gm,au=Ps.create({name:"blockquote",defaultOptions:{HTMLAttributes:{}},content:"block*",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:t}){return["blockquote",vi(this.options.HTMLAttributes,t),0]},addCommands:()=>({setBlockquote:()=>({commands:t})=>t.wrapIn("blockquote"),toggleBlockquote:()=>({commands:t})=>t.toggleWrap("blockquote"),unsetBlockquote:()=>({commands:t})=>t.lift("blockquote")}),addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Do(su,this.type)]}}),cu=Ps.create({name:"listItem",defaultOptions:{HTMLAttributes:{}},content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",vi(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem("listItem"),Tab:()=>this.editor.commands.sinkListItem("listItem"),"Shift-Tab":()=>this.editor.commands.liftListItem("listItem")}}}),pu=Oi.create({name:"starterKit",addExtensions(){var t,e,n,r,o,i,s,a,c,p,l,d,u,h,f,m,v,g;const y=[];return!1!==this.options.blockquote&&y.push(au.configure(null===(t=this.options)||void 0===t?void 0:t.blockquote)),!1!==this.options.bold&&y.push(Ud.configure(null===(e=this.options)||void 0===e?void 0:e.bold)),!1!==this.options.bulletList&&y.push(sd.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&y.push(tu.configure(null===(r=this.options)||void 0===r?void 0:r.code)),!1!==this.options.codeBlock&&y.push(Kc.configure(null===(o=this.options)||void 0===o?void 0:o.codeBlock)),!1!==this.options.document&&y.push(kd.configure(null===(i=this.options)||void 0===i?void 0:i.document)),!1!==this.options.dropcursor&&y.push(hd.configure(null===(s=this.options)||void 0===s?void 0:s.dropcursor)),!1!==this.options.gapcursor&&y.push(wd.configure(null===(a=this.options)||void 0===a?void 0:a.gapcursor)),!1!==this.options.hardBreak&&y.push(nu.configure(null===(c=this.options)||void 0===c?void 0:c.hardBreak)),!1!==this.options.heading&&y.push(eu.configure(null===(p=this.options)||void 0===p?void 0:p.heading)),!1!==this.options.history&&y.push(Fd.configure(null===(l=this.options)||void 0===l?void 0:l.history)),!1!==this.options.horizontalRule&&y.push(rd.configure(null===(d=this.options)||void 0===d?void 0:d.horizontalRule)),!1!==this.options.italic&&y.push(Qd.configure(null===(u=this.options)||void 0===u?void 0:u.italic)),!1!==this.options.listItem&&y.push(cu.configure(null===(h=this.options)||void 0===h?void 0:h.listItem)),!1!==this.options.orderedList&&y.push(cd.configure(null===(f=this.options)||void 0===f?void 0:f.orderedList)),!1!==this.options.paragraph&&y.push(xd.configure(null===(m=this.options)||void 0===m?void 0:m.paragraph)),!1!==this.options.strike&&y.push(iu.configure(null===(v=this.options)||void 0===v?void 0:v.strike)),!1!==this.options.text&&y.push(Md.configure(null===(g=this.options)||void 0===g?void 0:g.text)),y}});const lu={components:{EditorContent:Jc,BubbleMenu:Hc},props:{modelValue:{type:String,default:""},maxChars:{type:Number,default:0},bubbleMenu:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},bold:{type:Boolean,default:!0},italic:{type:Boolean,default:!0},strike:{type:Boolean,default:!0},underline:{type:Boolean,default:!0},code:{type:Boolean,default:!0},codeBlock:{type:Boolean,default:!0},blockquote:{type:Boolean,default:!0},bulletList:{type:Boolean,default:!0},orderedList:{type:Boolean,default:!0},taskList:{type:Boolean,default:!0},heading:{type:Boolean,default:!0},textAlign:{type:Boolean,default:!0},horizontalRule:{type:Boolean,default:!0},undoRedo:{type:Boolean,default:!0}},data:()=>({editor:null,headingOpen:!1,alignOpen:!1}),watch:{modelValue(t){this.editor.getHTML()!==t&&this.editor.commands.setContent(this.modelValue,!1)},disabled(t){this.editor&&this.editor.setEditable(!t)}},methods:{insertImageFromURL(t){this.editor.chain().focus().setImage({src:t},!1).run()}},computed:{extensions(){return[pu,Gc,nd,Kc,cd.configure({class:"inline-flex"}),sd.configure({class:"inline-flex"}),ed.configure({limit:this.maxChars}),pd,dd]},hasTextAlign(){return this.editor.isActive({textAlign:"left"})||this.editor.isActive({textAlign:"right"})||this.editor.isActive({textAlign:"center"})||this.editor.isActive({textAlign:"justify"})},charPercentage(){return Math.round(100/this.maxChars*this.editor.getCharacterCount())}},mounted(){this.editor=new qc({content:this.modelValue,extensions:this.extensions,editorProps:{attributes:{class:"h-full overflow-y-auto input"}},editable:!this.disabled}).on("update",(({editor:t})=>{this.$emit("update:modelValue",t.getHTML())}))},beforeUnmount(){this.editor.destroy()}},du=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M7 5h6a3.5 3.5 0 0 1 0 7h-6z"}),t.createVNode("path",{d:"M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7"})],-1),uu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"11",y1:"5",x2:"17",y2:"5"}),t.createVNode("line",{x1:"7",y1:"19",x2:"13",y2:"19"}),t.createVNode("line",{x1:"14",y1:"5",x2:"10",y2:"19"})],-1),hu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M7 5v9a5 5 0 0 0 10 0v-9"}),t.createVNode("path",{d:"M4 12h16"})],-1),fu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M7 5v5a5 5 0 0 0 10 0v-5"}),t.createVNode("path",{d:"M5 19h14"})],-1),mu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("polyline",{points:"7 8 3 12 7 16"}),t.createVNode("polyline",{points:"17 8 21 12 17 16"}),t.createVNode("line",{x1:"14",y1:"4",x2:"10",y2:"20"})],-1),vu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),t.createVNode("path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"}),t.createVNode("path",{d:"M10 13l-1 2l1 2"}),t.createVNode("path",{d:"M14 13l1 2l-1 2"})],-1),gu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M6 15h15"}),t.createVNode("path",{d:"M21 19h-15"}),t.createVNode("path",{d:"M15 11h6"}),t.createVNode("path",{d:"M21 7h-6"}),t.createVNode("path",{d:"M9 9h1a1 1 0 1 1 -1 1v-2.5a2 2 0 0 1 2 -2"}),t.createVNode("path",{d:"M3 9h1a1 1 0 1 1 -1 1v-2.5a2 2 0 0 1 2 -2"})],-1),yu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"9",y1:"6",x2:"20",y2:"6"}),t.createVNode("line",{x1:"9",y1:"12",x2:"20",y2:"12"}),t.createVNode("line",{x1:"9",y1:"18",x2:"20",y2:"18"}),t.createVNode("line",{x1:"5",y1:"6",x2:"5",y2:"6.01"}),t.createVNode("line",{x1:"5",y1:"12",x2:"5",y2:"12.01"}),t.createVNode("line",{x1:"5",y1:"18",x2:"5",y2:"18.01"})],-1),bu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M11 6h9"}),t.createVNode("path",{d:"M11 12h9"}),t.createVNode("path",{d:"M12 18h8"}),t.createVNode("path",{d:"M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4"}),t.createVNode("path",{d:"M6 10v-6l-2 2"})],-1),wu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M3.5 5.5l1.5 1.5l2.5 -2.5"}),t.createVNode("path",{d:"M3.5 11.5l1.5 1.5l2.5 -2.5"}),t.createVNode("path",{d:"M3.5 17.5l1.5 1.5l2.5 -2.5"}),t.createVNode("line",{x1:"11",y1:"6",x2:"20",y2:"6"}),t.createVNode("line",{x1:"11",y1:"12",x2:"20",y2:"12"}),t.createVNode("line",{x1:"11",y1:"18",x2:"20",y2:"18"})],-1),ku={key:10},xu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M7 12h10"}),t.createVNode("path",{d:"M7 4v16"}),t.createVNode("path",{d:"M17 4v16"}),t.createVNode("path",{d:"M15 20h4"}),t.createVNode("path",{d:"M15 4h4"}),t.createVNode("path",{d:"M5 20h4"}),t.createVNode("path",{d:"M5 4h4"})],-1),Mu={key:0,class:"inline-flex"},Su=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M19 18v-8l-2 2"}),t.createVNode("path",{d:"M4 6v12"}),t.createVNode("path",{d:"M12 6v12"}),t.createVNode("path",{d:"M11 18h2"}),t.createVNode("path",{d:"M3 18h2"}),t.createVNode("path",{d:"M4 12h8"}),t.createVNode("path",{d:"M3 6h2"}),t.createVNode("path",{d:"M11 6h2"})],-1),Ou=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M17 12a2 2 0 1 1 4 0c0 .591 -.417 1.318 -.816 1.858l-3.184 4.143l4 -.001"}),t.createVNode("path",{d:"M4 6v12"}),t.createVNode("path",{d:"M12 6v12"}),t.createVNode("path",{d:"M11 18h2"}),t.createVNode("path",{d:"M3 18h2"}),t.createVNode("path",{d:"M4 12h8"}),t.createVNode("path",{d:"M3 6h2"}),t.createVNode("path",{d:"M11 6h2"})],-1),Cu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M19 14a2 2 0 1 0 -2 -2"}),t.createVNode("path",{d:"M17 16a2 2 0 1 0 2 -2"}),t.createVNode("path",{d:"M4 6v12"}),t.createVNode("path",{d:"M12 6v12"}),t.createVNode("path",{d:"M11 18h2"}),t.createVNode("path",{d:"M3 18h2"}),t.createVNode("path",{d:"M4 12h8"}),t.createVNode("path",{d:"M3 6h2"}),t.createVNode("path",{d:"M11 6h2"})],-1),Nu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M20 18v-8l-4 6h5"}),t.createVNode("path",{d:"M4 6v12"}),t.createVNode("path",{d:"M12 6v12"}),t.createVNode("path",{d:"M11 18h2"}),t.createVNode("path",{d:"M3 18h2"}),t.createVNode("path",{d:"M4 12h8"}),t.createVNode("path",{d:"M3 6h2"}),t.createVNode("path",{d:"M11 6h2"})],-1),_u=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M17 18h2a2 2 0 1 0 0 -4h-2v-4h4"}),t.createVNode("path",{d:"M4 6v12"}),t.createVNode("path",{d:"M12 6v12"}),t.createVNode("path",{d:"M11 18h2"}),t.createVNode("path",{d:"M3 18h2"}),t.createVNode("path",{d:"M4 12h8"}),t.createVNode("path",{d:"M3 6h2"}),t.createVNode("path",{d:"M11 6h2"})],-1),Tu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("circle",{transform:"rotate(180 19 16)",cx:"19",cy:"16",r:"2"}),t.createVNode("path",{d:"M21 12a2 2 0 1 0 -4 0v4"}),t.createVNode("path",{d:"M4 6v12"}),t.createVNode("path",{d:"M12 6v12"}),t.createVNode("path",{d:"M11 18h2"}),t.createVNode("path",{d:"M3 18h2"}),t.createVNode("path",{d:"M4 12h8"}),t.createVNode("path",{d:"M3 6h2"}),t.createVNode("path",{d:"M11 6h2"})],-1),Vu={key:11},Au=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),t.createVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),t.createVNode("line",{x1:"6",y1:"18",x2:"18",y2:"18"})],-1),Eu={key:0,class:"inline-flex"},Du=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),t.createVNode("line",{x1:"4",y1:"12",x2:"14",y2:"12"}),t.createVNode("line",{x1:"4",y1:"18",x2:"18",y2:"18"})],-1),Ru=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),t.createVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"}),t.createVNode("line",{x1:"6",y1:"18",x2:"18",y2:"18"})],-1),zu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),t.createVNode("line",{x1:"10",y1:"12",x2:"20",y2:"12"}),t.createVNode("line",{x1:"6",y1:"18",x2:"20",y2:"18"})],-1),Iu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),t.createVNode("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),t.createVNode("line",{x1:"4",y1:"18",x2:"16",y2:"18"})],-1),Bu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"4",y1:"7",x2:"20",y2:"7"}),t.createVNode("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),t.createVNode("line",{x1:"14",y1:"11",x2:"14",y2:"17"}),t.createVNode("path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"}),t.createVNode("path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"})],-1),Lu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),t.createVNode("line",{x1:"4",y1:"4",x2:"4",y2:"4.01"}),t.createVNode("line",{x1:"8",y1:"4",x2:"8",y2:"4.01"}),t.createVNode("line",{x1:"12",y1:"4",x2:"12",y2:"4.01"}),t.createVNode("line",{x1:"16",y1:"4",x2:"16",y2:"4.01"}),t.createVNode("line",{x1:"20",y1:"4",x2:"20",y2:"4.01"}),t.createVNode("line",{x1:"4",y1:"8",x2:"4",y2:"8.01"}),t.createVNode("line",{x1:"12",y1:"8",x2:"12",y2:"8.01"}),t.createVNode("line",{x1:"20",y1:"8",x2:"20",y2:"8.01"}),t.createVNode("line",{x1:"4",y1:"16",x2:"4",y2:"16.01"}),t.createVNode("line",{x1:"12",y1:"16",x2:"12",y2:"16.01"}),t.createVNode("line",{x1:"20",y1:"16",x2:"20",y2:"16.01"}),t.createVNode("line",{x1:"4",y1:"20",x2:"4",y2:"20.01"}),t.createVNode("line",{x1:"8",y1:"20",x2:"8",y2:"20.01"}),t.createVNode("line",{x1:"12",y1:"20",x2:"12",y2:"20.01"}),t.createVNode("line",{x1:"16",y1:"20",x2:"16",y2:"20.01"}),t.createVNode("line",{x1:"20",y1:"20",x2:"20",y2:"20.01"})],-1),Pu=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M9 13l-4 -4l4 -4m-4 4h11a4 4 0 0 1 0 8h-1"})],-1),ju=t.createVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[t.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),t.createVNode("path",{d:"M15 13l4 -4l-4 -4m4 4h-11a4 4 0 0 0 0 8h1"})],-1);lu.render=function(e,n,r,o,i,s){const a=t.resolveComponent("collapse-x-transition"),c=t.resolveComponent("editor-content"),p=t.resolveDirective("tooltip");return t.openBlock(),t.createBlock("div",null,[t.createVNode("div",null,[i.editor?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.bubbleMenu?"bubble-menu":"div"),{key:0,editor:i.editor,class:["flex-wrap space-x-1",r.bubbleMenu?"bg-gray-600 rounded dark p-1":"mb-2"]},{default:t.withCtx((()=>[r.bold?t.withDirectives((t.openBlock(),t.createBlock("button",{key:0,"aria-label":e.__("tiptap::tiptap.bold"),onClick:n[1]||(n[1]=t=>i.editor.chain().focus().toggleBold().run()),class:["button",{accent:i.editor.isActive("bold")}]},[du],10,["aria-label"])),[[p,e.__("tiptap::tiptap.bold")]]):t.createCommentVNode("",!0),r.italic?t.withDirectives((t.openBlock(),t.createBlock("button",{key:1,"aria-label":e.__("tiptap::tiptap.italic"),onClick:n[2]||(n[2]=t=>i.editor.chain().focus().toggleItalic().run()),class:["button",{accent:i.editor.isActive("italic")}]},[uu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.italic")]]):t.createCommentVNode("",!0),r.strike?t.withDirectives((t.openBlock(),t.createBlock("button",{key:2,"aria-label":e.__("tiptap::tiptap.strike"),onClick:n[3]||(n[3]=t=>i.editor.chain().focus().toggleStrike().run()),class:["button",{accent:i.editor.isActive("strike")}]},[hu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.strike")]]):t.createCommentVNode("",!0),r.underline?t.withDirectives((t.openBlock(),t.createBlock("button",{key:3,"aria-label":e.__("tiptap::tiptap.underline"),onClick:n[4]||(n[4]=t=>i.editor.chain().focus().toggleUnderline().run()),class:["button",{accent:i.editor.isActive("underline")}]},[fu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.underline")]]):t.createCommentVNode("",!0),r.code?t.withDirectives((t.openBlock(),t.createBlock("button",{key:4,"aria-label":e.__("tiptap::tiptap.code"),onClick:n[5]||(n[5]=t=>i.editor.chain().focus().toggleCode().run()),class:["button",{accent:i.editor.isActive("code")}]},[mu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.code")]]):t.createCommentVNode("",!0),r.codeBlock?t.withDirectives((t.openBlock(),t.createBlock("button",{key:5,"aria-label":e.__("tiptap::tiptap.code_block"),onClick:n[6]||(n[6]=t=>i.editor.chain().focus().toggleCodeBlock().run()),class:["button",{accent:i.editor.isActive("codeBlock")}]},[vu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.code_block")]]):t.createCommentVNode("",!0),r.blockquote?t.withDirectives((t.openBlock(),t.createBlock("button",{key:6,"aria-label":e.__("tiptap::tiptap.blockquote"),onClick:n[7]||(n[7]=t=>i.editor.chain().focus().toggleBlockquote().run()),class:["button",{accent:i.editor.isActive("blockquote")}]},[gu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.blockquote")]]):t.createCommentVNode("",!0),r.bulletList?t.withDirectives((t.openBlock(),t.createBlock("button",{key:7,"aria-label":e.__("tiptap::tiptap.bullet_list"),onClick:n[8]||(n[8]=t=>i.editor.chain().focus().toggleBulletList().run()),class:["button",{accent:i.editor.isActive("bulletList")}]},[yu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.bullet_list")]]):t.createCommentVNode("",!0),r.orderedList?t.withDirectives((t.openBlock(),t.createBlock("button",{key:8,"aria-label":e.__("tiptap::tiptap.ordered_list"),onClick:n[9]||(n[9]=t=>i.editor.chain().focus().toggleOrderedList().run()),class:["button",{accent:i.editor.isActive("orderedList")}]},[bu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.ordered_list")]]):t.createCommentVNode("",!0),r.taskList?t.withDirectives((t.openBlock(),t.createBlock("button",{key:9,"aria-label":e.__("tiptap::tiptap.task_list"),onClick:n[10]||(n[10]=t=>i.editor.chain().focus().toggleTaskList().run()),class:["button",{accent:i.editor.isActive("taskList")}]},[wu],10,["aria-label"])),[[p,e.__("tiptap::tiptap.task_list")]]):t.createCommentVNode("",!0),r.heading?(t.openBlock(),t.createBlock("span",ku,[t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive("heading")}],onClick:n[11]||(n[11]=t=>{i.headingOpen=!i.headingOpen,i.alignOpen=!1}),"aria-label":e.__("tiptap::tiptap.heading")},[xu],10,["aria-label"]),[[p,e.__("tiptap::tiptap.heading")]]),t.createVNode(a,null,{default:t.withCtx((()=>[i.headingOpen?(t.openBlock(),t.createBlock("div",Mu,[t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive("heading",{level:1})}],"aria-label":`${e.__("tiptap::tiptap.header")} 1`,onClick:n[12]||(n[12]=t=>i.editor.chain().focus().toggleHeading({level:1}).run())},[Su],10,["aria-label"]),[[p,`${e.__("tiptap::tiptap.heading")} 1`]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive("heading",{level:2})}],"aria-label":`${e.__("tiptap::tiptap.header")} 2`,onClick:n[13]||(n[13]=t=>i.editor.chain().focus().toggleHeading({level:2}).run())},[Ou],10,["aria-label"]),[[p,`${e.__("tiptap::tiptap.heading")} 2`]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive("heading",{level:3})}],"aria-label":`${e.__("tiptap::tiptap.header")} 3`,onClick:n[14]||(n[14]=t=>i.editor.chain().focus().toggleHeading({level:3}).run())},[Cu],10,["aria-label"]),[[p,`${e.__("tiptap::tiptap.heading")} 3`]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive("heading",{level:4})}],"aria-label":`${e.__("tiptap::tiptap.header")} 4`,onClick:n[15]||(n[15]=t=>i.editor.chain().focus().toggleHeading({level:4}).run())},[Nu],10,["aria-label"]),[[p,`${e.__("tiptap::tiptap.heading")} 4`]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive("heading",{level:5})}],"aria-label":`${e.__("tiptap::tiptap.header")} 5`,onClick:n[16]||(n[16]=t=>i.editor.chain().focus().toggleHeading({level:5}).run())},[_u],10,["aria-label"]),[[p,`${e.__("tiptap::tiptap.heading")} 5`]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive("heading",{level:6})}],"aria-label":`${e.__("tiptap::tiptap.header")} 6`,onClick:n[17]||(n[17]=t=>i.editor.chain().focus().toggleHeading({level:6}).run())},[Tu],10,["aria-label"]),[[p,`${e.__("tiptap::tiptap.heading")} 6`]])])):t.createCommentVNode("",!0)])),_:1})])):t.createCommentVNode("",!0),r.textAlign?(t.openBlock(),t.createBlock("span",Vu,[t.withDirectives(t.createVNode("button",{class:["button",{accent:s.hasTextAlign}],onClick:n[18]||(n[18]=t=>{i.alignOpen=!i.alignOpen,i.headingOpen=!1}),"aria-label":e.__("tiptap::tiptap.text_align")},[Au],10,["aria-label"]),[[p,e.__("tiptap::tiptap.text_align")]]),t.createVNode(a,null,{default:t.withCtx((()=>[i.alignOpen?(t.openBlock(),t.createBlock("div",Eu,[t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive({textAlign:"left"})}],"aria-label":e.__("tiptap::tiptap.left"),onClick:n[19]||(n[19]=t=>i.editor.chain().focus().setTextAlign("left").run())},[Du],10,["aria-label"]),[[p,e.__("tiptap::tiptap.left")]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive({textAlign:"center"})}],"aria-label":e.__("tiptap::tiptap.center"),onClick:n[20]||(n[20]=t=>i.editor.chain().focus().setTextAlign("center").run())},[Ru],10,["aria-label"]),[[p,e.__("tiptap::tiptap.center")]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive({textAlign:"right"})}],"aria-label":e.__("tiptap::tiptap.right"),onClick:n[21]||(n[21]=t=>i.editor.chain().focus().setTextAlign("right").run())},[zu],10,["aria-label"]),[[p,e.__("tiptap::tiptap.right")]]),t.withDirectives(t.createVNode("button",{class:["button",{accent:i.editor.isActive({textAlign:"justify"})}],"aria-label":e.__("tiptap::tiptap.justify"),onClick:n[22]||(n[22]=t=>i.editor.chain().focus().setTextAlign("justify").run())},[Iu],10,["aria-label"]),[[p,e.__("tiptap::tiptap.justify")]]),t.withDirectives(t.createVNode("button",{class:"button","aria-label":e.__("tiptap::tiptap.clear"),onClick:n[23]||(n[23]=t=>i.editor.chain().focus().unsetTextAlign().run())},[Bu],8,["aria-label"]),[[p,e.__("tiptap::tiptap.clear")]])])):t.createCommentVNode("",!0)])),_:1})])):t.createCommentVNode("",!0),r.horizontalRule?t.withDirectives((t.openBlock(),t.createBlock("button",{key:12,"aria-label":e.__("tiptap::tiptap.horizontal_rule"),onClick:n[24]||(n[24]=t=>i.editor.chain().focus().setHorizontalRule().run()),class:"button"},[Lu],8,["aria-label"])),[[p,e.__("tiptap::tiptap.horizontal_rule")]]):t.createCommentVNode("",!0),r.undoRedo?t.withDirectives((t.openBlock(),t.createBlock("button",{key:13,"aria-label":e.__("tiptap::tiptap.undo"),onClick:n[25]||(n[25]=t=>i.editor.chain().focus().undo().run()),class:"button"},[Pu],8,["aria-label"])),[[p,e.__("tiptap::tiptap.undo")]]):t.createCommentVNode("",!0),r.undoRedo?t.withDirectives((t.openBlock(),t.createBlock("button",{key:14,"aria-label":e.__("tiptap::tiptap.redo"),onClick:n[26]||(n[26]=t=>i.editor.chain().focus().redo().run()),class:"button"},[ju],8,["aria-label"])),[[p,e.__("tiptap::tiptap.redo")]]):t.createCommentVNode("",!0)])),_:1},8,["editor","class"])):t.createCommentVNode("",!0)]),t.createVNode(c,{editor:i.editor,class:"min-h-64 h-64",onClick:n[27]||(n[27]=t=>{i.headingOpen=!1,i.alignOpen=!1})},null,8,["editor"]),i.editor&&r.maxChars>0?(t.openBlock(),t.createBlock("div",{key:0,class:["w-full",s.charPercentage>90?"text-red-500":s.charPercentage>75?"text-yellow-500":null]},t.toDisplayString(e.__("tiptap::tiptap.character_count",{chars:i.editor.getCharacterCount(),max:r.maxChars})),3)):t.createCommentVNode("",!0)])};const $u={components:{Tiptap:lu},data:()=>({bubbleMenu:!1,maxChars:280,content:"

This is tiptap 2 in Voyager II using Vue 3 🎉

",disabled:!1,bold:!0,italic:!0,strike:!0,underline:!0,code:!0,codeBlock:!0,blockquote:!0,bulletList:!0,orderedList:!0,taskList:!0,heading:!0,textAlign:!0,horizontalRule:!0,undoRedo:!0})},Fu={class:"flex space-x-2"},Hu={class:"input-group"},qu=t.createVNode("label",{for:"bubble",class:"label"},"Bubble menu",-1),Ju={class:"mt-1"},Wu={class:"input-group"},Uu=t.createVNode("label",{for:"maxChars",class:"label"},"Max characters (0 = infinite)",-1),Ku={class:"mt-1"},Gu={class:"input-group"},Xu=t.createVNode("label",{for:"disabled",class:"label"},"Disabled",-1),Yu={class:"mt-1"},Qu={class:"flex flex-wrap space-x-2 mt-4"},Zu={class:"input-group"},th={for:"bold",class:"label"},eh={class:"mt-1"},nh={class:"input-group"},rh={for:"italic",class:"label"},oh={class:"mt-1"},ih={class:"input-group"},sh={for:"strike",class:"label"},ah={class:"mt-1"},ch={class:"input-group"},ph={for:"underline",class:"label"},lh={class:"mt-1"},dh={class:"input-group"},uh={for:"code",class:"label"},hh={class:"mt-1"},fh={class:"input-group"},mh={for:"codeBlock",class:"label"},vh={class:"mt-1"},gh={class:"input-group"},yh={for:"blockquote",class:"label"},bh={class:"mt-1"},wh={class:"input-group"},kh={for:"bulletList",class:"label"},xh={class:"mt-1"},Mh={class:"input-group"},Sh={for:"orderedList",class:"label"},Oh={class:"mt-1"},Ch={class:"input-group"},Nh={for:"taskList",class:"label"},_h={class:"mt-1"},Th={class:"input-group"},Vh={for:"heading",class:"label"},Ah={class:"mt-1"},Eh={class:"input-group"},Dh={for:"textAlign",class:"label"},Rh={class:"mt-1"},zh={class:"input-group"},Ih={for:"horizontalRule",class:"label"},Bh={class:"mt-1"},Lh={class:"input-group"},Ph={for:"undoRedo",class:"label"},jh={class:"mt-1"};$u.render=function(e,n,r,o,i,s){const a=t.resolveComponent("tiptap"),c=t.resolveComponent("collapsible");return t.openBlock(),t.createBlock(t.Fragment,null,[t.createVNode(a,{bubbleMenu:i.bubbleMenu,maxChars:i.maxChars,modelValue:i.content,"onUpdate:modelValue":n[1]||(n[1]=t=>i.content=t),disabled:i.disabled,bold:i.bold,italic:i.italic,strike:i.strike,underline:i.underline,code:i.code,codeBlock:i.codeBlock,blockquote:i.blockquote,bulletList:i.bulletList,orderedList:i.orderedList,taskList:i.taskList,heading:i.heading,textAlign:i.textAlign,horizontalRule:i.horizontalRule,undoRedo:i.undoRedo},null,8,["bubbleMenu","maxChars","modelValue","disabled","bold","italic","strike","underline","code","codeBlock","blockquote","bulletList","orderedList","taskList","heading","textAlign","horizontalRule","undoRedo"]),t.createVNode(c,{title:"Options"},{default:t.withCtx((()=>[t.createVNode("div",Fu,[t.createVNode("div",Hu,[qu,t.createVNode("div",Ju,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[2]||(n[2]=t=>i.bubbleMenu=t),id:"bubble"},null,512),[[t.vModelCheckbox,i.bubbleMenu]])])]),t.createVNode("div",Wu,[Uu,t.createVNode("div",Ku,[t.withDirectives(t.createVNode("input",{type:"number",class:"input","onUpdate:modelValue":n[3]||(n[3]=t=>i.maxChars=t),min:"0",id:"maxChars"},null,512),[[t.vModelText,i.maxChars,void 0,{number:!0}]])])]),t.createVNode("div",Gu,[Xu,t.createVNode("div",Yu,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[4]||(n[4]=t=>i.disabled=t),id:"disabled"},null,512),[[t.vModelCheckbox,i.disabled]])])])]),t.createVNode("div",Qu,[t.createVNode("div",Zu,[t.createVNode("label",th,t.toDisplayString(e.__("tiptap::tiptap.bold")),1),t.createVNode("div",eh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[5]||(n[5]=t=>i.bold=t),id:"bold"},null,512),[[t.vModelCheckbox,i.bold]])])]),t.createVNode("div",nh,[t.createVNode("label",rh,t.toDisplayString(e.__("tiptap::tiptap.italic")),1),t.createVNode("div",oh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[6]||(n[6]=t=>i.italic=t),id:"italic"},null,512),[[t.vModelCheckbox,i.italic]])])]),t.createVNode("div",ih,[t.createVNode("label",sh,t.toDisplayString(e.__("tiptap::tiptap.strike")),1),t.createVNode("div",ah,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[7]||(n[7]=t=>i.strike=t),id:"strike"},null,512),[[t.vModelCheckbox,i.strike]])])]),t.createVNode("div",ch,[t.createVNode("label",ph,t.toDisplayString(e.__("tiptap::tiptap.underline")),1),t.createVNode("div",lh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[8]||(n[8]=t=>i.underline=t),id:"underline"},null,512),[[t.vModelCheckbox,i.underline]])])]),t.createVNode("div",dh,[t.createVNode("label",uh,t.toDisplayString(e.__("tiptap::tiptap.code")),1),t.createVNode("div",hh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[9]||(n[9]=t=>i.code=t),id:"code"},null,512),[[t.vModelCheckbox,i.code]])])]),t.createVNode("div",fh,[t.createVNode("label",mh,t.toDisplayString(e.__("tiptap::tiptap.code_block")),1),t.createVNode("div",vh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[10]||(n[10]=t=>i.codeBlock=t),id:"codeBlock"},null,512),[[t.vModelCheckbox,i.codeBlock]])])]),t.createVNode("div",gh,[t.createVNode("label",yh,t.toDisplayString(e.__("tiptap::tiptap.blockquote")),1),t.createVNode("div",bh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[11]||(n[11]=t=>i.blockquote=t),id:"blockquote"},null,512),[[t.vModelCheckbox,i.blockquote]])])]),t.createVNode("div",wh,[t.createVNode("label",kh,t.toDisplayString(e.__("tiptap::tiptap.bullet_list")),1),t.createVNode("div",xh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[12]||(n[12]=t=>i.bulletList=t),id:"bulletList"},null,512),[[t.vModelCheckbox,i.bulletList]])])]),t.createVNode("div",Mh,[t.createVNode("label",Sh,t.toDisplayString(e.__("tiptap::tiptap.ordered_list")),1),t.createVNode("div",Oh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[13]||(n[13]=t=>i.orderedList=t),id:"orderedList"},null,512),[[t.vModelCheckbox,i.orderedList]])])]),t.createVNode("div",Ch,[t.createVNode("label",Nh,t.toDisplayString(e.__("tiptap::tiptap.task_list")),1),t.createVNode("div",_h,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[14]||(n[14]=t=>i.taskList=t),id:"taskList"},null,512),[[t.vModelCheckbox,i.taskList]])])]),t.createVNode("div",Th,[t.createVNode("label",Vh,t.toDisplayString(e.__("tiptap::tiptap.heading")),1),t.createVNode("div",Ah,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[15]||(n[15]=t=>i.heading=t),id:"heading"},null,512),[[t.vModelCheckbox,i.heading]])])]),t.createVNode("div",Eh,[t.createVNode("label",Dh,t.toDisplayString(e.__("tiptap::tiptap.text_align")),1),t.createVNode("div",Rh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[16]||(n[16]=t=>i.textAlign=t),id:"textAlign"},null,512),[[t.vModelCheckbox,i.textAlign]])])]),t.createVNode("div",zh,[t.createVNode("label",Ih,t.toDisplayString(e.__("tiptap::tiptap.horizontal_rule")),1),t.createVNode("div",Bh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[17]||(n[17]=t=>i.horizontalRule=t),id:"horizontalRule"},null,512),[[t.vModelCheckbox,i.horizontalRule]])])]),t.createVNode("div",Lh,[t.createVNode("label",Ph,t.toDisplayString(e.__("tiptap::tiptap.undo"))+"/"+t.toDisplayString(e.__("tiptap::tiptap.redo")),1),t.createVNode("div",jh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[18]||(n[18]=t=>i.undoRedo=t),id:"undoRedo"},null,512),[[t.vModelCheckbox,i.undoRedo]])])])])])),_:1}),t.createVNode(c,{title:"HTML Output"},{default:t.withCtx((()=>[t.withDirectives(t.createVNode("textarea",{class:"input w-full min-h-64","onUpdate:modelValue":n[19]||(n[19]=t=>i.content=t)},null,512),[[t.vModelText,i.content]])])),_:1})],64)};const $h={mixins:[voyager.formfieldMixin]},Fh={key:1},Hh={key:2};$h.render=function(e,n,r,o,i,s){const a=t.resolveComponent("tiptap");return"query"==e.action?t.renderSlot(e.$slots,"default",{key:0}):"add"==e.action||"edit"==e.action?(t.openBlock(),t.createBlock("div",Fh,[t.createVNode(a,{bubbleMenu:e.options.bubbleMenu,maxChars:e.options.maxChars,modelValue:e.modelValue,"onUpdate:modelValue":n[1]||(n[1]=t=>e.$emit("update:modelValue",t)),bold:e.options.bold,italic:e.options.italic,strike:e.options.strike,underline:e.options.underline,code:e.options.code,codeBlock:e.options.codeBlock,blockquote:e.options.blockquote,bulletList:e.options.bulletList,orderedList:e.options.orderedList,taskList:e.options.taskList,heading:e.options.heading,textAlign:e.options.textAlign,horizontalRule:e.options.horizontalRule,undoRedo:e.options.undoRedo},null,8,["bubbleMenu","maxChars","modelValue","bold","italic","strike","underline","code","codeBlock","blockquote","bulletList","orderedList","taskList","heading","textAlign","horizontalRule","undoRedo"])])):"browse"==e.action?(t.openBlock(),t.createBlock("div",Hh,t.toDisplayString(e.modelValue),1)):t.createCommentVNode("",!0)};const qh={mixins:[voyager.formfieldBuilderMixin],computed:{defaultListOptions:()=>({display_length:150}),defaultViewOptions:()=>({bubbleMenu:!1,maxChars:0,bold:!0,italic:!0,strike:!0,underline:!0,code:!0,codeBlock:!0,blockquote:!0,bulletList:!0,orderedList:!0,taskList:!0,heading:!0,textAlign:!0,horizontalRule:!0,undoRedo:!0})}},Jh={key:0},Wh={for:"length",class:"label"},Uh={key:1},Kh={class:"mt-2"},Gh={for:"maxChars",class:"label"},Xh={class:"grid grid-cols-3 lg:grid-cols-2 xl:grid-cols-3 gap-2 mt-2"},Yh={class:"flex items-center space-x-1"},Qh={for:"bubble",class:"label"},Zh={class:"flex items-center space-x-1"},tf={for:"bold",class:"label"},ef={class:"flex items-center space-x-1"},nf={for:"italic",class:"label"},rf={class:"flex items-center space-x-1"},of={for:"strike",class:"label"},sf={class:"flex items-center space-x-1"},af={for:"underline",class:"label"},cf={class:"flex items-center space-x-1"},pf={for:"code",class:"label"},lf={class:"flex items-center space-x-1"},df={for:"codeBlock",class:"label"},uf={class:"flex items-center space-x-1"},hf={for:"blockquote",class:"label"},ff={class:"flex items-center space-x-1"},mf={for:"bulletList",class:"label"},vf={class:"flex items-center space-x-1"},gf={for:"orderedList",class:"label"},yf={class:"flex items-center space-x-1"},bf={for:"taskList",class:"label"},wf={class:"flex items-center space-x-1"},kf={for:"heading",class:"label"},xf={class:"flex items-center space-x-1"},Mf={for:"textAlign",class:"label"},Sf={class:"flex items-center space-x-1"},Of={for:"horizontalRule",class:"label"},Cf={class:"flex items-center space-x-1"},Nf={for:"undoRedo",class:"label"},_f={key:2};qh.render=function(e,n,r,o,i,s){const a=t.resolveComponent("tiptap");return"list-options"==e.action?(t.openBlock(),t.createBlock("div",Jh,[t.createVNode("label",Wh,t.toDisplayString(e.__("voyager::generic.display_length")),1),t.withDirectives(t.createVNode("input",{type:"number",id:"length",class:"input w-full","onUpdate:modelValue":n[1]||(n[1]=t=>e.options.display_length=t)},null,512),[[t.vModelText,e.options.display_length,void 0,{number:!0}]])])):"view-options"==e.action?(t.openBlock(),t.createBlock("div",Uh,[t.createVNode("div",Kh,[t.createVNode("label",Gh,t.toDisplayString(e.__("tiptap::tiptap.max_characters")),1),t.withDirectives(t.createVNode("input",{type:"number",class:"input w-full","onUpdate:modelValue":n[2]||(n[2]=t=>e.options.maxChars=t),min:"0",id:"maxChars"},null,512),[[t.vModelText,e.options.maxChars,void 0,{number:!0}]])]),t.createVNode("div",Xh,[t.createVNode("div",Yh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[3]||(n[3]=t=>e.options.bubbleMenu=t),id:"bubble"},null,512),[[t.vModelCheckbox,e.options.bubbleMenu]]),t.createVNode("label",Qh,t.toDisplayString(e.__("tiptap::tiptap.bubble_menu")),1)]),t.createVNode("div",Zh,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[4]||(n[4]=t=>e.options.bold=t),id:"bold"},null,512),[[t.vModelCheckbox,e.options.bold]]),t.createVNode("label",tf,t.toDisplayString(e.__("tiptap::tiptap.bold")),1)]),t.createVNode("div",ef,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[5]||(n[5]=t=>e.options.italic=t),id:"italic"},null,512),[[t.vModelCheckbox,e.options.italic]]),t.createVNode("label",nf,t.toDisplayString(e.__("tiptap::tiptap.italic")),1)]),t.createVNode("div",rf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[6]||(n[6]=t=>e.options.strike=t),id:"strike"},null,512),[[t.vModelCheckbox,e.options.strike]]),t.createVNode("label",of,t.toDisplayString(e.__("tiptap::tiptap.strike")),1)]),t.createVNode("div",sf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[7]||(n[7]=t=>e.options.underline=t),id:"underline"},null,512),[[t.vModelCheckbox,e.options.underline]]),t.createVNode("label",af,t.toDisplayString(e.__("tiptap::tiptap.underline")),1)]),t.createVNode("div",cf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[8]||(n[8]=t=>e.options.code=t),id:"code"},null,512),[[t.vModelCheckbox,e.options.code]]),t.createVNode("label",pf,t.toDisplayString(e.__("tiptap::tiptap.code")),1)]),t.createVNode("div",lf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[9]||(n[9]=t=>e.options.codeBlock=t),id:"codeBlock"},null,512),[[t.vModelCheckbox,e.options.codeBlock]]),t.createVNode("label",df,t.toDisplayString(e.__("tiptap::tiptap.code_block")),1)]),t.createVNode("div",uf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[10]||(n[10]=t=>e.options.blockquote=t),id:"blockquote"},null,512),[[t.vModelCheckbox,e.options.blockquote]]),t.createVNode("label",hf,t.toDisplayString(e.__("tiptap::tiptap.blockquote")),1)]),t.createVNode("div",ff,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[11]||(n[11]=t=>e.options.bulletList=t),id:"bulletList"},null,512),[[t.vModelCheckbox,e.options.bulletList]]),t.createVNode("label",mf,t.toDisplayString(e.__("tiptap::tiptap.bullet_list")),1)]),t.createVNode("div",vf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[12]||(n[12]=t=>e.options.orderedList=t),id:"orderedList"},null,512),[[t.vModelCheckbox,e.options.orderedList]]),t.createVNode("label",gf,t.toDisplayString(e.__("tiptap::tiptap.ordered_list")),1)]),t.createVNode("div",yf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[13]||(n[13]=t=>e.options.taskList=t),id:"taskList"},null,512),[[t.vModelCheckbox,e.options.taskList]]),t.createVNode("label",bf,t.toDisplayString(e.__("tiptap::tiptap.task_list")),1)]),t.createVNode("div",wf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[14]||(n[14]=t=>e.options.heading=t),id:"heading"},null,512),[[t.vModelCheckbox,e.options.heading]]),t.createVNode("label",kf,t.toDisplayString(e.__("tiptap::tiptap.heading")),1)]),t.createVNode("div",xf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[15]||(n[15]=t=>e.options.textAlign=t),id:"textAlign"},null,512),[[t.vModelCheckbox,e.options.textAlign]]),t.createVNode("label",Mf,t.toDisplayString(e.__("tiptap::tiptap.text_align")),1)]),t.createVNode("div",Sf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[16]||(n[16]=t=>e.options.horizontalRule=t),id:"horizontalRule"},null,512),[[t.vModelCheckbox,e.options.horizontalRule]]),t.createVNode("label",Of,t.toDisplayString(e.__("tiptap::tiptap.horizontal_rule")),1)]),t.createVNode("div",Cf,[t.withDirectives(t.createVNode("input",{type:"checkbox",class:"input","onUpdate:modelValue":n[17]||(n[17]=t=>e.options.undoRedo=t),id:"undoRedo"},null,512),[[t.vModelCheckbox,e.options.undoRedo]]),t.createVNode("label",Nf,t.toDisplayString(e.__("tiptap::tiptap.undo"))+"/"+t.toDisplayString(e.__("tiptap::tiptap.redo")),1)])])])):"view"==e.action?(t.openBlock(),t.createBlock("div",_f,[t.createVNode(a,{bubbleMenu:e.options.bubbleMenu,maxChars:e.options.maxChars,value:"''",bold:e.options.bold,italic:e.options.italic,strike:e.options.strike,underline:e.options.underline,code:e.options.code,codeBlock:e.options.codeBlock,blockquote:e.options.blockquote,bulletList:e.options.bulletList,orderedList:e.options.orderedList,taskList:e.options.taskList,heading:e.options.heading,textAlign:e.options.textAlign,horizontalRule:e.options.horizontalRule,undoRedo:e.options.undoRedo},null,8,["bubbleMenu","maxChars","bold","italic","strike","underline","code","codeBlock","blockquote","bulletList","orderedList","taskList","heading","textAlign","horizontalRule","undoRedo"])])):t.createCommentVNode("",!0)},voyager.component("tiptap",lu),voyager.component("tiptap-demo",$u),voyager.component("tiptap-formfield",$h),voyager.component("tiptap-builder",qh),voyager.addToUI("Tiptap","tiptap-demo")})); diff --git a/package-lock.json b/package-lock.json index c9b8ab7..1103037 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,34 +9,34 @@ "version": "0.0.0", "dependencies": { "@tabler/icons": "^1.41.2", - "@tiptap/core": "^2.0.0-beta.85", - "@tiptap/extension-blockquote": "^2.0.0-beta.14", - "@tiptap/extension-bullet-list": "^2.0.0-beta.14", - "@tiptap/extension-character-count": "^2.0.0-beta.12", - "@tiptap/extension-code-block": "^2.0.0-beta.16", - "@tiptap/extension-document": "^2.0.0-beta.12", - "@tiptap/extension-heading": "^2.0.0-beta.14", - "@tiptap/extension-history": "^2.0.0-beta.13", - "@tiptap/extension-horizontal-rule": "^2.0.0-beta.17", - "@tiptap/extension-image": "^2.0.0-beta.14", - "@tiptap/extension-list-item": "^2.0.0-beta.13", - "@tiptap/extension-ordered-list": "^2.0.0-beta.14", - "@tiptap/extension-paragraph": "^2.0.0-beta.15", - "@tiptap/extension-task-item": "^2.0.0-beta.16", - "@tiptap/extension-task-list": "^2.0.0-beta.16", - "@tiptap/extension-text": "^2.0.0-beta.12", - "@tiptap/extension-text-align": "^2.0.0-beta.20", - "@tiptap/extension-typography": "^2.0.0-beta.12", - "@tiptap/extension-underline": "^2.0.0-beta.15", - "@tiptap/starter-kit": "^2.0.0-beta.81", - "@tiptap/vue-3": "^2.0.0-beta.45", + "@tiptap/core": "^2.0.0-beta.89", + "@tiptap/extension-blockquote": "^2.0.0-beta.15", + "@tiptap/extension-bullet-list": "^2.0.0-beta.15", + "@tiptap/extension-character-count": "^2.0.0-beta.13", + "@tiptap/extension-code-block": "^2.0.0-beta.17", + "@tiptap/extension-document": "^2.0.0-beta.13", + "@tiptap/extension-heading": "^2.0.0-beta.15", + "@tiptap/extension-history": "^2.0.0-beta.15", + "@tiptap/extension-horizontal-rule": "^2.0.0-beta.18", + "@tiptap/extension-image": "^2.0.0-beta.15", + "@tiptap/extension-list-item": "^2.0.0-beta.14", + "@tiptap/extension-ordered-list": "^2.0.0-beta.15", + "@tiptap/extension-paragraph": "^2.0.0-beta.16", + "@tiptap/extension-task-item": "^2.0.0-beta.17", + "@tiptap/extension-task-list": "^2.0.0-beta.17", + "@tiptap/extension-text": "^2.0.0-beta.13", + "@tiptap/extension-text-align": "^2.0.0-beta.22", + "@tiptap/extension-typography": "^2.0.0-beta.13", + "@tiptap/extension-underline": "^2.0.0-beta.16", + "@tiptap/starter-kit": "^2.0.0-beta.85", + "@tiptap/vue-3": "^2.0.0-beta.47", "vue": "^3.0.11" }, "devDependencies": { - "@vitejs/plugin-vue": "^1.2.4", - "@vue/compiler-sfc": "^3.1.2", - "sass": "^1.35.1", - "vite": "^2.3.8" + "@vitejs/plugin-vue": "^1.3.0", + "@vue/compiler-sfc": "^3.1.5", + "sass": "^1.36.0", + "vite": "^2.4.4" } }, "node_modules/@babel/helper-validator-identifier": { @@ -87,26 +87,26 @@ } }, "node_modules/@tiptap/core": { - "version": "2.0.0-beta.85", - "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.0.0-beta.85.tgz", - "integrity": "sha512-uAEpmUbwHq5NqftVqp0tz4DJwLnHB2h5YG/ATtNjh7Nzxt9VdrbXtyNTj/652jqeds4dTd+ShJOHN9DBnJ9fuw==", + "version": "2.0.0-beta.89", + "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.0.0-beta.89.tgz", + "integrity": "sha512-EFOU5BWUmKWDWZ1FaKbLajXIV/UnvpcjZbCTyIR6RQr/bXx8BO3eZzuuZuR+Pj566TleICoOlXDIvC2auyu2yw==", "dependencies": { "@types/prosemirror-commands": "^1.0.4", "@types/prosemirror-inputrules": "^1.0.4", "@types/prosemirror-keymap": "^1.0.4", - "@types/prosemirror-model": "^1.13.0", + "@types/prosemirror-model": "^1.13.1", "@types/prosemirror-schema-list": "^1.0.3", - "@types/prosemirror-state": "^1.2.6", - "@types/prosemirror-transform": "^1.1.3", - "@types/prosemirror-view": "^1.17.1", - "prosemirror-commands": "^1.1.9", + "@types/prosemirror-state": "^1.2.7", + "@types/prosemirror-transform": "^1.1.4", + "@types/prosemirror-view": "^1.17.2", + "prosemirror-commands": "^1.1.10", "prosemirror-inputrules": "^1.1.3", "prosemirror-keymap": "^1.1.3", - "prosemirror-model": "^1.14.2", - "prosemirror-schema-list": "^1.1.4", + "prosemirror-model": "^1.14.3", + "prosemirror-schema-list": "^1.1.5", "prosemirror-state": "^1.3.4", "prosemirror-transform": "^1.3.2", - "prosemirror-view": "^1.18.8" + "prosemirror-view": "^1.18.11" }, "funding": { "type": "github", @@ -114,9 +114,9 @@ } }, "node_modules/@tiptap/extension-blockquote": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-2.0.0-beta.14.tgz", - "integrity": "sha512-1U/mJA1Yncl1Uvdv66oRhWrT7RZC/GdrZrvzU4EHdpRRwW4s71jvDVzqGX2tYwMO70TnwmkqMEWm0Csb1pOhMg==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-2.0.0-beta.15.tgz", + "integrity": "sha512-Cso44KsYsqKqaNveQmx5KVaLy9krq5AzE9WhGVDBSFqWhvuIJkQYrTRBbOTfUDs/st9VuwJrbjTDD65ow50wEw==", "dependencies": { "prosemirror-inputrules": "^1.1.3" }, @@ -129,9 +129,9 @@ } }, "node_modules/@tiptap/extension-bold": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-2.0.0-beta.14.tgz", - "integrity": "sha512-WhKB3GfXhIDISQE2jYIVYe0aVQCvQRJQZCRFeac7kMxHE2veHWpjqjbp7jSbvTQ7YVZxPZFvezVs+3HWz1K0xg==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-2.0.0-beta.15.tgz", + "integrity": "sha512-jKyV6iiwhxwa0+7uuKD74jNDVNLNOS1GmU14MgaA95pY5e1fyaRBPPX8Gtt89niz2CLOY711AV17RPZTe/e60w==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -141,12 +141,12 @@ } }, "node_modules/@tiptap/extension-bubble-menu": { - "version": "2.0.0-beta.24", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-2.0.0-beta.24.tgz", - "integrity": "sha512-u1btwasgaidUr9JLQwFQwf9oeXUYPv9TyBzUn/soj9F8qKrWxQxTi/EQUsudvjumzsQOX+tZQIj/YtO5EzR+hA==", + "version": "2.0.0-beta.25", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-2.0.0-beta.25.tgz", + "integrity": "sha512-OZnhJ/n7DUKmXrj791CUC/LRQRerCxuZJY5pT0Vy4QV0q0QH66yTrlCokkjrFPrXyTtWD6Mc04teRKctwxi6DA==", "dependencies": { "prosemirror-state": "^1.3.4", - "prosemirror-view": "^1.18.8", + "prosemirror-view": "^1.18.11", "tippy.js": "^6.3.1" }, "funding": { @@ -158,9 +158,9 @@ } }, "node_modules/@tiptap/extension-bullet-list": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-2.0.0-beta.14.tgz", - "integrity": "sha512-PcyaTNk/aGaXVC98mPAq4TRjXG6dDNb0CAeBqFIo8hLywwwKTaLfLQJNHtm605MSoEo2f8XO6gfQhWgJQQ6qwA==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-2.0.0-beta.15.tgz", + "integrity": "sha512-5i44JzsZOh8Ci6CuYRQy6W3jCpYgX0+VuJKeHvZ6Aomy4Qqrtc9Jk43PBmCj91lNUUtH6Io9l+kDrLCumEFnEg==", "dependencies": { "prosemirror-inputrules": "^1.1.3" }, @@ -173,9 +173,9 @@ } }, "node_modules/@tiptap/extension-character-count": { - "version": "2.0.0-beta.12", - "resolved": "https://registry.npmjs.org/@tiptap/extension-character-count/-/extension-character-count-2.0.0-beta.12.tgz", - "integrity": "sha512-45mh/63Y3u9yCFp3DcSyq/Vv6TI9NCIZfGvFLKIxPIm3mD0+DG3y7LnuaWYcZLgC66OdYSFidoLtD9u3/tdK2w==", + "version": "2.0.0-beta.13", + "resolved": "https://registry.npmjs.org/@tiptap/extension-character-count/-/extension-character-count-2.0.0-beta.13.tgz", + "integrity": "sha512-2rRMvp+ppocyw6tmJx/hpl8wvs9BOIFN5fvDpVxH9INXJu9ZnZPfb2Pko/2RYsx+uWn2q7nKS4jgqNmkZA0ovg==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -186,9 +186,9 @@ } }, "node_modules/@tiptap/extension-code": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.0.0-beta.14.tgz", - "integrity": "sha512-Z67Ae2BPTAXG8VxHaw2SAS9HjUmfL1fUew5IUdaML8GOSaBYjzIffvN/+0MNdxkBEFxMJu4zm3o/WdWIoUckdQ==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.0.0-beta.15.tgz", + "integrity": "sha512-zQkNAOL0/DzQ07exTTquznJ8k/1Fah03AfPrOTNIu3QlepWObfrC9cw51qU+Jlh01CCkijarobIB/bHBD0WWjA==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -198,9 +198,9 @@ } }, "node_modules/@tiptap/extension-code-block": { - "version": "2.0.0-beta.16", - "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.0.0-beta.16.tgz", - "integrity": "sha512-FgKuobqybmkVidRsOSatgVYEyHldvGPBu7/nr5z131PHMqTe7Z35c4r2ts5DCZRsOoby17Nn4iLAENqtsmyyJQ==", + "version": "2.0.0-beta.17", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.0.0-beta.17.tgz", + "integrity": "sha512-u3RY991mXtjuw+trVaDwbAhuPPlU8l6kS4rXIxWJ5W/sNElbmfHLVu7RP++YwM8KOQrCrQl8TJbZTEIekMw61w==", "dependencies": { "prosemirror-inputrules": "^1.1.3" }, @@ -213,9 +213,9 @@ } }, "node_modules/@tiptap/extension-document": { - "version": "2.0.0-beta.12", - "resolved": "https://registry.npmjs.org/@tiptap/extension-document/-/extension-document-2.0.0-beta.12.tgz", - "integrity": "sha512-i5anc2n98Jg1gi6WDLTaS76jLIUe41FHuMHgL4DCIDXv8m2q0qnktfmOvh9AMF7cPzJ2NVAR9xYw0Pxm3qXY4w==", + "version": "2.0.0-beta.13", + "resolved": "https://registry.npmjs.org/@tiptap/extension-document/-/extension-document-2.0.0-beta.13.tgz", + "integrity": "sha512-nrufdKziA/wovaY4DjGkc8OGuIZi8CH8CW3+yYfeWbruwFKkyZHlZy9nplFWSEqBHPAeqD+px9r91yGMW3ontA==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -225,11 +225,11 @@ } }, "node_modules/@tiptap/extension-dropcursor": { - "version": "2.0.0-beta.16", - "resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-2.0.0-beta.16.tgz", - "integrity": "sha512-Wac9kZOmjCGLT/Gg26PBsDGogm4G6CbfQSWLtoZYpM1JQsh91kydEMTUe/INtn3zGZBUuPhX0JmfZPRP2O3WJg==", + "version": "2.0.0-beta.18", + "resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-2.0.0-beta.18.tgz", + "integrity": "sha512-P9cMKO7YXsqp62WA2sliWA6TZThO0yoQprv8Em5BPnW53ttZn9RR9sZaeLL/y02cl/aLVtqdLtl2CPSER43ieA==", "dependencies": { - "@types/prosemirror-dropcursor": "^1.0.1", + "@types/prosemirror-dropcursor": "^1.0.2", "prosemirror-dropcursor": "^1.3.5" }, "funding": { @@ -241,12 +241,12 @@ } }, "node_modules/@tiptap/extension-floating-menu": { - "version": "2.0.0-beta.18", - "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-2.0.0-beta.18.tgz", - "integrity": "sha512-1fCRGdTxCiRm5DV91GwKYn9yu43oonq6iuRAlgcTZ2ON03MAAG55j+cDA2S3JSwbsA7Vr49ijmXBY/fEdU/fiQ==", + "version": "2.0.0-beta.19", + "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-2.0.0-beta.19.tgz", + "integrity": "sha512-SwUFE8Gwsb9B7uP24n/cZUY6fSez5umvaHgsz8TIupgfYsCePMqcwYaMGxJE5iGTE/Zi6vf50b3Xfq87oibO3g==", "dependencies": { "prosemirror-state": "^1.3.4", - "prosemirror-view": "^1.18.8", + "prosemirror-view": "^1.18.11", "tippy.js": "^6.3.1" }, "funding": { @@ -258,11 +258,11 @@ } }, "node_modules/@tiptap/extension-gapcursor": { - "version": "2.0.0-beta.17", - "resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-2.0.0-beta.17.tgz", - "integrity": "sha512-ItucjmbjpIfjBkoarkekfZ2BB4nsJuBptZc2xWj36zpC9ehQvH3uVcgyRPM/5To2gvj4uj8MmYyxO8Q6/PszAg==", + "version": "2.0.0-beta.19", + "resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-2.0.0-beta.19.tgz", + "integrity": "sha512-GZYMR+Z45bn87CMuOHyxzTJOFoCv58mNakIBdSGX+8A+ExBFeZr/qLqxDxN3wz+LRqy7pREe5K3UxJxpsYnCzA==", "dependencies": { - "@types/prosemirror-gapcursor": "^1.0.3", + "@types/prosemirror-gapcursor": "^1.0.4", "prosemirror-gapcursor": "^1.1.5" }, "funding": { @@ -274,9 +274,9 @@ } }, "node_modules/@tiptap/extension-hard-break": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-2.0.0-beta.14.tgz", - "integrity": "sha512-PbGQJGvgYdsEzeHidlodVCaOkcPaib4A7i0MJlXIyzUnBz8Eiv5+Ks2UBG5JgfBB4GGopatZaLfz8VkG3qfGxw==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-2.0.0-beta.15.tgz", + "integrity": "sha512-MS7MjGOtKtC1bVNAShwCetFRuk8nPr/j18OOzKChNrJFrZXWNJrid3dUojwDLqCraYdzSTmiOmMgU+yoUe/gnw==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -286,9 +286,9 @@ } }, "node_modules/@tiptap/extension-heading": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-2.0.0-beta.14.tgz", - "integrity": "sha512-ezJRM5ikZK5bmzYCsvq6xCw1KlellSwHcmAVJsupHk3aPD3UF2IEXnKQYbtDjGN62sB2KwnNy6gKFJ5v48gpxA==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-2.0.0-beta.15.tgz", + "integrity": "sha512-UoXDwEdCV9KiPh0wj0jj2Jt6VDqkoTaSU3d9bmEBLwg1Gjgbuv39JDst7oxSqbf9rgbl3txbeOy35wVBKe9CqA==", "dependencies": { "prosemirror-inputrules": "^1.1.3" }, @@ -301,11 +301,11 @@ } }, "node_modules/@tiptap/extension-history": { - "version": "2.0.0-beta.13", - "resolved": "https://registry.npmjs.org/@tiptap/extension-history/-/extension-history-2.0.0-beta.13.tgz", - "integrity": "sha512-5btrwGkgdBXmSRCi7JLtigw5xC7VJQKljMomZjUR0yWV50EEHirCrKAAdjvZbfsFDP9eqO/WV9VxuI3tqqG+IQ==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-history/-/extension-history-2.0.0-beta.15.tgz", + "integrity": "sha512-6UtsNu9eTDnSTsAw1DdOoOh4rf6pL2sn0my93vkNLe7GUf5RbasPPhWX8Qe6JZMkbBTRPTzqfw92jPhJTchggQ==", "dependencies": { - "@types/prosemirror-history": "^1.0.2", + "@types/prosemirror-history": "^1.0.3", "prosemirror-history": "^1.1.3" }, "funding": { @@ -317,9 +317,9 @@ } }, "node_modules/@tiptap/extension-horizontal-rule": { - "version": "2.0.0-beta.17", - "resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-2.0.0-beta.17.tgz", - "integrity": "sha512-JDjwRSEWFTgdx0ob4zKjfzKcRxkiQTyPEGEZ2uIcTeXTPD0B0j2ysuWIWnqgwtpFdYfv1wOCU59kNLQx+a5JmA==", + "version": "2.0.0-beta.18", + "resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-2.0.0-beta.18.tgz", + "integrity": "sha512-drcPbveAwjj/Ci7glcP6bw5PjKOE6ADHBumwpS3pTLEvWbcF3o6XfRFLykZoGLsforv+/d2JMs7vKnLNbnUHSw==", "dependencies": { "prosemirror-state": "^1.3.4" }, @@ -332,9 +332,9 @@ } }, "node_modules/@tiptap/extension-image": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-image/-/extension-image-2.0.0-beta.14.tgz", - "integrity": "sha512-OguktQVJ8D0wFm8jrnct16Pu+T5J0N+rzMNk5kguJJCMiFjhQZ4USZw5jHU6BIAKwulupXmZ/PUBIYCx02LhIA==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-image/-/extension-image-2.0.0-beta.15.tgz", + "integrity": "sha512-iMwQ154RPefOxgqTTHjOA735YWesyjBhYvD9fFxRDctM2vLxEYYYFOENXEBCFLNAr94gfaxefCEdkuNYHl9H7g==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -344,9 +344,9 @@ } }, "node_modules/@tiptap/extension-italic": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-2.0.0-beta.14.tgz", - "integrity": "sha512-kDdHVHfHuQe3s0A+xrJm0OTE3MrCRWDFHiJ+rC5JnY3/b8GEzovOD6cslz6CeVSZAUDERmHKVPF+ioAct7HXtw==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-2.0.0-beta.15.tgz", + "integrity": "sha512-ZCz1vCysLdvOUrwODuyBP0BDaemCLh6ib7qTYoSDKdive9kfn0Vc5Fg3o8xgHrtrUfwKIJz/sWOknjDEGIc9cw==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -356,9 +356,9 @@ } }, "node_modules/@tiptap/extension-list-item": { - "version": "2.0.0-beta.13", - "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-2.0.0-beta.13.tgz", - "integrity": "sha512-5nvrCvcV35J6WjLd8xQCQWnj2HIDsfTalr0D57jMwym3ZCIEvLwf23DQQ1nNsOHhopmS/Emixh+RQpXUZjH8lQ==", + "version": "2.0.0-beta.14", + "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-2.0.0-beta.14.tgz", + "integrity": "sha512-t6xwEqP+d5443Ul2Jvqz9kXb3ro7bA7yY9HA0vskm3120WxxHW9jxgxZN+82Ot5Tm7nXOAlsN6vuqnt4idnxZQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -368,9 +368,9 @@ } }, "node_modules/@tiptap/extension-ordered-list": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-2.0.0-beta.14.tgz", - "integrity": "sha512-7Tq8jotj7WSUIRlMhNWCv6u99Yu+lyuI8SLx7hRZbmUiGShCQX1J5YI+dti4qlrlhOjjqs1kV95Dgg0JaBtNQw==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-2.0.0-beta.15.tgz", + "integrity": "sha512-j9Xh8CYtV+C/wrTXEWN+U7NJIQ/cQrjta80Mm2hFiE2KDtFNkpsPqG6UBoky04EPFphR5xDUsO1nCT7T7Tei5A==", "dependencies": { "prosemirror-inputrules": "^1.1.3" }, @@ -383,9 +383,9 @@ } }, "node_modules/@tiptap/extension-paragraph": { - "version": "2.0.0-beta.15", - "resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-2.0.0-beta.15.tgz", - "integrity": "sha512-mYGjo85oyLVwgWc8+XZ0cvr5GSHSKvkj5t2t1PyHXDmt6Nhl5cJcHgXDztIUhyh0gbRVFKjwQMeUAZWg6DGxMg==", + "version": "2.0.0-beta.16", + "resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-2.0.0-beta.16.tgz", + "integrity": "sha512-Sj8TXrt9W3ZjK6TQYle9VDgV/bUVnQsXEA7+iQ/gtWST0F1UMFXIhi4hgd9n4gLUtsY/PsmYOEMMbTTAwlERgw==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -395,9 +395,9 @@ } }, "node_modules/@tiptap/extension-strike": { - "version": "2.0.0-beta.16", - "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-2.0.0-beta.16.tgz", - "integrity": "sha512-SPSCUVzxFLKZzgMXYfeUZE+xy52CJckswo0dZ/8NcUthl3mkDS/TwzokpQ/wsyEsKaJNYt8vh2S9HpadSrLcug==", + "version": "2.0.0-beta.17", + "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-2.0.0-beta.17.tgz", + "integrity": "sha512-+WRd0RuCK4+jFKNVN+4rHTa5VMqqGDO2uc+TknkqhFqWp/z96OAGlpHJOwPrnW1fLbpjEBBQIr1vVYSw6KgcZg==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -407,9 +407,9 @@ } }, "node_modules/@tiptap/extension-task-item": { - "version": "2.0.0-beta.16", - "resolved": "https://registry.npmjs.org/@tiptap/extension-task-item/-/extension-task-item-2.0.0-beta.16.tgz", - "integrity": "sha512-HIWIhM/egHNtydjc0z9ebGGeRt4g3EsYtEoAiFhJXgv5fQlm84Fn3dBFva3JuhwaH58TOikAiKGOEIrxZ4rgZA==", + "version": "2.0.0-beta.17", + "resolved": "https://registry.npmjs.org/@tiptap/extension-task-item/-/extension-task-item-2.0.0-beta.17.tgz", + "integrity": "sha512-uV5f9rWo9NAZ+oyt/mkhFEZfcngr92pVL2sn291RiT0qw9NRvdIQ6PLH24il9zu+jjeWmh1cJnBuQos+MQqjyg==", "dependencies": { "prosemirror-inputrules": "^1.1.3" }, @@ -422,9 +422,9 @@ } }, "node_modules/@tiptap/extension-task-list": { - "version": "2.0.0-beta.16", - "resolved": "https://registry.npmjs.org/@tiptap/extension-task-list/-/extension-task-list-2.0.0-beta.16.tgz", - "integrity": "sha512-CxVrjdOAmEGIQjz5Jg46jNZUjLdll726ZCUyE1H9cW1e5bFRCWdjyPb5D3NFw2qJ7IBrf2utE7ESvKWJWws9nA==", + "version": "2.0.0-beta.17", + "resolved": "https://registry.npmjs.org/@tiptap/extension-task-list/-/extension-task-list-2.0.0-beta.17.tgz", + "integrity": "sha512-E17VBqW2lXF59hCQ/3/Kg0hYSDGvVC4B3W8miZwCXt5WTOl98Gk6qAiDXl+2mDKZvnsLty/YrgkD88OlZSIEbQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -434,9 +434,9 @@ } }, "node_modules/@tiptap/extension-text": { - "version": "2.0.0-beta.12", - "resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-2.0.0-beta.12.tgz", - "integrity": "sha512-JEWLYOJKSpmpaI0YTzj30uodpsrSYDGSvy5dT5bYvWovIvLmggKPHl0iKIPDWAM5xfd07CkP2+BFFRblMh96IA==", + "version": "2.0.0-beta.13", + "resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-2.0.0-beta.13.tgz", + "integrity": "sha512-0EtAwuRldCAoFaL/iXgkRepEeOd55rPg5N4FQUN1xTwZT7PDofukP0DG/2jff/Uj17x4uTaJAa9qlFWuNnDvjw==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -446,9 +446,9 @@ } }, "node_modules/@tiptap/extension-text-align": { - "version": "2.0.0-beta.20", - "resolved": "https://registry.npmjs.org/@tiptap/extension-text-align/-/extension-text-align-2.0.0-beta.20.tgz", - "integrity": "sha512-R06oz4xr6ULKkVA9MBwttR+72ostEnPDAeXfdf++/RxGwLLmM7TG2+ulMcfp4ICWe6H/zLwTAPpkaKeZSEwwrw==", + "version": "2.0.0-beta.22", + "resolved": "https://registry.npmjs.org/@tiptap/extension-text-align/-/extension-text-align-2.0.0-beta.22.tgz", + "integrity": "sha512-47jbI0DyiS+debUo0Wo2eexoRAdFZajw1+PJgpbtKLq5kWYqXeAvOyMkIIOFYHEl5u8pi4SsQd1NgEt21j0mig==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -471,9 +471,9 @@ } }, "node_modules/@tiptap/extension-typography": { - "version": "2.0.0-beta.12", - "resolved": "https://registry.npmjs.org/@tiptap/extension-typography/-/extension-typography-2.0.0-beta.12.tgz", - "integrity": "sha512-HFA3O3aDF6VgMAnwMBhRn4q34Wx9uquqc/MscagxPKtDy3e+3CPqp/0+TxvaUtgJhMv9amjjy40b1uw54jJstA==", + "version": "2.0.0-beta.13", + "resolved": "https://registry.npmjs.org/@tiptap/extension-typography/-/extension-typography-2.0.0-beta.13.tgz", + "integrity": "sha512-YBPYKqovj22yYRgHFa8qIUEdtJm/6GY9HnmUeNBdxwIi9ncA+aaXENpgyFDYKzF9C9bV+kWtIXGD7bkUtDuReg==", "dependencies": { "prosemirror-inputrules": "^1.1.3" }, @@ -486,9 +486,9 @@ } }, "node_modules/@tiptap/extension-underline": { - "version": "2.0.0-beta.15", - "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-2.0.0-beta.15.tgz", - "integrity": "sha512-xrdNYXBuDaiKBByAuJ8Z9g+1w4I1pp8Id6ZbhxnljiTIwtX6SD/Pp4z/4dKhXNSpHvipyaFEXY0CVpxzbSEk5w==", + "version": "2.0.0-beta.16", + "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-2.0.0-beta.16.tgz", + "integrity": "sha512-N3wMfSJkn+A5HbuLSpbn1Zp9CWWLXfMexpVdg4eUwTMOgF/kpVRaPGCkBonhHH3NfWtT7QbSipdWc7DKpBb8Jw==", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -498,29 +498,29 @@ } }, "node_modules/@tiptap/starter-kit": { - "version": "2.0.0-beta.81", - "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-2.0.0-beta.81.tgz", - "integrity": "sha512-9AFZgJUOhJ0q16zW3q/r2w3tLwqlE/HssQUKEoHS1o4KJUTO/9SpqqJspKEddjeKL5TCzKvOdlBdWcXEZM6Pxw==", - "dependencies": { - "@tiptap/core": "^2.0.0-beta.85", - "@tiptap/extension-blockquote": "^2.0.0-beta.14", - "@tiptap/extension-bold": "^2.0.0-beta.14", - "@tiptap/extension-bullet-list": "^2.0.0-beta.14", - "@tiptap/extension-code": "^2.0.0-beta.14", - "@tiptap/extension-code-block": "^2.0.0-beta.16", - "@tiptap/extension-document": "^2.0.0-beta.12", - "@tiptap/extension-dropcursor": "^2.0.0-beta.16", - "@tiptap/extension-gapcursor": "^2.0.0-beta.17", - "@tiptap/extension-hard-break": "^2.0.0-beta.14", - "@tiptap/extension-heading": "^2.0.0-beta.14", - "@tiptap/extension-history": "^2.0.0-beta.13", - "@tiptap/extension-horizontal-rule": "^2.0.0-beta.17", - "@tiptap/extension-italic": "^2.0.0-beta.14", - "@tiptap/extension-list-item": "^2.0.0-beta.13", - "@tiptap/extension-ordered-list": "^2.0.0-beta.14", - "@tiptap/extension-paragraph": "^2.0.0-beta.15", - "@tiptap/extension-strike": "^2.0.0-beta.16", - "@tiptap/extension-text": "^2.0.0-beta.12" + "version": "2.0.0-beta.85", + "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-2.0.0-beta.85.tgz", + "integrity": "sha512-wlaCn4ol7rR/wOfFz8MHOeHrcXkYX3cq2LQl8l4JJgwcKiBZTfLSX2t8sy4eAufQlM74aNLwHn/3iuI7iw3k4w==", + "dependencies": { + "@tiptap/core": "^2.0.0-beta.89", + "@tiptap/extension-blockquote": "^2.0.0-beta.15", + "@tiptap/extension-bold": "^2.0.0-beta.15", + "@tiptap/extension-bullet-list": "^2.0.0-beta.15", + "@tiptap/extension-code": "^2.0.0-beta.15", + "@tiptap/extension-code-block": "^2.0.0-beta.17", + "@tiptap/extension-document": "^2.0.0-beta.13", + "@tiptap/extension-dropcursor": "^2.0.0-beta.18", + "@tiptap/extension-gapcursor": "^2.0.0-beta.19", + "@tiptap/extension-hard-break": "^2.0.0-beta.15", + "@tiptap/extension-heading": "^2.0.0-beta.15", + "@tiptap/extension-history": "^2.0.0-beta.15", + "@tiptap/extension-horizontal-rule": "^2.0.0-beta.18", + "@tiptap/extension-italic": "^2.0.0-beta.15", + "@tiptap/extension-list-item": "^2.0.0-beta.14", + "@tiptap/extension-ordered-list": "^2.0.0-beta.15", + "@tiptap/extension-paragraph": "^2.0.0-beta.16", + "@tiptap/extension-strike": "^2.0.0-beta.17", + "@tiptap/extension-text": "^2.0.0-beta.13" }, "funding": { "type": "github", @@ -528,14 +528,14 @@ } }, "node_modules/@tiptap/vue-3": { - "version": "2.0.0-beta.45", - "resolved": "https://registry.npmjs.org/@tiptap/vue-3/-/vue-3-2.0.0-beta.45.tgz", - "integrity": "sha512-DMBRvSZKcGMPQiJhtUvytaCjQqkvCx82DJgcm9FsrjWPjv8qUfkUxgaEYyLNWSx72otldQF/h7pLWv2Bkd1hSA==", + "version": "2.0.0-beta.47", + "resolved": "https://registry.npmjs.org/@tiptap/vue-3/-/vue-3-2.0.0-beta.47.tgz", + "integrity": "sha512-REi5+sJdHSfBFqAriof58rcwgAsDtsKGTC6dBAyvf0SNXV1OwS0ZnsjAhv4OcgoRhChDAD/Ux+mG6Lbg0b01bA==", "dependencies": { - "@tiptap/extension-bubble-menu": "^2.0.0-beta.24", - "@tiptap/extension-floating-menu": "^2.0.0-beta.18", + "@tiptap/extension-bubble-menu": "^2.0.0-beta.25", + "@tiptap/extension-floating-menu": "^2.0.0-beta.19", "prosemirror-state": "^1.3.4", - "prosemirror-view": "^1.18.8", + "prosemirror-view": "^1.18.11", "vue": "^3.0.0" }, "funding": { @@ -568,26 +568,26 @@ } }, "node_modules/@types/prosemirror-dropcursor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/prosemirror-dropcursor/-/prosemirror-dropcursor-1.0.1.tgz", - "integrity": "sha512-nHokhFypOZjknolZBm2XShlR7fx1IUcCiA3S2fBwmAraWu6zv3gboDSwwFpoS9UB2xKc4ismAmBxh2bpL3YNkg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/prosemirror-dropcursor/-/prosemirror-dropcursor-1.0.2.tgz", + "integrity": "sha512-5Ez7yIAvHQgn5YJkuafEh0w4sHV7pksCX9LTPBFRjCuznamcKsnYCez4mR0PwIWq/WuPDvHkR+wqKb4l0t9/aQ==", "dependencies": { "@types/prosemirror-state": "*" } }, "node_modules/@types/prosemirror-gapcursor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/prosemirror-gapcursor/-/prosemirror-gapcursor-1.0.3.tgz", - "integrity": "sha512-kBVjjbMmUk7ZsgpI1NOyY15makulu1skEGr+V9GgY7GQnT9vqjo8/XiNSgSj9s9vRTsTb/KAaTI9KJwWlhbhxQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/prosemirror-gapcursor/-/prosemirror-gapcursor-1.0.4.tgz", + "integrity": "sha512-9xKjFIG5947dzerFvkLWp6F53JwrUYoYwh3SgcTFEp8SbSfNNrez/PFYVZKPnoqPoaK5WtTdQTaMwpCV9rXQIg==", "dependencies": { "@types/prosemirror-model": "*", "@types/prosemirror-state": "*" } }, "node_modules/@types/prosemirror-history": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/prosemirror-history/-/prosemirror-history-1.0.2.tgz", - "integrity": "sha512-AcfpWo+HkIuvq/H2zYjIMi2jxa2GWfYaTNiFTB2sigjkpWNM93CIlb7Cimy/4vNH8lVPp0GwLBjYIMRX6zOUyA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/prosemirror-history/-/prosemirror-history-1.0.3.tgz", + "integrity": "sha512-5TloMDRavgLjOAKXp1Li8u0xcsspzbT1Cm9F2pwHOkgvQOz1jWQb2VIXO7RVNsFjLBZdIXlyfSLivro3DuMWXg==", "dependencies": { "@types/prosemirror-model": "*", "@types/prosemirror-state": "*" @@ -614,9 +614,9 @@ } }, "node_modules/@types/prosemirror-model": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@types/prosemirror-model/-/prosemirror-model-1.13.0.tgz", - "integrity": "sha512-EIUr2R38Zh9n1eA8BQ1C3NX/XLV9U44DhNVk8x3Sth2RW+wa7jNA82XHMPOoapsOTfmpnh32xaHBOzREiBqdPQ==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/@types/prosemirror-model/-/prosemirror-model-1.13.1.tgz", + "integrity": "sha512-tA1AlI+YR2t3Ve5eeQVJnQm4yV4wVlNfeogHusD1X3OEqqMYTuPssThgIMR4PxPHtvV871Ix8a20bUiJvULDgw==", "dependencies": { "@types/orderedmap": "*" } @@ -632,9 +632,9 @@ } }, "node_modules/@types/prosemirror-state": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@types/prosemirror-state/-/prosemirror-state-1.2.6.tgz", - "integrity": "sha512-tJo0wC+/cQvbrPDVx01Fnng9Fs41bAMVxgJY1KLOyIsUPN0otUN1KdoQurLMmHNHTvIna9ZXxjZD//xJKLYfJw==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/prosemirror-state/-/prosemirror-state-1.2.7.tgz", + "integrity": "sha512-clJf5uw3/XQnBJtl2RqYXoLMGBySnLYl43xtDvFfQZKkLnnYcM1SDU8dcz7lWjl2Dm+H98RpLOl44pp7DYT+wA==", "dependencies": { "@types/prosemirror-model": "*", "@types/prosemirror-transform": "*", @@ -642,17 +642,17 @@ } }, "node_modules/@types/prosemirror-transform": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@types/prosemirror-transform/-/prosemirror-transform-1.1.3.tgz", - "integrity": "sha512-qtnd4jMoBgUAF2Vy2uRCVY4/LN3d069PP9XTIKrfk7mwWPYKonBYv1NsaBGTpK26sOPu0p7eJNZwaiNYmbfIwA==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@types/prosemirror-transform/-/prosemirror-transform-1.1.4.tgz", + "integrity": "sha512-HP1PauvkqSgDquZut8HaLOTUDQ6jja/LAy4OA7tTS1XG7wqRnX3gLUyEj0mD6vFd4y8BPkNddNdOh/BeGHlUjg==", "dependencies": { "@types/prosemirror-model": "*" } }, "node_modules/@types/prosemirror-view": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/prosemirror-view/-/prosemirror-view-1.17.1.tgz", - "integrity": "sha512-PNiGGc6BffxHQzMR09UUilsBR8xFPDsKiPIXb4K/g56voPIvqq1pqySnWFfSR50Vo4ZL0tss3VBLWiiiKzVahQ==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/@types/prosemirror-view/-/prosemirror-view-1.18.0.tgz", + "integrity": "sha512-7NBy7qIV/ig49ThfkrIJrvW8E+HwumMgmpopUTYJlKwOh/fQ6SVUG/RtdnAIBLD+4uK0R2SMObbGZm06x6OwbA==", "dependencies": { "@types/prosemirror-model": "*", "@types/prosemirror-state": "*", @@ -660,9 +660,9 @@ } }, "node_modules/@vitejs/plugin-vue": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.2.4.tgz", - "integrity": "sha512-D/3H9plevPQGgQGwmV6eecvOnooLTecPR63HPffVVWPEhbfvmtYLWgznzs456NBb2DItiRTCIa1yWxvGqC+I8A==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.3.0.tgz", + "integrity": "sha512-wJvuJdTBjvucUX0vK4fuy60t+A9bJSZxc59vp1Y+8kiOd0NU5kFt4lay72gMWPeR+lSUjrTmGUq8Uzb99Jbw3A==", "dev": true, "engines": { "node": ">=12.0.0" @@ -672,39 +672,39 @@ } }, "node_modules/@vue/compiler-core": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.1.2.tgz", - "integrity": "sha512-nHmq7vLjq/XM2IMbZUcKWoH5sPXa2uR/nIKZtjbK5F3TcbnYE/zKsrSUR9WZJ03unlwotNBX1OyxVt9HbWD7/Q==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.1.5.tgz", + "integrity": "sha512-TXBhFinoBaXKDykJzY26UEuQU1K07FOp/0Ie+OXySqqk0bS0ZO7Xvl7UmiTUPYcLrWbxWBR7Bs/y55AI0MNc2Q==", "dependencies": { "@babel/parser": "^7.12.0", "@babel/types": "^7.12.0", - "@vue/shared": "3.1.2", + "@vue/shared": "3.1.5", "estree-walker": "^2.0.1", "source-map": "^0.6.1" } }, "node_modules/@vue/compiler-dom": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.1.2.tgz", - "integrity": "sha512-k2+SWcWH0jL6WQAX7Or2ONqu5MbtTgTO0dJrvebQYzgqaKMXNI90RNeWeCxS4BnNFMDONpHBeFgbwbnDWIkmRg==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.1.5.tgz", + "integrity": "sha512-ZsL3jqJ52OjGU/YiT/9XiuZAmWClKInZM2aFJh9gnsAPqOrj2JIELMbkIFpVKR/CrVO/f2VxfPiiQdQTr65jcQ==", "dependencies": { - "@vue/compiler-core": "3.1.2", - "@vue/shared": "3.1.2" + "@vue/compiler-core": "3.1.5", + "@vue/shared": "3.1.5" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.1.2.tgz", - "integrity": "sha512-SeG/2+DvwejQ7oAiSx8BrDh5qOdqCYHGClPiTvVIHTfSIHiS2JjMbCANdDCjHkTOh/O7WZzo2JhdKm98bRBxTw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.1.5.tgz", + "integrity": "sha512-mtMY6xMvZeSRx9MTa1+NgJWndrkzVTdJ1pQAmAKQuxyb5LsHVvrgP7kcQFvxPHVpLVTORbTJWHaiqoKrJvi1iA==", "dev": true, "dependencies": { "@babel/parser": "^7.13.9", "@babel/types": "^7.13.0", "@types/estree": "^0.0.48", - "@vue/compiler-core": "3.1.2", - "@vue/compiler-dom": "3.1.2", - "@vue/compiler-ssr": "3.1.2", - "@vue/shared": "3.1.2", + "@vue/compiler-core": "3.1.5", + "@vue/compiler-dom": "3.1.5", + "@vue/compiler-ssr": "3.1.5", + "@vue/shared": "3.1.5", "consolidate": "^0.16.0", "estree-walker": "^2.0.1", "hash-sum": "^2.0.0", @@ -717,50 +717,50 @@ "source-map": "^0.6.1" }, "peerDependencies": { - "vue": "3.1.2" + "vue": "3.1.5" } }, "node_modules/@vue/compiler-ssr": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.1.2.tgz", - "integrity": "sha512-BwXo9LFk5OSWdMyZQ4bX1ELHX0Z/9F+ld/OaVnpUPzAZCHslBYLvyKUVDwv2C/lpLjRffpC2DOUEdl1+RP1aGg==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.1.5.tgz", + "integrity": "sha512-CU5N7Di/a4lyJ18LGJxJYZS2a8PlLdWpWHX9p/XcsjT2TngMpj3QvHVRkuik2u8QrIDZ8OpYmTyj1WDNsOV+Dg==", "dev": true, "dependencies": { - "@vue/compiler-dom": "3.1.2", - "@vue/shared": "3.1.2" + "@vue/compiler-dom": "3.1.5", + "@vue/shared": "3.1.5" } }, "node_modules/@vue/reactivity": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.1.2.tgz", - "integrity": "sha512-glJzJoN2xE7I2lRvwKM5u1BHRPTd1yc8iaf//Lai/78/uYAvE5DXp5HzWRFOwMlbRvMGJHIQjOqoxj87cDAaag==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.1.5.tgz", + "integrity": "sha512-1tdfLmNjWG6t/CsPldh+foumYFo3cpyCHgBYQ34ylaMsJ+SNHQ1kApMIa8jN+i593zQuaw3AdWH0nJTARzCFhg==", "dependencies": { - "@vue/shared": "3.1.2" + "@vue/shared": "3.1.5" } }, "node_modules/@vue/runtime-core": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.1.2.tgz", - "integrity": "sha512-gsPZG4dRIkixuuKmoj4P9IHgfT0yaFLcqWOM5F/bCk0nxQn1XtxH8oUehWuET726KhbukvDoJfe9G2CKviy80w==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.1.5.tgz", + "integrity": "sha512-YQbG5cBktN1RowQDKA22itmvQ+b40f0WgQ6CXK4VYoYICAiAfu6Cc14777ve8zp1rJRGtk5oIeS149TOculrTg==", "dependencies": { - "@vue/reactivity": "3.1.2", - "@vue/shared": "3.1.2" + "@vue/reactivity": "3.1.5", + "@vue/shared": "3.1.5" } }, "node_modules/@vue/runtime-dom": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.1.2.tgz", - "integrity": "sha512-QvINxjLucEZFzp5f0NVu7JqWYCv5TKQfkH2FDs/N6QNE4iKcYtKrWdT0HKfABnVXG28Znqv6rIH0dH4ZAOwxpA==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.1.5.tgz", + "integrity": "sha512-tNcf3JhVR0RfW0kw1p8xZgv30nvX8Y9rsz7eiQ0dHe273sfoCngAG0y4GvMaY4Xd8FsjUwFedd4suQ8Lu8meXg==", "dependencies": { - "@vue/runtime-core": "3.1.2", - "@vue/shared": "3.1.2", + "@vue/runtime-core": "3.1.5", + "@vue/shared": "3.1.5", "csstype": "^2.6.8" } }, "node_modules/@vue/shared": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.1.2.tgz", - "integrity": "sha512-EmH/poaDWBPJaPILXNI/1fvUbArJQmmTyVCwvvyDYDFnkPoTclAbHRAtyIvqfez7jybTDn077HTNILpxlsoWhg==" + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.1.5.tgz", + "integrity": "sha512-oJ4F3TnvpXaQwZJNF3ZK+kLPHKarDmJjJ6jyzVNDKH9md1dptjC7lWR//jrGuLdek/U6iltWxqAnYOu8gCiOvA==" }, "node_modules/anymatch": { "version": "3.1.2", @@ -1171,9 +1171,9 @@ } }, "node_modules/postcss": { - "version": "8.3.5", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.5.tgz", - "integrity": "sha512-NxTuJocUhYGsMiMFHDUkmjSKT3EdH4/WbGF6GCi1NDGk+vbcUTun4fpbOqaPtD8IIsztA2ilZm2DhYCuyN58gA==", + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.6.tgz", + "integrity": "sha512-wG1cc/JhRgdqB6WHEuyLTedf3KIRuD0hG6ldkFEZNCjRxiC+3i6kkWUUbiJQayP28iwG35cEmAbe98585BYV0A==", "dev": true, "dependencies": { "colorette": "^1.2.2", @@ -1286,9 +1286,9 @@ "dev": true }, "node_modules/prosemirror-commands": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.1.9.tgz", - "integrity": "sha512-zedlbQ+8QK0tIeibb6vbnAX5FO/S5x67xHgF57Fned+3G6RZY3JAGma9kC1jSCmLF/XC7MCZ90oekb0qo2b+Pw==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.1.10.tgz", + "integrity": "sha512-IWyBBXNAd44RM6NnBPljwq+/CM2oYCQJkF+YhKEAZNwzW0uFdGf4qComhjbKZzqFdu6Iub2ZhNsXgwPibA0lCQ==", "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", @@ -1345,17 +1345,17 @@ } }, "node_modules/prosemirror-model": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.14.2.tgz", - "integrity": "sha512-TwkACyEiSi8FJiRhg2ffbzmQRy5DR+aTwAr7trNQNZL24HJR8ouxy4qCkG99PnWK0xZ0AjSMtPXSU6hnxAiP7Q==", + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.14.3.tgz", + "integrity": "sha512-yzZlBaSxfUPIIP6U5Edh5zKxJPZ5f7bwZRhiCuH3UYkWhj+P3d8swHsbuAMOu/iDatDc5J/Qs5Mb3++mZf+CvQ==", "dependencies": { "orderedmap": "^1.1.0" } }, "node_modules/prosemirror-schema-list": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.1.4.tgz", - "integrity": "sha512-pNTuZflacFOBlxrTcWSdWhjoB8BaucwfJVp/gJNxztOwaN3wQiC65axclXyplf6TKgXD/EkWfS/QAov3/Znadw==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.1.5.tgz", + "integrity": "sha512-9gadhga/wySVfb/iZ2vOpndbG0XroeLw0HkkZN5demNbOea6U5oQtJmvyYWC7ZVf3WkhmVdVsOXrllM9JcC20A==", "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-transform": "^1.0.0" @@ -1379,11 +1379,11 @@ } }, "node_modules/prosemirror-view": { - "version": "1.18.8", - "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.18.8.tgz", - "integrity": "sha512-iLNonsRUM+ByIxJZP+tRuE8jUy56jfgf8oxnc4InWYTYdPibARs4FL6DQ6D56GdPMlXyTjXjSdfDp/x8mwHhtw==", + "version": "1.18.11", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.18.11.tgz", + "integrity": "sha512-KXUM8UEV+IK4JYWHNyxkPGDGbxeTEUHQv3POApfyTRN5eMcPFbY4cB0mDJr0LPelVvYPghmZDOCqfCIm9mYHtQ==", "dependencies": { - "prosemirror-model": "^1.1.0", + "prosemirror-model": "^1.14.3", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } @@ -1461,9 +1461,9 @@ "integrity": "sha512-ku6MFrwEVSVmXLvy3dYph3LAMNS0890K7fabn+0YIRQ2T96T9F4gkFf0vf0WW0JUraNWwGRtInEpH7yO4tbQZg==" }, "node_modules/sass": { - "version": "1.35.1", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.35.1.tgz", - "integrity": "sha512-oCisuQJstxMcacOPmxLNiLlj4cUyN2+8xJnG7VanRoh2GOLr9RqkvI4AxA4a6LHVg/rsu+PmxXeGhrdSF9jCiQ==", + "version": "1.36.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.36.0.tgz", + "integrity": "sha512-fQzEjipfOv5kh930nu3Imzq3ie/sGDc/4KtQMJlt7RRdrkQSfe37Bwi/Rf/gfuYHsIuE1fIlDMvpyMcEwjnPvg==", "dev": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0" @@ -1549,13 +1549,13 @@ "dev": true }, "node_modules/vite": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/vite/-/vite-2.3.8.tgz", - "integrity": "sha512-QiEx+iqNnJntSgSF2fWRQvRey9pORIrtNJzNyBJXwc+BdzWs83FQolX84cTBo393cfhObrtWa6180dAa4NLDiQ==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.4.4.tgz", + "integrity": "sha512-m1wK6pFJKmaYA6AeZIUXyiAgUAAJzVXhIMYCdZUpCaFMGps0v0IlNJtbmPvkUhVEyautalajmnW5X6NboUPsnw==", "dev": true, "dependencies": { "esbuild": "^0.12.8", - "postcss": "^8.3.4", + "postcss": "^8.3.6", "resolve": "^1.20.0", "rollup": "^2.38.5" }, @@ -1570,13 +1570,13 @@ } }, "node_modules/vue": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.1.2.tgz", - "integrity": "sha512-q/rbKpb7aofax4ugqu2k/uj7BYuNPcd6Z5/qJtfkJQsE0NkwVoCyeSh7IZGH61hChwYn3CEkh4bHolvUPxlQ+w==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.1.5.tgz", + "integrity": "sha512-Ho7HNb1nfDoO+HVb6qYZgeaobt1XbY6KXFe4HGs1b9X6RhkWG/113n4/SrtM1LUclM6OrP/Se5aPHHvAPG1iVQ==", "dependencies": { - "@vue/compiler-dom": "3.1.2", - "@vue/runtime-dom": "3.1.2", - "@vue/shared": "3.1.2" + "@vue/compiler-dom": "3.1.5", + "@vue/runtime-dom": "3.1.5", + "@vue/shared": "3.1.5" } }, "node_modules/w3c-keyname": { @@ -1623,207 +1623,207 @@ "requires": {} }, "@tiptap/core": { - "version": "2.0.0-beta.85", - "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.0.0-beta.85.tgz", - "integrity": "sha512-uAEpmUbwHq5NqftVqp0tz4DJwLnHB2h5YG/ATtNjh7Nzxt9VdrbXtyNTj/652jqeds4dTd+ShJOHN9DBnJ9fuw==", + "version": "2.0.0-beta.89", + "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.0.0-beta.89.tgz", + "integrity": "sha512-EFOU5BWUmKWDWZ1FaKbLajXIV/UnvpcjZbCTyIR6RQr/bXx8BO3eZzuuZuR+Pj566TleICoOlXDIvC2auyu2yw==", "requires": { "@types/prosemirror-commands": "^1.0.4", "@types/prosemirror-inputrules": "^1.0.4", "@types/prosemirror-keymap": "^1.0.4", - "@types/prosemirror-model": "^1.13.0", + "@types/prosemirror-model": "^1.13.1", "@types/prosemirror-schema-list": "^1.0.3", - "@types/prosemirror-state": "^1.2.6", - "@types/prosemirror-transform": "^1.1.3", - "@types/prosemirror-view": "^1.17.1", - "prosemirror-commands": "^1.1.9", + "@types/prosemirror-state": "^1.2.7", + "@types/prosemirror-transform": "^1.1.4", + "@types/prosemirror-view": "^1.17.2", + "prosemirror-commands": "^1.1.10", "prosemirror-inputrules": "^1.1.3", "prosemirror-keymap": "^1.1.3", - "prosemirror-model": "^1.14.2", - "prosemirror-schema-list": "^1.1.4", + "prosemirror-model": "^1.14.3", + "prosemirror-schema-list": "^1.1.5", "prosemirror-state": "^1.3.4", "prosemirror-transform": "^1.3.2", - "prosemirror-view": "^1.18.8" + "prosemirror-view": "^1.18.11" } }, "@tiptap/extension-blockquote": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-2.0.0-beta.14.tgz", - "integrity": "sha512-1U/mJA1Yncl1Uvdv66oRhWrT7RZC/GdrZrvzU4EHdpRRwW4s71jvDVzqGX2tYwMO70TnwmkqMEWm0Csb1pOhMg==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-2.0.0-beta.15.tgz", + "integrity": "sha512-Cso44KsYsqKqaNveQmx5KVaLy9krq5AzE9WhGVDBSFqWhvuIJkQYrTRBbOTfUDs/st9VuwJrbjTDD65ow50wEw==", "requires": { "prosemirror-inputrules": "^1.1.3" } }, "@tiptap/extension-bold": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-2.0.0-beta.14.tgz", - "integrity": "sha512-WhKB3GfXhIDISQE2jYIVYe0aVQCvQRJQZCRFeac7kMxHE2veHWpjqjbp7jSbvTQ7YVZxPZFvezVs+3HWz1K0xg==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-2.0.0-beta.15.tgz", + "integrity": "sha512-jKyV6iiwhxwa0+7uuKD74jNDVNLNOS1GmU14MgaA95pY5e1fyaRBPPX8Gtt89niz2CLOY711AV17RPZTe/e60w==", "requires": {} }, "@tiptap/extension-bubble-menu": { - "version": "2.0.0-beta.24", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-2.0.0-beta.24.tgz", - "integrity": "sha512-u1btwasgaidUr9JLQwFQwf9oeXUYPv9TyBzUn/soj9F8qKrWxQxTi/EQUsudvjumzsQOX+tZQIj/YtO5EzR+hA==", + "version": "2.0.0-beta.25", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-2.0.0-beta.25.tgz", + "integrity": "sha512-OZnhJ/n7DUKmXrj791CUC/LRQRerCxuZJY5pT0Vy4QV0q0QH66yTrlCokkjrFPrXyTtWD6Mc04teRKctwxi6DA==", "requires": { "prosemirror-state": "^1.3.4", - "prosemirror-view": "^1.18.8", + "prosemirror-view": "^1.18.11", "tippy.js": "^6.3.1" } }, "@tiptap/extension-bullet-list": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-2.0.0-beta.14.tgz", - "integrity": "sha512-PcyaTNk/aGaXVC98mPAq4TRjXG6dDNb0CAeBqFIo8hLywwwKTaLfLQJNHtm605MSoEo2f8XO6gfQhWgJQQ6qwA==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-2.0.0-beta.15.tgz", + "integrity": "sha512-5i44JzsZOh8Ci6CuYRQy6W3jCpYgX0+VuJKeHvZ6Aomy4Qqrtc9Jk43PBmCj91lNUUtH6Io9l+kDrLCumEFnEg==", "requires": { "prosemirror-inputrules": "^1.1.3" } }, "@tiptap/extension-character-count": { - "version": "2.0.0-beta.12", - "resolved": "https://registry.npmjs.org/@tiptap/extension-character-count/-/extension-character-count-2.0.0-beta.12.tgz", - "integrity": "sha512-45mh/63Y3u9yCFp3DcSyq/Vv6TI9NCIZfGvFLKIxPIm3mD0+DG3y7LnuaWYcZLgC66OdYSFidoLtD9u3/tdK2w==", + "version": "2.0.0-beta.13", + "resolved": "https://registry.npmjs.org/@tiptap/extension-character-count/-/extension-character-count-2.0.0-beta.13.tgz", + "integrity": "sha512-2rRMvp+ppocyw6tmJx/hpl8wvs9BOIFN5fvDpVxH9INXJu9ZnZPfb2Pko/2RYsx+uWn2q7nKS4jgqNmkZA0ovg==", "requires": {} }, "@tiptap/extension-code": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.0.0-beta.14.tgz", - "integrity": "sha512-Z67Ae2BPTAXG8VxHaw2SAS9HjUmfL1fUew5IUdaML8GOSaBYjzIffvN/+0MNdxkBEFxMJu4zm3o/WdWIoUckdQ==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.0.0-beta.15.tgz", + "integrity": "sha512-zQkNAOL0/DzQ07exTTquznJ8k/1Fah03AfPrOTNIu3QlepWObfrC9cw51qU+Jlh01CCkijarobIB/bHBD0WWjA==", "requires": {} }, "@tiptap/extension-code-block": { - "version": "2.0.0-beta.16", - "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.0.0-beta.16.tgz", - "integrity": "sha512-FgKuobqybmkVidRsOSatgVYEyHldvGPBu7/nr5z131PHMqTe7Z35c4r2ts5DCZRsOoby17Nn4iLAENqtsmyyJQ==", + "version": "2.0.0-beta.17", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.0.0-beta.17.tgz", + "integrity": "sha512-u3RY991mXtjuw+trVaDwbAhuPPlU8l6kS4rXIxWJ5W/sNElbmfHLVu7RP++YwM8KOQrCrQl8TJbZTEIekMw61w==", "requires": { "prosemirror-inputrules": "^1.1.3" } }, "@tiptap/extension-document": { - "version": "2.0.0-beta.12", - "resolved": "https://registry.npmjs.org/@tiptap/extension-document/-/extension-document-2.0.0-beta.12.tgz", - "integrity": "sha512-i5anc2n98Jg1gi6WDLTaS76jLIUe41FHuMHgL4DCIDXv8m2q0qnktfmOvh9AMF7cPzJ2NVAR9xYw0Pxm3qXY4w==", + "version": "2.0.0-beta.13", + "resolved": "https://registry.npmjs.org/@tiptap/extension-document/-/extension-document-2.0.0-beta.13.tgz", + "integrity": "sha512-nrufdKziA/wovaY4DjGkc8OGuIZi8CH8CW3+yYfeWbruwFKkyZHlZy9nplFWSEqBHPAeqD+px9r91yGMW3ontA==", "requires": {} }, "@tiptap/extension-dropcursor": { - "version": "2.0.0-beta.16", - "resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-2.0.0-beta.16.tgz", - "integrity": "sha512-Wac9kZOmjCGLT/Gg26PBsDGogm4G6CbfQSWLtoZYpM1JQsh91kydEMTUe/INtn3zGZBUuPhX0JmfZPRP2O3WJg==", + "version": "2.0.0-beta.18", + "resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-2.0.0-beta.18.tgz", + "integrity": "sha512-P9cMKO7YXsqp62WA2sliWA6TZThO0yoQprv8Em5BPnW53ttZn9RR9sZaeLL/y02cl/aLVtqdLtl2CPSER43ieA==", "requires": { - "@types/prosemirror-dropcursor": "^1.0.1", + "@types/prosemirror-dropcursor": "^1.0.2", "prosemirror-dropcursor": "^1.3.5" } }, "@tiptap/extension-floating-menu": { - "version": "2.0.0-beta.18", - "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-2.0.0-beta.18.tgz", - "integrity": "sha512-1fCRGdTxCiRm5DV91GwKYn9yu43oonq6iuRAlgcTZ2ON03MAAG55j+cDA2S3JSwbsA7Vr49ijmXBY/fEdU/fiQ==", + "version": "2.0.0-beta.19", + "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-2.0.0-beta.19.tgz", + "integrity": "sha512-SwUFE8Gwsb9B7uP24n/cZUY6fSez5umvaHgsz8TIupgfYsCePMqcwYaMGxJE5iGTE/Zi6vf50b3Xfq87oibO3g==", "requires": { "prosemirror-state": "^1.3.4", - "prosemirror-view": "^1.18.8", + "prosemirror-view": "^1.18.11", "tippy.js": "^6.3.1" } }, "@tiptap/extension-gapcursor": { - "version": "2.0.0-beta.17", - "resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-2.0.0-beta.17.tgz", - "integrity": "sha512-ItucjmbjpIfjBkoarkekfZ2BB4nsJuBptZc2xWj36zpC9ehQvH3uVcgyRPM/5To2gvj4uj8MmYyxO8Q6/PszAg==", + "version": "2.0.0-beta.19", + "resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-2.0.0-beta.19.tgz", + "integrity": "sha512-GZYMR+Z45bn87CMuOHyxzTJOFoCv58mNakIBdSGX+8A+ExBFeZr/qLqxDxN3wz+LRqy7pREe5K3UxJxpsYnCzA==", "requires": { - "@types/prosemirror-gapcursor": "^1.0.3", + "@types/prosemirror-gapcursor": "^1.0.4", "prosemirror-gapcursor": "^1.1.5" } }, "@tiptap/extension-hard-break": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-2.0.0-beta.14.tgz", - "integrity": "sha512-PbGQJGvgYdsEzeHidlodVCaOkcPaib4A7i0MJlXIyzUnBz8Eiv5+Ks2UBG5JgfBB4GGopatZaLfz8VkG3qfGxw==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-2.0.0-beta.15.tgz", + "integrity": "sha512-MS7MjGOtKtC1bVNAShwCetFRuk8nPr/j18OOzKChNrJFrZXWNJrid3dUojwDLqCraYdzSTmiOmMgU+yoUe/gnw==", "requires": {} }, "@tiptap/extension-heading": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-2.0.0-beta.14.tgz", - "integrity": "sha512-ezJRM5ikZK5bmzYCsvq6xCw1KlellSwHcmAVJsupHk3aPD3UF2IEXnKQYbtDjGN62sB2KwnNy6gKFJ5v48gpxA==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-2.0.0-beta.15.tgz", + "integrity": "sha512-UoXDwEdCV9KiPh0wj0jj2Jt6VDqkoTaSU3d9bmEBLwg1Gjgbuv39JDst7oxSqbf9rgbl3txbeOy35wVBKe9CqA==", "requires": { "prosemirror-inputrules": "^1.1.3" } }, "@tiptap/extension-history": { - "version": "2.0.0-beta.13", - "resolved": "https://registry.npmjs.org/@tiptap/extension-history/-/extension-history-2.0.0-beta.13.tgz", - "integrity": "sha512-5btrwGkgdBXmSRCi7JLtigw5xC7VJQKljMomZjUR0yWV50EEHirCrKAAdjvZbfsFDP9eqO/WV9VxuI3tqqG+IQ==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-history/-/extension-history-2.0.0-beta.15.tgz", + "integrity": "sha512-6UtsNu9eTDnSTsAw1DdOoOh4rf6pL2sn0my93vkNLe7GUf5RbasPPhWX8Qe6JZMkbBTRPTzqfw92jPhJTchggQ==", "requires": { - "@types/prosemirror-history": "^1.0.2", + "@types/prosemirror-history": "^1.0.3", "prosemirror-history": "^1.1.3" } }, "@tiptap/extension-horizontal-rule": { - "version": "2.0.0-beta.17", - "resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-2.0.0-beta.17.tgz", - "integrity": "sha512-JDjwRSEWFTgdx0ob4zKjfzKcRxkiQTyPEGEZ2uIcTeXTPD0B0j2ysuWIWnqgwtpFdYfv1wOCU59kNLQx+a5JmA==", + "version": "2.0.0-beta.18", + "resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-2.0.0-beta.18.tgz", + "integrity": "sha512-drcPbveAwjj/Ci7glcP6bw5PjKOE6ADHBumwpS3pTLEvWbcF3o6XfRFLykZoGLsforv+/d2JMs7vKnLNbnUHSw==", "requires": { "prosemirror-state": "^1.3.4" } }, "@tiptap/extension-image": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-image/-/extension-image-2.0.0-beta.14.tgz", - "integrity": "sha512-OguktQVJ8D0wFm8jrnct16Pu+T5J0N+rzMNk5kguJJCMiFjhQZ4USZw5jHU6BIAKwulupXmZ/PUBIYCx02LhIA==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-image/-/extension-image-2.0.0-beta.15.tgz", + "integrity": "sha512-iMwQ154RPefOxgqTTHjOA735YWesyjBhYvD9fFxRDctM2vLxEYYYFOENXEBCFLNAr94gfaxefCEdkuNYHl9H7g==", "requires": {} }, "@tiptap/extension-italic": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-2.0.0-beta.14.tgz", - "integrity": "sha512-kDdHVHfHuQe3s0A+xrJm0OTE3MrCRWDFHiJ+rC5JnY3/b8GEzovOD6cslz6CeVSZAUDERmHKVPF+ioAct7HXtw==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-2.0.0-beta.15.tgz", + "integrity": "sha512-ZCz1vCysLdvOUrwODuyBP0BDaemCLh6ib7qTYoSDKdive9kfn0Vc5Fg3o8xgHrtrUfwKIJz/sWOknjDEGIc9cw==", "requires": {} }, "@tiptap/extension-list-item": { - "version": "2.0.0-beta.13", - "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-2.0.0-beta.13.tgz", - "integrity": "sha512-5nvrCvcV35J6WjLd8xQCQWnj2HIDsfTalr0D57jMwym3ZCIEvLwf23DQQ1nNsOHhopmS/Emixh+RQpXUZjH8lQ==", + "version": "2.0.0-beta.14", + "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-2.0.0-beta.14.tgz", + "integrity": "sha512-t6xwEqP+d5443Ul2Jvqz9kXb3ro7bA7yY9HA0vskm3120WxxHW9jxgxZN+82Ot5Tm7nXOAlsN6vuqnt4idnxZQ==", "requires": {} }, "@tiptap/extension-ordered-list": { - "version": "2.0.0-beta.14", - "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-2.0.0-beta.14.tgz", - "integrity": "sha512-7Tq8jotj7WSUIRlMhNWCv6u99Yu+lyuI8SLx7hRZbmUiGShCQX1J5YI+dti4qlrlhOjjqs1kV95Dgg0JaBtNQw==", + "version": "2.0.0-beta.15", + "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-2.0.0-beta.15.tgz", + "integrity": "sha512-j9Xh8CYtV+C/wrTXEWN+U7NJIQ/cQrjta80Mm2hFiE2KDtFNkpsPqG6UBoky04EPFphR5xDUsO1nCT7T7Tei5A==", "requires": { "prosemirror-inputrules": "^1.1.3" } }, "@tiptap/extension-paragraph": { - "version": "2.0.0-beta.15", - "resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-2.0.0-beta.15.tgz", - "integrity": "sha512-mYGjo85oyLVwgWc8+XZ0cvr5GSHSKvkj5t2t1PyHXDmt6Nhl5cJcHgXDztIUhyh0gbRVFKjwQMeUAZWg6DGxMg==", + "version": "2.0.0-beta.16", + "resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-2.0.0-beta.16.tgz", + "integrity": "sha512-Sj8TXrt9W3ZjK6TQYle9VDgV/bUVnQsXEA7+iQ/gtWST0F1UMFXIhi4hgd9n4gLUtsY/PsmYOEMMbTTAwlERgw==", "requires": {} }, "@tiptap/extension-strike": { - "version": "2.0.0-beta.16", - "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-2.0.0-beta.16.tgz", - "integrity": "sha512-SPSCUVzxFLKZzgMXYfeUZE+xy52CJckswo0dZ/8NcUthl3mkDS/TwzokpQ/wsyEsKaJNYt8vh2S9HpadSrLcug==", + "version": "2.0.0-beta.17", + "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-2.0.0-beta.17.tgz", + "integrity": "sha512-+WRd0RuCK4+jFKNVN+4rHTa5VMqqGDO2uc+TknkqhFqWp/z96OAGlpHJOwPrnW1fLbpjEBBQIr1vVYSw6KgcZg==", "requires": {} }, "@tiptap/extension-task-item": { - "version": "2.0.0-beta.16", - "resolved": "https://registry.npmjs.org/@tiptap/extension-task-item/-/extension-task-item-2.0.0-beta.16.tgz", - "integrity": "sha512-HIWIhM/egHNtydjc0z9ebGGeRt4g3EsYtEoAiFhJXgv5fQlm84Fn3dBFva3JuhwaH58TOikAiKGOEIrxZ4rgZA==", + "version": "2.0.0-beta.17", + "resolved": "https://registry.npmjs.org/@tiptap/extension-task-item/-/extension-task-item-2.0.0-beta.17.tgz", + "integrity": "sha512-uV5f9rWo9NAZ+oyt/mkhFEZfcngr92pVL2sn291RiT0qw9NRvdIQ6PLH24il9zu+jjeWmh1cJnBuQos+MQqjyg==", "requires": { "prosemirror-inputrules": "^1.1.3" } }, "@tiptap/extension-task-list": { - "version": "2.0.0-beta.16", - "resolved": "https://registry.npmjs.org/@tiptap/extension-task-list/-/extension-task-list-2.0.0-beta.16.tgz", - "integrity": "sha512-CxVrjdOAmEGIQjz5Jg46jNZUjLdll726ZCUyE1H9cW1e5bFRCWdjyPb5D3NFw2qJ7IBrf2utE7ESvKWJWws9nA==", + "version": "2.0.0-beta.17", + "resolved": "https://registry.npmjs.org/@tiptap/extension-task-list/-/extension-task-list-2.0.0-beta.17.tgz", + "integrity": "sha512-E17VBqW2lXF59hCQ/3/Kg0hYSDGvVC4B3W8miZwCXt5WTOl98Gk6qAiDXl+2mDKZvnsLty/YrgkD88OlZSIEbQ==", "requires": {} }, "@tiptap/extension-text": { - "version": "2.0.0-beta.12", - "resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-2.0.0-beta.12.tgz", - "integrity": "sha512-JEWLYOJKSpmpaI0YTzj30uodpsrSYDGSvy5dT5bYvWovIvLmggKPHl0iKIPDWAM5xfd07CkP2+BFFRblMh96IA==", + "version": "2.0.0-beta.13", + "resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-2.0.0-beta.13.tgz", + "integrity": "sha512-0EtAwuRldCAoFaL/iXgkRepEeOd55rPg5N4FQUN1xTwZT7PDofukP0DG/2jff/Uj17x4uTaJAa9qlFWuNnDvjw==", "requires": {} }, "@tiptap/extension-text-align": { - "version": "2.0.0-beta.20", - "resolved": "https://registry.npmjs.org/@tiptap/extension-text-align/-/extension-text-align-2.0.0-beta.20.tgz", - "integrity": "sha512-R06oz4xr6ULKkVA9MBwttR+72ostEnPDAeXfdf++/RxGwLLmM7TG2+ulMcfp4ICWe6H/zLwTAPpkaKeZSEwwrw==", + "version": "2.0.0-beta.22", + "resolved": "https://registry.npmjs.org/@tiptap/extension-text-align/-/extension-text-align-2.0.0-beta.22.tgz", + "integrity": "sha512-47jbI0DyiS+debUo0Wo2eexoRAdFZajw1+PJgpbtKLq5kWYqXeAvOyMkIIOFYHEl5u8pi4SsQd1NgEt21j0mig==", "requires": {} }, "@tiptap/extension-text-style": { @@ -1834,54 +1834,54 @@ "requires": {} }, "@tiptap/extension-typography": { - "version": "2.0.0-beta.12", - "resolved": "https://registry.npmjs.org/@tiptap/extension-typography/-/extension-typography-2.0.0-beta.12.tgz", - "integrity": "sha512-HFA3O3aDF6VgMAnwMBhRn4q34Wx9uquqc/MscagxPKtDy3e+3CPqp/0+TxvaUtgJhMv9amjjy40b1uw54jJstA==", + "version": "2.0.0-beta.13", + "resolved": "https://registry.npmjs.org/@tiptap/extension-typography/-/extension-typography-2.0.0-beta.13.tgz", + "integrity": "sha512-YBPYKqovj22yYRgHFa8qIUEdtJm/6GY9HnmUeNBdxwIi9ncA+aaXENpgyFDYKzF9C9bV+kWtIXGD7bkUtDuReg==", "requires": { "prosemirror-inputrules": "^1.1.3" } }, "@tiptap/extension-underline": { - "version": "2.0.0-beta.15", - "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-2.0.0-beta.15.tgz", - "integrity": "sha512-xrdNYXBuDaiKBByAuJ8Z9g+1w4I1pp8Id6ZbhxnljiTIwtX6SD/Pp4z/4dKhXNSpHvipyaFEXY0CVpxzbSEk5w==", + "version": "2.0.0-beta.16", + "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-2.0.0-beta.16.tgz", + "integrity": "sha512-N3wMfSJkn+A5HbuLSpbn1Zp9CWWLXfMexpVdg4eUwTMOgF/kpVRaPGCkBonhHH3NfWtT7QbSipdWc7DKpBb8Jw==", "requires": {} }, "@tiptap/starter-kit": { - "version": "2.0.0-beta.81", - "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-2.0.0-beta.81.tgz", - "integrity": "sha512-9AFZgJUOhJ0q16zW3q/r2w3tLwqlE/HssQUKEoHS1o4KJUTO/9SpqqJspKEddjeKL5TCzKvOdlBdWcXEZM6Pxw==", - "requires": { - "@tiptap/core": "^2.0.0-beta.85", - "@tiptap/extension-blockquote": "^2.0.0-beta.14", - "@tiptap/extension-bold": "^2.0.0-beta.14", - "@tiptap/extension-bullet-list": "^2.0.0-beta.14", - "@tiptap/extension-code": "^2.0.0-beta.14", - "@tiptap/extension-code-block": "^2.0.0-beta.16", - "@tiptap/extension-document": "^2.0.0-beta.12", - "@tiptap/extension-dropcursor": "^2.0.0-beta.16", - "@tiptap/extension-gapcursor": "^2.0.0-beta.17", - "@tiptap/extension-hard-break": "^2.0.0-beta.14", - "@tiptap/extension-heading": "^2.0.0-beta.14", - "@tiptap/extension-history": "^2.0.0-beta.13", - "@tiptap/extension-horizontal-rule": "^2.0.0-beta.17", - "@tiptap/extension-italic": "^2.0.0-beta.14", - "@tiptap/extension-list-item": "^2.0.0-beta.13", - "@tiptap/extension-ordered-list": "^2.0.0-beta.14", - "@tiptap/extension-paragraph": "^2.0.0-beta.15", - "@tiptap/extension-strike": "^2.0.0-beta.16", - "@tiptap/extension-text": "^2.0.0-beta.12" + "version": "2.0.0-beta.85", + "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-2.0.0-beta.85.tgz", + "integrity": "sha512-wlaCn4ol7rR/wOfFz8MHOeHrcXkYX3cq2LQl8l4JJgwcKiBZTfLSX2t8sy4eAufQlM74aNLwHn/3iuI7iw3k4w==", + "requires": { + "@tiptap/core": "^2.0.0-beta.89", + "@tiptap/extension-blockquote": "^2.0.0-beta.15", + "@tiptap/extension-bold": "^2.0.0-beta.15", + "@tiptap/extension-bullet-list": "^2.0.0-beta.15", + "@tiptap/extension-code": "^2.0.0-beta.15", + "@tiptap/extension-code-block": "^2.0.0-beta.17", + "@tiptap/extension-document": "^2.0.0-beta.13", + "@tiptap/extension-dropcursor": "^2.0.0-beta.18", + "@tiptap/extension-gapcursor": "^2.0.0-beta.19", + "@tiptap/extension-hard-break": "^2.0.0-beta.15", + "@tiptap/extension-heading": "^2.0.0-beta.15", + "@tiptap/extension-history": "^2.0.0-beta.15", + "@tiptap/extension-horizontal-rule": "^2.0.0-beta.18", + "@tiptap/extension-italic": "^2.0.0-beta.15", + "@tiptap/extension-list-item": "^2.0.0-beta.14", + "@tiptap/extension-ordered-list": "^2.0.0-beta.15", + "@tiptap/extension-paragraph": "^2.0.0-beta.16", + "@tiptap/extension-strike": "^2.0.0-beta.17", + "@tiptap/extension-text": "^2.0.0-beta.13" } }, "@tiptap/vue-3": { - "version": "2.0.0-beta.45", - "resolved": "https://registry.npmjs.org/@tiptap/vue-3/-/vue-3-2.0.0-beta.45.tgz", - "integrity": "sha512-DMBRvSZKcGMPQiJhtUvytaCjQqkvCx82DJgcm9FsrjWPjv8qUfkUxgaEYyLNWSx72otldQF/h7pLWv2Bkd1hSA==", + "version": "2.0.0-beta.47", + "resolved": "https://registry.npmjs.org/@tiptap/vue-3/-/vue-3-2.0.0-beta.47.tgz", + "integrity": "sha512-REi5+sJdHSfBFqAriof58rcwgAsDtsKGTC6dBAyvf0SNXV1OwS0ZnsjAhv4OcgoRhChDAD/Ux+mG6Lbg0b01bA==", "requires": { - "@tiptap/extension-bubble-menu": "^2.0.0-beta.24", - "@tiptap/extension-floating-menu": "^2.0.0-beta.18", + "@tiptap/extension-bubble-menu": "^2.0.0-beta.25", + "@tiptap/extension-floating-menu": "^2.0.0-beta.19", "prosemirror-state": "^1.3.4", - "prosemirror-view": "^1.18.8", + "prosemirror-view": "^1.18.11", "vue": "^3.0.0" } }, @@ -1907,26 +1907,26 @@ } }, "@types/prosemirror-dropcursor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/prosemirror-dropcursor/-/prosemirror-dropcursor-1.0.1.tgz", - "integrity": "sha512-nHokhFypOZjknolZBm2XShlR7fx1IUcCiA3S2fBwmAraWu6zv3gboDSwwFpoS9UB2xKc4ismAmBxh2bpL3YNkg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/prosemirror-dropcursor/-/prosemirror-dropcursor-1.0.2.tgz", + "integrity": "sha512-5Ez7yIAvHQgn5YJkuafEh0w4sHV7pksCX9LTPBFRjCuznamcKsnYCez4mR0PwIWq/WuPDvHkR+wqKb4l0t9/aQ==", "requires": { "@types/prosemirror-state": "*" } }, "@types/prosemirror-gapcursor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/prosemirror-gapcursor/-/prosemirror-gapcursor-1.0.3.tgz", - "integrity": "sha512-kBVjjbMmUk7ZsgpI1NOyY15makulu1skEGr+V9GgY7GQnT9vqjo8/XiNSgSj9s9vRTsTb/KAaTI9KJwWlhbhxQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/prosemirror-gapcursor/-/prosemirror-gapcursor-1.0.4.tgz", + "integrity": "sha512-9xKjFIG5947dzerFvkLWp6F53JwrUYoYwh3SgcTFEp8SbSfNNrez/PFYVZKPnoqPoaK5WtTdQTaMwpCV9rXQIg==", "requires": { "@types/prosemirror-model": "*", "@types/prosemirror-state": "*" } }, "@types/prosemirror-history": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/prosemirror-history/-/prosemirror-history-1.0.2.tgz", - "integrity": "sha512-AcfpWo+HkIuvq/H2zYjIMi2jxa2GWfYaTNiFTB2sigjkpWNM93CIlb7Cimy/4vNH8lVPp0GwLBjYIMRX6zOUyA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/prosemirror-history/-/prosemirror-history-1.0.3.tgz", + "integrity": "sha512-5TloMDRavgLjOAKXp1Li8u0xcsspzbT1Cm9F2pwHOkgvQOz1jWQb2VIXO7RVNsFjLBZdIXlyfSLivro3DuMWXg==", "requires": { "@types/prosemirror-model": "*", "@types/prosemirror-state": "*" @@ -1953,9 +1953,9 @@ } }, "@types/prosemirror-model": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@types/prosemirror-model/-/prosemirror-model-1.13.0.tgz", - "integrity": "sha512-EIUr2R38Zh9n1eA8BQ1C3NX/XLV9U44DhNVk8x3Sth2RW+wa7jNA82XHMPOoapsOTfmpnh32xaHBOzREiBqdPQ==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/@types/prosemirror-model/-/prosemirror-model-1.13.1.tgz", + "integrity": "sha512-tA1AlI+YR2t3Ve5eeQVJnQm4yV4wVlNfeogHusD1X3OEqqMYTuPssThgIMR4PxPHtvV871Ix8a20bUiJvULDgw==", "requires": { "@types/orderedmap": "*" } @@ -1971,9 +1971,9 @@ } }, "@types/prosemirror-state": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@types/prosemirror-state/-/prosemirror-state-1.2.6.tgz", - "integrity": "sha512-tJo0wC+/cQvbrPDVx01Fnng9Fs41bAMVxgJY1KLOyIsUPN0otUN1KdoQurLMmHNHTvIna9ZXxjZD//xJKLYfJw==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/prosemirror-state/-/prosemirror-state-1.2.7.tgz", + "integrity": "sha512-clJf5uw3/XQnBJtl2RqYXoLMGBySnLYl43xtDvFfQZKkLnnYcM1SDU8dcz7lWjl2Dm+H98RpLOl44pp7DYT+wA==", "requires": { "@types/prosemirror-model": "*", "@types/prosemirror-transform": "*", @@ -1981,17 +1981,17 @@ } }, "@types/prosemirror-transform": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@types/prosemirror-transform/-/prosemirror-transform-1.1.3.tgz", - "integrity": "sha512-qtnd4jMoBgUAF2Vy2uRCVY4/LN3d069PP9XTIKrfk7mwWPYKonBYv1NsaBGTpK26sOPu0p7eJNZwaiNYmbfIwA==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@types/prosemirror-transform/-/prosemirror-transform-1.1.4.tgz", + "integrity": "sha512-HP1PauvkqSgDquZut8HaLOTUDQ6jja/LAy4OA7tTS1XG7wqRnX3gLUyEj0mD6vFd4y8BPkNddNdOh/BeGHlUjg==", "requires": { "@types/prosemirror-model": "*" } }, "@types/prosemirror-view": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/@types/prosemirror-view/-/prosemirror-view-1.17.1.tgz", - "integrity": "sha512-PNiGGc6BffxHQzMR09UUilsBR8xFPDsKiPIXb4K/g56voPIvqq1pqySnWFfSR50Vo4ZL0tss3VBLWiiiKzVahQ==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/@types/prosemirror-view/-/prosemirror-view-1.18.0.tgz", + "integrity": "sha512-7NBy7qIV/ig49ThfkrIJrvW8E+HwumMgmpopUTYJlKwOh/fQ6SVUG/RtdnAIBLD+4uK0R2SMObbGZm06x6OwbA==", "requires": { "@types/prosemirror-model": "*", "@types/prosemirror-state": "*", @@ -1999,46 +1999,46 @@ } }, "@vitejs/plugin-vue": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.2.4.tgz", - "integrity": "sha512-D/3H9plevPQGgQGwmV6eecvOnooLTecPR63HPffVVWPEhbfvmtYLWgznzs456NBb2DItiRTCIa1yWxvGqC+I8A==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-1.3.0.tgz", + "integrity": "sha512-wJvuJdTBjvucUX0vK4fuy60t+A9bJSZxc59vp1Y+8kiOd0NU5kFt4lay72gMWPeR+lSUjrTmGUq8Uzb99Jbw3A==", "dev": true, "requires": {} }, "@vue/compiler-core": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.1.2.tgz", - "integrity": "sha512-nHmq7vLjq/XM2IMbZUcKWoH5sPXa2uR/nIKZtjbK5F3TcbnYE/zKsrSUR9WZJ03unlwotNBX1OyxVt9HbWD7/Q==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.1.5.tgz", + "integrity": "sha512-TXBhFinoBaXKDykJzY26UEuQU1K07FOp/0Ie+OXySqqk0bS0ZO7Xvl7UmiTUPYcLrWbxWBR7Bs/y55AI0MNc2Q==", "requires": { "@babel/parser": "^7.12.0", "@babel/types": "^7.12.0", - "@vue/shared": "3.1.2", + "@vue/shared": "3.1.5", "estree-walker": "^2.0.1", "source-map": "^0.6.1" } }, "@vue/compiler-dom": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.1.2.tgz", - "integrity": "sha512-k2+SWcWH0jL6WQAX7Or2ONqu5MbtTgTO0dJrvebQYzgqaKMXNI90RNeWeCxS4BnNFMDONpHBeFgbwbnDWIkmRg==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.1.5.tgz", + "integrity": "sha512-ZsL3jqJ52OjGU/YiT/9XiuZAmWClKInZM2aFJh9gnsAPqOrj2JIELMbkIFpVKR/CrVO/f2VxfPiiQdQTr65jcQ==", "requires": { - "@vue/compiler-core": "3.1.2", - "@vue/shared": "3.1.2" + "@vue/compiler-core": "3.1.5", + "@vue/shared": "3.1.5" } }, "@vue/compiler-sfc": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.1.2.tgz", - "integrity": "sha512-SeG/2+DvwejQ7oAiSx8BrDh5qOdqCYHGClPiTvVIHTfSIHiS2JjMbCANdDCjHkTOh/O7WZzo2JhdKm98bRBxTw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.1.5.tgz", + "integrity": "sha512-mtMY6xMvZeSRx9MTa1+NgJWndrkzVTdJ1pQAmAKQuxyb5LsHVvrgP7kcQFvxPHVpLVTORbTJWHaiqoKrJvi1iA==", "dev": true, "requires": { "@babel/parser": "^7.13.9", "@babel/types": "^7.13.0", "@types/estree": "^0.0.48", - "@vue/compiler-core": "3.1.2", - "@vue/compiler-dom": "3.1.2", - "@vue/compiler-ssr": "3.1.2", - "@vue/shared": "3.1.2", + "@vue/compiler-core": "3.1.5", + "@vue/compiler-dom": "3.1.5", + "@vue/compiler-ssr": "3.1.5", + "@vue/shared": "3.1.5", "consolidate": "^0.16.0", "estree-walker": "^2.0.1", "hash-sum": "^2.0.0", @@ -2052,46 +2052,46 @@ } }, "@vue/compiler-ssr": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.1.2.tgz", - "integrity": "sha512-BwXo9LFk5OSWdMyZQ4bX1ELHX0Z/9F+ld/OaVnpUPzAZCHslBYLvyKUVDwv2C/lpLjRffpC2DOUEdl1+RP1aGg==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.1.5.tgz", + "integrity": "sha512-CU5N7Di/a4lyJ18LGJxJYZS2a8PlLdWpWHX9p/XcsjT2TngMpj3QvHVRkuik2u8QrIDZ8OpYmTyj1WDNsOV+Dg==", "dev": true, "requires": { - "@vue/compiler-dom": "3.1.2", - "@vue/shared": "3.1.2" + "@vue/compiler-dom": "3.1.5", + "@vue/shared": "3.1.5" } }, "@vue/reactivity": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.1.2.tgz", - "integrity": "sha512-glJzJoN2xE7I2lRvwKM5u1BHRPTd1yc8iaf//Lai/78/uYAvE5DXp5HzWRFOwMlbRvMGJHIQjOqoxj87cDAaag==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.1.5.tgz", + "integrity": "sha512-1tdfLmNjWG6t/CsPldh+foumYFo3cpyCHgBYQ34ylaMsJ+SNHQ1kApMIa8jN+i593zQuaw3AdWH0nJTARzCFhg==", "requires": { - "@vue/shared": "3.1.2" + "@vue/shared": "3.1.5" } }, "@vue/runtime-core": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.1.2.tgz", - "integrity": "sha512-gsPZG4dRIkixuuKmoj4P9IHgfT0yaFLcqWOM5F/bCk0nxQn1XtxH8oUehWuET726KhbukvDoJfe9G2CKviy80w==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.1.5.tgz", + "integrity": "sha512-YQbG5cBktN1RowQDKA22itmvQ+b40f0WgQ6CXK4VYoYICAiAfu6Cc14777ve8zp1rJRGtk5oIeS149TOculrTg==", "requires": { - "@vue/reactivity": "3.1.2", - "@vue/shared": "3.1.2" + "@vue/reactivity": "3.1.5", + "@vue/shared": "3.1.5" } }, "@vue/runtime-dom": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.1.2.tgz", - "integrity": "sha512-QvINxjLucEZFzp5f0NVu7JqWYCv5TKQfkH2FDs/N6QNE4iKcYtKrWdT0HKfABnVXG28Znqv6rIH0dH4ZAOwxpA==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.1.5.tgz", + "integrity": "sha512-tNcf3JhVR0RfW0kw1p8xZgv30nvX8Y9rsz7eiQ0dHe273sfoCngAG0y4GvMaY4Xd8FsjUwFedd4suQ8Lu8meXg==", "requires": { - "@vue/runtime-core": "3.1.2", - "@vue/shared": "3.1.2", + "@vue/runtime-core": "3.1.5", + "@vue/shared": "3.1.5", "csstype": "^2.6.8" } }, "@vue/shared": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.1.2.tgz", - "integrity": "sha512-EmH/poaDWBPJaPILXNI/1fvUbArJQmmTyVCwvvyDYDFnkPoTclAbHRAtyIvqfez7jybTDn077HTNILpxlsoWhg==" + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.1.5.tgz", + "integrity": "sha512-oJ4F3TnvpXaQwZJNF3ZK+kLPHKarDmJjJ6jyzVNDKH9md1dptjC7lWR//jrGuLdek/U6iltWxqAnYOu8gCiOvA==" }, "anymatch": { "version": "3.1.2", @@ -2406,9 +2406,9 @@ "dev": true }, "postcss": { - "version": "8.3.5", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.5.tgz", - "integrity": "sha512-NxTuJocUhYGsMiMFHDUkmjSKT3EdH4/WbGF6GCi1NDGk+vbcUTun4fpbOqaPtD8IIsztA2ilZm2DhYCuyN58gA==", + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.6.tgz", + "integrity": "sha512-wG1cc/JhRgdqB6WHEuyLTedf3KIRuD0hG6ldkFEZNCjRxiC+3i6kkWUUbiJQayP28iwG35cEmAbe98585BYV0A==", "dev": true, "requires": { "colorette": "^1.2.2", @@ -2485,9 +2485,9 @@ "dev": true }, "prosemirror-commands": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.1.9.tgz", - "integrity": "sha512-zedlbQ+8QK0tIeibb6vbnAX5FO/S5x67xHgF57Fned+3G6RZY3JAGma9kC1jSCmLF/XC7MCZ90oekb0qo2b+Pw==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.1.10.tgz", + "integrity": "sha512-IWyBBXNAd44RM6NnBPljwq+/CM2oYCQJkF+YhKEAZNwzW0uFdGf4qComhjbKZzqFdu6Iub2ZhNsXgwPibA0lCQ==", "requires": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", @@ -2544,17 +2544,17 @@ } }, "prosemirror-model": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.14.2.tgz", - "integrity": "sha512-TwkACyEiSi8FJiRhg2ffbzmQRy5DR+aTwAr7trNQNZL24HJR8ouxy4qCkG99PnWK0xZ0AjSMtPXSU6hnxAiP7Q==", + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.14.3.tgz", + "integrity": "sha512-yzZlBaSxfUPIIP6U5Edh5zKxJPZ5f7bwZRhiCuH3UYkWhj+P3d8swHsbuAMOu/iDatDc5J/Qs5Mb3++mZf+CvQ==", "requires": { "orderedmap": "^1.1.0" } }, "prosemirror-schema-list": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.1.4.tgz", - "integrity": "sha512-pNTuZflacFOBlxrTcWSdWhjoB8BaucwfJVp/gJNxztOwaN3wQiC65axclXyplf6TKgXD/EkWfS/QAov3/Znadw==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.1.5.tgz", + "integrity": "sha512-9gadhga/wySVfb/iZ2vOpndbG0XroeLw0HkkZN5demNbOea6U5oQtJmvyYWC7ZVf3WkhmVdVsOXrllM9JcC20A==", "requires": { "prosemirror-model": "^1.0.0", "prosemirror-transform": "^1.0.0" @@ -2578,11 +2578,11 @@ } }, "prosemirror-view": { - "version": "1.18.8", - "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.18.8.tgz", - "integrity": "sha512-iLNonsRUM+ByIxJZP+tRuE8jUy56jfgf8oxnc4InWYTYdPibARs4FL6DQ6D56GdPMlXyTjXjSdfDp/x8mwHhtw==", + "version": "1.18.11", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.18.11.tgz", + "integrity": "sha512-KXUM8UEV+IK4JYWHNyxkPGDGbxeTEUHQv3POApfyTRN5eMcPFbY4cB0mDJr0LPelVvYPghmZDOCqfCIm9mYHtQ==", "requires": { - "prosemirror-model": "^1.1.0", + "prosemirror-model": "^1.14.3", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } @@ -2642,9 +2642,9 @@ "integrity": "sha512-ku6MFrwEVSVmXLvy3dYph3LAMNS0890K7fabn+0YIRQ2T96T9F4gkFf0vf0WW0JUraNWwGRtInEpH7yO4tbQZg==" }, "sass": { - "version": "1.35.1", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.35.1.tgz", - "integrity": "sha512-oCisuQJstxMcacOPmxLNiLlj4cUyN2+8xJnG7VanRoh2GOLr9RqkvI4AxA4a6LHVg/rsu+PmxXeGhrdSF9jCiQ==", + "version": "1.36.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.36.0.tgz", + "integrity": "sha512-fQzEjipfOv5kh930nu3Imzq3ie/sGDc/4KtQMJlt7RRdrkQSfe37Bwi/Rf/gfuYHsIuE1fIlDMvpyMcEwjnPvg==", "dev": true, "requires": { "chokidar": ">=3.0.0 <4.0.0" @@ -2712,26 +2712,26 @@ "dev": true }, "vite": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/vite/-/vite-2.3.8.tgz", - "integrity": "sha512-QiEx+iqNnJntSgSF2fWRQvRey9pORIrtNJzNyBJXwc+BdzWs83FQolX84cTBo393cfhObrtWa6180dAa4NLDiQ==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.4.4.tgz", + "integrity": "sha512-m1wK6pFJKmaYA6AeZIUXyiAgUAAJzVXhIMYCdZUpCaFMGps0v0IlNJtbmPvkUhVEyautalajmnW5X6NboUPsnw==", "dev": true, "requires": { "esbuild": "^0.12.8", "fsevents": "~2.3.2", - "postcss": "^8.3.4", + "postcss": "^8.3.6", "resolve": "^1.20.0", "rollup": "^2.38.5" } }, "vue": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.1.2.tgz", - "integrity": "sha512-q/rbKpb7aofax4ugqu2k/uj7BYuNPcd6Z5/qJtfkJQsE0NkwVoCyeSh7IZGH61hChwYn3CEkh4bHolvUPxlQ+w==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.1.5.tgz", + "integrity": "sha512-Ho7HNb1nfDoO+HVb6qYZgeaobt1XbY6KXFe4HGs1b9X6RhkWG/113n4/SrtM1LUclM6OrP/Se5aPHHvAPG1iVQ==", "requires": { - "@vue/compiler-dom": "3.1.2", - "@vue/runtime-dom": "3.1.2", - "@vue/shared": "3.1.2" + "@vue/compiler-dom": "3.1.5", + "@vue/runtime-dom": "3.1.5", + "@vue/shared": "3.1.5" } }, "w3c-keyname": { diff --git a/package.json b/package.json index 5231966..228b0a9 100644 --- a/package.json +++ b/package.json @@ -7,33 +7,33 @@ }, "dependencies": { "@tabler/icons": "^1.41.2", - "@tiptap/core": "^2.0.0-beta.85", - "@tiptap/extension-blockquote": "^2.0.0-beta.14", - "@tiptap/extension-bullet-list": "^2.0.0-beta.14", - "@tiptap/extension-character-count": "^2.0.0-beta.12", - "@tiptap/extension-code-block": "^2.0.0-beta.16", - "@tiptap/extension-document": "^2.0.0-beta.12", - "@tiptap/extension-heading": "^2.0.0-beta.14", - "@tiptap/extension-history": "^2.0.0-beta.13", - "@tiptap/extension-horizontal-rule": "^2.0.0-beta.17", - "@tiptap/extension-image": "^2.0.0-beta.14", - "@tiptap/extension-list-item": "^2.0.0-beta.13", - "@tiptap/extension-ordered-list": "^2.0.0-beta.14", - "@tiptap/extension-paragraph": "^2.0.0-beta.15", - "@tiptap/extension-task-item": "^2.0.0-beta.16", - "@tiptap/extension-task-list": "^2.0.0-beta.16", - "@tiptap/extension-text": "^2.0.0-beta.12", - "@tiptap/extension-text-align": "^2.0.0-beta.20", - "@tiptap/extension-typography": "^2.0.0-beta.12", - "@tiptap/extension-underline": "^2.0.0-beta.15", - "@tiptap/starter-kit": "^2.0.0-beta.81", - "@tiptap/vue-3": "^2.0.0-beta.45", + "@tiptap/core": "^2.0.0-beta.89", + "@tiptap/extension-blockquote": "^2.0.0-beta.15", + "@tiptap/extension-bullet-list": "^2.0.0-beta.15", + "@tiptap/extension-character-count": "^2.0.0-beta.13", + "@tiptap/extension-code-block": "^2.0.0-beta.17", + "@tiptap/extension-document": "^2.0.0-beta.13", + "@tiptap/extension-heading": "^2.0.0-beta.15", + "@tiptap/extension-history": "^2.0.0-beta.15", + "@tiptap/extension-horizontal-rule": "^2.0.0-beta.18", + "@tiptap/extension-image": "^2.0.0-beta.15", + "@tiptap/extension-list-item": "^2.0.0-beta.14", + "@tiptap/extension-ordered-list": "^2.0.0-beta.15", + "@tiptap/extension-paragraph": "^2.0.0-beta.16", + "@tiptap/extension-task-item": "^2.0.0-beta.17", + "@tiptap/extension-task-list": "^2.0.0-beta.17", + "@tiptap/extension-text": "^2.0.0-beta.13", + "@tiptap/extension-text-align": "^2.0.0-beta.22", + "@tiptap/extension-typography": "^2.0.0-beta.13", + "@tiptap/extension-underline": "^2.0.0-beta.16", + "@tiptap/starter-kit": "^2.0.0-beta.85", + "@tiptap/vue-3": "^2.0.0-beta.47", "vue": "^3.0.11" }, "devDependencies": { - "@vitejs/plugin-vue": "^1.2.4", - "@vue/compiler-sfc": "^3.1.2", - "sass": "^1.35.1", - "vite": "^2.3.8" + "@vitejs/plugin-vue": "^1.3.0", + "@vue/compiler-sfc": "^3.1.5", + "sass": "^1.36.0", + "vite": "^2.4.4" } }