@opengis/richtext 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,16 @@
1
- (function(g,ve){typeof exports=="object"&&typeof module<"u"?module.exports=ve(require("vue")):typeof define=="function"&&define.amd?define(["vue"],ve):(g=typeof globalThis<"u"?globalThis:g||self,g.richtext=ve(g.Vue))})(this,function(g){"use strict";function ve(t){this.content=t}ve.prototype={constructor:ve,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),s=r.content.slice();return o==-1?s.push(n||t,e):(s[o+1]=e,n&&(s[o]=n)),new ve(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new ve(n)},addToStart:function(t,e){return new ve([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new ve(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),s=r.find(t);return o.splice(s==-1?o.length:s,0,e,n),new ve(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=ve.from(t),t.size?new ve(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=ve.from(t),t.size?new ve(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=ve.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},ve.from=function(t){if(t instanceof ve)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new ve(e)};function fu(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),s=e.child(r);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){for(let i=0;o.text[i]==s.text[i];i++)n++;return n}if(o.content.size||s.content.size){let i=fu(o.content,s.content,n+1);if(i!=null)return i}n+=o.nodeSize}}function pu(t,e,n,r){for(let o=t.childCount,s=e.childCount;;){if(o==0||s==0)return o==s?null:{a:n,b:r};let i=t.child(--o),l=e.child(--s),a=i.nodeSize;if(i==l){n-=a,r-=a;continue}if(!i.sameMarkup(l))return{a:n,b:r};if(i.isText&&i.text!=l.text){let c=0,u=Math.min(i.text.length,l.text.length);for(;c<u&&i.text[i.text.length-c-1]==l.text[l.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(i.content.size||l.content.size){let c=pu(i.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}class M{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,s){for(let i=0,l=0;l<n;i++){let a=this.content[i],c=l+a.nodeSize;if(c>e&&r(a,o+l,s||null,i)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,o+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let s="",i=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(i?i=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)o.push(e.content[s]);return new M(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let s=0,i=0;i<n;s++){let l=this.content[s],a=i+l.nodeSize;a>e&&((i<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-i),Math.min(l.text.length,n-i)):l=l.cut(Math.max(0,e-i-1),Math.min(l.content.size,n-i-1))),r.push(l),o+=l.nodeSize),i=a}return new M(r,o)}cutByIndex(e,n){return e==n?M.empty:e==0&&n==this.content.length?this:new M(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new M(o,s)}addToStart(e){return new M([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new M(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return fu(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return pu(this,e,n,r)}findIndex(e,n=-1){if(e==0)return fs(0,e);if(e==this.size)return fs(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let s=this.child(r),i=o+s.nodeSize;if(i>=e)return i==e||n>0?fs(r+1,i):fs(r,o);o=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return M.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new M(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return M.empty;let n,r=0;for(let o=0;o<e.length;o++){let s=e[o];r+=s.nodeSize,o&&s.isText&&e[o-1].sameMarkup(s)?(n||(n=e.slice(0,o)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new M(n||e,r)}static from(e){if(!e)return M.empty;if(e instanceof M)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new M([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}M.empty=new M([],0);const dl={index:0,offset:0};function fs(t,e){return dl.index=t,dl.offset=e,dl}function ps(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!ps(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ps(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ce=class cu{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let s=e[o];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,o));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ps(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return cu.none;if(e instanceof cu)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};ce.none=[];class hs extends Error{}class D{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=mu(this.content,e+this.openStart,n);return r&&new D(r,this.openStart,this.openEnd)}removeBetween(e,n){return new D(hu(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return D.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new D(M.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new D(e,r,o)}}D.empty=new D(M.empty,0,0);function hu(t,e,n){let{index:r,offset:o}=t.findIndex(e),s=t.maybeChild(r),{index:i,offset:l}=t.findIndex(n);if(o==e||s.isText){if(l!=n&&!t.child(i).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=i)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(hu(s.content,e-o-1,n-o-1)))}function mu(t,e,n,r){let{index:o,offset:s}=t.findIndex(e),i=t.maybeChild(o);if(s==e||i.isText)return t.cut(0,e).append(n).append(t.cut(e));let l=mu(i.content,e-s-1,n);return l&&t.replaceChild(o,i.copy(l))}function Vg(t,e,n){if(n.openStart>t.depth)throw new hs("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new hs("Inconsistent open depths");return gu(t,e,n,0)}function gu(t,e,n,r){let o=t.index(r),s=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let i=gu(t,e,n,r+1);return s.copy(s.content.replaceChild(o,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let i=t.parent,l=i.content;return tr(i,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:i,end:l}=Hg(n,t);return tr(s,bu(t,i,l,e,r))}else return tr(s,ms(t,e,r))}function yu(t,e){if(!e.type.compatibleContent(t.type))throw new hs("Cannot join "+e.type.name+" onto "+t.type.name)}function fl(t,e,n){let r=t.node(n);return yu(r,e.node(n)),r}function er(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function co(t,e,n,r){let o=(e||t).node(n),s=0,i=e?e.index(n):o.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(er(t.nodeAfter,r),s++));for(let l=s;l<i;l++)er(o.child(l),r);e&&e.depth==n&&e.textOffset&&er(e.nodeBefore,r)}function tr(t,e){return t.type.checkContent(e),t.copy(e)}function bu(t,e,n,r,o){let s=t.depth>o&&fl(t,e,o+1),i=r.depth>o&&fl(n,r,o+1),l=[];return co(null,t,o,l),s&&i&&e.index(o)==n.index(o)?(yu(s,i),er(tr(s,bu(t,e,n,r,o+1)),l)):(s&&er(tr(s,ms(t,e,o+1)),l),co(e,n,o,l),i&&er(tr(i,ms(n,r,o+1)),l)),co(r,null,o,l),new M(l)}function ms(t,e,n){let r=[];if(co(null,t,n,r),t.depth>n){let o=fl(t,e,n+1);er(tr(o,ms(t,e,n+1)),r)}return co(e,null,n,r),new M(r)}function Hg(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)o=e.node(s).copy(M.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class uo{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)o+=r.child(s).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ce.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let l=r;r=o,o=l}let s=r.marks;for(var i=0;i<s.length;i++)s[i].type.spec.inclusive===!1&&(!o||!s[i].isInSet(o.marks))&&(s=s[i--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!o||!r[s].isInSet(o.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new gs(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,s=n;for(let i=e;;){let{index:l,offset:a}=i.content.findIndex(s),c=s-a;if(r.push(i,l,o+a),!c||(i=i.child(l),i.isText))break;s=c-1,o+=a+1}return new uo(n,r,s)}static resolveCached(e,n){let r=Eu.get(e);if(r)for(let s=0;s<r.elts.length;s++){let i=r.elts[s];if(i.pos==n)return i}else Eu.set(e,r=new Ug);let o=r.elts[r.i]=uo.resolve(e,n);return r.i=(r.i+1)%zg,o}}class Ug{constructor(){this.elts=[],this.i=0}}const zg=12,Eu=new WeakMap;class gs{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const jg=Object.create(null);let On=class uu{constructor(e,n,r,o=ce.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||M.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&ps(this.attrs,n||e.defaultAttrs||jg)&&ce.sameSet(this.marks,r||ce.none)}copy(e=null){return e==this.content?this:new uu(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new uu(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return D.empty;let o=this.resolve(e),s=this.resolve(n),i=r?0:o.sharedDepth(n),l=o.start(i),c=o.node(i).content.cut(o.pos-l,s.pos-l);return new D(c,o.depth-i,s.depth-i)}replace(e,n,r){return Vg(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return uo.resolveCached(this,e)}resolveNoCache(e){return uo.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),wu(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=M.empty,o=0,s=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,o,s),l=i&&i.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=o;a<s;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let s=this.contentMatchAt(e).matchType(r),i=s&&s.matchFragment(this.content,n);return i?i.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ce.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ce.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=M.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,o,r);return s.type.checkAttrs(s.attrs),s}};On.prototype.text=void 0;class ys extends On{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):wu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ys(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ys(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function wu(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class nr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Wg(e,n);if(r.next==null)return nr.empty;let o=ku(r);r.next&&r.err("Unexpected trailing text");let s=Qg(Xg(o));return Zg(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let s=n;o&&s<r;s++)o=o.matchType(e.child(s).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function s(i,l){let a=i.matchFragment(e,r);if(a&&(!n||a.validEnd))return M.from(l.map(c=>c.createAndFill()));for(let c=0;c<i.next.length;c++){let{type:u,next:d}=i.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let f=s(d,l.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),s=o.match;if(s.matchType(e)){let i=[];for(let l=o;l.type;l=l.via)i.push(l.type);return i.reverse()}for(let i=0;i<s.next.length;i++){let{type:l,next:a}=s.next[i];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!o.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:o}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let s=o+(r.validEnd?"*":" ")+" ";for(let i=0;i<r.next.length;i++)s+=(i?", ":"")+r.next[i].type.name+"->"+e.indexOf(r.next[i].next);return s}).join(`
2
- `)}}nr.empty=new nr(!0);class Wg{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function ku(t){let e=[];do e.push(Kg(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Kg(t){let e=[];do e.push(qg(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function qg(t){let e=Yg(t);for(;;)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("{"))e=Jg(t,e);else break;return e}function Cu(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Jg(t,e){let n=Cu(t),r=n;return t.eat(",")&&(t.next!="}"?r=Cu(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function Gg(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let s in n){let i=n[s];i.isInGroup(e)&&o.push(i)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function Yg(t){if(t.eat("(")){let e=ku(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=Gg(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Xg(t){let e=[[]];return o(s(t,0),n()),e;function n(){return e.push([])-1}function r(i,l,a){let c={term:a,to:l};return e[i].push(c),c}function o(i,l){i.forEach(a=>a.to=l)}function s(i,l){if(i.type=="choice")return i.exprs.reduce((a,c)=>a.concat(s(c,l)),[]);if(i.type=="seq")for(let a=0;;a++){let c=s(i.exprs[a],l);if(a==i.exprs.length-1)return c;o(c,l=n())}else if(i.type=="star"){let a=n();return r(l,a),o(s(i.expr,a),a),[r(a)]}else if(i.type=="plus"){let a=n();return o(s(i.expr,l),a),o(s(i.expr,a),a),[r(a)]}else{if(i.type=="opt")return[r(l)].concat(s(i.expr,l));if(i.type=="range"){let a=l;for(let c=0;c<i.min;c++){let u=n();o(s(i.expr,a),u),a=u}if(i.max==-1)o(s(i.expr,a),a);else for(let c=i.min;c<i.max;c++){let u=n();r(a,u),o(s(i.expr,a),u),a=u}return[r(a)]}else{if(i.type=="name")return[r(l,void 0,i.value)];throw new Error("Unknown expr type")}}}}function Su(t,e){return e-t}function vu(t,e){let n=[];return r(e),n.sort(Su);function r(o){let s=t[o];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(o);for(let i=0;i<s.length;i++){let{term:l,to:a}=s[i];!l&&n.indexOf(a)==-1&&r(a)}}}function Qg(t){let e=Object.create(null);return n(vu(t,0));function n(r){let o=[];r.forEach(i=>{t[i].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<o.length;u++)o[u][0]==l&&(c=o[u][1]);vu(t,a).forEach(u=>{c||o.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new nr(r.indexOf(t.length-1)>-1);for(let i=0;i<o.length;i++){let l=o[i][1].sort(Su);s.next.push({type:o[i][0],next:e[l.join(",")]||n(l)})}return s}}function Zg(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],s=!o.validEnd,i=[];for(let l=0;l<o.next.length;l++){let{type:a,next:c}=o.next[l];i.push(a.name),s&&!(a.isText||a.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function xu(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Tu(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let s=t[r];if(s.hasDefault)o=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function Ou(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let s=t[o];s.validate&&s.validate(e[o])}}function Nu(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new ty(t,r,e[r]);return n}let Au=class Bg{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Nu(e,r.attrs),this.defaultAttrs=xu(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==nr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Tu(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new On(this,this.computeAttrs(e),M.from(n),ce.setFrom(r))}createChecked(e=null,n,r){return n=M.from(n),this.checkContent(n),new On(this,this.computeAttrs(e),n,ce.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=M.from(n),n.size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(M.empty,!0);return s?new On(this,e,n.append(s),ce.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Ou(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:ce.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,i)=>r[s]=new Bg(s,n,i));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function ey(t,e,n){let r=n.split("|");return o=>{let s=o===null?"null":typeof o;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class ty{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?ey(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class bs{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=Nu(e,o.attrs),this.excluded=null;let s=xu(this.attrs);this.instance=s?new ce(this,s):null}create(e=null){return!e&&this.instance?this.instance:new ce(this,Tu(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((s,i)=>r[s]=new bs(s,o++,n,i)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Ou(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class _u{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=ve.from(e.nodes),n.marks=ve.from(e.marks||{}),this.nodes=Au.compile(this.spec.nodes,this),this.marks=bs.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],i=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=r[i]||(r[i]=nr.parse(i,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?Mu(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],i=s.spec.excludes;s.excluded=i==null?[s]:i==""?[]:Mu(this,i.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Au){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new ys(r,r.defaultAttrs,e,ce.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return On.fromJSON(this,e)}markFromJSON(e){return ce.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Mu(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],s=t.marks[o],i=s;if(s)n.push(s);else for(let l in t.marks){let a=t.marks[l];(o=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(o)>-1)&&n.push(i=a)}if(!i)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function ny(t){return t.tag!=null}function ry(t){return t.style!=null}let Ar=class du{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(ny(o))this.tags.push(o);else if(ry(o)){let s=/[^=]*/.exec(o.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=e.nodes[o.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new Du(this,n,!1);return r.addAll(e,ce.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Du(this,n,!0);return r.addAll(e,ce.none,n.from,n.to),D.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let s=this.tags[o];if(iy(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let i=s.getAttrs(e);if(i===!1)continue;s.attrs=i||void 0}return s}}}matchStyle(e,n,r,o){for(let s=o?this.styles.indexOf(o)+1:0;s<this.styles.length;s++){let i=this.styles[s],l=i.style;if(!(l.indexOf(e)!=0||i.context&&!r.matchesContext(i.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(i.getAttrs){let a=i.getAttrs(n);if(a===!1)continue;i.attrs=a||void 0}return i}}}static schemaRules(e){let n=[];function r(o){let s=o.priority==null?50:o.priority,i=0;for(;i<n.length;i++){let l=n[i];if((l.priority==null?50:l.priority)<s)break}n.splice(i,0,o)}for(let o in e.marks){let s=e.marks[o].spec.parseDOM;s&&s.forEach(i=>{r(i=Pu(i)),i.mark||i.ignore||i.clearMark||(i.mark=o)})}for(let o in e.nodes){let s=e.nodes[o].spec.parseDOM;s&&s.forEach(i=>{r(i=Pu(i)),i.node||i.ignore||i.mark||(i.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new du(e,du.schemaRules(e)))}};const Ru={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},oy={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Lu={ol:!0,ul:!0},fo=1,pl=2,po=4;function Iu(t,e,n){return e!=null?(e?fo:0)|(e==="full"?pl:0):t&&t.whitespace=="pre"?fo|pl:n&~po}class Es{constructor(e,n,r,o,s,i){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=i,this.content=[],this.activeMarks=ce.none,this.match=s||(i&po?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(M.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&fo)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=M.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(M.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ru.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Du{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,i=Iu(null,n.preserveWhitespace,0)|(r?po:0);o?s=new Es(o.type,o.attrs,ce.none,!0,n.topMatch||o.type.contentMatch,i):r?s=new Es(null,null,ce.none,!0,null,i):s=new Es(e.schema.topNodeType,null,ce.none,!0,null,i),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,s=o.options&pl?"full":this.localPreserveWS||(o.options&fo)>0;if(s==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)s!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
3
- `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let i=o.content[o.content.length-1],l=e.previousSibling;(!i||l&&l.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),l;Lu.hasOwnProperty(i)&&this.parser.normalizeLists&&sy(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:oy.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,n);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(Ru.hasOwnProperty(i))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=a&&a.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(s),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
- `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let s=this.parser.matchedStyles[o],i=r.getPropertyValue(s);if(i)for(let l=void 0;;){let a=this.parser.matchStyle(s,i,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(c=>!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,o){let s,i;if(n.node)if(i=this.parser.schema.nodes[n.node],i.isLeaf)this.insertNode(i.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(i,n.attrs||null,r,n.preserveWhitespace);a&&(s=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(i&&i.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}s&&this.sync(l)&&this.open--}addAll(e,n,r,o){let s=r||0;for(let i=r?e.childNodes[r]:e.firstChild,l=o==null?null:e.childNodes[o];i!=l;i=i.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(i,n);this.findAtPoint(e,s)}findPlace(e,n,r){let o,s;for(let i=this.open,l=0;i>=0;i--){let a=this.nodes[i],c=a.findWrapping(e);if(c&&(!o||o.length>c.length+l)&&(o=c,s=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!o)return null;this.sync(s);for(let i=0;i<o.length;i++)n=this.enterInner(o[i],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let i=ce.none;for(let l of o.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):Bu(l.type,e.type))&&(i=l.addToSet(i));return s.content.push(e.mark(i)),!0}return!1}enter(e,n,r,o){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,o)),s}enterInner(e,n,r,o=!1,s){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let l=Iu(e,s,i.options);i.options&po&&i.content.length==0&&(l|=po);let a=ce.none;return r=r.filter(c=>(i.type?i.type.allowsMarkType(c.type):Bu(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Es(e,n,a,o,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=fo)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(o?0:1),i=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(i(l-1,a))return!0;return!1}else{let u=a>0||a==0&&o?this.nodes[a].type:r&&a>=s?r.node(a-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return i(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function sy(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Lu.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function iy(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Pu(t){let e={};for(let n in t)e[n]=t[n];return e}function Bu(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let s=[],i=l=>{s.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||s.indexOf(u)<0&&i(u))return!0}};if(i(o.contentMatch))return!0}}class rr{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=hl(n).createDocumentFragment());let o=r,s=[];return e.forEach(i=>{if(s.length||i.marks.length){let l=0,a=0;for(;l<s.length&&a<i.marks.length;){let c=i.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(s[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<s.length;)o=s.pop()[1];for(;a<i.marks.length;){let c=i.marks[a++],u=this.serializeMark(c,i.isInline,n);u&&(s.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(i,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=ws(hl(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let s=this.serializeMark(e.marks[o],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&ws(hl(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return ws(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new rr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Fu(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Fu(e.marks)}}function Fu(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function hl(t){return t.document||window.document}const $u=new WeakMap;function ly(t){let e=$u.get(t);return e===void 0&&$u.set(t,e=ay(t)),e}function ay(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function ws(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],s;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=ly(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let l,a=n?t.createElementNS(n,o):t.createElement(o),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:p,contentDOM:h}=ws(t,f,n,r);if(a.appendChild(p),h){if(l)throw new RangeError("Multiple content holes");l=h}}}return{dom:a,contentDOM:l}}const Vu=65535,Hu=Math.pow(2,16);function cy(t,e){return t+e*Hu}function Uu(t){return t&Vu}function uy(t){return(t-(t&Vu))/Hu}const zu=1,ju=2,ks=4,Wu=8;class ml{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Wu)>0}get deletedBefore(){return(this.delInfo&(zu|ks))>0}get deletedAfter(){return(this.delInfo&(ju|ks))>0}get deletedAcross(){return(this.delInfo&ks)>0}}class ht{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&ht.empty)return ht.empty}recover(e){let n=0,r=Uu(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+uy(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,s=this.inverted?2:1,i=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?o:0);if(a>e)break;let c=this.ranges[l+s],u=this.ranges[l+i],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:n:n,p=a+o+(f<0?0:u);if(r)return p;let h=e==(n<0?a:d)?null:cy(l/3,e-a),m=e==a?ju:e==d?zu:ks;return(n<0?e!=a:e!=d)&&(m|=Wu),new ml(p,m,h)}o+=u-c}return r?e+o:new ml(e+o,0,null)}touches(e,n){let r=0,o=Uu(n),s=this.inverted?2:1,i=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+s],u=a+c;if(e<=u&&l==o*3)return!0;r+=this.ranges[l+i]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,s=0;o<this.ranges.length;o+=3){let i=this.ranges[o],l=i-(this.inverted?s:0),a=i+(this.inverted?0:s),c=this.ranges[o+n],u=this.ranges[o+r];e(l,l+c,a,a+u),s+=u-c}}invert(){return new ht(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ht.empty:new ht(e<0?[0,-e,0]:[0,0,e])}}ht.empty=new ht([]);class ho{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new ho(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new ho;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let s=this.from;s<this.to;s++){let i=this._maps[s],l=i.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(s);if(a!=null&&a>s&&a<this.to){s=a,e=this._maps[a].recover(l.recover);continue}}o|=l.delInfo,e=l.pos}return r?e:new ml(e,o,null)}}const gl=Object.create(null);class Ue{getMap(){return ht.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=gl[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in gl)throw new RangeError("Duplicate use of step JSON ID "+e);return gl[e]=n,n.prototype.jsonID=e,n}}class Ne{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Ne(e,null)}static fail(e){return new Ne(null,e)}static fromReplace(e,n,r,o){try{return Ne.ok(e.replace(n,r,o))}catch(s){if(s instanceof hs)return Ne.fail(s.message);throw s}}}function yl(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let s=t.child(o);s.content.size&&(s=s.copy(yl(s.content,e,s))),s.isInline&&(s=e(s,n,o)),r.push(s)}return M.fromArray(r)}class Nn extends Ue{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),s=new D(yl(n.content,(i,l)=>!i.isAtom||!l.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),o),n.openStart,n.openEnd);return Ne.fromReplace(e,this.from,this.to,s)}invert(){return new Wt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Nn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Nn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Nn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Nn(n.from,n.to,e.markFromJSON(n.mark))}}Ue.jsonID("addMark",Nn);class Wt extends Ue{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new D(yl(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return Ne.fromReplace(e,this.from,this.to,r)}invert(){return new Nn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Wt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Wt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Wt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Wt(n.from,n.to,e.markFromJSON(n.mark))}}Ue.jsonID("removeMark",Wt);class An extends Ue{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ne.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ne.fromReplace(e,this.pos,this.pos+1,new D(M.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new An(this.pos,n.marks[o]);return new An(this.pos,this.mark)}}return new or(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new An(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new An(n.pos,e.markFromJSON(n.mark))}}Ue.jsonID("addNodeMark",An);class or extends Ue{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ne.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ne.fromReplace(e,this.pos,this.pos+1,new D(M.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new An(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new or(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new or(n.pos,e.markFromJSON(n.mark))}}Ue.jsonID("removeNodeMark",or);class Le extends Ue{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&bl(e,this.from,this.to)?Ne.fail("Structure replace would overwrite content"):Ne.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ht([this.from,this.to-this.from,this.slice.size])}invert(e){return new Le(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Le(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Le)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?D.empty:new D(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Le(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?D.empty:new D(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Le(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Le(n.from,n.to,D.fromJSON(e,n.slice),!!n.structure)}}Ue.jsonID("replace",Le);class Ie extends Ue{constructor(e,n,r,o,s,i,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=s,this.insert=i,this.structure=l}apply(e){if(this.structure&&(bl(e,this.from,this.gapFrom)||bl(e,this.gapTo,this.to)))return Ne.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ne.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ne.fromReplace(e,this.from,this.to,r):Ne.fail("Content does not fit in gap")}getMap(){return new ht([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ie(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||s>r.pos?null:new Ie(n.pos,r.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ie(n.from,n.to,n.gapFrom,n.gapTo,D.fromJSON(e,n.slice),n.insert,!!n.structure)}}Ue.jsonID("replaceAround",Ie);function bl(t,e,n){let r=t.resolve(e),o=n-e,s=r.depth;for(;o>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,o--;if(o>0){let i=r.node(s).maybeChild(r.indexAfter(s));for(;o>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,o--}}return!1}function dy(t,e,n,r){let o=[],s=[],i,l;t.doc.nodesBetween(e,n,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+a.nodeSize,n),h=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(h)||(i&&i.to==f&&i.mark.eq(d[m])?i.to=p:o.push(i=new Wt(f,p,d[m])));l&&l.to==f?l.to=p:s.push(l=new Nn(f,p,r))}}),o.forEach(a=>t.step(a)),s.forEach(a=>t.step(a))}function fy(t,e,n,r){let o=[],s=0;t.doc.nodesBetween(e,n,(i,l)=>{if(!i.isInline)return;s++;let a=null;if(r instanceof bs){let c=i.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(i.marks)&&(a=[r]):a=i.marks;if(a&&a.length){let c=Math.min(l+i.nodeSize,n);for(let u=0;u<a.length;u++){let d=a[u],f;for(let p=0;p<o.length;p++){let h=o[p];h.step==s-1&&d.eq(o[p].style)&&(f=h)}f?(f.to=c,f.step=s):o.push({style:d,from:Math.max(l,e),to:c,step:s})}}}),o.forEach(i=>t.step(new Wt(i.from,i.to,i.style)))}function El(t,e,n,r=n.contentMatch,o=!0){let s=t.doc.nodeAt(e),i=[],l=e+1;for(let a=0;a<s.childCount;a++){let c=s.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)i.push(new Le(l,u,D.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new Wt(l,u,c.marks[f]));if(o&&c.isText&&n.whitespace!="pre"){let f,p=/\r?\n|\r/g,h;for(;f=p.exec(c.text);)h||(h=new D(M.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),i.push(new Le(l+f.index,l+f.index+f[0].length,h))}}l=u}if(!r.validEnd){let a=r.fillBefore(M.empty,!0);t.replace(l,l,new D(a,0,0))}for(let a=i.length-1;a>=0;a--)t.step(i[a])}function py(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function _r(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),s=t.$from.index(r),i=t.$to.indexAfter(r);if(r<t.depth&&o.canReplace(s,i,n))return r;if(r==0||o.type.spec.isolating||!py(o,s,i))break}return null}function hy(t,e,n){let{$from:r,$to:o,depth:s}=e,i=r.before(s+1),l=o.after(s+1),a=i,c=l,u=M.empty,d=0;for(let h=s,m=!1;h>n;h--)m||r.index(h)>0?(m=!0,u=M.from(r.node(h).copy(u)),d++):a--;let f=M.empty,p=0;for(let h=s,m=!1;h>n;h--)m||o.after(h+1)<o.end(h)?(m=!0,f=M.from(o.node(h).copy(f)),p++):c++;t.step(new Ie(a,c,i,l,new D(u.append(f),d,p),u.size-d,!0))}function wl(t,e,n=null,r=t){let o=my(t,e),s=o&&gy(r,e);return s?o.map(Ku).concat({type:e,attrs:n}).concat(s.map(Ku)):null}function Ku(t){return{type:t,attrs:null}}function my(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let i=s.length?s[0]:e;return n.canReplaceWith(r,o,i)?s:null}function gy(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.child(r),i=e.contentMatch.findWrapping(s.type);if(!i)return null;let a=(i.length?i[i.length-1]:e).contentMatch;for(let c=r;a&&c<o;c++)a=a.matchType(n.child(c).type);return!a||!a.validEnd?null:i}function yy(t,e,n){let r=M.empty;for(let i=n.length-1;i>=0;i--){if(r.size){let l=n[i].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=M.from(n[i].type.create(n[i].attrs,r))}let o=e.start,s=e.end;t.step(new Ie(o,s,o,s,new D(r,0,0),n.length,!0))}function by(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(i,l)=>{let a=typeof o=="function"?o(i):o;if(i.isTextblock&&!i.hasMarkup(r,a)&&Ey(t.doc,t.mapping.slice(s).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!h?c=!1:!p&&h&&(c=!0)}c===!1&&Ju(t,i,l,s),El(t,t.mapping.slice(s).map(l,1),r,void 0,c===null);let u=t.mapping.slice(s),d=u.map(l,1),f=u.map(l+i.nodeSize,1);return t.step(new Ie(d,f,d+1,f-1,new D(M.from(r.create(a,null,i.marks)),0,0),1,!0)),c===!0&&qu(t,i,l,s),!1}})}function qu(t,e,n,r){e.forEach((o,s)=>{if(o.isText){let i,l=/\r?\n|\r/g;for(;i=l.exec(o.text);){let a=t.mapping.slice(r).map(n+1+s+i.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Ju(t,e,n,r){e.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let i=t.mapping.slice(r).map(n+1+s);t.replaceWith(i,i+1,e.type.schema.text(`
5
- `))}})}function Ey(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function wy(t,e,n,r,o){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let i=n.create(r,null,o||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,i);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ie(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new D(M.from(i),0,0),1,!0))}function un(t,e,n=1,r){let o=t.resolve(e),s=o.depth-n,i=r&&r[r.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!i.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>s;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=r&&r[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let l=o.indexAfter(s),a=r&&r[0];return o.node(s).canReplaceWith(l,l,a?a.type:o.node(s+1).type)}function ky(t,e,n=1,r){let o=t.doc.resolve(e),s=M.empty,i=M.empty;for(let l=o.depth,a=o.depth-n,c=n-1;l>a;l--,c--){s=M.from(o.node(l).copy(s));let u=r&&r[c];i=M.from(u?u.type.create(u.attrs,i):o.node(l).copy(i))}t.step(new Le(e,e,new D(s.append(i),n,n),!0))}function _n(t,e){let n=t.resolve(e),r=n.index();return Gu(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Cy(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let s=e.child(o),i=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(i),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function Gu(t,e){return!!(t&&e&&!t.isLeaf&&Cy(t,e))}function Cs(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let s,i,l=r.index(o);if(o==r.depth?(s=r.nodeBefore,i=r.nodeAfter):n>0?(s=r.node(o+1),l++,i=r.node(o).maybeChild(l)):(s=r.node(o).maybeChild(l-1),i=r.node(o+1)),s&&!s.isTextblock&&Gu(s,i)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function Sy(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,s=t.doc.resolve(e-n),i=s.node().type;if(o&&i.inlineContent){let u=i.whitespace=="pre",d=!!i.contentMatch.matchType(o);u&&!d?r=!1:!u&&d&&(r=!0)}let l=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);Ju(t,u.node(),u.before(),l)}i.inlineContent&&El(t,e+n-1,i,s.node().contentMatchAt(s.index()),r==null);let a=t.mapping.slice(l),c=a.map(e-n);if(t.step(new Le(c,a.map(e+n,-1),D.empty,!0)),r===!0){let u=t.doc.resolve(c);qu(t,u.node(),u.before(),t.steps.length)}return t}function vy(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let s=r.index(o);if(r.node(o).canReplaceWith(s,s,n))return r.before(o+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let s=r.indexAfter(o);if(r.node(o).canReplaceWith(s,s,n))return r.after(o+1);if(s<r.node(o).childCount)return null}return null}function xy(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let s=0;s<n.openStart;s++)o=o.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let i=r.depth;i>=0;i--){let l=i==r.depth?0:r.pos<=(r.start(i+1)+r.end(i+1))/2?-1:1,a=r.index(i)+(l>0?1:0),c=r.node(i),u=!1;if(s==1)u=c.canReplace(a,a,o);else{let d=c.contentMatchAt(a).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(i+1):r.after(i+1)}return null}function Ss(t,e,n=e,r=D.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),s=t.resolve(n);return Yu(o,s,r)?new Le(e,n,r):new Ty(o,s,r).fit()}function Yu(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class Ty{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=M.empty;for(let o=0;o<=e.depth;o++){let s=e.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=M.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let 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;let s=this.placed,i=r.depth,l=o.depth;for(;i&&l&&s.childCount==1;)s=s.firstChild.content,i--,l--;let a=new D(s,i,l);return e>-1?new Ie(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new Le(r.pos,o.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(o=0),s.type.spec.isolating&&o<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,s=null;r?(s=kl(this.unplaced.content,r-1).firstChild,o=s.content):o=this.unplaced.content;let i=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(n==1&&(i?c.matchType(i.type)||(d=c.fillBefore(M.from(i),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:l,parent:s,inject:d};if(n==2&&i&&(u=c.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:l,parent:s,wrap:u};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=kl(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new D(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=kl(e,n);if(o.childCount<=1&&n>0){let s=e.size-n<=n+o.size;this.unplaced=new D(mo(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new D(mo(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let m=0;m<s.length;m++)this.openFrontierNode(s[m]);let i=this.unplaced,l=r?r.content:i.content,a=i.openStart-e,c=0,u=[],{match:d,type:f}=this.frontier[n];if(o){for(let m=0;m<o.childCount;m++)u.push(o.child(m));d=d.matchFragment(o)}let p=l.size+e-(i.content.size-i.openEnd);for(;c<l.childCount;){let m=l.child(c),y=d.matchType(m.type);if(!y)break;c++,(c>1||a==0||m.content.size)&&(d=y,u.push(Xu(m.mark(f.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?p:-1)))}let h=c==l.childCount;h||(p=-1),this.placed=go(this.placed,n,M.from(u)),this.frontier[n].match=d,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,y=l;m<p;m++){let b=y.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),y=b.content}this.unplaced=h?e==0?D.empty:new D(mo(i.content,e-1,1),e-1,p<0?i.openEnd:e-1):new D(mo(i.content,e,c),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Cl(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),i=Cl(e,n,o,r,s);if(i){for(let l=n-1;l>=0;l--){let{match:a,type:c}=this.frontier[l],u=Cl(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:n,fit:i,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=go(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),s=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,s)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=go(this.placed,this.depth,M.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(M.empty,!0);n.childCount&&(this.placed=go(this.placed,this.frontier.length,n))}}function mo(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(mo(t.firstChild.content,e-1,n)))}function go(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(go(t.lastChild.content,e-1,n)))}function kl(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Xu(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Xu(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(M.empty,!0)))),t.copy(r)}function Cl(t,e,n,r,o){let s=t.node(e),i=o?t.indexAfter(e):t.index(e);if(i==s.childCount&&!n.compatibleContent(s.type))return null;let l=r.fillBefore(s.content,!0,i);return l&&!Oy(n,s.content,i)?l:null}function Oy(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function Ny(t){return t.spec.defining||t.spec.definingForContent}function Ay(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(Yu(o,s,r))return t.step(new Le(e,n,r));let i=Zu(o,t.doc.resolve(n));i[i.length-1]==0&&i.pop();let l=-(o.depth+1);i.unshift(l);for(let f=o.depth,p=o.pos-1;f>0;f--,p--){let h=o.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;i.indexOf(f)>-1?l=f:o.before(f)==p&&i.splice(1,0,-f)}let a=i.indexOf(l),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==r.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=Ny(p.type);if(h&&!p.sameMarkup(o.node(Math.abs(l)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),h=c[p];if(h)for(let m=0;m<i.length;m++){let y=i[(m+a)%i.length],b=!0;y<0&&(b=!1,y=-y);let w=o.node(y-1),k=o.index(y-1);if(w.canReplaceWith(k,k,h.type,h.marks))return t.replace(o.before(y),b?s.after(y):n,new D(Qu(r.content,0,r.openStart,p),p,r.openEnd))}}let d=t.steps.length;for(let f=i.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let p=i[f];p<0||(e=o.before(p),n=s.after(p))}}function Qu(t,e,n,r,o){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(Qu(s.content,e+1,n,r,s)))}if(e>r){let s=o.contentMatchAt(0),i=s.fillBefore(t).append(t);t=i.append(s.matchFragment(i).fillBefore(M.empty,!0))}return t}function _y(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=vy(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new D(M.from(r),0,0))}function My(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),s=Zu(r,o);for(let i=0;i<s.length;i++){let l=s[i],a=i==s.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),o.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),o.indexAfter(l-1))))return t.delete(r.before(l),o.after(l))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(e-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i&&r.start(i-1)==o.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),o.index(i-1)))return t.delete(r.before(i),n);t.delete(e,n)}function Zu(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let s=t.start(o);if(s<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(s==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==s-1)&&n.push(o)}return n}class Mr extends Ue{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ne.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return Ne.fromReplace(e,this.pos,this.pos+1,new D(M.from(o),0,n.isLeaf?0:1))}getMap(){return ht.empty}invert(e){return new Mr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Mr(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Mr(n.pos,n.attr,n.value)}}Ue.jsonID("attr",Mr);class yo extends Ue{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Ne.ok(r)}getMap(){return ht.empty}invert(e){return new yo(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new yo(n.attr,n.value)}}Ue.jsonID("docAttr",yo);let Rr=class extends Error{};Rr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},Rr.prototype=Object.create(Error.prototype),Rr.prototype.constructor=Rr,Rr.prototype.name="TransformError";class Sl{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ho}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Rr(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=D.empty){let o=Ss(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new D(M.from(r),0,0))}delete(e,n){return this.replace(e,n,D.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Ay(this,e,n,r),this}replaceRangeWith(e,n,r){return _y(this,e,n,r),this}deleteRange(e,n){return My(this,e,n),this}lift(e,n){return hy(this,e,n),this}join(e,n=1){return Sy(this,e,n),this}wrap(e,n){return yy(this,e,n),this}setBlockType(e,n=e,r,o=null){return by(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return wy(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Mr(e,n,r)),this}setDocAttribute(e,n){return this.step(new yo(e,n)),this}addNodeMark(e,n){return this.step(new An(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof ce)n.isInSet(r.marks)&&this.step(new or(e,n));else{let o=r.marks,s,i=[];for(;s=n.isInSet(o);)i.push(new or(e,s)),o=s.removeFromSet(o);for(let l=i.length-1;l>=0;l--)this.step(i[l])}return this}split(e,n=1,r){return ky(this,e,n,r),this}addMark(e,n,r){return dy(this,e,n,r),this}removeMark(e,n,r){return fy(this,e,n,r),this}clearIncompatible(e,n,r){return El(this,e,n,r),this}}const vl=Object.create(null);class z{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new ed(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=D.empty){let r=n.content.lastChild,o=null;for(let l=0;l<n.openEnd;l++)o=r,r=r.lastChild;let s=e.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){let{$from:a,$to:c}=i[l],u=e.mapping.slice(s);e.replaceRange(u.map(a.pos),u.map(c.pos),l?D.empty:n),l==0&&rd(e,s,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:i,$to:l}=o[s],a=e.mapping.slice(r),c=a.map(i.pos),u=a.map(l.pos);s?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),rd(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new j(e):Lr(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let s=e.depth-1;s>=0;s--){let i=n<0?Lr(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Lr(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(i)return i}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new kt(e.node(0))}static atStart(e){return Lr(e,e,0,0,1)||new kt(e)}static atEnd(e){return Lr(e,e,e.content.size,e.childCount,-1)||new kt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=vl[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in vl)throw new RangeError("Duplicate use of selection JSON ID "+e);return vl[e]=n,n.prototype.jsonID=e,n}getBookmark(){return j.between(this.$anchor,this.$head).getBookmark()}}z.prototype.visible=!0;class ed{constructor(e,n){this.$from=e,this.$to=n}}let td=!1;function nd(t){!td&&!t.parent.inlineContent&&(td=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class j extends z{constructor(e,n=e){nd(e),nd(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return z.near(r);let o=e.resolve(n.map(this.anchor));return new j(o.parent.inlineContent?o:r,r)}replace(e,n=D.empty){if(super.replace(e,n),n==D.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof j&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new vs(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new j(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let s=z.findFrom(n,r,!0)||z.findFrom(n,-r,!0);if(s)n=s.$head;else return z.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(z.findFrom(e,-r,!0)||z.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new j(e,n)}}z.jsonID("text",j);class vs{constructor(e,n){this.anchor=e,this.head=n}map(e){return new vs(e.map(this.anchor),e.map(this.head))}resolve(e){return j.between(e.resolve(this.anchor),e.resolve(this.head))}}class U extends z{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),s=e.resolve(o);return r?z.near(s):new U(s)}content(){return new D(M.from(this.node),0,0)}eq(e){return e instanceof U&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new xl(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new U(e.resolve(n.anchor))}static create(e,n){return new U(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}U.prototype.visible=!1,z.jsonID("node",U);class xl{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new vs(r,r):new xl(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&U.isSelectable(r)?new U(n):z.near(n)}}class kt extends z{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=D.empty){if(n==D.empty){e.delete(0,e.doc.content.size);let r=z.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new kt(e)}map(e){return new kt(e)}eq(e){return e instanceof kt}getBookmark(){return Ry}}z.jsonID("all",kt);const Ry={map(){return this},resolve(t){return new kt(t)}};function Lr(t,e,n,r,o,s=!1){if(e.inlineContent)return j.create(t,n);for(let i=r-(o>0?0:1);o>0?i<e.childCount:i>=0;i+=o){let l=e.child(i);if(l.isAtom){if(!s&&U.isSelectable(l))return U.create(t,n-(o<0?l.nodeSize:0))}else{let a=Lr(t,l,n+o,o<0?l.childCount:0,o,s);if(a)return a}n+=l.nodeSize*o}return null}function rd(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof Le||o instanceof Ie))return;let s=t.mapping.maps[r],i;s.forEach((l,a,c,u)=>{i==null&&(i=u)}),t.setSelection(z.near(t.doc.resolve(i),n))}const od=1,xs=2,sd=4;class Ly extends Sl{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|od)&~xs,this.storedMarks=null,this}get selectionSet(){return(this.updated&od)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=xs,this}ensureMarks(e){return ce.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&xs)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~xs,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ce.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let i=this.doc.resolve(n);s=r==n?i.marks():i.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,s)),this.selection.empty||this.setSelection(z.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=sd,this}get scrolledIntoView(){return(this.updated&sd)>0}}function id(t,e){return!e||!t?t:t.bind(e)}class bo{constructor(e,n,r){this.name=e,this.init=id(n.init,r),this.apply=id(n.apply,r)}}const Iy=[new bo("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new bo("selection",{init(t,e){return t.selection||z.atStart(e.doc)},apply(t){return t.selection}}),new bo("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new bo("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Tl{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Iy.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new bo(r.key,r.spec.state,r))})}}class Ir{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let s=!1;for(let i=0;i<this.config.plugins.length;i++){let l=this.config.plugins[i];if(l.spec.appendTransaction){let a=o?o[i].n:0,c=o?o[i].state:this,u=a<n.length&&l.spec.appendTransaction.call(l,a?n.slice(a):n,c,r);if(u&&r.filterTransaction(u,i)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<i?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),s=!0}o&&(o[i]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ir(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let s=r[o];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new Ly(this)}static create(e){let n=new Tl(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Ir(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new Tl(this.schema,e.plugins),r=n.fields,o=new Ir(n);for(let s=0;s<r.length;s++){let i=r[s].name;o[i]=this.hasOwnProperty(i)?this[i]:r[s].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],s=o.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new Tl(e.schema,e.plugins),s=new Ir(o);return o.fields.forEach(i=>{if(i.name=="doc")s.doc=On.fromJSON(e.schema,n.doc);else if(i.name=="selection")s.selection=z.fromJSON(s.doc,n.selection);else if(i.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==i.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[i.name]=c.fromJSON.call(a,e,n[l],s);return}}s[i.name]=i.init(e,s)}}),s}}function ld(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=ld(o,e,{})),n[r]=o}return n}class Ae{constructor(e){this.spec=e,this.props={},e.props&&ld(e.props,this,this.props),this.key=e.key?e.key.key:ad("plugin")}getState(e){return e[this.key]}}const Ol=Object.create(null);function ad(t){return t in Ol?t+"$"+ ++Ol[t]:(Ol[t]=0,t+"$")}class De{constructor(e="key"){this.key=ad(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Ve=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Dr=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Nl=null;const dn=function(t,e,n){let r=Nl||(Nl=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Dy=function(){Nl=null},sr=function(t,e,n,r){return n&&(cd(t,e,n,r,-1)||cd(t,e,n,r,1))},Py=/^(img|br|input|textarea|hr)$/i;function cd(t,e,n,r,o){for(var s;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Ct(t))){let i=t.parentNode;if(!i||i.nodeType!=1||Eo(t)||Py.test(t.nodeName)||t.contentEditable=="false")return!1;e=Ve(t)+(o<0?0:1),t=i}else if(t.nodeType==1){let i=t.childNodes[e+(o<0?-1:0)];if(i.nodeType==1&&i.contentEditable=="false")if(!((s=i.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=o;else return!1;else t=i,e=o<0?Ct(t):0}else return!1}}function Ct(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function By(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Ct(t)}else if(t.parentNode&&!Eo(t))e=Ve(t),t=t.parentNode;else return null}}function Fy(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Eo(t))e=Ve(t)+1,t=t.parentNode;else return null}}function $y(t,e,n){for(let r=e==0,o=e==Ct(t);r||o;){if(t==n)return!0;let s=Ve(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,o=o&&s==Ct(t)}}function Eo(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Ts=function(t){return t.focusNode&&sr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ir(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Vy(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Hy(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Ct(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Ct(r.startContainer),r.startOffset)}}}const Kt=typeof navigator<"u"?navigator:null,ud=typeof document<"u"?document:null,Mn=Kt&&Kt.userAgent||"",Al=/Edge\/(\d+)/.exec(Mn),dd=/MSIE \d/.exec(Mn),_l=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Mn),rt=!!(dd||_l||Al),Rn=dd?document.documentMode:_l?+_l[1]:Al?+Al[1]:0,Pt=!rt&&/gecko\/(\d+)/i.test(Mn);Pt&&+(/Firefox\/(\d+)/.exec(Mn)||[0,0])[1];const Ml=!rt&&/Chrome\/(\d+)/.exec(Mn),ze=!!Ml,fd=Ml?+Ml[1]:0,Ge=!rt&&!!Kt&&/Apple Computer/.test(Kt.vendor),Pr=Ge&&(/Mobile\/\w+/.test(Mn)||!!Kt&&Kt.maxTouchPoints>2),St=Pr||(Kt?/Mac/.test(Kt.platform):!1),Uy=Kt?/Win/.test(Kt.platform):!1,fn=/Android \d/.test(Mn),wo=!!ud&&"webkitFontSmoothing"in ud.documentElement.style,zy=wo?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function jy(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function pn(t,e){return typeof t=="number"?t:t[e]}function Wy(t){let 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 pd(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let i=n||t.dom;i;){if(i.nodeType!=1){i=Dr(i);continue}let l=i,a=l==s.body,c=a?jy(s):Wy(l),u=0,d=0;if(e.top<c.top+pn(r,"top")?d=-(c.top-e.top+pn(o,"top")):e.bottom>c.bottom-pn(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+pn(o,"top")-c.top:e.bottom-c.bottom+pn(o,"bottom")),e.left<c.left+pn(r,"left")?u=-(c.left-e.left+pn(o,"left")):e.right>c.right-pn(r,"right")&&(u=e.right-c.right+pn(o,"right")),u||d)if(a)s.defaultView.scrollBy(u,d);else{let p=l.scrollLeft,h=l.scrollTop;d&&(l.scrollTop+=d),u&&(l.scrollLeft+=u);let m=l.scrollLeft-p,y=l.scrollTop-h;e={left:e.left-m,top:e.top-y,right:e.right-m,bottom:e.bottom-y}}let f=a?"fixed":getComputedStyle(i).position;if(/^(fixed|sticky)$/.test(f))break;i=f=="absolute"?i.offsetParent:Dr(i)}}function Ky(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let s=(e.left+e.right)/2,i=n+1;i<Math.min(innerHeight,e.bottom);i+=5){let l=t.root.elementFromPoint(s,i);if(!l||l==t.dom||!t.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=n-20){r=l,o=a.top;break}}return{refDOM:r,refTop:o,stack:hd(t.dom)}}function hd(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Dr(r));return e}function qy({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;md(n,r==0?0:r-e)}function md(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:s}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let Br=null;function Jy(t){if(t.setActive)return t.setActive();if(Br)return t.focus(Br);let e=hd(t);t.focus(Br==null?{get preventScroll(){return Br={preventScroll:!0},!0}}:void 0),Br||(Br=!1,md(e,0))}function gd(t,e){let n,r=2e8,o,s=0,i=e.top,l=e.top,a,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=dn(u).getClientRects();else continue;for(let p=0;p<f.length;p++){let h=f[p];if(h.top<=i&&h.bottom>=l){i=Math.max(h.bottom,i),l=Math.min(h.top,l);let m=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(m<r){n=u,r=m,o=m&&n.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,u.nodeType==1&&m&&(s=d+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!a&&h.left<=e.left&&h.right>=e.left&&(a=u,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(s=d+1)}}return!n&&a&&(n=a,o=c,r=0),n&&n.nodeType==3?Gy(n,o):!n||r&&n.nodeType==1?{node:t,offset:s}:gd(n,o)}function Gy(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let s=Ln(r,1);if(s.top!=s.bottom&&Rl(e,s))return{node:t,offset:o+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function Rl(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Yy(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function Xy(t,e,n){let{node:r,offset:o}=gd(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let i=r.getBoundingClientRect();s=i.left!=i.right&&n.left>(i.left+i.right)/2?1:-1}return t.docView.posFromDOM(r,o,s)}function Qy(t,e,n,r){let o=-1;for(let s=e,i=!1;s!=t.dom;){let l=t.docView.nearestDesc(s,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&(!i&&a.left>r.left||a.top>r.top?o=l.posBefore:(!i&&a.right<r.left||a.bottom<r.top)&&(o=l.posAfter),i=!0),!l.contentDOM&&o<0&&!l.node.isText))return(l.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?l.posBefore:l.posAfter;s=l.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function yd(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=o;;){let i=t.childNodes[s];if(i.nodeType==1){let l=i.getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if(Rl(e,c))return yd(i,e,c)}}if((s=(s+1)%r)==o)break}return t}function Zy(t,e){let n=t.dom.ownerDocument,r,o=0,s=Hy(n,e.left,e.top);s&&({node:r,offset:o}=s);let i=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!i||!t.dom.contains(i.nodeType!=1?i.parentNode:i)){let c=t.dom.getBoundingClientRect();if(!Rl(e,c)||(i=yd(t.dom,e,c),!i))return null}if(Ge)for(let c=i;r&&c;c=Dr(c))c.draggable&&(r=void 0);if(i=Yy(i,e),r){if(Pt&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&o++}let c;wo&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(l=Qy(t,r,o,e))}l==null&&(l=Xy(t,i,e));let a=t.docView.nearestDesc(i,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function bd(t){return t.top<t.bottom||t.left<t.right}function Ln(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(bd(r))return r}return Array.prototype.find.call(n,bd)||t.getBoundingClientRect()}const e0=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ed(t,e,n){let{node:r,offset:o,atom:s}=t.docView.domFromPos(e,n<0?-1:1),i=wo||Pt;if(r.nodeType==3)if(i&&(e0.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let a=Ln(dn(r,o,o),n);if(Pt&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=Ln(dn(r,o-1,o-1),-1);if(c.top==a.top){let u=Ln(dn(r,o,o+1),-1);if(u.top!=a.top)return ko(u,u.left<c.left)}}return a}else{let a=o,c=o,u=n<0?1:-1;return n<0&&!o?(c++,u=-1):n>=0&&o==r.nodeValue.length?(a--,u=1):n<0?a--:c++,ko(Ln(dn(r,a,c),u),u<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&o&&(n<0||o==Ct(r))){let a=r.childNodes[o-1];if(a.nodeType==1)return Ll(a.getBoundingClientRect(),!1)}if(s==null&&o<Ct(r)){let a=r.childNodes[o];if(a.nodeType==1)return Ll(a.getBoundingClientRect(),!0)}return Ll(r.getBoundingClientRect(),n>=0)}if(s==null&&o&&(n<0||o==Ct(r))){let a=r.childNodes[o-1],c=a.nodeType==3?dn(a,Ct(a)-(i?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return ko(Ln(c,1),!1)}if(s==null&&o<Ct(r)){let a=r.childNodes[o];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let c=a?a.nodeType==3?dn(a,0,i?0:1):a.nodeType==1?a:null:null;if(c)return ko(Ln(c,-1),!0)}return ko(Ln(r.nodeType==3?dn(r):r,-n),n>=0)}function ko(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ll(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function wd(t,e,n){let 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()}}function t0(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return wd(t,e,()=>{let{node:s}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let i=Ed(t,o.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=dn(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<a.length;c++){let u=a[c];if(u.bottom>u.top+1&&(n=="up"?i.top-u.top>(u.bottom-i.top)*2:u.bottom-i.bottom>(i.bottom-u.top)*2))return!1}}return!0})}const n0=/[\u0590-\u08ac]/;function r0(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,s=!o,i=o==r.parent.content.size,l=t.domSelection();return l?!n0.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?s:i:wd(t,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:m}=t.domSelectionRange(),y=h&&!p.contains(h.nodeType==1?h:h.parentNode)||a==h&&c==m;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),y}):r.pos==r.start()||r.pos==r.end()}let kd=null,Cd=null,Sd=!1;function o0(t,e,n){return kd==e&&Cd==n?Sd:(kd=e,Cd=n,Sd=n=="up"||n=="down"?t0(t,e,n):r0(t,e,n))}const vt=0,vd=1,lr=2,qt=3;class Co{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=vt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,i;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(i)+i.size:this.posAtStart}else{let s,i;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(i):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>Ve(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!1;break}if(s.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!0;break}if(s.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let s=this.getDesc(o),i;if(s&&(!n||s.node))if(r&&(i=s.nodeDOM)&&!(i.nodeType==1?i.contains(e.nodeType==1?e:e.parentNode):i==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let s=this.getDesc(o);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],s=r+o.size;if(r==e&&s!=r){for(;!o.border&&o.children.length;)for(let i=0;i<o.children.length;i++){let l=o.children[i];if(l.size){o=l;break}}return o}if(e<s)return o.descAt(e-r-o.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let s=0;r<this.children.length;r++){let i=this.children[r],l=s+i.size;if(l>e||i instanceof Od){o=e-s;break}s=l}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof xd&&s.side>=0;r--);if(n<=0){let s,i=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,i=!1);return s&&n&&i&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?Ve(s.dom)+1:0}}else{let s,i=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,i=!1);return s&&i&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?Ve(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,s=-1;for(let i=r,l=0;;l++){let a=this.children[l],c=i+a.size;if(o==-1&&e<=c){let u=i+a.border;if(e>=u&&n<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,u);e=i;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=Ve(f.dom)+1;break}e-=f.size}o==-1&&(o=0)}if(o>-1&&(c>n||l==this.children.length-1)){n=c;for(let u=l+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){s=Ve(d.dom);break}n+=d.size}s==-1&&(s=this.contentDOM.childNodes.length);break}i=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let s=Math.min(e,n),i=Math.max(e,n);for(let p=0,h=0;p<this.children.length;p++){let m=this.children[p],y=h+m.size;if(s>h&&i<y)return m.setSelection(e-h-m.border,n-h-m.border,r,o);h=y}let l=this.domFromPos(e,e?-1:1),a=n==e?l:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),d=!1;if((Pt||Ge)&&e==n){let{node:p,offset:h}=l;if(p.nodeType==3){if(d=!!(h&&p.nodeValue[h-1]==`
6
- `),d&&h==p.nodeValue.length)for(let m=p,y;m;m=m.parentNode){if(y=m.nextSibling){y.nodeName=="BR"&&(l=a={node:y.parentNode,offset:Ve(y)+1});break}let b=m.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let m=p.childNodes[h-1];d=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(Pt&&u.focusNode&&u.focusNode!=a.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(o=!0)}if(!(o||d&&Ge)&&sr(l.node,l.offset,u.anchorNode,u.anchorOffset)&&sr(a.node,a.offset,u.focusNode,u.focusOffset))return;let f=!1;if((c.extend||e==n)&&!d){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>n){let h=l;l=a,a=h}let p=document.createRange();p.setEnd(a.node,a.offset),p.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let s=this.children[o],i=r+s.size;if(r==i?e<=i&&n>=r:e<i&&n>r){let l=r+s.border,a=i-s.border;if(e>=l&&n<=a){this.dirty=e==r||n==i?lr:vd,e==l&&n==a&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=qt:s.markDirty(e-l,n-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?lr:qt}r=i}this.dirty=lr}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?lr:vd;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class xd extends Co{constructor(e,n,r,o){let s,i=n.type.toDOM;if(typeof i=="function"&&(i=i(r,()=>{if(!s)return o;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(i.nodeType!=1){let l=document.createElement("span");l.appendChild(i),i=l}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==vt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class s0 extends Co{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class ar extends Co{constructor(e,n,r,o,s){super(e,[],r,o),this.mark=n,this.spec=s}static create(e,n,r,o){let s=o.nodeViews[n.type.name],i=s&&s(n,o,r);return(!i||!i.dom)&&(i=rr.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ar(e,n,i.dom,i.contentDOM||i.dom,i)}parseRule(){return this.dirty&qt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=qt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=vt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=vt}}slice(e,n,r){let o=ar.create(this.parent,this.mark,!0,r),s=this.children,i=this.size;n<i&&(s=Dl(s,n,i,r)),e>0&&(s=Dl(s,0,e,r));for(let l=0;l<s.length;l++)s[l].parent=o;return o.children=s,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class In extends Co{constructor(e,n,r,o,s,i,l,a,c){super(e,[],s,i),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=l}static create(e,n,r,o,s,i){let l=s.nodeViews[n.type.name],a,c=l&&l(n,s,()=>{if(!a)return i;if(a.parent)return a.parent.posBeforeChild(a)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=rr.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=_d(u,r,n),c?a=new i0(e,n,r,o,u,d||null,f,c,s,i+1):n.isText?new Os(e,n,r,o,u,f,s):new In(e,n,r,o,u,d||null,f,s,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>M.empty)}return e}matchesNode(e,n,r){return this.dirty==vt&&e.eq(this.node)&&Ns(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,s=e.composing?this.localCompositionInfo(e,n):null,i=s&&s.pos>-1?s:null,l=s&&s.pos<0,a=new a0(this,i&&i.node,e);d0(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&a.syncToMarks(u==this.node.childCount?ce.none:this.node.child(u).marks,r,e),a.placeWidget(c,e,o)},(c,u,d,f)=>{a.syncToMarks(c.marks,r,e);let p;a.findNodeMatch(c,u,d,f)||l&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(p=a.findIndexWithChild(s.node))>-1&&a.updateNodeAt(c,u,d,p,e)||a.updateNextNode(c,u,d,e,f,o)||a.addNode(c,u,d,e,o),o+=c.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==lr)&&(i&&this.protectLocalComposition(e,i),Nd(this.contentDOM,this.children,e),Pr&&f0(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof j)||r<n||o>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let i=s.nodeValue,l=p0(this.node.content,i,r-n,o-n);return l<0?null:{node:s,pos:l,text:i}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let i=new s0(this,s,n,o);e.input.compositionNodes.push(i),this.children=Dl(this.children,r,r+o.length,e,i)}update(e,n,r,o){return this.dirty==qt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=vt}updateOuterDeco(e){if(Ns(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Ad(this.dom,this.nodeDOM,Il(this.outerDeco,this.node,n),Il(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Td(t,e,n,r,o){_d(r,e,t);let s=new In(void 0,t,e,n,r,r,r,o,0);return s.contentDOM&&s.updateChildren(o,0),s}class Os extends In{constructor(e,n,r,o,s,i,l){super(e,n,r,o,s,null,i,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==qt||this.dirty!=vt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=vt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=vt,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),s=document.createTextNode(o.text);return new Os(this.parent,o,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=qt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Od extends Co{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==vt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class i0 extends In{constructor(e,n,r,o,s,i,l,a,c,u){super(e,n,r,o,s,i,l,c,u),this.spec=a}update(e,n,r,o){if(this.dirty==qt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,o),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Nd(t,e,n){let r=t.firstChild,o=!1;for(let s=0;s<e.length;s++){let i=e[s],l=i.dom;if(l.parentNode==t){for(;l!=r;)r=Md(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(l,r);if(i instanceof ar){let a=r?r.previousSibling:t.lastChild;Nd(i.contentDOM,i.children,n),r=a?a.nextSibling:t.firstChild}}for(;r;)r=Md(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const So=function(t){t&&(this.nodeName=t)};So.prototype=Object.create(null);const cr=[new So];function Il(t,e,n){if(t.length==0)return cr;let r=n?cr[0]:new So,o=[r];for(let s=0;s<t.length;s++){let i=t[s].type.attrs;if(i){i.nodeName&&o.push(r=new So(i.nodeName));for(let l in i){let a=i[l];a!=null&&(n&&o.length==1&&o.push(r=new So(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+a:l=="style"?r.style=(r.style?r.style+";":"")+a:l!="nodeName"&&(r[l]=a))}}}return o}function Ad(t,e,n,r){if(n==cr&&r==cr)return e;let o=e;for(let s=0;s<r.length;s++){let i=r[s],l=n[s];if(s){let a;l&&l.nodeName==i.nodeName&&o!=t&&(a=o.parentNode)&&a.nodeName.toLowerCase()==i.nodeName||(a=document.createElement(i.nodeName),a.pmIsDeco=!0,a.appendChild(o),l=cr[0]),o=a}l0(o,l||cr[0],i)}return o}function l0(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)o.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<o.length;s++)r.indexOf(o[s])==-1&&t.classList.add(o[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function _d(t,e,n){return Ad(t,t,cr,Il(e,n,t.nodeType!=1))}function Ns(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Md(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class a0{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=c0(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,s=this.stack.length>>1,i=Math.min(s,e.length);for(;o<i&&(o==s-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<s;)this.destroyRest(),this.top.dirty=vt,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let a=this.index;a<Math.min(this.index+3,this.top.children.length);a++){let c=this.top.children[a];if(c.matchesMark(e[s])&&!this.isLocked(c.dom)){l=a;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=ar.create(this.top,e[s],n,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,s++}}findNodeMatch(e,n,r,o){let s=-1,i;if(o>=this.preMatch.index&&(i=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&i.matchesNode(e,n,r))s=this.top.children.indexOf(i,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let c=this.top.children[l];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){s=l;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,o,s){let i=this.top.children[o];return i.dirty==qt&&i.dom==i.contentDOM&&(i.dirty=lr),i.update(e,n,r,s)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,s,i){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof In){let c=this.preMatch.matched.get(a);if(c!=null&&c!=s)return!1;let u=a.dom,d,f=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=qt&&Ns(n,a.outerDeco));if(!f&&a.update(e,n,r,o))return this.destroyBetween(this.index,l),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(a,e,n,r,o,i)))return this.destroyBetween(this.index,l),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=lr,d.updateChildren(o,i+1),d.dirty=vt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,s,i){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Ns(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let l=In.create(this.top,n,r,o,s,i);if(l.contentDOM){l.children=e.children,e.children=[];for(let a of l.children)a.parent=l}return e.destroy(),l}addNode(e,n,r,o,s){let i=In.create(this.top,e,n,r,o,s);i.contentDOM&&i.updateChildren(o,s+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let s=new xd(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof ar;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Os)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Ge||ze)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new Od(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function c0(t,e){let n=e,r=n.children.length,o=t.childCount,s=new Map,i=[];e:for(;o>0;){let l;for(;;)if(r){let c=n.children[r-1];if(c instanceof ar)n=c,r=c.children.length;else{l=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(o-1))break;--o,s.set(l,o),i.push(l)}}return{index:o,matched:s,matches:i.reverse()}}function u0(t,e){return t.type.side-e.type.side}function d0(t,e,n,r){let o=e.locals(t),s=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,o,e.forChild(s,u),c),s+=u.nodeSize}return}let i=0,l=[],a=null;for(let c=0;;){let u,d;for(;i<o.length&&o[i].to==s;){let y=o[i++];y.widget&&(u?(d||(d=[u])).push(y):u=y)}if(u)if(d){d.sort(u0);for(let y=0;y<d.length;y++)n(d[y],c,!!a)}else n(u,c,!!a);let f,p;if(a)p=-1,f=a,a=null;else if(c<t.childCount)p=c,f=t.child(c++);else break;for(let y=0;y<l.length;y++)l[y].to<=s&&l.splice(y--,1);for(;i<o.length&&o[i].from<=s&&o[i].to>s;)l.push(o[i++]);let h=s+f.nodeSize;if(f.isText){let y=h;i<o.length&&o[i].from<y&&(y=o[i].from);for(let b=0;b<l.length;b++)l[b].to<y&&(y=l[b].to);y<h&&(a=f.cut(y-s),f=f.cut(0,y-s),h=y,p=-1)}else for(;i<o.length&&o[i].to<h;)i++;let m=f.isInline&&!f.isLeaf?l.filter(y=>!y.inline):l.slice();r(f,m,e.forChild(s,f),p),s=h}}function f0(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function p0(t,e,n,r){for(let o=0,s=0;o<t.childCount&&s<=r;){let i=t.child(o++),l=s;if(s+=i.nodeSize,!i.isText)continue;let a=i.text;for(;o<t.childCount;){let c=t.child(o++);if(s+=c.nodeSize,!c.isText)break;a+=c.text}if(s>=n){if(s>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l<r?a.lastIndexOf(e,r-l-1):-1;if(c>=0&&c+e.length+l>=n)return l+c;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function Dl(t,e,n,r,o){let s=[];for(let i=0,l=0;i<t.length;i++){let a=t[i],c=l,u=l+=a.size;c>=n||u<=e?s.push(a):(c<e&&s.push(a.slice(0,e-c,r)),o&&(s.push(o),o=void 0),u>n&&s.push(a.slice(n-c,a.size,r)))}return s}function Pl(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),s=o&&o.size==0,i=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(i<0)return null;let l=r.resolve(i),a,c;if(Ts(n)){for(a=i;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&U.isSelectable(d)&&o.parent&&!(d.isInline&&$y(n.focusNode,n.focusOffset,o.dom))){let f=o.posBefore;c=new U(i==f?l:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=i,f=i;for(let p=0;p<n.rangeCount;p++){let h=n.getRangeAt(p);d=Math.min(d,t.docView.posFromDOM(h.startContainer,h.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(h.endContainer,h.endOffset,-1))}if(d<0)return null;[a,i]=f==t.state.selection.anchor?[f,d]:[d,f],l=r.resolve(i)}else a=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let u=r.resolve(a);if(!c){let d=e=="pointer"||t.state.selection.head<l.pos&&!s?1:-1;c=Fl(t,u,l,d)}return c}function Rd(t){return t.editable?t.hasFocus():$d(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function hn(t,e=!1){let n=t.state.selection;if(Pd(t,n),!!Rd(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ze){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&sr(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)m0(t);else{let{anchor:r,head:o}=n,s,i;Ld&&!(n instanceof j)&&(n.$from.parent.inlineContent||(s=Id(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(i=Id(t,n.to))),t.docView.setSelection(r,o,t,e),Ld&&(s&&Dd(s),i&&Dd(i)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&h0(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Ld=Ge||ze&&fd<63;function Id(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Ge&&o&&o.contentEditable=="false")return Bl(o);if((!o||o.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(o)return Bl(o);if(s)return Bl(s)}}function Bl(t){return t.contentEditable="true",Ge&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Dd(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function h0(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Rd(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function m0(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setStart(r.parentNode,Ve(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&rt&&Rn<=11&&(r.disabled=!0,r.disabled=!1)}function Pd(t,e){if(e instanceof U){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Bd(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Bd(t)}function Bd(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Fl(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||j.between(e,n,r)}function Fd(t){return t.editable&&!t.hasFocus()?!1:$d(t)}function $d(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function g0(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return sr(e.node,e.offset,n.anchorNode,n.anchorOffset)}function $l(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),s=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return s&&z.findFrom(s,e)}function Dn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Vd(t,e,n){let r=t.state.selection;if(r instanceof j)if(n.indexOf("s")>-1){let{$head:o}=r,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let i=t.state.doc.resolve(o.pos+s.nodeSize*(e<0?-1:1));return Dn(t,new j(r.$anchor,i))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=$l(t.state,e);return o&&o instanceof U?Dn(t,o):!1}else if(!(St&&n.indexOf("m")>-1)){let o=r.$head,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,i;if(!s||s.isText)return!1;let l=e<0?o.pos-s.nodeSize:o.pos;return s.isAtom||(i=t.docView.descAt(l))&&!i.contentDOM?U.isSelectable(s)?Dn(t,new U(e<0?t.state.doc.resolve(o.pos-s.nodeSize):o)):wo?Dn(t,new j(t.state.doc.resolve(e<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof U&&r.node.isInline)return Dn(t,new j(e>0?r.$to:r.$from));{let o=$l(t.state,e);return o?Dn(t,o):!1}}}function As(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function vo(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Fr(t,e){return e<0?y0(t):b0(t)}function y0(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,s,i=!1;for(Pt&&n.nodeType==1&&r<As(n)&&vo(n.childNodes[r],-1)&&(i=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(vo(l,-1))o=n,s=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(Hd(n))break;{let l=n.previousSibling;for(;l&&vo(l,-1);)o=n.parentNode,s=Ve(l),l=l.previousSibling;if(l)n=l,r=As(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}i?Vl(t,n,r):o&&Vl(t,o,s)}function b0(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=As(n),s,i;for(;;)if(r<o){if(n.nodeType!=1)break;let l=n.childNodes[r];if(vo(l,1))s=n,i=++r;else break}else{if(Hd(n))break;{let l=n.nextSibling;for(;l&&vo(l,1);)s=l.parentNode,i=Ve(l)+1,l=l.nextSibling;if(l)n=l,r=0,o=As(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}s&&Vl(t,s,i)}function Hd(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function E0(t,e){for(;t&&e==t.childNodes.length&&!Eo(t);)e=Ve(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function w0(t,e){for(;t&&!e&&!Eo(t);)e=Ve(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Vl(t,e,n){if(e.nodeType!=3){let s,i;(i=E0(e,n))?(e=i,n=0):(s=w0(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Ts(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&hn(t)},50)}function Ud(t,e){let n=t.state.doc.resolve(e);if(!(ze||Uy)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),i=(s.top+s.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(s.left-o.left)>1)return s.left<o.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),i=(s.top+s.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(s.left-o.left)>1)return s.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function zd(t,e,n){let r=t.state.selection;if(r instanceof j&&!r.empty||n.indexOf("s")>-1||St&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let i=$l(t.state,e);if(i&&i instanceof U)return Dn(t,i)}if(!o.parent.inlineContent){let i=e<0?o:s,l=r instanceof kt?z.near(i,e):z.findFrom(i,e);return l?Dn(t,l):!1}return!1}function jd(t,e){if(!(t.state.selection instanceof j))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let i=t.state.tr;return e<0?i.delete(n.pos-s.nodeSize,n.pos):i.delete(n.pos,n.pos+s.nodeSize),t.dispatch(i),!0}return!1}function Wd(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function k0(t){if(!Ge||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Wd(t,r,"true"),setTimeout(()=>Wd(t,r,"false"),20)}return!1}function C0(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function S0(t,e){let n=e.keyCode,r=C0(e);if(n==8||St&&n==72&&r=="c")return jd(t,-1)||Fr(t,-1);if(n==46&&!e.shiftKey||St&&n==68&&r=="c")return jd(t,1)||Fr(t,1);if(n==13||n==27)return!0;if(n==37||St&&n==66&&r=="c"){let o=n==37?Ud(t,t.state.selection.from)=="ltr"?-1:1:-1;return Vd(t,o,r)||Fr(t,o)}else if(n==39||St&&n==70&&r=="c"){let o=n==39?Ud(t,t.state.selection.from)=="ltr"?1:-1:1;return Vd(t,o,r)||Fr(t,o)}else{if(n==38||St&&n==80&&r=="c")return zd(t,-1,r)||Fr(t,-1);if(n==40||St&&n==78&&r=="c")return k0(t)||zd(t,1,r)||Fr(t,1);if(r==(St?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Hl(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:o,openEnd:s}=e;for(;o>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,s--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let i=t.someProp("clipboardSerializer")||rr.fromSchema(t.state.schema),l=Zd(),a=l.createElement("div");a.appendChild(i.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=Xd[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=l.createElement(u[p]);for(;a.firstChild;)h.appendChild(a.firstChild);a.appendChild(h),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${s}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
7
-
8
- `);return{dom:a,text:f,slice:e}}function Kd(t,e,n,r,o){let s=o.parent.type.spec.code,i,l;if(!n&&!e)return null;let a=e&&(r||s||!n);if(a){if(t.someProp("transformPastedText",f=>{e=f(e,s||r,t)}),s)return e?new D(M.from(t.state.schema.text(e.replace(/\r\n?/g,`
9
- `))),0,0):D.empty;let d=t.someProp("clipboardTextParser",f=>f(e,o,r,t));if(d)l=d;else{let f=o.marks(),{schema:p}=t.state,h=rr.fromSchema(p);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let y=i.appendChild(document.createElement("p"));m&&y.appendChild(h.serializeNode(p.text(m,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),i=O0(n),wo&&N0(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=i.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;i=f}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Ar.fromSchema(t.state.schema)).parseSlice(i,{preserveWhitespace:!!(a||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!v0.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=A0(Yd(l,+u[1],+u[2]),u[4]);else if(l=D.maxOpen(x0(l.content,o),!0),l.openStart||l.openEnd){let d=0,f=0;for(let p=l.content.firstChild;d<l.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=l.content.lastChild;f<l.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);l=Yd(l,d,f)}return t.someProp("transformPasted",d=>{l=d(l,t)}),l}const v0=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function x0(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),s,i=[];if(t.forEach(l=>{if(!i)return;let a=o.findWrapping(l.type),c;if(!a)return i=null;if(c=i.length&&s.length&&Jd(a,s,l,i[i.length-1],0))i[i.length-1]=c;else{i.length&&(i[i.length-1]=Gd(i[i.length-1],s.length));let u=qd(l,a);i.push(u),o=o.matchType(u.type),s=a}}),i)return M.from(i)}return t}function qd(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,M.from(t));return t}function Jd(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let s=Jd(t,e,n,r.lastChild,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(M.from(qd(n,t,o+1))))}}function Gd(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Gd(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(M.empty,!0);return t.copy(n.append(r))}function Ul(t,e,n,r,o,s){let i=e<0?t.firstChild:t.lastChild,l=i.content;return t.childCount>1&&(s=0),o<r-1&&(l=Ul(l,e,n,r,o+1,s)),o>=n&&(l=e<0?i.contentMatchAt(0).fillBefore(l,s<=o).append(l):l.append(i.contentMatchAt(i.childCount).fillBefore(M.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,i.copy(l))}function Yd(t,e,n){return e<t.openStart&&(t=new D(Ul(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new D(Ul(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Xd={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Qd=null;function Zd(){return Qd||(Qd=document.implementation.createHTMLDocument("title"))}let zl=null;function T0(t){let e=window.trustedTypes;return e?(zl||(zl=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),zl.createHTML(t)):t}function O0(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Zd().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&Xd[r[1].toLowerCase()])&&(t=o.map(s=>"<"+s+">").join("")+t+o.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=T0(t),o)for(let s=0;s<o.length;s++)n=n.querySelector(o[s])||n;return n}function N0(t){let e=t.querySelectorAll(ze?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function A0(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:s,openEnd:i}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;o=M.from(a.create(r[l+1],o)),s++,i++}return new D(o,s,i)}const Ye={},Xe={},_0={touchstart:!0,touchmove:!0};class M0{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function R0(t){for(let e in Ye){let n=Ye[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{I0(t,r)&&!Wl(t,r)&&(t.editable||!(r.type in Xe))&&n(t,r)},_0[e]?{passive:!0}:void 0)}Ge&&t.dom.addEventListener("input",()=>null),jl(t)}function Pn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function L0(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function jl(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Wl(t,r))})}function Wl(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function I0(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function D0(t,e){!Wl(t,e)&&Ye[e.type]&&(t.editable||!(e.type in Xe))&&Ye[e.type](t,e)}Xe.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!tf(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(fn&&ze&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Pr&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,ir(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||S0(t,n)?n.preventDefault():Pn(t,"key")},Xe.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},Xe.keypress=(t,e)=>{let n=e;if(tf(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||St&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof j)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o,s))&&t.dispatch(s()),n.preventDefault()}};function _s(t){return{left:t.clientX,top:t.clientY}}function P0(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Kl(t,e,n,r,o){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let i=s.depth+1;i>0;i--)if(t.someProp(e,l=>i>s.depth?l(t,n,s.nodeAfter,s.before(i),o,!0):l(t,n,s.node(i),s.before(i),o,!1)))return!0;return!1}function $r(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function B0(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&U.isSelectable(r)?($r(t,new U(n)),!0):!1}function F0(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof U&&(r=n.node);let s=t.state.doc.resolve(e);for(let i=s.depth+1;i>0;i--){let l=i>s.depth?s.nodeAfter:s.node(i);if(U.isSelectable(l)){r&&n.$from.depth>0&&i>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?o=s.before(n.$from.depth):o=s.before(i);break}}return o!=null?($r(t,U.create(t.state.doc,o)),!0):!1}function $0(t,e,n,r,o){return Kl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(o?F0(t,n):B0(t,n))}function V0(t,e,n,r){return Kl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function H0(t,e,n,r){return Kl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||U0(t,n,r)}function U0(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?($r(t,j.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let s=o.depth+1;s>0;s--){let i=s>o.depth?o.nodeAfter:o.node(s),l=o.before(s);if(i.inlineContent)$r(t,j.create(r,l+1,l+1+i.content.size));else if(U.isSelectable(i))$r(t,U.create(r,l));else continue;return!0}}function ql(t){return Ms(t)}const ef=St?"metaKey":"ctrlKey";Ye.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=ql(t),o=Date.now(),s="singleClick";o-t.input.lastClick.time<500&&P0(n,t.input.lastClick)&&!n[ef]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:s,button:n.button};let i=t.posAtCoords(_s(n));i&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new z0(t,i,n,!!r)):(s=="doubleClick"?V0:H0)(t,i.pos,i.inside,n)?n.preventDefault():Pn(t,"pointer"))};class z0{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[ef],this.allowDefault=r.shiftKey;let s,i;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),i=n.inside;else{let u=e.state.doc.resolve(n.pos);s=u.parent,i=u.depth?u.before():0}const l=o?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.dom.nodeType==1?a.dom:null;let{selection:c}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof U&&c.from<=i&&c.to>i)&&(this.mightDrag={node:s,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Pt&&!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(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Pn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>hn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(_s(e))),this.updateAllowDefault(e),this.allowDefault||!n?Pn(this.view,"pointer"):$0(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ge&&this.mightDrag&&!this.mightDrag.node.isAtom||ze&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?($r(this.view,z.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Pn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Pn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Ye.touchstart=t=>{t.input.lastTouch=Date.now(),ql(t),Pn(t,"pointer")},Ye.touchmove=t=>{t.input.lastTouch=Date.now(),Pn(t,"pointer")},Ye.contextmenu=t=>ql(t);function tf(t,e){return t.composing?!0:Ge&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const j0=fn?5e3:-1;Xe.compositionstart=Xe.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof j&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Ms(t,!0),t.markCursor=null;else if(Ms(t,!e.selection.empty),Pt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,s=r.focusOffset;o&&o.nodeType==1&&s!=0;){let i=s<0?o.lastChild:o.childNodes[s-1];if(!i)break;if(i.nodeType==3){let l=t.domSelection();l&&l.collapse(i,i.nodeValue.length);break}else o=i,s=-1}}t.input.composing=!0}nf(t,j0)},Xe.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,nf(t,20))};function nf(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Ms(t),e))}function rf(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=K0());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function W0(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=By(e.focusNode,e.focusOffset),r=Fy(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let i=n.pmViewDesc;if(!(!i||!i.isText(n.nodeValue)))return r}}return n||r}function K0(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Ms(t,e=!1){if(!(fn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),rf(t),e||t.docView&&t.docView.dirty){let n=Pl(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function q0(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const xo=rt&&Rn<15||Pr&&zy<604;Ye.copy=Xe.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let s=xo?null:n.clipboardData,i=r.content(),{dom:l,text:a}=Hl(t,i);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",a)):q0(t,l),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function J0(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function G0(t,e){if(!t.dom.parentNode)return;let n=t.input.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();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?To(t,r.value,null,o,e):To(t,r.textContent,r.innerHTML,o,e)},50)}function To(t,e,n,r,o){let s=Kd(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",a=>a(t,o,s||D.empty)))return!0;if(!s)return!1;let i=J0(s),l=i?t.state.tr.replaceSelectionWith(i,r):t.state.tr.replaceSelection(s);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function of(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Xe.paste=(t,e)=>{let n=e;if(t.composing&&!fn)return;let r=xo?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&To(t,of(r),r.getData("text/html"),o,n)?n.preventDefault():G0(t,n)};class sf{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Y0=St?"altKey":"ctrlKey";function lf(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[Y0]}Ye.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,s=o.empty?null:t.posAtCoords(_s(n)),i;if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof U?o.to-1:o.to))){if(r&&r.mightDrag)i=U.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(i=U.create(t.state.doc,d.posBefore))}}let l=(i||t.state.selection).content(),{dom:a,text:c,slice:u}=Hl(t,l);(!n.dataTransfer.files.length||!ze||fd>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(xo?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",xo||n.dataTransfer.setData("text/plain",c),t.dragging=new sf(u,lf(t,n),i)},Ye.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},Xe.dragover=Xe.dragenter=(t,e)=>e.preventDefault(),Xe.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(_s(n));if(!o)return;let s=t.state.doc.resolve(o.pos),i=r&&r.slice;i?t.someProp("transformPasted",h=>{i=h(i,t)}):i=Kd(t,of(n.dataTransfer),xo?null:n.dataTransfer.getData("text/html"),!1,s);let l=!!(r&&lf(t,n));if(t.someProp("handleDrop",h=>h(t,n,i||D.empty,l))){n.preventDefault();return}if(!i)return;n.preventDefault();let a=i?xy(t.state.doc,s.pos,i):s.pos;a==null&&(a=s.pos);let c=t.state.tr;if(l){let{node:h}=r;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(a),d=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,i.content.firstChild):c.replaceRange(u,u,i),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&U.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new U(p));else{let h=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((m,y,b,w)=>h=w),c.setSelection(Fl(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Ye.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&hn(t)},20))},Ye.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Ye.beforeinput=(t,e)=>{if(ze&&fn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,ir(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in Xe)Ye[t]=Xe[t];function Oo(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Rs{constructor(e,n){this.toDOM=e,this.spec=n||ur,this.side=this.spec.side||0}map(e,n,r,o){let{pos:s,deleted:i}=e.mapResult(n.from+o,this.side<0?-1:1);return i?null:new Qe(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Rs&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Oo(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Bn{constructor(e,n){this.attrs=e,this.spec=n||ur}map(e,n,r,o){let s=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,i=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return s>=i?null:new Qe(s,i,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Bn&&Oo(this.attrs,e.attrs)&&Oo(this.spec,e.spec)}static is(e){return e.type instanceof Bn}destroy(){}}class Jl{constructor(e,n){this.attrs=e,this.spec=n||ur}map(e,n,r,o){let s=e.mapResult(n.from+o,1);if(s.deleted)return null;let i=e.mapResult(n.to+o,-1);return i.deleted||i.pos<=s.pos?null:new Qe(s.pos-r,i.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),s;return o==n.from&&!(s=e.child(r)).isText&&o+s.nodeSize==n.to}eq(e){return this==e||e instanceof Jl&&Oo(this.attrs,e.attrs)&&Oo(this.spec,e.spec)}destroy(){}}class Qe{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Qe(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Qe(e,e,new Rs(n,r))}static inline(e,n,r,o){return new Qe(e,n,new Bn(r,o))}static node(e,n,r,o){return new Qe(e,n,new Jl(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Bn}get widget(){return this.type instanceof Rs}}const Vr=[],ur={};class Ee{constructor(e,n){this.local=e.length?e:Vr,this.children=n.length?n:Vr}static create(e,n){return n.length?Ls(n,e,0,ur):je}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,s){for(let i=0;i<this.local.length;i++){let l=this.local[i];l.from<=n&&l.to>=e&&(!s||s(l.spec))&&r.push(l.copy(l.from+o,l.to+o))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<n&&this.children[i+1]>e){let l=this.children[i]+1;this.children[i+2].findInner(e-l,n-l,r,o+l,s)}}map(e,n,r){return this==je||e.maps.length==0?this:this.mapInner(e,n,0,0,r||ur)}mapInner(e,n,r,o,s){let i;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,o);a&&a.type.valid(n,a)?(i||(i=[])).push(a):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?X0(this.children,i||[],e,n,r,o,s):i?new Ee(i.sort(dr),Vr):je}add(e,n){return n.length?this==je?Ee.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,s=0;e.forEach((l,a)=>{let c=a+r,u;if(u=cf(n,l,c)){for(o||(o=this.children.slice());s<o.length&&o[s]<a;)s+=3;o[s]==a?o[s+2]=o[s+2].addInner(l,u,c+1):o.splice(s,0,a,a+l.nodeSize,Ls(u,l,c+1,ur)),s+=3}});let i=af(s?uf(n):n,-r);for(let l=0;l<i.length;l++)i[l].type.valid(e,i[l])||i.splice(l--,1);return new Ee(i.length?this.local.concat(i).sort(dr):this.local,o||this.children)}remove(e){return e.length==0||this==je?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let s=0;s<r.length;s+=3){let i,l=r[s]+n,a=r[s+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>l&&d.to<a&&(e[u]=null,(i||(i=[])).push(d));if(!i)continue;r==this.children&&(r=this.children.slice());let c=r[s+2].removeInner(i,l+1);c!=je?r[s+2]=c:(r.splice(s,3),s-=3)}if(o.length){for(let s=0,i;s<e.length;s++)if(i=e[s])for(let l=0;l<o.length;l++)o[l].eq(i,n)&&(o==this.local&&(o=this.local.slice()),o.splice(l--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new Ee(o,r):je}forChild(e,n){if(this==je)return this;if(n.isLeaf)return Ee.empty;let r,o;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let s=e+1,i=s+n.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<i&&a.to>s&&a.type instanceof Bn){let c=Math.max(s,a.from)-s,u=Math.min(i,a.to)-s;c<u&&(o||(o=[])).push(a.copy(c,u))}}if(o){let l=new Ee(o.sort(dr),Vr);return r?new Fn([l,r]):l}return r||je}eq(e){if(this==e)return!0;if(!(e instanceof Ee)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Gl(this.localsInner(e))}localsInner(e){if(this==je)return Vr;if(e.inlineContent||!this.local.some(Bn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Bn||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Ee.empty=new Ee([],[]),Ee.removeOverlap=Gl;const je=Ee.empty;class Fn{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,ur));return Fn.from(r)}forChild(e,n){if(n.isLeaf)return Ee.empty;let r=[];for(let o=0;o<this.members.length;o++){let s=this.members[o].forChild(e,n);s!=je&&(s instanceof Fn?r=r.concat(s.members):r.push(s))}return Fn.from(r)}eq(e){if(!(e instanceof Fn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let s=this.members[o].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let i=0;i<s.length;i++)n.push(s[i])}}return n?Gl(r?n:n.sort(dr)):Vr}static from(e){switch(e.length){case 0:return je;case 1:return e[0];default:return new Fn(e.every(n=>n instanceof Ee)?e:e.reduce((n,r)=>n.concat(r instanceof Ee?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function X0(t,e,n,r,o,s,i){let l=t.slice();for(let c=0,u=s;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,p,h,m)=>{let y=m-h-(p-f);for(let b=0;b<l.length;b+=3){let w=l[b+1];if(w<0||f>w+u-d)continue;let k=l[b]+u-d;p>=k?l[b+1]=f<=k?-2:-1:f>=u&&y&&(l[b]+=y,l[b+1]+=y)}d+=y}),u=n.maps[c].map(u,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){a=!0,l[c+1]=-1;continue}let u=n.map(t[c]+s),d=u-o;if(d<0||d>=r.content.size){a=!0;continue}let f=n.map(t[c+1]+s,-1),p=f-o,{index:h,offset:m}=r.content.findIndex(d),y=r.maybeChild(h);if(y&&m==d&&m+y.nodeSize==p){let b=l[c+2].mapInner(n,y,u+1,t[c]+s+1,i);b!=je?(l[c]=d,l[c+1]=p,l[c+2]=b):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=Q0(l,t,e,n,o,s,i),u=Ls(c,r,0,i);e=u.local;for(let d=0;d<l.length;d+=3)l[d+1]<0&&(l.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let p=u.children[d];for(;f<l.length&&l[f]<p;)f+=3;l.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new Ee(e.sort(dr),l)}function af(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Qe(o.from+e,o.to+e,o.type))}return n}function Q0(t,e,n,r,o,s,i){function l(a,c){for(let u=0;u<a.local.length;u++){let d=a.local[u].map(r,o,c);d?n.push(d):i.onRemove&&i.onRemove(a.local[u].spec)}for(let u=0;u<a.children.length;u+=3)l(a.children[u+2],a.children[u]+c+1)}for(let a=0;a<t.length;a+=3)t[a+1]==-1&&l(t[a+2],e[a]+s+1);return n}function cf(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let s=0,i;s<t.length;s++)(i=t[s])&&i.from>n&&i.to<r&&((o||(o=[])).push(i),t[s]=null);return o}function uf(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Ls(t,e,n,r){let o=[],s=!1;e.forEach((l,a)=>{let c=cf(t,l,a+n);if(c){s=!0;let u=Ls(c,l,n+a+1,r);u!=je&&o.push(a,a+l.nodeSize,u)}});let i=af(s?uf(t):t,-n).sort(dr);for(let l=0;l<i.length;l++)i[l].type.valid(e,i[l])||(r.onRemove&&r.onRemove(i[l].spec),i.splice(l--,1));return i.length||o.length?new Ee(i,o):je}function dr(t,e){return t.from-e.from||t.to-e.to}function Gl(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let s=e[o];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[o]=s.copy(s.from,r.to),df(e,o+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),df(e,o,r.copy(s.from,r.to)));break}}}return e}function df(t,e,n){for(;e<t.length&&dr(n,t[e])>0;)e++;t.splice(e,0,n)}function Yl(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=je&&e.push(r)}),t.cursorWrapper&&e.push(Ee.create(t.state.doc,[t.cursorWrapper.deco])),Fn.from(e)}const Z0={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},eb=rt&&Rn<=11;class tb{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class nb{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new tb,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);rt&&Rn<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),eb&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Z0)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Fd(this.view)){if(this.suppressingSelectionUpdates)return hn(this.view);if(rt&&Rn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&sr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=Dr(s))n.add(s);for(let s=e.anchorNode;s;s=Dr(s))if(n.has(s)){r=s;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Fd(e)&&!this.ignoreSelectionChange(r),s=-1,i=-1,l=!1,a=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],a);d&&(s=s<0?d.from:Math.min(d.from,s),i=i<0?d.to:Math.max(d.to,i),d.typeOver&&(l=!0))}if(Pt&&a.length){let u=a.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let p=f.parentNode;p&&p.nodeName=="LI"&&(!d||sb(e,d)!=p)&&f.remove()}}}let c=null;s<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Ts(r)&&(c=Pl(e))&&c.eq(z.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,hn(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||o)&&(s>-1&&(e.docView.markDirty(s,i),rb(e)),this.handleDOMChange(s,i,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||hn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let d=e.addedNodes[u];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,s=e.nextSibling;if(rt&&Rn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(s=f)}let i=o&&o.parentNode==e.target?Ve(o)+1:0,l=r.localPosFromDOM(e.target,i,-1),a=s&&s.parentNode==e.target?Ve(s):e.target.childNodes.length,c=r.localPosFromDOM(e.target,a,1);return{from:l,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let ff=new WeakMap,pf=!1;function rb(t){if(!ff.has(t)&&(ff.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Pt,pf)return;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."),pf=!0}}function hf(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,s=e.endOffset,i=t.domAtPos(t.state.selection.anchor);return sr(i.node,i.offset,o,s)&&([n,r,o,s]=[o,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:s}}function ob(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return hf(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?hf(t,n):null}function sb(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function ib(t,e,n){let{node:r,fromOffset:o,toOffset:s,from:i,to:l}=t.docView.parseRange(e,n),a=t.domSelectionRange(),c,u=a.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:a.anchorOffset}],Ts(a)||c.push({node:a.focusNode,offset:a.focusOffset})),ze&&t.input.lastKeyCode===8)for(let y=s;y>o;y--){let b=r.childNodes[y-1],w=b.pmViewDesc;if(b.nodeName=="BR"&&!w){s=y;break}if(!w||w.size)break}let d=t.state.doc,f=t.someProp("domParser")||Ar.fromSchema(t.state.schema),p=d.resolve(i),h=null,m=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:s,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:lb,context:p});if(c&&c[0].pos!=null){let y=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=y),h={anchor:y+i,head:b+i}}return{doc:m,sel:h,from:i,to:l}}function lb(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Ge&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Ge&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const ab=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function cb(t,e,n,r,o){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let _=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,P=Pl(t,_);if(P&&!t.state.selection.eq(P)){if(ze&&fn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",Z=>Z(t,ir(13,"Enter"))))return;let V=t.state.tr.setSelection(P);_=="pointer"?V.setMeta("pointer",!0):_=="key"&&V.scrollIntoView(),s&&V.setMeta("composition",s),t.dispatch(V)}return}let i=t.state.doc.resolve(e),l=i.sharedDepth(n);e=i.before(l+1),n=t.state.doc.resolve(n).after(l+1);let a=t.state.selection,c=ib(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let h=fb(d.content,c.doc.content,c.from,f,p);if(h&&t.input.domChangeCount++,(Pr&&t.input.lastIOSEnter>Date.now()-225||fn)&&o.some(_=>_.nodeType==1&&!ab.test(_.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",_=>_(t,ir(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&a instanceof j&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let _=mf(t,t.state.doc,c.sel);if(_&&!_.eq(t.state.selection)){let P=t.state.tr.setSelection(_);s&&P.setMeta("composition",s),t.dispatch(P)}}return}t.state.selection.from<t.state.selection.to&&h.start==h.endB&&t.state.selection instanceof j&&(h.start>t.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?h.start=t.state.selection.from:h.endA<t.state.selection.to&&h.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),rt&&Rn<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),y=c.doc.resolveNoCache(h.endB-c.from),b=u.resolve(h.start),w=m.sameParent(y)&&m.parent.inlineContent&&b.end()>=h.endA,k;if((Pr&&t.input.lastIOSEnter>Date.now()-225&&(!w||o.some(_=>_.nodeName=="DIV"||_.nodeName=="P"))||!w&&m.pos<c.doc.content.size&&(!m.sameParent(y)||!m.parent.inlineContent)&&!/\S/.test(c.doc.textBetween(m.pos,y.pos,"",""))&&(k=z.findFrom(c.doc.resolve(m.pos+1),1,!0))&&k.head>m.pos)&&t.someProp("handleKeyDown",_=>_(t,ir(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&db(u,h.start,h.endA,m,y)&&t.someProp("handleKeyDown",_=>_(t,ir(8,"Backspace")))){fn&&ze&&t.domObserver.suppressSelectionUpdates();return}ze&&h.endB==h.start&&(t.input.lastChromeDelete=Date.now()),fn&&!w&&m.start()!=y.start()&&y.parentOffset==0&&m.depth==y.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,y=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(_){return _(t,ir(13,"Enter"))})},20));let E=h.start,x=h.endA,v=_=>{let P=_||t.state.tr.replace(E,x,c.doc.slice(h.start-c.from,h.endB-c.from));if(c.sel){let V=mf(t,P.doc,c.sel);V&&!(ze&&t.composing&&V.empty&&(h.start!=h.endB||t.input.lastChromeDelete<Date.now()-100)&&(V.head==E||V.head==P.mapping.map(x)-1)||rt&&V.empty&&V.head==E)&&P.setSelection(V)}return s&&P.setMeta("composition",s),P.scrollIntoView()},T;if(w){if(m.pos==y.pos){rt&&Rn<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>hn(t),20));let _=v(t.state.tr.delete(E,x)),P=u.resolve(h.start).marksAcross(u.resolve(h.endA));P&&_.ensureMarks(P),t.dispatch(_)}else if(h.endA==h.endB&&(T=ub(m.parent.content.cut(m.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start())))){let _=v(t.state.tr);T.type=="add"?_.addMark(E,x,T.mark):_.removeMark(E,x,T.mark),t.dispatch(_)}else if(m.parent.child(m.index()).isText&&m.index()==y.index()-(y.textOffset?0:1)){let _=m.parent.textBetween(m.parentOffset,y.parentOffset),P=()=>v(t.state.tr.insertText(_,E,x));t.someProp("handleTextInput",V=>V(t,E,x,_,P))||t.dispatch(P())}}else t.dispatch(v())}function mf(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Fl(t,e.resolve(n.anchor),e.resolve(n.head))}function ub(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,s=r,i,l,a;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)s=n[u].removeFromSet(s);if(o.length==1&&s.length==0)l=o[0],i="add",a=u=>u.mark(l.addToSet(u.marks));else if(o.length==0&&s.length==1)l=s[0],i="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(a(e.child(u)));if(M.from(c).eq(t))return{mark:l,type:i}}function db(t,e,n,r,o){if(n-e<=o.pos-r.pos||Xl(r,!0,!1)<o.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let l=s.nodeAfter;return l!=null&&n==e+l.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let i=t.resolve(Xl(s,!0,!0));return!i.parent.isTextblock||i.pos>n||Xl(i,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(i.parent.content)}function Xl(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,o++}return o}function fb(t,e,n,r,o){let s=t.findDiffStart(e,n);if(s==null)return null;let{a:i,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let a=Math.max(0,s-Math.min(i,l));r-=i+a-s}if(i<s&&t.size<e.size){let a=r<=s&&r>=i?s-r:0;s-=a,s&&s<e.size&&gf(e.textBetween(s-1,s+1))&&(s+=a?1:-1),l=s+(l-i),i=s}else if(l<s){let a=r<=s&&r>=l?s-r:0;s-=a,s&&s<t.size&&gf(t.textBetween(s-1,s+1))&&(s+=a?1:-1),i=s+(i-l),l=s}return{start:s,endA:i,endB:l}}function gf(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class yf{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new M0,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Cf),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=wf(this),Ef(this),this.nodeViews=kf(this),this.docView=Td(this.state.doc,bf(this),Yl(this),this.dom,this),this.domObserver=new nb(this,(r,o,s,i)=>cb(this,r,o,s,i)),this.domObserver.start(),R0(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&jl(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Cf),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,s=!1,i=!1;e.storedMarks&&this.composing&&(rf(this),i=!0),this.state=e;let l=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=kf(this);hb(p,this.nodeViews)&&(this.nodeViews=p,s=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&jl(this),this.editable=wf(this),Ef(this);let a=Yl(this),c=bf(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=s||!this.docView.matchesNode(e.doc,c,a);(d||!e.selection.eq(o.selection))&&(i=!0);let f=u=="preserve"&&i&&this.dom.style.overflowAnchor==null&&Ky(this);if(i){this.domObserver.stop();let p=d&&(rt||ze)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&pb(o.selection,e.selection);if(d){let h=ze?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=W0(this)),(s||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Td(e.doc,c,a,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&g0(this))?hn(this,p):(Pd(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&qy(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof U){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&pd(this,n.getBoundingClientRect(),e)}else pd(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==r.node&&(o=s)}this.dragging=new sf(e.slice,e.move,o<0?void 0:U.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let i=0;i<this.directPlugins.length;i++){let l=this.directPlugins[i].props[e];if(l!=null&&(o=n?n(l):l))return o}let s=this.state.plugins;if(s)for(let i=0;i<s.length;i++){let l=s[i].props[e];if(l!=null&&(o=n?n(l):l))return o}}hasFocus(){if(rt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Jy(this.dom),hn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Zy(this,e)}coordsAtPos(e,n=1){return Ed(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return o0(this,n||this.state,e)}pasteHTML(e,n){return To(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return To(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Hl(this,e)}destroy(){this.docView&&(L0(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Yl(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Dy())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return D0(this,e)}domSelectionRange(){let e=this.domSelection();return e?Ge&&this.root.nodeType===11&&Vy(this.dom.ownerDocument)==this.dom&&ob(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}yf.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function bf(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Qe.node(0,t.state.doc.content.size,e)]}function Ef(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Qe.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function wf(t){return!t.someProp("editable",e=>e(t.state)===!1)}function pb(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function kf(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function hb(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function Cf(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var $n={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Is={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},mb=typeof navigator<"u"&&/Mac/.test(navigator.platform),gb=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),He=0;He<10;He++)$n[48+He]=$n[96+He]=String(He);for(var He=1;He<=24;He++)$n[He+111]="F"+He;for(var He=65;He<=90;He++)$n[He]=String.fromCharCode(He+32),Is[He]=String.fromCharCode(He);for(var Ql in $n)Is.hasOwnProperty(Ql)||(Is[Ql]=$n[Ql]);function yb(t){var e=mb&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||gb&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Is:$n)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const bb=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Eb=typeof navigator<"u"&&/Win/.test(navigator.platform);function wb(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,s,i;for(let l=0;l<e.length-1;l++){let a=e[l];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))bb?i=!0:o=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),i&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function kb(t){let e=Object.create(null);for(let n in t)e[wb(n)]=t[n];return e}function Zl(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Cb(t){return new Ae({props:{handleKeyDown:ea(t)}})}function ea(t){let e=kb(t);return function(n,r){let o=yb(r),s,i=e[Zl(o,r)];if(i&&i(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let l=e[Zl(o,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(Eb&&r.ctrlKey&&r.altKey)&&(s=$n[r.keyCode])&&s!=o){let l=e[Zl(s,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const ta=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Sf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const vf=(t,e,n)=>{let r=Sf(t,n);if(!r)return!1;let o=na(r);if(!o){let i=r.blockRange(),l=i&&_r(i);return l==null?!1:(e&&e(t.tr.lift(i,l).scrollIntoView()),!0)}let s=o.nodeBefore;if(Lf(t,o,e,-1))return!0;if(r.parent.content.size==0&&(Hr(s,"end")||U.isSelectable(s)))for(let i=r.depth;;i--){let l=Ss(t.doc,r.before(i),r.after(i),D.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=t.tr.step(l);a.setSelection(Hr(s,"end")?z.findFrom(a.doc.resolve(a.mapping.map(o.pos,-1)),-1):U.create(a.doc,o.pos-s.nodeSize)),e(a.scrollIntoView())}return!0}if(i==1||r.node(i-1).childCount>1)break}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0):!1},Sb=(t,e,n)=>{let r=Sf(t,n);if(!r)return!1;let o=na(r);return o?xf(t,o,e):!1},vb=(t,e,n)=>{let r=Of(t,n);if(!r)return!1;let o=ra(r);return o?xf(t,o,e):!1};function xf(t,e,n){let r=e.nodeBefore,o=r,s=e.pos-1;for(;!o.isTextblock;s--){if(o.type.spec.isolating)return!1;let u=o.lastChild;if(!u)return!1;o=u}let i=e.nodeAfter,l=i,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=Ss(t.doc,s,a,D.empty);if(!c||c.from!=s||c instanceof Le&&c.slice.size>=a-s)return!1;if(n){let u=t.tr.step(c);u.setSelection(j.create(u.doc,s)),n(u.scrollIntoView())}return!0}function Hr(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const Tf=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=na(r)}let i=s&&s.nodeBefore;return!i||!U.isSelectable(i)?!1:(e&&e(t.tr.setSelection(U.create(t.doc,s.pos-i.nodeSize)).scrollIntoView()),!0)};function na(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Of(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const Nf=(t,e,n)=>{let r=Of(t,n);if(!r)return!1;let o=ra(r);if(!o)return!1;let s=o.nodeAfter;if(Lf(t,o,e,1))return!0;if(r.parent.content.size==0&&(Hr(s,"start")||U.isSelectable(s))){let i=Ss(t.doc,r.before(),r.after(),D.empty);if(i&&i.slice.size<i.to-i.from){if(e){let l=t.tr.step(i);l.setSelection(Hr(s,"start")?z.findFrom(l.doc.resolve(l.mapping.map(o.pos)),1):U.create(l.doc,l.mapping.map(o.pos))),e(l.scrollIntoView())}return!0}}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+s.nodeSize).scrollIntoView()),!0):!1},Af=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=ra(r)}let i=s&&s.nodeAfter;return!i||!U.isSelectable(i)?!1:(e&&e(t.tr.setSelection(U.create(t.doc,s.pos)).scrollIntoView()),!0)};function ra(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const xb=(t,e)=>{let n=t.selection,r=n instanceof U,o;if(r){if(n.node.isTextblock||!_n(t.doc,n.from))return!1;o=n.from}else if(o=Cs(t.doc,n.from,-1),o==null)return!1;if(e){let s=t.tr.join(o);r&&s.setSelection(U.create(s.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},Tb=(t,e)=>{let n=t.selection,r;if(n instanceof U){if(n.node.isTextblock||!_n(t.doc,n.to))return!1;r=n.to}else if(r=Cs(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Ob=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),s=o&&_r(o);return s==null?!1:(e&&e(t.tr.lift(o,s).scrollIntoView()),!0)},_f=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
10
- `).scrollIntoView()),!0)};function oa(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Nb=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),s=n.indexAfter(-1),i=oa(o.contentMatchAt(s));if(!i||!o.canReplaceWith(s,s,i))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,i.createAndFill());a.setSelection(z.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},Mf=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof kt||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=oa(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let i=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=t.tr.insert(i,s.createAndFill());l.setSelection(j.create(l.doc,i+1)),e(l.scrollIntoView())}return!0},Rf=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(un(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),o=r&&_r(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function Ab(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof U&&e.selection.node.isBlock)return!r.parentOffset||!un(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],i,l,a=!1,c=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){a=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),l=oa(r.node(p-1).contentMatchAt(r.indexAfter(p-1))),s.unshift(a&&l?{type:l}:null),i=p;break}else{if(p==1)return!1;s.unshift(null)}let u=e.tr;(e.selection instanceof j||e.selection instanceof kt)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=un(u.doc,d,s.length,s);if(f||(s[0]=l?{type:l}:null,f=un(u.doc,d,s.length,s)),!f)return!1;if(u.split(d,s.length,s),!a&&c&&r.node(i).type!=l){let p=u.mapping.map(r.before(i)),h=u.doc.resolve(p);l&&r.node(i-1).canReplaceWith(h.index(),h.index()+1,l)&&u.setNodeMarkup(u.mapping.map(r.before(i)),l)}return n&&n(u.scrollIntoView()),!0}}const _b=Ab(),Mb=(t,e)=>{let{$from:n,to:r}=t.selection,o,s=n.sharedDepth(r);return s==0?!1:(o=n.before(s),e&&e(t.tr.setSelection(U.create(t.doc,o))),!0)};function Rb(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,s=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(o.isTextblock||_n(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function Lf(t,e,n,r){let o=e.nodeBefore,s=e.nodeAfter,i,l,a=o.type.spec.isolating||s.type.spec.isolating;if(!a&&Rb(t,e,n))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(i=(l=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&l.matchType(i[0]||s.type).validEnd){if(n){let p=e.pos+s.nodeSize,h=M.empty;for(let b=i.length-1;b>=0;b--)h=M.from(i[b].create(null,h));h=M.from(o.copy(h));let m=t.tr.step(new Ie(e.pos-1,p,e.pos,p,new D(h,1,0),i.length,!0)),y=m.doc.resolve(p+2*i.length);y.nodeAfter&&y.nodeAfter.type==o.type&&_n(m.doc,y.pos)&&m.join(y.pos),n(m.scrollIntoView())}return!0}let u=s.type.spec.isolating||r>0&&a?null:z.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&_r(d);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(d,f).scrollIntoView()),!0;if(c&&Hr(s,"start",!0)&&Hr(o,"end")){let p=o,h=[];for(;h.push(p),!p.isTextblock;)p=p.lastChild;let m=s,y=1;for(;!m.isTextblock;m=m.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(n){let b=M.empty;for(let k=h.length-1;k>=0;k--)b=M.from(h[k].copy(b));let w=t.tr.step(new Ie(e.pos-h.length,e.pos+s.nodeSize,e.pos+y,e.pos+s.nodeSize-y,new D(b,h.length,0),0,!0));n(w.scrollIntoView())}return!0}}return!1}function If(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return o.node(s).isTextblock?(n&&n(e.tr.setSelection(j.create(e.doc,t<0?o.start(s):o.end(s)))),!0):!1}}const Lb=If(-1),Ib=If(1);function Db(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s),l=i&&wl(i,t,e);return l?(r&&r(n.tr.wrap(i,l).scrollIntoView()),!0):!1}}function Df(t,e=null){return function(n,r){let o=!1;for(let s=0;s<n.selection.ranges.length&&!o;s++){let{$from:{pos:i},$to:{pos:l}}=n.selection.ranges[s];n.doc.nodesBetween(i,l,(a,c)=>{if(o)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)o=!0;else{let u=n.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,t)}})}if(!o)return!1;if(r){let s=n.tr;for(let i=0;i<n.selection.ranges.length;i++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[i];s.setBlockType(l,a,t,e)}r(s.scrollIntoView())}return!0}}function sa(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}sa(ta,vf,Tf),sa(ta,Nf,Af),sa(_f,Mf,Rf,_b),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Pb(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s);if(!i)return!1;let l=r?n.tr:null;return Bb(l,i,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function Bb(t,e,n,r=null){let o=!1,s=e,i=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=i.resolve(e.start-2);s=new gs(a,a,e.depth),e.endIndex<e.parent.childCount&&(e=new gs(e.$from,i.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let l=wl(s,n,r,e);return l?(t&&Fb(t,e,l,o,n),!0):!1}function Fb(t,e,n,r,o){let s=M.empty;for(let u=n.length-1;u>=0;u--)s=M.from(n[u].type.create(n[u].attrs,s));t.step(new Ie(e.start-(r?2:0),e.end,e.start,e.end,new D(s,0,0),n.length,!0));let i=0;for(let u=0;u<n.length;u++)n[u].type==o&&(i=u+1);let l=n.length-i,a=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,f=!0;u<d;u++,f=!1)!f&&un(t.doc,a,l)&&(t.split(a,l),a+=2*l),a+=c.child(u).nodeSize;return t}function $b(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,i=>i.childCount>0&&i.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?Vb(e,n,t,s):Hb(e,n,s):!0:!1}}function Vb(t,e,n,r){let o=t.tr,s=r.end,i=r.$to.end(r.depth);s<i&&(o.step(new Ie(s-1,i,s,i,new D(M.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new gs(o.doc.resolve(r.$from.pos),o.doc.resolve(i),r.depth));const l=_r(r);if(l==null)return!1;o.lift(r,l);let a=o.doc.resolve(o.mapping.map(s,-1)-1);return _n(o.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&o.join(a.pos),e(o.scrollIntoView()),!0}function Hb(t,e,n){let r=t.tr,o=n.parent;for(let p=n.end,h=n.endIndex-1,m=n.startIndex;h>m;h--)p-=o.child(h).nodeSize,r.delete(p-1,p+1);let s=r.doc.resolve(n.start),i=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,a=n.endIndex==o.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(l?0:1),u+1,i.content.append(a?M.empty:M.from(o))))return!1;let d=s.pos,f=d+i.nodeSize;return r.step(new Ie(d-(l?1:0),f+(a?1:0),d+1,f-1,new D((l?M.empty:M.from(o.copy(M.empty))).append(a?M.empty:M.from(o.copy(M.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Ub(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!s)return!1;let i=s.startIndex;if(i==0)return!1;let l=s.parent,a=l.child(i-1);if(a.type!=t)return!1;if(n){let c=a.lastChild&&a.lastChild.type==l.type,u=M.from(c?t.create():null),d=new D(M.from(t.create(null,M.from(l.type.create(null,u)))),c?3:1,0),f=s.start,p=s.end;n(e.tr.step(new Ie(f-(c?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}function Ds(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,s=n.storedMarks,n}}}class Ps{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:s}=r,i=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...u)=>{const d=a(...u)(i);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(s),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:o,state:s}=this,{view:i}=o,l=[],a=!!e,c=e||s.tr,u=()=>(!a&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(c),l.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,p])=>[f,(...m)=>{const y=this.buildProps(c,n),b=p(...m)(y);return l.push(b),d}])),run:u};return d}createCan(e){const{rawCommands:n,state:r}=this,o=!1,s=e||r.tr,i=this.buildProps(s,o);return{...Object.fromEntries(Object.entries(n).map(([a,c])=>[a,(...u)=>c(...u)({...i,dispatch:void 0})])),chain:()=>this.createChain(s,o)}}buildProps(e,n=!0){const{rawCommands:r,editor:o,state:s}=this,{view:i}=o,l={tr:e,editor:o,view:i,state:Ds({state:s,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([a,c])=>[a,(...u)=>c(...u)(l)]))}};return l}}class zb{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(o=>o!==n):delete this.callbacks[e]),this}once(e,n){const r=(...o)=>{this.off(e,r),n.apply(this,o)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function F(t,e,n){return t.config[e]===void 0&&t.parent?F(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?F(t.parent,e,n):null}):t.config[e]}function Bs(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Pf(t){const e=[],{nodeExtensions:n,markExtensions:r}=Bs(t),o=[...n,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(i=>{const l={name:i.name,options:i.options,storage:i.storage,extensions:o},a=F(i,"addGlobalAttributes",l);if(!a)return;a().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([f,p])=>{e.push({type:d,name:f,attribute:{...s,...p}})})})})}),o.forEach(i=>{const l={name:i.name,options:i.options,storage:i.storage},a=F(i,"addAttributes",l);if(!a)return;const c=a();Object.entries(c).forEach(([u,d])=>{const f={...s,...d};typeof f?.default=="function"&&(f.default=f.default()),f?.isRequired&&f?.default===void 0&&delete f.default,e.push({type:i.name,name:u,attribute:f})})}),e}function Pe(t,e){if(typeof t=="string"){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 pe(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,s])=>{if(!r[o]){r[o]=s;return}if(o==="class"){const l=s?s.split(" "):[],a=r[o]?r[o].split(" "):[],c=l.filter(u=>!a.includes(u));r[o]=[...a,...c].join(" ")}else if(o==="style"){const l=s?s.split(";").map(u=>u.trim()).filter(Boolean):[],a=r[o]?r[o].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;a.forEach(u=>{const[d,f]=u.split(":").map(p=>p.trim());c.set(d,f)}),l.forEach(u=>{const[d,f]=u.split(":").map(p=>p.trim());c.set(d,f)}),r[o]=Array.from(c.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[o]=s}),r},{})}function ia(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>pe(n,r),{})}function Bf(t){return typeof t=="function"}function G(t,e=void 0,...n){return Bf(t)?e?t.bind(e)(...n):t(...n):t}function jb(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Wb(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Ff(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((s,i)=>{const l=i.attribute.parseHTML?i.attribute.parseHTML(n):Wb(n.getAttribute(i.name));return l==null?s:{...s,[i.name]:l}},{});return{...r,...o}}}}function $f(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&jb(n)?!1:n!=null))}function Kb(t,e){var n;const r=Pf(t),{nodeExtensions:o,markExtensions:s}=Bs(t),i=(n=o.find(c=>F(c,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(o.map(c=>{const u=r.filter(b=>b.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((b,w)=>{const k=F(w,"extendNodeSchema",d);return{...b,...k?k(c):{}}},{}),p=$f({...f,content:G(F(c,"content",d)),marks:G(F(c,"marks",d)),group:G(F(c,"group",d)),inline:G(F(c,"inline",d)),atom:G(F(c,"atom",d)),selectable:G(F(c,"selectable",d)),draggable:G(F(c,"draggable",d)),code:G(F(c,"code",d)),whitespace:G(F(c,"whitespace",d)),linebreakReplacement:G(F(c,"linebreakReplacement",d)),defining:G(F(c,"defining",d)),isolating:G(F(c,"isolating",d)),attrs:Object.fromEntries(u.map(b=>{var w;return[b.name,{default:(w=b?.attribute)===null||w===void 0?void 0:w.default}]}))}),h=G(F(c,"parseHTML",d));h&&(p.parseDOM=h.map(b=>Ff(b,u)));const m=F(c,"renderHTML",d);m&&(p.toDOM=b=>m({node:b,HTMLAttributes:ia(b,u)}));const y=F(c,"renderText",d);return y&&(p.toText=y),[c.name,p]})),a=Object.fromEntries(s.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((y,b)=>{const w=F(b,"extendMarkSchema",d);return{...y,...w?w(c):{}}},{}),p=$f({...f,inclusive:G(F(c,"inclusive",d)),excludes:G(F(c,"excludes",d)),group:G(F(c,"group",d)),spanning:G(F(c,"spanning",d)),code:G(F(c,"code",d)),attrs:Object.fromEntries(u.map(y=>{var b;return[y.name,{default:(b=y?.attribute)===null||b===void 0?void 0:b.default}]}))}),h=G(F(c,"parseHTML",d));h&&(p.parseDOM=h.map(y=>Ff(y,u)));const m=F(c,"renderHTML",d);return m&&(p.toDOM=y=>m({mark:y,HTMLAttributes:ia(y,u)})),[c.name,p]}));return new _u({topNode:i,nodes:l,marks:a})}function la(t,e){return e.nodes[t]||e.marks[t]||null}function Vf(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function aa(t,e){const n=rr.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}const qb=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,s,i,l)=>{var a,c;const u=((c=(a=o.type.spec).toText)===null||c===void 0?void 0:c.call(a,{node:o,pos:s,parent:i,index:l}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-s))}),n};function ca(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Fs{constructor(e){this.find=e.find,this.handler=e.handler}}const Jb=(t,e)=>{if(ca(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function $s(t){var e;const{editor:n,from:r,to:o,text:s,rules:i,plugin:l}=t,{view:a}=n;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const d=qb(c)+s;return i.forEach(f=>{if(u)return;const p=Jb(d,f.find);if(!p)return;const h=a.state.tr,m=Ds({state:a.state,transaction:h}),y={from:r-(p[0].length-s.length),to:o},{commands:b,chain:w,can:k}=new Ps({editor:n,state:m});f.handler({state:m,range:y,match:p,commands:b,chain:w,can:k})===null||!h.steps.length||(h.setMeta(l,{transform:h,from:r,to:o,text:s}),a.dispatch(h),u=!0)}),u}function Gb(t){const{editor:e,rules:n}=t,r=new Ae({state:{init(){return null},apply(o,s,i){const l=o.getMeta(r);if(l)return l;const a=o.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:u}=a;typeof u=="string"?u=u:u=aa(M.from(u),i.schema);const{from:d}=a,f=d+u.length;$s({editor:e,from:d,to:f,text:u,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:s}},props:{handleTextInput(o,s,i,l){return $s({editor:e,from:s,to:i,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:s}=o.state.selection;s&&$s({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,s){if(s.key!=="Enter")return!1;const{$cursor:i}=o.state.selection;return i?$s({editor:e,from:i.pos,to:i.pos,text:`
11
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Yb(t){return Object.prototype.toString.call(t).slice(8,-1)}function Vs(t){return Yb(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Hs(t,e){const n={...t};return Vs(t)&&Vs(e)&&Object.keys(e).forEach(r=>{Vs(e[r])&&Vs(t[r])?n[r]=Hs(t[r],e[r]):n[r]=e[r]}),n}class ot{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=G(F(this,"addOptions",{name:this.name}))),this.storage=G(F(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ot(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Hs(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new ot(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=G(F(n,"addOptions",{name:n.name})),n.storage=G(F(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const i=o.marks();if(!!!i.find(c=>c?.type.name===n.name))return!1;const a=i.find(c=>c?.type.name===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}}function Xb(t){return typeof t=="number"}class Qb{constructor(e){this.find=e.find,this.handler=e.handler}}const Zb=(t,e,n)=>{if(ca(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const s=[o.text];return s.index=o.index,s.input=t,s.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(o.replaceWith)),s}):[]};function e1(t){const{editor:e,state:n,from:r,to:o,rule:s,pasteEvent:i,dropEvent:l}=t,{commands:a,chain:c,can:u}=new Ps({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,o,(p,h)=>{if(!p.isTextblock||p.type.spec.code)return;const m=Math.max(r,h),y=Math.min(o,h+p.content.size),b=p.textBetween(m-h,y-h,void 0,"");Zb(b,s.find,i).forEach(k=>{if(k.index===void 0)return;const E=m+k.index+1,x=E+k[0].length,v={from:n.tr.mapping.map(E),to:n.tr.mapping.map(x)},T=s.handler({state:n,range:v,match:k,commands:a,chain:c,can:u,pasteEvent:i,dropEvent:l});d.push(T)})}),d.every(p=>p!==null)}const t1=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function n1(t){const{editor:e,rules:n}=t;let r=null,o=!1,s=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const a=({state:u,from:d,to:f,rule:p,pasteEvt:h})=>{const m=u.tr,y=Ds({state:u,transaction:m});if(!(!e1({editor:e,state:y,from:Math.max(d-1,0),to:f.b-1,rule:p,pasteEvent:h,dropEvent:l})||!m.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return n.map(u=>new Ae({view(d){const f=p=>{var h;r=!((h=d.dom.parentElement)===null||h===void 0)&&h.contains(p.target)?d.dom.parentElement:null};return window.addEventListener("dragstart",f),{destroy(){window.removeEventListener("dragstart",f)}}},props:{handleDOMEvents:{drop:(d,f)=>(s=r===d.dom.parentElement,l=f,!1),paste:(d,f)=>{var p;const h=(p=f.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return i=f,o=!!h?.includes("data-pm-slice"),!1}}},appendTransaction:(d,f,p)=>{const h=d[0],m=h.getMeta("uiEvent")==="paste"&&!o,y=h.getMeta("uiEvent")==="drop"&&!s,b=h.getMeta("applyPasteRules"),w=!!b;if(!m&&!y&&!w)return;if(w){let{text:x}=b;typeof x=="string"?x=x:x=aa(M.from(x),p.schema);const{from:v}=b,T=v+x.length,_=t1(x);return a({rule:u,state:p,from:v,to:{b:T},pasteEvt:_})}const k=f.doc.content.findDiffStart(p.doc.content),E=f.doc.content.findDiffEnd(p.doc.content);if(!(!Xb(k)||!E||k===E.b))return a({rule:u,state:p,from:k,to:E,pasteEvt:i})}}))}function r1(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class Ur{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Ur.resolve(e),this.schema=Kb(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Ur.sort(Ur.flatten(e)),r=r1(n.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},o=F(n,"addExtensions",r);return o?[n,...this.flatten(o())]:n}).flat(10)}static sort(e){return e.sort((r,o)=>{const s=F(r,"priority")||100,i=F(o,"priority")||100;return s>i?-1:s<i?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:la(n.name,this.schema)},o=F(n,"addCommands",r);return o?{...e,...o()}:e},{})}get plugins(){const{editor:e}=this,n=Ur.sort([...this.extensions].reverse()),r=[],o=[],s=n.map(i=>{const l={name:i.name,options:i.options,storage:i.storage,editor:e,type:la(i.name,this.schema)},a=[],c=F(i,"addKeyboardShortcuts",l);let u={};if(i.type==="mark"&&F(i,"exitable",l)&&(u.ArrowRight=()=>ot.handleExit({editor:e,mark:i})),c){const m=Object.fromEntries(Object.entries(c()).map(([y,b])=>[y,()=>b({editor:e})]));u={...u,...m}}const d=Cb(u);a.push(d);const f=F(i,"addInputRules",l);Vf(i,e.options.enableInputRules)&&f&&r.push(...f());const p=F(i,"addPasteRules",l);Vf(i,e.options.enablePasteRules)&&p&&o.push(...p());const h=F(i,"addProseMirrorPlugins",l);if(h){const m=h();a.push(...m)}return a}).flat();return[Gb({editor:e,rules:r}),...n1({editor:e,rules:o}),...s]}get attributes(){return Pf(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Bs(this.extensions);return Object.fromEntries(n.filter(r=>!!F(r,"addNodeView")).map(r=>{const o=this.attributes.filter(a=>a.type===r.name),s={name:r.name,options:r.options,storage:r.storage,editor:e,type:Pe(r.name,this.schema)},i=F(r,"addNodeView",s);if(!i)return[];const l=(a,c,u,d,f)=>{const p=ia(a,o);return i()({node:a,view:c,getPos:u,decorations:d,innerDecorations:f,editor:e,extension:r,HTMLAttributes:p})};return[r.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:la(e.name,this.schema)};e.type==="mark"&&(!((n=G(F(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const o=F(e,"onBeforeCreate",r),s=F(e,"onCreate",r),i=F(e,"onUpdate",r),l=F(e,"onSelectionUpdate",r),a=F(e,"onTransaction",r),c=F(e,"onFocus",r),u=F(e,"onBlur",r),d=F(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),s&&this.editor.on("create",s),i&&this.editor.on("update",i),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}}class Be{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=G(F(this,"addOptions",{name:this.name}))),this.storage=G(F(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Be(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Hs(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Be({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=G(F(n,"addOptions",{name:n.name})),n.storage=G(F(n,"addStorage",{name:n.name,options:n.options})),n}}function Hf(t,e,n){const{from:r,to:o}=e,{blockSeparator:s=`
12
-
13
- `,textSerializers:i={}}=n||{};let l="";return t.nodesBetween(r,o,(a,c,u,d)=>{var f;a.isBlock&&c>r&&(l+=s);const p=i?.[a.type.name];if(p)return u&&(l+=p({node:a,pos:c,parent:u,index:d,range:e})),!1;a.isText&&(l+=(f=a?.text)===null||f===void 0?void 0:f.slice(Math.max(r,c)-c,o-c))}),l}function ua(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const o1=Be.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ae({key:new De("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:s}=o,i=Math.min(...s.map(u=>u.$from.pos)),l=Math.max(...s.map(u=>u.$to.pos)),a=ua(n);return Hf(r,{from:i,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),s1=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),i1=(t=!1)=>({commands:e})=>e.setContent("",t),l1=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:s,$to:i})=>{t.doc.nodesBetween(s.pos,i.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(a)),f=c.resolve(u.map(a+l.nodeSize)),p=d.blockRange(f);if(!p)return;const h=_r(p);if(l.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,m)}(h||h===0)&&e.lift(p,h)})}),!0},a1=t=>e=>t(e),c1=()=>({state:t,dispatch:e})=>Mf(t,e),u1=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,s=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const i=r.mapping.map(e);return r.insert(i,s.content),r.setSelection(new j(r.doc.resolve(i-1))),!0},d1=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===r.type){if(e){const l=o.before(s),a=o.after(s);t.delete(l,a).scrollIntoView()}return!0}return!1},f1=t=>({tr:e,state:n,dispatch:r})=>{const o=Pe(t,n.schema),s=e.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===o){if(r){const a=s.before(i),c=s.after(i);e.delete(a,c).scrollIntoView()}return!0}return!1},p1=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},h1=()=>({state:t,dispatch:e})=>ta(t,e),m1=()=>({commands:t})=>t.keyboardShortcut("Enter"),g1=()=>({state:t,dispatch:e})=>Nb(t,e);function Us(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:ca(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function Uf(t,e,n={}){return t.find(r=>r.type===e&&Us(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function zf(t,e,n={}){return!!Uf(t,e,n)}function da(t,e,n){var r;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(u=>u.type===e))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(u=>u.type===e)||(n=n||((r=o.node.marks[0])===null||r===void 0?void 0:r.attrs),!Uf([...o.node.marks],e,n)))return;let i=o.index,l=t.start()+o.offset,a=i+1,c=l+o.node.nodeSize;for(;i>0&&zf([...t.parent.child(i-1).marks],e,n);)i-=1,l-=t.parent.child(i).nodeSize;for(;a<t.parent.childCount&&zf([...t.parent.child(a).marks],e,n);)c+=t.parent.child(a).nodeSize,a+=1;return{from:l,to:c}}function Vn(t,e){if(typeof t=="string"){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}const y1=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const s=Vn(t,r.schema),{doc:i,selection:l}=n,{$from:a,from:c,to:u}=l;if(o){const d=da(a,s,e);if(d&&d.from<=c&&d.to>=u){const f=j.create(i,d.from,d.to);n.setSelection(f)}}return!0},b1=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function fa(t){return t instanceof j}function mn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function jf(t,e=null){if(!e)return null;const n=z.atStart(t),r=z.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,s=r.to;return e==="all"?j.create(t,mn(0,o,s),mn(t.content.size,o,s)):j.create(t,mn(e,o,s),mn(e,o,s))}function pa(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const E1=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:s})=>{e={scrollIntoView:!0,...e};const i=()=>{pa()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!fa(n.state.selection))return i(),!0;const l=jf(o.doc,t)||n.state.selection,a=n.state.selection.eq(l);return s&&(a||o.setSelection(l),a&&o.storedMarks&&o.setStoredMarks(o.storedMarks),i()),!0},w1=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),k1=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Wf=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&Wf(r)}return t};function zs(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Wf(n)}function js(t,e,n){if(t instanceof On||t instanceof M)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return M.fromArray(t.map(l=>e.nodeFromJSON(l)));const i=e.nodeFromJSON(t);return n.errorOnInvalidContent&&i.check(),i}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),js("",e,n)}if(o){if(n.errorOnInvalidContent){let i=!1,l="";const a=new _u({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(i=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Ar.fromSchema(a).parseSlice(zs(t),n.parseOptions):Ar.fromSchema(a).parse(zs(t),n.parseOptions),n.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=Ar.fromSchema(e);return n.slice?s.parseSlice(zs(t),n.parseOptions).content:s.parse(zs(t),n.parseOptions)}return js("",e,n)}function C1(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof Le||o instanceof Ie))return;const s=t.mapping.maps[r];let i=0;s.forEach((l,a,c,u)=>{i===0&&(i=u)}),t.setSelection(z.near(t.doc.resolve(i),n))}const S1=t=>!("type"in t),v1=(t,e,n)=>({tr:r,dispatch:o,editor:s})=>{var i;if(o){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=js(e,s.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(i=n.errorOnInvalidContent)!==null&&i!==void 0?i:s.options.enableContentCheck})}catch(h){return s.emit("contentError",{editor:s,error:h,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}}),!1}let{from:a,to:c}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,d=!0;if((S1(l)?l:[l]).forEach(h=>{h.check(),u=u?h.isText&&h.marks.length===0:!1,d=d?h.isBlock:!1}),a===c&&d){const{parent:h}=r.doc.resolve(a);h.isTextblock&&!h.type.spec.code&&!h.childCount&&(a-=1,c+=1)}let p;if(u){if(Array.isArray(e))p=e.map(h=>h.text||"").join("");else if(e instanceof M){let h="";e.forEach(m=>{m.text&&(h+=m.text)}),p=h}else typeof e=="object"&&e&&e.text?p=e.text:p=e;r.insertText(p,a,c)}else p=l,r.replaceWith(a,c,p);n.updateSelection&&C1(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:a,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:a,text:p})}return!0},x1=()=>({state:t,dispatch:e})=>xb(t,e),T1=()=>({state:t,dispatch:e})=>Tb(t,e),O1=()=>({state:t,dispatch:e})=>vf(t,e),N1=()=>({state:t,dispatch:e})=>Nf(t,e),A1=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Cs(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},_1=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Cs(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},M1=()=>({state:t,dispatch:e})=>Sb(t,e),R1=()=>({state:t,dispatch:e})=>vb(t,e);function Kf(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function L1(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,s,i;for(let l=0;l<e.length-1;l+=1){const a=e[l];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))pa()||Kf()?i=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${a}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),i&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}const I1=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const s=L1(t).split(/-(?!$)/),i=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,l))});return a?.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function No(t,e,n={}){const{from:r,to:o,empty:s}=t.selection,i=e?Pe(e,t.schema):null,l=[];t.doc.nodesBetween(r,o,(d,f)=>{if(d.isText)return;const p=Math.max(r,f),h=Math.min(o,f+d.nodeSize);l.push({node:d,from:p,to:h})});const a=o-r,c=l.filter(d=>i?i.name===d.node.type.name:!0).filter(d=>Us(d.node.attrs,n,{strict:!1}));return s?!!c.length:c.reduce((d,f)=>d+f.to-f.from,0)>=a}const D1=(t,e={})=>({state:n,dispatch:r})=>{const o=Pe(t,n.schema);return No(n,o,e)?Ob(n,r):!1},P1=()=>({state:t,dispatch:e})=>Rf(t,e),B1=t=>({state:e,dispatch:n})=>{const r=Pe(t,e.schema);return $b(r)(e,n)},F1=()=>({state:t,dispatch:e})=>_f(t,e);function Ws(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function qf(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const $1=(t,e)=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const l=Ws(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(s=Pe(t,r.schema)),l==="mark"&&(i=Vn(t,r.schema)),o&&n.selection.ranges.forEach(a=>{r.doc.nodesBetween(a.$from.pos,a.$to.pos,(c,u)=>{s&&s===c.type&&n.setNodeMarkup(u,void 0,qf(c.attrs,e)),i&&c.marks.length&&c.marks.forEach(d=>{i===d.type&&n.addMark(u,u+c.nodeSize,i.create(qf(d.attrs,e)))})})}),!0):!1},V1=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),H1=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),U1=()=>({state:t,dispatch:e})=>Tf(t,e),z1=()=>({state:t,dispatch:e})=>Af(t,e),j1=()=>({state:t,dispatch:e})=>Mb(t,e),W1=()=>({state:t,dispatch:e})=>Ib(t,e),K1=()=>({state:t,dispatch:e})=>Lb(t,e);function ha(t,e,n={},r={}){return js(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const q1=(t,e=!1,n={},r={})=>({editor:o,tr:s,dispatch:i,commands:l})=>{var a,c;const{doc:u}=s;if(n.preserveWhitespace!=="full"){const d=ha(t,o.schema,n,{errorOnInvalidContent:(a=r.errorOnInvalidContent)!==null&&a!==void 0?a:o.options.enableContentCheck});return i&&s.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!e),!0}return i&&s.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function ma(t,e){const n=Vn(e,t.schema),{from:r,to:o,empty:s}=t.selection,i=[];s?(t.storedMarks&&i.push(...t.storedMarks),i.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,a=>{i.push(...a.marks)});const l=i.find(a=>a.type.name===n.name);return l?{...l.attrs}:{}}function J1(t,e){const n=new Sl(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function G1(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Y1(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,s)=>{n(o)&&r.push({node:o,pos:s})}),r}function Jf(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}}}function ga(t){return e=>Jf(e.$from,t)}function Gf(t,e){const n={from:0,to:t.content.size};return Hf(t,n,e)}function X1(t,e){const n=Pe(e,t.schema),{from:r,to:o}=t.selection,s=[];t.doc.nodesBetween(r,o,l=>{s.push(l)});const i=s.reverse().find(l=>l.type.name===n.name);return i?{...i.attrs}:{}}function Yf(t,e){const n=Ws(typeof e=="string"?e:e.name,t.schema);return n==="node"?X1(t,e):n==="mark"?ma(t,e):{}}function Q1(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function Z1(t){const e=Q1(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,i)=>i!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function eE(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,s)=>{const i=[];if(o.ranges.length)o.forEach((l,a)=>{i.push({from:l,to:a})});else{const{from:l,to:a}=n[s];if(l===void 0||a===void 0)return;i.push({from:l,to:a})}i.forEach(({from:l,to:a})=>{const c=e.slice(s).map(l,-1),u=e.slice(s).map(a),d=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),Z1(r)}function ya(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const s=n.resolve(t),i=da(s,o.type);i&&r.push({mark:o,...i})}):n.nodesBetween(t,e,(o,s)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(i=>({from:s,to:s+o.nodeSize,mark:i})))}),r}function Ks(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(s=>s.type===e&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}function ba(t,e,n={}){const{empty:r,ranges:o}=t.selection,s=e?Vn(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>s?s.name===d.type.name:!0).find(d=>Us(d.attrs,n,{strict:!1}));let i=0;const l=[];if(o.forEach(({$from:d,$to:f})=>{const p=d.pos,h=f.pos;t.doc.nodesBetween(p,h,(m,y)=>{if(!m.isText&&!m.marks.length)return;const b=Math.max(p,y),w=Math.min(h,y+m.nodeSize),k=w-b;i+=k,l.push(...m.marks.map(E=>({mark:E,from:b,to:w})))})}),i===0)return!1;const a=l.filter(d=>s?s.name===d.mark.type.name:!0).filter(d=>Us(d.mark.attrs,n,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),c=l.filter(d=>s?d.mark.type!==s&&d.mark.type.excludes(s):!0).reduce((d,f)=>d+f.to-f.from,0);return(a>0?a+c:a)>=i}function tE(t,e,n={}){if(!e)return No(t,null,n)||ba(t,null,n);const r=Ws(e,t.schema);return r==="node"?No(t,e,n):r==="mark"?ba(t,e,n):!1}function Xf(t,e){const{nodeExtensions:n}=Bs(e),r=n.find(i=>i.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},s=G(F(r,"group",o));return typeof s!="string"?!1:s.split(" ").includes("list")}function Ea(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(s=>{o!==!1&&(Ea(s,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function nE(t){return t instanceof U}function Qf(t,e,n){const o=t.state.doc.content.size,s=mn(e,0,o),i=mn(n,0,o),l=t.coordsAtPos(s),a=t.coordsAtPos(i,-1),c=Math.min(l.top,a.top),u=Math.max(l.bottom,a.bottom),d=Math.min(l.left,a.left),f=Math.max(l.right,a.right),p=f-d,h=u-c,b={top:c,bottom:u,left:d,right:f,width:p,height:h,x:d,y:c};return{...b,toJSON:()=>b}}function rE(t,e,n){var r;const{selection:o}=e;let s=null;if(fa(o)&&(s=o.$cursor),s){const l=(r=t.storedMarks)!==null&&r!==void 0?r:s.marks();return!!n.isInSet(l)||!l.some(a=>a.type.excludes(n))}const{ranges:i}=o;return i.some(({$from:l,$to:a})=>{let c=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,a.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const p=!f||f.type.allowsMarkType(n),h=!!n.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(n));c=p&&h}return!c}),c})}const oE=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=n,{empty:i,ranges:l}=s,a=Vn(t,r.schema);if(o)if(i){const c=ma(r,a);n.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,p)=>{const h=Math.max(p,u),m=Math.min(p+f.nodeSize,d);f.marks.find(b=>b.type===a)?f.marks.forEach(b=>{a===b.type&&n.addMark(h,m,a.create({...b.attrs,...e}))}):n.addMark(h,m,a.create(e))})});return rE(r,n,a)},sE=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),iE=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const s=Pe(t,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),s.isTextblock?o().command(({commands:l})=>Df(s,{...i,...e})(n)?!0:l.clearNodes()).command(({state:l})=>Df(s,{...i,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},lE=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=mn(t,0,r.content.size),s=U.create(r,o);e.setSelection(s)}return!0},aE=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:s}=typeof t=="number"?{from:t,to:t}:t,i=j.atStart(r).from,l=j.atEnd(r).to,a=mn(o,i,l),c=mn(s,i,l),u=j.create(r,a,c);e.setSelection(u)}return!0},cE=t=>({state:e,dispatch:n})=>{const r=Pe(t,e.schema);return Ub(r)(e,n)};function Zf(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e?.includes(o.type.name));t.tr.ensureMarks(r)}}const uE=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:i}=e,{$from:l,$to:a}=s,c=o.extensionManager.attributes,u=Ks(c,l.node().type.name,l.node().attrs);if(s instanceof U&&s.node.isBlock)return!l.parentOffset||!un(i,l.pos)?!1:(r&&(t&&Zf(n,o.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const d=a.parentOffset===a.parent.content.size,f=l.depth===0?void 0:G1(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=d&&f?[{type:f,attrs:u}]:void 0,h=un(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!h&&un(e.doc,e.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(h=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(h&&(s instanceof j&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,p),f&&!d&&!l.parentOffset&&l.parent.type!==f)){const m=e.mapping.map(l.before()),y=e.doc.resolve(m);l.node(-1).canReplaceWith(y.index(),y.index()+1,f)&&e.setNodeMarkup(e.mapping.map(l.before()),f)}t&&Zf(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return h},dE=(t,e={})=>({tr:n,state:r,dispatch:o,editor:s})=>{var i;const l=Pe(t,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;const d=a.node(-1);if(d.type!==l)return!1;const f=s.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(o){let b=M.empty;const w=a.index(-1)?1:a.index(-2)?2:3;for(let _=a.depth-w;_>=a.depth-3;_-=1)b=M.from(a.node(_).copy(b));const k=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,E={...Ks(f,a.node().type.name,a.node().attrs),...e},x=((i=l.contentMatch.defaultType)===null||i===void 0?void 0:i.createAndFill(E))||void 0;b=b.append(M.from(l.createAndFill(null,x)||void 0));const v=a.before(a.depth-(w-1));n.replace(v,a.after(-k),new D(b,4-w,0));let T=-1;n.doc.nodesBetween(v,n.doc.content.size,(_,P)=>{if(T>-1)return!1;_.isTextblock&&_.content.size===0&&(T=P+1)}),T>-1&&n.setSelection(j.near(n.doc.resolve(T))),n.scrollIntoView()}return!0}const p=c.pos===a.end()?d.contentMatchAt(0).defaultType:null,h={...Ks(f,d.type.name,d.attrs),...e},m={...Ks(f,a.node().type.name,a.node().attrs),...e};n.delete(a.pos,c.pos);const y=p?[{type:l,attrs:h},{type:p,attrs:m}]:[{type:l,attrs:h}];if(!un(n.doc,a.pos,2))return!1;if(o){const{selection:b,storedMarks:w}=r,{splittableMarks:k}=s.extensionManager,E=w||b.$to.parentOffset&&b.$from.marks();if(n.split(a.pos,2,y).scrollIntoView(),!E||!o)return!0;const x=E.filter(v=>k.includes(v.type.name));n.ensureMarks(x)}return!0},wa=(t,e)=>{const n=ga(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&_n(t.doc,n.pos)&&t.join(n.pos),!0},ka=(t,e)=>{const n=ga(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&_n(t.doc,r)&&t.join(r),!0};var fE=Object.freeze({__proto__:null,blur:s1,clearContent:i1,clearNodes:l1,command:a1,createParagraphNear:c1,cut:u1,deleteCurrentNode:d1,deleteNode:f1,deleteRange:p1,deleteSelection:h1,enter:m1,exitCode:g1,extendMarkRange:y1,first:b1,focus:E1,forEach:w1,insertContent:k1,insertContentAt:v1,joinBackward:O1,joinDown:T1,joinForward:N1,joinItemBackward:A1,joinItemForward:_1,joinTextblockBackward:M1,joinTextblockForward:R1,joinUp:x1,keyboardShortcut:I1,lift:D1,liftEmptyBlock:P1,liftListItem:B1,newlineInCode:F1,resetAttributes:$1,scrollIntoView:V1,selectAll:H1,selectNodeBackward:U1,selectNodeForward:z1,selectParentNode:j1,selectTextblockEnd:W1,selectTextblockStart:K1,setContent:q1,setMark:oE,setMeta:sE,setNode:iE,setNodeSelection:lE,setTextSelection:aE,sinkListItem:cE,splitBlock:uE,splitListItem:dE,toggleList:(t,e,n,r={})=>({editor:o,tr:s,state:i,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=o.extensionManager,p=Pe(t,i.schema),h=Pe(e,i.schema),{selection:m,storedMarks:y}=i,{$from:b,$to:w}=m,k=b.blockRange(w),E=y||m.$to.parentOffset&&m.$from.marks();if(!k)return!1;const x=ga(v=>Xf(v.type.name,d))(m);if(k.depth>=1&&x&&k.depth-x.depth<=1){if(x.node.type===p)return c.liftListItem(h);if(Xf(x.node.type.name,d)&&p.validContent(x.node.content)&&l)return a().command(()=>(s.setNodeMarkup(x.pos,p),!0)).command(()=>wa(s,p)).command(()=>ka(s,p)).run()}return!n||!E||!l?a().command(()=>u().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>wa(s,p)).command(()=>ka(s,p)).run():a().command(()=>{const v=u().wrapInList(p,r),T=E.filter(_=>f.includes(_.type.name));return s.ensureMarks(T),v?!0:c.clearNodes()}).wrapInList(p,r).command(()=>wa(s,p)).command(()=>ka(s,p)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:s=!1}=n,i=Vn(t,r.schema);return ba(r,i,e)?o.unsetMark(i,{extendEmptyMarkRange:s}):o.setMark(i,e)},toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const s=Pe(t,r.schema),i=Pe(e,r.schema),l=No(r,s,n);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?o.setNode(i,a):o.setNode(s,{...a,...n})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=Pe(t,n.schema);return No(n,o,e)?r.lift(o):r.wrapIn(o,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let s;if(o.spec.isInputRules&&(s=o.getState(t))){if(e){const i=t.tr,l=s.transform;for(let a=l.steps.length-1;a>=0;a-=1)i.step(l.steps[a].invert(l.docs[a]));if(s.text){const a=i.doc.resolve(s.from).marks();i.replaceWith(s.from,s.to,t.schema.text(s.text,a))}else i.delete(s.from,s.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{var s;const{extendEmptyMarkRange:i=!1}=e,{selection:l}=n,a=Vn(t,r.schema),{$from:c,empty:u,ranges:d}=l;if(!o)return!0;if(u&&i){let{from:f,to:p}=l;const h=(s=c.marks().find(y=>y.type===a))===null||s===void 0?void 0:s.attrs,m=da(c,a,h);m&&(f=m.from,p=m.to),n.removeMark(f,p,a)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,a)});return n.removeStoredMark(a),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const l=Ws(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(s=Pe(t,r.schema)),l==="mark"&&(i=Vn(t,r.schema)),o&&n.selection.ranges.forEach(a=>{const c=a.$from.pos,u=a.$to.pos;let d,f,p,h;n.selection.empty?r.doc.nodesBetween(c,u,(m,y)=>{s&&s===m.type&&(p=Math.max(y,c),h=Math.min(y+m.nodeSize,u),d=y,f=m)}):r.doc.nodesBetween(c,u,(m,y)=>{y<c&&s&&s===m.type&&(p=Math.max(y,c),h=Math.min(y+m.nodeSize,u),d=y,f=m),y>=c&&y<=u&&(s&&s===m.type&&n.setNodeMarkup(y,void 0,{...m.attrs,...e}),i&&m.marks.length&&m.marks.forEach(b=>{if(i===b.type){const w=Math.max(y,c),k=Math.min(y+m.nodeSize,u);n.addMark(w,k,i.create({...b.attrs,...e}))}}))}),f&&(d!==void 0&&n.setNodeMarkup(d,void 0,{...f.attrs,...e}),i&&f.marks.length&&f.marks.forEach(m=>{i===m.type&&n.addMark(p,h,i.create({...m.attrs,...e}))}))}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const o=Pe(t,n.schema);return Db(o,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const o=Pe(t,n.schema);return Pb(o,e)(n,r)}});const pE=Be.create({name:"commands",addCommands(){return{...fE}}}),hE=Be.create({name:"drop",addProseMirrorPlugins(){return[new Ae({key:new De("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),mE=Be.create({name:"editable",addProseMirrorPlugins(){return[new Ae({key:new De("editable"),props:{editable:()=>this.editor.options.editable}})]}}),gE=Be.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ae({key:new De("focusEvents"),props:{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}}}})]}}),yE=Be.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:d}=a,{pos:f,parent:p}=d,h=d.parent.isTextblock&&f>0?l.doc.resolve(f-1):d,m=h.parent.type.spec.isolating,y=d.pos-d.parentOffset,b=m&&h.parent.childCount===1?y===d.pos:z.atStart(c).from===f;return!u||!p.type.isTextblock||p.textContent.length||!b||b&&d.parent.type.name==="paragraph"?!1:i.clearNodes()}),()=>i.deleteSelection(),()=>i.joinBackward(),()=>i.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.deleteCurrentNode(),()=>i.joinForward(),()=>i.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return pa()||Kf()?s:o},addProseMirrorPlugins(){return[new Ae({key:new De("clearDocument"),appendTransaction:(t,e,n)=>{const r=t.some(m=>m.docChanged)&&!e.doc.eq(n.doc),o=t.some(m=>m.getMeta("preventClearDocument"));if(!r||o)return;const{empty:s,from:i,to:l}=e.selection,a=z.atStart(e.doc).from,c=z.atEnd(e.doc).to;if(s||!(i===a&&l===c)||!Ea(n.doc))return;const f=n.tr,p=Ds({state:n,transaction:f}),{commands:h}=new Ps({editor:this.editor,state:p});if(h.clearNodes(),!!f.steps.length)return f}})]}}),bE=Be.create({name:"paste",addProseMirrorPlugins(){return[new Ae({key:new De("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),EE=Be.create({name:"tabindex",addProseMirrorPlugins(){return[new Ae({key:new De("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class fr{get name(){return this.node.type.name}constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new fr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new fr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new fr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,i=this.pos+r+(s?0:1),l=this.resolvedPos.doc.resolve(i);if(!o&&l.depth<=this.depth)return;const a=new fr(l,this.editor,o,o?n:null);o&&(a.actualDepth=this.depth+1),e.push(new fr(l,this.editor,o,o?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const s=o.node.attrs,i=Object.keys(n);for(let l=0;l<i.length;l+=1){const a=i[l];if(s[a]!==n[a])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const s=Object.keys(n);return this.children.forEach(i=>{r&&o.length>0||(i.node.type.name===e&&s.every(a=>n[a]===i.node.attrs[a])&&o.push(i),!(r&&o.length>0)&&(o=o.concat(i.querySelectorAll(e,n,r))))}),o}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const wE=`.ProseMirror {
1
+ (function(y,De){typeof exports=="object"&&typeof module<"u"?module.exports=De(require("vue")):typeof define=="function"&&define.amd?define(["vue"],De):(y=typeof globalThis<"u"?globalThis:y||self,y.richtext=De(y.Vue))})(this,function(y){"use strict";function De(t){this.content=t}De.prototype={constructor:De,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new De(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new De(n)},addToStart:function(t,e){return new De([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new De(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new De(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=De.from(t),t.size?new De(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=De.from(t),t.size?new De(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=De.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},De.from=function(t){if(t instanceof De)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new De(e)};function Cu(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=Cu(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function Su(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=Su(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class V{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,o+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new V(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new V(r,o)}cutByIndex(e,n){return e==n?V.empty:e==0&&n==this.content.length?this:new V(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new V(o,i)}addToStart(e){return new V([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new V(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return Cu(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Su(this,e,n,r)}findIndex(e,n=-1){if(e==0)return fi(0,e);if(e==this.size)return fi(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=e)return s==e||n>0?fi(r+1,s):fi(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return V.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new V(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return V.empty;let n,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new V(n||e,r)}static from(e){if(!e)return V.empty;if(e instanceof V)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new V([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}V.empty=new V([],0);const ma={index:0,offset:0};function fi(t,e){return ma.index=t,ma.offset=e,ma}function pi(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!pi(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!pi(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let _e=class ku{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&pi(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ku.none;if(e instanceof ku)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};_e.none=[];class hi extends Error{}class W{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Nu(this.content,e+this.openStart,n);return r&&new W(r,this.openStart,this.openEnd)}removeBetween(e,n){return new W(Tu(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return W.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new W(V.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new W(e,r,o)}}W.empty=new W(V.empty,0,0);function Tu(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Tu(i.content,e-o-1,n-o-1)))}function Nu(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=Nu(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function z0(t,e,n){if(n.openStart>t.depth)throw new hi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new hi("Inconsistent open depths");return Au(t,e,n,0)}function Au(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=Au(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return nr(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=j0(n,t);return nr(i,Mu(t,s,a,e,r))}else return nr(i,mi(t,e,r))}function Ou(t,e){if(!e.type.compatibleContent(t.type))throw new hi("Cannot join "+e.type.name+" onto "+t.type.name)}function ga(t,e,n){let r=t.node(n);return Ou(r,e.node(n)),r}function tr(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function uo(t,e,n,r){let 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&&(tr(t.nodeAfter,r),i++));for(let a=i;a<s;a++)tr(o.child(a),r);e&&e.depth==n&&e.textOffset&&tr(e.nodeBefore,r)}function nr(t,e){return t.type.checkContent(e),t.copy(e)}function Mu(t,e,n,r,o){let i=t.depth>o&&ga(t,e,o+1),s=r.depth>o&&ga(n,r,o+1),a=[];return uo(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(Ou(i,s),tr(nr(i,Mu(t,e,n,r,o+1)),a)):(i&&tr(nr(i,mi(t,e,o+1)),a),uo(e,n,o,a),s&&tr(nr(s,mi(n,r,o+1)),a)),uo(r,null,o,a),new V(a)}function mi(t,e,n){let r=[];if(uo(null,t,n,r),t.depth>n){let o=ga(t,e,n+1);tr(nr(o,mi(t,e,n+1)),r)}return uo(e,null,n,r),new V(r)}function j0(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(V.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class fo{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return _e.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new gi(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(r.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new fo(n,r,i)}static resolveCached(e,n){let r=xu.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else xu.set(e,r=new U0);let o=r.elts[r.i]=fo.resolve(e,n);return r.i=(r.i+1)%W0,o}}class U0{constructor(){this.elts=[],this.i=0}}const W0=12,xu=new WeakMap;class gi{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const K0=Object.create(null);let On=class _u{constructor(e,n,r,o=_e.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||V.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&pi(this.attrs,n||e.defaultAttrs||K0)&&_e.sameSet(this.marks,r||_e.none)}copy(e=null){return e==this.content?this:new _u(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new _u(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return W.empty;let o=this.resolve(e),i=this.resolve(n),s=r?0:o.sharedDepth(n),a=o.start(s),c=o.node(s).content.cut(o.pos-a,i.pos-a);return new W(c,o.depth-s,i.depth-s)}replace(e,n,r){return z0(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return fo.resolveCached(this,e)}resolveNoCache(e){return fo.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Lu(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=V.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=_e.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!_e.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=V.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};On.prototype.text=void 0;class bi extends On{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Lu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new bi(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new bi(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Lu(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class rr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new q0(e,n);if(r.next==null)return rr.empty;let o=Ru(r);r.next&&r.err("Unexpected trailing text");let i=eb(Z0(o));return tb(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function i(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return V.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:f}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(f)==-1){o.push(f);let p=i(f,a.concat(u));if(p)return p}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
2
+ `)}}rr.empty=new rr(!0);class q0{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ru(t){let e=[];do e.push(G0(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function G0(t){let e=[];do e.push(J0(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function J0(t){let e=Q0(t);for(;;)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("{"))e=Y0(t,e);else break;return e}function Pu(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Y0(t,e){let n=Pu(t),r=n;return t.eat(",")&&(t.next!="}"?r=Pu(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function X0(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function Q0(t){if(t.eat("(")){let e=Ru(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=X0(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Z0(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();o(i(s.expr,l),u),l=u}if(s.max==-1)o(i(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),o(i(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Iu(t,e){return e-t}function Du(t,e){let n=[];return r(e),n.sort(Iu);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&n.indexOf(l)==-1&&r(l)}}}function eb(t){let e=Object.create(null);return n(Du(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<o.length;u++)o[u][0]==a&&(c=o[u][1]);Du(t,l).forEach(u=>{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new rr(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(Iu);i.next.push({type:o[s][0],next:e[a.join(",")]||n(a)})}return i}}function tb(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:l,next:c}=o.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Bu(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Fu(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function $u(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let i=t[o];i.validate&&i.validate(e[o])}}function Vu(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new rb(t,r,e[r]);return n}let Hu=class $0{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Vu(e,r.attrs),this.defaultAttrs=Bu(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==rr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Fu(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new On(this,this.computeAttrs(e),V.from(n),_e.setFrom(r))}createChecked(e=null,n,r){return n=V.from(n),this.checkContent(n),new On(this,this.computeAttrs(e),n,_e.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=V.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(V.empty,!0);return i?new On(this,e,n.append(i),_e.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){$u(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:_e.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new $0(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function nb(t,e,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class rb{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?nb(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class yi{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=Vu(e,o.attrs),this.excluded=null;let i=Bu(this.attrs);this.instance=i?new _e(this,i):null}create(e=null){return!e&&this.instance?this.instance:new _e(this,Fu(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new yi(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){$u(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class zu{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=De.from(e.nodes),n.marks=De.from(e.marks||{}),this.nodes=Hu.compile(this.spec.nodes,this),this.marks=yi.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=rr.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?ju(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:ju(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Hu){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new bi(r,r.defaultAttrs,e,_e.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return On.fromJSON(this,e)}markFromJSON(e){return _e.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function ju(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let a in t.marks){let l=t.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function ob(t){return t.tag!=null}function ib(t){return t.style!=null}let Mr=class Eu{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(ob(o))this.tags.push(o);else if(ib(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new qu(this,n,!1);return r.addAll(e,_e.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new qu(this,n,!0);return r.addAll(e,_e.none,n.from,n.to),W.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(lb(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<i)break}n.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=Gu(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=Gu(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Eu(e,Eu.schemaRules(e)))}};const Uu={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},sb={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Wu={ol:!0,ul:!0},po=1,ba=2,ho=4;function Ku(t,e,n){return e!=null?(e?po:0)|(e==="full"?ba:0):t&&t.whitespace=="pre"?po|ba:n&~ho}class wi{constructor(e,n,r,o,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=_e.none,this.match=i||(s&ho?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(V.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&po)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=V.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(V.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Uu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class qu{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,i,s=Ku(null,n.preserveWhitespace,0)|(r?ho:0);o?i=new wi(o.type,o.attrs,_e.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new wi(null,null,_e.none,!0,null,s):i=new wi(e.schema.topNodeType,null,_e.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,i=o.options&ba?"full":this.localPreserveWS||(o.options&po)>0;if(i==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)i!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
3
+ `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=o.content[o.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;Wu.hasOwnProperty(s)&&this.parser.normalizeLists&&ab(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:sb.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(Uu.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=l&&l.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
+ `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=r.getPropertyValue(i);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(i,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(a)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=o==null?null:e.childNodes[o];s!=a;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n,r){let o,i;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(e);if(c&&(!o||o.length>c.length+a)&&(o=c,i=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!o)return null;this.sync(i);for(let s=0;s<o.length;s++)n=this.enterInner(o[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=_e.none;for(let a of o.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):Ju(a.type,e.type))&&(s=a.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,o){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,o)),i}enterInner(e,n,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=Ku(e,i,s.options);s.options&ho&&s.content.length==0&&(a|=ho);let l=_e.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):Ju(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new wi(e,n,l,o,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=po)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function ab(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Wu.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function lb(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Gu(t){let e={};for(let n in t)e[n]=t[n];return e}function Ju(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}class or{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=ya(n).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)o=i.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=ki(ya(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&ki(ya(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return ki(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new or(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Yu(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Yu(e.marks)}}function Yu(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ya(t){return t.document||window.document}const Xu=new WeakMap;function cb(t){let e=Xu.get(t);return e===void 0&&Xu.set(t,e=ub(t)),e}function ub(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function ki(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=cb(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let a,l=n?t.createElementNS(n,o):t.createElement(o),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let f in c)if(c[f]!=null){let p=f.indexOf(" ");p>0?l.setAttributeNS(f.slice(0,p),f.slice(p+1),c[f]):l.setAttribute(f,c[f])}}for(let f=u;f<e.length;f++){let p=e[f];if(p===0){if(f<e.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:m,contentDOM:b}=ki(t,p,n,r);if(l.appendChild(m),b){if(a)throw new RangeError("Multiple content holes");a=b}}}return{dom:l,contentDOM:a}}const Qu=65535,Zu=Math.pow(2,16);function db(t,e){return t+e*Zu}function ed(t){return t&Qu}function fb(t){return(t-(t&Qu))/Zu}const td=1,nd=2,_i=4,rd=8;class wa{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&rd)>0}get deletedBefore(){return(this.delInfo&(td|_i))>0}get deletedAfter(){return(this.delInfo&(nd|_i))>0}get deletedAcross(){return(this.delInfo&_i)>0}}class vt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&vt.empty)return vt.empty}recover(e){let n=0,r=ed(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+fb(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>e)break;let c=this.ranges[a+i],u=this.ranges[a+s],f=l+c;if(e<=f){let p=c?e==l?-1:e==f?1:n:n,m=l+o+(p<0?0:u);if(r)return m;let b=e==(n<0?l:f)?null:db(a/3,e-l),k=e==l?nd:e==f?td:_i;return(n<0?e!=l:e!=f)&&(k|=rd),new wa(m,k,b)}o+=u-c}return r?e+o:new wa(e+o,0,null)}touches(e,n){let r=0,o=ed(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+i],u=l+c;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),c=this.ranges[o+n],u=this.ranges[o+r];e(a,a+c,l,l+u),i+=u-c}}invert(){return new vt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?vt.empty:new vt(e<0?[0,-e,0]:[0,0,e])}}vt.empty=new vt([]);class mo{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new mo(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new mo;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new wa(e,o,null)}}const ka=Object.create(null);class Ye{getMap(){return vt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=ka[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in ka)throw new RangeError("Duplicate use of step JSON ID "+e);return ka[e]=n,n.prototype.jsonID=e,n}}class Fe{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Fe(e,null)}static fail(e){return new Fe(null,e)}static fromReplace(e,n,r,o){try{return Fe.ok(e.replace(n,r,o))}catch(i){if(i instanceof hi)return Fe.fail(i.message);throw i}}}function _a(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(_a(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return V.fromArray(r)}class Mn extends Ye{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new W(_a(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return Fe.fromReplace(e,this.from,this.to,i)}invert(){return new Yt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Mn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Mn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Mn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Mn(n.from,n.to,e.markFromJSON(n.mark))}}Ye.jsonID("addMark",Mn);class Yt extends Ye{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new W(_a(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return Fe.fromReplace(e,this.from,this.to,r)}invert(){return new Mn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Yt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Yt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Yt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Yt(n.from,n.to,e.markFromJSON(n.mark))}}Ye.jsonID("removeMark",Yt);class xn extends Ye{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Fe.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Fe.fromReplace(e,this.pos,this.pos+1,new W(V.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new xn(this.pos,n.marks[o]);return new xn(this.pos,this.mark)}}return new ir(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new xn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new xn(n.pos,e.markFromJSON(n.mark))}}Ye.jsonID("addNodeMark",xn);class ir extends Ye{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Fe.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Fe.fromReplace(e,this.pos,this.pos+1,new W(V.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new xn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ir(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ir(n.pos,e.markFromJSON(n.mark))}}Ye.jsonID("removeNodeMark",ir);class ze extends Ye{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&Ea(e,this.from,this.to)?Fe.fail("Structure replace would overwrite content"):Fe.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new vt([this.from,this.to-this.from,this.slice.size])}invert(e){return new ze(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new ze(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ze)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?W.empty:new W(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ze(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?W.empty:new W(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ze(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ze(n.from,n.to,W.fromJSON(e,n.slice),!!n.structure)}}Ye.jsonID("replace",ze);class je extends Ye{constructor(e,n,r,o,i,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Ea(e,this.from,this.gapFrom)||Ea(e,this.gapTo,this.to)))return Fe.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Fe.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Fe.fromReplace(e,this.from,this.to,r):Fe.fail("Content does not fit in gap")}getMap(){return new vt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new je(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new je(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new je(n.from,n.to,n.gapFrom,n.gapTo,W.fromJSON(e,n.slice),n.insert,!!n.structure)}}Ye.jsonID("replaceAround",je);function Ea(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function pb(t,e,n,r){let o=[],i=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let p=Math.max(c,e),m=Math.min(c+l.nodeSize,n),b=r.addToSet(f);for(let k=0;k<f.length;k++)f[k].isInSet(b)||(s&&s.to==p&&s.mark.eq(f[k])?s.to=m:o.push(s=new Yt(p,m,f[k])));a&&a.to==p?a.to=m:i.push(a=new Mn(p,m,r))}}),o.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function hb(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof yi){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let f=l[u],p;for(let m=0;m<o.length;m++){let b=o[m];b.step==i-1&&f.eq(o[m].style)&&(p=b)}p?(p.to=c,p.step=i):o.push({style:f,from:Math.max(a,e),to:c,step:i})}}}),o.forEach(s=>t.step(new Yt(s.from,s.to,s.style)))}function va(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<i.childCount;l++){let c=i.child(l),u=a+c.nodeSize,f=r.matchType(c.type);if(!f)s.push(new ze(a,u,W.empty));else{r=f;for(let p=0;p<c.marks.length;p++)n.allowsMarkType(c.marks[p].type)||t.step(new Yt(a,u,c.marks[p]));if(o&&c.isText&&n.whitespace!="pre"){let p,m=/\r?\n|\r/g,b;for(;p=m.exec(c.text);)b||(b=new W(V.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new ze(a+p.index,a+p.index+p[0].length,b))}}a=u}if(!r.validEnd){let l=r.fillBefore(V.empty,!0);t.replace(a,a,new W(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function mb(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function xr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&o.canReplace(i,s,n))return r;if(r==0||o.type.spec.isolating||!mb(o,i,s))break}return null}function gb(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=V.empty,f=0;for(let b=i,k=!1;b>n;b--)k||r.index(b)>0?(k=!0,u=V.from(r.node(b).copy(u)),f++):l--;let p=V.empty,m=0;for(let b=i,k=!1;b>n;b--)k||o.after(b+1)<o.end(b)?(k=!0,p=V.from(o.node(b).copy(p)),m++):c++;t.step(new je(l,c,s,a,new W(u.append(p),f,m),u.size-f,!0))}function Ca(t,e,n=null,r=t){let o=bb(t,e),i=o&&yb(r,e);return i?o.map(od).concat({type:e,attrs:n}).concat(i.map(od)):null}function od(t){return{type:t,attrs:null}}function bb(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}function yb(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<o;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function wb(t,e,n){let r=V.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=V.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new je(o,i,o,i,new W(r,0,0),n.length,!0))}function kb(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&_b(t.doc,t.mapping.slice(i).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let m=r.whitespace=="pre",b=!!r.contentMatch.matchType(r.schema.linebreakReplacement);m&&!b?c=!1:!m&&b&&(c=!0)}c===!1&&sd(t,s,a,i),va(t,t.mapping.slice(i).map(a,1),r,void 0,c===null);let u=t.mapping.slice(i),f=u.map(a,1),p=u.map(a+s.nodeSize,1);return t.step(new je(f,p,f+1,p-1,new W(V.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&id(t,s,a,i),!1}})}function id(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function sd(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
5
+ `))}})}function _b(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function Eb(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new je(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new W(V.from(s),0,0),1,!0))}function fn(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let f=o.node(c),p=o.index(c);if(f.type.spec.isolating)return!1;let m=f.content.cutByIndex(p,f.childCount),b=r&&r[u+1];b&&(m=m.replaceChild(0,b.type.create(b.attrs)));let k=r&&r[u]||f;if(!f.canReplace(p+1,f.childCount)||!k.type.validContent(m))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function vb(t,e,n=1,r){let o=t.doc.resolve(e),i=V.empty,s=V.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=V.from(o.node(a).copy(i));let u=r&&r[c];s=V.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}t.step(new ze(e,e,new W(i.append(s),n,n),!0))}function Ln(t,e){let n=t.resolve(e),r=n.index();return ad(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Cb(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function ad(t,e){return!!(t&&e&&!t.isLeaf&&Cb(t,e))}function Ei(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let i,s,a=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&ad(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function Sb(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let u=s.whitespace=="pre",f=!!s.contentMatch.matchType(o);u&&!f?r=!1:!u&&f&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);sd(t,u.node(),u.before(),a)}s.inlineContent&&va(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new ze(c,l.map(e+n,-1),W.empty,!0)),r===!0){let u=t.doc.resolve(c);id(t,u.node(),u.before(),t.steps.length)}return t}function Tb(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let 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(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function Nb(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let f=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=f&&c.canReplaceWith(l,l,f[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function vi(t,e,n=e,r=W.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return ld(o,i,r)?new ze(e,n,r):new Ab(o,i,r).fit()}function ld(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class Ab{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=V.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=V.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let 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;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new W(i,s,a);return e>-1?new je(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new ze(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=Sa(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,f=null;if(n==1&&(s?c.matchType(s.type)||(f=c.fillBefore(V.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:f};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Sa(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new W(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Sa(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new W(go(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new W(go(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let k=0;k<i.length;k++)this.openFrontierNode(i[k]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,c=0,u=[],{match:f,type:p}=this.frontier[n];if(o){for(let k=0;k<o.childCount;k++)u.push(o.child(k));f=f.matchFragment(o)}let m=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let k=a.child(c),_=f.matchType(k.type);if(!_)break;c++,(c>1||l==0||k.content.size)&&(f=_,u.push(cd(k.mark(p.allowedMarks(k.marks)),c==1?l:0,c==a.childCount?m:-1)))}let b=c==a.childCount;b||(m=-1),this.placed=bo(this.placed,n,V.from(u)),this.frontier[n].match=f,b&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let k=0,_=a;k<m;k++){let E=_.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),_=E.content}this.unplaced=b?e==0?W.empty:new W(go(s.content,e-1,1),e-1,m<0?s.openEnd:e-1):new W(go(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Ta(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Ta(e,n,o,r,i);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Ta(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=bo(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=bo(this.placed,this.depth,V.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(V.empty,!0);n.childCount&&(this.placed=bo(this.placed,this.frontier.length,n))}}function go(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(go(t.firstChild.content,e-1,n)))}function bo(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(bo(t.lastChild.content,e-1,n)))}function Sa(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function cd(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,cd(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(V.empty,!0)))),t.copy(r)}function Ta(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!Ob(n,i.content,s)?a:null}function Ob(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function Mb(t){return t.spec.defining||t.spec.definingForContent}function xb(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(ld(o,i,r))return t.step(new ze(e,n,r));let s=dd(o,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let p=o.depth,m=o.pos-1;p>0;p--,m--){let b=o.node(p).type.spec;if(b.defining||b.definingAsContext||b.isolating)break;s.indexOf(p)>-1?a=p:o.before(p)==m&&s.splice(1,0,-p)}let l=s.indexOf(a),c=[],u=r.openStart;for(let p=r.content,m=0;;m++){let b=p.firstChild;if(c.push(b),m==r.openStart)break;p=b.content}for(let p=u-1;p>=0;p--){let m=c[p],b=Mb(m.type);if(b&&!m.sameMarkup(o.node(Math.abs(a)-1)))u=p;else if(b||!m.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let m=(p+u+1)%(r.openStart+1),b=c[m];if(b)for(let k=0;k<s.length;k++){let _=s[(k+l)%s.length],E=!0;_<0&&(E=!1,_=-_);let N=o.node(_-1),A=o.index(_-1);if(N.canReplaceWith(A,A,b.type,b.marks))return t.replace(o.before(_),E?i.after(_):n,new W(ud(r.content,0,r.openStart,m),m,r.openEnd))}}let f=t.steps.length;for(let p=s.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>f));p--){let m=s[p];m<0||(e=o.before(m),n=i.after(m))}}function ud(t,e,n,r,o){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(ud(i.content,e+1,n,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(V.empty,!0))}return t}function Lb(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=Tb(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new W(V.from(r),0,0))}function Rb(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=dd(r,o);for(let s=0;s<i.length;s++){let a=i[s],l=s==i.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),o.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s&&r.start(s-1)==o.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),o.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function dd(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}class Lr extends Ye{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Fe.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return Fe.fromReplace(e,this.pos,this.pos+1,new W(V.from(o),0,n.isLeaf?0:1))}getMap(){return vt.empty}invert(e){return new Lr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Lr(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Lr(n.pos,n.attr,n.value)}}Ye.jsonID("attr",Lr);class yo extends Ye{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Fe.ok(r)}getMap(){return vt.empty}invert(e){return new yo(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new yo(n.attr,n.value)}}Ye.jsonID("docAttr",yo);let Rr=class extends Error{};Rr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},Rr.prototype=Object.create(Error.prototype),Rr.prototype.constructor=Rr,Rr.prototype.name="TransformError";class Na{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new mo}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Rr(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=W.empty){let o=vi(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new W(V.from(r),0,0))}delete(e,n){return this.replace(e,n,W.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return xb(this,e,n,r),this}replaceRangeWith(e,n,r){return Lb(this,e,n,r),this}deleteRange(e,n){return Rb(this,e,n),this}lift(e,n){return gb(this,e,n),this}join(e,n=1){return Sb(this,e,n),this}wrap(e,n){return wb(this,e,n),this}setBlockType(e,n=e,r,o=null){return kb(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return Eb(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Lr(e,n,r)),this}setDocAttribute(e,n){return this.step(new yo(e,n)),this}addNodeMark(e,n){return this.step(new xn(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof _e)n.isInSet(r.marks)&&this.step(new ir(e,n));else{let o=r.marks,i,s=[];for(;i=n.isInSet(o);)s.push(new ir(e,i)),o=i.removeFromSet(o);for(let a=s.length-1;a>=0;a--)this.step(s[a])}return this}split(e,n=1,r){return vb(this,e,n,r),this}addMark(e,n,r){return pb(this,e,n,r),this}removeMark(e,n,r){return hb(this,e,n,r),this}clearIncompatible(e,n,r){return va(this,e,n,r),this}}const Aa=Object.create(null);class ee{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new fd(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=W.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let i=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=e.mapping.slice(i);e.replaceRange(u.map(l.pos),u.map(c.pos),a?W.empty:n),a==0&&md(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:a}=o[i],l=e.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),md(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new te(e):Pr(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=n<0?Pr(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):Pr(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Ot(e.node(0))}static atStart(e){return Pr(e,e,0,0,1)||new Ot(e)}static atEnd(e){return Pr(e,e,e.content.size,e.childCount,-1)||new Ot(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Aa[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Aa)throw new RangeError("Duplicate use of selection JSON ID "+e);return Aa[e]=n,n.prototype.jsonID=e,n}getBookmark(){return te.between(this.$anchor,this.$head).getBookmark()}}ee.prototype.visible=!0;class fd{constructor(e,n){this.$from=e,this.$to=n}}let pd=!1;function hd(t){!pd&&!t.parent.inlineContent&&(pd=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class te extends ee{constructor(e,n=e){hd(e),hd(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ee.near(r);let o=e.resolve(n.map(this.anchor));return new te(o.parent.inlineContent?o:r,r)}replace(e,n=W.empty){if(super.replace(e,n),n==W.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof te&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ci(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new te(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=ee.findFrom(n,r,!0)||ee.findFrom(n,-r,!0);if(i)n=i.$head;else return ee.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(ee.findFrom(e,-r,!0)||ee.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new te(e,n)}}ee.jsonID("text",te);class Ci{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ci(e.map(this.anchor),e.map(this.head))}resolve(e){return te.between(e.resolve(this.anchor),e.resolve(this.head))}}class Q extends ee{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=e.resolve(o);return r?ee.near(i):new Q(i)}content(){return new W(V.from(this.node),0,0)}eq(e){return e instanceof Q&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Oa(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Q(e.resolve(n.anchor))}static create(e,n){return new Q(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Q.prototype.visible=!1,ee.jsonID("node",Q);class Oa{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Ci(r,r):new Oa(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Q.isSelectable(r)?new Q(n):ee.near(n)}}class Ot extends ee{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=W.empty){if(n==W.empty){e.delete(0,e.doc.content.size);let r=ee.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Ot(e)}map(e){return new Ot(e)}eq(e){return e instanceof Ot}getBookmark(){return Pb}}ee.jsonID("all",Ot);const Pb={map(){return this},resolve(t){return new Ot(t)}};function Pr(t,e,n,r,o,i=!1){if(e.inlineContent)return te.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let a=e.child(s);if(a.isAtom){if(!i&&Q.isSelectable(a))return Q.create(t,n-(o<0?a.nodeSize:0))}else{let l=Pr(t,a,n+o,o<0?a.childCount:0,o,i);if(l)return l}n+=a.nodeSize*o}return null}function md(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof ze||o instanceof je))return;let i=t.mapping.maps[r],s;i.forEach((a,l,c,u)=>{s==null&&(s=u)}),t.setSelection(ee.near(t.doc.resolve(s),n))}const gd=1,Si=2,bd=4;class Ib extends Na{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|gd)&~Si,this.storedMarks=null,this}get selectionSet(){return(this.updated&gd)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Si,this}ensureMarks(e){return _e.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Si)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Si,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||_e.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,i)),this.selection.empty||this.setSelection(ee.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=bd,this}get scrolledIntoView(){return(this.updated&bd)>0}}function yd(t,e){return!e||!t?t:t.bind(e)}class wo{constructor(e,n,r){this.name=e,this.init=yd(n.init,r),this.apply=yd(n.apply,r)}}const Db=[new wo("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new wo("selection",{init(t,e){return t.selection||ee.atStart(e.doc)},apply(t){return t.selection}}),new wo("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new wo("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Ma{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Db.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new wo(r.key,r.spec.state,r))})}}class Ir{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=o?o[s].n:0,c=o?o[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let f=0;f<this.config.plugins.length;f++)o.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ir(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new Ib(this)}static create(e){let n=new Ma(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Ir(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new Ma(this.schema,e.plugins),r=n.fields,o=new Ir(n);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new Ma(e.schema,e.plugins),i=new Ir(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=On.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=ee.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=c.fromJSON.call(l,e,n[a],i);return}}i[s.name]=s.init(e,i)}}),i}}function wd(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=wd(o,e,{})),n[r]=o}return n}class $e{constructor(e){this.spec=e,this.props={},e.props&&wd(e.props,this,this.props),this.key=e.key?e.key.key:kd("plugin")}getState(e){return e[this.key]}}const xa=Object.create(null);function kd(t){return t in xa?t+"$"+ ++xa[t]:(xa[t]=0,t+"$")}class Ue{constructor(e="key"){this.key=kd(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Ge=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Dr=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let La=null;const pn=function(t,e,n){let r=La||(La=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Bb=function(){La=null},sr=function(t,e,n,r){return n&&(_d(t,e,n,r,-1)||_d(t,e,n,r,1))},Fb=/^(img|br|input|textarea|hr)$/i;function _d(t,e,n,r,o){for(var i;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Mt(t))){let s=t.parentNode;if(!s||s.nodeType!=1||ko(t)||Fb.test(t.nodeName)||t.contentEditable=="false")return!1;e=Ge(t)+(o<0?0:1),t=s}else if(t.nodeType==1){let s=t.childNodes[e+(o<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((i=s.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=o;else return!1;else t=s,e=o<0?Mt(t):0}else return!1}}function Mt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function $b(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Mt(t)}else if(t.parentNode&&!ko(t))e=Ge(t),t=t.parentNode;else return null}}function Vb(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!ko(t))e=Ge(t)+1,t=t.parentNode;else return null}}function Hb(t,e,n){for(let r=e==0,o=e==Mt(t);r||o;){if(t==n)return!0;let i=Ge(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,o=o&&i==Mt(t)}}function ko(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Ti=function(t){return t.focusNode&&sr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ar(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function zb(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function jb(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Mt(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Mt(r.startContainer),r.startOffset)}}}const Xt=typeof navigator<"u"?navigator:null,Ed=typeof document<"u"?document:null,Rn=Xt&&Xt.userAgent||"",Ra=/Edge\/(\d+)/.exec(Rn),vd=/MSIE \d/.exec(Rn),Pa=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Rn),pt=!!(vd||Pa||Ra),Pn=vd?document.documentMode:Pa?+Pa[1]:Ra?+Ra[1]:0,jt=!pt&&/gecko\/(\d+)/i.test(Rn);jt&&+(/Firefox\/(\d+)/.exec(Rn)||[0,0])[1];const Ia=!pt&&/Chrome\/(\d+)/.exec(Rn),Xe=!!Ia,Cd=Ia?+Ia[1]:0,it=!pt&&!!Xt&&/Apple Computer/.test(Xt.vendor),Br=it&&(/Mobile\/\w+/.test(Rn)||!!Xt&&Xt.maxTouchPoints>2),xt=Br||(Xt?/Mac/.test(Xt.platform):!1),Ub=Xt?/Win/.test(Xt.platform):!1,hn=/Android \d/.test(Rn),_o=!!Ed&&"webkitFontSmoothing"in Ed.documentElement.style,Wb=_o?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Kb(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function mn(t,e){return typeof t=="number"?t:t[e]}function qb(t){let 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 Sd(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(s.nodeType!=1){s=Dr(s);continue}let a=s,l=a==i.body,c=l?Kb(i):qb(a),u=0,f=0;if(e.top<c.top+mn(r,"top")?f=-(c.top-e.top+mn(o,"top")):e.bottom>c.bottom-mn(r,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+mn(o,"top")-c.top:e.bottom-c.bottom+mn(o,"bottom")),e.left<c.left+mn(r,"left")?u=-(c.left-e.left+mn(o,"left")):e.right>c.right-mn(r,"right")&&(u=e.right-c.right+mn(o,"right")),u||f)if(l)i.defaultView.scrollBy(u,f);else{let m=a.scrollLeft,b=a.scrollTop;f&&(a.scrollTop+=f),u&&(a.scrollLeft+=u);let k=a.scrollLeft-m,_=a.scrollTop-b;e={left:e.left-k,top:e.top-_,right:e.right-k,bottom:e.bottom-_}}let p=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(p))break;s=p=="absolute"?s.offsetParent:Dr(s)}}function Gb(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(i,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:Td(t.dom)}}function Td(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Dr(r));return e}function Jb({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Nd(n,r==0?0:r-e)}function Nd(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let Fr=null;function Yb(t){if(t.setActive)return t.setActive();if(Fr)return t.focus(Fr);let e=Td(t);t.focus(Fr==null?{get preventScroll(){return Fr={preventScroll:!0},!0}}:void 0),Fr||(Fr=!1,Nd(e,0))}function Ad(t,e){let n,r=2e8,o,i=0,s=e.top,a=e.top,l,c;for(let u=t.firstChild,f=0;u;u=u.nextSibling,f++){let p;if(u.nodeType==1)p=u.getClientRects();else if(u.nodeType==3)p=pn(u).getClientRects();else continue;for(let m=0;m<p.length;m++){let b=p[m];if(b.top<=s&&b.bottom>=a){s=Math.max(b.bottom,s),a=Math.min(b.top,a);let k=b.left>e.left?b.left-e.left:b.right<e.left?e.left-b.right:0;if(k<r){n=u,r=k,o=k&&n.nodeType==3?{left:b.right<e.left?b.right:b.left,top:e.top}:e,u.nodeType==1&&k&&(i=f+(e.left>=(b.left+b.right)/2?1:0));continue}}else b.top>e.top&&!l&&b.left<=e.left&&b.right>=e.left&&(l=u,c={left:Math.max(b.left,Math.min(b.right,e.left)),top:b.top});!n&&(e.left>=b.right&&e.top>=b.top||e.left>=b.left&&e.top>=b.bottom)&&(i=f+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?Xb(n,o):!n||r&&n.nodeType==1?{node:t,offset:i}:Ad(n,o)}function Xb(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let i=In(r,1);if(i.top!=i.bottom&&Da(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function Da(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Qb(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function Zb(t,e,n){let{node:r,offset:o}=Ad(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function ey(t,e,n,r){let o=-1;for(let i=e,s=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?o=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(o=a.posAfter),s=!0),!a.contentDOM&&o<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;i=a.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function Od(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let s=t.childNodes[i];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(Da(e,c))return Od(s,e,c)}}if((i=(i+1)%r)==o)break}return t}function ty(t,e){let n=t.dom.ownerDocument,r,o=0,i=jb(n,e.left,e.top);i&&({node:r,offset:o}=i);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!Da(e,c)||(s=Od(t.dom,e,c),!s))return null}if(it)for(let c=s;r&&c;c=Dr(c))c.draggable&&(r=void 0);if(s=Qb(s,e),r){if(jt&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&o++}let c;_o&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=ey(t,r,o,e))}a==null&&(a=Zb(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Md(t){return t.top<t.bottom||t.left<t.right}function In(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Md(r))return r}return Array.prototype.find.call(n,Md)||t.getBoundingClientRect()}const ny=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function xd(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=_o||jt;if(r.nodeType==3)if(s&&(ny.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let l=In(pn(r,o,o),n);if(jt&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=In(pn(r,o-1,o-1),-1);if(c.top==l.top){let u=In(pn(r,o,o+1),-1);if(u.top!=l.top)return Eo(u,u.left<c.left)}}return l}else{let l=o,c=o,u=n<0?1:-1;return n<0&&!o?(c++,u=-1):n>=0&&o==r.nodeValue.length?(l--,u=1):n<0?l--:c++,Eo(In(pn(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==Mt(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return Ba(l.getBoundingClientRect(),!1)}if(i==null&&o<Mt(r)){let l=r.childNodes[o];if(l.nodeType==1)return Ba(l.getBoundingClientRect(),!0)}return Ba(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==Mt(r))){let l=r.childNodes[o-1],c=l.nodeType==3?pn(l,Mt(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Eo(In(c,1),!1)}if(i==null&&o<Mt(r)){let l=r.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?pn(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return Eo(In(c,-1),!0)}return Eo(In(r.nodeType==3?pn(r):r,-n),n>=0)}function Eo(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ba(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Ld(t,e,n){let 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()}}function ry(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return Ld(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=xd(t,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=pn(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const oy=/[\u0590-\u08ac]/;function iy(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return a?!oy.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:Ld(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",n,"character");let m=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:b,focusOffset:k}=t.domSelectionRange(),_=b&&!m.contains(b.nodeType==1?b:b.parentNode)||l==b&&c==k;try{a.collapse(u,f),l&&(l!=u||c!=f)&&a.extend&&a.extend(l,c)}catch{}return p!=null&&(a.caretBidiLevel=p),_}):r.pos==r.start()||r.pos==r.end()}let Rd=null,Pd=null,Id=!1;function sy(t,e,n){return Rd==e&&Pd==n?Id:(Rd=e,Pd=n,Id=n=="up"||n=="down"?ry(t,e,n):iy(t,e,n))}const Lt=0,Dd=1,lr=2,Qt=3;class vo{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Lt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,s;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>Ge(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==e&&i!=r){for(;!o.border&&o.children.length;)for(let s=0;s<o.children.length;s++){let a=o.children[s];if(a.size){o=a;break}}return o}if(e<i)return o.descAt(e-r-o.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],a=i+s.size;if(a>e||s instanceof $d){o=e-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Bd&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Ge(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?Ge(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(o==-1&&e<=c){let u=s+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let f=a;f>0;f--){let p=this.children[f-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){o=Ge(p.dom)+1;break}e-=p.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){i=Ge(f.dom);break}n+=f.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let i=Math.min(e,n),s=Math.max(e,n);for(let m=0,b=0;m<this.children.length;m++){let k=this.children[m],_=b+k.size;if(i>b&&s<_)return k.setSelection(e-b-k.border,n-b-k.border,r,o);b=_}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),f=!1;if((jt||it)&&e==n){let{node:m,offset:b}=a;if(m.nodeType==3){if(f=!!(b&&m.nodeValue[b-1]==`
6
+ `),f&&b==m.nodeValue.length)for(let k=m,_;k;k=k.parentNode){if(_=k.nextSibling){_.nodeName=="BR"&&(a=l={node:_.parentNode,offset:Ge(_)+1});break}let E=k.pmViewDesc;if(E&&E.node&&E.node.isBlock)break}}else{let k=m.childNodes[b-1];f=k&&(k.nodeName=="BR"||k.contentEditable=="false")}}if(jt&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let m=u.focusNode.childNodes[u.focusOffset];m&&m.contentEditable=="false"&&(o=!0)}if(!(o||f&&it)&&sr(a.node,a.offset,u.anchorNode,u.anchorOffset)&&sr(l.node,l.offset,u.focusNode,u.focusOffset))return;let p=!1;if((c.extend||e==n)&&!f){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),p=!0}catch{}}if(!p){if(e>n){let b=a;a=l,l=b}let m=document.createRange();m.setEnd(l.node,l.offset),m.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(m)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+i.border,l=s-i.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?lr:Dd,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Qt:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?lr:Qt}r=s}this.dirty=lr}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?lr:Dd;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Bd extends vo{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==Lt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class ay extends vo{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class cr extends vo{constructor(e,n,r,o,i){super(e,[],r,o),this.mark=n,this.spec=i}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=or.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new cr(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Qt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Qt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Lt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Lt}}slice(e,n,r){let o=cr.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=$a(i,n,s,r)),e>0&&(i=$a(i,0,e,r));for(let a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Dn extends vo{constructor(e,n,r,o,i,s,a,l,c){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(e,n,r,o,i,s){let a=i.nodeViews[n.type.name],l,c=a&&a(n,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=or.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let p=u;return u=zd(u,r,n),c?l=new ly(e,n,r,o,u,f||null,p,c,i,s+1):n.isText?new Ni(e,n,r,o,u,p,i):new Dn(e,n,r,o,u,f||null,p,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>V.empty)}return e}matchesNode(e,n,r){return this.dirty==Lt&&e.eq(this.node)&&Ai(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new uy(this,s&&s.node,e);py(this.node,this.innerDeco,(c,u,f)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!f&&l.syncToMarks(u==this.node.childCount?_e.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,o)},(c,u,f,p)=>{l.syncToMarks(c.marks,r,e);let m;l.findNodeMatch(c,u,f,p)||a&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(m=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,u,f,m,e)||l.updateNextNode(c,u,f,e,p,o)||l.addNode(c,u,f,e,o),o+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==lr)&&(s&&this.protectLocalComposition(e,s),Vd(this.contentDOM,this.children,e),Br&&hy(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof te)||r<n||o>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,a=my(this.node.content,s,r-n,o-n);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;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=void 0)}let s=new ay(this,i,n,o);e.input.compositionNodes.push(s),this.children=$a(this.children,r,r+o.length,e,s)}update(e,n,r,o){return this.dirty==Qt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Lt}updateOuterDeco(e){if(Ai(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Hd(this.dom,this.nodeDOM,Fa(this.outerDeco,this.node,n),Fa(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Fd(t,e,n,r,o){zd(r,e,t);let i=new Dn(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Ni extends Dn{constructor(e,n,r,o,i,s,a){super(e,n,r,o,i,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==Qt||this.dirty!=Lt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Lt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=Lt,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),i=document.createTextNode(o.text);return new Ni(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Qt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class $d extends vo{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Lt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class ly extends Dn{constructor(e,n,r,o,i,s,a,l,c,u){super(e,n,r,o,i,s,a,c,u),this.spec=l}update(e,n,r,o){if(this.dirty==Qt)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Vd(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=jd(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(s instanceof cr){let l=r?r.previousSibling:t.lastChild;Vd(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=jd(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Co=function(t){t&&(this.nodeName=t)};Co.prototype=Object.create(null);const ur=[new Co];function Fa(t,e,n){if(t.length==0)return ur;let r=n?ur[0]:new Co,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new Co(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&o.length==1&&o.push(r=new Co(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return o}function Hd(t,e,n,r){if(n==ur&&r==ur)return e;let o=e;for(let i=0;i<r.length;i++){let s=r[i],a=n[i];if(i){let l;a&&a.nodeName==s.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(o),a=ur[0]),o=l}cy(o,a||ur[0],s)}return o}function cy(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&t.classList.add(o[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function zd(t,e,n){return Hd(t,t,ur,Fa(e,n,t.nodeType!=1))}function Ai(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function jd(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class uy{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=dy(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=Lt,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[i])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=cr.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,o,i){let s=this.top.children[o];return s.dirty==Qt&&s.dom==s.contentDOM&&(s.dirty=lr),s.update(e,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,i,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Dn){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let u=l.dom,f,p=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Qt&&Ai(n,l.outerDeco));if(!p&&l.update(e,n,r,o))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!p&&(f=this.recreateWrapper(l,e,n,r,o,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=lr,f.updateChildren(o,s+1),f.dirty=Lt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,i,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Ai(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let a=Dn.create(this.top,n,r,o,i,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,o,i){let s=Dn.create(this.top,e,n,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new Bd(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof cr;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ni)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((it||Xe)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new $d(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function dy(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof cr)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function fy(t,e){return t.type.side-e.type.side}function py(t,e,n,r){let o=e.locals(t),i=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,o,e.forChild(i,u),c),i+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,f;for(;s<o.length&&o[s].to==i;){let _=o[s++];_.widget&&(u?(f||(f=[u])).push(_):u=_)}if(u)if(f){f.sort(fy);for(let _=0;_<f.length;_++)n(f[_],c,!!l)}else n(u,c,!!l);let p,m;if(l)m=-1,p=l,l=null;else if(c<t.childCount)m=c,p=t.child(c++);else break;for(let _=0;_<a.length;_++)a[_].to<=i&&a.splice(_--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let b=i+p.nodeSize;if(p.isText){let _=b;s<o.length&&o[s].from<_&&(_=o[s].from);for(let E=0;E<a.length;E++)a[E].to<_&&(_=a[E].to);_<b&&(l=p.cut(_-i),p=p.cut(0,_-i),b=_,m=-1)}else for(;s<o.length&&o[s].to<b;)s++;let k=p.isInline&&!p.isLeaf?a.filter(_=>!_.inline):a.slice();r(p,k,e.forChild(i,p),m),i=b}}function hy(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function my(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<t.childCount;){let c=t.child(o++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function $a(t,e,n,r,o){let i=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,u=a+=l.size;c>=n||u<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function Va(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(Ti(n)){for(l=s;o&&!o.node;)o=o.parent;let f=o.node;if(o&&f.isAtom&&Q.isSelectable(f)&&o.parent&&!(f.isInline&&Hb(n.focusNode,n.focusOffset,o.dom))){let p=o.posBefore;c=new Q(s==p?a:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,p=s;for(let m=0;m<n.rangeCount;m++){let b=n.getRangeAt(m);f=Math.min(f,t.docView.posFromDOM(b.startContainer,b.startOffset,1)),p=Math.max(p,t.docView.posFromDOM(b.endContainer,b.endOffset,-1))}if(f<0)return null;[l,s]=p==t.state.selection.anchor?[p,f]:[f,p],a=r.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let f=e=="pointer"||t.state.selection.head<a.pos&&!i?1:-1;c=za(t,u,a,f)}return c}function Ud(t){return t.editable?t.hasFocus():Xd(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function gn(t,e=!1){let n=t.state.selection;if(Gd(t,n),!!Ud(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Xe){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&sr(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)by(t);else{let{anchor:r,head:o}=n,i,s;Wd&&!(n instanceof te)&&(n.$from.parent.inlineContent||(i=Kd(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=Kd(t,n.to))),t.docView.setSelection(r,o,t,e),Wd&&(i&&qd(i),s&&qd(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&gy(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Wd=it||Xe&&Cd<63;function Kd(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(it&&o&&o.contentEditable=="false")return Ha(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return Ha(o);if(i)return Ha(i)}}function Ha(t){return t.contentEditable="true",it&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function qd(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function gy(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Ud(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function by(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setStart(r.parentNode,Ge(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&pt&&Pn<=11&&(r.disabled=!0,r.disabled=!1)}function Gd(t,e){if(e instanceof Q){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Jd(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Jd(t)}function Jd(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function za(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||te.between(e,n,r)}function Yd(t){return t.editable&&!t.hasFocus()?!1:Xd(t)}function Xd(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function yy(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return sr(e.node,e.offset,n.anchorNode,n.anchorOffset)}function ja(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&ee.findFrom(i,e)}function Bn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Qd(t,e,n){let r=t.state.selection;if(r instanceof te)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return Bn(t,new te(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=ja(t.state,e);return o&&o instanceof Q?Bn(t,o):!1}else if(!(xt&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?Q.isSelectable(i)?Bn(t,new Q(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):_o?Bn(t,new te(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Q&&r.node.isInline)return Bn(t,new te(e>0?r.$to:r.$from));{let o=ja(t.state,e);return o?Bn(t,o):!1}}}function Oi(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function So(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function $r(t,e){return e<0?wy(t):ky(t)}function wy(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(jt&&n.nodeType==1&&r<Oi(n)&&So(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(So(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(Zd(n))break;{let a=n.previousSibling;for(;a&&So(a,-1);)o=n.parentNode,i=Ge(a),a=a.previousSibling;if(a)n=a,r=Oi(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Ua(t,n,r):o&&Ua(t,o,i)}function ky(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=Oi(n),i,s;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(So(a,1))i=n,s=++r;else break}else{if(Zd(n))break;{let a=n.nextSibling;for(;a&&So(a,1);)i=a.parentNode,s=Ge(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=Oi(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}i&&Ua(t,i,s)}function Zd(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function _y(t,e){for(;t&&e==t.childNodes.length&&!ko(t);)e=Ge(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function Ey(t,e){for(;t&&!e&&!ko(t);)e=Ge(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Ua(t,e,n){if(e.nodeType!=3){let i,s;(s=_y(e,n))?(e=s,n=0):(i=Ey(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Ti(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&gn(t)},50)}function ef(t,e){let n=t.state.doc.resolve(e);if(!(Xe||Ub)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function tf(t,e,n){let r=t.state.selection;if(r instanceof te&&!r.empty||n.indexOf("s")>-1||xt&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=ja(t.state,e);if(s&&s instanceof Q)return Bn(t,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=r instanceof Ot?ee.near(s,e):ee.findFrom(s,e);return a?Bn(t,a):!1}return!1}function nf(t,e){if(!(t.state.selection instanceof te))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function rf(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function vy(t){if(!it||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;rf(t,r,"true"),setTimeout(()=>rf(t,r,"false"),20)}return!1}function Cy(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Sy(t,e){let n=e.keyCode,r=Cy(e);if(n==8||xt&&n==72&&r=="c")return nf(t,-1)||$r(t,-1);if(n==46&&!e.shiftKey||xt&&n==68&&r=="c")return nf(t,1)||$r(t,1);if(n==13||n==27)return!0;if(n==37||xt&&n==66&&r=="c"){let o=n==37?ef(t,t.state.selection.from)=="ltr"?-1:1:-1;return Qd(t,o,r)||$r(t,o)}else if(n==39||xt&&n==70&&r=="c"){let o=n==39?ef(t,t.state.selection.from)=="ltr"?1:-1:1;return Qd(t,o,r)||$r(t,o)}else{if(n==38||xt&&n==80&&r=="c")return tf(t,-1,r)||$r(t,-1);if(n==40||xt&&n==78&&r=="c")return vy(t)||tf(t,1,r)||$r(t,1);if(r==(xt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Wa(t,e){t.someProp("transformCopied",m=>{e=m(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let m=r.firstChild;n.push(m.type.name,m.attrs!=m.type.defaultAttrs?m.attrs:null),r=m.content}let s=t.someProp("clipboardSerializer")||or.fromSchema(t.state.schema),a=ff(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,f=0;for(;c&&c.nodeType==1&&(u=uf[c.nodeName.toLowerCase()]);){for(let m=u.length-1;m>=0;m--){let b=a.createElement(u[m]);for(;l.firstChild;)b.appendChild(l.firstChild);l.appendChild(b),f++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${f?` -${f}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",m=>m(e,t))||e.content.textBetween(0,e.content.size,`
7
+
8
+ `);return{dom:l,text:p,slice:e}}function of(t,e,n,r,o){let i=o.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||i||!n);if(l){if(t.someProp("transformPastedText",p=>{e=p(e,i||r,t)}),i)return e?new W(V.from(t.state.schema.text(e.replace(/\r\n?/g,`
9
+ `))),0,0):W.empty;let f=t.someProp("clipboardTextParser",p=>p(e,o,r,t));if(f)a=f;else{let p=o.marks(),{schema:m}=t.state,b=or.fromSchema(m);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(k=>{let _=s.appendChild(document.createElement("p"));k&&_.appendChild(b.serializeNode(m.text(k,p)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=Oy(n),_o&&My(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let p=s.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;s=p}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Mr.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!Ty.test(p.parentNode.nodeName)?{ignore:!0}:null}})),u)a=xy(cf(a,+u[1],+u[2]),u[4]);else if(a=W.maxOpen(Ny(a.content,o),!0),a.openStart||a.openEnd){let f=0,p=0;for(let m=a.content.firstChild;f<a.openStart&&!m.type.spec.isolating;f++,m=m.firstChild);for(let m=a.content.lastChild;p<a.openEnd&&!m.type.spec.isolating;p++,m=m.lastChild);a=cf(a,f,p)}return t.someProp("transformPasted",f=>{a=f(a,t)}),a}const Ty=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Ny(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&af(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=lf(s[s.length-1],i.length));let u=sf(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return V.from(s)}return t}function sf(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,V.from(t));return t}function af(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=af(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(V.from(sf(n,t,o+1))))}}function lf(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,lf(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(V.empty,!0);return t.copy(n.append(r))}function Ka(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(i=0),o<r-1&&(a=Ka(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(V.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function cf(t,e,n){return e<t.openStart&&(t=new W(Ka(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new W(Ka(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const uf={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let df=null;function ff(){return df||(df=document.implementation.createHTMLDocument("title"))}let qa=null;function Ay(t){let e=window.trustedTypes;return e?(qa||(qa=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),qa.createHTML(t)):t}function Oy(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=ff().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&uf[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=Ay(t),o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function My(t){let e=t.querySelectorAll(Xe?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function xy(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=V.from(l.create(r[a+1],o)),i++,s++}return new W(o,i,s)}const st={},at={},Ly={touchstart:!0,touchmove:!0};class Ry{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Py(t){for(let e in st){let n=st[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{Dy(t,r)&&!Ja(t,r)&&(t.editable||!(r.type in at))&&n(t,r)},Ly[e]?{passive:!0}:void 0)}it&&t.dom.addEventListener("input",()=>null),Ga(t)}function Fn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Iy(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Ga(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Ja(t,r))})}function Ja(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function Dy(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function By(t,e){!Ja(t,e)&&st[e.type]&&(t.editable||!(e.type in at))&&st[e.type](t,e)}at.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!hf(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(hn&&Xe&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Br&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,ar(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||Sy(t,n)?n.preventDefault():Fn(t,"key")},at.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},at.keypress=(t,e)=>{let n=e;if(hf(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||xt&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof te)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode),i=()=>t.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,o,i))&&t.dispatch(i()),n.preventDefault()}};function Mi(t){return{left:t.clientX,top:t.clientY}}function Fy(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Ya(t,e,n,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,a=>s>i.depth?a(t,n,i.nodeAfter,i.before(s),o,!0):a(t,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function Vr(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function $y(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Q.isSelectable(r)?(Vr(t,new Q(n)),!0):!1}function Vy(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Q&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(Q.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(Vr(t,Q.create(t.state.doc,o)),!0):!1}function Hy(t,e,n,r,o){return Ya(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(o?Vy(t,n):$y(t,n))}function zy(t,e,n,r){return Ya(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function jy(t,e,n,r){return Ya(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||Uy(t,n,r)}function Uy(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Vr(t,te.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)Vr(t,te.create(r,a+1,a+1+s.content.size));else if(Q.isSelectable(s))Vr(t,Q.create(r,a));else continue;return!0}}function Xa(t){return xi(t)}const pf=xt?"metaKey":"ctrlKey";st.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Xa(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&Fy(n,t.input.lastClick)&&!n[pf]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i,button:n.button};let s=t.posAtCoords(Mi(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Wy(t,s,n,!!r)):(i=="doubleClick"?zy:jy)(t,s.pos,s.inside,n)?n.preventDefault():Fn(t,"pointer"))};class Wy{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[pf],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof Q&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&jt&&!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(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Fn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>gn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Mi(e))),this.updateAllowDefault(e),this.allowDefault||!n?Fn(this.view,"pointer"):Hy(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||it&&this.mightDrag&&!this.mightDrag.node.isAtom||Xe&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Vr(this.view,ee.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Fn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Fn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}st.touchstart=t=>{t.input.lastTouch=Date.now(),Xa(t),Fn(t,"pointer")},st.touchmove=t=>{t.input.lastTouch=Date.now(),Fn(t,"pointer")},st.contextmenu=t=>Xa(t);function hf(t,e){return t.composing?!0:it&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Ky=hn?5e3:-1;at.compositionstart=at.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof te&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),xi(t,!0),t.markCursor=null;else if(xi(t,!e.selection.empty),jt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else o=s,i=-1}}t.input.composing=!0}mf(t,Ky)},at.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,mf(t,20))};function mf(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>xi(t),e))}function gf(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Gy());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function qy(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=$b(e.focusNode,e.focusOffset),r=Vb(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function Gy(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function xi(t,e=!1){if(!(hn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),gf(t),e||t.docView&&t.docView.dirty){let n=Va(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function Jy(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const To=pt&&Pn<15||Br&&Wb<604;st.copy=at.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let i=To?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Wa(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):Jy(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Yy(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Xy(t,e){if(!t.dom.parentNode)return;let n=t.input.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();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?No(t,r.value,null,o,e):No(t,r.textContent,r.innerHTML,o,e)},50)}function No(t,e,n,r,o){let i=of(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,i||W.empty)))return!0;if(!i)return!1;let s=Yy(i),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function bf(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}at.paste=(t,e)=>{let n=e;if(t.composing&&!hn)return;let r=To?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&No(t,bf(r),r.getData("text/html"),o,n)?n.preventDefault():Xy(t,n)};class yf{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Qy=xt?"altKey":"ctrlKey";function wf(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[Qy]}st.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(Mi(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof Q?o.to-1:o.to))){if(r&&r.mightDrag)s=Q.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=Q.create(t.state.doc,f.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:u}=Wa(t,a);(!n.dataTransfer.files.length||!Xe||Cd>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(To?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",To||n.dataTransfer.setData("text/plain",c),t.dragging=new yf(u,wf(t,n),s)},st.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},at.dragover=at.dragenter=(t,e)=>e.preventDefault(),at.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(Mi(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",b=>{s=b(s,t)}):s=of(t,bf(n.dataTransfer),To?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&wf(t,n));if(t.someProp("handleDrop",b=>b(t,n,s||W.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?Nb(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=t.state.tr;if(a){let{node:b}=r;b?b.replace(c):c.deleteSelection()}let u=c.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=c.doc;if(f?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(p))return;let m=c.doc.resolve(u);if(f&&Q.isSelectable(s.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Q(m));else{let b=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((k,_,E,N)=>b=N),c.setSelection(za(t,m,c.doc.resolve(b)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},st.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&gn(t)},20))},st.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},st.beforeinput=(t,e)=>{if(Xe&&hn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,ar(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in at)st[t]=at[t];function Ao(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Li{constructor(e,n){this.toDOM=e,this.spec=n||dr,this.side=this.spec.side||0}map(e,n,r,o){let{pos:i,deleted:s}=e.mapResult(n.from+o,this.side<0?-1:1);return s?null:new lt(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Li&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ao(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class $n{constructor(e,n){this.attrs=e,this.spec=n||dr}map(e,n,r,o){let i=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new lt(i,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof $n&&Ao(this.attrs,e.attrs)&&Ao(this.spec,e.spec)}static is(e){return e.type instanceof $n}destroy(){}}class Qa{constructor(e,n){this.attrs=e,this.spec=n||dr}map(e,n,r,o){let i=e.mapResult(n.from+o,1);if(i.deleted)return null;let s=e.mapResult(n.to+o,-1);return s.deleted||s.pos<=i.pos?null:new lt(i.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),i;return o==n.from&&!(i=e.child(r)).isText&&o+i.nodeSize==n.to}eq(e){return this==e||e instanceof Qa&&Ao(this.attrs,e.attrs)&&Ao(this.spec,e.spec)}destroy(){}}class lt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new lt(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new lt(e,e,new Li(n,r))}static inline(e,n,r,o){return new lt(e,n,new $n(r,o))}static node(e,n,r,o){return new lt(e,n,new Qa(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof $n}get widget(){return this.type instanceof Li}}const Hr=[],dr={};class Le{constructor(e,n){this.local=e.length?e:Hr,this.children=n.length?n:Hr}static create(e,n){return n.length?Ri(n,e,0,dr):Qe}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,o+a,i)}}map(e,n,r){return this==Qe||e.maps.length==0?this:this.mapInner(e,n,0,0,r||dr)}mapInner(e,n,r,o,i){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,o);l&&l.type.valid(n,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?Zy(this.children,s||[],e,n,r,o,i):s?new Le(s.sort(fr),Hr):Qe}add(e,n){return n.length?this==Qe?Le.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,i=0;e.forEach((a,l)=>{let c=l+r,u;if(u=_f(n,a,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<l;)i+=3;o[i]==l?o[i+2]=o[i+2].addInner(a,u,c+1):o.splice(i,0,l,l+a.nodeSize,Ri(u,a,c+1,dr)),i+=3}});let s=kf(i?Ef(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Le(s.length?this.local.concat(s).sort(fr):this.local,o||this.children)}remove(e){return e.length==0||this==Qe?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,a=r[i]+n,l=r[i+1]+n;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>a&&f.to<l&&(e[u]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(s,a+1);c!=Qe?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<e.length;i++)if(s=e[i])for(let a=0;a<o.length;a++)o[a].eq(s,n)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new Le(o,r):Qe}forChild(e,n){if(this==Qe)return this;if(n.isLeaf)return Le.empty;let r,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let i=e+1,s=i+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>i&&l.type instanceof $n){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;c<u&&(o||(o=[])).push(l.copy(c,u))}}if(o){let a=new Le(o.sort(fr),Hr);return r?new Vn([a,r]):a}return r||Qe}eq(e){if(this==e)return!0;if(!(e instanceof Le)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Za(this.localsInner(e))}localsInner(e){if(this==Qe)return Hr;if(e.inlineContent||!this.local.some($n.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof $n||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Le.empty=new Le([],[]),Le.removeOverlap=Za;const Qe=Le.empty;class Vn{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,dr));return Vn.from(r)}forChild(e,n){if(n.isLeaf)return Le.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,n);i!=Qe&&(i instanceof Vn?r=r.concat(i.members):r.push(i))}return Vn.from(r)}eq(e){if(!(e instanceof Vn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?Za(r?n:n.sort(fr)):Hr}static from(e){switch(e.length){case 0:return Qe;case 1:return e[0];default:return new Vn(e.every(n=>n instanceof Le)?e:e.reduce((n,r)=>n.concat(r instanceof Le?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function Zy(t,e,n,r,o,i,s){let a=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let f=0;n.maps[c].forEach((p,m,b,k)=>{let _=k-b-(m-p);for(let E=0;E<a.length;E+=3){let N=a[E+1];if(N<0||p>N+u-f)continue;let A=a[E]+u-f;m>=A?a[E+1]=p<=A?-2:-1:p>=u&&_&&(a[E]+=_,a[E+1]+=_)}f+=_}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(t[c]+i),f=u-o;if(f<0||f>=r.content.size){l=!0;continue}let p=n.map(t[c+1]+i,-1),m=p-o,{index:b,offset:k}=r.content.findIndex(f),_=r.maybeChild(b);if(_&&k==f&&k+_.nodeSize==m){let E=a[c+2].mapInner(n,_,u+1,t[c]+i+1,s);E!=Qe?(a[c]=f,a[c+1]=m,a[c+2]=E):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=ew(a,t,e,n,o,i,s),u=Ri(c,r,0,s);e=u.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,p=0;f<u.children.length;f+=3){let m=u.children[f];for(;p<a.length&&a[p]<m;)p+=3;a.splice(p,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Le(e.sort(fr),a)}function kf(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new lt(o.from+e,o.to+e,o.type))}return n}function ew(t,e,n,r,o,i,s){function a(l,c){for(let u=0;u<l.local.length;u++){let f=l.local[u].map(r,o,c);f?n.push(f):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+i+1);return n}function _f(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let i=0,s;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function Ef(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Ri(t,e,n,r){let o=[],i=!1;e.forEach((a,l)=>{let c=_f(t,a,l+n);if(c){i=!0;let u=Ri(c,a,n+l+1,r);u!=Qe&&o.push(l,l+a.nodeSize,u)}});let s=kf(i?Ef(t):t,-n).sort(fr);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new Le(s,o):Qe}function fr(t,e){return t.from-e.from||t.to-e.to}function Za(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),vf(e,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),vf(e,o,r.copy(i.from,r.to)));break}}}return e}function vf(t,e,n){for(;e<t.length&&fr(n,t[e])>0;)e++;t.splice(e,0,n)}function el(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Qe&&e.push(r)}),t.cursorWrapper&&e.push(Le.create(t.state.doc,[t.cursorWrapper.deco])),Vn.from(e)}const tw={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},nw=pt&&Pn<=11;class rw{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class ow{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new rw,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);pt&&Pn<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),nw&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,tw)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Yd(this.view)){if(this.suppressingSelectionUpdates)return gn(this.view);if(pt&&Pn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&sr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=Dr(i))n.add(i);for(let i=e.anchorNode;i;i=Dr(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Yd(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let f=this.registerMutation(n[u],l);f&&(i=i<0?f.from:Math.min(f.from,i),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(a=!0))}if(jt&&l.length){let u=l.filter(f=>f.nodeName=="BR");if(u.length==2){let[f,p]=u;f.parentNode&&f.parentNode.parentNode==p.parentNode?p.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let p of u){let m=p.parentNode;m&&m.nodeName=="LI"&&(!f||aw(e,f)!=m)&&p.remove()}}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Ti(r)&&(c=Va(e))&&c.eq(ee.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,gn(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),iw(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||gn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let f=e.addedNodes[u];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,i=e.nextSibling;if(pt&&Pn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:p}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(o=f),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(i=p)}let s=o&&o.parentNode==e.target?Ge(o)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=i&&i.parentNode==e.target?Ge(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Cf=new WeakMap,Sf=!1;function iw(t){if(!Cf.has(t)&&(Cf.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=jt,Sf)return;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."),Sf=!0}}function Tf(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return sr(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function sw(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return Tf(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Tf(t,n):null}function aw(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function lw(t,e,n){let{node:r,fromOffset:o,toOffset:i,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],Ti(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Xe&&t.input.lastKeyCode===8)for(let _=i;_>o;_--){let E=r.childNodes[_-1],N=E.pmViewDesc;if(E.nodeName=="BR"&&!N){i=_;break}if(!N||N.size)break}let f=t.state.doc,p=t.someProp("domParser")||Mr.fromSchema(t.state.schema),m=f.resolve(s),b=null,k=p.parse(r,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:o,to:i,preserveWhitespace:m.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:cw,context:m});if(c&&c[0].pos!=null){let _=c[0].pos,E=c[1]&&c[1].pos;E==null&&(E=_),b={anchor:_+s,head:E+s}}return{doc:k,sel:b,from:s,to:a}}function cw(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(it&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||it&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const uw=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function dw(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let v=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,S=Va(t,v);if(S&&!t.state.selection.eq(S)){if(Xe&&hn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",M=>M(t,ar(13,"Enter"))))return;let C=t.state.tr.setSelection(S);v=="pointer"?C.setMeta("pointer",!0):v=="key"&&C.scrollIntoView(),i&&C.setMeta("composition",i),t.dispatch(C)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=lw(t,e,n),u=t.state.doc,f=u.slice(c.from,c.to),p,m;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(p=t.state.selection.to,m="end"):(p=t.state.selection.from,m="start"),t.input.lastKeyCode=null;let b=hw(f.content,c.doc.content,c.from,p,m);if(b&&t.input.domChangeCount++,(Br&&t.input.lastIOSEnter>Date.now()-225||hn)&&o.some(v=>v.nodeType==1&&!uw.test(v.nodeName))&&(!b||b.endA>=b.endB)&&t.someProp("handleKeyDown",v=>v(t,ar(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!b)if(r&&l instanceof te&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))b={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let v=Nf(t,t.state.doc,c.sel);if(v&&!v.eq(t.state.selection)){let S=t.state.tr.setSelection(v);i&&S.setMeta("composition",i),t.dispatch(S)}}return}t.state.selection.from<t.state.selection.to&&b.start==b.endB&&t.state.selection instanceof te&&(b.start>t.state.selection.from&&b.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?b.start=t.state.selection.from:b.endA<t.state.selection.to&&b.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),pt&&Pn<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>c.from&&c.doc.textBetween(b.start-c.from-1,b.start-c.from+1)=="  "&&(b.start--,b.endA--,b.endB--);let k=c.doc.resolveNoCache(b.start-c.from),_=c.doc.resolveNoCache(b.endB-c.from),E=u.resolve(b.start),N=k.sameParent(_)&&k.parent.inlineContent&&E.end()>=b.endA,A;if((Br&&t.input.lastIOSEnter>Date.now()-225&&(!N||o.some(v=>v.nodeName=="DIV"||v.nodeName=="P"))||!N&&k.pos<c.doc.content.size&&(!k.sameParent(_)||!k.parent.inlineContent)&&!/\S/.test(c.doc.textBetween(k.pos,_.pos,"",""))&&(A=ee.findFrom(c.doc.resolve(k.pos+1),1,!0))&&A.head>k.pos)&&t.someProp("handleKeyDown",v=>v(t,ar(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>b.start&&pw(u,b.start,b.endA,k,_)&&t.someProp("handleKeyDown",v=>v(t,ar(8,"Backspace")))){hn&&Xe&&t.domObserver.suppressSelectionUpdates();return}Xe&&b.endB==b.start&&(t.input.lastChromeDelete=Date.now()),hn&&!N&&k.start()!=_.start()&&_.parentOffset==0&&k.depth==_.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==b.endA&&(b.endB-=2,_=c.doc.resolveNoCache(b.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(v){return v(t,ar(13,"Enter"))})},20));let d=b.start,g=b.endA,h=v=>{let S=v||t.state.tr.replace(d,g,c.doc.slice(b.start-c.from,b.endB-c.from));if(c.sel){let C=Nf(t,S.doc,c.sel);C&&!(Xe&&t.composing&&C.empty&&(b.start!=b.endB||t.input.lastChromeDelete<Date.now()-100)&&(C.head==d||C.head==S.mapping.map(g)-1)||pt&&C.empty&&C.head==d)&&S.setSelection(C)}return i&&S.setMeta("composition",i),S.scrollIntoView()},w;if(N){if(k.pos==_.pos){pt&&Pn<=11&&k.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>gn(t),20));let v=h(t.state.tr.delete(d,g)),S=u.resolve(b.start).marksAcross(u.resolve(b.endA));S&&v.ensureMarks(S),t.dispatch(v)}else if(b.endA==b.endB&&(w=fw(k.parent.content.cut(k.parentOffset,_.parentOffset),E.parent.content.cut(E.parentOffset,b.endA-E.start())))){let v=h(t.state.tr);w.type=="add"?v.addMark(d,g,w.mark):v.removeMark(d,g,w.mark),t.dispatch(v)}else if(k.parent.child(k.index()).isText&&k.index()==_.index()-(_.textOffset?0:1)){let v=k.parent.textBetween(k.parentOffset,_.parentOffset),S=()=>h(t.state.tr.insertText(v,d,g));t.someProp("handleTextInput",C=>C(t,d,g,v,S))||t.dispatch(S())}}else t.dispatch(h())}function Nf(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:za(t,e.resolve(n.anchor),e.resolve(n.head))}function fw(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,i=r,s,a,l;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(o.length==1&&i.length==0)a=o[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(V.from(c).eq(t))return{mark:a,type:s}}function pw(t,e,n,r,o){if(n-e<=o.pos-r.pos||tl(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let a=i.nodeAfter;return a!=null&&n==e+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(tl(i,!0,!0));return!s.parent.isTextblock||s.pos>n||tl(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function tl(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function hw(t,e,n,r,o){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));r-=s+l-i}if(s<i&&t.size<e.size){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<e.size&&Af(e.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i}else if(a<i){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<t.size&&Af(t.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}function Af(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class Of{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Ry,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Pf),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Lf(this),xf(this),this.nodeViews=Rf(this),this.docView=Fd(this.state.doc,Mf(this),el(this),this.dom,this),this.domObserver=new ow(this,(r,o,i,s)=>dw(this,r,o,i,s)),this.domObserver.start(),Py(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ga(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Pf),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(gf(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let m=Rf(this);gw(m,this.nodeViews)&&(this.nodeViews=m,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Ga(this),this.editable=Lf(this),xf(this);let l=el(this),c=Mf(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",f=i||!this.docView.matchesNode(e.doc,c,l);(f||!e.selection.eq(o.selection))&&(s=!0);let p=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Gb(this);if(s){this.domObserver.stop();let m=f&&(pt||Xe)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&mw(o.selection,e.selection);if(f){let b=Xe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=qy(this)),(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Fd(e.doc,c,l,this.dom,this)),b&&!this.trackWrites&&(m=!0)}m||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&yy(this))?gn(this,m):(Gd(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():p&&Jb(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Q){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Sd(this,n.getBoundingClientRect(),e)}else Sd(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new yf(e.slice,e.move,o<0?void 0:Q.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(o=n?n(a):a))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let a=i[s].props[e];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(pt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Yb(this.dom),gn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return ty(this,e)}coordsAtPos(e,n=1){return xd(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return sy(this,n||this.state,e)}pasteHTML(e,n){return No(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return No(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Wa(this,e)}destroy(){this.docView&&(Iy(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],el(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Bb())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return By(this,e)}domSelectionRange(){let e=this.domSelection();return e?it&&this.root.nodeType===11&&zb(this.dom.ownerDocument)==this.dom&&sw(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Of.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Mf(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[lt.node(0,t.state.doc.content.size,e)]}function xf(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:lt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Lf(t){return!t.someProp("editable",e=>e(t.state)===!1)}function mw(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Rf(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function gw(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function Pf(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Hn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Pi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},bw=typeof navigator<"u"&&/Mac/.test(navigator.platform),yw=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Je=0;Je<10;Je++)Hn[48+Je]=Hn[96+Je]=String(Je);for(var Je=1;Je<=24;Je++)Hn[Je+111]="F"+Je;for(var Je=65;Je<=90;Je++)Hn[Je]=String.fromCharCode(Je+32),Pi[Je]=String.fromCharCode(Je);for(var nl in Hn)Pi.hasOwnProperty(nl)||(Pi[nl]=Hn[nl]);function ww(t){var e=bw&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||yw&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Pi:Hn)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const kw=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),_w=typeof navigator<"u"&&/Win/.test(navigator.platform);function Ew(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))kw?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function vw(t){let e=Object.create(null);for(let n in t)e[Ew(n)]=t[n];return e}function rl(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Cw(t){return new $e({props:{handleKeyDown:ol(t)}})}function ol(t){let e=vw(t);return function(n,r){let o=ww(r),i,s=e[rl(o,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[rl(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(_w&&r.ctrlKey&&r.altKey)&&(i=Hn[r.keyCode])&&i!=o){let a=e[rl(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const il=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function If(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Df=(t,e,n)=>{let r=If(t,n);if(!r)return!1;let o=sl(r);if(!o){let s=r.blockRange(),a=s&&xr(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(Wf(t,o,e,-1))return!0;if(r.parent.content.size==0&&(zr(i,"end")||Q.isSelectable(i)))for(let s=r.depth;;s--){let a=vi(t.doc,r.before(s),r.after(s),W.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(zr(i,"end")?ee.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):Q.create(l.doc,o.pos-i.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},Sw=(t,e,n)=>{let r=If(t,n);if(!r)return!1;let o=sl(r);return o?Bf(t,o,e):!1},Tw=(t,e,n)=>{let r=$f(t,n);if(!r)return!1;let o=al(r);return o?Bf(t,o,e):!1};function Bf(t,e,n){let r=e.nodeBefore,o=r,i=e.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let u=o.lastChild;if(!u)return!1;o=u}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=vi(t.doc,i,l,W.empty);if(!c||c.from!=i||c instanceof ze&&c.slice.size>=l-i)return!1;if(n){let u=t.tr.step(c);u.setSelection(te.create(u.doc,i)),n(u.scrollIntoView())}return!0}function zr(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const Ff=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=sl(r)}let s=i&&i.nodeBefore;return!s||!Q.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Q.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function sl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function $f(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const Vf=(t,e,n)=>{let r=$f(t,n);if(!r)return!1;let o=al(r);if(!o)return!1;let i=o.nodeAfter;if(Wf(t,o,e,1))return!0;if(r.parent.content.size==0&&(zr(i,"start")||Q.isSelectable(i))){let s=vi(t.doc,r.before(),r.after(),W.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(zr(i,"start")?ee.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):Q.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},Hf=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=al(r)}let s=i&&i.nodeAfter;return!s||!Q.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Q.create(t.doc,i.pos)).scrollIntoView()),!0)};function al(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const Nw=(t,e)=>{let n=t.selection,r=n instanceof Q,o;if(r){if(n.node.isTextblock||!Ln(t.doc,n.from))return!1;o=n.from}else if(o=Ei(t.doc,n.from,-1),o==null)return!1;if(e){let i=t.tr.join(o);r&&i.setSelection(Q.create(i.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},Aw=(t,e)=>{let n=t.selection,r;if(n instanceof Q){if(n.node.isTextblock||!Ln(t.doc,n.to))return!1;r=n.to}else if(r=Ei(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Ow=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&xr(o);return i==null?!1:(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)},zf=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
10
+ `).scrollIntoView()),!0)};function ll(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Mw=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=ll(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(ee.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},jf=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Ot||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=ll(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(s,i.createAndFill());a.setSelection(te.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},Uf=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(fn(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&xr(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function xw(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof Q&&e.selection.node.isBlock)return!r.parentOffset||!fn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],s,a,l=!1,c=!1;for(let m=r.depth;;m--)if(r.node(m).isBlock){l=r.end(m)==r.pos+(r.depth-m),c=r.start(m)==r.pos-(r.depth-m),a=ll(r.node(m-1).contentMatchAt(r.indexAfter(m-1))),i.unshift(l&&a?{type:a}:null),s=m;break}else{if(m==1)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof te||e.selection instanceof Ot)&&u.deleteSelection();let f=u.mapping.map(r.pos),p=fn(u.doc,f,i.length,i);if(p||(i[0]=a?{type:a}:null,p=fn(u.doc,f,i.length,i)),!p)return!1;if(u.split(f,i.length,i),!l&&c&&r.node(s).type!=a){let m=u.mapping.map(r.before(s)),b=u.doc.resolve(m);a&&r.node(s-1).canReplaceWith(b.index(),b.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(s)),a)}return n&&n(u.scrollIntoView()),!0}}const Lw=xw(),Rw=(t,e)=>{let{$from:n,to:r}=t.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),e&&e(t.tr.setSelection(Q.create(t.doc,o))),!0)};function Pw(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!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||Ln(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function Wf(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,a,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&Pw(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&a.matchType(s[0]||i.type).validEnd){if(n){let m=e.pos+i.nodeSize,b=V.empty;for(let E=s.length-1;E>=0;E--)b=V.from(s[E].create(null,b));b=V.from(o.copy(b));let k=t.tr.step(new je(e.pos-1,m,e.pos,m,new W(b,1,0),s.length,!0)),_=k.doc.resolve(m+2*s.length);_.nodeAfter&&_.nodeAfter.type==o.type&&Ln(k.doc,_.pos)&&k.join(_.pos),n(k.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&l?null:ee.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),p=f&&xr(f);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(f,p).scrollIntoView()),!0;if(c&&zr(i,"start",!0)&&zr(o,"end")){let m=o,b=[];for(;b.push(m),!m.isTextblock;)m=m.lastChild;let k=i,_=1;for(;!k.isTextblock;k=k.firstChild)_++;if(m.canReplace(m.childCount,m.childCount,k.content)){if(n){let E=V.empty;for(let A=b.length-1;A>=0;A--)E=V.from(b[A].copy(E));let N=t.tr.step(new je(e.pos-b.length,e.pos+i.nodeSize,e.pos+_,e.pos+i.nodeSize-_,new W(E,b.length,0),0,!0));n(N.scrollIntoView())}return!0}}return!1}function Kf(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(te.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const Iw=Kf(-1),Dw=Kf(1);function Bw(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&Ca(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function qf(t,e=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[i];n.doc.nodesBetween(s,a,(l,c)=>{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)o=!0;else{let u=n.doc.resolve(c),f=u.index();o=u.parent.canReplaceWith(f,f+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];i.setBlockType(a,l,t,e)}r(i.scrollIntoView())}return!0}}function cl(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}cl(il,Df,Ff),cl(il,Vf,Hf),cl(zf,jf,Uf,Lw),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Fw(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i);if(!s)return!1;let a=r?n.tr:null;return $w(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function $w(t,e,n,r=null){let o=!1,i=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=s.resolve(e.start-2);i=new gi(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new gi(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let a=Ca(i,n,r,e);return a?(t&&Vw(t,e,a,o,n),!0):!1}function Vw(t,e,n,r,o){let i=V.empty;for(let u=n.length-1;u>=0;u--)i=V.from(n[u].type.create(n[u].attrs,i));t.step(new je(e.start-(r?2:0),e.end,e.start,e.end,new W(i,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==o&&(s=u+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,f=e.endIndex,p=!0;u<f;u++,p=!1)!p&&fn(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function Hw(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?zw(e,n,t,i):jw(e,n,i):!0:!1}}function zw(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new je(i-1,s,i,s,new W(V.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new gi(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=xr(r);if(a==null)return!1;o.lift(r,a);let l=o.doc.resolve(o.mapping.map(i,-1)-1);return Ln(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos),e(o.scrollIntoView()),!0}function jw(t,e,n){let r=t.tr,o=n.parent;for(let m=n.end,b=n.endIndex-1,k=n.startIndex;b>k;b--)m-=o.child(b).nodeSize,r.delete(m-1,m+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?V.empty:V.from(o))))return!1;let f=i.pos,p=f+s.nodeSize;return r.step(new je(f-(a?1:0),p+(l?1:0),f+1,p-1,new W((a?V.empty:V.from(o.copy(V.empty))).append(l?V.empty:V.from(o.copy(V.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function Uw(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=V.from(c?t.create():null),f=new W(V.from(t.create(null,V.from(a.type.create(null,u)))),c?3:1,0),p=i.start,m=i.end;n(e.tr.step(new je(p-(c?3:1),m,p,m,f,1,!0)).scrollIntoView())}return!0}}function Ii(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}class Di{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const f=l(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a=[],l=!!e,c=e||i.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(p=>p===!0)),f={...Object.fromEntries(Object.entries(r).map(([p,m])=>[p,(...k)=>{const _=this.buildProps(c,n),E=m(...k)(_);return a.push(E),f}])),run:u};return f}createCan(e){const{rawCommands:n,state:r}=this,o=!1,i=e||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a={tr:e,editor:o,view:s,state:Ii({state:i,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class Ww{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(o=>o!==n):delete this.callbacks[e]),this}once(e,n){const r=(...o)=>{this.off(e,r),n.apply(this,o)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function J(t,e,n){return t.config[e]===void 0&&t.parent?J(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?J(t.parent,e,n):null}):t.config[e]}function Bi(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Gf(t){const e=[],{nodeExtensions:n,markExtensions:r}=Bi(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:o},l=J(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([p,m])=>{e.push({type:f,name:p,attribute:{...i,...m}})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=J(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,f])=>{const p={...i,...f};typeof p?.default=="function"&&(p.default=p.default()),p?.isRequired&&p?.default===void 0&&delete p.default,e.push({type:s.name,name:u,attribute:p})})}),e}function We(t,e){if(typeof t=="string"){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 Ce(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const a=i?i.split(" "):[],l=r[o]?r[o].split(" "):[],c=a.filter(u=>!l.includes(u));r[o]=[...l,...c].join(" ")}else if(o==="style"){const a=i?i.split(";").map(u=>u.trim()).filter(Boolean):[],l=r[o]?r[o].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;l.forEach(u=>{const[f,p]=u.split(":").map(m=>m.trim());c.set(f,p)}),a.forEach(u=>{const[f,p]=u.split(":").map(m=>m.trim());c.set(f,p)}),r[o]=Array.from(c.entries()).map(([u,f])=>`${u}: ${f}`).join("; ")}else r[o]=i}),r},{})}function ul(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Ce(n,r),{})}function Jf(t){return typeof t=="function"}function ie(t,e=void 0,...n){return Jf(t)?e?t.bind(e)(...n):t(...n):t}function Kw(t={}){return Object.keys(t).length===0&&t.constructor===Object}function qw(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Yf(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):qw(n.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return{...r,...o}}}}function Xf(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&Kw(n)?!1:n!=null))}function Gw(t,e){var n;const r=Gf(t),{nodeExtensions:o,markExtensions:i}=Bi(t),s=(n=o.find(c=>J(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(o.map(c=>{const u=r.filter(E=>E.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((E,N)=>{const A=J(N,"extendNodeSchema",f);return{...E,...A?A(c):{}}},{}),m=Xf({...p,content:ie(J(c,"content",f)),marks:ie(J(c,"marks",f)),group:ie(J(c,"group",f)),inline:ie(J(c,"inline",f)),atom:ie(J(c,"atom",f)),selectable:ie(J(c,"selectable",f)),draggable:ie(J(c,"draggable",f)),code:ie(J(c,"code",f)),whitespace:ie(J(c,"whitespace",f)),linebreakReplacement:ie(J(c,"linebreakReplacement",f)),defining:ie(J(c,"defining",f)),isolating:ie(J(c,"isolating",f)),attrs:Object.fromEntries(u.map(E=>{var N;return[E.name,{default:(N=E?.attribute)===null||N===void 0?void 0:N.default}]}))}),b=ie(J(c,"parseHTML",f));b&&(m.parseDOM=b.map(E=>Yf(E,u)));const k=J(c,"renderHTML",f);k&&(m.toDOM=E=>k({node:E,HTMLAttributes:ul(E,u)}));const _=J(c,"renderText",f);return _&&(m.toText=_),[c.name,m]})),l=Object.fromEntries(i.map(c=>{const u=r.filter(_=>_.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((_,E)=>{const N=J(E,"extendMarkSchema",f);return{..._,...N?N(c):{}}},{}),m=Xf({...p,inclusive:ie(J(c,"inclusive",f)),excludes:ie(J(c,"excludes",f)),group:ie(J(c,"group",f)),spanning:ie(J(c,"spanning",f)),code:ie(J(c,"code",f)),attrs:Object.fromEntries(u.map(_=>{var E;return[_.name,{default:(E=_?.attribute)===null||E===void 0?void 0:E.default}]}))}),b=ie(J(c,"parseHTML",f));b&&(m.parseDOM=b.map(_=>Yf(_,u)));const k=J(c,"renderHTML",f);return k&&(m.toDOM=_=>k({mark:_,HTMLAttributes:ul(_,u)})),[c.name,m]}));return new zu({topNode:s,nodes:a,marks:l})}function dl(t,e){return e.nodes[t]||e.marks[t]||null}function Qf(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function fl(t,e){const n=or.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}const Jw=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,a)=>{var l,c;const u=((c=(l=o.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:o,pos:i,parent:s,index:a}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-i))}),n};function pl(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Fi{constructor(e){this.find=e.find,this.handler=e.handler}}const Yw=(t,e)=>{if(pl(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function $i(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(p=>p.type.spec.code))return!1;let u=!1;const f=Jw(c)+i;return s.forEach(p=>{if(u)return;const m=Yw(f,p.find);if(!m)return;const b=l.state.tr,k=Ii({state:l.state,transaction:b}),_={from:r-(m[0].length-i.length),to:o},{commands:E,chain:N,can:A}=new Di({editor:n,state:k});p.handler({state:k,range:_,match:m,commands:E,chain:N,can:A})===null||!b.steps.length||(b.setMeta(a,{transform:b,from:r,to:o,text:i}),l.dispatch(b),u=!0)}),u}function Xw(t){const{editor:e,rules:n}=t,r=new $e({state:{init(){return null},apply(o,i,s){const a=o.getMeta(r);if(a)return a;const l=o.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:u}=l;typeof u=="string"?u=u:u=fl(V.from(u),s.schema);const{from:f}=l,p=f+u.length;$i({editor:e,from:f,to:p,text:u,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,a){return $i({editor:e,from:i,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&$i({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?$i({editor:e,from:s.pos,to:s.pos,text:`
11
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Qw(t){return Object.prototype.toString.call(t).slice(8,-1)}function Vi(t){return Qw(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Hi(t,e){const n={...t};return Vi(t)&&Vi(e)&&Object.keys(e).forEach(r=>{Vi(e[r])&&Vi(t[r])?n[r]=Hi(t[r],e[r]):n[r]=e[r]}),n}class ht{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ie(J(this,"addOptions",{name:this.name}))),this.storage=ie(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ht(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Hi(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new ht(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ie(J(n,"addOptions",{name:n.name})),n.storage=ie(J(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const s=o.marks();if(!!!s.find(c=>c?.type.name===n.name))return!1;const l=s.find(c=>c?.type.name===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}}function Zw(t){return typeof t=="number"}class ek{constructor(e){this.find=e.find,this.handler=e.handler}}const tk=(t,e,n)=>{if(pl(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const i=[o.text];return i.index=o.index,i.input=t,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function nk(t){const{editor:e,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:u}=new Di({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,o,(m,b)=>{if(!m.isTextblock||m.type.spec.code)return;const k=Math.max(r,b),_=Math.min(o,b+m.content.size),E=m.textBetween(k-b,_-b,void 0,"");tk(E,i.find,s).forEach(A=>{if(A.index===void 0)return;const d=k+A.index+1,g=d+A[0].length,h={from:n.tr.mapping.map(d),to:n.tr.mapping.map(g)},w=i.handler({state:n,range:h,match:A,commands:l,chain:c,can:u,pasteEvent:s,dropEvent:a});f.push(w)})}),f.every(m=>m!==null)}const rk=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function ok(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:u,from:f,to:p,rule:m,pasteEvt:b})=>{const k=u.tr,_=Ii({state:u,transaction:k});if(!(!nk({editor:e,state:_,from:Math.max(f-1,0),to:p.b-1,rule:m,pasteEvent:b,dropEvent:a})||!k.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,k}};return n.map(u=>new $e({view(f){const p=m=>{var b;r=!((b=f.dom.parentElement)===null||b===void 0)&&b.contains(m.target)?f.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(f,p)=>(i=r===f.dom.parentElement,a=p,!1),paste:(f,p)=>{var m;const b=(m=p.clipboardData)===null||m===void 0?void 0:m.getData("text/html");return s=p,o=!!b?.includes("data-pm-slice"),!1}}},appendTransaction:(f,p,m)=>{const b=f[0],k=b.getMeta("uiEvent")==="paste"&&!o,_=b.getMeta("uiEvent")==="drop"&&!i,E=b.getMeta("applyPasteRules"),N=!!E;if(!k&&!_&&!N)return;if(N){let{text:g}=E;typeof g=="string"?g=g:g=fl(V.from(g),m.schema);const{from:h}=E,w=h+g.length,v=rk(g);return l({rule:u,state:m,from:h,to:{b:w},pasteEvt:v})}const A=p.doc.content.findDiffStart(m.doc.content),d=p.doc.content.findDiffEnd(m.doc.content);if(!(!Zw(A)||!d||A===d.b))return l({rule:u,state:m,from:A,to:d,pasteEvt:s})}}))}function ik(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class jr{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=jr.resolve(e),this.schema=Gw(this.extensions,n),this.setupExtensions()}static resolve(e){const n=jr.sort(jr.flatten(e)),r=ik(n.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},o=J(n,"addExtensions",r);return o?[n,...this.flatten(o())]:n}).flat(10)}static sort(e){return e.sort((r,o)=>{const i=J(r,"priority")||100,s=J(o,"priority")||100;return i>s?-1:i<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:dl(n.name,this.schema)},o=J(n,"addCommands",r);return o?{...e,...o()}:e},{})}get plugins(){const{editor:e}=this,n=jr.sort([...this.extensions].reverse()),r=[],o=[],i=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:dl(s.name,this.schema)},l=[],c=J(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&J(s,"exitable",a)&&(u.ArrowRight=()=>ht.handleExit({editor:e,mark:s})),c){const k=Object.fromEntries(Object.entries(c()).map(([_,E])=>[_,()=>E({editor:e})]));u={...u,...k}}const f=Cw(u);l.push(f);const p=J(s,"addInputRules",a);Qf(s,e.options.enableInputRules)&&p&&r.push(...p());const m=J(s,"addPasteRules",a);Qf(s,e.options.enablePasteRules)&&m&&o.push(...m());const b=J(s,"addProseMirrorPlugins",a);if(b){const k=b();l.push(...k)}return l}).flat();return[Xw({editor:e,rules:r}),...ok({editor:e,rules:o}),...i]}get attributes(){return Gf(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Bi(this.extensions);return Object.fromEntries(n.filter(r=>!!J(r,"addNodeView")).map(r=>{const o=this.attributes.filter(l=>l.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:e,type:We(r.name,this.schema)},s=J(r,"addNodeView",i);if(!s)return[];const a=(l,c,u,f,p)=>{const m=ul(l,o);return s()({node:l,view:c,getPos:u,decorations:f,innerDecorations:p,editor:e,extension:r,HTMLAttributes:m})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:dl(e.name,this.schema)};e.type==="mark"&&(!((n=ie(J(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const o=J(e,"onBeforeCreate",r),i=J(e,"onCreate",r),s=J(e,"onUpdate",r),a=J(e,"onSelectionUpdate",r),l=J(e,"onTransaction",r),c=J(e,"onFocus",r),u=J(e,"onBlur",r),f=J(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}}class Ke{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ie(J(this,"addOptions",{name:this.name}))),this.storage=ie(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ke(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Hi(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Ke({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ie(J(n,"addOptions",{name:n.name})),n.storage=ie(J(n,"addStorage",{name:n.name,options:n.options})),n}}function Zf(t,e,n){const{from:r,to:o}=e,{blockSeparator:i=`
12
+
13
+ `,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,o,(l,c,u,f)=>{var p;l.isBlock&&c>r&&(a+=i);const m=s?.[l.type.name];if(m)return u&&(a+=m({node:l,pos:c,parent:u,index:f,range:e})),!1;l.isText&&(a+=(p=l?.text)===null||p===void 0?void 0:p.slice(Math.max(r,c)-c,o-c))}),a}function hl(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const sk=Ke.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new $e({key:new Ue("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map(u=>u.$from.pos)),a=Math.max(...i.map(u=>u.$to.pos)),l=hl(n);return Zf(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),ak=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),lk=(t=!1)=>({commands:e})=>e.setContent("",t),ck=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:i,$to:s})=>{t.doc.nodesBetween(i.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,f=c.resolve(u.map(l)),p=c.resolve(u.map(l+a.nodeSize)),m=f.blockRange(p);if(!m)return;const b=xr(m);if(a.type.isTextblock){const{defaultType:k}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(m.start,k)}(b||b===0)&&e.lift(m,b)})}),!0},uk=t=>e=>t(e),dk=()=>({state:t,dispatch:e})=>jf(t,e),fk=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,i.content),r.setSelection(new te(r.doc.resolve(s-1))),!0},pk=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(e){const a=o.before(i),l=o.after(i);t.delete(a,l).scrollIntoView()}return!0}return!1},hk=t=>({tr:e,state:n,dispatch:r})=>{const o=We(t,n.schema),i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const l=i.before(s),c=i.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1},mk=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},gk=()=>({state:t,dispatch:e})=>il(t,e),bk=()=>({commands:t})=>t.keyboardShortcut("Enter"),yk=()=>({state:t,dispatch:e})=>Mw(t,e);function zi(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:pl(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function ep(t,e,n={}){return t.find(r=>r.type===e&&zi(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function tp(t,e,n={}){return!!ep(t,e,n)}function ml(t,e,n){var r;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(u=>u.type===e))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(u=>u.type===e)||(n=n||((r=o.node.marks[0])===null||r===void 0?void 0:r.attrs),!ep([...o.node.marks],e,n)))return;let s=o.index,a=t.start()+o.offset,l=s+1,c=a+o.node.nodeSize;for(;s>0&&tp([...t.parent.child(s-1).marks],e,n);)s-=1,a-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&tp([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function zn(t,e){if(typeof t=="string"){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}const wk=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const i=zn(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const f=ml(l,i,e);if(f&&f.from<=c&&f.to>=u){const p=te.create(s,f.from,f.to);n.setSelection(p)}}return!0},kk=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function gl(t){return t instanceof te}function bn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function np(t,e=null){if(!e)return null;const n=ee.atStart(t),r=ee.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,i=r.to;return e==="all"?te.create(t,bn(0,o,i),bn(t.content.size,o,i)):te.create(t,bn(e,o,i),bn(e,o,i))}function bl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const _k=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{bl()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(i&&t===null&&!gl(n.state.selection))return s(),!0;const a=np(o.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},Ek=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),vk=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),rp=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&rp(r)}return t};function ji(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return rp(n)}function Ui(t,e,n){if(t instanceof On||t instanceof V)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return V.fromArray(t.map(a=>e.nodeFromJSON(a)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),Ui("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!1,a="";const l=new zu({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Mr.fromSchema(l).parseSlice(ji(t),n.parseOptions):Mr.fromSchema(l).parse(ji(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=Mr.fromSchema(e);return n.slice?i.parseSlice(ji(t),n.parseOptions).content:i.parse(ji(t),n.parseOptions)}return Ui("",e,n)}function Ck(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof ze||o instanceof je))return;const i=t.mapping.maps[r];let s=0;i.forEach((a,l,c,u)=>{s===0&&(s=u)}),t.setSelection(ee.near(t.doc.resolve(s),n))}const Sk=t=>!("type"in t),Tk=(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=Ui(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:i.options.enableContentCheck})}catch(b){return i.emit("contentError",{editor:i,error:b,disableCollaboration:()=>{i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}}),!1}let{from:l,to:c}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,f=!0;if((Sk(a)?a:[a]).forEach(b=>{b.check(),u=u?b.isText&&b.marks.length===0:!1,f=f?b.isBlock:!1}),l===c&&f){const{parent:b}=r.doc.resolve(l);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(l-=1,c+=1)}let m;if(u){if(Array.isArray(e))m=e.map(b=>b.text||"").join("");else if(e instanceof V){let b="";e.forEach(k=>{k.text&&(b+=k.text)}),m=b}else typeof e=="object"&&e&&e.text?m=e.text:m=e;r.insertText(m,l,c)}else m=a,r.replaceWith(l,c,m);n.updateSelection&&Ck(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:m}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:m})}return!0},Nk=()=>({state:t,dispatch:e})=>Nw(t,e),Ak=()=>({state:t,dispatch:e})=>Aw(t,e),Ok=()=>({state:t,dispatch:e})=>Df(t,e),Mk=()=>({state:t,dispatch:e})=>Vf(t,e),xk=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Ei(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Lk=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Ei(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Rk=()=>({state:t,dispatch:e})=>Sw(t,e),Pk=()=>({state:t,dispatch:e})=>Tw(t,e);function op(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Ik(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,i,s;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))bl()||op()?s=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}const Dk=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const i=Ik(t).split(/-(?!$)/),s=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l?.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function Oo(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?We(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,(f,p)=>{if(f.isText)return;const m=Math.max(r,p),b=Math.min(o,p+f.nodeSize);a.push({node:f,from:m,to:b})});const l=o-r,c=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>zi(f.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((f,p)=>f+p.to-p.from,0)>=l}const Bk=(t,e={})=>({state:n,dispatch:r})=>{const o=We(t,n.schema);return Oo(n,o,e)?Ow(n,r):!1},Fk=()=>({state:t,dispatch:e})=>Uf(t,e),$k=t=>({state:e,dispatch:n})=>{const r=We(t,e.schema);return Hw(r)(e,n)},Vk=()=>({state:t,dispatch:e})=>zf(t,e);function Wi(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function ip(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const Hk=(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Wi(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=We(t,r.schema)),a==="mark"&&(s=zn(t,r.schema)),o&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{i&&i===c.type&&n.setNodeMarkup(u,void 0,ip(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(f=>{s===f.type&&n.addMark(u,u+c.nodeSize,s.create(ip(f.attrs,e)))})})}),!0):!1},zk=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),jk=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),Uk=()=>({state:t,dispatch:e})=>Ff(t,e),Wk=()=>({state:t,dispatch:e})=>Hf(t,e),Kk=()=>({state:t,dispatch:e})=>Rw(t,e),qk=()=>({state:t,dispatch:e})=>Dw(t,e),Gk=()=>({state:t,dispatch:e})=>Iw(t,e);function yl(t,e,n={},r={}){return Ui(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const Jk=(t,e=!1,n={},r={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{var l,c;const{doc:u}=i;if(n.preserveWhitespace!=="full"){const f=yl(t,o.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:o.options.enableContentCheck});return s&&i.replaceWith(0,u.content.size,f).setMeta("preventUpdate",!e),!0}return s&&i.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function wl(t,e){const n=zn(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function Yk(t,e){const n=new Na(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function Xk(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Qk(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,i)=>{n(o)&&r.push({node:o,pos:i})}),r}function sp(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}}}function kl(t){return e=>sp(e.$from,t)}function ap(t,e){const n={from:0,to:t.content.size};return Zf(t,n,e)}function Zk(t,e){const n=We(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function lp(t,e){const n=Wi(typeof e=="string"?e:e.name,t.schema);return n==="node"?Zk(t,e):n==="mark"?wl(t,e):{}}function e1(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function t1(t){const e=e1(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,s)=>s!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function n1(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,i)=>{const s=[];if(o.ranges.length)o.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[i];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const c=e.slice(i).map(a,-1),u=e.slice(i).map(l),f=e.invert().map(c,-1),p=e.invert().map(u);r.push({oldRange:{from:f,to:p},newRange:{from:c,to:u}})})}),t1(r)}function _l(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const i=n.resolve(t),s=ml(i,o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(t,e,(o,i)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function Ki(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function El(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?zn(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>i?i.name===f.type.name:!0).find(f=>zi(f.attrs,n,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:f,$to:p})=>{const m=f.pos,b=p.pos;t.doc.nodesBetween(m,b,(k,_)=>{if(!k.isText&&!k.marks.length)return;const E=Math.max(m,_),N=Math.min(b,_+k.nodeSize),A=N-E;s+=A,a.push(...k.marks.map(d=>({mark:d,from:E,to:N})))})}),s===0)return!1;const l=a.filter(f=>i?i.name===f.mark.type.name:!0).filter(f=>zi(f.mark.attrs,n,{strict:!1})).reduce((f,p)=>f+p.to-p.from,0),c=a.filter(f=>i?f.mark.type!==i&&f.mark.type.excludes(i):!0).reduce((f,p)=>f+p.to-p.from,0);return(l>0?l+c:l)>=s}function r1(t,e,n={}){if(!e)return Oo(t,null,n)||El(t,null,n);const r=Wi(e,t.schema);return r==="node"?Oo(t,e,n):r==="mark"?El(t,e,n):!1}function cp(t,e){const{nodeExtensions:n}=Bi(e),r=n.find(s=>s.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=ie(J(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function vl(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(i=>{o!==!1&&(vl(i,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function o1(t){return t instanceof Q}function up(t,e,n){const o=t.state.doc.content.size,i=bn(e,0,o),s=bn(n,0,o),a=t.coordsAtPos(i),l=t.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),f=Math.min(a.left,l.left),p=Math.max(a.right,l.right),m=p-f,b=u-c,E={top:c,bottom:u,left:f,right:p,width:m,height:b,x:f,y:c};return{...E,toJSON:()=>E}}function i1(t,e,n){var r;const{selection:o}=e;let i=null;if(gl(o)&&(i=o.$cursor),i){const a=(r=t.storedMarks)!==null&&r!==void 0?r:i.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=o;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,f,p)=>{if(c)return!1;if(u.isInline){const m=!p||p.type.allowsMarkType(n),b=!!n.isInSet(u.marks)||!u.marks.some(k=>k.type.excludes(n));c=m&&b}return!c}),c})}const s1=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=zn(t,r.schema);if(o)if(s){const c=wl(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(u,f,(p,m)=>{const b=Math.max(m,u),k=Math.min(m+p.nodeSize,f);p.marks.find(E=>E.type===l)?p.marks.forEach(E=>{l===E.type&&n.addMark(b,k,l.create({...E.attrs,...e}))}):n.addMark(b,k,l.create(e))})});return i1(r,n,l)},a1=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),l1=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=We(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),i.isTextblock?o().command(({commands:a})=>qf(i,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>qf(i,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},c1=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=bn(t,0,r.content.size),i=Q.create(r,o);e.setSelection(i)}return!0},u1=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:i}=typeof t=="number"?{from:t,to:t}:t,s=te.atStart(r).from,a=te.atEnd(r).to,l=bn(o,s,a),c=bn(i,s,a),u=te.create(r,l,c);e.setSelection(u)}return!0},d1=t=>({state:e,dispatch:n})=>{const r=We(t,e.schema);return Uw(r)(e,n)};function dp(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e?.includes(o.type.name));t.tr.ensureMarks(r)}}const f1=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=o.extensionManager.attributes,u=Ki(c,a.node().type.name,a.node().attrs);if(i instanceof Q&&i.node.isBlock)return!a.parentOffset||!fn(s,a.pos)?!1:(r&&(t&&dp(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=l.parentOffset===l.parent.content.size,p=a.depth===0?void 0:Xk(a.node(-1).contentMatchAt(a.indexAfter(-1)));let m=f&&p?[{type:p,attrs:u}]:void 0,b=fn(e.doc,e.mapping.map(a.pos),1,m);if(!m&&!b&&fn(e.doc,e.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(b=!0,m=p?[{type:p,attrs:u}]:void 0),r){if(b&&(i instanceof te&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,m),p&&!f&&!a.parentOffset&&a.parent.type!==p)){const k=e.mapping.map(a.before()),_=e.doc.resolve(k);a.node(-1).canReplaceWith(_.index(),_.index()+1,p)&&e.setNodeMarkup(e.mapping.map(a.before()),p)}t&&dp(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return b},p1=(t,e={})=>({tr:n,state:r,dispatch:o,editor:i})=>{var s;const a=We(t,r.schema),{$from:l,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const f=l.node(-1);if(f.type!==a)return!1;const p=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){let E=V.empty;const N=l.index(-1)?1:l.index(-2)?2:3;for(let v=l.depth-N;v>=l.depth-3;v-=1)E=V.from(l.node(v).copy(E));const A=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,d={...Ki(p,l.node().type.name,l.node().attrs),...e},g=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(d))||void 0;E=E.append(V.from(a.createAndFill(null,g)||void 0));const h=l.before(l.depth-(N-1));n.replace(h,l.after(-A),new W(E,4-N,0));let w=-1;n.doc.nodesBetween(h,n.doc.content.size,(v,S)=>{if(w>-1)return!1;v.isTextblock&&v.content.size===0&&(w=S+1)}),w>-1&&n.setSelection(te.near(n.doc.resolve(w))),n.scrollIntoView()}return!0}const m=c.pos===l.end()?f.contentMatchAt(0).defaultType:null,b={...Ki(p,f.type.name,f.attrs),...e},k={...Ki(p,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const _=m?[{type:a,attrs:b},{type:m,attrs:k}]:[{type:a,attrs:b}];if(!fn(n.doc,l.pos,2))return!1;if(o){const{selection:E,storedMarks:N}=r,{splittableMarks:A}=i.extensionManager,d=N||E.$to.parentOffset&&E.$from.marks();if(n.split(l.pos,2,_).scrollIntoView(),!d||!o)return!0;const g=d.filter(h=>A.includes(h.type.name));n.ensureMarks(g)}return!0},Cl=(t,e)=>{const n=kl(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&Ln(t.doc,n.pos)&&t.join(n.pos),!0},Sl=(t,e)=>{const n=kl(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&Ln(t.doc,r)&&t.join(r),!0};var h1=Object.freeze({__proto__:null,blur:ak,clearContent:lk,clearNodes:ck,command:uk,createParagraphNear:dk,cut:fk,deleteCurrentNode:pk,deleteNode:hk,deleteRange:mk,deleteSelection:gk,enter:bk,exitCode:yk,extendMarkRange:wk,first:kk,focus:_k,forEach:Ek,insertContent:vk,insertContentAt:Tk,joinBackward:Ok,joinDown:Ak,joinForward:Mk,joinItemBackward:xk,joinItemForward:Lk,joinTextblockBackward:Rk,joinTextblockForward:Pk,joinUp:Nk,keyboardShortcut:Dk,lift:Bk,liftEmptyBlock:Fk,liftListItem:$k,newlineInCode:Vk,resetAttributes:Hk,scrollIntoView:zk,selectAll:jk,selectNodeBackward:Uk,selectNodeForward:Wk,selectParentNode:Kk,selectTextblockEnd:qk,selectTextblockStart:Gk,setContent:Jk,setMark:s1,setMeta:a1,setNode:l1,setNodeSelection:c1,setTextSelection:u1,sinkListItem:d1,splitBlock:f1,splitListItem:p1,toggleList:(t,e,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:f,splittableMarks:p}=o.extensionManager,m=We(t,s.schema),b=We(e,s.schema),{selection:k,storedMarks:_}=s,{$from:E,$to:N}=k,A=E.blockRange(N),d=_||k.$to.parentOffset&&k.$from.marks();if(!A)return!1;const g=kl(h=>cp(h.type.name,f))(k);if(A.depth>=1&&g&&A.depth-g.depth<=1){if(g.node.type===m)return c.liftListItem(b);if(cp(g.node.type.name,f)&&m.validContent(g.node.content)&&a)return l().command(()=>(i.setNodeMarkup(g.pos,m),!0)).command(()=>Cl(i,m)).command(()=>Sl(i,m)).run()}return!n||!d||!a?l().command(()=>u().wrapInList(m,r)?!0:c.clearNodes()).wrapInList(m,r).command(()=>Cl(i,m)).command(()=>Sl(i,m)).run():l().command(()=>{const h=u().wrapInList(m,r),w=d.filter(v=>p.includes(v.type.name));return i.ensureMarks(w),h?!0:c.clearNodes()}).wrapInList(m,r).command(()=>Cl(i,m)).command(()=>Sl(i,m)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=zn(t,r.schema);return El(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const i=We(t,r.schema),s=We(e,r.schema),a=Oo(r,i,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?o.setNode(s,l):o.setNode(i,{...l,...n})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=We(t,n.schema);return Oo(n,o,e)?r.lift(o):r.wrapIn(o,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const s=t.tr,a=i.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(i.text){const l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else s.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=zn(t,r.schema),{$from:c,empty:u,ranges:f}=a;if(!o)return!0;if(u&&s){let{from:p,to:m}=a;const b=(i=c.marks().find(_=>_.type===l))===null||i===void 0?void 0:i.attrs,k=ml(c,l,b);k&&(p=k.from,m=k.to),n.removeMark(p,m,l)}else f.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,l)});return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Wi(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=We(t,r.schema)),a==="mark"&&(s=zn(t,r.schema)),o&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;let f,p,m,b;n.selection.empty?r.doc.nodesBetween(c,u,(k,_)=>{i&&i===k.type&&(m=Math.max(_,c),b=Math.min(_+k.nodeSize,u),f=_,p=k)}):r.doc.nodesBetween(c,u,(k,_)=>{_<c&&i&&i===k.type&&(m=Math.max(_,c),b=Math.min(_+k.nodeSize,u),f=_,p=k),_>=c&&_<=u&&(i&&i===k.type&&n.setNodeMarkup(_,void 0,{...k.attrs,...e}),s&&k.marks.length&&k.marks.forEach(E=>{if(s===E.type){const N=Math.max(_,c),A=Math.min(_+k.nodeSize,u);n.addMark(N,A,s.create({...E.attrs,...e}))}}))}),p&&(f!==void 0&&n.setNodeMarkup(f,void 0,{...p.attrs,...e}),s&&p.marks.length&&p.marks.forEach(k=>{s===k.type&&n.addMark(m,b,s.create({...k.attrs,...e}))}))}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const o=We(t,n.schema);return Bw(o,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const o=We(t,n.schema);return Fw(o,e)(n,r)}});const m1=Ke.create({name:"commands",addCommands(){return{...h1}}}),g1=Ke.create({name:"drop",addProseMirrorPlugins(){return[new $e({key:new Ue("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),b1=Ke.create({name:"editable",addProseMirrorPlugins(){return[new $e({key:new Ue("editable"),props:{editable:()=>this.editor.options.editable}})]}}),y1=Ke.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new $e({key:new Ue("focusEvents"),props:{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}}}})]}}),w1=Ke.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:u,$anchor:f}=l,{pos:p,parent:m}=f,b=f.parent.isTextblock&&p>0?a.doc.resolve(p-1):f,k=b.parent.type.spec.isolating,_=f.pos-f.parentOffset,E=k&&b.parent.childCount===1?_===f.pos:ee.atStart(c).from===p;return!u||!m.type.isTextblock||m.textContent.length||!E||E&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return bl()||op()?i:o},addProseMirrorPlugins(){return[new $e({key:new Ue("clearDocument"),appendTransaction:(t,e,n)=>{const r=t.some(k=>k.docChanged)&&!e.doc.eq(n.doc),o=t.some(k=>k.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:s,to:a}=e.selection,l=ee.atStart(e.doc).from,c=ee.atEnd(e.doc).to;if(i||!(s===l&&a===c)||!vl(n.doc))return;const p=n.tr,m=Ii({state:n,transaction:p}),{commands:b}=new Di({editor:this.editor,state:m});if(b.clearNodes(),!!p.steps.length)return p}})]}}),k1=Ke.create({name:"paste",addProseMirrorPlugins(){return[new $e({key:new Ue("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),_1=Ke.create({name:"tabindex",addProseMirrorPlugins(){return[new $e({key:new Ue("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class pr{get name(){return this.node.type.name}constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new pr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new pr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new pr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=this.pos+r+(i?0:1),a=this.resolvedPos.doc.resolve(s);if(!o&&a.depth<=this.depth)return;const l=new pr(a,this.editor,o,o?n:null);o&&(l.actualDepth=this.depth+1),e.push(new pr(a,this.editor,o,o?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const i=o.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const l=s[a];if(i[l]!==n[l])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const i=Object.keys(n);return this.children.forEach(s=>{r&&o.length>0||(s.node.type.name===e&&i.every(l=>n[l]===s.node.attrs[l])&&o.push(s),!(r&&o.length>0)&&(o=o.concat(s.querySelectorAll(e,n,r))))}),o}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const E1=`.ProseMirror {
14
14
  position: relative;
15
15
  }
16
16
 
@@ -84,60 +84,249 @@ img.ProseMirror-separator {
84
84
 
85
85
  .tippy-box[data-animation=fade][data-state=hidden] {
86
86
  opacity: 0
87
- }`;function kE(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}let CE=class extends zb{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),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),this.on("drop",({event:n,slice:r,moved:o})=>this.options.onDrop(n,r,o)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=kE(wE,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=Bf(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(s=>{const i=typeof s=="string"?`${s}$`:s.key;r=n.filter(l=>!l.key.startsWith(i))}),n.length===r.length)return;const o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}createExtensionManager(){var e,n;const o=[...this.options.enableCoreExtensions?[mE,o1.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),pE,gE,yE,EE,hE,bE].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s?.type));this.extensionManager=new Ur(o,this)}createCommandManager(){this.commandManager=new Ps({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=ha(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(i){if(!(i instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(i.message))throw i;this.emit("contentError",{editor:this,error:i,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(l=>l.name!=="collaboration"),this.createExtensionManager()}}),n=ha(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=jf(n,this.options.autofocus);this.view=new yf(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Ir.create({doc:n,selection:r||void 0})});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.prependClass();const s=this.view.dom;s.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(i=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(i)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const o=e.getMeta("focus"),s=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),s&&this.emit("blur",{editor:this,event:s.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Yf(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,o=typeof e=="string"?n:e;return tE(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return aa(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
87
+ }`;function v1(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}let C1=class extends Ww{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),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),this.on("drop",({event:n,slice:r,moved:o})=>this.options.onDrop(n,r,o)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=v1(E1,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=Jf(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;r=n.filter(a=>!a.key.startsWith(s))}),n.length===r.length)return;const o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}createExtensionManager(){var e,n;const o=[...this.options.enableCoreExtensions?[b1,sk.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),m1,y1,w1,_1,g1,k1].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i?.type));this.extensionManager=new jr(o,this)}createCommandManager(){this.commandManager=new Di({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=yl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(a=>a.name!=="collaboration"),this.createExtensionManager()}}),n=yl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=np(n,this.options.autofocus);this.view=new Of(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Ir.create({doc:n,selection:r||void 0})});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const o=e.getMeta("focus"),i=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return lp(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,o=typeof e=="string"?n:e;return r1(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return fl(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
88
88
 
89
- `,textSerializers:r={}}=e||{};return Gf(this.state.doc,{blockSeparator:n,textSerializers:{...ua(this.schema),...r}})}get isEmpty(){return Ea(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new fr(n,this)}get $doc(){return this.$pos(0)}};function pr(t){return new Fs({find:t.find,handler:({state:e,range:n,match:r})=>{const o=G(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:s}=e,i=r[r.length-1],l=r[0];if(i){const a=l.search(/\S/),c=n.from+l.indexOf(i),u=c+i.length;if(ya(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===t.type&&m!==p.mark.type)).filter(p=>p.to>c).length)return null;u<n.to&&s.delete(u,n.to),c>n.from&&s.delete(n.from+a,c);const f=n.from+a+i.length;s.addMark(n.from+a,f,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function SE(t){return new Fs({find:t.find,handler:({state:e,range:n,match:r})=>{const o=G(t.getAttributes,void 0,r)||{},{tr:s}=e,i=n.from;let l=n.to;const a=t.type.create(o);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=i+c;u>l?u=l:l=u+r[1].length;const d=r[0][r[0].length-1];s.insertText(d,i+r[0].length-1),s.replaceWith(u,l,a)}else if(r[0]){const c=t.type.isInline?i:i-1;s.insert(c,t.type.create(o)).delete(s.mapping.map(i),s.mapping.map(l))}s.scrollIntoView()}})}function Ca(t){return new Fs({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),s=G(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})}function Ao(t){return new Fs({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const s=G(t.getAttributes,void 0,r)||{},i=e.tr.delete(n.from,n.to),a=i.doc.resolve(n.from).blockRange(),c=a&&wl(a,t.type,s);if(!c)return null;if(i.wrap(a,c),t.keepMarks&&t.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:p}=t.editor.extensionManager,h=f||d.$to.parentOffset&&d.$from.marks();if(h){const m=h.filter(y=>p.includes(y.type.name));i.ensureMarks(m)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(d,s).run()}const u=i.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&_n(i.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&i.join(n.from-1)}})}class Fe{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=G(F(this,"addOptions",{name:this.name}))),this.storage=G(F(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Fe(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Hs(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Fe(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=G(F(n,"addOptions",{name:n.name})),n.storage=G(F(n,"addStorage",{name:n.name,options:n.options})),n}}function Hn(t){return new Qb({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const s=G(t.getAttributes,void 0,r,o);if(s===!1||s===null)return null;const{tr:i}=e,l=r[r.length-1],a=r[0];let c=n.to;if(l){const u=a.search(/\S/),d=n.from+a.indexOf(l),f=d+l.length;if(ya(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(y=>y===t.type&&y!==h.mark.type)).filter(h=>h.to>d).length)return null;f<n.to&&i.delete(f,n.to),d>n.from&&i.delete(n.from+u,d),c=n.from+u+l.length,i.addMark(n.from+u,c,t.type.create(s||{})),i.removeStoredMark(t.type)}}})}var st="top",xt="bottom",Tt="right",it="left",Sa="auto",_o=[st,xt,Tt,it],zr="start",Mo="end",vE="clippingParents",ep="viewport",Ro="popper",xE="reference",tp=_o.reduce(function(t,e){return t.concat([e+"-"+zr,e+"-"+Mo])},[]),np=[].concat(_o,[Sa]).reduce(function(t,e){return t.concat([e,e+"-"+zr,e+"-"+Mo])},[]),TE="beforeRead",OE="read",NE="afterRead",AE="beforeMain",_E="main",ME="afterMain",RE="beforeWrite",LE="write",IE="afterWrite",DE=[TE,OE,NE,AE,_E,ME,RE,LE,IE];function Jt(t){return t?(t.nodeName||"").toLowerCase():null}function mt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function hr(t){var e=mt(t).Element;return t instanceof e||t instanceof Element}function Ot(t){var e=mt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function va(t){if(typeof ShadowRoot>"u")return!1;var e=mt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function PE(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},s=e.elements[n];!Ot(s)||!Jt(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(i){var l=o[i];l===!1?s.removeAttribute(i):s.setAttribute(i,l===!0?"":l)}))})}function BE(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(r){var o=e.elements[r],s=e.attributes[r]||{},i=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=i.reduce(function(a,c){return a[c]="",a},{});!Ot(o)||!Jt(o)||(Object.assign(o.style,l),Object.keys(s).forEach(function(a){o.removeAttribute(a)}))})}}const rp={name:"applyStyles",enabled:!0,phase:"write",fn:PE,effect:BE,requires:["computeStyles"]};function Gt(t){return t.split("-")[0]}var mr=Math.max,qs=Math.min,jr=Math.round;function xa(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function op(){return!/^((?!chrome|android).)*safari/i.test(xa())}function Wr(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),o=1,s=1;e&&Ot(t)&&(o=t.offsetWidth>0&&jr(r.width)/t.offsetWidth||1,s=t.offsetHeight>0&&jr(r.height)/t.offsetHeight||1);var i=hr(t)?mt(t):window,l=i.visualViewport,a=!op()&&n,c=(r.left+(a&&l?l.offsetLeft:0))/o,u=(r.top+(a&&l?l.offsetTop:0))/s,d=r.width/o,f=r.height/s;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Ta(t){var e=Wr(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 sp(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&va(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function gn(t){return mt(t).getComputedStyle(t)}function FE(t){return["table","td","th"].indexOf(Jt(t))>=0}function Un(t){return((hr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Js(t){return Jt(t)==="html"?t:t.assignedSlot||t.parentNode||(va(t)?t.host:null)||Un(t)}function ip(t){return!Ot(t)||gn(t).position==="fixed"?null:t.offsetParent}function $E(t){var e=/firefox/i.test(xa()),n=/Trident/i.test(xa());if(n&&Ot(t)){var r=gn(t);if(r.position==="fixed")return null}var o=Js(t);for(va(o)&&(o=o.host);Ot(o)&&["html","body"].indexOf(Jt(o))<0;){var s=gn(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function Lo(t){for(var e=mt(t),n=ip(t);n&&FE(n)&&gn(n).position==="static";)n=ip(n);return n&&(Jt(n)==="html"||Jt(n)==="body"&&gn(n).position==="static")?e:n||$E(t)||e}function Oa(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Io(t,e,n){return mr(t,qs(e,n))}function VE(t,e,n){var r=Io(t,e,n);return r>n?n:r}function lp(){return{top:0,right:0,bottom:0,left:0}}function ap(t){return Object.assign({},lp(),t)}function cp(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var HE=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,ap(typeof e!="number"?e:cp(e,_o))};function UE(t){var e,n=t.state,r=t.name,o=t.options,s=n.elements.arrow,i=n.modifiersData.popperOffsets,l=Gt(n.placement),a=Oa(l),c=[it,Tt].indexOf(l)>=0,u=c?"height":"width";if(!(!s||!i)){var d=HE(o.padding,n),f=Ta(s),p=a==="y"?st:it,h=a==="y"?xt:Tt,m=n.rects.reference[u]+n.rects.reference[a]-i[a]-n.rects.popper[u],y=i[a]-n.rects.reference[a],b=Lo(s),w=b?a==="y"?b.clientHeight||0:b.clientWidth||0:0,k=m/2-y/2,E=d[p],x=w-f[u]-d[h],v=w/2-f[u]/2+k,T=Io(E,v,x),_=a;n.modifiersData[r]=(e={},e[_]=T,e.centerOffset=T-v,e)}}function zE(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||sp(e.elements.popper,o)&&(e.elements.arrow=o))}const jE={name:"arrow",enabled:!0,phase:"main",fn:UE,effect:zE,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Kr(t){return t.split("-")[1]}var WE={top:"auto",right:"auto",bottom:"auto",left:"auto"};function KE(t,e){var n=t.x,r=t.y,o=e.devicePixelRatio||1;return{x:jr(n*o)/o||0,y:jr(r*o)/o||0}}function up(t){var e,n=t.popper,r=t.popperRect,o=t.placement,s=t.variation,i=t.offsets,l=t.position,a=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,f=i.x,p=f===void 0?0:f,h=i.y,m=h===void 0?0:h,y=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=y.x,m=y.y;var b=i.hasOwnProperty("x"),w=i.hasOwnProperty("y"),k=it,E=st,x=window;if(c){var v=Lo(n),T="clientHeight",_="clientWidth";if(v===mt(n)&&(v=Un(n),gn(v).position!=="static"&&l==="absolute"&&(T="scrollHeight",_="scrollWidth")),v=v,o===st||(o===it||o===Tt)&&s===Mo){E=xt;var P=d&&v===x&&x.visualViewport?x.visualViewport.height:v[T];m-=P-r.height,m*=a?1:-1}if(o===it||(o===st||o===xt)&&s===Mo){k=Tt;var V=d&&v===x&&x.visualViewport?x.visualViewport.width:v[_];p-=V-r.width,p*=a?1:-1}}var Z=Object.assign({position:l},c&&WE),q=u===!0?KE({x:p,y:m},mt(n)):{x:p,y:m};if(p=q.x,m=q.y,a){var re;return Object.assign({},Z,(re={},re[E]=w?"0":"",re[k]=b?"0":"",re.transform=(x.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",re))}return Object.assign({},Z,(e={},e[E]=w?m+"px":"",e[k]=b?p+"px":"",e.transform="",e))}function qE(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,i=s===void 0?!0:s,l=n.roundOffsets,a=l===void 0?!0:l,c={placement:Gt(e.placement),variation:Kr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,up(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:i,roundOffsets:a})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,up(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const JE={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:qE,data:{}};var Gs={passive:!0};function GE(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,s=o===void 0?!0:o,i=r.resize,l=i===void 0?!0:i,a=mt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(u){u.addEventListener("scroll",n.update,Gs)}),l&&a.addEventListener("resize",n.update,Gs),function(){s&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Gs)}),l&&a.removeEventListener("resize",n.update,Gs)}}const YE={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:GE,data:{}};var XE={left:"right",right:"left",bottom:"top",top:"bottom"};function Ys(t){return t.replace(/left|right|bottom|top/g,function(e){return XE[e]})}var QE={start:"end",end:"start"};function dp(t){return t.replace(/start|end/g,function(e){return QE[e]})}function Na(t){var e=mt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Aa(t){return Wr(Un(t)).left+Na(t).scrollLeft}function ZE(t,e){var n=mt(t),r=Un(t),o=n.visualViewport,s=r.clientWidth,i=r.clientHeight,l=0,a=0;if(o){s=o.width,i=o.height;var c=op();(c||!c&&e==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:s,height:i,x:l+Aa(t),y:a}}function ew(t){var e,n=Un(t),r=Na(t),o=(e=t.ownerDocument)==null?void 0:e.body,s=mr(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=mr(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+Aa(t),a=-r.scrollTop;return gn(o||n).direction==="rtl"&&(l+=mr(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:i,x:l,y:a}}function _a(t){var e=gn(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function fp(t){return["html","body","#document"].indexOf(Jt(t))>=0?t.ownerDocument.body:Ot(t)&&_a(t)?t:fp(Js(t))}function Do(t,e){var n;e===void 0&&(e=[]);var r=fp(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),s=mt(r),i=o?[s].concat(s.visualViewport||[],_a(r)?r:[]):r,l=e.concat(i);return o?l:l.concat(Do(Js(i)))}function Ma(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function tw(t,e){var n=Wr(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function pp(t,e,n){return e===ep?Ma(ZE(t,n)):hr(e)?tw(e,n):Ma(ew(Un(t)))}function nw(t){var e=Do(Js(t)),n=["absolute","fixed"].indexOf(gn(t).position)>=0,r=n&&Ot(t)?Lo(t):t;return hr(r)?e.filter(function(o){return hr(o)&&sp(o,r)&&Jt(o)!=="body"}):[]}function rw(t,e,n,r){var o=e==="clippingParents"?nw(t):[].concat(e),s=[].concat(o,[n]),i=s[0],l=s.reduce(function(a,c){var u=pp(t,c,r);return a.top=mr(u.top,a.top),a.right=qs(u.right,a.right),a.bottom=qs(u.bottom,a.bottom),a.left=mr(u.left,a.left),a},pp(t,i,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function hp(t){var e=t.reference,n=t.element,r=t.placement,o=r?Gt(r):null,s=r?Kr(r):null,i=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,a;switch(o){case st:a={x:i,y:e.y-n.height};break;case xt:a={x:i,y:e.y+e.height};break;case Tt:a={x:e.x+e.width,y:l};break;case it:a={x:e.x-n.width,y:l};break;default:a={x:e.x,y:e.y}}var c=o?Oa(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(s){case zr:a[c]=a[c]-(e[u]/2-n[u]/2);break;case Mo:a[c]=a[c]+(e[u]/2-n[u]/2);break}}return a}function Po(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,s=n.strategy,i=s===void 0?t.strategy:s,l=n.boundary,a=l===void 0?vE:l,c=n.rootBoundary,u=c===void 0?ep:c,d=n.elementContext,f=d===void 0?Ro:d,p=n.altBoundary,h=p===void 0?!1:p,m=n.padding,y=m===void 0?0:m,b=ap(typeof y!="number"?y:cp(y,_o)),w=f===Ro?xE:Ro,k=t.rects.popper,E=t.elements[h?w:f],x=rw(hr(E)?E:E.contextElement||Un(t.elements.popper),a,u,i),v=Wr(t.elements.reference),T=hp({reference:v,element:k,placement:o}),_=Ma(Object.assign({},k,T)),P=f===Ro?_:v,V={top:x.top-P.top+b.top,bottom:P.bottom-x.bottom+b.bottom,left:x.left-P.left+b.left,right:P.right-x.right+b.right},Z=t.modifiersData.offset;if(f===Ro&&Z){var q=Z[o];Object.keys(V).forEach(function(re){var Te=[Tt,xt].indexOf(re)>=0?1:-1,Se=[st,xt].indexOf(re)>=0?"y":"x";V[re]+=q[Se]*Te})}return V}function ow(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,s=n.rootBoundary,i=n.padding,l=n.flipVariations,a=n.allowedAutoPlacements,c=a===void 0?np:a,u=Kr(r),d=u?l?tp:tp.filter(function(h){return Kr(h)===u}):_o,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=Po(t,{placement:m,boundary:o,rootBoundary:s,padding:i})[Gt(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function sw(t){if(Gt(t)===Sa)return[];var e=Ys(t);return[dp(t),e,dp(e)]}function iw(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!0:i,a=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,m=n.allowedAutoPlacements,y=e.options.placement,b=Gt(y),w=b===y,k=a||(w||!h?[Ys(y)]:sw(y)),E=[y].concat(k).reduce(function(wt,tt){return wt.concat(Gt(tt)===Sa?ow(e,{placement:tt,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):tt)},[]),x=e.rects.reference,v=e.rects.popper,T=new Map,_=!0,P=E[0],V=0;V<E.length;V++){var Z=E[V],q=Gt(Z),re=Kr(Z)===zr,Te=[st,xt].indexOf(q)>=0,Se=Te?"width":"height",de=Po(e,{placement:Z,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),me=Te?re?Tt:it:re?xt:st;x[Se]>v[Se]&&(me=Ys(me));var Oe=Ys(me),dt=[];if(s&&dt.push(de[q]<=0),l&&dt.push(de[me]<=0,de[Oe]<=0),dt.every(function(wt){return wt})){P=Z,_=!1;break}T.set(Z,dt)}if(_)for(var Me=h?3:1,Et=function(tt){var Rt=E.find(function(sn){var pt=T.get(sn);if(pt)return pt.slice(0,tt).every(function(ln){return ln})});if(Rt)return P=Rt,"break"},ft=Me;ft>0;ft--){var Ut=Et(ft);if(Ut==="break")break}e.placement!==P&&(e.modifiersData[r]._skip=!0,e.placement=P,e.reset=!0)}}const lw={name:"flip",enabled:!0,phase:"main",fn:iw,requiresIfExists:["offset"],data:{_skip:!1}};function mp(t,e,n){return n===void 0&&(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 gp(t){return[st,Tt,xt,it].some(function(e){return t[e]>=0})}function aw(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,s=e.modifiersData.preventOverflow,i=Po(e,{elementContext:"reference"}),l=Po(e,{altBoundary:!0}),a=mp(i,r),c=mp(l,o,s),u=gp(a),d=gp(c);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const cw={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:aw};function uw(t,e,n){var r=Gt(t),o=[it,st].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,i=s[0],l=s[1];return i=i||0,l=(l||0)*o,[it,Tt].indexOf(r)>=0?{x:l,y:i}:{x:i,y:l}}function dw(t){var e=t.state,n=t.options,r=t.name,o=n.offset,s=o===void 0?[0,0]:o,i=np.reduce(function(u,d){return u[d]=uw(d,e.rects,s),u},{}),l=i[e.placement],a=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=a,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=i}const fw={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:dw};function pw(t){var e=t.state,n=t.name;e.modifiersData[n]=hp({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const hw={name:"popperOffsets",enabled:!0,phase:"read",fn:pw,data:{}};function mw(t){return t==="x"?"y":"x"}function gw(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!1:i,a=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,h=n.tetherOffset,m=h===void 0?0:h,y=Po(e,{boundary:a,rootBoundary:c,padding:d,altBoundary:u}),b=Gt(e.placement),w=Kr(e.placement),k=!w,E=Oa(b),x=mw(E),v=e.modifiersData.popperOffsets,T=e.rects.reference,_=e.rects.popper,P=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,V=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),Z=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,q={x:0,y:0};if(v){if(s){var re,Te=E==="y"?st:it,Se=E==="y"?xt:Tt,de=E==="y"?"height":"width",me=v[E],Oe=me+y[Te],dt=me-y[Se],Me=p?-_[de]/2:0,Et=w===zr?T[de]:_[de],ft=w===zr?-_[de]:-T[de],Ut=e.elements.arrow,wt=p&&Ut?Ta(Ut):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:lp(),Rt=tt[Te],sn=tt[Se],pt=Io(0,T[de],wt[de]),ln=k?T[de]/2-Me-pt-Rt-V.mainAxis:Et-pt-Rt-V.mainAxis,Lt=k?-T[de]/2+Me+pt+sn+V.mainAxis:ft+pt+sn+V.mainAxis,an=e.elements.arrow&&Lo(e.elements.arrow),Qn=an?E==="y"?an.clientTop||0:an.clientLeft||0:0,zt=(re=Z?.[E])!=null?re:0,cn=me+ln-zt-Qn,It=me+Lt-zt,jt=Io(p?qs(Oe,cn):Oe,me,p?mr(dt,It):dt);v[E]=jt,q[E]=jt-me}if(l){var Sn,C=E==="x"?st:it,S=E==="x"?xt:Tt,R=v[x],$=x==="y"?"height":"width",fe=R+y[C],se=R-y[S],Q=[st,it].indexOf(b)!==-1,N=(Sn=Z?.[x])!=null?Sn:0,L=Q?fe:R-T[$]-_[$]-N+V.altAxis,ee=Q?R+T[$]+_[$]-N-V.altAxis:se,ge=p&&Q?VE(L,R,ee):Io(p?L:fe,R,p?ee:se);v[x]=ge,q[x]=ge-R}e.modifiersData[r]=q}}const yw={name:"preventOverflow",enabled:!0,phase:"main",fn:gw,requiresIfExists:["offset"]};function bw(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Ew(t){return t===mt(t)||!Ot(t)?Na(t):bw(t)}function ww(t){var e=t.getBoundingClientRect(),n=jr(e.width)/t.offsetWidth||1,r=jr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function kw(t,e,n){n===void 0&&(n=!1);var r=Ot(e),o=Ot(e)&&ww(e),s=Un(e),i=Wr(t,o,n),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!n)&&((Jt(e)!=="body"||_a(s))&&(l=Ew(e)),Ot(e)?(a=Wr(e,!0),a.x+=e.clientLeft,a.y+=e.clientTop):s&&(a.x=Aa(s))),{x:i.left+l.scrollLeft-a.x,y:i.top+l.scrollTop-a.y,width:i.width,height:i.height}}function Cw(t){var e=new Map,n=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function o(s){n.add(s.name);var i=[].concat(s.requires||[],s.requiresIfExists||[]);i.forEach(function(l){if(!n.has(l)){var a=e.get(l);a&&o(a)}}),r.push(s)}return t.forEach(function(s){n.has(s.name)||o(s)}),r}function Sw(t){var e=Cw(t);return DE.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function vw(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function xw(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var yp={placement:"bottom",modifiers:[],strategy:"absolute"};function bp(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Tw(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,s=o===void 0?yp:o;return function(l,a,c){c===void 0&&(c=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},yp,s),modifiersData:{},elements:{reference:l,popper:a},attributes:{},styles:{}},d=[],f=!1,p={state:u,setOptions:function(b){var w=typeof b=="function"?b(u.options):b;m(),u.options=Object.assign({},s,u.options,w),u.scrollParents={reference:hr(l)?Do(l):l.contextElement?Do(l.contextElement):[],popper:Do(a)};var k=Sw(xw([].concat(r,u.options.modifiers)));return u.orderedModifiers=k.filter(function(E){return E.enabled}),h(),p.update()},forceUpdate:function(){if(!f){var b=u.elements,w=b.reference,k=b.popper;if(bp(w,k)){u.rects={reference:kw(w,Lo(k),u.options.strategy==="fixed"),popper:Ta(k)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(V){return u.modifiersData[V.name]=Object.assign({},V.data)});for(var E=0;E<u.orderedModifiers.length;E++){if(u.reset===!0){u.reset=!1,E=-1;continue}var x=u.orderedModifiers[E],v=x.fn,T=x.options,_=T===void 0?{}:T,P=x.name;typeof v=="function"&&(u=v({state:u,options:_,name:P,instance:p})||u)}}}},update:vw(function(){return new Promise(function(y){p.forceUpdate(),y(u)})}),destroy:function(){m(),f=!0}};if(!bp(l,a))return p;p.setOptions(c).then(function(y){!f&&c.onFirstUpdate&&c.onFirstUpdate(y)});function h(){u.orderedModifiers.forEach(function(y){var b=y.name,w=y.options,k=w===void 0?{}:w,E=y.effect;if(typeof E=="function"){var x=E({state:u,name:b,instance:p,options:k}),v=function(){};d.push(x||v)}})}function m(){d.forEach(function(y){return y()}),d=[]}return p}}var Ow=[YE,hw,JE,rp,fw,lw,yw,jE,cw],Nw=Tw({defaultModifiers:Ow}),Aw="tippy-box",Ep="tippy-content",_w="tippy-backdrop",wp="tippy-arrow",kp="tippy-svg-arrow",gr={passive:!0,capture:!0},Cp=function(){return document.body};function Mw(t,e){return{}.hasOwnProperty.call(t,e)}function Ra(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function La(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function Sp(t,e){return typeof t=="function"?t.apply(void 0,e):t}function vp(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function Rw(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function Lw(t){return t.split(/\s+/).filter(Boolean)}function qr(t){return[].concat(t)}function xp(t,e){t.indexOf(e)===-1&&t.push(e)}function Iw(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function Dw(t){return t.split("-")[0]}function Xs(t){return[].slice.call(t)}function Tp(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Bo(){return document.createElement("div")}function Fo(t){return["Element","Fragment"].some(function(e){return La(t,e)})}function Pw(t){return La(t,"NodeList")}function Bw(t){return La(t,"MouseEvent")}function Fw(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function $w(t){return Fo(t)?[t]:Pw(t)?Xs(t):Array.isArray(t)?t:Xs(document.querySelectorAll(t))}function Ia(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Op(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function Vw(t){var e,n=qr(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function Hw(t,e){var n=e.clientX,r=e.clientY;return t.every(function(o){var s=o.popperRect,i=o.popperState,l=o.props,a=l.interactiveBorder,c=Dw(i.placement),u=i.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,h=c==="left"?u.right.x:0,m=s.top-r+d>a,y=r-s.bottom-f>a,b=s.left-n+p>a,w=n-s.right-h>a;return m||y||b||w})}function Da(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){t[r](o,n)})}function Np(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Yt={isTouch:!1},Ap=0;function Uw(){Yt.isTouch||(Yt.isTouch=!0,window.performance&&document.addEventListener("mousemove",_p))}function _p(){var t=performance.now();t-Ap<20&&(Yt.isTouch=!1,document.removeEventListener("mousemove",_p)),Ap=t}function zw(){var t=document.activeElement;if(Fw(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function jw(){document.addEventListener("touchstart",Uw,gr),window.addEventListener("blur",zw)}var Ww=typeof window<"u"&&typeof document<"u",Kw=Ww?!!window.msCrypto:!1;function Jr(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Mp(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function qw(t){return Mp(`
89
+ `,textSerializers:r={}}=e||{};return ap(this.state.doc,{blockSeparator:n,textSerializers:{...hl(this.schema),...r}})}get isEmpty(){return vl(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new pr(n,this)}get $doc(){return this.$pos(0)}};function hr(t){return new Fi({find:t.find,handler:({state:e,range:n,match:r})=>{const o=ie(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:i}=e,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(_l(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(k=>k===t.type&&k!==m.mark.type)).filter(m=>m.to>c).length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+l,c);const p=n.from+l+s.length;i.addMark(n.from+l,p,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}function S1(t){return new Fi({find:t.find,handler:({state:e,range:n,match:r})=>{const o=ie(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from;let a=n.to;const l=t.type.create(o);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=s+c;u>a?u=a:a=u+r[1].length;const f=r[0][r[0].length-1];i.insertText(f,s+r[0].length-1),i.replaceWith(u,a,l)}else if(r[0]){const c=t.type.isInline?s:s-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}})}function Tl(t){return new Fi({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=ie(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)}})}function Mo(t){return new Fi({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const i=ie(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&Ca(l,t.type,i);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){const{selection:f,storedMarks:p}=e,{splittableMarks:m}=t.editor.extensionManager,b=p||f.$to.parentOffset&&f.$from.marks();if(b){const k=b.filter(_=>m.includes(_.type.name));s.ensureMarks(k)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(f,i).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&Ln(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}let ct=class vu{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ie(J(this,"addOptions",{name:this.name}))),this.storage=ie(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new vu(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Hi(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new vu(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ie(J(n,"addOptions",{name:n.name})),n.storage=ie(J(n,"addStorage",{name:n.name,options:n.options})),n}};function jn(t){return new ek({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const i=ie(t.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const u=l.search(/\S/),f=n.from+l.indexOf(a),p=f+a.length;if(_l(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(_=>_===t.type&&_!==b.mark.type)).filter(b=>b.to>f).length)return null;p<n.to&&s.delete(p,n.to),f>n.from&&s.delete(n.from+u,f),c=n.from+u+a.length,s.addMark(n.from+u,c,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}var mt="top",Rt="bottom",Pt="right",gt="left",Nl="auto",xo=[mt,Rt,Pt,gt],Ur="start",Lo="end",T1="clippingParents",fp="viewport",Ro="popper",N1="reference",pp=xo.reduce(function(t,e){return t.concat([e+"-"+Ur,e+"-"+Lo])},[]),hp=[].concat(xo,[Nl]).reduce(function(t,e){return t.concat([e,e+"-"+Ur,e+"-"+Lo])},[]),A1="beforeRead",O1="read",M1="afterRead",x1="beforeMain",L1="main",R1="afterMain",P1="beforeWrite",I1="write",D1="afterWrite",B1=[A1,O1,M1,x1,L1,R1,P1,I1,D1];function Zt(t){return t?(t.nodeName||"").toLowerCase():null}function Ct(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function mr(t){var e=Ct(t).Element;return t instanceof e||t instanceof Element}function It(t){var e=Ct(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Al(t){if(typeof ShadowRoot>"u")return!1;var e=Ct(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function F1(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},i=e.elements[n];!It(i)||!Zt(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function $1(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(r){var o=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!It(o)||!Zt(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const mp={name:"applyStyles",enabled:!0,phase:"write",fn:F1,effect:$1,requires:["computeStyles"]};function en(t){return t.split("-")[0]}var gr=Math.max,qi=Math.min,Wr=Math.round;function Ol(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function gp(){return!/^((?!chrome|android).)*safari/i.test(Ol())}function Kr(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),o=1,i=1;e&&It(t)&&(o=t.offsetWidth>0&&Wr(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&Wr(r.height)/t.offsetHeight||1);var s=mr(t)?Ct(t):window,a=s.visualViewport,l=!gp()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/o,u=(r.top+(l&&a?a.offsetTop:0))/i,f=r.width/o,p=r.height/i;return{width:f,height:p,top:u,right:c+f,bottom:u+p,left:c,x:c,y:u}}function Ml(t){var e=Kr(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 bp(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Al(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function yn(t){return Ct(t).getComputedStyle(t)}function V1(t){return["table","td","th"].indexOf(Zt(t))>=0}function Un(t){return((mr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Gi(t){return Zt(t)==="html"?t:t.assignedSlot||t.parentNode||(Al(t)?t.host:null)||Un(t)}function yp(t){return!It(t)||yn(t).position==="fixed"?null:t.offsetParent}function H1(t){var e=/firefox/i.test(Ol()),n=/Trident/i.test(Ol());if(n&&It(t)){var r=yn(t);if(r.position==="fixed")return null}var o=Gi(t);for(Al(o)&&(o=o.host);It(o)&&["html","body"].indexOf(Zt(o))<0;){var i=yn(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Po(t){for(var e=Ct(t),n=yp(t);n&&V1(n)&&yn(n).position==="static";)n=yp(n);return n&&(Zt(n)==="html"||Zt(n)==="body"&&yn(n).position==="static")?e:n||H1(t)||e}function xl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Io(t,e,n){return gr(t,qi(e,n))}function z1(t,e,n){var r=Io(t,e,n);return r>n?n:r}function wp(){return{top:0,right:0,bottom:0,left:0}}function kp(t){return Object.assign({},wp(),t)}function _p(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var j1=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,kp(typeof e!="number"?e:_p(e,xo))};function U1(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=en(n.placement),l=xl(a),c=[gt,Pt].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var f=j1(o.padding,n),p=Ml(i),m=l==="y"?mt:gt,b=l==="y"?Rt:Pt,k=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],_=s[l]-n.rects.reference[l],E=Po(i),N=E?l==="y"?E.clientHeight||0:E.clientWidth||0:0,A=k/2-_/2,d=f[m],g=N-p[u]-f[b],h=N/2-p[u]/2+A,w=Io(d,h,g),v=l;n.modifiersData[r]=(e={},e[v]=w,e.centerOffset=w-h,e)}}function W1(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||bp(e.elements.popper,o)&&(e.elements.arrow=o))}const K1={name:"arrow",enabled:!0,phase:"main",fn:U1,effect:W1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function qr(t){return t.split("-")[1]}var q1={top:"auto",right:"auto",bottom:"auto",left:"auto"};function G1(t,e){var n=t.x,r=t.y,o=e.devicePixelRatio||1;return{x:Wr(n*o)/o||0,y:Wr(r*o)/o||0}}function Ep(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,f=t.isFixed,p=s.x,m=p===void 0?0:p,b=s.y,k=b===void 0?0:b,_=typeof u=="function"?u({x:m,y:k}):{x:m,y:k};m=_.x,k=_.y;var E=s.hasOwnProperty("x"),N=s.hasOwnProperty("y"),A=gt,d=mt,g=window;if(c){var h=Po(n),w="clientHeight",v="clientWidth";if(h===Ct(n)&&(h=Un(n),yn(h).position!=="static"&&a==="absolute"&&(w="scrollHeight",v="scrollWidth")),h=h,o===mt||(o===gt||o===Pt)&&i===Lo){d=Rt;var S=f&&h===g&&g.visualViewport?g.visualViewport.height:h[w];k-=S-r.height,k*=l?1:-1}if(o===gt||(o===mt||o===Rt)&&i===Lo){A=Pt;var C=f&&h===g&&g.visualViewport?g.visualViewport.width:h[v];m-=C-r.width,m*=l?1:-1}}var M=Object.assign({position:a},c&&q1),P=u===!0?G1({x:m,y:k},Ct(n)):{x:m,y:k};if(m=P.x,k=P.y,l){var D;return Object.assign({},M,(D={},D[d]=N?"0":"",D[A]=E?"0":"",D.transform=(g.devicePixelRatio||1)<=1?"translate("+m+"px, "+k+"px)":"translate3d("+m+"px, "+k+"px, 0)",D))}return Object.assign({},M,(e={},e[d]=N?k+"px":"",e[A]=E?m+"px":"",e.transform="",e))}function J1(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:en(e.placement),variation:qr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Ep(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Ep(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Y1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:J1,data:{}};var Ji={passive:!0};function X1(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=Ct(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,Ji)}),a&&l.addEventListener("resize",n.update,Ji),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Ji)}),a&&l.removeEventListener("resize",n.update,Ji)}}const Q1={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:X1,data:{}};var Z1={left:"right",right:"left",bottom:"top",top:"bottom"};function Yi(t){return t.replace(/left|right|bottom|top/g,function(e){return Z1[e]})}var e_={start:"end",end:"start"};function vp(t){return t.replace(/start|end/g,function(e){return e_[e]})}function Ll(t){var e=Ct(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Rl(t){return Kr(Un(t)).left+Ll(t).scrollLeft}function t_(t,e){var n=Ct(t),r=Un(t),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=gp();(c||!c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+Rl(t),y:l}}function n_(t){var e,n=Un(t),r=Ll(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=gr(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=gr(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+Rl(t),l=-r.scrollTop;return yn(o||n).direction==="rtl"&&(a+=gr(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Pl(t){var e=yn(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Cp(t){return["html","body","#document"].indexOf(Zt(t))>=0?t.ownerDocument.body:It(t)&&Pl(t)?t:Cp(Gi(t))}function Do(t,e){var n;e===void 0&&(e=[]);var r=Cp(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=Ct(r),s=o?[i].concat(i.visualViewport||[],Pl(r)?r:[]):r,a=e.concat(s);return o?a:a.concat(Do(Gi(s)))}function Il(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function r_(t,e){var n=Kr(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Sp(t,e,n){return e===fp?Il(t_(t,n)):mr(e)?r_(e,n):Il(n_(Un(t)))}function o_(t){var e=Do(Gi(t)),n=["absolute","fixed"].indexOf(yn(t).position)>=0,r=n&&It(t)?Po(t):t;return mr(r)?e.filter(function(o){return mr(o)&&bp(o,r)&&Zt(o)!=="body"}):[]}function i_(t,e,n,r){var o=e==="clippingParents"?o_(t):[].concat(e),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,c){var u=Sp(t,c,r);return l.top=gr(u.top,l.top),l.right=qi(u.right,l.right),l.bottom=qi(u.bottom,l.bottom),l.left=gr(u.left,l.left),l},Sp(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Tp(t){var e=t.reference,n=t.element,r=t.placement,o=r?en(r):null,i=r?qr(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(o){case mt:l={x:s,y:e.y-n.height};break;case Rt:l={x:s,y:e.y+e.height};break;case Pt:l={x:e.x+e.width,y:a};break;case gt:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=o?xl(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Ur:l[c]=l[c]-(e[u]/2-n[u]/2);break;case Lo:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function Bo(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,i=n.strategy,s=i===void 0?t.strategy:i,a=n.boundary,l=a===void 0?T1:a,c=n.rootBoundary,u=c===void 0?fp:c,f=n.elementContext,p=f===void 0?Ro:f,m=n.altBoundary,b=m===void 0?!1:m,k=n.padding,_=k===void 0?0:k,E=kp(typeof _!="number"?_:_p(_,xo)),N=p===Ro?N1:Ro,A=t.rects.popper,d=t.elements[b?N:p],g=i_(mr(d)?d:d.contextElement||Un(t.elements.popper),l,u,s),h=Kr(t.elements.reference),w=Tp({reference:h,element:A,placement:o}),v=Il(Object.assign({},A,w)),S=p===Ro?v:h,C={top:g.top-S.top+E.top,bottom:S.bottom-g.bottom+E.bottom,left:g.left-S.left+E.left,right:S.right-g.right+E.right},M=t.modifiersData.offset;if(p===Ro&&M){var P=M[o];Object.keys(C).forEach(function(D){var F=[Pt,Rt].indexOf(D)>=0?1:-1,$=[mt,Rt].indexOf(D)>=0?"y":"x";C[D]+=P[$]*F})}return C}function s_(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?hp:l,u=qr(r),f=u?a?pp:pp.filter(function(b){return qr(b)===u}):xo,p=f.filter(function(b){return c.indexOf(b)>=0});p.length===0&&(p=f);var m=p.reduce(function(b,k){return b[k]=Bo(t,{placement:k,boundary:o,rootBoundary:i,padding:s})[en(k)],b},{});return Object.keys(m).sort(function(b,k){return m[b]-m[k]})}function a_(t){if(en(t)===Nl)return[];var e=Yi(t);return[vp(t),e,vp(e)]}function l_(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,p=n.altBoundary,m=n.flipVariations,b=m===void 0?!0:m,k=n.allowedAutoPlacements,_=e.options.placement,E=en(_),N=E===_,A=l||(N||!b?[Yi(_)]:a_(_)),d=[_].concat(A).reduce(function(Oe,fe){return Oe.concat(en(fe)===Nl?s_(e,{placement:fe,boundary:u,rootBoundary:f,padding:c,flipVariations:b,allowedAutoPlacements:k}):fe)},[]),g=e.rects.reference,h=e.rects.popper,w=new Map,v=!0,S=d[0],C=0;C<d.length;C++){var M=d[C],P=en(M),D=qr(M)===Ur,F=[mt,Rt].indexOf(P)>=0,$=F?"width":"height",T=Bo(e,{placement:M,boundary:u,rootBoundary:f,altBoundary:p,padding:c}),I=F?D?Pt:gt:D?Rt:mt;g[$]>h[$]&&(I=Yi(I));var U=Yi(I),q=[];if(i&&q.push(T[P]<=0),a&&q.push(T[I]<=0,T[U]<=0),q.every(function(Oe){return Oe})){S=M,v=!1;break}w.set(M,q)}if(v)for(var Z=b?3:1,G=function(fe){var we=d.find(function(Me){var ke=w.get(Me);if(ke)return ke.slice(0,fe).every(function(_t){return _t})});if(we)return S=we,"break"},he=Z;he>0;he--){var Te=G(he);if(Te==="break")break}e.placement!==S&&(e.modifiersData[r]._skip=!0,e.placement=S,e.reset=!0)}}const c_={name:"flip",enabled:!0,phase:"main",fn:l_,requiresIfExists:["offset"],data:{_skip:!1}};function Np(t,e,n){return n===void 0&&(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 Ap(t){return[mt,Pt,Rt,gt].some(function(e){return t[e]>=0})}function u_(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=Bo(e,{elementContext:"reference"}),a=Bo(e,{altBoundary:!0}),l=Np(s,r),c=Np(a,o,i),u=Ap(l),f=Ap(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const d_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:u_};function f_(t,e,n){var r=en(t),o=[gt,mt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[gt,Pt].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function p_(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=o===void 0?[0,0]:o,s=hp.reduce(function(u,f){return u[f]=f_(f,e.rects,i),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const h_={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:p_};function m_(t){var e=t.state,n=t.name;e.modifiersData[n]=Tp({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const g_={name:"popperOffsets",enabled:!0,phase:"read",fn:m_,data:{}};function b_(t){return t==="x"?"y":"x"}function y_(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,p=n.tether,m=p===void 0?!0:p,b=n.tetherOffset,k=b===void 0?0:b,_=Bo(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),E=en(e.placement),N=qr(e.placement),A=!N,d=xl(E),g=b_(d),h=e.modifiersData.popperOffsets,w=e.rects.reference,v=e.rects.popper,S=typeof k=="function"?k(Object.assign({},e.rects,{placement:e.placement})):k,C=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),M=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,P={x:0,y:0};if(h){if(i){var D,F=d==="y"?mt:gt,$=d==="y"?Rt:Pt,T=d==="y"?"height":"width",I=h[d],U=I+_[F],q=I-_[$],Z=m?-v[T]/2:0,G=N===Ur?w[T]:v[T],he=N===Ur?-v[T]:-w[T],Te=e.elements.arrow,Oe=m&&Te?Ml(Te):{width:0,height:0},fe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:wp(),we=fe[F],Me=fe[$],ke=Io(0,w[T],Oe[T]),_t=A?w[T]/2-Z-ke-we-C.mainAxis:G-ke-we-C.mainAxis,ot=A?-w[T]/2+Z+ke+Me+C.mainAxis:he+ke+Me+C.mainAxis,At=e.elements.arrow&&Po(e.elements.arrow),Vt=At?d==="y"?At.clientTop||0:At.clientLeft||0:0,Et=(D=M?.[d])!=null?D:0,dn=I+_t-Et-Vt,Ht=I+ot-Et,Jt=Io(m?qi(U,dn):U,I,m?gr(q,Ht):q);h[d]=Jt,P[d]=Jt-I}if(a){var Sn,O=d==="x"?mt:gt,x=d==="x"?Rt:Pt,H=h[g],Y=g==="y"?"height":"width",ve=H+_[O],me=H-_[x],le=[mt,gt].indexOf(E)!==-1,R=(Sn=M?.[g])!=null?Sn:0,z=le?ve:H-w[Y]-v[Y]-R+C.altAxis,ce=le?H+w[Y]+v[Y]-R-C.altAxis:me,Ne=m&&le?z1(z,H,ce):Io(m?z:ve,H,m?ce:me);h[g]=Ne,P[g]=Ne-H}e.modifiersData[r]=P}}const w_={name:"preventOverflow",enabled:!0,phase:"main",fn:y_,requiresIfExists:["offset"]};function k_(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function __(t){return t===Ct(t)||!It(t)?Ll(t):k_(t)}function E_(t){var e=t.getBoundingClientRect(),n=Wr(e.width)/t.offsetWidth||1,r=Wr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function v_(t,e,n){n===void 0&&(n=!1);var r=It(e),o=It(e)&&E_(e),i=Un(e),s=Kr(t,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Zt(e)!=="body"||Pl(i))&&(a=__(e)),It(e)?(l=Kr(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):i&&(l.x=Rl(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function C_(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&o(l)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||o(i)}),r}function S_(t){var e=C_(t);return B1.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function T_(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function N_(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Op={placement:"bottom",modifiers:[],strategy:"absolute"};function Mp(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function A_(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,i=o===void 0?Op:o;return function(a,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Op,i),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],p=!1,m={state:u,setOptions:function(E){var N=typeof E=="function"?E(u.options):E;k(),u.options=Object.assign({},i,u.options,N),u.scrollParents={reference:mr(a)?Do(a):a.contextElement?Do(a.contextElement):[],popper:Do(l)};var A=S_(N_([].concat(r,u.options.modifiers)));return u.orderedModifiers=A.filter(function(d){return d.enabled}),b(),m.update()},forceUpdate:function(){if(!p){var E=u.elements,N=E.reference,A=E.popper;if(Mp(N,A)){u.rects={reference:v_(N,Po(A),u.options.strategy==="fixed"),popper:Ml(A)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(C){return u.modifiersData[C.name]=Object.assign({},C.data)});for(var d=0;d<u.orderedModifiers.length;d++){if(u.reset===!0){u.reset=!1,d=-1;continue}var g=u.orderedModifiers[d],h=g.fn,w=g.options,v=w===void 0?{}:w,S=g.name;typeof h=="function"&&(u=h({state:u,options:v,name:S,instance:m})||u)}}}},update:T_(function(){return new Promise(function(_){m.forceUpdate(),_(u)})}),destroy:function(){k(),p=!0}};if(!Mp(a,l))return m;m.setOptions(c).then(function(_){!p&&c.onFirstUpdate&&c.onFirstUpdate(_)});function b(){u.orderedModifiers.forEach(function(_){var E=_.name,N=_.options,A=N===void 0?{}:N,d=_.effect;if(typeof d=="function"){var g=d({state:u,name:E,instance:m,options:A}),h=function(){};f.push(g||h)}})}function k(){f.forEach(function(_){return _()}),f=[]}return m}}var O_=[Q1,g_,Y1,mp,h_,c_,w_,K1,d_],M_=A_({defaultModifiers:O_}),x_="tippy-box",xp="tippy-content",L_="tippy-backdrop",Lp="tippy-arrow",Rp="tippy-svg-arrow",br={passive:!0,capture:!0},Pp=function(){return document.body};function R_(t,e){return{}.hasOwnProperty.call(t,e)}function Dl(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function Bl(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function Ip(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Dp(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function P_(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function I_(t){return t.split(/\s+/).filter(Boolean)}function Gr(t){return[].concat(t)}function Bp(t,e){t.indexOf(e)===-1&&t.push(e)}function D_(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function B_(t){return t.split("-")[0]}function Xi(t){return[].slice.call(t)}function Fp(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Fo(){return document.createElement("div")}function $o(t){return["Element","Fragment"].some(function(e){return Bl(t,e)})}function F_(t){return Bl(t,"NodeList")}function $_(t){return Bl(t,"MouseEvent")}function V_(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function H_(t){return $o(t)?[t]:F_(t)?Xi(t):Array.isArray(t)?t:Xi(document.querySelectorAll(t))}function Fl(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function $p(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function z_(t){var e,n=Gr(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function j_(t,e){var n=e.clientX,r=e.clientY;return t.every(function(o){var i=o.popperRect,s=o.popperState,a=o.props,l=a.interactiveBorder,c=B_(s.placement),u=s.modifiersData.offset;if(!u)return!0;var f=c==="bottom"?u.top.y:0,p=c==="top"?u.bottom.y:0,m=c==="right"?u.left.x:0,b=c==="left"?u.right.x:0,k=i.top-r+f>l,_=r-i.bottom-p>l,E=i.left-n+m>l,N=n-i.right-b>l;return k||_||E||N})}function $l(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){t[r](o,n)})}function Vp(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var tn={isTouch:!1},Hp=0;function U_(){tn.isTouch||(tn.isTouch=!0,window.performance&&document.addEventListener("mousemove",zp))}function zp(){var t=performance.now();t-Hp<20&&(tn.isTouch=!1,document.removeEventListener("mousemove",zp)),Hp=t}function W_(){var t=document.activeElement;if(V_(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function K_(){document.addEventListener("touchstart",U_,br),window.addEventListener("blur",W_)}var q_=typeof window<"u"&&typeof document<"u",G_=q_?!!window.msCrypto:!1;function Jr(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function jp(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function J_(t){return jp(`
90
90
  %ctippy.js
91
91
 
92
- %c`+Mp(t)+`
92
+ %c`+jp(t)+`
93
93
 
94
94
  %c👷‍ This is a development-only message. It will be removed in production.
95
- `)}function Rp(t){return[qw(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var $o;process.env.NODE_ENV!=="production"&&Jw();function Jw(){$o=new Set}function yn(t,e){if(t&&!$o.has(e)){var n;$o.add(e),(n=console).warn.apply(n,Rp(e))}}function Pa(t,e){if(t&&!$o.has(e)){var n;$o.add(e),(n=console).error.apply(n,Rp(e))}}function Gw(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;Pa(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Pa(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Lp={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Yw={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},gt=Object.assign({appendTo:Cp,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},Lp,Yw),Xw=Object.keys(gt),Qw=function(e){process.env.NODE_ENV!=="production"&&Pp(e,[]);var n=Object.keys(e);n.forEach(function(r){gt[r]=e[r]})};function Ip(t){var e=t.plugins||[],n=e.reduce(function(r,o){var s=o.name,i=o.defaultValue;if(s){var l;r[s]=t[s]!==void 0?t[s]:(l=gt[s])!=null?l:i}return r},{});return Object.assign({},t,n)}function Zw(t,e){var n=e?Object.keys(Ip(Object.assign({},gt,{plugins:e}))):Xw,r=n.reduce(function(o,s){var i=(t.getAttribute("data-tippy-"+s)||"").trim();if(!i)return o;if(s==="content")o[s]=i;else try{o[s]=JSON.parse(i)}catch{o[s]=i}return o},{});return r}function Dp(t,e){var n=Object.assign({},e,{content:Sp(e.content,[t])},e.ignoreAttributes?{}:Zw(t,e.plugins));return n.aria=Object.assign({},gt.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function Pp(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var o=Rw(gt,Object.keys(Lp)),s=!Mw(o,r);s&&(s=e.filter(function(i){return i.name===r}).length===0),yn(s,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
95
+ `)}function Up(t){return[J_(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Vo;process.env.NODE_ENV!=="production"&&Y_();function Y_(){Vo=new Set}function wn(t,e){if(t&&!Vo.has(e)){var n;Vo.add(e),(n=console).warn.apply(n,Up(e))}}function Vl(t,e){if(t&&!Vo.has(e)){var n;Vo.add(e),(n=console).error.apply(n,Up(e))}}function X_(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;Vl(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Vl(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Wp={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Q_={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},St=Object.assign({appendTo:Pp,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},Wp,Q_),Z_=Object.keys(St),eE=function(e){process.env.NODE_ENV!=="production"&&Gp(e,[]);var n=Object.keys(e);n.forEach(function(r){St[r]=e[r]})};function Kp(t){var e=t.plugins||[],n=e.reduce(function(r,o){var i=o.name,s=o.defaultValue;if(i){var a;r[i]=t[i]!==void 0?t[i]:(a=St[i])!=null?a:s}return r},{});return Object.assign({},t,n)}function tE(t,e){var n=e?Object.keys(Kp(Object.assign({},St,{plugins:e}))):Z_,r=n.reduce(function(o,i){var s=(t.getAttribute("data-tippy-"+i)||"").trim();if(!s)return o;if(i==="content")o[i]=s;else try{o[i]=JSON.parse(s)}catch{o[i]=s}return o},{});return r}function qp(t,e){var n=Object.assign({},e,{content:Ip(e.content,[t])},e.ignoreAttributes?{}:tE(t,e.plugins));return n.aria=Object.assign({},St.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function Gp(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var o=P_(St,Object.keys(Wp)),i=!R_(o,r);i&&(i=e.filter(function(s){return s.name===r}).length===0),wn(i,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
96
96
 
97
97
  `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
98
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var ek=function(){return"innerHTML"};function Ba(t,e){t[ek()]=e}function Bp(t){var e=Bo();return t===!0?e.className=wp:(e.className=kp,Fo(t)?e.appendChild(t):Ba(e,t)),e}function Fp(t,e){Fo(e.content)?(Ba(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Ba(t,e.content):t.textContent=e.content)}function Fa(t){var e=t.firstElementChild,n=Xs(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Ep)}),arrow:n.find(function(r){return r.classList.contains(wp)||r.classList.contains(kp)}),backdrop:n.find(function(r){return r.classList.contains(_w)})}}function $p(t){var e=Bo(),n=Bo();n.className=Aw,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Bo();r.className=Ep,r.setAttribute("data-state","hidden"),Fp(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props);function o(s,i){var l=Fa(e),a=l.box,c=l.content,u=l.arrow;i.theme?a.setAttribute("data-theme",i.theme):a.removeAttribute("data-theme"),typeof i.animation=="string"?a.setAttribute("data-animation",i.animation):a.removeAttribute("data-animation"),i.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth=typeof i.maxWidth=="number"?i.maxWidth+"px":i.maxWidth,i.role?a.setAttribute("role",i.role):a.removeAttribute("role"),(s.content!==i.content||s.allowHTML!==i.allowHTML)&&Fp(c,t.props),i.arrow?u?s.arrow!==i.arrow&&(a.removeChild(u),a.appendChild(Bp(i.arrow))):a.appendChild(Bp(i.arrow)):u&&a.removeChild(u)}return{popper:e,onUpdate:o}}$p.$$tippy=!0;var tk=1,Qs=[],$a=[];function nk(t,e){var n=Dp(t,Object.assign({},gt,Ip(Tp(e)))),r,o,s,i=!1,l=!1,a=!1,c=!1,u,d,f,p=[],h=vp(cn,n.interactiveDebounce),m,y=tk++,b=null,w=Iw(n.plugins),k={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},E={id:y,reference:t,popper:Bo(),popperInstance:b,props:n,state:k,plugins:w,clearDelayTimeouts:L,setProps:ee,setContent:ge,show:vn,hide:io,hideWithInteractivity:Zn,enable:Q,disable:N,unmount:xn,destroy:iu};if(!n.render)return process.env.NODE_ENV!=="production"&&Pa(!0,"render() function has not been supplied."),E;var x=n.render(E),v=x.popper,T=x.onUpdate;v.setAttribute("data-tippy-root",""),v.id="tippy-"+E.id,E.popper=v,t._tippy=E,v._tippy=E;var _=w.map(function(A){return A.fn(E)}),P=t.hasAttribute("aria-expanded");return an(),Me(),me(),Oe("onCreate",[E]),n.showOnCreate&&fe(),v.addEventListener("mouseenter",function(){E.props.interactive&&E.state.isVisible&&E.clearDelayTimeouts()}),v.addEventListener("mouseleave",function(){E.props.interactive&&E.props.trigger.indexOf("mouseenter")>=0&&Te().addEventListener("mousemove",h)}),E;function V(){var A=E.props.touch;return Array.isArray(A)?A:[A,0]}function Z(){return V()[0]==="hold"}function q(){var A;return!!((A=E.props.render)!=null&&A.$$tippy)}function re(){return m||t}function Te(){var A=re().parentNode;return A?Vw(A):document}function Se(){return Fa(v)}function de(A){return E.state.isMounted&&!E.state.isVisible||Yt.isTouch||u&&u.type==="focus"?0:Ra(E.props.delay,A?0:1,gt.delay)}function me(A){A===void 0&&(A=!1),v.style.pointerEvents=E.props.interactive&&!A?"":"none",v.style.zIndex=""+E.props.zIndex}function Oe(A,H,K){if(K===void 0&&(K=!0),_.forEach(function(oe){oe[A]&&oe[A].apply(oe,H)}),K){var ie;(ie=E.props)[A].apply(ie,H)}}function dt(){var A=E.props.aria;if(A.content){var H="aria-"+A.content,K=v.id,ie=qr(E.props.triggerTarget||t);ie.forEach(function(oe){var nt=oe.getAttribute(H);if(E.state.isVisible)oe.setAttribute(H,nt?nt+" "+K:K);else{var Dt=nt&&nt.replace(K,"").trim();Dt?oe.setAttribute(H,Dt):oe.removeAttribute(H)}})}}function Me(){if(!(P||!E.props.aria.expanded)){var A=qr(E.props.triggerTarget||t);A.forEach(function(H){E.props.interactive?H.setAttribute("aria-expanded",E.state.isVisible&&H===re()?"true":"false"):H.removeAttribute("aria-expanded")})}}function Et(){Te().removeEventListener("mousemove",h),Qs=Qs.filter(function(A){return A!==h})}function ft(A){if(!(Yt.isTouch&&(a||A.type==="mousedown"))){var H=A.composedPath&&A.composedPath()[0]||A.target;if(!(E.props.interactive&&Np(v,H))){if(qr(E.props.triggerTarget||t).some(function(K){return Np(K,H)})){if(Yt.isTouch||E.state.isVisible&&E.props.trigger.indexOf("click")>=0)return}else Oe("onClickOutside",[E,A]);E.props.hideOnClick===!0&&(E.clearDelayTimeouts(),E.hide(),l=!0,setTimeout(function(){l=!1}),E.state.isMounted||Rt())}}}function Ut(){a=!0}function wt(){a=!1}function tt(){var A=Te();A.addEventListener("mousedown",ft,!0),A.addEventListener("touchend",ft,gr),A.addEventListener("touchstart",wt,gr),A.addEventListener("touchmove",Ut,gr)}function Rt(){var A=Te();A.removeEventListener("mousedown",ft,!0),A.removeEventListener("touchend",ft,gr),A.removeEventListener("touchstart",wt,gr),A.removeEventListener("touchmove",Ut,gr)}function sn(A,H){ln(A,function(){!E.state.isVisible&&v.parentNode&&v.parentNode.contains(v)&&H()})}function pt(A,H){ln(A,H)}function ln(A,H){var K=Se().box;function ie(oe){oe.target===K&&(Da(K,"remove",ie),H())}if(A===0)return H();Da(K,"remove",d),Da(K,"add",ie),d=ie}function Lt(A,H,K){K===void 0&&(K=!1);var ie=qr(E.props.triggerTarget||t);ie.forEach(function(oe){oe.addEventListener(A,H,K),p.push({node:oe,eventType:A,handler:H,options:K})})}function an(){Z()&&(Lt("touchstart",zt,{passive:!0}),Lt("touchend",It,{passive:!0})),Lw(E.props.trigger).forEach(function(A){if(A!=="manual")switch(Lt(A,zt),A){case"mouseenter":Lt("mouseleave",It);break;case"focus":Lt(Kw?"focusout":"blur",jt);break;case"focusin":Lt("focusout",jt);break}})}function Qn(){p.forEach(function(A){var H=A.node,K=A.eventType,ie=A.handler,oe=A.options;H.removeEventListener(K,ie,oe)}),p=[]}function zt(A){var H,K=!1;if(!(!E.state.isEnabled||Sn(A)||l)){var ie=((H=u)==null?void 0:H.type)==="focus";u=A,m=A.currentTarget,Me(),!E.state.isVisible&&Bw(A)&&Qs.forEach(function(oe){return oe(A)}),A.type==="click"&&(E.props.trigger.indexOf("mouseenter")<0||i)&&E.props.hideOnClick!==!1&&E.state.isVisible?K=!0:fe(A),A.type==="click"&&(i=!K),K&&!ie&&se(A)}}function cn(A){var H=A.target,K=re().contains(H)||v.contains(H);if(!(A.type==="mousemove"&&K)){var ie=$().concat(v).map(function(oe){var nt,Dt=oe._tippy,lo=(nt=Dt.popperInstance)==null?void 0:nt.state;return lo?{popperRect:oe.getBoundingClientRect(),popperState:lo,props:n}:null}).filter(Boolean);Hw(ie,A)&&(Et(),se(A))}}function It(A){var H=Sn(A)||E.props.trigger.indexOf("click")>=0&&i;if(!H){if(E.props.interactive){E.hideWithInteractivity(A);return}se(A)}}function jt(A){E.props.trigger.indexOf("focusin")<0&&A.target!==re()||E.props.interactive&&A.relatedTarget&&v.contains(A.relatedTarget)||se(A)}function Sn(A){return Yt.isTouch?Z()!==A.type.indexOf("touch")>=0:!1}function C(){S();var A=E.props,H=A.popperOptions,K=A.placement,ie=A.offset,oe=A.getReferenceClientRect,nt=A.moveTransition,Dt=q()?Fa(v).arrow:null,lo=oe?{getBoundingClientRect:oe,contextElement:oe.contextElement||re()}:t,Pg={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(al){var ao=al.state;if(q()){var IA=Se(),au=IA.box;["placement","reference-hidden","escaped"].forEach(function(cl){cl==="placement"?au.setAttribute("data-placement",ao.placement):ao.attributes.popper["data-popper-"+cl]?au.setAttribute("data-"+cl,""):au.removeAttribute("data-"+cl)}),ao.attributes.popper={}}}},Nr=[{name:"offset",options:{offset:ie}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!nt}},Pg];q()&&Dt&&Nr.push({name:"arrow",options:{element:Dt,padding:3}}),Nr.push.apply(Nr,H?.modifiers||[]),E.popperInstance=Nw(lo,v,Object.assign({},H,{placement:K,onFirstUpdate:f,modifiers:Nr}))}function S(){E.popperInstance&&(E.popperInstance.destroy(),E.popperInstance=null)}function R(){var A=E.props.appendTo,H,K=re();E.props.interactive&&A===Cp||A==="parent"?H=K.parentNode:H=Sp(A,[K]),H.contains(v)||H.appendChild(v),E.state.isMounted=!0,C(),process.env.NODE_ENV!=="production"&&yn(E.props.interactive&&A===gt.appendTo&&K.nextElementSibling!==v,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
98
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var nE=function(){return"innerHTML"};function Hl(t,e){t[nE()]=e}function Jp(t){var e=Fo();return t===!0?e.className=Lp:(e.className=Rp,$o(t)?e.appendChild(t):Hl(e,t)),e}function Yp(t,e){$o(e.content)?(Hl(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Hl(t,e.content):t.textContent=e.content)}function zl(t){var e=t.firstElementChild,n=Xi(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(xp)}),arrow:n.find(function(r){return r.classList.contains(Lp)||r.classList.contains(Rp)}),backdrop:n.find(function(r){return r.classList.contains(L_)})}}function Xp(t){var e=Fo(),n=Fo();n.className=x_,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Fo();r.className=xp,r.setAttribute("data-state","hidden"),Yp(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props);function o(i,s){var a=zl(e),l=a.box,c=a.content,u=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&Yp(c,t.props),s.arrow?u?i.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(Jp(s.arrow))):l.appendChild(Jp(s.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:o}}Xp.$$tippy=!0;var rE=1,Qi=[],jl=[];function oE(t,e){var n=qp(t,Object.assign({},St,Kp(Fp(e)))),r,o,i,s=!1,a=!1,l=!1,c=!1,u,f,p,m=[],b=Dp(dn,n.interactiveDebounce),k,_=rE++,E=null,N=D_(n.plugins),A={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},d={id:_,reference:t,popper:Fo(),popperInstance:E,props:n,state:A,plugins:N,clearDelayTimeouts:z,setProps:ce,setContent:Ne,show:Tn,hide:ao,hideWithInteractivity:er,enable:le,disable:R,unmount:Nn,destroy:bu};if(!n.render)return process.env.NODE_ENV!=="production"&&Vl(!0,"render() function has not been supplied."),d;var g=n.render(d),h=g.popper,w=g.onUpdate;h.setAttribute("data-tippy-root",""),h.id="tippy-"+d.id,d.popper=h,t._tippy=d,h._tippy=d;var v=N.map(function(B){return B.fn(d)}),S=t.hasAttribute("aria-expanded");return At(),Z(),I(),U("onCreate",[d]),n.showOnCreate&&ve(),h.addEventListener("mouseenter",function(){d.props.interactive&&d.state.isVisible&&d.clearDelayTimeouts()}),h.addEventListener("mouseleave",function(){d.props.interactive&&d.props.trigger.indexOf("mouseenter")>=0&&F().addEventListener("mousemove",b)}),d;function C(){var B=d.props.touch;return Array.isArray(B)?B:[B,0]}function M(){return C()[0]==="hold"}function P(){var B;return!!((B=d.props.render)!=null&&B.$$tippy)}function D(){return k||t}function F(){var B=D().parentNode;return B?z_(B):document}function $(){return zl(h)}function T(B){return d.state.isMounted&&!d.state.isVisible||tn.isTouch||u&&u.type==="focus"?0:Dl(d.props.delay,B?0:1,St.delay)}function I(B){B===void 0&&(B=!1),h.style.pointerEvents=d.props.interactive&&!B?"":"none",h.style.zIndex=""+d.props.zIndex}function U(B,X,re){if(re===void 0&&(re=!0),v.forEach(function(pe){pe[B]&&pe[B].apply(pe,X)}),re){var ge;(ge=d.props)[B].apply(ge,X)}}function q(){var B=d.props.aria;if(B.content){var X="aria-"+B.content,re=h.id,ge=Gr(d.props.triggerTarget||t);ge.forEach(function(pe){var ft=pe.getAttribute(X);if(d.state.isVisible)pe.setAttribute(X,ft?ft+" "+re:re);else{var zt=ft&&ft.replace(re,"").trim();zt?pe.setAttribute(X,zt):pe.removeAttribute(X)}})}}function Z(){if(!(S||!d.props.aria.expanded)){var B=Gr(d.props.triggerTarget||t);B.forEach(function(X){d.props.interactive?X.setAttribute("aria-expanded",d.state.isVisible&&X===D()?"true":"false"):X.removeAttribute("aria-expanded")})}}function G(){F().removeEventListener("mousemove",b),Qi=Qi.filter(function(B){return B!==b})}function he(B){if(!(tn.isTouch&&(l||B.type==="mousedown"))){var X=B.composedPath&&B.composedPath()[0]||B.target;if(!(d.props.interactive&&Vp(h,X))){if(Gr(d.props.triggerTarget||t).some(function(re){return Vp(re,X)})){if(tn.isTouch||d.state.isVisible&&d.props.trigger.indexOf("click")>=0)return}else U("onClickOutside",[d,B]);d.props.hideOnClick===!0&&(d.clearDelayTimeouts(),d.hide(),a=!0,setTimeout(function(){a=!1}),d.state.isMounted||we())}}}function Te(){l=!0}function Oe(){l=!1}function fe(){var B=F();B.addEventListener("mousedown",he,!0),B.addEventListener("touchend",he,br),B.addEventListener("touchstart",Oe,br),B.addEventListener("touchmove",Te,br)}function we(){var B=F();B.removeEventListener("mousedown",he,!0),B.removeEventListener("touchend",he,br),B.removeEventListener("touchstart",Oe,br),B.removeEventListener("touchmove",Te,br)}function Me(B,X){_t(B,function(){!d.state.isVisible&&h.parentNode&&h.parentNode.contains(h)&&X()})}function ke(B,X){_t(B,X)}function _t(B,X){var re=$().box;function ge(pe){pe.target===re&&($l(re,"remove",ge),X())}if(B===0)return X();$l(re,"remove",f),$l(re,"add",ge),f=ge}function ot(B,X,re){re===void 0&&(re=!1);var ge=Gr(d.props.triggerTarget||t);ge.forEach(function(pe){pe.addEventListener(B,X,re),m.push({node:pe,eventType:B,handler:X,options:re})})}function At(){M()&&(ot("touchstart",Et,{passive:!0}),ot("touchend",Ht,{passive:!0})),I_(d.props.trigger).forEach(function(B){if(B!=="manual")switch(ot(B,Et),B){case"mouseenter":ot("mouseleave",Ht);break;case"focus":ot(G_?"focusout":"blur",Jt);break;case"focusin":ot("focusout",Jt);break}})}function Vt(){m.forEach(function(B){var X=B.node,re=B.eventType,ge=B.handler,pe=B.options;X.removeEventListener(re,ge,pe)}),m=[]}function Et(B){var X,re=!1;if(!(!d.state.isEnabled||Sn(B)||a)){var ge=((X=u)==null?void 0:X.type)==="focus";u=B,k=B.currentTarget,Z(),!d.state.isVisible&&$_(B)&&Qi.forEach(function(pe){return pe(B)}),B.type==="click"&&(d.props.trigger.indexOf("mouseenter")<0||s)&&d.props.hideOnClick!==!1&&d.state.isVisible?re=!0:ve(B),B.type==="click"&&(s=!re),re&&!ge&&me(B)}}function dn(B){var X=B.target,re=D().contains(X)||h.contains(X);if(!(B.type==="mousemove"&&re)){var ge=Y().concat(h).map(function(pe){var ft,zt=pe._tippy,lo=(ft=zt.popperInstance)==null?void 0:ft.state;return lo?{popperRect:pe.getBoundingClientRect(),popperState:lo,props:n}:null}).filter(Boolean);j_(ge,B)&&(G(),me(B))}}function Ht(B){var X=Sn(B)||d.props.trigger.indexOf("click")>=0&&s;if(!X){if(d.props.interactive){d.hideWithInteractivity(B);return}me(B)}}function Jt(B){d.props.trigger.indexOf("focusin")<0&&B.target!==D()||d.props.interactive&&B.relatedTarget&&h.contains(B.relatedTarget)||me(B)}function Sn(B){return tn.isTouch?M()!==B.type.indexOf("touch")>=0:!1}function O(){x();var B=d.props,X=B.popperOptions,re=B.placement,ge=B.offset,pe=B.getReferenceClientRect,ft=B.moveTransition,zt=P()?zl(h).arrow:null,lo=pe?{getBoundingClientRect:pe,contextElement:pe.contextElement||D()}:t,F0={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(fa){var co=fa.state;if(P()){var IO=$(),wu=IO.box;["placement","reference-hidden","escaped"].forEach(function(pa){pa==="placement"?wu.setAttribute("data-placement",co.placement):co.attributes.popper["data-popper-"+pa]?wu.setAttribute("data-"+pa,""):wu.removeAttribute("data-"+pa)}),co.attributes.popper={}}}},Or=[{name:"offset",options:{offset:ge}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ft}},F0];P()&&zt&&Or.push({name:"arrow",options:{element:zt,padding:3}}),Or.push.apply(Or,X?.modifiers||[]),d.popperInstance=M_(lo,h,Object.assign({},X,{placement:re,onFirstUpdate:p,modifiers:Or}))}function x(){d.popperInstance&&(d.popperInstance.destroy(),d.popperInstance=null)}function H(){var B=d.props.appendTo,X,re=D();d.props.interactive&&B===Pp||B==="parent"?X=re.parentNode:X=Ip(B,[re]),X.contains(h)||X.appendChild(h),d.state.isMounted=!0,O(),process.env.NODE_ENV!=="production"&&wn(d.props.interactive&&B===St.appendTo&&re.nextElementSibling!==h,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
99
99
 
100
100
  `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
101
101
 
102
102
  `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
103
103
 
104
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function $(){return Xs(v.querySelectorAll("[data-tippy-root]"))}function fe(A){E.clearDelayTimeouts(),A&&Oe("onTrigger",[E,A]),tt();var H=de(!0),K=V(),ie=K[0],oe=K[1];Yt.isTouch&&ie==="hold"&&oe&&(H=oe),H?r=setTimeout(function(){E.show()},H):E.show()}function se(A){if(E.clearDelayTimeouts(),Oe("onUntrigger",[E,A]),!E.state.isVisible){Rt();return}if(!(E.props.trigger.indexOf("mouseenter")>=0&&E.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(A.type)>=0&&i)){var H=de(!1);H?o=setTimeout(function(){E.state.isVisible&&E.hide()},H):s=requestAnimationFrame(function(){E.hide()})}}function Q(){E.state.isEnabled=!0}function N(){E.hide(),E.state.isEnabled=!1}function L(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(s)}function ee(A){if(process.env.NODE_ENV!=="production"&&yn(E.state.isDestroyed,Jr("setProps")),!E.state.isDestroyed){Oe("onBeforeUpdate",[E,A]),Qn();var H=E.props,K=Dp(t,Object.assign({},H,Tp(A),{ignoreAttributes:!0}));E.props=K,an(),H.interactiveDebounce!==K.interactiveDebounce&&(Et(),h=vp(cn,K.interactiveDebounce)),H.triggerTarget&&!K.triggerTarget?qr(H.triggerTarget).forEach(function(ie){ie.removeAttribute("aria-expanded")}):K.triggerTarget&&t.removeAttribute("aria-expanded"),Me(),me(),T&&T(H,K),E.popperInstance&&(C(),$().forEach(function(ie){requestAnimationFrame(ie._tippy.popperInstance.forceUpdate)})),Oe("onAfterUpdate",[E,A])}}function ge(A){E.setProps({content:A})}function vn(){process.env.NODE_ENV!=="production"&&yn(E.state.isDestroyed,Jr("show"));var A=E.state.isVisible,H=E.state.isDestroyed,K=!E.state.isEnabled,ie=Yt.isTouch&&!E.props.touch,oe=Ra(E.props.duration,0,gt.duration);if(!(A||H||K||ie)&&!re().hasAttribute("disabled")&&(Oe("onShow",[E],!1),E.props.onShow(E)!==!1)){if(E.state.isVisible=!0,q()&&(v.style.visibility="visible"),me(),tt(),E.state.isMounted||(v.style.transition="none"),q()){var nt=Se(),Dt=nt.box,lo=nt.content;Ia([Dt,lo],0)}f=function(){var Nr;if(!(!E.state.isVisible||c)){if(c=!0,v.offsetHeight,v.style.transition=E.props.moveTransition,q()&&E.props.animation){var lu=Se(),al=lu.box,ao=lu.content;Ia([al,ao],oe),Op([al,ao],"visible")}dt(),Me(),xp($a,E),(Nr=E.popperInstance)==null||Nr.forceUpdate(),Oe("onMount",[E]),E.props.animation&&q()&&pt(oe,function(){E.state.isShown=!0,Oe("onShown",[E])})}},R()}}function io(){process.env.NODE_ENV!=="production"&&yn(E.state.isDestroyed,Jr("hide"));var A=!E.state.isVisible,H=E.state.isDestroyed,K=!E.state.isEnabled,ie=Ra(E.props.duration,1,gt.duration);if(!(A||H||K)&&(Oe("onHide",[E],!1),E.props.onHide(E)!==!1)){if(E.state.isVisible=!1,E.state.isShown=!1,c=!1,i=!1,q()&&(v.style.visibility="hidden"),Et(),Rt(),me(!0),q()){var oe=Se(),nt=oe.box,Dt=oe.content;E.props.animation&&(Ia([nt,Dt],ie),Op([nt,Dt],"hidden"))}dt(),Me(),E.props.animation?q()&&sn(ie,E.unmount):E.unmount()}}function Zn(A){process.env.NODE_ENV!=="production"&&yn(E.state.isDestroyed,Jr("hideWithInteractivity")),Te().addEventListener("mousemove",h),xp(Qs,h),h(A)}function xn(){process.env.NODE_ENV!=="production"&&yn(E.state.isDestroyed,Jr("unmount")),E.state.isVisible&&E.hide(),E.state.isMounted&&(S(),$().forEach(function(A){A._tippy.unmount()}),v.parentNode&&v.parentNode.removeChild(v),$a=$a.filter(function(A){return A!==E}),E.state.isMounted=!1,Oe("onHidden",[E]))}function iu(){process.env.NODE_ENV!=="production"&&yn(E.state.isDestroyed,Jr("destroy")),!E.state.isDestroyed&&(E.clearDelayTimeouts(),E.unmount(),Qn(),delete t._tippy,E.state.isDestroyed=!0,Oe("onDestroy",[E]))}}function Gr(t,e){e===void 0&&(e={});var n=gt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(Gw(t),Pp(e,n)),jw();var r=Object.assign({},e,{plugins:n}),o=$w(t);if(process.env.NODE_ENV!=="production"){var s=Fo(r.content),i=o.length>1;yn(s&&i,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
104
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Y(){return Xi(h.querySelectorAll("[data-tippy-root]"))}function ve(B){d.clearDelayTimeouts(),B&&U("onTrigger",[d,B]),fe();var X=T(!0),re=C(),ge=re[0],pe=re[1];tn.isTouch&&ge==="hold"&&pe&&(X=pe),X?r=setTimeout(function(){d.show()},X):d.show()}function me(B){if(d.clearDelayTimeouts(),U("onUntrigger",[d,B]),!d.state.isVisible){we();return}if(!(d.props.trigger.indexOf("mouseenter")>=0&&d.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(B.type)>=0&&s)){var X=T(!1);X?o=setTimeout(function(){d.state.isVisible&&d.hide()},X):i=requestAnimationFrame(function(){d.hide()})}}function le(){d.state.isEnabled=!0}function R(){d.hide(),d.state.isEnabled=!1}function z(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)}function ce(B){if(process.env.NODE_ENV!=="production"&&wn(d.state.isDestroyed,Jr("setProps")),!d.state.isDestroyed){U("onBeforeUpdate",[d,B]),Vt();var X=d.props,re=qp(t,Object.assign({},X,Fp(B),{ignoreAttributes:!0}));d.props=re,At(),X.interactiveDebounce!==re.interactiveDebounce&&(G(),b=Dp(dn,re.interactiveDebounce)),X.triggerTarget&&!re.triggerTarget?Gr(X.triggerTarget).forEach(function(ge){ge.removeAttribute("aria-expanded")}):re.triggerTarget&&t.removeAttribute("aria-expanded"),Z(),I(),w&&w(X,re),d.popperInstance&&(O(),Y().forEach(function(ge){requestAnimationFrame(ge._tippy.popperInstance.forceUpdate)})),U("onAfterUpdate",[d,B])}}function Ne(B){d.setProps({content:B})}function Tn(){process.env.NODE_ENV!=="production"&&wn(d.state.isDestroyed,Jr("show"));var B=d.state.isVisible,X=d.state.isDestroyed,re=!d.state.isEnabled,ge=tn.isTouch&&!d.props.touch,pe=Dl(d.props.duration,0,St.duration);if(!(B||X||re||ge)&&!D().hasAttribute("disabled")&&(U("onShow",[d],!1),d.props.onShow(d)!==!1)){if(d.state.isVisible=!0,P()&&(h.style.visibility="visible"),I(),fe(),d.state.isMounted||(h.style.transition="none"),P()){var ft=$(),zt=ft.box,lo=ft.content;Fl([zt,lo],0)}p=function(){var Or;if(!(!d.state.isVisible||c)){if(c=!0,h.offsetHeight,h.style.transition=d.props.moveTransition,P()&&d.props.animation){var yu=$(),fa=yu.box,co=yu.content;Fl([fa,co],pe),$p([fa,co],"visible")}q(),Z(),Bp(jl,d),(Or=d.popperInstance)==null||Or.forceUpdate(),U("onMount",[d]),d.props.animation&&P()&&ke(pe,function(){d.state.isShown=!0,U("onShown",[d])})}},H()}}function ao(){process.env.NODE_ENV!=="production"&&wn(d.state.isDestroyed,Jr("hide"));var B=!d.state.isVisible,X=d.state.isDestroyed,re=!d.state.isEnabled,ge=Dl(d.props.duration,1,St.duration);if(!(B||X||re)&&(U("onHide",[d],!1),d.props.onHide(d)!==!1)){if(d.state.isVisible=!1,d.state.isShown=!1,c=!1,s=!1,P()&&(h.style.visibility="hidden"),G(),we(),I(!0),P()){var pe=$(),ft=pe.box,zt=pe.content;d.props.animation&&(Fl([ft,zt],ge),$p([ft,zt],"hidden"))}q(),Z(),d.props.animation?P()&&Me(ge,d.unmount):d.unmount()}}function er(B){process.env.NODE_ENV!=="production"&&wn(d.state.isDestroyed,Jr("hideWithInteractivity")),F().addEventListener("mousemove",b),Bp(Qi,b),b(B)}function Nn(){process.env.NODE_ENV!=="production"&&wn(d.state.isDestroyed,Jr("unmount")),d.state.isVisible&&d.hide(),d.state.isMounted&&(x(),Y().forEach(function(B){B._tippy.unmount()}),h.parentNode&&h.parentNode.removeChild(h),jl=jl.filter(function(B){return B!==d}),d.state.isMounted=!1,U("onHidden",[d]))}function bu(){process.env.NODE_ENV!=="production"&&wn(d.state.isDestroyed,Jr("destroy")),!d.state.isDestroyed&&(d.clearDelayTimeouts(),d.unmount(),Vt(),delete t._tippy,d.state.isDestroyed=!0,U("onDestroy",[d]))}}function Yr(t,e){e===void 0&&(e={});var n=St.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(X_(t),Gp(e,n)),K_();var r=Object.assign({},e,{plugins:n}),o=H_(t);if(process.env.NODE_ENV!=="production"){var i=$o(r.content),s=o.length>1;wn(i&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
105
105
 
106
106
  `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
107
107
 
108
108
  `,`1) content: element.innerHTML
109
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var l=o.reduce(function(a,c){var u=c&&nk(c,r);return u&&a.push(u),a},[]);return Fo(t)?l[0]:l}Gr.defaultProps=gt,Gr.setDefaultProps=Qw,Gr.currentInput=Yt,Object.assign({},rp,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),Gr.setDefaultProps({render:$p});class rk{constructor({editor:e,element:n,view:r,tippyOptions:o={},updateDelay:s=250,shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:l,state:a,from:c,to:u})=>{const{doc:d,selection:f}=a,{empty:p}=f,h=!d.textBetween(c,u).length&&fa(a.selection),m=this.element.contains(document.activeElement);return!(!(l.hasFocus()||m)||p||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var a;if(this.preventHide){this.preventHide=!1;return}l?.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(l.relatedTarget))||l?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,a)=>{const c=!a?.selection.eq(l.state.selection),u=!a?.doc.eq(l.state.doc);!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,c,u,a)},this.updateDelay))},this.updateHandler=(l,a,c,u)=>{var d,f,p;const{state:h,composing:m}=l,{selection:y}=h;if(m||!a&&!c)return;this.createTooltip();const{ranges:w}=y,k=Math.min(...w.map(v=>v.$from.pos)),E=Math.max(...w.map(v=>v.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,element:this.element,view:l,state:h,oldState:u,from:k,to:E}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(nE(h.selection)){let v=l.nodeDOM(k);if(v){const T=v.dataset.nodeViewWrapper?v:v.querySelector("[data-node-view-wrapper]");if(T&&(v=T.firstChild),v)return v.getBoundingClientRect()}}return Qf(l,k,E)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=s,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Gr(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,o=r.selection.from!==r.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,n);return}const s=!n?.selection.eq(e.state.selection),i=!n?.doc.eq(e.state.doc);this.updateHandler(e,s,i,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Vp=t=>new Ae({key:typeof t.pluginKey=="string"?new De(t.pluginKey):t.pluginKey,view:e=>new rk({view:e,...t})});Be.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Vp({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class ok{getTextContent(e){return Gf(e,{textSerializers:ua(this.editor.schema)})}constructor({editor:e,element:n,view:r,tippyOptions:o={},shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:i,state:l})=>{const{selection:a}=l,{$anchor:c,empty:u}=a,d=c.depth===1,f=c.parent.isTextblock&&!c.parent.type.spec.code&&!c.parent.textContent&&c.parent.childCount===0&&!this.getTextContent(c.parent);return!(!i.hasFocus()||!u||!d||!f||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:i})=>{var l;if(this.preventHide){this.preventHide=!1;return}i?.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(i.relatedTarget))||i?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=i=>{this.blurHandler({event:i})},this.editor=e,this.element=n,this.view=r,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Gr(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,o,s;const{state:i}=e,{doc:l,selection:a}=i,{from:c,to:u}=a;if(n&&n.doc.eq(l)&&n.selection.eq(a))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:i,oldState:n}))){this.hide();return}(o=this.tippy)===null||o===void 0||o.setProps({getReferenceClientRect:((s=this.tippyOptions)===null||s===void 0?void 0:s.getReferenceClientRect)||(()=>Qf(e,c,u))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Hp=t=>new Ae({key:typeof t.pluginKey=="string"?new De(t.pluginKey):t.pluginKey,view:e=>new ok({view:e,...t})});Be.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Hp({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),g.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=g.ref(null);return g.onMounted(()=>{const{updateDelay:r,editor:o,pluginKey:s,shouldShow:i,tippyOptions:l}=t;o.registerPlugin(Vp({updateDelay:r,editor:o,element:n.value,pluginKey:s,shouldShow:i,tippyOptions:l}))}),g.onBeforeUnmount(()=>{const{pluginKey:r,editor:o}=t;o.unregisterPlugin(r)}),()=>{var r;return g.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function Up(t){return g.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class sk extends CE{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=Up(this.view.state),this.reactiveExtensionStorage=Up(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),g.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){const r=super.registerPlugin(e,n);return this.reactiveState&&(this.reactiveState.value=r),r}unregisterPlugin(e){const n=super.unregisterPlugin(e);return this.reactiveState&&n&&(this.reactiveState.value=n),n}}const ik=g.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=g.ref(),n=g.getCurrentInstance();return g.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&g.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const o=g.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:o}),r.createNodeViews()})}),g.onBeforeUnmount(()=>{const r=t.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return g.h("div",{ref:t=>{this.rootEl=t}})}});g.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=g.ref(null);return g.onMounted(()=>{const{pluginKey:r,editor:o,tippyOptions:s,shouldShow:i}=t;o.registerPlugin(Hp({pluginKey:r,editor:o,element:n.value,tippyOptions:s,shouldShow:i}))}),g.onBeforeUnmount(()=>{const{pluginKey:r,editor:o}=t;o.unregisterPlugin(r)}),()=>{var r;return g.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),g.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return g.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),g.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return g.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}});const lk=(t={})=>{const e=g.shallowRef();return g.onMounted(()=>{e.value=new sk(t)}),g.onBeforeUnmount(()=>{var n,r,o;const s=(n=e.value)===null||n===void 0?void 0:n.options.element,i=s?.cloneNode(!0);(r=s?.parentNode)===null||r===void 0||r.replaceChild(i,s),(o=e.value)===null||o===void 0||o.destroy()}),e},ak=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,ck=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,uk=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,dk=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,fk=ot.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",pe(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[pr({find:ak,type:this.type}),pr({find:uk,type:this.type})]},addPasteRules(){return[Hn({find:ck,type:this.type}),Hn({find:dk,type:this.type})]}}),pk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,hk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,mk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,gk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,yk=ot.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",pe(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[pr({find:pk,type:this.type}),pr({find:mk,type:this.type})]},addPasteRules(){return[Hn({find:hk,type:this.type}),Hn({find:gk,type:this.type})]}}),bk=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Ek=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,wk=ot.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",pe(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[pr({find:bk,type:this.type})]},addPasteRules(){return[Hn({find:Ek,type:this.type})]}}),kk=/(^|[^`])`([^`]+)`(?!`)/,Ck=/(^|[^`])`([^`]+)`(?!`)/g,Sk=ot.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",pe(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[pr({find:kk,type:this.type})]},addPasteRules(){return[Hn({find:Ck,type:this.type})]}}),vk=/^```([a-z]+)?[\s\n]$/,xk=/^~~~([a-z]+)?[\s\n]$/,Tk=Fe.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,s=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(i=>i.startsWith(n)).map(i=>i.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",pe(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,i=r.parent.textContent.endsWith(`
109
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var a=o.reduce(function(l,c){var u=c&&oE(c,r);return u&&l.push(u),l},[]);return $o(t)?a[0]:a}Yr.defaultProps=St,Yr.setDefaultProps=eE,Yr.currentInput=tn,Object.assign({},mp,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),Yr.setDefaultProps({render:Xp});class iE{constructor({editor:e,element:n,view:r,tippyOptions:o={},updateDelay:i=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:c,to:u})=>{const{doc:f,selection:p}=l,{empty:m}=p,b=!f.textBetween(c,u).length&&gl(l.selection),k=this.element.contains(document.activeElement);return!(!(a.hasFocus()||k)||m||b||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a?.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||a?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const c=!l?.selection.eq(a.state.selection),u=!l?.doc.eq(a.state.doc);!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,c,u,l)},this.updateDelay))},this.updateHandler=(a,l,c,u)=>{var f,p,m;const{state:b,composing:k}=a,{selection:_}=b;if(k||!l&&!c)return;this.createTooltip();const{ranges:N}=_,A=Math.min(...N.map(h=>h.$from.pos)),d=Math.max(...N.map(h=>h.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,element:this.element,view:a,state:b,oldState:u,from:A,to:d}))){this.hide();return}(p=this.tippy)===null||p===void 0||p.setProps({getReferenceClientRect:((m=this.tippyOptions)===null||m===void 0?void 0:m.getReferenceClientRect)||(()=>{if(o1(b.selection)){let h=a.nodeDOM(A);if(h){const w=h.dataset.nodeViewWrapper?h:h.querySelector("[data-node-view-wrapper]");if(w&&(h=w.firstChild),h)return h.getBoundingClientRect()}}return up(a,A,d)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=i,s&&(this.shouldShow=s),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.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Yr(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,o=r.selection.from!==r.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,n);return}const i=!n?.selection.eq(e.state.selection),s=!n?.doc.eq(e.state.doc);this.updateHandler(e,i,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Qp=t=>new $e({key:typeof t.pluginKey=="string"?new Ue(t.pluginKey):t.pluginKey,view:e=>new iE({view:e,...t})});Ke.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Qp({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class sE{getTextContent(e){return ap(e,{textSerializers:hl(this.editor.schema)})}constructor({editor:e,element:n,view:r,tippyOptions:o={},shouldShow:i}){this.preventHide=!1,this.shouldShow=({view:s,state:a})=>{const{selection:l}=a,{$anchor:c,empty:u}=l,f=c.depth===1,p=c.parent.isTextblock&&!c.parent.type.spec.code&&!c.parent.textContent&&c.parent.childCount===0&&!this.getTextContent(c.parent);return!(!s.hasFocus()||!u||!f||!p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var a;if(this.preventHide){this.preventHide=!1;return}s?.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(s.relatedTarget))||s?.relatedTarget!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,i&&(this.shouldShow=i),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=Yr(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,o,i;const{state:s}=e,{doc:a,selection:l}=s,{from:c,to:u}=l;if(n&&n.doc.eq(a)&&n.selection.eq(l))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(o=this.tippy)===null||o===void 0||o.setProps({getReferenceClientRect:((i=this.tippyOptions)===null||i===void 0?void 0:i.getReferenceClientRect)||(()=>up(e,c,u))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Zp=t=>new $e({key:typeof t.pluginKey=="string"?new Ue(t.pluginKey):t.pluginKey,view:e=>new sE({view:e,...t})});Ke.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Zp({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),y.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=y.ref(null);return y.onMounted(()=>{const{updateDelay:r,editor:o,pluginKey:i,shouldShow:s,tippyOptions:a}=t;o.registerPlugin(Qp({updateDelay:r,editor:o,element:n.value,pluginKey:i,shouldShow:s,tippyOptions:a}))}),y.onBeforeUnmount(()=>{const{pluginKey:r,editor:o}=t;o.unregisterPlugin(r)}),()=>{var r;return y.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function eh(t){return y.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class aE extends C1{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=eh(this.view.state),this.reactiveExtensionStorage=eh(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),y.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){const r=super.registerPlugin(e,n);return this.reactiveState&&(this.reactiveState.value=r),r}unregisterPlugin(e){const n=super.unregisterPlugin(e);return this.reactiveState&&n&&(this.reactiveState.value=n),n}}const th=y.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=y.ref(),n=y.getCurrentInstance();return y.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&y.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const o=y.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:o}),r.createNodeViews()})}),y.onBeforeUnmount(()=>{const r=t.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return y.h("div",{ref:t=>{this.rootEl=t}})}});y.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=y.ref(null);return y.onMounted(()=>{const{pluginKey:r,editor:o,tippyOptions:i,shouldShow:s}=t;o.registerPlugin(Zp({pluginKey:r,editor:o,element:n.value,tippyOptions:i,shouldShow:s}))}),y.onBeforeUnmount(()=>{const{pluginKey:r,editor:o}=t;o.unregisterPlugin(r)}),()=>{var r;return y.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),y.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return y.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),y.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return y.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}});const nh=(t={})=>{const e=y.shallowRef();return y.onMounted(()=>{e.value=new aE(t)}),y.onBeforeUnmount(()=>{var n,r,o;const i=(n=e.value)===null||n===void 0?void 0:n.options.element,s=i?.cloneNode(!0);(r=i?.parentNode)===null||r===void 0||r.replaceChild(s,i),(o=e.value)===null||o===void 0||o.destroy()}),e},lE=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,cE=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,uE=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,dE=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,rh=ht.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[hr({find:lE,type:this.type}),hr({find:uE,type:this.type})]},addPasteRules(){return[jn({find:cE,type:this.type}),jn({find:dE,type:this.type})]}}),fE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,pE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,hE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,mE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,oh=ht.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[hr({find:fE,type:this.type}),hr({find:hE,type:this.type})]},addPasteRules(){return[jn({find:pE,type:this.type}),jn({find:mE,type:this.type})]}}),gE=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,bE=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,ih=ht.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[hr({find:gE,type:this.type})]},addPasteRules(){return[jn({find:bE,type:this.type})]}}),yE=/(^|[^`])`([^`]+)`(?!`)/,wE=/(^|[^`])`([^`]+)`(?!`)/g,sh=ht.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[hr({find:yE,type:this.type})]},addPasteRules(){return[jn({find:wE,type:this.type})]}}),kE=/^```([a-z]+)?[\s\n]$/,_E=/^~~~([a-z]+)?[\s\n]$/,ah=ct.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,i=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Ce(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
110
110
 
111
- `);return!s||!i?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:s}=n;if(!s||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const l=o.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:c})=>(c.setSelection(z.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[Ca({find:vk,type:this.type,getAttributes:t=>({language:t[1]})}),Ca({find:xk,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Ae({key:new De("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,s=o?.mode;if(!n||!s)return!1;const{tr:i,schema:l}=t.state,a=l.text(n.replace(/\r\n?/g,`
112
- `));return i.replaceSelectionWith(this.type.create({language:s},a)),i.selection.$from.parent.type!==this.type&&i.setSelection(j.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.setMeta("paste",!0),t.dispatch(i),!0}}})]}}),Ok="listItem",zp="textStyle",jp=/^\s*([-+*])\s$/,Nk=Fe.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",pe(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Ok,this.editor.getAttributes(zp)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Ao({find:jp,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ao({find:jp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(zp),editor:this.editor})),[t]}}),Ak="listItem",Wp="textStyle",Kp=/^(\d+)\.\s$/,_k=Fe.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",pe(this.options.HTMLAttributes,n),0]:["ol",pe(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Ak,this.editor.getAttributes(Wp)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Ao({find:Kp,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ao({find:Kp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Wp)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),Mk=Fe.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",pe(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Rk=/^\s*>\s$/,Lk=Fe.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",pe(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Ao({find:Rk,type:this.type})]}}),Ik=Fe.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",pe(this.options.HTMLAttributes,t)]},renderText(){return`
113
- `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:s}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:l}=r.extensionManager,a=s||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&i){const d=a.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var Zs=200,$e=function(){};$e.prototype.append=function(e){return e.length?(e=$e.from(e),!this.length&&e||e.length<Zs&&this.leafAppend(e)||this.length<Zs&&e.leafPrepend(this)||this.appendInner(e)):this},$e.prototype.prepend=function(e){return e.length?$e.from(e).append(this):this},$e.prototype.appendInner=function(e){return new Dk(this,e)},$e.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?$e.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},$e.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},$e.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},$e.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(s,i){return o.push(e(s,i))},n,r),o},$e.from=function(e){return e instanceof $e?e:e&&e.length?new qp(e):$e.empty};var qp=function(t){function e(r){t.call(this),this.values=r}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(o,s){return o==0&&s==this.length?this:new e(this.values.slice(o,s))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,s,i,l){for(var a=s;a<i;a++)if(o(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(o,s,i,l){for(var a=s-1;a>=i;a--)if(o(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=Zs)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Zs)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}($e);$e.empty=new qp([]);var Dk=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.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(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,s,i){var l=this.left.length;if(o<l&&this.left.forEachInner(r,o,Math.min(s,l),i)===!1||s>l&&this.right.forEachInner(r,Math.max(o-l,0),Math.min(this.length,s)-l,i+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,i){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(r,o-l,Math.max(s,l)-l,i+l)===!1||s<l&&this.left.forEachInvertedInner(r,Math.min(o,l),s,i)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var s=this.left.length;return o<=s?this.left.slice(r,o):r>=s?this.right.slice(r-s,o-s):this.left.slice(r,s).append(this.right.slice(0,o-s))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}($e);const Pk=500;class Bt{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,s;n&&(o=this.remapping(r,this.items.length),s=o.maps.length);let i=e.tr,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(r,f+1),s=o.maps.length),s--,u.push(d);return}if(o){u.push(new Xt(d.map));let p=d.step.map(o.slice(s)),h;p&&i.maybeStep(p).doc&&(h=i.mapping.maps[i.mapping.maps.length-1],c.push(new Xt(h,void 0,void 0,c.length+u.length))),s--,h&&o.appendMap(h,s)}else i.maybeStep(d.step);if(d.selection)return l=o?d.selection.map(o.slice(s)):d.selection,a=new Bt(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:i,selection:l}}addTransform(e,n,r,o){let s=[],i=this.eventCount,l=this.items,a=!o&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new Xt(e.mapping.maps[u],d,n),p;(p=a&&a.merge(f))&&(f=p,u?s.pop():l=l.slice(0,l.length-1)),s.push(f),n&&(i++,n=void 0),o||(a=f)}let c=i-r.depth;return c>Fk&&(l=Bk(l,c),i-=c),new Bt(l.append(s),i)}remapping(e,n){let r=new ho;return this.items.forEach((o,s)=>{let i=o.mirrorOffset!=null&&s-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,i)},e,n),r}addMaps(e){return this.eventCount==0?this:new Bt(this.items.append(e.map(n=>new Xt(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),s=e.mapping,i=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},o);let a=n;this.items.forEach(f=>{let p=s.getMirror(--a);if(p==null)return;i=Math.min(i,p);let h=s.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),y=f.selection&&f.selection.map(s.slice(a+1,p));y&&l++,r.push(new Xt(h,m,y))}else r.push(new Xt(h))},o);let c=[];for(let f=n;f<i;f++)c.push(new Xt(s.maps[f]));let u=this.items.slice(0,o).append(c).append(r),d=new Bt(u,l);return d.emptyItemCount()>Pk&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],s=0;return this.items.forEach((i,l)=>{if(l>=e)o.push(i),i.selection&&s++;else if(i.step){let a=i.step.map(n.slice(r)),c=a&&a.getMap();if(r--,c&&n.appendMap(c,r),a){let u=i.selection&&i.selection.map(n.slice(r));u&&s++;let d=new Xt(c.invert(),a,u),f,p=o.length-1;(f=o.length&&o[p].merge(d))?o[p]=f:o.push(d)}}else i.map&&r--},this.items.length,0),new Bt($e.from(o.reverse()),s)}}Bt.empty=new Bt($e.empty,0);function Bk(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class Xt{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Xt(n.getMap().invert(),n,this.selection)}}}class zn{constructor(e,n,r,o,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}}const Fk=20;function $k(t,e,n,r){let o=n.getMeta(yr),s;if(o)return o.historyState;n.getMeta(Uk)&&(t=new zn(t.done,t.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(i&&i.getMeta(yr))return i.getMeta(yr).redo?new zn(t.done.addTransform(n,void 0,r,ei(e)),t.undone,Jp(n.mapping.maps),t.prevTime,t.prevComposition):new zn(t.done,t.undone.addTransform(n,void 0,r,ei(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=t.prevTime==0||!i&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!Vk(n,t.prevRanges)),c=i?Va(t.prevRanges,n.mapping):Jp(n.mapping.maps);return new zn(t.done.addTransform(n,a?e.selection.getBookmark():void 0,r,ei(e)),Bt.empty,c,n.time,l??t.prevComposition)}else return(s=n.getMeta("rebased"))?new zn(t.done.rebased(n,s),t.undone.rebased(n,s),Va(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new zn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Va(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function Vk(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&o>=e[s]&&(n=!0)}),n}function Jp(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,s,i)=>e.push(s,i));return e}function Va(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),s=e.map(t[r+1],-1);o<=s&&n.push(o,s)}return n}function Hk(t,e,n){let r=ei(e),o=yr.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let i=s.selection.resolve(s.transform.doc),l=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),o,r),a=new zn(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(i).setMeta(yr,{redo:n,historyState:a})}let Ha=!1,Gp=null;function ei(t){let e=t.plugins;if(Gp!=e){Ha=!1,Gp=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Ha=!0;break}}return Ha}const yr=new De("history"),Uk=new De("closeHistory");function zk(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ae({key:yr,state:{init(){return new zn(Bt.empty,Bt.empty,null,0,-1)},apply(e,n,r){return $k(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?Xp:r=="historyRedo"?Qp:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function Yp(t,e){return(n,r)=>{let o=yr.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let s=Hk(o,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const Xp=Yp(!1,!0),Qp=Yp(!0,!0),jk=Be.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Xp(t,e),redo:()=>({state:t,dispatch:e})=>Qp(t,e)}},addProseMirrorPlugins(){return[zk(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Wk=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,Kk=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,qk=ot.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",pe(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[pr({find:Wk,type:this.type})]},addPasteRules(){return[Hn({find:Kk,type:this.type})]}}),Jk=ot.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",pe(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Gk=ot.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",pe(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),Yk=ot.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",pe(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),Xk="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Qk="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Yr=(t,e)=>{for(const n in e)t[n]=e[n];return t},Ua="numeric",za="ascii",ja="alpha",Vo="asciinumeric",Ho="alphanumeric",Wa="domain",Zp="emoji",Zk="scheme",eC="slashscheme",Ka="whitespace";function tC(t,e){return t in e||(e[t]=[]),e[t]}function br(t,e,n){e[Ua]&&(e[Vo]=!0,e[Ho]=!0),e[za]&&(e[Vo]=!0,e[ja]=!0),e[Vo]&&(e[Ho]=!0),e[ja]&&(e[Ho]=!0),e[Ho]&&(e[Wa]=!0),e[Zp]&&(e[Wa]=!0);for(const r in e){const o=tC(r,n);o.indexOf(t)<0&&o.push(t)}}function nC(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function lt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}lt.groups={},lt.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const o=e.jr[r][0],s=e.jr[r][1];if(s&&o.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){r=r||lt.groups;let o;return e&&e.j?o=e:(o=new lt(e),n&&r&&br(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const s=t.length;if(!s)return o;for(let i=0;i<s-1;i++)o=o.tt(t[i]);return o.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||lt.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const s=e;let i,l=o.go(t);if(l?(i=new lt,Yr(i.j,l.j),i.jr.push.apply(i.jr,l.jr),i.jd=l.jd,i.t=l.t):i=new lt,s){if(r)if(i.t&&typeof i.t=="string"){const a=Yr(nC(i.t,r),n);br(s,a,r)}else n&&br(s,n,r);i.t=s}return o.j[t]=i,i}};const Y=(t,e,n,r,o)=>t.ta(e,n,r,o),we=(t,e,n,r,o)=>t.tr(e,n,r,o),eh=(t,e,n,r,o)=>t.ts(e,n,r,o),I=(t,e,n,r,o)=>t.tt(e,n,r,o),bn="WORD",qa="UWORD",th="ASCIINUMERICAL",nh="ALPHANUMERICAL",Uo="LOCALHOST",Ja="TLD",Ga="UTLD",ti="SCHEME",Xr="SLASH_SCHEME",Ya="NUM",Xa="WS",Qa="NL",zo="OPENBRACE",jo="CLOSEBRACE",ni="OPENBRACKET",ri="CLOSEBRACKET",oi="OPENPAREN",si="CLOSEPAREN",ii="OPENANGLEBRACKET",li="CLOSEANGLEBRACKET",ai="FULLWIDTHLEFTPAREN",ci="FULLWIDTHRIGHTPAREN",ui="LEFTCORNERBRACKET",di="RIGHTCORNERBRACKET",fi="LEFTWHITECORNERBRACKET",pi="RIGHTWHITECORNERBRACKET",hi="FULLWIDTHLESSTHAN",mi="FULLWIDTHGREATERTHAN",gi="AMPERSAND",yi="APOSTROPHE",bi="ASTERISK",jn="AT",Ei="BACKSLASH",wi="BACKTICK",ki="CARET",Wn="COLON",Za="COMMA",Ci="DOLLAR",Qt="DOT",Si="EQUALS",ec="EXCLAMATION",Nt="HYPHEN",Wo="PERCENT",vi="PIPE",xi="PLUS",Ti="POUND",Ko="QUERY",tc="QUOTE",rh="FULLWIDTHMIDDLEDOT",nc="SEMI",Zt="SLASH",qo="TILDE",Oi="UNDERSCORE",oh="EMOJI",Ni="SYM";var sh=Object.freeze({__proto__:null,ALPHANUMERICAL:nh,AMPERSAND:gi,APOSTROPHE:yi,ASCIINUMERICAL:th,ASTERISK:bi,AT:jn,BACKSLASH:Ei,BACKTICK:wi,CARET:ki,CLOSEANGLEBRACKET:li,CLOSEBRACE:jo,CLOSEBRACKET:ri,CLOSEPAREN:si,COLON:Wn,COMMA:Za,DOLLAR:Ci,DOT:Qt,EMOJI:oh,EQUALS:Si,EXCLAMATION:ec,FULLWIDTHGREATERTHAN:mi,FULLWIDTHLEFTPAREN:ai,FULLWIDTHLESSTHAN:hi,FULLWIDTHMIDDLEDOT:rh,FULLWIDTHRIGHTPAREN:ci,HYPHEN:Nt,LEFTCORNERBRACKET:ui,LEFTWHITECORNERBRACKET:fi,LOCALHOST:Uo,NL:Qa,NUM:Ya,OPENANGLEBRACKET:ii,OPENBRACE:zo,OPENBRACKET:ni,OPENPAREN:oi,PERCENT:Wo,PIPE:vi,PLUS:xi,POUND:Ti,QUERY:Ko,QUOTE:tc,RIGHTCORNERBRACKET:di,RIGHTWHITECORNERBRACKET:pi,SCHEME:ti,SEMI:nc,SLASH:Zt,SLASH_SCHEME:Xr,SYM:Ni,TILDE:qo,TLD:Ja,UNDERSCORE:Oi,UTLD:Ga,UWORD:qa,WORD:bn,WS:Xa});const En=/[a-z]/,Jo=new RegExp("\\p{L}","u"),rc=new RegExp("\\p{Emoji}","u"),wn=/\d/,oc=/\s/,ih="\r",sc=`
114
- `,rC="️",oC="‍",ic="";let Ai=null,_i=null;function sC(t=[]){const e={};lt.groups=e;const n=new lt;Ai==null&&(Ai=ah(Xk)),_i==null&&(_i=ah(Qk)),I(n,"'",yi),I(n,"{",zo),I(n,"}",jo),I(n,"[",ni),I(n,"]",ri),I(n,"(",oi),I(n,")",si),I(n,"<",ii),I(n,">",li),I(n,"(",ai),I(n,")",ci),I(n,"「",ui),I(n,"」",di),I(n,"『",fi),I(n,"』",pi),I(n,"<",hi),I(n,">",mi),I(n,"&",gi),I(n,"*",bi),I(n,"@",jn),I(n,"`",wi),I(n,"^",ki),I(n,":",Wn),I(n,",",Za),I(n,"$",Ci),I(n,".",Qt),I(n,"=",Si),I(n,"!",ec),I(n,"-",Nt),I(n,"%",Wo),I(n,"|",vi),I(n,"+",xi),I(n,"#",Ti),I(n,"?",Ko),I(n,'"',tc),I(n,"/",Zt),I(n,";",nc),I(n,"~",qo),I(n,"_",Oi),I(n,"\\",Ei),I(n,"・",rh);const r=we(n,wn,Ya,{[Ua]:!0});we(r,wn,r);const o=we(r,En,th,{[Vo]:!0}),s=we(r,Jo,nh,{[Ho]:!0}),i=we(n,En,bn,{[za]:!0});we(i,wn,o),we(i,En,i),we(o,wn,o),we(o,En,o);const l=we(n,Jo,qa,{[ja]:!0});we(l,En),we(l,wn,s),we(l,Jo,l),we(s,wn,s),we(s,En),we(s,Jo,s);const a=I(n,sc,Qa,{[Ka]:!0}),c=I(n,ih,Xa,{[Ka]:!0}),u=we(n,oc,Xa,{[Ka]:!0});I(n,ic,u),I(c,sc,a),I(c,ic,u),we(c,oc,u),I(u,ih),I(u,sc),we(u,oc,u),I(u,ic,u);const d=we(n,rc,oh,{[Zp]:!0});I(d,"#"),we(d,rc,d),I(d,rC,d);const f=I(d,oC);I(f,"#"),we(f,rc,d);const p=[[En,i],[wn,o]],h=[[En,null],[Jo,l],[wn,s]];for(let m=0;m<Ai.length;m++)Kn(n,Ai[m],Ja,bn,p);for(let m=0;m<_i.length;m++)Kn(n,_i[m],Ga,qa,h);br(Ja,{tld:!0,ascii:!0},e),br(Ga,{utld:!0,alpha:!0},e),Kn(n,"file",ti,bn,p),Kn(n,"mailto",ti,bn,p),Kn(n,"http",Xr,bn,p),Kn(n,"https",Xr,bn,p),Kn(n,"ftp",Xr,bn,p),Kn(n,"ftps",Xr,bn,p),br(ti,{scheme:!0,ascii:!0},e),br(Xr,{slashscheme:!0,ascii:!0},e),t=t.sort((m,y)=>m[0]>y[0]?1:-1);for(let m=0;m<t.length;m++){const y=t[m][0],w=t[m][1]?{[Zk]:!0}:{[eC]:!0};y.indexOf("-")>=0?w[Wa]=!0:En.test(y)?wn.test(y)?w[Vo]=!0:w[za]=!0:w[Ua]=!0,eh(n,y,y,w)}return eh(n,"localhost",Uo,{ascii:!0}),n.jd=new lt(Ni),{start:n,tokens:Yr({groups:e},sh)}}function lh(t,e){const n=iC(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,o=[];let s=0,i=0;for(;i<r;){let l=t,a=null,c=0,u=null,d=-1,f=-1;for(;i<r&&(a=l.go(n[i]));)l=a,l.accepts()?(d=0,f=0,u=l):d>=0&&(d+=n[i].length,f++),c+=n[i].length,s+=n[i].length,i++;s-=d,i-=f,c-=d,o.push({t:u.t,v:e.slice(s-c,s),s:s-c,e:s})}return o}function iC(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),s,i=o<55296||o>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(i),r+=i.length}return e}function Kn(t,e,n,r,o){let s;const i=e.length;for(let l=0;l<i-1;l++){const a=e[l];t.j[a]?s=t.j[a]:(s=new lt(r),s.jr=o.slice(),t.j[a]=s),t=s}return s=new lt(n),s.jr=o.slice(),t.j[e[i-1]]=s,s}function ah(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let s=0;for(;o.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let i=parseInt(t.substring(r,r+s),10);i>0;i--)n.pop();r+=s}else n.push(t[r]),r++}return e}const Go={defaultProtocol:"http",events:null,format:ch,formatHref:ch,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function lc(t,e=null){let n=Yr({},Go);t&&(n=Yr(n,t instanceof lc?t.o:t));const r=n.ignoreTags,o=[];for(let s=0;s<r.length;s++)o.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}lc.prototype={o:Go,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:Go[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function ch(t){return t}function uh(t,e){this.t="token",this.v=t,this.tk=e}uh.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Go.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),s=this.toFormattedString(t),i={},l=t.get("className",n,e),a=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return i.href=r,l&&(i.class=l),a&&(i.target=a),c&&(i.rel=c),u&&Yr(i,u),{tagName:o,attributes:i,content:s,eventListeners:d}}};function Mi(t,e){class n extends uh{constructor(o,s){super(o,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const dh=Mi("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),fh=Mi("text"),lC=Mi("nl"),Ri=Mi("url",{isLink:!0,toHref(t=Go.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Uo&&t[1].t===Wn}}),At=t=>new lt(t);function aC({groups:t}){const e=t.domain.concat([gi,bi,jn,Ei,wi,ki,Ci,Si,Nt,Ya,Wo,vi,xi,Ti,Zt,Ni,qo,Oi]),n=[yi,Wn,Za,Qt,ec,Wo,Ko,tc,nc,ii,li,zo,jo,ri,ni,oi,si,ai,ci,ui,di,fi,pi,hi,mi],r=[gi,yi,bi,Ei,wi,ki,Ci,Si,Nt,zo,jo,Wo,vi,xi,Ti,Ko,Zt,Ni,qo,Oi],o=At(),s=I(o,qo);Y(s,r,s),Y(s,t.domain,s);const i=At(),l=At(),a=At();Y(o,t.domain,i),Y(o,t.scheme,l),Y(o,t.slashscheme,a),Y(i,r,s),Y(i,t.domain,i);const c=I(i,jn);I(s,jn,c),I(l,jn,c),I(a,jn,c);const u=I(s,Qt);Y(u,r,s),Y(u,t.domain,s);const d=At();Y(c,t.domain,d),Y(d,t.domain,d);const f=I(d,Qt);Y(f,t.domain,d);const p=At(dh);Y(f,t.tld,p),Y(f,t.utld,p),I(c,Uo,p);const h=I(d,Nt);I(h,Nt,h),Y(h,t.domain,d),Y(p,t.domain,d),I(p,Qt,f),I(p,Nt,h);const m=I(p,Wn);Y(m,t.numeric,dh);const y=I(i,Nt),b=I(i,Qt);I(y,Nt,y),Y(y,t.domain,i),Y(b,r,s),Y(b,t.domain,i);const w=At(Ri);Y(b,t.tld,w),Y(b,t.utld,w),Y(w,t.domain,i),Y(w,r,s),I(w,Qt,b),I(w,Nt,y),I(w,jn,c);const k=I(w,Wn),E=At(Ri);Y(k,t.numeric,E);const x=At(Ri),v=At();Y(x,e,x),Y(x,n,v),Y(v,e,x),Y(v,n,v),I(w,Zt,x),I(E,Zt,x);const T=I(l,Wn),_=I(a,Wn),P=I(_,Zt),V=I(P,Zt);Y(l,t.domain,i),I(l,Qt,b),I(l,Nt,y),Y(a,t.domain,i),I(a,Qt,b),I(a,Nt,y),Y(T,t.domain,x),I(T,Zt,x),I(T,Ko,x),Y(V,t.domain,x),Y(V,e,x),I(V,Zt,x);const Z=[[zo,jo],[ni,ri],[oi,si],[ii,li],[ai,ci],[ui,di],[fi,pi],[hi,mi]];for(let q=0;q<Z.length;q++){const[re,Te]=Z[q],Se=I(x,re);I(v,re,Se),I(Se,Te,x);const de=At(Ri);Y(Se,e,de);const me=At();Y(Se,n),Y(de,e,de),Y(de,n,me),Y(me,e,de),Y(me,n,me),I(de,Te,x),I(me,Te,x)}return I(o,Uo,w),I(o,Qa,lC),{start:o,tokens:sh}}function cC(t,e,n){let r=n.length,o=0,s=[],i=[];for(;o<r;){let l=t,a=null,c=null,u=0,d=null,f=-1;for(;o<r&&!(a=l.go(n[o].t));)i.push(n[o++]);for(;o<r&&(c=a||l.go(n[o].t));)a=null,l=c,l.accepts()?(f=0,d=l):f>=0&&f++,o++,u++;if(f<0)o-=u,o<r&&(i.push(n[o]),o++);else{i.length>0&&(s.push(ac(fh,e,i)),i=[]),o-=f,u-=f;const p=d.t,h=n.slice(o-u,o);s.push(ac(p,e,h))}}return i.length>0&&s.push(ac(fh,e,i)),s}function ac(t,e,n){const r=n[0].s,o=n[n.length-1].e,s=e.slice(r,o);return new t(s,n)}const uC=typeof console<"u"&&console&&console.warn||(()=>{}),dC="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ye={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function fC(){return lt.groups={},ye.scanner=null,ye.parser=null,ye.tokenQueue=[],ye.pluginQueue=[],ye.customSchemes=[],ye.initialized=!1,ye}function ph(t,e=!1){if(ye.initialized&&uC(`linkifyjs: already initialized - will not register custom scheme "${t}" ${dC}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
111
+ `);return!i||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const a=o.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:c})=>(c.setSelection(ee.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[Tl({find:kE,type:this.type,getAttributes:t=>({language:t[1]})}),Tl({find:_E,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new $e({key:new Ue("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o?.mode;if(!n||!i)return!1;const{tr:s,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,`
112
+ `));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(te.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),EE="listItem",lh="textStyle",ch=/^\s*([-+*])\s$/,uh=ct.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(EE,this.editor.getAttributes(lh)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Mo({find:ch,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Mo({find:ch,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(lh),editor:this.editor})),[t]}}),vE="listItem",dh="textStyle",fh=/^(\d+)\.\s$/,ph=ct.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Ce(this.options.HTMLAttributes,n),0]:["ol",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(vE,this.editor.getAttributes(dh)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Mo({find:fh,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Mo({find:fh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(dh)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),hh=ct.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Ce(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),CE=/^\s*>\s$/,mh=ct.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Mo({find:CE,type:this.type})]}}),gh=ct.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Ce(this.options.HTMLAttributes,t)]},renderText(){return`
113
+ `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:i}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=i||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&s){const f=l.filter(p=>a.includes(p.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var Zi=200,qe=function(){};qe.prototype.append=function(e){return e.length?(e=qe.from(e),!this.length&&e||e.length<Zi&&this.leafAppend(e)||this.length<Zi&&e.leafPrepend(this)||this.appendInner(e)):this},qe.prototype.prepend=function(e){return e.length?qe.from(e).append(this):this},qe.prototype.appendInner=function(e){return new SE(this,e)},qe.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?qe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},qe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},qe.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},qe.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(e(i,s))},n,r),o},qe.from=function(e){return e instanceof qe?e:e&&e.length?new bh(e):qe.empty};var bh=function(t){function e(r){t.call(this),this.values=r}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(o,i){return o==0&&i==this.length?this:new e(this.values.slice(o,i))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,i,s,a){for(var l=i;l<s;l++)if(o(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(o,i,s,a){for(var l=i-1;l>=s;l--)if(o(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=Zi)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Zi)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(qe);qe.empty=new bh([]);var SE=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.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(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,i,s){var a=this.left.length;if(o<a&&this.left.forEachInner(r,o,Math.min(i,a),s)===!1||i>a&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(r,o-a,Math.max(i,a)-a,s+a)===!1||i<a&&this.left.forEachInvertedInner(r,Math.min(o,a),i,s)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(r,o):r>=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(qe);const TE=500;class Ut{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((f,p)=>{if(!f.step){o||(o=this.remapping(r,p+1),i=o.maps.length),i--,u.push(f);return}if(o){u.push(new nn(f.map));let m=f.step.map(o.slice(i)),b;m&&s.maybeStep(m).doc&&(b=s.mapping.maps[s.mapping.maps.length-1],c.push(new nn(b,void 0,void 0,c.length+u.length))),i--,b&&o.appendMap(b,i)}else s.maybeStep(f.step);if(f.selection)return a=o?f.selection.map(o.slice(i)):f.selection,l=new Ut(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),p=new nn(e.mapping.maps[u],f,n),m;(m=l&&l.merge(p))&&(p=m,u?i.pop():a=a.slice(0,a.length-1)),i.push(p),n&&(s++,n=void 0),o||(l=p)}let c=s-r.depth;return c>AE&&(a=NE(a,c),s-=c),new Ut(a.append(i),s)}remapping(e,n){let r=new mo;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Ut(this.items.append(e.map(n=>new nn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},o);let l=n;this.items.forEach(p=>{let m=i.getMirror(--l);if(m==null)return;s=Math.min(s,m);let b=i.maps[m];if(p.step){let k=e.steps[m].invert(e.docs[m]),_=p.selection&&p.selection.map(i.slice(l+1,m));_&&a++,r.push(new nn(b,k,_))}else r.push(new nn(b))},o);let c=[];for(let p=n;p<s;p++)c.push(new nn(i.maps[p]));let u=this.items.slice(0,o).append(c).append(r),f=new Ut(u,a);return f.emptyItemCount()>TE&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=e)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&i++;let f=new nn(c.invert(),l,u),p,m=o.length-1;(p=o.length&&o[m].merge(f))?o[m]=p:o.push(f)}}else s.map&&r--},this.items.length,0),new Ut(qe.from(o.reverse()),i)}}Ut.empty=new Ut(qe.empty,0);function NE(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class nn{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new nn(n.getMap().invert(),n,this.selection)}}}class Wn{constructor(e,n,r,o,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const AE=20;function OE(t,e,n,r){let o=n.getMeta(yr),i;if(o)return o.historyState;n.getMeta(LE)&&(t=new Wn(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(yr))return s.getMeta(yr).redo?new Wn(t.done.addTransform(n,void 0,r,es(e)),t.undone,yh(n.mapping.maps),t.prevTime,t.prevComposition):new Wn(t.done,t.undone.addTransform(n,void 0,r,es(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!ME(n,t.prevRanges)),c=s?Ul(t.prevRanges,n.mapping):yh(n.mapping.maps);return new Wn(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,es(e)),Ut.empty,c,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new Wn(t.done.rebased(n,i),t.undone.rebased(n,i),Ul(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Wn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Ul(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function ME(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&o>=e[i]&&(n=!0)}),n}function yh(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,i,s)=>e.push(i,s));return e}function Ul(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function xE(t,e,n){let r=es(e),o=yr.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),o,r),l=new Wn(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(yr,{redo:n,historyState:l})}let Wl=!1,wh=null;function es(t){let e=t.plugins;if(wh!=e){Wl=!1,wh=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Wl=!0;break}}return Wl}const yr=new Ue("history"),LE=new Ue("closeHistory");function RE(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new $e({key:yr,state:{init(){return new Wn(Ut.empty,Ut.empty,null,0,-1)},apply(e,n,r){return OE(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?_h:r=="historyRedo"?Eh:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function kh(t,e){return(n,r)=>{let o=yr.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let i=xE(o,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const _h=kh(!1,!0),Eh=kh(!0,!0),vh=Ke.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>_h(t,e),redo:()=>({state:t,dispatch:e})=>Eh(t,e)}},addProseMirrorPlugins(){return[RE(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),PE=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,IE=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,Ch=ht.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[hr({find:PE,type:this.type})]},addPasteRules(){return[jn({find:IE,type:this.type})]}}),Sh=ht.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Th=ht.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),Nh=ht.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),DE="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",BE="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Xr=(t,e)=>{for(const n in e)t[n]=e[n];return t},Kl="numeric",ql="ascii",Gl="alpha",Ho="asciinumeric",zo="alphanumeric",Jl="domain",Ah="emoji",FE="scheme",$E="slashscheme",Yl="whitespace";function VE(t,e){return t in e||(e[t]=[]),e[t]}function wr(t,e,n){e[Kl]&&(e[Ho]=!0,e[zo]=!0),e[ql]&&(e[Ho]=!0,e[Gl]=!0),e[Ho]&&(e[zo]=!0),e[Gl]&&(e[zo]=!0),e[zo]&&(e[Jl]=!0),e[Ah]&&(e[Jl]=!0);for(const r in e){const o=VE(r,n);o.indexOf(t)<0&&o.push(t)}}function HE(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function bt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}bt.groups={},bt.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const o=e.jr[r][0],i=e.jr[r][1];if(i&&o.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){r=r||bt.groups;let o;return e&&e.j?o=e:(o=new bt(e),n&&r&&wr(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const i=t.length;if(!i)return o;for(let s=0;s<i-1;s++)o=o.tt(t[s]);return o.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||bt.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const i=e;let s,a=o.go(t);if(a?(s=new bt,Xr(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new bt,i){if(r)if(s.t&&typeof s.t=="string"){const l=Xr(HE(s.t,r),n);wr(i,l,r)}else n&&wr(i,n,r);s.t=i}return o.j[t]=s,s}};const se=(t,e,n,r,o)=>t.ta(e,n,r,o),Re=(t,e,n,r,o)=>t.tr(e,n,r,o),Oh=(t,e,n,r,o)=>t.ts(e,n,r,o),j=(t,e,n,r,o)=>t.tt(e,n,r,o),kn="WORD",Xl="UWORD",Mh="ASCIINUMERICAL",xh="ALPHANUMERICAL",jo="LOCALHOST",Ql="TLD",Zl="UTLD",ts="SCHEME",Qr="SLASH_SCHEME",ec="NUM",tc="WS",nc="NL",Uo="OPENBRACE",Wo="CLOSEBRACE",ns="OPENBRACKET",rs="CLOSEBRACKET",is="OPENPAREN",ss="CLOSEPAREN",as="OPENANGLEBRACKET",ls="CLOSEANGLEBRACKET",cs="FULLWIDTHLEFTPAREN",us="FULLWIDTHRIGHTPAREN",ds="LEFTCORNERBRACKET",fs="RIGHTCORNERBRACKET",ps="LEFTWHITECORNERBRACKET",hs="RIGHTWHITECORNERBRACKET",ms="FULLWIDTHLESSTHAN",gs="FULLWIDTHGREATERTHAN",bs="AMPERSAND",ys="APOSTROPHE",ws="ASTERISK",Kn="AT",ks="BACKSLASH",_s="BACKTICK",Es="CARET",qn="COLON",rc="COMMA",vs="DOLLAR",rn="DOT",Cs="EQUALS",oc="EXCLAMATION",Dt="HYPHEN",Ko="PERCENT",Ss="PIPE",Ts="PLUS",Ns="POUND",qo="QUERY",ic="QUOTE",Lh="FULLWIDTHMIDDLEDOT",sc="SEMI",on="SLASH",Go="TILDE",As="UNDERSCORE",Rh="EMOJI",Os="SYM";var Ph=Object.freeze({__proto__:null,ALPHANUMERICAL:xh,AMPERSAND:bs,APOSTROPHE:ys,ASCIINUMERICAL:Mh,ASTERISK:ws,AT:Kn,BACKSLASH:ks,BACKTICK:_s,CARET:Es,CLOSEANGLEBRACKET:ls,CLOSEBRACE:Wo,CLOSEBRACKET:rs,CLOSEPAREN:ss,COLON:qn,COMMA:rc,DOLLAR:vs,DOT:rn,EMOJI:Rh,EQUALS:Cs,EXCLAMATION:oc,FULLWIDTHGREATERTHAN:gs,FULLWIDTHLEFTPAREN:cs,FULLWIDTHLESSTHAN:ms,FULLWIDTHMIDDLEDOT:Lh,FULLWIDTHRIGHTPAREN:us,HYPHEN:Dt,LEFTCORNERBRACKET:ds,LEFTWHITECORNERBRACKET:ps,LOCALHOST:jo,NL:nc,NUM:ec,OPENANGLEBRACKET:as,OPENBRACE:Uo,OPENBRACKET:ns,OPENPAREN:is,PERCENT:Ko,PIPE:Ss,PLUS:Ts,POUND:Ns,QUERY:qo,QUOTE:ic,RIGHTCORNERBRACKET:fs,RIGHTWHITECORNERBRACKET:hs,SCHEME:ts,SEMI:sc,SLASH:on,SLASH_SCHEME:Qr,SYM:Os,TILDE:Go,TLD:Ql,UNDERSCORE:As,UTLD:Zl,UWORD:Xl,WORD:kn,WS:tc});const _n=/[a-z]/,Jo=new RegExp("\\p{L}","u"),ac=new RegExp("\\p{Emoji}","u"),En=/\d/,lc=/\s/,Ih="\r",cc=`
114
+ `,zE="️",jE="‍",uc="";let Ms=null,xs=null;function UE(t=[]){const e={};bt.groups=e;const n=new bt;Ms==null&&(Ms=Bh(DE)),xs==null&&(xs=Bh(BE)),j(n,"'",ys),j(n,"{",Uo),j(n,"}",Wo),j(n,"[",ns),j(n,"]",rs),j(n,"(",is),j(n,")",ss),j(n,"<",as),j(n,">",ls),j(n,"(",cs),j(n,")",us),j(n,"「",ds),j(n,"」",fs),j(n,"『",ps),j(n,"』",hs),j(n,"<",ms),j(n,">",gs),j(n,"&",bs),j(n,"*",ws),j(n,"@",Kn),j(n,"`",_s),j(n,"^",Es),j(n,":",qn),j(n,",",rc),j(n,"$",vs),j(n,".",rn),j(n,"=",Cs),j(n,"!",oc),j(n,"-",Dt),j(n,"%",Ko),j(n,"|",Ss),j(n,"+",Ts),j(n,"#",Ns),j(n,"?",qo),j(n,'"',ic),j(n,"/",on),j(n,";",sc),j(n,"~",Go),j(n,"_",As),j(n,"\\",ks),j(n,"・",Lh);const r=Re(n,En,ec,{[Kl]:!0});Re(r,En,r);const o=Re(r,_n,Mh,{[Ho]:!0}),i=Re(r,Jo,xh,{[zo]:!0}),s=Re(n,_n,kn,{[ql]:!0});Re(s,En,o),Re(s,_n,s),Re(o,En,o),Re(o,_n,o);const a=Re(n,Jo,Xl,{[Gl]:!0});Re(a,_n),Re(a,En,i),Re(a,Jo,a),Re(i,En,i),Re(i,_n),Re(i,Jo,i);const l=j(n,cc,nc,{[Yl]:!0}),c=j(n,Ih,tc,{[Yl]:!0}),u=Re(n,lc,tc,{[Yl]:!0});j(n,uc,u),j(c,cc,l),j(c,uc,u),Re(c,lc,u),j(u,Ih),j(u,cc),Re(u,lc,u),j(u,uc,u);const f=Re(n,ac,Rh,{[Ah]:!0});j(f,"#"),Re(f,ac,f),j(f,zE,f);const p=j(f,jE);j(p,"#"),Re(p,ac,f);const m=[[_n,s],[En,o]],b=[[_n,null],[Jo,a],[En,i]];for(let k=0;k<Ms.length;k++)Gn(n,Ms[k],Ql,kn,m);for(let k=0;k<xs.length;k++)Gn(n,xs[k],Zl,Xl,b);wr(Ql,{tld:!0,ascii:!0},e),wr(Zl,{utld:!0,alpha:!0},e),Gn(n,"file",ts,kn,m),Gn(n,"mailto",ts,kn,m),Gn(n,"http",Qr,kn,m),Gn(n,"https",Qr,kn,m),Gn(n,"ftp",Qr,kn,m),Gn(n,"ftps",Qr,kn,m),wr(ts,{scheme:!0,ascii:!0},e),wr(Qr,{slashscheme:!0,ascii:!0},e),t=t.sort((k,_)=>k[0]>_[0]?1:-1);for(let k=0;k<t.length;k++){const _=t[k][0],N=t[k][1]?{[FE]:!0}:{[$E]:!0};_.indexOf("-")>=0?N[Jl]=!0:_n.test(_)?En.test(_)?N[Ho]=!0:N[ql]=!0:N[Kl]=!0,Oh(n,_,_,N)}return Oh(n,"localhost",jo,{ascii:!0}),n.jd=new bt(Os),{start:n,tokens:Xr({groups:e},Ph)}}function Dh(t,e){const n=WE(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=t,l=null,c=0,u=null,f=-1,p=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(f=0,p=0,u=a):f>=0&&(f+=n[s].length,p++),c+=n[s].length,i+=n[s].length,s++;i-=f,s-=p,c-=f,o.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}function WE(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),i,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Gn(t,e,n,r,o){let i;const s=e.length;for(let a=0;a<s-1;a++){const l=e[a];t.j[l]?i=t.j[l]:(i=new bt(r),i.jr=o.slice(),t.j[l]=i),t=i}return i=new bt(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function Bh(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let i=0;for(;o.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}const Yo={defaultProtocol:"http",events:null,format:Fh,formatHref:Fh,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function dc(t,e=null){let n=Xr({},Yo);t&&(n=Xr(n,t instanceof dc?t.o:t));const r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}dc.prototype={o:Yo,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:Yo[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Fh(t){return t}function $h(t,e){this.t="token",this.v=t,this.tk=e}$h.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Yo.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),f=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),u&&Xr(s,u),{tagName:o,attributes:s,content:i,eventListeners:f}}};function Ls(t,e){class n extends $h{constructor(o,i){super(o,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const Vh=Ls("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Hh=Ls("text"),KE=Ls("nl"),Rs=Ls("url",{isLink:!0,toHref(t=Yo.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==jo&&t[1].t===qn}}),Bt=t=>new bt(t);function qE({groups:t}){const e=t.domain.concat([bs,ws,Kn,ks,_s,Es,vs,Cs,Dt,ec,Ko,Ss,Ts,Ns,on,Os,Go,As]),n=[ys,qn,rc,rn,oc,Ko,qo,ic,sc,as,ls,Uo,Wo,rs,ns,is,ss,cs,us,ds,fs,ps,hs,ms,gs],r=[bs,ys,ws,ks,_s,Es,vs,Cs,Dt,Uo,Wo,Ko,Ss,Ts,Ns,qo,on,Os,Go,As],o=Bt(),i=j(o,Go);se(i,r,i),se(i,t.domain,i);const s=Bt(),a=Bt(),l=Bt();se(o,t.domain,s),se(o,t.scheme,a),se(o,t.slashscheme,l),se(s,r,i),se(s,t.domain,s);const c=j(s,Kn);j(i,Kn,c),j(a,Kn,c),j(l,Kn,c);const u=j(i,rn);se(u,r,i),se(u,t.domain,i);const f=Bt();se(c,t.domain,f),se(f,t.domain,f);const p=j(f,rn);se(p,t.domain,f);const m=Bt(Vh);se(p,t.tld,m),se(p,t.utld,m),j(c,jo,m);const b=j(f,Dt);j(b,Dt,b),se(b,t.domain,f),se(m,t.domain,f),j(m,rn,p),j(m,Dt,b);const k=j(m,qn);se(k,t.numeric,Vh);const _=j(s,Dt),E=j(s,rn);j(_,Dt,_),se(_,t.domain,s),se(E,r,i),se(E,t.domain,s);const N=Bt(Rs);se(E,t.tld,N),se(E,t.utld,N),se(N,t.domain,s),se(N,r,i),j(N,rn,E),j(N,Dt,_),j(N,Kn,c);const A=j(N,qn),d=Bt(Rs);se(A,t.numeric,d);const g=Bt(Rs),h=Bt();se(g,e,g),se(g,n,h),se(h,e,g),se(h,n,h),j(N,on,g),j(d,on,g);const w=j(a,qn),v=j(l,qn),S=j(v,on),C=j(S,on);se(a,t.domain,s),j(a,rn,E),j(a,Dt,_),se(l,t.domain,s),j(l,rn,E),j(l,Dt,_),se(w,t.domain,g),j(w,on,g),j(w,qo,g),se(C,t.domain,g),se(C,e,g),j(C,on,g);const M=[[Uo,Wo],[ns,rs],[is,ss],[as,ls],[cs,us],[ds,fs],[ps,hs],[ms,gs]];for(let P=0;P<M.length;P++){const[D,F]=M[P],$=j(g,D);j(h,D,$),j($,F,g);const T=Bt(Rs);se($,e,T);const I=Bt();se($,n),se(T,e,T),se(T,n,I),se(I,e,T),se(I,n,I),j(T,F,g),j(I,F,g)}return j(o,jo,N),j(o,nc,KE),{start:o,tokens:Ph}}function GE(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=t,l=null,c=null,u=0,f=null,p=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(p=0,f=a):p>=0&&p++,o++,u++;if(p<0)o-=u,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(fc(Hh,e,s)),s=[]),o-=p,u-=p;const m=f.t,b=n.slice(o-u,o);i.push(fc(m,e,b))}}return s.length>0&&i.push(fc(Hh,e,s)),i}function fc(t,e,n){const r=n[0].s,o=n[n.length-1].e,i=e.slice(r,o);return new t(i,n)}const JE=typeof console<"u"&&console&&console.warn||(()=>{}),YE="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ae={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function XE(){return bt.groups={},Ae.scanner=null,Ae.parser=null,Ae.tokenQueue=[],Ae.pluginQueue=[],Ae.customSchemes=[],Ae.initialized=!1,Ae}function zh(t,e=!1){if(Ae.initialized&&JE(`linkifyjs: already initialized - will not register custom scheme "${t}" ${YE}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
115
115
  1. Must only contain digits, lowercase ASCII letters or "-"
116
116
  2. Cannot start or end with "-"
117
- 3. "-" cannot repeat`);ye.customSchemes.push([t,e])}function pC(){ye.scanner=sC(ye.customSchemes);for(let t=0;t<ye.tokenQueue.length;t++)ye.tokenQueue[t][1]({scanner:ye.scanner});ye.parser=aC(ye.scanner.tokens);for(let t=0;t<ye.pluginQueue.length;t++)ye.pluginQueue[t][1]({scanner:ye.scanner,parser:ye.parser});return ye.initialized=!0,ye}function cc(t){return ye.initialized||pC(),cC(ye.parser.start,t,lh(ye.scanner.start,t))}cc.scan=lh;function hh(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new lc(n),o=cc(t),s=[];for(let i=0;i<o.length;i++){const l=o[i];l.isLink&&(!e||l.t===e)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}function hC(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function mC(t){return new Ae({key:new De("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),s=e.some(c=>c.getMeta("preventAutolink"));if(!o||s)return;const{tr:i}=r,l=J1(n.doc,[...e]);if(eE(l).forEach(({newRange:c})=>{const u=Y1(r.doc,c,p=>p.isTextblock);let d,f;if(u.length>1?(d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")),d&&f){const p=f.split(" ").filter(b=>b!=="");if(p.length<=0)return!1;const h=p[p.length-1],m=d.pos+f.lastIndexOf(h);if(!h)return!1;const y=cc(h).map(b=>b.toObject(t.defaultProtocol));if(!hC(y))return!1;y.filter(b=>b.isLink).map(b=>({...b,from:m+b.start+1,to:m+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>t.validate(b.value)).filter(b=>t.shouldAutoLink(b.value)).forEach(b=>{ya(b.from,b.to,r.doc).some(w=>w.mark.type===t.type)||i.addMark(b.from,b.to,t.type.create({href:b.href}))})}}),!!i.steps.length)return i}})}function gC(t){return new Ae({key:new De("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,s;if(r.button!==0||!e.editable)return!1;let i=r.target;const l=[];for(;i.nodeName!=="DIV";)l.push(i),i=i.parentNode;if(!l.find(f=>f.nodeName==="A"))return!1;const a=Yf(e.state,t.type.name),c=r.target,u=(o=c?.href)!==null&&o!==void 0?o:a.href,d=(s=c?.target)!==null&&s!==void 0?s:a.target;return c&&u?(window.open(u,d),!0):!1}}})}function yC(t){return new Ae({key:new De("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:s}=o,{empty:i}=s;if(i)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const a=hh(l,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!a?!1:(t.editor.commands.setMark(t.type,{href:a.href}),!0)}}})}const bC=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Er(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(bC,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const EC=ot.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){ph(t);return}ph(t.scheme,t.optionalSlashes)})},onDestroy(){fC()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Er(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Er(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Er(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",pe(this.options.HTMLAttributes,t),0]:["a",pe(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Er(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Er(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Hn({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=hh(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:i=>!!Er(i,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(mC({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Er(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(gC({type:this.type})),this.options.linkOnPaste&&t.push(yC({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),wC=ot.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",pe(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=ma(t,this.type);return Object.entries(n).some(([,o])=>!!o)?!0:e.unsetMark(this.name)}}}}),kC=Be.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),CC=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,SC=Fe.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",pe(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[SE({find:CC,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var uc,dc;if(typeof WeakMap<"u"){let t=new WeakMap;uc=e=>t.get(e),dc=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;uc=r=>{for(let o=0;o<t.length;o+=2)if(t[o]==r)return t[o+1]},dc=(r,o)=>(n==10&&(n=0),t[n++]=r,t[n++]=o)}var ke=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,o=e/this.width|0;let s=r+1,i=o+1;for(let l=1;s<this.width&&this.map[e+l]==n;l++)s++;for(let l=1;i<this.height&&this.map[e+this.width*l]==n;l++)i++;return{left:r,top:o,right:s,bottom:i}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:o,top:s,bottom:i}=this.findCell(t);return e=="horiz"?(n<0?r==0:o==this.width)?null:this.map[s*this.width+(n<0?r-1:o)]:(n<0?s==0:i==this.height)?null:this.map[r+this.width*(n<0?s-1:i)]}rectBetween(t,e){const{left:n,right:r,top:o,bottom:s}=this.findCell(t),{left:i,right:l,top:a,bottom:c}=this.findCell(e);return{left:Math.min(n,i),top:Math.min(o,a),right:Math.max(r,l),bottom:Math.max(s,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let o=t.left;o<t.right;o++){const s=r*this.width+o,i=this.map[s];n[i]||(n[i]=!0,!(o==t.left&&o&&this.map[s-1]==i||r==t.top&&r&&this.map[s-this.width]==i)&&e.push(i))}return e}positionAt(t,e,n){for(let r=0,o=0;;r++){const s=o+n.child(r).nodeSize;if(r==t){let i=e+t*this.width;const l=(t+1)*this.width;for(;i<l&&this.map[i]<o;)i++;return i==l?s-1:this.map[i]}o=s}}static get(t){return uc(t)||dc(t,vC(t))}};function vC(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=xC(t),n=t.childCount,r=[];let o=0,s=null;const i=[];for(let c=0,u=e*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const d=t.child(c);u++;for(let h=0;;h++){for(;o<r.length&&r[o]!=0;)o++;if(h==d.childCount)break;const m=d.child(h),{colspan:y,rowspan:b,colwidth:w}=m.attrs;for(let k=0;k<b;k++){if(k+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:u,n:b-k});break}const E=o+k*e;for(let x=0;x<y;x++){r[E+x]==0?r[E+x]=u:(s||(s=[])).push({type:"collision",row:c,pos:u,n:y-x});const v=w&&w[x];if(v){const T=(E+x)%e*2,_=i[T];_==null||_!=v&&i[T+1]==1?(i[T]=v,i[T+1]=1):_==v&&i[T+1]++}}}o+=y,u+=m.nodeSize}const f=(c+1)*e;let p=0;for(;o<f;)r[o++]==0&&p++;p&&(s||(s=[])).push({type:"missing",row:c,n:p}),u++}(e===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const l=new ke(e,n,r,s);let a=!1;for(let c=0;!a&&c<i.length;c+=2)i[c]!=null&&i[c+1]<n&&(a=!0);return a&&TC(l,i,t),l}function xC(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let s=0;if(n)for(let i=0;i<r;i++){const l=t.child(i);for(let a=0;a<l.childCount;a++){const c=l.child(a);i+c.attrs.rowspan>r&&(s+=c.attrs.colspan)}}for(let i=0;i<o.childCount;i++){const l=o.child(i);s+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function TC(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const s=t.map[o];if(r[s])continue;r[s]=!0;const i=n.nodeAt(s);if(!i)throw new RangeError(`No cell with offset ${s} found`);let l=null;const a=i.attrs;for(let c=0;c<a.colspan;c++){const u=(o+c)%t.width,d=e[u*2];d!=null&&(!a.colwidth||a.colwidth[c]!=d)&&((l||(l=OC(a)))[c]=d)}l&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:l})}}function OC(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function We(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var qn=new De("selectingCells");function Qr(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function NC(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function Ft(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Li(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Qr(e.$head)||AC(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function AC(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function fc(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function _C(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function pc(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function mh(t,e,n){const r=t.node(-1),o=ke.get(r),s=t.start(-1),i=o.nextCell(t.pos-s,e,n);return i==null?null:t.node(0).resolve(s+i)}function wr(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function gh(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function MC(t,e,n){const r=We(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var he=class Tn extends z{constructor(e,n=e){const r=e.node(-1),o=ke.get(r),s=e.start(-1),i=o.rectBetween(e.pos-s,n.pos-s),l=e.node(0),a=o.cellsInRect(i).filter(u=>u!=n.pos-s);a.unshift(n.pos-s);const c=a.map(u=>{const d=r.nodeAt(u);if(!d)throw RangeError(`No cell with offset ${u} found`);const f=s+u+1;return new ed(l.resolve(f),l.resolve(f+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(fc(r)&&fc(o)&&pc(r,o)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?Tn.rowSelection(r,o):s&&this.isColSelection()?Tn.colSelection(r,o):new Tn(r,o)}return j.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=ke.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},i=[];for(let a=o.top;a<o.bottom;a++){const c=[];for(let u=a*n.width+o.left,d=o.left;d<o.right;d++,u++){const f=n.map[u];if(s[f])continue;s[f]=!0;const p=n.findCell(f);let h=e.nodeAt(f);if(!h)throw RangeError(`No cell with offset ${f} found`);const m=o.left-p.left,y=p.right-o.right;if(m>0||y>0){let b=h.attrs;if(m>0&&(b=wr(b,0,m)),y>0&&(b=wr(b,b.colspan-y,y)),p.left<o.left){if(h=h.type.createAndFill(b),!h)throw RangeError(`Could not create cell with attrs ${JSON.stringify(b)}`)}else h=h.type.create(b,h.content)}if(p.top<o.top||p.bottom>o.bottom){const b={...h.attrs,rowspan:Math.min(p.bottom,o.bottom)-Math.max(p.top,o.top)};p.top<o.top?h=h.type.createAndFill(b):h=h.type.create(b,h.content)}c.push(h)}i.push(e.child(a).copy(M.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:i;return new D(M.from(l),1,1)}replace(e,n=D.empty){const r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){const{$from:l,$to:a}=o[i],c=e.mapping.slice(r);e.replace(c.map(l.pos),c.map(a.pos),i?D.empty:n)}const s=z.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new D(M.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=ke.get(n),o=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let i=0;i<s.length;i++)e(n.nodeAt(s[i]),o+s[i])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=ke.get(r),s=e.start(-1),i=o.findCell(e.pos-s),l=o.findCell(n.pos-s),a=e.node(0);return i.top<=l.top?(i.top>0&&(e=a.resolve(s+o.map[i.left])),l.bottom<o.height&&(n=a.resolve(s+o.map[o.width*(o.height-1)+l.right-1]))):(l.top>0&&(n=a.resolve(s+o.map[l.left])),i.bottom<o.height&&(e=a.resolve(s+o.map[o.width*(o.height-1)+i.right-1]))),new Tn(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=ke.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),s=n.colCount(this.$headCell.pos-r);if(Math.min(o,s)>0)return!1;const i=o+this.$anchorCell.nodeAfter.attrs.colspan,l=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,l)==n.width}eq(e){return e instanceof Tn&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=ke.get(r),s=e.start(-1),i=o.findCell(e.pos-s),l=o.findCell(n.pos-s),a=e.node(0);return i.left<=l.left?(i.left>0&&(e=a.resolve(s+o.map[i.top*o.width])),l.right<o.width&&(n=a.resolve(s+o.map[o.width*(l.top+1)-1]))):(l.left>0&&(n=a.resolve(s+o.map[l.top*o.width])),i.right<o.width&&(e=a.resolve(s+o.map[o.width*(i.top+1)-1]))),new Tn(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Tn(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Tn(e.resolve(n),e.resolve(r))}getBookmark(){return new RC(this.$anchorCell.pos,this.$headCell.pos)}};he.prototype.visible=!1,z.jsonID("cell",he);var RC=class Fg{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Fg(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&pc(n,r)?new he(n,r):z.near(r,1)}};function LC(t){if(!(t.selection instanceof he))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(Qe.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Ee.create(t.doc,e)}function IC({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}function DC({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const s=t.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let o=e.depth;o>0;o--){const s=e.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function PC(t,e,n){const r=(e||t).selection,o=(e||t).doc;let s,i;if(r instanceof U&&(i=r.node.type.spec.tableRole)){if(i=="cell"||i=="header_cell")s=he.create(o,r.from);else if(i=="row"){const l=o.resolve(r.from+1);s=he.rowSelection(l,l)}else if(!n){const l=ke.get(r.node),a=r.from+1,c=a+l.map[l.width*l.height-1];s=he.create(o,a+1,c)}}else r instanceof j&&IC(r)?s=j.create(o,r.from):r instanceof j&&DC(r)&&(s=j.create(o,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var BC=new De("fix-tables");function yh(t,e,n,r){const o=t.childCount,s=e.childCount;e:for(let i=0,l=0;i<s;i++){const a=e.child(i);for(let c=l,u=Math.min(o,i+3);c<u;c++)if(t.child(c)==a){l=c+1,n+=a.nodeSize;continue e}r(a,n),l<o&&t.child(l).sameMarkup(a)?yh(t.child(l),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function bh(t,e){let n;const r=(o,s)=>{o.type.spec.tableRole=="table"&&(n=FC(t,o,s,n))};return e?e.doc!=t.doc&&yh(e.doc,t.doc,0,r):t.doc.descendants(r),n}function FC(t,e,n,r){const o=ke.get(e);if(!o.problems)return r;r||(r=t.tr);const s=[];for(let a=0;a<o.height;a++)s.push(0);for(let a=0;a<o.problems.length;a++){const c=o.problems[a];if(c.type=="collision"){const u=e.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let f=0;f<d.rowspan;f++)s[c.row+f]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,wr(d,d.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=r.mapping.map(n);r.delete(u,u+e.nodeSize)}}let i,l;for(let a=0;a<s.length;a++)s[a]&&(i==null&&(i=a),l=a);for(let a=0,c=n+1;a<o.height;a++){const u=e.child(a),d=c+u.nodeSize,f=s[a];if(f>0){let p="cell";u.firstChild&&(p=u.firstChild.type.spec.tableRole);const h=[];for(let y=0;y<f;y++){const b=We(t.schema)[p].createAndFill();b&&h.push(b)}const m=(a==0||i==a-1)&&l==a?c+1:d-1;r.insert(r.mapping.map(m),h)}c=d}return r.setMeta(BC,{fixTables:!0})}function en(t){const e=t.selection,n=Li(t),r=n.node(-1),o=n.start(-1),s=ke.get(r);return{...e instanceof he?s.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):s.findCell(n.pos-o),tableStart:o,map:s,table:r}}function Eh(t,{map:e,tableStart:n,table:r},o){let s=o>0?-1:0;MC(e,r,o+s)&&(s=o==0||o==e.width?null:0);for(let i=0;i<e.height;i++){const l=i*e.width+o;if(o>0&&o<e.width&&e.map[l-1]==e.map[l]){const a=e.map[l],c=r.nodeAt(a);t.setNodeMarkup(t.mapping.map(n+a),null,gh(c.attrs,o-e.colCount(a))),i+=c.attrs.rowspan-1}else{const a=s==null?We(r.type.schema).cell:r.nodeAt(e.map[l+s]).type,c=e.positionAt(i,o,r);t.insert(t.mapping.map(n+c),a.createAndFill())}}return t}function $C(t,e){if(!Ft(t))return!1;if(e){const n=en(t);e(Eh(t.tr,n,n.left))}return!0}function VC(t,e){if(!Ft(t))return!1;if(e){const n=en(t);e(Eh(t.tr,n,n.right))}return!0}function HC(t,{map:e,table:n,tableStart:r},o){const s=t.mapping.maps.length;for(let i=0;i<e.height;){const l=i*e.width+o,a=e.map[l],c=n.nodeAt(a),u=c.attrs;if(o>0&&e.map[l-1]==a||o<e.width-1&&e.map[l+1]==a)t.setNodeMarkup(t.mapping.slice(s).map(r+a),null,wr(u,o-e.colCount(a)));else{const d=t.mapping.slice(s).map(r+a);t.delete(d,d+c.nodeSize)}i+=u.rowspan}}function UC(t,e){if(!Ft(t))return!1;if(e){const n=en(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;HC(r,n,o),o!=n.left;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=ke.get(s)}e(r)}return!0}function zC(t,e,n){var r;const o=We(e.type.schema).header_cell;for(let s=0;s<t.width;s++)if(((r=e.nodeAt(t.map[s+n*t.width]))==null?void 0:r.type)!=o)return!1;return!0}function wh(t,{map:e,tableStart:n,table:r},o){var s;let i=n;for(let c=0;c<o;c++)i+=r.child(c).nodeSize;const l=[];let a=o>0?-1:0;zC(e,r,o+a)&&(a=o==0||o==e.height?null:0);for(let c=0,u=e.width*o;c<e.width;c++,u++)if(o>0&&o<e.height&&e.map[u]==e.map[u-e.width]){const d=e.map[u],f=r.nodeAt(d).attrs;t.setNodeMarkup(n+d,null,{...f,rowspan:f.rowspan+1}),c+=f.colspan-1}else{const d=a==null?We(r.type.schema).cell:(s=r.nodeAt(e.map[u+a*e.width]))==null?void 0:s.type,f=d?.createAndFill();f&&l.push(f)}return t.insert(i,We(r.type.schema).row.create(null,l)),t}function jC(t,e){if(!Ft(t))return!1;if(e){const n=en(t);e(wh(t.tr,n,n.top))}return!0}function WC(t,e){if(!Ft(t))return!1;if(e){const n=en(t);e(wh(t.tr,n,n.bottom))}return!0}function KC(t,{map:e,table:n,tableStart:r},o){let s=0;for(let c=0;c<o;c++)s+=n.child(c).nodeSize;const i=s+n.child(o).nodeSize,l=t.mapping.maps.length;t.delete(s+r,i+r);const a=new Set;for(let c=0,u=o*e.width;c<e.width;c++,u++){const d=e.map[u];if(!a.has(d)){if(a.add(d),o>0&&d==e.map[u-e.width]){const f=n.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(l).map(d+r),null,{...f,rowspan:f.rowspan-1}),c+=f.colspan-1}else if(o<e.height&&d==e.map[u+e.width]){const f=n.nodeAt(d),p=f.attrs,h=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),m=e.positionAt(o+1,c,n);t.insert(t.mapping.slice(l).map(r+m),h),c+=p.colspan-1}}}}function qC(t,e){if(!Ft(t))return!1;if(e){const n=en(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;KC(r,n,o),o!=n.top;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=ke.get(n.table)}e(r)}return!0}function kh(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function JC({width:t,height:e,map:n},r){let o=r.top*t+r.left,s=o,i=(r.bottom-1)*t+r.left,l=o+(r.right-r.left-1);for(let a=r.top;a<r.bottom;a++){if(r.left>0&&n[s]==n[s-1]||r.right<t&&n[l]==n[l+1])return!0;s+=t,l+=t}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[o]==n[o-t]||r.bottom<e&&n[i]==n[i+t])return!0;o++,i++}return!1}function Ch(t,e){const n=t.selection;if(!(n instanceof he)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=en(t),{map:o}=r;if(JC(o,r))return!1;if(e){const s=t.tr,i={};let l=M.empty,a,c;for(let u=r.top;u<r.bottom;u++)for(let d=r.left;d<r.right;d++){const f=o.map[u*o.width+d],p=r.table.nodeAt(f);if(!(i[f]||!p))if(i[f]=!0,a==null)a=f,c=p;else{kh(p)||(l=l.append(p.content));const h=s.mapping.map(f+r.tableStart);s.delete(h,h+p.nodeSize)}}if(a==null||c==null)return!0;if(s.setNodeMarkup(a+r.tableStart,null,{...gh(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),l.size){const u=a+1+c.content.size,d=kh(c)?a+1:u;s.replaceWith(d+r.tableStart,u+r.tableStart,l)}s.setSelection(new he(s.doc.resolve(a+r.tableStart))),e(s)}return!0}function Sh(t,e){const n=We(t.schema);return GC(({node:r})=>n[r.type.spec.tableRole])(t,e)}function GC(t){return(e,n)=>{var r;const o=e.selection;let s,i;if(o instanceof he){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;s=o.$anchorCell.nodeAfter,i=o.$anchorCell.pos}else{if(s=NC(o.$from),!s)return!1;i=(r=Qr(o.$from))==null?void 0:r.pos}if(s==null||i==null||s.attrs.colspan==1&&s.attrs.rowspan==1)return!1;if(n){let l=s.attrs;const a=[],c=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const u=en(e),d=e.tr;for(let p=0;p<u.right-u.left;p++)a.push(c?{...l,colwidth:c&&c[p]?[c[p]]:null}:l);let f;for(let p=u.top;p<u.bottom;p++){let h=u.map.positionAt(p,u.left,u.table);p==u.top&&(h+=s.nodeSize);for(let m=u.left,y=0;m<u.right;m++,y++)m==u.left&&p==u.top||d.insert(f=d.mapping.map(h+u.tableStart,1),t({node:s,row:p,col:m}).createAndFill(a[y]))}d.setNodeMarkup(i,t({node:s,row:u.top,col:u.left}),a[0]),o instanceof he&&d.setSelection(new he(d.doc.resolve(o.$anchorCell.pos),f?d.doc.resolve(f):void 0)),n(d)}return!0}}function YC(t,e){return function(n,r){if(!Ft(n))return!1;const o=Li(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof he?n.selection.forEachCell((i,l)=>{i.attrs[t]!==e&&s.setNodeMarkup(l,null,{...i.attrs,[t]:e})}):s.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(s)}return!0}}function XC(t){return function(e,n){if(!Ft(e))return!1;if(n){const r=We(e.schema),o=en(e),s=e.tr,i=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),l=i.map(a=>o.table.nodeAt(a));for(let a=0;a<i.length;a++)l[a].type==r.header_cell&&s.setNodeMarkup(o.tableStart+i[a],r.cell,l[a].attrs);if(s.steps.length==0)for(let a=0;a<i.length;a++)s.setNodeMarkup(o.tableStart+i[a],r.header_cell,l[a].attrs);n(s)}return!0}}function vh(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const s=e.table.nodeAt(r[o]);if(s&&s.type!==n.header_cell)return!1}return!0}function Yo(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?XC(t):function(n,r){if(!Ft(n))return!1;if(r){const o=We(n.schema),s=en(n),i=n.tr,l=vh("row",s,o),a=vh("column",s,o),u=(t==="column"?l:t==="row"?a:!1)?1:0,d=t=="column"?{left:0,top:u,right:1,bottom:s.map.height}:t=="row"?{left:u,top:0,right:s.map.width,bottom:1}:s,f=t=="column"?a?o.cell:o.header_cell:t=="row"?l?o.cell:o.header_cell:o.cell;s.map.cellsInRect(d).forEach(p=>{const h=p+s.tableStart,m=i.doc.nodeAt(h);m&&i.setNodeMarkup(h,f,m.attrs)}),r(i)}return!0}}Yo("row",{useDeprecatedLogic:!0}),Yo("column",{useDeprecatedLogic:!0});var QC=Yo("cell",{useDeprecatedLogic:!0});function ZC(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const s=t.node(-1).child(r),i=s.lastChild;if(i)return o-1-i.nodeSize;o-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),o=t.after();r<n.childCount;r++){const s=n.child(r);if(s.childCount)return o+1;o+=s.nodeSize}}return null}function xh(t){return function(e,n){if(!Ft(e))return!1;const r=ZC(Li(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(j.between(o,_C(o))).scrollIntoView())}return!0}}function eS(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Ii(t,e){const n=t.selection;if(!(n instanceof he))return!1;if(e){const r=t.tr,o=We(t.schema).cell.createAndFill().content;n.forEachCell((s,i)=>{s.content.eq(o)||r.replace(r.mapping.map(i+1),r.mapping.map(i+s.nodeSize-1),new D(o,0,0))}),r.docChanged&&e(r)}return!0}function tS(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const o=e.child(0),s=o.type.spec.tableRole,i=o.type.schema,l=[];if(s=="row")for(let a=0;a<e.childCount;a++){let c=e.child(a).content;const u=a?0:Math.max(0,n-1),d=a<e.childCount-1?0:Math.max(0,r-1);(u||d)&&(c=hc(We(i).row,new D(c,u,d)).content),l.push(c)}else if(s=="cell"||s=="header_cell")l.push(n||r?hc(We(i).row,new D(e,n,r)).content:e);else return null;return nS(i,l)}function nS(t,e){const n=[];for(let o=0;o<e.length;o++){const s=e[o];for(let i=s.childCount-1;i>=0;i--){const{rowspan:l,colspan:a}=s.child(i).attrs;for(let c=o;c<o+l;c++)n[c]=(n[c]||0)+a}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(M.empty),n[o]<r){const s=We(t).cell.createAndFill(),i=[];for(let l=n[o];l<r;l++)i.push(s);e[o]=e[o].append(M.from(i))}return{height:e.length,width:r,rows:e}}function hc(t,e){const n=t.createAndFill();return new Sl(n).replace(0,n.content.size,e).doc}function rS({width:t,height:e,rows:n},r,o){if(t!=r){const s=[],i=[];for(let l=0;l<n.length;l++){const a=n[l],c=[];for(let u=s[l]||0,d=0;u<r;d++){let f=a.child(d%a.childCount);u+f.attrs.colspan>r&&(f=f.type.createChecked(wr(f.attrs,f.attrs.colspan,u+f.attrs.colspan-r),f.content)),c.push(f),u+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)s[l+p]=(s[l+p]||0)+f.attrs.colspan}i.push(M.from(c))}n=i,t=r}if(e!=o){const s=[];for(let i=0,l=0;i<o;i++,l++){const a=[],c=n[l%e];for(let u=0;u<c.childCount;u++){let d=c.child(u);i+d.attrs.rowspan>o&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,o-d.attrs.rowspan)},d.content)),a.push(d)}s.push(M.from(a))}n=s,e=o}return{width:t,height:e,rows:n}}function oS(t,e,n,r,o,s,i){const l=t.doc.type.schema,a=We(l);let c,u;if(o>e.width)for(let d=0,f=0;d<e.height;d++){const p=n.child(d);f+=p.nodeSize;const h=[];let m;p.lastChild==null||p.lastChild.type==a.cell?m=c||(c=a.cell.createAndFill()):m=u||(u=a.header_cell.createAndFill());for(let y=e.width;y<o;y++)h.push(m);t.insert(t.mapping.slice(i).map(f-1+r),h)}if(s>e.height){const d=[];for(let h=0,m=(e.height-1)*e.width;h<Math.max(e.width,o);h++){const y=h>=e.width?!1:n.nodeAt(e.map[m+h]).type==a.header_cell;d.push(y?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const f=a.row.create(null,M.from(d)),p=[];for(let h=e.height;h<s;h++)p.push(f);t.insert(t.mapping.slice(i).map(r+n.nodeSize-2),p)}return!!(c||u)}function Th(t,e,n,r,o,s,i,l){if(i==0||i==e.height)return!1;let a=!1;for(let c=o;c<s;c++){const u=i*e.width+c,d=e.map[u];if(e.map[u-e.width]==d){a=!0;const f=n.nodeAt(d),{top:p,left:h}=e.findCell(d);t.setNodeMarkup(t.mapping.slice(l).map(d+r),null,{...f.attrs,rowspan:i-p}),t.insert(t.mapping.slice(l).map(e.positionAt(i,h,n)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-i})),c+=f.attrs.colspan-1}}return a}function Oh(t,e,n,r,o,s,i,l){if(i==0||i==e.width)return!1;let a=!1;for(let c=o;c<s;c++){const u=c*e.width+i,d=e.map[u];if(e.map[u-1]==d){a=!0;const f=n.nodeAt(d),p=e.colCount(d),h=t.mapping.slice(l).map(d+r);t.setNodeMarkup(h,null,wr(f.attrs,i-p,f.attrs.colspan-(i-p))),t.insert(h+f.nodeSize,f.type.createAndFill(wr(f.attrs,0,i-p))),c+=f.attrs.rowspan-1}}return a}function Nh(t,e,n,r,o){let s=n?t.doc.nodeAt(n-1):t.doc;if(!s)throw new Error("No table found");let i=ke.get(s);const{top:l,left:a}=r,c=a+o.width,u=l+o.height,d=t.tr;let f=0;function p(){if(s=n?d.doc.nodeAt(n-1):d.doc,!s)throw new Error("No table found");i=ke.get(s),f=d.mapping.maps.length}oS(d,i,s,n,c,u,f)&&p(),Th(d,i,s,n,a,c,l,f)&&p(),Th(d,i,s,n,a,c,u,f)&&p(),Oh(d,i,s,n,l,u,a,f)&&p(),Oh(d,i,s,n,l,u,c,f)&&p();for(let h=l;h<u;h++){const m=i.positionAt(h,a,s),y=i.positionAt(h,c,s);d.replace(d.mapping.slice(f).map(m+n),d.mapping.slice(f).map(y+n),new D(o.rows[h-l],0,0))}p(),d.setSelection(new he(d.doc.resolve(n+i.positionAt(l,a,s)),d.doc.resolve(n+i.positionAt(u-1,c-1,s)))),e(d)}var sS=ea({ArrowLeft:Pi("horiz",-1),ArrowRight:Pi("horiz",1),ArrowUp:Pi("vert",-1),ArrowDown:Pi("vert",1),"Shift-ArrowLeft":Bi("horiz",-1),"Shift-ArrowRight":Bi("horiz",1),"Shift-ArrowUp":Bi("vert",-1),"Shift-ArrowDown":Bi("vert",1),Backspace:Ii,"Mod-Backspace":Ii,Delete:Ii,"Mod-Delete":Ii});function Di(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Pi(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;if(s instanceof he)return Di(n,r,z.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const i=Ah(o,t,e);if(i==null)return!1;if(t=="horiz")return Di(n,r,z.near(n.doc.resolve(s.head+e),e));{const l=n.doc.resolve(i),a=mh(l,t,e);let c;return a?c=z.near(a,1):e<0?c=z.near(n.doc.resolve(l.before(-1)),-1):c=z.near(n.doc.resolve(l.after(-1)),1),Di(n,r,c)}}}function Bi(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;let i;if(s instanceof he)i=s;else{const a=Ah(o,t,e);if(a==null)return!1;i=new he(n.doc.resolve(a))}const l=mh(i.$headCell,t,e);return l?Di(n,r,new he(i.$anchorCell,l)):!1}}function iS(t,e){const n=t.state.doc,r=Qr(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new he(r))),!0):!1}function lS(t,e,n){if(!Ft(t.state))return!1;let r=tS(n);const o=t.state.selection;if(o instanceof he){r||(r={width:1,height:1,rows:[M.from(hc(We(t.state.schema).cell,n))]});const s=o.$anchorCell.node(-1),i=o.$anchorCell.start(-1),l=ke.get(s).rectBetween(o.$anchorCell.pos-i,o.$headCell.pos-i);return r=rS(r,l.right-l.left,l.bottom-l.top),Nh(t.state,t.dispatch,i,l,r),!0}else if(r){const s=Li(t.state),i=s.start(-1);return Nh(t.state,t.dispatch,i,ke.get(s.node(-1)).findCell(s.pos-i),r),!0}else return!1}function aS(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=_h(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof he)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=Qr(t.state.selection.$anchor))!=null&&((n=mc(t,e))==null?void 0:n.pos)!=o.pos)s(o,e),e.preventDefault();else if(!r)return;function s(a,c){let u=mc(t,c);const d=qn.getState(t.state)==null;if(!u||!pc(a,u))if(d)u=a;else return;const f=new he(a,u);if(d||!t.state.selection.eq(f)){const p=t.state.tr.setSelection(f);d&&p.setMeta(qn,a.pos),t.dispatch(p)}}function i(){t.root.removeEventListener("mouseup",i),t.root.removeEventListener("dragstart",i),t.root.removeEventListener("mousemove",l),qn.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(qn,-1))}function l(a){const c=a,u=qn.getState(t.state);let d;if(u!=null)d=t.state.doc.resolve(u);else if(_h(t,c.target)!=r&&(d=mc(t,e),!d))return i();d&&s(d,c)}t.root.addEventListener("mouseup",i),t.root.addEventListener("dragstart",i),t.root.addEventListener("mousemove",l)}function Ah(t,e,n){if(!(t.state.selection instanceof j))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const s=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=r.before(o),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?l:null}}return null}function _h(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function mc(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Qr(t.state.doc.resolve(n.pos)):null}var cS=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),gc(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,gc(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function gc(t,e,n,r,o,s){var i;let l=0,a=!0,c=e.firstChild;const u=t.firstChild;if(u){for(let d=0,f=0;d<u.childCount;d++){const{colspan:p,colwidth:h}=u.child(d).attrs;for(let m=0;m<p;m++,f++){const y=o==f?s:h&&h[m],b=y?y+"px":"";if(l+=y||r,y||(a=!1),c)c.style.width!=b&&(c.style.width=b),c=c.nextSibling;else{const w=document.createElement("col");w.style.width=b,e.appendChild(w)}}}for(;c;){const d=c.nextSibling;(i=c.parentNode)==null||i.removeChild(c),c=d}a?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}var yt=new De("tableColumnResizing");function uS({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=cS,lastColumnResizable:o=!0}={}){const s=new Ae({key:yt,state:{init(i,l){var a,c;const u=(c=(a=s.spec)==null?void 0:a.props)==null?void 0:c.nodeViews,d=We(l.schema).table.name;return r&&u&&(u[d]=(f,p)=>new r(f,n,p)),new dS(-1,!1)},apply(i,l){return l.apply(i)}},props:{attributes:i=>{const l=yt.getState(i);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(i,l)=>{fS(i,l,t,o)},mouseleave:i=>{pS(i)},mousedown:(i,l)=>{hS(i,l,e,n)}},decorations:i=>{const l=yt.getState(i);if(l&&l.activeHandle>-1)return ES(i,l.activeHandle)},nodeViews:{}}});return s}var dS=class ul{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(yt);if(r&&r.setHandle!=null)return new ul(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new ul(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return fc(e.doc.resolve(o))||(o=-1),new ul(o,n.dragging)}return n}};function fS(t,e,n,r){if(!t.editable)return;const o=yt.getState(t.state);if(o&&!o.dragging){const s=gS(e.target);let i=-1;if(s){const{left:l,right:a}=s.getBoundingClientRect();e.clientX-l<=n?i=Mh(t,e,"left",n):a-e.clientX<=n&&(i=Mh(t,e,"right",n))}if(i!=o.activeHandle){if(!r&&i!==-1){const l=t.state.doc.resolve(i),a=l.node(-1),c=ke.get(a),u=l.start(-1);if(c.colCount(l.pos-u)+l.nodeAfter.attrs.colspan-1==c.width-1)return}Lh(t,i)}}}function pS(t){if(!t.editable)return;const e=yt.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&Lh(t,-1)}function hS(t,e,n,r){var o;if(!t.editable)return!1;const s=(o=t.dom.ownerDocument.defaultView)!=null?o:window,i=yt.getState(t.state);if(!i||i.activeHandle==-1||i.dragging)return!1;const l=t.state.doc.nodeAt(i.activeHandle),a=mS(t,i.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(yt,{setDragging:{startX:e.clientX,startWidth:a}}));function c(d){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",u);const f=yt.getState(t.state);f?.dragging&&(yS(t,f.activeHandle,Rh(f.dragging,d,n)),t.dispatch(t.state.tr.setMeta(yt,{setDragging:null})))}function u(d){if(!d.which)return c(d);const f=yt.getState(t.state);if(f&&f.dragging){const p=Rh(f.dragging,d,n);Ih(t,f.activeHandle,p,r)}}return Ih(t,i.activeHandle,a,r),s.addEventListener("mouseup",c),s.addEventListener("mousemove",u),e.preventDefault(),!0}function mS(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const s=t.domAtPos(e);let l=s.node.childNodes[s.offset].offsetWidth,a=n;if(r)for(let c=0;c<n;c++)r[c]&&(l-=r[c],a--);return l/a}function gS(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function Mh(t,e,n,r){const o=n=="right"?-r:r,s=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!s)return-1;const{pos:i}=s,l=Qr(t.state.doc.resolve(i));if(!l)return-1;if(n=="right")return l.pos;const a=ke.get(l.node(-1)),c=l.start(-1),u=a.map.indexOf(l.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function Rh(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function Lh(t,e){t.dispatch(t.state.tr.setMeta(yt,{setHandle:e}))}function yS(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),s=ke.get(o),i=r.start(-1),l=s.colCount(r.pos-i)+r.nodeAfter.attrs.colspan-1,a=t.state.tr;for(let c=0;c<s.height;c++){const u=c*s.width+l;if(c&&s.map[u]==s.map[u-s.width])continue;const d=s.map[u],f=o.nodeAt(d).attrs,p=f.colspan==1?0:l-s.colCount(d);if(f.colwidth&&f.colwidth[p]==n)continue;const h=f.colwidth?f.colwidth.slice():bS(f.colspan);h[p]=n,a.setNodeMarkup(i+d,null,{...f,colwidth:h})}a.docChanged&&t.dispatch(a)}function Ih(t,e,n,r){const o=t.state.doc.resolve(e),s=o.node(-1),i=o.start(-1),l=ke.get(s).colCount(o.pos-i)+o.nodeAfter.attrs.colspan-1;let a=t.domAtPos(o.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&gc(s,a.firstChild,a,r,l,n)}function bS(t){return Array(t).fill(0)}function ES(t,e){var n;const r=[],o=t.doc.resolve(e),s=o.node(-1);if(!s)return Ee.empty;const i=ke.get(s),l=o.start(-1),a=i.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<i.height;c++){const u=a+c*i.width;if((a==i.width-1||i.map[u]!=i.map[u+1])&&(c==0||i.map[u]!=i.map[u-i.width])){const d=i.map[u],f=l+d+s.nodeAt(d).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",(n=yt.getState(t))!=null&&n.dragging&&r.push(Qe.node(l+d,l+d+s.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),r.push(Qe.widget(f,p))}}return Ee.create(t.doc,r)}function wS({allowTableNodeSelection:t=!1}={}){return new Ae({key:qn,state:{init(){return null},apply(e,n){const r=e.getMeta(qn);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:s}=e.mapping.mapResult(n);return o?null:s}},props:{decorations:LC,handleDOMEvents:{mousedown:aS},createSelectionBetween(e){return qn.getState(e.state)!=null?e.state.selection:null},handleTripleClick:iS,handleKeyDown:sS,handlePaste:lS},appendTransaction(e,n,r){return PC(r,bh(r,n),t)}})}function yc(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function Dh(t,e,n,r,o,s){var i;let l=0,a=!0,c=e.firstChild;const u=t.firstChild;if(u!==null)for(let d=0,f=0;d<u.childCount;d+=1){const{colspan:p,colwidth:h}=u.child(d).attrs;for(let m=0;m<p;m+=1,f+=1){const y=o===f?s:h&&h[m],b=y?`${y}px`:"";if(l+=y||r,y||(a=!1),c){if(c.style.width!==b){const[w,k]=yc(r,y);c.style.setProperty(w,k)}c=c.nextSibling}else{const w=document.createElement("col"),[k,E]=yc(r,y);w.style.setProperty(k,E),e.appendChild(w)}}}for(;c;){const d=c.nextSibling;(i=c.parentNode)===null||i===void 0||i.removeChild(c),c=d}a?(n.style.width=`${l}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${l}px`)}class kS{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Dh(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,Dh(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function CS(t,e,n,r){let o=0,s=!0;const i=[],l=t.firstChild;if(!l)return{};for(let d=0,f=0;d<l.childCount;d+=1){const{colspan:p,colwidth:h}=l.child(d).attrs;for(let m=0;m<p;m+=1,f+=1){const y=n===f?r:h&&h[m];o+=y||e,y||(s=!1);const[b,w]=yc(e,y);i.push(["col",{style:`${b}: ${w}`}])}}const a=s?`${o}px`:"",c=s?"":`${o}px`;return{colgroup:["colgroup",{},...i],tableWidth:a,tableMinWidth:c}}function Ph(t,e){return t.createAndFill()}function SS(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function vS(t,e,n,r,o){const s=SS(t),i=[],l=[];for(let c=0;c<n;c+=1){const u=Ph(s.cell);if(u&&l.push(u),r){const d=Ph(s.header_cell);d&&i.push(d)}}const a=[];for(let c=0;c<e;c+=1)a.push(s.row.createChecked(null,r&&c===0?i:l));return s.table.createChecked(null,a)}function xS(t){return t instanceof he}const Fi=({editor:t})=>{const{selection:e}=t.state;if(!xS(e))return!1;let n=0;const r=Jf(e.ranges[0].$from,s=>s.type.name==="table");return r?.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},TS=Fe.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:kS,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:o}=CS(t,this.options.cellMinWidth);return["table",pe(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:s})=>{const i=vS(s.schema,t,e,n);if(o){const l=r.selection.from+1;r.replaceSelectionWith(i).scrollIntoView().setSelection(j.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>$C(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>VC(t,e),deleteColumn:()=>({state:t,dispatch:e})=>UC(t,e),addRowBefore:()=>({state:t,dispatch:e})=>jC(t,e),addRowAfter:()=>({state:t,dispatch:e})=>WC(t,e),deleteRow:()=>({state:t,dispatch:e})=>qC(t,e),deleteTable:()=>({state:t,dispatch:e})=>eS(t,e),mergeCells:()=>({state:t,dispatch:e})=>Ch(t,e),splitCell:()=>({state:t,dispatch:e})=>Sh(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Yo("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Yo("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>QC(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Ch(t,e)?!0:Sh(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>YC(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>xh(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>xh(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&bh(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=he.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Fi,"Mod-Backspace":Fi,Delete:Fi,"Mod-Delete":Fi}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[uS({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],wS({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:G(F(t,"tableRole",e))}}}),OS=Be.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign||this.options.defaultAlignment;return this.options.alignments.includes(e)?e: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.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},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")}}}),NS=Fe.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",pe(this.options.HTMLAttributes,t),0]}}),AS=Fe.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",pe(this.options.HTMLAttributes,t),0]}}),_S=Fe.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",pe(this.options.HTMLAttributes,t),0]}}),MS=Fe.create({name:"doc",topNode:!0,content:"block+"});class Ce extends z{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ce.valid(r)?new Ce(r):z.near(r)}content(){return D.empty}eq(e){return e instanceof Ce&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ce(e.resolve(n.pos))}getBookmark(){return new bc(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!RS(e)||!LS(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ce.valid(e))return e;let o=e.pos,s=null;for(let i=e.depth;;i--){let l=e.node(i);if(n>0?e.indexAfter(i)<l.childCount:e.index(i)>0){s=l.child(n>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;o+=n;let a=e.doc.resolve(o);if(Ce.valid(a))return a}for(;;){let i=n>0?s.firstChild:s.lastChild;if(!i){if(s.isAtom&&!s.isText&&!U.isSelectable(s)){e=e.doc.resolve(o+s.nodeSize*n),r=!1;continue e}break}s=i,o+=n;let l=e.doc.resolve(o);if(Ce.valid(l))return l}return null}}}Ce.prototype.visible=!1,Ce.findFrom=Ce.findGapCursorFrom,z.jsonID("gapcursor",Ce);class bc{constructor(e){this.pos=e}map(e){return new bc(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ce.valid(n)?new Ce(n):z.near(n)}}function RS(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function LS(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function IS(){return new Ae({props:{decorations:FS,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ce.valid(n)?new Ce(n):null},handleClick:PS,handleKeyDown:DS,handleDOMEvents:{beforeinput:BS}}})}const DS=ea({ArrowLeft:$i("horiz",-1),ArrowRight:$i("horiz",1),ArrowUp:$i("vert",-1),ArrowDown:$i("vert",1)});function $i(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,s){let i=r.selection,l=e>0?i.$to:i.$from,a=i.empty;if(i instanceof j){if(!s.endOfTextblock(n)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=Ce.findGapCursorFrom(l,e,a);return c?(o&&o(r.tr.setSelection(new Ce(c))),!0):!1}}function PS(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ce.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&U.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ce(r))),!0)}function BS(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ce))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=M.empty;for(let i=r.length-1;i>=0;i--)o=M.from(r[i].createAndFill(null,o));let s=t.state.tr.replace(n.pos,n.pos,new D(o,0,0));return s.setSelection(j.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function FS(t){if(!(t.selection instanceof Ce))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ee.create(t.doc,[Qe.widget(t.selection.head,e,{key:"gapcursor"})])}const $S=Be.create({name:"gapCursor",addProseMirrorPlugins(){return[IS()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=G(F(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),VS=Fe.create({name:"text",group:"inline"}),HS=Be.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),Ke=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},US={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function zS(t,e,n,r,o,s){return g.openBlock(),g.createElementBlock("button",{onClick:e[0]||(e[0]=(...i)=>s.toggleBlockquote&&s.toggleBlockquote(...i)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},e[1]||(e[1]=[g.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[g.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)]))}const jS=Ke(US,[["render",zS]]),WS={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function KS(t,e,n,r,o,s){return g.openBlock(),g.createElementBlock("button",{onClick:e[0]||(e[0]=(...i)=>s.toggleBulletList&&s.toggleBulletList(...i)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},e[1]||(e[1]=[g.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[g.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)]))}const qS=Ke(WS,[["render",KS]]),JS={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function GS(t,e,n,r,o,s){return g.openBlock(),g.createElementBlock("button",{onClick:e[0]||(e[0]=(...i)=>s.toggleOrderedList&&s.toggleOrderedList(...i)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},e[1]||(e[1]=[g.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[g.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)]))}const YS=Ke(JS,[["render",GS]]),XS={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function QS(t,e,n,r,o,s){return g.openBlock(),g.createElementBlock("button",{onClick:e[0]||(e[0]=(...i)=>s.toggleCodeBlock&&s.toggleCodeBlock(...i)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},e[1]||(e[1]=[g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[g.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)]))}const ZS=Ke(XS,[["render",QS]]),ev={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.chain().toggleBold().run()}}};function tv(t,e,n,r,o,s){return g.openBlock(),g.createElementBlock("button",{onClick:e[0]||(e[0]=(...i)=>s.toggleBold&&s.toggleBold(...i)),class:g.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":n.editor?.isActive("bold")}])},e[1]||(e[1]=[g.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[g.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),g.createElementVNode("span",{class:"sr-only"},"Bold",-1)]),2)}const nv=Ke(ev,[["render",tv]]),rv={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function ov(t,e,n,r,o,s){return g.openBlock(),g.createElementBlock("button",{onClick:e[0]||(e[0]=(...i)=>s.toggleItalic&&s.toggleItalic(...i)),class:g.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":n.editor?.isActive("italic")}])},e[1]||(e[1]=[g.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[g.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),g.createElementVNode("span",{class:"sr-only"},"Italic",-1)]),2)}const sv=Ke(rv,[["render",ov]]),Xo=async(t,e,n,r=10)=>{if(!e||!n)return;await g.nextTick();const o=await n?.getBoundingClientRect(),s=await e?.getBoundingClientRect();if(!s||!o)return;const i=await parseInt(e?.getBoundingClientRect()?.height),l=await parseInt(e?.getBoundingClientRect()?.width),a=await parseInt(n?.getBoundingClientRect()?.height),c=await parseInt(n?.getBoundingClientRect()?.width),u=await window.innerHeight,d=await window.innerWidth;let f=0,p=0;const h=s.bottom+r+a;switch(t){case"top":s.top-o.height-r<0?f=s.top-o.height+r+a+i:f=s.top-o.height-r,d>c+s.right+30?p=s.left-o.width/2+s.width/2:p=d-30-c;break;case"bottom":u>h?f=s.bottom+r:f=s.bottom-r-a-i,p=s.left-o.width/2+s.width/2;break;case"left":f=s.top-o.height/2+s.height/2,s.left-o.width-r>0?p=s.left-o.width-r:p=10;break;case"right":f=s.top-o.height/2+s.height/2,d-l>c?p=s.right+r:p=d-30-c;break;case"top-right":s.top-o.height-r<0?f=s.top-o.height+r+a+i:f=s.top-o.height-r,d-l>c?p=s.right+r:p=d-30-c;break;case"top-left":s.top-o.height-r<0?f=s.top-o.height+r+a+i:f=s.top-o.height-r,s.left-o.width-r>0?p=s.left-o.width-r:p=10;break;case"top-start":s.top-o.height-r<0?f=s.top-o.height+r+a+i:f=s.top-o.height-r,s.left>0?p=s.left:p=10;break;case"bottom-right":u>h?f=s.bottom+r:f=s.bottom-r-a-i,d-l>c?p=s.left:p=d-30-c;break;case"bottom-left":u>h?f=s.bottom+r:f=s.bottom-r-a-i,s.left>0?p=s.right-c:p=10;break;case"bottom-start":u>h?f=s.bottom+r:f=s.bottom-r-a-i,s.left>0?p=s.left:p=10;break}f+a>u?f=u-a-r:f<0&&(f=r),p+c>d?p=d-c-r:p<0&&(p=r),n instanceof HTMLElement&&(n.style.top=`${f}px`,n.style.left=`${p}px`,n.style.position="fixed")},iv={class:"text-center"},lv={class:"py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},Qo={__name:"vs-popover",props:{isOpen:{type:Boolean,default:()=>!1},placement:{type:String,default:"top"},gap:{type:Number,default:8},width:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},trigger:{type:String,default:"click"},teleport:{type:String,default:"#modal"}},emits:["isvisible"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=g.ref(!1),i=g.ref([]),l=g.ref(null),a=g.ref(null),c=g.ref(null);g.watch(s,k=>{k?(u(),window.addEventListener("resize",()=>Xo(r.placement,a.value,c.value)),Xo(r.placement,a.value,c.value)):window.removeEventListener("resize",()=>Xo(r.placement,a.value,c.value)),o("isvisible",k)}),g.onMounted(()=>{window.addEventListener("click",y),window.addEventListener("popstate",b),window.addEventListener("scroll",w,!0),u()}),g.onBeforeUnmount(()=>{window.removeEventListener("click",y),window.removeEventListener("popstate",b),d()});const u=()=>{let k=l.value;for(;k&&k!==document.body;)(k.scrollHeight>k.clientHeight||k.scrollWidth>k.clientWidth)&&(k.addEventListener("scroll",m),i.value.push(k)),k=k.parentElement;document.body&&(document.body.addEventListener("scroll",m),i.value.push(document.body))},d=()=>{i.value.forEach(k=>{k.removeEventListener("scroll",m)}),i.value=[]},f=()=>{s.value=!0,Xo(r.placement,a.value,c.value)},p=()=>{s.value=!1},h=async()=>{await Xo(r.placement,a.value,c.value),s.value=!s.value},m=()=>{s.value=!1},y=k=>{if(!k){s.value=!1;return}a.value?.contains(k.target)||c.value?.contains(k.target)||(s.value=!1)},b=()=>{s.value&&(s.value=!1)},w=k=>{s.value&&c.value&&!c.value.contains(k.target)&&(s.value=!1)};return e({togglePopover:h}),(k,E)=>(g.openBlock(),g.createElementBlock("div",{ref_key:"popover",ref:l,class:"vs-popover inline-block"},[g.createElementVNode("div",iv,[t.trigger==="click"?(g.openBlock(),g.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:a,onClick:h,class:g.normalizeClass({"pointer-events-none":t.disabled})},[g.renderSlot(k.$slots,"reference",{},()=>[E[0]||(E[0]=g.createElementVNode("button",null,"Click me!",-1))])],2)):g.createCommentVNode("",!0),t.trigger==="hover"?(g.openBlock(),g.createElementBlock("div",{key:1,ref_key:"popoverRef",ref:a,onMouseover:f,onMouseleave:p,class:g.normalizeClass({"pointer-events-none":t.disabled})},[g.renderSlot(k.$slots,"reference",{},()=>[E[1]||(E[1]=g.createElementVNode("button",null,"Click me!",-1))])],34)):g.createCommentVNode("",!0),(g.openBlock(),g.createBlock(g.Teleport,{to:t.teleport},[g.createVNode(g.Transition,{name:"fade"},{default:g.withCtx(()=>[g.withDirectives(g.createElementVNode("div",{class:g.normalizeClass(["vsTailwind vs-popover__content",t.placement]),ref_key:"contentPop",ref:c,style:g.normalizeStyle({width:t.width?t.width+"px":"fit-content",zIndex:10002})},[g.createElementVNode("div",lv,[g.renderSlot(k.$slots,"default",{},()=>[E[2]||(E[2]=g.createElementVNode("span",null,"Popover content",-1))])])],6),[[g.vShow,s.value]])]),_:3})],8,["to"]))])],512))}},av={class:"w-[30px] h-[30px] rounded-full hover:bg-gray-100 justify-center items-center relative flex"},cv={class:"flex w-[160px] flex-wrap gap-[4px]"},uv=["onClick"],dv={__name:"vs-editor-color",props:{editor:Object},setup(t){const e=t,n=g.ref("popover"),r=g.ref("#000000"),o=g.ref(["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]),s=i=>{e.editor&&(e.editor.chain().focus().setColor(i).run(),r.value=i,n.value&&n.value.togglePopover())};return(i,l)=>(g.openBlock(),g.createBlock(Qo,{ref_key:"popover",ref:n,placement:"bottom"},{reference:g.withCtx(()=>[g.createElementVNode("button",av,[l[0]||(l[0]=g.createElementVNode("svg",{class:"text-gray-500",height:"16",width:"16","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[g.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 19.2H5.5c-.3 0-.5-.2-.5-.5V16c0-.2.2-.4.5-.4h13c.3 0 .5.2.5.4v2.7c0 .3-.2.5-.5.5H18m-6-1 1.4 1.8h.2l1.4-1.7m-7-5.4L12 4c0-.1 0-.1 0 0l4 8.8m-6-2.7h4m-7 2.7h2.5m5 0H17"})],-1)),g.createElementVNode("span",{class:"absolute h-[2px] w-[40%] bottom-[10px] left-[9px]",style:g.normalizeStyle({backgroundColor:r.value})},null,4)])]),default:g.withCtx(()=>[g.createElementVNode("div",null,[g.createElementVNode("ul",cv,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(o.value,a=>(g.openBlock(),g.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:g.normalizeStyle({backgroundColor:a}),onClick:c=>s(a),key:a},null,12,uv))),128))])])]),_:1},512))}},fv={__name:"vs-editor-underline",props:{editor:Object},setup(t){const e=t,n=()=>{e.editor&&e.editor.chain().focus().toggleUnderline().run()};return(r,o)=>(g.openBlock(),g.createElementBlock("button",{onClick:n,class:g.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[t.editor?.isActive("underline")?"bg-gray-100 text-gray-900":"text-gray-500"]])},o[0]||(o[0]=[g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[g.createElementVNode("path",{d:"M6 4v6a6 6 0 0 0 12 0V4"}),g.createElementVNode("line",{x1:"4",x2:"20",y1:"20",y2:"20"})],-1)]),2))}},pv={__name:"vs-editor-strike",props:{editor:Object},setup(t){const e=t,n=()=>{e.editor&&e.editor.chain().focus().toggleStrike().run()};return(r,o)=>(g.openBlock(),g.createElementBlock("button",{onClick:n,class:g.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[t.editor?.isActive("strike")?"bg-gray-100 text-gray-900":"text-gray-500"]])},o[0]||(o[0]=[g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-strikethrough"},[g.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),g.createElementVNode("path",{d:"M5 12l14 0"}),g.createElementVNode("path",{d:"M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5"})],-1)]),2))}},hv={props:{visible:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},size:{type:String,default:()=>""},closeClickBack:{type:Boolean,default:()=>!1}},emits:["update:visible","onClose"],name:"vs-dialog",mounted(){window.addEventListener("keydown",this.checkKey)},unmounted(){window.removeEventListener("keydown",this.checkKey)},computed:{hasSlot(){return!!this.$slots?.footer},checkSize(){return this.size==="small"?"md:w-5/12 w-9/12":this.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"}},methods:{checkKey({key:t}){t==="Escape"&&this.handleClose()},handleClose(){this.$emit("update:visible",!1),this.$emit("onClose")},closeByClickBack(t,e){e&&t.target.classList.contains("vs-dialog-overlay")&&this.handleClose()}}},mv={key:0,class:"vsTailwind ui-dialog__wrapper"},gv={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},yv={class:"font-medium text-gray-800 dark:text-[#ffffff]"},bv={class:"ui-dialog__content p-4"},Ev={key:0,class:"flex justify-end gap-x-2"};function wv(t,e,n,r,o,s){return g.openBlock(),g.createBlock(g.Teleport,{to:"#modal"},[n.visible?(g.openBlock(),g.createElementBlock("div",mv,[g.createElementVNode("div",{onMousedown:e[1]||(e[1]=i=>s.closeByClickBack(i,n.closeClickBack)),class:"vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},[g.createVNode(g.Transition,{name:"content",appear:""},{default:g.withCtx(()=>[g.createElementVNode("div",{class:g.normalizeClass(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",[s.checkSize]])},[g.createElementVNode("div",gv,[g.createElementVNode("h3",yv,g.toDisplayString(n.title),1),g.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:e[0]||(e[0]=(...i)=>s.handleClose&&s.handleClose(...i))},e[2]||(e[2]=[g.createElementVNode("span",{class:"sr-only"},"Close",-1),g.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[g.createElementVNode("path",{d:"M18 6 6 18"}),g.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),g.createElementVNode("div",bv,[g.renderSlot(t.$slots,"default",{},void 0,!0)]),s.hasSlot?(g.openBlock(),g.createElementBlock("div",Ev,[g.renderSlot(t.$slots,"footer",{handleClose:s.handleClose},void 0,!0)])):g.createCommentVNode("",!0)],2)]),_:3})],32)])):g.createCommentVNode("",!0)])}const kv=Ke(hv,[["render",wv],["__scopeId","data-v-6d4e684d"]]),Cv={},Sv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function vv(t,e,n,r,o,s){return g.openBlock(),g.createElementBlock("svg",Sv,e[0]||(e[0]=[g.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),g.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),g.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const xv=Ke(Cv,[["render",vv]]),Tv={},Ov={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search"};function Nv(t,e,n,r,o,s){return g.openBlock(),g.createElementBlock("svg",Ov,e[0]||(e[0]=[g.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),g.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),g.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const Av=Ke(Tv,[["render",Nv]]),_v={},Mv={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-mail"};function Rv(t,e,n,r,o,s){return g.openBlock(),g.createElementBlock("svg",Mv,e[0]||(e[0]=[g.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),g.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"},null,-1),g.createElementVNode("path",{d:"M3 7l9 6l9 -6"},null,-1)]))}const Lv=Ke(_v,[["render",Rv]]),Iv=g.defineComponent({components:{IconClose:xv,IconSearch:Av,IconEmail:Lv},props:{icon:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},modelValue:{type:String,default:()=>""},placeholder:{type:String,default:()=>""},iconPosition:{type:String,default:()=>"right"},type:{type:String,default:()=>"text"},style:{type:Object,default:()=>null},size:{type:String,default:()=>"md"},attrs:{type:Object,default:()=>{}}},emits:["onInput","update:modelValue","blur","focus"],computed:{checkSize(){if((this.style?.size||this.size)==="xs")return"h-[32px] text-sm";if((this.style?.size||this.size)==="md")return"h-[38px] text-sm";this.style?.size||this.size},value:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t.trim())}},clearIconStyle(){return[{"right-8":this.icon&&this.iconPosition==="right","right-3":!this.icon||this.iconPosition!=="right","pointer-events-none":this.disabled}]},iconStylePosition(){return[{"left-3":this.icon&&this.iconPosition==="left","right-3":this.icon&&this.iconPosition==="right"}]},inputStyle(){return[{"!pr-8":this.clearable&&!this.icon,"!pr-7":this.clearable,"!pr-16":this.clearable&&this.icon&&this.iconPosition==="right","!pl-8":this.icon&&this.iconPosition==="left","!pr-[50px]":this.clearable&&this.value&&this.icon&&this.iconPosition==="right","!cursor-not-allowed bg-slate-100":this.disabled,"bg-white":!this.disabled}]}},methods:{handleInput(){this.$emit("onInput",this.modelValue)},handleBlur(){this.$emit("blur")},handleFocus(){this.$emit("focus")},clearInput(){this.$emit("update:modelValue",""),this.$emit("onInput","")},async inputFocus(){const{vsText:t}=await this.$refs;await t.focus()}}}),Dv={class:"vs-form-text relative bg-white rounded-lg"},Pv={key:2,class:"absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"},Bv=["disabled","type","placeholder"];function Fv(t,e,n,r,o,s){const i=g.resolveComponent("IconClose"),l=g.resolveComponent("IconSearch"),a=g.resolveComponent("IconEmail");return g.openBlock(),g.createElementBlock("div",Dv,[t.clearable&&t.value?(g.openBlock(),g.createElementBlock("div",{key:0,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[0]||(e[0]=(...c)=>t.clearInput&&t.clearInput(...c))},[g.createVNode(i,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):g.createCommentVNode("",!0),t.icon&&t.icon==="search"?(g.openBlock(),g.createElementBlock("div",{key:1,class:g.normalizeClass(["absolute bottom-2/4 translate-y-2/4 cursor-pointer",t.iconStylePosition])},[g.createVNode(l,{width:"15px",height:"15px",class:"stroke-gray-500 transition-all"})],2)):t.icon&&t.icon==="email"?(g.openBlock(),g.createElementBlock("div",Pv,[g.createVNode(a,{width:"16",height:"16",class:"stroke-gray-500 transition-all"})])):(g.openBlock(),g.createElementBlock("i",{key:3,class:g.normalizeClass(["absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer",["ti "+t.icon,t.iconStylePosition]])},null,2)),t.clearable&&t.value?(g.openBlock(),g.createElementBlock("div",{key:4,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[1]||(e[1]=(...c)=>t.clearInput&&t.clearInput(...c))},[g.createVNode(i,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):g.createCommentVNode("",!0),g.withDirectives(g.createElementVNode("input",g.mergeProps({ref:"vsText",disabled:t.disabled,type:t.type,onInput:e[2]||(e[2]=(...c)=>t.handleInput&&t.handleInput(...c)),placeholder:t.placeholder,"onUpdate:modelValue":e[3]||(e[3]=c=>t.value=c)},t.style?.attrs||t.attrs||{},{onFocus:e[4]||(e[4]=(...c)=>t.handleFocus&&t.handleFocus(...c)),onBlur:e[5]||(e[5]=(...c)=>t.handleBlur&&t.handleBlur(...c)),class:[[t.inputStyle,t.checkSize],"py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"]}),null,16,Bv),[[g.vModelDynamic,t.value]])])}const Bh=Ke(Iv,[["render",Fv],["__scopeId","data-v-00f5150b"]]);/*!
117
+ 3. "-" cannot repeat`);Ae.customSchemes.push([t,e])}function QE(){Ae.scanner=UE(Ae.customSchemes);for(let t=0;t<Ae.tokenQueue.length;t++)Ae.tokenQueue[t][1]({scanner:Ae.scanner});Ae.parser=qE(Ae.scanner.tokens);for(let t=0;t<Ae.pluginQueue.length;t++)Ae.pluginQueue[t][1]({scanner:Ae.scanner,parser:Ae.parser});return Ae.initialized=!0,Ae}function pc(t){return Ae.initialized||QE(),GE(Ae.parser.start,t,Dh(Ae.scanner.start,t))}pc.scan=Dh;function jh(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new dc(n),o=pc(t),i=[];for(let s=0;s<o.length;s++){const a=o[s];a.isLink&&(!e||a.t===e)&&r.check(a)&&i.push(a.toFormattedObject(r))}return i}function ZE(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function ev(t){return new $e({key:new Ue("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),i=e.some(c=>c.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,a=Yk(n.doc,[...e]);if(n1(a).forEach(({newRange:c})=>{const u=Qk(r.doc,c,m=>m.isTextblock);let f,p;if(u.length>1?(f=u[0],p=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(f=u[0],p=r.doc.textBetween(f.pos,c.to,void 0," ")),f&&p){const m=p.split(" ").filter(E=>E!=="");if(m.length<=0)return!1;const b=m[m.length-1],k=f.pos+p.lastIndexOf(b);if(!b)return!1;const _=pc(b).map(E=>E.toObject(t.defaultProtocol));if(!ZE(_))return!1;_.filter(E=>E.isLink).map(E=>({...E,from:k+E.start+1,to:k+E.end+1})).filter(E=>r.schema.marks.code?!r.doc.rangeHasMark(E.from,E.to,r.schema.marks.code):!0).filter(E=>t.validate(E.value)).filter(E=>t.shouldAutoLink(E.value)).forEach(E=>{_l(E.from,E.to,r.doc).some(N=>N.mark.type===t.type)||s.addMark(E.from,E.to,t.type.create({href:E.href}))})}}),!!s.steps.length)return s}})}function tv(t){return new $e({key:new Ue("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(r.button!==0||!e.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(p=>p.nodeName==="A"))return!1;const l=lp(e.state,t.type.name),c=r.target,u=(o=c?.href)!==null&&o!==void 0?o:l.href,f=(i=c?.target)!==null&&i!==void 0?i:l.target;return c&&u?(window.open(u,f),!0):!1}}})}function nv(t){return new $e({key:new Ue("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach(c=>{a+=c.textContent});const l=jh(a,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:(t.editor.commands.setMark(t.type,{href:l.href}),!0)}}})}const rv=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function kr(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(rv,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Uh=ht.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){zh(t);return}zh(t.scheme,t.optionalSlashes)})},onDestroy(){XE()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!kr(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!kr(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!kr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Ce(this.options.HTMLAttributes,t),0]:["a",Ce(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!kr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!kr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[jn({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=jh(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!kr(s,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(ev({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!kr(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(tv({type:this.type})),this.options.linkOnPaste&&t.push(nv({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),Wh=ht.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=wl(t,this.type);return Object.entries(n).some(([,o])=>!!o)?!0:e.unsetMark(this.name)}}}}),Kh=Ke.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),ov=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,qh=ct.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Ce(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[S1({find:ov,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}});var hc,mc;if(typeof WeakMap<"u"){let t=new WeakMap;hc=e=>t.get(e),mc=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;hc=r=>{for(let o=0;o<t.length;o+=2)if(t[o]==r)return t[o+1]},mc=(r,o)=>(n==10&&(n=0),t[n++]=r,t[n++]=o)}var Pe=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,o=e/this.width|0;let i=r+1,s=o+1;for(let a=1;i<this.width&&this.map[e+a]==n;a++)i++;for(let a=1;s<this.height&&this.map[e+this.width*a]==n;a++)s++;return{left:r,top:o,right:i,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:o,top:i,bottom:s}=this.findCell(t);return e=="horiz"?(n<0?r==0:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?i==0:s==this.height)?null:this.map[r+this.width*(n<0?i-1:s)]}rectBetween(t,e){const{left:n,right:r,top:o,bottom:i}=this.findCell(t),{left:s,right:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(n,s),top:Math.min(o,l),right:Math.max(r,a),bottom:Math.max(i,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let o=t.left;o<t.right;o++){const i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,!(o==t.left&&o&&this.map[i-1]==s||r==t.top&&r&&this.map[i-this.width]==s)&&e.push(s))}return e}positionAt(t,e,n){for(let r=0,o=0;;r++){const i=o+n.child(r).nodeSize;if(r==t){let s=e+t*this.width;const a=(t+1)*this.width;for(;s<a&&this.map[s]<o;)s++;return s==a?i-1:this.map[s]}o=i}}static get(t){return hc(t)||mc(t,iv(t))}};function iv(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=sv(t),n=t.childCount,r=[];let o=0,i=null;const s=[];for(let c=0,u=e*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const f=t.child(c);u++;for(let b=0;;b++){for(;o<r.length&&r[o]!=0;)o++;if(b==f.childCount)break;const k=f.child(b),{colspan:_,rowspan:E,colwidth:N}=k.attrs;for(let A=0;A<E;A++){if(A+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:E-A});break}const d=o+A*e;for(let g=0;g<_;g++){r[d+g]==0?r[d+g]=u:(i||(i=[])).push({type:"collision",row:c,pos:u,n:_-g});const h=N&&N[g];if(h){const w=(d+g)%e*2,v=s[w];v==null||v!=h&&s[w+1]==1?(s[w]=h,s[w+1]=1):v==h&&s[w+1]++}}}o+=_,u+=k.nodeSize}const p=(c+1)*e;let m=0;for(;o<p;)r[o++]==0&&m++;m&&(i||(i=[])).push({type:"missing",row:c,n:m}),u++}(e===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});const a=new Pe(e,n,r,i);let l=!1;for(let c=0;!l&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(l=!0);return l&&av(a,s,t),a}function sv(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let i=0;if(n)for(let s=0;s<r;s++){const a=t.child(s);for(let l=0;l<a.childCount;l++){const c=a.child(l);s+c.attrs.rowspan>r&&(i+=c.attrs.colspan)}}for(let s=0;s<o.childCount;s++){const a=o.child(s);i+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function av(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const i=t.map[o];if(r[i])continue;r[i]=!0;const s=n.nodeAt(i);if(!s)throw new RangeError(`No cell with offset ${i} found`);let a=null;const l=s.attrs;for(let c=0;c<l.colspan;c++){const u=(o+c)%t.width,f=e[u*2];f!=null&&(!l.colwidth||l.colwidth[c]!=f)&&((a||(a=lv(l)))[c]=f)}a&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}function lv(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Ze(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var Jn=new Ue("selectingCells");function Zr(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function cv(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function Wt(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Ps(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Zr(e.$head)||uv(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function uv(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function gc(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function dv(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function bc(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Gh(t,e,n){const r=t.node(-1),o=Pe.get(r),i=t.start(-1),s=o.nextCell(t.pos-i,e,n);return s==null?null:t.node(0).resolve(i+s)}function _r(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function Jh(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function fv(t,e,n){const r=Ze(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var Se=class An extends ee{constructor(e,n=e){const r=e.node(-1),o=Pe.get(r),i=e.start(-1),s=o.rectBetween(e.pos-i,n.pos-i),a=e.node(0),l=o.cellsInRect(s).filter(u=>u!=n.pos-i);l.unshift(n.pos-i);const c=l.map(u=>{const f=r.nodeAt(u);if(!f)throw RangeError(`No cell with offset ${u} found`);const p=i+u+1;return new fd(a.resolve(p),a.resolve(p+f.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(gc(r)&&gc(o)&&bc(r,o)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?An.rowSelection(r,o):i&&this.isColSelection()?An.colSelection(r,o):new An(r,o)}return te.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=Pe.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},s=[];for(let l=o.top;l<o.bottom;l++){const c=[];for(let u=l*n.width+o.left,f=o.left;f<o.right;f++,u++){const p=n.map[u];if(i[p])continue;i[p]=!0;const m=n.findCell(p);let b=e.nodeAt(p);if(!b)throw RangeError(`No cell with offset ${p} found`);const k=o.left-m.left,_=m.right-o.right;if(k>0||_>0){let E=b.attrs;if(k>0&&(E=_r(E,0,k)),_>0&&(E=_r(E,E.colspan-_,_)),m.left<o.left){if(b=b.type.createAndFill(E),!b)throw RangeError(`Could not create cell with attrs ${JSON.stringify(E)}`)}else b=b.type.create(E,b.content)}if(m.top<o.top||m.bottom>o.bottom){const E={...b.attrs,rowspan:Math.min(m.bottom,o.bottom)-Math.max(m.top,o.top)};m.top<o.top?b=b.type.createAndFill(E):b=b.type.create(E,b.content)}c.push(b)}s.push(e.child(l).copy(V.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:s;return new W(V.from(a),1,1)}replace(e,n=W.empty){const r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){const{$from:a,$to:l}=o[s],c=e.mapping.slice(r);e.replace(c.map(a.pos),c.map(l.pos),s?W.empty:n)}const i=ee.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new W(V.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=Pe.get(n),o=this.$anchorCell.start(-1),i=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let s=0;s<i.length;s++)e(n.nodeAt(i[s]),o+i[s])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=Pe.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(n.pos-i),l=e.node(0);return s.top<=a.top?(s.top>0&&(e=l.resolve(i+o.map[s.left])),a.bottom<o.height&&(n=l.resolve(i+o.map[o.width*(o.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(i+o.map[a.left])),s.bottom<o.height&&(e=l.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))),new An(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=Pe.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),i=n.colCount(this.$headCell.pos-r);if(Math.min(o,i)>0)return!1;const s=o+this.$anchorCell.nodeAfter.attrs.colspan,a=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,a)==n.width}eq(e){return e instanceof An&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=Pe.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(n.pos-i),l=e.node(0);return s.left<=a.left?(s.left>0&&(e=l.resolve(i+o.map[s.top*o.width])),a.right<o.width&&(n=l.resolve(i+o.map[o.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(i+o.map[a.top*o.width])),s.right<o.width&&(e=l.resolve(i+o.map[o.width*(s.top+1)-1]))),new An(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new An(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new An(e.resolve(n),e.resolve(r))}getBookmark(){return new pv(this.$anchorCell.pos,this.$headCell.pos)}};Se.prototype.visible=!1,ee.jsonID("cell",Se);var pv=class V0{constructor(e,n){this.anchor=e,this.head=n}map(e){return new V0(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&bc(n,r)?new Se(n,r):ee.near(r,1)}};function hv(t){if(!(t.selection instanceof Se))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(lt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Le.create(t.doc,e)}function mv({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let i=e.depth;i>=0&&!(e.before(i+1)>e.start(i));i--,r--);return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}function gv({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const i=t.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){n=i;break}}for(let o=e.depth;o>0;o--){const i=e.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){r=i;break}}return n!==r&&e.parentOffset===0}function bv(t,e,n){const r=(e||t).selection,o=(e||t).doc;let i,s;if(r instanceof Q&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")i=Se.create(o,r.from);else if(s=="row"){const a=o.resolve(r.from+1);i=Se.rowSelection(a,a)}else if(!n){const a=Pe.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];i=Se.create(o,l+1,c)}}else r instanceof te&&mv(r)?i=te.create(o,r.from):r instanceof te&&gv(r)&&(i=te.create(o,r.$from.start(),r.$from.end()));return i&&(e||(e=t.tr)).setSelection(i),e}var yv=new Ue("fix-tables");function Yh(t,e,n,r){const o=t.childCount,i=e.childCount;e:for(let s=0,a=0;s<i;s++){const l=e.child(s);for(let c=a,u=Math.min(o,s+3);c<u;c++)if(t.child(c)==l){a=c+1,n+=l.nodeSize;continue e}r(l,n),a<o&&t.child(a).sameMarkup(l)?Yh(t.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function Xh(t,e){let n;const r=(o,i)=>{o.type.spec.tableRole=="table"&&(n=wv(t,o,i,n))};return e?e.doc!=t.doc&&Yh(e.doc,t.doc,0,r):t.doc.descendants(r),n}function wv(t,e,n,r){const o=Pe.get(e);if(!o.problems)return r;r||(r=t.tr);const i=[];for(let l=0;l<o.height;l++)i.push(0);for(let l=0;l<o.problems.length;l++){const c=o.problems[l];if(c.type=="collision"){const u=e.nodeAt(c.pos);if(!u)continue;const f=u.attrs;for(let p=0;p<f.rowspan;p++)i[c.row+p]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,_r(f,f.colspan-c.n,c.n))}else if(c.type=="missing")i[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=r.mapping.map(n);r.delete(u,u+e.nodeSize)}}let s,a;for(let l=0;l<i.length;l++)i[l]&&(s==null&&(s=l),a=l);for(let l=0,c=n+1;l<o.height;l++){const u=e.child(l),f=c+u.nodeSize,p=i[l];if(p>0){let m="cell";u.firstChild&&(m=u.firstChild.type.spec.tableRole);const b=[];for(let _=0;_<p;_++){const E=Ze(t.schema)[m].createAndFill();E&&b.push(E)}const k=(l==0||s==l-1)&&a==l?c+1:f-1;r.insert(r.mapping.map(k),b)}c=f}return r.setMeta(yv,{fixTables:!0})}function sn(t){const e=t.selection,n=Ps(t),r=n.node(-1),o=n.start(-1),i=Pe.get(r);return{...e instanceof Se?i.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function Qh(t,{map:e,tableStart:n,table:r},o){let i=o>0?-1:0;fv(e,r,o+i)&&(i=o==0||o==e.width?null:0);for(let s=0;s<e.height;s++){const a=s*e.width+o;if(o>0&&o<e.width&&e.map[a-1]==e.map[a]){const l=e.map[a],c=r.nodeAt(l);t.setNodeMarkup(t.mapping.map(n+l),null,Jh(c.attrs,o-e.colCount(l))),s+=c.attrs.rowspan-1}else{const l=i==null?Ze(r.type.schema).cell:r.nodeAt(e.map[a+i]).type,c=e.positionAt(s,o,r);t.insert(t.mapping.map(n+c),l.createAndFill())}}return t}function kv(t,e){if(!Wt(t))return!1;if(e){const n=sn(t);e(Qh(t.tr,n,n.left))}return!0}function _v(t,e){if(!Wt(t))return!1;if(e){const n=sn(t);e(Qh(t.tr,n,n.right))}return!0}function Ev(t,{map:e,table:n,tableStart:r},o){const i=t.mapping.maps.length;for(let s=0;s<e.height;){const a=s*e.width+o,l=e.map[a],c=n.nodeAt(l),u=c.attrs;if(o>0&&e.map[a-1]==l||o<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(i).map(r+l),null,_r(u,o-e.colCount(l)));else{const f=t.mapping.slice(i).map(r+l);t.delete(f,f+c.nodeSize)}s+=u.rowspan}}function vv(t,e){if(!Wt(t))return!1;if(e){const n=sn(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;Ev(r,n,o),o!=n.left;o--){const i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=Pe.get(i)}e(r)}return!0}function Cv(t,e,n){var r;const o=Ze(e.type.schema).header_cell;for(let i=0;i<t.width;i++)if(((r=e.nodeAt(t.map[i+n*t.width]))==null?void 0:r.type)!=o)return!1;return!0}function Zh(t,{map:e,tableStart:n,table:r},o){var i;let s=n;for(let c=0;c<o;c++)s+=r.child(c).nodeSize;const a=[];let l=o>0?-1:0;Cv(e,r,o+l)&&(l=o==0||o==e.height?null:0);for(let c=0,u=e.width*o;c<e.width;c++,u++)if(o>0&&o<e.height&&e.map[u]==e.map[u-e.width]){const f=e.map[u],p=r.nodeAt(f).attrs;t.setNodeMarkup(n+f,null,{...p,rowspan:p.rowspan+1}),c+=p.colspan-1}else{const f=l==null?Ze(r.type.schema).cell:(i=r.nodeAt(e.map[u+l*e.width]))==null?void 0:i.type,p=f?.createAndFill();p&&a.push(p)}return t.insert(s,Ze(r.type.schema).row.create(null,a)),t}function Sv(t,e){if(!Wt(t))return!1;if(e){const n=sn(t);e(Zh(t.tr,n,n.top))}return!0}function Tv(t,e){if(!Wt(t))return!1;if(e){const n=sn(t);e(Zh(t.tr,n,n.bottom))}return!0}function Nv(t,{map:e,table:n,tableStart:r},o){let i=0;for(let c=0;c<o;c++)i+=n.child(c).nodeSize;const s=i+n.child(o).nodeSize,a=t.mapping.maps.length;t.delete(i+r,s+r);const l=new Set;for(let c=0,u=o*e.width;c<e.width;c++,u++){const f=e.map[u];if(!l.has(f)){if(l.add(f),o>0&&f==e.map[u-e.width]){const p=n.nodeAt(f).attrs;t.setNodeMarkup(t.mapping.slice(a).map(f+r),null,{...p,rowspan:p.rowspan-1}),c+=p.colspan-1}else if(o<e.height&&f==e.map[u+e.width]){const p=n.nodeAt(f),m=p.attrs,b=p.type.create({...m,rowspan:p.attrs.rowspan-1},p.content),k=e.positionAt(o+1,c,n);t.insert(t.mapping.slice(a).map(r+k),b),c+=m.colspan-1}}}}function Av(t,e){if(!Wt(t))return!1;if(e){const n=sn(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;Nv(r,n,o),o!=n.top;o--){const i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=Pe.get(n.table)}e(r)}return!0}function em(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function Ov({width:t,height:e,map:n},r){let o=r.top*t+r.left,i=o,s=(r.bottom-1)*t+r.left,a=o+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[i]==n[i-1]||r.right<t&&n[a]==n[a+1])return!0;i+=t,a+=t}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[o]==n[o-t]||r.bottom<e&&n[s]==n[s+t])return!0;o++,s++}return!1}function tm(t,e){const n=t.selection;if(!(n instanceof Se)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=sn(t),{map:o}=r;if(Ov(o,r))return!1;if(e){const i=t.tr,s={};let a=V.empty,l,c;for(let u=r.top;u<r.bottom;u++)for(let f=r.left;f<r.right;f++){const p=o.map[u*o.width+f],m=r.table.nodeAt(p);if(!(s[p]||!m))if(s[p]=!0,l==null)l=p,c=m;else{em(m)||(a=a.append(m.content));const b=i.mapping.map(p+r.tableStart);i.delete(b,b+m.nodeSize)}}if(l==null||c==null)return!0;if(i.setNodeMarkup(l+r.tableStart,null,{...Jh(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),a.size){const u=l+1+c.content.size,f=em(c)?l+1:u;i.replaceWith(f+r.tableStart,u+r.tableStart,a)}i.setSelection(new Se(i.doc.resolve(l+r.tableStart))),e(i)}return!0}function nm(t,e){const n=Ze(t.schema);return Mv(({node:r})=>n[r.type.spec.tableRole])(t,e)}function Mv(t){return(e,n)=>{var r;const o=e.selection;let i,s;if(o instanceof Se){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{if(i=cv(o.$from),!i)return!1;s=(r=Zr(o.$from))==null?void 0:r.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let a=i.attrs;const l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const u=sn(e),f=e.tr;for(let m=0;m<u.right-u.left;m++)l.push(c?{...a,colwidth:c&&c[m]?[c[m]]:null}:a);let p;for(let m=u.top;m<u.bottom;m++){let b=u.map.positionAt(m,u.left,u.table);m==u.top&&(b+=i.nodeSize);for(let k=u.left,_=0;k<u.right;k++,_++)k==u.left&&m==u.top||f.insert(p=f.mapping.map(b+u.tableStart,1),t({node:i,row:m,col:k}).createAndFill(l[_]))}f.setNodeMarkup(s,t({node:i,row:u.top,col:u.left}),l[0]),o instanceof Se&&f.setSelection(new Se(f.doc.resolve(o.$anchorCell.pos),p?f.doc.resolve(p):void 0)),n(f)}return!0}}function xv(t,e){return function(n,r){if(!Wt(n))return!1;const o=Ps(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const i=n.tr;n.selection instanceof Se?n.selection.forEachCell((s,a)=>{s.attrs[t]!==e&&i.setNodeMarkup(a,null,{...s.attrs,[t]:e})}):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(i)}return!0}}function Lv(t){return function(e,n){if(!Wt(e))return!1;if(n){const r=Ze(e.schema),o=sn(e),i=e.tr,s=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),a=s.map(l=>o.table.nodeAt(l));for(let l=0;l<s.length;l++)a[l].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[l],r.cell,a[l].attrs);if(i.steps.length==0)for(let l=0;l<s.length;l++)i.setNodeMarkup(o.tableStart+s[l],r.header_cell,a[l].attrs);n(i)}return!0}}function rm(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const i=e.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function Xo(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Lv(t):function(n,r){if(!Wt(n))return!1;if(r){const o=Ze(n.schema),i=sn(n),s=n.tr,a=rm("row",i,o),l=rm("column",i,o),u=(t==="column"?a:t==="row"?l:!1)?1:0,f=t=="column"?{left:0,top:u,right:1,bottom:i.map.height}:t=="row"?{left:u,top:0,right:i.map.width,bottom:1}:i,p=t=="column"?l?o.cell:o.header_cell:t=="row"?a?o.cell:o.header_cell:o.cell;i.map.cellsInRect(f).forEach(m=>{const b=m+i.tableStart,k=s.doc.nodeAt(b);k&&s.setNodeMarkup(b,p,k.attrs)}),r(s)}return!0}}Xo("row",{useDeprecatedLogic:!0}),Xo("column",{useDeprecatedLogic:!0});var Rv=Xo("cell",{useDeprecatedLogic:!0});function Pv(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const i=t.node(-1).child(r),s=i.lastChild;if(s)return o-1-s.nodeSize;o-=i.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),o=t.after();r<n.childCount;r++){const i=n.child(r);if(i.childCount)return o+1;o+=i.nodeSize}}return null}function om(t){return function(e,n){if(!Wt(e))return!1;const r=Pv(Ps(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(te.between(o,dv(o))).scrollIntoView())}return!0}}function Iv(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Is(t,e){const n=t.selection;if(!(n instanceof Se))return!1;if(e){const r=t.tr,o=Ze(t.schema).cell.createAndFill().content;n.forEachCell((i,s)=>{i.content.eq(o)||r.replace(r.mapping.map(s+1),r.mapping.map(s+i.nodeSize-1),new W(o,0,0))}),r.docChanged&&e(r)}return!0}function Dv(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const o=e.child(0),i=o.type.spec.tableRole,s=o.type.schema,a=[];if(i=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content;const u=l?0:Math.max(0,n-1),f=l<e.childCount-1?0:Math.max(0,r-1);(u||f)&&(c=yc(Ze(s).row,new W(c,u,f)).content),a.push(c)}else if(i=="cell"||i=="header_cell")a.push(n||r?yc(Ze(s).row,new W(e,n,r)).content:e);else return null;return Bv(s,a)}function Bv(t,e){const n=[];for(let o=0;o<e.length;o++){const i=e[o];for(let s=i.childCount-1;s>=0;s--){const{rowspan:a,colspan:l}=i.child(s).attrs;for(let c=o;c<o+a;c++)n[c]=(n[c]||0)+l}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(V.empty),n[o]<r){const i=Ze(t).cell.createAndFill(),s=[];for(let a=n[o];a<r;a++)s.push(i);e[o]=e[o].append(V.from(s))}return{height:e.length,width:r,rows:e}}function yc(t,e){const n=t.createAndFill();return new Na(n).replace(0,n.content.size,e).doc}function Fv({width:t,height:e,rows:n},r,o){if(t!=r){const i=[],s=[];for(let a=0;a<n.length;a++){const l=n[a],c=[];for(let u=i[a]||0,f=0;u<r;f++){let p=l.child(f%l.childCount);u+p.attrs.colspan>r&&(p=p.type.createChecked(_r(p.attrs,p.attrs.colspan,u+p.attrs.colspan-r),p.content)),c.push(p),u+=p.attrs.colspan;for(let m=1;m<p.attrs.rowspan;m++)i[a+m]=(i[a+m]||0)+p.attrs.colspan}s.push(V.from(c))}n=s,t=r}if(e!=o){const i=[];for(let s=0,a=0;s<o;s++,a++){const l=[],c=n[a%e];for(let u=0;u<c.childCount;u++){let f=c.child(u);s+f.attrs.rowspan>o&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,o-f.attrs.rowspan)},f.content)),l.push(f)}i.push(V.from(l))}n=i,e=o}return{width:t,height:e,rows:n}}function $v(t,e,n,r,o,i,s){const a=t.doc.type.schema,l=Ze(a);let c,u;if(o>e.width)for(let f=0,p=0;f<e.height;f++){const m=n.child(f);p+=m.nodeSize;const b=[];let k;m.lastChild==null||m.lastChild.type==l.cell?k=c||(c=l.cell.createAndFill()):k=u||(u=l.header_cell.createAndFill());for(let _=e.width;_<o;_++)b.push(k);t.insert(t.mapping.slice(s).map(p-1+r),b)}if(i>e.height){const f=[];for(let b=0,k=(e.height-1)*e.width;b<Math.max(e.width,o);b++){const _=b>=e.width?!1:n.nodeAt(e.map[k+b]).type==l.header_cell;f.push(_?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const p=l.row.create(null,V.from(f)),m=[];for(let b=e.height;b<i;b++)m.push(p);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),m)}return!!(c||u)}function im(t,e,n,r,o,i,s,a){if(s==0||s==e.height)return!1;let l=!1;for(let c=o;c<i;c++){const u=s*e.width+c,f=e.map[u];if(e.map[u-e.width]==f){l=!0;const p=n.nodeAt(f),{top:m,left:b}=e.findCell(f);t.setNodeMarkup(t.mapping.slice(a).map(f+r),null,{...p.attrs,rowspan:s-m}),t.insert(t.mapping.slice(a).map(e.positionAt(s,b,n)),p.type.createAndFill({...p.attrs,rowspan:m+p.attrs.rowspan-s})),c+=p.attrs.colspan-1}}return l}function sm(t,e,n,r,o,i,s,a){if(s==0||s==e.width)return!1;let l=!1;for(let c=o;c<i;c++){const u=c*e.width+s,f=e.map[u];if(e.map[u-1]==f){l=!0;const p=n.nodeAt(f),m=e.colCount(f),b=t.mapping.slice(a).map(f+r);t.setNodeMarkup(b,null,_r(p.attrs,s-m,p.attrs.colspan-(s-m))),t.insert(b+p.nodeSize,p.type.createAndFill(_r(p.attrs,0,s-m))),c+=p.attrs.rowspan-1}}return l}function am(t,e,n,r,o){let i=n?t.doc.nodeAt(n-1):t.doc;if(!i)throw new Error("No table found");let s=Pe.get(i);const{top:a,left:l}=r,c=l+o.width,u=a+o.height,f=t.tr;let p=0;function m(){if(i=n?f.doc.nodeAt(n-1):f.doc,!i)throw new Error("No table found");s=Pe.get(i),p=f.mapping.maps.length}$v(f,s,i,n,c,u,p)&&m(),im(f,s,i,n,l,c,a,p)&&m(),im(f,s,i,n,l,c,u,p)&&m(),sm(f,s,i,n,a,u,l,p)&&m(),sm(f,s,i,n,a,u,c,p)&&m();for(let b=a;b<u;b++){const k=s.positionAt(b,l,i),_=s.positionAt(b,c,i);f.replace(f.mapping.slice(p).map(k+n),f.mapping.slice(p).map(_+n),new W(o.rows[b-a],0,0))}m(),f.setSelection(new Se(f.doc.resolve(n+s.positionAt(a,l,i)),f.doc.resolve(n+s.positionAt(u-1,c-1,i)))),e(f)}var Vv=ol({ArrowLeft:Bs("horiz",-1),ArrowRight:Bs("horiz",1),ArrowUp:Bs("vert",-1),ArrowDown:Bs("vert",1),"Shift-ArrowLeft":Fs("horiz",-1),"Shift-ArrowRight":Fs("horiz",1),"Shift-ArrowUp":Fs("vert",-1),"Shift-ArrowDown":Fs("vert",1),Backspace:Is,"Mod-Backspace":Is,Delete:Is,"Mod-Delete":Is});function Ds(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Bs(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;if(i instanceof Se)return Ds(n,r,ee.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const s=lm(o,t,e);if(s==null)return!1;if(t=="horiz")return Ds(n,r,ee.near(n.doc.resolve(i.head+e),e));{const a=n.doc.resolve(s),l=Gh(a,t,e);let c;return l?c=ee.near(l,1):e<0?c=ee.near(n.doc.resolve(a.before(-1)),-1):c=ee.near(n.doc.resolve(a.after(-1)),1),Ds(n,r,c)}}}function Fs(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let s;if(i instanceof Se)s=i;else{const l=lm(o,t,e);if(l==null)return!1;s=new Se(n.doc.resolve(l))}const a=Gh(s.$headCell,t,e);return a?Ds(n,r,new Se(s.$anchorCell,a)):!1}}function Hv(t,e){const n=t.state.doc,r=Zr(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Se(r))),!0):!1}function zv(t,e,n){if(!Wt(t.state))return!1;let r=Dv(n);const o=t.state.selection;if(o instanceof Se){r||(r={width:1,height:1,rows:[V.from(yc(Ze(t.state.schema).cell,n))]});const i=o.$anchorCell.node(-1),s=o.$anchorCell.start(-1),a=Pe.get(i).rectBetween(o.$anchorCell.pos-s,o.$headCell.pos-s);return r=Fv(r,a.right-a.left,a.bottom-a.top),am(t.state,t.dispatch,s,a,r),!0}else if(r){const i=Ps(t.state),s=i.start(-1);return am(t.state,t.dispatch,s,Pe.get(i.node(-1)).findCell(i.pos-s),r),!0}else return!1}function jv(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=cm(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof Se)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=Zr(t.state.selection.$anchor))!=null&&((n=wc(t,e))==null?void 0:n.pos)!=o.pos)i(o,e),e.preventDefault();else if(!r)return;function i(l,c){let u=wc(t,c);const f=Jn.getState(t.state)==null;if(!u||!bc(l,u))if(f)u=l;else return;const p=new Se(l,u);if(f||!t.state.selection.eq(p)){const m=t.state.tr.setSelection(p);f&&m.setMeta(Jn,l.pos),t.dispatch(m)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",a),Jn.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Jn,-1))}function a(l){const c=l,u=Jn.getState(t.state);let f;if(u!=null)f=t.state.doc.resolve(u);else if(cm(t,c.target)!=r&&(f=wc(t,e),!f))return s();f&&i(f,c)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",a)}function lm(t,e,n){if(!(t.state.selection instanceof te))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const a=r.before(o),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?a:null}}return null}function cm(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function wc(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Zr(t.state.doc.resolve(n.pos)):null}var Uv=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),kc(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,kc(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function kc(t,e,n,r,o,i){var s;let a=0,l=!0,c=e.firstChild;const u=t.firstChild;if(u){for(let f=0,p=0;f<u.childCount;f++){const{colspan:m,colwidth:b}=u.child(f).attrs;for(let k=0;k<m;k++,p++){const _=o==p?i:b&&b[k],E=_?_+"px":"";if(a+=_||r,_||(l=!1),c)c.style.width!=E&&(c.style.width=E),c=c.nextSibling;else{const N=document.createElement("col");N.style.width=E,e.appendChild(N)}}}for(;c;){const f=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=f}l?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}var Tt=new Ue("tableColumnResizing");function Wv({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=Uv,lastColumnResizable:o=!0}={}){const i=new $e({key:Tt,state:{init(s,a){var l,c;const u=(c=(l=i.spec)==null?void 0:l.props)==null?void 0:c.nodeViews,f=Ze(a.schema).table.name;return r&&u&&(u[f]=(p,m)=>new r(p,n,m)),new Kv(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{const a=Tt.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{qv(s,a,t,o)},mouseleave:s=>{Gv(s)},mousedown:(s,a)=>{Jv(s,a,e,n)}},decorations:s=>{const a=Tt.getState(s);if(a&&a.activeHandle>-1)return eC(s,a.activeHandle)},nodeViews:{}}});return i}var Kv=class ha{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(Tt);if(r&&r.setHandle!=null)return new ha(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new ha(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return gc(e.doc.resolve(o))||(o=-1),new ha(o,n.dragging)}return n}};function qv(t,e,n,r){if(!t.editable)return;const o=Tt.getState(t.state);if(o&&!o.dragging){const i=Xv(e.target);let s=-1;if(i){const{left:a,right:l}=i.getBoundingClientRect();e.clientX-a<=n?s=um(t,e,"left",n):l-e.clientX<=n&&(s=um(t,e,"right",n))}if(s!=o.activeHandle){if(!r&&s!==-1){const a=t.state.doc.resolve(s),l=a.node(-1),c=Pe.get(l),u=a.start(-1);if(c.colCount(a.pos-u)+a.nodeAfter.attrs.colspan-1==c.width-1)return}fm(t,s)}}}function Gv(t){if(!t.editable)return;const e=Tt.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&fm(t,-1)}function Jv(t,e,n,r){var o;if(!t.editable)return!1;const i=(o=t.dom.ownerDocument.defaultView)!=null?o:window,s=Tt.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const a=t.state.doc.nodeAt(s.activeHandle),l=Yv(t,s.activeHandle,a.attrs);t.dispatch(t.state.tr.setMeta(Tt,{setDragging:{startX:e.clientX,startWidth:l}}));function c(f){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",u);const p=Tt.getState(t.state);p?.dragging&&(Qv(t,p.activeHandle,dm(p.dragging,f,n)),t.dispatch(t.state.tr.setMeta(Tt,{setDragging:null})))}function u(f){if(!f.which)return c(f);const p=Tt.getState(t.state);if(p&&p.dragging){const m=dm(p.dragging,f,n);pm(t,p.activeHandle,m,r)}}return pm(t,s.activeHandle,l,r),i.addEventListener("mouseup",c),i.addEventListener("mousemove",u),e.preventDefault(),!0}function Yv(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=t.domAtPos(e);let a=i.node.childNodes[i.offset].offsetWidth,l=n;if(r)for(let c=0;c<n;c++)r[c]&&(a-=r[c],l--);return a/l}function Xv(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function um(t,e,n,r){const o=n=="right"?-r:r,i=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!i)return-1;const{pos:s}=i,a=Zr(t.state.doc.resolve(s));if(!a)return-1;if(n=="right")return a.pos;const l=Pe.get(a.node(-1)),c=a.start(-1),u=l.map.indexOf(a.pos-c);return u%l.width==0?-1:c+l.map[u-1]}function dm(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function fm(t,e){t.dispatch(t.state.tr.setMeta(Tt,{setHandle:e}))}function Qv(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),i=Pe.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let c=0;c<i.height;c++){const u=c*i.width+a;if(c&&i.map[u]==i.map[u-i.width])continue;const f=i.map[u],p=o.nodeAt(f).attrs,m=p.colspan==1?0:a-i.colCount(f);if(p.colwidth&&p.colwidth[m]==n)continue;const b=p.colwidth?p.colwidth.slice():Zv(p.colspan);b[m]=n,l.setNodeMarkup(s+f,null,{...p,colwidth:b})}l.docChanged&&t.dispatch(l)}function pm(t,e,n,r){const o=t.state.doc.resolve(e),i=o.node(-1),s=o.start(-1),a=Pe.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;let l=t.domAtPos(o.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&kc(i,l.firstChild,l,r,a,n)}function Zv(t){return Array(t).fill(0)}function eC(t,e){var n;const r=[],o=t.doc.resolve(e),i=o.node(-1);if(!i)return Le.empty;const s=Pe.get(i),a=o.start(-1),l=s.colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=l+c*s.width;if((l==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){const f=s.map[u],p=a+f+i.nodeAt(f).nodeSize-1,m=document.createElement("div");m.className="column-resize-handle",(n=Tt.getState(t))!=null&&n.dragging&&r.push(lt.node(a+f,a+f+i.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),r.push(lt.widget(p,m))}}return Le.create(t.doc,r)}function tC({allowTableNodeSelection:t=!1}={}){return new $e({key:Jn,state:{init(){return null},apply(e,n){const r=e.getMeta(Jn);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:i}=e.mapping.mapResult(n);return o?null:i}},props:{decorations:hv,handleDOMEvents:{mousedown:jv},createSelectionBetween(e){return Jn.getState(e.state)!=null?e.state.selection:null},handleTripleClick:Hv,handleKeyDown:Vv,handlePaste:zv},appendTransaction(e,n,r){return bv(r,Xh(r,n),t)}})}function _c(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function hm(t,e,n,r,o,i){var s;let a=0,l=!0,c=e.firstChild;const u=t.firstChild;if(u!==null)for(let f=0,p=0;f<u.childCount;f+=1){const{colspan:m,colwidth:b}=u.child(f).attrs;for(let k=0;k<m;k+=1,p+=1){const _=o===p?i:b&&b[k],E=_?`${_}px`:"";if(a+=_||r,_||(l=!1),c){if(c.style.width!==E){const[N,A]=_c(r,_);c.style.setProperty(N,A)}c=c.nextSibling}else{const N=document.createElement("col"),[A,d]=_c(r,_);N.style.setProperty(A,d),e.appendChild(N)}}}for(;c;){const f=c.nextSibling;(s=c.parentNode)===null||s===void 0||s.removeChild(c),c=f}l?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}class nC{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),hm(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,hm(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function rC(t,e,n,r){let o=0,i=!0;const s=[],a=t.firstChild;if(!a)return{};for(let f=0,p=0;f<a.childCount;f+=1){const{colspan:m,colwidth:b}=a.child(f).attrs;for(let k=0;k<m;k+=1,p+=1){const _=n===p?r:b&&b[k];o+=_||e,_||(i=!1);const[E,N]=_c(e,_);s.push(["col",{style:`${E}: ${N}`}])}}const l=i?`${o}px`:"",c=i?"":`${o}px`;return{colgroup:["colgroup",{},...s],tableWidth:l,tableMinWidth:c}}function mm(t,e){return t.createAndFill()}function oC(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function iC(t,e,n,r,o){const i=oC(t),s=[],a=[];for(let c=0;c<n;c+=1){const u=mm(i.cell);if(u&&a.push(u),r){const f=mm(i.header_cell);f&&s.push(f)}}const l=[];for(let c=0;c<e;c+=1)l.push(i.row.createChecked(null,r&&c===0?s:a));return i.table.createChecked(null,l)}function sC(t){return t instanceof Se}const $s=({editor:t})=>{const{selection:e}=t.state;if(!sC(e))return!1;let n=0;const r=sp(e.ranges[0].$from,i=>i.type.name==="table");return r?.node.descendants(i=>{if(i.type.name==="table")return!1;["tableCell","tableHeader"].includes(i.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},gm=ct.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:nC,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:o}=rC(t,this.options.cellMinWidth);return["table",Ce(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:i})=>{const s=iC(i.schema,t,e,n);if(o){const a=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(te.near(r.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>kv(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>_v(t,e),deleteColumn:()=>({state:t,dispatch:e})=>vv(t,e),addRowBefore:()=>({state:t,dispatch:e})=>Sv(t,e),addRowAfter:()=>({state:t,dispatch:e})=>Tv(t,e),deleteRow:()=>({state:t,dispatch:e})=>Av(t,e),deleteTable:()=>({state:t,dispatch:e})=>Iv(t,e),mergeCells:()=>({state:t,dispatch:e})=>tm(t,e),splitCell:()=>({state:t,dispatch:e})=>nm(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Xo("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Xo("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>Rv(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>tm(t,e)?!0:nm(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>xv(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>om(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>om(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Xh(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=Se.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:$s,"Mod-Backspace":$s,Delete:$s,"Mod-Delete":$s}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Wv({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],tC({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:ie(J(t,"tableRole",e))}}}),bm=Ke.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign||this.options.defaultAlignment;return this.options.alignments.includes(e)?e: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.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},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")}}}),ym=ct.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",Ce(this.options.HTMLAttributes,t),0]}}),wm=ct.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",Ce(this.options.HTMLAttributes,t),0]}}),km=ct.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",Ce(this.options.HTMLAttributes,t),0]}}),_m=ct.create({name:"doc",topNode:!0,content:"block+"});class Ie extends ee{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ie.valid(r)?new Ie(r):ee.near(r)}content(){return W.empty}eq(e){return e instanceof Ie&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ie(e.resolve(n.pos))}getBookmark(){return new Ec(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!aC(e)||!lC(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ie.valid(e))return e;let o=e.pos,i=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){i=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;o+=n;let l=e.doc.resolve(o);if(Ie.valid(l))return l}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!Q.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let a=e.doc.resolve(o);if(Ie.valid(a))return a}return null}}}Ie.prototype.visible=!1,Ie.findFrom=Ie.findGapCursorFrom,ee.jsonID("gapcursor",Ie);class Ec{constructor(e){this.pos=e}map(e){return new Ec(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ie.valid(n)?new Ie(n):ee.near(n)}}function aC(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function lC(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function cC(){return new $e({props:{decorations:pC,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ie.valid(n)?new Ie(n):null},handleClick:dC,handleKeyDown:uC,handleDOMEvents:{beforeinput:fC}}})}const uC=ol({ArrowLeft:Vs("horiz",-1),ArrowRight:Vs("horiz",1),ArrowUp:Vs("vert",-1),ArrowDown:Vs("vert",1)});function Vs(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,i){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof te){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=Ie.findGapCursorFrom(a,e,l);return c?(o&&o(r.tr.setSelection(new Ie(c))),!0):!1}}function dC(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ie.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Q.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ie(r))),!0)}function fC(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ie))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=V.empty;for(let s=r.length-1;s>=0;s--)o=V.from(r[s].createAndFill(null,o));let i=t.state.tr.replace(n.pos,n.pos,new W(o,0,0));return i.setSelection(te.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function pC(t){if(!(t.selection instanceof Ie))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Le.create(t.doc,[lt.widget(t.selection.head,e,{key:"gapcursor"})])}const Em=Ke.create({name:"gapCursor",addProseMirrorPlugins(){return[cC()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ie(J(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),vm=ct.create({name:"text",group:"inline"}),Cm=Ke.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),et=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},hC={props:{editor:Object},methods:{toggleBlockquote(){this.editor&&this.editor.chain().toggleBlockquote().run()}}};function mC(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("button",{onClick:e[0]||(e[0]=(...s)=>i.toggleBlockquote&&i.toggleBlockquote(...s)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[y.createElementVNode("path",{"fill-rule":"evenodd",d:"M6 6a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3H5a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2H6Zm9 0a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h3a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1a5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3Z"})],-1)]))}const gC=et(hC,[["render",mC]]),bC={props:{editor:Object},methods:{toggleBulletList(){this.editor&&this.editor.chain().focus().toggleBulletList().run()}}};function yC(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("button",{onClick:e[0]||(e[0]=(...s)=>i.toggleBulletList&&i.toggleBulletList(...s)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 8h10M9 12h10M9 16h10M4.99 8H5m-.02 4h.01m0 4H5"})],-1)]))}const wC=et(bC,[["render",yC]]),kC={props:{editor:Object},methods:{toggleOrderedList(){this.editor&&this.editor.chain().focus().toggleOrderedList().run()}}};function _C(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("button",{onClick:e[0]||(e[0]=(...s)=>i.toggleOrderedList&&i.toggleOrderedList(...s)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},e[1]||(e[1]=[y.createElementVNode("svg",{height:"16",width:"16",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6h8m-8 6h8m-8 6h8M4 16a2 2 0 1 1 3.321 1.5L4 20h5M4 5l2-1v6m-2 0h4"})],-1)]))}const EC=et(kC,[["render",_C]]),vC={props:{editor:Object},methods:{toggleCodeBlock(){this.editor&&this.editor.chain().focus().toggleCodeBlock().run()}}};function CC(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("button",{onClick:e[0]||(e[0]=(...s)=>i.toggleCodeBlock&&i.toggleCodeBlock(...s)),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100"},e[1]||(e[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8 8-4 4 4 4m8 0 4-4-4-4m-2-3-4 14"})],-1)]))}const SC=et(vC,[["render",CC]]),TC={props:{editor:Object},methods:{toggleBold(){this.editor&&this.editor.chain().toggleBold().run()}}};function NC(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("button",{onClick:e[0]||(e[0]=(...s)=>i.toggleBold&&i.toggleBold(...s)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":n.editor?.isActive("bold")}])},e[1]||(e[1]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 5h4.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0-7H6m2 7h6.5a3.5 3.5 0 1 1 0 7H8m0-7v7m0 0H6"})],-1),y.createElementVNode("span",{class:"sr-only"},"Bold",-1)]),2)}const AC=et(TC,[["render",NC]]),OC={props:{editor:Object},methods:{toggleItalic(){this.editor&&this.editor.chain().toggleItalic().run()}}};function MC(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("button",{onClick:e[0]||(e[0]=(...s)=>i.toggleItalic&&i.toggleItalic(...s)),class:y.normalizeClass(["h-[30px] w-[30px] flex items-center justify-center text-gray-500 rounded-full cursor-pointer hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":n.editor?.isActive("italic")}])},e[1]||(e[1]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m8.874 19 6.143-14M6 19h6.33m-.66-14H18"})],-1),y.createElementVNode("span",{class:"sr-only"},"Italic",-1)]),2)}const xC=et(OC,[["render",MC]]),Qo=async(t,e,n,r=10)=>{if(!e||!n)return;await y.nextTick();const o=await n?.getBoundingClientRect(),i=await e?.getBoundingClientRect();if(!i||!o)return;const s=await parseInt(e?.getBoundingClientRect()?.height),a=await parseInt(e?.getBoundingClientRect()?.width),l=await parseInt(n?.getBoundingClientRect()?.height),c=await parseInt(n?.getBoundingClientRect()?.width),u=await window.innerHeight,f=await window.innerWidth;let p=0,m=0;const b=i.bottom+r+l;switch(t){case"top":i.top-o.height-r<0?p=i.top-o.height+r+l+s:p=i.top-o.height-r,f>c+i.right+30?m=i.left-o.width/2+i.width/2:m=f-30-c;break;case"bottom":u>b?p=i.bottom+r:p=i.bottom-r-l-s,m=i.left-o.width/2+i.width/2;break;case"left":p=i.top-o.height/2+i.height/2,i.left-o.width-r>0?m=i.left-o.width-r:m=10;break;case"right":p=i.top-o.height/2+i.height/2,f-a>c?m=i.right+r:m=f-30-c;break;case"top-right":i.top-o.height-r<0?p=i.top-o.height+r+l+s:p=i.top-o.height-r,f-a>c?m=i.right+r:m=f-30-c;break;case"top-left":i.top-o.height-r<0?p=i.top-o.height+r+l+s:p=i.top-o.height-r,i.left-o.width-r>0?m=i.left-o.width-r:m=10;break;case"top-start":i.top-o.height-r<0?p=i.top-o.height+r+l+s:p=i.top-o.height-r,i.left>0?m=i.left:m=10;break;case"bottom-right":u>b?p=i.bottom+r:p=i.bottom-r-l-s,f-a>c?m=i.left:m=f-30-c;break;case"bottom-left":u>b?p=i.bottom+r:p=i.bottom-r-l-s,i.left>0?m=i.right-c:m=10;break;case"bottom-start":u>b?p=i.bottom+r:p=i.bottom-r-l-s,i.left>0?m=i.left:m=10;break}p+l>u?p=u-l-r:p<0&&(p=r),m+c>f?m=f-c-r:m<0&&(m=r),n instanceof HTMLElement&&(n.style.top=`${p}px`,n.style.left=`${m}px`,n.style.position="fixed")},LC={class:"text-center"},RC={class:"py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},Zo={__name:"vs-popover",props:{isOpen:{type:Boolean,default:()=>!1},placement:{type:String,default:"top"},gap:{type:Number,default:8},width:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},trigger:{type:String,default:"click"},teleport:{type:String,default:"#modal"}},emits:["isvisible"],setup(t,{expose:e,emit:n}){const r=t,o=n,i=y.ref(!1),s=y.ref([]),a=y.ref(null),l=y.ref(null),c=y.ref(null);y.watch(i,A=>{A?(u(),window.addEventListener("resize",()=>Qo(r.placement,l.value,c.value)),Qo(r.placement,l.value,c.value)):window.removeEventListener("resize",()=>Qo(r.placement,l.value,c.value)),o("isvisible",A)}),y.onMounted(()=>{window.addEventListener("click",_),window.addEventListener("popstate",E),window.addEventListener("scroll",N,!0),u()}),y.onBeforeUnmount(()=>{window.removeEventListener("click",_),window.removeEventListener("popstate",E),f()});const u=()=>{let A=a.value;for(;A&&A!==document.body;)(A.scrollHeight>A.clientHeight||A.scrollWidth>A.clientWidth)&&(A.addEventListener("scroll",k),s.value.push(A)),A=A.parentElement;document.body&&(document.body.addEventListener("scroll",k),s.value.push(document.body))},f=()=>{s.value.forEach(A=>{A.removeEventListener("scroll",k)}),s.value=[]},p=()=>{i.value=!0,Qo(r.placement,l.value,c.value)},m=()=>{i.value=!1},b=async()=>{await Qo(r.placement,l.value,c.value),i.value=!i.value},k=()=>{i.value=!1},_=A=>{if(!A){i.value=!1;return}l.value?.contains(A.target)||c.value?.contains(A.target)||(i.value=!1)},E=()=>{i.value&&(i.value=!1)},N=A=>{i.value&&c.value&&!c.value.contains(A.target)&&(i.value=!1)};return e({togglePopover:b}),(A,d)=>(y.openBlock(),y.createElementBlock("div",{ref_key:"popover",ref:a,class:"vs-popover inline-block"},[y.createElementVNode("div",LC,[t.trigger==="click"?(y.openBlock(),y.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:l,onClick:b,class:y.normalizeClass({"pointer-events-none":t.disabled})},[y.renderSlot(A.$slots,"reference",{},()=>[d[0]||(d[0]=y.createElementVNode("button",null,"Click me!",-1))])],2)):y.createCommentVNode("",!0),t.trigger==="hover"?(y.openBlock(),y.createElementBlock("div",{key:1,ref_key:"popoverRef",ref:l,onMouseover:p,onMouseleave:m,class:y.normalizeClass({"pointer-events-none":t.disabled})},[y.renderSlot(A.$slots,"reference",{},()=>[d[1]||(d[1]=y.createElementVNode("button",null,"Click me!",-1))])],34)):y.createCommentVNode("",!0),(y.openBlock(),y.createBlock(y.Teleport,{to:t.teleport},[y.createVNode(y.Transition,{name:"fade"},{default:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["vsTailwind vs-popover__content",t.placement]),ref_key:"contentPop",ref:c,style:y.normalizeStyle({width:t.width?t.width+"px":"fit-content",zIndex:10002})},[y.createElementVNode("div",RC,[y.renderSlot(A.$slots,"default",{},()=>[d[2]||(d[2]=y.createElementVNode("span",null,"Popover content",-1))])])],6),[[y.vShow,i.value]])]),_:3})],8,["to"]))])],512))}},PC={class:"w-[30px] h-[30px] rounded-full hover:bg-gray-100 justify-center items-center relative flex"},IC={class:"flex w-[160px] flex-wrap gap-[4px]"},DC=["onClick"],BC={__name:"vs-editor-color",props:{editor:Object},setup(t){const e=t,n=y.ref("popover"),r=y.ref("#000000"),o=y.ref(["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]),i=s=>{e.editor&&(e.editor.chain().focus().setColor(s).run(),r.value=s,n.value&&n.value.togglePopover())};return(s,a)=>(y.openBlock(),y.createBlock(Zo,{ref_key:"popover",ref:n,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",PC,[a[0]||(a[0]=y.createElementVNode("svg",{class:"text-gray-500",height:"16",width:"16","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 19.2H5.5c-.3 0-.5-.2-.5-.5V16c0-.2.2-.4.5-.4h13c.3 0 .5.2.5.4v2.7c0 .3-.2.5-.5.5H18m-6-1 1.4 1.8h.2l1.4-1.7m-7-5.4L12 4c0-.1 0-.1 0 0l4 8.8m-6-2.7h4m-7 2.7h2.5m5 0H17"})],-1)),y.createElementVNode("span",{class:"absolute h-[2px] w-[40%] bottom-[10px] left-[9px]",style:y.normalizeStyle({backgroundColor:r.value})},null,4)])]),default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createElementVNode("ul",IC,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(o.value,l=>(y.openBlock(),y.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:y.normalizeStyle({backgroundColor:l}),onClick:c=>i(l),key:l},null,12,DC))),128))])])]),_:1},512))}},FC={__name:"vs-editor-underline",props:{editor:Object},setup(t){const e=t,n=()=>{e.editor&&e.editor.chain().focus().toggleUnderline().run()};return(r,o)=>(y.openBlock(),y.createElementBlock("button",{onClick:n,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[t.editor?.isActive("underline")?"bg-gray-100 text-gray-900":"text-gray-500"]])},o[0]||(o[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M6 4v6a6 6 0 0 0 12 0V4"}),y.createElementVNode("line",{x1:"4",x2:"20",y1:"20",y2:"20"})],-1)]),2))}},$C={__name:"vs-editor-strike",props:{editor:Object},setup(t){const e=t,n=()=>{e.editor&&e.editor.chain().focus().toggleStrike().run()};return(r,o)=>(y.openBlock(),y.createElementBlock("button",{onClick:n,class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100",[t.editor?.isActive("strike")?"bg-gray-100 text-gray-900":"text-gray-500"]])},o[0]||(o[0]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-strikethrough"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M5 12l14 0"}),y.createElementVNode("path",{d:"M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5"})],-1)]),2))}},VC={props:{visible:{type:Boolean,default:()=>!1},title:{type:String,default:()=>""},size:{type:String,default:()=>""},closeClickBack:{type:Boolean,default:()=>!1}},emits:["update:visible","onClose"],name:"vs-dialog",mounted(){window.addEventListener("keydown",this.checkKey)},unmounted(){window.removeEventListener("keydown",this.checkKey)},computed:{hasSlot(){return!!this.$slots?.footer},checkSize(){return this.size==="small"?"md:w-5/12 w-9/12":this.size==="medium"?"md:w-6/12 w-9/12":"lg:w-7/12 w-11/12"}},methods:{checkKey({key:t}){t==="Escape"&&this.handleClose()},handleClose(){this.$emit("update:visible",!1),this.$emit("onClose")},closeByClickBack(t,e){e&&t.target.classList.contains("vs-dialog-overlay")&&this.handleClose()}}},HC={key:0,class:"vsTailwind ui-dialog__wrapper"},zC={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},jC={class:"font-medium text-gray-800 dark:text-[#ffffff]"},UC={class:"ui-dialog__content p-4"},WC={key:0,class:"flex justify-end gap-x-2"};function KC(t,e,n,r,o,i){return y.openBlock(),y.createBlock(y.Teleport,{to:"#modal"},[n.visible?(y.openBlock(),y.createElementBlock("div",HC,[y.createElementVNode("div",{onMousedown:e[1]||(e[1]=s=>i.closeByClickBack(s,n.closeClickBack)),class:"vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[80] bg-black bg-opacity-50"},[y.createVNode(y.Transition,{name:"content",appear:""},{default:y.withCtx(()=>[y.createElementVNode("div",{class:y.normalizeClass(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl",[i.checkSize]])},[y.createElementVNode("div",zC,[y.createElementVNode("h3",jC,y.toDisplayString(n.title),1),y.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",onClick:e[0]||(e[0]=(...s)=>i.handleClose&&i.handleClose(...s))},e[2]||(e[2]=[y.createElementVNode("span",{class:"sr-only"},"Close",-1),y.createElementVNode("svg",{class:"flex-shrink-0 w-4 h-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[y.createElementVNode("path",{d:"M18 6 6 18"}),y.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),y.createElementVNode("div",UC,[y.renderSlot(t.$slots,"default",{},void 0,!0)]),i.hasSlot?(y.openBlock(),y.createElementBlock("div",WC,[y.renderSlot(t.$slots,"footer",{handleClose:i.handleClose},void 0,!0)])):y.createCommentVNode("",!0)],2)]),_:3})],32)])):y.createCommentVNode("",!0)])}const qC=et(VC,[["render",KC],["__scopeId","data-v-6d4e684d"]]),GC={},JC={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x"};function YC(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("svg",JC,e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),y.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const XC=et(GC,[["render",YC]]),QC={},ZC={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search"};function eS(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("svg",ZC,e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),y.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const tS=et(QC,[["render",eS]]),nS={},rS={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-mail"};function oS(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("svg",rS,e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"},null,-1),y.createElementVNode("path",{d:"M3 7l9 6l9 -6"},null,-1)]))}const iS=et(nS,[["render",oS]]),sS=y.defineComponent({components:{IconClose:XC,IconSearch:tS,IconEmail:iS},props:{icon:{type:String,default:()=>""},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},modelValue:{type:String,default:()=>""},placeholder:{type:String,default:()=>""},iconPosition:{type:String,default:()=>"right"},type:{type:String,default:()=>"text"},style:{type:Object,default:()=>null},size:{type:String,default:()=>"md"},attrs:{type:Object,default:()=>{}}},emits:["onInput","update:modelValue","blur","focus"],computed:{checkSize(){if((this.style?.size||this.size)==="xs")return"h-[32px] text-sm";if((this.style?.size||this.size)==="md")return"h-[38px] text-sm";this.style?.size||this.size},value:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t.trim())}},clearIconStyle(){return[{"right-8":this.icon&&this.iconPosition==="right","right-3":!this.icon||this.iconPosition!=="right","pointer-events-none":this.disabled}]},iconStylePosition(){return[{"left-3":this.icon&&this.iconPosition==="left","right-3":this.icon&&this.iconPosition==="right"}]},inputStyle(){return[{"!pr-8":this.clearable&&!this.icon,"!pr-7":this.clearable,"!pr-16":this.clearable&&this.icon&&this.iconPosition==="right","!pl-8":this.icon&&this.iconPosition==="left","!pr-[50px]":this.clearable&&this.value&&this.icon&&this.iconPosition==="right","!cursor-not-allowed bg-slate-100":this.disabled,"bg-white":!this.disabled}]}},methods:{handleInput(){this.$emit("onInput",this.modelValue)},handleBlur(){this.$emit("blur")},handleFocus(){this.$emit("focus")},clearInput(){this.$emit("update:modelValue",""),this.$emit("onInput","")},async inputFocus(){const{vsText:t}=await this.$refs;await t.focus()}}}),aS={class:"vs-form-text relative bg-white rounded-lg"},lS={key:2,class:"absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"},cS=["disabled","type","placeholder"];function uS(t,e,n,r,o,i){const s=y.resolveComponent("IconClose"),a=y.resolveComponent("IconSearch"),l=y.resolveComponent("IconEmail");return y.openBlock(),y.createElementBlock("div",aS,[t.clearable&&t.value?(y.openBlock(),y.createElementBlock("div",{key:0,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[0]||(e[0]=(...c)=>t.clearInput&&t.clearInput(...c))},[y.createVNode(s,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):y.createCommentVNode("",!0),t.icon&&t.icon==="search"?(y.openBlock(),y.createElementBlock("div",{key:1,class:y.normalizeClass(["absolute bottom-2/4 translate-y-2/4 cursor-pointer",t.iconStylePosition])},[y.createVNode(a,{width:"15px",height:"15px",class:"stroke-gray-500 transition-all"})],2)):t.icon&&t.icon==="email"?(y.openBlock(),y.createElementBlock("div",lS,[y.createVNode(l,{width:"16",height:"16",class:"stroke-gray-500 transition-all"})])):(y.openBlock(),y.createElementBlock("i",{key:3,class:y.normalizeClass(["absolute bottom-2/4 translate-y-2/4 text-gray-500 cursor-pointer",["ti "+t.icon,t.iconStylePosition]])},null,2)),t.clearable&&t.value?(y.openBlock(),y.createElementBlock("div",{key:4,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",onClick:e[1]||(e[1]=(...c)=>t.clearInput&&t.clearInput(...c))},[y.createVNode(s,{width:"15px",height:"15px",class:"stroke-gray-500 hover:stroke-red-500 transition-all"})])):y.createCommentVNode("",!0),y.withDirectives(y.createElementVNode("input",y.mergeProps({ref:"vsText",disabled:t.disabled,type:t.type,onInput:e[2]||(e[2]=(...c)=>t.handleInput&&t.handleInput(...c)),placeholder:t.placeholder,"onUpdate:modelValue":e[3]||(e[3]=c=>t.value=c)},t.style?.attrs||t.attrs||{},{onFocus:e[4]||(e[4]=(...c)=>t.handleFocus&&t.handleFocus(...c)),onBlur:e[5]||(e[5]=(...c)=>t.handleBlur&&t.handleBlur(...c)),class:[[t.inputStyle,t.checkSize],"py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"]}),null,16,cS),[[y.vModelDynamic,t.value]])])}const Sm=et(sS,[["render",uS],["__scopeId","data-v-00f5150b"]]);/*!
118
118
  * shared v11.1.7
119
119
  * (c) 2025 kazuya kawaguchi
120
120
  * Released under the MIT License.
121
- */const $t=typeof window<"u";let bt,kr;if(process.env.NODE_ENV!=="production"){const t=$t&&window.performance;t&&t.mark&&t.measure&&t.clearMarks&&t.clearMeasures&&(bt=e=>{t.mark(e)},kr=(e,n,r)=>{t.measure(e,n,r),t.clearMarks(n),t.clearMarks(r)})}const $v=/\{([0-9a-zA-Z]+)\}/g;function Vi(t,...e){return e.length===1&&te(e[0])&&(e=e[0]),(!e||!e.hasOwnProperty)&&(e={}),t.replace($v,(n,r)=>e.hasOwnProperty(r)?e[r]:"")}const tn=(t,e=!1)=>e?Symbol.for(t):Symbol(t),Vv=(t,e,n)=>Hv({l:t,k:e,s:n}),Hv=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),_e=t=>typeof t=="number"&&isFinite(t),Uv=t=>Ec(t)==="[object Date]",Zr=t=>Ec(t)==="[object RegExp]",Hi=t=>X(t)&&Object.keys(t).length===0,Re=Object.assign,zv=Object.create,le=(t=null)=>zv(t);let Fh;const Cr=()=>Fh||(Fh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:le());function $h(t){return t.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const jv=Object.prototype.hasOwnProperty;function Vt(t,e){return jv.call(t,e)}const be=Array.isArray,ue=t=>typeof t=="function",B=t=>typeof t=="string",ne=t=>typeof t=="boolean",te=t=>t!==null&&typeof t=="object",Wv=t=>te(t)&&ue(t.then)&&ue(t.catch),Vh=Object.prototype.toString,Ec=t=>Vh.call(t),X=t=>Ec(t)==="[object Object]",Kv=t=>t==null?"":be(t)||X(t)&&t.toString===Vh?JSON.stringify(t,null,2):String(t);function wc(t,e=""){return t.reduce((n,r,o)=>o===0?n+r:n+e+r,"")}const Hh=2;function qv(t,e=0,n=t.length){const r=t.split(/\r?\n/);let o=0;const s=[];for(let i=0;i<r.length;i++)if(o+=r[i].length+1,o>=e){for(let l=i-Hh;l<=i+Hh||n>o;l++){if(l<0||l>=r.length)continue;const a=l+1;s.push(`${a}${" ".repeat(3-String(a).length)}| ${r[l]}`);const c=r[l].length;if(l===i){const u=e-(o-c)+1,d=Math.max(1,n>o?c-u:n-e);s.push(" | "+" ".repeat(u)+"^".repeat(d))}else if(l>i){if(n>o){const u=Math.max(Math.min(n-o,c),1);s.push(" | "+"^".repeat(u))}o+=c+1}}break}return s.join(`
122
- `)}function Jn(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const Uh={};function kc(t){Uh[t]||(Uh[t]=!0,Jn(t))}function Cc(){const t=new Map;return{events:t,on(n,r){const o=t.get(n);o&&o.push(r)||t.set(n,[r])},off(n,r){const o=t.get(n);o&&o.splice(o.indexOf(r)>>>0,1)},emit(n,r){(t.get(n)||[]).slice().map(o=>o(r)),(t.get("*")||[]).slice().map(o=>o(n,r))}}}const Ui=t=>!te(t)||be(t);function zi(t,e){if(Ui(t)||Ui(e))throw new Error("Invalid value");const n=[{src:t,des:e}];for(;n.length;){const{src:r,des:o}=n.pop();Object.keys(r).forEach(s=>{s!=="__proto__"&&(te(r[s])&&!te(o[s])&&(o[s]=Array.isArray(r[s])?[]:le()),Ui(o[s])||Ui(r[s])?o[s]=r[s]:n.push({src:r[s],des:o[s]}))})}}/*!
121
+ */const Kt=typeof window<"u";let Nt,Er;if(process.env.NODE_ENV!=="production"){const t=Kt&&window.performance;t&&t.mark&&t.measure&&t.clearMarks&&t.clearMeasures&&(Nt=e=>{t.mark(e)},Er=(e,n,r)=>{t.measure(e,n,r),t.clearMarks(n),t.clearMarks(r)})}const dS=/\{([0-9a-zA-Z]+)\}/g;function Hs(t,...e){return e.length===1&&ue(e[0])&&(e=e[0]),(!e||!e.hasOwnProperty)&&(e={}),t.replace(dS,(n,r)=>e.hasOwnProperty(r)?e[r]:"")}const an=(t,e=!1)=>e?Symbol.for(t):Symbol(t),fS=(t,e,n)=>pS({l:t,k:e,s:n}),pS=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Ve=t=>typeof t=="number"&&isFinite(t),hS=t=>vc(t)==="[object Date]",eo=t=>vc(t)==="[object RegExp]",zs=t=>ae(t)&&Object.keys(t).length===0,He=Object.assign,mS=Object.create,be=(t=null)=>mS(t);let Tm;const vr=()=>Tm||(Tm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:be());function Nm(t){return t.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const gS=Object.prototype.hasOwnProperty;function qt(t,e){return gS.call(t,e)}const xe=Array.isArray,Ee=t=>typeof t=="function",K=t=>typeof t=="string",de=t=>typeof t=="boolean",ue=t=>t!==null&&typeof t=="object",bS=t=>ue(t)&&Ee(t.then)&&Ee(t.catch),Am=Object.prototype.toString,vc=t=>Am.call(t),ae=t=>vc(t)==="[object Object]",yS=t=>t==null?"":xe(t)||ae(t)&&t.toString===Am?JSON.stringify(t,null,2):String(t);function Cc(t,e=""){return t.reduce((n,r,o)=>o===0?n+r:n+e+r,"")}const Om=2;function wS(t,e=0,n=t.length){const r=t.split(/\r?\n/);let o=0;const i=[];for(let s=0;s<r.length;s++)if(o+=r[s].length+1,o>=e){for(let a=s-Om;a<=s+Om||n>o;a++){if(a<0||a>=r.length)continue;const l=a+1;i.push(`${l}${" ".repeat(3-String(l).length)}| ${r[a]}`);const c=r[a].length;if(a===s){const u=e-(o-c)+1,f=Math.max(1,n>o?c-u:n-e);i.push(" | "+" ".repeat(u)+"^".repeat(f))}else if(a>s){if(n>o){const u=Math.max(Math.min(n-o,c),1);i.push(" | "+"^".repeat(u))}o+=c+1}}break}return i.join(`
122
+ `)}function Yn(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const Mm={};function Sc(t){Mm[t]||(Mm[t]=!0,Yn(t))}function Tc(){const t=new Map;return{events:t,on(n,r){const o=t.get(n);o&&o.push(r)||t.set(n,[r])},off(n,r){const o=t.get(n);o&&o.splice(o.indexOf(r)>>>0,1)},emit(n,r){(t.get(n)||[]).slice().map(o=>o(r)),(t.get("*")||[]).slice().map(o=>o(n,r))}}}const js=t=>!ue(t)||xe(t);function Us(t,e){if(js(t)||js(e))throw new Error("Invalid value");const n=[{src:t,des:e}];for(;n.length;){const{src:r,des:o}=n.pop();Object.keys(r).forEach(i=>{i!=="__proto__"&&(ue(r[i])&&!ue(o[i])&&(o[i]=Array.isArray(r[i])?[]:be()),js(o[i])||js(r[i])?o[i]=r[i]:n.push({src:r[i],des:o[i]}))})}}/*!
123
123
  * message-compiler v11.1.7
124
124
  * (c) 2025 kazuya kawaguchi
125
125
  * Released under the MIT License.
126
- */function Jv(t,e,n){return{line:t,column:e,offset:n}}function Sc(t,e,n){return{start:t,end:e}}const W={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},Gv=17,Yv={[W.EXPECTED_TOKEN]:"Expected token: '{0}'",[W.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[W.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[W.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[W.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[W.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[W.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[W.EMPTY_PLACEHOLDER]:"Empty placeholder",[W.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[W.INVALID_LINKED_FORMAT]:"Invalid linked format",[W.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[W.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[W.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[W.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[W.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[W.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function eo(t,e,n={}){const{domain:r,messages:o,args:s}=n,i=process.env.NODE_ENV!=="production"?Vi((o||Yv)[t]||"",...s||[]):t,l=new SyntaxError(String(i));return l.code=t,e&&(l.location=e),l.domain=r,l}function Xv(t){throw t}const Qv=/<\/?[\w\s="/.':;#-\/]+>/,Zv=t=>Qv.test(t),kn=" ",ex="\r",Ze=`
127
- `,tx="\u2028",nx="\u2029";function rx(t){const e=t;let n=0,r=1,o=1,s=0;const i=T=>e[T]===ex&&e[T+1]===Ze,l=T=>e[T]===Ze,a=T=>e[T]===nx,c=T=>e[T]===tx,u=T=>i(T)||l(T)||a(T)||c(T),d=()=>n,f=()=>r,p=()=>o,h=()=>s,m=T=>i(T)||a(T)||c(T)?Ze:e[T],y=()=>m(n),b=()=>m(n+s);function w(){return s=0,u(n)&&(r++,o=0),i(n)&&n++,n++,o++,e[n]}function k(){return i(n+s)&&s++,s++,e[n+s]}function E(){n=0,r=1,o=1,s=0}function x(T=0){s=T}function v(){const T=n+s;for(;T!==n;)w();s=0}return{index:d,line:f,column:p,peekOffset:h,charAt:m,currentChar:y,currentPeek:b,next:w,peek:k,reset:E,resetPeek:x,skipToPeek:v}}const Gn=void 0,ox=".",zh="'",sx="tokenizer";function ix(t,e={}){const n=e.location!==!1,r=rx(t),o=()=>r.index(),s=()=>Jv(r.line(),r.column(),r.index()),i=s(),l=o(),a={currentType:13,offset:l,startLoc:i,endLoc:i,lastType:13,lastOffset:l,lastStartLoc:i,lastEndLoc:i,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=e;function d(C,S,R,...$){const fe=c();if(S.column+=R,S.offset+=R,u){const se=n?Sc(fe.startLoc,S):null,Q=eo(C,se,{domain:sx,args:$});u(Q)}}function f(C,S,R){C.endLoc=s(),C.currentType=S;const $={type:S};return n&&($.loc=Sc(C.startLoc,C.endLoc)),R!=null&&($.value=R),$}const p=C=>f(C,13);function h(C,S){return C.currentChar()===S?(C.next(),S):(d(W.EXPECTED_TOKEN,s(),0,S),"")}function m(C){let S="";for(;C.currentPeek()===kn||C.currentPeek()===Ze;)S+=C.currentPeek(),C.peek();return S}function y(C){const S=m(C);return C.skipToPeek(),S}function b(C){if(C===Gn)return!1;const S=C.charCodeAt(0);return S>=97&&S<=122||S>=65&&S<=90||S===95}function w(C){if(C===Gn)return!1;const S=C.charCodeAt(0);return S>=48&&S<=57}function k(C,S){const{currentType:R}=S;if(R!==2)return!1;m(C);const $=b(C.currentPeek());return C.resetPeek(),$}function E(C,S){const{currentType:R}=S;if(R!==2)return!1;m(C);const $=C.currentPeek()==="-"?C.peek():C.currentPeek(),fe=w($);return C.resetPeek(),fe}function x(C,S){const{currentType:R}=S;if(R!==2)return!1;m(C);const $=C.currentPeek()===zh;return C.resetPeek(),$}function v(C,S){const{currentType:R}=S;if(R!==7)return!1;m(C);const $=C.currentPeek()===".";return C.resetPeek(),$}function T(C,S){const{currentType:R}=S;if(R!==8)return!1;m(C);const $=b(C.currentPeek());return C.resetPeek(),$}function _(C,S){const{currentType:R}=S;if(!(R===7||R===11))return!1;m(C);const $=C.currentPeek()===":";return C.resetPeek(),$}function P(C,S){const{currentType:R}=S;if(R!==9)return!1;const $=()=>{const se=C.currentPeek();return se==="{"?b(C.peek()):se==="@"||se==="|"||se===":"||se==="."||se===kn||!se?!1:se===Ze?(C.peek(),$()):Z(C,!1)},fe=$();return C.resetPeek(),fe}function V(C){m(C);const S=C.currentPeek()==="|";return C.resetPeek(),S}function Z(C,S=!0){const R=(fe=!1,se="")=>{const Q=C.currentPeek();return Q==="{"||Q==="@"||!Q?fe:Q==="|"?!(se===kn||se===Ze):Q===kn?(C.peek(),R(!0,kn)):Q===Ze?(C.peek(),R(!0,Ze)):!0},$=R();return S&&C.resetPeek(),$}function q(C,S){const R=C.currentChar();return R===Gn?Gn:S(R)?(C.next(),R):null}function re(C){const S=C.charCodeAt(0);return S>=97&&S<=122||S>=65&&S<=90||S>=48&&S<=57||S===95||S===36}function Te(C){return q(C,re)}function Se(C){const S=C.charCodeAt(0);return S>=97&&S<=122||S>=65&&S<=90||S>=48&&S<=57||S===95||S===36||S===45}function de(C){return q(C,Se)}function me(C){const S=C.charCodeAt(0);return S>=48&&S<=57}function Oe(C){return q(C,me)}function dt(C){const S=C.charCodeAt(0);return S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102}function Me(C){return q(C,dt)}function Et(C){let S="",R="";for(;S=Oe(C);)R+=S;return R}function ft(C){let S="";for(;;){const R=C.currentChar();if(R==="{"||R==="}"||R==="@"||R==="|"||!R)break;if(R===kn||R===Ze)if(Z(C))S+=R,C.next();else{if(V(C))break;S+=R,C.next()}else S+=R,C.next()}return S}function Ut(C){y(C);let S="",R="";for(;S=de(C);)R+=S;return C.currentChar()===Gn&&d(W.UNTERMINATED_CLOSING_BRACE,s(),0),R}function wt(C){y(C);let S="";return C.currentChar()==="-"?(C.next(),S+=`-${Et(C)}`):S+=Et(C),C.currentChar()===Gn&&d(W.UNTERMINATED_CLOSING_BRACE,s(),0),S}function tt(C){return C!==zh&&C!==Ze}function Rt(C){y(C),h(C,"'");let S="",R="";for(;S=q(C,tt);)S==="\\"?R+=sn(C):R+=S;const $=C.currentChar();return $===Ze||$===Gn?(d(W.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),$===Ze&&(C.next(),h(C,"'")),R):(h(C,"'"),R)}function sn(C){const S=C.currentChar();switch(S){case"\\":case"'":return C.next(),`\\${S}`;case"u":return pt(C,S,4);case"U":return pt(C,S,6);default:return d(W.UNKNOWN_ESCAPE_SEQUENCE,s(),0,S),""}}function pt(C,S,R){h(C,S);let $="";for(let fe=0;fe<R;fe++){const se=Me(C);if(!se){d(W.INVALID_UNICODE_ESCAPE_SEQUENCE,s(),0,`\\${S}${$}${C.currentChar()}`);break}$+=se}return`\\${S}${$}`}function ln(C){return C!=="{"&&C!=="}"&&C!==kn&&C!==Ze}function Lt(C){y(C);let S="",R="";for(;S=q(C,ln);)R+=S;return R}function an(C){let S="",R="";for(;S=Te(C);)R+=S;return R}function Qn(C){const S=R=>{const $=C.currentChar();return $==="{"||$==="@"||$==="|"||$==="("||$===")"||!$||$===kn?R:(R+=$,C.next(),S(R))};return S("")}function zt(C){y(C);const S=h(C,"|");return y(C),S}function cn(C,S){let R=null;switch(C.currentChar()){case"{":return S.braceNest>=1&&d(W.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),C.next(),R=f(S,2,"{"),y(C),S.braceNest++,R;case"}":return S.braceNest>0&&S.currentType===2&&d(W.EMPTY_PLACEHOLDER,s(),0),C.next(),R=f(S,3,"}"),S.braceNest--,S.braceNest>0&&y(C),S.inLinked&&S.braceNest===0&&(S.inLinked=!1),R;case"@":return S.braceNest>0&&d(W.UNTERMINATED_CLOSING_BRACE,s(),0),R=It(C,S)||p(S),S.braceNest=0,R;default:{let fe=!0,se=!0,Q=!0;if(V(C))return S.braceNest>0&&d(W.UNTERMINATED_CLOSING_BRACE,s(),0),R=f(S,1,zt(C)),S.braceNest=0,S.inLinked=!1,R;if(S.braceNest>0&&(S.currentType===4||S.currentType===5||S.currentType===6))return d(W.UNTERMINATED_CLOSING_BRACE,s(),0),S.braceNest=0,jt(C,S);if(fe=k(C,S))return R=f(S,4,Ut(C)),y(C),R;if(se=E(C,S))return R=f(S,5,wt(C)),y(C),R;if(Q=x(C,S))return R=f(S,6,Rt(C)),y(C),R;if(!fe&&!se&&!Q)return R=f(S,12,Lt(C)),d(W.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,R.value),y(C),R;break}}return R}function It(C,S){const{currentType:R}=S;let $=null;const fe=C.currentChar();switch((R===7||R===8||R===11||R===9)&&(fe===Ze||fe===kn)&&d(W.INVALID_LINKED_FORMAT,s(),0),fe){case"@":return C.next(),$=f(S,7,"@"),S.inLinked=!0,$;case".":return y(C),C.next(),f(S,8,".");case":":return y(C),C.next(),f(S,9,":");default:return V(C)?($=f(S,1,zt(C)),S.braceNest=0,S.inLinked=!1,$):v(C,S)||_(C,S)?(y(C),It(C,S)):T(C,S)?(y(C),f(S,11,an(C))):P(C,S)?(y(C),fe==="{"?cn(C,S)||$:f(S,10,Qn(C))):(R===7&&d(W.INVALID_LINKED_FORMAT,s(),0),S.braceNest=0,S.inLinked=!1,jt(C,S))}}function jt(C,S){let R={type:13};if(S.braceNest>0)return cn(C,S)||p(S);if(S.inLinked)return It(C,S)||p(S);switch(C.currentChar()){case"{":return cn(C,S)||p(S);case"}":return d(W.UNBALANCED_CLOSING_BRACE,s(),0),C.next(),f(S,3,"}");case"@":return It(C,S)||p(S);default:{if(V(C))return R=f(S,1,zt(C)),S.braceNest=0,S.inLinked=!1,R;if(Z(C))return f(S,0,ft(C));break}}return R}function Sn(){const{currentType:C,offset:S,startLoc:R,endLoc:$}=a;return a.lastType=C,a.lastOffset=S,a.lastStartLoc=R,a.lastEndLoc=$,a.offset=o(),a.startLoc=s(),r.currentChar()===Gn?f(a,13):jt(r,a)}return{nextToken:Sn,currentOffset:o,currentPosition:s,context:c}}const lx="parser",ax=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function cx(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function ux(t={}){const e=t.location!==!1,{onError:n}=t;function r(b,w,k,E,...x){const v=b.currentPosition();if(v.offset+=E,v.column+=E,n){const T=e?Sc(k,v):null,_=eo(w,T,{domain:lx,args:x});n(_)}}function o(b,w,k){const E={type:b};return e&&(E.start=w,E.end=w,E.loc={start:k,end:k}),E}function s(b,w,k,E){e&&(b.end=w,b.loc&&(b.loc.end=k))}function i(b,w){const k=b.context(),E=o(3,k.offset,k.startLoc);return E.value=w,s(E,b.currentOffset(),b.currentPosition()),E}function l(b,w){const k=b.context(),{lastOffset:E,lastStartLoc:x}=k,v=o(5,E,x);return v.index=parseInt(w,10),b.nextToken(),s(v,b.currentOffset(),b.currentPosition()),v}function a(b,w){const k=b.context(),{lastOffset:E,lastStartLoc:x}=k,v=o(4,E,x);return v.key=w,b.nextToken(),s(v,b.currentOffset(),b.currentPosition()),v}function c(b,w){const k=b.context(),{lastOffset:E,lastStartLoc:x}=k,v=o(9,E,x);return v.value=w.replace(ax,cx),b.nextToken(),s(v,b.currentOffset(),b.currentPosition()),v}function u(b){const w=b.nextToken(),k=b.context(),{lastOffset:E,lastStartLoc:x}=k,v=o(8,E,x);return w.type!==11?(r(b,W.UNEXPECTED_EMPTY_LINKED_MODIFIER,k.lastStartLoc,0),v.value="",s(v,E,x),{nextConsumeToken:w,node:v}):(w.value==null&&r(b,W.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,nn(w)),v.value=w.value||"",s(v,b.currentOffset(),b.currentPosition()),{node:v})}function d(b,w){const k=b.context(),E=o(7,k.offset,k.startLoc);return E.value=w,s(E,b.currentOffset(),b.currentPosition()),E}function f(b){const w=b.context(),k=o(6,w.offset,w.startLoc);let E=b.nextToken();if(E.type===8){const x=u(b);k.modifier=x.node,E=x.nextConsumeToken||b.nextToken()}switch(E.type!==9&&r(b,W.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,nn(E)),E=b.nextToken(),E.type===2&&(E=b.nextToken()),E.type){case 10:E.value==null&&r(b,W.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,nn(E)),k.key=d(b,E.value||"");break;case 4:E.value==null&&r(b,W.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,nn(E)),k.key=a(b,E.value||"");break;case 5:E.value==null&&r(b,W.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,nn(E)),k.key=l(b,E.value||"");break;case 6:E.value==null&&r(b,W.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,nn(E)),k.key=c(b,E.value||"");break;default:{r(b,W.UNEXPECTED_EMPTY_LINKED_KEY,w.lastStartLoc,0);const x=b.context(),v=o(7,x.offset,x.startLoc);return v.value="",s(v,x.offset,x.startLoc),k.key=v,s(k,x.offset,x.startLoc),{nextConsumeToken:E,node:k}}}return s(k,b.currentOffset(),b.currentPosition()),{node:k}}function p(b){const w=b.context(),k=w.currentType===1?b.currentOffset():w.offset,E=w.currentType===1?w.endLoc:w.startLoc,x=o(2,k,E);x.items=[];let v=null;do{const P=v||b.nextToken();switch(v=null,P.type){case 0:P.value==null&&r(b,W.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,nn(P)),x.items.push(i(b,P.value||""));break;case 5:P.value==null&&r(b,W.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,nn(P)),x.items.push(l(b,P.value||""));break;case 4:P.value==null&&r(b,W.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,nn(P)),x.items.push(a(b,P.value||""));break;case 6:P.value==null&&r(b,W.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,nn(P)),x.items.push(c(b,P.value||""));break;case 7:{const V=f(b);x.items.push(V.node),v=V.nextConsumeToken||null;break}}}while(w.currentType!==13&&w.currentType!==1);const T=w.currentType===1?w.lastOffset:b.currentOffset(),_=w.currentType===1?w.lastEndLoc:b.currentPosition();return s(x,T,_),x}function h(b,w,k,E){const x=b.context();let v=E.items.length===0;const T=o(1,w,k);T.cases=[],T.cases.push(E);do{const _=p(b);v||(v=_.items.length===0),T.cases.push(_)}while(x.currentType!==13);return v&&r(b,W.MUST_HAVE_MESSAGES_IN_PLURAL,k,0),s(T,b.currentOffset(),b.currentPosition()),T}function m(b){const w=b.context(),{offset:k,startLoc:E}=w,x=p(b);return w.currentType===13?x:h(b,k,E,x)}function y(b){const w=ix(b,Re({},t)),k=w.context(),E=o(0,k.offset,k.startLoc);return e&&E.loc&&(E.loc.source=b),E.body=m(w),t.onCacheKey&&(E.cacheKey=t.onCacheKey(b)),k.currentType!==13&&r(w,W.UNEXPECTED_LEXICAL_ANALYSIS,k.lastStartLoc,0,b[k.offset]||""),s(E,w.currentOffset(),w.currentPosition()),E}return{parse:y}}function nn(t){if(t.type===13)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function dx(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:s=>(n.helpers.add(s),s)}}function jh(t,e){for(let n=0;n<t.length;n++)vc(t[n],e)}function vc(t,e){switch(t.type){case 1:jh(t.cases,e),e.helper("plural");break;case 2:jh(t.items,e);break;case 6:{vc(t.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function fx(t,e={}){const n=dx(t);n.helper("normalize"),t.body&&vc(t.body,n);const r=n.context();t.helpers=Array.from(r.helpers)}function px(t){const e=t.body;return e.type===2?Wh(e):e.cases.forEach(n=>Wh(n)),t}function Wh(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;n<t.items.length;n++){const r=t.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;e.push(r.value)}if(e.length===t.items.length){t.static=wc(e);for(let n=0;n<t.items.length;n++){const r=t.items[n];(r.type===3||r.type===9)&&delete r.value}}}}const hx="minifier";function to(t){switch(t.t=t.type,t.type){case 0:{const e=t;to(e.body),e.b=e.body,delete e.body;break}case 1:{const e=t,n=e.cases;for(let r=0;r<n.length;r++)to(n[r]);e.c=n,delete e.cases;break}case 2:{const e=t,n=e.items;for(let r=0;r<n.length;r++)to(n[r]);e.i=n,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=t;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=t;to(e.key),e.k=e.key,delete e.key,e.modifier&&(to(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=t;e.i=e.index,delete e.index;break}case 4:{const e=t;e.k=e.key,delete e.key;break}default:if(process.env.NODE_ENV!=="production")throw eo(W.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:hx,args:[t.type]})}delete t.type}const mx="parser";function gx(t,e){const{filename:n,breakLineCode:r,needIndent:o}=e,s=e.location!==!1,i={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:o,indentLevel:0};s&&t.loc&&(i.source=t.loc.source);const l=()=>i;function a(m,y){i.code+=m}function c(m,y=!0){const b=y?r:"";a(o?b+" ".repeat(m):b)}function u(m=!0){const y=++i.indentLevel;m&&c(y)}function d(m=!0){const y=--i.indentLevel;m&&c(y)}function f(){c(i.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:f,helper:m=>`_${m}`,needIndent:()=>i.needIndent}}function yx(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),no(t,e.key),e.modifier?(t.push(", "),no(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function bx(t,e){const{helper:n,needIndent:r}=t;t.push(`${n("normalize")}([`),t.indent(r());const o=e.items.length;for(let s=0;s<o&&(no(t,e.items[s]),s!==o-1);s++)t.push(", ");t.deindent(r()),t.push("])")}function Ex(t,e){const{helper:n,needIndent:r}=t;if(e.cases.length>1){t.push(`${n("plural")}([`),t.indent(r());const o=e.cases.length;for(let s=0;s<o&&(no(t,e.cases[s]),s!==o-1);s++)t.push(", ");t.deindent(r()),t.push("])")}}function wx(t,e){e.body?no(t,e.body):t.push("null")}function no(t,e){const{helper:n}=t;switch(e.type){case 0:wx(t,e);break;case 1:Ex(t,e);break;case 2:bx(t,e);break;case 6:yx(t,e);break;case 8:t.push(JSON.stringify(e.value),e);break;case 7:t.push(JSON.stringify(e.value),e);break;case 5:t.push(`${n("interpolate")}(${n("list")}(${e.index}))`,e);break;case 4:t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:t.push(JSON.stringify(e.value),e);break;case 3:t.push(JSON.stringify(e.value),e);break;default:if(process.env.NODE_ENV!=="production")throw eo(W.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:mx,args:[e.type]})}}const kx=(t,e={})=>{const n=B(e.mode)?e.mode:"normal",r=B(e.filename)?e.filename:"message.intl";e.sourceMap;const o=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":`
128
- `,s=e.needIndent?e.needIndent:n!=="arrow",i=t.helpers||[],l=gx(t,{filename:r,breakLineCode:o,needIndent:s});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(s),i.length>0&&(l.push(`const { ${wc(i.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),no(l,t),l.deindent(s),l.push("}"),delete t.helpers;const{code:a,map:c}=l.context();return{ast:t,code:a,map:c?c.toJSON():void 0}};function Cx(t,e={}){const n=Re({},e),r=!!n.jit,o=!!n.minify,s=n.optimize==null?!0:n.optimize,l=ux(n).parse(t);return r?(s&&px(l),o&&to(l),{ast:l,code:""}):(fx(l,n),kx(l,n))}/*!
126
+ */function kS(t,e,n){return{line:t,column:e,offset:n}}function Nc(t,e,n){return{start:t,end:e}}const ne={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},_S=17,ES={[ne.EXPECTED_TOKEN]:"Expected token: '{0}'",[ne.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[ne.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[ne.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[ne.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[ne.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[ne.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[ne.EMPTY_PLACEHOLDER]:"Empty placeholder",[ne.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[ne.INVALID_LINKED_FORMAT]:"Invalid linked format",[ne.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[ne.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[ne.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[ne.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[ne.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[ne.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function to(t,e,n={}){const{domain:r,messages:o,args:i}=n,s=process.env.NODE_ENV!=="production"?Hs((o||ES)[t]||"",...i||[]):t,a=new SyntaxError(String(s));return a.code=t,e&&(a.location=e),a.domain=r,a}function vS(t){throw t}const CS=/<\/?[\w\s="/.':;#-\/]+>/,SS=t=>CS.test(t),vn=" ",TS="\r",ut=`
127
+ `,NS="\u2028",AS="\u2029";function OS(t){const e=t;let n=0,r=1,o=1,i=0;const s=w=>e[w]===TS&&e[w+1]===ut,a=w=>e[w]===ut,l=w=>e[w]===AS,c=w=>e[w]===NS,u=w=>s(w)||a(w)||l(w)||c(w),f=()=>n,p=()=>r,m=()=>o,b=()=>i,k=w=>s(w)||l(w)||c(w)?ut:e[w],_=()=>k(n),E=()=>k(n+i);function N(){return i=0,u(n)&&(r++,o=0),s(n)&&n++,n++,o++,e[n]}function A(){return s(n+i)&&i++,i++,e[n+i]}function d(){n=0,r=1,o=1,i=0}function g(w=0){i=w}function h(){const w=n+i;for(;w!==n;)N();i=0}return{index:f,line:p,column:m,peekOffset:b,charAt:k,currentChar:_,currentPeek:E,next:N,peek:A,reset:d,resetPeek:g,skipToPeek:h}}const Xn=void 0,MS=".",xm="'",xS="tokenizer";function LS(t,e={}){const n=e.location!==!1,r=OS(t),o=()=>r.index(),i=()=>kS(r.line(),r.column(),r.index()),s=i(),a=o(),l={currentType:13,offset:a,startLoc:s,endLoc:s,lastType:13,lastOffset:a,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},c=()=>l,{onError:u}=e;function f(O,x,H,...Y){const ve=c();if(x.column+=H,x.offset+=H,u){const me=n?Nc(ve.startLoc,x):null,le=to(O,me,{domain:xS,args:Y});u(le)}}function p(O,x,H){O.endLoc=i(),O.currentType=x;const Y={type:x};return n&&(Y.loc=Nc(O.startLoc,O.endLoc)),H!=null&&(Y.value=H),Y}const m=O=>p(O,13);function b(O,x){return O.currentChar()===x?(O.next(),x):(f(ne.EXPECTED_TOKEN,i(),0,x),"")}function k(O){let x="";for(;O.currentPeek()===vn||O.currentPeek()===ut;)x+=O.currentPeek(),O.peek();return x}function _(O){const x=k(O);return O.skipToPeek(),x}function E(O){if(O===Xn)return!1;const x=O.charCodeAt(0);return x>=97&&x<=122||x>=65&&x<=90||x===95}function N(O){if(O===Xn)return!1;const x=O.charCodeAt(0);return x>=48&&x<=57}function A(O,x){const{currentType:H}=x;if(H!==2)return!1;k(O);const Y=E(O.currentPeek());return O.resetPeek(),Y}function d(O,x){const{currentType:H}=x;if(H!==2)return!1;k(O);const Y=O.currentPeek()==="-"?O.peek():O.currentPeek(),ve=N(Y);return O.resetPeek(),ve}function g(O,x){const{currentType:H}=x;if(H!==2)return!1;k(O);const Y=O.currentPeek()===xm;return O.resetPeek(),Y}function h(O,x){const{currentType:H}=x;if(H!==7)return!1;k(O);const Y=O.currentPeek()===".";return O.resetPeek(),Y}function w(O,x){const{currentType:H}=x;if(H!==8)return!1;k(O);const Y=E(O.currentPeek());return O.resetPeek(),Y}function v(O,x){const{currentType:H}=x;if(!(H===7||H===11))return!1;k(O);const Y=O.currentPeek()===":";return O.resetPeek(),Y}function S(O,x){const{currentType:H}=x;if(H!==9)return!1;const Y=()=>{const me=O.currentPeek();return me==="{"?E(O.peek()):me==="@"||me==="|"||me===":"||me==="."||me===vn||!me?!1:me===ut?(O.peek(),Y()):M(O,!1)},ve=Y();return O.resetPeek(),ve}function C(O){k(O);const x=O.currentPeek()==="|";return O.resetPeek(),x}function M(O,x=!0){const H=(ve=!1,me="")=>{const le=O.currentPeek();return le==="{"||le==="@"||!le?ve:le==="|"?!(me===vn||me===ut):le===vn?(O.peek(),H(!0,vn)):le===ut?(O.peek(),H(!0,ut)):!0},Y=H();return x&&O.resetPeek(),Y}function P(O,x){const H=O.currentChar();return H===Xn?Xn:x(H)?(O.next(),H):null}function D(O){const x=O.charCodeAt(0);return x>=97&&x<=122||x>=65&&x<=90||x>=48&&x<=57||x===95||x===36}function F(O){return P(O,D)}function $(O){const x=O.charCodeAt(0);return x>=97&&x<=122||x>=65&&x<=90||x>=48&&x<=57||x===95||x===36||x===45}function T(O){return P(O,$)}function I(O){const x=O.charCodeAt(0);return x>=48&&x<=57}function U(O){return P(O,I)}function q(O){const x=O.charCodeAt(0);return x>=48&&x<=57||x>=65&&x<=70||x>=97&&x<=102}function Z(O){return P(O,q)}function G(O){let x="",H="";for(;x=U(O);)H+=x;return H}function he(O){let x="";for(;;){const H=O.currentChar();if(H==="{"||H==="}"||H==="@"||H==="|"||!H)break;if(H===vn||H===ut)if(M(O))x+=H,O.next();else{if(C(O))break;x+=H,O.next()}else x+=H,O.next()}return x}function Te(O){_(O);let x="",H="";for(;x=T(O);)H+=x;return O.currentChar()===Xn&&f(ne.UNTERMINATED_CLOSING_BRACE,i(),0),H}function Oe(O){_(O);let x="";return O.currentChar()==="-"?(O.next(),x+=`-${G(O)}`):x+=G(O),O.currentChar()===Xn&&f(ne.UNTERMINATED_CLOSING_BRACE,i(),0),x}function fe(O){return O!==xm&&O!==ut}function we(O){_(O),b(O,"'");let x="",H="";for(;x=P(O,fe);)x==="\\"?H+=Me(O):H+=x;const Y=O.currentChar();return Y===ut||Y===Xn?(f(ne.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),Y===ut&&(O.next(),b(O,"'")),H):(b(O,"'"),H)}function Me(O){const x=O.currentChar();switch(x){case"\\":case"'":return O.next(),`\\${x}`;case"u":return ke(O,x,4);case"U":return ke(O,x,6);default:return f(ne.UNKNOWN_ESCAPE_SEQUENCE,i(),0,x),""}}function ke(O,x,H){b(O,x);let Y="";for(let ve=0;ve<H;ve++){const me=Z(O);if(!me){f(ne.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${x}${Y}${O.currentChar()}`);break}Y+=me}return`\\${x}${Y}`}function _t(O){return O!=="{"&&O!=="}"&&O!==vn&&O!==ut}function ot(O){_(O);let x="",H="";for(;x=P(O,_t);)H+=x;return H}function At(O){let x="",H="";for(;x=F(O);)H+=x;return H}function Vt(O){const x=H=>{const Y=O.currentChar();return Y==="{"||Y==="@"||Y==="|"||Y==="("||Y===")"||!Y||Y===vn?H:(H+=Y,O.next(),x(H))};return x("")}function Et(O){_(O);const x=b(O,"|");return _(O),x}function dn(O,x){let H=null;switch(O.currentChar()){case"{":return x.braceNest>=1&&f(ne.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),O.next(),H=p(x,2,"{"),_(O),x.braceNest++,H;case"}":return x.braceNest>0&&x.currentType===2&&f(ne.EMPTY_PLACEHOLDER,i(),0),O.next(),H=p(x,3,"}"),x.braceNest--,x.braceNest>0&&_(O),x.inLinked&&x.braceNest===0&&(x.inLinked=!1),H;case"@":return x.braceNest>0&&f(ne.UNTERMINATED_CLOSING_BRACE,i(),0),H=Ht(O,x)||m(x),x.braceNest=0,H;default:{let ve=!0,me=!0,le=!0;if(C(O))return x.braceNest>0&&f(ne.UNTERMINATED_CLOSING_BRACE,i(),0),H=p(x,1,Et(O)),x.braceNest=0,x.inLinked=!1,H;if(x.braceNest>0&&(x.currentType===4||x.currentType===5||x.currentType===6))return f(ne.UNTERMINATED_CLOSING_BRACE,i(),0),x.braceNest=0,Jt(O,x);if(ve=A(O,x))return H=p(x,4,Te(O)),_(O),H;if(me=d(O,x))return H=p(x,5,Oe(O)),_(O),H;if(le=g(O,x))return H=p(x,6,we(O)),_(O),H;if(!ve&&!me&&!le)return H=p(x,12,ot(O)),f(ne.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,H.value),_(O),H;break}}return H}function Ht(O,x){const{currentType:H}=x;let Y=null;const ve=O.currentChar();switch((H===7||H===8||H===11||H===9)&&(ve===ut||ve===vn)&&f(ne.INVALID_LINKED_FORMAT,i(),0),ve){case"@":return O.next(),Y=p(x,7,"@"),x.inLinked=!0,Y;case".":return _(O),O.next(),p(x,8,".");case":":return _(O),O.next(),p(x,9,":");default:return C(O)?(Y=p(x,1,Et(O)),x.braceNest=0,x.inLinked=!1,Y):h(O,x)||v(O,x)?(_(O),Ht(O,x)):w(O,x)?(_(O),p(x,11,At(O))):S(O,x)?(_(O),ve==="{"?dn(O,x)||Y:p(x,10,Vt(O))):(H===7&&f(ne.INVALID_LINKED_FORMAT,i(),0),x.braceNest=0,x.inLinked=!1,Jt(O,x))}}function Jt(O,x){let H={type:13};if(x.braceNest>0)return dn(O,x)||m(x);if(x.inLinked)return Ht(O,x)||m(x);switch(O.currentChar()){case"{":return dn(O,x)||m(x);case"}":return f(ne.UNBALANCED_CLOSING_BRACE,i(),0),O.next(),p(x,3,"}");case"@":return Ht(O,x)||m(x);default:{if(C(O))return H=p(x,1,Et(O)),x.braceNest=0,x.inLinked=!1,H;if(M(O))return p(x,0,he(O));break}}return H}function Sn(){const{currentType:O,offset:x,startLoc:H,endLoc:Y}=l;return l.lastType=O,l.lastOffset=x,l.lastStartLoc=H,l.lastEndLoc=Y,l.offset=o(),l.startLoc=i(),r.currentChar()===Xn?p(l,13):Jt(r,l)}return{nextToken:Sn,currentOffset:o,currentPosition:i,context:c}}const RS="parser",PS=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function IS(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function DS(t={}){const e=t.location!==!1,{onError:n}=t;function r(E,N,A,d,...g){const h=E.currentPosition();if(h.offset+=d,h.column+=d,n){const w=e?Nc(A,h):null,v=to(N,w,{domain:RS,args:g});n(v)}}function o(E,N,A){const d={type:E};return e&&(d.start=N,d.end=N,d.loc={start:A,end:A}),d}function i(E,N,A,d){e&&(E.end=N,E.loc&&(E.loc.end=A))}function s(E,N){const A=E.context(),d=o(3,A.offset,A.startLoc);return d.value=N,i(d,E.currentOffset(),E.currentPosition()),d}function a(E,N){const A=E.context(),{lastOffset:d,lastStartLoc:g}=A,h=o(5,d,g);return h.index=parseInt(N,10),E.nextToken(),i(h,E.currentOffset(),E.currentPosition()),h}function l(E,N){const A=E.context(),{lastOffset:d,lastStartLoc:g}=A,h=o(4,d,g);return h.key=N,E.nextToken(),i(h,E.currentOffset(),E.currentPosition()),h}function c(E,N){const A=E.context(),{lastOffset:d,lastStartLoc:g}=A,h=o(9,d,g);return h.value=N.replace(PS,IS),E.nextToken(),i(h,E.currentOffset(),E.currentPosition()),h}function u(E){const N=E.nextToken(),A=E.context(),{lastOffset:d,lastStartLoc:g}=A,h=o(8,d,g);return N.type!==11?(r(E,ne.UNEXPECTED_EMPTY_LINKED_MODIFIER,A.lastStartLoc,0),h.value="",i(h,d,g),{nextConsumeToken:N,node:h}):(N.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,A.lastStartLoc,0,ln(N)),h.value=N.value||"",i(h,E.currentOffset(),E.currentPosition()),{node:h})}function f(E,N){const A=E.context(),d=o(7,A.offset,A.startLoc);return d.value=N,i(d,E.currentOffset(),E.currentPosition()),d}function p(E){const N=E.context(),A=o(6,N.offset,N.startLoc);let d=E.nextToken();if(d.type===8){const g=u(E);A.modifier=g.node,d=g.nextConsumeToken||E.nextToken()}switch(d.type!==9&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(d)),d=E.nextToken(),d.type===2&&(d=E.nextToken()),d.type){case 10:d.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(d)),A.key=f(E,d.value||"");break;case 4:d.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(d)),A.key=l(E,d.value||"");break;case 5:d.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(d)),A.key=a(E,d.value||"");break;case 6:d.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(d)),A.key=c(E,d.value||"");break;default:{r(E,ne.UNEXPECTED_EMPTY_LINKED_KEY,N.lastStartLoc,0);const g=E.context(),h=o(7,g.offset,g.startLoc);return h.value="",i(h,g.offset,g.startLoc),A.key=h,i(A,g.offset,g.startLoc),{nextConsumeToken:d,node:A}}}return i(A,E.currentOffset(),E.currentPosition()),{node:A}}function m(E){const N=E.context(),A=N.currentType===1?E.currentOffset():N.offset,d=N.currentType===1?N.endLoc:N.startLoc,g=o(2,A,d);g.items=[];let h=null;do{const S=h||E.nextToken();switch(h=null,S.type){case 0:S.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(S)),g.items.push(s(E,S.value||""));break;case 5:S.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(S)),g.items.push(a(E,S.value||""));break;case 4:S.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(S)),g.items.push(l(E,S.value||""));break;case 6:S.value==null&&r(E,ne.UNEXPECTED_LEXICAL_ANALYSIS,N.lastStartLoc,0,ln(S)),g.items.push(c(E,S.value||""));break;case 7:{const C=p(E);g.items.push(C.node),h=C.nextConsumeToken||null;break}}}while(N.currentType!==13&&N.currentType!==1);const w=N.currentType===1?N.lastOffset:E.currentOffset(),v=N.currentType===1?N.lastEndLoc:E.currentPosition();return i(g,w,v),g}function b(E,N,A,d){const g=E.context();let h=d.items.length===0;const w=o(1,N,A);w.cases=[],w.cases.push(d);do{const v=m(E);h||(h=v.items.length===0),w.cases.push(v)}while(g.currentType!==13);return h&&r(E,ne.MUST_HAVE_MESSAGES_IN_PLURAL,A,0),i(w,E.currentOffset(),E.currentPosition()),w}function k(E){const N=E.context(),{offset:A,startLoc:d}=N,g=m(E);return N.currentType===13?g:b(E,A,d,g)}function _(E){const N=LS(E,He({},t)),A=N.context(),d=o(0,A.offset,A.startLoc);return e&&d.loc&&(d.loc.source=E),d.body=k(N),t.onCacheKey&&(d.cacheKey=t.onCacheKey(E)),A.currentType!==13&&r(N,ne.UNEXPECTED_LEXICAL_ANALYSIS,A.lastStartLoc,0,E[A.offset]||""),i(d,N.currentOffset(),N.currentPosition()),d}return{parse:_}}function ln(t){if(t.type===13)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function BS(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function Lm(t,e){for(let n=0;n<t.length;n++)Ac(t[n],e)}function Ac(t,e){switch(t.type){case 1:Lm(t.cases,e),e.helper("plural");break;case 2:Lm(t.items,e);break;case 6:{Ac(t.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function FS(t,e={}){const n=BS(t);n.helper("normalize"),t.body&&Ac(t.body,n);const r=n.context();t.helpers=Array.from(r.helpers)}function $S(t){const e=t.body;return e.type===2?Rm(e):e.cases.forEach(n=>Rm(n)),t}function Rm(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;n<t.items.length;n++){const r=t.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;e.push(r.value)}if(e.length===t.items.length){t.static=Cc(e);for(let n=0;n<t.items.length;n++){const r=t.items[n];(r.type===3||r.type===9)&&delete r.value}}}}const VS="minifier";function no(t){switch(t.t=t.type,t.type){case 0:{const e=t;no(e.body),e.b=e.body,delete e.body;break}case 1:{const e=t,n=e.cases;for(let r=0;r<n.length;r++)no(n[r]);e.c=n,delete e.cases;break}case 2:{const e=t,n=e.items;for(let r=0;r<n.length;r++)no(n[r]);e.i=n,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=t;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=t;no(e.key),e.k=e.key,delete e.key,e.modifier&&(no(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=t;e.i=e.index,delete e.index;break}case 4:{const e=t;e.k=e.key,delete e.key;break}default:if(process.env.NODE_ENV!=="production")throw to(ne.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:VS,args:[t.type]})}delete t.type}const HS="parser";function zS(t,e){const{filename:n,breakLineCode:r,needIndent:o}=e,i=e.location!==!1,s={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:o,indentLevel:0};i&&t.loc&&(s.source=t.loc.source);const a=()=>s;function l(k,_){s.code+=k}function c(k,_=!0){const E=_?r:"";l(o?E+" ".repeat(k):E)}function u(k=!0){const _=++s.indentLevel;k&&c(_)}function f(k=!0){const _=--s.indentLevel;k&&c(_)}function p(){c(s.indentLevel)}return{context:a,push:l,indent:u,deindent:f,newline:p,helper:k=>`_${k}`,needIndent:()=>s.needIndent}}function jS(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),ro(t,e.key),e.modifier?(t.push(", "),ro(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function US(t,e){const{helper:n,needIndent:r}=t;t.push(`${n("normalize")}([`),t.indent(r());const o=e.items.length;for(let i=0;i<o&&(ro(t,e.items[i]),i!==o-1);i++)t.push(", ");t.deindent(r()),t.push("])")}function WS(t,e){const{helper:n,needIndent:r}=t;if(e.cases.length>1){t.push(`${n("plural")}([`),t.indent(r());const o=e.cases.length;for(let i=0;i<o&&(ro(t,e.cases[i]),i!==o-1);i++)t.push(", ");t.deindent(r()),t.push("])")}}function KS(t,e){e.body?ro(t,e.body):t.push("null")}function ro(t,e){const{helper:n}=t;switch(e.type){case 0:KS(t,e);break;case 1:WS(t,e);break;case 2:US(t,e);break;case 6:jS(t,e);break;case 8:t.push(JSON.stringify(e.value),e);break;case 7:t.push(JSON.stringify(e.value),e);break;case 5:t.push(`${n("interpolate")}(${n("list")}(${e.index}))`,e);break;case 4:t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:t.push(JSON.stringify(e.value),e);break;case 3:t.push(JSON.stringify(e.value),e);break;default:if(process.env.NODE_ENV!=="production")throw to(ne.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:HS,args:[e.type]})}}const qS=(t,e={})=>{const n=K(e.mode)?e.mode:"normal",r=K(e.filename)?e.filename:"message.intl";e.sourceMap;const o=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":`
128
+ `,i=e.needIndent?e.needIndent:n!=="arrow",s=t.helpers||[],a=zS(t,{filename:r,breakLineCode:o,needIndent:i});a.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(i),s.length>0&&(a.push(`const { ${Cc(s.map(u=>`${u}: _${u}`),", ")} } = ctx`),a.newline()),a.push("return "),ro(a,t),a.deindent(i),a.push("}"),delete t.helpers;const{code:l,map:c}=a.context();return{ast:t,code:l,map:c?c.toJSON():void 0}};function GS(t,e={}){const n=He({},e),r=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,a=DS(n).parse(t);return r?(i&&$S(a),o&&no(a),{ast:a,code:""}):(FS(a,n),qS(a,n))}/*!
129
129
  * core-base v11.1.7
130
130
  * (c) 2025 kazuya kawaguchi
131
131
  * Released under the MIT License.
132
- */function Sx(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Cr().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Cr().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function _t(t){return te(t)&&xc(t)===0&&(Vt(t,"b")||Vt(t,"body"))}const Kh=["b","body"];function vx(t){return Yn(t,Kh)}const qh=["c","cases"];function xx(t){return Yn(t,qh,[])}const Jh=["s","static"];function Tx(t){return Yn(t,Jh)}const Gh=["i","items"];function Ox(t){return Yn(t,Gh,[])}const Yh=["t","type"];function xc(t){return Yn(t,Yh)}const Xh=["v","value"];function ji(t,e){const n=Yn(t,Xh);if(n!=null)return n;throw Zo(e)}const Qh=["m","modifier"];function Nx(t){return Yn(t,Qh)}const Zh=["k","key"];function Ax(t){const e=Yn(t,Zh);if(e)return e;throw Zo(6)}function Yn(t,e,n){for(let r=0;r<e.length;r++){const o=e[r];if(Vt(t,o)&&t[o]!=null)return t[o]}return n}const em=[...Kh,...qh,...Jh,...Gh,...Zh,...Qh,...Xh,...Yh];function Zo(t){return new Error(`unhandled node type: ${t}`)}function Tc(t){return n=>_x(n,t)}function _x(t,e){const n=vx(e);if(n==null)throw Zo(0);if(xc(n)===1){const s=xx(n);return t.plural(s.reduce((i,l)=>[...i,tm(t,l)],[]))}else return tm(t,n)}function tm(t,e){const n=Tx(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const r=Ox(e).reduce((o,s)=>[...o,Oc(t,s)],[]);return t.normalize(r)}}function Oc(t,e){const n=xc(e);switch(n){case 3:return ji(e,n);case 9:return ji(e,n);case 4:{const r=e;if(Vt(r,"k")&&r.k)return t.interpolate(t.named(r.k));if(Vt(r,"key")&&r.key)return t.interpolate(t.named(r.key));throw Zo(n)}case 5:{const r=e;if(Vt(r,"i")&&_e(r.i))return t.interpolate(t.list(r.i));if(Vt(r,"index")&&_e(r.index))return t.interpolate(t.list(r.index));throw Zo(n)}case 6:{const r=e,o=Nx(r),s=Ax(r);return t.linked(Oc(t,s),o?Oc(t,o):void 0,t.type)}case 7:return ji(e,n);case 8:return ji(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Mx="Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";function Rx(t,e){e&&Zv(t)&&Jn(Vi(Mx,{source:t}))}const Lx=t=>t;let Wi=le();function Ix(t,e={}){let n=!1;const r=e.onError||Xv;return e.onError=o=>{n=!0,r(o)},{...Cx(t,e),detectError:n}}function Dx(t,e){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&B(t)){const n=ne(e.warnHtmlMessage)?e.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&Rx(t,n);const o=(e.onCacheKey||Lx)(t),s=Wi[o];if(s)return s;const{ast:i,detectError:l}=Ix(t,{...e,location:process.env.NODE_ENV!=="production",jit:!0}),a=Tc(i);return l?a:Wi[o]=a}else{if(process.env.NODE_ENV!=="production"&&!_t(t))return Jn(`the message that is resolve with key '${e.key}' is not supported for jit compilation`),()=>t;const n=t.cacheKey;if(n){const r=Wi[n];return r||(Wi[n]=Tc(t))}else return Tc(t)}}let es=null;function Px(t){es=t}function Bx(t,e,n){es&&es.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:n})}const Fx=$x("function:translate");function $x(t){return e=>es&&es.emit(t,e)}const qe={INVALID_ARGUMENT:Gv,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},Vx=24;function Cn(t){return eo(t,null,process.env.NODE_ENV!=="production"?{messages:Hx}:void 0)}const Hx={[qe.INVALID_ARGUMENT]:"Invalid arguments",[qe.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[qe.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string",[qe.NOT_SUPPORT_NON_STRING_MESSAGE]:"Not support non-string message",[qe.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:"cannot support promise value",[qe.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:"cannot support async function",[qe.NOT_SUPPORT_LOCALE_TYPE]:"cannot support locale type"};function Nc(t,e){return e.locale!=null?nm(e.locale):nm(t.locale)}let Ac;function nm(t){if(B(t))return t;if(ue(t)){if(t.resolvedOnce&&Ac!=null)return Ac;if(t.constructor.name==="Function"){const e=t();if(Wv(e))throw Cn(qe.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Ac=e}else throw Cn(qe.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Cn(qe.NOT_SUPPORT_LOCALE_TYPE)}function Ux(t,e,n){return[...new Set([n,...be(e)?e:te(e)?Object.keys(e):B(e)?[e]:[n]])]}function rm(t,e,n){const r=B(n)?n:ts,o=t;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(r);if(!s){s=[];let i=[n];for(;be(i);)i=om(s,i,e);const l=be(e)||!X(e)?e:e.default?e.default:null;i=B(l)?[l]:l,be(i)&&om(s,i,!1),o.__localeChainCache.set(r,s)}return s}function om(t,e,n){let r=!0;for(let o=0;o<e.length&&ne(r);o++){const s=e[o];B(s)&&(r=zx(t,e[o],n))}return r}function zx(t,e,n){let r;const o=e.split("-");do{const s=o.join("-");r=jx(t,s,n),o.splice(-1,1)}while(o.length&&r===!0);return r}function jx(t,e,n){let r=!1;if(!t.includes(e)&&(r=!0,e)){r=e[e.length-1]!=="!";const o=e.replace(/!/g,"");t.push(o),(be(n)||X(n))&&n[o]&&(r=n[o])}return r}const Xn=[];Xn[0]={w:[0],i:[3,0],"[":[4],o:[7]},Xn[1]={w:[1],".":[2],"[":[4],o:[7]},Xn[2]={w:[2],i:[3,0],0:[3,0]},Xn[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},Xn[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},Xn[5]={"'":[4,0],o:8,l:[5,0]},Xn[6]={'"':[4,0],o:8,l:[6,0]};const Wx=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Kx(t){return Wx.test(t)}function qx(t){const e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e===n&&(e===34||e===39)?t.slice(1,-1):t}function Jx(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Gx(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:Kx(e)?qx(e):"*"+e}function Yx(t){const e=[];let n=-1,r=0,o=0,s,i,l,a,c,u,d;const f=[];f[0]=()=>{i===void 0?i=l:i+=l},f[1]=()=>{i!==void 0&&(e.push(i),i=void 0)},f[2]=()=>{f[0](),o++},f[3]=()=>{if(o>0)o--,r=4,f[0]();else{if(o=0,i===void 0||(i=Gx(i),i===!1))return!1;f[1]()}};function p(){const h=t[n+1];if(r===5&&h==="'"||r===6&&h==='"')return n++,l="\\"+h,f[0](),!0}for(;r!==null;)if(n++,s=t[n],!(s==="\\"&&p())){if(a=Jx(s),d=Xn[r],c=d[a]||d.l||8,c===8||(r=c[0],c[1]!==void 0&&(u=f[c[1]],u&&(l=s,u()===!1))))return;if(r===7)return e}}const sm=new Map;function Xx(t,e){return te(t)?t[e]:null}function Qx(t,e){if(!te(t))return null;let n=sm.get(e);if(n||(n=Yx(e),n&&sm.set(e,n)),!n)return null;const r=n.length;let o=t,s=0;for(;s<r;){const i=n[s];if(em.includes(i)&&_t(o))return null;const l=o[i];if(l===void 0||ue(o))return null;o=l,s++}return o}const at={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},Zx=8,eT={[at.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[at.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[at.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[at.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[at.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[at.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[at.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function Sr(t,...e){return Vi(eT[t],...e)}const tT="11.1.7",Ki=-1,ts="en-US",qi="",im=t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function nT(){return{upper:(t,e)=>e==="text"&&B(t)?t.toUpperCase():e==="vnode"&&te(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&B(t)?t.toLowerCase():e==="vnode"&&te(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&B(t)?im(t):e==="vnode"&&te(t)&&"__v_isVNode"in t?im(t.children):t}}let lm;function rT(t){lm=t}let am;function oT(t){am=t}let cm;function sT(t){cm=t}let um=null;const iT=t=>{um=t},lT=()=>um;let dm=null;const fm=t=>{dm=t},aT=()=>dm;let pm=0;function cT(t={}){const e=ue(t.onWarn)?t.onWarn:Jn,n=B(t.version)?t.version:tT,r=B(t.locale)||ue(t.locale)?t.locale:ts,o=ue(r)?ts:r,s=be(t.fallbackLocale)||X(t.fallbackLocale)||B(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:o,i=X(t.messages)?t.messages:_c(o),l=X(t.datetimeFormats)?t.datetimeFormats:_c(o),a=X(t.numberFormats)?t.numberFormats:_c(o),c=Re(le(),t.modifiers,nT()),u=t.pluralRules||le(),d=ue(t.missing)?t.missing:null,f=ne(t.missingWarn)||Zr(t.missingWarn)?t.missingWarn:!0,p=ne(t.fallbackWarn)||Zr(t.fallbackWarn)?t.fallbackWarn:!0,h=!!t.fallbackFormat,m=!!t.unresolving,y=ue(t.postTranslation)?t.postTranslation:null,b=X(t.processor)?t.processor:null,w=ne(t.warnHtmlMessage)?t.warnHtmlMessage:!0,k=!!t.escapeParameter,E=ue(t.messageCompiler)?t.messageCompiler:lm;process.env.NODE_ENV!=="production"&&ue(t.messageCompiler)&&kc(Sr(at.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));const x=ue(t.messageResolver)?t.messageResolver:am||Xx,v=ue(t.localeFallbacker)?t.localeFallbacker:cm||Ux,T=te(t.fallbackContext)?t.fallbackContext:void 0,_=t,P=te(_.__datetimeFormatters)?_.__datetimeFormatters:new Map,V=te(_.__numberFormatters)?_.__numberFormatters:new Map,Z=te(_.__meta)?_.__meta:{};pm++;const q={version:n,cid:pm,locale:r,fallbackLocale:s,messages:i,modifiers:c,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:p,fallbackFormat:h,unresolving:m,postTranslation:y,processor:b,warnHtmlMessage:w,escapeParameter:k,messageCompiler:E,messageResolver:x,localeFallbacker:v,fallbackContext:T,onWarn:e,__meta:Z};return q.datetimeFormats=l,q.numberFormats=a,q.__datetimeFormatters=P,q.__numberFormatters=V,process.env.NODE_ENV!=="production"&&(q.__v_emitter=_.__v_emitter!=null?_.__v_emitter:void 0),(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__)&&Bx(q,n,Z),q}const _c=t=>({[t]:le()});function Ji(t,e){return t instanceof RegExp?t.test(e):t}function hm(t,e){return t instanceof RegExp?t.test(e):t}function Mc(t,e,n,r,o){const{missing:s,onWarn:i}=t;if(process.env.NODE_ENV!=="production"){const l=t.__v_emitter;l&&l.emit("missing",{locale:n,key:e,type:o,groupId:`${o}:${e}`})}if(s!==null){const l=s(t,n,e,o);return B(l)?l:e}else return process.env.NODE_ENV!=="production"&&hm(r,e)&&i(Sr(at.NOT_FOUND_KEY,{key:e,locale:n})),e}function ns(t,e,n){const r=t;r.__localeChainCache=new Map,t.localeFallbacker(t,n,e)}function mm(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function uT(t,e){const n=e.indexOf(t);if(n===-1)return!1;for(let r=n+1;r<e.length;r++)if(mm(t,e[r]))return!0;return!1}const gm=typeof Intl<"u",ym={dateTimeFormat:gm&&typeof Intl.DateTimeFormat<"u",numberFormat:gm&&typeof Intl.NumberFormat<"u"};function bm(t,...e){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:i}=t,{__datetimeFormatters:l}=t;if(process.env.NODE_ENV!=="production"&&!ym.dateTimeFormat)return s(Sr(at.CANNOT_FORMAT_DATE)),qi;const[a,c,u,d]=Rc(...e),f=ne(u.missingWarn)?u.missingWarn:t.missingWarn,p=ne(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn,h=!!u.part,m=Nc(t,u),y=i(t,o,m);if(!B(a)||a==="")return new Intl.DateTimeFormat(m,d).format(c);let b={},w,k=null,E=m,x=null;const v="datetime format";for(let P=0;P<y.length;P++){if(w=x=y[P],process.env.NODE_ENV!=="production"&&m!==w&&Ji(p,a)&&s(Sr(at.FALLBACK_TO_DATE_FORMAT,{key:a,target:w})),process.env.NODE_ENV!=="production"&&m!==w){const V=t.__v_emitter;V&&V.emit("fallback",{type:v,key:a,from:E,to:x,groupId:`${v}:${a}`})}if(b=n[w]||{},k=b[a],X(k))break;Mc(t,a,w,f,v),E=x}if(!X(k)||!B(w))return r?Ki:a;let T=`${w}__${a}`;Hi(d)||(T=`${T}__${JSON.stringify(d)}`);let _=l.get(T);return _||(_=new Intl.DateTimeFormat(w,Re({},k,d)),l.set(T,_)),h?_.formatToParts(c):_.format(c)}const Em=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Rc(...t){const[e,n,r,o]=t,s=le();let i=le(),l;if(B(e)){const a=e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw Cn(qe.INVALID_ISO_DATE_ARGUMENT);const c=a[3]?a[3].trim().startsWith("T")?`${a[1].trim()}${a[3].trim()}`:`${a[1].trim()}T${a[3].trim()}`:a[1].trim();l=new Date(c);try{l.toISOString()}catch{throw Cn(qe.INVALID_ISO_DATE_ARGUMENT)}}else if(Uv(e)){if(isNaN(e.getTime()))throw Cn(qe.INVALID_DATE_ARGUMENT);l=e}else if(_e(e))l=e;else throw Cn(qe.INVALID_ARGUMENT);return B(n)?s.key=n:X(n)&&Object.keys(n).forEach(a=>{Em.includes(a)?i[a]=n[a]:s[a]=n[a]}),B(r)?s.locale=r:X(r)&&(i=r),X(o)&&(i=o),[s.key||"",l,s,i]}function wm(t,e,n){const r=t;for(const o in n){const s=`${e}__${o}`;r.__datetimeFormatters.has(s)&&r.__datetimeFormatters.delete(s)}}function km(t,...e){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:i}=t,{__numberFormatters:l}=t;if(process.env.NODE_ENV!=="production"&&!ym.numberFormat)return s(Sr(at.CANNOT_FORMAT_NUMBER)),qi;const[a,c,u,d]=Lc(...e),f=ne(u.missingWarn)?u.missingWarn:t.missingWarn,p=ne(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn,h=!!u.part,m=Nc(t,u),y=i(t,o,m);if(!B(a)||a==="")return new Intl.NumberFormat(m,d).format(c);let b={},w,k=null,E=m,x=null;const v="number format";for(let P=0;P<y.length;P++){if(w=x=y[P],process.env.NODE_ENV!=="production"&&m!==w&&Ji(p,a)&&s(Sr(at.FALLBACK_TO_NUMBER_FORMAT,{key:a,target:w})),process.env.NODE_ENV!=="production"&&m!==w){const V=t.__v_emitter;V&&V.emit("fallback",{type:v,key:a,from:E,to:x,groupId:`${v}:${a}`})}if(b=n[w]||{},k=b[a],X(k))break;Mc(t,a,w,f,v),E=x}if(!X(k)||!B(w))return r?Ki:a;let T=`${w}__${a}`;Hi(d)||(T=`${T}__${JSON.stringify(d)}`);let _=l.get(T);return _||(_=new Intl.NumberFormat(w,Re({},k,d)),l.set(T,_)),h?_.formatToParts(c):_.format(c)}const Cm=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Lc(...t){const[e,n,r,o]=t,s=le();let i=le();if(!_e(e))throw Cn(qe.INVALID_ARGUMENT);const l=e;return B(n)?s.key=n:X(n)&&Object.keys(n).forEach(a=>{Cm.includes(a)?i[a]=n[a]:s[a]=n[a]}),B(r)?s.locale=r:X(r)&&(i=r),X(o)&&(i=o),[s.key||"",l,s,i]}function Sm(t,e,n){const r=t;for(const o in n){const s=`${e}__${o}`;r.__numberFormatters.has(s)&&r.__numberFormatters.delete(s)}}const dT=t=>t,fT=t=>"",pT="text",hT=t=>t.length===0?"":wc(t),mT=Kv;function vm(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function gT(t){const e=_e(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(_e(t.named.count)||_e(t.named.n))?_e(t.named.count)?t.named.count:_e(t.named.n)?t.named.n:e:e}function yT(t,e){e.count||(e.count=t),e.n||(e.n=t)}function bT(t={}){const e=t.locale,n=gT(t),r=te(t.pluralRules)&&B(e)&&ue(t.pluralRules[e])?t.pluralRules[e]:vm,o=te(t.pluralRules)&&B(e)&&ue(t.pluralRules[e])?vm:void 0,s=b=>b[r(n,b.length,o)],i=t.list||[],l=b=>i[b],a=t.named||le();_e(t.pluralIndex)&&yT(n,a);const c=b=>a[b];function u(b,w){const k=ue(t.messages)?t.messages(b,!!w):te(t.messages)?t.messages[b]:!1;return k||(t.parent?t.parent.message(b):fT)}const d=b=>t.modifiers?t.modifiers[b]:dT,f=X(t.processor)&&ue(t.processor.normalize)?t.processor.normalize:hT,p=X(t.processor)&&ue(t.processor.interpolate)?t.processor.interpolate:mT,h=X(t.processor)&&B(t.processor.type)?t.processor.type:pT,y={list:l,named:c,plural:s,linked:(b,...w)=>{const[k,E]=w;let x="text",v="";w.length===1?te(k)?(v=k.modifier||v,x=k.type||x):B(k)&&(v=k||v):w.length===2&&(B(k)&&(v=k||v),B(E)&&(x=E||x));const T=u(b,!0)(y),_=x==="vnode"&&be(T)&&v?T[0]:T;return v?d(v)(_,x):_},message:u,type:h,interpolate:p,normalize:f,values:Re(le(),i,a)};return y}const xm=()=>"",Mt=t=>ue(t);function Tm(t,...e){const{fallbackFormat:n,postTranslation:r,unresolving:o,messageCompiler:s,fallbackLocale:i,messages:l}=t,[a,c]=Ic(...e),u=ne(c.missingWarn)?c.missingWarn:t.missingWarn,d=ne(c.fallbackWarn)?c.fallbackWarn:t.fallbackWarn,f=ne(c.escapeParameter)?c.escapeParameter:t.escapeParameter,p=!!c.resolvedMessage,h=B(c.default)||ne(c.default)?ne(c.default)?s?a:()=>a:c.default:n?s?a:()=>a:null,m=n||h!=null&&(B(h)||ue(h)),y=Nc(t,c);f&&ET(c);let[b,w,k]=p?[a,y,l[y]||le()]:Om(t,a,y,i,d,u),E=b,x=a;if(!p&&!(B(E)||_t(E)||Mt(E))&&m&&(E=h,x=E),!p&&(!(B(E)||_t(E)||Mt(E))||!B(w)))return o?Ki:a;if(process.env.NODE_ENV!=="production"&&B(E)&&t.messageCompiler==null)return Jn(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${a}'.`),a;let v=!1;const T=()=>{v=!0},_=Mt(E)?E:Nm(t,a,w,E,x,T);if(v)return E;const P=ST(t,w,k,c),V=bT(P),Z=wT(t,_,V),q=r?r(Z,a):Z;if(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const re={timestamp:Date.now(),key:B(a)?a:Mt(E)?E.key:"",locale:w||(Mt(E)?E.locale:""),format:B(E)?E:Mt(E)?E.source:"",message:q};re.meta=Re({},t.__meta,lT()||{}),Fx(re)}return q}function ET(t){be(t.list)?t.list=t.list.map(e=>B(e)?$h(e):e):te(t.named)&&Object.keys(t.named).forEach(e=>{B(t.named[e])&&(t.named[e]=$h(t.named[e]))})}function Om(t,e,n,r,o,s){const{messages:i,onWarn:l,messageResolver:a,localeFallbacker:c}=t,u=c(t,r,n);let d=le(),f,p=null,h=n,m=null;const y="translate";for(let b=0;b<u.length;b++){if(f=m=u[b],process.env.NODE_ENV!=="production"&&n!==f&&!mm(n,f)&&Ji(o,e)&&l(Sr(at.FALLBACK_TO_TRANSLATE,{key:e,target:f})),process.env.NODE_ENV!=="production"&&n!==f){const x=t.__v_emitter;x&&x.emit("fallback",{type:y,key:e,from:h,to:m,groupId:`${y}:${e}`})}d=i[f]||le();let w=null,k,E;if(process.env.NODE_ENV!=="production"&&$t&&(w=window.performance.now(),k="intlify-message-resolve-start",E="intlify-message-resolve-end",bt&&bt(k)),(p=a(d,e))===null&&(p=d[e]),process.env.NODE_ENV!=="production"&&$t){const x=window.performance.now(),v=t.__v_emitter;v&&w&&p&&v.emit("message-resolve",{type:"message-resolve",key:e,message:p,time:x-w,groupId:`${y}:${e}`}),k&&E&&bt&&kr&&(bt(E),kr("intlify message resolve",k,E))}if(B(p)||_t(p)||Mt(p))break;if(!uT(f,u)){const x=Mc(t,e,f,s,y);x!==e&&(p=x)}h=m}return[p,f,d]}function Nm(t,e,n,r,o,s){const{messageCompiler:i,warnHtmlMessage:l}=t;if(Mt(r)){const f=r;return f.locale=f.locale||n,f.key=f.key||e,f}if(i==null){const f=()=>r;return f.locale=n,f.key=e,f}let a=null,c,u;process.env.NODE_ENV!=="production"&&$t&&(a=window.performance.now(),c="intlify-message-compilation-start",u="intlify-message-compilation-end",bt&&bt(c));const d=i(r,kT(t,n,o,r,l,s));if(process.env.NODE_ENV!=="production"&&$t){const f=window.performance.now(),p=t.__v_emitter;p&&a&&p.emit("message-compilation",{type:"message-compilation",message:r,time:f-a,groupId:`translate:${e}`}),c&&u&&bt&&kr&&(bt(u),kr("intlify message compilation",c,u))}return d.locale=n,d.key=e,d.source=r,d}function wT(t,e,n){let r=null,o,s;process.env.NODE_ENV!=="production"&&$t&&(r=window.performance.now(),o="intlify-message-evaluation-start",s="intlify-message-evaluation-end",bt&&bt(o));const i=e(n);if(process.env.NODE_ENV!=="production"&&$t){const l=window.performance.now(),a=t.__v_emitter;a&&r&&a.emit("message-evaluation",{type:"message-evaluation",value:i,time:l-r,groupId:`translate:${e.key}`}),o&&s&&bt&&kr&&(bt(s),kr("intlify message evaluation",o,s))}return i}function Ic(...t){const[e,n,r]=t,o=le();if(!B(e)&&!_e(e)&&!Mt(e)&&!_t(e))throw Cn(qe.INVALID_ARGUMENT);const s=_e(e)?String(e):(Mt(e),e);return _e(n)?o.plural=n:B(n)?o.default=n:X(n)&&!Hi(n)?o.named=n:be(n)&&(o.list=n),_e(r)?o.plural=r:B(r)?o.default=r:X(r)&&Re(o,r),[s,o]}function kT(t,e,n,r,o,s){return{locale:e,key:n,warnHtmlMessage:o,onError:i=>{if(s&&s(i),process.env.NODE_ENV!=="production"){const l=CT(r),a=`Message compilation error: ${i.message}`,c=i.location&&l&&qv(l,i.location.start.offset,i.location.end.offset),u=t.__v_emitter;u&&l&&u.emit("compile-error",{message:l,error:i.message,start:i.location&&i.location.start.offset,end:i.location&&i.location.end.offset,groupId:`translate:${n}`}),console.error(c?`${a}
133
- ${c}`:a)}else throw i},onCacheKey:i=>Vv(e,n,i)}}function CT(t){if(B(t))return t;if(t.loc&&t.loc.source)return t.loc.source}function ST(t,e,n,r){const{modifiers:o,pluralRules:s,messageResolver:i,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=t,f={locale:e,modifiers:o,pluralRules:s,messages:(p,h)=>{let m=i(n,p);if(m==null&&(u||h)){const[,,y]=Om(u||t,p,e,l,a,c);m=i(y,p)}if(B(m)||_t(m)){let y=!1;const w=Nm(t,p,e,m,p,()=>{y=!0});return y?xm:w}else return Mt(m)?m:xm}};return t.processor&&(f.processor=t.processor),r.list&&(f.list=r.list),r.named&&(f.named=r.named),_e(r.plural)&&(f.pluralIndex=r.plural),f}Sx();function vT(){return Am().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Am(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const xT=typeof Proxy=="function",TT="devtools-plugin:setup",OT="plugin:settings:set";let ro,Dc;function NT(){var t;return ro!==void 0||(typeof window<"u"&&window.performance?(ro=!0,Dc=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?(ro=!0,Dc=globalThis.perf_hooks.performance):ro=!1),ro}function AT(){return NT()?Dc.now():Date.now()}class _T{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const r={};if(e.settings)for(const i in e.settings){const l=e.settings[i];r[i]=l.defaultValue}const o=`__vue-devtools-plugin-settings__${e.id}`;let s=Object.assign({},r);try{const i=localStorage.getItem(o),l=JSON.parse(i);Object.assign(s,l)}catch{}this.fallbacks={getSettings(){return s},setSettings(i){try{localStorage.setItem(o,JSON.stringify(i))}catch{}s=i},now(){return AT()}},n&&n.on(OT,(i,l)=>{i===this.plugin.id&&this.fallbacks.setSettings(l)}),this.proxiedOn=new Proxy({},{get:(i,l)=>this.target?this.target.on[l]:(...a)=>{this.onQueue.push({method:l,args:a})}}),this.proxiedTarget=new Proxy({},{get:(i,l)=>this.target?this.target[l]:l==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(l)?(...a)=>(this.targetQueue.push({method:l,args:a,resolve:()=>{}}),this.fallbacks[l](...a)):(...a)=>new Promise(c=>{this.targetQueue.push({method:l,args:a,resolve:c})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function MT(t,e){const n=t,r=Am(),o=vT(),s=xT&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))o.emit(TT,t,e);else{const i=s?new _T(n,o):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:i}),i&&e(i.proxiedTarget)}}/*!
132
+ */function JS(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(vr().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(vr().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Ft(t){return ue(t)&&Oc(t)===0&&(qt(t,"b")||qt(t,"body"))}const Pm=["b","body"];function YS(t){return Qn(t,Pm)}const Im=["c","cases"];function XS(t){return Qn(t,Im,[])}const Dm=["s","static"];function QS(t){return Qn(t,Dm)}const Bm=["i","items"];function ZS(t){return Qn(t,Bm,[])}const Fm=["t","type"];function Oc(t){return Qn(t,Fm)}const $m=["v","value"];function Ws(t,e){const n=Qn(t,$m);if(n!=null)return n;throw ei(e)}const Vm=["m","modifier"];function eT(t){return Qn(t,Vm)}const Hm=["k","key"];function tT(t){const e=Qn(t,Hm);if(e)return e;throw ei(6)}function Qn(t,e,n){for(let r=0;r<e.length;r++){const o=e[r];if(qt(t,o)&&t[o]!=null)return t[o]}return n}const zm=[...Pm,...Im,...Dm,...Bm,...Hm,...Vm,...$m,...Fm];function ei(t){return new Error(`unhandled node type: ${t}`)}function Mc(t){return n=>nT(n,t)}function nT(t,e){const n=YS(e);if(n==null)throw ei(0);if(Oc(n)===1){const i=XS(n);return t.plural(i.reduce((s,a)=>[...s,jm(t,a)],[]))}else return jm(t,n)}function jm(t,e){const n=QS(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const r=ZS(e).reduce((o,i)=>[...o,xc(t,i)],[]);return t.normalize(r)}}function xc(t,e){const n=Oc(e);switch(n){case 3:return Ws(e,n);case 9:return Ws(e,n);case 4:{const r=e;if(qt(r,"k")&&r.k)return t.interpolate(t.named(r.k));if(qt(r,"key")&&r.key)return t.interpolate(t.named(r.key));throw ei(n)}case 5:{const r=e;if(qt(r,"i")&&Ve(r.i))return t.interpolate(t.list(r.i));if(qt(r,"index")&&Ve(r.index))return t.interpolate(t.list(r.index));throw ei(n)}case 6:{const r=e,o=eT(r),i=tT(r);return t.linked(xc(t,i),o?xc(t,o):void 0,t.type)}case 7:return Ws(e,n);case 8:return Ws(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const rT="Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";function oT(t,e){e&&SS(t)&&Yn(Hs(rT,{source:t}))}const iT=t=>t;let Ks=be();function sT(t,e={}){let n=!1;const r=e.onError||vS;return e.onError=o=>{n=!0,r(o)},{...GS(t,e),detectError:n}}function aT(t,e){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&K(t)){const n=de(e.warnHtmlMessage)?e.warnHtmlMessage:!0;process.env.NODE_ENV!=="production"&&oT(t,n);const o=(e.onCacheKey||iT)(t),i=Ks[o];if(i)return i;const{ast:s,detectError:a}=sT(t,{...e,location:process.env.NODE_ENV!=="production",jit:!0}),l=Mc(s);return a?l:Ks[o]=l}else{if(process.env.NODE_ENV!=="production"&&!Ft(t))return Yn(`the message that is resolve with key '${e.key}' is not supported for jit compilation`),()=>t;const n=t.cacheKey;if(n){const r=Ks[n];return r||(Ks[n]=Mc(t))}else return Mc(t)}}let ti=null;function lT(t){ti=t}function cT(t,e,n){ti&&ti.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:n})}const uT=dT("function:translate");function dT(t){return e=>ti&&ti.emit(t,e)}const tt={INVALID_ARGUMENT:_S,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},fT=24;function Cn(t){return to(t,null,process.env.NODE_ENV!=="production"?{messages:pT}:void 0)}const pT={[tt.INVALID_ARGUMENT]:"Invalid arguments",[tt.INVALID_DATE_ARGUMENT]:"The date provided is an invalid Date object.Make sure your Date represents a valid date.",[tt.INVALID_ISO_DATE_ARGUMENT]:"The argument provided is not a valid ISO date string",[tt.NOT_SUPPORT_NON_STRING_MESSAGE]:"Not support non-string message",[tt.NOT_SUPPORT_LOCALE_PROMISE_VALUE]:"cannot support promise value",[tt.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]:"cannot support async function",[tt.NOT_SUPPORT_LOCALE_TYPE]:"cannot support locale type"};function Lc(t,e){return e.locale!=null?Um(e.locale):Um(t.locale)}let Rc;function Um(t){if(K(t))return t;if(Ee(t)){if(t.resolvedOnce&&Rc!=null)return Rc;if(t.constructor.name==="Function"){const e=t();if(bS(e))throw Cn(tt.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Rc=e}else throw Cn(tt.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Cn(tt.NOT_SUPPORT_LOCALE_TYPE)}function hT(t,e,n){return[...new Set([n,...xe(e)?e:ue(e)?Object.keys(e):K(e)?[e]:[n]])]}function Wm(t,e,n){const r=K(n)?n:ni,o=t;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(r);if(!i){i=[];let s=[n];for(;xe(s);)s=Km(i,s,e);const a=xe(e)||!ae(e)?e:e.default?e.default:null;s=K(a)?[a]:a,xe(s)&&Km(i,s,!1),o.__localeChainCache.set(r,i)}return i}function Km(t,e,n){let r=!0;for(let o=0;o<e.length&&de(r);o++){const i=e[o];K(i)&&(r=mT(t,e[o],n))}return r}function mT(t,e,n){let r;const o=e.split("-");do{const i=o.join("-");r=gT(t,i,n),o.splice(-1,1)}while(o.length&&r===!0);return r}function gT(t,e,n){let r=!1;if(!t.includes(e)&&(r=!0,e)){r=e[e.length-1]!=="!";const o=e.replace(/!/g,"");t.push(o),(xe(n)||ae(n))&&n[o]&&(r=n[o])}return r}const Zn=[];Zn[0]={w:[0],i:[3,0],"[":[4],o:[7]},Zn[1]={w:[1],".":[2],"[":[4],o:[7]},Zn[2]={w:[2],i:[3,0],0:[3,0]},Zn[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},Zn[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},Zn[5]={"'":[4,0],o:8,l:[5,0]},Zn[6]={'"':[4,0],o:8,l:[6,0]};const bT=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function yT(t){return bT.test(t)}function wT(t){const e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e===n&&(e===34||e===39)?t.slice(1,-1):t}function kT(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function _T(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:yT(e)?wT(e):"*"+e}function ET(t){const e=[];let n=-1,r=0,o=0,i,s,a,l,c,u,f;const p=[];p[0]=()=>{s===void 0?s=a:s+=a},p[1]=()=>{s!==void 0&&(e.push(s),s=void 0)},p[2]=()=>{p[0](),o++},p[3]=()=>{if(o>0)o--,r=4,p[0]();else{if(o=0,s===void 0||(s=_T(s),s===!1))return!1;p[1]()}};function m(){const b=t[n+1];if(r===5&&b==="'"||r===6&&b==='"')return n++,a="\\"+b,p[0](),!0}for(;r!==null;)if(n++,i=t[n],!(i==="\\"&&m())){if(l=kT(i),f=Zn[r],c=f[l]||f.l||8,c===8||(r=c[0],c[1]!==void 0&&(u=p[c[1]],u&&(a=i,u()===!1))))return;if(r===7)return e}}const qm=new Map;function vT(t,e){return ue(t)?t[e]:null}function CT(t,e){if(!ue(t))return null;let n=qm.get(e);if(n||(n=ET(e),n&&qm.set(e,n)),!n)return null;const r=n.length;let o=t,i=0;for(;i<r;){const s=n[i];if(zm.includes(s)&&Ft(o))return null;const a=o[s];if(a===void 0||Ee(o))return null;o=a,i++}return o}const yt={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7},ST=8,TT={[yt.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[yt.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[yt.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[yt.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[yt.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[yt.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[yt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function Cr(t,...e){return Hs(TT[t],...e)}const NT="11.1.7",qs=-1,ni="en-US",Gs="",Gm=t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function AT(){return{upper:(t,e)=>e==="text"&&K(t)?t.toUpperCase():e==="vnode"&&ue(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&K(t)?t.toLowerCase():e==="vnode"&&ue(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&K(t)?Gm(t):e==="vnode"&&ue(t)&&"__v_isVNode"in t?Gm(t.children):t}}let Jm;function OT(t){Jm=t}let Ym;function MT(t){Ym=t}let Xm;function xT(t){Xm=t}let Qm=null;const LT=t=>{Qm=t},RT=()=>Qm;let Zm=null;const eg=t=>{Zm=t},PT=()=>Zm;let tg=0;function IT(t={}){const e=Ee(t.onWarn)?t.onWarn:Yn,n=K(t.version)?t.version:NT,r=K(t.locale)||Ee(t.locale)?t.locale:ni,o=Ee(r)?ni:r,i=xe(t.fallbackLocale)||ae(t.fallbackLocale)||K(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:o,s=ae(t.messages)?t.messages:Pc(o),a=ae(t.datetimeFormats)?t.datetimeFormats:Pc(o),l=ae(t.numberFormats)?t.numberFormats:Pc(o),c=He(be(),t.modifiers,AT()),u=t.pluralRules||be(),f=Ee(t.missing)?t.missing:null,p=de(t.missingWarn)||eo(t.missingWarn)?t.missingWarn:!0,m=de(t.fallbackWarn)||eo(t.fallbackWarn)?t.fallbackWarn:!0,b=!!t.fallbackFormat,k=!!t.unresolving,_=Ee(t.postTranslation)?t.postTranslation:null,E=ae(t.processor)?t.processor:null,N=de(t.warnHtmlMessage)?t.warnHtmlMessage:!0,A=!!t.escapeParameter,d=Ee(t.messageCompiler)?t.messageCompiler:Jm;process.env.NODE_ENV!=="production"&&Ee(t.messageCompiler)&&Sc(Cr(yt.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));const g=Ee(t.messageResolver)?t.messageResolver:Ym||vT,h=Ee(t.localeFallbacker)?t.localeFallbacker:Xm||hT,w=ue(t.fallbackContext)?t.fallbackContext:void 0,v=t,S=ue(v.__datetimeFormatters)?v.__datetimeFormatters:new Map,C=ue(v.__numberFormatters)?v.__numberFormatters:new Map,M=ue(v.__meta)?v.__meta:{};tg++;const P={version:n,cid:tg,locale:r,fallbackLocale:i,messages:s,modifiers:c,pluralRules:u,missing:f,missingWarn:p,fallbackWarn:m,fallbackFormat:b,unresolving:k,postTranslation:_,processor:E,warnHtmlMessage:N,escapeParameter:A,messageCompiler:d,messageResolver:g,localeFallbacker:h,fallbackContext:w,onWarn:e,__meta:M};return P.datetimeFormats=a,P.numberFormats=l,P.__datetimeFormatters=S,P.__numberFormatters=C,process.env.NODE_ENV!=="production"&&(P.__v_emitter=v.__v_emitter!=null?v.__v_emitter:void 0),(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__)&&cT(P,n,M),P}const Pc=t=>({[t]:be()});function Js(t,e){return t instanceof RegExp?t.test(e):t}function ng(t,e){return t instanceof RegExp?t.test(e):t}function Ic(t,e,n,r,o){const{missing:i,onWarn:s}=t;if(process.env.NODE_ENV!=="production"){const a=t.__v_emitter;a&&a.emit("missing",{locale:n,key:e,type:o,groupId:`${o}:${e}`})}if(i!==null){const a=i(t,n,e,o);return K(a)?a:e}else return process.env.NODE_ENV!=="production"&&ng(r,e)&&s(Cr(yt.NOT_FOUND_KEY,{key:e,locale:n})),e}function ri(t,e,n){const r=t;r.__localeChainCache=new Map,t.localeFallbacker(t,n,e)}function rg(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function DT(t,e){const n=e.indexOf(t);if(n===-1)return!1;for(let r=n+1;r<e.length;r++)if(rg(t,e[r]))return!0;return!1}const og=typeof Intl<"u",ig={dateTimeFormat:og&&typeof Intl.DateTimeFormat<"u",numberFormat:og&&typeof Intl.NumberFormat<"u"};function sg(t,...e){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:i,localeFallbacker:s}=t,{__datetimeFormatters:a}=t;if(process.env.NODE_ENV!=="production"&&!ig.dateTimeFormat)return i(Cr(yt.CANNOT_FORMAT_DATE)),Gs;const[l,c,u,f]=Dc(...e),p=de(u.missingWarn)?u.missingWarn:t.missingWarn,m=de(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn,b=!!u.part,k=Lc(t,u),_=s(t,o,k);if(!K(l)||l==="")return new Intl.DateTimeFormat(k,f).format(c);let E={},N,A=null,d=k,g=null;const h="datetime format";for(let S=0;S<_.length;S++){if(N=g=_[S],process.env.NODE_ENV!=="production"&&k!==N&&Js(m,l)&&i(Cr(yt.FALLBACK_TO_DATE_FORMAT,{key:l,target:N})),process.env.NODE_ENV!=="production"&&k!==N){const C=t.__v_emitter;C&&C.emit("fallback",{type:h,key:l,from:d,to:g,groupId:`${h}:${l}`})}if(E=n[N]||{},A=E[l],ae(A))break;Ic(t,l,N,p,h),d=g}if(!ae(A)||!K(N))return r?qs:l;let w=`${N}__${l}`;zs(f)||(w=`${w}__${JSON.stringify(f)}`);let v=a.get(w);return v||(v=new Intl.DateTimeFormat(N,He({},A,f)),a.set(w,v)),b?v.formatToParts(c):v.format(c)}const ag=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Dc(...t){const[e,n,r,o]=t,i=be();let s=be(),a;if(K(e)){const l=e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!l)throw Cn(tt.INVALID_ISO_DATE_ARGUMENT);const c=l[3]?l[3].trim().startsWith("T")?`${l[1].trim()}${l[3].trim()}`:`${l[1].trim()}T${l[3].trim()}`:l[1].trim();a=new Date(c);try{a.toISOString()}catch{throw Cn(tt.INVALID_ISO_DATE_ARGUMENT)}}else if(hS(e)){if(isNaN(e.getTime()))throw Cn(tt.INVALID_DATE_ARGUMENT);a=e}else if(Ve(e))a=e;else throw Cn(tt.INVALID_ARGUMENT);return K(n)?i.key=n:ae(n)&&Object.keys(n).forEach(l=>{ag.includes(l)?s[l]=n[l]:i[l]=n[l]}),K(r)?i.locale=r:ae(r)&&(s=r),ae(o)&&(s=o),[i.key||"",a,i,s]}function lg(t,e,n){const r=t;for(const o in n){const i=`${e}__${o}`;r.__datetimeFormatters.has(i)&&r.__datetimeFormatters.delete(i)}}function cg(t,...e){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:i,localeFallbacker:s}=t,{__numberFormatters:a}=t;if(process.env.NODE_ENV!=="production"&&!ig.numberFormat)return i(Cr(yt.CANNOT_FORMAT_NUMBER)),Gs;const[l,c,u,f]=Bc(...e),p=de(u.missingWarn)?u.missingWarn:t.missingWarn,m=de(u.fallbackWarn)?u.fallbackWarn:t.fallbackWarn,b=!!u.part,k=Lc(t,u),_=s(t,o,k);if(!K(l)||l==="")return new Intl.NumberFormat(k,f).format(c);let E={},N,A=null,d=k,g=null;const h="number format";for(let S=0;S<_.length;S++){if(N=g=_[S],process.env.NODE_ENV!=="production"&&k!==N&&Js(m,l)&&i(Cr(yt.FALLBACK_TO_NUMBER_FORMAT,{key:l,target:N})),process.env.NODE_ENV!=="production"&&k!==N){const C=t.__v_emitter;C&&C.emit("fallback",{type:h,key:l,from:d,to:g,groupId:`${h}:${l}`})}if(E=n[N]||{},A=E[l],ae(A))break;Ic(t,l,N,p,h),d=g}if(!ae(A)||!K(N))return r?qs:l;let w=`${N}__${l}`;zs(f)||(w=`${w}__${JSON.stringify(f)}`);let v=a.get(w);return v||(v=new Intl.NumberFormat(N,He({},A,f)),a.set(w,v)),b?v.formatToParts(c):v.format(c)}const ug=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Bc(...t){const[e,n,r,o]=t,i=be();let s=be();if(!Ve(e))throw Cn(tt.INVALID_ARGUMENT);const a=e;return K(n)?i.key=n:ae(n)&&Object.keys(n).forEach(l=>{ug.includes(l)?s[l]=n[l]:i[l]=n[l]}),K(r)?i.locale=r:ae(r)&&(s=r),ae(o)&&(s=o),[i.key||"",a,i,s]}function dg(t,e,n){const r=t;for(const o in n){const i=`${e}__${o}`;r.__numberFormatters.has(i)&&r.__numberFormatters.delete(i)}}const BT=t=>t,FT=t=>"",$T="text",VT=t=>t.length===0?"":Cc(t),HT=yS;function fg(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function zT(t){const e=Ve(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(Ve(t.named.count)||Ve(t.named.n))?Ve(t.named.count)?t.named.count:Ve(t.named.n)?t.named.n:e:e}function jT(t,e){e.count||(e.count=t),e.n||(e.n=t)}function UT(t={}){const e=t.locale,n=zT(t),r=ue(t.pluralRules)&&K(e)&&Ee(t.pluralRules[e])?t.pluralRules[e]:fg,o=ue(t.pluralRules)&&K(e)&&Ee(t.pluralRules[e])?fg:void 0,i=E=>E[r(n,E.length,o)],s=t.list||[],a=E=>s[E],l=t.named||be();Ve(t.pluralIndex)&&jT(n,l);const c=E=>l[E];function u(E,N){const A=Ee(t.messages)?t.messages(E,!!N):ue(t.messages)?t.messages[E]:!1;return A||(t.parent?t.parent.message(E):FT)}const f=E=>t.modifiers?t.modifiers[E]:BT,p=ae(t.processor)&&Ee(t.processor.normalize)?t.processor.normalize:VT,m=ae(t.processor)&&Ee(t.processor.interpolate)?t.processor.interpolate:HT,b=ae(t.processor)&&K(t.processor.type)?t.processor.type:$T,_={list:a,named:c,plural:i,linked:(E,...N)=>{const[A,d]=N;let g="text",h="";N.length===1?ue(A)?(h=A.modifier||h,g=A.type||g):K(A)&&(h=A||h):N.length===2&&(K(A)&&(h=A||h),K(d)&&(g=d||g));const w=u(E,!0)(_),v=g==="vnode"&&xe(w)&&h?w[0]:w;return h?f(h)(v,g):v},message:u,type:b,interpolate:m,normalize:p,values:He(be(),s,l)};return _}const pg=()=>"",$t=t=>Ee(t);function hg(t,...e){const{fallbackFormat:n,postTranslation:r,unresolving:o,messageCompiler:i,fallbackLocale:s,messages:a}=t,[l,c]=Fc(...e),u=de(c.missingWarn)?c.missingWarn:t.missingWarn,f=de(c.fallbackWarn)?c.fallbackWarn:t.fallbackWarn,p=de(c.escapeParameter)?c.escapeParameter:t.escapeParameter,m=!!c.resolvedMessage,b=K(c.default)||de(c.default)?de(c.default)?i?l:()=>l:c.default:n?i?l:()=>l:null,k=n||b!=null&&(K(b)||Ee(b)),_=Lc(t,c);p&&WT(c);let[E,N,A]=m?[l,_,a[_]||be()]:mg(t,l,_,s,f,u),d=E,g=l;if(!m&&!(K(d)||Ft(d)||$t(d))&&k&&(d=b,g=d),!m&&(!(K(d)||Ft(d)||$t(d))||!K(N)))return o?qs:l;if(process.env.NODE_ENV!=="production"&&K(d)&&t.messageCompiler==null)return Yn(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${l}'.`),l;let h=!1;const w=()=>{h=!0},v=$t(d)?d:gg(t,l,N,d,g,w);if(h)return d;const S=JT(t,N,A,c),C=UT(S),M=KT(t,v,C),P=r?r(M,l):M;if(process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const D={timestamp:Date.now(),key:K(l)?l:$t(d)?d.key:"",locale:N||($t(d)?d.locale:""),format:K(d)?d:$t(d)?d.source:"",message:P};D.meta=He({},t.__meta,RT()||{}),uT(D)}return P}function WT(t){xe(t.list)?t.list=t.list.map(e=>K(e)?Nm(e):e):ue(t.named)&&Object.keys(t.named).forEach(e=>{K(t.named[e])&&(t.named[e]=Nm(t.named[e]))})}function mg(t,e,n,r,o,i){const{messages:s,onWarn:a,messageResolver:l,localeFallbacker:c}=t,u=c(t,r,n);let f=be(),p,m=null,b=n,k=null;const _="translate";for(let E=0;E<u.length;E++){if(p=k=u[E],process.env.NODE_ENV!=="production"&&n!==p&&!rg(n,p)&&Js(o,e)&&a(Cr(yt.FALLBACK_TO_TRANSLATE,{key:e,target:p})),process.env.NODE_ENV!=="production"&&n!==p){const g=t.__v_emitter;g&&g.emit("fallback",{type:_,key:e,from:b,to:k,groupId:`${_}:${e}`})}f=s[p]||be();let N=null,A,d;if(process.env.NODE_ENV!=="production"&&Kt&&(N=window.performance.now(),A="intlify-message-resolve-start",d="intlify-message-resolve-end",Nt&&Nt(A)),(m=l(f,e))===null&&(m=f[e]),process.env.NODE_ENV!=="production"&&Kt){const g=window.performance.now(),h=t.__v_emitter;h&&N&&m&&h.emit("message-resolve",{type:"message-resolve",key:e,message:m,time:g-N,groupId:`${_}:${e}`}),A&&d&&Nt&&Er&&(Nt(d),Er("intlify message resolve",A,d))}if(K(m)||Ft(m)||$t(m))break;if(!DT(p,u)){const g=Ic(t,e,p,i,_);g!==e&&(m=g)}b=k}return[m,p,f]}function gg(t,e,n,r,o,i){const{messageCompiler:s,warnHtmlMessage:a}=t;if($t(r)){const p=r;return p.locale=p.locale||n,p.key=p.key||e,p}if(s==null){const p=()=>r;return p.locale=n,p.key=e,p}let l=null,c,u;process.env.NODE_ENV!=="production"&&Kt&&(l=window.performance.now(),c="intlify-message-compilation-start",u="intlify-message-compilation-end",Nt&&Nt(c));const f=s(r,qT(t,n,o,r,a,i));if(process.env.NODE_ENV!=="production"&&Kt){const p=window.performance.now(),m=t.__v_emitter;m&&l&&m.emit("message-compilation",{type:"message-compilation",message:r,time:p-l,groupId:`translate:${e}`}),c&&u&&Nt&&Er&&(Nt(u),Er("intlify message compilation",c,u))}return f.locale=n,f.key=e,f.source=r,f}function KT(t,e,n){let r=null,o,i;process.env.NODE_ENV!=="production"&&Kt&&(r=window.performance.now(),o="intlify-message-evaluation-start",i="intlify-message-evaluation-end",Nt&&Nt(o));const s=e(n);if(process.env.NODE_ENV!=="production"&&Kt){const a=window.performance.now(),l=t.__v_emitter;l&&r&&l.emit("message-evaluation",{type:"message-evaluation",value:s,time:a-r,groupId:`translate:${e.key}`}),o&&i&&Nt&&Er&&(Nt(i),Er("intlify message evaluation",o,i))}return s}function Fc(...t){const[e,n,r]=t,o=be();if(!K(e)&&!Ve(e)&&!$t(e)&&!Ft(e))throw Cn(tt.INVALID_ARGUMENT);const i=Ve(e)?String(e):($t(e),e);return Ve(n)?o.plural=n:K(n)?o.default=n:ae(n)&&!zs(n)?o.named=n:xe(n)&&(o.list=n),Ve(r)?o.plural=r:K(r)?o.default=r:ae(r)&&He(o,r),[i,o]}function qT(t,e,n,r,o,i){return{locale:e,key:n,warnHtmlMessage:o,onError:s=>{if(i&&i(s),process.env.NODE_ENV!=="production"){const a=GT(r),l=`Message compilation error: ${s.message}`,c=s.location&&a&&wS(a,s.location.start.offset,s.location.end.offset),u=t.__v_emitter;u&&a&&u.emit("compile-error",{message:a,error:s.message,start:s.location&&s.location.start.offset,end:s.location&&s.location.end.offset,groupId:`translate:${n}`}),console.error(c?`${l}
133
+ ${c}`:l)}else throw s},onCacheKey:s=>fS(e,n,s)}}function GT(t){if(K(t))return t;if(t.loc&&t.loc.source)return t.loc.source}function JT(t,e,n,r){const{modifiers:o,pluralRules:i,messageResolver:s,fallbackLocale:a,fallbackWarn:l,missingWarn:c,fallbackContext:u}=t,p={locale:e,modifiers:o,pluralRules:i,messages:(m,b)=>{let k=s(n,m);if(k==null&&(u||b)){const[,,_]=mg(u||t,m,e,a,l,c);k=s(_,m)}if(K(k)||Ft(k)){let _=!1;const N=gg(t,m,e,k,m,()=>{_=!0});return _?pg:N}else return $t(k)?k:pg}};return t.processor&&(p.processor=t.processor),r.list&&(p.list=r.list),r.named&&(p.named=r.named),Ve(r.plural)&&(p.pluralIndex=r.plural),p}JS();function YT(){return bg().__VUE_DEVTOOLS_GLOBAL_HOOK__}function bg(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const XT=typeof Proxy=="function",QT="devtools-plugin:setup",ZT="plugin:settings:set";let oo,$c;function e3(){var t;return oo!==void 0||(typeof window<"u"&&window.performance?(oo=!0,$c=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?(oo=!0,$c=globalThis.perf_hooks.performance):oo=!1),oo}function t3(){return e3()?$c.now():Date.now()}class n3{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const r={};if(e.settings)for(const s in e.settings){const a=e.settings[s];r[s]=a.defaultValue}const o=`__vue-devtools-plugin-settings__${e.id}`;let i=Object.assign({},r);try{const s=localStorage.getItem(o),a=JSON.parse(s);Object.assign(i,a)}catch{}this.fallbacks={getSettings(){return i},setSettings(s){try{localStorage.setItem(o,JSON.stringify(s))}catch{}i=s},now(){return t3()}},n&&n.on(ZT,(s,a)=>{s===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(s,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(s,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(c=>{this.targetQueue.push({method:a,args:l,resolve:c})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function r3(t,e){const n=t,r=bg(),o=YT(),i=XT&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!i))o.emit(QT,t,e);else{const s=i?new n3(n,o):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:s}),s&&e(s.proxiedTarget)}}/*!
134
134
  * vue-i18n v11.1.7
135
135
  * (c) 2025 kazuya kawaguchi
136
136
  * Released under the MIT License.
137
- */const RT="11.1.7";function LT(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Cr().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Cr().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Cr().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Cr().__INTLIFY_PROD_DEVTOOLS__=!1)}const ae={UNEXPECTED_RETURN_TYPE:Vx,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34,DUPLICATE_USE_I18N_CALLING:35};function et(t,...e){return eo(t,null,process.env.NODE_ENV!=="production"?{messages:IT,args:e}:void 0)}const IT={[ae.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[ae.INVALID_ARGUMENT]:"Invalid argument",[ae.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[ae.NOT_INSTALLED]:"Need to install with `app.use` function",[ae.UNEXPECTED_ERROR]:"Unexpected error",[ae.REQUIRED_VALUE]:"Required in value: {0}",[ae.INVALID_VALUE]:"Invalid value",[ae.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[ae.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[ae.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[ae.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly",[ae.DUPLICATE_USE_I18N_CALLING]:"Duplicate `useI18n` calling by local scope. Please don't call it on local scope"},Pc=tn("__translateVNode"),Bc=tn("__datetimeParts"),Fc=tn("__numberParts"),vr=tn("__enableEmitter"),rs=tn("__disableEmitter"),_m=tn("__setPluralRules"),Mm=tn("__injectWithOption"),$c=tn("__dispose"),rn={FALLBACK_TO_ROOT:Zx,NOT_FOUND_PARENT_SCOPE:9,IGNORE_OBJ_FLATTEN:10,DEPRECATE_LEGACY_MODE:11,DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE:12},DT={[rn.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[rn.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[rn.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[rn.DEPRECATE_LEGACY_MODE]:`Legacy API mode has been deprecated in v11. Use Composition API mode instead.
138
- About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,[rn.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]:"'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead."};function ss(t,...e){return Vi(DT[t],...e)}function is(t){if(!te(t)||_t(t))return t;for(const e in t)if(Vt(t,e))if(!e.includes("."))te(t[e])&&is(t[e]);else{const n=e.split("."),r=n.length-1;let o=t,s=!1;for(let i=0;i<r;i++){if(n[i]==="__proto__")throw new Error(`unsafe key: ${n[i]}`);if(n[i]in o||(o[n[i]]=le()),!te(o[n[i]])){process.env.NODE_ENV!=="production"&&Jn(ss(rn.IGNORE_OBJ_FLATTEN,{key:n[i]})),s=!0;break}o=o[n[i]]}if(s||(_t(o)?em.includes(n[r])||delete t[e]:(o[n[r]]=t[e],delete t[e])),!_t(o)){const i=o[n[r]];te(i)&&is(i)}}return t}function Vc(t,e){const{messages:n,__i18n:r,messageResolver:o,flatJson:s}=e,i=X(n)?n:be(r)?le():{[t]:le()};if(be(r)&&r.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(i[a]=i[a]||le(),zi(c,i[a])):zi(c,i)}else B(l)&&zi(JSON.parse(l),i)}),o==null&&s)for(const l in i)Vt(i,l)&&is(i[l]);return i}function Rm(t){return t.type}function Lm(t,e,n){let r=te(e.messages)?e.messages:le();"__i18nGlobal"in n&&(r=Vc(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const o=Object.keys(r);o.length&&o.forEach(s=>{t.mergeLocaleMessage(s,r[s])});{if(te(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(i=>{t.mergeDateTimeFormat(i,e.datetimeFormats[i])})}if(te(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(i=>{t.mergeNumberFormat(i,e.numberFormats[i])})}}}function Im(t){return g.createVNode(g.Text,null,t,0)}const Dm="__INTLIFY_META__",Pm=()=>[],PT=()=>!1;let Bm=0;function Fm(t){return(e,n,r,o)=>t(n,r,g.getCurrentInstance()||void 0,o)}const BT=()=>{const t=g.getCurrentInstance();let e=null;return t&&(e=Rm(t)[Dm])?{[Dm]:e}:null};function Hc(t={}){const{__root:e,__injectWithOption:n}=t,r=e===void 0,o=t.flatJson,s=$t?g.ref:g.shallowRef;let i=ne(t.inheritLocale)?t.inheritLocale:!0;const l=s(e&&i?e.locale.value:B(t.locale)?t.locale:ts),a=s(e&&i?e.fallbackLocale.value:B(t.fallbackLocale)||be(t.fallbackLocale)||X(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:l.value),c=s(Vc(l.value,t)),u=s(X(t.datetimeFormats)?t.datetimeFormats:{[l.value]:{}}),d=s(X(t.numberFormats)?t.numberFormats:{[l.value]:{}});let f=e?e.missingWarn:ne(t.missingWarn)||Zr(t.missingWarn)?t.missingWarn:!0,p=e?e.fallbackWarn:ne(t.fallbackWarn)||Zr(t.fallbackWarn)?t.fallbackWarn:!0,h=e?e.fallbackRoot:ne(t.fallbackRoot)?t.fallbackRoot:!0,m=!!t.fallbackFormat,y=ue(t.missing)?t.missing:null,b=ue(t.missing)?Fm(t.missing):null,w=ue(t.postTranslation)?t.postTranslation:null,k=e?e.warnHtmlMessage:ne(t.warnHtmlMessage)?t.warnHtmlMessage:!0,E=!!t.escapeParameter;const x=e?e.modifiers:X(t.modifiers)?t.modifiers:{};let v=t.pluralRules||e&&e.pluralRules,T;T=(()=>{r&&fm(null);const N={version:RT,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:x,pluralRules:v,missing:b===null?void 0:b,missingWarn:f,fallbackWarn:p,fallbackFormat:m,unresolving:!0,postTranslation:w===null?void 0:w,warnHtmlMessage:k,escapeParameter:E,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};N.datetimeFormats=u.value,N.numberFormats=d.value,N.__datetimeFormatters=X(T)?T.__datetimeFormatters:void 0,N.__numberFormatters=X(T)?T.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(N.__v_emitter=X(T)?T.__v_emitter:void 0);const L=cT(N);return r&&fm(L),L})(),ns(T,l.value,a.value);function P(){return[l.value,a.value,c.value,u.value,d.value]}const V=g.computed({get:()=>l.value,set:N=>{T.locale=N,l.value=N}}),Z=g.computed({get:()=>a.value,set:N=>{T.fallbackLocale=N,a.value=N,ns(T,l.value,N)}}),q=g.computed(()=>c.value),re=g.computed(()=>u.value),Te=g.computed(()=>d.value);function Se(){return ue(w)?w:null}function de(N){w=N,T.postTranslation=N}function me(){return y}function Oe(N){N!==null&&(b=Fm(N)),y=N,T.missing=b}function dt(N,L){return N!=="translate"||!L.resolvedMessage}const Me=(N,L,ee,ge,vn,io)=>{P();let Zn;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(T.fallbackContext=e?aT():void 0),Zn=N(T)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(T.fallbackContext=void 0)}if(ee!=="translate exists"&&_e(Zn)&&Zn===Ki||ee==="translate exists"&&!Zn){const[xn,iu]=L();if(process.env.NODE_ENV!=="production"&&e&&B(xn)&&dt(ee,iu)&&(h&&(Ji(p,xn)||hm(f,xn))&&Jn(ss(rn.FALLBACK_TO_ROOT,{key:xn,type:ee})),process.env.NODE_ENV!=="production")){const{__v_emitter:A}=T;A&&h&&A.emit("fallback",{type:ee,key:xn,to:"global",groupId:`${ee}:${xn}`})}return e&&h?ge(e):vn(xn)}else{if(io(Zn))return Zn;throw et(ae.UNEXPECTED_RETURN_TYPE)}};function Et(...N){return Me(L=>Reflect.apply(Tm,null,[L,...N]),()=>Ic(...N),"translate",L=>Reflect.apply(L.t,L,[...N]),L=>L,L=>B(L))}function ft(...N){const[L,ee,ge]=N;if(ge&&!te(ge))throw et(ae.INVALID_ARGUMENT);return Et(L,ee,Re({resolvedMessage:!0},ge||{}))}function Ut(...N){return Me(L=>Reflect.apply(bm,null,[L,...N]),()=>Rc(...N),"datetime format",L=>Reflect.apply(L.d,L,[...N]),()=>qi,L=>B(L)||be(L))}function wt(...N){return Me(L=>Reflect.apply(km,null,[L,...N]),()=>Lc(...N),"number format",L=>Reflect.apply(L.n,L,[...N]),()=>qi,L=>B(L)||be(L))}function tt(N){return N.map(L=>B(L)||_e(L)||ne(L)?Im(String(L)):L)}const sn={normalize:tt,interpolate:N=>N,type:"vnode"};function pt(...N){return Me(L=>{let ee;const ge=L;try{ge.processor=sn,ee=Reflect.apply(Tm,null,[ge,...N])}finally{ge.processor=null}return ee},()=>Ic(...N),"translate",L=>L[Pc](...N),L=>[Im(L)],L=>be(L))}function ln(...N){return Me(L=>Reflect.apply(km,null,[L,...N]),()=>Lc(...N),"number format",L=>L[Fc](...N),Pm,L=>B(L)||be(L))}function Lt(...N){return Me(L=>Reflect.apply(bm,null,[L,...N]),()=>Rc(...N),"datetime format",L=>L[Bc](...N),Pm,L=>B(L)||be(L))}function an(N){v=N,T.pluralRules=v}function Qn(N,L){return Me(()=>{if(!N)return!1;const ee=B(L)?L:l.value,ge=It(ee),vn=T.messageResolver(ge,N);return _t(vn)||Mt(vn)||B(vn)},()=>[N],"translate exists",ee=>Reflect.apply(ee.te,ee,[N,L]),PT,ee=>ne(ee))}function zt(N){let L=null;const ee=rm(T,a.value,l.value);for(let ge=0;ge<ee.length;ge++){const vn=c.value[ee[ge]]||{},io=T.messageResolver(vn,N);if(io!=null){L=io;break}}return L}function cn(N){const L=zt(N);return L??(e?e.tm(N)||{}:{})}function It(N){return c.value[N]||{}}function jt(N,L){if(o){const ee={[N]:L};for(const ge in ee)Vt(ee,ge)&&is(ee[ge]);L=ee[N]}c.value[N]=L,T.messages=c.value}function Sn(N,L){c.value[N]=c.value[N]||{};const ee={[N]:L};if(o)for(const ge in ee)Vt(ee,ge)&&is(ee[ge]);L=ee[N],zi(L,c.value[N]),T.messages=c.value}function C(N){return u.value[N]||{}}function S(N,L){u.value[N]=L,T.datetimeFormats=u.value,wm(T,N,L)}function R(N,L){u.value[N]=Re(u.value[N]||{},L),T.datetimeFormats=u.value,wm(T,N,L)}function $(N){return d.value[N]||{}}function fe(N,L){d.value[N]=L,T.numberFormats=d.value,Sm(T,N,L)}function se(N,L){d.value[N]=Re(d.value[N]||{},L),T.numberFormats=d.value,Sm(T,N,L)}Bm++,e&&$t&&(g.watch(e.locale,N=>{i&&(l.value=N,T.locale=N,ns(T,l.value,a.value))}),g.watch(e.fallbackLocale,N=>{i&&(a.value=N,T.fallbackLocale=N,ns(T,l.value,a.value))}));const Q={id:Bm,locale:V,fallbackLocale:Z,get inheritLocale(){return i},set inheritLocale(N){i=N,N&&e&&(l.value=e.locale.value,a.value=e.fallbackLocale.value,ns(T,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:q,get modifiers(){return x},get pluralRules(){return v||{}},get isGlobal(){return r},get missingWarn(){return f},set missingWarn(N){f=N,T.missingWarn=f},get fallbackWarn(){return p},set fallbackWarn(N){p=N,T.fallbackWarn=p},get fallbackRoot(){return h},set fallbackRoot(N){h=N},get fallbackFormat(){return m},set fallbackFormat(N){m=N,T.fallbackFormat=m},get warnHtmlMessage(){return k},set warnHtmlMessage(N){k=N,T.warnHtmlMessage=N},get escapeParameter(){return E},set escapeParameter(N){E=N,T.escapeParameter=N},t:Et,getLocaleMessage:It,setLocaleMessage:jt,mergeLocaleMessage:Sn,getPostTranslationHandler:Se,setPostTranslationHandler:de,getMissingHandler:me,setMissingHandler:Oe,[_m]:an};return Q.datetimeFormats=re,Q.numberFormats=Te,Q.rt=ft,Q.te=Qn,Q.tm=cn,Q.d=Ut,Q.n=wt,Q.getDateTimeFormat=C,Q.setDateTimeFormat=S,Q.mergeDateTimeFormat=R,Q.getNumberFormat=$,Q.setNumberFormat=fe,Q.mergeNumberFormat=se,Q[Mm]=n,Q[Pc]=pt,Q[Bc]=Lt,Q[Fc]=ln,process.env.NODE_ENV!=="production"&&(Q[vr]=N=>{T.__v_emitter=N},Q[rs]=()=>{T.__v_emitter=void 0}),Q}const $m="vue-i18n: composer properties",Uc={"vue-devtools-plugin-vue-i18n":"Vue I18n DevTools","vue-i18n-resource-inspector":"Vue I18n DevTools","vue-i18n-timeline":"Vue I18n"},FT={"vue-i18n-resource-inspector":"Search for scopes ..."},$T={"vue-i18n-timeline":16764185};let zc;async function VT(t,e){return new Promise((n,r)=>{try{MT({id:"vue-devtools-plugin-vue-i18n",label:Uc["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[$m],app:t},o=>{zc=o,o.on.visitComponentTree(({componentInstance:i,treeNode:l})=>{HT(i,l,e)}),o.on.inspectComponent(({componentInstance:i,instanceData:l})=>{i.vnode.el&&i.vnode.el.__VUE_I18N__&&l&&(e.mode==="legacy"?i.vnode.el.__VUE_I18N__!==e.global.__composer&&Hm(l,i.vnode.el.__VUE_I18N__):Hm(l,i.vnode.el.__VUE_I18N__))}),o.addInspector({id:"vue-i18n-resource-inspector",label:Uc["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:FT["vue-i18n-resource-inspector"]}),o.on.getInspectorTree(i=>{i.app===t&&i.inspectorId==="vue-i18n-resource-inspector"&&KT(i,e)});const s=new Map;o.on.getInspectorState(async i=>{if(i.app===t&&i.inspectorId==="vue-i18n-resource-inspector")if(o.unhighlightElement(),JT(i,e),i.nodeId==="global"){if(!s.has(i.app)){const[l]=await o.getComponentInstances(i.app);s.set(i.app,l)}o.highlightElement(s.get(i.app))}else{const l=qT(i.nodeId,e);l&&o.highlightElement(l)}}),o.on.editInspectorState(i=>{i.app===t&&i.inspectorId==="vue-i18n-resource-inspector"&&YT(i,e)}),o.addTimelineLayer({id:"vue-i18n-timeline",label:Uc["vue-i18n-timeline"],color:$T["vue-i18n-timeline"]}),n(!0)})}catch(o){console.error(o),r(!1)}})}function Vm(t){return t.type.name||t.type.displayName||t.type.__file||"Anonymous"}function HT(t,e,n){const r=n.mode==="composition"?n.global:n.global.__composer;if(t&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&t.vnode.el.__VUE_I18N__!==r){const o={label:`i18n (${Vm(t)} Scope)`,textColor:0,backgroundColor:16764185};e.tags.push(o)}}function Hm(t,e){const n=$m;t.state.push({type:n,key:"locale",editable:!0,value:e.locale.value}),t.state.push({type:n,key:"availableLocales",editable:!1,value:e.availableLocales}),t.state.push({type:n,key:"fallbackLocale",editable:!0,value:e.fallbackLocale.value}),t.state.push({type:n,key:"inheritLocale",editable:!0,value:e.inheritLocale}),t.state.push({type:n,key:"messages",editable:!1,value:jc(e.messages.value)}),t.state.push({type:n,key:"datetimeFormats",editable:!1,value:e.datetimeFormats.value}),t.state.push({type:n,key:"numberFormats",editable:!1,value:e.numberFormats.value})}function jc(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];ue(r)&&"source"in r?e[n]=WT(r):_t(r)&&r.loc&&r.loc.source?e[n]=r.loc.source:te(r)?e[n]=jc(r):e[n]=r}),e}const UT={"<":"&lt;",">":"&gt;",'"':"&quot;","&":"&amp;"};function zT(t){return t.replace(/[<>"&]/g,jT)}function jT(t){return UT[t]||t}function WT(t){return{_custom:{type:"function",display:`<span>ƒ</span> ${t.source?`("${zT(t.source)}")`:"(?)"}`}}}function KT(t,e){t.rootNodes.push({id:"global",label:"Global Scope"});const n=e.mode==="composition"?e.global:e.global.__composer;for(const[r,o]of e.__instances){const s=e.mode==="composition"?o:o.__composer;n!==s&&t.rootNodes.push({id:s.id.toString(),label:`${Vm(r)} Scope`})}}function qT(t,e){let n=null;if(t!=="global"){for(const[r,o]of e.__instances.entries())if(o.id.toString()===t){n=r;break}}return n}function Um(t,e){if(t==="global")return e.mode==="composition"?e.global:e.global.__composer;{const n=Array.from(e.__instances.values()).find(r=>r.id.toString()===t);return n?e.mode==="composition"?n:n.__composer:null}}function JT(t,e){const n=Um(t.nodeId,e);return n&&(t.state=GT(n)),null}function GT(t){const e={},n="Locale related info",r=[{type:n,key:"locale",editable:!0,value:t.locale.value},{type:n,key:"fallbackLocale",editable:!0,value:t.fallbackLocale.value},{type:n,key:"availableLocales",editable:!1,value:t.availableLocales},{type:n,key:"inheritLocale",editable:!0,value:t.inheritLocale}];e[n]=r;const o="Locale messages info",s=[{type:o,key:"messages",editable:!1,value:jc(t.messages.value)}];e[o]=s;{const i="Datetime formats info",l=[{type:i,key:"datetimeFormats",editable:!1,value:t.datetimeFormats.value}];e[i]=l;const a="Datetime formats info",c=[{type:a,key:"numberFormats",editable:!1,value:t.numberFormats.value}];e[a]=c}return e}function ls(t,e){if(zc){let n;e&&"groupId"in e&&(n=e.groupId,delete e.groupId),zc.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:t,groupId:n,time:Date.now(),meta:{},data:e||{},logType:t==="compile-error"?"error":t==="fallback"||t==="missing"?"warning":"default"}})}}function YT(t,e){const n=Um(t.nodeId,e);if(n){const[r]=t.path;r==="locale"&&B(t.state.value)?n.locale.value=t.state.value:r==="fallbackLocale"&&(B(t.state.value)||be(t.state.value)||te(t.state.value))?n.fallbackLocale.value=t.state.value:r==="inheritLocale"&&ne(t.state.value)&&(n.inheritLocale=t.state.value)}}function XT(t){const e=B(t.locale)?t.locale:ts,n=B(t.fallbackLocale)||be(t.fallbackLocale)||X(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,r=ue(t.missing)?t.missing:void 0,o=ne(t.silentTranslationWarn)||Zr(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,s=ne(t.silentFallbackWarn)||Zr(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,i=ne(t.fallbackRoot)?t.fallbackRoot:!0,l=!!t.formatFallbackMessages,a=X(t.modifiers)?t.modifiers:{},c=t.pluralizationRules,u=ue(t.postTranslation)?t.postTranslation:void 0,d=B(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,f=!!t.escapeParameterHtml,p=ne(t.sync)?t.sync:!0;let h=t.messages;if(X(t.sharedMessages)){const x=t.sharedMessages;h=Object.keys(x).reduce((T,_)=>{const P=T[_]||(T[_]={});return Re(P,x[_]),T},h||{})}const{__i18n:m,__root:y,__injectWithOption:b}=t,w=t.datetimeFormats,k=t.numberFormats,E=t.flatJson;return{locale:e,fallbackLocale:n,messages:h,flatJson:E,datetimeFormats:w,numberFormats:k,missing:r,missingWarn:o,fallbackWarn:s,fallbackRoot:i,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:f,messageResolver:t.messageResolver,inheritLocale:p,__i18n:m,__root:y,__injectWithOption:b}}function Wc(t={}){const e=Hc(XT(t)),{__extender:n}=t,r={id:e.id,get locale(){return e.locale.value},set locale(o){e.locale.value=o},get fallbackLocale(){return e.fallbackLocale.value},set fallbackLocale(o){e.fallbackLocale.value=o},get messages(){return e.messages.value},get datetimeFormats(){return e.datetimeFormats.value},get numberFormats(){return e.numberFormats.value},get availableLocales(){return e.availableLocales},get missing(){return e.getMissingHandler()},set missing(o){e.setMissingHandler(o)},get silentTranslationWarn(){return ne(e.missingWarn)?!e.missingWarn:e.missingWarn},set silentTranslationWarn(o){e.missingWarn=ne(o)?!o:o},get silentFallbackWarn(){return ne(e.fallbackWarn)?!e.fallbackWarn:e.fallbackWarn},set silentFallbackWarn(o){e.fallbackWarn=ne(o)?!o:o},get modifiers(){return e.modifiers},get formatFallbackMessages(){return e.fallbackFormat},set formatFallbackMessages(o){e.fallbackFormat=o},get postTranslation(){return e.getPostTranslationHandler()},set postTranslation(o){e.setPostTranslationHandler(o)},get sync(){return e.inheritLocale},set sync(o){e.inheritLocale=o},get warnHtmlInMessage(){return e.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){e.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return e.escapeParameter},set escapeParameterHtml(o){e.escapeParameter=o},get pluralizationRules(){return e.pluralRules||{}},__composer:e,t(...o){return Reflect.apply(e.t,e,[...o])},rt(...o){return Reflect.apply(e.rt,e,[...o])},te(o,s){return e.te(o,s)},tm(o){return e.tm(o)},getLocaleMessage(o){return e.getLocaleMessage(o)},setLocaleMessage(o,s){e.setLocaleMessage(o,s)},mergeLocaleMessage(o,s){e.mergeLocaleMessage(o,s)},d(...o){return Reflect.apply(e.d,e,[...o])},getDateTimeFormat(o){return e.getDateTimeFormat(o)},setDateTimeFormat(o,s){e.setDateTimeFormat(o,s)},mergeDateTimeFormat(o,s){e.mergeDateTimeFormat(o,s)},n(...o){return Reflect.apply(e.n,e,[...o])},getNumberFormat(o){return e.getNumberFormat(o)},setNumberFormat(o,s){e.setNumberFormat(o,s)},mergeNumberFormat(o,s){e.mergeNumberFormat(o,s)}};return r.__extender=n,process.env.NODE_ENV!=="production"&&(r.__enableEmitter=o=>{const s=e;s[vr]&&s[vr](o)},r.__disableEmitter=()=>{const o=e;o[rs]&&o[rs]()}),r}function QT(t,e,n){return{beforeCreate(){const r=g.getCurrentInstance();if(!r)throw et(ae.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const s=o.i18n;if(o.__i18n&&(s.__i18n=o.__i18n),s.__root=e,this===this.$root)this.$i18n=zm(t,s);else{s.__injectWithOption=!0,s.__extender=n.__vueI18nExtend,this.$i18n=Wc(s);const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=zm(t,o);else{this.$i18n=Wc({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:e});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=t;o.__i18nGlobal&&Lm(e,o,o),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$te=(s,i)=>this.$i18n.te(s,i),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),n.__setInstance(r,this.$i18n)},mounted(){if(process.env.NODE_ENV!=="production"&&this.$el&&this.$i18n){const r=this.$i18n;this.$el.__VUE_I18N__=r.__composer;const o=this.__v_emitter=Cc();r.__enableEmitter&&r.__enableEmitter(o),o.on("*",ls)}},unmounted(){const r=g.getCurrentInstance();if(!r)throw et(ae.UNEXPECTED_ERROR);const o=this.$i18n;process.env.NODE_ENV!=="production"&&this.$el&&this.$el.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",ls),delete this.__v_emitter),this.$i18n&&(o.__disableEmitter&&o.__disableEmitter(),delete this.$el.__VUE_I18N__)),delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(r),delete this.$i18n}}}function zm(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[_m](e.pluralizationRules||t.pluralizationRules);const n=Vc(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(n).forEach(r=>t.mergeLocaleMessage(r,n[r])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(r=>t.mergeDateTimeFormat(r,e.datetimeFormats[r])),e.numberFormats&&Object.keys(e.numberFormats).forEach(r=>t.mergeNumberFormat(r,e.numberFormats[r])),t}const Kc={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function ZT({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,o)=>[...r,...o.type===g.Fragment?o.children:[o]],[]):e.reduce((n,r)=>{const o=t[r];return o&&(n[r]=o()),n},le())}function jm(){return g.Fragment}const Wm=g.defineComponent({name:"i18n-t",props:Re({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>_e(t)||!isNaN(t)}},Kc),setup(t,e){const{slots:n,attrs:r}=e,o=t.i18n||Gi({useScope:t.scope,__useComponent:!0});return()=>{const s=Object.keys(n).filter(d=>d[0]!=="_"),i=le();t.locale&&(i.locale=t.locale),t.plural!==void 0&&(i.plural=B(t.plural)?+t.plural:t.plural);const l=ZT(e,s),a=o[Pc](t.keypath,l,i),c=Re(le(),r),u=B(t.tag)||te(t.tag)?t.tag:jm();return g.h(u,c,a)}}});function eO(t){return be(t)&&!B(t[0])}function Km(t,e,n,r){const{slots:o,attrs:s}=e;return()=>{const i={part:!0};let l=le();t.locale&&(i.locale=t.locale),B(t.format)?i.key=t.format:te(t.format)&&(B(t.format.key)&&(i.key=t.format.key),l=Object.keys(t.format).reduce((f,p)=>n.includes(p)?Re(le(),f,{[p]:t.format[p]}):f,le()));const a=r(t.value,i,l);let c=[i.key];be(a)?c=a.map((f,p)=>{const h=o[f.type],m=h?h({[f.type]:f.value,index:p,parts:a}):[f.value];return eO(m)&&(m[0].key=`${f.type}-${p}`),m}):B(a)&&(c=[a]);const u=Re(le(),s),d=B(t.tag)||te(t.tag)?t.tag:jm();return g.h(d,u,c)}}const qm=g.defineComponent({name:"i18n-n",props:Re({value:{type:Number,required:!0},format:{type:[String,Object]}},Kc),setup(t,e){const n=t.i18n||Gi({useScope:t.scope,__useComponent:!0});return Km(t,e,Cm,(...r)=>n[Fc](...r))}});function tO(t,e){const n=t;if(t.mode==="composition")return n.__getInstance(e)||t.global;{const r=n.__getInstance(e);return r!=null?r.__composer:t.global.__composer}}function nO(t){const e=i=>{process.env.NODE_ENV!=="production"&&kc(ss(rn.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));const{instance:l,value:a}=i;if(!l||!l.$)throw et(ae.UNEXPECTED_ERROR);const c=tO(t,l.$),u=Jm(a);return[Reflect.apply(c.t,c,[...Gm(u)]),c]};return{created:(i,l)=>{const[a,c]=e(l);$t&&t.global===c&&(i.__i18nWatcher=g.watch(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),i.__composer=c,i.textContent=a},unmounted:i=>{$t&&i.__i18nWatcher&&(i.__i18nWatcher(),i.__i18nWatcher=void 0,delete i.__i18nWatcher),i.__composer&&(i.__composer=void 0,delete i.__composer)},beforeUpdate:(i,{value:l})=>{if(i.__composer){const a=i.__composer,c=Jm(l);i.textContent=Reflect.apply(a.t,a,[...Gm(c)])}},getSSRProps:i=>{const[l]=e(i);return{textContent:l}}}}function Jm(t){if(B(t))return{path:t};if(X(t)){if(!("path"in t))throw et(ae.REQUIRED_VALUE,"path");return t}else throw et(ae.INVALID_VALUE)}function Gm(t){const{path:e,locale:n,args:r,choice:o,plural:s}=t,i={},l=r||{};return B(n)&&(i.locale=n),_e(o)&&(i.plural=o),_e(s)&&(i.plural=s),[e,l,i]}function rO(t,e,...n){const r=X(n[0])?n[0]:{};(ne(r.globalInstall)?r.globalInstall:!0)&&([Wm.name,"I18nT"].forEach(s=>t.component(s,Wm)),[qm.name,"I18nN"].forEach(s=>t.component(s,qm)),[Xm.name,"I18nD"].forEach(s=>t.component(s,Xm))),t.directive("t",nO(e))}const oO=tn("global-vue-i18n");function sO(t={}){const e=__VUE_I18N_LEGACY_API__&&ne(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__;process.env.NODE_ENV!=="production"&&e&&kc(ss(rn.DEPRECATE_LEGACY_MODE));const n=ne(t.globalInjection)?t.globalInjection:!0,r=new Map,[o,s]=iO(t,e),i=tn(process.env.NODE_ENV!=="production"?"vue-i18n":"");function l(d){return r.get(d)||null}function a(d,f){r.set(d,f)}function c(d){r.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&e?"legacy":"composition"},async install(d,...f){if(process.env.NODE_ENV!=="production"&&(d.__VUE_I18N__=u),d.__VUE_I18N_SYMBOL__=i,d.provide(d.__VUE_I18N_SYMBOL__,u),X(f[0])){const m=f[0];u.__composerExtend=m.__composerExtend,u.__vueI18nExtend=m.__vueI18nExtend}let p=null;!e&&n&&(p=hO(d,u.global)),__VUE_I18N_FULL_INSTALL__&&rO(d,u,...f),__VUE_I18N_LEGACY_API__&&e&&d.mixin(QT(s,s.__composer,u));const h=d.unmount;if(d.unmount=()=>{p&&p(),u.dispose(),h()},process.env.NODE_ENV!=="production"){if(!await VT(d,u))throw et(ae.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const y=Cc();if(e){const b=s;b.__enableEmitter&&b.__enableEmitter(y)}else{const b=s;b[vr]&&b[vr](y)}y.on("*",ls)}},get global(){return s},dispose(){o.stop()},__instances:r,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function Gi(t={}){const e=g.getCurrentInstance();if(e==null)throw et(ae.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw et(ae.NOT_INSTALLED);const n=lO(e),r=cO(n),o=Rm(e),s=aO(t,o);if(s==="global")return Lm(r,t,o),r;if(s==="parent"){let a=uO(n,e,t.__useComponent);return a==null&&(process.env.NODE_ENV!=="production"&&Jn(ss(rn.NOT_FOUND_PARENT_SCOPE)),a=r),a}const i=n;let l=i.__getInstance(e);if(l==null){const a=Re({},t);"__i18n"in o&&(a.__i18n=o.__i18n),r&&(a.__root=r),l=Hc(a),i.__composerExtend&&(l[$c]=i.__composerExtend(l)),fO(i,e,l),i.__setInstance(e,l)}else if(process.env.NODE_ENV!=="production"&&s==="local")throw et(ae.DUPLICATE_USE_I18N_CALLING);return l}function iO(t,e){const n=g.effectScope(),r=__VUE_I18N_LEGACY_API__&&e?n.run(()=>Wc(t)):n.run(()=>Hc(t));if(r==null)throw et(ae.UNEXPECTED_ERROR);return[n,r]}function lO(t){const e=g.inject(t.isCE?oO:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw et(t.isCE?ae.NOT_INSTALLED_WITH_PROVIDE:ae.UNEXPECTED_ERROR);return e}function aO(t,e){return Hi(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function cO(t){return t.mode==="composition"?t.global:t.global.__composer}function uO(t,e,n=!1){let r=null;const o=e.root;let s=dO(e,n);for(;s!=null;){const i=t;if(t.mode==="composition")r=i.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const l=i.__getInstance(s);l!=null&&(r=l.__composer,n&&r&&!r[Mm]&&(r=null))}if(r!=null||o===s)break;s=s.parent}return r}function dO(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function fO(t,e,n){let r=null;g.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&e.vnode.el){e.vnode.el.__VUE_I18N__=n,r=Cc();const o=n;o[vr]&&o[vr](r),r.on("*",ls)}},e),g.onUnmounted(()=>{const o=n;process.env.NODE_ENV!=="production"&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&(r&&r.off("*",ls),o[rs]&&o[rs](),delete e.vnode.el.__VUE_I18N__),t.__deleteInstance(e);const s=o[$c];s&&(s(),delete o[$c])},e)}const pO=["locale","fallbackLocale","availableLocales"],Ym=["t","rt","d","n","tm","te"];function hO(t,e){const n=Object.create(null);return pO.forEach(o=>{const s=Object.getOwnPropertyDescriptor(e,o);if(!s)throw et(ae.UNEXPECTED_ERROR);const i=g.isRef(s.value)?{get(){return s.value.value},set(l){s.value.value=l}}:{get(){return s.get&&s.get()}};Object.defineProperty(n,o,i)}),t.config.globalProperties.$i18n=n,Ym.forEach(o=>{const s=Object.getOwnPropertyDescriptor(e,o);if(!s||!s.value)throw et(ae.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${o}`,s)}),()=>{delete t.config.globalProperties.$i18n,Ym.forEach(o=>{delete t.config.globalProperties[`$${o}`]})}}const Xm=g.defineComponent({name:"i18n-d",props:Re({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Kc),setup(t,e){const n=t.i18n||Gi({useScope:t.scope,__useComponent:!0});return Km(t,e,Em,(...r)=>n[Bc](...r))}});if(LT(),rT(Dx),oT(Qx),sT(rm),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const t=Cr();t.__INTLIFY__=!0,Px(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const mO={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},gO={__name:"vs-editor-link",props:{editor:Object},setup(t){const{t:e}=Gi(),n=t,r=g.ref(!1),o=g.ref(""),s=()=>{n.editor.chain().focus().toggleLink({href:o.value}).run(),r.value=!1,o.value=""};return(i,l)=>(g.openBlock(),g.createElementBlock(g.Fragment,null,[g.createElementVNode("button",{onClick:l[0]||(l[0]=a=>r.value=!0),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},l[4]||(l[4]=[g.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[g.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.213 9.787a3.391 3.391 0 0 0-4.795 0l-3.425 3.426a3.39 3.39 0 0 0 4.795 4.794l.321-.304m-.321-4.49a3.39 3.39 0 0 0 4.795 0l3.424-3.426a3.39 3.39 0 0 0-4.794-4.795l-1.028.961"})],-1)])),g.createVNode(kv,{title:g.unref(e)("tiptap.linkTitle"),visible:r.value,"onUpdate:visible":l[3]||(l[3]=a=>r.value=a),size:"small"},{footer:g.withCtx(()=>[g.createElementVNode("div",mO,[g.createElementVNode("button",{style:{border:"1px solid #000"},onClick:l[2]||(l[2]=a=>{r.value=!1,o.value=""}),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"},g.toDisplayString(g.unref(e)("tiptap.cancel")),1),g.createElementVNode("button",{onClick:s,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},g.toDisplayString(g.unref(e)("tiptap.create")),1)])]),default:g.withCtx(()=>[g.createVNode(Bh,{modelValue:o.value,"onUpdate:modelValue":l[1]||(l[1]=a=>o.value=a),placeholder:g.unref(e)("tiptap.linkTitle")},null,8,["modelValue","placeholder"])]),_:1},8,["title","visible"])],64))}},yO={class:"flex flex-col gap-[2px] p-[2px]"},bO=["onClick"],EO={__name:"vs-editor-table",props:{editor:Object},setup(t){const{$t:e}=g.getCurrentInstance().proxy,n=t,r=g.ref(!1),o=g.ref("popover"),s=()=>{n.editor&&(n.editor.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),o.value.togglePopover())},i=()=>{n.editor&&(n.editor.chain().focus().addColumnAfter().run(),o.value.togglePopover())},l=()=>{n.editor&&(n.editor.chain().focus().addRowAfter().run(),o.value.togglePopover())},a=()=>{n.editor&&(n.editor.chain().focus().deleteColumn().run(),o.value.togglePopover())},c=()=>{n.editor&&(n.editor.chain().focus().deleteRow().run(),o.value.togglePopover())},u=()=>{n.editor&&(n.editor.chain().focus().deleteTable().run(),o.value.togglePopover())},d=[{text:e("tiptap.createTable"),function:s},{text:e("tiptap.addColumn"),function:i},{text:e("tiptap.addRow"),function:l},{text:e("tiptap.deleteColumn"),function:a},{text:e("tiptap.deleteRow"),function:c},{text:e("tiptap.deleteTable"),function:u}];return(f,p)=>(g.openBlock(),g.createBlock(Qo,{ref_key:"popover",ref:o,placement:"bottom",onIsvisible:p[0]||(p[0]=h=>r.value=h)},{reference:g.withCtx(()=>[g.createElementVNode("button",{class:g.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[r.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},p[1]||(p[1]=[g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-table"},[g.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),g.createElementVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"}),g.createElementVNode("path",{d:"M3 10h18"}),g.createElementVNode("path",{d:"M10 3v18"})],-1)]),2)]),default:g.withCtx(()=>[g.createElementVNode("div",yO,[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(d,(h,m)=>g.createElementVNode("button",{key:m,onClick:h?.function,class:"px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded"},g.toDisplayString(h.text),9,bO)),64))])]),_:1},512))}},wO={},kO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-center"};function CO(t,e,n,r,o,s){return g.openBlock(),g.createElementBlock("svg",kO,e[0]||(e[0]=[g.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),g.createElementVNode("path",{d:"M4 6l16 0"},null,-1),g.createElementVNode("path",{d:"M8 12l8 0"},null,-1),g.createElementVNode("path",{d:"M6 18l12 0"},null,-1)]))}const SO=Ke(wO,[["render",CO]]),vO={},xO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-right"};function TO(t,e,n,r,o,s){return g.openBlock(),g.createElementBlock("svg",xO,e[0]||(e[0]=[g.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),g.createElementVNode("path",{d:"M4 6l16 0"},null,-1),g.createElementVNode("path",{d:"M10 12l10 0"},null,-1),g.createElementVNode("path",{d:"M6 18l14 0"},null,-1)]))}const OO=Ke(vO,[["render",TO]]),NO={},AO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-left"};function _O(t,e,n,r,o,s){return g.openBlock(),g.createElementBlock("svg",AO,e[0]||(e[0]=[g.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),g.createElementVNode("path",{d:"M4 6l16 0"},null,-1),g.createElementVNode("path",{d:"M4 12l10 0"},null,-1),g.createElementVNode("path",{d:"M4 18l14 0"},null,-1)]))}const Qm={left:Ke(NO,[["render",_O]]),center:SO,right:OO},MO={class:"flex gap-[4px] p-1"},RO=["onClick"],LO={__name:"vs-editor-align",props:{editor:Object},setup(t){const e=t,n=g.ref(!1),r=g.ref("popover"),o=g.ref("left"),s=g.computed(()=>e.editor?.isActive({textAlign:"left"})),i=g.computed(()=>e.editor?.isActive({textAlign:"right"})),l=g.computed(()=>e.editor?.isActive({textAlign:"center"})),a=u=>{e.editor&&e.editor.chain().focus().setTextAlign(u).run()},c=g.ref([{id:"left",isActive:s},{id:"center",isActive:l},{id:"right",isActive:i}]);return(u,d)=>(g.openBlock(),g.createBlock(Qo,{ref_key:"popover",ref:r,placement:"bottom",onIsvisible:d[0]||(d[0]=f=>n.value=f)},{reference:g.withCtx(()=>[g.createElementVNode("button",{class:g.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[n.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[(g.openBlock(),g.createBlock(g.resolveDynamicComponent(g.unref(Qm)[o.value]),{height:"16",width:"16"}))],2)]),default:g.withCtx(()=>[g.createElementVNode("div",MO,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(c.value,f=>(g.openBlock(),g.createElementBlock("button",{class:g.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":f?.isActive}]),key:f?.id,onClick:p=>a(f?.id)},[(g.openBlock(),g.createBlock(g.resolveDynamicComponent(g.unref(Qm)[f?.id]),{height:"16",width:"16"}))],10,RO))),128))])]),_:1},512))}},IO={class:"flex flex-col gap-[2px] p-[2px]"},DO=["onClick"],PO={__name:"vs-editor-type-tag",props:{editor:Object},setup(t){const{$t:e}=g.getCurrentInstance().proxy,n=t,r=g.ref(!1),o=g.ref("popover"),s=()=>{n.editor&&(n.editor?.chain().focus().setParagraph().run(),o.value.togglePopover())},i=a=>{n.editor&&(n.editor?.chain().focus().toggleHeading({level:a}).run(),o.value.togglePopover())},l=[{text:"Заголовок 1",id:1,style:"font-[700] text-[30px]"},{text:"Заголовок 2",id:2,style:"font-[700] text-[26px]"},{text:"Заголовок 3",id:3,style:"font-[700] text-[22px]"},{text:"Заголовок 4",id:4,style:"font-[700] text-[18px]"},{text:"Заголовок 5",id:5,style:"font-[500] text-[16px]"},{text:"Заголовок 6",id:6,style:"font-[400] text-[14px]"}];return(a,c)=>(g.openBlock(),g.createBlock(Qo,{ref_key:"popover",ref:o,placement:"bottom",onIsvisible:c[0]||(c[0]=u=>r.value=u)},{reference:g.withCtx(()=>[g.createElementVNode("button",{class:g.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[r.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},c[1]||(c[1]=[g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-text-size"},[g.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),g.createElementVNode("path",{d:"M3 7v-2h13v2"}),g.createElementVNode("path",{d:"M10 5v14"}),g.createElementVNode("path",{d:"M12 19h-4"}),g.createElementVNode("path",{d:"M15 13v-1h6v1"}),g.createElementVNode("path",{d:"M18 12v7"}),g.createElementVNode("path",{d:"M17 19h2"})],-1)]),2)]),default:g.withCtx(()=>[g.createElementVNode("div",IO,[g.createElementVNode("button",{onClick:s,class:g.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded",[t.editor?.isActive("paragraph")?"bg-gray-100":""]])},g.toDisplayString(g.unref(e)("tiptap.paragraph")),3),(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(l,(u,d)=>g.createElementVNode("button",{key:d,onClick:f=>i(u?.id),class:g.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded leading-[100%]",[u?.style,t.editor?.isActive("heading",{level:u?.id})?"bg-gray-100":""]])},g.toDisplayString(g.unref(e)(`tiptap.heading${u?.id}`)),11,DO)),64))])]),_:1},512))}},BO={},FO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function $O(t,e,n,r,o,s){return g.openBlock(),g.createElementBlock("svg",FO,e[0]||(e[0]=[g.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),g.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const VO=Ke(BO,[["render",$O]]),HO={components:{VsText:Bh},events:["update:modelValue"],props:{modelValue:{type:String,default:()=>"#000000"},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},isTextInputShown:{type:Boolean,default:()=>!0}},computed:{value:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}}},UO={class:"flex items-center w-full"},zO=["disabled"];function jO(t,e,n,r,o,s){const i=g.resolveComponent("vs-text");return g.openBlock(),g.createElementBlock("div",UO,[g.withDirectives(g.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>s.value=l),type:"color",class:g.normalizeClass(["w-10 h-10 py-[2px] px-[3px] dark:bg-neutral-800 border dark:border-neutral-700 border-stone-200 rounded-lg",n.disabled?"cursor-not-allowed":"cursor-pointer"]),disabled:n.disabled},null,10,zO),[[g.vModelText,s.value]]),n.isTextInputShown?(g.openBlock(),g.createBlock(i,{key:0,modelValue:s.value,"onUpdate:modelValue":e[1]||(e[1]=l=>s.value=l),class:"ml-2 w-full",disabled:n.disabled,clearable:n.clearable},null,8,["modelValue","disabled","clearable"])):g.createCommentVNode("",!0)])}const WO=Ke(HO,[["render",jO]]),KO={class:"w-[30px] h-[30px] rounded-full hover:bg-gray-100 justify-center items-center relative flex"},qO={class:"w-[160px]"},JO={class:"flex gap-[4px] mb-[8px]"},GO={class:"flex w-[160px] flex-wrap gap-[4px]"},YO=["onClick"],XO={bold:nv,italic:sv,color:dv,color_picker:{__name:"vs-editor-colorpicker",props:{editor:Object},setup(t){const e=t,n=g.ref("popover"),r=g.ref("#000000"),o=g.ref("#000000"),s=g.ref(["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]),i=a=>{e.editor&&(e.editor.chain().focus().setColor(a).run(),o.value=a,n.value&&n.value.togglePopover())},l=()=>{i(r.value),r.value=""};return(a,c)=>(g.openBlock(),g.createBlock(Qo,{ref_key:"popover",ref:n,placement:"bottom"},{reference:g.withCtx(()=>[g.createElementVNode("button",KO,[c[1]||(c[1]=g.createElementVNode("svg",{class:"text-gray-500",height:"16",width:"16","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[g.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 19.2H5.5c-.3 0-.5-.2-.5-.5V16c0-.2.2-.4.5-.4h13c.3 0 .5.2.5.4v2.7c0 .3-.2.5-.5.5H18m-6-1 1.4 1.8h.2l1.4-1.7m-7-5.4L12 4c0-.1 0-.1 0 0l4 8.8m-6-2.7h4m-7 2.7h2.5m5 0H17"})],-1)),g.createElementVNode("span",{class:"absolute h-[2px] w-[40%] bottom-[10px] left-[9px]",style:g.normalizeStyle({backgroundColor:o.value})},null,4)])]),default:g.withCtx(()=>[g.createElementVNode("div",qO,[g.createElementVNode("div",JO,[g.createVNode(WO,{modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=u=>r.value=u)},null,8,["modelValue"]),g.createElementVNode("button",{onClick:l,class:"h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"},[g.createVNode(VO,{class:"h-[24px] w-[24px] text-white"})])]),g.createElementVNode("ul",GO,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(s.value,u=>(g.openBlock(),g.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:g.normalizeStyle({backgroundColor:u}),onClick:d=>i(u),key:u},null,12,YO))),128))])])]),_:1},512))}},bullet_list:qS,ordered_list:YS,blockquote:jS,codeblock:ZS,underline:fv,strike:pv,link:gO,table:EO,text_align:LO,type_tag:PO};function Zm(t,e){return function(){return t.apply(e,arguments)}}const{toString:QO}=Object.prototype,{getPrototypeOf:qc}=Object,{iterator:Yi,toStringTag:eg}=Symbol,Xi=(t=>e=>{const n=QO.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Ht=t=>(t=t.toLowerCase(),e=>Xi(e)===t),Qi=t=>e=>typeof e===t,{isArray:oo}=Array,as=Qi("undefined");function ZO(t){return t!==null&&!as(t)&&t.constructor!==null&&!as(t.constructor)&&ct(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const tg=Ht("ArrayBuffer");function eN(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&tg(t.buffer),e}const tN=Qi("string"),ct=Qi("function"),ng=Qi("number"),Zi=t=>t!==null&&typeof t=="object",nN=t=>t===!0||t===!1,el=t=>{if(Xi(t)!=="object")return!1;const e=qc(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(eg in t)&&!(Yi in t)},rN=Ht("Date"),oN=Ht("File"),sN=Ht("Blob"),iN=Ht("FileList"),lN=t=>Zi(t)&&ct(t.pipe),aN=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||ct(t.append)&&((e=Xi(t))==="formdata"||e==="object"&&ct(t.toString)&&t.toString()==="[object FormData]"))},cN=Ht("URLSearchParams"),[uN,dN,fN,pN]=["ReadableStream","Request","Response","Headers"].map(Ht),hN=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function cs(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),oo(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{const s=n?Object.getOwnPropertyNames(t):Object.keys(t),i=s.length;let l;for(r=0;r<i;r++)l=s[r],e.call(null,t[l],l,t)}}function rg(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,o;for(;r-- >0;)if(o=n[r],e===o.toLowerCase())return o;return null}const xr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,og=t=>!as(t)&&t!==xr;function Jc(){const{caseless:t}=og(this)&&this||{},e={},n=(r,o)=>{const s=t&&rg(e,o)||o;el(e[s])&&el(r)?e[s]=Jc(e[s],r):el(r)?e[s]=Jc({},r):oo(r)?e[s]=r.slice():e[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&cs(arguments[r],n);return e}const mN=(t,e,n,{allOwnKeys:r}={})=>(cs(e,(o,s)=>{n&&ct(o)?t[s]=Zm(o,n):t[s]=o},{allOwnKeys:r}),t),gN=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),yN=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},bN=(t,e,n,r)=>{let o,s,i;const l={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),s=o.length;s-- >0;)i=o[s],(!r||r(i,t,e))&&!l[i]&&(e[i]=t[i],l[i]=!0);t=n!==!1&&qc(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},EN=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},wN=t=>{if(!t)return null;if(oo(t))return t;let e=t.length;if(!ng(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},kN=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&qc(Uint8Array)),CN=(t,e)=>{const r=(t&&t[Yi]).call(t);let o;for(;(o=r.next())&&!o.done;){const s=o.value;e.call(t,s[0],s[1])}},SN=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},vN=Ht("HTMLFormElement"),xN=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),sg=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),TN=Ht("RegExp"),ig=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};cs(n,(o,s)=>{let i;(i=e(o,s,t))!==!1&&(r[s]=i||o)}),Object.defineProperties(t,r)},ON=t=>{ig(t,(e,n)=>{if(ct(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(ct(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},NN=(t,e)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return oo(t)?r(t):r(String(t).split(e)),n},AN=()=>{},_N=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function MN(t){return!!(t&&ct(t.append)&&t[eg]==="FormData"&&t[Yi])}const RN=t=>{const e=new Array(10),n=(r,o)=>{if(Zi(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[o]=r;const s=oo(r)?[]:{};return cs(r,(i,l)=>{const a=n(i,o+1);!as(a)&&(s[l]=a)}),e[o]=void 0,s}}return r};return n(t,0)},LN=Ht("AsyncFunction"),IN=t=>t&&(Zi(t)||ct(t))&&ct(t.then)&&ct(t.catch),lg=((t,e)=>t?setImmediate:e?((n,r)=>(xr.addEventListener("message",({source:o,data:s})=>{o===xr&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),xr.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ct(xr.postMessage)),DN=typeof queueMicrotask<"u"?queueMicrotask.bind(xr):typeof process<"u"&&process.nextTick||lg,O={isArray:oo,isArrayBuffer:tg,isBuffer:ZO,isFormData:aN,isArrayBufferView:eN,isString:tN,isNumber:ng,isBoolean:nN,isObject:Zi,isPlainObject:el,isReadableStream:uN,isRequest:dN,isResponse:fN,isHeaders:pN,isUndefined:as,isDate:rN,isFile:oN,isBlob:sN,isRegExp:TN,isFunction:ct,isStream:lN,isURLSearchParams:cN,isTypedArray:kN,isFileList:iN,forEach:cs,merge:Jc,extend:mN,trim:hN,stripBOM:gN,inherits:yN,toFlatObject:bN,kindOf:Xi,kindOfTest:Ht,endsWith:EN,toArray:wN,forEachEntry:CN,matchAll:SN,isHTMLForm:vN,hasOwnProperty:sg,hasOwnProp:sg,reduceDescriptors:ig,freezeMethods:ON,toObjectSet:NN,toCamelCase:xN,noop:AN,toFiniteNumber:_N,findKey:rg,global:xr,isContextDefined:og,isSpecCompliantForm:MN,toJSONObject:RN,isAsyncFn:LN,isThenable:IN,setImmediate:lg,asap:DN,isIterable:t=>t!=null&&ct(t[Yi])};function J(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}O.inherits(J,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:O.toJSONObject(this.config),code:this.code,status:this.status}}});const ag=J.prototype,cg={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{cg[t]={value:t}}),Object.defineProperties(J,cg),Object.defineProperty(ag,"isAxiosError",{value:!0}),J.from=(t,e,n,r,o,s)=>{const i=Object.create(ag);return O.toFlatObject(t,i,function(a){return a!==Error.prototype},l=>l!=="isAxiosError"),J.call(i,t.message,e,n,r,o),i.cause=t,i.name=t.name,s&&Object.assign(i,s),i};const PN=null;function Gc(t){return O.isPlainObject(t)||O.isArray(t)}function ug(t){return O.endsWith(t,"[]")?t.slice(0,-2):t}function dg(t,e,n){return t?t.concat(e).map(function(o,s){return o=ug(o),!n&&s?"["+o+"]":o}).join(n?".":""):e}function BN(t){return O.isArray(t)&&!t.some(Gc)}const FN=O.toFlatObject(O,{},null,function(e){return/^is[A-Z]/.test(e)});function tl(t,e,n){if(!O.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=O.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!O.isUndefined(y[m])});const r=n.metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,a=(n.Blob||typeof Blob<"u"&&Blob)&&O.isSpecCompliantForm(e);if(!O.isFunction(o))throw new TypeError("visitor must be a function");function c(h){if(h===null)return"";if(O.isDate(h))return h.toISOString();if(O.isBoolean(h))return h.toString();if(!a&&O.isBlob(h))throw new J("Blob is not supported. Use a Buffer instead.");return O.isArrayBuffer(h)||O.isTypedArray(h)?a&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,m,y){let b=h;if(h&&!y&&typeof h=="object"){if(O.endsWith(m,"{}"))m=r?m:m.slice(0,-2),h=JSON.stringify(h);else if(O.isArray(h)&&BN(h)||(O.isFileList(h)||O.endsWith(m,"[]"))&&(b=O.toArray(h)))return m=ug(m),b.forEach(function(k,E){!(O.isUndefined(k)||k===null)&&e.append(i===!0?dg([m],E,s):i===null?m:m+"[]",c(k))}),!1}return Gc(h)?!0:(e.append(dg(y,m,s),c(h)),!1)}const d=[],f=Object.assign(FN,{defaultVisitor:u,convertValue:c,isVisitable:Gc});function p(h,m){if(!O.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(h),O.forEach(h,function(b,w){(!(O.isUndefined(b)||b===null)&&o.call(e,b,O.isString(w)?w.trim():w,m,f))===!0&&p(b,m?m.concat(w):[w])}),d.pop()}}if(!O.isObject(t))throw new TypeError("data must be an object");return p(t),e}function fg(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Yc(t,e){this._pairs=[],t&&tl(t,this,e)}const pg=Yc.prototype;pg.append=function(e,n){this._pairs.push([e,n])},pg.toString=function(e){const n=e?function(r){return e.call(this,r,fg)}:fg;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function $N(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function hg(t,e,n){if(!e)return t;const r=n&&n.encode||$N;O.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(e,n):s=O.isURLSearchParams(e)?e.toString():new Yc(e,n).toString(r),s){const i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class mg{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){O.forEach(this.handlers,function(r){r!==null&&e(r)})}}const gg={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},VN={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Yc,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Xc=typeof window<"u"&&typeof document<"u",Qc=typeof navigator=="object"&&navigator||void 0,HN=Xc&&(!Qc||["ReactNative","NativeScript","NS"].indexOf(Qc.product)<0),UN=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",zN=Xc&&window.location.href||"http://localhost",Je={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Xc,hasStandardBrowserEnv:HN,hasStandardBrowserWebWorkerEnv:UN,navigator:Qc,origin:zN},Symbol.toStringTag,{value:"Module"})),...VN};function jN(t,e){return tl(t,new Je.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Je.isNode&&O.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function WN(t){return O.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function KN(t){const e={},n=Object.keys(t);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],e[s]=t[s];return e}function yg(t){function e(n,r,o,s){let i=n[s++];if(i==="__proto__")return!0;const l=Number.isFinite(+i),a=s>=n.length;return i=!i&&O.isArray(o)?o.length:i,a?(O.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!l):((!o[i]||!O.isObject(o[i]))&&(o[i]=[]),e(n,r,o[i],s)&&O.isArray(o[i])&&(o[i]=KN(o[i])),!l)}if(O.isFormData(t)&&O.isFunction(t.entries)){const n={};return O.forEachEntry(t,(r,o)=>{e(WN(r),o,n,0)}),n}return null}function qN(t,e,n){if(O.isString(t))try{return(e||JSON.parse)(t),O.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const us={transitional:gg,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=O.isObject(e);if(s&&O.isHTMLForm(e)&&(e=new FormData(e)),O.isFormData(e))return o?JSON.stringify(yg(e)):e;if(O.isArrayBuffer(e)||O.isBuffer(e)||O.isStream(e)||O.isFile(e)||O.isBlob(e)||O.isReadableStream(e))return e;if(O.isArrayBufferView(e))return e.buffer;if(O.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return jN(e,this.formSerializer).toString();if((l=O.isFileList(e))||r.indexOf("multipart/form-data")>-1){const a=this.env&&this.env.FormData;return tl(l?{"files[]":e}:e,a&&new a,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),qN(e)):e}],transformResponse:[function(e){const n=this.transitional||us.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(O.isResponse(e)||O.isReadableStream(e))return e;if(e&&O.isString(e)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(l){if(i)throw l.name==="SyntaxError"?J.from(l,J.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Je.classes.FormData,Blob:Je.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};O.forEach(["delete","get","head","post","put","patch"],t=>{us.headers[t]={}});const JN=O.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),GN=t=>{const e={};let n,r,o;return t&&t.split(`
139
- `).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||e[n]&&JN[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},bg=Symbol("internals");function ds(t){return t&&String(t).trim().toLowerCase()}function nl(t){return t===!1||t==null?t:O.isArray(t)?t.map(nl):String(t)}function YN(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const XN=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Zc(t,e,n,r,o){if(O.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!O.isString(e)){if(O.isString(r))return e.indexOf(r)!==-1;if(O.isRegExp(r))return r.test(e)}}function QN(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function ZN(t,e){const n=O.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,s,i){return this[r].call(this,e,o,s,i)},configurable:!0})})}let ut=class{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function s(l,a,c){const u=ds(a);if(!u)throw new Error("header name must be a non-empty string");const d=O.findKey(o,u);(!d||o[d]===void 0||c===!0||c===void 0&&o[d]!==!1)&&(o[d||a]=nl(l))}const i=(l,a)=>O.forEach(l,(c,u)=>s(c,u,a));if(O.isPlainObject(e)||e instanceof this.constructor)i(e,n);else if(O.isString(e)&&(e=e.trim())&&!XN(e))i(GN(e),n);else if(O.isObject(e)&&O.isIterable(e)){let l={},a,c;for(const u of e){if(!O.isArray(u))throw TypeError("Object iterator must return a key-value pair");l[c=u[0]]=(a=l[c])?O.isArray(a)?[...a,u[1]]:[a,u[1]]:u[1]}i(l,n)}else e!=null&&s(n,e,r);return this}get(e,n){if(e=ds(e),e){const r=O.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return YN(o);if(O.isFunction(n))return n.call(this,o,r);if(O.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=ds(e),e){const r=O.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||Zc(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function s(i){if(i=ds(i),i){const l=O.findKey(r,i);l&&(!n||Zc(r,r[l],l,n))&&(delete r[l],o=!0)}}return O.isArray(e)?e.forEach(s):s(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!e||Zc(this,this[s],s,e,!0))&&(delete this[s],o=!0)}return o}normalize(e){const n=this,r={};return O.forEach(this,(o,s)=>{const i=O.findKey(r,s);if(i){n[i]=nl(o),delete n[s];return}const l=e?QN(s):String(s).trim();l!==s&&delete n[s],n[l]=nl(o),r[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return O.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&O.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
140
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[bg]=this[bg]={accessors:{}}).accessors,o=this.prototype;function s(i){const l=ds(i);r[l]||(ZN(o,i),r[l]=!0)}return O.isArray(e)?e.forEach(s):s(e),this}};ut.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),O.reduceDescriptors(ut.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),O.freezeMethods(ut);function eu(t,e){const n=this||us,r=e||n,o=ut.from(r.headers);let s=r.data;return O.forEach(t,function(l){s=l.call(n,s,o.normalize(),e?e.status:void 0)}),o.normalize(),s}function Eg(t){return!!(t&&t.__CANCEL__)}function so(t,e,n){J.call(this,t??"canceled",J.ERR_CANCELED,e,n),this.name="CanceledError"}O.inherits(so,J,{__CANCEL__:!0});function wg(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new J("Request failed with status code "+n.status,[J.ERR_BAD_REQUEST,J.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function eA(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function tA(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,s=0,i;return e=e!==void 0?e:1e3,function(a){const c=Date.now(),u=r[s];i||(i=c),n[o]=a,r[o]=c;let d=s,f=0;for(;d!==o;)f+=n[d++],d=d%t;if(o=(o+1)%t,o===s&&(s=(s+1)%t),c-i<e)return;const p=u&&c-u;return p?Math.round(f*1e3/p):void 0}}function nA(t,e){let n=0,r=1e3/e,o,s;const i=(c,u=Date.now())=>{n=u,o=null,s&&(clearTimeout(s),s=null),t.apply(null,c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=r?i(c,u):(o=c,s||(s=setTimeout(()=>{s=null,i(o)},r-d)))},()=>o&&i(o)]}const rl=(t,e,n=3)=>{let r=0;const o=tA(50,250);return nA(s=>{const i=s.loaded,l=s.lengthComputable?s.total:void 0,a=i-r,c=o(a),u=i<=l;r=i;const d={loaded:i,total:l,progress:l?i/l:void 0,bytes:a,rate:c||void 0,estimated:c&&l&&u?(l-i)/c:void 0,event:s,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(d)},n)},kg=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Cg=t=>(...e)=>O.asap(()=>t(...e)),rA=Je.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Je.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Je.origin),Je.navigator&&/(msie|trident)/i.test(Je.navigator.userAgent)):()=>!0,oA=Je.hasStandardBrowserEnv?{write(t,e,n,r,o,s){const i=[t+"="+encodeURIComponent(e)];O.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),O.isString(r)&&i.push("path="+r),O.isString(o)&&i.push("domain="+o),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function sA(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function iA(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Sg(t,e,n){let r=!sA(e);return t&&(r||n==!1)?iA(t,e):e}const vg=t=>t instanceof ut?{...t}:t;function Tr(t,e){e=e||{};const n={};function r(c,u,d,f){return O.isPlainObject(c)&&O.isPlainObject(u)?O.merge.call({caseless:f},c,u):O.isPlainObject(u)?O.merge({},u):O.isArray(u)?u.slice():u}function o(c,u,d,f){if(O.isUndefined(u)){if(!O.isUndefined(c))return r(void 0,c,d,f)}else return r(c,u,d,f)}function s(c,u){if(!O.isUndefined(u))return r(void 0,u)}function i(c,u){if(O.isUndefined(u)){if(!O.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function l(c,u,d){if(d in e)return r(c,u);if(d in t)return r(void 0,c)}const a={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(c,u,d)=>o(vg(c),vg(u),d,!0)};return O.forEach(Object.keys(Object.assign({},t,e)),function(u){const d=a[u]||o,f=d(t[u],e[u],u);O.isUndefined(f)&&d!==l||(n[u]=f)}),n}const xg=t=>{const e=Tr({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:l}=e;e.headers=i=ut.from(i),e.url=hg(Sg(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let a;if(O.isFormData(n)){if(Je.hasStandardBrowserEnv||Je.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((a=i.getContentType())!==!1){const[c,...u]=a?a.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([c||"multipart/form-data",...u].join("; "))}}if(Je.hasStandardBrowserEnv&&(r&&O.isFunction(r)&&(r=r(e)),r||r!==!1&&rA(e.url))){const c=o&&s&&oA.read(s);c&&i.set(o,c)}return e},lA=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=xg(t);let s=o.data;const i=ut.from(o.headers).normalize();let{responseType:l,onUploadProgress:a,onDownloadProgress:c}=o,u,d,f,p,h;function m(){p&&p(),h&&h(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(o.method.toUpperCase(),o.url,!0),y.timeout=o.timeout;function b(){if(!y)return;const k=ut.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),x={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:k,config:t,request:y};wg(function(T){n(T),m()},function(T){r(T),m()},x),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(r(new J("Request aborted",J.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new J("Network Error",J.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let E=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const x=o.transitional||gg;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),r(new J(E,x.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,t,y)),y=null},s===void 0&&i.setContentType(null),"setRequestHeader"in y&&O.forEach(i.toJSON(),function(E,x){y.setRequestHeader(x,E)}),O.isUndefined(o.withCredentials)||(y.withCredentials=!!o.withCredentials),l&&l!=="json"&&(y.responseType=o.responseType),c&&([f,h]=rl(c,!0),y.addEventListener("progress",f)),a&&y.upload&&([d,p]=rl(a),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",p)),(o.cancelToken||o.signal)&&(u=k=>{y&&(r(!k||k.type?new so(null,t,y):k),y.abort(),y=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const w=eA(o.url);if(w&&Je.protocols.indexOf(w)===-1){r(new J("Unsupported protocol "+w+":",J.ERR_BAD_REQUEST,t));return}y.send(s||null)})},aA=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,o;const s=function(c){if(!o){o=!0,l();const u=c instanceof Error?c:this.reason;r.abort(u instanceof J?u:new so(u instanceof Error?u.message:u))}};let i=e&&setTimeout(()=>{i=null,s(new J(`timeout ${e} of ms exceeded`,J.ETIMEDOUT))},e);const l=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),t=null)};t.forEach(c=>c.addEventListener("abort",s));const{signal:a}=r;return a.unsubscribe=()=>O.asap(l),a}},cA=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,o;for(;r<n;)o=r+e,yield t.slice(r,o),r=o},uA=async function*(t,e){for await(const n of dA(t))yield*cA(n,e)},dA=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},Tg=(t,e,n,r)=>{const o=uA(t,e);let s=0,i,l=a=>{i||(i=!0,r&&r(a))};return new ReadableStream({async pull(a){try{const{done:c,value:u}=await o.next();if(c){l(),a.close();return}let d=u.byteLength;if(n){let f=s+=d;n(f)}a.enqueue(new Uint8Array(u))}catch(c){throw l(c),c}},cancel(a){return l(a),o.return()}},{highWaterMark:2})},ol=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Og=ol&&typeof ReadableStream=="function",fA=ol&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Ng=(t,...e)=>{try{return!!t(...e)}catch{return!1}},pA=Og&&Ng(()=>{let t=!1;const e=new Request(Je.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Ag=64*1024,tu=Og&&Ng(()=>O.isReadableStream(new Response("").body)),sl={stream:tu&&(t=>t.body)};ol&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!sl[e]&&(sl[e]=O.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new J(`Response type '${e}' is not supported`,J.ERR_NOT_SUPPORT,r)})})})(new Response);const hA=async t=>{if(t==null)return 0;if(O.isBlob(t))return t.size;if(O.isSpecCompliantForm(t))return(await new Request(Je.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(O.isArrayBufferView(t)||O.isArrayBuffer(t))return t.byteLength;if(O.isURLSearchParams(t)&&(t=t+""),O.isString(t))return(await fA(t)).byteLength},mA=async(t,e)=>{const n=O.toFiniteNumber(t.getContentLength());return n??hA(e)},nu={http:PN,xhr:lA,fetch:ol&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:l,onUploadProgress:a,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:f}=xg(t);c=c?(c+"").toLowerCase():"text";let p=aA([o,s&&s.toAbortSignal()],i),h;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(a&&pA&&n!=="get"&&n!=="head"&&(y=await mA(u,r))!==0){let x=new Request(e,{method:"POST",body:r,duplex:"half"}),v;if(O.isFormData(r)&&(v=x.headers.get("content-type"))&&u.setContentType(v),x.body){const[T,_]=kg(y,rl(Cg(a)));r=Tg(x.body,Ag,T,_)}}O.isString(d)||(d=d?"include":"omit");const b="credentials"in Request.prototype;h=new Request(e,{...f,signal:p,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:b?d:void 0});let w=await fetch(h,f);const k=tu&&(c==="stream"||c==="response");if(tu&&(l||k&&m)){const x={};["status","statusText","headers"].forEach(P=>{x[P]=w[P]});const v=O.toFiniteNumber(w.headers.get("content-length")),[T,_]=l&&kg(v,rl(Cg(l),!0))||[];w=new Response(Tg(w.body,Ag,T,()=>{_&&_(),m&&m()}),x)}c=c||"text";let E=await sl[O.findKey(sl,c)||"text"](w,t);return!k&&m&&m(),await new Promise((x,v)=>{wg(x,v,{data:E,headers:ut.from(w.headers),status:w.status,statusText:w.statusText,config:t,request:h})})}catch(b){throw m&&m(),b&&b.name==="TypeError"&&/Load failed|fetch/i.test(b.message)?Object.assign(new J("Network Error",J.ERR_NETWORK,t,h),{cause:b.cause||b}):J.from(b,b&&b.code,t,h)}})};O.forEach(nu,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const _g=t=>`- ${t}`,gA=t=>O.isFunction(t)||t===null||t===!1,Mg={getAdapter:t=>{t=O.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let s=0;s<e;s++){n=t[s];let i;if(r=n,!gA(n)&&(r=nu[(i=String(n)).toLowerCase()],r===void 0))throw new J(`Unknown adapter '${i}'`);if(r)break;o[i||"#"+s]=r}if(!r){const s=Object.entries(o).map(([l,a])=>`adapter ${l} `+(a===!1?"is not supported by the environment":"is not available in the build"));let i=e?s.length>1?`since :
141
- `+s.map(_g).join(`
142
- `):" "+_g(s[0]):"as no adapter specified";throw new J("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:nu};function ru(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new so(null,t)}function Rg(t){return ru(t),t.headers=ut.from(t.headers),t.data=eu.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Mg.getAdapter(t.adapter||us.adapter)(t).then(function(r){return ru(t),r.data=eu.call(t,t.transformResponse,r),r.headers=ut.from(r.headers),r},function(r){return Eg(r)||(ru(t),r&&r.response&&(r.response.data=eu.call(t,t.transformResponse,r.response),r.response.headers=ut.from(r.response.headers))),Promise.reject(r)})}const Lg="1.10.0",il={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{il[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Ig={};il.transitional=function(e,n,r){function o(s,i){return"[Axios v"+Lg+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,l)=>{if(e===!1)throw new J(o(i," has been removed"+(n?" in "+n:"")),J.ERR_DEPRECATED);return n&&!Ig[i]&&(Ig[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,i,l):!0}},il.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function yA(t,e,n){if(typeof t!="object")throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const s=r[o],i=e[s];if(i){const l=t[s],a=l===void 0||i(l,s,t);if(a!==!0)throw new J("option "+s+" must be "+a,J.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new J("Unknown option "+s,J.ERR_BAD_OPTION)}}const ll={assertOptions:yA,validators:il},on=ll.validators;let Or=class{constructor(e){this.defaults=e||{},this.interceptors={request:new mg,response:new mg}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
143
- `+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Tr(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&ll.assertOptions(r,{silentJSONParsing:on.transitional(on.boolean),forcedJSONParsing:on.transitional(on.boolean),clarifyTimeoutError:on.transitional(on.boolean)},!1),o!=null&&(O.isFunction(o)?n.paramsSerializer={serialize:o}:ll.assertOptions(o,{encode:on.function,serialize:on.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ll.assertOptions(n,{baseUrl:on.spelling("baseURL"),withXsrfToken:on.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&O.merge(s.common,s[n.method]);s&&O.forEach(["delete","get","head","post","put","patch","common"],h=>{delete s[h]}),n.headers=ut.concat(i,s);const l=[];let a=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(a=a&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,f;if(!a){const h=[Rg.bind(this),void 0];for(h.unshift.apply(h,l),h.push.apply(h,c),f=h.length,u=Promise.resolve(n);d<f;)u=u.then(h[d++],h[d++]);return u}f=l.length;let p=n;for(d=0;d<f;){const h=l[d++],m=l[d++];try{p=h(p)}catch(y){m.call(this,y);break}}try{u=Rg.call(this,p)}catch(h){return Promise.reject(h)}for(d=0,f=c.length;d<f;)u=u.then(c[d++],c[d++]);return u}getUri(e){e=Tr(this.defaults,e);const n=Sg(e.baseURL,e.url,e.allowAbsoluteUrls);return hg(n,e.params,e.paramsSerializer)}};O.forEach(["delete","get","head","options"],function(e){Or.prototype[e]=function(n,r){return this.request(Tr(r||{},{method:e,url:n,data:(r||{}).data}))}}),O.forEach(["post","put","patch"],function(e){function n(r){return function(s,i,l){return this.request(Tr(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}Or.prototype[e]=n(),Or.prototype[e+"Form"]=n(!0)});let bA=class $g{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(l=>{r.subscribe(l),s=l}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},e(function(s,i,l){r.reason||(r.reason=new so(s,i,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new $g(function(o){e=o}),cancel:e}}};function EA(t){return function(n){return t.apply(null,n)}}function wA(t){return O.isObject(t)&&t.isAxiosError===!0}const ou={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ou).forEach(([t,e])=>{ou[e]=t});function Dg(t){const e=new Or(t),n=Zm(Or.prototype.request,e);return O.extend(n,Or.prototype,e,{allOwnKeys:!0}),O.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return Dg(Tr(t,o))},n}const xe=Dg(us);xe.Axios=Or,xe.CanceledError=so,xe.CancelToken=bA,xe.isCancel=Eg,xe.VERSION=Lg,xe.toFormData=tl,xe.AxiosError=J,xe.Cancel=xe.CanceledError,xe.all=function(e){return Promise.all(e)},xe.spread=EA,xe.isAxiosError=wA,xe.mergeConfig=Tr,xe.AxiosHeaders=ut,xe.formToJSON=t=>yg(O.isHTMLForm(t)?new FormData(t):t),xe.getAdapter=Mg.getAdapter,xe.HttpStatusCode=ou,xe.default=xe;const{Axios:r_,AxiosError:o_,CanceledError:s_,isCancel:i_,CancelToken:l_,VERSION:a_,all:c_,Cancel:u_,isAxiosError:d_,spread:f_,toFormData:p_,AxiosHeaders:h_,HttpStatusCode:m_,formToJSON:g_,getAdapter:y_,mergeConfig:b_}=xe,kA=async t=>{try{const e=new FormData;e.append("unique","true"),e.append("file",t);const{data:n}=await xe.post("/file/upload/uploads?id=&form=&table=",e);return n?.result}catch(e){console.error(e)}},CA=async(t,e)=>{const n=e.clipboardData?.items;if(n){const r=e.clipboardData?.getData("text/html"),o=e.clipboardData?.getData("text/plain");if(r){const{state:s,dispatch:i}=t,{tr:l}=s,a=Ar.fromSchema(t.state.schema),c=new DOMParser().parseFromString(r,"text/html").body,u=a.parse(c),d=l.replaceSelectionWith(u);return i(d),e.preventDefault(),!0}if(o){const{state:s,dispatch:i}=t,{tr:l}=s,a=l.insertText(o,s.selection.from,s.selection.to);return i(a),e.preventDefault(),!0}for(let s=0;s<n.length;s++){const i=n[s];if(i.type.startsWith("image/")){const l=i.getAsFile();if(l){const a=await kA(l),{schema:c}=t.state,u=c.nodes.image.create({src:a?.file_path}),d=t.state.tr.replaceSelectionWith(u);return t.dispatch(d),e.preventDefault(),!0}}}}return!1},SA=Fe.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(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]}`,pe(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Ca({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),vA=["font-[700] text-[30px]","font-[700] text-[26px]","font-[700] text-[22px]","font-[700] text-[18px]","font-[500] text-[16px]","font-[400] text-[14px]"],xA=SA.extend({addOptions(){return{...this.parent?.(),levels:[1,2,3,4,5,6]}}}).extend({addAttributes(){return{...this.parent?.(),level:{default:1,renderHTML:t=>{const e=t.level||1;return{class:`heading-level-${e} ${vA[e-1]}`}}}}}}),TA=Fe.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",pe(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}).configure({HTMLAttributes:{class:"min-h-[1rem]"}}),OA={class:"bg-white border border border-solid border-gray-200 rounded-xl"},NA={class:"flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent"},AA={__name:"vs-richtext",props:{modelValue:{type:String,default:()=>""},toolbar:{type:Array,default:()=>["bold","italic","underline","text_align","color","color_picker","blockquote","bullet_list","ordered_list","codeblock","text_more","strike","link","table"]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,o=lk({content:n.modelValue,extensions:[MS,VS,fk,yk,wk,Sk,Tk,Nk,_k,Mk,Lk,Ik,jk,TA,Jk,HS,wC,Yk,qk,Gk,xA,$S,kC,OS.configure({types:["heading","paragraph"]}),SC,TS.configure({HTMLAttributes:{class:"editor-content"},resizable:!0}),_S,AS,NS,EC.configure({HTMLAttributes:{class:"editor-link"},openOnClick:!1,autolink:!0})],editorProps:{handlePaste:CA}}),s=g.computed(()=>n.toolbar.map(l=>XO[l]));g.watch(o,l=>{l&&o.value.on("update",a=>{const c=a.editor.getHTML();c!==n.modelValue&&r("update:modelValue",c==='<p class="min-h-[1rem]"></p>'?null:c)})});const i=()=>{o.value&&!o.value.isFocused&&o.value.commands.focus()};return(l,a)=>(g.openBlock(),g.createElementBlock("div",OA,[g.createElementVNode("div",NA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(s.value,c=>(g.openBlock(),g.createBlock(g.resolveDynamicComponent(c),{editor:g.unref(o)},null,8,["editor"]))),256))]),g.createElementVNode("div",{onClick:i,class:"relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800"},[g.createVNode(g.unref(ik),{editor:g.unref(o),class:"relative w-full"},null,8,["editor"])])]))}},_A={},MA={},RA={paragraph:"Paragraph",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",createTable:"Create Table",addColumn:"Add Column",addRow:"Add Row",deleteColumn:"Delete Column",deleteRow:"Delete Row",deleteTable:"Delete Table",linkTitle:"Enter Link",create:"Create",cancel:"Cancel"},LA={paragraph:"Звичайний текст",heading1:"Заголовок 1",heading2:"Заголовок 2",heading3:"Заголовок 3",heading4:"Заголовок 4",heading5:"Заголовок 5",heading6:"Заголовок 6",createTable:"Створити таблицю",addColumn:"Додати колонку",addRow:"Додати рядок",deleteColumn:"Видалити колонку",deleteRow:"Видалити рядок",deleteTable:"Видалити таблицю",linkTitle:"Введіть посилання",create:"Створити",cancel:"Скасувати"},su=sO({legacy:!1,locale:"uk",fallbackLocale:"en",messages:{en:{..._A,tiptap:RA},uk:{...MA,tiptap:LA}}});return{install:(t,e={})=>{if(e.i18nConfig){const n=e.i18nConfig,r=su.global?.messages?.value||su.messages;r&&n.global?.messages?.value&&Object.keys(r).forEach(o=>{n.global.mergeLocaleMessage?n.global.mergeLocaleMessage(o,r[o]):n.global.setLocaleMessage(o,r[o])})}else t.use(su);t.component("vs-richtext",AA)}}});
137
+ */const o3="11.1.7";function i3(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(vr().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(vr().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(vr().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(vr().__INTLIFY_PROD_DEVTOOLS__=!1)}const ye={UNEXPECTED_RETURN_TYPE:fT,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:30,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_COMPATIBLE_LEGACY_VUE_I18N:33,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34,DUPLICATE_USE_I18N_CALLING:35};function dt(t,...e){return to(t,null,process.env.NODE_ENV!=="production"?{messages:s3,args:e}:void 0)}const s3={[ye.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[ye.INVALID_ARGUMENT]:"Invalid argument",[ye.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[ye.NOT_INSTALLED]:"Need to install with `app.use` function",[ye.UNEXPECTED_ERROR]:"Unexpected error",[ye.REQUIRED_VALUE]:"Required in value: {0}",[ye.INVALID_VALUE]:"Invalid value",[ye.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[ye.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[ye.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[ye.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly",[ye.DUPLICATE_USE_I18N_CALLING]:"Duplicate `useI18n` calling by local scope. Please don't call it on local scope"},Vc=an("__translateVNode"),Hc=an("__datetimeParts"),zc=an("__numberParts"),Sr=an("__enableEmitter"),oi=an("__disableEmitter"),yg=an("__setPluralRules"),wg=an("__injectWithOption"),jc=an("__dispose"),cn={FALLBACK_TO_ROOT:ST,NOT_FOUND_PARENT_SCOPE:9,IGNORE_OBJ_FLATTEN:10,DEPRECATE_LEGACY_MODE:11,DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE:12},a3={[cn.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[cn.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[cn.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[cn.DEPRECATE_LEGACY_MODE]:`Legacy API mode has been deprecated in v11. Use Composition API mode instead.
138
+ About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,[cn.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]:"'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead."};function ii(t,...e){return Hs(a3[t],...e)}function si(t){if(!ue(t)||Ft(t))return t;for(const e in t)if(qt(t,e))if(!e.includes("."))ue(t[e])&&si(t[e]);else{const n=e.split("."),r=n.length-1;let o=t,i=!1;for(let s=0;s<r;s++){if(n[s]==="__proto__")throw new Error(`unsafe key: ${n[s]}`);if(n[s]in o||(o[n[s]]=be()),!ue(o[n[s]])){process.env.NODE_ENV!=="production"&&Yn(ii(cn.IGNORE_OBJ_FLATTEN,{key:n[s]})),i=!0;break}o=o[n[s]]}if(i||(Ft(o)?zm.includes(n[r])||delete t[e]:(o[n[r]]=t[e],delete t[e])),!Ft(o)){const s=o[n[r]];ue(s)&&si(s)}}return t}function Uc(t,e){const{messages:n,__i18n:r,messageResolver:o,flatJson:i}=e,s=ae(n)?n:xe(r)?be():{[t]:be()};if(xe(r)&&r.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:l,resource:c}=a;l?(s[l]=s[l]||be(),Us(c,s[l])):Us(c,s)}else K(a)&&Us(JSON.parse(a),s)}),o==null&&i)for(const a in s)qt(s,a)&&si(s[a]);return s}function kg(t){return t.type}function _g(t,e,n){let r=ue(e.messages)?e.messages:be();"__i18nGlobal"in n&&(r=Uc(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const o=Object.keys(r);o.length&&o.forEach(i=>{t.mergeLocaleMessage(i,r[i])});{if(ue(e.datetimeFormats)){const i=Object.keys(e.datetimeFormats);i.length&&i.forEach(s=>{t.mergeDateTimeFormat(s,e.datetimeFormats[s])})}if(ue(e.numberFormats)){const i=Object.keys(e.numberFormats);i.length&&i.forEach(s=>{t.mergeNumberFormat(s,e.numberFormats[s])})}}}function Eg(t){return y.createVNode(y.Text,null,t,0)}const vg="__INTLIFY_META__",Cg=()=>[],l3=()=>!1;let Sg=0;function Tg(t){return(e,n,r,o)=>t(n,r,y.getCurrentInstance()||void 0,o)}const c3=()=>{const t=y.getCurrentInstance();let e=null;return t&&(e=kg(t)[vg])?{[vg]:e}:null};function Wc(t={}){const{__root:e,__injectWithOption:n}=t,r=e===void 0,o=t.flatJson,i=Kt?y.ref:y.shallowRef;let s=de(t.inheritLocale)?t.inheritLocale:!0;const a=i(e&&s?e.locale.value:K(t.locale)?t.locale:ni),l=i(e&&s?e.fallbackLocale.value:K(t.fallbackLocale)||xe(t.fallbackLocale)||ae(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:a.value),c=i(Uc(a.value,t)),u=i(ae(t.datetimeFormats)?t.datetimeFormats:{[a.value]:{}}),f=i(ae(t.numberFormats)?t.numberFormats:{[a.value]:{}});let p=e?e.missingWarn:de(t.missingWarn)||eo(t.missingWarn)?t.missingWarn:!0,m=e?e.fallbackWarn:de(t.fallbackWarn)||eo(t.fallbackWarn)?t.fallbackWarn:!0,b=e?e.fallbackRoot:de(t.fallbackRoot)?t.fallbackRoot:!0,k=!!t.fallbackFormat,_=Ee(t.missing)?t.missing:null,E=Ee(t.missing)?Tg(t.missing):null,N=Ee(t.postTranslation)?t.postTranslation:null,A=e?e.warnHtmlMessage:de(t.warnHtmlMessage)?t.warnHtmlMessage:!0,d=!!t.escapeParameter;const g=e?e.modifiers:ae(t.modifiers)?t.modifiers:{};let h=t.pluralRules||e&&e.pluralRules,w;w=(()=>{r&&eg(null);const R={version:o3,locale:a.value,fallbackLocale:l.value,messages:c.value,modifiers:g,pluralRules:h,missing:E===null?void 0:E,missingWarn:p,fallbackWarn:m,fallbackFormat:k,unresolving:!0,postTranslation:N===null?void 0:N,warnHtmlMessage:A,escapeParameter:d,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};R.datetimeFormats=u.value,R.numberFormats=f.value,R.__datetimeFormatters=ae(w)?w.__datetimeFormatters:void 0,R.__numberFormatters=ae(w)?w.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(R.__v_emitter=ae(w)?w.__v_emitter:void 0);const z=IT(R);return r&&eg(z),z})(),ri(w,a.value,l.value);function S(){return[a.value,l.value,c.value,u.value,f.value]}const C=y.computed({get:()=>a.value,set:R=>{w.locale=R,a.value=R}}),M=y.computed({get:()=>l.value,set:R=>{w.fallbackLocale=R,l.value=R,ri(w,a.value,R)}}),P=y.computed(()=>c.value),D=y.computed(()=>u.value),F=y.computed(()=>f.value);function $(){return Ee(N)?N:null}function T(R){N=R,w.postTranslation=R}function I(){return _}function U(R){R!==null&&(E=Tg(R)),_=R,w.missing=E}function q(R,z){return R!=="translate"||!z.resolvedMessage}const Z=(R,z,ce,Ne,Tn,ao)=>{S();let er;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(w.fallbackContext=e?PT():void 0),er=R(w)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,r||(w.fallbackContext=void 0)}if(ce!=="translate exists"&&Ve(er)&&er===qs||ce==="translate exists"&&!er){const[Nn,bu]=z();if(process.env.NODE_ENV!=="production"&&e&&K(Nn)&&q(ce,bu)&&(b&&(Js(m,Nn)||ng(p,Nn))&&Yn(ii(cn.FALLBACK_TO_ROOT,{key:Nn,type:ce})),process.env.NODE_ENV!=="production")){const{__v_emitter:B}=w;B&&b&&B.emit("fallback",{type:ce,key:Nn,to:"global",groupId:`${ce}:${Nn}`})}return e&&b?Ne(e):Tn(Nn)}else{if(ao(er))return er;throw dt(ye.UNEXPECTED_RETURN_TYPE)}};function G(...R){return Z(z=>Reflect.apply(hg,null,[z,...R]),()=>Fc(...R),"translate",z=>Reflect.apply(z.t,z,[...R]),z=>z,z=>K(z))}function he(...R){const[z,ce,Ne]=R;if(Ne&&!ue(Ne))throw dt(ye.INVALID_ARGUMENT);return G(z,ce,He({resolvedMessage:!0},Ne||{}))}function Te(...R){return Z(z=>Reflect.apply(sg,null,[z,...R]),()=>Dc(...R),"datetime format",z=>Reflect.apply(z.d,z,[...R]),()=>Gs,z=>K(z)||xe(z))}function Oe(...R){return Z(z=>Reflect.apply(cg,null,[z,...R]),()=>Bc(...R),"number format",z=>Reflect.apply(z.n,z,[...R]),()=>Gs,z=>K(z)||xe(z))}function fe(R){return R.map(z=>K(z)||Ve(z)||de(z)?Eg(String(z)):z)}const Me={normalize:fe,interpolate:R=>R,type:"vnode"};function ke(...R){return Z(z=>{let ce;const Ne=z;try{Ne.processor=Me,ce=Reflect.apply(hg,null,[Ne,...R])}finally{Ne.processor=null}return ce},()=>Fc(...R),"translate",z=>z[Vc](...R),z=>[Eg(z)],z=>xe(z))}function _t(...R){return Z(z=>Reflect.apply(cg,null,[z,...R]),()=>Bc(...R),"number format",z=>z[zc](...R),Cg,z=>K(z)||xe(z))}function ot(...R){return Z(z=>Reflect.apply(sg,null,[z,...R]),()=>Dc(...R),"datetime format",z=>z[Hc](...R),Cg,z=>K(z)||xe(z))}function At(R){h=R,w.pluralRules=h}function Vt(R,z){return Z(()=>{if(!R)return!1;const ce=K(z)?z:a.value,Ne=Ht(ce),Tn=w.messageResolver(Ne,R);return Ft(Tn)||$t(Tn)||K(Tn)},()=>[R],"translate exists",ce=>Reflect.apply(ce.te,ce,[R,z]),l3,ce=>de(ce))}function Et(R){let z=null;const ce=Wm(w,l.value,a.value);for(let Ne=0;Ne<ce.length;Ne++){const Tn=c.value[ce[Ne]]||{},ao=w.messageResolver(Tn,R);if(ao!=null){z=ao;break}}return z}function dn(R){const z=Et(R);return z??(e?e.tm(R)||{}:{})}function Ht(R){return c.value[R]||{}}function Jt(R,z){if(o){const ce={[R]:z};for(const Ne in ce)qt(ce,Ne)&&si(ce[Ne]);z=ce[R]}c.value[R]=z,w.messages=c.value}function Sn(R,z){c.value[R]=c.value[R]||{};const ce={[R]:z};if(o)for(const Ne in ce)qt(ce,Ne)&&si(ce[Ne]);z=ce[R],Us(z,c.value[R]),w.messages=c.value}function O(R){return u.value[R]||{}}function x(R,z){u.value[R]=z,w.datetimeFormats=u.value,lg(w,R,z)}function H(R,z){u.value[R]=He(u.value[R]||{},z),w.datetimeFormats=u.value,lg(w,R,z)}function Y(R){return f.value[R]||{}}function ve(R,z){f.value[R]=z,w.numberFormats=f.value,dg(w,R,z)}function me(R,z){f.value[R]=He(f.value[R]||{},z),w.numberFormats=f.value,dg(w,R,z)}Sg++,e&&Kt&&(y.watch(e.locale,R=>{s&&(a.value=R,w.locale=R,ri(w,a.value,l.value))}),y.watch(e.fallbackLocale,R=>{s&&(l.value=R,w.fallbackLocale=R,ri(w,a.value,l.value))}));const le={id:Sg,locale:C,fallbackLocale:M,get inheritLocale(){return s},set inheritLocale(R){s=R,R&&e&&(a.value=e.locale.value,l.value=e.fallbackLocale.value,ri(w,a.value,l.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:P,get modifiers(){return g},get pluralRules(){return h||{}},get isGlobal(){return r},get missingWarn(){return p},set missingWarn(R){p=R,w.missingWarn=p},get fallbackWarn(){return m},set fallbackWarn(R){m=R,w.fallbackWarn=m},get fallbackRoot(){return b},set fallbackRoot(R){b=R},get fallbackFormat(){return k},set fallbackFormat(R){k=R,w.fallbackFormat=k},get warnHtmlMessage(){return A},set warnHtmlMessage(R){A=R,w.warnHtmlMessage=R},get escapeParameter(){return d},set escapeParameter(R){d=R,w.escapeParameter=R},t:G,getLocaleMessage:Ht,setLocaleMessage:Jt,mergeLocaleMessage:Sn,getPostTranslationHandler:$,setPostTranslationHandler:T,getMissingHandler:I,setMissingHandler:U,[yg]:At};return le.datetimeFormats=D,le.numberFormats=F,le.rt=he,le.te=Vt,le.tm=dn,le.d=Te,le.n=Oe,le.getDateTimeFormat=O,le.setDateTimeFormat=x,le.mergeDateTimeFormat=H,le.getNumberFormat=Y,le.setNumberFormat=ve,le.mergeNumberFormat=me,le[wg]=n,le[Vc]=ke,le[Hc]=ot,le[zc]=_t,process.env.NODE_ENV!=="production"&&(le[Sr]=R=>{w.__v_emitter=R},le[oi]=()=>{w.__v_emitter=void 0}),le}const Ng="vue-i18n: composer properties",Kc={"vue-devtools-plugin-vue-i18n":"Vue I18n DevTools","vue-i18n-resource-inspector":"Vue I18n DevTools","vue-i18n-timeline":"Vue I18n"},u3={"vue-i18n-resource-inspector":"Search for scopes ..."},d3={"vue-i18n-timeline":16764185};let qc;async function f3(t,e){return new Promise((n,r)=>{try{r3({id:"vue-devtools-plugin-vue-i18n",label:Kc["vue-devtools-plugin-vue-i18n"],packageName:"vue-i18n",homepage:"https://vue-i18n.intlify.dev",logo:"https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",componentStateTypes:[Ng],app:t},o=>{qc=o,o.on.visitComponentTree(({componentInstance:s,treeNode:a})=>{p3(s,a,e)}),o.on.inspectComponent(({componentInstance:s,instanceData:a})=>{s.vnode.el&&s.vnode.el.__VUE_I18N__&&a&&(e.mode==="legacy"?s.vnode.el.__VUE_I18N__!==e.global.__composer&&Og(a,s.vnode.el.__VUE_I18N__):Og(a,s.vnode.el.__VUE_I18N__))}),o.addInspector({id:"vue-i18n-resource-inspector",label:Kc["vue-i18n-resource-inspector"],icon:"language",treeFilterPlaceholder:u3["vue-i18n-resource-inspector"]}),o.on.getInspectorTree(s=>{s.app===t&&s.inspectorId==="vue-i18n-resource-inspector"&&y3(s,e)});const i=new Map;o.on.getInspectorState(async s=>{if(s.app===t&&s.inspectorId==="vue-i18n-resource-inspector")if(o.unhighlightElement(),k3(s,e),s.nodeId==="global"){if(!i.has(s.app)){const[a]=await o.getComponentInstances(s.app);i.set(s.app,a)}o.highlightElement(i.get(s.app))}else{const a=w3(s.nodeId,e);a&&o.highlightElement(a)}}),o.on.editInspectorState(s=>{s.app===t&&s.inspectorId==="vue-i18n-resource-inspector"&&E3(s,e)}),o.addTimelineLayer({id:"vue-i18n-timeline",label:Kc["vue-i18n-timeline"],color:d3["vue-i18n-timeline"]}),n(!0)})}catch(o){console.error(o),r(!1)}})}function Ag(t){return t.type.name||t.type.displayName||t.type.__file||"Anonymous"}function p3(t,e,n){const r=n.mode==="composition"?n.global:n.global.__composer;if(t&&t.vnode.el&&t.vnode.el.__VUE_I18N__&&t.vnode.el.__VUE_I18N__!==r){const o={label:`i18n (${Ag(t)} Scope)`,textColor:0,backgroundColor:16764185};e.tags.push(o)}}function Og(t,e){const n=Ng;t.state.push({type:n,key:"locale",editable:!0,value:e.locale.value}),t.state.push({type:n,key:"availableLocales",editable:!1,value:e.availableLocales}),t.state.push({type:n,key:"fallbackLocale",editable:!0,value:e.fallbackLocale.value}),t.state.push({type:n,key:"inheritLocale",editable:!0,value:e.inheritLocale}),t.state.push({type:n,key:"messages",editable:!1,value:Gc(e.messages.value)}),t.state.push({type:n,key:"datetimeFormats",editable:!1,value:e.datetimeFormats.value}),t.state.push({type:n,key:"numberFormats",editable:!1,value:e.numberFormats.value})}function Gc(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];Ee(r)&&"source"in r?e[n]=b3(r):Ft(r)&&r.loc&&r.loc.source?e[n]=r.loc.source:ue(r)?e[n]=Gc(r):e[n]=r}),e}const h3={"<":"&lt;",">":"&gt;",'"':"&quot;","&":"&amp;"};function m3(t){return t.replace(/[<>"&]/g,g3)}function g3(t){return h3[t]||t}function b3(t){return{_custom:{type:"function",display:`<span>ƒ</span> ${t.source?`("${m3(t.source)}")`:"(?)"}`}}}function y3(t,e){t.rootNodes.push({id:"global",label:"Global Scope"});const n=e.mode==="composition"?e.global:e.global.__composer;for(const[r,o]of e.__instances){const i=e.mode==="composition"?o:o.__composer;n!==i&&t.rootNodes.push({id:i.id.toString(),label:`${Ag(r)} Scope`})}}function w3(t,e){let n=null;if(t!=="global"){for(const[r,o]of e.__instances.entries())if(o.id.toString()===t){n=r;break}}return n}function Mg(t,e){if(t==="global")return e.mode==="composition"?e.global:e.global.__composer;{const n=Array.from(e.__instances.values()).find(r=>r.id.toString()===t);return n?e.mode==="composition"?n:n.__composer:null}}function k3(t,e){const n=Mg(t.nodeId,e);return n&&(t.state=_3(n)),null}function _3(t){const e={},n="Locale related info",r=[{type:n,key:"locale",editable:!0,value:t.locale.value},{type:n,key:"fallbackLocale",editable:!0,value:t.fallbackLocale.value},{type:n,key:"availableLocales",editable:!1,value:t.availableLocales},{type:n,key:"inheritLocale",editable:!0,value:t.inheritLocale}];e[n]=r;const o="Locale messages info",i=[{type:o,key:"messages",editable:!1,value:Gc(t.messages.value)}];e[o]=i;{const s="Datetime formats info",a=[{type:s,key:"datetimeFormats",editable:!1,value:t.datetimeFormats.value}];e[s]=a;const l="Datetime formats info",c=[{type:l,key:"numberFormats",editable:!1,value:t.numberFormats.value}];e[l]=c}return e}function ai(t,e){if(qc){let n;e&&"groupId"in e&&(n=e.groupId,delete e.groupId),qc.addTimelineEvent({layerId:"vue-i18n-timeline",event:{title:t,groupId:n,time:Date.now(),meta:{},data:e||{},logType:t==="compile-error"?"error":t==="fallback"||t==="missing"?"warning":"default"}})}}function E3(t,e){const n=Mg(t.nodeId,e);if(n){const[r]=t.path;r==="locale"&&K(t.state.value)?n.locale.value=t.state.value:r==="fallbackLocale"&&(K(t.state.value)||xe(t.state.value)||ue(t.state.value))?n.fallbackLocale.value=t.state.value:r==="inheritLocale"&&de(t.state.value)&&(n.inheritLocale=t.state.value)}}function v3(t){const e=K(t.locale)?t.locale:ni,n=K(t.fallbackLocale)||xe(t.fallbackLocale)||ae(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,r=Ee(t.missing)?t.missing:void 0,o=de(t.silentTranslationWarn)||eo(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,i=de(t.silentFallbackWarn)||eo(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,s=de(t.fallbackRoot)?t.fallbackRoot:!0,a=!!t.formatFallbackMessages,l=ae(t.modifiers)?t.modifiers:{},c=t.pluralizationRules,u=Ee(t.postTranslation)?t.postTranslation:void 0,f=K(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,p=!!t.escapeParameterHtml,m=de(t.sync)?t.sync:!0;let b=t.messages;if(ae(t.sharedMessages)){const g=t.sharedMessages;b=Object.keys(g).reduce((w,v)=>{const S=w[v]||(w[v]={});return He(S,g[v]),w},b||{})}const{__i18n:k,__root:_,__injectWithOption:E}=t,N=t.datetimeFormats,A=t.numberFormats,d=t.flatJson;return{locale:e,fallbackLocale:n,messages:b,flatJson:d,datetimeFormats:N,numberFormats:A,missing:r,missingWarn:o,fallbackWarn:i,fallbackRoot:s,fallbackFormat:a,modifiers:l,pluralRules:c,postTranslation:u,warnHtmlMessage:f,escapeParameter:p,messageResolver:t.messageResolver,inheritLocale:m,__i18n:k,__root:_,__injectWithOption:E}}function Jc(t={}){const e=Wc(v3(t)),{__extender:n}=t,r={id:e.id,get locale(){return e.locale.value},set locale(o){e.locale.value=o},get fallbackLocale(){return e.fallbackLocale.value},set fallbackLocale(o){e.fallbackLocale.value=o},get messages(){return e.messages.value},get datetimeFormats(){return e.datetimeFormats.value},get numberFormats(){return e.numberFormats.value},get availableLocales(){return e.availableLocales},get missing(){return e.getMissingHandler()},set missing(o){e.setMissingHandler(o)},get silentTranslationWarn(){return de(e.missingWarn)?!e.missingWarn:e.missingWarn},set silentTranslationWarn(o){e.missingWarn=de(o)?!o:o},get silentFallbackWarn(){return de(e.fallbackWarn)?!e.fallbackWarn:e.fallbackWarn},set silentFallbackWarn(o){e.fallbackWarn=de(o)?!o:o},get modifiers(){return e.modifiers},get formatFallbackMessages(){return e.fallbackFormat},set formatFallbackMessages(o){e.fallbackFormat=o},get postTranslation(){return e.getPostTranslationHandler()},set postTranslation(o){e.setPostTranslationHandler(o)},get sync(){return e.inheritLocale},set sync(o){e.inheritLocale=o},get warnHtmlInMessage(){return e.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){e.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return e.escapeParameter},set escapeParameterHtml(o){e.escapeParameter=o},get pluralizationRules(){return e.pluralRules||{}},__composer:e,t(...o){return Reflect.apply(e.t,e,[...o])},rt(...o){return Reflect.apply(e.rt,e,[...o])},te(o,i){return e.te(o,i)},tm(o){return e.tm(o)},getLocaleMessage(o){return e.getLocaleMessage(o)},setLocaleMessage(o,i){e.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){e.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(e.d,e,[...o])},getDateTimeFormat(o){return e.getDateTimeFormat(o)},setDateTimeFormat(o,i){e.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){e.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(e.n,e,[...o])},getNumberFormat(o){return e.getNumberFormat(o)},setNumberFormat(o,i){e.setNumberFormat(o,i)},mergeNumberFormat(o,i){e.mergeNumberFormat(o,i)}};return r.__extender=n,process.env.NODE_ENV!=="production"&&(r.__enableEmitter=o=>{const i=e;i[Sr]&&i[Sr](o)},r.__disableEmitter=()=>{const o=e;o[oi]&&o[oi]()}),r}function C3(t,e,n){return{beforeCreate(){const r=y.getCurrentInstance();if(!r)throw dt(ye.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;if(o.__i18n&&(i.__i18n=o.__i18n),i.__root=e,this===this.$root)this.$i18n=xg(t,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Jc(i);const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=xg(t,o);else{this.$i18n=Jc({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:e});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=t;o.__i18nGlobal&&_g(e,o,o),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,s)=>this.$i18n.te(i,s),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(r,this.$i18n)},mounted(){if(process.env.NODE_ENV!=="production"&&this.$el&&this.$i18n){const r=this.$i18n;this.$el.__VUE_I18N__=r.__composer;const o=this.__v_emitter=Tc();r.__enableEmitter&&r.__enableEmitter(o),o.on("*",ai)}},unmounted(){const r=y.getCurrentInstance();if(!r)throw dt(ye.UNEXPECTED_ERROR);const o=this.$i18n;process.env.NODE_ENV!=="production"&&this.$el&&this.$el.__VUE_I18N__&&(this.__v_emitter&&(this.__v_emitter.off("*",ai),delete this.__v_emitter),this.$i18n&&(o.__disableEmitter&&o.__disableEmitter(),delete this.$el.__VUE_I18N__)),delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(r),delete this.$i18n}}}function xg(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[yg](e.pluralizationRules||t.pluralizationRules);const n=Uc(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(n).forEach(r=>t.mergeLocaleMessage(r,n[r])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(r=>t.mergeDateTimeFormat(r,e.datetimeFormats[r])),e.numberFormats&&Object.keys(e.numberFormats).forEach(r=>t.mergeNumberFormat(r,e.numberFormats[r])),t}const Yc={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function S3({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,o)=>[...r,...o.type===y.Fragment?o.children:[o]],[]):e.reduce((n,r)=>{const o=t[r];return o&&(n[r]=o()),n},be())}function Lg(){return y.Fragment}const Rg=y.defineComponent({name:"i18n-t",props:He({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Ve(t)||!isNaN(t)}},Yc),setup(t,e){const{slots:n,attrs:r}=e,o=t.i18n||Ys({useScope:t.scope,__useComponent:!0});return()=>{const i=Object.keys(n).filter(f=>f[0]!=="_"),s=be();t.locale&&(s.locale=t.locale),t.plural!==void 0&&(s.plural=K(t.plural)?+t.plural:t.plural);const a=S3(e,i),l=o[Vc](t.keypath,a,s),c=He(be(),r),u=K(t.tag)||ue(t.tag)?t.tag:Lg();return y.h(u,c,l)}}});function T3(t){return xe(t)&&!K(t[0])}function Pg(t,e,n,r){const{slots:o,attrs:i}=e;return()=>{const s={part:!0};let a=be();t.locale&&(s.locale=t.locale),K(t.format)?s.key=t.format:ue(t.format)&&(K(t.format.key)&&(s.key=t.format.key),a=Object.keys(t.format).reduce((p,m)=>n.includes(m)?He(be(),p,{[m]:t.format[m]}):p,be()));const l=r(t.value,s,a);let c=[s.key];xe(l)?c=l.map((p,m)=>{const b=o[p.type],k=b?b({[p.type]:p.value,index:m,parts:l}):[p.value];return T3(k)&&(k[0].key=`${p.type}-${m}`),k}):K(l)&&(c=[l]);const u=He(be(),i),f=K(t.tag)||ue(t.tag)?t.tag:Lg();return y.h(f,u,c)}}const Ig=y.defineComponent({name:"i18n-n",props:He({value:{type:Number,required:!0},format:{type:[String,Object]}},Yc),setup(t,e){const n=t.i18n||Ys({useScope:t.scope,__useComponent:!0});return Pg(t,e,ug,(...r)=>n[zc](...r))}});function N3(t,e){const n=t;if(t.mode==="composition")return n.__getInstance(e)||t.global;{const r=n.__getInstance(e);return r!=null?r.__composer:t.global.__composer}}function A3(t){const e=s=>{process.env.NODE_ENV!=="production"&&Sc(ii(cn.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));const{instance:a,value:l}=s;if(!a||!a.$)throw dt(ye.UNEXPECTED_ERROR);const c=N3(t,a.$),u=Dg(l);return[Reflect.apply(c.t,c,[...Bg(u)]),c]};return{created:(s,a)=>{const[l,c]=e(a);Kt&&t.global===c&&(s.__i18nWatcher=y.watch(c.locale,()=>{a.instance&&a.instance.$forceUpdate()})),s.__composer=c,s.textContent=l},unmounted:s=>{Kt&&s.__i18nWatcher&&(s.__i18nWatcher(),s.__i18nWatcher=void 0,delete s.__i18nWatcher),s.__composer&&(s.__composer=void 0,delete s.__composer)},beforeUpdate:(s,{value:a})=>{if(s.__composer){const l=s.__composer,c=Dg(a);s.textContent=Reflect.apply(l.t,l,[...Bg(c)])}},getSSRProps:s=>{const[a]=e(s);return{textContent:a}}}}function Dg(t){if(K(t))return{path:t};if(ae(t)){if(!("path"in t))throw dt(ye.REQUIRED_VALUE,"path");return t}else throw dt(ye.INVALID_VALUE)}function Bg(t){const{path:e,locale:n,args:r,choice:o,plural:i}=t,s={},a=r||{};return K(n)&&(s.locale=n),Ve(o)&&(s.plural=o),Ve(i)&&(s.plural=i),[e,a,s]}function O3(t,e,...n){const r=ae(n[0])?n[0]:{};(de(r.globalInstall)?r.globalInstall:!0)&&([Rg.name,"I18nT"].forEach(i=>t.component(i,Rg)),[Ig.name,"I18nN"].forEach(i=>t.component(i,Ig)),[$g.name,"I18nD"].forEach(i=>t.component(i,$g))),t.directive("t",A3(e))}const M3=an("global-vue-i18n");function x3(t={}){const e=__VUE_I18N_LEGACY_API__&&de(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__;process.env.NODE_ENV!=="production"&&e&&Sc(ii(cn.DEPRECATE_LEGACY_MODE));const n=de(t.globalInjection)?t.globalInjection:!0,r=new Map,[o,i]=L3(t,e),s=an(process.env.NODE_ENV!=="production"?"vue-i18n":"");function a(f){return r.get(f)||null}function l(f,p){r.set(f,p)}function c(f){r.delete(f)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&e?"legacy":"composition"},async install(f,...p){if(process.env.NODE_ENV!=="production"&&(f.__VUE_I18N__=u),f.__VUE_I18N_SYMBOL__=s,f.provide(f.__VUE_I18N_SYMBOL__,u),ae(p[0])){const k=p[0];u.__composerExtend=k.__composerExtend,u.__vueI18nExtend=k.__vueI18nExtend}let m=null;!e&&n&&(m=V3(f,u.global)),__VUE_I18N_FULL_INSTALL__&&O3(f,u,...p),__VUE_I18N_LEGACY_API__&&e&&f.mixin(C3(i,i.__composer,u));const b=f.unmount;if(f.unmount=()=>{m&&m(),u.dispose(),b()},process.env.NODE_ENV!=="production"){if(!await f3(f,u))throw dt(ye.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);const _=Tc();if(e){const E=i;E.__enableEmitter&&E.__enableEmitter(_)}else{const E=i;E[Sr]&&E[Sr](_)}_.on("*",ai)}},get global(){return i},dispose(){o.stop()},__instances:r,__getInstance:a,__setInstance:l,__deleteInstance:c};return u}function Ys(t={}){const e=y.getCurrentInstance();if(e==null)throw dt(ye.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw dt(ye.NOT_INSTALLED);const n=R3(e),r=I3(n),o=kg(e),i=P3(t,o);if(i==="global")return _g(r,t,o),r;if(i==="parent"){let l=D3(n,e,t.__useComponent);return l==null&&(process.env.NODE_ENV!=="production"&&Yn(ii(cn.NOT_FOUND_PARENT_SCOPE)),l=r),l}const s=n;let a=s.__getInstance(e);if(a==null){const l=He({},t);"__i18n"in o&&(l.__i18n=o.__i18n),r&&(l.__root=r),a=Wc(l),s.__composerExtend&&(a[jc]=s.__composerExtend(a)),F3(s,e,a),s.__setInstance(e,a)}else if(process.env.NODE_ENV!=="production"&&i==="local")throw dt(ye.DUPLICATE_USE_I18N_CALLING);return a}function L3(t,e){const n=y.effectScope(),r=__VUE_I18N_LEGACY_API__&&e?n.run(()=>Jc(t)):n.run(()=>Wc(t));if(r==null)throw dt(ye.UNEXPECTED_ERROR);return[n,r]}function R3(t){const e=y.inject(t.isCE?M3:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw dt(t.isCE?ye.NOT_INSTALLED_WITH_PROVIDE:ye.UNEXPECTED_ERROR);return e}function P3(t,e){return zs(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function I3(t){return t.mode==="composition"?t.global:t.global.__composer}function D3(t,e,n=!1){let r=null;const o=e.root;let i=B3(e,n);for(;i!=null;){const s=t;if(t.mode==="composition")r=s.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const a=s.__getInstance(i);a!=null&&(r=a.__composer,n&&r&&!r[wg]&&(r=null))}if(r!=null||o===i)break;i=i.parent}return r}function B3(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function F3(t,e,n){let r=null;y.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&e.vnode.el){e.vnode.el.__VUE_I18N__=n,r=Tc();const o=n;o[Sr]&&o[Sr](r),r.on("*",ai)}},e),y.onUnmounted(()=>{const o=n;process.env.NODE_ENV!=="production"&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&(r&&r.off("*",ai),o[oi]&&o[oi](),delete e.vnode.el.__VUE_I18N__),t.__deleteInstance(e);const i=o[jc];i&&(i(),delete o[jc])},e)}const $3=["locale","fallbackLocale","availableLocales"],Fg=["t","rt","d","n","tm","te"];function V3(t,e){const n=Object.create(null);return $3.forEach(o=>{const i=Object.getOwnPropertyDescriptor(e,o);if(!i)throw dt(ye.UNEXPECTED_ERROR);const s=y.isRef(i.value)?{get(){return i.value.value},set(a){i.value.value=a}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,s)}),t.config.globalProperties.$i18n=n,Fg.forEach(o=>{const i=Object.getOwnPropertyDescriptor(e,o);if(!i||!i.value)throw dt(ye.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${o}`,i)}),()=>{delete t.config.globalProperties.$i18n,Fg.forEach(o=>{delete t.config.globalProperties[`$${o}`]})}}const $g=y.defineComponent({name:"i18n-d",props:He({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Yc),setup(t,e){const n=t.i18n||Ys({useScope:t.scope,__useComponent:!0});return Pg(t,e,ag,(...r)=>n[Hc](...r))}});if(i3(),OT(aT),MT(CT),xT(Wm),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const t=vr();t.__INTLIFY__=!0,lT(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const H3={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},z3={__name:"vs-editor-link",props:{editor:Object},setup(t){const{t:e}=Ys(),n=t,r=y.ref(!1),o=y.ref(""),i=()=>{n.editor.chain().focus().toggleLink({href:o.value}).run(),r.value=!1,o.value=""};return(s,a)=>(y.openBlock(),y.createElementBlock(y.Fragment,null,[y.createElementVNode("button",{onClick:a[0]||(a[0]=l=>r.value=!0),class:"text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none"},a[4]||(a[4]=[y.createElementVNode("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.213 9.787a3.391 3.391 0 0 0-4.795 0l-3.425 3.426a3.39 3.39 0 0 0 4.795 4.794l.321-.304m-.321-4.49a3.39 3.39 0 0 0 4.795 0l3.424-3.426a3.39 3.39 0 0 0-4.794-4.795l-1.028.961"})],-1)])),y.createVNode(qC,{title:y.unref(e)("tiptap.linkTitle"),visible:r.value,"onUpdate:visible":a[3]||(a[3]=l=>r.value=l),size:"small"},{footer:y.withCtx(()=>[y.createElementVNode("div",H3,[y.createElementVNode("button",{style:{border:"1px solid #000"},onClick:a[2]||(a[2]=l=>{r.value=!1,o.value=""}),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"},y.toDisplayString(y.unref(e)("tiptap.cancel")),1),y.createElementVNode("button",{onClick:i,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},y.toDisplayString(y.unref(e)("tiptap.create")),1)])]),default:y.withCtx(()=>[y.createVNode(Sm,{modelValue:o.value,"onUpdate:modelValue":a[1]||(a[1]=l=>o.value=l),placeholder:y.unref(e)("tiptap.linkTitle")},null,8,["modelValue","placeholder"])]),_:1},8,["title","visible"])],64))}},j3={class:"flex flex-col gap-[2px] p-[2px]"},U3=["onClick"],W3={__name:"vs-editor-table",props:{editor:Object},setup(t){const{$t:e}=y.getCurrentInstance().proxy,n=t,r=y.ref(!1),o=y.ref("popover"),i=()=>{n.editor&&(n.editor.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),o.value.togglePopover())},s=()=>{n.editor&&(n.editor.chain().focus().addColumnAfter().run(),o.value.togglePopover())},a=()=>{n.editor&&(n.editor.chain().focus().addRowAfter().run(),o.value.togglePopover())},l=()=>{n.editor&&(n.editor.chain().focus().deleteColumn().run(),o.value.togglePopover())},c=()=>{n.editor&&(n.editor.chain().focus().deleteRow().run(),o.value.togglePopover())},u=()=>{n.editor&&(n.editor.chain().focus().deleteTable().run(),o.value.togglePopover())},f=[{text:e("tiptap.createTable"),function:i},{text:e("tiptap.addColumn"),function:s},{text:e("tiptap.addRow"),function:a},{text:e("tiptap.deleteColumn"),function:l},{text:e("tiptap.deleteRow"),function:c},{text:e("tiptap.deleteTable"),function:u}];return(p,m)=>(y.openBlock(),y.createBlock(Zo,{ref_key:"popover",ref:o,placement:"bottom",onIsvisible:m[0]||(m[0]=b=>r.value=b)},{reference:y.withCtx(()=>[y.createElementVNode("button",{class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[r.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},m[1]||(m[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-table"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"}),y.createElementVNode("path",{d:"M3 10h18"}),y.createElementVNode("path",{d:"M10 3v18"})],-1)]),2)]),default:y.withCtx(()=>[y.createElementVNode("div",j3,[(y.openBlock(),y.createElementBlock(y.Fragment,null,y.renderList(f,(b,k)=>y.createElementVNode("button",{key:k,onClick:b?.function,class:"px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded"},y.toDisplayString(b.text),9,U3)),64))])]),_:1},512))}},K3={},q3={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-center"};function G3(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("svg",q3,e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M8 12l8 0"},null,-1),y.createElementVNode("path",{d:"M6 18l12 0"},null,-1)]))}const J3=et(K3,[["render",G3]]),Y3={},X3={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-right"};function Q3(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("svg",X3,e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M10 12l10 0"},null,-1),y.createElementVNode("path",{d:"M6 18l14 0"},null,-1)]))}const Z3=et(Y3,[["render",Q3]]),eN={},tN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-left"};function nN(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("svg",tN,e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M4 6l16 0"},null,-1),y.createElementVNode("path",{d:"M4 12l10 0"},null,-1),y.createElementVNode("path",{d:"M4 18l14 0"},null,-1)]))}const Vg={left:et(eN,[["render",nN]]),center:J3,right:Z3},rN={class:"flex gap-[4px] p-1"},oN=["onClick"],iN={__name:"vs-editor-align",props:{editor:Object},setup(t){const e=t,n=y.ref(!1),r=y.ref("popover"),o=y.ref("left"),i=y.computed(()=>e.editor?.isActive({textAlign:"left"})),s=y.computed(()=>e.editor?.isActive({textAlign:"right"})),a=y.computed(()=>e.editor?.isActive({textAlign:"center"})),l=u=>{e.editor&&e.editor.chain().focus().setTextAlign(u).run()},c=y.ref([{id:"left",isActive:i},{id:"center",isActive:a},{id:"right",isActive:s}]);return(u,f)=>(y.openBlock(),y.createBlock(Zo,{ref_key:"popover",ref:r,placement:"bottom",onIsvisible:f[0]||(f[0]=p=>n.value=p)},{reference:y.withCtx(()=>[y.createElementVNode("button",{class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[n.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},[(y.openBlock(),y.createBlock(y.resolveDynamicComponent(y.unref(Vg)[o.value]),{height:"16",width:"16"}))],2)]),default:y.withCtx(()=>[y.createElementVNode("div",rN,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(c.value,p=>(y.openBlock(),y.createElementBlock("button",{class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 text-gray-900":p?.isActive}]),key:p?.id,onClick:m=>l(p?.id)},[(y.openBlock(),y.createBlock(y.resolveDynamicComponent(y.unref(Vg)[p?.id]),{height:"16",width:"16"}))],10,oN))),128))])]),_:1},512))}},sN={class:"flex flex-col gap-[2px] p-[2px]"},aN=["onClick"],lN={__name:"vs-editor-type-tag",props:{editor:Object},setup(t){const{$t:e}=y.getCurrentInstance().proxy,n=t,r=y.ref(!1),o=y.ref("popover"),i=()=>{n.editor&&(n.editor?.chain().focus().setParagraph().run(),o.value.togglePopover())},s=l=>{n.editor&&(n.editor?.chain().focus().toggleHeading({level:l}).run(),o.value.togglePopover())},a=[{text:"Заголовок 1",id:1,style:"font-[700] text-[30px]"},{text:"Заголовок 2",id:2,style:"font-[700] text-[26px]"},{text:"Заголовок 3",id:3,style:"font-[700] text-[22px]"},{text:"Заголовок 4",id:4,style:"font-[700] text-[18px]"},{text:"Заголовок 5",id:5,style:"font-[500] text-[16px]"},{text:"Заголовок 6",id:6,style:"font-[400] text-[14px]"}];return(l,c)=>(y.openBlock(),y.createBlock(Zo,{ref_key:"popover",ref:o,placement:"bottom",onIsvisible:c[0]||(c[0]=u=>r.value=u)},{reference:y.withCtx(()=>[y.createElementVNode("button",{class:y.normalizeClass(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100",[r.value?"bg-gray-100 text-gray-900":"text-gray-500"]])},c[1]||(c[1]=[y.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-text-size"},[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),y.createElementVNode("path",{d:"M3 7v-2h13v2"}),y.createElementVNode("path",{d:"M10 5v14"}),y.createElementVNode("path",{d:"M12 19h-4"}),y.createElementVNode("path",{d:"M15 13v-1h6v1"}),y.createElementVNode("path",{d:"M18 12v7"}),y.createElementVNode("path",{d:"M17 19h2"})],-1)]),2)]),default:y.withCtx(()=>[y.createElementVNode("div",sN,[y.createElementVNode("button",{onClick:i,class:y.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded",[t.editor?.isActive("paragraph")?"bg-gray-100":""]])},y.toDisplayString(y.unref(e)("tiptap.paragraph")),3),(y.openBlock(),y.createElementBlock(y.Fragment,null,y.renderList(a,(u,f)=>y.createElementVNode("button",{key:f,onClick:p=>s(u?.id),class:y.normalizeClass(["px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded leading-[100%]",[u?.style,t.editor?.isActive("heading",{level:u?.id})?"bg-gray-100":""]])},y.toDisplayString(y.unref(e)(`tiptap.heading${u?.id}`)),11,aN)),64))])]),_:1},512))}},cN={},uN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check"};function dN(t,e,n,r,o,i){return y.openBlock(),y.createElementBlock("svg",uN,e[0]||(e[0]=[y.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),y.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const fN=et(cN,[["render",dN]]),pN={components:{VsText:Sm},events:["update:modelValue"],props:{modelValue:{type:String,default:()=>"#000000"},disabled:{type:Boolean,default:()=>!1},clearable:{type:Boolean,default:()=>!1},isTextInputShown:{type:Boolean,default:()=>!0}},computed:{value:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}}}},hN={class:"flex items-center w-full"},mN=["disabled"];function gN(t,e,n,r,o,i){const s=y.resolveComponent("vs-text");return y.openBlock(),y.createElementBlock("div",hN,[y.withDirectives(y.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>i.value=a),type:"color",class:y.normalizeClass(["w-10 h-10 py-[2px] px-[3px] dark:bg-neutral-800 border dark:border-neutral-700 border-stone-200 rounded-lg",n.disabled?"cursor-not-allowed":"cursor-pointer"]),disabled:n.disabled},null,10,mN),[[y.vModelText,i.value]]),n.isTextInputShown?(y.openBlock(),y.createBlock(s,{key:0,modelValue:i.value,"onUpdate:modelValue":e[1]||(e[1]=a=>i.value=a),class:"ml-2 w-full",disabled:n.disabled,clearable:n.clearable},null,8,["modelValue","disabled","clearable"])):y.createCommentVNode("",!0)])}const bN=et(pN,[["render",gN]]),yN={class:"w-[30px] h-[30px] rounded-full hover:bg-gray-100 justify-center items-center relative flex"},wN={class:"w-[160px]"},kN={class:"flex gap-[4px] mb-[8px]"},_N={class:"flex w-[160px] flex-wrap gap-[4px]"},EN=["onClick"],Hg={bold:AC,italic:xC,color:BC,color_picker:{__name:"vs-editor-colorpicker",props:{editor:Object},setup(t){const e=t,n=y.ref("popover"),r=y.ref("#000000"),o=y.ref("#000000"),i=y.ref(["#000000","#0055CC","#206A83","#216E4E","#E56910","#AE2E24","#5E4DB2","#758195","#FF0000","#008000","#28A9AB","#AB7222"]),s=l=>{e.editor&&(e.editor.chain().focus().setColor(l).run(),o.value=l,n.value&&n.value.togglePopover())},a=()=>{s(r.value),r.value=""};return(l,c)=>(y.openBlock(),y.createBlock(Zo,{ref_key:"popover",ref:n,placement:"bottom"},{reference:y.withCtx(()=>[y.createElementVNode("button",yN,[c[1]||(c[1]=y.createElementVNode("svg",{class:"text-gray-500",height:"16",width:"16","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[y.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",d:"M9 19.2H5.5c-.3 0-.5-.2-.5-.5V16c0-.2.2-.4.5-.4h13c.3 0 .5.2.5.4v2.7c0 .3-.2.5-.5.5H18m-6-1 1.4 1.8h.2l1.4-1.7m-7-5.4L12 4c0-.1 0-.1 0 0l4 8.8m-6-2.7h4m-7 2.7h2.5m5 0H17"})],-1)),y.createElementVNode("span",{class:"absolute h-[2px] w-[40%] bottom-[10px] left-[9px]",style:y.normalizeStyle({backgroundColor:o.value})},null,4)])]),default:y.withCtx(()=>[y.createElementVNode("div",wN,[y.createElementVNode("div",kN,[y.createVNode(bN,{modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=u=>r.value=u)},null,8,["modelValue"]),y.createElementVNode("button",{onClick:a,class:"h-[38px] w-[38px] bg-blue-500 shrink-0 border rounded-md flex items-center justify-center hover:bg-blue-700 duration-300"},[y.createVNode(fN,{class:"h-[24px] w-[24px] text-white"})])]),y.createElementVNode("ul",_N,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,u=>(y.openBlock(),y.createElementBlock("li",{class:"h-[37px] w-[37px] rounded",style:y.normalizeStyle({backgroundColor:u}),onClick:f=>s(u),key:u},null,12,EN))),128))])])]),_:1},512))}},bullet_list:wC,ordered_list:EC,blockquote:gC,codeblock:SC,underline:FC,strike:$C,link:z3,table:W3,text_align:iN,type_tag:lN};function zg(t,e){return function(){return t.apply(e,arguments)}}const{toString:vN}=Object.prototype,{getPrototypeOf:Xc}=Object,{iterator:Xs,toStringTag:jg}=Symbol,Qs=(t=>e=>{const n=vN.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Gt=t=>(t=t.toLowerCase(),e=>Qs(e)===t),Zs=t=>e=>typeof e===t,{isArray:io}=Array,li=Zs("undefined");function CN(t){return t!==null&&!li(t)&&t.constructor!==null&&!li(t.constructor)&&wt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ug=Gt("ArrayBuffer");function SN(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ug(t.buffer),e}const TN=Zs("string"),wt=Zs("function"),Wg=Zs("number"),ea=t=>t!==null&&typeof t=="object",NN=t=>t===!0||t===!1,ta=t=>{if(Qs(t)!=="object")return!1;const e=Xc(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(jg in t)&&!(Xs in t)},AN=Gt("Date"),ON=Gt("File"),MN=Gt("Blob"),xN=Gt("FileList"),LN=t=>ea(t)&&wt(t.pipe),RN=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||wt(t.append)&&((e=Qs(t))==="formdata"||e==="object"&&wt(t.toString)&&t.toString()==="[object FormData]"))},PN=Gt("URLSearchParams"),[IN,DN,BN,FN]=["ReadableStream","Request","Response","Headers"].map(Gt),$N=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ci(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),io(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{const i=n?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let a;for(r=0;r<s;r++)a=i[r],e.call(null,t[a],a,t)}}function Kg(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,o;for(;r-- >0;)if(o=n[r],e===o.toLowerCase())return o;return null}const Tr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,qg=t=>!li(t)&&t!==Tr;function Qc(){const{caseless:t}=qg(this)&&this||{},e={},n=(r,o)=>{const i=t&&Kg(e,o)||o;ta(e[i])&&ta(r)?e[i]=Qc(e[i],r):ta(r)?e[i]=Qc({},r):io(r)?e[i]=r.slice():e[i]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&ci(arguments[r],n);return e}const VN=(t,e,n,{allOwnKeys:r}={})=>(ci(e,(o,i)=>{n&&wt(o)?t[i]=zg(o,n):t[i]=o},{allOwnKeys:r}),t),HN=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),zN=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},jN=(t,e,n,r)=>{let o,i,s;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&Xc(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},UN=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},WN=t=>{if(!t)return null;if(io(t))return t;let e=t.length;if(!Wg(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},KN=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Xc(Uint8Array)),qN=(t,e)=>{const r=(t&&t[Xs]).call(t);let o;for(;(o=r.next())&&!o.done;){const i=o.value;e.call(t,i[0],i[1])}},GN=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},JN=Gt("HTMLFormElement"),YN=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Gg=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),XN=Gt("RegExp"),Jg=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};ci(n,(o,i)=>{let s;(s=e(o,i,t))!==!1&&(r[i]=s||o)}),Object.defineProperties(t,r)},QN=t=>{Jg(t,(e,n)=>{if(wt(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(wt(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ZN=(t,e)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return io(t)?r(t):r(String(t).split(e)),n},eA=()=>{},tA=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function nA(t){return!!(t&&wt(t.append)&&t[jg]==="FormData"&&t[Xs])}const rA=t=>{const e=new Array(10),n=(r,o)=>{if(ea(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[o]=r;const i=io(r)?[]:{};return ci(r,(s,a)=>{const l=n(s,o+1);!li(l)&&(i[a]=l)}),e[o]=void 0,i}}return r};return n(t,0)},oA=Gt("AsyncFunction"),iA=t=>t&&(ea(t)||wt(t))&&wt(t.then)&&wt(t.catch),Yg=((t,e)=>t?setImmediate:e?((n,r)=>(Tr.addEventListener("message",({source:o,data:i})=>{o===Tr&&i===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Tr.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",wt(Tr.postMessage)),sA=typeof queueMicrotask<"u"?queueMicrotask.bind(Tr):typeof process<"u"&&process.nextTick||Yg,L={isArray:io,isArrayBuffer:Ug,isBuffer:CN,isFormData:RN,isArrayBufferView:SN,isString:TN,isNumber:Wg,isBoolean:NN,isObject:ea,isPlainObject:ta,isReadableStream:IN,isRequest:DN,isResponse:BN,isHeaders:FN,isUndefined:li,isDate:AN,isFile:ON,isBlob:MN,isRegExp:XN,isFunction:wt,isStream:LN,isURLSearchParams:PN,isTypedArray:KN,isFileList:xN,forEach:ci,merge:Qc,extend:VN,trim:$N,stripBOM:HN,inherits:zN,toFlatObject:jN,kindOf:Qs,kindOfTest:Gt,endsWith:UN,toArray:WN,forEachEntry:qN,matchAll:GN,isHTMLForm:JN,hasOwnProperty:Gg,hasOwnProp:Gg,reduceDescriptors:Jg,freezeMethods:QN,toObjectSet:ZN,toCamelCase:YN,noop:eA,toFiniteNumber:tA,findKey:Kg,global:Tr,isContextDefined:qg,isSpecCompliantForm:nA,toJSONObject:rA,isAsyncFn:oA,isThenable:iA,setImmediate:Yg,asap:sA,isIterable:t=>t!=null&&wt(t[Xs])};function oe(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}L.inherits(oe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:L.toJSONObject(this.config),code:this.code,status:this.status}}});const Xg=oe.prototype,Qg={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Qg[t]={value:t}}),Object.defineProperties(oe,Qg),Object.defineProperty(Xg,"isAxiosError",{value:!0}),oe.from=(t,e,n,r,o,i)=>{const s=Object.create(Xg);return L.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),oe.call(s,t.message,e,n,r,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const aA=null;function Zc(t){return L.isPlainObject(t)||L.isArray(t)}function Zg(t){return L.endsWith(t,"[]")?t.slice(0,-2):t}function e0(t,e,n){return t?t.concat(e).map(function(o,i){return o=Zg(o),!n&&i?"["+o+"]":o}).join(n?".":""):e}function lA(t){return L.isArray(t)&&!t.some(Zc)}const cA=L.toFlatObject(L,{},null,function(e){return/^is[A-Z]/.test(e)});function na(t,e,n){if(!L.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(k,_){return!L.isUndefined(_[k])});const r=n.metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&L.isSpecCompliantForm(e);if(!L.isFunction(o))throw new TypeError("visitor must be a function");function c(b){if(b===null)return"";if(L.isDate(b))return b.toISOString();if(L.isBoolean(b))return b.toString();if(!l&&L.isBlob(b))throw new oe("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(b)||L.isTypedArray(b)?l&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function u(b,k,_){let E=b;if(b&&!_&&typeof b=="object"){if(L.endsWith(k,"{}"))k=r?k:k.slice(0,-2),b=JSON.stringify(b);else if(L.isArray(b)&&lA(b)||(L.isFileList(b)||L.endsWith(k,"[]"))&&(E=L.toArray(b)))return k=Zg(k),E.forEach(function(A,d){!(L.isUndefined(A)||A===null)&&e.append(s===!0?e0([k],d,i):s===null?k:k+"[]",c(A))}),!1}return Zc(b)?!0:(e.append(e0(_,k,i),c(b)),!1)}const f=[],p=Object.assign(cA,{defaultVisitor:u,convertValue:c,isVisitable:Zc});function m(b,k){if(!L.isUndefined(b)){if(f.indexOf(b)!==-1)throw Error("Circular reference detected in "+k.join("."));f.push(b),L.forEach(b,function(E,N){(!(L.isUndefined(E)||E===null)&&o.call(e,E,L.isString(N)?N.trim():N,k,p))===!0&&m(E,k?k.concat(N):[N])}),f.pop()}}if(!L.isObject(t))throw new TypeError("data must be an object");return m(t),e}function t0(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function eu(t,e){this._pairs=[],t&&na(t,this,e)}const n0=eu.prototype;n0.append=function(e,n){this._pairs.push([e,n])},n0.toString=function(e){const n=e?function(r){return e.call(this,r,t0)}:t0;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function uA(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function r0(t,e,n){if(!e)return t;const r=n&&n.encode||uA;L.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(o?i=o(e,n):i=L.isURLSearchParams(e)?e.toString():new eu(e,n).toString(r),i){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class o0{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){L.forEach(this.handlers,function(r){r!==null&&e(r)})}}const i0={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dA={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:eu,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},tu=typeof window<"u"&&typeof document<"u",nu=typeof navigator=="object"&&navigator||void 0,fA=tu&&(!nu||["ReactNative","NativeScript","NS"].indexOf(nu.product)<0),pA=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",hA=tu&&window.location.href||"http://localhost",nt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:tu,hasStandardBrowserEnv:fA,hasStandardBrowserWebWorkerEnv:pA,navigator:nu,origin:hA},Symbol.toStringTag,{value:"Module"})),...dA};function mA(t,e){return na(t,new nt.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return nt.isNode&&L.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function gA(t){return L.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function bA(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],e[i]=t[i];return e}function s0(t){function e(n,r,o,i){let s=n[i++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),l=i>=n.length;return s=!s&&L.isArray(o)?o.length:s,l?(L.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!a):((!o[s]||!L.isObject(o[s]))&&(o[s]=[]),e(n,r,o[s],i)&&L.isArray(o[s])&&(o[s]=bA(o[s])),!a)}if(L.isFormData(t)&&L.isFunction(t.entries)){const n={};return L.forEachEntry(t,(r,o)=>{e(gA(r),o,n,0)}),n}return null}function yA(t,e,n){if(L.isString(t))try{return(e||JSON.parse)(t),L.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const ui={transitional:i0,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=L.isObject(e);if(i&&L.isHTMLForm(e)&&(e=new FormData(e)),L.isFormData(e))return o?JSON.stringify(s0(e)):e;if(L.isArrayBuffer(e)||L.isBuffer(e)||L.isStream(e)||L.isFile(e)||L.isBlob(e)||L.isReadableStream(e))return e;if(L.isArrayBufferView(e))return e.buffer;if(L.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return mA(e,this.formSerializer).toString();if((a=L.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return na(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),yA(e)):e}],transformResponse:[function(e){const n=this.transitional||ui.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(L.isResponse(e)||L.isReadableStream(e))return e;if(e&&L.isString(e)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?oe.from(a,oe.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:nt.classes.FormData,Blob:nt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};L.forEach(["delete","get","head","post","put","patch"],t=>{ui.headers[t]={}});const wA=L.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),kA=t=>{const e={};let n,r,o;return t&&t.split(`
139
+ `).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||e[n]&&wA[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},a0=Symbol("internals");function di(t){return t&&String(t).trim().toLowerCase()}function ra(t){return t===!1||t==null?t:L.isArray(t)?t.map(ra):String(t)}function _A(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const EA=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ru(t,e,n,r,o){if(L.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!L.isString(e)){if(L.isString(r))return e.indexOf(r)!==-1;if(L.isRegExp(r))return r.test(e)}}function vA(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function CA(t,e){const n=L.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,i,s){return this[r].call(this,e,o,i,s)},configurable:!0})})}let kt=class{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function i(a,l,c){const u=di(l);if(!u)throw new Error("header name must be a non-empty string");const f=L.findKey(o,u);(!f||o[f]===void 0||c===!0||c===void 0&&o[f]!==!1)&&(o[f||l]=ra(a))}const s=(a,l)=>L.forEach(a,(c,u)=>i(c,u,l));if(L.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(L.isString(e)&&(e=e.trim())&&!EA(e))s(kA(e),n);else if(L.isObject(e)&&L.isIterable(e)){let a={},l,c;for(const u of e){if(!L.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[c=u[0]]=(l=a[c])?L.isArray(l)?[...l,u[1]]:[l,u[1]]:u[1]}s(a,n)}else e!=null&&i(n,e,r);return this}get(e,n){if(e=di(e),e){const r=L.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return _A(o);if(L.isFunction(n))return n.call(this,o,r);if(L.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=di(e),e){const r=L.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||ru(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function i(s){if(s=di(s),s){const a=L.findKey(r,s);a&&(!n||ru(r,r[a],a,n))&&(delete r[a],o=!0)}}return L.isArray(e)?e.forEach(i):i(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!e||ru(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){const n=this,r={};return L.forEach(this,(o,i)=>{const s=L.findKey(r,i);if(s){n[s]=ra(o),delete n[i];return}const a=e?vA(i):String(i).trim();a!==i&&delete n[i],n[a]=ra(o),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return L.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&L.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
140
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[a0]=this[a0]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=di(s);r[a]||(CA(o,s),r[a]=!0)}return L.isArray(e)?e.forEach(i):i(e),this}};kt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.reduceDescriptors(kt.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),L.freezeMethods(kt);function ou(t,e){const n=this||ui,r=e||n,o=kt.from(r.headers);let i=r.data;return L.forEach(t,function(a){i=a.call(n,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function l0(t){return!!(t&&t.__CANCEL__)}function so(t,e,n){oe.call(this,t??"canceled",oe.ERR_CANCELED,e,n),this.name="CanceledError"}L.inherits(so,oe,{__CANCEL__:!0});function c0(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new oe("Request failed with status code "+n.status,[oe.ERR_BAD_REQUEST,oe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function SA(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function TA(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,i=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=r[i];s||(s=c),n[o]=l,r[o]=c;let f=i,p=0;for(;f!==o;)p+=n[f++],f=f%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),c-s<e)return;const m=u&&c-u;return m?Math.round(p*1e3/m):void 0}}function NA(t,e){let n=0,r=1e3/e,o,i;const s=(c,u=Date.now())=>{n=u,o=null,i&&(clearTimeout(i),i=null),t.apply(null,c)};return[(...c)=>{const u=Date.now(),f=u-n;f>=r?s(c,u):(o=c,i||(i=setTimeout(()=>{i=null,s(o)},r-f)))},()=>o&&s(o)]}const oa=(t,e,n=3)=>{let r=0;const o=TA(50,250);return NA(i=>{const s=i.loaded,a=i.lengthComputable?i.total:void 0,l=s-r,c=o(l),u=s<=a;r=s;const f={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-s)/c:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(f)},n)},u0=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},d0=t=>(...e)=>L.asap(()=>t(...e)),AA=nt.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,nt.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(nt.origin),nt.navigator&&/(msie|trident)/i.test(nt.navigator.userAgent)):()=>!0,OA=nt.hasStandardBrowserEnv?{write(t,e,n,r,o,i){const s=[t+"="+encodeURIComponent(e)];L.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),L.isString(r)&&s.push("path="+r),L.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function MA(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function xA(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function f0(t,e,n){let r=!MA(e);return t&&(r||n==!1)?xA(t,e):e}const p0=t=>t instanceof kt?{...t}:t;function Nr(t,e){e=e||{};const n={};function r(c,u,f,p){return L.isPlainObject(c)&&L.isPlainObject(u)?L.merge.call({caseless:p},c,u):L.isPlainObject(u)?L.merge({},u):L.isArray(u)?u.slice():u}function o(c,u,f,p){if(L.isUndefined(u)){if(!L.isUndefined(c))return r(void 0,c,f,p)}else return r(c,u,f,p)}function i(c,u){if(!L.isUndefined(u))return r(void 0,u)}function s(c,u){if(L.isUndefined(u)){if(!L.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,f){if(f in e)return r(c,u);if(f in t)return r(void 0,c)}const l={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,u,f)=>o(p0(c),p0(u),f,!0)};return L.forEach(Object.keys(Object.assign({},t,e)),function(u){const f=l[u]||o,p=f(t[u],e[u],u);L.isUndefined(p)&&f!==a||(n[u]=p)}),n}const h0=t=>{const e=Nr({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=e;e.headers=s=kt.from(s),e.url=r0(f0(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(L.isFormData(n)){if(nt.hasStandardBrowserEnv||nt.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((l=s.getContentType())!==!1){const[c,...u]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];s.setContentType([c||"multipart/form-data",...u].join("; "))}}if(nt.hasStandardBrowserEnv&&(r&&L.isFunction(r)&&(r=r(e)),r||r!==!1&&AA(e.url))){const c=o&&i&&OA.read(i);c&&s.set(o,c)}return e},LA=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){const o=h0(t);let i=o.data;const s=kt.from(o.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=o,u,f,p,m,b;function k(){m&&m(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let _=new XMLHttpRequest;_.open(o.method.toUpperCase(),o.url,!0),_.timeout=o.timeout;function E(){if(!_)return;const A=kt.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),g={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:A,config:t,request:_};c0(function(w){n(w),k()},function(w){r(w),k()},g),_=null}"onloadend"in _?_.onloadend=E:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(E)},_.onabort=function(){_&&(r(new oe("Request aborted",oe.ECONNABORTED,t,_)),_=null)},_.onerror=function(){r(new oe("Network Error",oe.ERR_NETWORK,t,_)),_=null},_.ontimeout=function(){let d=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const g=o.transitional||i0;o.timeoutErrorMessage&&(d=o.timeoutErrorMessage),r(new oe(d,g.clarifyTimeoutError?oe.ETIMEDOUT:oe.ECONNABORTED,t,_)),_=null},i===void 0&&s.setContentType(null),"setRequestHeader"in _&&L.forEach(s.toJSON(),function(d,g){_.setRequestHeader(g,d)}),L.isUndefined(o.withCredentials)||(_.withCredentials=!!o.withCredentials),a&&a!=="json"&&(_.responseType=o.responseType),c&&([p,b]=oa(c,!0),_.addEventListener("progress",p)),l&&_.upload&&([f,m]=oa(l),_.upload.addEventListener("progress",f),_.upload.addEventListener("loadend",m)),(o.cancelToken||o.signal)&&(u=A=>{_&&(r(!A||A.type?new so(null,t,_):A),_.abort(),_=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const N=SA(o.url);if(N&&nt.protocols.indexOf(N)===-1){r(new oe("Unsupported protocol "+N+":",oe.ERR_BAD_REQUEST,t));return}_.send(i||null)})},RA=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,o;const i=function(c){if(!o){o=!0,a();const u=c instanceof Error?c:this.reason;r.abort(u instanceof oe?u:new so(u instanceof Error?u.message:u))}};let s=e&&setTimeout(()=>{s=null,i(new oe(`timeout ${e} of ms exceeded`,oe.ETIMEDOUT))},e);const a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),t=null)};t.forEach(c=>c.addEventListener("abort",i));const{signal:l}=r;return l.unsubscribe=()=>L.asap(a),l}},PA=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,o;for(;r<n;)o=r+e,yield t.slice(r,o),r=o},IA=async function*(t,e){for await(const n of DA(t))yield*PA(n,e)},DA=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},m0=(t,e,n,r)=>{const o=IA(t,e);let i=0,s,a=l=>{s||(s=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await o.next();if(c){a(),l.close();return}let f=u.byteLength;if(n){let p=i+=f;n(p)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),o.return()}},{highWaterMark:2})},ia=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",g0=ia&&typeof ReadableStream=="function",BA=ia&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),b0=(t,...e)=>{try{return!!t(...e)}catch{return!1}},FA=g0&&b0(()=>{let t=!1;const e=new Request(nt.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),y0=64*1024,iu=g0&&b0(()=>L.isReadableStream(new Response("").body)),sa={stream:iu&&(t=>t.body)};ia&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!sa[e]&&(sa[e]=L.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new oe(`Response type '${e}' is not supported`,oe.ERR_NOT_SUPPORT,r)})})})(new Response);const $A=async t=>{if(t==null)return 0;if(L.isBlob(t))return t.size;if(L.isSpecCompliantForm(t))return(await new Request(nt.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(L.isArrayBufferView(t)||L.isArrayBuffer(t))return t.byteLength;if(L.isURLSearchParams(t)&&(t=t+""),L.isString(t))return(await BA(t)).byteLength},VA=async(t,e)=>{const n=L.toFiniteNumber(t.getContentLength());return n??$A(e)},su={http:aA,xhr:LA,fetch:ia&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:f="same-origin",fetchOptions:p}=h0(t);c=c?(c+"").toLowerCase():"text";let m=RA([o,i&&i.toAbortSignal()],s),b;const k=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let _;try{if(l&&FA&&n!=="get"&&n!=="head"&&(_=await VA(u,r))!==0){let g=new Request(e,{method:"POST",body:r,duplex:"half"}),h;if(L.isFormData(r)&&(h=g.headers.get("content-type"))&&u.setContentType(h),g.body){const[w,v]=u0(_,oa(d0(l)));r=m0(g.body,y0,w,v)}}L.isString(f)||(f=f?"include":"omit");const E="credentials"in Request.prototype;b=new Request(e,{...p,signal:m,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:E?f:void 0});let N=await fetch(b,p);const A=iu&&(c==="stream"||c==="response");if(iu&&(a||A&&k)){const g={};["status","statusText","headers"].forEach(S=>{g[S]=N[S]});const h=L.toFiniteNumber(N.headers.get("content-length")),[w,v]=a&&u0(h,oa(d0(a),!0))||[];N=new Response(m0(N.body,y0,w,()=>{v&&v(),k&&k()}),g)}c=c||"text";let d=await sa[L.findKey(sa,c)||"text"](N,t);return!A&&k&&k(),await new Promise((g,h)=>{c0(g,h,{data:d,headers:kt.from(N.headers),status:N.status,statusText:N.statusText,config:t,request:b})})}catch(E){throw k&&k(),E&&E.name==="TypeError"&&/Load failed|fetch/i.test(E.message)?Object.assign(new oe("Network Error",oe.ERR_NETWORK,t,b),{cause:E.cause||E}):oe.from(E,E&&E.code,t,b)}})};L.forEach(su,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const w0=t=>`- ${t}`,HA=t=>L.isFunction(t)||t===null||t===!1,k0={getAdapter:t=>{t=L.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let i=0;i<e;i++){n=t[i];let s;if(r=n,!HA(n)&&(r=su[(s=String(n)).toLowerCase()],r===void 0))throw new oe(`Unknown adapter '${s}'`);if(r)break;o[s||"#"+i]=r}if(!r){const i=Object.entries(o).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=e?i.length>1?`since :
141
+ `+i.map(w0).join(`
142
+ `):" "+w0(i[0]):"as no adapter specified";throw new oe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:su};function au(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new so(null,t)}function _0(t){return au(t),t.headers=kt.from(t.headers),t.data=ou.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),k0.getAdapter(t.adapter||ui.adapter)(t).then(function(r){return au(t),r.data=ou.call(t,t.transformResponse,r),r.headers=kt.from(r.headers),r},function(r){return l0(r)||(au(t),r&&r.response&&(r.response.data=ou.call(t,t.transformResponse,r.response),r.response.headers=kt.from(r.response.headers))),Promise.reject(r)})}const E0="1.10.0",aa={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{aa[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const v0={};aa.transitional=function(e,n,r){function o(i,s){return"[Axios v"+E0+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,a)=>{if(e===!1)throw new oe(o(s," has been removed"+(n?" in "+n:"")),oe.ERR_DEPRECATED);return n&&!v0[s]&&(v0[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,s,a):!0}},aa.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function zA(t,e,n){if(typeof t!="object")throw new oe("options must be an object",oe.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],s=e[i];if(s){const a=t[i],l=a===void 0||s(a,i,t);if(l!==!0)throw new oe("option "+i+" must be "+l,oe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new oe("Unknown option "+i,oe.ERR_BAD_OPTION)}}const la={assertOptions:zA,validators:aa},un=la.validators;let Ar=class{constructor(e){this.defaults=e||{},this.interceptors={request:new o0,response:new o0}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
143
+ `+i):r.stack=i}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Nr(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&la.assertOptions(r,{silentJSONParsing:un.transitional(un.boolean),forcedJSONParsing:un.transitional(un.boolean),clarifyTimeoutError:un.transitional(un.boolean)},!1),o!=null&&(L.isFunction(o)?n.paramsSerializer={serialize:o}:la.assertOptions(o,{encode:un.function,serialize:un.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),la.assertOptions(n,{baseUrl:un.spelling("baseURL"),withXsrfToken:un.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&L.merge(i.common,i[n.method]);i&&L.forEach(["delete","get","head","post","put","patch","common"],b=>{delete i[b]}),n.headers=kt.concat(s,i);const a=[];let l=!0;this.interceptors.request.forEach(function(k){typeof k.runWhen=="function"&&k.runWhen(n)===!1||(l=l&&k.synchronous,a.unshift(k.fulfilled,k.rejected))});const c=[];this.interceptors.response.forEach(function(k){c.push(k.fulfilled,k.rejected)});let u,f=0,p;if(!l){const b=[_0.bind(this),void 0];for(b.unshift.apply(b,a),b.push.apply(b,c),p=b.length,u=Promise.resolve(n);f<p;)u=u.then(b[f++],b[f++]);return u}p=a.length;let m=n;for(f=0;f<p;){const b=a[f++],k=a[f++];try{m=b(m)}catch(_){k.call(this,_);break}}try{u=_0.call(this,m)}catch(b){return Promise.reject(b)}for(f=0,p=c.length;f<p;)u=u.then(c[f++],c[f++]);return u}getUri(e){e=Nr(this.defaults,e);const n=f0(e.baseURL,e.url,e.allowAbsoluteUrls);return r0(n,e.params,e.paramsSerializer)}};L.forEach(["delete","get","head","options"],function(e){Ar.prototype[e]=function(n,r){return this.request(Nr(r||{},{method:e,url:n,data:(r||{}).data}))}}),L.forEach(["post","put","patch"],function(e){function n(r){return function(i,s,a){return this.request(Nr(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Ar.prototype[e]=n(),Ar.prototype[e+"Form"]=n(!0)});let jA=class H0{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{r.subscribe(a),i=a}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},e(function(i,s,a){r.reason||(r.reason=new so(i,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new H0(function(o){e=o}),cancel:e}}};function UA(t){return function(n){return t.apply(null,n)}}function WA(t){return L.isObject(t)&&t.isAxiosError===!0}const lu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(lu).forEach(([t,e])=>{lu[e]=t});function C0(t){const e=new Ar(t),n=zg(Ar.prototype.request,e);return L.extend(n,Ar.prototype,e,{allOwnKeys:!0}),L.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return C0(Nr(t,o))},n}const Be=C0(ui);Be.Axios=Ar,Be.CanceledError=so,Be.CancelToken=jA,Be.isCancel=l0,Be.VERSION=E0,Be.toFormData=na,Be.AxiosError=oe,Be.Cancel=Be.CanceledError,Be.all=function(e){return Promise.all(e)},Be.spread=UA,Be.isAxiosError=WA,Be.mergeConfig=Nr,Be.AxiosHeaders=kt,Be.formToJSON=t=>s0(L.isHTMLForm(t)?new FormData(t):t),Be.getAdapter=k0.getAdapter,Be.HttpStatusCode=lu,Be.default=Be;const{Axios:oM,AxiosError:iM,CanceledError:sM,isCancel:aM,CancelToken:lM,VERSION:cM,all:uM,Cancel:dM,isAxiosError:fM,spread:pM,toFormData:hM,AxiosHeaders:mM,HttpStatusCode:gM,formToJSON:bM,getAdapter:yM,mergeConfig:wM}=Be,KA=async t=>{try{const e=new FormData;e.append("unique","true"),e.append("file",t);const{data:n}=await Be.post("/file/upload/uploads?id=&form=&table=",e);return n?.result}catch(e){console.error(e)}},S0=async(t,e)=>{const n=e.clipboardData?.items;if(n){const r=e.clipboardData?.getData("text/html"),o=e.clipboardData?.getData("text/plain");if(r){const{state:i,dispatch:s}=t,{tr:a}=i,l=Mr.fromSchema(t.state.schema),c=new DOMParser().parseFromString(r,"text/html").body,u=l.parse(c),f=a.replaceSelectionWith(u);return s(f),e.preventDefault(),!0}if(o){const{state:i,dispatch:s}=t,{tr:a}=i,l=a.insertText(o,i.selection.from,i.selection.to);return s(l),e.preventDefault(),!0}for(let i=0;i<n.length;i++){const s=n[i];if(s.type.startsWith("image/")){const a=s.getAsFile();if(a){const l=await KA(a),{schema:c}=t.state,u=c.nodes.image.create({src:l?.file_path}),f=t.state.tr.replaceSelectionWith(u);return t.dispatch(f),e.preventDefault(),!0}}}}return!1},qA=ct.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(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]}`,Ce(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Tl({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),GA=["font-[700] text-[30px]","font-[700] text-[26px]","font-[700] text-[22px]","font-[700] text-[18px]","font-[500] text-[16px]","font-[400] text-[14px]"],T0=qA.extend({addOptions(){return{...this.parent?.(),levels:[1,2,3,4,5,6]}}}).extend({addAttributes(){return{...this.parent?.(),level:{default:1,renderHTML:t=>{const e=t.level||1;return{class:`heading-level-${e} ${GA[e-1]}`}}}}}}),N0=ct.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Ce(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}).configure({HTMLAttributes:{class:"min-h-[1rem]"}}),JA={class:"bg-white border border border-solid border-gray-200 rounded-xl"},YA={class:"flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent"},XA={__name:"vs-richtext",props:{modelValue:{type:String,default:()=>""},toolbar:{type:Array,default:()=>["bold","italic","underline","text_align","color","color_picker","blockquote","bullet_list","ordered_list","codeblock","text_more","strike","link","table"]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,o=nh({content:n.modelValue,extensions:[_m,vm,rh,oh,ih,sh,ah,uh,ph,hh,mh,gh,vh,N0,Sh,Cm,Wh,Nh,Ch,Th,T0,Em,Kh,bm.configure({types:["heading","paragraph"]}),qh,gm.configure({HTMLAttributes:{class:"editor-content"},resizable:!0}),km,wm,ym,Uh.configure({HTMLAttributes:{class:"editor-link"},openOnClick:!1,autolink:!0})],editorProps:{handlePaste:S0}}),i=y.computed(()=>n.toolbar.map(a=>Hg[a]));y.watch(o,a=>{a&&o.value.on("update",l=>{const c=l.editor.getHTML();c!==n.modelValue&&r("update:modelValue",c==='<p class="min-h-[1rem]"></p>'?null:c)})});const s=()=>{o.value&&!o.value.isFocused&&o.value.commands.focus()};return(a,l)=>(y.openBlock(),y.createElementBlock("div",JA,[y.createElementVNode("div",YA,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(i.value,c=>(y.openBlock(),y.createBlock(y.resolveDynamicComponent(c),{editor:y.unref(o)},null,8,["editor"]))),256))]),y.createElementVNode("div",{onClick:s,class:"relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800"},[y.createVNode(y.unref(th),{editor:y.unref(o),class:"relative w-full"},null,8,["editor"])])]))}};function QA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ca={exports:{}},ZA=ca.exports,A0;function eO(){return A0||(A0=1,function(t){(function(){function e(d){var g={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:`Remove only spaces, ' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids`,type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{defaultValue:!1,describe:"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",type:"boolean"},metadata:{defaultValue:!1,describe:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,describe:"Split adjacent blockquote blocks",type:"boolean"}};if(d===!1)return JSON.parse(JSON.stringify(g));var h={};for(var w in g)g.hasOwnProperty(w)&&(h[w]=g[w].defaultValue);return h}function n(){var d=e(!0),g={};for(var h in d)d.hasOwnProperty(h)&&(g[h]=!0);return g}var r={},o={},i={},s=e(!0),a="vanilla",l={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:e(!0),allOn:n()};r.helper={},r.extensions={},r.setOption=function(d,g){return s[d]=g,this},r.getOption=function(d){return s[d]},r.getOptions=function(){return s},r.resetOptions=function(){s=e(!0)},r.setFlavor=function(d){if(!l.hasOwnProperty(d))throw Error(d+" flavor was not found");r.resetOptions();var g=l[d];a=d;for(var h in g)g.hasOwnProperty(h)&&(s[h]=g[h])},r.getFlavor=function(){return a},r.getFlavorOptions=function(d){if(l.hasOwnProperty(d))return l[d]},r.getDefaultOptions=function(d){return e(d)},r.subParser=function(d,g){if(r.helper.isString(d))if(typeof g<"u")o[d]=g;else{if(o.hasOwnProperty(d))return o[d];throw Error("SubParser named "+d+" not registered!")}},r.extension=function(d,g){if(!r.helper.isString(d))throw Error("Extension 'name' must be a string");if(d=r.helper.stdExtName(d),r.helper.isUndefined(g)){if(!i.hasOwnProperty(d))throw Error("Extension named "+d+" is not registered!");return i[d]}else{typeof g=="function"&&(g=g()),r.helper.isArray(g)||(g=[g]);var h=c(g,d);if(h.valid)i[d]=g;else throw Error(h.error)}},r.getAllExtensions=function(){return i},r.removeExtension=function(d){delete i[d]},r.resetExtensions=function(){i={}};function c(d,g){var h=g?"Error in "+g+" extension->":"Error in unnamed extension",w={valid:!0,error:""};r.helper.isArray(d)||(d=[d]);for(var v=0;v<d.length;++v){var S=h+" sub-extension "+v+": ",C=d[v];if(typeof C!="object")return w.valid=!1,w.error=S+"must be an object, but "+typeof C+" given",w;if(!r.helper.isString(C.type))return w.valid=!1,w.error=S+'property "type" must be a string, but '+typeof C.type+" given",w;var M=C.type=C.type.toLowerCase();if(M==="language"&&(M=C.type="lang"),M==="html"&&(M=C.type="output"),M!=="lang"&&M!=="output"&&M!=="listener")return w.valid=!1,w.error=S+"type "+M+' is not recognized. Valid values: "lang/language", "output/html" or "listener"',w;if(M==="listener"){if(r.helper.isUndefined(C.listeners))return w.valid=!1,w.error=S+'. Extensions of type "listener" must have a property called "listeners"',w}else if(r.helper.isUndefined(C.filter)&&r.helper.isUndefined(C.regex))return w.valid=!1,w.error=S+M+' extensions must define either a "regex" property or a "filter" method',w;if(C.listeners){if(typeof C.listeners!="object")return w.valid=!1,w.error=S+'"listeners" property must be an object but '+typeof C.listeners+" given",w;for(var P in C.listeners)if(C.listeners.hasOwnProperty(P)&&typeof C.listeners[P]!="function")return w.valid=!1,w.error=S+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+P+" must be a function but "+typeof C.listeners[P]+" given",w}if(C.filter){if(typeof C.filter!="function")return w.valid=!1,w.error=S+'"filter" must be a function, but '+typeof C.filter+" given",w}else if(C.regex){if(r.helper.isString(C.regex)&&(C.regex=new RegExp(C.regex,"g")),!(C.regex instanceof RegExp))return w.valid=!1,w.error=S+'"regex" property must either be a string or a RegExp object, but '+typeof C.regex+" given",w;if(r.helper.isUndefined(C.replace))return w.valid=!1,w.error=S+'"regex" extensions must implement a replace string or function',w}}return w}r.validateExtension=function(d){var g=c(d,null);return g.valid?!0:(console.warn(g.error),!1)},r.hasOwnProperty("helper")||(r.helper={}),r.helper.isString=function(d){return typeof d=="string"||d instanceof String},r.helper.isFunction=function(d){var g={};return d&&g.toString.call(d)==="[object Function]"},r.helper.isArray=function(d){return Array.isArray(d)},r.helper.isUndefined=function(d){return typeof d>"u"},r.helper.forEach=function(d,g){if(r.helper.isUndefined(d))throw new Error("obj param is required");if(r.helper.isUndefined(g))throw new Error("callback param is required");if(!r.helper.isFunction(g))throw new Error("callback param must be a function/closure");if(typeof d.forEach=="function")d.forEach(g);else if(r.helper.isArray(d))for(var h=0;h<d.length;h++)g(d[h],h,d);else if(typeof d=="object")for(var w in d)d.hasOwnProperty(w)&&g(d[w],w,d);else throw new Error("obj does not seem to be an array or an iterable object")},r.helper.stdExtName=function(d){return d.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()};function u(d,g){var h=g.charCodeAt(0);return"¨E"+h+"E"}r.helper.escapeCharactersCallback=u,r.helper.escapeCharacters=function(d,g,h){var w="(["+g.replace(/([\[\]\\])/g,"\\$1")+"])";h&&(w="\\\\"+w);var v=new RegExp(w,"g");return d=d.replace(v,u),d},r.helper.unescapeHTMLEntities=function(d){return d.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")};var f=function(d,g,h,w){var v=w||"",S=v.indexOf("g")>-1,C=new RegExp(g+"|"+h,"g"+v.replace(/g/g,"")),M=new RegExp(g,v.replace(/g/g,"")),P=[],D,F,$,T,I;do for(D=0;$=C.exec(d);)if(M.test($[0]))D++||(F=C.lastIndex,T=F-$[0].length);else if(D&&!--D){I=$.index+$[0].length;var U={left:{start:T,end:F},match:{start:F,end:$.index},right:{start:$.index,end:I},wholeMatch:{start:T,end:I}};if(P.push(U),!S)return P}while(D&&(C.lastIndex=F));return P};r.helper.matchRecursiveRegExp=function(d,g,h,w){for(var v=f(d,g,h,w),S=[],C=0;C<v.length;++C)S.push([d.slice(v[C].wholeMatch.start,v[C].wholeMatch.end),d.slice(v[C].match.start,v[C].match.end),d.slice(v[C].left.start,v[C].left.end),d.slice(v[C].right.start,v[C].right.end)]);return S},r.helper.replaceRecursiveRegExp=function(d,g,h,w,v){if(!r.helper.isFunction(g)){var S=g;g=function(){return S}}var C=f(d,h,w,v),M=d,P=C.length;if(P>0){var D=[];C[0].wholeMatch.start!==0&&D.push(d.slice(0,C[0].wholeMatch.start));for(var F=0;F<P;++F)D.push(g(d.slice(C[F].wholeMatch.start,C[F].wholeMatch.end),d.slice(C[F].match.start,C[F].match.end),d.slice(C[F].left.start,C[F].left.end),d.slice(C[F].right.start,C[F].right.end))),F<P-1&&D.push(d.slice(C[F].wholeMatch.end,C[F+1].wholeMatch.start));C[P-1].wholeMatch.end<d.length&&D.push(d.slice(C[P-1].wholeMatch.end)),M=D.join("")}return M},r.helper.regexIndexOf=function(d,g,h){if(!r.helper.isString(d))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(!(g instanceof RegExp))throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var w=d.substring(h||0).search(g);return w>=0?w+(h||0):w},r.helper.splitAtIndex=function(d,g){if(!r.helper.isString(d))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[d.substring(0,g),d.substring(g)]},r.helper.encodeEmailAddress=function(d){var g=[function(h){return"&#"+h.charCodeAt(0)+";"},function(h){return"&#x"+h.charCodeAt(0).toString(16)+";"},function(h){return h}];return d=d.replace(/./g,function(h){if(h==="@")h=g[Math.floor(Math.random()*2)](h);else{var w=Math.random();h=w>.9?g[2](h):w>.45?g[1](h):g[0](h)}return h}),d},r.helper.padEnd=function(g,h,w){return h=h>>0,w=String(w||" "),g.length>h?String(g):(h=h-g.length,h>w.length&&(w+=w.repeat(h/w.length)),String(g)+w.slice(0,h))},typeof console>"u"&&(console={warn:function(d){alert(d)},log:function(d){alert(d)},error:function(d){throw d}}),r.helper.regexes={asteriskDashAndColon:/([*_:~])/g},r.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️&zwj;♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴&zwj;♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱&zwj;♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇&zwj;♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷&zwj;♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨&zwj;❤️&zwj;👨",couple_with_heart_woman_woman:"👩&zwj;❤️&zwj;👩",couplekiss_man_man:"👨&zwj;❤️&zwj;💋&zwj;👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩&zwj;❤️&zwj;💋&zwj;👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯&zwj;♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁&zwj;🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨&zwj;👦",family_man_boy_boy:"👨&zwj;👦&zwj;👦",family_man_girl:"👨&zwj;👧",family_man_girl_boy:"👨&zwj;👧&zwj;👦",family_man_girl_girl:"👨&zwj;👧&zwj;👧",family_man_man_boy:"👨&zwj;👨&zwj;👦",family_man_man_boy_boy:"👨&zwj;👨&zwj;👦&zwj;👦",family_man_man_girl:"👨&zwj;👨&zwj;👧",family_man_man_girl_boy:"👨&zwj;👨&zwj;👧&zwj;👦",family_man_man_girl_girl:"👨&zwj;👨&zwj;👧&zwj;👧",family_man_woman_boy_boy:"👨&zwj;👩&zwj;👦&zwj;👦",family_man_woman_girl:"👨&zwj;👩&zwj;👧",family_man_woman_girl_boy:"👨&zwj;👩&zwj;👧&zwj;👦",family_man_woman_girl_girl:"👨&zwj;👩&zwj;👧&zwj;👧",family_woman_boy:"👩&zwj;👦",family_woman_boy_boy:"👩&zwj;👦&zwj;👦",family_woman_girl:"👩&zwj;👧",family_woman_girl_boy:"👩&zwj;👧&zwj;👦",family_woman_girl_girl:"👩&zwj;👧&zwj;👧",family_woman_woman_boy:"👩&zwj;👩&zwj;👦",family_woman_woman_boy_boy:"👩&zwj;👩&zwj;👦&zwj;👦",family_woman_woman_girl:"👩&zwj;👩&zwj;👧",family_woman_woman_girl_boy:"👩&zwj;👩&zwj;👧&zwj;👦",family_woman_woman_girl_girl:"👩&zwj;👩&zwj;👧&zwj;👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️&zwj;♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍&zwj;♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️&zwj;♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂&zwj;♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇&zwj;♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨&zwj;🎨",man_astronaut:"👨&zwj;🚀",man_cartwheeling:"🤸&zwj;♂️",man_cook:"👨&zwj;🍳",man_dancing:"🕺",man_facepalming:"🤦&zwj;♂️",man_factory_worker:"👨&zwj;🏭",man_farmer:"👨&zwj;🌾",man_firefighter:"👨&zwj;🚒",man_health_worker:"👨&zwj;⚕️",man_in_tuxedo:"🤵",man_judge:"👨&zwj;⚖️",man_juggling:"🤹&zwj;♂️",man_mechanic:"👨&zwj;🔧",man_office_worker:"👨&zwj;💼",man_pilot:"👨&zwj;✈️",man_playing_handball:"🤾&zwj;♂️",man_playing_water_polo:"🤽&zwj;♂️",man_scientist:"👨&zwj;🔬",man_shrugging:"🤷&zwj;♂️",man_singer:"👨&zwj;🎤",man_student:"👨&zwj;🎓",man_teacher:"👨&zwj;🏫",man_technologist:"👨&zwj;💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆&zwj;♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼&zwj;♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵&zwj;♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅&zwj;♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆&zwj;♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮&zwj;♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎&zwj;♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️&zwj;🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋&zwj;♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣&zwj;♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃&zwj;♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄&zwj;♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊&zwj;♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁&zwj;♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶&zwj;♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️&zwj;♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩&zwj;🎨",woman_astronaut:"👩&zwj;🚀",woman_cartwheeling:"🤸&zwj;♀️",woman_cook:"👩&zwj;🍳",woman_facepalming:"🤦&zwj;♀️",woman_factory_worker:"👩&zwj;🏭",woman_farmer:"👩&zwj;🌾",woman_firefighter:"👩&zwj;🚒",woman_health_worker:"👩&zwj;⚕️",woman_judge:"👩&zwj;⚖️",woman_juggling:"🤹&zwj;♀️",woman_mechanic:"👩&zwj;🔧",woman_office_worker:"👩&zwj;💼",woman_pilot:"👩&zwj;✈️",woman_playing_handball:"🤾&zwj;♀️",woman_playing_water_polo:"🤽&zwj;♀️",woman_scientist:"👩&zwj;🔬",woman_shrugging:"🤷&zwj;♀️",woman_singer:"👩&zwj;🎤",woman_student:"👩&zwj;🎓",woman_teacher:"👩&zwj;🏫",woman_technologist:"👩&zwj;💻",woman_with_turban:"👳&zwj;♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼&zwj;♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:`<span style="font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;">S</span>`},r.Converter=function(d){var g={},h=[],w=[],v={},S=a,C={parsed:{},raw:"",format:""};M();function M(){d=d||{};for(var T in s)s.hasOwnProperty(T)&&(g[T]=s[T]);if(typeof d=="object")for(var I in d)d.hasOwnProperty(I)&&(g[I]=d[I]);else throw Error("Converter expects the passed parameter to be an object, but "+typeof d+" was passed instead.");g.extensions&&r.helper.forEach(g.extensions,P)}function P(T,I){if(I=I||null,r.helper.isString(T))if(T=r.helper.stdExtName(T),I=T,r.extensions[T]){console.warn("DEPRECATION WARNING: "+T+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),D(r.extensions[T],T);return}else if(!r.helper.isUndefined(i[T]))T=i[T];else throw Error('Extension "'+T+'" could not be loaded. It was either not found or is not a valid extension.');typeof T=="function"&&(T=T()),r.helper.isArray(T)||(T=[T]);var U=c(T,I);if(!U.valid)throw Error(U.error);for(var q=0;q<T.length;++q){switch(T[q].type){case"lang":h.push(T[q]);break;case"output":w.push(T[q]);break}if(T[q].hasOwnProperty("listeners"))for(var Z in T[q].listeners)T[q].listeners.hasOwnProperty(Z)&&F(Z,T[q].listeners[Z])}}function D(T,I){typeof T=="function"&&(T=T(new r.Converter)),r.helper.isArray(T)||(T=[T]);var U=c(T,I);if(!U.valid)throw Error(U.error);for(var q=0;q<T.length;++q)switch(T[q].type){case"lang":h.push(T[q]);break;case"output":w.push(T[q]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}function F(T,I){if(!r.helper.isString(T))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof T+" given");if(typeof I!="function")throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof I+" given");v.hasOwnProperty(T)||(v[T]=[]),v[T].push(I)}function $(T){var I=T.match(/^\s*/)[0].length,U=new RegExp("^\\s{0,"+I+"}","gm");return T.replace(U,"")}this._dispatch=function(I,U,q,Z){if(v.hasOwnProperty(I))for(var G=0;G<v[I].length;++G){var he=v[I][G](I,U,this,q,Z);he&&typeof he<"u"&&(U=he)}return U},this.listen=function(T,I){return F(T,I),this},this.makeHtml=function(T){if(!T)return T;var I={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:h,outputModifiers:w,converter:this,ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return T=T.replace(/¨/g,"¨T"),T=T.replace(/\$/g,"¨D"),T=T.replace(/\r\n/g,`
144
+ `),T=T.replace(/\r/g,`
145
+ `),T=T.replace(/\u00A0/g,"&nbsp;"),g.smartIndentationFix&&(T=$(T)),T=`
146
+
147
+ `+T+`
148
+
149
+ `,T=r.subParser("detab")(T,g,I),T=T.replace(/^[ \t]+$/mg,""),r.helper.forEach(h,function(U){T=r.subParser("runExtension")(U,T,g,I)}),T=r.subParser("metadata")(T,g,I),T=r.subParser("hashPreCodeTags")(T,g,I),T=r.subParser("githubCodeBlocks")(T,g,I),T=r.subParser("hashHTMLBlocks")(T,g,I),T=r.subParser("hashCodeTags")(T,g,I),T=r.subParser("stripLinkDefinitions")(T,g,I),T=r.subParser("blockGamut")(T,g,I),T=r.subParser("unhashHTMLSpans")(T,g,I),T=r.subParser("unescapeSpecialChars")(T,g,I),T=T.replace(/¨D/g,"$$"),T=T.replace(/¨T/g,"¨"),T=r.subParser("completeHTMLDocument")(T,g,I),r.helper.forEach(w,function(U){T=r.subParser("runExtension")(U,T,g,I)}),C=I.metadata,T},this.makeMarkdown=this.makeMd=function(T,I){if(T=T.replace(/\r\n/g,`
150
+ `),T=T.replace(/\r/g,`
151
+ `),T=T.replace(/>[ \t]+</,">¨NBSP;<"),!I)if(window&&window.document)I=window.document;else throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var U=I.createElement("div");U.innerHTML=T;var q={preList:Oe(U)};Te(U);for(var Z=U.childNodes,G="",he=0;he<Z.length;he++)G+=r.subParser("makeMarkdown.node")(Z[he],q);function Te(fe){for(var we=0;we<fe.childNodes.length;++we){var Me=fe.childNodes[we];Me.nodeType===3?!/\S/.test(Me.nodeValue)&&!/^[ ]+$/.test(Me.nodeValue)?(fe.removeChild(Me),--we):(Me.nodeValue=Me.nodeValue.split(`
152
+ `).join(" "),Me.nodeValue=Me.nodeValue.replace(/(\s)+/g,"$1")):Me.nodeType===1&&Te(Me)}}function Oe(fe){for(var we=fe.querySelectorAll("pre"),Me=[],ke=0;ke<we.length;++ke)if(we[ke].childElementCount===1&&we[ke].firstChild.tagName.toLowerCase()==="code"){var _t=we[ke].firstChild.innerHTML.trim(),ot=we[ke].firstChild.getAttribute("data-language")||"";if(ot==="")for(var At=we[ke].firstChild.className.split(" "),Vt=0;Vt<At.length;++Vt){var Et=At[Vt].match(/^language-(.+)$/);if(Et!==null){ot=Et[1];break}}_t=r.helper.unescapeHTMLEntities(_t),Me.push(_t),we[ke].outerHTML='<precode language="'+ot+'" precodenum="'+ke.toString()+'"></precode>'}else Me.push(we[ke].innerHTML),we[ke].innerHTML="",we[ke].setAttribute("prenum",ke.toString());return Me}return G},this.setOption=function(T,I){g[T]=I},this.getOption=function(T){return g[T]},this.getOptions=function(){return g},this.addExtension=function(T,I){I=I||null,P(T,I)},this.useExtension=function(T){P(T)},this.setFlavor=function(T){if(!l.hasOwnProperty(T))throw Error(T+" flavor was not found");var I=l[T];S=T;for(var U in I)I.hasOwnProperty(U)&&(g[U]=I[U])},this.getFlavor=function(){return S},this.removeExtension=function(T){r.helper.isArray(T)||(T=[T]);for(var I=0;I<T.length;++I){for(var U=T[I],q=0;q<h.length;++q)h[q]===U&&h.splice(q,1);for(var Z=0;Z<w.length;++Z)w[Z]===U&&w.splice(Z,1)}},this.getAllExtensions=function(){return{language:h,output:w}},this.getMetadata=function(T){return T?C.raw:C.parsed},this.getMetadataFormat=function(){return C.format},this._setMetadataPair=function(T,I){C.parsed[T]=I},this._setMetadataFormat=function(T){C.format=T},this._setMetadataRaw=function(T){C.raw=T}},r.subParser("anchors",function(d,g,h){d=h.converter._dispatch("anchors.before",d,g,h);var w=function(v,S,C,M,P,D,F){if(r.helper.isUndefined(F)&&(F=""),C=C.toLowerCase(),v.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)M="";else if(!M)if(C||(C=S.toLowerCase().replace(/ ?\n/g," ")),M="#"+C,!r.helper.isUndefined(h.gUrls[C]))M=h.gUrls[C],r.helper.isUndefined(h.gTitles[C])||(F=h.gTitles[C]);else return v;M=M.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var $='<a href="'+M+'"';return F!==""&&F!==null&&(F=F.replace(/"/g,"&quot;"),F=F.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),$+=' title="'+F+'"'),g.openLinksInNewWindow&&!/^#/.test(M)&&($+=' rel="noopener noreferrer" target="¨E95Eblank"'),$+=">"+S+"</a>",$};return d=d.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,w),d=d.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,w),d=d.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,w),d=d.replace(/\[([^\[\]]+)]()()()()()/g,w),g.ghMentions&&(d=d.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(v,S,C,M,P){if(C==="\\")return S+M;if(!r.helper.isString(g.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var D=g.ghMentionsLink.replace(/\{u}/g,P),F="";return g.openLinksInNewWindow&&(F=' rel="noopener noreferrer" target="¨E95Eblank"'),S+'<a href="'+D+'"'+F+">"+M+"</a>"})),d=h.converter._dispatch("anchors.after",d,g,h),d});var p=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,m=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,b=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,k=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,_=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,E=function(d){return function(g,h,w,v,S,C,M){w=w.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var P=w,D="",F="",$=h||"",T=M||"";return/^www\./i.test(w)&&(w=w.replace(/^www\./i,"http://www.")),d.excludeTrailingPunctuationFromURLs&&C&&(D=C),d.openLinksInNewWindow&&(F=' rel="noopener noreferrer" target="¨E95Eblank"'),$+'<a href="'+w+'"'+F+">"+P+"</a>"+D+T}},N=function(d,g){return function(h,w,v){var S="mailto:";return w=w||"",v=r.subParser("unescapeSpecialChars")(v,d,g),d.encodeEmails?(S=r.helper.encodeEmailAddress(S+v),v=r.helper.encodeEmailAddress(v)):S=S+v,w+'<a href="'+S+'">'+v+"</a>"}};r.subParser("autoLinks",function(d,g,h){return d=h.converter._dispatch("autoLinks.before",d,g,h),d=d.replace(b,E(g)),d=d.replace(_,N(g,h)),d=h.converter._dispatch("autoLinks.after",d,g,h),d}),r.subParser("simplifiedAutoLinks",function(d,g,h){return g.simplifiedAutoLink&&(d=h.converter._dispatch("simplifiedAutoLinks.before",d,g,h),g.excludeTrailingPunctuationFromURLs?d=d.replace(m,E(g)):d=d.replace(p,E(g)),d=d.replace(k,N(g,h)),d=h.converter._dispatch("simplifiedAutoLinks.after",d,g,h)),d}),r.subParser("blockGamut",function(d,g,h){return d=h.converter._dispatch("blockGamut.before",d,g,h),d=r.subParser("blockQuotes")(d,g,h),d=r.subParser("headers")(d,g,h),d=r.subParser("horizontalRule")(d,g,h),d=r.subParser("lists")(d,g,h),d=r.subParser("codeBlocks")(d,g,h),d=r.subParser("tables")(d,g,h),d=r.subParser("hashHTMLBlocks")(d,g,h),d=r.subParser("paragraphs")(d,g,h),d=h.converter._dispatch("blockGamut.after",d,g,h),d}),r.subParser("blockQuotes",function(d,g,h){d=h.converter._dispatch("blockQuotes.before",d,g,h),d=d+`
153
+
154
+ `;var w=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return g.splitAdjacentBlockquotes&&(w=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),d=d.replace(w,function(v){return v=v.replace(/^[ \t]*>[ \t]?/gm,""),v=v.replace(/¨0/g,""),v=v.replace(/^[ \t]+$/gm,""),v=r.subParser("githubCodeBlocks")(v,g,h),v=r.subParser("blockGamut")(v,g,h),v=v.replace(/(^|\n)/g,"$1 "),v=v.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(S,C){var M=C;return M=M.replace(/^ /mg,"¨0"),M=M.replace(/¨0/g,""),M}),r.subParser("hashBlock")(`<blockquote>
155
+ `+v+`
156
+ </blockquote>`,g,h)}),d=h.converter._dispatch("blockQuotes.after",d,g,h),d}),r.subParser("codeBlocks",function(d,g,h){d=h.converter._dispatch("codeBlocks.before",d,g,h),d+="¨0";var w=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;return d=d.replace(w,function(v,S,C){var M=S,P=C,D=`
157
+ `;return M=r.subParser("outdent")(M,g,h),M=r.subParser("encodeCode")(M,g,h),M=r.subParser("detab")(M,g,h),M=M.replace(/^\n+/g,""),M=M.replace(/\n+$/g,""),g.omitExtraWLInCodeBlocks&&(D=""),M="<pre><code>"+M+D+"</code></pre>",r.subParser("hashBlock")(M,g,h)+P}),d=d.replace(/¨0/,""),d=h.converter._dispatch("codeBlocks.after",d,g,h),d}),r.subParser("codeSpans",function(d,g,h){return d=h.converter._dispatch("codeSpans.before",d,g,h),typeof d>"u"&&(d=""),d=d.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(w,v,S,C){var M=C;return M=M.replace(/^([ \t]*)/g,""),M=M.replace(/[ \t]*$/g,""),M=r.subParser("encodeCode")(M,g,h),M=v+"<code>"+M+"</code>",M=r.subParser("hashHTMLSpans")(M,g,h),M}),d=h.converter._dispatch("codeSpans.after",d,g,h),d}),r.subParser("completeHTMLDocument",function(d,g,h){if(!g.completeHTMLDocument)return d;d=h.converter._dispatch("completeHTMLDocument.before",d,g,h);var w="html",v=`<!DOCTYPE HTML>
158
+ `,S="",C=`<meta charset="utf-8">
159
+ `,M="",P="";typeof h.metadata.parsed.doctype<"u"&&(v="<!DOCTYPE "+h.metadata.parsed.doctype+`>
160
+ `,w=h.metadata.parsed.doctype.toString().toLowerCase(),(w==="html"||w==="html5")&&(C='<meta charset="utf-8">'));for(var D in h.metadata.parsed)if(h.metadata.parsed.hasOwnProperty(D))switch(D.toLowerCase()){case"doctype":break;case"title":S="<title>"+h.metadata.parsed.title+`</title>
161
+ `;break;case"charset":w==="html"||w==="html5"?C='<meta charset="'+h.metadata.parsed.charset+`">
162
+ `:C='<meta name="charset" content="'+h.metadata.parsed.charset+`">
163
+ `;break;case"language":case"lang":M=' lang="'+h.metadata.parsed[D]+'"',P+='<meta name="'+D+'" content="'+h.metadata.parsed[D]+`">
164
+ `;break;default:P+='<meta name="'+D+'" content="'+h.metadata.parsed[D]+`">
165
+ `}return d=v+"<html"+M+`>
166
+ <head>
167
+ `+S+C+P+`</head>
168
+ <body>
169
+ `+d.trim()+`
170
+ </body>
171
+ </html>`,d=h.converter._dispatch("completeHTMLDocument.after",d,g,h),d}),r.subParser("detab",function(d,g,h){return d=h.converter._dispatch("detab.before",d,g,h),d=d.replace(/\t(?=\t)/g," "),d=d.replace(/\t/g,"¨A¨B"),d=d.replace(/¨B(.+?)¨A/g,function(w,v){for(var S=v,C=4-S.length%4,M=0;M<C;M++)S+=" ";return S}),d=d.replace(/¨A/g," "),d=d.replace(/¨B/g,""),d=h.converter._dispatch("detab.after",d,g,h),d}),r.subParser("ellipsis",function(d,g,h){return g.ellipsis&&(d=h.converter._dispatch("ellipsis.before",d,g,h),d=d.replace(/\.\.\./g,"…"),d=h.converter._dispatch("ellipsis.after",d,g,h)),d}),r.subParser("emoji",function(d,g,h){if(!g.emoji)return d;d=h.converter._dispatch("emoji.before",d,g,h);var w=/:([\S]+?):/g;return d=d.replace(w,function(v,S){return r.helper.emojis.hasOwnProperty(S)?r.helper.emojis[S]:v}),d=h.converter._dispatch("emoji.after",d,g,h),d}),r.subParser("encodeAmpsAndAngles",function(d,g,h){return d=h.converter._dispatch("encodeAmpsAndAngles.before",d,g,h),d=d.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&amp;"),d=d.replace(/<(?![a-z\/?$!])/gi,"&lt;"),d=d.replace(/</g,"&lt;"),d=d.replace(/>/g,"&gt;"),d=h.converter._dispatch("encodeAmpsAndAngles.after",d,g,h),d}),r.subParser("encodeBackslashEscapes",function(d,g,h){return d=h.converter._dispatch("encodeBackslashEscapes.before",d,g,h),d=d.replace(/\\(\\)/g,r.helper.escapeCharactersCallback),d=d.replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g,r.helper.escapeCharactersCallback),d=h.converter._dispatch("encodeBackslashEscapes.after",d,g,h),d}),r.subParser("encodeCode",function(d,g,h){return d=h.converter._dispatch("encodeCode.before",d,g,h),d=d.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/([*_{}\[\]\\=~-])/g,r.helper.escapeCharactersCallback),d=h.converter._dispatch("encodeCode.after",d,g,h),d}),r.subParser("escapeSpecialCharsWithinTagAttributes",function(d,g,h){d=h.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",d,g,h);var w=/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,v=/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;return d=d.replace(w,function(S){return S.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,r.helper.escapeCharactersCallback)}),d=d.replace(v,function(S){return S.replace(/([\\`*_~=|])/g,r.helper.escapeCharactersCallback)}),d=h.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",d,g,h),d}),r.subParser("githubCodeBlocks",function(d,g,h){return g.ghCodeBlocks?(d=h.converter._dispatch("githubCodeBlocks.before",d,g,h),d+="¨0",d=d.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(w,v,S,C){var M=g.omitExtraWLInCodeBlocks?"":`
172
+ `;return C=r.subParser("encodeCode")(C,g,h),C=r.subParser("detab")(C,g,h),C=C.replace(/^\n+/g,""),C=C.replace(/\n+$/g,""),C="<pre><code"+(S?' class="'+S+" language-"+S+'"':"")+">"+C+M+"</code></pre>",C=r.subParser("hashBlock")(C,g,h),`
173
+
174
+ ¨G`+(h.ghCodeBlocks.push({text:w,codeblock:C})-1)+`G
175
+
176
+ `}),d=d.replace(/¨0/,""),h.converter._dispatch("githubCodeBlocks.after",d,g,h)):d}),r.subParser("hashBlock",function(d,g,h){return d=h.converter._dispatch("hashBlock.before",d,g,h),d=d.replace(/(^\n+|\n+$)/g,""),d=`
177
+
178
+ ¨K`+(h.gHtmlBlocks.push(d)-1)+`K
179
+
180
+ `,d=h.converter._dispatch("hashBlock.after",d,g,h),d}),r.subParser("hashCodeTags",function(d,g,h){d=h.converter._dispatch("hashCodeTags.before",d,g,h);var w=function(v,S,C,M){var P=C+r.subParser("encodeCode")(S,g,h)+M;return"¨C"+(h.gHtmlSpans.push(P)-1)+"C"};return d=r.helper.replaceRecursiveRegExp(d,w,"<code\\b[^>]*>","</code>","gim"),d=h.converter._dispatch("hashCodeTags.after",d,g,h),d}),r.subParser("hashElement",function(d,g,h){return function(w,v){var S=v;return S=S.replace(/\n\n/g,`
181
+ `),S=S.replace(/^\n/,""),S=S.replace(/\n+$/g,""),S=`
182
+
183
+ ¨K`+(h.gHtmlBlocks.push(S)-1)+`K
184
+
185
+ `,S}}),r.subParser("hashHTMLBlocks",function(d,g,h){d=h.converter._dispatch("hashHTMLBlocks.before",d,g,h);var w=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],v=function(T,I,U,q){var Z=T;return U.search(/\bmarkdown\b/)!==-1&&(Z=U+h.converter.makeHtml(I)+q),`
186
+
187
+ ¨K`+(h.gHtmlBlocks.push(Z)-1)+`K
188
+
189
+ `};g.backslashEscapesHTMLTags&&(d=d.replace(/\\<(\/?[^>]+?)>/g,function(T,I){return"&lt;"+I+"&gt;"}));for(var S=0;S<w.length;++S)for(var C,M=new RegExp("^ {0,3}(<"+w[S]+"\\b[^>]*>)","im"),P="<"+w[S]+"\\b[^>]*>",D="</"+w[S]+">";(C=r.helper.regexIndexOf(d,M))!==-1;){var F=r.helper.splitAtIndex(d,C),$=r.helper.replaceRecursiveRegExp(F[1],v,P,D,"im");if($===F[1])break;d=F[0].concat($)}return d=d.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(d,g,h)),d=r.helper.replaceRecursiveRegExp(d,function(T){return`
190
+
191
+ ¨K`+(h.gHtmlBlocks.push(T)-1)+`K
192
+
193
+ `},"^ {0,3}<!--","-->","gm"),d=d.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(d,g,h)),d=h.converter._dispatch("hashHTMLBlocks.after",d,g,h),d}),r.subParser("hashHTMLSpans",function(d,g,h){d=h.converter._dispatch("hashHTMLSpans.before",d,g,h);function w(v){return"¨C"+(h.gHtmlSpans.push(v)-1)+"C"}return d=d.replace(/<[^>]+?\/>/gi,function(v){return w(v)}),d=d.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(v){return w(v)}),d=d.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(v){return w(v)}),d=d.replace(/<[^>]+?>/gi,function(v){return w(v)}),d=h.converter._dispatch("hashHTMLSpans.after",d,g,h),d}),r.subParser("unhashHTMLSpans",function(d,g,h){d=h.converter._dispatch("unhashHTMLSpans.before",d,g,h);for(var w=0;w<h.gHtmlSpans.length;++w){for(var v=h.gHtmlSpans[w],S=0;/¨C(\d+)C/.test(v);){var C=RegExp.$1;if(v=v.replace("¨C"+C+"C",h.gHtmlSpans[C]),S===10){console.error("maximum nesting of 10 spans reached!!!");break}++S}d=d.replace("¨C"+w+"C",v)}return d=h.converter._dispatch("unhashHTMLSpans.after",d,g,h),d}),r.subParser("hashPreCodeTags",function(d,g,h){d=h.converter._dispatch("hashPreCodeTags.before",d,g,h);var w=function(v,S,C,M){var P=C+r.subParser("encodeCode")(S,g,h)+M;return`
194
+
195
+ ¨G`+(h.ghCodeBlocks.push({text:v,codeblock:P})-1)+`G
196
+
197
+ `};return d=r.helper.replaceRecursiveRegExp(d,w,"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),d=h.converter._dispatch("hashPreCodeTags.after",d,g,h),d}),r.subParser("headers",function(d,g,h){d=h.converter._dispatch("headers.before",d,g,h);var w=isNaN(parseInt(g.headerLevelStart))?1:parseInt(g.headerLevelStart),v=g.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,S=g.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;d=d.replace(v,function(P,D){var F=r.subParser("spanGamut")(D,g,h),$=g.noHeaderId?"":' id="'+M(D)+'"',T=w,I="<h"+T+$+">"+F+"</h"+T+">";return r.subParser("hashBlock")(I,g,h)}),d=d.replace(S,function(P,D){var F=r.subParser("spanGamut")(D,g,h),$=g.noHeaderId?"":' id="'+M(D)+'"',T=w+1,I="<h"+T+$+">"+F+"</h"+T+">";return r.subParser("hashBlock")(I,g,h)});var C=g.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;d=d.replace(C,function(P,D,F){var $=F;g.customizedHeaderId&&($=F.replace(/\s?\{([^{]+?)}\s*$/,""));var T=r.subParser("spanGamut")($,g,h),I=g.noHeaderId?"":' id="'+M(F)+'"',U=w-1+D.length,q="<h"+U+I+">"+T+"</h"+U+">";return r.subParser("hashBlock")(q,g,h)});function M(P){var D,F;if(g.customizedHeaderId){var $=P.match(/\{([^{]+?)}\s*$/);$&&$[1]&&(P=$[1])}return D=P,r.helper.isString(g.prefixHeaderId)?F=g.prefixHeaderId:g.prefixHeaderId===!0?F="section-":F="",g.rawPrefixHeaderId||(D=F+D),g.ghCompatibleHeaderId?D=D.replace(/ /g,"-").replace(/&amp;/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():g.rawHeaderId?D=D.replace(/ /g,"-").replace(/&amp;/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():D=D.replace(/[^\w]/g,"").toLowerCase(),g.rawPrefixHeaderId&&(D=F+D),h.hashLinkCounts[D]?D=D+"-"+h.hashLinkCounts[D]++:h.hashLinkCounts[D]=1,D}return d=h.converter._dispatch("headers.after",d,g,h),d}),r.subParser("horizontalRule",function(d,g,h){d=h.converter._dispatch("horizontalRule.before",d,g,h);var w=r.subParser("hashBlock")("<hr />",g,h);return d=d.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,w),d=d.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,w),d=d.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,w),d=h.converter._dispatch("horizontalRule.after",d,g,h),d}),r.subParser("images",function(d,g,h){d=h.converter._dispatch("images.before",d,g,h);var w=/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,v=/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,S=/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,C=/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,M=/!\[([^\[\]]+)]()()()()()/g;function P(F,$,T,I,U,q,Z,G){return I=I.replace(/\s/g,""),D(F,$,T,I,U,q,Z,G)}function D(F,$,T,I,U,q,Z,G){var he=h.gUrls,Te=h.gTitles,Oe=h.gDimensions;if(T=T.toLowerCase(),G||(G=""),F.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)I="";else if(I===""||I===null)if((T===""||T===null)&&(T=$.toLowerCase().replace(/ ?\n/g," ")),I="#"+T,!r.helper.isUndefined(he[T]))I=he[T],r.helper.isUndefined(Te[T])||(G=Te[T]),r.helper.isUndefined(Oe[T])||(U=Oe[T].width,q=Oe[T].height);else return F;$=$.replace(/"/g,"&quot;").replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),I=I.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var fe='<img src="'+I+'" alt="'+$+'"';return G&&r.helper.isString(G)&&(G=G.replace(/"/g,"&quot;").replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),fe+=' title="'+G+'"'),U&&q&&(U=U==="*"?"auto":U,q=q==="*"?"auto":q,fe+=' width="'+U+'"',fe+=' height="'+q+'"'),fe+=" />",fe}return d=d.replace(C,D),d=d.replace(S,P),d=d.replace(v,D),d=d.replace(w,D),d=d.replace(M,D),d=h.converter._dispatch("images.after",d,g,h),d}),r.subParser("italicsAndBold",function(d,g,h){d=h.converter._dispatch("italicsAndBold.before",d,g,h);function w(v,S,C){return S+v+C}return g.literalMidWordUnderscores?(d=d.replace(/\b___(\S[\s\S]*?)___\b/g,function(v,S){return w(S,"<strong><em>","</em></strong>")}),d=d.replace(/\b__(\S[\s\S]*?)__\b/g,function(v,S){return w(S,"<strong>","</strong>")}),d=d.replace(/\b_(\S[\s\S]*?)_\b/g,function(v,S){return w(S,"<em>","</em>")})):(d=d.replace(/___(\S[\s\S]*?)___/g,function(v,S){return/\S$/.test(S)?w(S,"<strong><em>","</em></strong>"):v}),d=d.replace(/__(\S[\s\S]*?)__/g,function(v,S){return/\S$/.test(S)?w(S,"<strong>","</strong>"):v}),d=d.replace(/_([^\s_][\s\S]*?)_/g,function(v,S){return/\S$/.test(S)?w(S,"<em>","</em>"):v})),g.literalMidWordAsterisks?(d=d.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,function(v,S,C){return w(C,S+"<strong><em>","</em></strong>")}),d=d.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,function(v,S,C){return w(C,S+"<strong>","</strong>")}),d=d.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,function(v,S,C){return w(C,S+"<em>","</em>")})):(d=d.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,function(v,S){return/\S$/.test(S)?w(S,"<strong><em>","</em></strong>"):v}),d=d.replace(/\*\*(\S[\s\S]*?)\*\*/g,function(v,S){return/\S$/.test(S)?w(S,"<strong>","</strong>"):v}),d=d.replace(/\*([^\s*][\s\S]*?)\*/g,function(v,S){return/\S$/.test(S)?w(S,"<em>","</em>"):v})),d=h.converter._dispatch("italicsAndBold.after",d,g,h),d}),r.subParser("lists",function(d,g,h){function w(C,M){h.gListLevel++,C=C.replace(/\n{2,}$/,`
198
+ `),C+="¨0";var P=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,D=/\n[ \t]*\n(?!¨0)/.test(C);return g.disableForced4SpacesIndentedSublists&&(P=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),C=C.replace(P,function(F,$,T,I,U,q,Z){Z=Z&&Z.trim()!=="";var G=r.subParser("outdent")(U,g,h),he="";return q&&g.tasklists&&(he=' class="task-list-item" style="list-style-type: none;"',G=G.replace(/^[ \t]*\[(x|X| )?]/m,function(){var Te='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return Z&&(Te+=" checked"),Te+=">",Te})),G=G.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,function(Te){return"¨A"+Te}),$||G.search(/\n{2,}/)>-1?(G=r.subParser("githubCodeBlocks")(G,g,h),G=r.subParser("blockGamut")(G,g,h)):(G=r.subParser("lists")(G,g,h),G=G.replace(/\n$/,""),G=r.subParser("hashHTMLBlocks")(G,g,h),G=G.replace(/\n\n+/g,`
199
+
200
+ `),D?G=r.subParser("paragraphs")(G,g,h):G=r.subParser("spanGamut")(G,g,h)),G=G.replace("¨A",""),G="<li"+he+">"+G+`</li>
201
+ `,G}),C=C.replace(/¨0/g,""),h.gListLevel--,M&&(C=C.replace(/\s+$/,"")),C}function v(C,M){if(M==="ol"){var P=C.match(/^ *(\d+)\./);if(P&&P[1]!=="1")return' start="'+P[1]+'"'}return""}function S(C,M,P){var D=g.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,F=g.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,$=M==="ul"?D:F,T="";if(C.search($)!==-1)(function U(q){var Z=q.search($),G=v(C,M);Z!==-1?(T+=`
202
+
203
+ <`+M+G+`>
204
+ `+w(q.slice(0,Z),!!P)+"</"+M+`>
205
+ `,M=M==="ul"?"ol":"ul",$=M==="ul"?D:F,U(q.slice(Z))):T+=`
206
+
207
+ <`+M+G+`>
208
+ `+w(q,!!P)+"</"+M+`>
209
+ `})(C);else{var I=v(C,M);T=`
210
+
211
+ <`+M+I+`>
212
+ `+w(C,!!P)+"</"+M+`>
213
+ `}return T}return d=h.converter._dispatch("lists.before",d,g,h),d+="¨0",h.gListLevel?d=d.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(C,M,P){var D=P.search(/[*+-]/g)>-1?"ul":"ol";return S(M,D,!0)}):d=d.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(C,M,P,D){var F=D.search(/[*+-]/g)>-1?"ul":"ol";return S(P,F,!1)}),d=d.replace(/¨0/,""),d=h.converter._dispatch("lists.after",d,g,h),d}),r.subParser("metadata",function(d,g,h){if(!g.metadata)return d;d=h.converter._dispatch("metadata.before",d,g,h);function w(v){h.metadata.raw=v,v=v.replace(/&/g,"&amp;").replace(/"/g,"&quot;"),v=v.replace(/\n {4}/g," "),v.replace(/^([\S ]+): +([\s\S]+?)$/gm,function(S,C,M){return h.metadata.parsed[C]=M,""})}return d=d.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(v,S,C){return w(C),"¨M"}),d=d.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(v,S,C){return S&&(h.metadata.format=S),w(C),"¨M"}),d=d.replace(/¨M/g,""),d=h.converter._dispatch("metadata.after",d,g,h),d}),r.subParser("outdent",function(d,g,h){return d=h.converter._dispatch("outdent.before",d,g,h),d=d.replace(/^(\t|[ ]{1,4})/gm,"¨0"),d=d.replace(/¨0/g,""),d=h.converter._dispatch("outdent.after",d,g,h),d}),r.subParser("paragraphs",function(d,g,h){d=h.converter._dispatch("paragraphs.before",d,g,h),d=d.replace(/^\n+/g,""),d=d.replace(/\n+$/g,"");for(var w=d.split(/\n{2,}/g),v=[],S=w.length,C=0;C<S;C++){var M=w[C];M.search(/¨(K|G)(\d+)\1/g)>=0?v.push(M):M.search(/\S/)>=0&&(M=r.subParser("spanGamut")(M,g,h),M=M.replace(/^([ \t]*)/g,"<p>"),M+="</p>",v.push(M))}for(S=v.length,C=0;C<S;C++){for(var P="",D=v[C],F=!1;/¨(K|G)(\d+)\1/.test(D);){var $=RegExp.$1,T=RegExp.$2;$==="K"?P=h.gHtmlBlocks[T]:F?P=r.subParser("encodeCode")(h.ghCodeBlocks[T].text,g,h):P=h.ghCodeBlocks[T].codeblock,P=P.replace(/\$/g,"$$$$"),D=D.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,P),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(D)&&(F=!0)}v[C]=D}return d=v.join(`
214
+ `),d=d.replace(/^\n+/g,""),d=d.replace(/\n+$/g,""),h.converter._dispatch("paragraphs.after",d,g,h)}),r.subParser("runExtension",function(d,g,h,w){if(d.filter)g=d.filter(g,w.converter,h);else if(d.regex){var v=d.regex;v instanceof RegExp||(v=new RegExp(v,"g")),g=g.replace(v,d.replace)}return g}),r.subParser("spanGamut",function(d,g,h){return d=h.converter._dispatch("spanGamut.before",d,g,h),d=r.subParser("codeSpans")(d,g,h),d=r.subParser("escapeSpecialCharsWithinTagAttributes")(d,g,h),d=r.subParser("encodeBackslashEscapes")(d,g,h),d=r.subParser("images")(d,g,h),d=r.subParser("anchors")(d,g,h),d=r.subParser("autoLinks")(d,g,h),d=r.subParser("simplifiedAutoLinks")(d,g,h),d=r.subParser("emoji")(d,g,h),d=r.subParser("underline")(d,g,h),d=r.subParser("italicsAndBold")(d,g,h),d=r.subParser("strikethrough")(d,g,h),d=r.subParser("ellipsis")(d,g,h),d=r.subParser("hashHTMLSpans")(d,g,h),d=r.subParser("encodeAmpsAndAngles")(d,g,h),g.simpleLineBreaks?/\n\n¨K/.test(d)||(d=d.replace(/\n+/g,`<br />
215
+ `)):d=d.replace(/ +\n/g,`<br />
216
+ `),d=h.converter._dispatch("spanGamut.after",d,g,h),d}),r.subParser("strikethrough",function(d,g,h){function w(v){return g.simplifiedAutoLink&&(v=r.subParser("simplifiedAutoLinks")(v,g,h)),"<del>"+v+"</del>"}return g.strikethrough&&(d=h.converter._dispatch("strikethrough.before",d,g,h),d=d.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(v,S){return w(S)}),d=h.converter._dispatch("strikethrough.after",d,g,h)),d}),r.subParser("stripLinkDefinitions",function(d,g,h){var w=/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,v=/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;d+="¨0";var S=function(C,M,P,D,F,$,T){return M=M.toLowerCase(),d.toLowerCase().split(M).length-1<2?C:(P.match(/^data:.+?\/.+?;base64,/)?h.gUrls[M]=P.replace(/\s/g,""):h.gUrls[M]=r.subParser("encodeAmpsAndAngles")(P,g,h),$?$+T:(T&&(h.gTitles[M]=T.replace(/"|'/g,"&quot;")),g.parseImgDimensions&&D&&F&&(h.gDimensions[M]={width:D,height:F}),""))};return d=d.replace(v,S),d=d.replace(w,S),d=d.replace(/¨0/,""),d}),r.subParser("tables",function(d,g,h){if(!g.tables)return d;var w=/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,v=/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;function S(F){return/^:[ \t]*--*$/.test(F)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(F)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(F)?' style="text-align:center;"':""}function C(F,$){var T="";return F=F.trim(),(g.tablesHeaderId||g.tableHeaderId)&&(T=' id="'+F.replace(/ /g,"_").toLowerCase()+'"'),F=r.subParser("spanGamut")(F,g,h),"<th"+T+$+">"+F+`</th>
217
+ `}function M(F,$){var T=r.subParser("spanGamut")(F,g,h);return"<td"+$+">"+T+`</td>
218
+ `}function P(F,$){for(var T=`<table>
219
+ <thead>
220
+ <tr>
221
+ `,I=F.length,U=0;U<I;++U)T+=F[U];for(T+=`</tr>
222
+ </thead>
223
+ <tbody>
224
+ `,U=0;U<$.length;++U){T+=`<tr>
225
+ `;for(var q=0;q<I;++q)T+=$[U][q];T+=`</tr>
226
+ `}return T+=`</tbody>
227
+ </table>
228
+ `,T}function D(F){var $,T=F.split(`
229
+ `);for($=0;$<T.length;++$)/^ {0,3}\|/.test(T[$])&&(T[$]=T[$].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(T[$])&&(T[$]=T[$].replace(/\|[ \t]*$/,"")),T[$]=r.subParser("codeSpans")(T[$],g,h);var I=T[0].split("|").map(function(fe){return fe.trim()}),U=T[1].split("|").map(function(fe){return fe.trim()}),q=[],Z=[],G=[],he=[];for(T.shift(),T.shift(),$=0;$<T.length;++$)T[$].trim()!==""&&q.push(T[$].split("|").map(function(fe){return fe.trim()}));if(I.length<U.length)return F;for($=0;$<U.length;++$)G.push(S(U[$]));for($=0;$<I.length;++$)r.helper.isUndefined(G[$])&&(G[$]=""),Z.push(C(I[$],G[$]));for($=0;$<q.length;++$){for(var Te=[],Oe=0;Oe<Z.length;++Oe)r.helper.isUndefined(q[$][Oe]),Te.push(M(q[$][Oe],G[Oe]));he.push(Te)}return P(Z,he)}return d=h.converter._dispatch("tables.before",d,g,h),d=d.replace(/\\(\|)/g,r.helper.escapeCharactersCallback),d=d.replace(w,D),d=d.replace(v,D),d=h.converter._dispatch("tables.after",d,g,h),d}),r.subParser("underline",function(d,g,h){return g.underline&&(d=h.converter._dispatch("underline.before",d,g,h),g.literalMidWordUnderscores?(d=d.replace(/\b___(\S[\s\S]*?)___\b/g,function(w,v){return"<u>"+v+"</u>"}),d=d.replace(/\b__(\S[\s\S]*?)__\b/g,function(w,v){return"<u>"+v+"</u>"})):(d=d.replace(/___(\S[\s\S]*?)___/g,function(w,v){return/\S$/.test(v)?"<u>"+v+"</u>":w}),d=d.replace(/__(\S[\s\S]*?)__/g,function(w,v){return/\S$/.test(v)?"<u>"+v+"</u>":w})),d=d.replace(/(_)/g,r.helper.escapeCharactersCallback),d=h.converter._dispatch("underline.after",d,g,h)),d}),r.subParser("unescapeSpecialChars",function(d,g,h){return d=h.converter._dispatch("unescapeSpecialChars.before",d,g,h),d=d.replace(/¨E(\d+)E/g,function(w,v){var S=parseInt(v);return String.fromCharCode(S)}),d=h.converter._dispatch("unescapeSpecialChars.after",d,g,h),d}),r.subParser("makeMarkdown.blockquote",function(d,g){var h="";if(d.hasChildNodes())for(var w=d.childNodes,v=w.length,S=0;S<v;++S){var C=r.subParser("makeMarkdown.node")(w[S],g);C!==""&&(h+=C)}return h=h.trim(),h="> "+h.split(`
230
+ `).join(`
231
+ > `),h}),r.subParser("makeMarkdown.codeBlock",function(d,g){var h=d.getAttribute("language"),w=d.getAttribute("precodenum");return"```"+h+`
232
+ `+g.preList[w]+"\n```"}),r.subParser("makeMarkdown.codeSpan",function(d){return"`"+d.innerHTML+"`"}),r.subParser("makeMarkdown.emphasis",function(d,g){var h="";if(d.hasChildNodes()){h+="*";for(var w=d.childNodes,v=w.length,S=0;S<v;++S)h+=r.subParser("makeMarkdown.node")(w[S],g);h+="*"}return h}),r.subParser("makeMarkdown.header",function(d,g,h){var w=new Array(h+1).join("#"),v="";if(d.hasChildNodes()){v=w+" ";for(var S=d.childNodes,C=S.length,M=0;M<C;++M)v+=r.subParser("makeMarkdown.node")(S[M],g)}return v}),r.subParser("makeMarkdown.hr",function(){return"---"}),r.subParser("makeMarkdown.image",function(d){var g="";return d.hasAttribute("src")&&(g+="!["+d.getAttribute("alt")+"](",g+="<"+d.getAttribute("src")+">",d.hasAttribute("width")&&d.hasAttribute("height")&&(g+=" ="+d.getAttribute("width")+"x"+d.getAttribute("height")),d.hasAttribute("title")&&(g+=' "'+d.getAttribute("title")+'"'),g+=")"),g}),r.subParser("makeMarkdown.links",function(d,g){var h="";if(d.hasChildNodes()&&d.hasAttribute("href")){var w=d.childNodes,v=w.length;h="[";for(var S=0;S<v;++S)h+=r.subParser("makeMarkdown.node")(w[S],g);h+="](",h+="<"+d.getAttribute("href")+">",d.hasAttribute("title")&&(h+=' "'+d.getAttribute("title")+'"'),h+=")"}return h}),r.subParser("makeMarkdown.list",function(d,g,h){var w="";if(!d.hasChildNodes())return"";for(var v=d.childNodes,S=v.length,C=d.getAttribute("start")||1,M=0;M<S;++M)if(!(typeof v[M].tagName>"u"||v[M].tagName.toLowerCase()!=="li")){var P="";h==="ol"?P=C.toString()+". ":P="- ",w+=P+r.subParser("makeMarkdown.listItem")(v[M],g),++C}return w+=`
233
+ <!-- -->
234
+ `,w.trim()}),r.subParser("makeMarkdown.listItem",function(d,g){for(var h="",w=d.childNodes,v=w.length,S=0;S<v;++S)h+=r.subParser("makeMarkdown.node")(w[S],g);return/\n$/.test(h)?h=h.split(`
235
+ `).join(`
236
+ `).replace(/^ {4}$/gm,"").replace(/\n\n+/g,`
237
+
238
+ `):h+=`
239
+ `,h}),r.subParser("makeMarkdown.node",function(d,g,h){h=h||!1;var w="";if(d.nodeType===3)return r.subParser("makeMarkdown.txt")(d,g);if(d.nodeType===8)return"<!--"+d.data+`-->
240
+
241
+ `;if(d.nodeType!==1)return"";var v=d.tagName.toLowerCase();switch(v){case"h1":h||(w=r.subParser("makeMarkdown.header")(d,g,1)+`
242
+
243
+ `);break;case"h2":h||(w=r.subParser("makeMarkdown.header")(d,g,2)+`
244
+
245
+ `);break;case"h3":h||(w=r.subParser("makeMarkdown.header")(d,g,3)+`
246
+
247
+ `);break;case"h4":h||(w=r.subParser("makeMarkdown.header")(d,g,4)+`
248
+
249
+ `);break;case"h5":h||(w=r.subParser("makeMarkdown.header")(d,g,5)+`
250
+
251
+ `);break;case"h6":h||(w=r.subParser("makeMarkdown.header")(d,g,6)+`
252
+
253
+ `);break;case"p":h||(w=r.subParser("makeMarkdown.paragraph")(d,g)+`
254
+
255
+ `);break;case"blockquote":h||(w=r.subParser("makeMarkdown.blockquote")(d,g)+`
256
+
257
+ `);break;case"hr":h||(w=r.subParser("makeMarkdown.hr")(d,g)+`
258
+
259
+ `);break;case"ol":h||(w=r.subParser("makeMarkdown.list")(d,g,"ol")+`
260
+
261
+ `);break;case"ul":h||(w=r.subParser("makeMarkdown.list")(d,g,"ul")+`
262
+
263
+ `);break;case"precode":h||(w=r.subParser("makeMarkdown.codeBlock")(d,g)+`
264
+
265
+ `);break;case"pre":h||(w=r.subParser("makeMarkdown.pre")(d,g)+`
266
+
267
+ `);break;case"table":h||(w=r.subParser("makeMarkdown.table")(d,g)+`
268
+
269
+ `);break;case"code":w=r.subParser("makeMarkdown.codeSpan")(d,g);break;case"em":case"i":w=r.subParser("makeMarkdown.emphasis")(d,g);break;case"strong":case"b":w=r.subParser("makeMarkdown.strong")(d,g);break;case"del":w=r.subParser("makeMarkdown.strikethrough")(d,g);break;case"a":w=r.subParser("makeMarkdown.links")(d,g);break;case"img":w=r.subParser("makeMarkdown.image")(d,g);break;default:w=d.outerHTML+`
270
+
271
+ `}return w}),r.subParser("makeMarkdown.paragraph",function(d,g){var h="";if(d.hasChildNodes())for(var w=d.childNodes,v=w.length,S=0;S<v;++S)h+=r.subParser("makeMarkdown.node")(w[S],g);return h=h.trim(),h}),r.subParser("makeMarkdown.pre",function(d,g){var h=d.getAttribute("prenum");return"<pre>"+g.preList[h]+"</pre>"}),r.subParser("makeMarkdown.strikethrough",function(d,g){var h="";if(d.hasChildNodes()){h+="~~";for(var w=d.childNodes,v=w.length,S=0;S<v;++S)h+=r.subParser("makeMarkdown.node")(w[S],g);h+="~~"}return h}),r.subParser("makeMarkdown.strong",function(d,g){var h="";if(d.hasChildNodes()){h+="**";for(var w=d.childNodes,v=w.length,S=0;S<v;++S)h+=r.subParser("makeMarkdown.node")(w[S],g);h+="**"}return h}),r.subParser("makeMarkdown.table",function(d,g){var h="",w=[[],[]],v=d.querySelectorAll("thead>tr>th"),S=d.querySelectorAll("tbody>tr"),C,M;for(C=0;C<v.length;++C){var P=r.subParser("makeMarkdown.tableCell")(v[C],g),D="---";if(v[C].hasAttribute("style")){var F=v[C].getAttribute("style").toLowerCase().replace(/\s/g,"");switch(F){case"text-align:left;":D=":---";break;case"text-align:right;":D="---:";break;case"text-align:center;":D=":---:";break}}w[0][C]=P.trim(),w[1][C]=D}for(C=0;C<S.length;++C){var $=w.push([])-1,T=S[C].getElementsByTagName("td");for(M=0;M<v.length;++M){var I=" ";typeof T[M]<"u"&&(I=r.subParser("makeMarkdown.tableCell")(T[M],g)),w[$].push(I)}}var U=3;for(C=0;C<w.length;++C)for(M=0;M<w[C].length;++M){var q=w[C][M].length;q>U&&(U=q)}for(C=0;C<w.length;++C){for(M=0;M<w[C].length;++M)C===1?w[C][M].slice(-1)===":"?w[C][M]=r.helper.padEnd(w[C][M].slice(-1),U-1,"-")+":":w[C][M]=r.helper.padEnd(w[C][M],U,"-"):w[C][M]=r.helper.padEnd(w[C][M],U);h+="| "+w[C].join(" | ")+` |
272
+ `}return h.trim()}),r.subParser("makeMarkdown.tableCell",function(d,g){var h="";if(!d.hasChildNodes())return"";for(var w=d.childNodes,v=w.length,S=0;S<v;++S)h+=r.subParser("makeMarkdown.node")(w[S],g,!0);return h.trim()}),r.subParser("makeMarkdown.txt",function(d){var g=d.nodeValue;return g=g.replace(/ +/g," "),g=g.replace(/¨NBSP;/g," "),g=r.helper.unescapeHTMLEntities(g),g=g.replace(/([*_~|`])/g,"\\$1"),g=g.replace(/^(\s*)>/g,"\\$1>"),g=g.replace(/^#/gm,"\\#"),g=g.replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3"),g=g.replace(/^( {0,3}\d+)\./gm,"$1\\."),g=g.replace(/^( {0,3})([+-])/gm,"$1\\$2"),g=g.replace(/]([\s]*)\(/g,"\\]$1\\("),g=g.replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:"),g});var A=this;t.exports?t.exports=r:A.showdown=r}).call(ZA)}(ca)),ca.exports}var tO=eO();const nO=QA(tO);function rO(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}return t}function cu(t,e){return Array(e+1).join(t)}function oO(t){return t.replace(/^\n*/,"")}function iO(t){for(var e=t.length;e>0&&t[e-1]===`
273
+ `;)e--;return t.substring(0,e)}var sO=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function uu(t){return du(t,sO)}var O0=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function M0(t){return du(t,O0)}function aO(t){return L0(t,O0)}var x0=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function lO(t){return du(t,x0)}function cO(t){return L0(t,x0)}function du(t,e){return e.indexOf(t.nodeName)>=0}function L0(t,e){return t.getElementsByTagName&&e.some(function(n){return t.getElementsByTagName(n).length})}var rt={};rt.paragraph={filter:"p",replacement:function(t){return`
274
+
275
+ `+t+`
276
+
277
+ `}},rt.lineBreak={filter:"br",replacement:function(t,e,n){return n.br+`
278
+ `}},rt.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(t,e,n){var r=Number(e.nodeName.charAt(1));if(n.headingStyle==="setext"&&r<3){var o=cu(r===1?"=":"-",t.length);return`
279
+
280
+ `+t+`
281
+ `+o+`
282
+
283
+ `}else return`
284
+
285
+ `+cu("#",r)+" "+t+`
286
+
287
+ `}},rt.blockquote={filter:"blockquote",replacement:function(t){return t=t.replace(/^\n+|\n+$/g,""),t=t.replace(/^/gm,"> "),`
288
+
289
+ `+t+`
290
+
291
+ `}},rt.list={filter:["ul","ol"],replacement:function(t,e){var n=e.parentNode;return n.nodeName==="LI"&&n.lastElementChild===e?`
292
+ `+t:`
293
+
294
+ `+t+`
295
+
296
+ `}},rt.listItem={filter:"li",replacement:function(t,e,n){t=t.replace(/^\n+/,"").replace(/\n+$/,`
297
+ `).replace(/\n/gm,`
298
+ `);var r=n.bulletListMarker+" ",o=e.parentNode;if(o.nodeName==="OL"){var i=o.getAttribute("start"),s=Array.prototype.indexOf.call(o.children,e);r=(i?Number(i)+s:s+1)+". "}return r+t+(e.nextSibling&&!/\n$/.test(t)?`
299
+ `:"")}},rt.indentedCodeBlock={filter:function(t,e){return e.codeBlockStyle==="indented"&&t.nodeName==="PRE"&&t.firstChild&&t.firstChild.nodeName==="CODE"},replacement:function(t,e,n){return`
300
+
301
+ `+e.firstChild.textContent.replace(/\n/g,`
302
+ `)+`
303
+
304
+ `}},rt.fencedCodeBlock={filter:function(t,e){return e.codeBlockStyle==="fenced"&&t.nodeName==="PRE"&&t.firstChild&&t.firstChild.nodeName==="CODE"},replacement:function(t,e,n){for(var r=e.firstChild.getAttribute("class")||"",o=(r.match(/language-(\S+)/)||[null,""])[1],i=e.firstChild.textContent,s=n.fence.charAt(0),a=3,l=new RegExp("^"+s+"{3,}","gm"),c;c=l.exec(i);)c[0].length>=a&&(a=c[0].length+1);var u=cu(s,a);return`
305
+
306
+ `+u+o+`
307
+ `+i.replace(/\n$/,"")+`
308
+ `+u+`
309
+
310
+ `}},rt.horizontalRule={filter:"hr",replacement:function(t,e,n){return`
311
+
312
+ `+n.hr+`
313
+
314
+ `}},rt.inlineLink={filter:function(t,e){return e.linkStyle==="inlined"&&t.nodeName==="A"&&t.getAttribute("href")},replacement:function(t,e){var n=e.getAttribute("href");n&&(n=n.replace(/([()])/g,"\\$1"));var r=ua(e.getAttribute("title"));return r&&(r=' "'+r.replace(/"/g,'\\"')+'"'),"["+t+"]("+n+r+")"}},rt.referenceLink={filter:function(t,e){return e.linkStyle==="referenced"&&t.nodeName==="A"&&t.getAttribute("href")},replacement:function(t,e,n){var r=e.getAttribute("href"),o=ua(e.getAttribute("title"));o&&(o=' "'+o+'"');var i,s;switch(n.linkReferenceStyle){case"collapsed":i="["+t+"][]",s="["+t+"]: "+r+o;break;case"shortcut":i="["+t+"]",s="["+t+"]: "+r+o;break;default:var a=this.references.length+1;i="["+t+"]["+a+"]",s="["+a+"]: "+r+o}return this.references.push(s),i},references:[],append:function(t){var e="";return this.references.length&&(e=`
315
+
316
+ `+this.references.join(`
317
+ `)+`
318
+
319
+ `,this.references=[]),e}},rt.emphasis={filter:["em","i"],replacement:function(t,e,n){return t.trim()?n.emDelimiter+t+n.emDelimiter:""}},rt.strong={filter:["strong","b"],replacement:function(t,e,n){return t.trim()?n.strongDelimiter+t+n.strongDelimiter:""}},rt.code={filter:function(t){var e=t.previousSibling||t.nextSibling,n=t.parentNode.nodeName==="PRE"&&!e;return t.nodeName==="CODE"&&!n},replacement:function(t){if(!t)return"";t=t.replace(/\r?\n|\r/g," ");for(var e=/^`|^ .*?[^ ].* $|`$/.test(t)?" ":"",n="`",r=t.match(/`+/gm)||[];r.indexOf(n)!==-1;)n=n+"`";return n+e+t+e+n}},rt.image={filter:"img",replacement:function(t,e){var n=ua(e.getAttribute("alt")),r=e.getAttribute("src")||"",o=ua(e.getAttribute("title")),i=o?' "'+o+'"':"";return r?"!["+n+"]("+r+i+")":""}};function ua(t){return t?t.replace(/(\n+\s*)+/g,`
320
+ `):""}function R0(t){this.options=t,this._keep=[],this._remove=[],this.blankRule={replacement:t.blankReplacement},this.keepReplacement=t.keepReplacement,this.defaultRule={replacement:t.defaultReplacement},this.array=[];for(var e in t.rules)this.array.push(t.rules[e])}R0.prototype={add:function(t,e){this.array.unshift(e)},keep:function(t){this._keep.unshift({filter:t,replacement:this.keepReplacement})},remove:function(t){this._remove.unshift({filter:t,replacement:function(){return""}})},forNode:function(t){if(t.isBlank)return this.blankRule;var e;return(e=fu(this.array,t,this.options))||(e=fu(this._keep,t,this.options))||(e=fu(this._remove,t,this.options))?e:this.defaultRule},forEach:function(t){for(var e=0;e<this.array.length;e++)t(this.array[e],e)}};function fu(t,e,n){for(var r=0;r<t.length;r++){var o=t[r];if(uO(o,e,n))return o}}function uO(t,e,n){var r=t.filter;if(typeof r=="string"){if(r===e.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(r.indexOf(e.nodeName.toLowerCase())>-1)return!0}else if(typeof r=="function"){if(r.call(t,e,n))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function dO(t){var e=t.element,n=t.isBlock,r=t.isVoid,o=t.isPre||function(f){return f.nodeName==="PRE"};if(!(!e.firstChild||o(e))){for(var i=null,s=!1,a=null,l=P0(a,e,o);l!==e;){if(l.nodeType===3||l.nodeType===4){var c=l.data.replace(/[ \r\n\t]+/g," ");if((!i||/ $/.test(i.data))&&!s&&c[0]===" "&&(c=c.substr(1)),!c){l=pu(l);continue}l.data=c,i=l}else if(l.nodeType===1)n(l)||l.nodeName==="BR"?(i&&(i.data=i.data.replace(/ $/,"")),i=null,s=!1):r(l)||o(l)?(i=null,s=!0):i&&(s=!1);else{l=pu(l);continue}var u=P0(a,l,o);a=l,l=u}i&&(i.data=i.data.replace(/ $/,""),i.data||pu(i))}}function pu(t){var e=t.nextSibling||t.parentNode;return t.parentNode.removeChild(t),e}function P0(t,e,n){return t&&t.parentNode===e||n(e)?e.nextSibling||e.parentNode:e.firstChild||e.nextSibling||e.parentNode}var hu=typeof window<"u"?window:{};function fO(){var t=hu.DOMParser,e=!1;try{new t().parseFromString("","text/html")&&(e=!0)}catch{}return e}function pO(){var t=function(){};return hO()?t.prototype.parseFromString=function(e){var n=new window.ActiveXObject("htmlfile");return n.designMode="on",n.open(),n.write(e),n.close(),n}:t.prototype.parseFromString=function(e){var n=document.implementation.createHTMLDocument("");return n.open(),n.write(e),n.close(),n},t}function hO(){var t=!1;try{document.implementation.createHTMLDocument("").open()}catch{hu.ActiveXObject&&(t=!0)}return t}var mO=fO()?hu.DOMParser:pO();function gO(t,e){var n;if(typeof t=="string"){var r=bO().parseFromString('<x-turndown id="turndown-root">'+t+"</x-turndown>","text/html");n=r.getElementById("turndown-root")}else n=t.cloneNode(!0);return dO({element:n,isBlock:uu,isVoid:M0,isPre:e.preformattedCode?yO:null}),n}var mu;function bO(){return mu=mu||new mO,mu}function yO(t){return t.nodeName==="PRE"||t.nodeName==="CODE"}function wO(t,e){return t.isBlock=uu(t),t.isCode=t.nodeName==="CODE"||t.parentNode.isCode,t.isBlank=kO(t),t.flankingWhitespace=_O(t,e),t}function kO(t){return!M0(t)&&!lO(t)&&/^\s*$/i.test(t.textContent)&&!aO(t)&&!cO(t)}function _O(t,e){if(t.isBlock||e.preformattedCode&&t.isCode)return{leading:"",trailing:""};var n=EO(t.textContent);return n.leadingAscii&&I0("left",t,e)&&(n.leading=n.leadingNonAscii),n.trailingAscii&&I0("right",t,e)&&(n.trailing=n.trailingNonAscii),{leading:n.leading,trailing:n.trailing}}function EO(t){var e=t.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:e[1],leadingAscii:e[2],leadingNonAscii:e[3],trailing:e[4],trailingNonAscii:e[5],trailingAscii:e[6]}}function I0(t,e,n){var r,o,i;return t==="left"?(r=e.previousSibling,o=/ $/):(r=e.nextSibling,o=/^ /),r&&(r.nodeType===3?i=o.test(r.nodeValue):n.preformattedCode&&r.nodeName==="CODE"?i=!1:r.nodeType===1&&!uu(r)&&(i=o.test(r.textContent))),i}var vO=Array.prototype.reduce,CO=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function da(t){if(!(this instanceof da))return new da(t);var e={rules:rt,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(n,r){return r.isBlock?`
321
+
322
+ `:""},keepReplacement:function(n,r){return r.isBlock?`
323
+
324
+ `+r.outerHTML+`
325
+
326
+ `:r.outerHTML},defaultReplacement:function(n,r){return r.isBlock?`
327
+
328
+ `+n+`
329
+
330
+ `:n}};this.options=rO({},e,t),this.rules=new R0(this.options)}da.prototype={turndown:function(t){if(!NO(t))throw new TypeError(t+" is not a string, or an element/document/fragment node.");if(t==="")return"";var e=D0.call(this,new gO(t,this.options));return SO.call(this,e)},use:function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)this.use(t[e]);else if(typeof t=="function")t(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(t,e){return this.rules.add(t,e),this},keep:function(t){return this.rules.keep(t),this},remove:function(t){return this.rules.remove(t),this},escape:function(t){return CO.reduce(function(e,n){return e.replace(n[0],n[1])},t)}};function D0(t){var e=this;return vO.call(t.childNodes,function(n,r){r=new wO(r,e.options);var o="";return r.nodeType===3?o=r.isCode?r.nodeValue:e.escape(r.nodeValue):r.nodeType===1&&(o=TO.call(e,r)),B0(n,o)},"")}function SO(t){var e=this;return this.rules.forEach(function(n){typeof n.append=="function"&&(t=B0(t,n.append(e.options)))}),t.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function TO(t){var e=this.rules.forNode(t),n=D0.call(this,t),r=t.flankingWhitespace;return(r.leading||r.trailing)&&(n=n.trim()),r.leading+e.replacement(n,t,this.options)+r.trailing}function B0(t,e){var n=iO(t),r=oO(e),o=Math.max(t.length-n.length,e.length-r.length),i=`
331
+
332
+ `.substring(0,o);return n+i+r}function NO(t){return t!=null&&(typeof t=="string"||t.nodeType&&(t.nodeType===1||t.nodeType===9||t.nodeType===11))}const AO={class:"bg-white border border border-solid border-gray-200 rounded-xl"},OO={class:"flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent"},MO={__name:"vs-richtext-md",props:{modelValue:{type:String,default:()=>""},toolbar:{type:Array,default:()=>["bold","italic","text_align","blockquote","bullet_list","ordered_list"]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,o=new nO.Converter({tables:!0,strikethrough:!0,tasklists:!0,ghCodeBlocks:!0}),i=nh({content:'<p class="min-h-[1rem]"></p>',extensions:[_m,vm,rh,oh,ih,sh,ah,uh,ph,hh,mh,gh,vh,N0,Sh,Cm,Wh,Nh,Ch,Th,T0,Em,Kh,bm.configure({types:["heading","paragraph"]}),qh,gm.configure({HTMLAttributes:{class:"editor-content"},resizable:!0}),km,wm,ym,Uh.configure({HTMLAttributes:{class:"editor-link"},openOnClick:!1,autolink:!0})],editorProps:{handlePaste:S0}}),s=y.computed(()=>n.toolbar.map(l=>Hg[l]));y.onMounted(()=>{if(i.value&&n.modelValue){const l=o.makeHtml(n.modelValue);i.value.commands.setContent(l)}}),y.watch(i,l=>{l&&l.on("update",()=>{const c=l.getHTML(),f=new da().turndown(c);r("update:modelValue",f)})});const a=()=>{i.value&&!i.value.isFocused&&i.value.commands.focus()};return(l,c)=>(y.openBlock(),y.createElementBlock("div",AO,[y.createElementVNode("div",OO,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(s.value,u=>(y.openBlock(),y.createBlock(y.resolveDynamicComponent(u),{editor:y.unref(i)},null,8,["editor"]))),256))]),y.createElementVNode("div",{onClick:a,class:"relative w-full px-4 py-2 bg-white rounded-b-lg editor-content dark:bg-gray-800"},[y.createVNode(y.unref(th),{editor:y.unref(i),class:"relative w-full"},null,8,["editor"])])]))}},xO={},LO={},RO={paragraph:"Paragraph",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",createTable:"Create Table",addColumn:"Add Column",addRow:"Add Row",deleteColumn:"Delete Column",deleteRow:"Delete Row",deleteTable:"Delete Table",linkTitle:"Enter Link",create:"Create",cancel:"Cancel"},PO={paragraph:"Звичайний текст",heading1:"Заголовок 1",heading2:"Заголовок 2",heading3:"Заголовок 3",heading4:"Заголовок 4",heading5:"Заголовок 5",heading6:"Заголовок 6",createTable:"Створити таблицю",addColumn:"Додати колонку",addRow:"Додати рядок",deleteColumn:"Видалити колонку",deleteRow:"Видалити рядок",deleteTable:"Видалити таблицю",linkTitle:"Введіть посилання",create:"Створити",cancel:"Скасувати"},gu=x3({legacy:!1,locale:"uk",fallbackLocale:"en",messages:{en:{...xO,tiptap:RO},uk:{...LO,tiptap:PO}}});return{install:(t,e={})=>{if(e.i18nConfig){const n=e.i18nConfig,r=gu.global?.messages?.value||gu.messages;r&&n.global?.messages?.value&&Object.keys(r).forEach(o=>{n.global.mergeLocaleMessage?n.global.mergeLocaleMessage(o,r[o]):n.global.setLocaleMessage(o,r[o])})}else t.use(gu);t.component("vs-richtext",XA),t.component("vs-richtext-md",MO)}}});