Newer
Older
TelosDB / src / frontend / vendor / toast-ui / toastui-editor-bundle.iife.js
@楽曲作りまくりおじさん 楽曲作りまくりおじさん 16 hours ago 556 KB chore: アイコン・Toast UI vendor のコミット漏れを追加
var toastui=(function(ca){"use strict";function oe(r){this.content=r}oe.prototype={constructor:oe,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),a=n.content.slice();return i==-1?a.push(t||r,e):(a[i+1]=e,t&&(a[i]=t)),new oe(a)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new oe(t)},addToStart:function(r,e){return new oe([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new oe(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),a=n.find(r);return i.splice(a==-1?i.length:a,0,e,t),new oe(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=oe.from(r),r.size?new oe(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=oe.from(r),r.size?new oe(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=oe.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}},oe.from=function(r){if(r instanceof oe)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new oe(e)};function Ys(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),a=e.child(n);if(i==a){t+=i.nodeSize;continue}if(!i.sameMarkup(a))return t;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)t++;return t}if(i.content.size||a.content.size){let o=Ys(i.content,a.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function Qs(r,e,t,n){for(let i=r.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:t,b:n};let o=r.child(--i),s=e.child(--a),l=o.nodeSize;if(o==s){t-=l,n-=l;continue}if(!o.sameMarkup(s))return{a:t,b:n};if(o.isText&&o.text!=s.text){let u=0,c=Math.min(o.text.length,s.text.length);for(;u<c&&o.text[o.text.length-u-1]==s.text[s.text.length-u-1];)u++,t--,n--;return{a:t,b:n}}if(o.content.size||s.content.size){let u=Qs(o.content,s.content,t-1,n-1);if(u)return u}t-=l,n-=l}}class C{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,a){for(let o=0,s=0;s<t;o++){let l=this.content[o],u=s+l.nodeSize;if(u>e&&n(l,i+s,a||null,o)!==!1&&l.content.size){let c=s+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,t-c),n,i+c)}s=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let a="",o=!0;return this.nodesBetween(e,t,(s,l)=>{let u=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&n&&(o?o=!1:a+=n),a+=u},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new C(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let a=0,o=0;o<t;a++){let s=this.content[a],l=o+s.nodeSize;l>e&&((o<e||l>t)&&(s.isText?s=s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s=s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),i+=s.nodeSize),o=l}return new C(n,i)}cutByIndex(e,t){return e==t?C.empty:e==0&&t==this.content.length?this:new C(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),a=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new C(i,a)}addToStart(e){return new C([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new C(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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 t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return Ys(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Qs(this,e,t,n)}findIndex(e){if(e==0)return Fn(0,e);if(e==this.size)return Fn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=this.child(t),a=n+i.nodeSize;if(a>=e)return a==e?Fn(t+1,a):Fn(t,n);n=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return C.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new C(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return C.empty;let t,n=0;for(let i=0;i<e.length;i++){let a=e[i];n+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(t||(t=e.slice(0,i)),t[t.length-1]=a.withText(t[t.length-1].text+a.text)):t&&t.push(a)}return new C(t||e,n)}static from(e){if(!e)return C.empty;if(e instanceof C)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new C([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}C.empty=new C([],0);const fa={index:0,offset:0};function Fn(r,e){return fa.index=r,fa.offset=e,fa}function qn(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!qn(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!qn(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let z=class Js{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))t||(t=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!n&&a.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(a)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&qn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Js.none;if(e instanceof Js)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};z.none=[];class _n extends Error{}class S{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=el(this.content,e+this.openStart,t);return n&&new S(n,this.openStart,this.openEnd)}removeBetween(e,t){return new S(Zs(this.content,e+this.openStart,t+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,t){if(!t)return S.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new S(C.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.lastChild)i++;return new S(e,n,i)}}S.empty=new S(C.empty,0,0);function Zs(r,e,t){let{index:n,offset:i}=r.findIndex(e),a=r.maybeChild(n),{index:o,offset:s}=r.findIndex(t);if(i==e||a.isText){if(s!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,a.copy(Zs(a.content,e-i-1,t-i-1)))}function el(r,e,t,n){let{index:i,offset:a}=r.findIndex(e),o=r.maybeChild(i);if(a==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let s=el(o.content,e-a-1,t,o);return s&&r.replaceChild(i,o.copy(s))}function nv(r,e,t){if(t.openStart>r.depth)throw new _n("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new _n("Inconsistent open depths");return tl(r,e,t,0)}function tl(r,e,t,n){let i=r.index(n),a=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let o=tl(r,e,t,n+1);return a.copy(a.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let o=r.parent,s=o.content;return Gt(o,s.cut(0,r.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:o,end:s}=iv(t,r);return Gt(a,nl(r,o,s,e,n))}else return Gt(a,$n(r,e,n))}function rl(r,e){if(!e.type.compatibleContent(r.type))throw new _n("Cannot join "+e.type.name+" onto "+r.type.name)}function da(r,e,t){let n=r.node(t);return rl(n,e.node(t)),n}function jt(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function en(r,e,t,n){let i=(e||r).node(t),a=0,o=e?e.index(t):i.childCount;r&&(a=r.index(t),r.depth>t?a++:r.textOffset&&(jt(r.nodeAfter,n),a++));for(let s=a;s<o;s++)jt(i.child(s),n);e&&e.depth==t&&e.textOffset&&jt(e.nodeBefore,n)}function Gt(r,e){return r.type.checkContent(e),r.copy(e)}function nl(r,e,t,n,i){let a=r.depth>i&&da(r,e,i+1),o=n.depth>i&&da(t,n,i+1),s=[];return en(null,r,i,s),a&&o&&e.index(i)==t.index(i)?(rl(a,o),jt(Gt(a,nl(r,e,t,n,i+1)),s)):(a&&jt(Gt(a,$n(r,e,i+1)),s),en(e,t,i,s),o&&jt(Gt(o,$n(t,n,i+1)),s)),en(n,null,i,s),new C(s)}function $n(r,e,t){let n=[];if(en(null,r,t,n),r.depth>t){let i=da(r,e,t+1);jt(Gt(i,$n(r,e,t+1)),n)}return en(e,null,t,n),new C(n)}function iv(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let a=t-1;a>=0;a--)i=e.node(a).copy(C.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class tn{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.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,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let a=0;a<e;a++)i+=n.child(a).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return z.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let s=n;n=i,i=s}let a=n.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!i||!a[o].isInSet(i.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<n.length;a++)n[a].type.spec.inclusive===!1&&(!i||!n[a].isInSet(i.marks))&&(n=n[a--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new zn(this,e,n);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 t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,a=t;for(let o=e;;){let{index:s,offset:l}=o.content.findIndex(a),u=a-l;if(n.push(o,s,i+l),!u||(o=o.child(s),o.isText))break;a=u-1,i+=l+1}return new tn(t,n,a)}static resolveCached(e,t){let n=il.get(e);if(n)for(let a=0;a<n.elts.length;a++){let o=n.elts[a];if(o.pos==t)return o}else il.set(e,n=new av);let i=n.elts[n.i]=tn.resolve(e,t);return n.i=(n.i+1)%ov,i}}class av{constructor(){this.elts=[],this.i=0}}const ov=12,il=new WeakMap;class zn{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const sv=Object.create(null);let Et=class Xs{constructor(e,t,n,i=z.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||C.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,t,n,i=0){this.content.nodesBetween(e,t,n,i,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,t,n,i){return this.content.textBetween(e,t,n,i)}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,t,n){return this.type==e&&qn(this.attrs,t||e.defaultAttrs||sv)&&z.sameSet(this.marks,n||z.none)}copy(e=null){return e==this.content?this:new Xs(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Xs(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return S.empty;let i=this.resolve(e),a=this.resolve(t),o=n?0:i.sharedDepth(t),s=i.start(o),u=i.node(o).content.cut(i.pos-s,a.pos-s);return new S(u,i.depth-o,a.depth-o)}replace(e,t,n){return nv(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return tn.resolveCached(this,e)}resolveNoCache(e){return tn.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,a=>(n.isInSet(a.marks)&&(i=!0),!i)),i}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()+")"),al(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=C.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(n),o=a&&a.matchFragment(this.content,t);return o?o.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=z.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!z.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=C.fromJSON(e,t.content),a=e.nodeType(t.type).create(t.attrs,i,n);return a.type.checkAttrs(a.attrs),a}};Et.prototype.text=void 0;class Vn extends Et{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):al(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Vn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Vn(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function al(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class Kt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new lv(e,t);if(n.next==null)return Kt.empty;let i=ol(n);n.next&&n.err("Unexpected trailing text");let a=vv(pv(i));return mv(a,n),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let a=t;i&&a<n;a++)i=i.matchType(e.child(a).type);return i}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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];function a(o,s){let l=o.matchFragment(e,n);if(l&&(!t||l.validEnd))return C.from(s.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:c,next:f}=o.next[u];if(!(c.isText||c.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let d=a(f,s.concat(c));if(d)return d}}return null}return a(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),a=i.match;if(a.matchType(e)){let o=[];for(let s=i;s.type;s=s.via)o.push(s.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:s,next:l}=a.next[o];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in t)&&(!i.type||l.validEnd)&&(n.push({match:s.contentMatch,type:s,via:i}),t[s.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 t(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let a=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)a+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return a}).join(`
`)}}Kt.empty=new Kt(!0);class lv{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.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 ol(r){let e=[];do e.push(uv(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function uv(r){let e=[];do e.push(cv(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function cv(r){let e=hv(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=fv(r,e);else break;return e}function sl(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function fv(r,e){let t=sl(r),n=t;return r.eat(",")&&(r.next!="}"?n=sl(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function dv(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let a in t){let o=t[a];o.isInGroup(e)&&i.push(o)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function hv(r){if(r.eat("(")){let e=ol(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=dv(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function pv(r){let e=[[]];return i(a(r,0),t()),e;function t(){return e.push([])-1}function n(o,s,l){let u={term:l,to:s};return e[o].push(u),u}function i(o,s){o.forEach(l=>l.to=s)}function a(o,s){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(a(u,s)),[]);if(o.type=="seq")for(let l=0;;l++){let u=a(o.exprs[l],s);if(l==o.exprs.length-1)return u;i(u,s=t())}else if(o.type=="star"){let l=t();return n(s,l),i(a(o.expr,l),l),[n(l)]}else if(o.type=="plus"){let l=t();return i(a(o.expr,s),l),i(a(o.expr,l),l),[n(l)]}else{if(o.type=="opt")return[n(s)].concat(a(o.expr,s));if(o.type=="range"){let l=s;for(let u=0;u<o.min;u++){let c=t();i(a(o.expr,l),c),l=c}if(o.max==-1)i(a(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let c=t();n(l,c),i(a(o.expr,l),c),l=c}return[n(l)]}else{if(o.type=="name")return[n(s,void 0,o.value)];throw new Error("Unknown expr type")}}}}function ll(r,e){return e-r}function ul(r,e){let t=[];return n(e),t.sort(ll);function n(i){let a=r[i];if(a.length==1&&!a[0].term)return n(a[0].to);t.push(i);for(let o=0;o<a.length;o++){let{term:s,to:l}=a[o];!s&&t.indexOf(l)==-1&&n(l)}}}function vv(r){let e=Object.create(null);return t(ul(r,0));function t(n){let i=[];n.forEach(o=>{r[o].forEach(({term:s,to:l})=>{if(!s)return;let u;for(let c=0;c<i.length;c++)i[c][0]==s&&(u=i[c][1]);ul(r,l).forEach(c=>{u||i.push([s,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let a=e[n.join(",")]=new Kt(n.indexOf(r.length-1)>-1);for(let o=0;o<i.length;o++){let s=i[o][1].sort(ll);a.next.push({type:i[o][0],next:e[s.join(",")]||t(s)})}return a}}function mv(r,e){for(let t=0,n=[r];t<n.length;t++){let i=n[t],a=!i.validEnd,o=[];for(let s=0;s<i.next.length;s++){let{type:l,next:u}=i.next[s];o.push(l.name),a&&!(l.isText||l.hasRequiredAttrs())&&(a=!1),n.indexOf(u)==-1&&n.push(u)}a&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function cl(r){let e=Object.create(null);for(let t in r){let n=r[t];if(!n.hasDefault)return null;e[t]=n.default}return e}function fl(r,e){let t=Object.create(null);for(let n in r){let i=e&&e[n];if(i===void 0){let a=r[n];if(a.hasDefault)i=a.default;else throw new RangeError("No value supplied for attribute "+n)}t[n]=i}return t}function dl(r,e,t,n){for(let i in e)if(!(i in r))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in r){let a=r[i];a.validate&&a.validate(e[i])}}function hl(r,e){let t=Object.create(null);if(e)for(let n in e)t[n]=new yv(r,n,e[n]);return t}let pl=class rv{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=hl(e,n.attrs),this.defaultAttrs=cl(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Kt.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:fl(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Et(this,this.computeAttrs(e),C.from(t),z.setFrom(n))}createChecked(e=null,t,n){return t=C.from(t),this.checkContent(t),new Et(this,this.computeAttrs(e),t,z.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=C.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),a=i&&i.fillBefore(C.empty,!0);return a?new Et(this,e,t.append(a),z.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).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){dl(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 t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:z.none:e}static compile(e,t){let n=Object.create(null);e.forEach((a,o)=>n[a]=new rv(a,t,o));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let a in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function gv(r,e,t){let n=t.split("|");return i=>{let a=i===null?"null":typeof i;if(n.indexOf(a)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${r}, got ${a}`)}}class yv{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?gv(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Un{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=hl(e,i.attrs),this.excluded=null;let a=cl(this.attrs);this.instance=a?new z(this,a):null}create(e=null){return!e&&this.instance?this.instance:new z(this,fl(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((a,o)=>n[a]=new Un(a,i++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){dl(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class vl{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=oe.from(e.nodes),t.marks=oe.from(e.marks||{}),this.nodes=pl.compile(this.spec.nodes,this),this.marks=Un.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let a=this.nodes[i],o=a.spec.content||"",s=a.spec.marks;if(a.contentMatch=n[o]||(n[o]=Kt.parse(o,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=s=="_"?null:s?ml(this,s.split(" ")):s==""||!a.inlineContent?[]:null}for(let i in this.marks){let a=this.marks[i],o=a.spec.excludes;a.excluded=o==null?[a]:o==""?[]:ml(this,o.split(" "))}this.nodeFromJSON=i=>Et.fromJSON(this,i),this.markFromJSON=i=>z.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof pl){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(t,n,i)}text(e,t){let n=this.nodes.text;return new Vn(n,n.defaultAttrs,e,z.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function ml(r,e){let t=[];for(let n=0;n<e.length;n++){let i=e[n],a=r.marks[i],o=a;if(a)t.push(a);else for(let s in r.marks){let l=r.marks[s];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}function bv(r){return r.tag!=null}function wv(r){return r.style!=null}class Jt{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(i=>{if(bv(i))this.tags.push(i);else if(wv(i)){let a=/[^=]*/.exec(i.style)[0];n.indexOf(a)<0&&n.push(a),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let a=e.nodes[i.node];return a.contentMatch.matchType(a)})}parse(e,t={}){let n=new wl(this,t,!1);return n.addAll(e,z.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new wl(this,t,!0);return n.addAll(e,z.none,t.from,t.to),S.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let a=this.tags[i];if(Tv(e,a.tag)&&(a.namespace===void 0||e.namespaceURI==a.namespace)&&(!a.context||t.matchesContext(a.context))){if(a.getAttrs){let o=a.getAttrs(e);if(o===!1)continue;a.attrs=o||void 0}return a}}}matchStyle(e,t,n,i){for(let a=i?this.styles.indexOf(i)+1:0;a<this.styles.length;a++){let o=this.styles[a],s=o.style;if(!(s.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||s.length>e.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let a=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let s=t[o];if((s.priority==null?50:s.priority)<a)break}t.splice(o,0,i)}for(let i in e.marks){let a=e.marks[i].spec.parseDOM;a&&a.forEach(o=>{n(o=kl(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let a=e.nodes[i].spec.parseDOM;a&&a.forEach(o=>{n(o=kl(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Jt(e,Jt.schemaRules(e)))}}const gl={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},kv={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},yl={ol:!0,ul:!0},rn=1,ha=2,nn=4;function bl(r,e,t){return e!=null?(e?rn:0)|(e==="full"?ha:0):r&&r.whitespace=="pre"?rn|ha:t&~nn}class Wn{constructor(e,t,n,i,a,o){this.type=e,this.attrs=t,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=z.none,this.match=a||(o&nn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(C.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&rn)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let a=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let t=C.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(C.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!gl.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class wl{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=t.topNode,a,o=bl(null,t.preserveWhitespace,0)|(n?nn:0);i?a=new Wn(i.type,i.attrs,z.none,!0,t.topMatch||i.type.contentMatch,o):n?a=new Wn(null,null,z.none,!0,null,o):a=new Wn(e.schema.topNodeType,null,z.none,!0,null,o),this.nodes=[a],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,i=this.top,a=i.options&ha?"full":this.localPreserveWS||(i.options&rn)>0,{schema:o}=this.parser;if(a==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(a)if(a==="full")n=n.replace(/\r\n?/g,`
`);else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let s=n.split(/\r?\n|\r/);for(let l=0;l<s.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),t,!0),s[l]&&this.insertNode(o.text(s[l]),t,!/\S/.test(s[l]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],l=e.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let i=this.localPreserveWS,a=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),s;yl.hasOwnProperty(o)&&this.parser.normalizeLists&&Cv(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:kv.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);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 u,c=this.needsBlock;if(gl.hasOwnProperty(o))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),u=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let f=l&&l.skip?t:this.readStyles(e,t);f&&this.addAll(e,f),u&&this.sync(a),this.needsBlock=c}else{let u=this.readStyles(e,t);u&&this.addElementByRule(e,l,u,l.consuming===!1?s:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let a=this.parser.matchedStyles[i],o=n.getPropertyValue(a);if(o)for(let s=void 0;;){let l=this.parser.matchStyle(a,o,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?t=t.filter(u=>!l.clearMark(u)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return t}addElementByRule(e,t,n,i){let a,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(o,t.attrs||null,n,t.preserveWhitespace);l&&(a=!0,n=l)}else{let l=this.parser.schema.marks[t.mark];n=n.concat(l.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}a&&this.sync(s)&&this.open--}addAll(e,t,n,i){let a=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=i==null?null:e.childNodes[i];o!=s;o=o.nextSibling,++a)this.findAtPoint(e,a),this.addDOM(o,t);this.findAtPoint(e,a)}findPlace(e,t,n){let i,a;for(let o=this.open,s=0;o>=0;o--){let l=this.nodes[o],u=l.findWrapping(e);if(u&&(!i||i.length>u.length+s)&&(i=u,a=l,!u.length))break;if(l.solid){if(n)break;s+=2}}if(!i)return null;this.sync(a);for(let o=0;o<i.length;o++)t=this.enterInner(i[o],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(t=this.enterInner(a,null,t))}let i=this.findPlace(e,t,n);if(i){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(e.type));let o=z.none;for(let s of i.concat(e.marks))(a.type?a.type.allowsMarkType(s.type):Cl(s.type,e.type))&&(o=s.addToSet(o));return a.content.push(e.mark(o)),!0}return!1}enter(e,t,n,i){let a=this.findPlace(e.create(t),n,!1);return a&&(a=this.enterInner(e,t,n,!0,i)),a}enterInner(e,t,n,i=!1,a){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=bl(e,a,o.options);o.options&nn&&o.content.length==0&&(s|=nn);let l=z.none;return n=n.filter(u=>(o.type?o.type.allowsMarkType(u.type):Cl(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new Wn(e,t,l,i,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=rn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),a=-(n?n.depth+1:0)+(i?0:1),o=(s,l)=>{for(;s>=0;s--){let u=t[s];if(u==""){if(s==t.length-1||s==0)continue;for(;l>=a;l--)if(o(s-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:n&&l>=a?n.node(l-a).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}}function Cv(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&yl.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function Tv(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function kl(r){let e={};for(let t in r)e[t]=r[t];return e}function Cl(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let a=[],o=s=>{a.push(s);for(let l=0;l<s.edgeCount;l++){let{type:u,next:c}=s.edge(l);if(u==e||a.indexOf(c)<0&&o(c))return!0}};if(o(i.contentMatch))return!0}}class gr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=pa(t).createDocumentFragment());let i=n,a=[];return e.forEach(o=>{if(a.length||o.marks.length){let s=0,l=0;for(;s<a.length&&l<o.marks.length;){let u=o.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(a[s][0])||u.type.spec.spanning===!1)break;s++,l++}for(;s<a.length;)i=a.pop()[1];for(;l<o.marks.length;){let u=o.marks[l++],c=this.serializeMark(u,o.isInline,t);c&&(a.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:i}=jn(pa(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let a=this.serializeMark(e.marks[i],e.isInline,t);a&&((a.contentDOM||a.dom).appendChild(n),n=a.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&jn(pa(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return jn(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new gr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Tl(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return Tl(e.marks)}}function Tl(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function pa(r){return r.document||window.document}const xl=new WeakMap;function xv(r){let e=xl.get(r);return e===void 0&&xl.set(r,e=Ev(r)),e}function Ev(r){let e=null;function t(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)t(n[i]);else for(let i in n)t(n[i])}return t(r),e}function jn(r,e,t,n){if(typeof e=="string")return{dom:r.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],a;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(a=xv(n))&&a.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 o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let s,l=t?r.createElementNS(t,i):r.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let f in u)if(u[f]!=null){let d=f.indexOf(" ");d>0?l.setAttributeNS(f.slice(0,d),f.slice(d+1),u[f]):f=="style"&&l.style?l.style.cssText=u[f]:l.setAttribute(f,u[f])}}for(let f=c;f<e.length;f++){let d=e[f];if(d===0){if(f<e.length-1||f>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:p}=jn(r,d,t,n);if(l.appendChild(h),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:l,contentDOM:s}}const El=65535,Ml=Math.pow(2,16);function Mv(r,e){return r+e*Ml}function Sl(r){return r&El}function Sv(r){return(r-(r&El))/Ml}const Ol=1,Ll=2,Gn=4,Nl=8;class va{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Nl)>0}get deletedBefore(){return(this.delInfo&(Ol|Gn))>0}get deletedAfter(){return(this.delInfo&(Ll|Gn))>0}get deletedAcross(){return(this.delInfo&Gn)>0}}class Ne{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Ne.empty)return Ne.empty}recover(e){let t=0,n=Sl(e);if(!this.inverted)for(let i=0;i<n;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+t+Sv(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let i=0,a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[s+a],c=this.ranges[s+o],f=l+u;if(e<=f){let d=u?e==l?-1:e==f?1:t:t,h=l+i+(d<0?0:c);if(n)return h;let p=e==(t<0?l:f)?null:Mv(s/3,e-l),v=e==l?Ll:e==f?Ol:Gn;return(t<0?e!=l:e!=f)&&(v|=Nl),new va(h,v,p)}i+=c-u}return n?e+i:new va(e+i,0,null)}touches(e,t){let n=0,i=Sl(t),a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?n:0);if(l>e)break;let u=this.ranges[s+a],c=l+u;if(e<=c&&s==i*3)return!0;n+=this.ranges[s+o]-u}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,a=0;i<this.ranges.length;i+=3){let o=this.ranges[i],s=o-(this.inverted?a:0),l=o+(this.inverted?0:a),u=this.ranges[i+t],c=this.ranges[i+n];e(s,s+u,l,l+c),a+=c-u}}invert(){return new Ne(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Ne.empty:new Ne(e<0?[0,-e,0]:[0,0,e])}}Ne.empty=new Ne([]);class an{constructor(e,t,n=0,i=e?e.length:0){this.mirror=t,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new an(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?n+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new an;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let i=0;for(let a=this.from;a<this.to;a++){let o=this._maps[a],s=o.mapResult(e,t);if(s.recover!=null){let l=this.getMirror(a);if(l!=null&&l>a&&l<this.to){a=l,e=this._maps[l].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return n?e:new va(e,i,null)}}const ma=Object.create(null);class ve{getMap(){return Ne.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=ma[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in ma)throw new RangeError("Duplicate use of step JSON ID "+e);return ma[e]=t,t.prototype.jsonID=e,t}}class Y{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Y(e,null)}static fail(e){return new Y(null,e)}static fromReplace(e,t,n,i){try{return Y.ok(e.replace(t,n,i))}catch(a){if(a instanceof _n)return Y.fail(a.message);throw a}}}function ga(r,e,t){let n=[];for(let i=0;i<r.childCount;i++){let a=r.child(i);a.content.size&&(a=a.copy(ga(a.content,e,a))),a.isInline&&(a=e(a,t,i)),n.push(a)}return C.fromArray(n)}class Mt extends ve{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),a=new S(ga(t.content,(o,s)=>!o.isAtom||!s.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return Y.fromReplace(e,this.from,this.to,a)}invert(){return new Qe(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Mt(t.pos,n.pos,this.mark)}merge(e){return e instanceof Mt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Mt(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Mt(t.from,t.to,e.markFromJSON(t.mark))}}ve.jsonID("addMark",Mt);class Qe extends ve{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new S(ga(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Y.fromReplace(e,this.from,this.to,n)}invert(){return new Mt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Qe(t.pos,n.pos,this.mark)}merge(e){return e instanceof Qe&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Qe(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Qe(t.from,t.to,e.markFromJSON(t.mark))}}ve.jsonID("removeMark",Qe);class St extends ve{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Y.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Y.fromReplace(e,this.pos,this.pos+1,new S(C.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(n))return new St(this.pos,t.marks[i]);return new St(this.pos,this.mark)}}return new Xt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new St(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new St(t.pos,e.markFromJSON(t.mark))}}ve.jsonID("addNodeMark",St);class Xt extends ve{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Y.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Y.fromReplace(e,this.pos,this.pos+1,new S(C.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new St(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Xt(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Xt(t.pos,e.markFromJSON(t.mark))}}ve.jsonID("removeNodeMark",Xt);class me extends ve{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&ya(e,this.from,this.to)?Y.fail("Structure replace would overwrite content"):Y.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ne([this.from,this.to-this.from,this.slice.size])}invert(e){return new me(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new me(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof me)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?S.empty:new S(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new me(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?S.empty:new S(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new me(e.from,this.to,t,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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new me(t.from,t.to,S.fromJSON(e,t.slice),!!t.structure)}}ve.jsonID("replace",me);class re extends ve{constructor(e,t,n,i,a,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=a,this.insert=o,this.structure=s}apply(e){if(this.structure&&(ya(e,this.from,this.gapFrom)||ya(e,this.gapTo,this.to)))return Y.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Y.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Y.fromReplace(e,this.from,this.to,n):Y.fail("Content does not fit in gap")}getMap(){return new Ne([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new re(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),a=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||a>n.pos?null:new re(t.pos,n.pos,i,a,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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new re(t.from,t.to,t.gapFrom,t.gapTo,S.fromJSON(e,t.slice),t.insert,!!t.structure)}}ve.jsonID("replaceAround",re);function ya(r,e,t){let n=r.resolve(e),i=t-e,a=n.depth;for(;i>0&&a>0&&n.indexAfter(a)==n.node(a).childCount;)a--,i--;if(i>0){let o=n.node(a).maybeChild(n.indexAfter(a));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Ov(r,e,t,n){let i=[],a=[],o,s;r.doc.nodesBetween(e,t,(l,u,c)=>{if(!l.isInline)return;let f=l.marks;if(!n.isInSet(f)&&c.type.allowsMarkType(n.type)){let d=Math.max(u,e),h=Math.min(u+l.nodeSize,t),p=n.addToSet(f);for(let v=0;v<f.length;v++)f[v].isInSet(p)||(o&&o.to==d&&o.mark.eq(f[v])?o.to=h:i.push(o=new Qe(d,h,f[v])));s&&s.to==d?s.to=h:a.push(s=new Mt(d,h,n))}}),i.forEach(l=>r.step(l)),a.forEach(l=>r.step(l))}function Lv(r,e,t,n){let i=[],a=0;r.doc.nodesBetween(e,t,(o,s)=>{if(!o.isInline)return;a++;let l=null;if(n instanceof Un){let u=o.marks,c;for(;c=n.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length){let u=Math.min(s+o.nodeSize,t);for(let c=0;c<l.length;c++){let f=l[c],d;for(let h=0;h<i.length;h++){let p=i[h];p.step==a-1&&f.eq(i[h].style)&&(d=p)}d?(d.to=u,d.step=a):i.push({style:f,from:Math.max(s,e),to:u,step:a})}}}),i.forEach(o=>r.step(new Qe(o.from,o.to,o.style)))}function ba(r,e,t,n=t.contentMatch,i=!0){let a=r.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l<a.childCount;l++){let u=a.child(l),c=s+u.nodeSize,f=n.matchType(u.type);if(!f)o.push(new me(s,c,S.empty));else{n=f;for(let d=0;d<u.marks.length;d++)t.allowsMarkType(u.marks[d].type)||r.step(new Qe(s,c,u.marks[d]));if(i&&u.isText&&t.whitespace!="pre"){let d,h=/\r?\n|\r/g,p;for(;d=h.exec(u.text);)p||(p=new S(C.from(t.schema.text(" ",t.allowedMarks(u.marks))),0,0)),o.push(new me(s+d.index,s+d.index+d[0].length,p))}}s=c}if(!n.validEnd){let l=n.fillBefore(C.empty,!0);r.replace(s,s,new S(l,0,0))}for(let l=o.length-1;l>=0;l--)r.step(o[l])}function Nv(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function Kn(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth,i=0,a=0;;--n){let o=r.$from.node(n),s=r.$from.index(n)+i,l=r.$to.indexAfter(n)-a;if(n<r.depth&&o.canReplace(s,l,t))return n;if(n==0||o.type.spec.isolating||!Nv(o,s,l))break;s&&(i=1),l<o.childCount&&(a=1)}return null}function Av(r,e,t){let{$from:n,$to:i,depth:a}=e,o=n.before(a+1),s=i.after(a+1),l=o,u=s,c=C.empty,f=0;for(let p=a,v=!1;p>t;p--)v||n.index(p)>0?(v=!0,c=C.from(n.node(p).copy(c)),f++):l--;let d=C.empty,h=0;for(let p=a,v=!1;p>t;p--)v||i.after(p+1)<i.end(p)?(v=!0,d=C.from(i.node(p).copy(d)),h++):u++;r.step(new re(l,u,o,s,new S(c.append(d),f,h),c.size-f,!0))}function Dv(r,e,t=null,n=r){let i=Iv(r,e),a=i&&Rv(n,e);return a?i.map(Al).concat({type:e,attrs:t}).concat(a.map(Al)):null}function Al(r){return{type:r,attrs:null}}function Iv(r,e){let{parent:t,startIndex:n,endIndex:i}=r,a=t.contentMatchAt(n).findWrapping(e);if(!a)return null;let o=a.length?a[0]:e;return t.canReplaceWith(n,i,o)?a:null}function Rv(r,e){let{parent:t,startIndex:n,endIndex:i}=r,a=t.child(n),o=e.contentMatch.findWrapping(a.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let u=n;l&&u<i;u++)l=l.matchType(t.child(u).type);return!l||!l.validEnd?null:o}function Bv(r,e,t){let n=C.empty;for(let o=t.length-1;o>=0;o--){if(n.size){let s=t[o].type.contentMatch.matchFragment(n);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=C.from(t[o].type.create(t[o].attrs,n))}let i=e.start,a=e.end;r.step(new re(i,a,i,a,new S(n,0,0),t.length,!0))}function Pv(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=r.steps.length;r.doc.nodesBetween(e,t,(o,s)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,l)&&Hv(r.doc,r.mapping.slice(a).map(s),n)){let u=null;if(n.schema.linebreakReplacement){let h=n.whitespace=="pre",p=!!n.contentMatch.matchType(n.schema.linebreakReplacement);h&&!p?u=!1:!h&&p&&(u=!0)}u===!1&&Il(r,o,s,a),ba(r,r.mapping.slice(a).map(s,1),n,void 0,u===null);let c=r.mapping.slice(a),f=c.map(s,1),d=c.map(s+o.nodeSize,1);return r.step(new re(f,d,f+1,d-1,new S(C.from(n.create(l,null,o.marks)),0,0),1,!0)),u===!0&&Dl(r,o,s,a),!1}})}function Dl(r,e,t,n){e.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let l=r.mapping.slice(n).map(t+1+a+o.index);r.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Il(r,e,t,n){e.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let o=r.mapping.slice(n).map(t+1+a);r.replaceWith(o,o+1,e.type.schema.text(`
`))}})}function Hv(r,e,t){let n=r.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,t)}function Fv(r,e,t,n,i){let a=r.doc.nodeAt(e);if(!a)throw new RangeError("No node at given position");t||(t=a.type);let o=t.create(n,null,i||a.marks);if(a.isLeaf)return r.replaceWith(e,e+a.nodeSize,o);if(!t.validContent(a.content))throw new RangeError("Invalid content for node type "+t.name);r.step(new re(e,e+a.nodeSize,e+1,e+a.nodeSize-1,new S(C.from(o),0,0),1,!0))}function yr(r,e,t=1,n){let i=r.resolve(e),a=i.depth-t,o=n&&n[n.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=t-2;u>a;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(d,f.childCount),p=n&&n[c+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let v=n&&n[c]||f;if(!f.canReplace(d+1,f.childCount)||!v.type.validContent(h))return!1}let s=i.indexAfter(a),l=n&&n[0];return i.node(a).canReplaceWith(s,s,l?l.type:i.node(a+1).type)}function qv(r,e,t=1,n){let i=r.doc.resolve(e),a=C.empty,o=C.empty;for(let s=i.depth,l=i.depth-t,u=t-1;s>l;s--,u--){a=C.from(i.node(s).copy(a));let c=n&&n[u];o=C.from(c?c.type.create(c.attrs,o):i.node(s).copy(o))}r.step(new me(e,e,new S(a.append(o),t,t),!0))}function Rl(r,e){let t=r.resolve(e),n=t.index();return $v(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(n,n+1)}function _v(r,e){e.content.size||r.type.compatibleContent(e.type);let t=r.contentMatchAt(r.childCount),{linebreakReplacement:n}=r.type.schema;for(let i=0;i<e.childCount;i++){let a=e.child(i),o=a.type==n?r.type.schema.nodes.text:a.type;if(t=t.matchType(o),!t||!r.type.allowsMarks(a.marks))return!1}return t.validEnd}function $v(r,e){return!!(r&&e&&!r.isLeaf&&_v(r,e))}function zv(r,e,t){let n=null,{linebreakReplacement:i}=r.doc.type.schema,a=r.doc.resolve(e-t),o=a.node().type;if(i&&o.inlineContent){let c=o.whitespace=="pre",f=!!o.contentMatch.matchType(i);c&&!f?n=!1:!c&&f&&(n=!0)}let s=r.steps.length;if(n===!1){let c=r.doc.resolve(e+t);Il(r,c.node(),c.before(),s)}o.inlineContent&&ba(r,e+t-1,o,a.node().contentMatchAt(a.index()),n==null);let l=r.mapping.slice(s),u=l.map(e-t);if(r.step(new me(u,l.map(e+t,-1),S.empty,!0)),n===!0){let c=r.doc.resolve(u);Dl(r,c.node(),c.before(),r.steps.length)}return r}function Vv(r,e,t){let n=r.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),t))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let a=n.index(i);if(n.node(i).canReplaceWith(a,a,t))return n.before(i+1);if(a>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let a=n.indexAfter(i);if(n.node(i).canReplaceWith(a,a,t))return n.after(i+1);if(a<n.node(i).childCount)return null}return null}function Uv(r,e,t){let n=r.resolve(e);if(!t.content.size)return e;let i=t.content;for(let a=0;a<t.openStart;a++)i=i.firstChild.content;for(let a=1;a<=(t.openStart==0&&t.size?2:1);a++)for(let o=n.depth;o>=0;o--){let s=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,l=n.index(o)+(s>0?1:0),u=n.node(o),c=!1;if(a==1)c=u.canReplace(l,l,i);else{let f=u.contentMatchAt(l).findWrapping(i.firstChild.type);c=f&&u.canReplaceWith(l,l,f[0])}if(c)return s==0?n.pos:s<0?n.before(o+1):n.after(o+1)}return null}function wa(r,e,t=e,n=S.empty){if(e==t&&!n.size)return null;let i=r.resolve(e),a=r.resolve(t);return Bl(i,a,n)?new me(e,t,n):new Wv(i,a,n).fit()}function Bl(r,e,t){return!t.openStart&&!t.openEnd&&r.start()==e.start()&&r.parent.canReplace(r.index(),e.index(),t.content)}class Wv{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=C.empty;for(let i=0;i<=e.depth;i++){let a=e.node(i);this.frontier.push({type:a.type,match:a.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=C.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let a=this.placed,o=n.depth,s=i.depth;for(;o&&s&&a.childCount==1;)a=a.firstChild.content,o--,s--;let l=new S(a,o,s);return e>-1?new re(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new me(n.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<e;n++){let a=t.firstChild;if(t.childCount>1&&(i=0),a.type.spec.isolating&&i<=n){e=n;break}t=a.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let i,a=null;n?(a=ka(this.unplaced.content,n-1).firstChild,i=a.content):i=this.unplaced.content;let o=i.firstChild;for(let s=this.depth;s>=0;s--){let{type:l,match:u}=this.frontier[s],c,f=null;if(t==1&&(o?u.matchType(o.type)||(f=u.fillBefore(C.from(o),!1)):a&&l.compatibleContent(a.type)))return{sliceDepth:n,frontierDepth:s,parent:a,inject:f};if(t==2&&o&&(c=u.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:s,parent:a,wrap:c};if(a&&u.matchType(a.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=ka(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new S(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=ka(e,t);if(i.childCount<=1&&t>0){let a=e.size-t<=t+i.size;this.unplaced=new S(on(e,t-1,1),t-1,a?t-1:n)}else this.unplaced=new S(on(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:a}){for(;this.depth>t;)this.closeFrontierNode();if(a)for(let v=0;v<a.length;v++)this.openFrontierNode(a[v]);let o=this.unplaced,s=n?n.content:o.content,l=o.openStart-e,u=0,c=[],{match:f,type:d}=this.frontier[t];if(i){for(let v=0;v<i.childCount;v++)c.push(i.child(v));f=f.matchFragment(i)}let h=s.size+e-(o.content.size-o.openEnd);for(;u<s.childCount;){let v=s.child(u),m=f.matchType(v.type);if(!m)break;u++,(u>1||l==0||v.content.size)&&(f=m,c.push(Pl(v.mark(d.allowedMarks(v.marks)),u==1?l:0,u==s.childCount?h:-1)))}let p=u==s.childCount;p||(h=-1),this.placed=sn(this.placed,t,C.from(c)),this.frontier[t].match=f,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,m=s;v<h;v++){let g=m.lastChild;this.frontier.push({type:g.type,match:g.contentMatchAt(g.childCount)}),m=g.content}this.unplaced=p?e==0?S.empty:new S(on(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new S(on(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Ca(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],a=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=Ca(e,t,i,n,a);if(o){for(let s=t-1;s>=0;s--){let{match:l,type:u}=this.frontier[s],c=Ca(e,s,u,l,!0);if(!c||c.childCount)continue e}return{depth:t,fit:o,move:a?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=sn(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let i=e.node(n),a=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,a)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=sn(this.placed,this.depth,C.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(C.empty,!0);t.childCount&&(this.placed=sn(this.placed,this.frontier.length,t))}}function on(r,e,t){return e==0?r.cutByIndex(t,r.childCount):r.replaceChild(0,r.firstChild.copy(on(r.firstChild.content,e-1,t)))}function sn(r,e,t){return e==0?r.append(t):r.replaceChild(r.childCount-1,r.lastChild.copy(sn(r.lastChild.content,e-1,t)))}function ka(r,e){for(let t=0;t<e;t++)r=r.firstChild.content;return r}function Pl(r,e,t){if(e<=0)return r;let n=r.content;return e>1&&(n=n.replaceChild(0,Pl(n.firstChild,e-1,n.childCount==1?t-1:0))),e>0&&(n=r.type.contentMatch.fillBefore(n).append(n),t<=0&&(n=n.append(r.type.contentMatch.matchFragment(n).fillBefore(C.empty,!0)))),r.copy(n)}function Ca(r,e,t,n,i){let a=r.node(e),o=i?r.indexAfter(e):r.index(e);if(o==a.childCount&&!t.compatibleContent(a.type))return null;let s=n.fillBefore(a.content,!0,o);return s&&!jv(t,a.content,o)?s:null}function jv(r,e,t){for(let n=t;n<e.childCount;n++)if(!r.allowsMarks(e.child(n).marks))return!0;return!1}function Gv(r){return r.spec.defining||r.spec.definingForContent}function Kv(r,e,t,n){if(!n.size)return r.deleteRange(e,t);let i=r.doc.resolve(e),a=r.doc.resolve(t);if(Bl(i,a,n))return r.step(new me(e,t,n));let o=Fl(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let d=i.depth,h=i.pos-1;d>0;d--,h--){let p=i.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(d)>-1?s=d:i.before(d)==h&&o.splice(1,0,-d)}let l=o.indexOf(s),u=[],c=n.openStart;for(let d=n.content,h=0;;h++){let p=d.firstChild;if(u.push(p),h==n.openStart)break;d=p.content}for(let d=c-1;d>=0;d--){let h=u[d],p=Gv(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(s)-1)))c=d;else if(p||!h.type.isTextblock)break}for(let d=n.openStart;d>=0;d--){let h=(d+c+1)%(n.openStart+1),p=u[h];if(p)for(let v=0;v<o.length;v++){let m=o[(v+l)%o.length],g=!0;m<0&&(g=!1,m=-m);let w=i.node(m-1),k=i.index(m-1);if(w.canReplaceWith(k,k,p.type,p.marks))return r.replace(i.before(m),g?a.after(m):t,new S(Hl(n.content,0,n.openStart,h),h,n.openEnd))}}let f=r.steps.length;for(let d=o.length-1;d>=0&&(r.replace(e,t,n),!(r.steps.length>f));d--){let h=o[d];h<0||(e=i.before(h),t=a.after(h))}}function Hl(r,e,t,n,i){if(e<t){let a=r.firstChild;r=r.replaceChild(0,a.copy(Hl(a.content,e+1,t,n,a)))}if(e>n){let a=i.contentMatchAt(0),o=a.fillBefore(r).append(r);r=o.append(a.matchFragment(o).fillBefore(C.empty,!0))}return r}function Jv(r,e,t,n){if(!n.isInline&&e==t&&r.doc.resolve(e).parent.content.size){let i=Vv(r.doc,e,n.type);i!=null&&(e=t=i)}r.replaceRange(e,t,new S(C.from(n),0,0))}function Xv(r,e,t){let n=r.doc.resolve(e),i=r.doc.resolve(t),a=Fl(n,i);for(let o=0;o<a.length;o++){let s=a[o],l=o==a.length-1;if(l&&s==0||n.node(s).type.contentMatch.validEnd)return r.delete(n.start(s),i.end(s));if(s>0&&(l||n.node(s-1).canReplace(n.index(s-1),i.indexAfter(s-1))))return r.delete(n.before(s),i.after(s))}for(let o=1;o<=n.depth&&o<=i.depth;o++)if(e-n.start(o)==n.depth-o&&t>n.end(o)&&i.end(o)-t!=i.depth-o&&n.start(o-1)==i.start(o-1)&&n.node(o-1).canReplace(n.index(o-1),i.index(o-1)))return r.delete(n.before(o),t);r.delete(e,t)}function Fl(r,e){let t=[],n=Math.min(r.depth,e.depth);for(let i=n;i>=0;i--){let a=r.start(i);if(a<r.pos-(r.depth-i)||e.end(i)>e.pos+(e.depth-i)||r.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(a==e.start(i)||i==r.depth&&i==e.depth&&r.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==a-1)&&t.push(i)}return t}class br extends ve{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Y.fail("No node at attribute step's position");let n=Object.create(null);for(let a in t.attrs)n[a]=t.attrs[a];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return Y.fromReplace(e,this.pos,this.pos+1,new S(C.from(i),0,t.isLeaf?0:1))}getMap(){return Ne.empty}invert(e){return new br(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new br(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new br(t.pos,t.attr,t.value)}}ve.jsonID("attr",br);class ln extends ve{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Y.ok(n)}getMap(){return Ne.empty}invert(e){return new ln(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ln(t.attr,t.value)}}ve.jsonID("docAttr",ln);let wr=class extends Error{};wr=function r(e){let t=Error.call(this,e);return t.__proto__=r.prototype,t},wr.prototype=Object.create(Error.prototype),wr.prototype.constructor=wr,wr.prototype.name="TransformError";class Yv{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new an}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new wr(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let i=this.mapping.maps[n];n&&(e=i.map(e,1),t=i.map(t,-1)),i.forEach((a,o,s,l)=>{e=Math.min(e,s),t=Math.max(t,l)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=S.empty){let i=wa(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new S(C.from(n),0,0))}delete(e,t){return this.replace(e,t,S.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return Kv(this,e,t,n),this}replaceRangeWith(e,t,n){return Jv(this,e,t,n),this}deleteRange(e,t){return Xv(this,e,t),this}lift(e,t){return Av(this,e,t),this}join(e,t=1){return zv(this,e,t),this}wrap(e,t){return Bv(this,e,t),this}setBlockType(e,t=e,n,i=null){return Pv(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return Fv(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new br(e,t,n)),this}setDocAttribute(e,t){return this.step(new ln(e,t)),this}addNodeMark(e,t){return this.step(new St(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof z)t.isInSet(n.marks)&&this.step(new Xt(e,t));else{let i=n.marks,a,o=[];for(;a=t.isInSet(i);)o.push(new Xt(e,a)),i=a.removeFromSet(i);for(let s=o.length-1;s>=0;s--)this.step(o[s])}return this}split(e,t=1,n){return qv(this,e,t,n),this}addMark(e,t,n){return Ov(this,e,t,n),this}removeMark(e,t,n){return Lv(this,e,t,n),this}clearIncompatible(e,t,n){return ba(this,e,t,n),this}}const Ta=Object.create(null);class F{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new ql(e.min(t),e.max(t))]}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 t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=S.empty){let n=t.content.lastChild,i=null;for(let s=0;s<t.openEnd;s++)i=n,n=n.lastChild;let a=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:l,$to:u}=o[s],c=e.mapping.slice(a);e.replaceRange(c.map(l.pos),c.map(u.pos),s?S.empty:t),s==0&&zl(e,a,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:o,$to:s}=i[a],l=e.mapping.slice(n),u=l.map(o.pos),c=l.map(s.pos);a?e.deleteRange(u,c):(e.replaceRangeWith(u,c,t),zl(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let i=e.parent.inlineContent?new q(e):kr(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(let a=e.depth-1;a>=0;a--){let o=t<0?kr(e.node(0),e.node(a),e.before(a+1),e.index(a),t,n):kr(e.node(0),e.node(a),e.after(a+1),e.index(a)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Me(e.node(0))}static atStart(e){return kr(e,e,0,0,1)||new Me(e)}static atEnd(e){return kr(e,e,e.content.size,e.childCount,-1)||new Me(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Ta[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Ta)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ta[e]=t,t.prototype.jsonID=e,t}getBookmark(){return q.between(this.$anchor,this.$head).getBookmark()}}F.prototype.visible=!0;class ql{constructor(e,t){this.$from=e,this.$to=t}}let _l=!1;function $l(r){!_l&&!r.parent.inlineContent&&(_l=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}class q extends F{constructor(e,t=e){$l(e),$l(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return F.near(n);let i=e.resolve(t.map(this.anchor));return new q(i.parent.inlineContent?i:n,n)}replace(e,t=S.empty){if(super.replace(e,t),t==S.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof q&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Jn(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new q(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if((!n||i)&&(n=i>=0?1:-1),!t.parent.inlineContent){let a=F.findFrom(t,n,!0)||F.findFrom(t,-n,!0);if(a)t=a.$head;else return F.near(t,n)}return e.parent.inlineContent||(i==0?e=t:(e=(F.findFrom(e,-n,!0)||F.findFrom(e,n,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new q(e,t)}}F.jsonID("text",q);class Jn{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Jn(e.map(this.anchor),e.map(this.head))}resolve(e){return q.between(e.resolve(this.anchor),e.resolve(this.head))}}class R extends F{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:i}=t.mapResult(this.anchor),a=e.resolve(i);return n?F.near(a):new R(a)}content(){return new S(C.from(this.node),0,0)}eq(e){return e instanceof R&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new xa(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new R(e.resolve(t.anchor))}static create(e,t){return new R(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}R.prototype.visible=!1,F.jsonID("node",R);class xa{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new Jn(n,n):new xa(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&R.isSelectable(n)?new R(t):F.near(t)}}class Me extends F{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=S.empty){if(t==S.empty){e.delete(0,e.doc.content.size);let n=F.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Me(e)}map(e){return new Me(e)}eq(e){return e instanceof Me}getBookmark(){return Qv}}F.jsonID("all",Me);const Qv={map(){return this},resolve(r){return new Me(r)}};function kr(r,e,t,n,i,a=!1){if(e.inlineContent)return q.create(r,t);for(let o=n-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let s=e.child(o);if(s.isAtom){if(!a&&R.isSelectable(s))return R.create(r,t-(i<0?s.nodeSize:0))}else{let l=kr(r,s,t+i,i<0?s.childCount:0,i,a);if(l)return l}t+=s.nodeSize*i}return null}function zl(r,e,t){let n=r.steps.length-1;if(n<e)return;let i=r.steps[n];if(!(i instanceof me||i instanceof re))return;let a=r.mapping.maps[n],o;a.forEach((s,l,u,c)=>{o==null&&(o=c)}),r.setSelection(F.near(r.doc.resolve(o),t))}const Vl=1,Xn=2,Ul=4;class Zv extends Yv{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|Vl)&~Xn,this.storedMarks=null,this}get selectionSet(){return(this.updated&Vl)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Xn,this}ensureMarks(e){return z.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&Xn)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Xn,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||z.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=t),!e)return this.deleteRange(t,n);let a=this.storedMarks;if(!a){let o=this.doc.resolve(t);a=n==t?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,a)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(F.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,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|=Ul,this}get scrolledIntoView(){return(this.updated&Ul)>0}}function Wl(r,e){return!e||!r?r:r.bind(e)}class un{constructor(e,t,n){this.name=e,this.init=Wl(t.init,n),this.apply=Wl(t.apply,n)}}const em=[new un("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new un("selection",{init(r,e){return r.selection||F.atStart(e.doc)},apply(r){return r.selection}}),new un("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,n){return n.selection.$cursor?r.storedMarks:null}}),new un("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}})];class Ea{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=em.slice(),t&&t.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new un(n.key,n.spec.state,n))})}}class Yt{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,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),i=null;for(;;){let a=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let l=i?i[o].n:0,u=i?i[o].state:this,c=l<t.length&&s.spec.appendTransaction.call(s,l?t.slice(l):t,u,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),a=!0}i&&(i[o]={state:n,n:t.length})}}if(!a)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Yt(this.config),n=this.config.fields;for(let i=0;i<n.length;i++){let a=n[i];t[a.name]=a.apply(e,this[a.name],this,t)}return t}get tr(){return new Zv(this)}static create(e){let t=new Ea(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new Yt(t);for(let i=0;i<t.fields.length;i++)n[t.fields[i].name]=t.fields[i].init(e,n);return n}reconfigure(e){let t=new Ea(this.schema,e.plugins),n=t.fields,i=new Yt(t);for(let a=0;a<n.length;a++){let o=n[a].name;i[o]=this.hasOwnProperty(o)?this[o]:n[a].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],a=i.spec.state;a&&a.toJSON&&(t[n]=a.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Ea(e.schema,e.plugins),a=new Yt(i);return i.fields.forEach(o=>{if(o.name=="doc")a.doc=Et.fromJSON(e.schema,t.doc);else if(o.name=="selection")a.selection=F.fromJSON(a.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(a.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let s in n){let l=n[s],u=l.spec.state;if(l.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(t,s)){a[o.name]=u.fromJSON.call(l,e,t[s],a);return}}a[o.name]=o.init(e,a)}}),a}}function jl(r,e,t){for(let n in r){let i=r[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=jl(i,e,{})),t[n]=i}return t}class Ae{constructor(e){this.spec=e,this.props={},e.props&&jl(e.props,this,this.props),this.key=e.key?e.key.key:Gl("plugin")}getState(e){return e[this.key]}}const Ma=Object.create(null);function Gl(r){return r in Ma?r+"$"+ ++Ma[r]:(Ma[r]=0,r+"$")}class cn{constructor(e="key"){this.key=Gl(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const se=function(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e},Cr=function(r){let e=r.assignedSlot||r.parentNode;return e&&e.nodeType==11?e.host:e};let Sa=null;const ut=function(r,e,t){let n=Sa||(Sa=document.createRange());return n.setEnd(r,t??r.nodeValue.length),n.setStart(r,e||0),n},tm=function(){Sa=null},Qt=function(r,e,t,n){return t&&(Kl(r,e,t,n,-1)||Kl(r,e,t,n,1))},rm=/^(img|br|input|textarea|hr)$/i;function Kl(r,e,t,n,i){for(var a;;){if(r==t&&e==n)return!0;if(e==(i<0?0:Fe(r))){let o=r.parentNode;if(!o||o.nodeType!=1||fn(r)||rm.test(r.nodeName)||r.contentEditable=="false")return!1;e=se(r)+(i<0?0:1),r=o}else if(r.nodeType==1){let o=r.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((a=o.pmViewDesc)===null||a===void 0)&&a.ignoreForSelection)e+=i;else return!1;else r=o,e=i<0?Fe(r):0}else return!1}}function Fe(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function nm(r,e){for(;;){if(r.nodeType==3&&e)return r;if(r.nodeType==1&&e>0){if(r.contentEditable=="false")return null;r=r.childNodes[e-1],e=Fe(r)}else if(r.parentNode&&!fn(r))e=se(r),r=r.parentNode;else return null}}function im(r,e){for(;;){if(r.nodeType==3&&e<r.nodeValue.length)return r;if(r.nodeType==1&&e<r.childNodes.length){if(r.contentEditable=="false")return null;r=r.childNodes[e],e=0}else if(r.parentNode&&!fn(r))e=se(r)+1,r=r.parentNode;else return null}}function am(r,e,t){for(let n=e==0,i=e==Fe(r);n||i;){if(r==t)return!0;let a=se(r);if(r=r.parentNode,!r)return!1;n=n&&a==0,i=i&&a==Fe(r)}}function fn(r){let e;for(let t=r;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==r||e.contentDOM==r)}const Yn=function(r){return r.focusNode&&Qt(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)};function Zt(r,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=r,t.key=t.code=e,t}function om(r){let e=r.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function sm(r,e,t){if(r.caretPositionFromPoint)try{let n=r.caretPositionFromPoint(e,t);if(n)return{node:n.offsetNode,offset:Math.min(Fe(n.offsetNode),n.offset)}}catch{}if(r.caretRangeFromPoint){let n=r.caretRangeFromPoint(e,t);if(n)return{node:n.startContainer,offset:Math.min(Fe(n.startContainer),n.startOffset)}}}const Ze=typeof navigator<"u"?navigator:null,Jl=typeof document<"u"?document:null,Ot=Ze&&Ze.userAgent||"",Oa=/Edge\/(\d+)/.exec(Ot),Xl=/MSIE \d/.exec(Ot),La=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ot),De=!!(Xl||La||Oa),Lt=Xl?document.documentMode:La?+La[1]:Oa?+Oa[1]:0,qe=!De&&/gecko\/(\d+)/i.test(Ot);qe&&+(/Firefox\/(\d+)/.exec(Ot)||[0,0])[1];const Na=!De&&/Chrome\/(\d+)/.exec(Ot),le=!!Na,Yl=Na?+Na[1]:0,ge=!De&&!!Ze&&/Apple Computer/.test(Ze.vendor),Tr=ge&&(/Mobile\/\w+/.test(Ot)||!!Ze&&Ze.maxTouchPoints>2),_e=Tr||(Ze?/Mac/.test(Ze.platform):!1),Ql=Ze?/Win/.test(Ze.platform):!1,ct=/Android \d/.test(Ot),dn=!!Jl&&"webkitFontSmoothing"in Jl.documentElement.style,lm=dn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function um(r){let e=r.defaultView&&r.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:r.documentElement.clientWidth,top:0,bottom:r.documentElement.clientHeight}}function ft(r,e){return typeof r=="number"?r:r[e]}function cm(r){let e=r.getBoundingClientRect(),t=e.width/r.offsetWidth||1,n=e.height/r.offsetHeight||1;return{left:e.left,right:e.left+r.clientWidth*t,top:e.top,bottom:e.top+r.clientHeight*n}}function Zl(r,e,t){let n=r.someProp("scrollThreshold")||0,i=r.someProp("scrollMargin")||5,a=r.dom.ownerDocument;for(let o=t||r.dom;o;){if(o.nodeType!=1){o=Cr(o);continue}let s=o,l=s==a.body,u=l?um(a):cm(s),c=0,f=0;if(e.top<u.top+ft(n,"top")?f=-(u.top-e.top+ft(i,"top")):e.bottom>u.bottom-ft(n,"bottom")&&(f=e.bottom-e.top>u.bottom-u.top?e.top+ft(i,"top")-u.top:e.bottom-u.bottom+ft(i,"bottom")),e.left<u.left+ft(n,"left")?c=-(u.left-e.left+ft(i,"left")):e.right>u.right-ft(n,"right")&&(c=e.right-u.right+ft(i,"right")),c||f)if(l)a.defaultView.scrollBy(c,f);else{let h=s.scrollLeft,p=s.scrollTop;f&&(s.scrollTop+=f),c&&(s.scrollLeft+=c);let v=s.scrollLeft-h,m=s.scrollTop-p;e={left:e.left-v,top:e.top-m,right:e.right-v,bottom:e.bottom-m}}let d=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(d))break;o=d=="absolute"?o.offsetParent:Cr(o)}}function fm(r){let e=r.dom.getBoundingClientRect(),t=Math.max(0,e.top),n,i;for(let a=(e.left+e.right)/2,o=t+1;o<Math.min(innerHeight,e.bottom);o+=5){let s=r.root.elementFromPoint(a,o);if(!s||s==r.dom||!r.dom.contains(s))continue;let l=s.getBoundingClientRect();if(l.top>=t-20){n=s,i=l.top;break}}return{refDOM:n,refTop:i,stack:eu(r.dom)}}function eu(r){let e=[],t=r.ownerDocument;for(let n=r;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),r!=t);n=Cr(n));return e}function dm({refDOM:r,refTop:e,stack:t}){let n=r?r.getBoundingClientRect().top:0;tu(t,n==0?0:n-e)}function tu(r,e){for(let t=0;t<r.length;t++){let{dom:n,top:i,left:a}=r[t];n.scrollTop!=i+e&&(n.scrollTop=i+e),n.scrollLeft!=a&&(n.scrollLeft=a)}}let xr=null;function hm(r){if(r.setActive)return r.setActive();if(xr)return r.focus(xr);let e=eu(r);r.focus(xr==null?{get preventScroll(){return xr={preventScroll:!0},!0}}:void 0),xr||(xr=!1,tu(e,0))}function ru(r,e){let t,n=2e8,i,a=0,o=e.top,s=e.top,l,u;for(let c=r.firstChild,f=0;c;c=c.nextSibling,f++){let d;if(c.nodeType==1)d=c.getClientRects();else if(c.nodeType==3)d=ut(c).getClientRects();else continue;for(let h=0;h<d.length;h++){let p=d[h];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let v=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(v<n){t=c,n=v,i=v&&t.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,c.nodeType==1&&v&&(a=f+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=c,u={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!t&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(a=f+1)}}return!t&&l&&(t=l,i=u,n=0),t&&t.nodeType==3?pm(t,i):!t||n&&t.nodeType==1?{node:r,offset:a}:ru(t,i)}function pm(r,e){let t=r.nodeValue.length,n=document.createRange(),i;for(let a=0;a<t;a++){n.setEnd(r,a+1),n.setStart(r,a);let o=Nt(n,1);if(o.top!=o.bottom&&Aa(e,o)){i={node:r,offset:a+(e.left>=(o.left+o.right)/2?1:0)};break}}return n.detach(),i||{node:r,offset:0}}function Aa(r,e){return r.left>=e.left-1&&r.left<=e.right+1&&r.top>=e.top-1&&r.top<=e.bottom+1}function vm(r,e){let t=r.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<r.getBoundingClientRect().left?t:r}function mm(r,e,t){let{node:n,offset:i}=ru(e,t),a=-1;if(n.nodeType==1&&!n.firstChild){let o=n.getBoundingClientRect();a=o.left!=o.right&&t.left>(o.left+o.right)/2?1:-1}return r.docView.posFromDOM(n,i,a)}function gm(r,e,t,n){let i=-1;for(let a=e,o=!1;a!=r.dom;){let s=r.docView.nearestDesc(a,!0),l;if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((l=s.dom.getBoundingClientRect()).width||l.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!o&&l.left>n.left||l.top>n.top?i=s.posBefore:(!o&&l.right<n.left||l.bottom<n.top)&&(i=s.posAfter),o=!0),!s.contentDOM&&i<0&&!s.node.isText))return(s.node.isBlock?n.top<(l.top+l.bottom)/2:n.left<(l.left+l.right)/2)?s.posBefore:s.posAfter;a=s.dom.parentNode}return i>-1?i:r.docView.posFromDOM(e,t,-1)}function nu(r,e,t){let n=r.childNodes.length;if(n&&t.top<t.bottom)for(let i=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-t.top)/(t.bottom-t.top))-2)),a=i;;){let o=r.childNodes[a];if(o.nodeType==1){let s=o.getClientRects();for(let l=0;l<s.length;l++){let u=s[l];if(Aa(e,u))return nu(o,e,u)}}if((a=(a+1)%n)==i)break}return r}function ym(r,e){let t=r.dom.ownerDocument,n,i=0,a=sm(t,e.left,e.top);a&&({node:n,offset:i}=a);let o=(r.root.elementFromPoint?r.root:t).elementFromPoint(e.left,e.top),s;if(!o||!r.dom.contains(o.nodeType!=1?o.parentNode:o)){let u=r.dom.getBoundingClientRect();if(!Aa(e,u)||(o=nu(r.dom,e,u),!o))return null}if(ge)for(let u=o;n&&u;u=Cr(u))u.draggable&&(n=void 0);if(o=vm(o,e),n){if(qe&&n.nodeType==1&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let c=n.childNodes[i],f;c.nodeName=="IMG"&&(f=c.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let u;dn&&i&&n.nodeType==1&&(u=n.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,n==r.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?s=r.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(s=gm(r,n,i,e))}s==null&&(s=mm(r,o,e));let l=r.docView.nearestDesc(o,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function iu(r){return r.top<r.bottom||r.left<r.right}function Nt(r,e){let t=r.getClientRects();if(t.length){let n=t[e<0?0:t.length-1];if(iu(n))return n}return Array.prototype.find.call(t,iu)||r.getBoundingClientRect()}const bm=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function au(r,e,t){let{node:n,offset:i,atom:a}=r.docView.domFromPos(e,t<0?-1:1),o=dn||qe;if(n.nodeType==3)if(o&&(bm.test(n.nodeValue)||(t<0?!i:i==n.nodeValue.length))){let l=Nt(ut(n,i,i),t);if(qe&&i&&/\s/.test(n.nodeValue[i-1])&&i<n.nodeValue.length){let u=Nt(ut(n,i-1,i-1),-1);if(u.top==l.top){let c=Nt(ut(n,i,i+1),-1);if(c.top!=l.top)return hn(c,c.left<u.left)}}return l}else{let l=i,u=i,c=t<0?1:-1;return t<0&&!i?(u++,c=-1):t>=0&&i==n.nodeValue.length?(l--,c=1):t<0?l--:u++,hn(Nt(ut(n,l,u),c),c<0)}if(!r.state.doc.resolve(e-(a||0)).parent.inlineContent){if(a==null&&i&&(t<0||i==Fe(n))){let l=n.childNodes[i-1];if(l.nodeType==1)return Da(l.getBoundingClientRect(),!1)}if(a==null&&i<Fe(n)){let l=n.childNodes[i];if(l.nodeType==1)return Da(l.getBoundingClientRect(),!0)}return Da(n.getBoundingClientRect(),t>=0)}if(a==null&&i&&(t<0||i==Fe(n))){let l=n.childNodes[i-1],u=l.nodeType==3?ut(l,Fe(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return hn(Nt(u,1),!1)}if(a==null&&i<Fe(n)){let l=n.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?l.nodeType==3?ut(l,0,o?0:1):l.nodeType==1?l:null:null;if(u)return hn(Nt(u,-1),!0)}return hn(Nt(n.nodeType==3?ut(n):n,-t),t>=0)}function hn(r,e){if(r.width==0)return r;let t=e?r.left:r.right;return{top:r.top,bottom:r.bottom,left:t,right:t}}function Da(r,e){if(r.height==0)return r;let t=e?r.top:r.bottom;return{top:t,bottom:t,left:r.left,right:r.right}}function ou(r,e,t){let n=r.state,i=r.root.activeElement;n!=e&&r.updateState(e),i!=r.dom&&r.focus();try{return t()}finally{n!=e&&r.updateState(n),i!=r.dom&&i&&i.focus()}}function wm(r,e,t){let n=e.selection,i=t=="up"?n.$from:n.$to;return ou(r,e,()=>{let{node:a}=r.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let s=r.docView.nearestDesc(a,!0);if(!s)break;if(s.node.isBlock){a=s.contentDOM||s.dom;break}a=s.dom.parentNode}let o=au(r,i.pos,1);for(let s=a.firstChild;s;s=s.nextSibling){let l;if(s.nodeType==1)l=s.getClientRects();else if(s.nodeType==3)l=ut(s,0,s.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let c=l[u];if(c.bottom>c.top+1&&(t=="up"?o.top-c.top>(c.bottom-o.top)*2:c.bottom-o.bottom>(o.bottom-c.top)*2))return!1}}return!0})}const km=/[\u0590-\u08ac]/;function Cm(r,e,t){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,a=!i,o=i==n.parent.content.size,s=r.domSelection();return s?!km.test(n.parent.textContent)||!s.modify?t=="left"||t=="backward"?a:o:ou(r,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:f}=r.domSelectionRange(),d=s.caretBidiLevel;s.modify("move",t,"character");let h=n.depth?r.docView.domAfterPos(n.before()):r.dom,{focusNode:p,focusOffset:v}=r.domSelectionRange(),m=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&u==v;try{s.collapse(c,f),l&&(l!=c||u!=f)&&s.extend&&s.extend(l,u)}catch{}return d!=null&&(s.caretBidiLevel=d),m}):n.pos==n.start()||n.pos==n.end()}let su=null,lu=null,uu=!1;function Tm(r,e,t){return su==e&&lu==t?uu:(su=e,lu=t,uu=t=="up"||t=="down"?wm(r,e,t):Cm(r,e,t))}const $e=0,cu=1,er=2,et=3;class pn{constructor(e,t,n,i){this.parent=e,this.children=t,this.dom=n,this.contentDOM=i,this.dirty=$e,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].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 t=0,n=this.posAtStart;;t++){let i=this.children[t];if(i==e)return n;n+=i.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,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let a,o;if(e==this.contentDOM)a=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;a=e.previousSibling}for(;a&&!((o=a.pmViewDesc)&&o.parent==this);)a=a.previousSibling;return a?this.posBeforeChild(o)+o.size:this.posAtStart}else{let a,o;if(e==this.contentDOM)a=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;a=e.nextSibling}for(;a&&!((o=a.pmViewDesc)&&o.parent==this);)a=a.nextSibling;return a?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=t>se(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let a=e;;a=a.parentNode){if(a==this.dom){i=!1;break}if(a.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let a=e;;a=a.parentNode){if(a==this.dom){i=!0;break}if(a.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,i=e;i;i=i.parentNode){let a=this.getDesc(i),o;if(a&&(!t||a.node))if(n&&(o=a.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))n=!1;else return a}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let i=e;i;i=i.parentNode){let a=this.getDesc(i);if(a)return a.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let i=this.children[t],a=n+i.size;if(n==e&&a!=n){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let s=i.children[o];if(s.size){i=s;break}}return i}if(e<a)return i.descAt(e-n-i.border);n=a}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,i=0;for(let a=0;n<this.children.length;n++){let o=this.children[n],s=a+o.size;if(s>e||o instanceof hu){i=e-a;break}a=s}if(i)return this.children[n].domFromPos(i-this.children[n].border,t);for(let a;n&&!(a=this.children[n-1]).size&&a instanceof fu&&a.side>=0;n--);if(t<=0){let a,o=!0;for(;a=n?this.children[n-1]:null,!(!a||a.dom.parentNode==this.contentDOM);n--,o=!1);return a&&t&&o&&!a.border&&!a.domAtom?a.domFromPos(a.size,t):{node:this.contentDOM,offset:a?se(a.dom)+1:0}}else{let a,o=!0;for(;a=n<this.children.length?this.children[n]:null,!(!a||a.dom.parentNode==this.contentDOM);n++,o=!1);return a&&o&&!a.border&&!a.domAtom?a.domFromPos(0,t):{node:this.contentDOM,offset:a?se(a.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,a=-1;for(let o=n,s=0;;s++){let l=this.children[s],u=o+l.size;if(i==-1&&e<=u){let c=o+l.border;if(e>=c&&t<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,c);e=o;for(let f=s;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=se(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(u>t||s==this.children.length-1)){t=u;for(let c=s+1;c<this.children.length;c++){let f=this.children[c];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){a=se(f.dom);break}t+=f.size}a==-1&&(a=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:a}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,i=!1){let a=Math.min(e,t),o=Math.max(e,t);for(let h=0,p=0;h<this.children.length;h++){let v=this.children[h],m=p+v.size;if(a>p&&o<m)return v.setSelection(e-p-v.border,t-p-v.border,n,i);p=m}let s=this.domFromPos(e,e?-1:1),l=t==e?s:this.domFromPos(t,t?-1:1),u=n.root.getSelection(),c=n.domSelectionRange(),f=!1;if((qe||ge)&&e==t){let{node:h,offset:p}=s;if(h.nodeType==3){if(f=!!(p&&h.nodeValue[p-1]==`
`),f&&p==h.nodeValue.length)for(let v=h,m;v;v=v.parentNode){if(m=v.nextSibling){m.nodeName=="BR"&&(s=l={node:m.parentNode,offset:se(m)+1});break}let g=v.pmViewDesc;if(g&&g.node&&g.node.isBlock)break}}else{let v=h.childNodes[p-1];f=v&&(v.nodeName=="BR"||v.contentEditable=="false")}}if(qe&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let h=c.focusNode.childNodes[c.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||f&&ge)&&Qt(s.node,s.offset,c.anchorNode,c.anchorOffset)&&Qt(l.node,l.offset,c.focusNode,c.focusOffset))return;let d=!1;if((u.extend||e==t)&&!(f&&qe)){u.collapse(s.node,s.offset);try{e!=t&&u.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(e>t){let p=s;s=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(s.node,s.offset),u.removeAllRanges(),u.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i<this.children.length;i++){let a=this.children[i],o=n+a.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let s=n+a.border,l=o-a.border;if(e>=s&&t<=l){this.dirty=e==n||t==o?er:cu,e==s&&t==l&&(a.contentLost||a.dom.parentNode!=this.contentDOM)?a.dirty=et:a.markDirty(e-s,t-s);return}else a.dirty=a.dom==a.contentDOM&&a.dom.parentNode==this.contentDOM&&!a.children.length?er:et}n=o}this.dirty=er}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?er:cu;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class fu extends pn{constructor(e,t,n,i){let a,o=t.type.toDOM;if(typeof o=="function"&&(o=o(n,()=>{if(!a)return i;if(a.parent)return a.parent.posBeforeChild(a)})),!t.type.spec.raw){if(o.nodeType!=1){let s=document.createElement("span");s.appendChild(o),o=s}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,a=this}matchesWidget(e){return this.dirty==$e&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(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 xm extends pn{constructor(e,t,n,i){super(e,[],t,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class tr extends pn{constructor(e,t,n,i,a){super(e,[],n,i),this.mark=t,this.spec=a}static create(e,t,n,i){let a=i.nodeViews[t.type.name],o=a&&a(t,i,n);return(!o||!o.dom)&&(o=gr.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new tr(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&et||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=et&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=$e){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=$e}}slice(e,t,n){let i=tr.create(this.parent,this.mark,!0,n),a=this.children,o=this.size;t<o&&(a=Ra(a,t,o,n)),e>0&&(a=Ra(a,0,e,n));for(let s=0;s<a.length;s++)a[s].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class At extends pn{constructor(e,t,n,i,a,o,s,l,u){super(e,[],a,o),this.node=t,this.outerDeco=n,this.innerDeco=i,this.nodeDOM=s}static create(e,t,n,i,a,o){let s=a.nodeViews[t.type.name],l,u=s&&s(t,a,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},n,i),c=u&&u.dom,f=u&&u.contentDOM;if(t.isText){if(!c)c=document.createTextNode(t.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=gr.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!f&&!t.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return c=mu(c,n,t),u?l=new Em(e,t,n,i,c,f||null,d,u,a,o+1):t.isText?new Qn(e,t,n,i,c,d,a):new At(e,t,n,i,c,f||null,d,a,o+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 t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>C.empty)}return e}matchesNode(e,t,n){return this.dirty==$e&&e.eq(this.node)&&Zn(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,i=t,a=e.composing?this.localCompositionInfo(e,t):null,o=a&&a.pos>-1?a:null,s=a&&a.pos<0,l=new Sm(this,o&&o.node,e);Nm(this.node,this.innerDeco,(u,c,f)=>{u.spec.marks?l.syncToMarks(u.spec.marks,n,e,c):u.type.side>=0&&!f&&l.syncToMarks(c==this.node.childCount?z.none:this.node.child(c).marks,n,e,c),l.placeWidget(u,e,i)},(u,c,f,d)=>{l.syncToMarks(u.marks,n,e,d);let h;l.findNodeMatch(u,c,f,d)||s&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(h=l.findIndexWithChild(a.node))>-1&&l.updateNodeAt(u,c,f,h,e)||l.updateNextNode(u,c,f,e,d,i)||l.addNode(u,c,f,e,i),i+=u.nodeSize}),l.syncToMarks([],n,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==er)&&(o&&this.protectLocalComposition(e,o),pu(this.contentDOM,this.children,e),Tr&&Am(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof q)||n<t||i>t+this.node.content.size)return null;let a=e.input.compositionNode;if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let o=a.nodeValue,s=Dm(this.node.content,o,n-t,i-t);return s<0?null:{node:a,pos:s,text:o}}else return{node:a,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:i}){if(this.getDesc(t))return;let a=t;for(;a.parentNode!=this.contentDOM;a=a.parentNode){for(;a.previousSibling;)a.parentNode.removeChild(a.previousSibling);for(;a.nextSibling;)a.parentNode.removeChild(a.nextSibling);a.pmViewDesc&&(a.pmViewDesc=void 0)}let o=new xm(this,a,t,i);e.input.compositionNodes.push(o),this.children=Ra(this.children,n,n+i.length,e,o)}update(e,t,n,i){return this.dirty==et||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,i),!0)}updateInner(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=$e}updateOuterDeco(e){if(Zn(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=vu(this.dom,this.nodeDOM,Ia(this.outerDeco,this.node,t),Ia(e,this.node,t)),this.dom!=n&&(n.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.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function du(r,e,t,n,i){mu(n,e,r);let a=new At(void 0,r,e,t,n,n,n,i,0);return a.contentDOM&&a.updateChildren(i,0),a}class Qn extends At{constructor(e,t,n,i,a,o,s){super(e,t,n,i,a,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,i){return this.dirty==et||this.dirty!=$e&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=$e||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=$e,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,n){let i=this.node.cut(e,t),a=document.createTextNode(i.text);return new Qn(this.parent,i,this.outerDeco,this.innerDeco,a,a,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=et)}get domAtom(){return!1}isText(e){return this.node.text==e}}class hu extends pn{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==$e&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Em extends At{constructor(e,t,n,i,a,o,s,l,u,c){super(e,t,n,i,a,o,s,u,c),this.spec=l}update(e,t,n,i){if(this.dirty==et)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let a=this.spec.update(e,t,n);return a&&this.updateInner(e,t,n,i),a}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,i){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,i)}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 pu(r,e,t){let n=r.firstChild,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=o.dom;if(s.parentNode==r){for(;s!=n;)n=gu(n),i=!0;n=n.nextSibling}else i=!0,r.insertBefore(s,n);if(o instanceof tr){let l=n?n.previousSibling:r.lastChild;pu(o.contentDOM,o.children,t),n=l?l.nextSibling:r.firstChild}}for(;n;)n=gu(n),i=!0;i&&t.trackWrites==r&&(t.trackWrites=null)}const vn=function(r){r&&(this.nodeName=r)};vn.prototype=Object.create(null);const rr=[new vn];function Ia(r,e,t){if(r.length==0)return rr;let n=t?rr[0]:new vn,i=[n];for(let a=0;a<r.length;a++){let o=r[a].type.attrs;if(o){o.nodeName&&i.push(n=new vn(o.nodeName));for(let s in o){let l=o[s];l!=null&&(t&&i.length==1&&i.push(n=new vn(e.isInline?"span":"div")),s=="class"?n.class=(n.class?n.class+" ":"")+l:s=="style"?n.style=(n.style?n.style+";":"")+l:s!="nodeName"&&(n[s]=l))}}}return i}function vu(r,e,t,n){if(t==rr&&n==rr)return e;let i=e;for(let a=0;a<n.length;a++){let o=n[a],s=t[a];if(a){let l;s&&s.nodeName==o.nodeName&&i!=r&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),s=rr[0]),i=l}Mm(i,s||rr[0],o)}return i}function Mm(r,e,t){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in t)&&r.removeAttribute(n);for(let n in t)n!="class"&&n!="style"&&n!="nodeName"&&t[n]!=e[n]&&r.setAttribute(n,t[n]);if(e.class!=t.class){let n=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let a=0;a<n.length;a++)i.indexOf(n[a])==-1&&r.classList.remove(n[a]);for(let a=0;a<i.length;a++)n.indexOf(i[a])==-1&&r.classList.add(i[a]);r.classList.length==0&&r.removeAttribute("class")}if(e.style!=t.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=n.exec(e.style);)r.style.removeProperty(i[1])}t.style&&(r.style.cssText+=t.style)}}function mu(r,e,t){return vu(r,r,rr,Ia(e,t,r.nodeType!=1))}function Zn(r,e){if(r.length!=e.length)return!1;for(let t=0;t<r.length;t++)if(!r[t].type.eq(e[t].type))return!1;return!0}function gu(r){let e=r.nextSibling;return r.parentNode.removeChild(r),e}class Sm{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Om(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,i){let a=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;a<s&&(a==o-1?this.top:this.stack[a+1<<1]).matchesMark(e[a])&&e[a].type.spec.spanning!==!1;)a++;for(;a<o;)this.destroyRest(),this.top.dirty=$e,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let l=-1,u=this.top.children.length;i<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let c=this.index;c<u;c++){let f=this.top.children[c];if(f.matchesMark(e[o])&&!this.isLocked(f.dom)){l=c;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=tr.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,i){let a=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))a=this.top.children.indexOf(o,this.index);else for(let s=this.index,l=Math.min(this.top.children.length,s+5);s<l;s++){let u=this.top.children[s];if(u.matchesNode(e,t,n)&&!this.preMatch.matched.has(u)){a=s;break}}return a<0?!1:(this.destroyBetween(this.index,a),this.index++,!0)}updateNodeAt(e,t,n,i,a){let o=this.top.children[i];return o.dirty==et&&o.dom==o.contentDOM&&(o.dirty=er),o.update(e,t,n,a)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==n)return i}return-1}e=t}}updateNextNode(e,t,n,i,a,o){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof At){let u=this.preMatch.matched.get(l);if(u!=null&&u!=a)return!1;let c=l.dom,f,d=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=et&&Zn(t,l.outerDeco));if(!d&&l.update(e,t,n,i))return this.destroyBetween(this.index,s),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!d&&(f=this.recreateWrapper(l,e,t,n,i,o)))return this.destroyBetween(this.index,s),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=er,f.updateChildren(i,o+1),f.dirty=$e),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,i,a,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Zn(n,e.outerDeco)||!i.eq(e.innerDeco))return null;let s=At.create(this.top,t,n,i,a,o);if(s.contentDOM){s.children=e.children,e.children=[];for(let l of s.children)l.parent=s}return e.destroy(),s}addNode(e,t,n,i,a){let o=At.create(this.top,e,t,n,i,a);o.contentDOM&&o.updateChildren(i,a+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let a=new fu(this.top,e,t,n);this.top.children.splice(this.index++,0,a),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof tr;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Qn)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((ge||le)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let i=new hu(this.top,[],n,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Om(r,e){let t=e,n=t.children.length,i=r.childCount,a=new Map,o=[];e:for(;i>0;){let s;for(;;)if(n){let u=t.children[n-1];if(u instanceof tr)t=u,n=u.children.length;else{s=u,n--;break}}else{if(t==e)break e;n=t.parent.children.indexOf(t),t=t.parent}let l=s.node;if(l){if(l!=r.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Lm(r,e){return r.type.side-e.type.side}function Nm(r,e,t,n){let i=e.locals(r),a=0;if(i.length==0){for(let u=0;u<r.childCount;u++){let c=r.child(u);n(c,i,e.forChild(a,c),u),a+=c.nodeSize}return}let o=0,s=[],l=null;for(let u=0;;){let c,f;for(;o<i.length&&i[o].to==a;){let m=i[o++];m.widget&&(c?(f||(f=[c])).push(m):c=m)}if(c)if(f){f.sort(Lm);for(let m=0;m<f.length;m++)t(f[m],u,!!l)}else t(c,u,!!l);let d,h;if(l)h=-1,d=l,l=null;else if(u<r.childCount)h=u,d=r.child(u++);else break;for(let m=0;m<s.length;m++)s[m].to<=a&&s.splice(m--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let p=a+d.nodeSize;if(d.isText){let m=p;o<i.length&&i[o].from<m&&(m=i[o].from);for(let g=0;g<s.length;g++)s[g].to<m&&(m=s[g].to);m<p&&(l=d.cut(m-a),d=d.cut(0,m-a),p=m,h=-1)}else for(;o<i.length&&i[o].to<p;)o++;let v=d.isInline&&!d.isLeaf?s.filter(m=>!m.inline):s.slice();n(d,v,e.forChild(a,d),h),a=p}}function Am(r){if(r.nodeName=="UL"||r.nodeName=="OL"){let e=r.style.cssText;r.style.cssText=e+"; list-style: square !important",window.getComputedStyle(r).listStyle,r.style.cssText=e}}function Dm(r,e,t,n){for(let i=0,a=0;i<r.childCount&&a<=n;){let o=r.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<r.childCount;){let u=r.child(i++);if(a+=u.nodeSize,!u.isText)break;l+=u.text}if(a>=t){if(a>=n&&l.slice(n-e.length-s,n-s)==e)return n-e.length;let u=s<n?l.lastIndexOf(e,n-s-1):-1;if(u>=0&&u+e.length+s>=t)return s+u;if(t==n&&l.length>=n+e.length-s&&l.slice(n-s,n-s+e.length)==e)return n}}return-1}function Ra(r,e,t,n,i){let a=[];for(let o=0,s=0;o<r.length;o++){let l=r[o],u=s,c=s+=l.size;u>=t||c<=e?a.push(l):(u<e&&a.push(l.slice(0,e-u,n)),i&&(a.push(i),i=void 0),c>t&&a.push(l.slice(t-u,l.size,n)))}return a}function Ba(r,e=null){let t=r.domSelectionRange(),n=r.state.doc;if(!t.focusNode)return null;let i=r.docView.nearestDesc(t.focusNode),a=i&&i.size==0,o=r.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let s=n.resolve(o),l,u;if(Yn(t)){for(l=o;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&R.isSelectable(f)&&i.parent&&!(f.isInline&&am(t.focusNode,t.focusOffset,i.dom))){let d=i.posBefore;u=new R(o==d?s:n.resolve(d))}}else{if(t instanceof r.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let f=o,d=o;for(let h=0;h<t.rangeCount;h++){let p=t.getRangeAt(h);f=Math.min(f,r.docView.posFromDOM(p.startContainer,p.startOffset,1)),d=Math.max(d,r.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(f<0)return null;[l,o]=d==r.state.selection.anchor?[d,f]:[f,d],s=n.resolve(o)}else l=r.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(l<0)return null}let c=n.resolve(l);if(!u){let f=e=="pointer"||r.state.selection.head<s.pos&&!a?1:-1;u=Ha(r,c,s,f)}return u}function yu(r){return r.editable?r.hasFocus():Eu(r)&&document.activeElement&&document.activeElement.contains(r.dom)}function dt(r,e=!1){let t=r.state.selection;if(Cu(r,t),!!yu(r)){if(!e&&r.input.mouseDown&&r.input.mouseDown.allowDefault&&le){let n=r.domSelectionRange(),i=r.domObserver.currentSelection;if(n.anchorNode&&i.anchorNode&&Qt(n.anchorNode,n.anchorOffset,i.anchorNode,i.anchorOffset)){r.input.mouseDown.delayedSelectionSync=!0,r.domObserver.setCurSelection();return}}if(r.domObserver.disconnectSelection(),r.cursorWrapper)Rm(r);else{let{anchor:n,head:i}=t,a,o;bu&&!(t instanceof q)&&(t.$from.parent.inlineContent||(a=wu(r,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(o=wu(r,t.to))),r.docView.setSelection(n,i,r,e),bu&&(a&&ku(a),o&&ku(o)),t.visible?r.dom.classList.remove("ProseMirror-hideselection"):(r.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Im(r))}r.domObserver.setCurSelection(),r.domObserver.connectSelection()}}const bu=ge||le&&Yl<63;function wu(r,e){let{node:t,offset:n}=r.docView.domFromPos(e,0),i=n<t.childNodes.length?t.childNodes[n]:null,a=n?t.childNodes[n-1]:null;if(ge&&i&&i.contentEditable=="false")return Pa(i);if((!i||i.contentEditable=="false")&&(!a||a.contentEditable=="false")){if(i)return Pa(i);if(a)return Pa(a)}}function Pa(r){return r.contentEditable="true",ge&&r.draggable&&(r.draggable=!1,r.wasDraggable=!0),r}function ku(r){r.contentEditable="false",r.wasDraggable&&(r.draggable=!0,r.wasDraggable=null)}function Im(r){let e=r.dom.ownerDocument;e.removeEventListener("selectionchange",r.input.hideSelectionGuard);let t=r.domSelectionRange(),n=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",r.input.hideSelectionGuard=()=>{(t.anchorNode!=n||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!yu(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})}function Rm(r){let e=r.domSelection();if(!e)return;let t=r.cursorWrapper.dom,n=t.nodeName=="IMG";n?e.collapse(t.parentNode,se(t)+1):e.collapse(t,0),!n&&!r.state.selection.visible&&De&&Lt<=11&&(t.disabled=!0,t.disabled=!1)}function Cu(r,e){if(e instanceof R){let t=r.docView.descAt(e.from);t!=r.lastSelectedViewDesc&&(Tu(r),t&&t.selectNode(),r.lastSelectedViewDesc=t)}else Tu(r)}function Tu(r){r.lastSelectedViewDesc&&(r.lastSelectedViewDesc.parent&&r.lastSelectedViewDesc.deselectNode(),r.lastSelectedViewDesc=void 0)}function Ha(r,e,t,n){return r.someProp("createSelectionBetween",i=>i(r,e,t))||q.between(e,t,n)}function xu(r){return r.editable&&!r.hasFocus()?!1:Eu(r)}function Eu(r){let e=r.domSelectionRange();if(!e.anchorNode)return!1;try{return r.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(r.editable||r.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Bm(r){let e=r.docView.domFromPos(r.state.selection.anchor,0),t=r.domSelectionRange();return Qt(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Fa(r,e){let{$anchor:t,$head:n}=r.selection,i=e>0?t.max(n):t.min(n),a=i.parent.inlineContent?i.depth?r.doc.resolve(e>0?i.after():i.before()):null:i;return a&&F.findFrom(a,e)}function Dt(r,e){return r.dispatch(r.state.tr.setSelection(e).scrollIntoView()),!0}function Mu(r,e,t){let n=r.state.selection;if(n instanceof q)if(t.indexOf("s")>-1){let{$head:i}=n,a=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;let o=r.state.doc.resolve(i.pos+a.nodeSize*(e<0?-1:1));return Dt(r,new q(n.$anchor,o))}else if(n.empty){if(r.endOfTextblock(e>0?"forward":"backward")){let i=Fa(r.state,e);return i&&i instanceof R?Dt(r,i):!1}else if(!(_e&&t.indexOf("m")>-1)){let i=n.$head,a=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!a||a.isText)return!1;let s=e<0?i.pos-a.nodeSize:i.pos;return a.isAtom||(o=r.docView.descAt(s))&&!o.contentDOM?R.isSelectable(a)?Dt(r,new R(e<0?r.state.doc.resolve(i.pos-a.nodeSize):i)):dn?Dt(r,new q(r.state.doc.resolve(e<0?s:s+a.nodeSize))):!1:!1}}else return!1;else{if(n instanceof R&&n.node.isInline)return Dt(r,new q(e>0?n.$to:n.$from));{let i=Fa(r.state,e);return i?Dt(r,i):!1}}}function ei(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function mn(r,e){let t=r.pmViewDesc;return t&&t.size==0&&(e<0||r.nextSibling||r.nodeName!="BR")}function Er(r,e){return e<0?Pm(r):Hm(r)}function Pm(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i,a,o=!1;for(qe&&t.nodeType==1&&n<ei(t)&&mn(t.childNodes[n],-1)&&(o=!0);;)if(n>0){if(t.nodeType!=1)break;{let s=t.childNodes[n-1];if(mn(s,-1))i=t,a=--n;else if(s.nodeType==3)t=s,n=t.nodeValue.length;else break}}else{if(Su(t))break;{let s=t.previousSibling;for(;s&&mn(s,-1);)i=t.parentNode,a=se(s),s=s.previousSibling;if(s)t=s,n=ei(t);else{if(t=t.parentNode,t==r.dom)break;n=0}}}o?qa(r,t,n):i&&qa(r,i,a)}function Hm(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i=ei(t),a,o;for(;;)if(n<i){if(t.nodeType!=1)break;let s=t.childNodes[n];if(mn(s,1))a=t,o=++n;else break}else{if(Su(t))break;{let s=t.nextSibling;for(;s&&mn(s,1);)a=s.parentNode,o=se(s)+1,s=s.nextSibling;if(s)t=s,n=0,i=ei(t);else{if(t=t.parentNode,t==r.dom)break;n=i=0}}}a&&qa(r,a,o)}function Su(r){let e=r.pmViewDesc;return e&&e.node&&e.node.isBlock}function Fm(r,e){for(;r&&e==r.childNodes.length&&!fn(r);)e=se(r)+1,r=r.parentNode;for(;r&&e<r.childNodes.length;){let t=r.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;r=t,e=0}}function qm(r,e){for(;r&&!e&&!fn(r);)e=se(r),r=r.parentNode;for(;r&&e;){let t=r.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;r=t,e=r.childNodes.length}}function qa(r,e,t){if(e.nodeType!=3){let a,o;(o=Fm(e,t))?(e=o,t=0):(a=qm(e,t))&&(e=a,t=a.nodeValue.length)}let n=r.domSelection();if(!n)return;if(Yn(n)){let a=document.createRange();a.setEnd(e,t),a.setStart(e,t),n.removeAllRanges(),n.addRange(a)}else n.extend&&n.extend(e,t);r.domObserver.setCurSelection();let{state:i}=r;setTimeout(()=>{r.state==i&&dt(r)},50)}function Ou(r,e){let t=r.state.doc.resolve(e);if(!(le||Ql)&&t.parent.inlineContent){let i=r.coordsAtPos(e);if(e>t.start()){let a=r.coordsAtPos(e-1),o=(a.top+a.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(a.left-i.left)>1)return a.left<i.left?"ltr":"rtl"}if(e<t.end()){let a=r.coordsAtPos(e+1),o=(a.top+a.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(a.left-i.left)>1)return a.left>i.left?"ltr":"rtl"}}return getComputedStyle(r.dom).direction=="rtl"?"rtl":"ltr"}function Lu(r,e,t){let n=r.state.selection;if(n instanceof q&&!n.empty||t.indexOf("s")>-1||_e&&t.indexOf("m")>-1)return!1;let{$from:i,$to:a}=n;if(!i.parent.inlineContent||r.endOfTextblock(e<0?"up":"down")){let o=Fa(r.state,e);if(o&&o instanceof R)return Dt(r,o)}if(!i.parent.inlineContent){let o=e<0?i:a,s=n instanceof Me?F.near(o,e):F.findFrom(o,e);return s?Dt(r,s):!1}return!1}function Nu(r,e){if(!(r.state.selection instanceof q))return!0;let{$head:t,$anchor:n,empty:i}=r.state.selection;if(!t.sameParent(n))return!0;if(!i)return!1;if(r.endOfTextblock(e>0?"forward":"backward"))return!0;let a=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(a&&!a.isText){let o=r.state.tr;return e<0?o.delete(t.pos-a.nodeSize,t.pos):o.delete(t.pos,t.pos+a.nodeSize),r.dispatch(o),!0}return!1}function Au(r,e,t){r.domObserver.stop(),e.contentEditable=t,r.domObserver.start()}function _m(r){if(!ge||r.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;Au(r,n,"true"),setTimeout(()=>Au(r,n,"false"),20)}return!1}function $m(r){let e="";return r.ctrlKey&&(e+="c"),r.metaKey&&(e+="m"),r.altKey&&(e+="a"),r.shiftKey&&(e+="s"),e}function zm(r,e){let t=e.keyCode,n=$m(e);if(t==8||_e&&t==72&&n=="c")return Nu(r,-1)||Er(r,-1);if(t==46&&!e.shiftKey||_e&&t==68&&n=="c")return Nu(r,1)||Er(r,1);if(t==13||t==27)return!0;if(t==37||_e&&t==66&&n=="c"){let i=t==37?Ou(r,r.state.selection.from)=="ltr"?-1:1:-1;return Mu(r,i,n)||Er(r,i)}else if(t==39||_e&&t==70&&n=="c"){let i=t==39?Ou(r,r.state.selection.from)=="ltr"?1:-1:1;return Mu(r,i,n)||Er(r,i)}else{if(t==38||_e&&t==80&&n=="c")return Lu(r,-1,n)||Er(r,-1);if(t==40||_e&&t==78&&n=="c")return _m(r)||Lu(r,1,n)||Er(r,1);if(n==(_e?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function _a(r,e){r.someProp("transformCopied",h=>{e=h(e,r)});let t=[],{content:n,openStart:i,openEnd:a}=e;for(;i>1&&a>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,a--;let h=n.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),n=h.content}let o=r.someProp("clipboardSerializer")||gr.fromSchema(r.state.schema),s=qu(),l=s.createElement("div");l.appendChild(o.serializeFragment(n,{document:s}));let u=l.firstChild,c,f=0;for(;u&&u.nodeType==1&&(c=Hu[u.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let p=s.createElement(c[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),f++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${a}${f?` -${f}`:""} ${JSON.stringify(t)}`);let d=r.someProp("clipboardTextSerializer",h=>h(e,r))||e.content.textBetween(0,e.content.size,`

`);return{dom:l,text:d,slice:e}}function Du(r,e,t,n,i){let a=i.parent.type.spec.code,o,s;if(!t&&!e)return null;let l=!!e&&(n||a||!t);if(l){if(r.someProp("transformPastedText",d=>{e=d(e,a||n,r)}),a)return s=new S(C.from(r.state.schema.text(e.replace(/\r\n?/g,`
`))),0,0),r.someProp("transformPasted",d=>{s=d(s,r,!0)}),s;let f=r.someProp("clipboardTextParser",d=>d(e,i,n,r));if(f)s=f;else{let d=i.marks(),{schema:h}=r.state,p=gr.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let m=o.appendChild(document.createElement("p"));v&&m.appendChild(p.serializeNode(h.text(v,d)))})}}else r.someProp("transformPastedHTML",f=>{t=f(t,r)}),o=jm(t),dn&&Gm(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let d=o.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;o=d}if(s||(s=(r.someProp("clipboardParser")||r.someProp("domParser")||Jt.fromSchema(r.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||c),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!Vm.test(d.parentNode.nodeName)?{ignore:!0}:null}})),c)s=Km(Pu(s,+c[1],+c[2]),c[4]);else if(s=S.maxOpen(Um(s.content,i),!0),s.openStart||s.openEnd){let f=0,d=0;for(let h=s.content.firstChild;f<s.openStart&&!h.type.spec.isolating;f++,h=h.firstChild);for(let h=s.content.lastChild;d<s.openEnd&&!h.type.spec.isolating;d++,h=h.lastChild);s=Pu(s,f,d)}return r.someProp("transformPasted",f=>{s=f(s,r,l)}),s}const Vm=/^(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 Um(r,e){if(r.childCount<2)return r;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),a,o=[];if(r.forEach(s=>{if(!o)return;let l=i.findWrapping(s.type),u;if(!l)return o=null;if(u=o.length&&a.length&&Ru(l,a,s,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=Bu(o[o.length-1],a.length));let c=Iu(s,l);o.push(c),i=i.matchType(c.type),a=l}}),o)return C.from(o)}return r}function Iu(r,e,t=0){for(let n=e.length-1;n>=t;n--)r=e[n].create(null,C.from(r));return r}function Ru(r,e,t,n,i){if(i<r.length&&i<e.length&&r[i]==e[i]){let a=Ru(r,e,t,n.lastChild,i+1);if(a)return n.copy(n.content.replaceChild(n.childCount-1,a));if(n.contentMatchAt(n.childCount).matchType(i==r.length-1?t.type:r[i+1]))return n.copy(n.content.append(C.from(Iu(t,r,i+1))))}}function Bu(r,e){if(e==0)return r;let t=r.content.replaceChild(r.childCount-1,Bu(r.lastChild,e-1)),n=r.contentMatchAt(r.childCount).fillBefore(C.empty,!0);return r.copy(t.append(n))}function $a(r,e,t,n,i,a){let o=e<0?r.firstChild:r.lastChild,s=o.content;return r.childCount>1&&(a=0),i<n-1&&(s=$a(s,e,t,n,i+1,a)),i>=t&&(s=e<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(C.empty,!0))),r.replaceChild(e<0?0:r.childCount-1,o.copy(s))}function Pu(r,e,t){return e<r.openStart&&(r=new S($a(r.content,-1,e,r.openStart,0,r.openEnd),e,r.openEnd)),t<r.openEnd&&(r=new S($a(r.content,1,t,r.openEnd,0,0),r.openStart,t)),r}const Hu={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 Fu=null;function qu(){return Fu||(Fu=document.implementation.createHTMLDocument("title"))}let za=null;function Wm(r){let e=window.trustedTypes;return e?(za||(za=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),za.createHTML(r)):r}function jm(r){let e=/^(\s*<meta [^>]*>)*/.exec(r);e&&(r=r.slice(e[0].length));let t=qu().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(r),i;if((i=n&&Hu[n[1].toLowerCase()])&&(r=i.map(a=>"<"+a+">").join("")+r+i.map(a=>"</"+a+">").reverse().join("")),t.innerHTML=Wm(r),i)for(let a=0;a<i.length;a++)t=t.querySelector(i[a])||t;return t}function Gm(r){let e=r.querySelectorAll(le?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let n=e[t];n.childNodes.length==1&&n.textContent==" "&&n.parentNode&&n.parentNode.replaceChild(r.ownerDocument.createTextNode(" "),n)}}function Km(r,e){if(!r.size)return r;let t=r.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return r}let{content:i,openStart:a,openEnd:o}=r;for(let s=n.length-2;s>=0;s-=2){let l=t.nodes[n[s]];if(!l||l.hasRequiredAttrs())break;i=C.from(l.create(n[s+1],i)),a++,o++}return new S(i,a,o)}const Se={},Oe={},Jm={touchstart:!0,touchmove:!0};class Xm{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.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Ym(r){for(let e in Se){let t=Se[e];r.dom.addEventListener(e,r.input.eventHandlers[e]=n=>{Zm(r,n)&&!Ua(r,n)&&(r.editable||!(n.type in Oe))&&t(r,n)},Jm[e]?{passive:!0}:void 0)}ge&&r.dom.addEventListener("input",()=>null),Va(r)}function It(r,e){r.input.lastSelectionOrigin=e,r.input.lastSelectionTime=Date.now()}function Qm(r){r.domObserver.stop();for(let e in r.input.eventHandlers)r.dom.removeEventListener(e,r.input.eventHandlers[e]);clearTimeout(r.input.composingTimeout),clearTimeout(r.input.lastIOSEnterFallbackTimeout)}function Va(r){r.someProp("handleDOMEvents",e=>{for(let t in e)r.input.eventHandlers[t]||r.dom.addEventListener(t,r.input.eventHandlers[t]=n=>Ua(r,n))})}function Ua(r,e){return r.someProp("handleDOMEvents",t=>{let n=t[e.type];return n?n(r,e)||e.defaultPrevented:!1})}function Zm(r,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=r.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function eg(r,e){!Ua(r,e)&&Se[e.type]&&(r.editable||!(e.type in Oe))&&Se[e.type](r,e)}Oe.keydown=(r,e)=>{let t=e;if(r.input.shiftKey=t.keyCode==16||t.shiftKey,!$u(r,t)&&(r.input.lastKeyCode=t.keyCode,r.input.lastKeyCodeTime=Date.now(),!(ct&&le&&t.keyCode==13)))if(t.keyCode!=229&&r.domObserver.forceFlush(),Tr&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let n=Date.now();r.input.lastIOSEnter=n,r.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{r.input.lastIOSEnter==n&&(r.someProp("handleKeyDown",i=>i(r,Zt(13,"Enter"))),r.input.lastIOSEnter=0)},200)}else r.someProp("handleKeyDown",n=>n(r,t))||zm(r,t)?t.preventDefault():It(r,"key")},Oe.keyup=(r,e)=>{e.keyCode==16&&(r.input.shiftKey=!1)},Oe.keypress=(r,e)=>{let t=e;if($u(r,t)||!t.charCode||t.ctrlKey&&!t.altKey||_e&&t.metaKey)return;if(r.someProp("handleKeyPress",i=>i(r,t))){t.preventDefault();return}let n=r.state.selection;if(!(n instanceof q)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(t.charCode),a=()=>r.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!r.someProp("handleTextInput",o=>o(r,n.$from.pos,n.$to.pos,i,a))&&r.dispatch(a()),t.preventDefault()}};function ti(r){return{left:r.clientX,top:r.clientY}}function tg(r,e){let t=e.x-r.clientX,n=e.y-r.clientY;return t*t+n*n<100}function Wa(r,e,t,n,i){if(n==-1)return!1;let a=r.state.doc.resolve(n);for(let o=a.depth+1;o>0;o--)if(r.someProp(e,s=>o>a.depth?s(r,t,a.nodeAfter,a.before(o),i,!0):s(r,t,a.node(o),a.before(o),i,!1)))return!0;return!1}function Mr(r,e,t){if(r.focused||r.focus(),r.state.selection.eq(e))return;let n=r.state.tr.setSelection(e);n.setMeta("pointer",!0),r.dispatch(n)}function rg(r,e){if(e==-1)return!1;let t=r.state.doc.resolve(e),n=t.nodeAfter;return n&&n.isAtom&&R.isSelectable(n)?(Mr(r,new R(t)),!0):!1}function ng(r,e){if(e==-1)return!1;let t=r.state.selection,n,i;t instanceof R&&(n=t.node);let a=r.state.doc.resolve(e);for(let o=a.depth+1;o>0;o--){let s=o>a.depth?a.nodeAfter:a.node(o);if(R.isSelectable(s)){n&&t.$from.depth>0&&o>=t.$from.depth&&a.before(t.$from.depth+1)==t.$from.pos?i=a.before(t.$from.depth):i=a.before(o);break}}return i!=null?(Mr(r,R.create(r.state.doc,i)),!0):!1}function ig(r,e,t,n,i){return Wa(r,"handleClickOn",e,t,n)||r.someProp("handleClick",a=>a(r,e,n))||(i?ng(r,t):rg(r,t))}function ag(r,e,t,n){return Wa(r,"handleDoubleClickOn",e,t,n)||r.someProp("handleDoubleClick",i=>i(r,e,n))}function og(r,e,t,n){return Wa(r,"handleTripleClickOn",e,t,n)||r.someProp("handleTripleClick",i=>i(r,e,n))||sg(r,t,n)}function sg(r,e,t){if(t.button!=0)return!1;let n=r.state.doc;if(e==-1)return n.inlineContent?(Mr(r,q.create(n,0,n.content.size)),!0):!1;let i=n.resolve(e);for(let a=i.depth+1;a>0;a--){let o=a>i.depth?i.nodeAfter:i.node(a),s=i.before(a);if(o.inlineContent)Mr(r,q.create(n,s+1,s+1+o.content.size));else if(R.isSelectable(o))Mr(r,R.create(n,s));else continue;return!0}}function ja(r){return ri(r)}const _u=_e?"metaKey":"ctrlKey";Se.mousedown=(r,e)=>{let t=e;r.input.shiftKey=t.shiftKey;let n=ja(r),i=Date.now(),a="singleClick";i-r.input.lastClick.time<500&&tg(t,r.input.lastClick)&&!t[_u]&&r.input.lastClick.button==t.button&&(r.input.lastClick.type=="singleClick"?a="doubleClick":r.input.lastClick.type=="doubleClick"&&(a="tripleClick")),r.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:a,button:t.button};let o=r.posAtCoords(ti(t));o&&(a=="singleClick"?(r.input.mouseDown&&r.input.mouseDown.done(),r.input.mouseDown=new lg(r,o,t,!!n)):(a=="doubleClick"?ag:og)(r,o.pos,o.inside,t)?t.preventDefault():It(r,"pointer"))};class lg{constructor(e,t,n,i){this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[_u],this.allowDefault=n.shiftKey;let a,o;if(t.inside>-1)a=e.state.doc.nodeAt(t.inside),o=t.inside;else{let c=e.state.doc.resolve(t.pos);a=c.parent,o=c.depth?c.before():0}const s=i?null:n.target,l=s?e.docView.nearestDesc(s,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=e.state;(n.button==0&&a.type.spec.draggable&&a.type.spec.selectable!==!1||u instanceof R&&u.from<=o&&u.to>o)&&(this.mightDrag={node:a,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&qe&&!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)),It(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(()=>dt(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(ti(e))),this.updateAllowDefault(e),this.allowDefault||!t?It(this.view,"pointer"):ig(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ge&&this.mightDrag&&!this.mightDrag.node.isAtom||le&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Mr(this.view,F.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):It(this.view,"pointer")}move(e){this.updateAllowDefault(e),It(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)}}Se.touchstart=r=>{r.input.lastTouch=Date.now(),ja(r),It(r,"pointer")},Se.touchmove=r=>{r.input.lastTouch=Date.now(),It(r,"pointer")},Se.contextmenu=r=>ja(r);function $u(r,e){return r.composing?!0:ge&&Math.abs(e.timeStamp-r.input.compositionEndedAt)<500?(r.input.compositionEndedAt=-2e8,!0):!1}const ug=ct?5e3:-1;Oe.compositionstart=Oe.compositionupdate=r=>{if(!r.composing){r.domObserver.flush();let{state:e}=r,t=e.selection.$to;if(e.selection instanceof q&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)||le&&Ql&&cg(r)))r.markCursor=r.state.storedMarks||t.marks(),ri(r,!0),r.markCursor=null;else if(ri(r,!e.selection.empty),qe&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let n=r.domSelectionRange();for(let i=n.focusNode,a=n.focusOffset;i&&i.nodeType==1&&a!=0;){let o=a<0?i.lastChild:i.childNodes[a-1];if(!o)break;if(o.nodeType==3){let s=r.domSelection();s&&s.collapse(o,o.nodeValue.length);break}else i=o,a=-1}}r.input.composing=!0}zu(r,ug)};function cg(r){let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let n=e.childNodes[t];return n.nodeType==1&&n.contentEditable=="false"}Oe.compositionend=(r,e)=>{r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=e.timeStamp,r.input.compositionPendingChanges=r.domObserver.pendingRecords().length?r.input.compositionID:0,r.input.compositionNode=null,r.input.badSafariComposition?r.domObserver.forceFlush():r.input.compositionPendingChanges&&Promise.resolve().then(()=>r.domObserver.flush()),r.input.compositionID++,zu(r,20))};function zu(r,e){clearTimeout(r.input.composingTimeout),e>-1&&(r.input.composingTimeout=setTimeout(()=>ri(r),e))}function Vu(r){for(r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=dg());r.input.compositionNodes.length>0;)r.input.compositionNodes.pop().markParentsDirty()}function fg(r){let e=r.domSelectionRange();if(!e.focusNode)return null;let t=nm(e.focusNode,e.focusOffset),n=im(e.focusNode,e.focusOffset);if(t&&n&&t!=n){let i=n.pmViewDesc,a=r.domObserver.lastChangedTextNode;if(t==a||n==a)return a;if(!i||!i.isText(n.nodeValue))return n;if(r.input.compositionNode==n){let o=t.pmViewDesc;if(!(!o||!o.isText(t.nodeValue)))return n}}return t||n}function dg(){let r=document.createEvent("Event");return r.initEvent("event",!0,!0),r.timeStamp}function ri(r,e=!1){if(!(ct&&r.domObserver.flushingSoon>=0)){if(r.domObserver.forceFlush(),Vu(r),e||r.docView&&r.docView.dirty){let t=Ba(r),n=r.state.selection;return t&&!t.eq(n)?r.dispatch(r.state.tr.setSelection(t)):(r.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?r.dispatch(r.state.tr.deleteSelection()):r.updateState(r.state),!0}return!1}}function hg(r,e){if(!r.dom.parentNode)return;let t=r.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),r.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),r.focus()},50)}const gn=De&&Lt<15||Tr&&lm<604;Se.copy=Oe.cut=(r,e)=>{let t=e,n=r.state.selection,i=t.type=="cut";if(n.empty)return;let a=gn?null:t.clipboardData,o=n.content(),{dom:s,text:l}=_a(r,o);a?(t.preventDefault(),a.clearData(),a.setData("text/html",s.innerHTML),a.setData("text/plain",l)):hg(r,s),i&&r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function pg(r){return r.openStart==0&&r.openEnd==0&&r.content.childCount==1?r.content.firstChild:null}function vg(r,e){if(!r.dom.parentNode)return;let t=r.input.shiftKey||r.state.selection.$from.parent.type.spec.code,n=r.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=r.input.shiftKey&&r.input.lastKeyCode!=45;setTimeout(()=>{r.focus(),n.parentNode&&n.parentNode.removeChild(n),t?yn(r,n.value,null,i,e):yn(r,n.textContent,n.innerHTML,i,e)},50)}function yn(r,e,t,n,i){let a=Du(r,e,t,n,r.state.selection.$from);if(r.someProp("handlePaste",l=>l(r,i,a||S.empty)))return!0;if(!a)return!1;let o=pg(a),s=o?r.state.tr.replaceSelectionWith(o,n):r.state.tr.replaceSelection(a);return r.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Uu(r){let e=r.getData("text/plain")||r.getData("Text");if(e)return e;let t=r.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Oe.paste=(r,e)=>{let t=e;if(r.composing&&!ct)return;let n=gn?null:t.clipboardData,i=r.input.shiftKey&&r.input.lastKeyCode!=45;n&&yn(r,Uu(n),n.getData("text/html"),i,t)?t.preventDefault():vg(r,t)};class Wu{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const mg=_e?"altKey":"ctrlKey";function ju(r,e){let t=r.someProp("dragCopies",n=>!n(e));return t??!e[mg]}Se.dragstart=(r,e)=>{let t=e,n=r.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let i=r.state.selection,a=i.empty?null:r.posAtCoords(ti(t)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof R?i.to-1:i.to))){if(n&&n.mightDrag)o=R.create(r.state.doc,n.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let f=r.docView.nearestDesc(t.target,!0);f&&f.node.type.spec.draggable&&f!=r.docView&&(o=R.create(r.state.doc,f.posBefore))}}let s=(o||r.state.selection).content(),{dom:l,text:u,slice:c}=_a(r,s);(!t.dataTransfer.files.length||!le||Yl>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(gn?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",gn||t.dataTransfer.setData("text/plain",u),r.dragging=new Wu(c,ju(r,t),o)},Se.dragend=r=>{let e=r.dragging;window.setTimeout(()=>{r.dragging==e&&(r.dragging=null)},50)},Oe.dragover=Oe.dragenter=(r,e)=>e.preventDefault(),Oe.drop=(r,e)=>{try{gg(r,e,r.dragging)}finally{r.dragging=null}};function gg(r,e,t){if(!e.dataTransfer)return;let n=r.posAtCoords(ti(e));if(!n)return;let i=r.state.doc.resolve(n.pos),a=t&&t.slice;a?r.someProp("transformPasted",h=>{a=h(a,r,!1)}):a=Du(r,Uu(e.dataTransfer),gn?null:e.dataTransfer.getData("text/html"),!1,i);let o=!!(t&&ju(r,e));if(r.someProp("handleDrop",h=>h(r,e,a||S.empty,o))){e.preventDefault();return}if(!a)return;e.preventDefault();let s=a?Uv(r.state.doc,i.pos,a):i.pos;s==null&&(s=i.pos);let l=r.state.tr;if(o){let{node:h}=t;h?h.replace(l):l.deleteSelection()}let u=l.mapping.map(s),c=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,f=l.doc;if(c?l.replaceRangeWith(u,u,a.content.firstChild):l.replaceRange(u,u,a),l.doc.eq(f))return;let d=l.doc.resolve(u);if(c&&R.isSelectable(a.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(a.content.firstChild))l.setSelection(new R(d));else{let h=l.mapping.map(s);l.mapping.maps[l.mapping.maps.length-1].forEach((p,v,m,g)=>h=g),l.setSelection(Ha(r,d,l.doc.resolve(h)))}r.focus(),r.dispatch(l.setMeta("uiEvent","drop"))}Se.focus=r=>{r.input.lastFocus=Date.now(),r.focused||(r.domObserver.stop(),r.dom.classList.add("ProseMirror-focused"),r.domObserver.start(),r.focused=!0,setTimeout(()=>{r.docView&&r.hasFocus()&&!r.domObserver.currentSelection.eq(r.domSelectionRange())&&dt(r)},20))},Se.blur=(r,e)=>{let t=e;r.focused&&(r.domObserver.stop(),r.dom.classList.remove("ProseMirror-focused"),r.domObserver.start(),t.relatedTarget&&r.dom.contains(t.relatedTarget)&&r.domObserver.currentSelection.clear(),r.focused=!1)},Se.beforeinput=(r,e)=>{if(le&&ct&&e.inputType=="deleteContentBackward"){r.domObserver.flushSoon();let{domChangeCount:n}=r.input;setTimeout(()=>{if(r.input.domChangeCount!=n||(r.dom.blur(),r.focus(),r.someProp("handleKeyDown",a=>a(r,Zt(8,"Backspace")))))return;let{$cursor:i}=r.state.selection;i&&i.pos>0&&r.dispatch(r.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let r in Oe)Se[r]=Oe[r];function bn(r,e){if(r==e)return!0;for(let t in r)if(r[t]!==e[t])return!1;for(let t in e)if(!(t in r))return!1;return!0}class ni{constructor(e,t){this.toDOM=e,this.spec=t||nr,this.side=this.spec.side||0}map(e,t,n,i){let{pos:a,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new Ie(a-n,a-n,this)}valid(){return!0}eq(e){return this==e||e instanceof ni&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&bn(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Rt{constructor(e,t){this.attrs=e,this.spec=t||nr}map(e,t,n,i){let a=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return a>=o?null:new Ie(a,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Rt&&bn(this.attrs,e.attrs)&&bn(this.spec,e.spec)}static is(e){return e.type instanceof Rt}destroy(){}}class Ga{constructor(e,t){this.attrs=e,this.spec=t||nr}map(e,t,n,i){let a=e.mapResult(t.from+i,1);if(a.deleted)return null;let o=e.mapResult(t.to+i,-1);return o.deleted||o.pos<=a.pos?null:new Ie(a.pos-n,o.pos-n,this)}valid(e,t){let{index:n,offset:i}=e.content.findIndex(t.from),a;return i==t.from&&!(a=e.child(n)).isText&&i+a.nodeSize==t.to}eq(e){return this==e||e instanceof Ga&&bn(this.attrs,e.attrs)&&bn(this.spec,e.spec)}destroy(){}}class Ie{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new Ie(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new Ie(e,e,new ni(t,n))}static inline(e,t,n,i){return new Ie(e,t,new Rt(n,i))}static node(e,t,n,i){return new Ie(e,t,new Ga(n,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Rt}get widget(){return this.type instanceof ni}}const Sr=[],nr={};class J{constructor(e,t){this.local=e.length?e:Sr,this.children=t.length?t:Sr}static create(e,t){return t.length?ii(t,e,0,nr):ye}find(e,t,n){let i=[];return this.findInner(e??0,t??1e9,i,0,n),i}findInner(e,t,n,i,a){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!a||a(s.spec))&&n.push(s.copy(s.from+i,s.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,i+s,a)}}map(e,t,n){return this==ye||e.maps.length==0?this:this.mapInner(e,t,0,0,n||nr)}mapInner(e,t,n,i,a){let o;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(e,n,i);l&&l.type.valid(t,l)?(o||(o=[])).push(l):a.onRemove&&a.onRemove(this.local[s].spec)}return this.children.length?yg(this.children,o||[],e,t,n,i,a):o?new J(o.sort(ir),Sr):ye}add(e,t){return t.length?this==ye?J.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let i,a=0;e.forEach((s,l)=>{let u=l+n,c;if(c=Ku(t,s,u)){for(i||(i=this.children.slice());a<i.length&&i[a]<l;)a+=3;i[a]==l?i[a+2]=i[a+2].addInner(s,c,u+1):i.splice(a,0,l,l+s.nodeSize,ii(c,s,u+1,nr)),a+=3}});let o=Gu(a?Ju(t):t,-n);for(let s=0;s<o.length;s++)o[s].type.valid(e,o[s])||o.splice(s--,1);return new J(o.length?this.local.concat(o).sort(ir):this.local,i||this.children)}remove(e){return e.length==0||this==ye?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,i=this.local;for(let a=0;a<n.length;a+=3){let o,s=n[a]+t,l=n[a+1]+t;for(let c=0,f;c<e.length;c++)(f=e[c])&&f.from>s&&f.to<l&&(e[c]=null,(o||(o=[])).push(f));if(!o)continue;n==this.children&&(n=this.children.slice());let u=n[a+2].removeInner(o,s+1);u!=ye?n[a+2]=u:(n.splice(a,3),a-=3)}if(i.length){for(let a=0,o;a<e.length;a++)if(o=e[a])for(let s=0;s<i.length;s++)i[s].eq(o,t)&&(i==this.local&&(i=this.local.slice()),i.splice(s--,1))}return n==this.children&&i==this.local?this:i.length||n.length?new J(i,n):ye}forChild(e,t){if(this==ye)return this;if(t.isLeaf)return J.empty;let n,i;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=e){this.children[s]==e&&(n=this.children[s+2]);break}let a=e+1,o=a+t.content.size;for(let s=0;s<this.local.length;s++){let l=this.local[s];if(l.from<o&&l.to>a&&l.type instanceof Rt){let u=Math.max(a,l.from)-a,c=Math.min(o,l.to)-a;u<c&&(i||(i=[])).push(l.copy(u,c))}}if(i){let s=new J(i.sort(ir),Sr);return n?new Bt([s,n]):s}return n||ye}eq(e){if(this==e)return!0;if(!(e instanceof J)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Ka(this.localsInner(e))}localsInner(e){if(this==ye)return Sr;if(e.inlineContent||!this.local.some(Rt.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof Rt||t.push(this.local[n]);return t}forEachSet(e){e(this)}}J.empty=new J([],[]),J.removeOverlap=Ka;const ye=J.empty;class Bt{constructor(e){this.members=e}map(e,t){const n=this.members.map(i=>i.map(e,t,nr));return Bt.from(n)}forChild(e,t){if(t.isLeaf)return J.empty;let n=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(e,t);a!=ye&&(a instanceof Bt?n=n.concat(a.members):n.push(a))}return Bt.from(n)}eq(e){if(!(e instanceof Bt)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let i=0;i<this.members.length;i++){let a=this.members[i].localsInner(e);if(a.length)if(!t)t=a;else{n&&(t=t.slice(),n=!1);for(let o=0;o<a.length;o++)t.push(a[o])}}return t?Ka(n?t:t.sort(ir)):Sr}static from(e){switch(e.length){case 0:return ye;case 1:return e[0];default:return new Bt(e.every(t=>t instanceof J)?e:e.reduce((t,n)=>t.concat(n instanceof J?n:n.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function yg(r,e,t,n,i,a,o){let s=r.slice();for(let u=0,c=a;u<t.maps.length;u++){let f=0;t.maps[u].forEach((d,h,p,v)=>{let m=v-p-(h-d);for(let g=0;g<s.length;g+=3){let w=s[g+1];if(w<0||d>w+c-f)continue;let k=s[g]+c-f;h>=k?s[g+1]=d<=k?-2:-1:d>=c&&m&&(s[g]+=m,s[g+1]+=m)}f+=m}),c=t.maps[u].map(c,-1)}let l=!1;for(let u=0;u<s.length;u+=3)if(s[u+1]<0){if(s[u+1]==-2){l=!0,s[u+1]=-1;continue}let c=t.map(r[u]+a),f=c-i;if(f<0||f>=n.content.size){l=!0;continue}let d=t.map(r[u+1]+a,-1),h=d-i,{index:p,offset:v}=n.content.findIndex(f),m=n.maybeChild(p);if(m&&v==f&&v+m.nodeSize==h){let g=s[u+2].mapInner(t,m,c+1,r[u]+a+1,o);g!=ye?(s[u]=f,s[u+1]=h,s[u+2]=g):(s[u+1]=-2,l=!0)}else l=!0}if(l){let u=bg(s,r,e,t,i,a,o),c=ii(u,n,0,o);e=c.local;for(let f=0;f<s.length;f+=3)s[f+1]<0&&(s.splice(f,3),f-=3);for(let f=0,d=0;f<c.children.length;f+=3){let h=c.children[f];for(;d<s.length&&s[d]<h;)d+=3;s.splice(d,0,c.children[f],c.children[f+1],c.children[f+2])}}return new J(e.sort(ir),s)}function Gu(r,e){if(!e||!r.length)return r;let t=[];for(let n=0;n<r.length;n++){let i=r[n];t.push(new Ie(i.from+e,i.to+e,i.type))}return t}function bg(r,e,t,n,i,a,o){function s(l,u){for(let c=0;c<l.local.length;c++){let f=l.local[c].map(n,i,u);f?t.push(f):o.onRemove&&o.onRemove(l.local[c].spec)}for(let c=0;c<l.children.length;c+=3)s(l.children[c+2],l.children[c]+u+1)}for(let l=0;l<r.length;l+=3)r[l+1]==-1&&s(r[l+2],e[l]+a+1);return t}function Ku(r,e,t){if(e.isLeaf)return null;let n=t+e.nodeSize,i=null;for(let a=0,o;a<r.length;a++)(o=r[a])&&o.from>t&&o.to<n&&((i||(i=[])).push(o),r[a]=null);return i}function Ju(r){let e=[];for(let t=0;t<r.length;t++)r[t]!=null&&e.push(r[t]);return e}function ii(r,e,t,n){let i=[],a=!1;e.forEach((s,l)=>{let u=Ku(r,s,l+t);if(u){a=!0;let c=ii(u,s,t+l+1,n);c!=ye&&i.push(l,l+s.nodeSize,c)}});let o=Gu(a?Ju(r):r,-t).sort(ir);for(let s=0;s<o.length;s++)o[s].type.valid(e,o[s])||(n.onRemove&&n.onRemove(o[s].spec),o.splice(s--,1));return o.length||i.length?new J(o,i):ye}function ir(r,e){return r.from-e.from||r.to-e.to}function Ka(r){let e=r;for(let t=0;t<e.length-1;t++){let n=e[t];if(n.from!=n.to)for(let i=t+1;i<e.length;i++){let a=e[i];if(a.from==n.from){a.to!=n.to&&(e==r&&(e=r.slice()),e[i]=a.copy(a.from,n.to),Xu(e,i+1,a.copy(n.to,a.to)));continue}else{a.from<n.to&&(e==r&&(e=r.slice()),e[t]=n.copy(n.from,a.from),Xu(e,i,n.copy(a.from,n.to)));break}}}return e}function Xu(r,e,t){for(;e<r.length&&ir(t,r[e])>0;)e++;r.splice(e,0,t)}function Ja(r){let e=[];return r.someProp("decorations",t=>{let n=t(r.state);n&&n!=ye&&e.push(n)}),r.cursorWrapper&&e.push(J.create(r.state.doc,[r.cursorWrapper.deco])),Bt.from(e)}const wg={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},kg=De&&Lt<=11;class Cg{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 Tg{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Cg,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;i<n.length;i++)this.queue.push(n[i]);De&&Lt<=11&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():ge&&e.composing&&n.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),kg&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.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,wg)),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 t=0;t<e.length;t++)this.queue.push(e[t]);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(xu(this.view)){if(this.suppressingSelectionUpdates)return dt(this.view);if(De&&Lt<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Qt(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 t=new Set,n;for(let a=e.focusNode;a;a=Cr(a))t.add(a);for(let a=e.anchorNode;a;a=Cr(a))if(t.has(a)){n=a;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))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 t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&xu(e)&&!this.ignoreSelectionChange(n),a=-1,o=-1,s=!1,l=[];if(e.editable)for(let c=0;c<t.length;c++){let f=this.registerMutation(t[c],l);f&&(a=a<0?f.from:Math.min(f.from,a),o=o<0?f.to:Math.max(f.to,o),f.typeOver&&(s=!0))}if(l.some(c=>c.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let c of l)if(c.nodeName=="BR"&&c.parentNode){let f=c.nextSibling;f&&f.nodeType==1&&f.contentEditable=="false"&&c.parentNode.removeChild(c)}}else if(qe&&l.length){let c=l.filter(f=>f.nodeName=="BR");if(c.length==2){let[f,d]=c;f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let d of c){let h=d.parentNode;h&&h.nodeName=="LI"&&(!f||Mg(e,f)!=h)&&d.remove()}}}let u=null;a<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Yn(n)&&(u=Ba(e))&&u.eq(F.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,dt(e),this.currentSelection.set(n),e.scrollToSelection()):(a>-1||i)&&(a>-1&&(e.docView.markDirty(a,o),xg(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Sg(e,l)),this.handleDOMChange(a,o,s,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||dt(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;c<e.addedNodes.length;c++){let f=e.addedNodes[c];t.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let i=e.previousSibling,a=e.nextSibling;if(De&&Lt<=11&&e.addedNodes.length)for(let c=0;c<e.addedNodes.length;c++){let{previousSibling:f,nextSibling:d}=e.addedNodes[c];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(a=d)}let o=i&&i.parentNode==e.target?se(i)+1:0,s=n.localPosFromDOM(e.target,o,-1),l=a&&a.parentNode==e.target?se(a):e.target.childNodes.length,u=n.localPosFromDOM(e.target,l,1);return{from:s,to:u}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Yu=new WeakMap,Qu=!1;function xg(r){if(!Yu.has(r)&&(Yu.set(r,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(r.dom).whiteSpace)!==-1)){if(r.requiresGeckoHackNode=qe,Qu)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."),Qu=!0}}function Zu(r,e){let t=e.startContainer,n=e.startOffset,i=e.endContainer,a=e.endOffset,o=r.domAtPos(r.state.selection.anchor);return Qt(o.node,o.offset,i,a)&&([t,n,i,a]=[i,a,t,n]),{anchorNode:t,anchorOffset:n,focusNode:i,focusOffset:a}}function Eg(r,e){if(e.getComposedRanges){let i=e.getComposedRanges(r.root)[0];if(i)return Zu(r,i)}let t;function n(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return r.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),r.dom.removeEventListener("beforeinput",n,!0),t?Zu(r,t):null}function Mg(r,e){for(let t=e.parentNode;t&&t!=r.dom;t=t.parentNode){let n=r.docView.nearestDesc(t,!0);if(n&&n.node.isBlock)return t}return null}function Sg(r,e){var t;let{focusNode:n,focusOffset:i}=r.domSelectionRange();for(let a of e)if(((t=a.parentNode)===null||t===void 0?void 0:t.nodeName)=="TR"){let o=a.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let s=o;for(;;){let l=s.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;s=l}s.insertBefore(a,s.firstChild),n==a&&r.domSelection().collapse(a,i)}else a.parentNode.removeChild(a)}}function Og(r,e,t){let{node:n,fromOffset:i,toOffset:a,from:o,to:s}=r.docView.parseRange(e,t),l=r.domSelectionRange(),u,c=l.anchorNode;if(c&&r.dom.contains(c.nodeType==1?c:c.parentNode)&&(u=[{node:c,offset:l.anchorOffset}],Yn(l)||u.push({node:l.focusNode,offset:l.focusOffset})),le&&r.input.lastKeyCode===8)for(let m=a;m>i;m--){let g=n.childNodes[m-1],w=g.pmViewDesc;if(g.nodeName=="BR"&&!w){a=m;break}if(!w||w.size)break}let f=r.state.doc,d=r.someProp("domParser")||Jt.fromSchema(r.state.schema),h=f.resolve(o),p=null,v=d.parse(n,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:a,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:Lg,context:h});if(u&&u[0].pos!=null){let m=u[0].pos,g=u[1]&&u[1].pos;g==null&&(g=m),p={anchor:m+o,head:g+o}}return{doc:v,sel:p,from:o,to:s}}function Lg(r){let e=r.pmViewDesc;if(e)return e.parseRule();if(r.nodeName=="BR"&&r.parentNode){if(ge&&/^(ul|ol)$/i.test(r.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(r.parentNode.lastChild==r||ge&&/^(tr|table)$/i.test(r.parentNode.nodeName))return{ignore:!0}}else if(r.nodeName=="IMG"&&r.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Ng=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Ag(r,e,t,n,i){let a=r.input.compositionPendingChanges||(r.composing?r.input.compositionID:0);if(r.input.compositionPendingChanges=0,e<0){let E=r.input.lastSelectionTime>Date.now()-50?r.input.lastSelectionOrigin:null,A=Ba(r,E);if(A&&!r.state.selection.eq(A)){if(le&&ct&&r.input.lastKeyCode===13&&Date.now()-100<r.input.lastKeyCodeTime&&r.someProp("handleKeyDown",K=>K(r,Zt(13,"Enter"))))return;let P=r.state.tr.setSelection(A);E=="pointer"?P.setMeta("pointer",!0):E=="key"&&P.scrollIntoView(),a&&P.setMeta("composition",a),r.dispatch(P)}return}let o=r.state.doc.resolve(e),s=o.sharedDepth(t);e=o.before(s+1),t=r.state.doc.resolve(t).after(s+1);let l=r.state.selection,u=Og(r,e,t),c=r.state.doc,f=c.slice(u.from,u.to),d,h;r.input.lastKeyCode===8&&Date.now()-100<r.input.lastKeyCodeTime?(d=r.state.selection.to,h="end"):(d=r.state.selection.from,h="start"),r.input.lastKeyCode=null;let p=Rg(f.content,u.doc.content,u.from,d,h);if(p&&r.input.domChangeCount++,(Tr&&r.input.lastIOSEnter>Date.now()-225||ct)&&i.some(E=>E.nodeType==1&&!Ng.test(E.nodeName))&&(!p||p.endA>=p.endB)&&r.someProp("handleKeyDown",E=>E(r,Zt(13,"Enter")))){r.input.lastIOSEnter=0;return}if(!p)if(n&&l instanceof q&&!l.empty&&l.$head.sameParent(l.$anchor)&&!r.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let E=ec(r,r.state.doc,u.sel);if(E&&!E.eq(r.state.selection)){let A=r.state.tr.setSelection(E);a&&A.setMeta("composition",a),r.dispatch(A)}}return}r.state.selection.from<r.state.selection.to&&p.start==p.endB&&r.state.selection instanceof q&&(p.start>r.state.selection.from&&p.start<=r.state.selection.from+2&&r.state.selection.from>=u.from?p.start=r.state.selection.from:p.endA<r.state.selection.to&&p.endA>=r.state.selection.to-2&&r.state.selection.to<=u.to&&(p.endB+=r.state.selection.to-p.endA,p.endA=r.state.selection.to)),De&&Lt<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>u.from&&u.doc.textBetween(p.start-u.from-1,p.start-u.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let v=u.doc.resolveNoCache(p.start-u.from),m=u.doc.resolveNoCache(p.endB-u.from),g=c.resolve(p.start),w=v.sameParent(m)&&v.parent.inlineContent&&g.end()>=p.endA;if((Tr&&r.input.lastIOSEnter>Date.now()-225&&(!w||i.some(E=>E.nodeName=="DIV"||E.nodeName=="P"))||!w&&v.pos<u.doc.content.size&&(!v.sameParent(m)||!v.parent.inlineContent)&&v.pos<m.pos&&!/\S/.test(u.doc.textBetween(v.pos,m.pos,"","")))&&r.someProp("handleKeyDown",E=>E(r,Zt(13,"Enter")))){r.input.lastIOSEnter=0;return}if(r.state.selection.anchor>p.start&&Ig(c,p.start,p.endA,v,m)&&r.someProp("handleKeyDown",E=>E(r,Zt(8,"Backspace")))){ct&&le&&r.domObserver.suppressSelectionUpdates();return}le&&p.endB==p.start&&(r.input.lastChromeDelete=Date.now()),ct&&!w&&v.start()!=m.start()&&m.parentOffset==0&&v.depth==m.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==p.endA&&(p.endB-=2,m=u.doc.resolveNoCache(p.endB-u.from),setTimeout(()=>{r.someProp("handleKeyDown",function(E){return E(r,Zt(13,"Enter"))})},20));let k=p.start,T=p.endA,x=E=>{let A=E||r.state.tr.replace(k,T,u.doc.slice(p.start-u.from,p.endB-u.from));if(u.sel){let P=ec(r,A.doc,u.sel);P&&!(le&&r.composing&&P.empty&&(p.start!=p.endB||r.input.lastChromeDelete<Date.now()-100)&&(P.head==k||P.head==A.mapping.map(T)-1)||De&&P.empty&&P.head==k)&&A.setSelection(P)}return a&&A.setMeta("composition",a),A.scrollIntoView()},L;if(w)if(v.pos==m.pos){De&&Lt<=11&&v.parentOffset==0&&(r.domObserver.suppressSelectionUpdates(),setTimeout(()=>dt(r),20));let E=x(r.state.tr.delete(k,T)),A=c.resolve(p.start).marksAcross(c.resolve(p.endA));A&&E.ensureMarks(A),r.dispatch(E)}else if(p.endA==p.endB&&(L=Dg(v.parent.content.cut(v.parentOffset,m.parentOffset),g.parent.content.cut(g.parentOffset,p.endA-g.start())))){let E=x(r.state.tr);L.type=="add"?E.addMark(k,T,L.mark):E.removeMark(k,T,L.mark),r.dispatch(E)}else if(v.parent.child(v.index()).isText&&v.index()==m.index()-(m.textOffset?0:1)){let E=v.parent.textBetween(v.parentOffset,m.parentOffset),A=()=>x(r.state.tr.insertText(E,k,T));r.someProp("handleTextInput",P=>P(r,k,T,E,A))||r.dispatch(A())}else r.dispatch(x());else r.dispatch(x())}function ec(r,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:Ha(r,e.resolve(t.anchor),e.resolve(t.head))}function Dg(r,e){let t=r.firstChild.marks,n=e.firstChild.marks,i=t,a=n,o,s,l;for(let c=0;c<n.length;c++)i=n[c].removeFromSet(i);for(let c=0;c<t.length;c++)a=t[c].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o="add",l=c=>c.mark(s.addToSet(c.marks));else if(i.length==0&&a.length==1)s=a[0],o="remove",l=c=>c.mark(s.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<e.childCount;c++)u.push(l(e.child(c)));if(C.from(u).eq(r))return{mark:s,type:o}}function Ig(r,e,t,n,i){if(t-e<=i.pos-n.pos||Xa(n,!0,!1)<i.pos)return!1;let a=r.resolve(e);if(!n.parent.isTextblock){let s=a.nodeAfter;return s!=null&&t==e+s.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=r.resolve(Xa(a,!0,!0));return!o.parent.isTextblock||o.pos>t||Xa(o,!0,!1)<t?!1:n.parent.content.cut(n.parentOffset).eq(o.parent.content)}function Xa(r,e,t){let n=r.depth,i=e?r.end():r.pos;for(;n>0&&(e||r.indexAfter(n)==r.node(n).childCount);)n--,i++,e=!1;if(t){let a=r.node(n).maybeChild(r.indexAfter(n));for(;a&&!a.isLeaf;)a=a.firstChild,i++}return i}function Rg(r,e,t,n,i){let a=r.findDiffStart(e,t);if(a==null)return null;let{a:o,b:s}=r.findDiffEnd(e,t+r.size,t+e.size);if(i=="end"){let l=Math.max(0,a-Math.min(o,s));n-=o+l-a}if(o<a&&r.size<e.size){let l=n<=a&&n>=o?a-n:0;a-=l,a&&a<e.size&&tc(e.textBetween(a-1,a+1))&&(a+=l?1:-1),s=a+(s-o),o=a}else if(s<a){let l=n<=a&&n>=s?a-n:0;a-=l,a&&a<r.size&&tc(r.textBetween(a-1,a+1))&&(a+=l?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function tc(r){if(r.length!=2)return!1;let e=r.charCodeAt(0),t=r.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class ai{constructor(e,t){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 Xm,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(oc),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=ic(this),nc(this),this.nodeViews=ac(this),this.docView=du(this.state.doc,rc(this),Ja(this),this.dom,this),this.domObserver=new Tg(this,(n,i,a,o)=>Ag(this,n,i,a,o)),this.domObserver.start(),Ym(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 t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Va(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(oc),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let i=this.state,a=!1,o=!1;e.storedMarks&&this.composing&&(Vu(this),o=!0),this.state=e;let s=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let h=ac(this);Pg(h,this.nodeViews)&&(this.nodeViews=h,a=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Va(this),this.editable=ic(this),nc(this);let l=Ja(this),u=rc(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=a||!this.docView.matchesNode(e.doc,u,l);(f||!e.selection.eq(i.selection))&&(o=!0);let d=c=="preserve"&&o&&this.dom.style.overflowAnchor==null&&fm(this);if(o){this.domObserver.stop();let h=f&&(De||le)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Bg(i.selection,e.selection);if(f){let p=le?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=fg(this)),(a||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=du(e.doc,u,l,this.dom,this)),p&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Bm(this))?dt(this,h):(Cu(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((n=this.dragging)===null||n===void 0)&&n.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&dm(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof R){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Zl(this,t.getBoundingClientRect(),e)}else Zl(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 t=0;t<this.directPlugins.length;t++){let n=this.directPlugins[t];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let n=this.state.plugins[t];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,i=-1;if(this.state.doc.nodeAt(n.from)==n.node)i=n.from;else{let a=n.from+(this.state.doc.content.size-t.doc.content.size);(a>0&&this.state.doc.nodeAt(a))==n.node&&(i=a)}this.dragging=new Wu(e.slice,e.move,i<0?void 0:R.create(this.state.doc,i))}someProp(e,t){let n=this._props&&this._props[e],i;if(n!=null&&(i=t?t(n):n))return i;for(let o=0;o<this.directPlugins.length;o++){let s=this.directPlugins[o].props[e];if(s!=null&&(i=t?t(s):s))return i}let a=this.state.plugins;if(a)for(let o=0;o<a.length;o++){let s=a[o].props[e];if(s!=null&&(i=t?t(s):s))return i}}hasFocus(){if(De){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&&hm(this.dom),dt(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return ym(this,e)}coordsAtPos(e,t=1){return au(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let i=this.docView.posFromDOM(e,t,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return Tm(this,t||this.state,e)}pasteHTML(e,t){return yn(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return yn(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return _a(this,e)}destroy(){this.docView&&(Qm(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ja(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,tm())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return eg(this,e)}domSelectionRange(){let e=this.domSelection();return e?ge&&this.root.nodeType===11&&om(this.dom.ownerDocument)==this.dom&&Eg(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}ai.prototype.dispatch=function(r){let e=this._props.dispatchTransaction;e?e.call(this,r):this.updateState(this.state.apply(r))};function rc(r){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(r.editable),r.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(r.state)),t)for(let n in t)n=="class"?e.class+=" "+t[n]:n=="style"?e.style=(e.style?e.style+";":"")+t[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(t[n]))}),e.translate||(e.translate="no"),[Ie.node(0,r.state.doc.content.size,e)]}function nc(r){if(r.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),r.cursorWrapper={dom:e,deco:Ie.widget(r.state.selection.from,e,{raw:!0,marks:r.markCursor})}}else r.cursorWrapper=null}function ic(r){return!r.someProp("editable",e=>e(r.state)===!1)}function Bg(r,e){let t=Math.min(r.$anchor.sharedDepth(r.head),e.$anchor.sharedDepth(e.head));return r.$anchor.start(t)!=e.$anchor.start(t)}function ac(r){let e=Object.create(null);function t(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return r.someProp("nodeViews",t),r.someProp("markViews",t),e}function Pg(r,e){let t=0,n=0;for(let i in r){if(r[i]!=e[i])return!0;t++}for(let i in e)n++;return t!=n}function oc(r){if(r.spec.state||r.spec.filterTransaction||r.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Pt={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:"'"},oi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Hg=typeof navigator<"u"&&/Mac/.test(navigator.platform),Fg=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ue=0;ue<10;ue++)Pt[48+ue]=Pt[96+ue]=String(ue);for(var ue=1;ue<=24;ue++)Pt[ue+111]="F"+ue;for(var ue=65;ue<=90;ue++)Pt[ue]=String.fromCharCode(ue+32),oi[ue]=String.fromCharCode(ue);for(var Ya in Pt)oi.hasOwnProperty(Ya)||(oi[Ya]=Pt[Ya]);function qg(r){var e=Hg&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||Fg&&r.shiftKey&&r.key&&r.key.length==1||r.key=="Unidentified",t=!e&&r.key||(r.shiftKey?oi:Pt)[r.keyCode]||r.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const _g=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),$g=typeof navigator<"u"&&/Win/.test(navigator.platform);function zg(r){let e=r.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let n,i,a,o;for(let s=0;s<e.length-1;s++){let l=e[s];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))a=!0;else if(/^mod$/i.test(l))_g?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(t="Alt-"+t),i&&(t="Ctrl-"+t),o&&(t="Meta-"+t),a&&(t="Shift-"+t),t}function Vg(r){let e=Object.create(null);for(let t in r)e[zg(t)]=r[t];return e}function Qa(r,e,t=!0){return e.altKey&&(r="Alt-"+r),e.ctrlKey&&(r="Ctrl-"+r),e.metaKey&&(r="Meta-"+r),t&&e.shiftKey&&(r="Shift-"+r),r}function wn(r){return new Ae({props:{handleKeyDown:Ug(r)}})}function Ug(r){let e=Vg(r);return function(t,n){let i=qg(n),a,o=e[Qa(i,n)];if(o&&o(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(n.shiftKey){let s=e[Qa(i,n,!1)];if(s&&s(t.state,t.dispatch,t))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!($g&&n.ctrlKey&&n.altKey)&&(a=Pt[n.keyCode])&&a!=i){let s=e[Qa(a,n)];if(s&&s(t.state,t.dispatch,t))return!0}}return!1}}const Za=(r,e)=>r.selection.empty?!1:(e&&e(r.tr.deleteSelection().scrollIntoView()),!0);function Wg(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("backward",r):t.parentOffset>0)?null:t}const jg=(r,e,t)=>{let n=Wg(r,t);if(!n)return!1;let i=sc(n);if(!i){let o=n.blockRange(),s=o&&Kn(o);return s==null?!1:(e&&e(r.tr.lift(o,s).scrollIntoView()),!0)}let a=i.nodeBefore;if(dc(r,i,e,-1))return!0;if(n.parent.content.size==0&&(Or(a,"end")||R.isSelectable(a)))for(let o=n.depth;;o--){let s=wa(r.doc,n.before(o),n.after(o),S.empty);if(s&&s.slice.size<s.to-s.from){if(e){let l=r.tr.step(s);l.setSelection(Or(a,"end")?F.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):R.create(l.doc,i.pos-a.nodeSize)),e(l.scrollIntoView())}return!0}if(o==1||n.node(o-1).childCount>1)break}return a.isAtom&&i.depth==n.depth-1?(e&&e(r.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1};function Or(r,e,t=!1){for(let n=r;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(t&&n.childCount!=1)return!1}return!1}const Gg=(r,e,t)=>{let{$head:n,empty:i}=r.selection,a=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("backward",r):n.parentOffset>0)return!1;a=sc(n)}let o=a&&a.nodeBefore;return!o||!R.isSelectable(o)?!1:(e&&e(r.tr.setSelection(R.create(r.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function sc(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){if(r.index(e)>0)return r.doc.resolve(r.before(e+1));if(r.node(e).type.spec.isolating)break}return null}function Kg(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("forward",r):t.parentOffset<t.parent.content.size)?null:t}const lc=(r,e,t)=>{let n=Kg(r,t);if(!n)return!1;let i=uc(n);if(!i)return!1;let a=i.nodeAfter;if(dc(r,i,e,1))return!0;if(n.parent.content.size==0&&(Or(a,"start")||R.isSelectable(a))){let o=wa(r.doc,n.before(),n.after(),S.empty);if(o&&o.slice.size<o.to-o.from){if(e){let s=r.tr.step(o);s.setSelection(Or(a,"start")?F.findFrom(s.doc.resolve(s.mapping.map(i.pos)),1):R.create(s.doc,s.mapping.map(i.pos))),e(s.scrollIntoView())}return!0}}return a.isAtom&&i.depth==n.depth-1?(e&&e(r.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},Jg=(r,e,t)=>{let{$head:n,empty:i}=r.selection,a=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("forward",r):n.parentOffset<n.parent.content.size)return!1;a=uc(n)}let o=a&&a.nodeAfter;return!o||!R.isSelectable(o)?!1:(e&&e(r.tr.setSelection(R.create(r.doc,a.pos)).scrollIntoView()),!0)};function uc(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){let t=r.node(e);if(r.index(e)+1<t.childCount)return r.doc.resolve(r.after(e+1));if(t.type.spec.isolating)break}return null}const cc=(r,e)=>{let{$head:t,$anchor:n}=r.selection;return!t.parent.type.spec.code||!t.sameParent(n)?!1:(e&&e(r.tr.insertText(`
`).scrollIntoView()),!0)};function eo(r){for(let e=0;e<r.edgeCount;e++){let{type:t}=r.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const to=(r,e)=>{let{$head:t,$anchor:n}=r.selection;if(!t.parent.type.spec.code||!t.sameParent(n))return!1;let i=t.node(-1),a=t.indexAfter(-1),o=eo(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(e){let s=t.after(),l=r.tr.replaceWith(s,s,o.createAndFill());l.setSelection(F.near(l.doc.resolve(s),1)),e(l.scrollIntoView())}return!0},Xg=(r,e)=>{let t=r.selection,{$from:n,$to:i}=t;if(t instanceof Me||n.parent.inlineContent||i.parent.inlineContent)return!1;let a=eo(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(e){let o=(!n.parentOffset&&i.index()<i.parent.childCount?n:i).pos,s=r.tr.insert(o,a.createAndFill());s.setSelection(q.create(s.doc,o+1)),e(s.scrollIntoView())}return!0},Yg=(r,e)=>{let{$cursor:t}=r.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let a=t.before();if(yr(r.doc,a))return e&&e(r.tr.split(a).scrollIntoView()),!0}let n=t.blockRange(),i=n&&Kn(n);return i==null?!1:(e&&e(r.tr.lift(n,i).scrollIntoView()),!0)};function Qg(r){return(e,t)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof R&&e.selection.node.isBlock)return!n.parentOffset||!yr(e.doc,n.pos)?!1:(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let a=[],o,s,l=!1,u=!1;for(let h=n.depth;;h--)if(n.node(h).isBlock){l=n.end(h)==n.pos+(n.depth-h),u=n.start(h)==n.pos-(n.depth-h),s=eo(n.node(h-1).contentMatchAt(n.indexAfter(h-1))),a.unshift(l&&s?{type:s}:null),o=h;break}else{if(h==1)return!1;a.unshift(null)}let c=e.tr;(e.selection instanceof q||e.selection instanceof Me)&&c.deleteSelection();let f=c.mapping.map(n.pos),d=yr(c.doc,f,a.length,a);if(d||(a[0]=s?{type:s}:null,d=yr(c.doc,f,a.length,a)),!d)return!1;if(c.split(f,a.length,a),!l&&u&&n.node(o).type!=s){let h=c.mapping.map(n.before(o)),p=c.doc.resolve(h);s&&n.node(o-1).canReplaceWith(p.index(),p.index()+1,s)&&c.setNodeMarkup(c.mapping.map(n.before(o)),s)}return t&&t(c.scrollIntoView()),!0}}const Zg=Qg(),fc=(r,e)=>(e&&e(r.tr.setSelection(new Me(r.doc))),!0);function ey(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,a=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(a-1,a)?(t&&t(r.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(a,a+1)||!(i.isTextblock||Rl(r.doc,e.pos))?!1:(t&&t(r.tr.join(e.pos).scrollIntoView()),!0)}function dc(r,e,t,n){let i=e.nodeBefore,a=e.nodeAfter,o,s,l=i.type.spec.isolating||a.type.spec.isolating;if(!l&&ey(r,e,t))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(t){let h=e.pos+a.nodeSize,p=C.empty;for(let g=o.length-1;g>=0;g--)p=C.from(o[g].create(null,p));p=C.from(i.copy(p));let v=r.tr.step(new re(e.pos-1,h,e.pos,h,new S(p,1,0),o.length,!0)),m=v.doc.resolve(h+2*o.length);m.nodeAfter&&m.nodeAfter.type==i.type&&Rl(v.doc,m.pos)&&v.join(m.pos),t(v.scrollIntoView())}return!0}let c=a.type.spec.isolating||n>0&&l?null:F.findFrom(e,1),f=c&&c.$from.blockRange(c.$to),d=f&&Kn(f);if(d!=null&&d>=e.depth)return t&&t(r.tr.lift(f,d).scrollIntoView()),!0;if(u&&Or(a,"start",!0)&&Or(i,"end")){let h=i,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let v=a,m=1;for(;!v.isTextblock;v=v.firstChild)m++;if(h.canReplace(h.childCount,h.childCount,v.content)){if(t){let g=C.empty;for(let k=p.length-1;k>=0;k--)g=C.from(p[k].copy(g));let w=r.tr.step(new re(e.pos-p.length,e.pos+a.nodeSize,e.pos+m,e.pos+a.nodeSize-m,new S(g,p.length,0),0,!0));t(w.scrollIntoView())}return!0}}return!1}function hc(r){return function(e,t){let n=e.selection,i=r<0?n.$from:n.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(t&&t(e.tr.setSelection(q.create(e.doc,r<0?i.start(a):i.end(a)))),!0):!1}}const ty=hc(-1),ry=hc(1);function ny(r,e=null){return function(t,n){let{$from:i,$to:a}=t.selection,o=i.blockRange(a),s=o&&Dv(o,r,e);return s?(n&&n(t.tr.wrap(o,s).scrollIntoView()),!0):!1}}function ro(r,e=null){return function(t,n){let i=!1;for(let a=0;a<t.selection.ranges.length&&!i;a++){let{$from:{pos:o},$to:{pos:s}}=t.selection.ranges[a];t.doc.nodesBetween(o,s,(l,u)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(r,e)))if(l.type==r)i=!0;else{let c=t.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,r)}})}if(!i)return!1;if(n){let a=t.tr;for(let o=0;o<t.selection.ranges.length;o++){let{$from:{pos:s},$to:{pos:l}}=t.selection.ranges[o];a.setBlockType(s,l,r,e)}n(a.scrollIntoView())}return!0}}function iy(r,e,t,n){for(let i=0;i<e.length;i++){let{$from:a,$to:o}=e[i],s=a.depth==0?r.inlineContent&&r.type.allowsMarkType(t):!1;if(r.nodesBetween(a.pos,o.pos,(l,u)=>{if(s)return!1;s=l.inlineContent&&l.type.allowsMarkType(t)}),s)return!0}return!1}function kn(r,e=null,t){return function(n,i){let{empty:a,$cursor:o,ranges:s}=n.selection;if(a&&!o||!iy(n.doc,s,r))return!1;if(i)if(o)r.isInSet(n.storedMarks||o.marks())?i(n.tr.removeStoredMark(r)):i(n.tr.addStoredMark(r.create(e)));else{let l,u=n.tr;l=!s.some(c=>n.doc.rangeHasMark(c.$from.pos,c.$to.pos,r));for(let c=0;c<s.length;c++){let{$from:f,$to:d}=s[c];if(!l)u.removeMark(f.pos,d.pos,r);else{let h=f.pos,p=d.pos,v=f.nodeAfter,m=d.nodeBefore,g=v&&v.isText?/^\s*/.exec(v.text)[0].length:0,w=m&&m.isText?/\s*$/.exec(m.text)[0].length:0;h+g<p&&(h+=g,p-=w),u.addMark(h,p,r.create(e))}}i(u.scrollIntoView())}return!0}}function si(...r){return function(e,t,n){for(let i=0;i<r.length;i++)if(r[i](e,t,n))return!0;return!1}}let no=si(Za,jg,Gg),pc=si(Za,lc,Jg);const ht={Enter:si(cc,Xg,Yg,Zg),"Mod-Enter":to,Backspace:no,"Mod-Backspace":no,"Shift-Backspace":no,Delete:pc,"Mod-Delete":pc,"Mod-a":fc},vc={"Ctrl-h":ht.Backspace,"Alt-Backspace":ht["Mod-Backspace"],"Ctrl-d":ht.Delete,"Ctrl-Alt-Backspace":ht["Mod-Delete"],"Alt-Delete":ht["Mod-Delete"],"Alt-d":ht["Mod-Delete"],"Ctrl-a":ty,"Ctrl-e":ry};for(let r in ht)vc[r]=ht[r];const mc=(typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1)?vc:ht;class Ht{constructor(e,t,n={}){this.match=e,this.match=e,this.handler=typeof t=="string"?ay(t):t,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1,this.inCodeMark=n.inCodeMark!==!1}}function ay(r){return function(e,t,n,i){let a=r;if(t[1]){let o=t[0].lastIndexOf(t[1]);a+=t[0].slice(o+t[1].length),n+=o;let s=n-i;s>0&&(a=t[0].slice(o-s,o)+a,n=i)}return e.tr.insertText(a,n,i)}}const oy=500;function gc({rules:r}){let e=new Ae({state:{init(){return null},apply(t,n){let i=t.getMeta(this);return i||(t.selectionSet||t.docChanged?null:n)}},props:{handleTextInput(t,n,i,a){return yc(t,n,i,a,r,e)},handleDOMEvents:{compositionend:t=>{setTimeout(()=>{let{$cursor:n}=t.state.selection;n&&yc(t,n.pos,n.pos,"",r,e)})}}},isInputRules:!0});return e}function yc(r,e,t,n,i,a){if(r.composing)return!1;let o=r.state,s=o.doc.resolve(e),l=s.parent.textBetween(Math.max(0,s.parentOffset-oy),s.parentOffset,null,"")+n;for(let u=0;u<i.length;u++){let c=i[u];if(!c.inCodeMark&&s.marks().some(p=>p.type.spec.code))continue;if(s.parent.type.spec.code){if(!c.inCode)continue}else if(c.inCode==="only")continue;let f=c.match.exec(l);if(!f||f[0].length<n.length)continue;let d=e-(f[0].length-n.length);if(!c.inCodeMark){let p=!1;if(o.doc.nodesBetween(d,s.pos,v=>{v.isInline&&v.marks.some(m=>m.type.spec.code)&&(p=!0)}),p)continue}let h=c.handler(o,f,d,t);if(h)return c.undoable&&h.setMeta(a,{transform:h,from:e,to:t,text:n}),r.dispatch(h),!0}return!1}const sy=(r,e)=>{let t=r.plugins;for(let n=0;n<t.length;n++){let i=t[n],a;if(i.spec.isInputRules&&(a=i.getState(r))){if(e){let o=r.tr,s=a.transform;for(let l=s.steps.length-1;l>=0;l--)o.step(s.steps[l].invert(s.docs[l]));if(a.text){let l=o.doc.resolve(a.from).marks();o.replaceWith(a.from,a.to,r.schema.text(a.text,l))}else o.delete(a.from,a.to);e(o)}return!0}}return!1};new Ht(/--$/,"—",{inCodeMark:!1}),new Ht(/\.\.\.$/,"…",{inCodeMark:!1}),new Ht(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“",{inCodeMark:!1}),new Ht(/"$/,"”",{inCodeMark:!1}),new Ht(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘",{inCodeMark:!1}),new Ht(/'$/,"’",{inCodeMark:!1});var li=200,ne=function(){};ne.prototype.append=function(e){return e.length?(e=ne.from(e),!this.length&&e||e.length<li&&this.leafAppend(e)||this.length<li&&e.leafPrepend(this)||this.appendInner(e)):this},ne.prototype.prepend=function(e){return e.length?ne.from(e).append(this):this},ne.prototype.appendInner=function(e){return new ly(this,e)},ne.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?ne.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},ne.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},ne.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},ne.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(a,o){return i.push(e(a,o))},t,n),i},ne.from=function(e){return e instanceof ne?e:e&&e.length?new bc(e):ne.empty};var bc=(function(r){function e(n){r.call(this),this.values=n}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,a){return i==0&&a==this.length?this:new e(this.values.slice(i,a))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,a,o,s){for(var l=a;l<o;l++)if(i(this.values[l],s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,a,o,s){for(var l=a-1;l>=o;l--)if(i(this.values[l],s+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=li)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=li)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(ne);ne.empty=new bc([]);var ly=(function(r){function e(t,n){r.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,i,a,o){var s=this.left.length;if(i<s&&this.left.forEachInner(n,i,Math.min(a,s),o)===!1||a>s&&this.right.forEachInner(n,Math.max(i-s,0),Math.min(this.length,a)-s,o+s)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,a,o){var s=this.left.length;if(i>s&&this.right.forEachInvertedInner(n,i-s,Math.max(a,s)-s,o+s)===!1||a<s&&this.left.forEachInvertedInner(n,Math.min(i,s),a,o)===!1)return!1},e.prototype.sliceInner=function(n,i){if(n==0&&i==this.length)return this;var a=this.left.length;return i<=a?this.left.slice(n,i):n>=a?this.right.slice(n-a,i-a):this.left.slice(n,a).append(this.right.slice(0,i-a))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e})(ne);const uy=500;class We{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,a;t&&(i=this.remapping(n,this.items.length),a=i.maps.length);let o=e.tr,s,l,u=[],c=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(n,d+1),a=i.maps.length),a--,c.push(f);return}if(i){c.push(new tt(f.map));let h=f.step.map(i.slice(a)),p;h&&o.maybeStep(h).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],u.push(new tt(p,void 0,void 0,u.length+c.length))),a--,p&&i.appendMap(p,a)}else o.maybeStep(f.step);if(f.selection)return s=i?f.selection.map(i.slice(a)):f.selection,l=new We(this.items.slice(0,n).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:s}}addTransform(e,t,n,i){let a=[],o=this.eventCount,s=this.items,l=!i&&s.length?s.get(s.length-1):null;for(let c=0;c<e.steps.length;c++){let f=e.steps[c].invert(e.docs[c]),d=new tt(e.mapping.maps[c],f,t),h;(h=l&&l.merge(d))&&(d=h,c?a.pop():s=s.slice(0,s.length-1)),a.push(d),t&&(o++,t=void 0),i||(l=d)}let u=o-n.depth;return u>fy&&(s=cy(s,u),o-=u),new We(s.append(a),o)}remapping(e,t){let n=new an;return this.items.forEach((i,a)=>{let o=i.mirrorOffset!=null&&a-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new We(this.items.append(e.map(t=>new tt(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),a=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach(d=>{d.selection&&s--},i);let l=t;this.items.forEach(d=>{let h=a.getMirror(--l);if(h==null)return;o=Math.min(o,h);let p=a.maps[h];if(d.step){let v=e.steps[h].invert(e.docs[h]),m=d.selection&&d.selection.map(a.slice(l+1,h));m&&s++,n.push(new tt(p,v,m))}else n.push(new tt(p))},i);let u=[];for(let d=t;d<o;d++)u.push(new tt(a.maps[d]));let c=this.items.slice(0,i).append(u).append(n),f=new We(c,s);return f.emptyItemCount()>uy&&(f=f.compress(this.items.length-n.length)),f}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],a=0;return this.items.forEach((o,s)=>{if(s>=e)i.push(o),o.selection&&a++;else if(o.step){let l=o.step.map(t.slice(n)),u=l&&l.getMap();if(n--,u&&t.appendMap(u,n),l){let c=o.selection&&o.selection.map(t.slice(n));c&&a++;let f=new tt(u.invert(),l,c),d,h=i.length-1;(d=i.length&&i[h].merge(f))?i[h]=d:i.push(f)}}else o.map&&n--},this.items.length,0),new We(ne.from(i.reverse()),a)}}We.empty=new We(ne.empty,0);function cy(r,e){let t;return r.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),r.slice(t)}class tt{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new tt(t.getMap().invert(),t,this.selection)}}}class Ft{constructor(e,t,n,i,a){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=a}}const fy=20;function dy(r,e,t,n){let i=t.getMeta(qt),a;if(i)return i.historyState;t.getMeta(vy)&&(r=new Ft(r.done,r.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return r;if(o&&o.getMeta(qt))return o.getMeta(qt).redo?new Ft(r.done.addTransform(t,void 0,n,ui(e)),r.undone,wc(t.mapping.maps),r.prevTime,r.prevComposition):new Ft(r.done,r.undone.addTransform(t,void 0,n,ui(e)),null,r.prevTime,r.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let s=t.getMeta("composition"),l=r.prevTime==0||!o&&r.prevComposition!=s&&(r.prevTime<(t.time||0)-n.newGroupDelay||!hy(t,r.prevRanges)),u=o?io(r.prevRanges,t.mapping):wc(t.mapping.maps);return new Ft(r.done.addTransform(t,l?e.selection.getBookmark():void 0,n,ui(e)),We.empty,u,t.time,s??r.prevComposition)}else return(a=t.getMeta("rebased"))?new Ft(r.done.rebased(t,a),r.undone.rebased(t,a),io(r.prevRanges,t.mapping),r.prevTime,r.prevComposition):new Ft(r.done.addMaps(t.mapping.maps),r.undone.addMaps(t.mapping.maps),io(r.prevRanges,t.mapping),r.prevTime,r.prevComposition)}function hy(r,e){if(!e)return!1;if(!r.docChanged)return!0;let t=!1;return r.mapping.maps[0].forEach((n,i)=>{for(let a=0;a<e.length;a+=2)n<=e[a+1]&&i>=e[a]&&(t=!0)}),t}function wc(r){let e=[];for(let t=r.length-1;t>=0&&e.length==0;t--)r[t].forEach((n,i,a,o)=>e.push(a,o));return e}function io(r,e){if(!r)return null;let t=[];for(let n=0;n<r.length;n+=2){let i=e.map(r[n],1),a=e.map(r[n+1],-1);i<=a&&t.push(i,a)}return t}function py(r,e,t){let n=ui(e),i=qt.get(e).spec.config,a=(t?r.undone:r.done).popEvent(e,n);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(t?r.done:r.undone).addTransform(a.transform,e.selection.getBookmark(),i,n),l=new Ft(t?s:a.remaining,t?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(qt,{redo:t,historyState:l})}let ao=!1,kc=null;function ui(r){let e=r.plugins;if(kc!=e){ao=!1,kc=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){ao=!0;break}}return ao}const qt=new cn("history"),vy=new cn("closeHistory");function Cc(r={}){return r={depth:r.depth||100,newGroupDelay:r.newGroupDelay||500},new Ae({key:qt,state:{init(){return new Ft(We.empty,We.empty,null,0,-1)},apply(e,t,n){return dy(t,n,e,r)}},config:r,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i=n=="historyUndo"?Cn:n=="historyRedo"?oo:null;return!i||!e.editable?!1:(t.preventDefault(),i(e.state,e.dispatch))}}}})}function Tc(r,e){return(t,n)=>{let i=qt.getState(t);if(!i||(r?i.undone:i.done).eventCount==0)return!1;if(n){let a=py(i,t,r);a&&n(e?a.scrollIntoView():a)}return!0}}const Cn=Tc(!1,!0),oo=Tc(!0,!0);function my(r){let e=qt.getState(r);return e?e.done.eventCount:0}/**
 * @toast-ui/editor
 * @version 3.2.2 | Fri Feb 17 2023
 * @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
 * @license MIT
 *//*! *****************************************************************************
  Copyright (c) Microsoft Corporation.

  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted.

  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  ***************************************************************************** */var so=function(r,e){return so=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},so(r,e)};function O(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");so(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var b=function(){return b=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},b.apply(this,arguments)};function Re(r,e,t){if(arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}function _(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function gy(r,e,t){var n;t=t||null;for(n in r)if(r.hasOwnProperty(n)&&e.call(t,r[n],n,r)===!1)break}var Lr=gy;function yy(r,e){var t=Object.prototype.hasOwnProperty,n,i,a,o;for(a=1,o=arguments.length;a<o;a+=1){n=arguments[a];for(i in n)t.call(n,i)&&(r[i]=n[i])}return r}var lo=yy;function by(r){return typeof r=="string"||r instanceof String}var pt=by;function wy(r){return r instanceof Array}var Nr=wy;function ky(r,e,t){var n=0,i=r.length;for(t=t||null;n<i&&e.call(t,r[n],n,r)!==!1;n+=1);}var Ar=ky,Cy=Nr,Ty=Ar,xy=Lr;function Ey(r,e,t){Cy(r)?Ty(r,e,t):xy(r,e,t)}var ci=Ey,My=pt,Sy=ci;function Oy(r,e,t){var n=r.style;if(My(e)){n[e]=t;return}Sy(e,function(i,a){n[a]=i})}var rt=Oy,Ly=Nr;function Ny(r,e,t){var n,i;if(t=t||0,!Ly(e))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(e,r,t);for(i=e.length,n=t;t>=0&&n<i;n+=1)if(e[n]===r)return n;return-1}var ar=Ny;function Ay(r){return r===void 0}var je=Ay,Dy=je;function Iy(r){return!r||!r.className?"":Dy(r.className.baseVal)?r.className:r.className.baseVal}var uo=Iy,Ry=Nr,By=je;function Py(r,e){if(e=Ry(e)?e.join(" "):e,e=e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),By(r.className.baseVal)){r.className=e;return}r.className.baseVal=e}var xc=Py,Ec=ci,Hy=ar,Fy=uo,qy=xc;function _y(r){var e=Array.prototype.slice.call(arguments,1),t=r.classList,n=[],i;if(t){Ec(e,function(a){r.classList.add(a)});return}i=Fy(r),i&&(e=[].concat(i.split(/\s+/),e)),Ec(e,function(a){Hy(a,n)<0&&n.push(a)}),qy(r,n)}var nt=_y,Mc=Ar,$y=ar,zy=uo,Vy=xc;function Uy(r){var e=Array.prototype.slice.call(arguments,1),t=r.classList,n,i;if(t){Mc(e,function(a){t.remove(a)});return}n=zy(r).split(/\s+/),i=[],Mc(n,function(a){$y(a,e)<0&&i.push(a)}),Vy(r,i)}var Ge=Uy;function Wy(r){return typeof r=="number"||r instanceof Number}var vt=Wy;function jy(r){return r===null}var fi=jy,Gy=Lr;function Ky(r,e){var t=document.createElement("img"),n="";return Gy(e,function(i,a){n+="&"+a+"="+i}),n=n.substring(1),t.src=r+"?"+n,t.style.display="none",document.body.appendChild(t),document.body.removeChild(t),t}var Jy=Ky,Xy=je,Yy=Jy,Qy=10080*60*1e3;function Zy(r){var e=new Date().getTime();return e-r>Qy}function eb(r,e){var t="https://www.google-analytics.com/collect",n=location.hostname,i="event",a="use",o="TOAST UI "+r+" for "+n+": Statistics",s=window.localStorage.getItem(o);!Xy(window.tui)&&window.tui.usageStatistics===!1||s&&!Zy(s)||(window.localStorage.setItem(o,new Date().getTime()),setTimeout(function(){(document.readyState==="interactive"||document.readyState==="complete")&&Yy(t,{v:1,t:i,tid:e,cid:n,dp:n,dh:r,el:r,ec:a})},1e3))}var tb=eb,rb=/[\u0020]+/g,nb=/[>(){}[\]+-.!#|]/g,Sc=/<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>|<!--[^-]+-->|<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/g,Oc=/\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/g,ib=/[*_~`]/g,Lc=/!\[.*\]\(.*\)/g,ab=/[[\]]/g,Nc=/(?:^|[^\\])\\(?!\\)/g,ob='[&<>"]',Ac=new RegExp(ob,"g");function sb(r){switch(r){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return r}}function Dr(r){return Ac.test(r)?r.replace(Ac,sb):r}function lb(){tb("editor","UA-129966929-1")}function ce(r,e){return r.indexOf(e)!==-1}var ub=["rel","target","hreflang","type"],cb={codeblock:/(^ {4}[^\n]+\n*)+/,thematicBreak:/^ *((\* *){3,}|(- *){3,} *|(_ *){3,}) */,atxHeading:/^(#{1,6}) +[\s\S]+/,seTextheading:/^([^\n]+)\n *(=|-){2,} */,blockquote:/^( *>[^\n]+.*)+/,list:/^ *(\*+|-+|\d+\.) [\s\S]+/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? */,link:/!?\[.*\]\(.*\)/,reflink:/!?\[.*\]\s*\[([^\]]*)\]/,verticalBar:/\u007C/,fencedCodeblock:/^((`|~){3,})/};function Dc(r){if(!r)return null;var e={};return ub.forEach(function(t){je(r[t])||(e[t]=r[t])}),e}function di(r,e){for(var t="",n=0;n<e;n+=1)t+=r;return t}function fb(r){var e=!1;return Lr(cb,function(t){return t.test(r)&&(e=!0),!e}),e}function hi(r){for(var e=[],t=Lc.exec(r);t;)e.push([t.index,t.index+t[0].length]),t=Lc.exec(r);return r.replace(ab,function(n,i){var a=e.some(function(o){return i>o[0]&&i<o[1]});return a?n:"\\"+n})}function db(r){var e=function(i){return"\\"+i},t=function(i){return i+"\\"},n=r.replace(rb," ");return Oc.test(n)&&(n=n.replace(Oc,e)),Nc.test(n)&&(n=n.replace(Nc,t)),n=n.replace(ib,e),Sc.test(n)&&(n=n.replace(Sc,e)),fb(n)&&(n=n.replace(nb,e)),n}function hb(r){var e;return r.indexOf('"')===-1?e='""':e=r.indexOf("'")===-1?"''":"()",e[0]+r+e[1]}function co(r){return fi(r)||je(r)}function fo(r,e){if(r===null&&r===e)return!0;if(typeof r!="object"||typeof e!="object"||co(r)||co(e))return r===e;for(var t in r)if(r[t]!==e[t])return!1;for(var t in e)if(!(t in r))return!1;return!0}function be(r){return r[r.length-1]}function pb(r,e,t){return r>=e&&r<=t}function ho(r){return typeof r=="object"&&r!==null}function pi(r,e){var t=b({},r);return r&&e&&Object.keys(e).forEach(function(n){ho(t[n])?Array.isArray(e[n])?t[n]=po(e[n]):t.hasOwnProperty(n)?t[n]=pi(t[n],e[n]):t[n]=vo(e[n]):t[n]=e[n]}),t}function po(r){return r.map(function(e){return ho(e)?Array.isArray(e)?po(e):vo(e):e})}function vo(r){var e=Object.keys(r);return e.length?e.reduce(function(t,n){return ho(r[n])?t[n]=Array.isArray(r[n])?po(r[n]):vo(r[n]):t[n]=r[n],t},{}):r}function mo(r,e){return e===void 0&&(e={}),Object.keys(e).forEach(function(t){r.hasOwnProperty(t)&&typeof r[t]=="object"?Array.isArray(e[t])?r[t]=e[t]:mo(r[t],e[t]):r[t]=e[t]}),r}function Ic(r,e){return r>e?[e,r]:[r,e]}var vb=Ar;function mb(r){var e;try{e=Array.prototype.slice.call(r)}catch{e=[],vb(r,function(n){e.push(n)})}return e}var it=mb;function vi(r,e){var t=r.nodes.paragraph;return e?t.create(null,pt(e)?r.text(e):e):t.createAndFill()}function fe(r,e,t){return r.text(e,t)}function j(r,e,t){t===void 0&&(t=e);var n=r.doc.content.size,i=n>0?n-1:1;return q.create(r.doc,Math.min(e,i),Math.min(t,i))}function go(r,e,t){var n=e.pos;return r.replaceWith(n,n,vi(t)),r.setSelection(j(r,n+1))}function mi(r){for(var e=r.state,t=r.from,n=r.startIndex,i=r.endIndex,a=r.createText,o=e.tr,s=e.doc,l=e.schema,u=n;u<=i;u+=1){var c=s.child(u),f=c.nodeSize,d=c.textContent,h=c.content,p=a(d),v=p?fe(l,p):C.empty,m=o.mapping.map(t),g=m+h.size;o.replaceWith(m,g,v),t+=f}return o}function yo(r,e,t,n){var i=t.length;r.split(e).delete(e-i,e).insert(r.mapping.map(e),n).setSelection(j(r,r.mapping.map(e)-i))}function Tn(r){return r.sourcepos[0][0]}function gi(r){return r.sourcepos[1][0]}function yi(r){return r.sourcepos[0][1]}function _t(r){return r.sourcepos[1][1]}function gb(r){var e=r.type;return e==="htmlBlock"||e==="htmlInline"}function yb(r){var e=r.type;return e==="strike"||e==="strong"||e==="emph"||e==="code"||e==="link"||e==="image"}function bb(r){return r&&r.type==="codeBlock"}function or(r){return r&&(r.type==="item"||r.type==="list")}function Rc(r){return or(r)&&r.listData.type==="ordered"}function wb(r){return or(r)&&r.listData.type!=="ordered"}function Bc(r){return r&&(r.type==="tableCell"||r.type==="tableDelimCell")}function kb(r){switch(r.type){case"code":case"text":case"emph":case"strong":case"strike":case"link":case"image":case"htmlInline":case"linebreak":case"softbreak":case"customInline":return!0;default:return!1}}function Ir(r,e,t){for(t===void 0&&(t=!0),r=t?r:r.parent;r&&r.type!=="document";){if(e(r))return r;r=r.parent}return null}function Cb(r,e,t){for(t===void 0&&(t=!0),r=t?r:r.parent;r&&r.type!=="document";)e(r),r=r.parent}function ie(r,e){return[r[0],r[1]+e]}function $t(r,e){return[r[0],e]}function Tb(r){var e=r.firstChild.literal;switch(r.type){case"emph":return"*"+e+"*";case"strong":return"**"+e+"**";case"strike":return"~~"+e+"~~";case"code":return"`"+e+"`";case"link":case"image":var t=r,n=t.destination,i=t.title,a=r.type==="link"?"":"!";return a+"["+e+"]("+n+(i?' "'+i+'"':"")+")";default:return null}}function xb(r){switch(r.type){case"document":case"blockQuote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"strike":case"link":case"image":case"table":case"tableHead":case"tableBody":case"tableRow":case"tableCell":case"tableDelimRow":case"customInline":return!0;default:return!1}}function Eb(r){for(var e=[],t=r.walker(),n=null;n=t.next();){var i=n.node;i.type==="text"&&e.push(i.literal)}return e.join("")}var xn=[],Pc={},Hc=/\$\$widget\d+\s/;function bi(r){var e=r.search(Hc);if(e!==-1){var t=r.substring(e),n=t.replace(Hc,"").replace("$$","");r=r.substring(0,e),r+=bi(n)}return r}function Fc(r,e){return"$$"+r+" "+e+"$$"}function qc(r,e){var t=Pc[r],n=t.rule,i=t.toDOM,a=bi(e).match(n);return a&&(e=a[0]),i(e)}function Mb(){return xn}function Sb(r){xn=r,xn.forEach(function(e,t){Pc["widget"+t]=e})}function bo(r,e,t,n){return r.concat(sr(e,t,n))}function sr(r,e,t){t===void 0&&(t=0);var n=[],i=(xn[t]||{}).rule,a=t+1;if(r=bi(r),i&&i.test(r)){for(var o=void 0;(o=r.search(i))!==-1;){var s=r.substring(0,o);s&&(n=bo(n,s,e,a)),r=r.substring(o);var l=r.match(i)[0],u="widget"+t;n.push(e.nodes.widget.create({info:u},e.text(Fc(u,l)))),r=r.substring(l.length)}r&&(n=bo(n,r,e,a))}else r&&(n=t<xn.length-1?bo(n,r,e,a):[e.text(r)]);return n}function _c(r){for(var e,t="",n=r.walker();e=n.next();){var i=e.node,a=e.entering;a&&(i!==r&&i.type!=="text"?(t+=Tb(i),n.resumeAt(r,!1),n.next()):i.type==="text"&&(t+=i.literal))}return t}function $c(){return{deleteSelection:function(){return Za},selectAll:function(){return fc},undo:function(){return Cn},redo:function(){return oo}}}function Ob(r){return new Ae({props:{decorations:function(e){var t=e.doc;if(r.text&&t.childCount===1&&t.firstChild.isTextblock&&t.firstChild.content.size===0){var n=document.createElement("span");return nt(n,"placeholder"),r.className&&nt(n,r.className),n.textContent=r.text,J.create(t,[Ie.widget(1,n)])}return null}}})}var Lb=ar,Nb=uo;function Ab(r,e){var t;return r.classList?r.classList.contains(e):(t=Nb(r).split(/\s+/),Lb(e,t)>-1)}var zc=Ab,Db=ar,Ib=it,wi=Element.prototype,Rb=wi.matches||wi.webkitMatchesSelector||wi.mozMatchesSelector||wi.msMatchesSelector||function(r){var e=this.document||this.ownerDocument;return Db(this,Ib(e.querySelectorAll(r)))>-1};function Bb(r,e){return Rb.call(r,e)}var Pb=Bb,Vc="[A-Za-z][A-Za-z0-9-]*",Hb="[a-zA-Z_:][a-zA-Z0-9:._-]*",Fb="[^\"'=<>`\\x00-\\x20]+",qb="'[^']*'",_b='"[^"]*"',$b="(?:"+Fb+"|"+qb+"|"+_b+")",zb="(?:\\s*=\\s*"+$b+")",Uc="(?:\\s+"+Hb+zb+"?)",Wc="<("+Vc+")("+Uc+")*\\s*/?>",Vb="</("+Vc+")\\s*[>]",jc="(?:"+Wc+"|"+Vb+")",Rr=new RegExp("^"+jc,"i"),wo=/<br\s*\/*>/i,Ub=/<! ---->|<!--(?:-?[^>-])(?:-?[^-])*-->/,Gc="</p><p>";function ko(r,e,t){var n=parseInt(r.left,10),i=parseInt(r.top,10),a=parseInt(r.width,10)+parseInt(r.paddingLeft,10)+parseInt(r.paddingRight,10),o=parseInt(r.height,10)+parseInt(r.paddingTop,10)+parseInt(r.paddingBottom,10);return e>=n&&e<=n+a&&t>=i&&t<=i+o}var Kc="toastui-editor-";function N(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];for(var t=[],n=0,i=r;n<i.length;n++){var a=i[n],o=void 0;Array.isArray(a)?o=a[0]?a[1]:null:o=a,o&&t.push(""+Kc+o)}return t.join(" ")}function Z(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return r.map(function(t){return Kc+"md-"+t}).join(" ")}function Wb(r){return(r==null?void 0:r.nodeType)===Node.TEXT_NODE}function ki(r){return r&&r.nodeType===Node.ELEMENT_NODE}function jb(r,e){var t=it(r.querySelectorAll(e));return t.length?t:[]}function Gb(r,e){e=Nr(e)?it(e):[e],e.forEach(function(t){r.appendChild(t)})}function Kb(r,e){e.parentNode&&e.parentNode.insertBefore(r,e)}function lr(r){r.parentNode&&r.parentNode.removeChild(r)}function Jb(r){for(var e=[];r.firstChild;)e.push(r.firstChild),r.parentNode&&r.parentNode.insertBefore(r.firstChild,r);return lr(r),e}function Co(r,e,t){je(t)&&(t=!zc(r,e));var n=t?nt:Ge;n(r,e)}function Jc(r,e){var t=document.createElement("div");pt(r)?t.innerHTML=r:t.appendChild(r);var n=t.firstChild;return e&&e.appendChild(n),n}function To(r){var e=window.getComputedStyle(r);return["margin-left","margin-right"].reduce(function(t,n){return t+parseInt(e.getPropertyValue(n),10)},0)+r.offsetWidth}function at(r,e){var t;for(pt(e)?t=function(n){return Pb(n,e)}:t=function(n){return n===e};r&&r!==document;){if(ki(r)&&t(r))return r;r=r.parentNode}return null}function Xc(r,e){for(var t=0,n=0;r&&r!==e;){var i=r.offsetTop,a=r.offsetLeft,o=r.offsetParent;if(t+=i,n+=a,o===e.offsetParent)break;r=r.offsetParent}return{offsetTop:t,offsetLeft:n}}function xo(r,e){Object.keys(r).forEach(function(t){co(r[t])?e.removeAttribute(t):e.setAttribute(t,r[t])})}function Xb(r){var e=r.replace(/<p><br\s*\/*><\/p>/gi,"<p></p>"),t=new RegExp(jc,"ig"),n=e.match(t);return n==null||n.forEach(function(i,a){if(wo.test(i)){var o=Gc;if(a){var s=n[a-1],l=s.match(Wc);if(l&&!/br/i.test(l[1])){var u=l[1];o="</"+u+"><"+u+">"}}e=e.replace(wo,o)}}),e}function Eo(r){var e=/<img class="ProseMirror-separator" alt="">/g,t=/ class="ProseMirror-trailingBreak"/g,n=r;return n=n.replace(e,""),n=n.replace(t,""),n}var Yc=new cn("widget"),Qc=5,Yb=(function(){function r(e,t){var n=this;this.popup=null,this.removeWidget=function(){n.popup&&(n.rootEl.removeChild(n.popup),n.popup=null)},this.rootEl=e.dom.parentElement,this.eventEmitter=t,this.eventEmitter.listen("blur",this.removeWidget),this.eventEmitter.listen("loadUI",function(){n.rootEl=at(e.dom.parentElement,"."+N("defaultUI"))}),this.eventEmitter.listen("removePopupWidget",this.removeWidget)}return r.prototype.update=function(e){var t=Yc.getState(e.state);if(this.removeWidget(),t){var n=t.node,i=t.style,a=e.coordsAtPos(t.pos),o=a.top,s=a.left,l=a.bottom,u=l-o,c=this.rootEl.getBoundingClientRect(),f=o-c.top;rt(n,{opacity:"0"}),this.rootEl.appendChild(n),rt(n,{position:"absolute",left:s-c.left+Qc+"px",top:(i==="bottom"?f+u-Qc:f-u)+"px",opacity:"1"}),this.popup=n,e.focus()}},r.prototype.destroy=function(){this.eventEmitter.removeEventHandler("blur",this.removeWidget)},r})();function Qb(r){return new Ae({key:Yc,state:{init:function(){return null},apply:function(e){return e.getMeta("widget")}},view:function(e){return new Yb(e,r)}})}function Zb(r){r.listen("addImageBlobHook",function(e,t){var n=new FileReader;n.onload=function(i){var a=i.target;return t(a.result)},n.readAsDataURL(e)})}function Mo(r,e,t){var n=function(i,a){r.emit("command","addImage",{imageUrl:i,altText:a||e.name||"image"})};r.emit("addImageBlobHook",e,n,t)}function Zc(r){var e=it(r).filter(function(n){var i=n.type;return i.indexOf("image")!==-1});if(e.length===1){var t=e[0];if(t)return t.getAsFile()}return null}function ew(r){var e=r.eventEmitter;return new Ae({props:{handleDOMEvents:{drop:function(t,n){var i,a=(i=n.dataTransfer)===null||i===void 0?void 0:i.files;return a&&Ar(a,function(o){return o.type.indexOf("image")!==-1?(n.preventDefault(),n.stopPropagation(),Mo(e,o,n.type),!1):!0}),!0}}}})}var W=(function(){function r(){}return Object.defineProperty(r.prototype,"type",{get:function(){return"node"},enumerable:!1,configurable:!0}),r.prototype.setContext=function(e){this.context=e},r})();function ef(r){var e=document.createElement("span"),t=qc(r.attrs.info,r.textContent);return e.className="tui-widget",e.appendChild(t),{dom:e}}function So(r){return r.type.name==="widget"}var tf=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"widget"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{attrs:{info:{default:null}},group:"inline",inline:!0,content:"text*",selectable:!1,atom:!0,toDOM:function(){return["span",{class:"tui-widget"},0]},parseDOM:[{tag:"span.tui-widget",getAttrs:function(t){var n=t.textContent,i=n.match(/\$\$(widget\d+)/),a=i[1];return{info:a}}}]}},enumerable:!1,configurable:!0}),e})(W),rf=(function(){function r(e){this.timer=null,this.el=document.createElement("div"),this.el.className="toastui-editor",this.eventEmitter=e,this.placeholder={text:""}}return r.prototype.createState=function(){return Yt.create({schema:this.schema,plugins:this.createPlugins()})},r.prototype.initEvent=function(){var e=this,t=e.eventEmitter,n=e.view,i=e.editorType;n.dom.addEventListener("focus",function(){return t.emit("focus",i)}),n.dom.addEventListener("blur",function(){return t.emit("blur",i)})},r.prototype.emitChangeEvent=function(e){this.eventEmitter.emit("caretChange",this.editorType),e.docChanged&&this.eventEmitter.emit("change",this.editorType)},Object.defineProperty(r.prototype,"defaultPlugins",{get:function(){var e=this.createInputRules(),t=Re(Re([],this.keymaps),[wn(b({"Shift-Enter":mc.Enter},mc)),Cc(),Ob(this.placeholder),Qb(this.eventEmitter),ew(this.context)]);return e?t.concat(e):t},enumerable:!1,configurable:!0}),r.prototype.createInputRules=function(){var e=Mb(),t=e.map(function(n){var i=n.rule;return new Ht(i,function(a,o,s,l){var u=a.schema,c=a.tr,f=a.doc,d=o.input.match(new RegExp(i,"g")),h=f.resolve(s),p=h.parent,v=0;if(So(p)&&(p=h.node(h.depth-1)),p.forEach(function(w){return So(w)&&(v+=1)}),d.length>v){var m=be(d),g=sr(m,u);return c.replaceWith(l-m.length+1,l,g)}return null})});return t.length?gc({rules:t}):null},r.prototype.clearTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},r.prototype.createSchema=function(){return new vl({nodes:this.specs.nodes,marks:this.specs.marks})},r.prototype.createKeymaps=function(e){var t=$c(),n=t.undo,i=t.redo,a=this.specs.keymaps(e),o={"Mod-z":n(),"Shift-Mod-z":i()};return e?a.concat(wn(o)):a},r.prototype.createCommands=function(){return this.specs.commands(this.view)},r.prototype.createPluginProps=function(){var e=this;return this.extraPlugins.map(function(t){return t(e.eventEmitter)})},r.prototype.focus=function(){var e=this;this.clearTimer(),this.timer=setTimeout(function(){e.view.focus(),e.view.dispatch(e.view.state.tr.scrollIntoView())})},r.prototype.blur=function(){this.view.dom.blur()},r.prototype.destroy=function(){var e=this;this.clearTimer(),this.view.destroy(),Object.keys(this).forEach(function(t){delete e[t]})},r.prototype.moveCursorToStart=function(e){var t=this.view.state.tr;this.view.dispatch(t.setSelection(j(t,1)).scrollIntoView()),e&&this.focus()},r.prototype.moveCursorToEnd=function(e){var t=this.view.state.tr;this.view.dispatch(t.setSelection(j(t,t.doc.content.size-1)).scrollIntoView()),e&&this.focus()},r.prototype.setScrollTop=function(e){this.view.dom.scrollTop=e},r.prototype.getScrollTop=function(){return this.view.dom.scrollTop},r.prototype.setPlaceholder=function(e){this.placeholder.text=e,this.view.dispatch(this.view.state.tr.scrollIntoView())},r.prototype.setHeight=function(e){rt(this.el,{height:e+"px"})},r.prototype.setMinHeight=function(e){rt(this.el,{minHeight:e+"px"})},r.prototype.getElement=function(){return this.el},r})();function tw(r){return r instanceof Function}var ze=tw,rw=["Enter","Shift-Enter","Mod-Enter","Tab","Shift-Tab","Delete","Backspace","Mod-Delete","Mod-Backspace","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Mod-d","Mod-D","Alt-ArrowUp","Alt-ArrowDown"];function Ci(r,e,t){return r.focus(),e(t)(r.state,r.dispatch,r)}var nf=(function(){function r(e){this.specs=e}return Object.defineProperty(r.prototype,"nodes",{get:function(){return this.specs.filter(function(e){return e.type==="node"}).reduce(function(e,t){var n,i=t.name,a=t.schema;return b(b({},e),(n={},n[i]=a,n))},{})},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"marks",{get:function(){return this.specs.filter(function(e){return e.type==="mark"}).reduce(function(e,t){var n,i=t.name,a=t.schema;return b(b({},e),(n={},n[i]=a,n))},{})},enumerable:!1,configurable:!0}),r.prototype.commands=function(e,t){var n=this.specs.filter(function(a){var o=a.commands;return o}).reduce(function(a,o){var s={},l=o.commands();return ze(l)?s[o.name]=function(u){return Ci(e,l,u)}:Object.keys(l).forEach(function(u){s[u]=function(c){return Ci(e,l[u],c)}}),b(b({},a),s)},{}),i=$c();return Object.keys(i).forEach(function(a){n[a]=function(o){return Ci(e,i[a],o)}}),t&&Object.keys(t).forEach(function(a){n[a]=function(o){return Ci(e,t[a],o)}}),n},r.prototype.keymaps=function(e){var t=this.specs.filter(function(n){return n.keymaps}).map(function(n){return n.keymaps()});return t.map(function(n){return e||Object.keys(n).forEach(function(i){ce(rw,i)||delete n[i]}),wn(n)})},r.prototype.setContext=function(e){this.specs.forEach(function(t){t.setContext(e)})},r})();function af(r){var e=r.from,t=r.to;return r instanceof Me?[e+1,t-1]:[e,t]}function of(r){return r.index(0)+1}function Br(r,e,t){t===void 0&&(t=1);var n=0;return r.forEach(function(i,a){So(i)&&a+2<e&&(n+=2*t)}),n}function Ti(r,e,t){t===void 0&&(t=e);var n=e===t,i=r.resolve(e),a=of(i),o=a,s=i.start(1),l=s;if(!n){var u=r.resolve(t===r.content.size?t-1:t);l=u.start(1),o=of(u),u.pos===r.content.size&&(t=r.content.size-2)}var c=Math.max(e-s+1,1),f=Math.max(t-l+1,1);return[[a,c+Br(r.child(a-1),c,-1)],[o,f+Br(r.child(o-1),f,-1)]]}function sf(r,e){for(var t=[],n=0,i=0;n<e;n+=1){var a=r.child(n);t[n]=i,i+=a.nodeSize}return t}function ur(r,e,t){var n=sf(r,t[0]),i=e[0]-1,a=t[0]-1,o=r.child(i),s=r.child(a),l=n[i],u=n[a];return l+=e[1]+Br(o,e[1]-1),u+=t[1]+Br(s,t[1]-1),[l,Math.min(u,r.content.size)]}function ee(r){var e=r.$from,t=r.$to,n=r.from,i=r.to,a=e.doc;return r instanceof Me&&(e=a.resolve(n+1),t=a.resolve(i-1)),e.depth===0&&(e=a.resolve(n-1),t=e),{startFromOffset:e.start(1),endFromOffset:t.start(1),startToOffset:e.end(1),endToOffset:t.end(1),startIndex:e.index(0),endIndex:t.index(0),from:e.pos,to:t.pos}}function xi(r,e){for(var t=1,n=1,i=0,a=0;i<r.childCount;i+=1){var o=r.child(i).nodeSize;if(t=a+1,n=a+o-1,i===e)break;a+=o}return{startOffset:t,endOffset:n}}var lf="heading",nw="blockQuote",iw="listItem",aw="table",ow="tableCell",sw="codeBlock",lw="thematicBreak",Ei="link",Mi="code",Si="meta",cr="delimiter",uw="taskDelimiter",Oo="markedText",cw="html",fw="customBlock",uf={strong:2,emph:1,strike:2};function V(r,e,t,n){return{start:r,end:e,spec:{type:t,attrs:n}}}function dw(r,e,t){var n=r.level,i=r.headingType,a=[V(e,t,lf,{level:n})];return i==="atx"?a.push(V(e,ie(e,n),cr)):a.push(V($t(t,0),t,lf,{seText:!0})),a}function Lo(r,e,t){var n=r.type,i=ie(e,uf[n]),a=ie(t,-uf[n]);return[V(i,a,n),V(e,i,cr),V(a,t,cr)]}function cf(r,e,t,n){return[V(r,e,Ei),V($t(r,t[1]+1),$t(e,n),Ei,{desc:!0}),V($t(e,n+2),ie(e,-1),Ei,{url:!0})]}function hw(r,e,t){var n=r.lastChild,i=n?_t(n)+1:3,a=ie(e,1);return Re([V(e,a,Si)],cf(e,t,a,i))}function pw(r,e,t){var n=r.lastChild,i=r.extendedAutolink,a=n?_t(n)+1:2;return i?[V(e,t,Ei,{desc:!0})]:cf(e,t,e,a)}function vw(r,e,t){var n=r.tickCount,i=ie(e,n),a=ie(t,-n);return[V(e,t,Mi),V(e,i,Mi,{start:!0}),V(i,a,Mi,{marked:!0}),V(a,t,Mi,{end:!0})]}function ff(r,e,t,n){var i={start:e,end:t,spec:{attrs:{className:n+"-line-background",codeStart:e[0],codeEnd:t[0]}},lineBackground:!0};return r.type!=="item"&&r.type!=="blockQuote"?[b(b({},i),{end:e,spec:{attrs:{className:n+"-line-background start"}}}),b(b({},i),{start:[Math.min(e[0]+1,t[0]),e[1]]})]:null}function mw(r,e,t,n){var i=r.fenceOffset,a=r.fenceLength,o=r.fenceChar,s=r.info,l=r.infoPadding,u=r.parent,c=i+a,f=[V($t(e,1),t,sw)];o&&f.push(V(e,ie(e,c),cr)),s&&f.push(V(ie(e,a),ie(e,a+l+s.length),Si));var d="^(\\s{0,4})("+o+"{"+a+",})",h=new RegExp(d);h.test(n)&&f.push(V($t(t,1),t,cr));var p=ff(u,e,t,"code-block");return p?f.concat(p):f}function gw(r,e,t){var n=r,i=n.offset,a=n.syntaxLength,o=n.info,s=n.parent,l=i+a,u=[V($t(e,1),t,fw)];u.push(V(e,ie(e,l),cr)),o&&u.push(V(ie(e,l),ie(e,a+o.length),Si)),u.push(V($t(t,1),t,cr));var c=ff(s,e,t,"custom-block");return c?u.concat(c):u}function df(r,e){for(var t=[];r;){var n=r.type;(n==="paragraph"||n==="codeBlock")&&t.push(V([Tn(r),yi(r)-1],[gi(r),_t(r)+1],e)),r=r.next}return t}function yw(r){for(var e=[];r;)e.push(V([Tn(r),yi(r)],[gi(r),_t(r)+1],Oo)),r=r.next;return e}function bw(r,e,t){var n=r.parent&&r.parent.type!=="blockQuote"?[V(e,t,nw)]:[];if(r.firstChild){var i=[];r.firstChild.type==="paragraph"?i=yw(r.firstChild.firstChild):r.firstChild.type==="list"&&(i=df(r.firstChild,Oo)),n=Re(Re([],n),i)}return n}function ww(r){for(var e=0;r.parent.parent&&r.parent.parent.type==="item";)r=r.parent.parent,e+=1;var t=[{odd:!0},{even:!0}][e%2];return[iw,b(b({},t),{listStyle:!0})]}function kw(r,e){var t=r.listData,n=t.padding,i=t.task,a=ww(r),o=[V.apply(void 0,Re([e,ie(e,n)],a))];return i&&(o.push(V(ie(e,n),ie(e,n+3),uw)),o.push(V(ie(e,n+1),ie(e,n+2),Si))),o.concat(df(r.firstChild,Oo))}var hf={heading:dw,strong:Lo,emph:Lo,strike:Lo,link:pw,image:hw,code:vw,codeBlock:mw,blockQuote:bw,item:kw,customBlock:gw},pf={thematicBreak:lw,table:aw,tableCell:ow,htmlInline:cw};function Cw(r,e,t,n){var i=r.type;return ze(hf[i])?hf[i](r,e,t,n):pf[i]?[V(e,t,pf[i])]:null}var En={};function Tw(r){var e=r.schema,t=r.toastMark;return new Ae({appendTransaction:function(n,i,a){var o=n[0],s=a.tr;if(o.docChanged){var l=[],u=o.getMeta("editResult");u.forEach(function(c){var f=c.nodes,d=c.removedNodeRange;if(f.length){l=l.concat(Lw(s,f));for(var h=0,p=f;h<p.length;h++)for(var v=p[h],m=v.walker(),g=m.next();g;){var w=g.node,k=g.entering;k&&(l=l.concat(Nw(w,t))),g=m.next()}}else if(d)for(var T=s.doc.childCount-1,x=d.line,L=x[0],E=x[1],A=Math.min(L,T),P=Math.min(E,T),K=A;K<=P;K+=1)En[K]=!0}),Mw(s,e,l)}return s.setMeta("widget",o.getMeta("widget"))}})}function xw(r,e,t){return Object.keys(t).some(function(n){return t[n]!==r.child(e).attrs[n]})}function Ew(r,e,t,n,i){i===void 0&&(i={});for(var a=n.startIndex,o=n.endIndex,s=n.from,l=n.to,u=!1,c=a;c<=o;c+=1)delete En[c],u=xw(e,c,i);u&&r.setBlockType(s,l,t,i)}function Mw(r,e,t){var n=r.doc,i=e.nodes.paragraph,a=sf(n,n.childCount);t.forEach(function(o){var s=o.start,l=o.end,u=o.spec,c=o.lineBackground,f=Math.min(s[0],n.childCount)-1,d=Math.min(l[0],n.childCount)-1,h=n.child(f),p=n.child(d),v=a[f],m=a[d];if(v+=s[1]+Br(h,s[1]-1),m+=l[1]+Br(p,l[1]-1),u)if(c){var g={from:v,to:m,startIndex:f,endIndex:d};Ew(r,n,i,g,u.attrs)}else r.addMark(v,m,e.mark(u.type,u.attrs));else r.removeMark(v,m)}),Sw(r,a,i)}function Sw(r,e,t){Object.keys(En).forEach(function(n){var i=Number(n),a=Math.min(Number(n)+1,r.doc.childCount-1),o=e[i],s=e[a]-1;i===a&&(s+=2),r.setBlockType(o,s,t)})}function Ow(r,e,t){var n=[];En={};for(var i=e[0]-1;i<t[0];i+=1){var a=r.child(i),o=a.attrs.codeEnd,s=a.attrs.codeStart;if(s&&o&&!ce(n,s)){n.push(s),o=Math.min(o,r.childCount);for(var l=s-1,u=t[0],c=l;c<u;c+=1)En[c]=!0}}}function Lw(r,e){var t=r.doc,n=e[0].sourcepos[0],i=be(e).sourcepos,a=i[1],o=[n[0],n[1]],s=[a[0],a[1]+1],l=[];return Ow(t,n,a),l.push({start:o,end:s}),l}function Nw(r,e){var t=e.getLineTexts(),n=[Tn(r),yi(r)],i=[gi(r),_t(r)+1],a=Cw(r,n,i,t[i[0]-1]);return a??[]}var Aw=["taskList","orderedList","bulletList","table","strong","emph","strike","heading","thematicBreak","blockQuote","code","codeBlock","indent","outdent"];function Dw(r){var e=r.type;return or(r)?r.listData.task?"taskList":r.listData.type==="ordered"?"orderedList":"bulletList":e.indexOf("table")!==-1?"table":ce(Aw,e)?e:null}function Iw(r){var e={indent:{active:!1,disabled:!0},outdent:{active:!1,disabled:!0}},t=!0;return Cb(r,function(n){var i=Dw(n);i&&(i==="bulletList"||i==="orderedList"?t&&(e[i]={active:!0},e.indent.disabled=!1,e.outdent.disabled=!1,t=!1):e[i]={active:!0})}),e}function Rw(r){var e=r.toastMark,t=r.eventEmitter;return new Ae({view:function(){return{update:function(n,i){var a=n.state,o=a.doc,s=a.selection;if(!(i&&i.doc.eq(o)&&i.selection.eq(s))){var l=s.from,u=a.doc.resolve(l).start(),c=a.doc.content.findIndex(l).index+1,f=l-u;l===u&&(f+=1);var d=[c,f],h=e.findNodeAtPosition(d),p=Iw(h);t.emit("changeToolbarState",{cursorPos:d,mdNode:h,toolbarState:p}),t.emit("setFocusedNode",h)}}}}})}var Bw=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"doc"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"block+"}},enumerable:!1,configurable:!0}),e})(W),G=(function(){function r(){}return Object.defineProperty(r.prototype,"type",{get:function(){return"mark"},enumerable:!1,configurable:!0}),r.prototype.setContext=function(e){this.context=e},r})();function Be(r,e){return zt(r,e-1)}function zt(r,e){return r.child(e).textContent}var Mn=/^\s*> ?/,Pw=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"blockQuote"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Z("block-quote")},0]}}},enumerable:!1,configurable:!0}),e.prototype.createBlockQuoteText=function(t,n){return n?t.replace(Mn,"").trim():"> "+t.trim()},e.prototype.extendBlockQuote=function(){var t=this;return function(n,i){var a=n.selection,o=n.doc,s=n.tr,l=n.schema,u=ee(a),c=u.endFromOffset,f=u.endToOffset,d=u.endIndex,h=u.to,p=zt(o,d),v=Mn.test(p);if(v&&h>c&&a.empty){var m=!p.replace(Mn,"").trim();if(m)s.deleteRange(c,f).split(s.mapping.map(f));else{var g=p.slice(h-c).trim(),w=fe(l,t.createBlockQuoteText(g));yo(s,f,g,w)}return i(s),!0}return!1}},e.prototype.commands=function(){var t=this;return function(){return function(n,i){var a=n.selection,o=n.doc,s=ee(a),l=s.startFromOffset,u=s.endToOffset,c=s.startIndex,f=s.endIndex,d=Mn.test(zt(o,c)),h=mi({state:n,startIndex:c,endIndex:f,from:l,createText:function(p){return t.createBlockQuoteText(p,d)}});return i(h.setSelection(j(h,h.mapping.map(u)))),!0}}},e.prototype.keymaps=function(){var t=this.commands()();return{"alt-q":t,"alt-Q":t,Enter:this.extendBlockQuote()}},e})(G),fr=/(^\s*)([-*+] |[\d]+\. )/,No=/(^\s*)([\d])+\.( \[[ xX]])? /,mt=/^(\s*)((\d+)([.)]\s(?:\[(?:x|\s)\]\s)?))(.*)/,Oi=/(^\s*)([-*+]|[\d]+\.)( \[[ xX]])? /,Hw=/^(\s*)([-*+]+(\s(?:\[(?:x|\s)\]\s)?))(.*)/,Fw=/(^\s*)([-*+] |[\d]+\. )(\[[ xX]] )/,qw=/(^\s*)([-*+])( \[[ xX]]) /;function Ao(r){return No.test(r)?"ordered":"bullet"}function Do(r){for(var e=0;r&&r.type!=="document";)r.type==="list"&&(e+=1),r=r.parent;return e}function Io(r,e,t,n){for(var i=r.getLineTexts(),a=i.length,o=[],s=e;n?s<a:s>1;){s=n?s+1:s-1;var l=r.findFirstNodeAtLine(s),u=Do(l);if(u===t)o.push({line:s,depth:t,mdNode:l});else if(u<t)break}return o}function _w(r){var e=r.toastMark,t=r.mdNode,n=r.line,i=Do(t),a=Io(e,n,i,!1).reverse(),o=Io(e,n,i,!0);return a.concat([{line:n,depth:i,mdNode:t}]).concat(o)}function $w(r){if(!fr.test(r))return"* "+r;var e=Ao(r);return e==="bullet"&&Oi.test(r)?r=r.replace(qw,"$1$2 "):e==="ordered"&&(r=r.replace(No,"$1* ")),r}function zw(r,e){if(!fr.test(r))return e+". "+r;var t=Ao(r);if(t==="bullet"||t==="ordered"&&Oi.test(r))r=r.replace(Oi,"$1"+e+". ");else if(t==="ordered"){var n=mt.exec(r)[3];Number(n)!==e&&(r=r.replace(No,"$1"+e+". "))}return r}function vf(r,e,t,n){n===void 0&&(n=0);var i=Number.MAX_VALUE,a=0,o=e.map(function(s,l){var u=s.line;i=Math.min(u-1,i),a=Math.max(u-1,a);var c=Be(r,u);return c=t==="bullet"?$w(c):zw(c,l+1+n),{text:c,line:u}});return{changedResults:o,firstIndex:i,lastIndex:a}}function mf(r,e){var t=_w(e);return vf(e.doc,t,r)}var Vw={bullet:function(r){return mf("bullet",r)},ordered:function(r){return mf("ordered",r)},task:function(r){var e=r.mdNode,t=r.doc,n=r.line,i=Be(t,n);return e.listData.task?i=i.replace(Fw,"$1$2"):or(e)&&(i=i.replace(fr,"$1$2[ ] ")),{changedResults:[{text:i,line:n}]}}},Uw={bullet:function(r){var e=r.doc,t=r.line,n=Be(e,t),i=[{text:"* "+n,line:t}];return{changedResults:i}},ordered:function(r){for(var e=r.toastMark,t=r.doc,n=r.line,i=r.startLine,a=Be(t,n),o=1,s=i,l=0,u=i-1;u>0;u-=1){var c=e.findFirstNodeAtLine(u),f=Be(t,u),d=f&&!!Ir(c,function(k){return or(k)}),h=mt.exec(Be(t,u));if(!h&&!d)break;if(!h&&d){l+=1;continue}var p=h,v=p[1],m=p[3];if(!v){o=Number(m),s=u;break}}var g=o+n-s-l,w=[{text:g+". "+a,line:n}];return{changedResults:w}},task:function(r){var e=r.doc,t=r.line,n=Be(e,t),i=[{text:"* [ ] "+n,line:t}];return{changedResults:i}}},Ww={bullet:function(r){var e=r.line,t=r.doc,n=Be(t,e),i=Hw.exec(n),a=i[1],o=i[2];return{listSyntax:""+a+o}},ordered:function(r){var e=r.toastMark,t=r.line,n=r.mdNode,i=r.doc,a=Do(n),o=Be(i,t),s=mt.exec(o),l=s[1],u=s[3],c=s[4],f=Number(u)+1,d=""+l+f+c,h=Io(e,t,a,!0),p=h.filter(function(v){var m=mt.exec(Be(i,v.line));return m&&m[1].length===l.length&&!!Ir(v.mdNode,function(g){return Rc(g)})});return b({listSyntax:d},vf(i,p,"ordered",f))}};function gf(r,e,t,n,i){for(var a=[],o=Be(r,t),s=mt.exec(o);s;){var l=s[1],u=s[4],c=s[5],f=l.length;if(f===i)a.push(fe(e,""+l+n+u+c)),n+=1,t+=1;else if(f>i){var d=gf(r,e,t,1,f);t=d.line,a=a.concat(d.nodes)}if(f<i||t>r.childCount)break;o=Be(r,t),s=mt.exec(o)}return{nodes:a,line:t}}var yf=/(^\s{1,4})(.*)/;function bf(r,e,t){return r<e||fr.test(t)||Mn.test(t)}function wf(r,e,t){var n=t.$from;n.depth===0&&(n=r.resolve(n.pos-1));var i=n.node(1),a=n.start(1),o=i.content.size;return i.rangeHasMark(0,o,e.marks.table)&&n.pos-a!==o&&n.pos!==a}function kf(r,e){var t=e.from,n=e.to;if(e.type==="indent"){var i=4;t+=i,n+=(e.lineLen+1)*i}else{var a=e.spaceLenList;t-=a[0];for(var o=0;o<a.length;o+=1)n-=a[o]}return j(r,t,n)}var jw=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"paragraph"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"inline*",attrs:{className:{default:null},codeStart:{default:null},codeEnd:{default:null}},selectable:!1,group:"block",parseDOM:[{tag:"div"}],toDOM:function(t){var n=t.attrs;return n.className?["div",{class:Z(n.className)},0]:["div",0]}}},enumerable:!1,configurable:!0}),e.prototype.reorderList=function(t,n){for(var i=this.context,a=i.view,o=i.toastMark,s=i.schema,l=a.state,u=l.tr,c=l.selection,f=l.doc,d=o.findFirstNodeAtLine(t),h=d;d&&!wb(d)&&d.parent.type!=="document";)if(d=d.parent,Rc(d)){h=d;break}h&&(t=h.sourcepos[0][0]);var p=mt.exec(Be(f,t)),v=p[1],m=p[3],g=v.length,w=gf(f,s,t,Number(m),g),k=w.line,T=w.nodes;n=Math.max(n,k-1);for(var x=xi(f,t-1).startOffset,L=t-1;L<=n-1;L+=1){var E=f.child(L),A=E.nodeSize,P=E.content,K=u.mapping.map(x),pe=K+P.size;u.replaceWith(K,pe,T[L-t+1]),x+=A}var Ue=j(u,c.from,c.to);a.dispatch(u.setSelection(Ue))},e.prototype.indent=function(t){var n=this;return t===void 0&&(t=!1),function(){return function(i,a){var o=i.schema,s=i.selection,l=i.doc,u=ee(s),c=u.from,f=u.to,d=u.startFromOffset,h=u.startIndex,p=u.endIndex;if(t&&wf(l,o,s))return!1;var v=zt(l,h);if(t&&bf(c,f,v)||!t&&fr.test(v)){var m=mi({state:i,from:d,startIndex:h,endIndex:p,createText:function(w){return"    "+w}}),g={type:"indent",from:c,to:f,lineLen:p-h};a(m.setSelection(kf(m,g))),mt.test(v)&&n.reorderList(h+1,p+1)}else t&&a(i.tr.insert(f,fe(o,"    ")));return!0}}},e.prototype.outdent=function(t){var n=this;return t===void 0&&(t=!1),function(){return function(i,a){var o=i.selection,s=i.doc,l=i.schema,u=ee(o),c=u.from,f=u.to,d=u.startFromOffset,h=u.startIndex,p=u.endIndex;if(t&&wf(s,l,o))return!1;var v=zt(s,h);if(t&&bf(c,f,v)||!t&&fr.test(v)){var m=[],g=mi({state:i,from:d,startIndex:h,endIndex:p,createText:function(L){var E=yf.exec(L);return m.push(E?E[1].length:0),L.replace(yf,"$2")}}),w={type:"outdent",from:c,to:f,spaceLenList:m};a(g.setSelection(kf(g,w))),mt.test(v)&&n.reorderList(h+1,p+1)}else if(t){var k=v.slice(0,f-d),T=k.replace(/\s{1,4}$/,""),x=f-(k.length-T.length);a(i.tr.delete(x,f))}return!0}}},e.prototype.deleteLines=function(){var t=this;return function(n,i){var a=t.context.view,o=ee(n.selection),s=o.startFromOffset,l=o.endToOffset,u=function(){return i(n.tr.deleteRange(s,l)),!0};return si(u,lc)(n,i,a)}},e.prototype.moveDown=function(){return function(t,n){var i=t.doc,a=t.tr,o=t.selection,s=t.schema,l=ee(o),u=l.startFromOffset,c=l.endToOffset,f=l.endIndex;if(f<i.content.childCount-1){var d=i.child(f+1),h=d.nodeSize,p=d.textContent;return a.delete(c,c+h).split(u).insert(a.mapping.map(u)-2,fe(s,p)),n(a),!0}return!1}},e.prototype.moveUp=function(){return function(t,n){var i=t.tr,a=t.doc,o=t.selection,s=t.schema,l=ee(o),u=l.startFromOffset,c=l.endToOffset,f=l.startIndex;if(f>0){var d=a.child(f-1),h=d.nodeSize,p=d.textContent;return i.delete(u-h,u).split(i.mapping.map(c)).insert(i.mapping.map(c),fe(s,p)),n(i),!0}return!1}},e.prototype.commands=function(){return{indent:this.indent(),outdent:this.outdent()}},e.prototype.keymaps=function(){return{Tab:this.indent(!0)(),"Shift-Tab":this.outdent(!0)(),"Mod-d":this.deleteLines(),"Mod-D":this.deleteLines(),"Alt-ArrowUp":this.moveUp(),"Alt-ArrowDown":this.moveDown()}},e})(W),Gw=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"text"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{group:"inline"}},enumerable:!1,configurable:!0}),e})(W),Kw=/^#{1,6}\s/,Jw=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"heading"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{attrs:{level:{default:1},seText:{default:!1}},toDOM:function(t){var n=t.attrs,i=n.level,a=n.seText,o="heading|heading"+i;return a&&(o+="|delimiter|setext"),["span",{class:Z.apply(void 0,o.split("|"))},0]}}},enumerable:!1,configurable:!0}),e.prototype.createHeadingText=function(t,n,i){for(var a=n.replace(i,"").trim(),o="";t>0;)o+="#",t-=1;return o+" "+a},e.prototype.commands=function(){var t=this;return function(n){return function(i,a){var o=n.level,s=ee(i.selection),l=s.startFromOffset,u=s.endToOffset,c=s.startIndex,f=s.endIndex,d=mi({state:i,from:l,startIndex:c,endIndex:f,createText:function(h){var p=h.match(Kw),v=p?p[0]:"";return t.createHeadingText(o,h,v)}});return a(d.setSelection(j(d,d.mapping.map(u)))),!0}}},e})(G),Ro="```",Xw=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"codeBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Z("code-block")},0]}}},enumerable:!1,configurable:!0}),e.prototype.commands=function(){return function(){return function(t,n){var i=t.selection,a=t.schema,o=t.tr,s=ee(i),l=s.startFromOffset,u=s.endToOffset,c=fe(a,Ro);return o.insert(l,c).split(l+Ro.length),o.split(o.mapping.map(u)).insert(o.mapping.map(u),c),n(o.setSelection(j(o,o.mapping.map(u)-(Ro.length+2)))),!0}}},e.prototype.keepIndentation=function(){var t=this;return function(n,i){var a=n.selection,o=n.tr,s=n.doc,l=n.schema,u=t.context.toastMark,c=ee(a),f=c.startFromOffset,d=c.endToOffset,h=c.endIndex,p=c.from,v=c.to,m=zt(s,h);if(p===v&&m.trim()){var g=m.match(/^\s+/),w=u.findFirstNodeAtLine(h+1);if(bb(w)&&g){var k=g[0],T=m.slice(v-f),x=fe(l,k+T);return yo(o,d,T,x),i(o),!0}}return!1}},e.prototype.keymaps=function(){var t=this.commands()();return{"Shift-Mod-p":t,"Shift-Mod-P":t,Enter:this.keepIndentation()}},e})(G),Yw=/\||\s/g;function Qw(r){return[Li(r),Li(r,!0)]}function Zw(r,e){for(var t=[],n=0;n<e;n+=1)t.push(Li(r));return t}function Li(r,e){for(var t="|",n=0;n<r;n+=1)t+=e?" --- |":"  |";return t}function ek(r){return r?{type:"next",parentType:"tableHead",childType:"firstChild"}:{type:"prev",parentType:"tableBody",childType:"lastChild"}}var tk=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"table"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Z("table")},0]}}},enumerable:!1,configurable:!0}),e.prototype.extendTable=function(){var t=this;return function(n,i){var a=n.selection,o=n.doc,s=n.tr,l=n.schema;if(!a.empty)return!1;var u=ee(a),c=u.endFromOffset,f=u.endToOffset,d=u.endIndex,h=u.to,p=zt(o,d),v=[d+1,h-c+1],m=t.context.toastMark.findNodeAtPosition(v),g=Ir(m,function(L){return Bc(L)&&(L.parent.type==="tableDelimRow"||L.parent.parent.type==="tableBody")});if(g){var w=!p.replace(Yw,"").trim(),k=g.parent,T=k.parent.parent.columns.length,x=Li(T);return w?s.deleteRange(c,f).split(s.mapping.map(f)):s.split(f).insert(s.mapping.map(f),fe(l,x)).setSelection(j(s,s.mapping.map(f)-2)),i(s),!0}return!1}},e.prototype.moveTableCell=function(t){var n=this;return function(i,a){var o=i.selection,s=i.tr,l=ee(o),u=l.endFromOffset,c=l.endIndex,f=l.to,d=[c+1,f-u],h=n.context.toastMark.findNodeAtPosition(d),p=Ir(h,function(E){return Bc(E)});if(p){var v=p.parent,m=ek(t),g=m.type,w=m.parentType,k=m.childType,T=_t(p);if(p[g])T=_t(p[g])-1;else{var x=!v[g]&&v.parent.type===w?v.parent[g][k]:v[g];if(g==="next"){var L=x?_t(x[k]):0;T+=L+2}else g==="prev"&&(T=x?-4:0)}return a(s.setSelection(j(s,u+T))),!0}return!1}},e.prototype.addTable=function(){return function(t){return function(n,i){var a=n.selection,o=n.tr,s=n.schema,l=t,u=l.columnCount,c=l.rowCount,f=ee(a).endToOffset,d=Qw(u),h=Zw(u,c-1),p=Re(Re([],d),h);return p.forEach(function(v){o.split(o.mapping.map(f)).insert(o.mapping.map(f),fe(s,v))}),i(o.setSelection(j(o,f+4))),!0}}},e.prototype.commands=function(){return{addTable:this.addTable()}},e.prototype.keymaps=function(){return{Enter:this.extendTable(),Tab:this.moveTableCell(!0),"Shift-Tab":this.moveTableCell(!1)}},e})(G),rk="***",nk=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"thematicBreak"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Z("thematic-break")},0]}}},enumerable:!1,configurable:!0}),e.prototype.hr=function(){return function(){return function(t,n){var i=t.selection,a=t.schema,o=t.tr,s=ee(i),l=s.from,u=s.to,c=s.endToOffset,f=fe(a,rk);return o.split(l).replaceWith(o.mapping.map(l),o.mapping.map(u),f).split(o.mapping.map(u)).setSelection(j(o,o.mapping.map(c))),n(o),!0}}},e.prototype.commands=function(){return{hr:this.hr()}},e.prototype.keymaps=function(){var t=this.hr()();return{"Mod-l":t,"Mod-L":t}},e})(G);function ik(r,e){var t=r.type,n=r.sourcepos,i=n[0][0];return e<=i&&(t==="codeBlock"||t==="heading"||t.match("table"))}var ak=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"listItem"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{attrs:{odd:{default:!1},even:{default:!1},listStyle:{default:!1}},toDOM:function(t){var n=t.attrs,i=n.odd,a=n.even,o=n.listStyle,s="list-item";return o&&(s+="|list-item-style"),i&&(s+="|list-item-odd"),a&&(s+="|list-item-even"),["span",{class:Z.apply(void 0,s.split("|"))},0]}}},enumerable:!1,configurable:!0}),e.prototype.extendList=function(){var t=this;return function(n,i){var a=n.selection,o=n.doc,s=n.schema,l=n.tr,u=t.context.toastMark,c=ee(a),f=c.to,d=c.startFromOffset,h=c.endFromOffset,p=c.endIndex,v=c.endToOffset,m=zt(o,p),g=fr.test(m);if(!g||a.from===d||!a.empty)return!1;var w=!m.replace(Oi,"").trim();if(w)l.deleteRange(h,v).split(l.mapping.map(v));else{var k=Ao(m),T=u.findFirstNodeAtLine(p+1),x=m.slice(f-h),L={toastMark:u,mdNode:T,doc:o,line:p+1},E=Ww[k](L),A=E.listSyntax,P=E.changedResults;if(P!=null&&P.length){l.split(f),P.unshift({text:A+x,line:p+1}),t.changeToListPerLine(l,P,{from:f,startLine:P[0].line,endLine:be(P).line});var K=l.mapping.map(v)-x.length;l.setSelection(j(l,K))}else{var pe=fe(s,A+x);yo(l,v,x,pe)}}return i(l),!0}},e.prototype.toList=function(t){var n=this;return function(){return function(i,a){for(var o=i.doc,s=i.tr,l=i.selection,u=n.context.toastMark,c=ee(l),f=c.startIndex+1,d=c.endIndex+1,h=c.endToOffset,p=[],v=f;v<=d;v+=1){var m=u.findFirstNodeAtLine(v);if(m&&ik(m,v))break;if(p.indexOf(v)===-1){var g={toastMark:u,mdNode:m,doc:o,line:v,startLine:f},w=(or(m)?Vw[t](g):Uw[t](g)).changedResults,k=n.changeToListPerLine(s,w,{from:xi(o,w[0].line-1).startOffset,startLine:w[0].line,endLine:be(w).line,indexDiff:1});h=Math.max(k,h),w&&(p=p.concat(w.map(function(T){return T.line})))}}return a(s.setSelection(j(s,s.mapping.map(h)))),!0}}},e.prototype.changeToListPerLine=function(t,n,i){for(var a=i.from,o=i.startLine,s=i.endLine,l=i.indexDiff,u=l===void 0?0:l,c=0,f=function(p){var v=t.doc.child(p),m=v.nodeSize,g=v.content,w=t.mapping.map(a),k=w+g.size,T=n.filter(function(x){return x.line-u===p})[0];T&&(t.replaceWith(w,k,fe(d.context.schema,T.text)),c=Math.max(c,a+g.size)),a+=m},d=this,h=o-u;h<=s-u;h+=1)f(h);return c},e.prototype.toggleTask=function(){var t=this;return function(n,i){for(var a=n.selection,o=n.tr,s=n.doc,l=n.schema,u=t.context.toastMark,c=ee(a),f=c.startIndex,d=c.endIndex,h=null,p=f;p<=d;p+=1){var v=u.findFirstNodeAtLine(p+1);if(or(v)&&v.listData.task){var m=v.listData,g=m.checked,w=m.padding,k=g?" ":"x",T=v.sourcepos[0],x=xi(s,T[0]-1).startOffset;x+=T[1]+w,h=o.replaceWith(x,x+1,l.text(k))}}return h?(i(h),!0):!1}},e.prototype.commands=function(){return{bulletList:this.toList("bullet"),orderedList:this.toList("ordered"),taskList:this.toList("task")}},e.prototype.keymaps=function(){var t=this.toList("bullet")(),n=this.toList("ordered")(),i=this.toList("task")(),a=this.toggleTask();return{"Mod-u":t,"Mod-U":t,"Mod-o":n,"Mod-O":n,"alt-t":i,"alt-T":i,"Shift-Ctrl-x":a,"Shift-Ctrl-X":a,Enter:this.extendList()}},e})(G);function Ni(r,e){return function(){return function(t,n){var i=t.tr,a=t.selection,o=ze(r)?r:function(k){return r.test(k)},s=e.length,l=i.doc,u=af(a),c=u[0],f=u[1],d=Math.max(c-s,1),h=Math.min(f+s,l.content.size-1),p=a.content(),v=p.content.textBetween(0,p.content.size,`
`),m=l.textBetween(d,c,`
`),g=l.textBetween(f,h,`
`);if(v=""+m+v+g,m&&g&&o(v))i.delete(h-s,h).delete(d,d+s);else{i.insertText(e,f).insertText(e,c);var w=a.empty?j(i,c+s):j(i,c+s,f+s);i.setSelection(w)}return n(i),!0}}}var ok=/^(\*{2}|_{2}).*([\s\S]*)\1$/m,sk="**",lk=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"strong"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Z("strong")},0]}}},enumerable:!1,configurable:!0}),e.prototype.bold=function(){return Ni(ok,sk)},e.prototype.commands=function(){return{bold:this.bold()}},e.prototype.keymaps=function(){var t=this.bold()();return{"Mod-b":t,"Mod-B":t}},e})(G),uk=/^(~{2}).*([\s\S]*)\1$/m,ck="~~",fk=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"strike"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Z("strike")},0]}}},enumerable:!1,configurable:!0}),e.prototype.commands=function(){return Ni(uk,ck)},e.prototype.keymaps=function(){var t=this.commands()();return{"Mod-s":t,"Mod-S":t}},e})(G),dk=/^(\*|_).*([\s\S]*)\1$/m,hk="*",pk=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"emph"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Z("emph")},0]}}},enumerable:!1,configurable:!0}),e.prototype.italic=function(){return Ni(dk,hk)},e.prototype.commands=function(){return{italic:this.italic()}},e.prototype.keymaps=function(){var t=this.italic()();return{"Mod-i":t,"Mod-I":t}},e})(G),vk=/^(`).*([\s\S]*)\1$/m,mk="`",gk=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"code"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{attrs:{start:{default:!1},end:{default:!1},marked:{default:!1}},toDOM:function(t){var n=t.attrs,i=n.start,a=n.end,o=n.marked,s="code";return i&&(s+="|delimiter|start"),a&&(s+="|delimiter|end"),o&&(s+="|marked-text"),["span",{class:Z.apply(void 0,s.split("|"))},0]}}},enumerable:!1,configurable:!0}),e.prototype.commands=function(){return Ni(vk,mk)},e.prototype.keymaps=function(){var t=this.commands()();return{"Shift-Mod-c":t,"Shift-Mod-C":t}},e})(G),yk=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"link"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{attrs:{url:{default:!1},desc:{default:!1}},toDOM:function(t){var n=t.attrs,i=n.url,a=n.desc,o="link";return i&&(o+="|link-url|marked-text"),a&&(o+="|link-desc|marked-text"),["span",{class:Z.apply(void 0,o.split("|"))},0]}}},enumerable:!1,configurable:!0}),e.prototype.addLinkOrImage=function(t){return function(n){return function(i,a){var o=i.selection,s=i.tr,l=i.schema,u=af(o),c=u[0],f=u[1],d=n,h=d.linkText,p=d.altText,v=d.linkUrl,m=d.imageUrl,g=h,w=v,k="";return t==="image"&&(g=p,w=m,k="!"),g=hi(g),k+="["+g+"]("+w+")",a(s.replaceWith(c,f,fe(l,k))),!0}}},e.prototype.commands=function(){return{addImage:this.addLinkOrImage("image"),addLink:this.addLinkOrImage("link")}},e})(G),bk=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"taskDelimiter"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Z("delimiter","list-item")},0]}}},enumerable:!1,configurable:!0}),e})(G),wk=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"delimiter"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Z("delimiter")},0]}}},enumerable:!1,configurable:!0}),e})(G),kk=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"meta"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Z("meta")},0]}}},enumerable:!1,configurable:!0}),e})(G),Ck=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"markedText"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Z("marked-text")},0]}}},enumerable:!1,configurable:!0}),e})(G),Tk=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"tableCell"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Z("table-cell")},0]}}},enumerable:!1,configurable:!0}),e})(G),xk=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"html"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Z("html")},0]}}},enumerable:!1,configurable:!0}),e})(G),Bo="$$",Ek=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"customBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:Z("custom-block")},0]}}},enumerable:!1,configurable:!0}),e.prototype.commands=function(){return function(t){return function(n,i){var a=n.selection,o=n.schema,s=n.tr,l=ee(a),u=l.startFromOffset,c=l.endToOffset;if(!(t!=null&&t.info))return!1;var f=""+Bo+t.info,d=fe(o,f),h=fe(o,Bo);return s.insert(u,d).split(u+f.length),s.split(s.mapping.map(c)).insert(s.mapping.map(c),h),i(s.setSelection(j(s,s.mapping.map(c)-(Bo.length+2)))),!0}}},e})(G),Mk=/x|backspace/i,Sk=/^\[(\s*)(x?)(\s*)\](?:\s+)/i;function Ok(r){var e=r.schema,t=r.toastMark;return new Ae({props:{handleDOMEvents:{keyup:function(n,i){var a,o=n.state,s=o.doc,l=o.tr,u=o.selection;if(u.empty&&Mk.test(i.key)){var c=ee(u),f=c.startIndex,d=c.startFromOffset,h=c.from,p=[f+1,h-d+1],v=t.findNodeAtPosition(p),m=Ir(v,function(pe){var Ue;return pe.type==="paragraph"&&((Ue=pe.parent)===null||Ue===void 0?void 0:Ue.type)==="item"});if(!((a=m==null?void 0:m.firstChild)===null||a===void 0)&&a.literal){var g=m.firstChild,w=g.literal.match(Sk);if(w){var k=g.sourcepos[0],T=w[1],x=w[2],L=w[3],E=T.length+L.length,A=xi(s,k[0]-1).startOffset,P=k[1]+A;if(x){var K=E?E+1:0;l.replaceWith(P,K+P,e.text(x)),n.dispatch(l)}else E||(l.insertText(" ",P),n.dispatch(l))}}}return!1}}}})}var Po="cut",Cf=/\r\n|\n|\r/,Lk=(function(r){O(e,r);function e(t,n){var i=r.call(this,t)||this,a=n.toastMark,o=n.useCommandShortcut,s=o===void 0?!0:o,l=n.mdPlugins,u=l===void 0?[]:l;return i.editorType="markdown",i.el.classList.add("md-mode"),i.toastMark=a,i.extraPlugins=u,i.specs=i.createSpecs(),i.schema=i.createSchema(),i.context=i.createContext(),i.keymaps=i.createKeymaps(s),i.view=i.createView(),i.commands=i.createCommands(),i.specs.setContext(b(b({},i.context),{view:i.view})),i.createClipboard(),i.eventEmitter.listen("changePreviewTabWrite",function(c){return i.toggleActive(!0,c)}),i.eventEmitter.listen("changePreviewTabPreview",function(){return i.toggleActive(!1)}),i.initEvent(),i}return e.prototype.toggleActive=function(t,n){Co(this.el,"active",t),t?n||this.focus():this.blur()},e.prototype.createClipboard=function(){var t=this;this.clipboard=document.createElement("textarea"),this.clipboard.className=N("pseudo-clipboard"),this.clipboard.addEventListener("paste",function(n){var i=n.clipboardData||window.clipboardData,a=i&&i.items;if(a){var o=it(a).some(function(l){return l.kind==="string"&&l.type==="text/rtf"});if(!o){var s=Zc(a);s&&(n.preventDefault(),Mo(t.eventEmitter,s,n.type))}}}),this.clipboard.addEventListener("input",function(n){var i=n.target.value;t.replaceSelection(i),n.preventDefault(),n.target.value=""}),this.el.insertBefore(this.clipboard,this.view.dom)},e.prototype.createContext=function(){return{toastMark:this.toastMark,schema:this.schema,eventEmitter:this.eventEmitter}},e.prototype.createSpecs=function(){return new nf([new Bw,new jw,new tf,new Gw,new Jw,new Pw,new Xw,new Ek,new tk,new Tk,new nk,new ak,new lk,new fk,new pk,new gk,new yk,new wk,new bk,new Ck,new kk,new xk])},e.prototype.createPlugins=function(){return Re([Tw(this.context),Rw(this.context),Ok(this.context)],this.createPluginProps()).concat(this.defaultPlugins)},e.prototype.createView=function(){var t=this;return new ai(this.el,{state:this.createState(),dispatchTransaction:function(n){t.updateMarkdown(n);var i=t.view.state.applyTransaction(n).state;t.view.updateState(i),t.emitChangeEvent(n)},handleKeyDown:function(n,i){return(i.metaKey||i.ctrlKey)&&i.key.toUpperCase()==="V"&&t.clipboard.focus(),t.eventEmitter.emit("keydown",t.editorType,i),!1},handleDOMEvents:{copy:function(n,i){return t.captureCopy(i)},cut:function(n,i){return t.captureCopy(i,Po)},scroll:function(){return t.eventEmitter.emit("scroll","editor"),!0},keyup:function(n,i){return t.eventEmitter.emit("keyup",t.editorType,i),!1}},nodeViews:{widget:ef}})},e.prototype.createCommands=function(){return this.specs.commands(this.view)},e.prototype.captureCopy=function(t,n){t.preventDefault();var i=this.view.state,a=i.selection,o=i.tr;if(a.empty)return!0;var s=this.getChanged(a.content());return t.clipboardData?t.clipboardData.setData("text/plain",s):window.clipboardData.setData("Text",s),n===Po&&this.view.dispatch(o.deleteSelection().scrollIntoView().setMeta("uiEvent",Po)),!0},e.prototype.updateMarkdown=function(t){var n=this;t.docChanged&&t.steps.forEach(function(i,a){if(i.slice&&!(i instanceof re)){var o=t.docs[a],s=[i.from,i.to],l=s[0],u=s[1],c=Ti(o,l,u),f=c[0],d=c[1],h=n.getChanged(i.slice);f[0]===d[0]&&f[1]===d[1]&&h===""&&(h=`
`);var p=n.toastMark.editMarkdown(f,d,h);n.eventEmitter.emit("updatePreview",p),t.setMeta("editResult",p).scrollIntoView()}})},e.prototype.getChanged=function(t){var n="",i=0,a=t.content.size;return t.content.nodesBetween(i,a,function(o,s){o.isText?n+=o.text.slice(Math.max(i,s)-s,a-s):o.isBlock&&s>0&&(n+=`
`)}),n},e.prototype.setSelection=function(t,n){n===void 0&&(n=t);var i=this.view.state.tr,a=ur(i.doc,t,n),o=a[0],s=a[1];this.view.dispatch(i.setSelection(j(i,o,s)).scrollIntoView())},e.prototype.replaceSelection=function(t,n,i){var a,o=this.view.state,s=o.tr,l=o.schema,u=o.doc,c=t.split(Cf),f=c.map(function(m){return vi(l,sr(m,l))}),d=new S(C.from(f),1,1);if(this.focus(),n&&i){var h=ur(u,n,i),p=h[0],v=h[1];a=s.replaceRange(p,v,d)}else a=s.replaceSelection(d);this.view.dispatch(a.scrollIntoView())},e.prototype.deleteSelection=function(t,n){var i,a=this.view.state,o=a.tr,s=a.doc;if(t&&n){var l=ur(s,t,n),u=l[0],c=l[1];i=o.deleteRange(u,c)}else i=o.deleteSelection();this.view.dispatch(i.scrollIntoView())},e.prototype.getSelectedText=function(t,n){var i=this.view.state,a=i.doc,o=i.selection,s=o.from,l=o.to;if(t&&n){var u=ur(a,t,n);s=u[0],l=u[1]}return a.textBetween(s,l,`
`)},e.prototype.getSelection=function(){var t=this.view.state.selection,n=t.from,i=t.to;return Ti(this.view.state.tr.doc,n,i)},e.prototype.setMarkdown=function(t,n){n===void 0&&(n=!0);var i=t.split(Cf),a=this.view.state,o=a.tr,s=a.doc,l=a.schema,u=i.map(function(c){return vi(l,sr(c,l))});this.view.dispatch(o.replaceWith(0,s.content.size,u)),n&&this.moveCursorToEnd(!0)},e.prototype.addWidget=function(t,n,i){var a=this.view.state,o=a.tr,s=a.doc,l=a.selection,u=i?ur(s,i,i)[0]:l.to;this.view.dispatch(o.setMeta("widget",{pos:u,node:t,style:n}))},e.prototype.replaceWithWidget=function(t,n,i){var a=this.view.state,o=a.tr,s=a.schema,l=a.doc,u=ur(l,t,n),c=sr(i,s);this.view.dispatch(o.replaceWith(u[0],u[1],c))},e.prototype.getRangeInfoOfNode=function(t){var n=this.view.state,i=n.doc,a=n.selection,o=t||Ti(i,a.from)[0],s=this.toastMark.findNodeAtPosition(o);return s.type==="text"&&s.parent.type!=="paragraph"&&(s=s.parent),s.sourcepos[1][1]+=1,{range:s.sourcepos,type:s.type}},e.prototype.getMarkdown=function(){return this.toastMark.getLineTexts().map(function(t){return bi(t)}).join(`
`)},e.prototype.getToastMark=function(){return this.toastMark},e})(rf),Tf="_feEventKey";function Nk(r,e){var t=r[Tf],n;return t||(t=r[Tf]={}),n=t[e],n||(n=t[e]=[]),n}var xf=Nk,Ak=pt,Ai=ci,Dk=xf;function Ik(r,e,t){if(Ak(e)){Ai(e.split(/\s+/g),function(n){Ef(r,n,t)});return}Ai(e,function(n,i){Ef(r,i,n)})}function Ef(r,e,t){var n=Dk(r,e),i;t?(Ai(n,function(a,o){return t===a.handler?(Mf(r,e,a.wrappedHandler),i=o,!1):!0}),n.splice(i,1)):(Ai(n,function(a){Mf(r,e,a.wrappedHandler)}),n.splice(0,n.length))}function Mf(r,e,t){"removeEventListener"in r?r.removeEventListener(e,t):"detachEvent"in r&&r.detachEvent("on"+e,t)}var Sf=Ik,Rk=pt,Ho=ci,Bk=xf;function Pk(r,e,t,n){if(Rk(e)){Ho(e.split(/\s+/g),function(i){Of(r,i,t,n)});return}Ho(e,function(i,a){Of(r,a,i,t)})}function Of(r,e,t,n){function i(a){t.call(n||r,a||window.event)}"addEventListener"in r?r.addEventListener(e,i):"attachEvent"in r&&r.attachEvent("on"+e,i),Hk(r,e,t,i)}function Hk(r,e,t,n){var i=Bk(r,e),a=!1;Ho(i,function(o){return o.handler===t?(a=!0,!1):!0}),a||i.push({handler:t,wrappedHandler:n})}var Lf=Pk;/*! *****************************************************************************
  Copyright (c) Microsoft Corporation.

  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted.

  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  ***************************************************************************** */var Fo=function(r,e){return Fo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Fo(r,e)};function Ve(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Fo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var de=function(){return de=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},de.apply(this,arguments)};function qo(r,e,t){if(arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}var Pr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Nf={};function Fk(r){var e,t,n=Nf[r];if(n)return n;for(n=Nf[r]=[],e=0;e<128;e++)t=String.fromCharCode(e),/^[0-9a-z]$/i.test(t)?n.push(t):n.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2));for(e=0;e<r.length;e++)n[r.charCodeAt(e)]=r[e];return n}function Di(r,e,t){var n,i,a,o,s,l="";for(typeof e!="string"&&(t=e,e=Di.defaultChars),typeof t>"u"&&(t=!0),s=Fk(e),n=0,i=r.length;n<i;n++){if(a=r.charCodeAt(n),t&&a===37&&n+2<i&&/^[0-9a-f]{2}$/i.test(r.slice(n+1,n+3))){l+=r.slice(n,n+3),n+=2;continue}if(a<128){l+=s[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&n+1<i&&(o=r.charCodeAt(n+1),o>=56320&&o<=57343)){l+=encodeURIComponent(r[n]+r[n+1]),n++;continue}l+="%EF%BF%BD";continue}l+=encodeURIComponent(r[n])}return l}Di.defaultChars=";/?:@&=+$,-_.!~*'()#",Di.componentChars="-_.!~*'()";var qk=Di,_o={},gt={},_k="Á",$k="á",zk="Ă",Vk="ă",Uk="∾",Wk="∿",jk="∾̳",Gk="Â",Kk="â",Jk="´",Xk="А",Yk="а",Qk="Æ",Zk="æ",eC="⁡",tC="𝔄",rC="𝔞",nC="À",iC="à",aC="ℵ",oC="ℵ",sC="Α",lC="α",uC="Ā",cC="ā",fC="⨿",dC="&",hC="&",pC="⩕",vC="⩓",mC="∧",gC="⩜",yC="⩘",bC="⩚",wC="∠",kC="⦤",CC="∠",TC="⦨",xC="⦩",EC="⦪",MC="⦫",SC="⦬",OC="⦭",LC="⦮",NC="⦯",AC="∡",DC="∟",IC="⊾",RC="⦝",BC="∢",PC="Å",HC="⍼",FC="Ą",qC="ą",_C="𝔸",$C="𝕒",zC="⩯",VC="≈",UC="⩰",WC="≊",jC="≋",GC="'",KC="⁡",JC="≈",XC="≊",YC="Å",QC="å",ZC="𝒜",e0="𝒶",t0="≔",r0="*",n0="≈",i0="≍",a0="Ã",o0="ã",s0="Ä",l0="ä",u0="∳",c0="⨑",f0="≌",d0="϶",h0="‵",p0="∽",v0="⋍",m0="∖",g0="⫧",y0="⊽",b0="⌅",w0="⌆",k0="⌅",C0="⎵",T0="⎶",x0="≌",E0="Б",M0="б",S0="„",O0="∵",L0="∵",N0="∵",A0="⦰",D0="϶",I0="ℬ",R0="ℬ",B0="Β",P0="β",H0="ℶ",F0="≬",q0="𝔅",_0="𝔟",$0="⋂",z0="◯",V0="⋃",U0="⨀",W0="⨁",j0="⨂",G0="⨆",K0="★",J0="▽",X0="△",Y0="⨄",Q0="⋁",Z0="⋀",eT="⤍",tT="⧫",rT="▪",nT="▴",iT="▾",aT="◂",oT="▸",sT="␣",lT="▒",uT="░",cT="▓",fT="█",dT="=⃥",hT="≡⃥",pT="⫭",vT="⌐",mT="𝔹",gT="𝕓",yT="⊥",bT="⊥",wT="⋈",kT="⧉",CT="┐",TT="╕",xT="╖",ET="╗",MT="┌",ST="╒",OT="╓",LT="╔",NT="─",AT="═",DT="┬",IT="╤",RT="╥",BT="╦",PT="┴",HT="╧",FT="╨",qT="╩",_T="⊟",$T="⊞",zT="⊠",VT="┘",UT="╛",WT="╜",jT="╝",GT="└",KT="╘",JT="╙",XT="╚",YT="│",QT="║",ZT="┼",e1="╪",t1="╫",r1="╬",n1="┤",i1="╡",a1="╢",o1="╣",s1="├",l1="╞",u1="╟",c1="╠",f1="‵",d1="˘",h1="˘",p1="¦",v1="𝒷",m1="ℬ",g1="⁏",y1="∽",b1="⋍",w1="⧅",k1="\\",C1="⟈",T1="•",x1="•",E1="≎",M1="⪮",S1="≏",O1="≎",L1="≏",N1="Ć",A1="ć",D1="⩄",I1="⩉",R1="⩋",B1="∩",P1="⋒",H1="⩇",F1="⩀",q1="ⅅ",_1="∩︀",$1="⁁",z1="ˇ",V1="ℭ",U1="⩍",W1="Č",j1="č",G1="Ç",K1="ç",J1="Ĉ",X1="ĉ",Y1="∰",Q1="⩌",Z1="⩐",ex="Ċ",tx="ċ",rx="¸",nx="¸",ix="⦲",ax="¢",ox="·",sx="·",lx="𝔠",ux="ℭ",cx="Ч",fx="ч",dx="✓",hx="✓",px="Χ",vx="χ",mx="ˆ",gx="≗",yx="↺",bx="↻",wx="⊛",kx="⊚",Cx="⊝",Tx="⊙",xx="®",Ex="Ⓢ",Mx="⊖",Sx="⊕",Ox="⊗",Lx="○",Nx="⧃",Ax="≗",Dx="⨐",Ix="⫯",Rx="⧂",Bx="∲",Px="”",Hx="’",Fx="♣",qx="♣",_x=":",$x="∷",zx="⩴",Vx="≔",Ux="≔",Wx=",",jx="@",Gx="∁",Kx="∘",Jx="∁",Xx="ℂ",Yx="≅",Qx="⩭",Zx="≡",eE="∮",tE="∯",rE="∮",nE="𝕔",iE="ℂ",aE="∐",oE="∐",sE="©",lE="©",uE="℗",cE="∳",fE="↵",dE="✗",hE="⨯",pE="𝒞",vE="𝒸",mE="⫏",gE="⫑",yE="⫐",bE="⫒",wE="⋯",kE="⤸",CE="⤵",TE="⋞",xE="⋟",EE="↶",ME="⤽",SE="⩈",OE="⩆",LE="≍",NE="∪",AE="⋓",DE="⩊",IE="⊍",RE="⩅",BE="∪︀",PE="↷",HE="⤼",FE="⋞",qE="⋟",_E="⋎",$E="⋏",zE="¤",VE="↶",UE="↷",WE="⋎",jE="⋏",GE="∲",KE="∱",JE="⌭",XE="†",YE="‡",QE="ℸ",ZE="↓",eM="↡",tM="⇓",rM="‐",nM="⫤",iM="⊣",aM="⤏",oM="˝",sM="Ď",lM="ď",uM="Д",cM="д",fM="‡",dM="⇊",hM="ⅅ",pM="ⅆ",vM="⤑",mM="⩷",gM="°",yM="∇",bM="Δ",wM="δ",kM="⦱",CM="⥿",TM="𝔇",xM="𝔡",EM="⥥",MM="⇃",SM="⇂",OM="´",LM="˙",NM="˝",AM="`",DM="˜",IM="⋄",RM="⋄",BM="⋄",PM="♦",HM="♦",FM="¨",qM="ⅆ",_M="ϝ",$M="⋲",zM="÷",VM="÷",UM="⋇",WM="⋇",jM="Ђ",GM="ђ",KM="⌞",JM="⌍",XM="$",YM="𝔻",QM="𝕕",ZM="¨",eS="˙",tS="⃜",rS="≐",nS="≑",iS="≐",aS="∸",oS="∔",sS="⊡",lS="⌆",uS="∯",cS="¨",fS="⇓",dS="⇐",hS="⇔",pS="⫤",vS="⟸",mS="⟺",gS="⟹",yS="⇒",bS="⊨",wS="⇑",kS="⇕",CS="∥",TS="⤓",xS="↓",ES="↓",MS="⇓",SS="⇵",OS="̑",LS="⇊",NS="⇃",AS="⇂",DS="⥐",IS="⥞",RS="⥖",BS="↽",PS="⥟",HS="⥗",FS="⇁",qS="↧",_S="⊤",$S="⤐",zS="⌟",VS="⌌",US="𝒟",WS="𝒹",jS="Ѕ",GS="ѕ",KS="⧶",JS="Đ",XS="đ",YS="⋱",QS="▿",ZS="▾",eO="⇵",tO="⥯",rO="⦦",nO="Џ",iO="џ",aO="⟿",oO="É",sO="é",lO="⩮",uO="Ě",cO="ě",fO="Ê",dO="ê",hO="≖",pO="≕",vO="Э",mO="э",gO="⩷",yO="Ė",bO="ė",wO="≑",kO="ⅇ",CO="≒",TO="𝔈",xO="𝔢",EO="⪚",MO="È",SO="è",OO="⪖",LO="⪘",NO="⪙",AO="∈",DO="⏧",IO="ℓ",RO="⪕",BO="⪗",PO="Ē",HO="ē",FO="∅",qO="∅",_O="◻",$O="∅",zO="▫",VO=" ",UO=" ",WO=" ",jO="Ŋ",GO="ŋ",KO=" ",JO="Ę",XO="ę",YO="𝔼",QO="𝕖",ZO="⋕",eL="⧣",tL="⩱",rL="ε",nL="Ε",iL="ε",aL="ϵ",oL="≖",sL="≕",lL="≂",uL="⪖",cL="⪕",fL="⩵",dL="=",hL="≂",pL="≟",vL="⇌",mL="≡",gL="⩸",yL="⧥",bL="⥱",wL="≓",kL="ℯ",CL="ℰ",TL="≐",xL="⩳",EL="≂",ML="Η",SL="η",OL="Ð",LL="ð",NL="Ë",AL="ë",DL="€",IL="!",RL="∃",BL="∃",PL="ℰ",HL="ⅇ",FL="ⅇ",qL="≒",_L="Ф",$L="ф",zL="♀",VL="ffi",UL="ff",WL="ffl",jL="𝔉",GL="𝔣",KL="fi",JL="◼",XL="▪",YL="fj",QL="♭",ZL="fl",eN="▱",tN="ƒ",rN="𝔽",nN="𝕗",iN="∀",aN="∀",oN="⋔",sN="⫙",lN="ℱ",uN="⨍",cN="½",fN="⅓",dN="¼",hN="⅕",pN="⅙",vN="⅛",mN="⅔",gN="⅖",yN="¾",bN="⅗",wN="⅜",kN="⅘",CN="⅚",TN="⅝",xN="⅞",EN="⁄",MN="⌢",SN="𝒻",ON="ℱ",LN="ǵ",NN="Γ",AN="γ",DN="Ϝ",IN="ϝ",RN="⪆",BN="Ğ",PN="ğ",HN="Ģ",FN="Ĝ",qN="ĝ",_N="Г",$N="г",zN="Ġ",VN="ġ",UN="≥",WN="≧",jN="⪌",GN="⋛",KN="≥",JN="≧",XN="⩾",YN="⪩",QN="⩾",ZN="⪀",eA="⪂",tA="⪄",rA="⋛︀",nA="⪔",iA="𝔊",aA="𝔤",oA="≫",sA="⋙",lA="⋙",uA="ℷ",cA="Ѓ",fA="ѓ",dA="⪥",hA="≷",pA="⪒",vA="⪤",mA="⪊",gA="⪊",yA="⪈",bA="≩",wA="⪈",kA="≩",CA="⋧",TA="𝔾",xA="𝕘",EA="`",MA="≥",SA="⋛",OA="≧",LA="⪢",NA="≷",AA="⩾",DA="≳",IA="𝒢",RA="ℊ",BA="≳",PA="⪎",HA="⪐",FA="⪧",qA="⩺",_A=">",$A=">",zA="≫",VA="⋗",UA="⦕",WA="⩼",jA="⪆",GA="⥸",KA="⋗",JA="⋛",XA="⪌",YA="≷",QA="≳",ZA="≩︀",eD="≩︀",tD="ˇ",rD=" ",nD="½",iD="ℋ",aD="Ъ",oD="ъ",sD="⥈",lD="↔",uD="⇔",cD="↭",fD="^",dD="ℏ",hD="Ĥ",pD="ĥ",vD="♥",mD="♥",gD="…",yD="⊹",bD="𝔥",wD="ℌ",kD="ℋ",CD="⤥",TD="⤦",xD="⇿",ED="∻",MD="↩",SD="↪",OD="𝕙",LD="ℍ",ND="―",AD="─",DD="𝒽",ID="ℋ",RD="ℏ",BD="Ħ",PD="ħ",HD="≎",FD="≏",qD="⁃",_D="‐",$D="Í",zD="í",VD="⁣",UD="Î",WD="î",jD="И",GD="и",KD="İ",JD="Е",XD="е",YD="¡",QD="⇔",ZD="𝔦",eI="ℑ",tI="Ì",rI="ì",nI="ⅈ",iI="⨌",aI="∭",oI="⧜",sI="℩",lI="IJ",uI="ij",cI="Ī",fI="ī",dI="ℑ",hI="ⅈ",pI="ℐ",vI="ℑ",mI="ı",gI="ℑ",yI="⊷",bI="Ƶ",wI="⇒",kI="℅",CI="∞",TI="⧝",xI="ı",EI="⊺",MI="∫",SI="∬",OI="ℤ",LI="∫",NI="⊺",AI="⋂",DI="⨗",II="⨼",RI="⁣",BI="⁢",PI="Ё",HI="ё",FI="Į",qI="į",_I="𝕀",$I="𝕚",zI="Ι",VI="ι",UI="⨼",WI="¿",jI="𝒾",GI="ℐ",KI="∈",JI="⋵",XI="⋹",YI="⋴",QI="⋳",ZI="∈",eR="⁢",tR="Ĩ",rR="ĩ",nR="І",iR="і",aR="Ï",oR="ï",sR="Ĵ",lR="ĵ",uR="Й",cR="й",fR="𝔍",dR="𝔧",hR="ȷ",pR="𝕁",vR="𝕛",mR="𝒥",gR="𝒿",yR="Ј",bR="ј",wR="Є",kR="є",CR="Κ",TR="κ",xR="ϰ",ER="Ķ",MR="ķ",SR="К",OR="к",LR="𝔎",NR="𝔨",AR="ĸ",DR="Х",IR="х",RR="Ќ",BR="ќ",PR="𝕂",HR="𝕜",FR="𝒦",qR="𝓀",_R="⇚",$R="Ĺ",zR="ĺ",VR="⦴",UR="ℒ",WR="Λ",jR="λ",GR="⟨",KR="⟪",JR="⦑",XR="⟨",YR="⪅",QR="ℒ",ZR="«",eB="⇤",tB="⤟",rB="←",nB="↞",iB="⇐",aB="⤝",oB="↩",sB="↫",lB="⤹",uB="⥳",cB="↢",fB="⤙",dB="⤛",hB="⪫",pB="⪭",vB="⪭︀",mB="⤌",gB="⤎",yB="❲",bB="{",wB="[",kB="⦋",CB="⦏",TB="⦍",xB="Ľ",EB="ľ",MB="Ļ",SB="ļ",OB="⌈",LB="{",NB="Л",AB="л",DB="⤶",IB="“",RB="„",BB="⥧",PB="⥋",HB="↲",FB="≤",qB="≦",_B="⟨",$B="⇤",zB="←",VB="←",UB="⇐",WB="⇆",jB="↢",GB="⌈",KB="⟦",JB="⥡",XB="⥙",YB="⇃",QB="⌊",ZB="↽",eP="↼",tP="⇇",rP="↔",nP="↔",iP="⇔",aP="⇆",oP="⇋",sP="↭",lP="⥎",uP="↤",cP="⊣",fP="⥚",dP="⋋",hP="⧏",pP="⊲",vP="⊴",mP="⥑",gP="⥠",yP="⥘",bP="↿",wP="⥒",kP="↼",CP="⪋",TP="⋚",xP="≤",EP="≦",MP="⩽",SP="⪨",OP="⩽",LP="⩿",NP="⪁",AP="⪃",DP="⋚︀",IP="⪓",RP="⪅",BP="⋖",PP="⋚",HP="⪋",FP="⋚",qP="≦",_P="≶",$P="≶",zP="⪡",VP="≲",UP="⩽",WP="≲",jP="⥼",GP="⌊",KP="𝔏",JP="𝔩",XP="≶",YP="⪑",QP="⥢",ZP="↽",eH="↼",tH="⥪",rH="▄",nH="Љ",iH="љ",aH="⇇",oH="≪",sH="⋘",lH="⌞",uH="⇚",cH="⥫",fH="◺",dH="Ŀ",hH="ŀ",pH="⎰",vH="⎰",mH="⪉",gH="⪉",yH="⪇",bH="≨",wH="⪇",kH="≨",CH="⋦",TH="⟬",xH="⇽",EH="⟦",MH="⟵",SH="⟵",OH="⟸",LH="⟷",NH="⟷",AH="⟺",DH="⟼",IH="⟶",RH="⟶",BH="⟹",PH="↫",HH="↬",FH="⦅",qH="𝕃",_H="𝕝",$H="⨭",zH="⨴",VH="∗",UH="_",WH="↙",jH="↘",GH="◊",KH="◊",JH="⧫",XH="(",YH="⦓",QH="⇆",ZH="⌟",eF="⇋",tF="⥭",rF="‎",nF="⊿",iF="‹",aF="𝓁",oF="ℒ",sF="↰",lF="↰",uF="≲",cF="⪍",fF="⪏",dF="[",hF="‘",pF="‚",vF="Ł",mF="ł",gF="⪦",yF="⩹",bF="<",wF="<",kF="≪",CF="⋖",TF="⋋",xF="⋉",EF="⥶",MF="⩻",SF="◃",OF="⊴",LF="◂",NF="⦖",AF="⥊",DF="⥦",IF="≨︀",RF="≨︀",BF="¯",PF="♂",HF="✠",FF="✠",qF="↦",_F="↦",$F="↧",zF="↤",VF="↥",UF="▮",WF="⨩",jF="М",GF="м",KF="—",JF="∺",XF="∡",YF=" ",QF="ℳ",ZF="𝔐",eq="𝔪",tq="℧",rq="µ",nq="*",iq="⫰",aq="∣",oq="·",sq="⊟",lq="−",uq="∸",cq="⨪",fq="∓",dq="⫛",hq="…",pq="∓",vq="⊧",mq="𝕄",gq="𝕞",yq="∓",bq="𝓂",wq="ℳ",kq="∾",Cq="Μ",Tq="μ",xq="⊸",Eq="⊸",Mq="∇",Sq="Ń",Oq="ń",Lq="∠⃒",Nq="≉",Aq="⩰̸",Dq="≋̸",Iq="ʼn",Rq="≉",Bq="♮",Pq="ℕ",Hq="♮",Fq=" ",qq="≎̸",_q="≏̸",$q="⩃",zq="Ň",Vq="ň",Uq="Ņ",Wq="ņ",jq="≇",Gq="⩭̸",Kq="⩂",Jq="Н",Xq="н",Yq="–",Qq="⤤",Zq="↗",e_="⇗",t_="↗",r_="≠",n_="≐̸",i_="​",a_="​",o_="​",s_="​",l_="≢",u_="⤨",c_="≂̸",f_="≫",d_="≪",h_=`
`,p_="∄",v_="∄",m_="𝔑",g_="𝔫",y_="≧̸",b_="≱",w_="≱",k_="≧̸",C_="⩾̸",T_="⩾̸",x_="⋙̸",E_="≵",M_="≫⃒",S_="≯",O_="≯",L_="≫̸",N_="↮",A_="⇎",D_="⫲",I_="∋",R_="⋼",B_="⋺",P_="∋",H_="Њ",F_="њ",q_="↚",__="⇍",$_="‥",z_="≦̸",V_="≰",U_="↚",W_="⇍",j_="↮",G_="⇎",K_="≰",J_="≦̸",X_="⩽̸",Y_="⩽̸",Q_="≮",Z_="⋘̸",e$="≴",t$="≪⃒",r$="≮",n$="⋪",i$="⋬",a$="≪̸",o$="∤",s$="⁠",l$=" ",u$="𝕟",c$="ℕ",f$="⫬",d$="¬",h$="≢",p$="≭",v$="∦",m$="∉",g$="≠",y$="≂̸",b$="∄",w$="≯",k$="≱",C$="≧̸",T$="≫̸",x$="≹",E$="⩾̸",M$="≵",S$="≎̸",O$="≏̸",L$="∉",N$="⋵̸",A$="⋹̸",D$="∉",I$="⋷",R$="⋶",B$="⧏̸",P$="⋪",H$="⋬",F$="≮",q$="≰",_$="≸",$$="≪̸",z$="⩽̸",V$="≴",U$="⪢̸",W$="⪡̸",j$="∌",G$="∌",K$="⋾",J$="⋽",X$="⊀",Y$="⪯̸",Q$="⋠",Z$="∌",ez="⧐̸",tz="⋫",rz="⋭",nz="⊏̸",iz="⋢",az="⊐̸",oz="⋣",sz="⊂⃒",lz="⊈",uz="⊁",cz="⪰̸",fz="⋡",dz="≿̸",hz="⊃⃒",pz="⊉",vz="≁",mz="≄",gz="≇",yz="≉",bz="∤",wz="∦",kz="∦",Cz="⫽⃥",Tz="∂̸",xz="⨔",Ez="⊀",Mz="⋠",Sz="⊀",Oz="⪯̸",Lz="⪯̸",Nz="⤳̸",Az="↛",Dz="⇏",Iz="↝̸",Rz="↛",Bz="⇏",Pz="⋫",Hz="⋭",Fz="⊁",qz="⋡",_z="⪰̸",$z="𝒩",zz="𝓃",Vz="∤",Uz="∦",Wz="≁",jz="≄",Gz="≄",Kz="∤",Jz="∦",Xz="⋢",Yz="⋣",Qz="⊄",Zz="⫅̸",eV="⊈",tV="⊂⃒",rV="⊈",nV="⫅̸",iV="⊁",aV="⪰̸",oV="⊅",sV="⫆̸",lV="⊉",uV="⊃⃒",cV="⊉",fV="⫆̸",dV="≹",hV="Ñ",pV="ñ",vV="≸",mV="⋪",gV="⋬",yV="⋫",bV="⋭",wV="Ν",kV="ν",CV="#",TV="№",xV=" ",EV="≍⃒",MV="⊬",SV="⊭",OV="⊮",LV="⊯",NV="≥⃒",AV=">⃒",DV="⤄",IV="⧞",RV="⤂",BV="≤⃒",PV="<⃒",HV="⊴⃒",FV="⤃",qV="⊵⃒",_V="∼⃒",$V="⤣",zV="↖",VV="⇖",UV="↖",WV="⤧",jV="Ó",GV="ó",KV="⊛",JV="Ô",XV="ô",YV="⊚",QV="О",ZV="о",e2="⊝",t2="Ő",r2="ő",n2="⨸",i2="⊙",a2="⦼",o2="Œ",s2="œ",l2="⦿",u2="𝔒",c2="𝔬",f2="˛",d2="Ò",h2="ò",p2="⧁",v2="⦵",m2="Ω",g2="∮",y2="↺",b2="⦾",w2="⦻",k2="‾",C2="⧀",T2="Ō",x2="ō",E2="Ω",M2="ω",S2="Ο",O2="ο",L2="⦶",N2="⊖",A2="𝕆",D2="𝕠",I2="⦷",R2="“",B2="‘",P2="⦹",H2="⊕",F2="↻",q2="⩔",_2="∨",$2="⩝",z2="ℴ",V2="ℴ",U2="ª",W2="º",j2="⊶",G2="⩖",K2="⩗",J2="⩛",X2="Ⓢ",Y2="𝒪",Q2="ℴ",Z2="Ø",eU="ø",tU="⊘",rU="Õ",nU="õ",iU="⨶",aU="⨷",oU="⊗",sU="Ö",lU="ö",uU="⌽",cU="‾",fU="⏞",dU="⎴",hU="⏜",pU="¶",vU="∥",mU="∥",gU="⫳",yU="⫽",bU="∂",wU="∂",kU="П",CU="п",TU="%",xU=".",EU="‰",MU="⊥",SU="‱",OU="𝔓",LU="𝔭",NU="Φ",AU="φ",DU="ϕ",IU="ℳ",RU="☎",BU="Π",PU="π",HU="⋔",FU="ϖ",qU="ℏ",_U="ℎ",$U="ℏ",zU="⨣",VU="⊞",UU="⨢",WU="+",jU="∔",GU="⨥",KU="⩲",JU="±",XU="±",YU="⨦",QU="⨧",ZU="±",eW="ℌ",tW="⨕",rW="𝕡",nW="ℙ",iW="£",aW="⪷",oW="⪻",sW="≺",lW="≼",uW="⪷",cW="≺",fW="≼",dW="≺",hW="⪯",pW="≼",vW="≾",mW="⪯",gW="⪹",yW="⪵",bW="⋨",wW="⪯",kW="⪳",CW="≾",TW="′",xW="″",EW="ℙ",MW="⪹",SW="⪵",OW="⋨",LW="∏",NW="∏",AW="⌮",DW="⌒",IW="⌓",RW="∝",BW="∝",PW="∷",HW="∝",FW="≾",qW="⊰",_W="𝒫",$W="𝓅",zW="Ψ",VW="ψ",UW=" ",WW="𝔔",jW="𝔮",GW="⨌",KW="𝕢",JW="ℚ",XW="⁗",YW="𝒬",QW="𝓆",ZW="ℍ",ej="⨖",tj="?",rj="≟",nj='"',ij='"',aj="⇛",oj="∽̱",sj="Ŕ",lj="ŕ",uj="√",cj="⦳",fj="⟩",dj="⟫",hj="⦒",pj="⦥",vj="⟩",mj="»",gj="⥵",yj="⇥",bj="⤠",wj="⤳",kj="→",Cj="↠",Tj="⇒",xj="⤞",Ej="↪",Mj="↬",Sj="⥅",Oj="⥴",Lj="⤖",Nj="↣",Aj="↝",Dj="⤚",Ij="⤜",Rj="∶",Bj="ℚ",Pj="⤍",Hj="⤏",Fj="⤐",qj="❳",_j="}",$j="]",zj="⦌",Vj="⦎",Uj="⦐",Wj="Ř",jj="ř",Gj="Ŗ",Kj="ŗ",Jj="⌉",Xj="}",Yj="Р",Qj="р",Zj="⤷",e3="⥩",t3="”",r3="”",n3="↳",i3="ℜ",a3="ℛ",o3="ℜ",s3="ℝ",l3="ℜ",u3="▭",c3="®",f3="®",d3="∋",h3="⇋",p3="⥯",v3="⥽",m3="⌋",g3="𝔯",y3="ℜ",b3="⥤",w3="⇁",k3="⇀",C3="⥬",T3="Ρ",x3="ρ",E3="ϱ",M3="⟩",S3="⇥",O3="→",L3="→",N3="⇒",A3="⇄",D3="↣",I3="⌉",R3="⟧",B3="⥝",P3="⥕",H3="⇂",F3="⌋",q3="⇁",_3="⇀",$3="⇄",z3="⇌",V3="⇉",U3="↝",W3="↦",j3="⊢",G3="⥛",K3="⋌",J3="⧐",X3="⊳",Y3="⊵",Q3="⥏",Z3="⥜",eG="⥔",tG="↾",rG="⥓",nG="⇀",iG="˚",aG="≓",oG="⇄",sG="⇌",lG="‏",uG="⎱",cG="⎱",fG="⫮",dG="⟭",hG="⇾",pG="⟧",vG="⦆",mG="𝕣",gG="ℝ",yG="⨮",bG="⨵",wG="⥰",kG=")",CG="⦔",TG="⨒",xG="⇉",EG="⇛",MG="›",SG="𝓇",OG="ℛ",LG="↱",NG="↱",AG="]",DG="’",IG="’",RG="⋌",BG="⋊",PG="▹",HG="⊵",FG="▸",qG="⧎",_G="⧴",$G="⥨",zG="℞",VG="Ś",UG="ś",WG="‚",jG="⪸",GG="Š",KG="š",JG="⪼",XG="≻",YG="≽",QG="⪰",ZG="⪴",e4="Ş",t4="ş",r4="Ŝ",n4="ŝ",i4="⪺",a4="⪶",o4="⋩",s4="⨓",l4="≿",u4="С",c4="с",f4="⊡",d4="⋅",h4="⩦",p4="⤥",v4="↘",m4="⇘",g4="↘",y4="§",b4=";",w4="⤩",k4="∖",C4="∖",T4="✶",x4="𝔖",E4="𝔰",M4="⌢",S4="♯",O4="Щ",L4="щ",N4="Ш",A4="ш",D4="↓",I4="←",R4="∣",B4="∥",P4="→",H4="↑",F4="­",q4="Σ",_4="σ",$4="ς",z4="ς",V4="∼",U4="⩪",W4="≃",j4="≃",G4="⪞",K4="⪠",J4="⪝",X4="⪟",Y4="≆",Q4="⨤",Z4="⥲",eK="←",tK="∘",rK="∖",nK="⨳",iK="⧤",aK="∣",oK="⌣",sK="⪪",lK="⪬",uK="⪬︀",cK="Ь",fK="ь",dK="⌿",hK="⧄",pK="/",vK="𝕊",mK="𝕤",gK="♠",yK="♠",bK="∥",wK="⊓",kK="⊓︀",CK="⊔",TK="⊔︀",xK="√",EK="⊏",MK="⊑",SK="⊏",OK="⊑",LK="⊐",NK="⊒",AK="⊐",DK="⊒",IK="□",RK="□",BK="⊓",PK="⊏",HK="⊑",FK="⊐",qK="⊒",_K="⊔",$K="▪",zK="□",VK="▪",UK="→",WK="𝒮",jK="𝓈",GK="∖",KK="⌣",JK="⋆",XK="⋆",YK="☆",QK="★",ZK="ϵ",e5="ϕ",t5="¯",r5="⊂",n5="⋐",i5="⪽",a5="⫅",o5="⊆",s5="⫃",l5="⫁",u5="⫋",c5="⊊",f5="⪿",d5="⥹",h5="⊂",p5="⋐",v5="⊆",m5="⫅",g5="⊆",y5="⊊",b5="⫋",w5="⫇",k5="⫕",C5="⫓",T5="⪸",x5="≻",E5="≽",M5="≻",S5="⪰",O5="≽",L5="≿",N5="⪰",A5="⪺",D5="⪶",I5="⋩",R5="≿",B5="∋",P5="∑",H5="∑",F5="♪",q5="¹",_5="²",$5="³",z5="⊃",V5="⋑",U5="⪾",W5="⫘",j5="⫆",G5="⊇",K5="⫄",J5="⊃",X5="⊇",Y5="⟉",Q5="⫗",Z5="⥻",e8="⫂",t8="⫌",r8="⊋",n8="⫀",i8="⊃",a8="⋑",o8="⊇",s8="⫆",l8="⊋",u8="⫌",c8="⫈",f8="⫔",d8="⫖",h8="⤦",p8="↙",v8="⇙",m8="↙",g8="⤪",y8="ß",b8="	",w8="⌖",k8="Τ",C8="τ",T8="⎴",x8="Ť",E8="ť",M8="Ţ",S8="ţ",O8="Т",L8="т",N8="⃛",A8="⌕",D8="𝔗",I8="𝔱",R8="∴",B8="∴",P8="∴",H8="Θ",F8="θ",q8="ϑ",_8="ϑ",$8="≈",z8="∼",V8="  ",U8=" ",W8=" ",j8="≈",G8="∼",K8="Þ",J8="þ",X8="˜",Y8="∼",Q8="≃",Z8="≅",e9="≈",t9="⨱",r9="⊠",n9="×",i9="⨰",a9="∭",o9="⤨",s9="⌶",l9="⫱",u9="⊤",c9="𝕋",f9="𝕥",d9="⫚",h9="⤩",p9="‴",v9="™",m9="™",g9="▵",y9="▿",b9="◃",w9="⊴",k9="≜",C9="▹",T9="⊵",x9="◬",E9="≜",M9="⨺",S9="⃛",O9="⨹",L9="⧍",N9="⨻",A9="⏢",D9="𝒯",I9="𝓉",R9="Ц",B9="ц",P9="Ћ",H9="ћ",F9="Ŧ",q9="ŧ",_9="≬",$9="↞",z9="↠",V9="Ú",U9="ú",W9="↑",j9="↟",G9="⇑",K9="⥉",J9="Ў",X9="ў",Y9="Ŭ",Q9="ŭ",Z9="Û",e6="û",t6="У",r6="у",n6="⇅",i6="Ű",a6="ű",o6="⥮",s6="⥾",l6="𝔘",u6="𝔲",c6="Ù",f6="ù",d6="⥣",h6="↿",p6="↾",v6="▀",m6="⌜",g6="⌜",y6="⌏",b6="◸",w6="Ū",k6="ū",C6="¨",T6="_",x6="⏟",E6="⎵",M6="⏝",S6="⋃",O6="⊎",L6="Ų",N6="ų",A6="𝕌",D6="𝕦",I6="⤒",R6="↑",B6="↑",P6="⇑",H6="⇅",F6="↕",q6="↕",_6="⇕",$6="⥮",z6="↿",V6="↾",U6="⊎",W6="↖",j6="↗",G6="υ",K6="ϒ",J6="ϒ",X6="Υ",Y6="υ",Q6="↥",Z6="⊥",eJ="⇈",tJ="⌝",rJ="⌝",nJ="⌎",iJ="Ů",aJ="ů",oJ="◹",sJ="𝒰",lJ="𝓊",uJ="⋰",cJ="Ũ",fJ="ũ",dJ="▵",hJ="▴",pJ="⇈",vJ="Ü",mJ="ü",gJ="⦧",yJ="⦜",bJ="ϵ",wJ="ϰ",kJ="∅",CJ="ϕ",TJ="ϖ",xJ="∝",EJ="↕",MJ="⇕",SJ="ϱ",OJ="ς",LJ="⊊︀",NJ="⫋︀",AJ="⊋︀",DJ="⫌︀",IJ="ϑ",RJ="⊲",BJ="⊳",PJ="⫨",HJ="⫫",FJ="⫩",qJ="В",_J="в",$J="⊢",zJ="⊨",VJ="⊩",UJ="⊫",WJ="⫦",jJ="⊻",GJ="∨",KJ="⋁",JJ="≚",XJ="⋮",YJ="|",QJ="‖",ZJ="|",e7="‖",t7="∣",r7="|",n7="❘",i7="≀",a7=" ",o7="𝔙",s7="𝔳",l7="⊲",u7="⊂⃒",c7="⊃⃒",f7="𝕍",d7="𝕧",h7="∝",p7="⊳",v7="𝒱",m7="𝓋",g7="⫋︀",y7="⊊︀",b7="⫌︀",w7="⊋︀",k7="⊪",C7="⦚",T7="Ŵ",x7="ŵ",E7="⩟",M7="∧",S7="⋀",O7="≙",L7="℘",N7="𝔚",A7="𝔴",D7="𝕎",I7="𝕨",R7="℘",B7="≀",P7="≀",H7="𝒲",F7="𝓌",q7="⋂",_7="◯",$7="⋃",z7="▽",V7="𝔛",U7="𝔵",W7="⟷",j7="⟺",G7="Ξ",K7="ξ",J7="⟵",X7="⟸",Y7="⟼",Q7="⋻",Z7="⨀",eX="𝕏",tX="𝕩",rX="⨁",nX="⨂",iX="⟶",aX="⟹",oX="𝒳",sX="𝓍",lX="⨆",uX="⨄",cX="△",fX="⋁",dX="⋀",hX="Ý",pX="ý",vX="Я",mX="я",gX="Ŷ",yX="ŷ",bX="Ы",wX="ы",kX="¥",CX="𝔜",TX="𝔶",xX="Ї",EX="ї",MX="𝕐",SX="𝕪",OX="𝒴",LX="𝓎",NX="Ю",AX="ю",DX="ÿ",IX="Ÿ",RX="Ź",BX="ź",PX="Ž",HX="ž",FX="З",qX="з",_X="Ż",$X="ż",zX="ℨ",VX="​",UX="Ζ",WX="ζ",jX="𝔷",GX="ℨ",KX="Ж",JX="ж",XX="⇝",YX="𝕫",QX="ℤ",ZX="𝒵",eY="𝓏",tY="‍",rY="‌",Af={Aacute:_k,aacute:$k,Abreve:zk,abreve:Vk,ac:Uk,acd:Wk,acE:jk,Acirc:Gk,acirc:Kk,acute:Jk,Acy:Xk,acy:Yk,AElig:Qk,aelig:Zk,af:eC,Afr:tC,afr:rC,Agrave:nC,agrave:iC,alefsym:aC,aleph:oC,Alpha:sC,alpha:lC,Amacr:uC,amacr:cC,amalg:fC,amp:dC,AMP:hC,andand:pC,And:vC,and:mC,andd:gC,andslope:yC,andv:bC,ang:wC,ange:kC,angle:CC,angmsdaa:TC,angmsdab:xC,angmsdac:EC,angmsdad:MC,angmsdae:SC,angmsdaf:OC,angmsdag:LC,angmsdah:NC,angmsd:AC,angrt:DC,angrtvb:IC,angrtvbd:RC,angsph:BC,angst:PC,angzarr:HC,Aogon:FC,aogon:qC,Aopf:_C,aopf:$C,apacir:zC,ap:VC,apE:UC,ape:WC,apid:jC,apos:GC,ApplyFunction:KC,approx:JC,approxeq:XC,Aring:YC,aring:QC,Ascr:ZC,ascr:e0,Assign:t0,ast:r0,asymp:n0,asympeq:i0,Atilde:a0,atilde:o0,Auml:s0,auml:l0,awconint:u0,awint:c0,backcong:f0,backepsilon:d0,backprime:h0,backsim:p0,backsimeq:v0,Backslash:m0,Barv:g0,barvee:y0,barwed:b0,Barwed:w0,barwedge:k0,bbrk:C0,bbrktbrk:T0,bcong:x0,Bcy:E0,bcy:M0,bdquo:S0,becaus:O0,because:L0,Because:N0,bemptyv:A0,bepsi:D0,bernou:I0,Bernoullis:R0,Beta:B0,beta:P0,beth:H0,between:F0,Bfr:q0,bfr:_0,bigcap:$0,bigcirc:z0,bigcup:V0,bigodot:U0,bigoplus:W0,bigotimes:j0,bigsqcup:G0,bigstar:K0,bigtriangledown:J0,bigtriangleup:X0,biguplus:Y0,bigvee:Q0,bigwedge:Z0,bkarow:eT,blacklozenge:tT,blacksquare:rT,blacktriangle:nT,blacktriangledown:iT,blacktriangleleft:aT,blacktriangleright:oT,blank:sT,blk12:lT,blk14:uT,blk34:cT,block:fT,bne:dT,bnequiv:hT,bNot:pT,bnot:vT,Bopf:mT,bopf:gT,bot:yT,bottom:bT,bowtie:wT,boxbox:kT,boxdl:CT,boxdL:TT,boxDl:xT,boxDL:ET,boxdr:MT,boxdR:ST,boxDr:OT,boxDR:LT,boxh:NT,boxH:AT,boxhd:DT,boxHd:IT,boxhD:RT,boxHD:BT,boxhu:PT,boxHu:HT,boxhU:FT,boxHU:qT,boxminus:_T,boxplus:$T,boxtimes:zT,boxul:VT,boxuL:UT,boxUl:WT,boxUL:jT,boxur:GT,boxuR:KT,boxUr:JT,boxUR:XT,boxv:YT,boxV:QT,boxvh:ZT,boxvH:e1,boxVh:t1,boxVH:r1,boxvl:n1,boxvL:i1,boxVl:a1,boxVL:o1,boxvr:s1,boxvR:l1,boxVr:u1,boxVR:c1,bprime:f1,breve:d1,Breve:h1,brvbar:p1,bscr:v1,Bscr:m1,bsemi:g1,bsim:y1,bsime:b1,bsolb:w1,bsol:k1,bsolhsub:C1,bull:T1,bullet:x1,bump:E1,bumpE:M1,bumpe:S1,Bumpeq:O1,bumpeq:L1,Cacute:N1,cacute:A1,capand:D1,capbrcup:I1,capcap:R1,cap:B1,Cap:P1,capcup:H1,capdot:F1,CapitalDifferentialD:q1,caps:_1,caret:$1,caron:z1,Cayleys:V1,ccaps:U1,Ccaron:W1,ccaron:j1,Ccedil:G1,ccedil:K1,Ccirc:J1,ccirc:X1,Cconint:Y1,ccups:Q1,ccupssm:Z1,Cdot:ex,cdot:tx,cedil:rx,Cedilla:nx,cemptyv:ix,cent:ax,centerdot:ox,CenterDot:sx,cfr:lx,Cfr:ux,CHcy:cx,chcy:fx,check:dx,checkmark:hx,Chi:px,chi:vx,circ:mx,circeq:gx,circlearrowleft:yx,circlearrowright:bx,circledast:wx,circledcirc:kx,circleddash:Cx,CircleDot:Tx,circledR:xx,circledS:Ex,CircleMinus:Mx,CirclePlus:Sx,CircleTimes:Ox,cir:Lx,cirE:Nx,cire:Ax,cirfnint:Dx,cirmid:Ix,cirscir:Rx,ClockwiseContourIntegral:Bx,CloseCurlyDoubleQuote:Px,CloseCurlyQuote:Hx,clubs:Fx,clubsuit:qx,colon:_x,Colon:$x,Colone:zx,colone:Vx,coloneq:Ux,comma:Wx,commat:jx,comp:Gx,compfn:Kx,complement:Jx,complexes:Xx,cong:Yx,congdot:Qx,Congruent:Zx,conint:eE,Conint:tE,ContourIntegral:rE,copf:nE,Copf:iE,coprod:aE,Coproduct:oE,copy:sE,COPY:lE,copysr:uE,CounterClockwiseContourIntegral:cE,crarr:fE,cross:dE,Cross:hE,Cscr:pE,cscr:vE,csub:mE,csube:gE,csup:yE,csupe:bE,ctdot:wE,cudarrl:kE,cudarrr:CE,cuepr:TE,cuesc:xE,cularr:EE,cularrp:ME,cupbrcap:SE,cupcap:OE,CupCap:LE,cup:NE,Cup:AE,cupcup:DE,cupdot:IE,cupor:RE,cups:BE,curarr:PE,curarrm:HE,curlyeqprec:FE,curlyeqsucc:qE,curlyvee:_E,curlywedge:$E,curren:zE,curvearrowleft:VE,curvearrowright:UE,cuvee:WE,cuwed:jE,cwconint:GE,cwint:KE,cylcty:JE,dagger:XE,Dagger:YE,daleth:QE,darr:ZE,Darr:eM,dArr:tM,dash:rM,Dashv:nM,dashv:iM,dbkarow:aM,dblac:oM,Dcaron:sM,dcaron:lM,Dcy:uM,dcy:cM,ddagger:fM,ddarr:dM,DD:hM,dd:pM,DDotrahd:vM,ddotseq:mM,deg:gM,Del:yM,Delta:bM,delta:wM,demptyv:kM,dfisht:CM,Dfr:TM,dfr:xM,dHar:EM,dharl:MM,dharr:SM,DiacriticalAcute:OM,DiacriticalDot:LM,DiacriticalDoubleAcute:NM,DiacriticalGrave:AM,DiacriticalTilde:DM,diam:IM,diamond:RM,Diamond:BM,diamondsuit:PM,diams:HM,die:FM,DifferentialD:qM,digamma:_M,disin:$M,div:zM,divide:VM,divideontimes:UM,divonx:WM,DJcy:jM,djcy:GM,dlcorn:KM,dlcrop:JM,dollar:XM,Dopf:YM,dopf:QM,Dot:ZM,dot:eS,DotDot:tS,doteq:rS,doteqdot:nS,DotEqual:iS,dotminus:aS,dotplus:oS,dotsquare:sS,doublebarwedge:lS,DoubleContourIntegral:uS,DoubleDot:cS,DoubleDownArrow:fS,DoubleLeftArrow:dS,DoubleLeftRightArrow:hS,DoubleLeftTee:pS,DoubleLongLeftArrow:vS,DoubleLongLeftRightArrow:mS,DoubleLongRightArrow:gS,DoubleRightArrow:yS,DoubleRightTee:bS,DoubleUpArrow:wS,DoubleUpDownArrow:kS,DoubleVerticalBar:CS,DownArrowBar:TS,downarrow:xS,DownArrow:ES,Downarrow:MS,DownArrowUpArrow:SS,DownBreve:OS,downdownarrows:LS,downharpoonleft:NS,downharpoonright:AS,DownLeftRightVector:DS,DownLeftTeeVector:IS,DownLeftVectorBar:RS,DownLeftVector:BS,DownRightTeeVector:PS,DownRightVectorBar:HS,DownRightVector:FS,DownTeeArrow:qS,DownTee:_S,drbkarow:$S,drcorn:zS,drcrop:VS,Dscr:US,dscr:WS,DScy:jS,dscy:GS,dsol:KS,Dstrok:JS,dstrok:XS,dtdot:YS,dtri:QS,dtrif:ZS,duarr:eO,duhar:tO,dwangle:rO,DZcy:nO,dzcy:iO,dzigrarr:aO,Eacute:oO,eacute:sO,easter:lO,Ecaron:uO,ecaron:cO,Ecirc:fO,ecirc:dO,ecir:hO,ecolon:pO,Ecy:vO,ecy:mO,eDDot:gO,Edot:yO,edot:bO,eDot:wO,ee:kO,efDot:CO,Efr:TO,efr:xO,eg:EO,Egrave:MO,egrave:SO,egs:OO,egsdot:LO,el:NO,Element:AO,elinters:DO,ell:IO,els:RO,elsdot:BO,Emacr:PO,emacr:HO,empty:FO,emptyset:qO,EmptySmallSquare:_O,emptyv:$O,EmptyVerySmallSquare:zO,emsp13:VO,emsp14:UO,emsp:WO,ENG:jO,eng:GO,ensp:KO,Eogon:JO,eogon:XO,Eopf:YO,eopf:QO,epar:ZO,eparsl:eL,eplus:tL,epsi:rL,Epsilon:nL,epsilon:iL,epsiv:aL,eqcirc:oL,eqcolon:sL,eqsim:lL,eqslantgtr:uL,eqslantless:cL,Equal:fL,equals:dL,EqualTilde:hL,equest:pL,Equilibrium:vL,equiv:mL,equivDD:gL,eqvparsl:yL,erarr:bL,erDot:wL,escr:kL,Escr:CL,esdot:TL,Esim:xL,esim:EL,Eta:ML,eta:SL,ETH:OL,eth:LL,Euml:NL,euml:AL,euro:DL,excl:IL,exist:RL,Exists:BL,expectation:PL,exponentiale:HL,ExponentialE:FL,fallingdotseq:qL,Fcy:_L,fcy:$L,female:zL,ffilig:VL,fflig:UL,ffllig:WL,Ffr:jL,ffr:GL,filig:KL,FilledSmallSquare:JL,FilledVerySmallSquare:XL,fjlig:YL,flat:QL,fllig:ZL,fltns:eN,fnof:tN,Fopf:rN,fopf:nN,forall:iN,ForAll:aN,fork:oN,forkv:sN,Fouriertrf:lN,fpartint:uN,frac12:cN,frac13:fN,frac14:dN,frac15:hN,frac16:pN,frac18:vN,frac23:mN,frac25:gN,frac34:yN,frac35:bN,frac38:wN,frac45:kN,frac56:CN,frac58:TN,frac78:xN,frasl:EN,frown:MN,fscr:SN,Fscr:ON,gacute:LN,Gamma:NN,gamma:AN,Gammad:DN,gammad:IN,gap:RN,Gbreve:BN,gbreve:PN,Gcedil:HN,Gcirc:FN,gcirc:qN,Gcy:_N,gcy:$N,Gdot:zN,gdot:VN,ge:UN,gE:WN,gEl:jN,gel:GN,geq:KN,geqq:JN,geqslant:XN,gescc:YN,ges:QN,gesdot:ZN,gesdoto:eA,gesdotol:tA,gesl:rA,gesles:nA,Gfr:iA,gfr:aA,gg:oA,Gg:sA,ggg:lA,gimel:uA,GJcy:cA,gjcy:fA,gla:dA,gl:hA,glE:pA,glj:vA,gnap:mA,gnapprox:gA,gne:yA,gnE:bA,gneq:wA,gneqq:kA,gnsim:CA,Gopf:TA,gopf:xA,grave:EA,GreaterEqual:MA,GreaterEqualLess:SA,GreaterFullEqual:OA,GreaterGreater:LA,GreaterLess:NA,GreaterSlantEqual:AA,GreaterTilde:DA,Gscr:IA,gscr:RA,gsim:BA,gsime:PA,gsiml:HA,gtcc:FA,gtcir:qA,gt:_A,GT:$A,Gt:zA,gtdot:VA,gtlPar:UA,gtquest:WA,gtrapprox:jA,gtrarr:GA,gtrdot:KA,gtreqless:JA,gtreqqless:XA,gtrless:YA,gtrsim:QA,gvertneqq:ZA,gvnE:eD,Hacek:tD,hairsp:rD,half:nD,hamilt:iD,HARDcy:aD,hardcy:oD,harrcir:sD,harr:lD,hArr:uD,harrw:cD,Hat:fD,hbar:dD,Hcirc:hD,hcirc:pD,hearts:vD,heartsuit:mD,hellip:gD,hercon:yD,hfr:bD,Hfr:wD,HilbertSpace:kD,hksearow:CD,hkswarow:TD,hoarr:xD,homtht:ED,hookleftarrow:MD,hookrightarrow:SD,hopf:OD,Hopf:LD,horbar:ND,HorizontalLine:AD,hscr:DD,Hscr:ID,hslash:RD,Hstrok:BD,hstrok:PD,HumpDownHump:HD,HumpEqual:FD,hybull:qD,hyphen:_D,Iacute:$D,iacute:zD,ic:VD,Icirc:UD,icirc:WD,Icy:jD,icy:GD,Idot:KD,IEcy:JD,iecy:XD,iexcl:YD,iff:QD,ifr:ZD,Ifr:eI,Igrave:tI,igrave:rI,ii:nI,iiiint:iI,iiint:aI,iinfin:oI,iiota:sI,IJlig:lI,ijlig:uI,Imacr:cI,imacr:fI,image:dI,ImaginaryI:hI,imagline:pI,imagpart:vI,imath:mI,Im:gI,imof:yI,imped:bI,Implies:wI,incare:kI,in:"∈",infin:CI,infintie:TI,inodot:xI,intcal:EI,int:MI,Int:SI,integers:OI,Integral:LI,intercal:NI,Intersection:AI,intlarhk:DI,intprod:II,InvisibleComma:RI,InvisibleTimes:BI,IOcy:PI,iocy:HI,Iogon:FI,iogon:qI,Iopf:_I,iopf:$I,Iota:zI,iota:VI,iprod:UI,iquest:WI,iscr:jI,Iscr:GI,isin:KI,isindot:JI,isinE:XI,isins:YI,isinsv:QI,isinv:ZI,it:eR,Itilde:tR,itilde:rR,Iukcy:nR,iukcy:iR,Iuml:aR,iuml:oR,Jcirc:sR,jcirc:lR,Jcy:uR,jcy:cR,Jfr:fR,jfr:dR,jmath:hR,Jopf:pR,jopf:vR,Jscr:mR,jscr:gR,Jsercy:yR,jsercy:bR,Jukcy:wR,jukcy:kR,Kappa:CR,kappa:TR,kappav:xR,Kcedil:ER,kcedil:MR,Kcy:SR,kcy:OR,Kfr:LR,kfr:NR,kgreen:AR,KHcy:DR,khcy:IR,KJcy:RR,kjcy:BR,Kopf:PR,kopf:HR,Kscr:FR,kscr:qR,lAarr:_R,Lacute:$R,lacute:zR,laemptyv:VR,lagran:UR,Lambda:WR,lambda:jR,lang:GR,Lang:KR,langd:JR,langle:XR,lap:YR,Laplacetrf:QR,laquo:ZR,larrb:eB,larrbfs:tB,larr:rB,Larr:nB,lArr:iB,larrfs:aB,larrhk:oB,larrlp:sB,larrpl:lB,larrsim:uB,larrtl:cB,latail:fB,lAtail:dB,lat:hB,late:pB,lates:vB,lbarr:mB,lBarr:gB,lbbrk:yB,lbrace:bB,lbrack:wB,lbrke:kB,lbrksld:CB,lbrkslu:TB,Lcaron:xB,lcaron:EB,Lcedil:MB,lcedil:SB,lceil:OB,lcub:LB,Lcy:NB,lcy:AB,ldca:DB,ldquo:IB,ldquor:RB,ldrdhar:BB,ldrushar:PB,ldsh:HB,le:FB,lE:qB,LeftAngleBracket:_B,LeftArrowBar:$B,leftarrow:zB,LeftArrow:VB,Leftarrow:UB,LeftArrowRightArrow:WB,leftarrowtail:jB,LeftCeiling:GB,LeftDoubleBracket:KB,LeftDownTeeVector:JB,LeftDownVectorBar:XB,LeftDownVector:YB,LeftFloor:QB,leftharpoondown:ZB,leftharpoonup:eP,leftleftarrows:tP,leftrightarrow:rP,LeftRightArrow:nP,Leftrightarrow:iP,leftrightarrows:aP,leftrightharpoons:oP,leftrightsquigarrow:sP,LeftRightVector:lP,LeftTeeArrow:uP,LeftTee:cP,LeftTeeVector:fP,leftthreetimes:dP,LeftTriangleBar:hP,LeftTriangle:pP,LeftTriangleEqual:vP,LeftUpDownVector:mP,LeftUpTeeVector:gP,LeftUpVectorBar:yP,LeftUpVector:bP,LeftVectorBar:wP,LeftVector:kP,lEg:CP,leg:TP,leq:xP,leqq:EP,leqslant:MP,lescc:SP,les:OP,lesdot:LP,lesdoto:NP,lesdotor:AP,lesg:DP,lesges:IP,lessapprox:RP,lessdot:BP,lesseqgtr:PP,lesseqqgtr:HP,LessEqualGreater:FP,LessFullEqual:qP,LessGreater:_P,lessgtr:$P,LessLess:zP,lesssim:VP,LessSlantEqual:UP,LessTilde:WP,lfisht:jP,lfloor:GP,Lfr:KP,lfr:JP,lg:XP,lgE:YP,lHar:QP,lhard:ZP,lharu:eH,lharul:tH,lhblk:rH,LJcy:nH,ljcy:iH,llarr:aH,ll:oH,Ll:sH,llcorner:lH,Lleftarrow:uH,llhard:cH,lltri:fH,Lmidot:dH,lmidot:hH,lmoustache:pH,lmoust:vH,lnap:mH,lnapprox:gH,lne:yH,lnE:bH,lneq:wH,lneqq:kH,lnsim:CH,loang:TH,loarr:xH,lobrk:EH,longleftarrow:MH,LongLeftArrow:SH,Longleftarrow:OH,longleftrightarrow:LH,LongLeftRightArrow:NH,Longleftrightarrow:AH,longmapsto:DH,longrightarrow:IH,LongRightArrow:RH,Longrightarrow:BH,looparrowleft:PH,looparrowright:HH,lopar:FH,Lopf:qH,lopf:_H,loplus:$H,lotimes:zH,lowast:VH,lowbar:UH,LowerLeftArrow:WH,LowerRightArrow:jH,loz:GH,lozenge:KH,lozf:JH,lpar:XH,lparlt:YH,lrarr:QH,lrcorner:ZH,lrhar:eF,lrhard:tF,lrm:rF,lrtri:nF,lsaquo:iF,lscr:aF,Lscr:oF,lsh:sF,Lsh:lF,lsim:uF,lsime:cF,lsimg:fF,lsqb:dF,lsquo:hF,lsquor:pF,Lstrok:vF,lstrok:mF,ltcc:gF,ltcir:yF,lt:bF,LT:wF,Lt:kF,ltdot:CF,lthree:TF,ltimes:xF,ltlarr:EF,ltquest:MF,ltri:SF,ltrie:OF,ltrif:LF,ltrPar:NF,lurdshar:AF,luruhar:DF,lvertneqq:IF,lvnE:RF,macr:BF,male:PF,malt:HF,maltese:FF,Map:"⤅",map:qF,mapsto:_F,mapstodown:$F,mapstoleft:zF,mapstoup:VF,marker:UF,mcomma:WF,Mcy:jF,mcy:GF,mdash:KF,mDDot:JF,measuredangle:XF,MediumSpace:YF,Mellintrf:QF,Mfr:ZF,mfr:eq,mho:tq,micro:rq,midast:nq,midcir:iq,mid:aq,middot:oq,minusb:sq,minus:lq,minusd:uq,minusdu:cq,MinusPlus:fq,mlcp:dq,mldr:hq,mnplus:pq,models:vq,Mopf:mq,mopf:gq,mp:yq,mscr:bq,Mscr:wq,mstpos:kq,Mu:Cq,mu:Tq,multimap:xq,mumap:Eq,nabla:Mq,Nacute:Sq,nacute:Oq,nang:Lq,nap:Nq,napE:Aq,napid:Dq,napos:Iq,napprox:Rq,natural:Bq,naturals:Pq,natur:Hq,nbsp:Fq,nbump:qq,nbumpe:_q,ncap:$q,Ncaron:zq,ncaron:Vq,Ncedil:Uq,ncedil:Wq,ncong:jq,ncongdot:Gq,ncup:Kq,Ncy:Jq,ncy:Xq,ndash:Yq,nearhk:Qq,nearr:Zq,neArr:e_,nearrow:t_,ne:r_,nedot:n_,NegativeMediumSpace:i_,NegativeThickSpace:a_,NegativeThinSpace:o_,NegativeVeryThinSpace:s_,nequiv:l_,nesear:u_,nesim:c_,NestedGreaterGreater:f_,NestedLessLess:d_,NewLine:h_,nexist:p_,nexists:v_,Nfr:m_,nfr:g_,ngE:y_,nge:b_,ngeq:w_,ngeqq:k_,ngeqslant:C_,nges:T_,nGg:x_,ngsim:E_,nGt:M_,ngt:S_,ngtr:O_,nGtv:L_,nharr:N_,nhArr:A_,nhpar:D_,ni:I_,nis:R_,nisd:B_,niv:P_,NJcy:H_,njcy:F_,nlarr:q_,nlArr:__,nldr:$_,nlE:z_,nle:V_,nleftarrow:U_,nLeftarrow:W_,nleftrightarrow:j_,nLeftrightarrow:G_,nleq:K_,nleqq:J_,nleqslant:X_,nles:Y_,nless:Q_,nLl:Z_,nlsim:e$,nLt:t$,nlt:r$,nltri:n$,nltrie:i$,nLtv:a$,nmid:o$,NoBreak:s$,NonBreakingSpace:l$,nopf:u$,Nopf:c$,Not:f$,not:d$,NotCongruent:h$,NotCupCap:p$,NotDoubleVerticalBar:v$,NotElement:m$,NotEqual:g$,NotEqualTilde:y$,NotExists:b$,NotGreater:w$,NotGreaterEqual:k$,NotGreaterFullEqual:C$,NotGreaterGreater:T$,NotGreaterLess:x$,NotGreaterSlantEqual:E$,NotGreaterTilde:M$,NotHumpDownHump:S$,NotHumpEqual:O$,notin:L$,notindot:N$,notinE:A$,notinva:D$,notinvb:I$,notinvc:R$,NotLeftTriangleBar:B$,NotLeftTriangle:P$,NotLeftTriangleEqual:H$,NotLess:F$,NotLessEqual:q$,NotLessGreater:_$,NotLessLess:$$,NotLessSlantEqual:z$,NotLessTilde:V$,NotNestedGreaterGreater:U$,NotNestedLessLess:W$,notni:j$,notniva:G$,notnivb:K$,notnivc:J$,NotPrecedes:X$,NotPrecedesEqual:Y$,NotPrecedesSlantEqual:Q$,NotReverseElement:Z$,NotRightTriangleBar:ez,NotRightTriangle:tz,NotRightTriangleEqual:rz,NotSquareSubset:nz,NotSquareSubsetEqual:iz,NotSquareSuperset:az,NotSquareSupersetEqual:oz,NotSubset:sz,NotSubsetEqual:lz,NotSucceeds:uz,NotSucceedsEqual:cz,NotSucceedsSlantEqual:fz,NotSucceedsTilde:dz,NotSuperset:hz,NotSupersetEqual:pz,NotTilde:vz,NotTildeEqual:mz,NotTildeFullEqual:gz,NotTildeTilde:yz,NotVerticalBar:bz,nparallel:wz,npar:kz,nparsl:Cz,npart:Tz,npolint:xz,npr:Ez,nprcue:Mz,nprec:Sz,npreceq:Oz,npre:Lz,nrarrc:Nz,nrarr:Az,nrArr:Dz,nrarrw:Iz,nrightarrow:Rz,nRightarrow:Bz,nrtri:Pz,nrtrie:Hz,nsc:Fz,nsccue:qz,nsce:_z,Nscr:$z,nscr:zz,nshortmid:Vz,nshortparallel:Uz,nsim:Wz,nsime:jz,nsimeq:Gz,nsmid:Kz,nspar:Jz,nsqsube:Xz,nsqsupe:Yz,nsub:Qz,nsubE:Zz,nsube:eV,nsubset:tV,nsubseteq:rV,nsubseteqq:nV,nsucc:iV,nsucceq:aV,nsup:oV,nsupE:sV,nsupe:lV,nsupset:uV,nsupseteq:cV,nsupseteqq:fV,ntgl:dV,Ntilde:hV,ntilde:pV,ntlg:vV,ntriangleleft:mV,ntrianglelefteq:gV,ntriangleright:yV,ntrianglerighteq:bV,Nu:wV,nu:kV,num:CV,numero:TV,numsp:xV,nvap:EV,nvdash:MV,nvDash:SV,nVdash:OV,nVDash:LV,nvge:NV,nvgt:AV,nvHarr:DV,nvinfin:IV,nvlArr:RV,nvle:BV,nvlt:PV,nvltrie:HV,nvrArr:FV,nvrtrie:qV,nvsim:_V,nwarhk:$V,nwarr:zV,nwArr:VV,nwarrow:UV,nwnear:WV,Oacute:jV,oacute:GV,oast:KV,Ocirc:JV,ocirc:XV,ocir:YV,Ocy:QV,ocy:ZV,odash:e2,Odblac:t2,odblac:r2,odiv:n2,odot:i2,odsold:a2,OElig:o2,oelig:s2,ofcir:l2,Ofr:u2,ofr:c2,ogon:f2,Ograve:d2,ograve:h2,ogt:p2,ohbar:v2,ohm:m2,oint:g2,olarr:y2,olcir:b2,olcross:w2,oline:k2,olt:C2,Omacr:T2,omacr:x2,Omega:E2,omega:M2,Omicron:S2,omicron:O2,omid:L2,ominus:N2,Oopf:A2,oopf:D2,opar:I2,OpenCurlyDoubleQuote:R2,OpenCurlyQuote:B2,operp:P2,oplus:H2,orarr:F2,Or:q2,or:_2,ord:$2,order:z2,orderof:V2,ordf:U2,ordm:W2,origof:j2,oror:G2,orslope:K2,orv:J2,oS:X2,Oscr:Y2,oscr:Q2,Oslash:Z2,oslash:eU,osol:tU,Otilde:rU,otilde:nU,otimesas:iU,Otimes:aU,otimes:oU,Ouml:sU,ouml:lU,ovbar:uU,OverBar:cU,OverBrace:fU,OverBracket:dU,OverParenthesis:hU,para:pU,parallel:vU,par:mU,parsim:gU,parsl:yU,part:bU,PartialD:wU,Pcy:kU,pcy:CU,percnt:TU,period:xU,permil:EU,perp:MU,pertenk:SU,Pfr:OU,pfr:LU,Phi:NU,phi:AU,phiv:DU,phmmat:IU,phone:RU,Pi:BU,pi:PU,pitchfork:HU,piv:FU,planck:qU,planckh:_U,plankv:$U,plusacir:zU,plusb:VU,pluscir:UU,plus:WU,plusdo:jU,plusdu:GU,pluse:KU,PlusMinus:JU,plusmn:XU,plussim:YU,plustwo:QU,pm:ZU,Poincareplane:eW,pointint:tW,popf:rW,Popf:nW,pound:iW,prap:aW,Pr:oW,pr:sW,prcue:lW,precapprox:uW,prec:cW,preccurlyeq:fW,Precedes:dW,PrecedesEqual:hW,PrecedesSlantEqual:pW,PrecedesTilde:vW,preceq:mW,precnapprox:gW,precneqq:yW,precnsim:bW,pre:wW,prE:kW,precsim:CW,prime:TW,Prime:xW,primes:EW,prnap:MW,prnE:SW,prnsim:OW,prod:LW,Product:NW,profalar:AW,profline:DW,profsurf:IW,prop:RW,Proportional:BW,Proportion:PW,propto:HW,prsim:FW,prurel:qW,Pscr:_W,pscr:$W,Psi:zW,psi:VW,puncsp:UW,Qfr:WW,qfr:jW,qint:GW,qopf:KW,Qopf:JW,qprime:XW,Qscr:YW,qscr:QW,quaternions:ZW,quatint:ej,quest:tj,questeq:rj,quot:nj,QUOT:ij,rAarr:aj,race:oj,Racute:sj,racute:lj,radic:uj,raemptyv:cj,rang:fj,Rang:dj,rangd:hj,range:pj,rangle:vj,raquo:mj,rarrap:gj,rarrb:yj,rarrbfs:bj,rarrc:wj,rarr:kj,Rarr:Cj,rArr:Tj,rarrfs:xj,rarrhk:Ej,rarrlp:Mj,rarrpl:Sj,rarrsim:Oj,Rarrtl:Lj,rarrtl:Nj,rarrw:Aj,ratail:Dj,rAtail:Ij,ratio:Rj,rationals:Bj,rbarr:Pj,rBarr:Hj,RBarr:Fj,rbbrk:qj,rbrace:_j,rbrack:$j,rbrke:zj,rbrksld:Vj,rbrkslu:Uj,Rcaron:Wj,rcaron:jj,Rcedil:Gj,rcedil:Kj,rceil:Jj,rcub:Xj,Rcy:Yj,rcy:Qj,rdca:Zj,rdldhar:e3,rdquo:t3,rdquor:r3,rdsh:n3,real:i3,realine:a3,realpart:o3,reals:s3,Re:l3,rect:u3,reg:c3,REG:f3,ReverseElement:d3,ReverseEquilibrium:h3,ReverseUpEquilibrium:p3,rfisht:v3,rfloor:m3,rfr:g3,Rfr:y3,rHar:b3,rhard:w3,rharu:k3,rharul:C3,Rho:T3,rho:x3,rhov:E3,RightAngleBracket:M3,RightArrowBar:S3,rightarrow:O3,RightArrow:L3,Rightarrow:N3,RightArrowLeftArrow:A3,rightarrowtail:D3,RightCeiling:I3,RightDoubleBracket:R3,RightDownTeeVector:B3,RightDownVectorBar:P3,RightDownVector:H3,RightFloor:F3,rightharpoondown:q3,rightharpoonup:_3,rightleftarrows:$3,rightleftharpoons:z3,rightrightarrows:V3,rightsquigarrow:U3,RightTeeArrow:W3,RightTee:j3,RightTeeVector:G3,rightthreetimes:K3,RightTriangleBar:J3,RightTriangle:X3,RightTriangleEqual:Y3,RightUpDownVector:Q3,RightUpTeeVector:Z3,RightUpVectorBar:eG,RightUpVector:tG,RightVectorBar:rG,RightVector:nG,ring:iG,risingdotseq:aG,rlarr:oG,rlhar:sG,rlm:lG,rmoustache:uG,rmoust:cG,rnmid:fG,roang:dG,roarr:hG,robrk:pG,ropar:vG,ropf:mG,Ropf:gG,roplus:yG,rotimes:bG,RoundImplies:wG,rpar:kG,rpargt:CG,rppolint:TG,rrarr:xG,Rrightarrow:EG,rsaquo:MG,rscr:SG,Rscr:OG,rsh:LG,Rsh:NG,rsqb:AG,rsquo:DG,rsquor:IG,rthree:RG,rtimes:BG,rtri:PG,rtrie:HG,rtrif:FG,rtriltri:qG,RuleDelayed:_G,ruluhar:$G,rx:zG,Sacute:VG,sacute:UG,sbquo:WG,scap:jG,Scaron:GG,scaron:KG,Sc:JG,sc:XG,sccue:YG,sce:QG,scE:ZG,Scedil:e4,scedil:t4,Scirc:r4,scirc:n4,scnap:i4,scnE:a4,scnsim:o4,scpolint:s4,scsim:l4,Scy:u4,scy:c4,sdotb:f4,sdot:d4,sdote:h4,searhk:p4,searr:v4,seArr:m4,searrow:g4,sect:y4,semi:b4,seswar:w4,setminus:k4,setmn:C4,sext:T4,Sfr:x4,sfr:E4,sfrown:M4,sharp:S4,SHCHcy:O4,shchcy:L4,SHcy:N4,shcy:A4,ShortDownArrow:D4,ShortLeftArrow:I4,shortmid:R4,shortparallel:B4,ShortRightArrow:P4,ShortUpArrow:H4,shy:F4,Sigma:q4,sigma:_4,sigmaf:$4,sigmav:z4,sim:V4,simdot:U4,sime:W4,simeq:j4,simg:G4,simgE:K4,siml:J4,simlE:X4,simne:Y4,simplus:Q4,simrarr:Z4,slarr:eK,SmallCircle:tK,smallsetminus:rK,smashp:nK,smeparsl:iK,smid:aK,smile:oK,smt:sK,smte:lK,smtes:uK,SOFTcy:cK,softcy:fK,solbar:dK,solb:hK,sol:pK,Sopf:vK,sopf:mK,spades:gK,spadesuit:yK,spar:bK,sqcap:wK,sqcaps:kK,sqcup:CK,sqcups:TK,Sqrt:xK,sqsub:EK,sqsube:MK,sqsubset:SK,sqsubseteq:OK,sqsup:LK,sqsupe:NK,sqsupset:AK,sqsupseteq:DK,square:IK,Square:RK,SquareIntersection:BK,SquareSubset:PK,SquareSubsetEqual:HK,SquareSuperset:FK,SquareSupersetEqual:qK,SquareUnion:_K,squarf:$K,squ:zK,squf:VK,srarr:UK,Sscr:WK,sscr:jK,ssetmn:GK,ssmile:KK,sstarf:JK,Star:XK,star:YK,starf:QK,straightepsilon:ZK,straightphi:e5,strns:t5,sub:r5,Sub:n5,subdot:i5,subE:a5,sube:o5,subedot:s5,submult:l5,subnE:u5,subne:c5,subplus:f5,subrarr:d5,subset:h5,Subset:p5,subseteq:v5,subseteqq:m5,SubsetEqual:g5,subsetneq:y5,subsetneqq:b5,subsim:w5,subsub:k5,subsup:C5,succapprox:T5,succ:x5,succcurlyeq:E5,Succeeds:M5,SucceedsEqual:S5,SucceedsSlantEqual:O5,SucceedsTilde:L5,succeq:N5,succnapprox:A5,succneqq:D5,succnsim:I5,succsim:R5,SuchThat:B5,sum:P5,Sum:H5,sung:F5,sup1:q5,sup2:_5,sup3:$5,sup:z5,Sup:V5,supdot:U5,supdsub:W5,supE:j5,supe:G5,supedot:K5,Superset:J5,SupersetEqual:X5,suphsol:Y5,suphsub:Q5,suplarr:Z5,supmult:e8,supnE:t8,supne:r8,supplus:n8,supset:i8,Supset:a8,supseteq:o8,supseteqq:s8,supsetneq:l8,supsetneqq:u8,supsim:c8,supsub:f8,supsup:d8,swarhk:h8,swarr:p8,swArr:v8,swarrow:m8,swnwar:g8,szlig:y8,Tab:b8,target:w8,Tau:k8,tau:C8,tbrk:T8,Tcaron:x8,tcaron:E8,Tcedil:M8,tcedil:S8,Tcy:O8,tcy:L8,tdot:N8,telrec:A8,Tfr:D8,tfr:I8,there4:R8,therefore:B8,Therefore:P8,Theta:H8,theta:F8,thetasym:q8,thetav:_8,thickapprox:$8,thicksim:z8,ThickSpace:V8,ThinSpace:U8,thinsp:W8,thkap:j8,thksim:G8,THORN:K8,thorn:J8,tilde:X8,Tilde:Y8,TildeEqual:Q8,TildeFullEqual:Z8,TildeTilde:e9,timesbar:t9,timesb:r9,times:n9,timesd:i9,tint:a9,toea:o9,topbot:s9,topcir:l9,top:u9,Topf:c9,topf:f9,topfork:d9,tosa:h9,tprime:p9,trade:v9,TRADE:m9,triangle:g9,triangledown:y9,triangleleft:b9,trianglelefteq:w9,triangleq:k9,triangleright:C9,trianglerighteq:T9,tridot:x9,trie:E9,triminus:M9,TripleDot:S9,triplus:O9,trisb:L9,tritime:N9,trpezium:A9,Tscr:D9,tscr:I9,TScy:R9,tscy:B9,TSHcy:P9,tshcy:H9,Tstrok:F9,tstrok:q9,twixt:_9,twoheadleftarrow:$9,twoheadrightarrow:z9,Uacute:V9,uacute:U9,uarr:W9,Uarr:j9,uArr:G9,Uarrocir:K9,Ubrcy:J9,ubrcy:X9,Ubreve:Y9,ubreve:Q9,Ucirc:Z9,ucirc:e6,Ucy:t6,ucy:r6,udarr:n6,Udblac:i6,udblac:a6,udhar:o6,ufisht:s6,Ufr:l6,ufr:u6,Ugrave:c6,ugrave:f6,uHar:d6,uharl:h6,uharr:p6,uhblk:v6,ulcorn:m6,ulcorner:g6,ulcrop:y6,ultri:b6,Umacr:w6,umacr:k6,uml:C6,UnderBar:T6,UnderBrace:x6,UnderBracket:E6,UnderParenthesis:M6,Union:S6,UnionPlus:O6,Uogon:L6,uogon:N6,Uopf:A6,uopf:D6,UpArrowBar:I6,uparrow:R6,UpArrow:B6,Uparrow:P6,UpArrowDownArrow:H6,updownarrow:F6,UpDownArrow:q6,Updownarrow:_6,UpEquilibrium:$6,upharpoonleft:z6,upharpoonright:V6,uplus:U6,UpperLeftArrow:W6,UpperRightArrow:j6,upsi:G6,Upsi:K6,upsih:J6,Upsilon:X6,upsilon:Y6,UpTeeArrow:Q6,UpTee:Z6,upuparrows:eJ,urcorn:tJ,urcorner:rJ,urcrop:nJ,Uring:iJ,uring:aJ,urtri:oJ,Uscr:sJ,uscr:lJ,utdot:uJ,Utilde:cJ,utilde:fJ,utri:dJ,utrif:hJ,uuarr:pJ,Uuml:vJ,uuml:mJ,uwangle:gJ,vangrt:yJ,varepsilon:bJ,varkappa:wJ,varnothing:kJ,varphi:CJ,varpi:TJ,varpropto:xJ,varr:EJ,vArr:MJ,varrho:SJ,varsigma:OJ,varsubsetneq:LJ,varsubsetneqq:NJ,varsupsetneq:AJ,varsupsetneqq:DJ,vartheta:IJ,vartriangleleft:RJ,vartriangleright:BJ,vBar:PJ,Vbar:HJ,vBarv:FJ,Vcy:qJ,vcy:_J,vdash:$J,vDash:zJ,Vdash:VJ,VDash:UJ,Vdashl:WJ,veebar:jJ,vee:GJ,Vee:KJ,veeeq:JJ,vellip:XJ,verbar:YJ,Verbar:QJ,vert:ZJ,Vert:e7,VerticalBar:t7,VerticalLine:r7,VerticalSeparator:n7,VerticalTilde:i7,VeryThinSpace:a7,Vfr:o7,vfr:s7,vltri:l7,vnsub:u7,vnsup:c7,Vopf:f7,vopf:d7,vprop:h7,vrtri:p7,Vscr:v7,vscr:m7,vsubnE:g7,vsubne:y7,vsupnE:b7,vsupne:w7,Vvdash:k7,vzigzag:C7,Wcirc:T7,wcirc:x7,wedbar:E7,wedge:M7,Wedge:S7,wedgeq:O7,weierp:L7,Wfr:N7,wfr:A7,Wopf:D7,wopf:I7,wp:R7,wr:B7,wreath:P7,Wscr:H7,wscr:F7,xcap:q7,xcirc:_7,xcup:$7,xdtri:z7,Xfr:V7,xfr:U7,xharr:W7,xhArr:j7,Xi:G7,xi:K7,xlarr:J7,xlArr:X7,xmap:Y7,xnis:Q7,xodot:Z7,Xopf:eX,xopf:tX,xoplus:rX,xotime:nX,xrarr:iX,xrArr:aX,Xscr:oX,xscr:sX,xsqcup:lX,xuplus:uX,xutri:cX,xvee:fX,xwedge:dX,Yacute:hX,yacute:pX,YAcy:vX,yacy:mX,Ycirc:gX,ycirc:yX,Ycy:bX,ycy:wX,yen:kX,Yfr:CX,yfr:TX,YIcy:xX,yicy:EX,Yopf:MX,yopf:SX,Yscr:OX,yscr:LX,YUcy:NX,yucy:AX,yuml:DX,Yuml:IX,Zacute:RX,zacute:BX,Zcaron:PX,zcaron:HX,Zcy:FX,zcy:qX,Zdot:_X,zdot:$X,zeetrf:zX,ZeroWidthSpace:VX,Zeta:UX,zeta:WX,zfr:jX,Zfr:GX,ZHcy:KX,zhcy:JX,zigrarr:XX,zopf:YX,Zopf:QX,Zscr:ZX,zscr:eY,zwj:tY,zwnj:rY},nY="Á",iY="á",aY="Â",oY="â",sY="´",lY="Æ",uY="æ",cY="À",fY="à",dY="&",hY="&",pY="Å",vY="å",mY="Ã",gY="ã",yY="Ä",bY="ä",wY="¦",kY="Ç",CY="ç",TY="¸",xY="¢",EY="©",MY="©",SY="¤",OY="°",LY="÷",NY="É",AY="é",DY="Ê",IY="ê",RY="È",BY="è",PY="Ð",HY="ð",FY="Ë",qY="ë",_Y="½",$Y="¼",zY="¾",VY=">",UY=">",WY="Í",jY="í",GY="Î",KY="î",JY="¡",XY="Ì",YY="ì",QY="¿",ZY="Ï",eQ="ï",tQ="«",rQ="<",nQ="<",iQ="¯",aQ="µ",oQ="·",sQ=" ",lQ="¬",uQ="Ñ",cQ="ñ",fQ="Ó",dQ="ó",hQ="Ô",pQ="ô",vQ="Ò",mQ="ò",gQ="ª",yQ="º",bQ="Ø",wQ="ø",kQ="Õ",CQ="õ",TQ="Ö",xQ="ö",EQ="¶",MQ="±",SQ="£",OQ='"',LQ='"',NQ="»",AQ="®",DQ="®",IQ="§",RQ="­",BQ="¹",PQ="²",HQ="³",FQ="ß",qQ="Þ",_Q="þ",$Q="×",zQ="Ú",VQ="ú",UQ="Û",WQ="û",jQ="Ù",GQ="ù",KQ="¨",JQ="Ü",XQ="ü",YQ="Ý",QQ="ý",ZQ="¥",eZ="ÿ",tZ={Aacute:nY,aacute:iY,Acirc:aY,acirc:oY,acute:sY,AElig:lY,aelig:uY,Agrave:cY,agrave:fY,amp:dY,AMP:hY,Aring:pY,aring:vY,Atilde:mY,atilde:gY,Auml:yY,auml:bY,brvbar:wY,Ccedil:kY,ccedil:CY,cedil:TY,cent:xY,copy:EY,COPY:MY,curren:SY,deg:OY,divide:LY,Eacute:NY,eacute:AY,Ecirc:DY,ecirc:IY,Egrave:RY,egrave:BY,ETH:PY,eth:HY,Euml:FY,euml:qY,frac12:_Y,frac14:$Y,frac34:zY,gt:VY,GT:UY,Iacute:WY,iacute:jY,Icirc:GY,icirc:KY,iexcl:JY,Igrave:XY,igrave:YY,iquest:QY,Iuml:ZY,iuml:eQ,laquo:tQ,lt:rQ,LT:nQ,macr:iQ,micro:aQ,middot:oQ,nbsp:sQ,not:lQ,Ntilde:uQ,ntilde:cQ,Oacute:fQ,oacute:dQ,Ocirc:hQ,ocirc:pQ,Ograve:vQ,ograve:mQ,ordf:gQ,ordm:yQ,Oslash:bQ,oslash:wQ,Otilde:kQ,otilde:CQ,Ouml:TQ,ouml:xQ,para:EQ,plusmn:MQ,pound:SQ,quot:OQ,QUOT:LQ,raquo:NQ,reg:AQ,REG:DQ,sect:IQ,shy:RQ,sup1:BQ,sup2:PQ,sup3:HQ,szlig:FQ,THORN:qQ,thorn:_Q,times:$Q,Uacute:zQ,uacute:VQ,Ucirc:UQ,ucirc:WQ,Ugrave:jQ,ugrave:GQ,uml:KQ,Uuml:JQ,uuml:XQ,Yacute:YQ,yacute:QQ,yen:ZQ,yuml:eZ},rZ="&",nZ="'",iZ=">",aZ="<",oZ='"',Df={amp:rZ,apos:nZ,gt:iZ,lt:aZ,quot:oZ},$o={},sZ={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},lZ=Pr&&Pr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($o,"__esModule",{value:!0});var If=lZ(sZ),uZ=String.fromCodePoint||function(r){var e="";return r>65535&&(r-=65536,e+=String.fromCharCode(r>>>10&1023|55296),r=56320|r&1023),e+=String.fromCharCode(r),e};function cZ(r){return r>=55296&&r<=57343||r>1114111?"�":(r in If.default&&(r=If.default[r]),uZ(r))}$o.default=cZ;var Ii=Pr&&Pr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(gt,"__esModule",{value:!0}),gt.decodeHTML=gt.decodeHTMLStrict=gt.decodeXML=void 0;var zo=Ii(Af),fZ=Ii(tZ),dZ=Ii(Df),Rf=Ii($o),hZ=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;gt.decodeXML=Bf(dZ.default),gt.decodeHTMLStrict=Bf(zo.default);function Bf(r){var e=Hf(r);return function(t){return String(t).replace(hZ,e)}}var Pf=function(r,e){return r<e?1:-1};gt.decodeHTML=(function(){for(var r=Object.keys(fZ.default).sort(Pf),e=Object.keys(zo.default).sort(Pf),t=0,n=0;t<e.length;t++)r[n]===e[t]?(e[t]+=";?",n++):e[t]+=";";var i=new RegExp("&(?:"+e.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),a=Hf(zo.default);function o(s){return s.substr(-1)!==";"&&(s+=";"),a(s)}return function(s){return String(s).replace(i,o)}})();function Hf(r){return function(t){if(t.charAt(1)==="#"){var n=t.charAt(2);return n==="X"||n==="x"?Rf.default(parseInt(t.substr(3),16)):Rf.default(parseInt(t.substr(2),10))}return r[t.slice(1,-1)]||t}}var Pe={},Ff=Pr&&Pr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.escapeUTF8=Pe.escape=Pe.encodeNonAsciiHTML=Pe.encodeHTML=Pe.encodeXML=void 0;var pZ=Ff(Df),qf=$f(pZ.default),_f=zf(qf);Pe.encodeXML=Wf(qf);var vZ=Ff(Af),Vo=$f(vZ.default),mZ=zf(Vo);Pe.encodeHTML=yZ(Vo,mZ),Pe.encodeNonAsciiHTML=Wf(Vo);function $f(r){return Object.keys(r).sort().reduce(function(e,t){return e[r[t]]="&"+t+";",e},{})}function zf(r){for(var e=[],t=[],n=0,i=Object.keys(r);n<i.length;n++){var a=i[n];a.length===1?e.push("\\"+a):t.push(a)}e.sort();for(var o=0;o<e.length-1;o++){for(var s=o;s<e.length-1&&e[s].charCodeAt(1)+1===e[s+1].charCodeAt(1);)s+=1;var l=1+s-o;l<3||e.splice(o,l,e[o]+"-"+e[s])}return t.unshift("["+e.join("")+"]"),new RegExp(t.join("|"),"g")}var Vf=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,gZ=String.prototype.codePointAt!=null?function(r){return r.codePointAt(0)}:function(r){return(r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536};function Ri(r){return"&#x"+(r.length>1?gZ(r):r.charCodeAt(0)).toString(16).toUpperCase()+";"}function yZ(r,e){return function(t){return t.replace(e,function(n){return r[n]}).replace(Vf,Ri)}}var Uf=new RegExp(_f.source+"|"+Vf.source,"g");function bZ(r){return r.replace(Uf,Ri)}Pe.escape=bZ;function wZ(r){return r.replace(_f,Ri)}Pe.escapeUTF8=wZ;function Wf(r){return function(e){return e.replace(Uf,function(t){return r[t]||Ri(t)})}}(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.decodeXMLStrict=r.decodeHTML5Strict=r.decodeHTML4Strict=r.decodeHTML5=r.decodeHTML4=r.decodeHTMLStrict=r.decodeHTML=r.decodeXML=r.encodeHTML5=r.encodeHTML4=r.escapeUTF8=r.escape=r.encodeNonAsciiHTML=r.encodeHTML=r.encodeXML=r.encode=r.decodeStrict=r.decode=void 0;var e=gt,t=Pe;function n(l,u){return(!u||u<=0?e.decodeXML:e.decodeHTML)(l)}r.decode=n;function i(l,u){return(!u||u<=0?e.decodeXML:e.decodeHTMLStrict)(l)}r.decodeStrict=i;function a(l,u){return(!u||u<=0?t.encodeXML:t.encodeHTML)(l)}r.encode=a;var o=Pe;Object.defineProperty(r,"encodeXML",{enumerable:!0,get:function(){return o.encodeXML}}),Object.defineProperty(r,"encodeHTML",{enumerable:!0,get:function(){return o.encodeHTML}}),Object.defineProperty(r,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return o.encodeNonAsciiHTML}}),Object.defineProperty(r,"escape",{enumerable:!0,get:function(){return o.escape}}),Object.defineProperty(r,"escapeUTF8",{enumerable:!0,get:function(){return o.escapeUTF8}}),Object.defineProperty(r,"encodeHTML4",{enumerable:!0,get:function(){return o.encodeHTML}}),Object.defineProperty(r,"encodeHTML5",{enumerable:!0,get:function(){return o.encodeHTML}});var s=gt;Object.defineProperty(r,"decodeXML",{enumerable:!0,get:function(){return s.decodeXML}}),Object.defineProperty(r,"decodeHTML",{enumerable:!0,get:function(){return s.decodeHTML}}),Object.defineProperty(r,"decodeHTMLStrict",{enumerable:!0,get:function(){return s.decodeHTMLStrict}}),Object.defineProperty(r,"decodeHTML4",{enumerable:!0,get:function(){return s.decodeHTML}}),Object.defineProperty(r,"decodeHTML5",{enumerable:!0,get:function(){return s.decodeHTML}}),Object.defineProperty(r,"decodeHTML4Strict",{enumerable:!0,get:function(){return s.decodeHTMLStrict}}),Object.defineProperty(r,"decodeHTML5Strict",{enumerable:!0,get:function(){return s.decodeHTMLStrict}}),Object.defineProperty(r,"decodeXMLStrict",{enumerable:!0,get:function(){return s.decodeXML}})})(_o);var jf="&(?:#x[a-f0-9]{1,6}|#[0-9]{1,7}|[a-z][a-z0-9]{1,31});",kZ=92,CZ=/[\\&]/,Uo="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",TZ=new RegExp("\\\\"+Uo+"|"+jf,"gi"),xZ='[&<>"]',Gf=new RegExp(xZ,"g"),EZ=function(r){return r.charCodeAt(0)===kZ?r.charAt(1):_o.decodeHTML(r)};function Sn(r){return CZ.test(r)?r.replace(TZ,EZ):r}function Bi(r){try{return qk(r)}catch{return r}}function MZ(r){switch(r){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";default:return r}}function Hr(r){return Gf.test(r)?r.replace(Gf,MZ):r}function Wo(r,e){for(var t=[],n=0;n<e;n++)t.push(r);return t.join("")}function Kf(r){return r?!/[^ \t]+/.test(r):!0}var SZ=(function(){function r(e){this.current=e,this.root=e,this.entering=!0}return r.prototype.next=function(){var e=this.current,t=this.entering;if(e===null)return null;var n=jo(e);return t&&n?e.firstChild?(this.current=e.firstChild,this.entering=!0):this.entering=!1:e===this.root?this.current=null:e.next===null?(this.current=e.parent,this.entering=!1):(this.current=e.next,this.entering=!0),{entering:t,node:e}},r.prototype.resumeAt=function(e,t){this.current=e,this.entering=t===!0},r})();function jo(r){switch(r.type){case"document":case"blockQuote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"strike":case"link":case"image":case"table":case"tableHead":case"tableBody":case"tableRow":case"tableCell":case"tableDelimRow":case"customInline":return!0;default:return!1}}var OZ=1,Pi={};function LZ(r){return Pi[r]}function Go(r){delete Pi[r]}function NZ(){Pi={}}var On=(function(){function r(e,t){this.parent=null,this.prev=null,this.next=null,this.firstChild=null,this.lastChild=null,this.literal=null,e==="document"?this.id=-1:this.id=OZ++,this.type=e,this.sourcepos=t,Pi[this.id]=this}return r.prototype.isContainer=function(){return jo(this)},r.prototype.unlink=function(){this.prev?this.prev.next=this.next:this.parent&&(this.parent.firstChild=this.next),this.next?this.next.prev=this.prev:this.parent&&(this.parent.lastChild=this.prev),this.parent=null,this.next=null,this.prev=null},r.prototype.replaceWith=function(e){this.insertBefore(e),this.unlink()},r.prototype.insertAfter=function(e){e.unlink(),e.next=this.next,e.next&&(e.next.prev=e),e.prev=this,this.next=e,this.parent&&(e.parent=this.parent,e.next||(e.parent.lastChild=e))},r.prototype.insertBefore=function(e){e.unlink(),e.prev=this.prev,e.prev&&(e.prev.next=e),e.next=this,this.prev=e,e.parent=this.parent,e.prev||(e.parent.firstChild=e)},r.prototype.appendChild=function(e){e.unlink(),e.parent=this,this.lastChild?(this.lastChild.next=e,e.prev=this.lastChild,this.lastChild=e):(this.firstChild=e,this.lastChild=e)},r.prototype.prependChild=function(e){e.unlink(),e.parent=this,this.firstChild?(this.firstChild.prev=e,e.next=this.firstChild,this.firstChild=e):(this.firstChild=e,this.lastChild=e)},r.prototype.walker=function(){return new SZ(this)},r})(),yt=(function(r){Ve(e,r);function e(t,n){var i=r.call(this,t,n)||this;return i.open=!0,i.lineOffsets=null,i.stringContent=null,i.lastLineBlank=!1,i.lastLineChecked=!1,i.type=t,i}return e})(On),AZ=(function(r){Ve(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.listData=null,t}return e})(yt),DZ=(function(r){Ve(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.level=0,t.headingType="atx",t}return e})(yt),IZ=(function(r){Ve(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.isFenced=!1,t.fenceChar=null,t.fenceLength=0,t.fenceOffset=-1,t.info=null,t.infoPadding=0,t}return e})(yt),RZ=(function(r){Ve(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.columns=[],t}return e})(yt),BZ=(function(r){Ve(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.startIdx=0,t.endIdx=0,t.paddingLeft=0,t.paddingRight=0,t.ignored=!1,t}return e})(yt),PZ=(function(r){Ve(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.title="",t.dest="",t.label="",t}return e})(yt),HZ=(function(r){Ve(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.syntaxLength=0,t.offset=-1,t.info="",t}return e})(yt),FZ=(function(r){Ve(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.htmlBlockType=-1,t}return e})(yt),qZ=(function(r){Ve(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.destination=null,t.title=null,t.extendedAutolink=!1,t}return e})(On),_Z=(function(r){Ve(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.tickCount=0,t}return e})(On),$Z=(function(r){Ve(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.info="",t}return e})(On);function X(r,e){switch(r){case"heading":return new DZ(r,e);case"list":case"item":return new AZ(r,e);case"link":case"image":return new qZ(r,e);case"codeBlock":return new IZ(r,e);case"htmlBlock":return new FZ(r,e);case"table":return new RZ(r,e);case"tableCell":return new BZ(r,e);case"document":case"paragraph":case"blockQuote":case"thematicBreak":case"tableRow":case"tableBody":case"tableHead":case"frontMatter":return new yt(r,e);case"code":return new _Z(r,e);case"refDef":return new PZ(r,e);case"customBlock":return new HZ(r,e);case"customInline":return new $Z(r,e);default:return new On(r,e)}}function Jf(r){return r.type==="codeBlock"}function zZ(r){return r.type==="htmlBlock"}function VZ(r){return r.type==="heading"}function Xf(r){return r.type==="list"}function UZ(r){return r.type==="table"}function Fr(r){return r.type==="refDef"}function Yf(r){return r.type==="customBlock"}function WZ(r){return r.type==="customInline"}function te(r,e){var t=X("text",e);return t.literal=r,t}var Qf="[A-Za-z][A-Za-z0-9-]*",jZ="[a-zA-Z_:][a-zA-Z0-9:._-]*",GZ="[^\"'=<>`\\x00-\\x20]+",KZ="'[^']*'",JZ='"[^"]*"',XZ="(?:"+GZ+"|"+KZ+"|"+JZ+")",YZ="(?:\\s*=\\s*"+XZ+")",QZ="(?:\\s+"+jZ+YZ+"?)",Zf="<"+Qf+QZ+"*\\s*/?>",ed="</"+Qf+"\\s*[>]",ZZ="<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->",eee="[<][?].*?[?][>]",tee="<![A-Z]+\\s+[^>]*>",ree="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",nee="(?:"+Zf+"|"+ed+"|"+ZZ+"|"+eee+"|"+tee+"|"+ree+")",iee=new RegExp("^"+nee,"i");/*! http://mths.be/fromcodepoint v0.2.1 by @mathias */var Ko;if(String.fromCodePoint)Ko=function(r){try{return String.fromCodePoint(r)}catch(e){if(e instanceof RangeError)return"�";throw e}};else{var aee=String.fromCharCode,oee=Math.floor;Ko=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=16384,n=[],i,a,o=-1,s=r.length;if(!s)return"";for(var l="";++o<s;){var u=Number(r[o]);if(!isFinite(u)||u<0||u>1114111||oee(u)!==u)return"�";u<=65535?n.push(u):(u-=65536,i=(u>>10)+55296,a=u%1024+56320,n.push(i,a)),(o+1===s||n.length>t)&&(l+=aee.apply(void 0,n),n.length=0)}return l}}var Jo=Ko,see="(?:[w-]+.)*[A-Za-z0-9-]+.[A-Za-z0-9-]+",lee="[^<\\s]*[^<?!.,:*_?~\\s]",uee="[\\w.+-]+@(?:[\\w-]+\\.)+[\\w-]+";function cee(r){var e=/\)+$/.exec(r);if(e){for(var t=0,n=0,i=r;n<i.length;n++){var a=i[n];a==="("?t<0?t=1:t+=1:a===")"&&(t-=1)}if(t<0){var o=Math.min(-t,e[0].length);return r.substring(0,r.length-o)}}return r}function fee(r){return r.replace(/&[A-Za-z0-9]+;$/,"")}function dee(r){for(var e=new RegExp(uee,"g"),t=[],n;n=e.exec(r);){var i=n[0];/[_-]+$/.test(i)||t.push({text:i,range:[n.index,n.index+i.length-1],url:"mailto:"+i})}return t}function hee(r){for(var e=new RegExp("(www|https?://)."+see+lee,"g"),t=[],n;n=e.exec(r);){var i=fee(cee(n[0])),a=n[1]==="www"?"http://":"";t.push({text:i,range:[n.index,n.index+i.length-1],url:""+a+i})}return t}function pee(r){return qo(qo([],hee(r)),dee(r)).sort(function(e,t){return e.range[0]-t.range[0]})}function vee(r,e){typeof e=="boolean"&&(e=pee);for(var t,n=function(){var i=t.entering,a=t.node;if(i&&a.type==="text"&&a.parent.type!=="link"){var o=a.literal,s=e(o);if(!s||!s.length)return"continue";for(var l=0,u=a.sourcepos[0],c=u[0],f=u[1],d=function(A,P){return[[c,f+A],[c,f+P]]},h=[],p=0,v=s;p<v.length;p++){var m=v[p],g=m.range,w=m.url,k=m.text;g[0]>l&&h.push(te(o.substring(l,g[0]),d(l,g[0]-1)));var T=X("link",d.apply(void 0,g));T.appendChild(te(k,d.apply(void 0,g))),T.destination=w,T.extendedAutolink=!0,h.push(T),l=g[1]+1}l<o.length&&h.push(te(o.substring(l),d(l,o.length-1)));for(var x=0,L=h;x<L.length;x++){var E=L[x];a.insertBefore(E)}a.unlink()}};t=r.next();)n()}function Hi(r){return r[r.length-1]}function td(r){return r.slice(1,r.length-1).trim().replace(/[ \t\r\n]+/," ").toLowerCase().toUpperCase()}function Fi(r,e){Object.keys(r).forEach(function(t){e(t,r[t])})}function mee(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];var n=de({},r);return e.forEach(function(i){delete n[i]}),n}function qr(r){return!Object.keys(r).length}function gee(r){Object.keys(r).forEach(function(e){delete r[e]})}var Xo=10,Yo=42,qi=95,yee=96,rd=91,bee=93,_i=126,nd=60,wee=33,id=92,kee=38,ad=40,Qo=41,Cee=58,dr=39,hr=34,pr=36,Zo="\\\\"+Uo,od=new RegExp(/[!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/),Tee=new RegExp('^(?:"('+Zo+'|[^"\\x00])*"|'+("'("+Zo+"|[^'\\x00])*'")+"|"+("\\(("+Zo+"|[^()\\x00])*\\))")),xee=/^(?:<(?:[^<>\n\\\x00]|\\.)*>)/,sd=new RegExp("^"+Uo),Eee=new RegExp("^"+jf,"i"),Mee=/`+/,See=/^`+/,Oee=/\.\.\./g,Lee=/--+/g,Nee=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,Aee=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,Dee=/^ *(?:\n *)?/,es=/^[ \t\n\x0b\x0c\x0d]/,ld=/^\s/,Iee=/ *$/,Ree=/^ */,ud=/^ *(?:\n|$)/,Bee=/^\[(?:[^\\\[\]]|\\.){0,1000}\]/,Pee=/^[^\n`\[\]\\!<&*_'"~$]+/m,Hee=(function(){function r(e){this.subject="",this.delimiters=null,this.brackets=null,this.pos=0,this.lineStartNum=0,this.lineIdx=0,this.lineOffsets=[0],this.linePosOffset=0,this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.options=e}return r.prototype.sourcepos=function(e,t){var n=this.linePosOffset+this.lineOffsets[this.lineIdx],i=this.lineStartNum+this.lineIdx,a=[i,e+n];return typeof t=="number"?[a,[i,t+n]]:a},r.prototype.nextLine=function(){this.lineIdx+=1,this.linePosOffset=-this.pos},r.prototype.match=function(e){var t=e.exec(this.subject.slice(this.pos));return t===null?null:(this.pos+=t.index+t[0].length,t[0])},r.prototype.peek=function(){return this.pos<this.subject.length?this.subject.charCodeAt(this.pos):-1},r.prototype.spnl=function(){return this.match(Dee),!0},r.prototype.parseBackticks=function(e){var t=this.pos+1,n=this.match(See);if(n===null)return!1;for(var i=this.pos,a;(a=this.match(Mee))!==null;)if(a===n){var o=this.subject.slice(i,this.pos-n.length),s=this.sourcepos(t,this.pos),l=o.split(`
`);if(l.length>1){var u=Hi(l);this.lineIdx+=l.length-1,this.linePosOffset=-(this.pos-u.length-n.length),s[1]=this.sourcepos(this.pos),o=l.join(" ")}var c=X("code",s);return o.length>0&&o.match(/[^ ]/)!==null&&o[0]==" "&&o[o.length-1]==" "?c.literal=o.slice(1,o.length-1):c.literal=o,c.tickCount=n.length,e.appendChild(c),!0}return this.pos=i,e.appendChild(te(n,this.sourcepos(t,this.pos-1))),!0},r.prototype.parseBackslash=function(e){var t=this.subject,n;this.pos+=1;var i=this.pos;return this.peek()===Xo?(this.pos+=1,n=X("linebreak",this.sourcepos(this.pos-1,this.pos)),e.appendChild(n),this.nextLine()):sd.test(t.charAt(this.pos))?(e.appendChild(te(t.charAt(this.pos),this.sourcepos(i,this.pos))),this.pos+=1):e.appendChild(te("\\",this.sourcepos(i,i))),!0},r.prototype.parseAutolink=function(e){var t,n,i,a=this.pos+1;return(t=this.match(Nee))?(n=t.slice(1,t.length-1),i=X("link",this.sourcepos(a,this.pos)),i.destination=Bi("mailto:"+n),i.title="",i.appendChild(te(n,this.sourcepos(a+1,this.pos-1))),e.appendChild(i),!0):(t=this.match(Aee))?(n=t.slice(1,t.length-1),i=X("link",this.sourcepos(a,this.pos)),i.destination=Bi(n),i.title="",i.appendChild(te(n,this.sourcepos(a+1,this.pos-1))),e.appendChild(i),!0):!1},r.prototype.parseHtmlTag=function(e){var t=this.pos+1,n=this.match(iee);if(n===null)return!1;var i=X("htmlInline",this.sourcepos(t,this.pos));return i.literal=n,e.appendChild(i),!0},r.prototype.scanDelims=function(e){var t=0,n=this.pos;if(e===dr||e===hr)t++,this.pos++;else for(;this.peek()===e;)t++,this.pos++;if(t===0||t<2&&(e===_i||e===pr))return this.pos=n,null;var i=n===0?`
`:this.subject.charAt(n-1),a=this.peek(),o;a===-1?o=`
`:o=Jo(a);var s=ld.test(o),l=od.test(o),u=ld.test(i),c=od.test(i),f=!s&&(!l||u||c),d=!u&&(!c||s||l),h,p;return e===qi?(h=f&&(!d||c),p=d&&(!f||l)):e===dr||e===hr?(h=f&&!d,p=d):e===pr?(h=!s,p=!u):(h=f,p=d),this.pos=n,{numdelims:t,canOpen:h,canClose:p}},r.prototype.handleDelim=function(e,t){var n=this.scanDelims(e);if(!n)return!1;var i=n.numdelims,a=this.pos+1,o;this.pos+=i,e===dr?o="’":e===hr?o="“":o=this.subject.slice(a-1,this.pos);var s=te(o,this.sourcepos(a,this.pos));return t.appendChild(s),(n.canOpen||n.canClose)&&(this.options.smart||e!==dr&&e!==hr)&&(this.delimiters={cc:e,numdelims:i,origdelims:i,node:s,previous:this.delimiters,next:null,canOpen:n.canOpen,canClose:n.canClose},this.delimiters.previous&&(this.delimiters.previous.next=this.delimiters)),!0},r.prototype.removeDelimiter=function(e){e.previous!==null&&(e.previous.next=e.next),e.next===null?this.delimiters=e.previous:e.next.previous=e.previous},r.prototype.removeDelimitersBetween=function(e,t){e.next!==t&&(e.next=t,t.previous=e)},r.prototype.processEmphasis=function(e){var t,n,i,a,o,s,l,u=!1,c=(t={},t[qi]=[e,e,e],t[Yo]=[e,e,e],t[dr]=[e],t[hr]=[e],t[_i]=[e],t[pr]=[e],t);for(i=this.delimiters;i!==null&&i.previous!==e;)i=i.previous;for(;i!==null;){var f=i.cc,d=f===qi||f===Yo;if(!i.canClose)i=i.next;else{for(n=i.previous,l=!1;n!==null&&n!==e&&n!==c[f][d?i.origdelims%3:0];){if(u=d&&(i.canOpen||n.canClose)&&i.origdelims%3!==0&&(n.origdelims+i.origdelims)%3===0,n.cc===i.cc&&n.canOpen&&!u){l=!0;break}n=n.previous}if(a=i,d||f===_i||f===pr){if(!l)i=i.next;else if(n){var h=i.numdelims>=2&&n.numdelims>=2?2:1,p=d?0:1;o=n.node,s=i.node;var v=d?h===1?"emph":"strong":"strike";f===pr&&(v="customInline");var m=X(v),g=o.sourcepos[1],w=s.sourcepos[0];m.sourcepos=[[g[0],g[1]-h+1],[w[0],w[1]+h-1]],o.sourcepos[1][1]-=h,s.sourcepos[0][1]+=h,o.literal=o.literal.slice(h),s.literal=s.literal.slice(h),n.numdelims-=h,i.numdelims-=h;for(var k=o.next,T=void 0;k&&k!==s;)T=k.next,k.unlink(),m.appendChild(k),k=T;if(f===pr){var x=m.firstChild,L=x.literal||"",E=L.split(/\s/)[0];m.info=E,L.length<=E.length?x.unlink():(x.sourcepos[0][1]+=E.length,x.literal=L.replace(E+" ",""))}if(o.insertAfter(m),this.removeDelimitersBetween(n,i),n.numdelims<=p&&(n.numdelims===0&&o.unlink(),this.removeDelimiter(n)),i.numdelims<=p){i.numdelims===0&&s.unlink();var A=i.next;this.removeDelimiter(i),i=A}}}else f===dr?(i.node.literal="’",l&&(n.node.literal="‘"),i=i.next):f===hr&&(i.node.literal="”",l&&(n.node.literal="“"),i=i.next);l||(c[f][d?a.origdelims%3:0]=a.previous,a.canOpen||this.removeDelimiter(a))}}for(;this.delimiters!==null&&this.delimiters!==e;)this.removeDelimiter(this.delimiters)},r.prototype.parseLinkTitle=function(){var e=this.match(Tee);return e===null?null:Sn(e.substr(1,e.length-2))},r.prototype.parseLinkDestination=function(){var e=this.match(xee);if(e===null){if(this.peek()===nd)return null;for(var t=this.pos,n=0,i=void 0;(i=this.peek())!==-1;)if(i===id&&sd.test(this.subject.charAt(this.pos+1)))this.pos+=1,this.peek()!==-1&&(this.pos+=1);else if(i===ad)this.pos+=1,n+=1;else if(i===Qo){if(n<1)break;this.pos+=1,n-=1}else{if(es.exec(Jo(i))!==null)break;this.pos+=1}return this.pos===t&&i!==Qo||n!==0?null:(e=this.subject.substr(t,this.pos-t),Bi(Sn(e)))}return Bi(Sn(e.substr(1,e.length-2)))},r.prototype.parseLinkLabel=function(){var e=this.match(Bee);return e===null||e.length>1001?0:e.length},r.prototype.parseOpenBracket=function(e){var t=this.pos;this.pos+=1;var n=te("[",this.sourcepos(this.pos,this.pos));return e.appendChild(n),this.addBracket(n,t,!1),!0},r.prototype.parseBang=function(e){var t=this.pos;if(this.pos+=1,this.peek()===rd){this.pos+=1;var n=te("![",this.sourcepos(this.pos-1,this.pos));e.appendChild(n),this.addBracket(n,t+1,!0)}else{var n=te("!",this.sourcepos(this.pos,this.pos));e.appendChild(n)}return!0},r.prototype.parseCloseBracket=function(e){var t=null,n=null,i=!1;this.pos+=1;var a=this.pos,o=this.brackets;if(o===null)return e.appendChild(te("]",this.sourcepos(a,a))),!0;if(!o.active)return e.appendChild(te("]",this.sourcepos(a,a))),this.removeBracket(),!0;var s=o.image,l=this.pos;this.peek()===ad&&(this.pos++,this.spnl()&&(t=this.parseLinkDestination())!==null&&this.spnl()&&(es.test(this.subject.charAt(this.pos-1))&&(n=this.parseLinkTitle())||!0)&&this.spnl()&&this.peek()===Qo?(this.pos+=1,i=!0):this.pos=l);var u="";if(!i){var c=this.pos,f=this.parseLinkLabel();if(f>2?u=this.subject.slice(c,c+f):o.bracketAfter||(u=this.subject.slice(o.index,a)),f===0&&(this.pos=l),u){u=td(u);var d=this.refMap[u];d&&(t=d.destination,n=d.title,i=!0)}}if(i){var h=X(s?"image":"link");h.destination=t,h.title=n||"",h.sourcepos=[o.startpos,this.sourcepos(this.pos)];for(var p=o.node.next,v=void 0;p;)v=p.next,p.unlink(),h.appendChild(p),p=v;if(e.appendChild(h),this.processEmphasis(o.previousDelimiter),this.removeBracket(),o.node.unlink(),!s)for(o=this.brackets;o!==null;)o.image||(o.active=!1),o=o.previous;return this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refLabel:u}),!0}return this.removeBracket(),this.pos=a,e.appendChild(te("]",this.sourcepos(a,a))),this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refLabel:u}),!0},r.prototype.addBracket=function(e,t,n){this.brackets!==null&&(this.brackets.bracketAfter=!0),this.brackets={node:e,startpos:this.sourcepos(t+(n?0:1)),previous:this.brackets,previousDelimiter:this.delimiters,index:t,image:n,active:!0}},r.prototype.removeBracket=function(){this.brackets&&(this.brackets=this.brackets.previous)},r.prototype.parseEntity=function(e){var t,n=this.pos+1;return(t=this.match(Eee))?(e.appendChild(te(_o.decodeHTML(t),this.sourcepos(n,this.pos))),!0):!1},r.prototype.parseString=function(e){var t,n=this.pos+1;if(t=this.match(Pee)){if(this.options.smart){var i=t.replace(Oee,"…").replace(Lee,function(o){var s=0,l=0;return o.length%3===0?l=o.length/3:o.length%2===0?s=o.length/2:o.length%3===2?(s=1,l=(o.length-2)/3):(s=2,l=(o.length-4)/3),Wo("—",l)+Wo("–",s)});e.appendChild(te(i,this.sourcepos(n,this.pos)))}else{var a=te(t,this.sourcepos(n,this.pos));e.appendChild(a)}return!0}return!1},r.prototype.parseNewline=function(e){this.pos+=1;var t=e.lastChild;if(t&&t.type==="text"&&t.literal[t.literal.length-1]===" "){var n=t.literal[t.literal.length-2]===" ",i=t.literal.length;t.literal=t.literal.replace(Iee,"");var a=i-t.literal.length;t.sourcepos[1][1]-=a,e.appendChild(X(n?"linebreak":"softbreak",this.sourcepos(this.pos-a,this.pos)))}else e.appendChild(X("softbreak",this.sourcepos(this.pos,this.pos)));return this.nextLine(),this.match(Ree),!0},r.prototype.parseReference=function(e,t){if(!this.options.referenceDefinition)return 0;this.subject=e.stringContent,this.pos=0;var n=null,i=this.pos,a=this.parseLinkLabel();if(a===0)return 0;var o=this.subject.substr(0,a);if(this.peek()===Cee)this.pos++;else return this.pos=i,0;this.spnl();var s=this.parseLinkDestination();if(s===null)return this.pos=i,0;var l=this.pos;this.spnl(),this.pos!==l&&(n=this.parseLinkTitle()),n===null&&(n="",this.pos=l);var u=!0;if(this.match(ud)===null&&(n===""?u=!1:(n="",this.pos=l,u=this.match(ud)!==null)),!u)return this.pos=i,0;var c=td(o);if(c==="")return this.pos=i,0;var f=this.getReferenceDefSourcepos(e);e.sourcepos[0][0]=f[1][0]+1;var d=X("refDef",f);return d.title=n,d.dest=s,d.label=c,e.insertBefore(d),t[c]?this.refDefCandidateMap[d.id]=d:t[c]=ss(d),this.pos-i},r.prototype.mergeTextNodes=function(e){for(var t,n=[];t=e.next();){var i=t.entering,a=t.node;if(i&&a.type==="text")n.push(a);else if(n.length===1)n=[];else if(n.length>1){var o=n[0],s=n[n.length-1];o.sourcepos&&s.sourcepos&&(o.sourcepos[1]=s.sourcepos[1]),o.next=s.next,o.next&&(o.next.prev=o);for(var l=1;l<n.length;l+=1)o.literal+=n[l].literal,n[l].unlink();n=[]}}},r.prototype.getReferenceDefSourcepos=function(e){for(var t=e.stringContent.split(/\n|\r\n/),n=!1,i=0,a={line:0,ch:0},o=0;o<t.length;o+=1){var s=t[o];if(es.test(s))break;if(/\:/.test(s)&&i===0){if(n)break;var l=s.indexOf(":")===s.length-1?o+1:o;a={line:l,ch:t[l].length},n=!0}var u=s.match(/'|"/g);if(u&&(i+=u.length),i===2){a={line:o,ch:s.length};break}}return[[e.sourcepos[0][0],e.sourcepos[0][1]],[e.sourcepos[0][0]+a.line,a.ch]]},r.prototype.parseInline=function(e){var t,n=!1,i=this.peek();if(i===-1)return!1;switch(i){case Xo:n=this.parseNewline(e);break;case id:n=this.parseBackslash(e);break;case yee:n=this.parseBackticks(e);break;case Yo:case qi:case _i:case pr:n=this.handleDelim(i,e);break;case dr:case hr:n=!!(!((t=this.options)===null||t===void 0)&&t.smart)&&this.handleDelim(i,e);break;case rd:n=this.parseOpenBracket(e);break;case wee:n=this.parseBang(e);break;case bee:n=this.parseCloseBracket(e);break;case nd:n=this.parseAutolink(e)||this.parseHtmlTag(e);break;case kee:e.disabledEntityParse||(n=this.parseEntity(e));break;default:n=this.parseString(e);break}return n||(this.pos+=1,e.appendChild(te(Jo(i),this.sourcepos(this.pos,this.pos+1)))),!0},r.prototype.parse=function(e){for(this.subject=e.stringContent.trim(),this.pos=0,this.delimiters=null,this.brackets=null,this.lineOffsets=e.lineOffsets||[0],this.lineIdx=0,this.linePosOffset=0,this.lineStartNum=e.sourcepos[0][0],VZ(e)&&(this.lineOffsets[0]+=e.level+1);this.parseInline(e););e.stringContent=null,this.processEmphasis(null),this.mergeTextNodes(e.walker());var t=this.options,n=t.extendedAutolinks,i=t.customParser;if(n&&vee(e.walker(),n),i&&e.firstChild)for(var a,o=e.firstChild.walker();a=o.next();){var s=a.node,l=a.entering;i[s.type]&&i[s.type](s,{entering:l,options:this.options})}},r})(),Fee=/^\[([ \txX])\][ \t]+/;function qee(r,e){if(e.firstChild&&e.firstChild.type==="paragraph"){var t=e.firstChild,n=t.stringContent.match(Fee);if(n){var i=n[0].length;t.stringContent=t.stringContent.substring(i-1),t.sourcepos[0][1]+=i,t.lineOffsets[0]+=i,e.listData.task=!0,e.listData.checked=/[xX]/.test(n[1])}}}var _ee={continue:function(){return 0},finalize:function(){},canContain:function(r){return r==="tableHead"||r==="tableBody"},acceptsLines:!1},$ee={continue:function(){return 0},finalize:function(){},canContain:function(r){return r==="tableRow"},acceptsLines:!1},zee={continue:function(){return 1},finalize:function(){},canContain:function(r){return r==="tableRow"||r==="tableDelimRow"},acceptsLines:!1},Vee={continue:function(){return 1},finalize:function(){},canContain:function(r){return r==="tableDelimCell"},acceptsLines:!1},Uee={continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},Wee={continue:function(){return 1},finalize:function(){},canContain:function(r){return r==="tableCell"},acceptsLines:!1},jee={continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},$i=4,cd=9,fd=62,Gee=60,dd=32,hd=91,pd=/[^ \t\f\v\r\n]/,Kee=/^(?:`{3,}|~{3,})(?= *$)/;function vd(r){for(var e=r;e;){if(e.lastLineBlank)return!0;var t=e.type;if(!e.lastLineChecked&&(t==="list"||t==="item"))e.lastLineChecked=!0,e=e.lastChild;else{e.lastLineChecked=!0;break}}return!1}function He(r,e){return e<r.length?r.charCodeAt(e):-1}function md(r){return!pd.test(r)}function _r(r){return r===dd||r===cd}var Jee=/^\$\$$/,Xee={continue:function(r,e){var t=r.currentLine,n=t.match(Jee);if(n)return r.lastLineLength=n[0].length,r.finalize(e,r.lineNumber),2;for(var i=e.offset;i>0&&_r(He(t,r.offset));)r.advanceOffset(1,!0),i--;return 0},finalize:function(r,e){if(e.stringContent!==null){var t=e.stringContent,n=t.indexOf(`
`),i=t.slice(0,n),a=t.slice(n+1),o=i.match(/^(\s*)(.*)/);e.info=Sn(o[2].trim()),e.literal=a,e.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},gd={continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!0},Yee={continue:function(){return 0},finalize:function(){},canContain:function(r){return r!=="item"},acceptsLines:!1},Qee={continue:function(){return 0},finalize:function(r,e){for(var t=e.firstChild;t;){if(vd(t)&&t.next){e.listData.tight=!1;break}for(var n=t.firstChild;n;){if(vd(n)&&(t.next||n.next)){e.listData.tight=!1;break}n=n.next}t=t.next}},canContain:function(r){return r==="item"},acceptsLines:!1},Zee={continue:function(r){var e=r.currentLine;if(!r.indented&&He(e,r.nextNonspace)===fd)r.advanceNextNonspace(),r.advanceOffset(1,!1),_r(He(e,r.offset))&&r.advanceOffset(1,!0);else return 1;return 0},finalize:function(){},canContain:function(r){return r!=="item"},acceptsLines:!1},ete={continue:function(r,e){if(r.blank){if(e.firstChild===null)return 1;r.advanceNextNonspace()}else if(r.indent>=e.listData.markerOffset+e.listData.padding)r.advanceOffset(e.listData.markerOffset+e.listData.padding,!0);else return 1;return 0},finalize:qee,canContain:function(r){return r!=="item"},acceptsLines:!1},tte={continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},rte={continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},nte={continue:function(r,e){var t=r.currentLine,n=r.indent;if(e.isFenced){var i=n<=3&&t.charAt(r.nextNonspace)===e.fenceChar&&t.slice(r.nextNonspace).match(Kee);if(i&&i[0].length>=e.fenceLength)return r.lastLineLength=r.offset+n+i[0].length,r.finalize(e,r.lineNumber),2;for(var a=e.fenceOffset;a>0&&_r(He(t,r.offset));)r.advanceOffset(1,!0),a--}else if(n>=$i)r.advanceOffset($i,!0);else if(r.blank)r.advanceNextNonspace();else return 1;return 0},finalize:function(r,e){var t;if(e.stringContent!==null){if(e.isFenced){var n=e.stringContent,i=n.indexOf(`
`),a=n.slice(0,i),o=n.slice(i+1),s=a.match(/^(\s*)(.*)/);e.infoPadding=s[1].length,e.info=Sn(s[2].trim()),e.literal=o}else e.literal=(t=e.stringContent)===null||t===void 0?void 0:t.replace(/(\n *)+$/,`
`);e.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},ite={continue:function(r,e){return r.blank&&(e.htmlBlockType===6||e.htmlBlockType===7)?1:0},finalize:function(r,e){var t;e.literal=((t=e.stringContent)===null||t===void 0?void 0:t.replace(/(\n *)+$/,""))||null,e.stringContent=null},canContain:function(){return!1},acceptsLines:!0},ate={continue:function(r){return r.blank?1:0},finalize:function(r,e){if(e.stringContent!==null){for(var t,n=!1;He(e.stringContent,0)===hd&&(t=r.inlineParser.parseReference(e,r.refMap));)e.stringContent=e.stringContent.slice(t),n=!0;n&&md(e.stringContent)&&e.unlink()}},canContain:function(){return!1},acceptsLines:!0},ote=gd,ste=gd,$r={document:Yee,list:Qee,blockQuote:Zee,item:ete,heading:tte,thematicBreak:rte,codeBlock:nte,htmlBlock:ite,paragraph:ate,table:_ee,tableBody:$ee,tableHead:zee,tableRow:Wee,tableCell:jee,tableDelimRow:Vee,tableDelimCell:Uee,refDef:ote,customBlock:Xee,frontMatter:ste};function ts(r){for(var e=0,t=0,n=[],i=0;i<r.length;i+=1)if(r[i]==="|"&&r[i-1]!=="\\"){var a=r.substring(e,i);e===0&&Kf(a)?t=i+1:n.push(a),e=i+1}if(e<r.length){var a=r.substring(e,r.length);Kf(a)||n.push(a)}return[t,n]}function rs(r,e,t,n){for(var i=[],a=0,o=e;a<o.length;a++){var s=o[a],l=s.match(/^[ \t]+/),u=l?l[0].length:0,c=void 0,f=void 0;if(u===s.length)u=0,c=0,f="";else{var d=s.match(/[ \t]+$/);c=d?d[0].length:0,f=s.slice(u,s.length-c)}var h=n+u,p=X(r,[[t,n],[t,n+s.length-1]]);p.stringContent=f.replace(/\\\|/g,"|"),p.startIdx=i.length,p.endIdx=i.length,p.lineOffsets=[h-1],p.paddingLeft=u,p.paddingRight=c,i.push(p),n+=s.length+1}return i}function lte(r){var e=null,t=r.stringContent,n=t[0],i=t[t.length-1];return i===":"?e=n===":"?"center":"right":n===":"&&(e="left"),{align:e}}var ute=function(r,e){var t=e.stringContent;if(e.type==="paragraph"&&!r.indented&&!r.blank){var n=t.length-1,i=t.lastIndexOf(`
`,n-1)+1,a=t.slice(i,n),o=r.currentLine.slice(r.nextNonspace),s=ts(a),l=s[0],u=s[1],c=ts(o),f=c[0],d=c[1],h=/^[ \t]*:?-+:?[ \t]*$/;if(!u.length||!d.length||d.some(function(A){return!h.test(A)})||d.length===1&&o.indexOf("|")!==0)return 0;var p=e.lineOffsets,v=r.lineNumber-1,m=Hi(p)+1,g=X("table",[[v,m],[r.lineNumber,r.offset]]);if(g.columns=d.map(function(){return{align:null}}),e.insertAfter(g),p.length===1)e.unlink();else{e.stringContent=t.slice(0,i);var w=t.lastIndexOf(`
`,i-2)+1,k=i-w-1;r.lastLineLength=p[p.length-2]+k,r.finalize(e,v-1)}r.advanceOffset(r.currentLine.length-r.offset,!1);var T=X("tableHead",[[v,m],[r.lineNumber,r.offset]]);g.appendChild(T);var x=X("tableRow",[[v,m],[v,m+a.length-1]]),L=X("tableDelimRow",[[r.lineNumber,r.nextNonspace+1],[r.lineNumber,r.offset]]);T.appendChild(x),T.appendChild(L),rs("tableCell",u,v,m+l).forEach(function(A){x.appendChild(A)});var E=rs("tableDelimCell",d,r.lineNumber,r.nextNonspace+1+f);return E.forEach(function(A){L.appendChild(A)}),g.columns=E.map(lte),r.tip=g,2}return 0},cte=function(r,e){if(e.type!=="table"&&e.type!=="tableBody"||!r.blank&&r.currentLine.indexOf("|")===-1)return 0;if(r.advanceOffset(r.currentLine.length-r.offset,!1),r.blank){var t=e;return e.type==="tableBody"&&(t=e.parent,r.finalize(e,r.lineNumber-1)),r.finalize(t,r.lineNumber-1),0}var n=e;e.type==="table"&&(n=r.addChild("tableBody",r.nextNonspace),n.stringContent=null);var i=X("tableRow",[[r.lineNumber,r.nextNonspace+1],[r.lineNumber,r.currentLine.length]]);n.appendChild(i);var a=n.parent,o=r.currentLine.slice(r.nextNonspace),s=ts(o),l=s[0],u=s[1];return rs("tableCell",u,r.lineNumber,r.nextNonspace+1+l).forEach(function(c,f){f>=a.columns.length&&(c.ignored=!0),i.appendChild(c)}),2},fte=/^(\$\$)(\s*[a-zA-Z])+/,dte=/^(\$\$)(\s*[a-zA-Z])+.*(\$\$)/,hte=function(r){var e;if(!r.indented&&!dte.test(r.currentLine)&&(e=r.currentLine.match(fte))){var t=e[1].length;r.closeUnmatchedBlocks();var n=r.addChild("customBlock",r.nextNonspace);return n.syntaxLength=t,n.offset=r.indent,r.advanceNextNonspace(),r.advanceOffset(t,!1),2}return 0},pte=/^`{3,}(?!.*`)|^~{3,}/,vte=[/./,/^<(?:script|pre|style)(?:\s|>|$)/i,/^<!--/,/^<[?]/,/^<![A-Z]/,/^<!\[CDATA\[/,/^<[/]?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[123456]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[/]?[>]|$)/i,new RegExp("^(?:"+Zf+"|"+ed+")\\s*$","i")],mte=/^(?:=+|-+)[ \t]*$/,gte=/^#{1,6}(?:[ \t]+|$)/,yte=/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})[ \t]*$/,yd=/^[*+-]/,bd=/^(\d{1,9})([.)])/;function bte(r,e){var t=r.currentLine.slice(r.nextNonspace),n,i,a={type:"bullet",tight:!0,bulletChar:"",start:0,delimiter:"",padding:0,markerOffset:r.indent,task:!1,checked:!1};if(r.indent>=4)return null;if(n=t.match(yd))a.type="bullet",a.bulletChar=n[0][0];else if((n=t.match(bd))&&(e.type!=="paragraph"||n[1]==="1"))a.type="ordered",a.start=parseInt(n[1],10),a.delimiter=n[2];else return null;if(i=He(r.currentLine,r.nextNonspace+n[0].length),!(i===-1||i===cd||i===dd)||e.type==="paragraph"&&!r.currentLine.slice(r.nextNonspace+n[0].length).match(pd))return null;r.advanceNextNonspace(),r.advanceOffset(n[0].length,!0);var o=r.column,s=r.offset;do r.advanceOffset(1,!0),i=He(r.currentLine,r.offset);while(r.column-o<5&&_r(i));var l=He(r.currentLine,r.offset)===-1,u=r.column-o;return u>=5||u<1||l?(a.padding=n[0].length+1,r.column=o,r.offset=s,_r(He(r.currentLine,r.offset))&&r.advanceOffset(1,!0)):a.padding=n[0].length+u,a}function wte(r,e){return r.type===e.type&&r.delimiter===e.delimiter&&r.bulletChar===e.bulletChar}function wd(r,e){return r.options.disallowDeepHeading&&(e.type==="blockQuote"||e.type==="item")}var kte=function(r){return!r.indented&&He(r.currentLine,r.nextNonspace)===fd?(r.advanceNextNonspace(),r.advanceOffset(1,!1),_r(He(r.currentLine,r.offset))&&r.advanceOffset(1,!0),r.closeUnmatchedBlocks(),r.addChild("blockQuote",r.nextNonspace),1):0},Cte=function(r,e){var t;if(!r.indented&&!wd(r,e)&&(t=r.currentLine.slice(r.nextNonspace).match(gte))){r.advanceNextNonspace(),r.advanceOffset(t[0].length,!1),r.closeUnmatchedBlocks();var n=r.addChild("heading",r.nextNonspace);return n.level=t[0].trim().length,n.headingType="atx",n.stringContent=r.currentLine.slice(r.offset).replace(/^[ \t]*#+[ \t]*$/,"").replace(/[ \t]+#+[ \t]*$/,""),r.advanceOffset(r.currentLine.length-r.offset),2}return 0},Tte=function(r){var e;if(!r.indented&&(e=r.currentLine.slice(r.nextNonspace).match(pte))){var t=e[0].length;r.closeUnmatchedBlocks();var n=r.addChild("codeBlock",r.nextNonspace);return n.isFenced=!0,n.fenceLength=t,n.fenceChar=e[0][0],n.fenceOffset=r.indent,r.advanceNextNonspace(),r.advanceOffset(t,!1),2}return 0},xte=function(r,e){if(!r.indented&&He(r.currentLine,r.nextNonspace)===Gee){var t=r.currentLine.slice(r.nextNonspace),n=r.options.disallowedHtmlBlockTags,i=void 0;for(i=1;i<=7;i++){var a=t.match(vte[i]);if(a){if(i===7){if(e.type==="paragraph")return 0;if(n.length>0){var o=new RegExp("</?(?:"+n.join("|")+")","i");if(o.test(a[0]))return 0}}r.closeUnmatchedBlocks();var s=r.addChild("htmlBlock",r.offset);return s.htmlBlockType=i,2}}}return 0},Ete=function(r,e){var t;if(e.stringContent!==null&&!r.indented&&e.type==="paragraph"&&!wd(r,e.parent)&&(t=r.currentLine.slice(r.nextNonspace).match(mte))){r.closeUnmatchedBlocks();for(var n=void 0;He(e.stringContent,0)===hd&&(n=r.inlineParser.parseReference(e,r.refMap));)e.stringContent=e.stringContent.slice(n);if(e.stringContent.length>0){var i=X("heading",e.sourcepos);return i.level=t[0][0]==="="?1:2,i.headingType="setext",i.stringContent=e.stringContent,e.insertAfter(i),e.unlink(),r.tip=i,r.advanceOffset(r.currentLine.length-r.offset,!1),2}return 0}return 0},Mte=function(r){return!r.indented&&yte.test(r.currentLine.slice(r.nextNonspace))?(r.closeUnmatchedBlocks(),r.addChild("thematicBreak",r.nextNonspace),r.advanceOffset(r.currentLine.length-r.offset,!1),2):0},Ste=function(r,e){var t,n=e;return(!r.indented||e.type==="list")&&(t=bte(r,n))?(r.closeUnmatchedBlocks(),(r.tip.type!=="list"||!wte(n.listData,t))&&(n=r.addChild("list",r.nextNonspace),n.listData=t),n=r.addChild("item",r.nextNonspace),n.listData=t,1):0},Ote=function(r){return r.indented&&r.tip.type!=="paragraph"&&!r.blank?(r.advanceOffset($i,!0),r.closeUnmatchedBlocks(),r.addChild("codeBlock",r.offset),2):0},ns=[kte,Cte,Tte,xte,Ete,Mte,Ste,Ote,ute,cte,hte],kd=/^(-{3}|\+{3}|;{3})$/,Lte=function(r,e){var t=r.currentLine,n=r.lineNumber,i=r.indented;if(n===1&&!i&&e.type==="document"&&kd.test(t)){r.closeUnmatchedBlocks();var a=r.addChild("frontMatter",r.nextNonspace);return a.stringContent=t,r.advanceNextNonspace(),r.advanceOffset(t.length,!1),2}return 0},Nte={continue:function(r,e){var t=r.currentLine,n=t.match(kd);return e.type==="frontMatter"&&n?(e.stringContent+=t,r.lastLineLength=n[0].length,r.finalize(e,r.lineNumber),2):0},finalize:function(r,e){e.stringContent!==null&&(e.literal=e.stringContent,e.stringContent=null)},canContain:function(){return!1},acceptsLines:!0},Ate=[/./,/<\/(?:script|pre|style)>/i,/-->/,/\?>/,/>/,/\]\]>/],Dte=/^[#`~*+_=<>0-9-;$]/,Ite=/\r\n|\n|\r/;function is(){return X("document",[[1,1],[0,0]])}var Rte={smart:!1,tagFilter:!1,extendedAutolinks:!1,disallowedHtmlBlockTags:[],referenceDefinition:!1,disallowDeepHeading:!1,customParser:null,frontMatter:!1},Bte=(function(){function r(e){this.options=de(de({},Rte),e),this.doc=is(),this.tip=this.doc,this.oldtip=this.doc,this.lineNumber=0,this.offset=0,this.column=0,this.nextNonspace=0,this.nextNonspaceColumn=0,this.indent=0,this.currentLine="",this.indented=!1,this.blank=!1,this.partiallyConsumedTab=!1,this.allClosed=!0,this.lastMatchedContainer=this.doc,this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.lastLineLength=0,this.lines=[],this.options.frontMatter&&($r.frontMatter=Nte,ns.unshift(Lte)),this.inlineParser=new Hee(this.options)}return r.prototype.advanceOffset=function(e,t){t===void 0&&(t=!1);for(var n=this.currentLine,i,a,o;e>0&&(o=n[this.offset]);)o==="	"?(i=4-this.column%4,t?(this.partiallyConsumedTab=i>e,a=i>e?e:i,this.column+=a,this.offset+=this.partiallyConsumedTab?0:1,e-=a):(this.partiallyConsumedTab=!1,this.column+=i,this.offset+=1,e-=1)):(this.partiallyConsumedTab=!1,this.offset+=1,this.column+=1,e-=1)},r.prototype.advanceNextNonspace=function(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn,this.partiallyConsumedTab=!1},r.prototype.findNextNonspace=function(){for(var e=this.currentLine,t=this.offset,n=this.column,i;(i=e.charAt(t))!=="";)if(i===" ")t++,n++;else if(i==="	")t++,n+=4-n%4;else break;this.blank=i===`
`||i==="\r"||i==="",this.nextNonspace=t,this.nextNonspaceColumn=n,this.indent=this.nextNonspaceColumn-this.column,this.indented=this.indent>=$i},r.prototype.addLine=function(){if(this.partiallyConsumedTab){this.offset+=1;var e=4-this.column%4;this.tip.stringContent+=Wo(" ",e)}this.tip.lineOffsets?this.tip.lineOffsets.push(this.offset):this.tip.lineOffsets=[this.offset],this.tip.stringContent+=this.currentLine.slice(this.offset)+`
`},r.prototype.addChild=function(e,t){for(;!$r[this.tip.type].canContain(e);)this.finalize(this.tip,this.lineNumber-1);var n=t+1,i=X(e,[[this.lineNumber,n],[0,0]]);return i.stringContent="",this.tip.appendChild(i),this.tip=i,i},r.prototype.closeUnmatchedBlocks=function(){if(!this.allClosed){for(;this.oldtip!==this.lastMatchedContainer;){var e=this.oldtip.parent;this.finalize(this.oldtip,this.lineNumber-1),this.oldtip=e}this.allClosed=!0}},r.prototype.finalize=function(e,t){var n=e.parent;e.open=!1,e.sourcepos[1]=[t,this.lastLineLength],$r[e.type].finalize(this,e),this.tip=n},r.prototype.processInlines=function(e){var t,n=this.options.customParser,i=e.walker();for(this.inlineParser.refMap=this.refMap,this.inlineParser.refLinkCandidateMap=this.refLinkCandidateMap,this.inlineParser.refDefCandidateMap=this.refDefCandidateMap,this.inlineParser.options=this.options;t=i.next();){var a=t.node,o=t.entering,s=a.type;n&&n[s]&&n[s](a,{entering:o,options:this.options}),!o&&(s==="paragraph"||s==="heading"||s==="tableCell"&&!a.ignored)&&this.inlineParser.parse(a)}},r.prototype.incorporateLine=function(e){var t=this.doc;this.oldtip=this.tip,this.offset=0,this.column=0,this.blank=!1,this.partiallyConsumedTab=!1,this.lineNumber+=1,e.indexOf("\0")!==-1&&(e=e.replace(/\0/g,"�")),this.currentLine=e;for(var n=!0,i;(i=t.lastChild)&&i.open;){switch(t=i,this.findNextNonspace(),$r[t.type].continue(this,t)){case 0:break;case 1:n=!1;break;case 2:this.lastLineLength=e.length;return;default:throw new Error("continue returned illegal value, must be 0, 1, or 2")}if(!n){t=t.parent;break}}this.allClosed=t===this.oldtip,this.lastMatchedContainer=t;for(var a=t.type!=="paragraph"&&$r[t.type].acceptsLines,o=ns.length;!a;){if(this.findNextNonspace(),t.type!=="table"&&t.type!=="tableBody"&&t.type!=="paragraph"&&!this.indented&&!Dte.test(e.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(var s=0;s<o;){var l=ns[s](this,t);if(l===1){t=this.tip;break}else if(l===2){t=this.tip,a=!0;break}else s++}if(s===o){this.advanceNextNonspace();break}}if(!this.allClosed&&!this.blank&&this.tip.type==="paragraph")this.addLine();else{this.closeUnmatchedBlocks(),this.blank&&t.lastChild&&(t.lastChild.lastLineBlank=!0);for(var u=t.type,c=this.blank&&!(u==="blockQuote"||Jf(t)&&t.isFenced||u==="item"&&!t.firstChild&&t.sourcepos[0][0]===this.lineNumber),f=t;f;)f.lastLineBlank=c,f=f.parent;$r[u].acceptsLines?(this.addLine(),zZ(t)&&t.htmlBlockType>=1&&t.htmlBlockType<=5&&Ate[t.htmlBlockType].test(this.currentLine.slice(this.offset))&&(this.lastLineLength=e.length,this.finalize(t,this.lineNumber))):this.offset<e.length&&!this.blank&&(t=this.addChild("paragraph",this.offset),this.advanceNextNonspace(),this.addLine())}this.lastLineLength=e.length},r.prototype.parse=function(e,t){this.doc=is(),this.tip=this.doc,this.lineNumber=0,this.lastLineLength=0,this.offset=0,this.column=0,this.lastMatchedContainer=this.doc,this.currentLine="";var n=e.split(Ite),i=n.length;this.lines=t||n,this.options.referenceDefinition&&this.clearRefMaps(),e.charCodeAt(e.length-1)===Xo&&(i-=1);for(var a=0;a<i;a++)this.incorporateLine(n[a]);for(;this.tip;)this.finalize(this.tip,i);return this.processInlines(this.doc),this.doc},r.prototype.partialParseStart=function(e,t){this.doc=is(),this.tip=this.doc,this.lineNumber=e-1,this.lastLineLength=0,this.offset=0,this.column=0,this.lastMatchedContainer=this.doc,this.currentLine="";for(var n=t.length,i=0;i<n;i++)this.incorporateLine(t[i]);return this.doc},r.prototype.partialParseExtends=function(e){for(var t=0;t<e.length;t++)this.incorporateLine(e[t])},r.prototype.partialParseFinish=function(){for(;this.tip;)this.finalize(this.tip,this.lineNumber);this.processInlines(this.doc)},r.prototype.setRefMaps=function(e,t,n){this.refMap=e,this.refLinkCandidateMap=t,this.refDefCandidateMap=n},r.prototype.clearRefMaps=function(){[this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap].forEach(function(e){gee(e)})},r})();function Cd(r,e){return r[0]<e[0]?1:r[0]>e[0]?-1:r[1]<e[1]?1:r[1]>e[1]?-1:0}function Pte(r,e){var t=r[0],n=r[1];return Cd(n,e)===1?1:Cd(t,e)===-1?-1:0}function Hte(r,e){if(!(r.parent!==e.parent||r===e)){for(var t=r.next;t&&t!==e;){for(var n=t.next,i=0,a=["parent","prev","next"];i<a.length;i++){var o=a[i];t[o]&&(Go(t[o].id),t[o]=null)}t=n}r.next=e.next,e.next?e.next.prev=r:r.parent.lastChild=r}}function Fte(r){for(var e=[],t=r.firstChild;t;)e.push(t),t=t.next;return e}function Td(r,e){for(var t=0,n=e;t<n.length;t++){var i=n[t];r.insertBefore(i)}}function qte(r,e){for(var t=e.length-1;t>=0;t-=1)r.prependChild(e[t])}function _te(r,e){if(!(!r||!r.parent||e===0)){var t=r.parent.walker();t.resumeAt(r,!0);for(var n;n=t.next();){var i=n.node,a=n.entering;a&&(i.sourcepos[0][0]+=e,i.sourcepos[1][0]+=e)}}}function xd(r,e){var t=r[0],n=r[1];return n[0]<e?1:t[0]>e?-1:0}function zi(r,e){for(var t=r.firstChild;t;){var n=xd(t.sourcepos,e);if(n===0)return t;if(n===-1)return t.prev||t;t=t.next}return r.lastChild}function $te(r){for(;r.lastChild;)r=r.lastChild;return r}function zte(r){for(;r.parent&&r.parent.type!=="document"&&r.parent.sourcepos[0][0]===r.sourcepos[0][0];)r=r.parent;return r}function Vte(r,e){for(var t=r.firstChild,n=null;t;){var i=xd(t.sourcepos,e);if(i===0){if(t.sourcepos[0][0]===e||!t.firstChild)return t;n=t,t=t.firstChild}else{if(i===-1)break;n=t,t=t.next}}return n?zte($te(n)):null}function Ute(r,e){for(var t=r,n=null;t;){var i=Pte(t.sourcepos,e);if(i===0)if(t.firstChild)n=t,t=t.firstChild;else return t;else{if(i===-1)return n;if(t.next)t=t.next;else return n}}return t}function Ed(r){return LZ(r)||null}function as(r,e,t){if(t===void 0&&(t=null),e)for(var n=e.walker();e&&e!==t;){r(e);var i=n.next();if(i)e=i.node;else break}}function Wte(r){var e=Ed(r);if(!e)return!0;for(;e&&e.type!=="document";){if(!e.parent&&!e.prev&&!e.next)return!0;e=e.parent}return!1}var Md=/\r\n|\n|\r/;function jte(r){var e=r.match(/^[ \t]+/);if(e&&(e[0].length>=2||/\t/.test(e[0])))return!0;var t=e?r.slice(e.length):r;return yd.test(t)||bd.test(t)}function Gte(r){return!md(r)&&r.indexOf("|")!==-1}function ss(r){var e=r.id,t=r.title,n=r.sourcepos,i=r.dest;return{id:e,title:t,sourcepos:n,unlinked:!1,destination:i}}var Sd=(function(){function r(e,t){this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.referenceDefinition=!!(t!=null&&t.referenceDefinition),this.parser=new Bte(t),this.parser.setRefMaps(this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap),this.eventHandlerMap={change:[]},e=e||"",this.lineTexts=e.split(Md),this.root=this.parser.parse(e,this.lineTexts)}return r.prototype.updateLineTexts=function(e,t,n){var i,a=e[0],o=e[1],s=t[0],l=t[1],u=n.split(Md),c=u.length,f=this.lineTexts[a-1],d=this.lineTexts[s-1];u[0]=f.slice(0,o-1)+u[0],u[c-1]=u[c-1]+d.slice(l-1);var h=s-a+1;return(i=this.lineTexts).splice.apply(i,qo([a-1,h],u)),c-h},r.prototype.updateRootNodeState=function(){if(this.lineTexts.length===1&&this.lineTexts[0]===""){this.root.lastLineBlank=!0,this.root.sourcepos=[[1,1],[1,0]];return}this.root.lastChild&&(this.root.lastLineBlank=this.root.lastChild.lastLineBlank);for(var e=this.lineTexts,t=e.length-1;e[t]==="";)t-=1;e.length-2>t&&(t+=1),this.root.sourcepos[1]=[t+1,e[t].length]},r.prototype.replaceRangeNodes=function(e,t,n){e?(Td(e,n),Hte(e,t),[e.id,t.id].forEach(function(i){return Go(i)}),e.unlink()):t?(Td(t,n),Go(t.id),t.unlink()):qte(this.root,n)},r.prototype.getNodeRange=function(e,t){var n=zi(this.root,e[0]),i=zi(this.root,t[0]);return i&&i.next&&t[0]+1===i.next.sourcepos[0][0]&&(i=i.next),[n,i]},r.prototype.trigger=function(e,t){this.eventHandlerMap[e].forEach(function(n){n(t)})},r.prototype.extendEndLine=function(e){for(;this.lineTexts[e]==="";)e+=1;return e},r.prototype.parseRange=function(e,t,n,i){e&&e.prev&&(Xf(e.prev)&&jte(this.lineTexts[n-1])||UZ(e.prev)&&Gte(this.lineTexts[n-1]))&&(e=e.prev,n=e.sourcepos[0][0]);for(var a=this.lineTexts.slice(n-1,i),o=this.parser.partialParseStart(n,a),s=t?t.next:this.root.firstChild,l=o.lastChild,u=l&&Jf(l)&&l.open,c=l&&Yf(l)&&l.open,f=l&&Xf(l);(u||c)&&s||f&&s&&(s.type==="list"||s.sourcepos[0][1]>=2);){var d=this.extendEndLine(s.sourcepos[1][0]);this.parser.partialParseExtends(this.lineTexts.slice(i,d)),e||(e=t),t=s,i=d,s=s.next}this.parser.partialParseFinish();var h=Fte(o);return{newNodes:h,extStartNode:e,extEndNode:t}},r.prototype.getRemovedNodeRange=function(e,t){return!e||e&&Fr(e)||t&&Fr(t)?null:{id:[e.id,t.id],line:[e.sourcepos[0][0]-1,t.sourcepos[1][0]-1]}},r.prototype.markDeletedRefMap=function(e,t){var n=this;if(!qr(this.refMap)){var i=function(a){if(Fr(a)){var o=n.refMap[a.label];o&&a.id===o.id&&(o.unlinked=!0)}};e&&as(i,e.parent,t),t&&as(i,t)}},r.prototype.replaceWithNewRefDefState=function(e){var t=this;if(!qr(this.refMap)){var n=function(i){if(Fr(i)){var a=i.label,o=t.refMap[a];(!o||o.unlinked)&&(t.refMap[a]=ss(i))}};e.forEach(function(i){as(n,i)})}},r.prototype.replaceWithRefDefCandidate=function(){var e=this;qr(this.refDefCandidateMap)||Fi(this.refDefCandidateMap,function(t,n){var i=n.label,a=n.sourcepos,o=e.refMap[i];(!o||o.unlinked||o.sourcepos[0][0]>a[0][0])&&(e.refMap[i]=ss(n))})},r.prototype.getRangeWithRefDef=function(e,t,n,i,a){if(this.referenceDefinition&&!qr(this.refMap)){var o=zi(this.root,e-1),s=zi(this.root,t+1);o&&Fr(o)&&o!==n&&o!==i&&(n=o,e=n.sourcepos[0][0]),s&&Fr(s)&&s!==n&&s!==i&&(i=s,t=this.extendEndLine(i.sourcepos[1][0]+a))}return[n,i,e,t]},r.prototype.parse=function(e,t,n){n===void 0&&(n=0);var i=this.getNodeRange(e,t),a=i[0],o=i[1],s=a?Math.min(a.sourcepos[0][0],e[0]):e[0],l=this.extendEndLine((o?Math.max(o.sourcepos[1][0],t[0]):t[0])+n),u=this.parseRange.apply(this,this.getRangeWithRefDef(s,l,a,o,n)),c=u.newNodes,f=u.extStartNode,d=u.extEndNode,h=this.getRemovedNodeRange(f,d),p=d?d.next:this.root.firstChild;return this.referenceDefinition?(this.markDeletedRefMap(f,d),this.replaceRangeNodes(f,d,c),this.replaceWithNewRefDefState(c)):this.replaceRangeNodes(f,d,c),{nodes:c,removedNodeRange:h,nextNode:p}},r.prototype.parseRefLink=function(){var e=this,t=[];return qr(this.refMap)||Fi(this.refMap,function(n,i){i.unlinked&&delete e.refMap[n],Fi(e.refLinkCandidateMap,function(a,o){var s=o.node,l=o.refLabel;l===n&&t.push(e.parse(s.sourcepos[0],s.sourcepos[1]))})}),t},r.prototype.removeUnlinkedCandidate=function(){qr(this.refDefCandidateMap)||[this.refLinkCandidateMap,this.refDefCandidateMap].forEach(function(e){Fi(e,function(t){Wte(t)&&delete e[t]})})},r.prototype.editMarkdown=function(e,t,n){var i=this.updateLineTexts(e,t,n),a=this.parse(e,t,i),o=mee(a,"nextNode");_te(a.nextNode,i),this.updateRootNodeState();var s=[o];return this.referenceDefinition&&(this.removeUnlinkedCandidate(),this.replaceWithRefDefCandidate(),s=s.concat(this.parseRefLink())),this.trigger("change",s),s},r.prototype.getLineTexts=function(){return this.lineTexts},r.prototype.getRootNode=function(){return this.root},r.prototype.findNodeAtPosition=function(e){var t=Ute(this.root,e);return!t||t===this.root?null:t},r.prototype.findFirstNodeAtLine=function(e){return Vte(this.root,e)},r.prototype.on=function(e,t){this.eventHandlerMap[e].push(t)},r.prototype.off=function(e,t){var n=this.eventHandlerMap[e],i=n.indexOf(t);n.splice(i,1)},r.prototype.findNodeById=function(e){return Ed(e)},r.prototype.removeAllNode=function(){NZ()},r})(),Kte=["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"],Od=new RegExp("<(/?(?:"+Kte.join("|")+")[^>]*>)","ig");function Ld(r){return Od.test(r)?r.replace(Od,function(e,t){return"&lt;"+t}):r}var Nd={heading:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"h"+r.level,outerNewLine:!0}},text:function(r){return{type:"text",content:r.literal}},softbreak:function(r,e){var t=e.options;return{type:"html",content:t.softbreak}},linebreak:function(){return{type:"html",content:`<br />
`}},emph:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"em"}},strong:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"strong"}},paragraph:function(r,e){var t,n=e.entering,i=(t=r.parent)===null||t===void 0?void 0:t.parent;return i&&i.type==="list"&&i.listData.tight?null:{type:n?"openTag":"closeTag",tagName:"p",outerNewLine:!0}},thematicBreak:function(){return{type:"openTag",tagName:"hr",outerNewLine:!0,selfClose:!0}},blockQuote:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"blockquote",outerNewLine:!0,innerNewLine:!0}},list:function(r,e){var t=e.entering,n=r.listData,i=n.type,a=n.start,o=i==="bullet"?"ul":"ol",s={};return o==="ol"&&a!==null&&a!==1&&(s.start=a.toString()),{type:t?"openTag":"closeTag",tagName:o,attributes:s,outerNewLine:!0}},item:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"li",outerNewLine:!0}},htmlInline:function(r,e){var t=e.options,n=t.tagFilter?Ld(r.literal):r.literal;return{type:"html",content:n}},htmlBlock:function(r,e){var t=e.options,n=t.tagFilter?Ld(r.literal):r.literal;return t.nodeId?[{type:"openTag",tagName:"div",outerNewLine:!0},{type:"html",content:n},{type:"closeTag",tagName:"div",outerNewLine:!0}]:{type:"html",content:n,outerNewLine:!0}},code:function(r){return[{type:"openTag",tagName:"code"},{type:"text",content:r.literal},{type:"closeTag",tagName:"code"}]},codeBlock:function(r){var e=r.info,t=e?e.split(/\s+/):[],n=[];return t.length>0&&t[0].length>0&&n.push("language-"+Hr(t[0])),[{type:"openTag",tagName:"pre",outerNewLine:!0},{type:"openTag",tagName:"code",classNames:n},{type:"text",content:r.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre",outerNewLine:!0}]},link:function(r,e){var t=e.entering;if(t){var n=r,i=n.title,a=n.destination;return{type:"openTag",tagName:"a",attributes:de({href:Hr(a)},i&&{title:Hr(i)})}}return{type:"closeTag",tagName:"a"}},image:function(r,e){var t=e.getChildrenText,n=e.skipChildren,i=r,a=i.title,o=i.destination;return n(),{type:"openTag",tagName:"img",selfClose:!0,attributes:de({src:Hr(o),alt:t(r)},a&&{title:Hr(a)})}},customBlock:function(r,e,t){var n=r.info.trim().toLowerCase(),i=t[n];if(i)try{return i(r,e)}catch(a){console.warn("[@toast-ui/editor] - The error occurred when "+n+" block node was parsed in markdown renderer: "+a)}return[{type:"openTag",tagName:"div",outerNewLine:!0},{type:"text",content:r.literal},{type:"closeTag",tagName:"div",outerNewLine:!0}]},frontMatter:function(r){return[{type:"openTag",tagName:"div",outerNewLine:!0,attributes:{style:"white-space: pre; display: none;"}},{type:"text",content:r.literal},{type:"closeTag",tagName:"div",outerNewLine:!0}]},customInline:function(r,e,t){var n=r,i=n.info,a=n.firstChild,o=i.trim().toLowerCase(),s=t[o],l=e.entering;if(s)try{return s(r,e)}catch(u){console.warn("[@toast-ui/editor] - The error occurred when "+o+" inline node was parsed in markdown renderer: "+u)}return l?[{type:"openTag",tagName:"span"},{type:"text",content:"$$"+i+(a?" ":"")}]:[{type:"text",content:"$$"},{type:"closeTag",tagName:"span"}]}},Ad={strike:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"del"}},item:function(r,e){var t=e.entering,n=r.listData,i=n.checked,a=n.task;if(t){var o={type:"openTag",tagName:"li",outerNewLine:!0};return a?[o,{type:"openTag",tagName:"input",selfClose:!0,attributes:de(de({},i&&{checked:""}),{disabled:"",type:"checkbox"})},{type:"text",content:" "}]:o}return{type:"closeTag",tagName:"li",outerNewLine:!0}},table:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"table",outerNewLine:!0}},tableHead:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"thead",outerNewLine:!0}},tableBody:function(r,e){var t=e.entering;return{type:t?"openTag":"closeTag",tagName:"tbody",outerNewLine:!0}},tableRow:function(r,e){var t=e.entering;if(t)return{type:"openTag",tagName:"tr",outerNewLine:!0};var n=[];if(r.lastChild)for(var i=r.parent.parent.columns.length,a=r.lastChild.endIdx,o=a+1;o<i;o+=1)n.push({type:"openTag",tagName:"td",outerNewLine:!0},{type:"closeTag",tagName:"td",outerNewLine:!0});return n.push({type:"closeTag",tagName:"tr",outerNewLine:!0}),n},tableCell:function(r,e){var t=e.entering;if(r.ignored)return{type:"text",content:""};var n=r.parent.parent,i=n.type==="tableHead"?"th":"td",a=n.parent,o=a.columns[r.startIdx],s=o!=null&&o.align?{align:o.align}:null;return t?de({type:"openTag",tagName:i,outerNewLine:!0},s&&{attributes:s}):{type:"closeTag",tagName:i,outerNewLine:!0}}},Jte={softbreak:`
`,gfm:!1,tagFilter:!1,nodeId:!1};function Xte(r){for(var e=[],t=r.walker(),n=null;n=t.next();){var i=n.node;i.type==="text"&&e.push(i.literal)}return e.join("")}var ls=(function(){function r(e){this.buffer=[],this.options=de(de({},Jte),e),this.convertors=this.createConvertors(),delete this.options.convertors}return r.prototype.createConvertors=function(){var e=de({},Nd);if(this.options.gfm&&(e=de(de({},e),Ad)),this.options.convertors){var t=this.options.convertors,n=Object.keys(t),i=de(de({},Nd),Ad);n.forEach(function(a){var o=e[a],s=t[a],l=Object.keys(i).indexOf(a)===-1?a.toLowerCase():a;o?e[l]=function(u,c,f){return c.origin=function(){return o(u,c,f)},s(u,c)}:e[l]=s})}return e},r.prototype.getConvertors=function(){return this.convertors},r.prototype.getOptions=function(){return this.options},r.prototype.render=function(e){var t=this;this.buffer=[];for(var n=e.walker(),i=null,a=function(){var s=i.node,l=i.entering,u=o.convertors[s.type];if(!u)return"continue";var c=!1,f={entering:l,leaf:!jo(s),options:o.options,getChildrenText:Xte,skipChildren:function(){c=!0}},d=Yf(s)||WZ(s)?u(s,f,o.convertors):u(s,f);if(d){var h=Array.isArray(d)?d:[d];h.forEach(function(p,v){p.type==="openTag"&&t.options.nodeId&&v===0&&(p.attributes||(p.attributes={}),p.attributes["data-nodeid"]=String(s.id)),t.renderHTMLNode(p)}),c&&(n.resumeAt(s,!1),n.next())}},o=this;i=n.next();)a();return this.addNewLine(),this.buffer.join("")},r.prototype.renderHTMLNode=function(e){switch(e.type){case"openTag":case"closeTag":this.renderElementNode(e);break;case"text":this.renderTextNode(e);break;case"html":this.renderRawHtmlNode(e);break}},r.prototype.generateOpenTagString=function(e){var t=this,n=e.tagName,i=e.classNames,a=e.attributes;this.buffer.push("<"+n),i&&i.length>0&&this.buffer.push(' class="'+i.join(" ")+'"'),a&&Object.keys(a).forEach(function(o){var s=a[o];t.buffer.push(" "+o+'="'+s+'"')}),e.selfClose&&this.buffer.push(" /"),this.buffer.push(">")},r.prototype.generateCloseTagString=function(e){var t=e.tagName;this.buffer.push("</"+t+">")},r.prototype.addNewLine=function(){this.buffer.length&&Hi(Hi(this.buffer))!==`
`&&this.buffer.push(`
`)},r.prototype.addOuterNewLine=function(e){e.outerNewLine&&this.addNewLine()},r.prototype.addInnerNewLine=function(e){e.innerNewLine&&this.addNewLine()},r.prototype.renderTextNode=function(e){this.buffer.push(Hr(e.content))},r.prototype.renderRawHtmlNode=function(e){this.addOuterNewLine(e),this.buffer.push(e.content),this.addOuterNewLine(e)},r.prototype.renderElementNode=function(e){e.type==="openTag"?(this.addOuterNewLine(e),this.generateOpenTagString(e),e.selfClose?this.addOuterNewLine(e):this.addInnerNewLine(e)):(this.addInnerNewLine(e),this.generateCloseTagString(e),this.addOuterNewLine(e))},r})();/*! @license DOMPurify 2.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.3/LICENSE */function Yte(r){if(Array.isArray(r)){for(var e=0,t=Array(r.length);e<r.length;e++)t[e]=r[e];return t}else return Array.from(r)}var Qte=Object.hasOwnProperty,Dd=Object.setPrototypeOf,Zte=Object.isFrozen,ere=Object.getPrototypeOf,tre=Object.getOwnPropertyDescriptor,Le=Object.freeze,bt=Object.seal,rre=Object.create,Id=typeof Reflect<"u"&&Reflect,Vi=Id.apply,us=Id.construct;Vi||(Vi=function(e,t,n){return e.apply(t,n)}),Le||(Le=function(e){return e}),bt||(bt=function(e){return e}),us||(us=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(Yte(t))))});var nre=Ke(Array.prototype.forEach),Rd=Ke(Array.prototype.pop),Ln=Ke(Array.prototype.push),Ui=Ke(String.prototype.toLowerCase),Bd=Ke(String.prototype.match),Vt=Ke(String.prototype.replace),ire=Ke(String.prototype.indexOf),are=Ke(String.prototype.trim),wt=Ke(RegExp.prototype.test),Pd=ore(TypeError);function Ke(r){return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Vi(r,e,n)}}function ore(r){return function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return us(r,t)}}function H(r,e){Dd&&Dd(r,null);for(var t=e.length;t--;){var n=e[t];if(typeof n=="string"){var i=Ui(n);i!==n&&(Zte(e)||(e[t]=i),n=i)}r[n]=!0}return r}function vr(r){var e=rre(null),t=void 0;for(t in r)Vi(Qte,r,[t])&&(e[t]=r[t]);return e}function Wi(r,e){for(;r!==null;){var t=tre(r,e);if(t){if(t.get)return Ke(t.get);if(typeof t.value=="function")return Ke(t.value)}r=ere(r)}function n(i){return console.warn("fallback value for",i),null}return n}var Hd=Le(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),cs=Le(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),fs=Le(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),sre=Le(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ds=Le(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),lre=Le(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Fd=Le(["#text"]),qd=Le(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),hs=Le(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),_d=Le(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ji=Le(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ure=bt(/\{\{[\s\S]*|[\s\S]*\}\}/gm),cre=bt(/<%[\s\S]*|[\s\S]*%>/gm),fre=bt(/^data-[\-\w.\u00B7-\uFFFF]/),dre=bt(/^aria-[\-\w]+$/),hre=bt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pre=bt(/^(?:\w+script|data):/i),vre=bt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Nn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r};function ot(r){if(Array.isArray(r)){for(var e=0,t=Array(r.length);e<r.length;e++)t[e]=r[e];return t}else return Array.from(r)}var mre=function(){return typeof window>"u"?null:window},gre=function(e,t){if((typeof e>"u"?"undefined":Nn(e))!=="object"||typeof e.createPolicy!="function")return null;var n=null,i="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(i)&&(n=t.currentScript.getAttribute(i));var a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML:function(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function $d(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mre(),e=function(y){return $d(y)};if(e.version="2.3.3",e.removed=[],!r||!r.document||r.document.nodeType!==9)return e.isSupported=!1,e;var t=r.document,n=r.document,i=r.DocumentFragment,a=r.HTMLTemplateElement,o=r.Node,s=r.Element,l=r.NodeFilter,u=r.NamedNodeMap,c=u===void 0?r.NamedNodeMap||r.MozNamedAttrMap:u,f=r.Text,d=r.Comment,h=r.DOMParser,p=r.trustedTypes,v=s.prototype,m=Wi(v,"cloneNode"),g=Wi(v,"nextSibling"),w=Wi(v,"childNodes"),k=Wi(v,"parentNode");if(typeof a=="function"){var T=n.createElement("template");T.content&&T.content.ownerDocument&&(n=T.content.ownerDocument)}var x=gre(p,t),L=x&&sa?x.createHTML(""):"",E=n,A=E.implementation,P=E.createNodeIterator,K=E.createDocumentFragment,pe=E.getElementsByTagName,Ue=t.importNode,aa={};try{aa=vr(n).documentMode?n.documentMode:{}}catch{}var lt={};e.isSupported=typeof k=="function"&&A&&typeof A.createHTMLDocument<"u"&&aa!==9;var Rs=ure,Bs=cre,Joe=fre,Xoe=dre,Yoe=pre,Pp=vre,Ps=hre,ke=null,Hp=H({},[].concat(ot(Hd),ot(cs),ot(fs),ot(ds),ot(Fd))),Ce=null,Fp=H({},[].concat(ot(qd),ot(hs),ot(_d),ot(ji))),Hs=null,Fs=null,qp=!0,qs=!0,_p=!1,jr=!1,Gr=!1,_s=!1,$s=!1,Kr=!1,oa=!1,$p=!0,sa=!1,zp=!0,zs=!0,Bn=!1,Jr={},Xr=null,Vp=H({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Up=null,Wp=H({},["audio","video","img","source","image","track"]),Vs=null,jp=H({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Us="http://www.w3.org/1998/Math/MathML",Ws="http://www.w3.org/2000/svg",Wt="http://www.w3.org/1999/xhtml",la=Wt,js=!1,Yr=void 0,Qoe=["application/xhtml+xml","text/html"],Zoe="text/html",Qr=void 0,Zr=null,ese=n.createElement("form"),Gs=function(y){Zr&&Zr===y||((!y||(typeof y>"u"?"undefined":Nn(y))!=="object")&&(y={}),y=vr(y),ke="ALLOWED_TAGS"in y?H({},y.ALLOWED_TAGS):Hp,Ce="ALLOWED_ATTR"in y?H({},y.ALLOWED_ATTR):Fp,Vs="ADD_URI_SAFE_ATTR"in y?H(vr(jp),y.ADD_URI_SAFE_ATTR):jp,Up="ADD_DATA_URI_TAGS"in y?H(vr(Wp),y.ADD_DATA_URI_TAGS):Wp,Xr="FORBID_CONTENTS"in y?H({},y.FORBID_CONTENTS):Vp,Hs="FORBID_TAGS"in y?H({},y.FORBID_TAGS):{},Fs="FORBID_ATTR"in y?H({},y.FORBID_ATTR):{},Jr="USE_PROFILES"in y?y.USE_PROFILES:!1,qp=y.ALLOW_ARIA_ATTR!==!1,qs=y.ALLOW_DATA_ATTR!==!1,_p=y.ALLOW_UNKNOWN_PROTOCOLS||!1,jr=y.SAFE_FOR_TEMPLATES||!1,Gr=y.WHOLE_DOCUMENT||!1,Kr=y.RETURN_DOM||!1,oa=y.RETURN_DOM_FRAGMENT||!1,$p=y.RETURN_DOM_IMPORT!==!1,sa=y.RETURN_TRUSTED_TYPE||!1,$s=y.FORCE_BODY||!1,zp=y.SANITIZE_DOM!==!1,zs=y.KEEP_CONTENT!==!1,Bn=y.IN_PLACE||!1,Ps=y.ALLOWED_URI_REGEXP||Ps,la=y.NAMESPACE||Wt,Yr=Qoe.indexOf(y.PARSER_MEDIA_TYPE)===-1?Yr=Zoe:Yr=y.PARSER_MEDIA_TYPE,Qr=Yr==="application/xhtml+xml"?function(M){return M}:Ui,jr&&(qs=!1),oa&&(Kr=!0),Jr&&(ke=H({},[].concat(ot(Fd))),Ce=[],Jr.html===!0&&(H(ke,Hd),H(Ce,qd)),Jr.svg===!0&&(H(ke,cs),H(Ce,hs),H(Ce,ji)),Jr.svgFilters===!0&&(H(ke,fs),H(Ce,hs),H(Ce,ji)),Jr.mathMl===!0&&(H(ke,ds),H(Ce,_d),H(Ce,ji))),y.ADD_TAGS&&(ke===Hp&&(ke=vr(ke)),H(ke,y.ADD_TAGS)),y.ADD_ATTR&&(Ce===Fp&&(Ce=vr(Ce)),H(Ce,y.ADD_ATTR)),y.ADD_URI_SAFE_ATTR&&H(Vs,y.ADD_URI_SAFE_ATTR),y.FORBID_CONTENTS&&(Xr===Vp&&(Xr=vr(Xr)),H(Xr,y.FORBID_CONTENTS)),zs&&(ke["#text"]=!0),Gr&&H(ke,["html","head","body"]),ke.table&&(H(ke,["tbody"]),delete Hs.tbody),Le&&Le(y),Zr=y)},Gp=H({},["mi","mo","mn","ms","mtext"]),Kp=H({},["foreignobject","desc","title","annotation-xml"]),ua=H({},cs);H(ua,fs),H(ua,sre);var Ks=H({},ds);H(Ks,lre);var tse=function(y){var M=k(y);(!M||!M.tagName)&&(M={namespaceURI:Wt,tagName:"template"});var D=Ui(y.tagName),U=Ui(M.tagName);if(y.namespaceURI===Ws)return M.namespaceURI===Wt?D==="svg":M.namespaceURI===Us?D==="svg"&&(U==="annotation-xml"||Gp[U]):!!ua[D];if(y.namespaceURI===Us)return M.namespaceURI===Wt?D==="math":M.namespaceURI===Ws?D==="math"&&Kp[U]:!!Ks[D];if(y.namespaceURI===Wt){if(M.namespaceURI===Ws&&!Kp[U]||M.namespaceURI===Us&&!Gp[U])return!1;var Te=H({},["title","style","font","a","script"]);return!Ks[D]&&(Te[D]||!ua[D])}return!1},Ct=function(y){Ln(e.removed,{element:y});try{y.parentNode.removeChild(y)}catch{try{y.outerHTML=L}catch{y.remove()}}},Jp=function(y,M){try{Ln(e.removed,{attribute:M.getAttributeNode(y),from:M})}catch{Ln(e.removed,{attribute:null,from:M})}if(M.removeAttribute(y),y==="is"&&!Ce[y])if(Kr||oa)try{Ct(M)}catch{}else try{M.setAttribute(y,"")}catch{}},Xp=function(y){var M=void 0,D=void 0;if($s)y="<remove></remove>"+y;else{var U=Bd(y,/^[\r\n\t ]+/);D=U&&U[0]}Yr==="application/xhtml+xml"&&(y='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+y+"</body></html>");var Te=x?x.createHTML(y):y;if(la===Wt)try{M=new h().parseFromString(Te,Yr)}catch{}if(!M||!M.documentElement){M=A.createDocument(la,"template",null);try{M.documentElement.innerHTML=js?"":Te}catch{}}var xe=M.body||M.documentElement;return y&&D&&xe.insertBefore(n.createTextNode(D),xe.childNodes[0]||null),la===Wt?pe.call(M,Gr?"html":"body")[0]:Gr?M.documentElement:xe},Yp=function(y){return P.call(y.ownerDocument||y,y,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},rse=function(y){return y instanceof f||y instanceof d?!1:typeof y.nodeName!="string"||typeof y.textContent!="string"||typeof y.removeChild!="function"||!(y.attributes instanceof c)||typeof y.removeAttribute!="function"||typeof y.setAttribute!="function"||typeof y.namespaceURI!="string"||typeof y.insertBefore!="function"},Pn=function(y){return(typeof o>"u"?"undefined":Nn(o))==="object"?y instanceof o:y&&(typeof y>"u"?"undefined":Nn(y))==="object"&&typeof y.nodeType=="number"&&typeof y.nodeName=="string"},Tt=function(y,M,D){lt[y]&&nre(lt[y],function(U){U.call(e,M,D,Zr)})},Qp=function(y){var M=void 0;if(Tt("beforeSanitizeElements",y,null),rse(y)||Bd(y.nodeName,/[\u0080-\uFFFF]/))return Ct(y),!0;var D=Qr(y.nodeName);if(Tt("uponSanitizeElement",y,{tagName:D,allowedTags:ke}),!Pn(y.firstElementChild)&&(!Pn(y.content)||!Pn(y.content.firstElementChild))&&wt(/<[/\w]/g,y.innerHTML)&&wt(/<[/\w]/g,y.textContent)||D==="select"&&wt(/<template/i,y.innerHTML))return Ct(y),!0;if(!ke[D]||Hs[D]){if(zs&&!Xr[D]){var U=k(y)||y.parentNode,Te=w(y)||y.childNodes;if(Te&&U)for(var xe=Te.length,Ee=xe-1;Ee>=0;--Ee)U.insertBefore(m(Te[Ee],!0),g(y))}return Ct(y),!0}return y instanceof s&&!tse(y)||(D==="noscript"||D==="noembed")&&wt(/<\/no(script|embed)/i,y.innerHTML)?(Ct(y),!0):(jr&&y.nodeType===3&&(M=y.textContent,M=Vt(M,Rs," "),M=Vt(M,Bs," "),y.textContent!==M&&(Ln(e.removed,{element:y.cloneNode()}),y.textContent=M)),Tt("afterSanitizeElements",y,null),!1)},Zp=function(y,M,D){if(zp&&(M==="id"||M==="name")&&(D in n||D in ese))return!1;if(!(qs&&!Fs[M]&&wt(Joe,M))){if(!(qp&&wt(Xoe,M))){if(!Ce[M]||Fs[M])return!1;if(!Vs[M]){if(!wt(Ps,Vt(D,Pp,""))){if(!((M==="src"||M==="xlink:href"||M==="href")&&y!=="script"&&ire(D,"data:")===0&&Up[y])){if(!(_p&&!wt(Yoe,Vt(D,Pp,"")))){if(D)return!1}}}}}}return!0},ev=function(y){var M=void 0,D=void 0,U=void 0,Te=void 0;Tt("beforeSanitizeAttributes",y,null);var xe=y.attributes;if(xe){var Ee={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ce};for(Te=xe.length;Te--;){M=xe[Te];var xt=M,Hn=xt.name,tv=xt.namespaceURI;if(D=are(M.value),U=Qr(Hn),Ee.attrName=U,Ee.attrValue=D,Ee.keepAttr=!0,Ee.forceKeepAttr=void 0,Tt("uponSanitizeAttribute",y,Ee),D=Ee.attrValue,!Ee.forceKeepAttr&&(Jp(Hn,y),!!Ee.keepAttr)){if(wt(/\/>/i,D)){Jp(Hn,y);continue}jr&&(D=Vt(D,Rs," "),D=Vt(D,Bs," "));var ise=Qr(y.nodeName);if(Zp(ise,U,D))try{tv?y.setAttributeNS(tv,Hn,D):y.setAttribute(Hn,D),Rd(e.removed)}catch{}}}Tt("afterSanitizeAttributes",y,null)}},nse=function I(y){var M=void 0,D=Yp(y);for(Tt("beforeSanitizeShadowDOM",y,null);M=D.nextNode();)Tt("uponSanitizeShadowNode",M,null),!Qp(M)&&(M.content instanceof i&&I(M.content),ev(M));Tt("afterSanitizeShadowDOM",y,null)};return e.sanitize=function(I,y){var M=void 0,D=void 0,U=void 0,Te=void 0,xe=void 0;if(js=!I,js&&(I="<!-->"),typeof I!="string"&&!Pn(I)){if(typeof I.toString!="function")throw Pd("toString is not a function");if(I=I.toString(),typeof I!="string")throw Pd("dirty is not a string, aborting")}if(!e.isSupported){if(Nn(r.toStaticHTML)==="object"||typeof r.toStaticHTML=="function"){if(typeof I=="string")return r.toStaticHTML(I);if(Pn(I))return r.toStaticHTML(I.outerHTML)}return I}if(_s||Gs(y),e.removed=[],typeof I=="string"&&(Bn=!1),!Bn)if(I instanceof o)M=Xp("<!---->"),D=M.ownerDocument.importNode(I,!0),D.nodeType===1&&D.nodeName==="BODY"||D.nodeName==="HTML"?M=D:M.appendChild(D);else{if(!Kr&&!jr&&!Gr&&I.indexOf("<")===-1)return x&&sa?x.createHTML(I):I;if(M=Xp(I),!M)return Kr?null:L}M&&$s&&Ct(M.firstChild);for(var Ee=Yp(Bn?I:M);U=Ee.nextNode();)U.nodeType===3&&U===Te||Qp(U)||(U.content instanceof i&&nse(U.content),ev(U),Te=U);if(Te=null,Bn)return I;if(Kr){if(oa)for(xe=K.call(M.ownerDocument);M.firstChild;)xe.appendChild(M.firstChild);else xe=M;return $p&&(xe=Ue.call(t,xe,!0)),xe}var xt=Gr?M.outerHTML:M.innerHTML;return jr&&(xt=Vt(xt,Rs," "),xt=Vt(xt,Bs," ")),x&&sa?x.createHTML(xt):xt},e.setConfig=function(I){Gs(I),_s=!0},e.clearConfig=function(){Zr=null,_s=!1},e.isValidAttribute=function(I,y,M){Zr||Gs({});var D=Qr(I),U=Qr(y);return Zp(D,U,M)},e.addHook=function(I,y){typeof y=="function"&&(lt[I]=lt[I]||[],Ln(lt[I],y))},e.removeHook=function(I){lt[I]&&Rd(lt[I])},e.removeHooks=function(I){lt[I]&&(lt[I]=[])},e.removeAllHooks=function(){lt={}},e}var yre=$d(),bre=["iframe","embed"],zd=[];function Vd(r){ce(bre,r)&&zd.push(r.toLowerCase())}function mr(r,e){return yre.sanitize(r,b({ADD_TAGS:zd,ADD_ATTR:["rel","target","hreflang","type"],FORBID_TAGS:["input","script","textarea","form","button","select","meta","style","link","title","object","base"]},e))}function Ud(r,e){return r.literal.replace(new RegExp("(<\\s*"+e+"[^>]*>)|(</"+e+"\\s*[>])","ig"),"").trim()}function ps(r){r=r.match(Rr)[0];var e=r.match(new RegExp(Uc,"g"));return e?e.reduce(function(t,n){var i=n.trim().split("="),a=i[0],o=i.slice(1);return o.length&&(t[a]=o.join("=").replace(/'|"/g,"").trim()),t},{}):{}}function vs(r){return it(r.attributes).reduce(function(e,t){return e[t.nodeName]=t.nodeValue,e},{})}function Wd(r,e,t,n){var i=n.getToDOMNode(e)(r),a=t(i.outerHTML),o=document.createElement("div");o.innerHTML=a,i=o.firstChild;var s=vs(i);return{dom:i,htmlAttrs:s}}var wre={htmlBlock:function(r,e,t){return{atom:!0,content:"block+",group:"block",attrs:{htmlAttrs:{default:{}},childrenHTML:{default:""},htmlBlock:{default:!0}},parseDOM:[{tag:r,getAttrs:function(n){return{htmlAttrs:vs(n),childrenHTML:n.innerHTML}}}],toDOM:function(n){var i=Wd(n,r,e,t),a=i.dom,o=i.htmlAttrs;return o.class=o.class?o.class+" html-block":"html-block",Re([r,o],it(a.childNodes))}}},htmlInline:function(r,e,t){return{attrs:{htmlAttrs:{default:{}},htmlInline:{default:!0}},parseDOM:[{tag:r,getAttrs:function(n){return{htmlAttrs:vs(n)}}}],toDOM:function(n){var i=Wd(n,r,e,t).htmlAttrs;return[r,i,0]}}}};function kre(r,e,t){var n={nodes:{},marks:{}};return["htmlBlock","htmlInline"].forEach(function(i){r[i]&&Object.keys(r[i]).forEach(function(a){var o=i==="htmlBlock"?"nodes":"marks";Vd(a),n[o][a]=wre[i](a,e,t)})}),n}var Cre=/^\s*<\s*\//,Tre={paragraph:function(r,e){var t=e.entering,n=e.origin,i=e.options;return i.nodeId?{type:t?"openTag":"closeTag",outerNewLine:!0,tagName:"p"}:n()},softbreak:function(r){var e=r.prev&&r.prev.type==="htmlInline",t=e&&/<br ?\/?>/.test(r.prev.literal),n=t?`
`:`<br>
`;return{type:"html",content:n}},item:function(r,e){var t=e.entering;if(t){var n={},i=[];return r.listData.task&&(n["data-task"]="",i.push("task-list-item"),r.listData.checked&&(i.push("checked"),n["data-task-checked"]="")),{type:"openTag",tagName:"li",classNames:i,attributes:n,outerNewLine:!0}}return{type:"closeTag",tagName:"li",outerNewLine:!0}},code:function(r){var e={"data-backticks":String(r.tickCount)};return[{type:"openTag",tagName:"code",attributes:e},{type:"text",content:r.literal},{type:"closeTag",tagName:"code"}]},codeBlock:function(r){var e=r,t=e.fenceLength,n=e.info,i=n?n.split(/\s+/):[],a=[],o={};if(t>3&&(o["data-backticks"]=t),i.length>0&&i[0].length>0){var s=i[0];a.push("lang-"+s),o["data-language"]=s}return[{type:"openTag",tagName:"pre",classNames:a},{type:"openTag",tagName:"code",attributes:o},{type:"text",content:r.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre"}]},customInline:function(r,e){var t=e.origin,n=e.entering,i=e.skipChildren,a=r.info;if(a.indexOf("widget")!==-1&&n){i();var o=_c(r),s=qc(a,o).outerHTML;return[{type:"openTag",tagName:"span",classNames:["tui-widget"]},{type:"html",content:s},{type:"closeTag",tagName:"span"}]}return t()}};function ms(r,e){var t=b({},Tre);return r&&(t.link=function(n,i){var a=i.entering,o=i.origin,s=o();return a&&(s.attributes=b(b({},s.attributes),r)),s}),e&&Object.keys(e).forEach(function(n){var i=t[n],a=e[n];i&&ze(a)?t[n]=function(o,s){var l=b({},s);return l.origin=function(){return i(o,s)},a(o,l)}:ce(["htmlBlock","htmlInline"],n)&&!ze(a)?t[n]=function(o,s){var l=o.literal.match(Rr);if(l){var u=l[0],c=l[1],f=l[3],d=(c||f).toLowerCase(),h=a[d],p=Ud(o,d);if(h){var v=b({},o);return v.attrs=ps(u),v.childrenHTML=p,v.type=d,s.entering=!Cre.test(o.literal),h(v,s)}}return s.origin()}:t[n]=a}),t}var xre=["list","item","blockQuote"],Ere=["UL","OL","BLOCKQUOTE"];function Mre(r,e){var t,n=r.child(e);return!n.childCount||n.childCount===1&&!(!((t=n.firstChild.text)===null||t===void 0)&&t.trim())}function jd(r,e,t){var n=Tn(e)-1,i=gi(e)-1,a=t[n].getBoundingClientRect(),o=t[i].offsetTop-t[n].offsetTop+t[i].clientHeight;return{height:o<=0?t[n].clientHeight:o+Sre(r,t,Math.min(i+1,r.childCount-1)),rect:a}}function Sre(r,e,t){for(var n=r.childCount-1,i=0;t<=n&&Mre(r,t);)i+=e[t].clientHeight,t+=1;return i}function Ore(r,e){for(;!r.getAttribute("data-nodeid")&&r.parentElement!==e;)r=r.parentElement;return r}function Gi(r,e){for(var t=0;r&&r!==e&&(ce(Ere,r.tagName)||(t+=r.offsetTop),r.offsetParent!==e.offsetParent);)r=r.parentElement;return t}function Lre(r,e){for(var t=e,n=null;t;){var i=t.firstElementChild;if(!i)break;var a=Gd(i,r,Gi(t,e));n=t,t=a}var o=t||n;return o===e?null:o}function Gd(r,e,t){return r&&e>t+r.offsetTop?Gd(r.nextElementSibling,e,t)||r:null}function Nre(r,e,t,n){var i=Math.min((r-e)/t,1);return i*n}function gs(r,e){for(var t=r.querySelector('[data-nodeid="'+e.id+'"]');!t||yb(e);)e=e.parent,t=r.querySelector('[data-nodeid="'+e.id+'"]');return Are({mdNode:e,el:t})}function Are(r){for(var e=r.mdNode,t=r.el;(ce(xre,e.type)||e.type==="table")&&e.firstChild;)e=e.firstChild,t=t.firstElementChild;return{mdNode:e,el:t}}var Je={};function Dre(r,e){Je[r]=Je[r]||{},Je[r].height=e}function Ire(r,e){Je[r]=Je[r]||{},Je[r].offsetTop=e}function Rre(r){return Je[r]&&Je[r].height}function Bre(r){return Je[r]&&Je[r].offsetTop}function ys(r){r&&(delete Je[Number(r.getAttribute("data-nodeid"))],it(r.children).forEach(function(e){ys(e)}))}function Pre(r,e,t){var n=Rre(t),i=Bre(t),a=n||r.clientHeight,o=i||Gi(r,e)||r.offsetTop;return n||Dre(t,a),i||Ire(t,o),{nodeHeight:a,offsetTop:o}}var bs=N("md-preview-highlight");function Hre(r,e){for(var t=r.firstChild;t&&t.next&&!(yi(t.next)>e+1);)t=t.next;return t}var Kd=(function(){function r(e,t){var n=document.createElement("div");this.el=n,this.eventEmitter=e,this.isViewer=!!t.isViewer,this.el.className=N("md-preview");var i=t.linkAttributes,a=t.customHTMLRenderer,o=t.sanitizer,s=t.highlight,l=s===void 0?!1:s;this.renderer=new ls({gfm:!0,nodeId:!0,convertors:ms(i,a)}),this.cursorNodeId=null,this.sanitizer=o,this.initEvent(l),this.initContentSection(),this.isViewer&&(this.previewContent.style.overflowWrap="break-word")}return r.prototype.initContentSection=function(){this.previewContent=Jc('<div class="'+N("contents")+'"></div>'),this.isViewer||this.el.appendChild(this.previewContent)},r.prototype.toggleActive=function(e){Co(this.el,"active",e)},r.prototype.initEvent=function(e){var t=this;this.eventEmitter.listen("updatePreview",this.update.bind(this)),!this.isViewer&&(e&&(this.eventEmitter.listen("changeToolbarState",function(n){var i=n.mdNode,a=n.cursorPos;t.updateCursorNode(i,a)}),this.eventEmitter.listen("blur",function(){t.removeHighlight()})),Lf(this.el,"scroll",function(n){t.eventEmitter.emit("scroll","preview",Lre(n.target.scrollTop,t.previewContent))}),this.eventEmitter.listen("changePreviewTabPreview",function(){return t.toggleActive(!0)}),this.eventEmitter.listen("changePreviewTabWrite",function(){return t.toggleActive(!1)}))},r.prototype.removeHighlight=function(){if(this.cursorNodeId){var e=this.getElementByNodeId(this.cursorNodeId);e&&Ge(e,bs)}},r.prototype.updateCursorNode=function(e,t){e&&(e=Ir(e,function(o){return!kb(o)}),e.type==="tableRow"?e=Hre(e,t[1]):e.type==="tableBody"&&(e=null));var n=e?e.id:null;if(this.cursorNodeId!==n){var i=this.getElementByNodeId(this.cursorNodeId),a=this.getElementByNodeId(n);i&&Ge(i,bs),a&&nt(a,bs),this.cursorNodeId=n}},r.prototype.getElementByNodeId=function(e){return e?this.previewContent.querySelector('[data-nodeid="'+e+'"]'):null},r.prototype.update=function(e){var t=this;e.forEach(function(n){return t.replaceRangeNodes(n)}),this.eventEmitter.emit("afterPreviewRender",this)},r.prototype.replaceRangeNodes=function(e){var t=this,n=e.nodes,i=e.removedNodeRange,a=this.previewContent,o=this.eventEmitter.emitReduce("beforePreviewRender",this.sanitizer(n.map(function(p){return t.renderer.render(p)}).join("")));if(!i)a.insertAdjacentHTML("afterbegin",o);else{var s=i.id,l=s[0],u=s[1],c=this.getElementByNodeId(l),f=this.getElementByNodeId(u);if(c){c.insertAdjacentHTML("beforebegin",o);for(var d=c;d&&d!==f;){var h=d.nextElementSibling;lr(d),ys(d),d=h}d!=null&&d.parentNode&&(lr(d),ys(d))}}},r.prototype.getRenderer=function(){return this.renderer},r.prototype.destroy=function(){Sf(this.el,"scroll"),this.el=null},r.prototype.getElement=function(){return this.el},r.prototype.getHTML=function(){return Eo(this.previewContent.innerHTML)},r.prototype.setHTML=function(e){this.previewContent.innerHTML=e},r.prototype.setHeight=function(e){rt(this.el,{height:e+"px"})},r.prototype.setMinHeight=function(e){rt(this.el,{minHeight:e+"px"})},r})();function kt(r,e){for(var t=r.depth;t;){var n=r.node(t);if(e(n,t))return{node:n,depth:t,offset:t>0?r.before(t):0};t-=1}return null}function zr(r){return!!kt(r,function(e){var t=e.type;return t.name==="listItem"||t.name==="bulletList"||t.name==="orderedList"})}function Ki(r){return!!kt(r,function(e){var t=e.type;return t.name==="tableHeadCell"||t.name==="tableBodyCell"})}function Vr(r){return kt(r,function(e){var t=e.type;return t.name==="listItem"})}function Ji(r){return{tag:r,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return b({},t&&{rawHTML:t})}}}function Jd(r){return Object.keys(r).reduce(function(e,t){return t!=="rawHTML"&&r[t]&&(t=t==="className"?"class":t,e[t]=r[t]),e},{})}function Xd(r){return{tag:r,getAttrs:function(e){return["rawHTML","colspan","rowspan","extended"].reduce(function(t,n){var i=n==="rawHTML"?"data-raw-html":n,a=e.getAttribute(i);return a&&(t[n]=ce(["rawHTML","extended"],n)?a:Number(a)),t},{})}}}function ae(){return{htmlAttrs:{default:null},classNames:{default:null}}}function Q(r){var e=r.htmlAttrs,t=r.classNames;return b(b({},e),{class:t?t.join(" "):null})}function Fre(r,e){var t=r.parent,n=r.startIndex,i=r.endIndex,a=t.contentMatchAt(n).findWrapping(e);if(a){var o=a.length?a[0]:e;return t.canReplaceWith(n,i,o)?a:null}return null}function qre(r,e){var t=r.parent,n=r.startIndex,i=r.endIndex,a=t.child(n),o=e.contentMatch.findWrapping(a.type);if(o){for(var s=o.length?o[o.length-1]:e,l=s.contentMatch,u=n;l&&u<i;u+=1)l=l.matchType(t.child(u).type);if(l&&l.validEnd)return o}return null}function _re(r,e,t,n){var i=Fre(r,t),a=qre(e,t);if(i&&a){var o=i.map(function(l){return{type:l}}),s=a.map(function(l){return{type:l,attrs:n}});return o.concat({type:t}).concat(s)}return null}function $re(r,e,t,n,i){for(var a=e.start,o=e.end,s=e.startIndex,l=e.endIndex,u=e.parent,c=C.empty,f=t.length-1;f>=0;f-=1)c=C.from(t[f].type.create(t[f].attrs,c));r.step(new re(a-(n?2:0),o,a,o,new S(c,0,0),t.length,!0));for(var d=0,f=0;f<t.length;f+=1)if(t[f].type===i){d=f+1;break}for(var h=t.length-d,p=a+t.length-(n?2:0),f=s,v=l;f<v;f+=1){var m=f===s;!m&&yr(r.doc,p,h)&&(r.split(p,h),p+=h*2),p+=u.child(f).nodeSize}return r}function Yd(r,e,t,n){var i=e.$from,a=e.$to,o=e.depth,s=e,l=!1;if(o>=2&&i.node(o-1).type.compatibleContent(t)&&e.startIndex===0&&i.index(o-1)){var u=r.doc.resolve(e.start-2);s=new zn(u,u,o),e.endIndex<e.parent.childCount&&(e=new zn(i,r.doc.resolve(a.end(o)),o)),l=!0}var c=_re(s,e,t,n);return c?$re(r,e,c,l,t):r}function Qd(r,e){for(var t=r.resolve(e);t.node().type.name!=="paragraph";)e-=2,t=r.resolve(e);return Vr(t)}function zre(r,e){var t=e.$from,n=e.$to,i=Vr(t),a=Vr(n);if(i&&a)for(;a;){var o=a.offset,s=a.node,l={task:!s.attrs.task,checked:!1};if(r.setNodeMarkup(o,null,l),o===i.offset)break;a=Qd(r.doc,o)}return r}function Vre(r,e,t){var n=e.$from,i=e.$to,a=Vr(n),o=Vr(i);if(a&&o)for(;o;){var s=o.offset,l=o.node,u=o.depth;l.attrs.task&&r.setNodeMarkup(s,null,{task:!1,checked:!1});var c=r.doc.resolve(s);if(c.parent.type!==t){var f=c.before(u-1);r.setNodeMarkup(f,t)}if(s===a.offset)break;o=Qd(r.doc,s)}return r}function Zd(r){return function(e,t){var n=e.selection,i=e.tr,a=n.$from,o=n.$to,s=a.blockRange(o);if(s){var l=zr(a)?Vre(i,s,r):Yd(i,s,r);return t(l),!0}return!1}}function Ure(){return function(r,e){var t=r.selection,n=r.tr,i=r.schema,a=t.$from,o=t.$to,s=a.blockRange(o);if(s){var l=zr(a)?zre(n,s):Yd(n,s,i.nodes.bulletList,{task:!0});return e(l),!0}return!1}}function Wre(r){return function(e,t){var n=e.tr,i=e.selection,a=i.$from,o=i.$to,s=a.blockRange(o,function(v){var m=v.childCount,g=v.firstChild;return!!m&&g.type===r});if(s&&s.startIndex>0){var l=s.parent,u=l.child(s.startIndex-1);if(u.type!==r)return!1;var c=u.lastChild&&u.lastChild.type===l.type,f=c?C.from(r.create()):null,d=new S(C.from(r.create(null,C.from(l.type.create(null,f)))),c?3:1,0),h=s.start,p=s.end;return n.step(new re(h-(c?3:1),p,h,p,d,1,!0)),t(n),!0}return!1}}function jre(r,e,t){var n=e.$from,i=e.$to,a=e.end,o=e.depth,s=e.parent,l=i.end(o);return a<l&&(r.step(new re(a-1,l,a,l,new S(C.from(t.create(null,s.copy())),1,0),1,!0)),e=new zn(r.doc.resolve(n.pos),r.doc.resolve(l),o)),r.lift(e,Kn(e)),r}function Gre(r,e){for(var t=e.parent,n=e.end,i=e.endIndex-1,a=e.startIndex;i>a;i-=1)n-=t.child(i).nodeSize,r.delete(n-1,n+1);var o=r.doc.resolve(e.start),s=o.nodeAfter,l=e.startIndex===0,u=e.endIndex===t.childCount,c=o.node(-1),f=o.index(-1),d=c.canReplace(f+(l?0:1),f+1,s==null?void 0:s.content.append(u?C.empty:C.from(t)));if(s&&d){var h=o.pos,p=h+s.nodeSize;r.step(new re(h-(l?1:0),p+(u?1:0),h+1,p-1,new S((l?C.empty:C.from(t.copy(C.empty))).append(u?C.empty:C.from(t.copy(C.empty))),l?0:1,u?0:1),l?0:1))}return r}function Kre(r){return function(e,t){var n=e.tr,i=e.selection,a=i.$from,o=i.$to,s=a.blockRange(o,function(c){var f=c.childCount,d=c.firstChild;return!!f&&d.type===r});if(s){var l=a.node(s.depth-1).type===r,u=l?jre(n,s,r):Gre(n,s);return t(u),!0}return!1}}function Jre(r){return function(e,t){var n=e.tr,i=e.selection,a=i.$from,o=i.$to;if(a.depth<2||!a.sameParent(o))return!1;var s=a.node(-1);if(s.type!==r)return!1;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==r||a.index(-2)!==a.node(-2).childCount-1)return!1;for(var l=a.index(-1)>0,u=C.empty,c=a.depth-(l?1:2);c>=a.depth-3;c-=1)u=C.from(a.node(c).copy(u));return u=u.append(C.from(r.createAndFill())),n.replace(l?a.before():a.before(-1),a.after(-3),new S(u,l?3:2,2)),n.setSelection(F.near(n.doc.resolve(a.pos+(l?3:2)))),t(n),!0}var f=o.pos===a.end()?s.contentMatchAt(0).defaultType:null,d=f&&[null,{type:f}];return n.delete(a.pos,o.pos),yr(n.doc,a.pos,2,d)?(n.split(a.pos,2,d),t(n),!0):!1}}function Xre(){return function(){return function(r,e){var t=r.selection,n=r.schema,i=t.$from,a=t.$to,o=i.blockRange(a);return o&&zr(i)?Wre(n.nodes.listItem)(r,e):!1}}}function Yre(){return function(){return function(r,e){var t=r.selection,n=r.schema,i=t.$from,a=t.$to,o=i.blockRange(a);return o&&zr(i)?Kre(n.nodes.listItem)(r,e):!1}}}function ws(){return{indent:Xre(),outdent:Yre()}}var eh=new Map,he=(function(){function r(e,t,n,i){this.table=e,this.tableRows=t,this.tableStartPos=n,this.rowInfo=i}return r.create=function(e){var t=kt(e,function(p){var v=p.type;return v.name==="table"});if(t){var n=t.node,i=t.depth,a=t.offset,o=eh.get(n);if((o==null?void 0:o.tableStartPos)===a+1)return o;var s=[],l=e.start(i),u=n.child(0),c=n.child(1),f=ks(u,l),d=ks(c,l+u.nodeSize);u.forEach(function(p){return s.push(p)}),c.forEach(function(p){return s.push(p)});var h=new r(n,s,l,f.concat(d));return eh.set(n,h),h}return null},Object.defineProperty(r.prototype,"totalRowCount",{get:function(){return this.rowInfo.length},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"totalColumnCount",{get:function(){return this.rowInfo[0].length},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tableStartOffset",{get:function(){return this.tableStartPos},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tableEndOffset",{get:function(){return this.tableStartPos+this.table.nodeSize-1},enumerable:!1,configurable:!0}),r.prototype.getCellInfo=function(e,t){return this.rowInfo[e][t]},r.prototype.posAt=function(e,t){for(var n=0,i=this.tableStartPos;;n+=1){var a=i+this.tableRows[n].nodeSize;if(n===e){for(var o=t;o<this.totalColumnCount&&this.rowInfo[n][o].offset<i;)o+=1;return o===this.totalColumnCount?a:this.rowInfo[n][o].offset}i=a}},r.prototype.getNodeAndPos=function(e,t){var n=this.rowInfo[e][t];return{node:this.table.nodeAt(n.offset-this.tableStartOffset),pos:n.offset}},r.prototype.extendedRowspan=function(e,t){return!1},r.prototype.extendedColspan=function(e,t){return!1},r.prototype.getRowspanCount=function(e,t){return 0},r.prototype.getColspanCount=function(e,t){return 0},r.prototype.decreaseColspanCount=function(e,t){return 0},r.prototype.decreaseRowspanCount=function(e,t){return 0},r.prototype.getColspanStartInfo=function(e,t){return null},r.prototype.getRowspanStartInfo=function(e,t){return null},r.prototype.getCellStartOffset=function(e,t){var n=this.rowInfo[e][t].offset;return this.extendedRowspan(e,t)?this.posAt(e,t):n},r.prototype.getCellEndOffset=function(e,t){var n=this.rowInfo[e][t],i=n.offset,a=n.nodeSize;return this.extendedRowspan(e,t)?this.posAt(e,t):i+a},r.prototype.getCellIndex=function(e){for(var t=0;t<this.totalRowCount;t+=1)for(var n=this.rowInfo[t],i=0;i<this.totalColumnCount;i+=1)if(n[i].offset+1>e.pos)return[t,i];return[0,0]},r.prototype.getRectOffsets=function(e,t){var n,i,a;t===void 0&&(t=e),e.pos>t.pos&&(n=[t,e],e=n[0],t=n[1]);var o=this.getCellIndex(e),s=o[0],l=o[1],u=this.getCellIndex(t),c=u[0],f=u[1];return i=Ic(s,c),s=i[0],c=i[1],a=Ic(l,f),l=a[0],f=a[1],this.getSpannedOffsets({startRowIdx:s,startColIdx:l,endRowIdx:c,endColIdx:f})},r.prototype.getSpannedOffsets=function(e){return e},r})(),ks=function(r,e){var t=[];return r.forEach(function(n,i){var a={rowspanMap:{},colspanMap:{},length:0};n.forEach(function(o,s){for(var l=o.nodeSize,u=0;a[u];)u+=1;a[u]={offset:e+i+s+2,nodeSize:l},a.length+=1}),t.push(a)}),t};function Qre(r,e){return mo(he.prototype,r),ks=e,he}function Zre(r,e,t){for(var n=t.startRowIdx,i=t.startColIdx,a=t.endRowIdx,o=t.endColIdx,s=[],l=n;l<=a;l+=1)for(var u=i;u<=o;u+=1){var c=e.getCellInfo(l,u),f=c.offset,d=c.nodeSize;s.push(new ql(r.resolve(f+1),r.resolve(f+d-1)))}return s}function ene(r,e){var t=[];return r.childCount&&t.push(r),e.childCount&&t.push(e),C.from(t)}var Cs=(function(r){O(e,r);function e(t,n){n===void 0&&(n=t);var i=this,a=t.node(0),o=he.create(t),s=o.getRectOffsets(t,n),l=Zre(a,o,s);return i=r.call(this,l[0].$from,l[0].$to,l)||this,i.startCell=t,i.endCell=n,i.offsetMap=o,i.isCellSelection=!0,i.visible=!1,i}return e.prototype.map=function(t,n){var i=this.startCell.pos,a=this.endCell.pos,o=t.resolve(n.map(i)),s=t.resolve(n.map(a)),l=he.create(o);if(this.offsetMap.totalColumnCount>l.totalColumnCount||this.offsetMap.totalRowCount>l.totalRowCount){var u={tableBody:1,tableRow:2,tableCell:3,paragraph:4},c=u[s.parent.type.name],f=s.end(s.depth-c),d=Math.min(f-4,s.pos);return q.create(t,d)}return new e(o,s)},e.prototype.eq=function(t){return t instanceof e&&t.startCell.pos===this.startCell.pos&&t.endCell.pos===this.endCell.pos},e.prototype.content=function(){for(var t=this.startCell.node(-2),n=this.startCell.start(-2),i=t.child(1).firstChild,a=t.child(0).type.create(),o=t.child(1).type.create(),s=he.create(this.startCell),l=s.getRectOffsets(this.startCell,this.endCell),u=l.startRowIdx,c=l.startColIdx,f=l.endRowIdx,d=l.endColIdx,h=!1,p=u;p<=f;p+=1){for(var v=[],m=c;m<=d;m+=1){var g=s.getCellInfo(p,m).offset,w=t.nodeAt(g-n);w&&(h=w.type.name==="tableHeadCell",s.extendedRowspan(p,m)||s.extendedColspan(p,m)?v.push(w.type.create({extended:!0})):v.push(w.copy(w.content)))}var k=i.copy(C.from(v)),T=h?a:o;T.content=T.content.append(C.from(k))}return new S(ene(a,o),1,1)},e.prototype.toJSON=function(){return JSON.stringify(this)},e})(F);function tne(r,e,t){for(var n=e.nodes,i=n.tableRow,a=n.tableHeadCell,o=n.paragraph,s=[],l=0;l<r;l+=1){var u=t&&t[l],c=o.create(null,u?e.text(u):[]);s.push(a.create(null,c))}return[i.create(null,s)]}function th(r,e,t,n){for(var i=t.nodes,a=i.tableRow,o=i.tableBodyCell,s=i.paragraph,l=[],u=0;u<r;u+=1){for(var c=[],f=0;f<e;f+=1){var d=n&&n[u*e+f],h=s.create(null,d?t.text(d):[]);c.push(o.create(null,h))}l.push(a.create(null,c))}return l}function Xi(r,e,t,n){n===void 0&&(n=null);for(var i=t.nodes,a=i.tableHeadCell,o=i.tableBodyCell,s=i.paragraph,l=e===0?a:o,u=[],c=0;c<r;c+=1)u.push(l.create(n,s.create()));return u}function rh(r,e){for(;r&&r!==e;){if(r.nodeName==="TD"||r.nodeName==="TH")return r;r=r.parentNode}return null}function nh(r){return kt(r,function(e){var t=e.type;return t.name==="tableHeadCell"||t.name==="tableBodyCell"})}function st(r){if(r instanceof q){var e=r.$anchor,t=nh(e);if(t){var n=e.node(0).resolve(e.before(t.depth));return{anchor:n,head:n}}}var i=r,a=i.startCell,o=i.endCell;return{anchor:a,head:o}}function ih(r){var e;if(r.size){var t=r.content,n=r.openStart,i=r.openEnd;if(t.childCount!==1)return null;for(;t.childCount===1&&(n>0&&i>0||((e=t.firstChild)===null||e===void 0?void 0:e.type.name)==="table");)n-=1,i-=1,t=t.firstChild.content;if(t.firstChild.type.name==="tableHead"||t.firstChild.type.name==="tableBody")return t}return null}function Ur(r){var e=r.startRowIdx,t=r.startColIdx,n=r.endRowIdx,i=r.endColIdx,a=n-e+1,o=i-t+1;return{rowCount:a,columnCount:o}}function rne(r,e){return b(b({},r.attrs),e)}var Ut=new cn("cellSelection"),nne=2,ine=(function(){function r(e){this.view=e,this.handlers={mousedown:this.handleMousedown.bind(this),mousemove:this.handleMousemove.bind(this),mouseup:this.handleMouseup.bind(this)},this.startCellPos=null,this.init()}return r.prototype.init=function(){this.view.dom.addEventListener("mousedown",this.handlers.mousedown)},r.prototype.handleMousedown=function(e){var t=rh(e.target,this.view.dom);if(e.button===nne){e.preventDefault();return}if(t){var n=this.getCellPos(e);n&&(this.startCellPos=n),this.bindEvent()}},r.prototype.handleMousemove=function(e){var t=Ut.getState(this.view.state),n=this.getCellPos(e),i=this.startCellPos,a;t?a=this.view.state.doc.resolve(t):i!==n&&(a=i),a&&i&&n&&this.setCellSelection(i,n)},r.prototype.handleMouseup=function(){this.startCellPos=null,this.unbindEvent(),Ut.getState(this.view.state)!==null&&this.view.dispatch(this.view.state.tr.setMeta(Ut,-1))},r.prototype.bindEvent=function(){var e=this.view.dom;e.addEventListener("mousemove",this.handlers.mousemove),e.addEventListener("mouseup",this.handlers.mouseup)},r.prototype.unbindEvent=function(){var e=this.view.dom;e.removeEventListener("mousemove",this.handlers.mousemove),e.removeEventListener("mouseup",this.handlers.mouseup)},r.prototype.getCellPos=function(e){var t=e.clientX,n=e.clientY,i=this.view.posAtCoords({left:t,top:n});if(i){var a=this.view.state.doc,o=a.resolve(i.pos),s=nh(o);if(s){var l=o.before(s.depth);return a.resolve(l)}}return null},r.prototype.setCellSelection=function(e,t){var n=this.view.state,i=n.selection,a=n.tr,o=Ut.getState(this.view.state)===null,s=new Cs(e,t);if(o||!i.eq(s)){var l=a.setSelection(s);o&&l.setMeta(Ut,t.pos),this.view.dispatch(l)}},r.prototype.destroy=function(){this.view.dom.removeEventListener("mousedown",this.handlers.mousedown)},r})(),ane=N("cell-selected");function one(r){var e=r.selection,t=r.doc;if(e instanceof Cs){var n=[],i=e.ranges;return i.forEach(function(a){var o=a.$from,s=a.$to;n.push(Ie.node(o.pos-1,s.pos+1,{class:ane}))}),J.create(t,n)}return null}function sne(){return new Ae({key:Ut,state:{init:function(){return null},apply:function(r,e){var t=r.getMeta(Ut);if(t)return t===-1?null:t;if(fi(e)||!r.docChanged)return e;var n=r.mapping.mapResult(e),i=n.deleted,a=n.pos;return i?null:a}},props:{decorations:one,createSelectionBetween:function(r){var e=r.state;return fi(Ut.getState(e))?null:e.selection}},view:function(r){return new ine(r)}})}var ah=(function(){function r(){this.keys=[],this.values=[]}return r.prototype.getKeyIndex=function(e){return ar(e,this.keys)},r.prototype.get=function(e){return this.values[this.getKeyIndex(e)]},r.prototype.set=function(e,t){var n=this.getKeyIndex(e);return n>-1?this.values[n]=t:(this.keys.push(e),this.values.push(t)),this},r.prototype.has=function(e){return this.getKeyIndex(e)>-1},r.prototype.delete=function(e){var t=this.getKeyIndex(e);return t>-1?(this.keys.splice(t,1),this.values.splice(t,1),!0):!1},r.prototype.forEach=function(e,t){var n=this;t===void 0&&(t=this),this.values.forEach(function(i,a){i&&n.keys[a]&&e.call(t,i,n.keys[a],n)})},r.prototype.clear=function(){this.keys=[],this.values=[]},r})(),Ts="en-US",lne=(function(){function r(){this.code=Ts,this.langs=new ah}return r.prototype.setCode=function(e){this.code=e||Ts},r.prototype.setLanguage=function(e,t){var n=this;e=[].concat(e),e.forEach(function(i){if(!n.langs.has(i))n.langs.set(i,t);else{var a=n.langs.get(i);n.langs.set(i,lo(a,t))}})},r.prototype.get=function(e,t){t||(t=this.code);var n=this.langs.get(t);n||(n=this.langs.get(Ts));var i=n[e];if(!i)throw new Error('There is no text key "'+e+'" in '+t);return i},r})(),B=new lne,une=[[{action:"Add row to up",command:"addRowToUp",disableInThead:!0,className:"add-row-up"},{action:"Add row to down",command:"addRowToDown",disableInThead:!0,className:"add-row-down"},{action:"Remove row",command:"removeRow",disableInThead:!0,className:"remove-row"}],[{action:"Add column to left",command:"addColumnToLeft",className:"add-column-left"},{action:"Add column to right",command:"addColumnToRight",className:"add-column-right"},{action:"Remove column",command:"removeColumn",className:"remove-column"}],[{action:"Align column to left",command:"alignColumn",payload:{align:"left"},className:"align-column-left"},{action:"Align column to center",command:"alignColumn",payload:{align:"center"},className:"align-column-center"},{action:"Align column to right",command:"alignColumn",payload:{align:"right"},className:"align-column-right"}],[{action:"Remove table",command:"removeTable",className:"remove-table"}]];function cne(r,e){return une.map(function(t){return t.map(function(n){var i=n.action,a=n.command,o=n.payload,s=n.disableInThead,l=n.className;return{label:B.get(i),onClick:function(){r.emit("command",a,o)},disabled:e&&!!s,className:l}})}).concat()}function fne(r){return new Ae({props:{handleDOMEvents:{contextmenu:function(e,t){var n=rh(t.target,e.dom);if(n){t.preventDefault();var i=t,a=i.clientX,o=i.clientY,s=e.dom.parentNode.getBoundingClientRect(),l=s.left,u=s.top,c=n.nodeName==="TH";return r.emit("contextmenu",{pos:{left:a-l+10+"px",top:o-u+30+"px"},menuGroups:cne(r,c),tableCell:n}),!0}return!1}}}})}function dne(){return new Ae({props:{handleDOMEvents:{mousedown:function(r,e){var t=e,n=t.clientX,i=t.clientY,a=r.posAtCoords({left:n,top:i});if(a){var o=r.state,s=o.doc,l=o.tr,u=s.resolve(a.pos),c=Vr(u),f=e.target,d=getComputedStyle(f,":before"),h=e,p=h.offsetX,v=h.offsetY;if(!c||!ko(d,p,v))return!1;e.preventDefault();var m=u.before(c.depth),g=c.node.attrs;return l.setNodeMarkup(m,null,b(b({},g),{checked:!g.checked})),r.dispatch(l),!0}return!1}}}})}var hne=["image","link","customBlock","frontMatter"],pne=["strong","strike","emph","code"],oh=["bulletList","orderedList","taskList"];function vne(r,e){var t=r.type.name;return t==="listItem"?r.attrs.task?"taskList":e.type.name:t.indexOf("table")!==-1?"table":t}function mne(r,e){e[r]={active:!0},oh.filter(function(t){return t!==r}).forEach(function(t){e[t]&&delete e[t]})}function gne(r,e,t,n){pne.forEach(function(i){var a=t.marks[i],o=r.marksAcross(e)||[],s=!!a.isInSet(o);s&&(n[i]={active:!0})})}function yne(r,e,t){var n=r.$from,i=r.$to,a=r.from,o=r.to,s={indent:{active:!1,disabled:!0},outdent:{active:!1,disabled:!0}};return e.nodesBetween(a,o,function(l,u,c){var f=vne(l,c);ce(hne,f)||(ce(oh,f)?(mne(f,s),s.indent.disabled=!1,s.outdent.disabled=!1):f==="paragraph"||f==="text"?gne(n,i,t,s):s[f]={active:!0})}),s}function bne(r){return new Ae({view:function(){return{update:function(e){var t=e.state,n=t.selection,i=t.doc,a=t.schema;r.emit("changeToolbarState",{toolbarState:yne(n,i,a)})}}}})}var wne=(function(){function r(e,t,n,i){var a=this;this.openEditor=function(){if(a.innerEditorView)throw new Error("The editor is already opened.");a.dom.draggable=!1,a.wrapper.style.display="none",a.innerViewContainer.style.display="block",a.innerEditorView=new ai(a.innerViewContainer,{state:Yt.create({doc:a.node,plugins:[wn({"Mod-z":function(){return Cn(a.innerEditorView.state,a.innerEditorView.dispatch)},"Shift-Mod-z":function(){return oo(a.innerEditorView.state,a.innerEditorView.dispatch)},Tab:function(o,s){return s(o.tr.insertText("	")),!0},Enter:cc,Escape:function(){return a.cancelEditing(),!0},"Ctrl-Enter":function(){return a.saveAndFinishEditing(),!0}}),Cc()]}),dispatchTransaction:function(o){return a.dispatchInner(o)},handleDOMEvents:{mousedown:function(){return a.editorView.hasFocus()&&a.innerEditorView.focus(),!0},blur:function(){return a.saveAndFinishEditing(),!0}}}),a.innerEditorView.focus()},this.node=e,this.editorView=t,this.getPos=n,this.toDOMAdaptor=i,this.innerEditorView=null,this.canceled=!1,this.dom=document.createElement("div"),this.dom.className=N("custom-block"),this.wrapper=document.createElement("div"),this.wrapper.className=N("custom-block-view"),this.createInnerViewContainer(),this.renderCustomBlock(),this.dom.appendChild(this.innerViewContainer),this.dom.appendChild(this.wrapper)}return r.prototype.renderToolArea=function(){var e=this,t=document.createElement("div"),n=document.createElement("span"),i=document.createElement("button");t.className="tool",n.textContent=this.node.attrs.info,n.className="info",i.type="button",i.addEventListener("click",function(){return e.openEditor()}),t.appendChild(n),t.appendChild(i),this.wrapper.appendChild(t)},r.prototype.renderCustomBlock=function(){var e=this.toDOMAdaptor.getToDOMNode(this.node.attrs.info);if(e){for(var t=e(this.node);this.wrapper.hasChildNodes();)this.wrapper.removeChild(this.wrapper.lastChild);t&&this.wrapper.appendChild(t),this.renderToolArea()}},r.prototype.createInnerViewContainer=function(){this.innerViewContainer=document.createElement("div"),this.innerViewContainer.className=N("custom-block-editor"),this.innerViewContainer.style.display="none"},r.prototype.closeEditor=function(){this.innerEditorView&&(this.innerEditorView.destroy(),this.innerEditorView=null,this.innerViewContainer.style.display="none"),this.wrapper.style.display="block"},r.prototype.saveAndFinishEditing=function(){var e=this.editorView.state.selection.to,t=this.editorView.state;this.editorView.dispatch(t.tr.setSelection(j(t.tr,e))),this.editorView.focus(),this.renderCustomBlock(),this.closeEditor()},r.prototype.cancelEditing=function(){var e=my(this.innerEditorView.state);for(this.canceled=!0;e--;)Cn(this.innerEditorView.state,this.innerEditorView.dispatch),Cn(this.editorView.state,this.editorView.dispatch);this.canceled=!1;var t=this.editorView.state.selection.to,n=this.editorView.state;this.editorView.dispatch(n.tr.setSelection(q.create(n.doc,t))),this.editorView.focus(),this.closeEditor()},r.prototype.dispatchInner=function(e){var t=this.innerEditorView.state.applyTransaction(e),n=t.state,i=t.transactions;if(this.innerEditorView.updateState(n),!this.canceled&&ze(this.getPos)){for(var a=this.editorView.state.tr,o=Ne.offset(this.getPos()+1),s=0;s<i.length;s+=1)for(var l=i[s].steps,u=0;u<l.length;u+=1)a.step(l[u].map(o));a.docChanged&&this.editorView.dispatch(a)}},r.prototype.update=function(e){return e.sameMarkup(this.node)?(this.node=e,this.innerEditorView||this.renderCustomBlock(),!0):!1},r.prototype.stopEvent=function(e){return!!this.innerEditorView&&!!e.target&&this.innerEditorView.dom.contains(e.target)},r.prototype.ignoreMutation=function(){return!0},r.prototype.destroy=function(){this.dom.removeEventListener("dblclick",this.openEditor),this.closeEditor()},r})(),sh="image-link",kne=(function(){function r(e,t,n,i){var a=this,o;this.handleMousedown=function(s){s.preventDefault();var l=s.target,u=s.offsetX,c=s.offsetY;if(a.imageLink&&ze(a.getPos)&&zc(l,sh)){var f=getComputedStyle(l,":before");if(s.stopPropagation(),ko(f,u,c)){var d=a.view.state.tr,h=a.getPos();d.setSelection(j(d,h,h+1)),a.view.dispatch(d),a.eventEmitter.emit("openPopup","link",a.imageLink.attrs)}}},this.node=e,this.view=t,this.getPos=n,this.eventEmitter=i,this.imageLink=(o=e.marks.filter(function(s){var l=s.type;return l.name==="link"})[0])!==null&&o!==void 0?o:null,this.dom=this.createElement(),this.bindEvent()}return r.prototype.createElement=function(){var e=this.createImageElement(this.node);if(this.imageLink){var t=document.createElement("span");return t.className=sh,t.appendChild(e),t}return e},r.prototype.createImageElement=function(e){var t=document.createElement("img"),n=e.attrs,i=n.imageUrl,a=n.altText,o=Q(e.attrs);return t.src=i,a&&(t.alt=a),xo(o,t),t},r.prototype.bindEvent=function(){this.imageLink&&this.dom.addEventListener("mousedown",this.handleMousedown)},r.prototype.stopEvent=function(){return!0},r.prototype.destroy=function(){this.imageLink&&this.dom.removeEventListener("mousedown",this.handleMousedown)},r})(),Cne="toastui-editor-ww-code-block",Tne="toastui-editor-ww-code-block-language",xne=(function(){function r(e,t,n,i){var a=this;this.contentDOM=null,this.input=null,this.timer=null,this.handleMousedown=function(o){var s=o.target,l=getComputedStyle(s,":after");if(l.backgroundImage!=="none"&&ze(a.getPos)){var u=a.view.coordsAtPos(a.getPos()),c=u.top,f=u.right;a.createLanguageEditor({top:c,right:f})}},this.handleKeydown=function(o){o.key==="Enter"&&a.input&&(o.preventDefault(),a.changeLanguage())},this.node=e,this.view=t,this.getPos=n,this.eventEmitter=i,this.createElement(),this.bindDOMEvent(),this.bindEvent()}return r.prototype.createElement=function(){var e=this.node.attrs.language,t=document.createElement("div");t.setAttribute("data-language",e||"text"),t.className=Cne;var n=this.createCodeBlockElement(),i=n.firstChild;t.appendChild(n),this.dom=t,this.contentDOM=i},r.prototype.createCodeBlockElement=function(){var e=document.createElement("pre"),t=document.createElement("code"),n=this.node.attrs.language,i=Q(this.node.attrs);return n&&t.setAttribute("data-language",n),xo(i,e),e.appendChild(t),e},r.prototype.createLanguageEditor=function(e){var t=this,n=e.top,i=e.right,a=document.createElement("span");a.className=Tne;var o=document.createElement("input");o.type="text",o.value=this.node.attrs.language,a.appendChild(o),this.view.dom.parentElement.appendChild(a);var s=a.clientWidth;rt(a,{top:n+10+"px",left:i-s-10+"px",width:s+"px"}),this.input=o,this.input.addEventListener("blur",function(){return t.changeLanguage()}),this.input.addEventListener("keydown",this.handleKeydown),this.clearTimer(),this.timer=setTimeout(function(){t.input.focus()})},r.prototype.bindDOMEvent=function(){this.dom&&this.dom.addEventListener("click",this.handleMousedown)},r.prototype.bindEvent=function(){var e=this;this.eventEmitter.listen("scroll",function(){e.input&&e.reset()})},r.prototype.changeLanguage=function(){if(this.input&&ze(this.getPos)){var e=this.input.value;this.reset();var t=this.getPos(),n=this.view.state.tr;n.setNodeMarkup(t,null,{language:e}),this.view.dispatch(n)}},r.prototype.reset=function(){var e;if(!((e=this.input)===null||e===void 0)&&e.parentElement){var t=this.input.parentElement;this.input=null,lr(t)}},r.prototype.clearTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},r.prototype.stopEvent=function(){return!0},r.prototype.update=function(e){return e.sameMarkup(this.node)?(this.node=e,!0):!1},r.prototype.destroy=function(){this.reset(),this.clearTimer(),this.dom&&this.dom.removeEventListener("click",this.handleMousedown)},r})(),Ene=/MsoListParagraph/,lh=/style=(.|\n)*mso-/,uh=/mso-list:(.*)/,Mne=/O:P/,Sne=/^(n|u|l)/,One="p.MsoListParagraph";function Lne(r){return lh.test(r)}function Nne(r){for(var e=[],t=document.createTreeWalker(r,1,null,!1);t.nextNode();){var n=t.currentNode;if(ki(n)){var i=n,a=i.outerHTML,o=i.textContent,s=lh.test(a),l=uh.test(a);s&&!l&&o?e.push([n,!0]):(Mne.test(n.nodeName)||s&&!o||l)&&e.push([n,!1])}}return e.forEach(function(u){var c=u[0],f=u[1];f?Jb(c):lr(c)}),r.innerHTML.trim()}function Ane(r,e){var t=r.getAttribute("style");if(t){var n=t.match(uh),i=n[1],a=i.trim().split(" "),o=a[1],s=parseInt(o.replace("level",""),10),l=Sne.test(r.textContent||"");return{id:e,level:s,prev:null,parent:null,children:[],unordered:l,contents:Nne(r)}}return null}function Dne(r,e){if(e.level<r.level)e.children.push(r),r.parent=e;else{for(;e&&e.level!==r.level;)e=e.parent;e&&(r.prev=e,r.parent=e.parent,r.parent&&r.parent.children.push(r))}}function Ine(r){var e=[];return r.forEach(function(t,n){var i=e[n-1],a=Ane(t,n);a&&(i&&Dne(a,i),e.push(a))}),e}function ch(r){var e=r[0].unordered?"ul":"ol",t=document.createElement(e);return r.forEach(function(n){var i=n.children,a=n.contents,o=document.createElement("li");o.innerHTML=a,t.appendChild(o),i.length&&t.appendChild(ch(i))}),t}function Rne(r){var e=Ine(r),t=e.filter(function(n){var i=n.parent;return!i});return ch(t)}function Bne(r){for(;r&&!ki(r);)r=r.nextSibling;return r?!Ene.test(r.className):!0}function Pne(r){var e=document.createElement("div");e.innerHTML=r;var t=[],n=jb(e,One);n.forEach(function(a){var o=Bne(a.nextSibling);if(t.push(a),o){var s=Rne(t),l=a.nextSibling;l?Kb(s,l):Gb(e,s),t=[]}lr(a)});var i=n.length?"<p></p>":"";return""+i+e.innerHTML}var fh="<!--StartFragment-->",Hne="<!--EndFragment-->";function Fne(r){var e=r.indexOf(fh),t=r.lastIndexOf(Hne);return e>-1&&t>-1&&(r=r.slice(e+fh.length,t)),r.replace(/<br[^>]*>/g,Gc)}function qne(r){return/<\/td>((?!<\/tr>)[\s\S])*$/i.test(r)&&(r="<tr>"+r+"</tr>"),/<\/tr>((?!<\/table>)[\s\S])*$/i.test(r)&&(r="<table>"+r+"</table>"),r}function _ne(r){return r=Fne(r),r=qne(r),Lne(r)&&(r=Pne(r)),r}function $ne(r){var e=r.reduce(function(t,n){return t.childCount>n.childCount?t:n});return e.childCount}function dh(r,e,t){for(var n=[],i=r.childCount,a=0;a<i;a+=1)if(!r.child(a).attrs.extended){var o=a<i?t.create(r.child(a).attrs,r.child(a).content):t.createAndFill();n.push(o)}return n}function hh(r,e,t){var n=t.nodes,i=n.tableRow,a=n.tableHeadCell,o=dh(r,e,a);return i.create(null,o)}function ph(r,e,t){var n=t.nodes,i=n.tableRow,a=n.tableBodyCell,o=dh(r,e,a);return i.create(null,o)}function zne(r,e){for(var t=e.nodes,n=t.tableRow,i=t.tableBodyCell,a=[],o=0;o<r;o+=1){var s=i.createAndFill();a.push(s)}return n.create({dummyRowForPasting:!0},a)}function vh(r){var e=[],t=[];if(r.firstChild.type.name==="tableHead"){var n=r.firstChild;n.forEach(function(a){return e.push(a)})}if(r.lastChild.type.name==="tableBody"){var i=r.lastChild;i.forEach(function(a){return t.push(a)})}return Re(Re([],e),t)}function Vne(r,e,t){var n=hh(r,e,t);return t.nodes.tableHead.create(null,n)}function mh(r,e,t){var n=r.map(function(a){return ph(a,e,t)});if(!r.length){var i=zne(e,t);n.push(i)}return t.nodes.tableBody.create(null,n)}function Une(r,e,t,n){var i=$ne(r);if(t&&n)return e.nodes.table.create(null,[mh(r,i,e)]);var a=r[0],o=r.slice(1),s=[Vne(a,i,e)];return o.length&&s.push(mh(o,i,e)),e.nodes.table.create(null,s)}function Wne(r,e,t){var n=[],i=r.content,a=r.openStart,o=r.openEnd;return i.forEach(function(s){if(s.type.name==="table"){var l=ih(new S(C.from(s),0,0));if(l){var u=vh(l),c=l.firstChild.type.name==="tableBody",f=Une(u,e,c,t);n.push(f)}}else n.push(s)}),new S(C.from(n),a,o)}var jne=4,Gne=2;function Yi(r){return r*jne}function Kne(r,e,t){var n=[],i=vh(r),a=i[0].childCount,o=i.length,s=e.startRowIdx===0,l=i.slice(0,o);if(s){var u=l.shift();if(u){var c=hh(u,a,t).content;n.push(c)}}return l.forEach(function(f){if(!f.attrs.dummyRowForPasting){var d=ph(f,a,t).content;n.push(d)}}),n}function Jne(r,e,t){for(var n=e.startRowIdx,i=e.startColIdx,a=t.length,o=0,s=function(h){var p=t[h].childCount;t[h].forEach(function(v){var m=v.attrs,g=m.colspan;g>1&&(p+=g-1)}),o=Math.max(o,p)},l=0;l<a;l+=1)s(l);var u=n+a-1,c=i+o-1,f=Math.max(u+1-r.totalRowCount,0),d=Math.max(c+1-r.totalColumnCount,0);return{startRowIdx:n,startColIdx:i,endRowIdx:u,endColIdx:c,addedRowCount:f,addedColumnCount:d}}function Xne(r,e){for(var t=r.startRowIdx,n=r.startColIdx,i=r.endRowIdx,a=r.endColIdx,o=r.addedRowCount,s=r.addedColumnCount,l=t;l<=i-o;l+=1)e.push({rowIdx:l,startColIdx:n,endColIdx:a-s})}function Yne(r,e,t,n,i){for(var a=n.startRowIdx,o=n.startColIdx,s=n.endRowIdx,l=n.endColIdx,u=n.addedRowCount,c=n.addedColumnCount,f=t.totalRowCount,d=0,h=0;h<f;h+=1){var p=t.getCellInfo(h,l-c),v=p.offset,m=p.nodeSize,g=r.mapping.map(v+m),w=Xi(c,h,e);if(r.insert(g,w),h>=a&&h<=s-u){var k=t.getCellInfo(h,l-c),T=r.mapping.map(k.offset),x=g+Yi(c);i[d]={rowIdx:h,startColIdx:o,endColIdx:l,dummyOffsets:[T,x]},d+=1}}}function Qne(r,e,t,n,i){var a=n.addedRowCount,o=n.addedColumnCount,s=n.startColIdx,l=n.endColIdx,u=r.mapping.maps.length,c=t.tableEndOffset-2,f=th(a,t.totalColumnCount+o,e),d=c;r.insert(r.mapping.slice(u).map(d),f);for(var h=0;h<a;h+=1){var p=d+Yi(s)+1,v=d+Yi(l+1)+1,m=d+Yi(t.totalColumnCount+o)+Gne;i.push({rowIdx:h+t.totalRowCount,startColIdx:s,endColIdx:l,dummyOffsets:[p,v]}),d=m}}function Zne(r,e,t,n){var i=r.mapping.maps.length;t.forEach(function(a,o){var s=a.rowIdx,l=a.startColIdx,u=a.endColIdx,c=a.dummyOffsets,f=r.mapping.slice(i),d=new S(e[o],0,0),h=c?c[0]:n.getCellStartOffset(s,l),p=c?c[1]:n.getCellEndOffset(s,u);r.replace(f.map(h),f.map(p),d)})}function eie(r,e){var t=r.state,n=t.selection,i=t.schema,a=t.tr,o=st(n),s=o.anchor,l=o.head;if(s&&l){var u=ih(e);if(!u)return!1;var c=he.create(s),f=c.getRectOffsets(s,l),d=Kne(u,f,i),h=Jne(c,f,d),p=[];return rie(c,h)&&(Xne(h,p),h.addedColumnCount&&Yne(a,i,c,h,p),h.addedRowCount&&Qne(a,i,c,h,p),Zne(a,d,p,c),r.dispatch(a),tie(r,p,c.getCellInfo(0,0).offset)),!0}return!1}function tie(r,e,t){var n=r.state,i=n.tr,a=n.doc,o=he.create(a.resolve(t)),s=e[0],l=s.rowIdx,u=s.startColIdx,c=be(e),f=c.rowIdx,d=c.endColIdx,h=o.getCellInfo(l,u).offset,p=o.getCellInfo(f,d).offset;r.dispatch(i.setSelection(new Cs(a.resolve(h),a.resolve(p))))}function rie(r,e){var t=r.getSpannedOffsets(e),n=Ur(t),i=n.rowCount,a=n.columnCount,o=Ur(e),s=o.rowCount,l=o.columnCount;return i===s&&a===l}var nie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"doc"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"block+"}},enumerable:!1,configurable:!0}),e})(W),iie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"paragraph"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"inline*",group:"block",attrs:b({},ae()),parseDOM:[{tag:"p"}],toDOM:function(t){var n=t.attrs;return["p",Q(n),0]}}},enumerable:!1,configurable:!0}),e})(W),aie=/\s{1,4}$/,oie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"text"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{group:"inline"}},enumerable:!1,configurable:!0}),e.prototype.addSpaces=function(){return function(t,n){var i=t.selection,a=t.tr,o=i.$from,s=i.$to,l=o.blockRange(s);return l&&!zr(o)&&!Ki(o)?(n(a.insertText("    ",o.pos,s.pos)),!0):!1}},e.prototype.removeSpaces=function(){return function(t,n){var i=t.selection,a=t.tr,o=i.$from,s=i.$to,l=i.from,u=o.blockRange(s);if(u&&!zr(o)&&!Ki(o)){var c=o.nodeBefore;if(c&&c.isText){var f=c.text,d=f.replace(aie,""),h=f.length-d.length;return n(a.delete(l-h,l)),!0}}return!1}},e.prototype.keymaps=function(){return{Tab:this.addSpaces(),"Shift-Tab":this.removeSpaces()}},e})(W),sie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"heading"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"levels",{get:function(){return[1,2,3,4,5,6]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){var t=this.levels.map(function(n){return{tag:"h"+n,getAttrs:function(i){var a=i.getAttribute("data-raw-html");return b({level:n},a&&{rawHTML:a})}}});return{attrs:b({level:{default:1},headingType:{default:"atx"},rawHTML:{default:null}},ae()),content:"inline*",group:"block",defining:!0,parseDOM:t,toDOM:function(n){var i=n.attrs;return["h"+i.level,Q(i),0]}}},enumerable:!1,configurable:!0}),e.prototype.commands=function(){return function(t){return function(n,i){var a=n.schema.nodes[t.level?"heading":"paragraph"];return ro(a,t)(n,i)}}},e})(W),lie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"codeBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"text*",group:"block",attrs:b({language:{default:null},rawHTML:{default:null}},ae()),code:!0,defining:!0,marks:"",parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:function(t){var n=t.getAttribute("data-raw-html"),i=t.firstElementChild;return b({language:(i==null?void 0:i.getAttribute("data-language"))||null},n&&{rawHTML:n})}}],toDOM:function(t){var n=t.attrs;return[n.rawHTML||"pre",["code",b({"data-language":n.language},Q(n)),0]]}}},enumerable:!1,configurable:!0}),e.prototype.commands=function(){return function(){return function(t,n){return ro(t.schema.nodes.codeBlock)(t,n)}}},e.prototype.moveCursor=function(t){var n=this;return function(i,a){var o=i.tr,s=i.doc,l=i.schema,u=i.selection.$from,c=n.context.view;if(c.endOfTextblock(t)&&u.node().type.name==="codeBlock"){var f=u.parent.textContent.split(`
`),d=t==="up"?u.start():u.end(),h=t==="up"?[d,f[0].length+d]:[d-be(f).length,d],p=s.resolve(t==="up"?u.before():u.after()),v=t==="up"?p.nodeBefore:p.nodeAfter;if(pb(u.pos,h[0],h[1])&&!v){var m=go(o,p,l);if(m)return a(m),!0}}return!1}},e.prototype.keymaps=function(){var t=this.commands()();return{"Shift-Mod-p":t,"Shift-Mod-P":t,ArrowUp:this.moveCursor("up"),ArrowDown:this.moveCursor("down")}},e})(W),uie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"bulletList"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"listItem+",group:"block",attrs:b({rawHTML:{default:null}},ae()),parseDOM:[Ji("ul")],toDOM:function(t){var n=t.attrs;return["ul",Q(n),0]}}},enumerable:!1,configurable:!0}),e.prototype.changeList=function(){return function(t,n){return Zd(t.schema.nodes.bulletList)(t,n)}},e.prototype.commands=function(){return{bulletList:this.changeList,taskList:Ure}},e.prototype.keymaps=function(){var t=this.changeList(),n=ws(),i=n.indent,a=n.outdent;return{"Mod-u":t,"Mod-U":t,Tab:i(),"Shift-Tab":a()}},e})(W),cie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"orderedList"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"listItem+",group:"block",attrs:b({order:{default:1},rawHTML:{default:null}},ae()),parseDOM:[{tag:"ol",getAttrs:function(t){var n=t.getAttribute("start"),i=t.getAttribute("data-raw-html");return b({order:t.hasAttribute("start")?Number(n):1},i&&{rawHTML:i})}}],toDOM:function(t){var n=t.attrs;return[n.rawHTML||"ol",b({start:n.order===1?null:n.order},Q(n)),0]}}},enumerable:!1,configurable:!0}),e.prototype.commands=function(){return function(){return function(t,n){return Zd(t.schema.nodes.orderedList)(t,n)}}},e.prototype.keymaps=function(){var t=this.commands()(),n=ws(),i=n.indent,a=n.outdent;return{"Mod-o":t,"Mod-O":t,Tab:i(),"Shift-Tab":a()}},e})(W),fie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"listItem"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"paragraph block*",selectable:!1,attrs:{task:{default:!1},checked:{default:!1},rawHTML:{default:null}},defining:!0,parseDOM:[{tag:"li",getAttrs:function(t){var n=t.getAttribute("data-raw-html");return b({task:t.hasAttribute("data-task"),checked:t.hasAttribute("data-task-checked")},n&&{rawHTML:n})}}],toDOM:function(t){var n=t.attrs,i=n.task,a=n.checked;if(!i)return[n.rawHTML||"li",0];var o=["task-list-item"];return a&&o.push("checked"),[n.rawHTML||"li",b({class:o.join(" "),"data-task":i},a&&{"data-task-checked":a}),0]}}},enumerable:!1,configurable:!0}),e.prototype.liftToPrevListItem=function(){return function(t,n){var i=t.selection,a=t.tr,o=t.schema,s=i.$from,l=i.empty,u=o.nodes.listItem,c=s.parent,f=s.node(-1);if(l&&!c.childCount&&f.type===u){if(s.index(-2)>=1)return a.delete(s.start(-1)-1,s.end(-1)),n(a),!0;var d=s.node(-3);if(d.type===u)return a.delete(s.start(-2)-1,s.end(-1)),n(a),!0}return!1}},e.prototype.keymaps=function(){var t=function(n,i){return Jre(n.schema.nodes.listItem)(n,i)};return{Backspace:this.liftToPrevListItem(),Enter:t}},e})(W),die=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"blockQuote"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{attrs:b({rawHTML:{default:null}},ae()),content:"block+",group:"block",parseDOM:[Ji("blockquote")],toDOM:function(t){var n=t.attrs;return["blockquote",Q(n),0]}}},enumerable:!1,configurable:!0}),e.prototype.commands=function(){return function(){return function(t,n){return ny(t.schema.nodes.blockQuote)(t,n)}}},e.prototype.keymaps=function(){var t=this.commands()();return{"Alt-q":t,"Alt-Q":t}},e})(W),hie={left:kie,right:wie,up:Cie,down:Tie};function pie(r,e,t){var n=t[0],i=t[1],a=e.resolve(r.before(n-1));return i===n&&!a.nodeBefore}function vie(r){for(var e,t=r.depth,n;t&&(n=r.node(t),n.type.name!=="tableBodyCell");){if(n.type.name==="listItem"){var i=r.node(t-1),a=i.lastChild===n,o=((e=n.lastChild)===null||e===void 0?void 0:e.type.name)!=="paragraph";return a?!o:!1}t-=1}return!1}function mie(r,e,t,n,i){var a=e[0],o=e[1],s=e[2];if(r==="left"||r==="up"){if(i&&!pie(t,n,[a,o]))return!1;var l=t.before(s),u=n.resolve(l).nodeBefore;if(u)return!1}return!0}function gie(r,e,t,n,i){if(r==="right"||r==="down"){if(i&&!vie(t))return!1;var a=t.after(e),o=n.resolve(a).nodeAfter;if(o)return!1}return!0}function yie(r,e,t,n){var i=e[0],a=e[1],o=i+3,s=a>=o,l=s?i+1:a,u=mie(r,[a,o,l],t,n,s),c=gie(r,l,t,n,s);return u&&c}function gh(r,e,t){var n=t[0],i=t[1],a=e.getRowspanStartInfo(n,i),o=r==="up"&&n===0,s=r==="down"&&((a==null?void 0:a.count)>1?n+a.count-1:n)===e.totalRowCount-1;return o||s}function bie(r,e,t){var n=r.doc.resolve(e.tableStartOffset-1);return n.nodeBefore?r.setSelection(F.near(n,-1)):go(r,n,t)}function xs(r,e,t,n){n===void 0&&(n=!1);var i=r.doc.resolve(e.tableEndOffset);return n||!i.nodeAfter?go(r,i,t):r.setSelection(F.near(i,1))}function wie(r,e){var t=r[0],n=r[1],i=e.totalRowCount,a=e.totalColumnCount,o=n===a-1,s=t===i-1&&o;if(!s){var l=n+1,u=e.getColspanStartInfo(t,n);(u==null?void 0:u.count)>1&&(l+=u.count-1),(o||l===a)&&(t+=1,l=0);var c=e.getCellInfo(t,l).offset;return c+2}return null}function kie(r,e){var t=r[0],n=r[1],i=e.totalColumnCount,a=n===0,o=t===0&&a;if(!o){n-=1,a&&(t-=1,n=i-1);var s=e.getCellInfo(t,n),l=s.offset,u=s.nodeSize;return l+u-2}return null}function Cie(r,e){var t=r[0],n=r[1];if(t>0){var i=e.getCellInfo(t-1,n),a=i.offset,o=i.nodeSize;return a+o-2}return null}function Tie(r,e){var t=r[0],n=r[1],i=e.totalRowCount;if(t<i-1){var a=t+1,o=e.getRowspanStartInfo(t,n);(o==null?void 0:o.count)>1&&(a+=o.count-1);var s=e.getCellInfo(a,n).offset;return s+2}return null}function yh(r,e,t,n){var i=hie[r],a=i(t,n);if(a){var o=r==="right"||r==="down"?1:-1;return e.setSelection(F.near(e.doc.resolve(a),o))}return null}function xie(r,e,t){var n=t[0],i=t[1];if(r==="up"||r==="down")return!1;var a=e.tableStartOffset,o=e.tableEndOffset,s=e.getCellInfo(n,i),l=s.offset,u=s.nodeSize,c=r==="left"?a:o,f=r==="left"?l-2:l+u+3;return c===f}function Eie(r,e,t){var n=r.doc.resolve(e.before(t-3));return r.setSelection(new R(n))}function Mie(r,e,t){var n,i,a;return r==="up"?(n=t.startRowIdx,i=0,a=-1):(n=t.endRowIdx,i=e.totalColumnCount-1,a=e.getCellInfo(n,i).nodeSize+1),{targetRowIdx:n,insertColIdx:i,nodeSize:a}}function Sie(r,e,t){var n=r.getCellInfo(e,0).offset,i=r.getCellInfo(e,t-1),a=i.offset,o=i.nodeSize;return{from:n,to:a+o}}var Oie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"table"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"tableHead{1} tableBody{1}",group:"block",attrs:b({rawHTML:{default:null}},ae()),parseDOM:[Ji("table")],toDOM:function(t){var n=t.attrs;return["table",Q(n),0]}}},enumerable:!1,configurable:!0}),e.prototype.addTable=function(){return function(t){return t===void 0&&(t={rowCount:2,columnCount:1,data:[]}),function(n,i){var a=t.rowCount,o=t.columnCount,s=t.data,l=n.schema,u=n.selection,c=n.tr,f=u.from,d=u.to,h=u.$from,p=f===d;if(p&&!Ki(h)){var v=l.nodes,m=v.tableHead,g=v.tableBody,w=s==null?void 0:s.slice(0,o),k=s==null?void 0:s.slice(o,s.length),T=tne(o,l,w),x=th(a-1,o,l,k),L=l.nodes.table.create(null,[m.create(null,T),g.create(null,x)]);return i(c.replaceSelectionWith(L)),!0}return!1}}},e.prototype.removeTable=function(){return function(){return function(t,n){var i=t.selection,a=t.tr,o=he.create(i.$anchor);if(o){var s=o.tableStartOffset,l=o.tableEndOffset,u=s-1,c=j(a.delete(u,l),u);return n(a.setSelection(c)),!0}return!1}}},e.prototype.addColumn=function(t){return function(){return function(n,i){var a=n.selection,o=n.tr,s=n.schema,l=st(a),u=l.anchor,c=l.head;if(u&&c){for(var f=he.create(u),d=f.getRectOffsets(u,c),h=t==="left"?d.startColIdx:d.endColIdx+1,p=Ur(d).columnCount,v=f.totalRowCount,m=0;m<v;m+=1){var g=Xi(p,m,s);o.insert(o.mapping.map(f.posAt(m,h)),g)}return i(o),!0}return!1}}},e.prototype.removeColumn=function(){return function(){return function(t,n){var i=t.selection,a=t.tr,o=st(i),s=o.anchor,l=o.head;if(s&&l){var u=he.create(s),c=u.getRectOffsets(s,l),f=u.totalColumnCount,d=u.totalRowCount,h=Ur(c).columnCount,p=h===f;if(p)return!1;for(var v=c.startColIdx,m=c.endColIdx,g=a.mapping.maps.length,w=0;w<d;w+=1)for(var k=m;k>=v;k-=1){var T=u.getCellInfo(w,k),x=T.offset,L=T.nodeSize,E=a.mapping.slice(g).map(x),A=E+L;a.delete(E,A)}return n(a),!0}return!1}}},e.prototype.addRow=function(t){return function(){return function(n,i){var a=n.selection,o=n.schema,s=n.tr,l=st(a),u=l.anchor,c=l.head;if(u&&c){var f=he.create(u),d=f.totalColumnCount,h=f.getRectOffsets(u,c),p=Ur(h).rowCount,v=Mie(t,f,h),m=v.targetRowIdx,g=v.insertColIdx,w=v.nodeSize,k=m===0;if(!k){for(var T=[],x=s.mapping.map(f.posAt(m,g))+w,L=[],E=0;E<d;E+=1)L=L.concat(Xi(1,m,o));for(var A=0;A<p;A+=1)T.push(o.nodes.tableRow.create(null,L));return i(s.insert(x,T)),!0}}return!1}}},e.prototype.removeRow=function(){return function(){return function(t,n){var i=t.selection,a=t.tr,o=st(i),s=o.anchor,l=o.head;if(s&&l){var u=he.create(s),c=u.totalRowCount,f=u.totalColumnCount,d=u.getRectOffsets(s,l),h=Ur(d).rowCount,p=d.startRowIdx,v=d.endRowIdx,m=p===0,g=h===c-1;if(g||m)return!1;for(var w=v;w>=p;w-=1){var k=Sie(u,w,f),T=k.from,x=k.to;a.delete(T-1,x+1)}return n(a),!0}return!1}}},e.prototype.alignColumn=function(){return function(t){return t===void 0&&(t={align:"center"}),function(n,i){var a=t.align,o=n.selection,s=n.tr,l=st(o),u=l.anchor,c=l.head;if(u&&c){for(var f=he.create(u),d=f.totalRowCount,h=f.getRectOffsets(u,c),p=h.startColIdx,v=h.endColIdx,m=0;m<d;m+=1)for(var g=p;g<=v;g+=1)if(!f.extendedRowspan(m,g)&&!f.extendedColspan(m,g)){var w=f.getNodeAndPos(m,g),k=w.node,T=w.pos,x=rne(k,{align:a});s.setNodeMarkup(T,null,x)}return i(s),!0}return!1}}},e.prototype.moveToCell=function(t){return function(n,i){var a=n.selection,o=n.tr,s=n.schema,l=st(a),u=l.anchor,c=l.head;if(u&&c){var f=he.create(u),d=f.getCellIndex(u),h=void 0;if(gh(t,f,d)?h=xs(o,f,s):h=yh(t,o,d,f),h)return i(h),!0}return!1}},e.prototype.moveInCell=function(t){var n=this;return function(i,a){var o=i.selection,s=i.tr,l=i.doc,u=i.schema,c=o.$from,f=n.context.view;if(!f.endOfTextblock(t))return!1;var d=kt(c,function(k){var T=k.type;return T.name==="tableHeadCell"||T.name==="tableBodyCell"});if(d){var h=kt(c,function(k){var T=k.type;return T.name==="paragraph"}),p=d.depth;if(h&&yie(t,[p,h.depth],c,l)){var v=st(o).anchor,m=he.create(v),g=m.getCellIndex(v),w=void 0;if(xie(t,m,g)?w=Eie(s,c,p):gh(t,m,g)?t==="up"?w=bie(s,m,u):t==="down"&&(w=xs(s,m,u)):w=yh(t,s,g,m),w)return a(w),!0}}return!1}},e.prototype.deleteCells=function(){return function(t,n){var i=t.schema,a=t.selection,o=t.tr,s=st(a),l=s.anchor,u=s.head,c=a instanceof q;if(l&&u&&!c){for(var f=he.create(l),d=f.getRectOffsets(l,u),h=d.startRowIdx,p=d.startColIdx,v=d.endRowIdx,m=d.endColIdx,g=h;g<=v;g+=1)for(var w=p;w<=m;w+=1)if(!f.extendedRowspan(g,w)&&!f.extendedColspan(g,w)){var k=f.getNodeAndPos(g,w),T=k.node,x=k.pos,L=Xi(1,g,i,T.attrs);o.replaceWith(o.mapping.map(x),o.mapping.map(x+T.nodeSize),L)}return n(o),!0}return!1}},e.prototype.exitTable=function(){return function(t,n){var i=t.selection,a=t.tr,o=t.schema,s=i.$from,l=kt(s,function(d){var h=d.type;return h.name==="tableHeadCell"||h.name==="tableBodyCell"});if(l){var u=kt(s,function(d){var h=d.type;return h.name==="paragraph"});if(u){var c=st(i).anchor,f=he.create(c);return n(xs(a,f,o,!0)),!0}}return!1}},e.prototype.commands=function(){return{addTable:this.addTable(),removeTable:this.removeTable(),addColumnToLeft:this.addColumn("left"),addColumnToRight:this.addColumn("right"),removeColumn:this.removeColumn(),addRowToUp:this.addRow("up"),addRowToDown:this.addRow("down"),removeRow:this.removeRow(),alignColumn:this.alignColumn()}},e.prototype.keymaps=function(){var t=this.deleteCells();return{Tab:this.moveToCell("right"),"Shift-Tab":this.moveToCell("left"),ArrowUp:this.moveInCell("up"),ArrowDown:this.moveInCell("down"),ArrowLeft:this.moveInCell("left"),ArrowRight:this.moveInCell("right"),Backspace:t,"Mod-Backspace":t,Delete:t,"Mod-Delete":t,"Mod-Enter":this.exitTable()}},e})(W),Lie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"tableHead"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"tableRow{1}",attrs:b({rawHTML:{default:null}},ae()),parseDOM:[Ji("thead")],toDOM:function(t){var n=t.attrs;return["thead",Q(n),0]}}},enumerable:!1,configurable:!0}),e})(W),Nie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"tableBody"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"tableRow+",attrs:b({rawHTML:{default:null}},ae()),parseDOM:[{tag:"tbody",getAttrs:function(t){var n=t.querySelectorAll("tr"),i=n[0].children.length,a=t.getAttribute("data-raw-html");return i?b({},a&&{rawHTML:a}):!1}}],toDOM:function(t){var n=t.attrs;return["tbody",Q(n),0]}}},enumerable:!1,configurable:!0}),e})(W),Aie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"tableRow"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"(tableHeadCell | tableBodyCell)*",attrs:b({rawHTML:{default:null}},ae()),parseDOM:[{tag:"tr",getAttrs:function(t){var n=t.children.length,i=t.getAttribute("data-raw-html");return n?b({},i&&{rawHTML:i}):!1}}],toDOM:function(t){var n=t.attrs;return["tr",Q(n),0]}}},enumerable:!1,configurable:!0}),e})(W),Die=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"tableHeadCell"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"paragraph+",attrs:b({align:{default:null},className:{default:null},rawHTML:{default:null},colspan:{default:null},extended:{default:null}},ae()),isolating:!0,parseDOM:[Xd("th")],toDOM:function(t){var n=t.attrs,i=Jd(n);return["th",b(b({},i),Q(n)),0]}}},enumerable:!1,configurable:!0}),e})(W),Iie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"tableBodyCell"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"(paragraph | bulletList | orderedList)+",attrs:{align:{default:null},className:{default:null},rawHTML:{default:null},colspan:{default:null},rowspan:{default:null},extended:{default:null}},isolating:!0,parseDOM:[Xd("td")],toDOM:function(t){var n=t.attrs,i=Jd(n);return["td",i,0]}}},enumerable:!1,configurable:!0}),e})(W),Rie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"image"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{inline:!0,attrs:b({imageUrl:{default:""},altText:{default:null},rawHTML:{default:null}},ae()),group:"inline",selectable:!1,parseDOM:[{tag:"img[src]",getAttrs:function(t){var n=mr(t,{RETURN_DOM_FRAGMENT:!0}).firstChild,i=n.getAttribute("src")||"",a=n.getAttribute("data-raw-html"),o=n.getAttribute("alt");return b({imageUrl:i,altText:o},a&&{rawHTML:a})}}],toDOM:function(t){var n=t.attrs;return[n.rawHTML||"img",b(b({src:Dr(n.imageUrl)},n.altText&&{alt:n.altText}),Q(n))]}}},enumerable:!1,configurable:!0}),e.prototype.addImage=function(){return function(t){return function(n,i){var a=n.schema,o=n.tr,s=t,l=s.imageUrl,u=s.altText;if(!l)return!1;var c=a.nodes.image.createAndFill(b({imageUrl:l},u&&{altText:u}));return i(o.replaceSelectionWith(c).scrollIntoView()),!0}}},e.prototype.commands=function(){return{addImage:this.addImage()}},e})(W),bh=1,Bie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"thematicBreak"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{attrs:b({rawHTML:{default:null}},ae()),group:"block",parseDOM:[{tag:"hr"}],selectable:!1,toDOM:function(t){var n=t.attrs;return["div",Q(n),[n.rawHTML||"hr"]]}}},enumerable:!1,configurable:!0}),e.prototype.hr=function(){var t=this;return function(){return function(n,i){var a,o=n.selection,s=o.$from,l=o.$to;if(s===l){var u=n.doc,c=n.schema.nodes,f=c.thematicBreak,d=c.paragraph,h=[f.create()],p=s.node(bh),v=u.child(u.childCount-1)===p,m=u.resolve(s.after(bh)),g=((a=s.nodeAfter)===null||a===void 0?void 0:a.type.name)===t.name;return(v||g)&&h.push(d.create()),i(n.tr.insert(m.pos,h).scrollIntoView()),!0}return!1}}},e.prototype.commands=function(){return{hr:this.hr()}},e.prototype.keymaps=function(){var t=this.hr()();return{"Mod-l":t,"Mod-L":t}},e})(W),Pie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"strong"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){var t=["b","strong"].map(function(n){return{tag:n,getAttrs:function(i){var a=i.getAttribute("data-raw-html");return b({},a&&{rawHTML:a})}}});return{attrs:b({rawHTML:{default:null}},ae()),parseDOM:t,toDOM:function(n){var i=n.attrs;return[i.rawHTML||"strong",Q(i)]}}},enumerable:!1,configurable:!0}),e.prototype.bold=function(){return function(){return function(t,n){return kn(t.schema.marks.strong)(t,n)}}},e.prototype.commands=function(){return{bold:this.bold()}},e.prototype.keymaps=function(){var t=this.bold()();return{"Mod-b":t,"Mod-B":t}},e})(G),Hie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"emph"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){var t=["i","em"].map(function(n){return{tag:n,getAttrs:function(i){var a=i.getAttribute("data-raw-html");return b({},a&&{rawHTML:a})}}});return{attrs:b({rawHTML:{default:null}},ae()),parseDOM:t,toDOM:function(n){var i=n.attrs;return[i.rawHTML||"em",Q(i)]}}},enumerable:!1,configurable:!0}),e.prototype.italic=function(){return function(){return function(t,n){return kn(t.schema.marks.emph)(t,n)}}},e.prototype.commands=function(){return{italic:this.italic()}},e.prototype.keymaps=function(){var t=this.italic()();return{"Mod-i":t,"Mod-I":t}},e})(G),Fie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"strike"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){var t=["s","del"].map(function(n){return{tag:n,getAttrs:function(i){var a=i.getAttribute("data-raw-html");return b({},a&&{rawHTML:a})}}});return{attrs:b({rawHTML:{default:null}},ae()),parseDOM:t,toDOM:function(n){var i=n.attrs;return[i.rawHTML||"del",Q(i)]}}},enumerable:!1,configurable:!0}),e.prototype.commands=function(){return function(){return function(t,n){return kn(t.schema.marks.strike)(t,n)}}},e.prototype.keymaps=function(){var t=this.commands()();return{"Mod-s":t,"Mod-S":t}},e})(G),qie=(function(r){O(e,r);function e(t){var n=r.call(this)||this;return n.linkAttributes=t,n}return Object.defineProperty(e.prototype,"name",{get:function(){return"link"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){var t=this;return{attrs:b({linkUrl:{default:""},title:{default:null},rawHTML:{default:null}},ae()),inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:function(n){var i=mr(n,{RETURN_DOM_FRAGMENT:!0}).firstChild,a=i.getAttribute("href")||"",o=i.getAttribute("title")||"",s=i.getAttribute("data-raw-html");return b({linkUrl:a,title:o},s&&{rawHTML:s})}}],toDOM:function(n){var i=n.attrs;return[i.rawHTML||"a",b(b({href:Dr(i.linkUrl)},t.linkAttributes),Q(i))]}}},enumerable:!1,configurable:!0}),e.prototype.addLink=function(){return function(t){return function(n,i){var a=t,o=a.linkUrl,s=a.linkText,l=s===void 0?"":s,u=n.schema,c=n.tr,f=n.selection,d=f.empty,h=f.from,p=f.to;if(h&&p&&o){var v={linkUrl:o},m=u.mark("link",v);if(d&&l){var g=fe(u,l,m);c.replaceRangeWith(h,p,g)}else c.addMark(h,p,m);return i(c.scrollIntoView()),!0}return!1}}},e.prototype.toggleLink=function(){return function(t){return function(n,i){return kn(n.schema.marks.link,t)(n,i)}}},e.prototype.commands=function(){return{addLink:this.addLink(),toggleLink:this.toggleLink()}},e})(G),_ie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"code"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{attrs:b({rawHTML:{default:null}},ae()),parseDOM:[{tag:"code",getAttrs:function(t){var n=t.getAttribute("data-raw-html");return b({},n&&{rawHTML:n})}}],toDOM:function(t){var n=t.attrs;return[n.rawHTML||"code",Q(n)]}}},enumerable:!1,configurable:!0}),e.prototype.commands=function(){return function(){return function(t,n){return kn(t.schema.marks.code)(t,n)}}},e.prototype.keymaps=function(){var t=this.commands()();return{"Shift-Mod-c":t,"Shift-Mod-C":t}},e})(G),$ie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"customBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"text*",group:"block",attrs:{info:{default:null}},atom:!0,code:!0,defining:!0,parseDOM:[{tag:"div[data-custom-info]",getAttrs:function(t){var n=t.getAttribute("data-custom-info");return{info:n}}}],toDOM:function(t){var n=t.attrs;return["div",{"data-custom-info":n.info||null},0]}}},enumerable:!1,configurable:!0}),e.prototype.commands=function(){return function(t){return function(n,i){return t!=null&&t.info?ro(n.schema.nodes.customBlock,t)(n,i):!1}}},e})(W),zie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"frontMatter"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"text*",group:"block",code:!0,defining:!0,parseDOM:[{preserveWhitespace:"full",tag:"div[data-front-matter]"}],toDOM:function(){return["div",{"data-front-matter":"true"},0]}}},enumerable:!1,configurable:!0}),e.prototype.commands=function(){return function(){return function(t,n,i){var a=t.selection.$from;return i.endOfTextblock("down")&&a.node().type.name==="frontMatter"?to(t,n):!1}}},e.prototype.keymaps=function(){return{Enter:this.commands()()}},e})(W),Vie=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"htmlComment"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return{content:"text*",group:"block",code:!0,defining:!0,parseDOM:[{preserveWhitespace:"full",tag:"div[data-html-comment]"}],toDOM:function(){return["div",{"data-html-comment":"true"},0]}}},enumerable:!1,configurable:!0}),e.prototype.commands=function(){return function(){return function(t,n,i){var a=t.selection.$from;return i.endOfTextblock("down")&&a.node().type.name==="htmlComment"?to(t,n):!1}}},e.prototype.keymaps=function(){return{Enter:this.commands()()}},e})(W);function Uie(r){return new nf([new nie,new iie,new oie,new sie,new lie,new uie,new cie,new fie,new die,new Oie,new Lie,new Nie,new Aie,new Die,new Iie,new Rie,new Bie,new Pie,new Hie,new Fie,new qie(r),new _ie,new $ie,new zie,new tf,new Vie])}var Wie=N("contents"),jie=(function(r){O(e,r);function e(t,n){var i=r.call(this,t)||this,a=n.toDOMAdaptor,o=n.htmlSchemaMap,s=o===void 0?{}:o,l=n.linkAttributes,u=l===void 0?{}:l,c=n.useCommandShortcut,f=c===void 0?!0:c,d=n.wwPlugins,h=d===void 0?[]:d,p=n.wwNodeViews,v=p===void 0?{}:p;return i.editorType="wysiwyg",i.el.classList.add("ww-mode"),i.toDOMAdaptor=a,i.linkAttributes=u,i.extraPlugins=h,i.pluginNodeViews=v,i.specs=i.createSpecs(),i.schema=i.createSchema(s),i.context=i.createContext(),i.keymaps=i.createKeymaps(f),i.view=i.createView(),i.commands=i.createCommands(),i.specs.setContext(b(b({},i.context),{view:i.view})),i.initEvent(),i}return e.prototype.createSpecs=function(){return Uie(this.linkAttributes)},e.prototype.createContext=function(){return{schema:this.schema,eventEmitter:this.eventEmitter}},e.prototype.createSchema=function(t){return new vl({nodes:b(b({},this.specs.nodes),t.nodes),marks:b(b({},this.specs.marks),t.marks)})},e.prototype.createPlugins=function(){return Re([sne(),fne(this.eventEmitter),dne(),bne(this.eventEmitter)],this.createPluginProps()).concat(this.defaultPlugins)},e.prototype.createPluginNodeViews=function(){var t=this,n=t.eventEmitter,i=t.pluginNodeViews,a={};return i&&Object.keys(i).forEach(function(o){a[o]=function(s,l,u){return i[o](s,l,u,n)}}),a},e.prototype.createView=function(){var t=this,n=this,i=n.toDOMAdaptor,a=n.eventEmitter;return new ai(this.el,{state:this.createState(),attributes:{class:Wie},nodeViews:b({customBlock:function(o,s,l){return new wne(o,s,l,i)},image:function(o,s,l){return new kne(o,s,l,a)},codeBlock:function(o,s,l){return new xne(o,s,l,a)},widget:ef},this.createPluginNodeViews()),dispatchTransaction:function(o){var s=t.view.state.applyTransaction(o).state;t.view.updateState(s),t.emitChangeEvent(o.scrollIntoView()),t.eventEmitter.emit("setFocusedNode",s.selection.$from.node(1))},transformPastedHTML:_ne,transformPasted:function(o){return Wne(o,t.schema,Ki(t.view.state.selection.$from))},handlePaste:function(o,s,l){return eie(o,l)},handleKeyDown:function(o,s){return t.eventEmitter.emit("keydown",t.editorType,s),!1},handleDOMEvents:{paste:function(o,s){var l=s.clipboardData||window.clipboardData,u=l==null?void 0:l.items;if(u){var c=it(u).some(function(d){return d.kind==="string"&&d.type==="text/rtf"});if(!c){var f=Zc(u);f&&(s.preventDefault(),Mo(t.eventEmitter,f,s.type))}}return!1},keyup:function(o,s){return t.eventEmitter.emit("keyup",t.editorType,s),!1},scroll:function(){return t.eventEmitter.emit("scroll","editor"),!0}}})},e.prototype.createCommands=function(){return this.specs.commands(this.view,ws())},e.prototype.getHTML=function(){return Eo(this.view.dom.innerHTML)},e.prototype.getModel=function(){return this.view.state.doc},e.prototype.getSelection=function(){var t=this.view.state.selection,n=t.from,i=t.to;return[n,i]},e.prototype.getSchema=function(){return this.view.state.schema},e.prototype.replaceSelection=function(t,n,i){var a=this.view.state,o=a.schema,s=a.tr,l=t.split(`
`),u=l.map(function(d){return vi(o,sr(d,o))}),c=new S(C.from(u),1,1),f=vt(n)&&vt(i)?s.replaceRange(n,i,c):s.replaceSelection(c);this.view.dispatch(f),this.focus()},e.prototype.deleteSelection=function(t,n){var i=this.view.state.tr,a=vt(t)&&vt(n)?i.deleteRange(t,n):i.deleteSelection();this.view.dispatch(a.scrollIntoView())},e.prototype.getSelectedText=function(t,n){var i=this.view.state,a=i.doc,o=i.selection,s=o.from,l=o.to;return vt(t)&&vt(n)&&(s=t,l=n),a.textBetween(s,l,`
`)},e.prototype.setModel=function(t,n){n===void 0&&(n=!1);var i=this.view.state,a=i.tr,o=i.doc;this.view.dispatch(a.replaceWith(0,o.content.size,t)),n&&this.moveCursorToEnd(!0)},e.prototype.setSelection=function(t,n){n===void 0&&(n=t);var i=this.view.state.tr,a=j(i,t,n);this.view.dispatch(i.setSelection(a).scrollIntoView())},e.prototype.addWidget=function(t,n,i){var a=this.view,o=a.dispatch,s=a.state;o(s.tr.setMeta("widget",{pos:i??s.selection.to,node:t,style:n}))},e.prototype.replaceWithWidget=function(t,n,i){var a=this.view.state,o=a.tr,s=a.schema,l=sr(i,s);this.view.dispatch(o.replaceWith(t,n,l))},e.prototype.getRangeInfoOfNode=function(t){var n=this.view.state,i=n.doc,a=n.selection,o=t?i.resolve(t):a.$from,s=o.marks(),l=o.node(),u=o.start(),c=o.end(),f=l.type.name;if(s.length||f==="paragraph"){var d=s[s.length-1],h=function(p){return p.length?ce(p,d):!0};f=d?d.type.name:"text",l.forEach(function(p,v){var m=p.isText,g=p.nodeSize,w=p.marks,k=o.pos-u;m&&v<=k&&v+g>=k&&h(w)&&(u=u+v,c=u+g)})}return{range:[u,c],type:f}},e})(rf),Gie=je,Kie=fi;function Jie(r){return!Gie(r)&&!Kie(r)}var Xie=Jie,Yie=Xie;function Qie(r){return Yie(r)&&r!==!1}var Zie=Qie,eae=Zie;function tae(r){return!eae(r)}var rae=tae,wh=["afterPreviewRender","updatePreview","changeMode","needChangeMode","command","changePreviewStyle","changePreviewTabPreview","changePreviewTabWrite","scroll","contextmenu","show","hide","changeLanguage","changeToolbarState","toggleScrollSync","mixinTableOffsetMapPrototype","setFocusedNode","removePopupWidget","query","openPopup","closePopup","addImageBlobHook","beforePreviewRender","beforeConvertWysiwygToMarkdown","load","loadUI","change","caretChange","destroy","focus","blur","keydown","keyup"],kh=(function(){function r(){var e=this;this.events=new ah,this.eventTypes=wh.reduce(function(t,n){return b(b({},t),{type:n})},{}),this.hold=!1,wh.forEach(function(t){e.addEventType(t)})}return r.prototype.listen=function(e,t){var n=this.getTypeInfo(e),i=this.events.get(n.type)||[];if(!this.hasEventType(n.type))throw new Error("There is no event type "+n.type);n.namespace&&(t.namespace=n.namespace),i.push(t),this.events.set(n.type,i)},r.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=this.getTypeInfo(e),a=this.events.get(i.type),o=[];return!this.hold&&a&&a.forEach(function(s){var l=s.apply(void 0,t);je(l)||o.push(l)}),o},r.prototype.emitReduce=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];var a=this.events.get(e);return!this.hold&&a&&a.forEach(function(o){var s=o.apply(void 0,Re([t],n));rae(s)||(t=s)}),t},r.prototype.getTypeInfo=function(e){var t=e.split(".");return{type:t[0],namespace:t[1]}},r.prototype.hasEventType=function(e){return!je(this.eventTypes[this.getTypeInfo(e).type])},r.prototype.addEventType=function(e){if(this.hasEventType(e))throw new Error("There is already have event type "+e);this.eventTypes[e]=e},r.prototype.removeEventHandler=function(e,t){var n=this,i=this.getTypeInfo(e),a=i.type,o=i.namespace;a&&t?this.removeEventHandlerWithHandler(a,t):a&&!o?this.events.delete(a):!a&&o?this.events.forEach(function(s,l){n.removeEventHandlerWithTypeInfo(l,o)}):a&&o&&this.removeEventHandlerWithTypeInfo(a,o)},r.prototype.removeEventHandlerWithHandler=function(e,t){var n=this.events.get(e);if(n){var i=n.indexOf(t);n.indexOf(t)>=0&&n.splice(i,1)}},r.prototype.removeEventHandlerWithTypeInfo=function(e,t){var n=[],i=this.events.get(e);i&&(i.map(function(a){return a.namespace!==t&&n.push(a),null}),this.events.set(e,n))},r.prototype.getEvents=function(){return this.events},r.prototype.holdEventInvoke=function(e){this.hold=!0,e(),this.hold=!1},r})(),nae=(function(){function r(e,t,n,i){this.eventEmitter=e,this.mdCommands=t,this.wwCommands=n,this.getEditorType=i,this.initEvent()}return r.prototype.initEvent=function(){var e=this;this.eventEmitter.listen("command",function(t,n){e.exec(t,n)})},r.prototype.addCommand=function(e,t,n){e==="markdown"?this.mdCommands[t]=n:this.wwCommands[t]=n},r.prototype.deleteCommand=function(e,t){e==="markdown"?delete this.mdCommands[t]:delete this.wwCommands[t]},r.prototype.exec=function(e,t){var n=this.getEditorType();n==="markdown"?this.mdCommands[e](t):this.wwCommands[e](t)},r})();function Qi(r){return r[r.length-1]===`
`?r.slice(0,r.length-1):r}function Es(r,e){var t=r.schema,n=e.literal,i=n.match(Rr);if(i){var a=i[1],o=i[3],s=(a||o).toLowerCase();return e.type==="htmlInline"&&!!(t.marks[s]||t.nodes[s])}return!1}function Ms(r){var e=r.type;return ce(["text","strong","emph","strike","image","link","code"],e)}function Ch(r){return(r==null?void 0:r.type)==="softbreak"}function An(r){var e=r.type,t=r.literal,n=e==="htmlInline"&&t.match(Rr);if(n){var i=n[1],a=n[3],o=i||a;if(o)return ce(["ul","ol","li"],o.toLowerCase())}return!1}function iae(r){var e=r.literal,t=/data-task/.test(e),n=/data-task-checked/.test(e);return{task:t,checked:n}}function Th(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];var n=document.createElement("div");n.innerHTML=mr(r);var i=n.firstChild;return e.map(function(a){return i.getAttribute(a)||""})}function aae(r){var e={};return Object.keys(r).forEach(function(t){var n=t.split(", ");n.forEach(function(i){var a=i.toLowerCase();e[a]=r[t]})}),e}var oae={"b, strong":function(r,e,t){var n=r.schema.marks.strong;t?r.openMark(n.create({rawHTML:t})):r.closeMark(n)},"i, em":function(r,e,t){var n=r.schema.marks.emph;t?r.openMark(n.create({rawHTML:t})):r.closeMark(n)},"s, del":function(r,e,t){var n=r.schema.marks.strike;t?r.openMark(n.create({rawHTML:t})):r.closeMark(n)},code:function(r,e,t){var n=r.schema.marks.code;t?r.openMark(n.create({rawHTML:t})):r.closeMark(n)},a:function(r,e,t){var n=e.literal,i=r.schema.marks.link;if(t){var a=Th(n,"href")[0];r.openMark(i.create({linkUrl:a,rawHTML:t}))}else r.closeMark(i)},img:function(r,e,t){var n=e.literal;if(t){var i=Th(n,"src","alt"),a=i[0],o=i[1],s=r.schema.nodes.image;r.addNode(s,b({rawHTML:t,imageUrl:a},o&&{altText:o}))}},hr:function(r,e,t){r.addNode(r.schema.nodes.thematicBreak,{rawHTML:t})},br:function(r,e){var t=r.schema.nodes.paragraph,n=e.parent,i=e.prev,a=e.next;(n==null?void 0:n.type)==="paragraph"?(Ch(i)&&r.openNode(t),Ch(a)?r.closeNode():a&&(r.closeNode(),r.openNode(t))):(n==null?void 0:n.type)==="tableCell"&&(i&&(Ms(i)||Es(r,i))&&r.closeNode(),a&&(Ms(a)||Es(r,a))&&r.openNode(t))},pre:function(r,e,t){var n,i,a=document.createElement("div");a.innerHTML=e.literal;var o=(i=(n=a.firstChild)===null||n===void 0?void 0:n.firstChild)===null||i===void 0?void 0:i.textContent;r.openNode(r.schema.nodes.codeBlock,{rawHTML:t}),r.addText(Qi(o)),r.closeNode()},"ul, ol":function(r,e,t){if(e.parent.type==="tableCell"){var n=r.schema.nodes,i=n.bulletList,a=n.orderedList,o=n.paragraph,s=t==="ul"?i:a;t?(e.prev&&!An(e.prev)&&r.closeNode(),r.openNode(s,{rawHTML:t})):(r.closeNode(),e.next&&!An(e.next)&&r.openNode(o))}},li:function(r,e,t){var n;if(((n=e.parent)===null||n===void 0?void 0:n.type)==="tableCell"){var i=r.schema.nodes,a=i.listItem,o=i.paragraph;if(t){var s=iae(e);e.prev&&!An(e.prev)&&r.closeNode(),r.openNode(a,b({rawHTML:t},s)),e.next&&!An(e.next)&&r.openNode(o)}else e.prev&&!An(e.prev)&&r.closeNode(),r.closeNode()}}},sae=aae(oae);function xh(r){return r.type==="htmlInline"&&wo.test(r.literal)}function Eh(r){it(r.childNodes).forEach(function(e){if(ki(e)){var t=e.nodeName.toLowerCase();e.setAttribute("data-raw-html",t),e.childNodes&&Eh(e)}})}var Mh={text:function(r,e){r.addText(e.literal||"")},paragraph:function(r,e,t,n){var i,a=t.entering;if(a){var o=r.schema.nodes.paragraph;((i=e.prev)===null||i===void 0?void 0:i.type)==="paragraph"&&(r.openNode(o,n),r.closeNode()),r.openNode(o,n)}else r.closeNode()},heading:function(r,e,t,n){var i=t.entering;if(i){var a=e,o=a.level,s=a.headingType;r.openNode(r.schema.nodes.heading,b({level:o,headingType:s},n))}else r.closeNode()},codeBlock:function(r,e,t){var n=r.schema.nodes.codeBlock,i=e,a=i.info,o=i.literal;r.openNode(n,b({language:a},t)),r.addText(Qi(o||"")),r.closeNode()},list:function(r,e,t,n){var i=t.entering;if(i){var a=r.schema.nodes,o=a.bulletList,s=a.orderedList,l=e.listData,u=l.type,c=l.start;u==="bullet"?r.openNode(o,n):r.openNode(s,b({order:c},n))}else r.closeNode()},item:function(r,e,t,n){var i=t.entering,a=r.schema.nodes.listItem,o=e.listData,s=o.task,l=o.checked;if(i){var u=b(b(b({},s&&{task:s}),l&&{checked:l}),n);r.openNode(a,u)}else r.closeNode()},blockQuote:function(r,e,t,n){var i=t.entering;i?r.openNode(r.schema.nodes.blockQuote,n):r.closeNode()},image:function(r,e,t,n){var i=t.entering,a=t.skipChildren,o=r.schema.nodes.image,s=e,l=s.destination,u=s.firstChild;i&&a&&a(),r.addNode(o,b(b({imageUrl:l},u&&{altText:u.literal}),n))},thematicBreak:function(r,e,t,n){r.addNode(r.schema.nodes.thematicBreak,n)},strong:function(r,e,t,n){var i=t.entering,a=r.schema.marks.strong;i?r.openMark(a.create(n)):r.closeMark(a)},emph:function(r,e,t,n){var i=t.entering,a=r.schema.marks.emph;i?r.openMark(a.create(n)):r.closeMark(a)},link:function(r,e,t,n){var i=t.entering,a=r.schema.marks.link,o=e,s=o.destination,l=o.title;if(i){var u=b({linkUrl:s,title:l},n);r.openMark(a.create(u))}else r.closeMark(a)},softbreak:function(r,e){if(e.parent.type==="paragraph"){var t=e.prev,n=e.next;t&&!xh(t)&&r.closeNode(),n&&!xh(n)&&r.openNode(r.schema.nodes.paragraph)}},table:function(r,e,t,n){var i=t.entering;i?r.openNode(r.schema.nodes.table,n):r.closeNode()},tableHead:function(r,e,t,n){var i=t.entering;i?r.openNode(r.schema.nodes.tableHead,n):r.closeNode()},tableBody:function(r,e,t,n){var i=t.entering;i?r.openNode(r.schema.nodes.tableBody,n):r.closeNode()},tableRow:function(r,e,t,n){var i=t.entering;i?r.openNode(r.schema.nodes.tableRow,n):r.closeNode()},tableCell:function(r,e,t){var n=t.entering;if(!e.ignored){var i=function(p){return p&&(Ms(p)||Es(r,p))};if(n){var a=r.schema.nodes,o=a.tableHeadCell,s=a.tableBodyCell,l=a.paragraph,u=e.parent.parent,c=u.type==="tableHead"?o:s,f=u.parent,d=(f.columns[e.startIdx]||{}).align,h=b({},e.attrs);d&&(h.align=d),r.openNode(c,h),i(e.firstChild)&&r.openNode(l)}else i(e.lastChild)&&r.closeNode(),r.closeNode()}},strike:function(r,e,t,n){var i=t.entering,a=r.schema.marks.strike;i?r.openMark(a.create(n)):r.closeMark(a)},code:function(r,e,t,n){var i=r.schema.marks.code;r.openMark(i.create(n)),r.addText(Qi(e.literal||"")),r.closeMark(i)},customBlock:function(r,e){var t=r.schema.nodes,n=t.customBlock,i=t.paragraph,a=e,o=a.info,s=a.literal;r.openNode(n,{info:o}),r.addText(Qi(s||"")),r.closeNode(),e.next||(r.openNode(i),r.closeNode())},frontMatter:function(r,e){r.openNode(r.schema.nodes.frontMatter),r.addText(e.literal),r.closeNode()},htmlInline:function(r,e){var t=e.literal,n=t.match(Rr),i=n[1],a=n[3],o=(i||a).toLowerCase(),s=r.schema.marks[o],l=mr(t);if(s!=null&&s.spec.attrs.htmlInline)if(i){var u=ps(l);r.openMark(s.create({htmlAttrs:u}))}else r.closeMark(s);else{var c=sae[o];c&&c(r,e,i)}},htmlBlock:function(r,e){var t=e.literal,n=document.createElement("div"),i=Ub.test(t);if(i)r.openNode(r.schema.nodes.htmlComment),r.addText(e.literal),r.closeNode();else{var a=t.match(Rr),o=a[1],s=a[3],l=(o||s).toLowerCase(),u=r.schema.nodes[l],c=mr(t);if(u!=null&&u.spec.attrs.htmlBlock){var f=ps(c),d=Ud(e,l);r.addNode(u,{htmlAttrs:f,childrenHTML:d})}else n.innerHTML=c,Eh(n),r.convertByDOMParser(n)}},customInline:function(r,e,t){var n=t.entering,i=t.skipChildren,a=e,o=a.info,s=a.firstChild,l=r.schema;if(o.indexOf("widget")!==-1&&n){var u=_c(e);i(),r.addNode(l.nodes.widget,{info:o},[l.text(Fc(o,u))])}else{var c="$$";n&&(c+=s?o+" ":o),r.addText(c)}}};function lae(r){var e=Object.keys(r),t=b({},Mh),n=new ls({gfm:!0,nodeId:!0,convertors:r}),i=n.getConvertors();return e.forEach(function(a){var o=Mh[a];o&&!ce(["htmlBlock","htmlInline"],a)&&(t[a]=function(s,l,u){u.origin=function(){return i[a](l,u,i)};var c=r[a](l,u),f;if(c){var d=Array.isArray(c)?c[0]:c,h=d.attributes,p=d.classNames;f={htmlAttrs:h,classNames:p}}o(s,l,u,f)})}),t}function uae(r,e){return r.isText&&e.isText&&z.sameSet(r.marks,e.marks)?r.withText(r.text+e.text):!1}var cae=(function(){function r(e,t){this.schema=e,this.convertors=t,this.stack=[{type:this.schema.topNodeType,attrs:null,content:[]}],this.marks=z.none}return r.prototype.top=function(){return be(this.stack)},r.prototype.push=function(e){this.stack.length&&this.top().content.push(e)},r.prototype.addText=function(e){if(e){var t=this.top().content,n=be(t),i=this.schema.text(e,this.marks),a=n&&uae(n,i);a?t[t.length-1]=a:t.push(i)}},r.prototype.openMark=function(e){this.marks=e.addToSet(this.marks)},r.prototype.closeMark=function(e){this.marks=e.removeFromSet(this.marks)},r.prototype.addNode=function(e,t,n){var i=e.createAndFill(t,n,this.marks);return i?(this.push(i),i):null},r.prototype.openNode=function(e,t){this.stack.push({type:e,attrs:t,content:[]})},r.prototype.closeNode=function(){this.marks.length&&(this.marks=z.none);var e=this.stack.pop(),t=e.type,n=e.attrs,i=e.content;return this.addNode(t,n,i)},r.prototype.convertByDOMParser=function(e){var t=this,n=Jt.fromSchema(this.schema).parse(e);n.content.forEach(function(i){return t.push(i)})},r.prototype.closeUnmatchedHTMLInline=function(e,t){var n;if(!t&&e.type!=="htmlInline")for(var i=this.stack.length-1,a=i;a>=0;a-=1){var o=this.stack[a];if(!((n=o.attrs)===null||n===void 0)&&n.rawHTML)o.content.length?this.closeNode():this.stack.pop();else break}},r.prototype.convert=function(e,t){for(var n=e.walker(),i=n.next(),a=function(){var s=i.node,l=i.entering,u=o.convertors[s.type],c=!1;if(u){var f={entering:l,leaf:!xb(s),getChildrenText:Eb,options:{gfm:!0,nodeId:!1,tagFilter:!1,softbreak:`
`},skipChildren:function(){c=!0}};if(o.closeUnmatchedHTMLInline(s,l),u(o,s,f),(t==null?void 0:t.node)===s){var d=o.stack.reduce(function(h,p){return h+p.content.reduce(function(v,m){return v+m.nodeSize},0)},0)+1;t.setMappedPos(d)}}c&&(n.resumeAt(s,!1),n.next()),i=n.next()},o=this;i;)a()},r.prototype.convertNode=function(e,t){return this.convert(e,t),this.stack.length?this.closeNode():null},r})();function fae(r,e,t){var n=t[0],i=t[1];r.write(n),r.convertInline(e),r.write(i)}function dae(r,e,t){var n=e.node,i=e.parent,a=t[0],o=t[1];r.stopNewline=!0,r.write(a),r.convertNode(n),r.write(o),(i==null?void 0:i.type.name)==="doc"&&(r.closeBlock(n),r.stopNewline=!1)}function hae(r,e){var t=r.length,n="",i="";return e==="left"?(n=":",t-=1):e==="right"?(i=":",t-=1):e==="center"&&(n=":",i=":",t-=2),""+n+di("-",Math.max(t,3))+i}var Ss={text:function(r,e){var t,n=e.node,i=(t=n.text)!==null&&t!==void 0?t:"";(n.marks||[]).some(function(a){return a.type.name==="link"})?r.text(hi(i),!1):r.text(i)},paragraph:function(r,e){var t=e.node,n=e.parent,i=e.index,a=i===void 0?0:i;if(r.stopNewline)r.convertInline(t);else{var o=a===0,s=!o&&n.child(a-1),l=s&&s.childCount===0,u=a<n.childCount-1&&n.child(a+1),c=u&&u.type.name==="paragraph",f=t.childCount===0;if(f&&l)r.write(`<br>
`);else if(f&&!l&&!o){if((n==null?void 0:n.type.name)==="listItem"){var d=r.getDelim();r.setDelim(""),r.write("<br>"),r.setDelim(d)}r.write(`
`)}else r.convertInline(t),c?r.write(`
`):r.closeBlock(t)}},heading:function(r,e,t){var n=e.node,i=t.delim,a=n.attrs.headingType;a==="atx"?(r.write(i+" "),r.convertInline(n),r.closeBlock(n)):(r.convertInline(n),r.ensureNewLine(),r.write(i),r.closeBlock(n))},codeBlock:function(r,e,t){var n=e.node,i=t.delim,a=t.text,o=i,s=o[0],l=o[1];r.write(s),r.ensureNewLine(),r.text(a,!1),r.ensureNewLine(),r.write(l),r.closeBlock(n)},blockQuote:function(r,e,t){var n=e.node,i=e.parent,a=t.delim;(i==null?void 0:i.type.name)===n.type.name&&r.flushClose(1),r.wrapBlock(a,null,n,function(){return r.convertNode(n)})},bulletList:function(r,e,t){var n=e.node,i=t.delim;r.convertList(n,di(" ",4),function(){return i+" "})},orderedList:function(r,e){var t=e.node,n=t.attrs.order||1;r.convertList(t,di(" ",4),function(i){var a=String(n+i);return a+". "})},listItem:function(r,e){var t=e.node,n=t.attrs,i=n.task,a=n.checked;i&&r.write("["+(a?"x":" ")+"] "),r.convertNode(t)},image:function(r,e,t){var n=t.attrs;r.write("!["+(n==null?void 0:n.altText)+"]("+(n==null?void 0:n.imageUrl)+")")},thematicBreak:function(r,e,t){var n=e.node,i=t.delim;r.write(i),r.closeBlock(n)},table:function(r,e){var t=e.node;r.convertNode(t),r.closeBlock(t)},tableHead:function(r,e,t){var n=e.node,i=t.delim,a=n.firstChild;r.convertNode(n);var o=i??"";!i&&a&&a.forEach(function(s){var l=s.textContent,u=s.attrs,c=hae(l,u.align);o+="| "+c+" "}),r.write(o+"|"),r.ensureNewLine()},tableBody:function(r,e){var t=e.node;r.convertNode(t)},tableRow:function(r,e){var t=e.node;r.convertNode(t),r.write("|"),r.ensureNewLine()},tableHeadCell:function(r,e,t){var n=e.node,i=t.delim,a=i===void 0?"| ":i;r.write(a),r.convertTableCell(n),r.write(" ")},tableBodyCell:function(r,e,t){var n=e.node,i=t.delim,a=i===void 0?"| ":i;r.write(a),r.convertTableCell(n),r.write(" ")},customBlock:function(r,e,t){var n=e.node,i=t.delim,a=t.text,o=i,s=o[0],l=o[1];r.write(s),r.ensureNewLine(),r.text(a,!1),r.ensureNewLine(),r.write(l),r.closeBlock(n)},frontMatter:function(r,e,t){var n=e.node,i=t.text;r.text(i,!1),r.closeBlock(n)},widget:function(r,e,t){var n=t.text;r.write(n)},html:function(r,e,t){var n=e.node,i=t.text;r.write(i),n.attrs.htmlBlock&&r.closeBlock(n)},htmlComment:function(r,e,t){var n=e.node,i=t.text;r.write(i),r.closeBlock(n)}};function pae(r,e){var t=e.state,n=e.nodeInfo,i=e.params,a=i.rawHTML;a?ar(r,["heading","codeBlock"])>-1?fae(t,n.node,a):ar(r,["image","thematicBreak"])>-1?t.write(a):dae(t,n,a):Ss[r](t,n,i)}function Sh(r,e){var t=r.text,n=/`+/g,i=0;if(r.isText&&t)for(var a=n.exec(t);a;)i=Math.max(i,a[0].length),a=n.exec(t);for(var o=i>0&&e>0?" `":"`",s=0;s<i;s+=1)o+="`";return i>0&&e<0&&(o+=" "),o}function Xe(r){return r?["<"+r+">","</"+r+">"]:null}function Dn(r){return r?"<"+r+">":null}function In(r){return r?"</"+r+">":null}var Rn={heading:function(r){var e=r.node,t=e.attrs,n=t.level,i=di("#",n);return t.headingType==="setext"&&(i=n===1?"===":"---"),{delim:i,rawHTML:Xe(t.rawHTML)}},codeBlock:function(r){var e=r.node,t=e,n=t.attrs,i=t.textContent;return{delim:["```"+(n.language||""),"```"],rawHTML:Xe(n.rawHTML),text:i}},blockQuote:function(r){var e=r.node;return{delim:"> ",rawHTML:Xe(e.attrs.rawHTML)}},bulletList:function(r,e){var t=r.node,n=e.inTable,i=t.attrs.rawHTML;return n&&(i=i||"ul"),{delim:"*",rawHTML:Xe(i)}},orderedList:function(r,e){var t=r.node,n=e.inTable,i=t.attrs.rawHTML;return n&&(i=i||"ol"),{rawHTML:Xe(i)}},listItem:function(r,e){var t=r.node,n=e.inTable,i=t.attrs,a=i.task,o=i.checked,s=t.attrs.rawHTML;n&&(s=s||"li");var l=a?' class="task-list-item'+(o?" checked":"")+'"':"",u=a?" data-task"+(o?" data-task-checked":""):"";return{rawHTML:s?["<"+s+l+u+">","</"+s+">"]:null}},table:function(r){var e=r.node;return{rawHTML:Xe(e.attrs.rawHTML)}},tableHead:function(r){var e=r.node;return{rawHTML:Xe(e.attrs.rawHTML)}},tableBody:function(r){var e=r.node;return{rawHTML:Xe(e.attrs.rawHTML)}},tableRow:function(r){var e=r.node;return{rawHTML:Xe(e.attrs.rawHTML)}},tableHeadCell:function(r){var e=r.node;return{rawHTML:Xe(e.attrs.rawHTML)}},tableBodyCell:function(r){var e=r.node;return{rawHTML:Xe(e.attrs.rawHTML)}},image:function(r){var e=r.node,t=e.attrs,n=t.rawHTML,i=t.altText,a=t.imageUrl.replace(/&amp;/g,"&"),o=i?' alt="'+Dr(i)+'"':"";return{rawHTML:n?"<"+n+' src="'+Dr(a)+'"'+o+">":null,attrs:{altText:hi(i||""),imageUrl:a}}},thematicBreak:function(r){var e=r.node;return{delim:"***",rawHTML:Dn(e.attrs.rawHTML)}},customBlock:function(r){var e=r.node,t=e,n=t.attrs,i=t.textContent;return{delim:["$$"+n.info,"$$"],text:i}},frontMatter:function(r){var e=r.node;return{text:e.textContent}},widget:function(r){var e=r.node;return{text:e.textContent}},strong:function(r,e){var t=r.node,n=e.entering,i=t.attrs.rawHTML;return{delim:"**",rawHTML:n?Dn(i):In(i)}},emph:function(r,e){var t=r.node,n=e.entering,i=t.attrs.rawHTML;return{delim:"*",rawHTML:n?Dn(i):In(i)}},strike:function(r,e){var t=r.node,n=e.entering,i=t.attrs.rawHTML;return{delim:"~~",rawHTML:n?Dn(i):In(i)}},link:function(r,e){var t=r.node,n=e.entering,i=t.attrs,a=i.title,o=i.rawHTML,s=i.linkUrl.replace(/&amp;/g,"&"),l=a?' title="'+Dr(a)+'"':"";return n?{delim:"[",rawHTML:o?"<"+o+' href="'+Dr(s)+'"'+l+">":null}:{delim:"]("+s+(a?" "+hb(hi(a)):"")+")",rawHTML:In(o)}},code:function(r,e){var t=r.node,n=r.parent,i=r.index,a=i===void 0?0:i,o=e.entering,s=o?Sh(n.child(a),-1):Sh(n.child(a-1),1),l=o?Dn(t.attrs.rawHTML):In(t.attrs.rawHTML);return{delim:s,rawHTML:l}},htmlComment:function(r){var e=r.node;return{text:e.textContent}},html:function(r,e){var t=r.node,n=e.entering,i=t.type.name,a=t.attrs.htmlAttrs,o="<"+i,s="</"+i+">";return Object.keys(a).forEach(function(l){o+=" "+l+'="'+a[l].replace(/"/g,"'")+'"'}),o+=">",t.attrs.htmlInline?{rawHTML:n?o:s}:{text:""+o+t.attrs.childrenHTML+s}}},Oh={strong:{mixable:!0,removedEnclosingWhitespace:!0},emph:{mixable:!0,removedEnclosingWhitespace:!0},strike:{mixable:!0,removedEnclosingWhitespace:!0},code:{escape:!1},link:null,html:null};function vae(r){var e={},t=Object.keys(Ss);return t.forEach(function(n){e[n]=function(i,a){var o=Ss[n];if(o){var s=r[n],l=s?s(a,{inTable:i.inTable}):{};pae(n,{state:i,nodeInfo:a,params:l})}}}),e}function mae(r){var e={},t=Object.keys(Oh);return t.forEach(function(n){e[n]=function(i,a){var o=Oh[n],s=r[n],l=s&&i&&!je(a),u=l?s(i,{entering:a}):{};return b(b({},u),o)}}),e}function gae(r){var e=Object.keys(r);e.forEach(function(i){var a=Rn[i],o=r[i];a?Rn[i]=function(s,l){return l.origin=function(){return a(s,l)},o(s,l)}:Rn[i]=o,delete r[i]});var t=vae(Rn),n=mae(Rn);return{nodeTypeConvertors:t,markTypeConvertors:n}}var yae=(function(){function r(e){var t=e.nodeTypeConvertors,n=e.markTypeConvertors;this.nodeTypeConvertors=t,this.markTypeConvertors=n,this.delim="",this.result="",this.closed=!1,this.tightList=!1,this.stopNewline=!1,this.inTable=!1}return r.prototype.getMarkConvertor=function(e){var t=e.attrs.htmlInline?"html":e.type.name;return this.markTypeConvertors[t]},r.prototype.isInBlank=function(){return/(^|\n)$/.test(this.result)},r.prototype.markText=function(e,t,n,i){var a=this.getMarkConvertor(e);if(a){var o=a({node:e,parent:n,index:i},t),s=o.delim,l=o.rawHTML;return l||s}return""},r.prototype.setDelim=function(e){this.delim=e},r.prototype.getDelim=function(){return this.delim},r.prototype.flushClose=function(e){if(!this.stopNewline&&this.closed){if(this.isInBlank()||(this.result+=`
`),e||(e=2),e>1){var t=this.delim,n=/\s+$/.exec(t);n&&(t=t.slice(0,t.length-n[0].length));for(var i=1;i<e;i+=1)this.result+=t+`
`}this.closed=!1}},r.prototype.wrapBlock=function(e,t,n,i){var a=this.getDelim();this.write(t||e),this.setDelim(this.getDelim()+e),i(),this.setDelim(a),this.closeBlock(n)},r.prototype.ensureNewLine=function(){this.isInBlank()||(this.result+=`
`)},r.prototype.write=function(e){e===void 0&&(e=""),this.flushClose(),this.delim&&this.isInBlank()&&(this.result+=this.delim),e&&(this.result+=e)},r.prototype.closeBlock=function(e){this.closed=e},r.prototype.text=function(e,t){t===void 0&&(t=!0);for(var n=e.split(`
`),i=0;i<n.length;i+=1)this.write(),this.result+=t?db(n[i]):n[i],i!==n.length-1&&(this.result+=`
`)},r.prototype.convertBlock=function(e,t,n){var i=e.type.name,a=this.nodeTypeConvertors[i],o={node:e,parent:t,index:n};e.attrs.htmlBlock?this.nodeTypeConvertors.html(this,o):a&&a(this,o)},r.prototype.convertInline=function(e){var t=this,n=[],i="",a=function(o,s,l){var u=o?o.marks:[],c=i;i="";var f=o&&o.isText&&u.some(function(K){var pe=t.getMarkConvertor(K),Ue=pe&&pe();return Ue&&Ue.removedEnclosingWhitespace});if(f&&o&&o.text){var d=/^(\s*)(.*?)(\s*)$/m.exec(o.text),h=d[1],p=d[2],v=d[3];c+=h,i=v,(h||v)&&(o=p?o.withText(p):null,o||(u=n))}for(var m=u.length&&be(u),g=m&&t.getMarkConvertor(m),w=g&&g(),k=w&&w.escape===!1,T=u.length-(k?1:0),x=0;x<T;x+=1){var p=u[x];if(w&&!w.mixable)break;for(var L=0;L<n.length;L+=1){var E=n[L];if(w&&!w.mixable)break;if(p.eq(E)){x>L?u=u.slice(0,L).concat(p).concat(u.slice(L,x)).concat(u.slice(x+1,T)):L>x&&(u=u.slice(0,x).concat(u.slice(x+1,L)).concat(p).concat(u.slice(L,T)));break}}}for(var A=0;A<Math.min(n.length,T)&&u[A].eq(n[A]);)A+=1;for(;A<n.length;){var P=n.pop();P&&t.text(t.markText(P,!1,e,l),!1)}if(c&&t.text(c),o){for(;n.length<T;){var p=u[n.length];n.push(p),t.text(t.markText(p,!0,e,l),!1)}k&&o.isText?t.text(t.markText(m,!0,e,l)+o.text+t.markText(m,!1,e,l+1),!1):t.convertBlock(o,e,l)}};e.forEach(a),a(null,null,e.childCount)},r.prototype.convertList=function(e,t,n){var i=this,a;this.closed&&this.closed.type===e.type?this.flushClose(3):this.tightList&&this.flushClose(1);var o=(a=e.attrs.tight)!==null&&a!==void 0?a:!0,s=this.tightList;this.tightList=o,e.forEach(function(l,u,c){c&&o&&i.flushClose(1),i.wrapBlock(t,n(c),e,function(){return i.convertBlock(l,e,c)})}),this.tightList=s},r.prototype.convertTableCell=function(e){var t=this;this.stopNewline=!0,this.inTable=!0,e.forEach(function(n,i,a){if(ce(["bulletList","orderedList"],n.type.name))t.convertBlock(n,e,a),t.closed=!1;else if(t.convertInline(n),a<e.childCount-1){var o=e.child(a+1);o.type.name==="paragraph"&&t.write("<br>")}}),this.stopNewline=!1,this.inTable=!1},r.prototype.convertNode=function(e,t){var n=this;return e.forEach(function(i,a,o){if(n.convertBlock(i,e,o),(t==null?void 0:t.node)===i){var s=n.result.split(`
`);t.setMappedPos([s.length,be(s).length+1])}}),this.result},r})(),bae=(function(){function r(e,t,n,i){var a=this;this.setMappedPos=function(o){a.mappedPosWhenConverting=o},this.schema=e,this.eventEmitter=i,this.focusedNode=null,this.mappedPosWhenConverting=null,this.toWwConvertors=lae(n),this.toMdConvertors=gae(t||{}),this.eventEmitter.listen("setFocusedNode",function(o){return a.focusedNode=o})}return r.prototype.getMappedPos=function(){return this.mappedPosWhenConverting},r.prototype.getInfoForPosSync=function(){return{node:this.focusedNode,setMappedPos:this.setMappedPos}},r.prototype.toWysiwygModel=function(e){var t=new cae(this.schema,this.toWwConvertors);return t.convertNode(e,this.getInfoForPosSync())},r.prototype.toMarkdownText=function(e){var t=new yae(this.toMdConvertors),n=t.convertNode(e,this.getInfoForPosSync());return n=this.eventEmitter.emitReduce("beforeConvertWysiwygToMarkdown",n),n},r})();function wae(r){var e=r.plugin,t=r.eventEmitter,n=r.usageStatistics,i=r.instance,a={Plugin:Ae,PluginKey:cn,Selection:F,TextSelection:q},o={Decoration:Ie,DecorationSet:J},s={Fragment:C},l={InputRule:Ht,inputRules:gc,undoInputRule:sy},u={keymap:wn},c={eventEmitter:t,usageStatistics:n,instance:i,pmState:a,pmView:o,pmModel:s,pmRules:l,pmKeymap:u,i18n:B};if(Nr(e)){var f=e[0],d=e[1],h=d===void 0?{}:d;return f(c,h)}return e(c)}function Lh(r){var e=r.plugins,t=r.eventEmitter,n=r.usageStatistics,i=r.instance;return t.listen("mixinTableOffsetMapPrototype",Qre),(e??[]).reduce(function(a,o){var s=wae({plugin:o,eventEmitter:t,usageStatistics:n,instance:i});if(!s)throw new Error("The return value of the executed plugin is empty.");var l=s.markdownParsers,u=s.toHTMLRenderers,c=s.toMarkdownRenderers,f=s.markdownPlugins,d=s.wysiwygPlugins,h=s.wysiwygNodeViews,p=s.markdownCommands,v=s.wysiwygCommands,m=s.toolbarItems;return u&&(a.toHTMLRenderers=pi(a.toHTMLRenderers,u)),c&&(a.toMarkdownRenderers=pi(a.toMarkdownRenderers,c)),f&&(a.mdPlugins=a.mdPlugins.concat(f)),d&&(a.wwPlugins=a.wwPlugins.concat(d)),h&&(a.wwNodeViews=b(b({},a.wwNodeViews),h)),p&&(a.mdCommands=b(b({},a.mdCommands),p)),v&&(a.wwCommands=b(b({},a.wwCommands),v)),m&&(a.toolbarItems=a.toolbarItems.concat(m)),l&&(a.markdownParsers=b(b({},a.markdownParsers),l)),a},{toHTMLRenderers:{},toMarkdownRenderers:{},mdPlugins:[],wwPlugins:[],wwNodeViews:{},mdCommands:{},wwCommands:{},toolbarItems:[],markdownParsers:{}})}var kae="data-task",Cae="data-task-disabled",Tae="checked";function xae(r){["htmlBlock","htmlInline"].forEach(function(e){r[e]&&Object.keys(r[e]).forEach(function(t){return Vd(t)})})}var Nh=(function(){function r(e){var t=this;this.options=lo({linkAttributes:null,extendedAutolinks:!1,customHTMLRenderer:null,referenceDefinition:!1,customHTMLSanitizer:null,frontMatter:!1,usageStatistics:!0,theme:"light"},e),this.eventEmitter=new kh;var n=Dc(this.options.linkAttributes),i=Lh({plugins:this.options.plugins,eventEmitter:this.eventEmitter,usageStatistics:this.options.usageStatistics,instance:this})||{},a=i.toHTMLRenderers,o=i.markdownParsers,s=this.options,l=s.customHTMLRenderer,u=s.extendedAutolinks,c=s.referenceDefinition,f=s.frontMatter,d=s.customHTMLSanitizer,h={linkAttributes:n,customHTMLRenderer:b(b({},a),l),extendedAutolinks:u,referenceDefinition:c,frontMatter:f,sanitizer:d||mr};xae(h.customHTMLRenderer),this.options.events&&Lr(this.options.events,function(k,T){t.on(T,k)});var p=this.options,v=p.el,m=p.initialValue,g=p.theme,w=v.innerHTML;g!=="light"&&v.classList.add(N(g)),v.innerHTML="",this.toastMark=new Sd("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:u,referenceDefinition:c,disallowDeepHeading:!0,frontMatter:f,customParser:o}),this.preview=new Kd(this.eventEmitter,b(b({},h),{isViewer:!0})),Lf(this.preview.previewContent,"mousedown",this.toggleTask.bind(this)),m?this.setMarkdown(m):w&&this.preview.setHTML(w),v.appendChild(this.preview.previewContent),this.eventEmitter.emit("load",this)}return r.prototype.toggleTask=function(e){var t=e.target,n=getComputedStyle(t,":before");!t.hasAttribute(Cae)&&t.hasAttribute(kae)&&ko(n,e.offsetX,e.offsetY)&&(Co(t,Tae),this.eventEmitter.emit("change",{source:"viewer",date:e}))},r.prototype.setMarkdown=function(e){var t=this.toastMark.getLineTexts(),n=t.length,i=be(t),a=[n,i.length+1],o=this.toastMark.editMarkdown([1,1],a,e||"");this.eventEmitter.emit("updatePreview",o)},r.prototype.on=function(e,t){this.eventEmitter.listen(e,t)},r.prototype.off=function(e){this.eventEmitter.removeEventHandler(e)},r.prototype.addHook=function(e,t){this.eventEmitter.removeEventHandler(e),this.eventEmitter.listen(e,t)},r.prototype.destroy=function(){Sf(this.preview.el,"mousedown",this.toggleTask.bind(this)),this.preview.destroy(),this.eventEmitter.emit("destroy")},r.prototype.isViewer=function(){return!0},r.prototype.isMarkdownMode=function(){return!1},r.prototype.isWysiwygMode=function(){return!1},r})();function Zi(r){return r instanceof Et}function Ah(r){var e=["document","blockQuote","bulletList","orderedList","listItem","paragraph","heading","emph","strong","strike","link","image","table","tableHead","tableBody","tableRow","tableHeadCell","tableBodyCell"];return ce(e,r)}function Eae(r){var e=r.attrs,t=r.type,n=t.name,i={type:n,wysiwygNode:!0,literal:!Ah(n)&&Zi(r)?r.textContent:null},a={heading:{level:e.level},link:{destination:e.linkUrl,title:e.title},image:{destination:e.imageUrl},codeBlock:{info:e.language},bulletList:{type:"list",listData:{type:"bullet"}},orderedList:{type:"list",listData:{type:"ordered",start:e.order}},listItem:{type:"item",listData:{task:e.task,checked:e.checked}},tableHeadCell:{type:"tableCell",cellType:"head",align:e.align},tableBodyCell:{type:"tableCell",cellType:"body",align:e.align},customBlock:{info:e.info}},o=a[n],s=b(b({},i),o),l=r.attrs,u=l.htmlAttrs,c=l.childrenHTML;return u?b(b({},s),{attrs:u,childrenHTML:c}):s}var Mae={openTag:function(r,e){var t=r,n=t.tagName,i=t.classNames,a=t.attributes,o=document.createElement(n),s={};i&&(o.className=i.join(" ")),a&&(s=b(b({},s),a)),xo(s,o),e.push(o)},closeTag:function(r,e){if(e.length>1){var t=e.pop();be(e).appendChild(t)}},html:function(r,e){be(e).insertAdjacentHTML("beforeend",r.content)},text:function(r,e){var t=document.createTextNode(r.content);be(e).appendChild(t)}},Sae=(function(){function r(e,t){var n=ms(e,t),i=b(b({},t.htmlBlock),t.htmlInline);this.customConvertorKeys=Object.keys(t).concat(Object.keys(i)),this.renderer=new ls({gfm:!0,convertors:b(b({},n),i)}),this.convertors=this.renderer.getConvertors()}return r.prototype.generateTokens=function(e){var t=Eae(e),n={entering:!0,leaf:Zi(e)?e.isLeaf:!1,options:this.renderer.getOptions(),getChildrenText:function(){return Zi(e)?e.textContent:""},skipChildren:function(){return!1}},i=this.convertors[e.type.name],a=i(t,n,this.convertors),o=Nr(a)?a:[a];return(Ah(e.type.name)||e.attrs.htmlInline)&&(n.entering=!1,o.push({type:"text",content:Zi(e)?e.textContent:""}),o=o.concat(i(t,n,this.convertors))),o},r.prototype.toDOMNode=function(e){var t=this.generateTokens(e),n=[];return t.forEach(function(i){return Mae[i.type](i,n)}),n[0]},r.prototype.getToDOMNode=function(e){return ce(this.customConvertorKeys,e)?this.toDOMNode.bind(this):null},r})(),Oae=100,Lae=15,ea=null,Os=null;function Dh(r,e){var t=e.syncScrollTop,n=e.releaseEventBlock;Os&&clearTimeout(Os),t(r),Os=setTimeout(function(){n()},Lae)}function Nae(r,e,t){var n=e-r,i=Date.now(),a=function(){var o=Date.now(),s=(o-i)/Oae,l;ea&&clearTimeout(ea),s<1?(l=r+n*Math.cos((1-s)*Math.PI/2),Dh(Math.ceil(l),t),ea=setTimeout(a,1)):(Dh(e,t),ea=null)};a()}var Aae=18,Dae=(function(){function r(e,t,n){this.latestEditorScrollTop=null,this.latestPreviewScrollTop=null,this.blockedScroll=null,this.active=!0,this.timer=null;var i=t.previewContent,a=t.el;this.previewRoot=i,this.previewEl=a,this.mdEditor=e,this.editorView=e.view,this.toastMark=e.getToastMark(),this.eventEmitter=n,this.addScrollSyncEvent()}return r.prototype.addScrollSyncEvent=function(){var e=this;this.eventEmitter.listen("afterPreviewRender",function(){e.clearTimer(),e.timer=setTimeout(function(){e.syncPreviewScrollTop(!0)},200)}),this.eventEmitter.listen("scroll",function(t,n){e.active&&(t==="editor"&&e.blockedScroll!=="editor"?e.syncPreviewScrollTop():t==="preview"&&e.blockedScroll!=="preview"&&e.syncEditorScrollTop(n))}),this.eventEmitter.listen("toggleScrollSync",function(t){e.active=t})},r.prototype.getMdNodeAtPos=function(e,t){var n=e.content.findIndex(t.pos),i=n.index;return this.toastMark.findFirstNodeAtLine(i+1)},r.prototype.getScrollTopByCaretPos=function(){var e=this.mdEditor.getSelection(),t=this.toastMark.findFirstNodeAtLine(e[0][0]),n=this.previewEl.clientHeight,i=gs(this.previewRoot,t).el,a=Gi(i,this.previewRoot)||i.offsetTop,o=i.clientHeight,s=a+o-n*.5;this.latestEditorScrollTop=null;var l=i.getBoundingClientRect().top-this.previewEl.getBoundingClientRect().top;return l<n?null:s},r.prototype.syncPreviewScrollTop=function(e){e===void 0&&(e=!1);var t=this,n=t.editorView,i=t.previewEl,a=t.previewRoot,o=n.dom.getBoundingClientRect(),s=o.left,l=o.top,u=n.posAtCoords({left:s,top:l}),c=n.state.doc,f=this.getMdNodeAtPos(c,u);if(!(!f||gb(f))){var d=i.scrollTop,h=n.dom,p=h.scrollTop,v=h.scrollHeight,m=h.clientHeight,g=h.children,w=v-p<=m+Aae,k=w?i.scrollHeight:0;if(p&&!w){if(e){var T=this.getScrollTopByCaretPos();if(!T)return;k=T}else{var x=gs(this.previewRoot,f),L=x.el,E=x.mdNode,A=jd(c,E,g),P=A.height,K=A.rect,pe=Gi(L,a)||L.offsetTop,Ue=L.clientHeight,aa=l>K.top?Math.min((l-K.top)/P,1):0;k=pe+Ue*aa}k=this.getResolvedScrollTop("editor",p,k,d),this.latestEditorScrollTop=p}k!==d&&this.run("editor",k,d)}},r.prototype.syncEditorScrollTop=function(e){var t=this,n=t.toastMark,i=t.editorView,a=t.previewRoot,o=t.previewEl,s=i.dom,l=i.state,u=o.scrollTop,c=o.clientHeight,f=o.scrollHeight,d=f-u<=c,h=s.scrollTop,p=d?s.scrollHeight:0;if(u&&e&&!d){if(e=Ore(e,a),!e.getAttribute("data-nodeid"))return;var v=s.children,m=Number(e.getAttribute("data-nodeid")),g=gs(this.previewRoot,n.findNodeById(m)),w=g.mdNode,k=g.el,T=Tn(w);p=v[T-1].offsetTop;var x=jd(l.doc,w,v).height,L=Pre(k,a,m),E=L.nodeHeight,A=L.offsetTop;p+=Nre(u,A,E,x),p=this.getResolvedScrollTop("preview",u,p,h),this.latestPreviewScrollTop=u}p!==h&&this.run("preview",p,h)},r.prototype.getResolvedScrollTop=function(e,t,n,i){var a=e==="editor"?this.latestEditorScrollTop:this.latestPreviewScrollTop;return a===null?n:a<t?Math.max(n,i):Math.min(n,i)},r.prototype.run=function(e,t,n){var i=this,a;e==="editor"?(a=this.previewEl,this.blockedScroll="preview"):(a=this.editorView.dom,this.blockedScroll="editor");var o={syncScrollTop:function(s){return a.scrollTop=s},releaseEventBlock:function(){return i.blockedScroll=null}};Nae(n,t,o)},r.prototype.clearTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},r.prototype.destroy=function(){this.clearTimer(),this.eventEmitter.removeEventHandler("scroll"),this.eventEmitter.removeEventHandler("afterPreviewRender")},r})(),Iae={getPopupInitialValues:function(r,e){var t=e.popupName;return t==="link"?{linkText:r.getSelectedText()}:{}}};function Rae(r){r.eventEmitter.listen("query",function(e,t){return Iae[e](r,t)})}var Ih=(function(){function r(e){var t=this;this.initialHTML=e.el.innerHTML,e.el.innerHTML="",this.options=lo({previewStyle:"tab",previewHighlight:!0,initialEditType:"markdown",height:"300px",minHeight:"200px",language:"en-US",useCommandShortcut:!0,usageStatistics:!0,toolbarItems:[["heading","bold","italic","strike"],["hr","quote"],["ul","ol","task","indent","outdent"],["table","image","link"],["code","codeblock"],["scrollSync"]],hideModeSwitch:!1,linkAttributes:null,extendedAutolinks:!1,customHTMLRenderer:null,customMarkdownRenderer:null,referenceDefinition:!1,customHTMLSanitizer:null,frontMatter:!1,widgetRules:[],theme:"light",autofocus:!0},e);var n=this.options,i=n.customHTMLRenderer,a=n.extendedAutolinks,o=n.referenceDefinition,s=n.frontMatter,l=n.customMarkdownRenderer,u=n.useCommandShortcut,c=n.initialEditType,f=n.widgetRules,d=n.customHTMLSanitizer;this.mode=c||"markdown",this.mdPreviewStyle=this.options.previewStyle,this.i18n=B,this.i18n.setCode(this.options.language),this.eventEmitter=new kh,Sb(f);var h=Dc(this.options.linkAttributes);this.pluginInfo=Lh({plugins:this.options.plugins,eventEmitter:this.eventEmitter,usageStatistics:this.options.usageStatistics,instance:this});var p=this.pluginInfo,v=p.toHTMLRenderers,m=p.toMarkdownRenderers,g=p.mdPlugins,w=p.wwPlugins,k=p.wwNodeViews,T=p.mdCommands,x=p.wwCommands,L=p.markdownParsers,E={linkAttributes:h,customHTMLRenderer:pi(v,i),extendedAutolinks:a,referenceDefinition:o,frontMatter:s,sanitizer:d||mr},A=new Sae(h,E.customHTMLRenderer),P=kre(E.customHTMLRenderer,E.sanitizer,A);this.toastMark=new Sd("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:a,referenceDefinition:o,disallowDeepHeading:!0,frontMatter:s,customParser:L}),this.mdEditor=new Lk(this.eventEmitter,{toastMark:this.toastMark,useCommandShortcut:u,mdPlugins:g}),this.preview=new Kd(this.eventEmitter,b(b({},E),{isViewer:!1,highlight:this.options.previewHighlight})),this.wwEditor=new jie(this.eventEmitter,{toDOMAdaptor:A,useCommandShortcut:u,htmlSchemaMap:P,linkAttributes:h,wwPlugins:w,wwNodeViews:k}),this.convertor=new bae(this.wwEditor.getSchema(),b(b({},m),l),ms(h,E.customHTMLRenderer),this.eventEmitter),this.setMinHeight(this.options.minHeight),this.setHeight(this.options.height),this.setMarkdown(this.options.initialValue,!1),this.options.placeholder&&this.setPlaceholder(this.options.placeholder),this.options.initialValue||this.setHTML(this.initialHTML,!1),this.commandManager=new nae(this.eventEmitter,this.mdEditor.commands,this.wwEditor.commands,function(){return t.mode}),this.options.usageStatistics&&lb(),this.scrollSync=new Dae(this.mdEditor,this.preview,this.eventEmitter),this.addInitEvent(),this.addInitCommand(T,x),Rae(this),this.options.hooks&&Lr(this.options.hooks,function(K,pe){return t.addHook(pe,K)}),this.options.events&&Lr(this.options.events,function(K,pe){return t.on(pe,K)}),this.eventEmitter.emit("load",this),this.moveCursorToStart(this.options.autofocus)}return r.prototype.addInitEvent=function(){var e=this;this.on("needChangeMode",this.changeMode.bind(this)),this.on("loadUI",function(){if(e.height!=="auto"){var t=Math.min(parseInt(e.minHeight,10),parseInt(e.height,10)-75)+"px";e.setMinHeight(t)}}),Zb(this.eventEmitter)},r.prototype.addInitCommand=function(e,t){var n=this,i=function(a,o){Object.keys(o).forEach(function(s){n.addCommand(a,s,o[s])})};this.addCommand("markdown","toggleScrollSync",function(a){return n.eventEmitter.emit("toggleScrollSync",a.active),!0}),i("markdown",e),i("wysiwyg",t)},r.prototype.getCurrentModeEditor=function(){return this.isMarkdownMode()?this.mdEditor:this.wwEditor},r.factory=function(e){return e.viewer?new Nh(e):new r(e)},r.setLanguage=function(e,t){B.setLanguage(e,t)},r.prototype.changePreviewStyle=function(e){this.mdPreviewStyle!==e&&(this.mdPreviewStyle=e,this.eventEmitter.emit("changePreviewStyle",e))},r.prototype.exec=function(e,t){this.commandManager.exec(e,t)},r.prototype.addCommand=function(e,t,n){var i=this,a=function(o){o===void 0&&(o={});var s=(e==="markdown"?i.mdEditor:i.wwEditor).view;n(o,s.state,s.dispatch,s)};this.commandManager.addCommand(e,t,a)},r.prototype.on=function(e,t){this.eventEmitter.listen(e,t)},r.prototype.off=function(e){this.eventEmitter.removeEventHandler(e)},r.prototype.addHook=function(e,t){this.eventEmitter.removeEventHandler(e),this.eventEmitter.listen(e,t)},r.prototype.removeHook=function(e){this.eventEmitter.removeEventHandler(e)},r.prototype.focus=function(){this.getCurrentModeEditor().focus()},r.prototype.blur=function(){this.getCurrentModeEditor().blur()},r.prototype.moveCursorToEnd=function(e){e===void 0&&(e=!0),this.getCurrentModeEditor().moveCursorToEnd(e)},r.prototype.moveCursorToStart=function(e){e===void 0&&(e=!0),this.getCurrentModeEditor().moveCursorToStart(e)},r.prototype.setMarkdown=function(e,t){if(e===void 0&&(e=""),t===void 0&&(t=!0),this.mdEditor.setMarkdown(e,t),this.isWysiwygMode()){var n=this.toastMark.getRootNode(),i=this.convertor.toWysiwygModel(n);this.wwEditor.setModel(i,t)}},r.prototype.setHTML=function(e,t){e===void 0&&(e=""),t===void 0&&(t=!0);var n=document.createElement("div");n.innerHTML=Xb(e);var i=Jt.fromSchema(this.wwEditor.schema).parse(n);this.isMarkdownMode()?this.mdEditor.setMarkdown(this.convertor.toMarkdownText(i),t):this.wwEditor.setModel(i,t)},r.prototype.getMarkdown=function(){return this.isMarkdownMode()?this.mdEditor.getMarkdown():this.convertor.toMarkdownText(this.wwEditor.getModel())},r.prototype.getHTML=function(){var e=this;this.eventEmitter.holdEventInvoke(function(){if(e.isMarkdownMode()){var i=e.toastMark.getRootNode(),a=e.convertor.toWysiwygModel(i);e.wwEditor.setModel(a)}});var t=Eo(this.wwEditor.view.dom.innerHTML);if(this.placeholder){var n=new RegExp('<span class="placeholder[^>]+>'+this.placeholder+"</span>","i");return t.replace(n,"")}return t},r.prototype.insertText=function(e){this.getCurrentModeEditor().replaceSelection(e)},r.prototype.setSelection=function(e,t){this.getCurrentModeEditor().setSelection(e,t)},r.prototype.replaceSelection=function(e,t,n){this.getCurrentModeEditor().replaceSelection(e,t,n)},r.prototype.deleteSelection=function(e,t){this.getCurrentModeEditor().deleteSelection(e,t)},r.prototype.getSelectedText=function(e,t){return this.getCurrentModeEditor().getSelectedText(e,t)},r.prototype.getRangeInfoOfNode=function(e){return this.getCurrentModeEditor().getRangeInfoOfNode(e)},r.prototype.addWidget=function(e,t,n){this.getCurrentModeEditor().addWidget(e,t,n)},r.prototype.replaceWithWidget=function(e,t,n){this.getCurrentModeEditor().replaceWithWidget(e,t,n)},r.prototype.setHeight=function(e){var t=this.options.el;pt(e)&&(e==="auto"?nt(t,"auto-height"):Ge(t,"auto-height"),this.setMinHeight(this.getMinHeight())),rt(t,{height:e}),this.height=e},r.prototype.getHeight=function(){return this.height},r.prototype.setMinHeight=function(e){if(e!==this.minHeight){var t=this.height||this.options.height;t!=="auto"&&this.options.el.querySelector("."+N("main"))&&(e=Math.min(parseInt(e,10),parseInt(t,10)-75)+"px");var n=parseInt(e,10);this.minHeight=e,this.wwEditor.setMinHeight(n),this.mdEditor.setMinHeight(n),this.preview.setMinHeight(n)}},r.prototype.getMinHeight=function(){return this.minHeight},r.prototype.isMarkdownMode=function(){return this.mode==="markdown"},r.prototype.isWysiwygMode=function(){return this.mode==="wysiwyg"},r.prototype.isViewer=function(){return!1},r.prototype.getCurrentPreviewStyle=function(){return this.mdPreviewStyle},r.prototype.changeMode=function(e,t){if(this.mode!==e){if(this.mode=e,this.isWysiwygMode()){var n=this.toastMark.getRootNode(),i=this.convertor.toWysiwygModel(n);this.wwEditor.setModel(i)}else{var i=this.wwEditor.getModel();this.mdEditor.setMarkdown(this.convertor.toMarkdownText(i),!t)}if(this.eventEmitter.emit("removePopupWidget"),this.eventEmitter.emit("changeMode",e),!t){var a=this.convertor.getMappedPos();this.focus(),this.isWysiwygMode()&&vt(a)?this.wwEditor.setSelection(a):Array.isArray(a)&&this.mdEditor.setSelection(a)}}},r.prototype.destroy=function(){var e=this;this.wwEditor.destroy(),this.mdEditor.destroy(),this.preview.destroy(),this.scrollSync.destroy(),this.eventEmitter.emit("destroy"),this.eventEmitter.getEvents().forEach(function(t,n){return e.off(n)})},r.prototype.hide=function(){this.eventEmitter.emit("hide")},r.prototype.show=function(){this.eventEmitter.emit("show")},r.prototype.setScrollTop=function(e){this.getCurrentModeEditor().setScrollTop(e)},r.prototype.getScrollTop=function(){return this.getCurrentModeEditor().getScrollTop()},r.prototype.reset=function(){this.wwEditor.setModel([]),this.mdEditor.setMarkdown("")},r.prototype.getSelection=function(){return this.getCurrentModeEditor().getSelection()},r.prototype.setPlaceholder=function(e){this.placeholder=e,this.mdEditor.setPlaceholder(e),this.wwEditor.setPlaceholder(e)},r.prototype.getEditorElements=function(){return{mdEditor:this.mdEditor.getElement(),mdPreview:this.preview.getElement(),wwEditor:this.wwEditor.getElement()}},r.prototype.convertPosToMatchEditorMode=function(e,t,n){var i,a;t===void 0&&(t=e),n===void 0&&(n=this.mode);var o=this.mdEditor.view.state.doc,s=Array.isArray(e),l=Array.isArray(t),u=e,c=t;if(s!==l)throw new Error("Types of arguments must be same");return n==="markdown"&&!s&&!l?(i=Ti(o,e,t),u=i[0],c=i[1]):n==="wysiwyg"&&s&&l&&(a=ur(o,e,t),u=a[0],c=a[1]),[u,c]},r})();function Bae(r){for(var e,t,n=arguments,i=1,a="",o="",s=[0],l=function(c){i===1&&(c||(a=a.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?s.push(c?n[c]:a):i===3&&(c||a)?(s[1]=c?n[c]:a,i=2):i===2&&a==="..."&&c?s[2]=mo(s[2]||{},n[c]):i===2&&a&&!c?(s[2]=s[2]||{})[a]=!0:i>=5&&(i===5?((s[2]=s[2]||{})[t]=c?a?a+n[c]:n[c]:a,i=6):(c||a)&&(s[2][t]+=c?a+n[c]:a)),a=""},u=0;u<r.length;u++){u&&(i===1&&l(),l(u));for(let c=0;c<r[u].length;c++)e=r[u][c],i===1?e==="<"?(l(),s=[s,"",null],i=3):a+=e:i===4?a==="--"&&e===">"?(i=1,a=""):a=e+a[0]:o?e===o?o="":a+=e:e==='"'||e==="'"?o=e:e===">"?(l(),i=1):i&&(e==="="?(i=5,t=a,a=""):e==="/"&&(i<5||r[u][c+1]===">")?(l(),i===3&&(s=s[0]),i=s,(s=s[0]).push(this.apply(null,i.slice(1))),i=0):e===" "||e==="	"||e===`
`||e==="\r"?(l(),i=2):a+=e),i===3&&a==="!--"&&(i=4,s=s[0])}return l(),s.length>2?s.slice(1):s[1]}function Pae(r){return typeof r=="boolean"||r instanceof Boolean}var Hae=Pae,Fae=(function(){function r(e){this.current=e,this.root=e,this.entering=!0}return r.prototype.walk=function(){var e=this,t=e.entering,n=e.current;return n?(t?n.firstChild?(this.current=n.firstChild,this.entering=!0):this.entering=!1:n===this.root?this.current=null:n.next?(this.current=n.next,this.entering=!0):(this.current=n.parent,this.entering=!1),{vnode:n,entering:t}):null},r})(),Ye=(function(){function r(e,t,n){this.parent=null,this.old=null,this.firstChild=null,this.next=null,this.skip=!1,this.type=e,this.props=t,this.children=n,this.props.children=n,t.ref&&(this.ref=t.ref,delete t.ref),t.key&&(this.key=t.key,delete t.key)}return r.prototype.walker=function(){return new Fae(this)},r.removalNodes=[],r})();function qae(r){return new Ye("TEXT_NODE",{nodeValue:r},[])}function Rh(r,e){var t=r;Hae(r)||r==null?t=null:(pt(r)||vt(r))&&(t=qae(String(r))),t&&e.push(t)}function _ae(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i=[];return t.forEach(function(a){Array.isArray(a)?a.forEach(function(o){Rh(o,i)}):Rh(a,i)}),new Ye(r,e||{},i)}var $=Bae.bind(_ae);function $ae(r){return r===Object(r)}var zae=$ae;function Vae(r){var e;return r.type==="TEXT_NODE"?e=document.createTextNode(r.props.nodeValue):(e=document.createElement(r.type),Ph(e,{},r.props)),e}function Bh(r,e){r.node?e.removeChild(r.node):Bh(r.firstChild,e)}function Uae(r,e,t){Object.keys(e).forEach(function(n){if(/^on/.test(n)){if(!t[n]||e[n]!==t[n]){var i=n.slice(2).toLowerCase();r.removeEventListener(i,e[n])}}else n!=="children"&&!t[n]&&!Wb(r)&&r.removeAttribute(n)}),Ph(r,e,t,function(n){return!fo(e[n],t[n])})}var Wae=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function Ph(r,e,t,n){Object.keys(t).forEach(function(i){if(!n||n(i))if(/^on/.test(i)){var a=i.slice(2).toLowerCase();r.addEventListener(a,t[i])}else i==="nodeValue"?r[i]=t[i]:i==="style"&&zae(t[i])?jae(r,e[i],t[i]):i!=="children"&&(t[i]===!1?r.removeAttribute(i):r.setAttribute(i,t[i]))})}function jae(r,e,t){e&&Object.keys(e).forEach(function(n){r.style[n]=""}),Object.keys(t).forEach(function(n){var i=t[n];r.style[n]=vt(i)&&!Wae.test(n)?i+"px":i})}function Ls(r){if(Ye.removalNodes.forEach(function(a){return Fh(a)}),r){for(var e=void 0,t=r.walker();e=t.walk();)if(r=e.vnode,e.entering)Fh(r);else if(ze(r.type)){var n=r.component;if(!r.old&&n.mounted&&n.mounted(),r.old&&n.updated){var i=n.prevProps||{};n.updated(i)}}}}function Hh(r){for(var e=r.parent;!e.node;)e=e.parent;return e.node}function Fh(r){if(!(!r||!r.parent)){if(r.node){var e=Hh(r);r.effect==="A"?e.appendChild(r.node):r.effect==="U"&&Uae(r.node,r.old.props,r.props)}if(r.effect==="D"){for(var t=void 0,n=r.walker();t=n.walk();)if(r=t.vnode,!t.entering)if(ze(r.type)){var i=r.component;i.beforeDestroy&&i.beforeDestroy()}else{var e=Hh(r);Bh(r,e)}}r.ref&&(r.component?r.ref(r.component):r.node&&r.ref(r.node))}}function Gae(r,e){var t=e.props,n=e.component;return n?(n.prevProps=n.props,n.props=e.props,n):new r(t)}function qh(r){for(var e=r;r&&!r.skip;){if(ze(r.type)){var t=Gae(r.type,r);t.vnode=r,r.component=t,r.props.children=r.children=[t.render()],_h(r)}else r.node||(r.node=Vae(r)),_h(r);if(r.firstChild)r=r.firstChild;else{for(;r&&r.parent&&!r.next&&(r=r.parent,r!==e););r=r.next}}}function Kae(r,e){return r&&e&&e.type===r.type&&(!e.key||e.key===r.key)}function _h(r){var e=r.children,t=r.old?r.old.firstChild:null,n=null;e.forEach(function(a,o){var s=Kae(t,a);s&&(a.old=t,a.parent=r,a.node=t.node,a.component=t.component,a.effect="U"),a&&!s&&(a.old=null,a.parent=r,a.node=null,a.effect="A"),t&&!s&&(Ye.removalNodes.push(t),t.effect="D"),t&&(t=t.next),o===0?r.firstChild=a:a&&(n.next=a),n=a});var i=be(e);if(!e.length)for(;t;)Ye.removalNodes.push(t),t.effect="D",t=t.next;for(;t&&i;)t&&i.old!==t&&(Ye.removalNodes.push(t),t.effect="D",t=t.next)}function Jae(r){r.effect="D",Ye.removalNodes=[r],Ls(),Ye.removalNodes=[]}function Xae(r){var e=r.vnode;e.effect="U",e.old=e,e.next&&(e.next.skip=!0),Ye.removalNodes=[],qh(e),Ls(e),e.next&&(e.next.skip=!1)}function Yae(r,e){var t=new Ye(r.tagName.toLowerCase(),{},[e]);return t.node=r,Ye.removalNodes=[],qh(t),Ls(t),function(){return Jae(t.firstChild)}}var we=(function(){function r(e){this.props=e,this.state={},this.refs={}}return r.prototype.setState=function(e){var t=b(b({},this.state),e);fo(this.state,t)||(this.state=t,Xae(this))},r})(),Qae=(function(r){O(e,r);function e(t){var n=r.call(this,t)||this;return n.state={hide:!1},n}return e.prototype.show=function(){this.setState({hide:!1})},e.prototype.hide=function(){this.setState({hide:!0})},e.prototype.render=function(){var t=this.props,n=t.editorType,i=t.eventEmitter;return $($h||($h=_([`
      <div class="`,'" style="display: ',`">
        <div
          class="tab-item`,`"
          onClick=`,`
        >
          `,`
        </div>
        <div
          class="tab-item`,`"
          onClick=`,`
        >
          `,`
        </div>
      </div>
    `],[`
      <div class="`,'" style="display: ',`">
        <div
          class="tab-item`,`"
          onClick=`,`
        >
          `,`
        </div>
        <div
          class="tab-item`,`"
          onClick=`,`
        >
          `,`
        </div>
      </div>
    `])),N("mode-switch"),this.state.hide?"none":"block",n==="markdown"?" active":"",function(){i.emit("needChangeMode","markdown")},B.get("Markdown"),n==="wysiwyg"?" active":"",function(){i.emit("needChangeMode","wysiwyg")},B.get("WYSIWYG"))},e})(we),$h;function Zae(r,e){var t,n;e=e||0;function i(){n=Array.prototype.slice.call(arguments),window.clearTimeout(t),t=window.setTimeout(function(){r.apply(null,n)},e)}return i}var eoe=Zae,toe=eoe;function roe(r,e){var t,n=!0,i=function(c){r.apply(null,c),t=null},a,o,s;e=e||0,a=toe(i,e);function l(){if(s=Array.prototype.slice.call(arguments),n){i(s),n=!1;return}o=Number(new Date),t=t||o,a(s),o-t>=e&&i(s)}function u(){n=!0,t=null}return l.reset=u,l}var noe=roe,zh=(function(){if(typeof Map<"u")return Map;function r(e,t){var n=-1;return e.some(function(i,a){return i[0]===t?(n=a,!0):!1}),n}return(function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var n=r(this.__entries__,t),i=this.__entries__[n];return i&&i[1]},e.prototype.set=function(t,n){var i=r(this.__entries__,t);~i?this.__entries__[i][1]=n:this.__entries__.push([t,n])},e.prototype.delete=function(t){var n=this.__entries__,i=r(n,t);~i&&n.splice(i,1)},e.prototype.has=function(t){return!!~r(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,n){n===void 0&&(n=null);for(var i=0,a=this.__entries__;i<a.length;i++){var o=a[i];t.call(n,o[1],o[0])}},e})()})(),Ns=typeof window<"u"&&typeof document<"u"&&window.document===document,ta=(function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()})(),ioe=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ta):function(r){return setTimeout(function(){return r(Date.now())},1e3/60)}})(),aoe=2;function ooe(r,e){var t=!1,n=!1,i=0;function a(){t&&(t=!1,r()),n&&s()}function o(){ioe(a)}function s(){var l=Date.now();if(t){if(l-i<aoe)return;n=!0}else t=!0,n=!1,setTimeout(o,e);i=l}return s}var soe=20,loe=["top","right","bottom","left","width","height","size","weight"],uoe=typeof MutationObserver<"u",coe=(function(){function r(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=ooe(this.refresh.bind(this),soe)}return r.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},r.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},r.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},r.prototype.updateObservers_=function(){var e=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return e.forEach(function(t){return t.broadcastActive()}),e.length>0},r.prototype.connect_=function(){!Ns||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),uoe?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},r.prototype.disconnect_=function(){!Ns||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},r.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=t===void 0?"":t,i=loe.some(function(a){return!!~n.indexOf(a)});i&&this.refresh()},r.getInstance=function(){return this.instance_||(this.instance_=new r),this.instance_},r.instance_=null,r})(),Vh=(function(r,e){for(var t=0,n=Object.keys(e);t<n.length;t++){var i=n[t];Object.defineProperty(r,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return r}),Wr=(function(r){var e=r&&r.ownerDocument&&r.ownerDocument.defaultView;return e||ta}),Uh=na(0,0,0,0);function ra(r){return parseFloat(r)||0}function Wh(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(n,i){var a=r["border-"+i+"-width"];return n+ra(a)},0)}function foe(r){for(var e=["top","right","bottom","left"],t={},n=0,i=e;n<i.length;n++){var a=i[n],o=r["padding-"+a];t[a]=ra(o)}return t}function doe(r){var e=r.getBBox();return na(0,0,e.width,e.height)}function hoe(r){var e=r.clientWidth,t=r.clientHeight;if(!e&&!t)return Uh;var n=Wr(r).getComputedStyle(r),i=foe(n),a=i.left+i.right,o=i.top+i.bottom,s=ra(n.width),l=ra(n.height);if(n.boxSizing==="border-box"&&(Math.round(s+a)!==e&&(s-=Wh(n,"left","right")+a),Math.round(l+o)!==t&&(l-=Wh(n,"top","bottom")+o)),!voe(r)){var u=Math.round(s+a)-e,c=Math.round(l+o)-t;Math.abs(u)!==1&&(s-=u),Math.abs(c)!==1&&(l-=c)}return na(i.left,i.top,s,l)}var poe=(function(){return typeof SVGGraphicsElement<"u"?function(r){return r instanceof Wr(r).SVGGraphicsElement}:function(r){return r instanceof Wr(r).SVGElement&&typeof r.getBBox=="function"}})();function voe(r){return r===Wr(r).document.documentElement}function moe(r){return Ns?poe(r)?doe(r):hoe(r):Uh}function goe(r){var e=r.x,t=r.y,n=r.width,i=r.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,o=Object.create(a.prototype);return Vh(o,{x:e,y:t,width:n,height:i,top:t,right:e+n,bottom:i+t,left:e}),o}function na(r,e,t,n){return{x:r,y:e,width:t,height:n}}var yoe=(function(){function r(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=na(0,0,0,0),this.target=e}return r.prototype.isActive=function(){var e=moe(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},r.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},r})(),boe=(function(){function r(e,t){var n=goe(t);Vh(this,{target:e,contentRect:n})}return r})(),woe=(function(){function r(e,t,n){if(this.activeObservations_=[],this.observations_=new zh,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return r.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof Wr(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new yoe(e)),this.controller_.addObserver(this),this.controller_.refresh())}},r.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof Wr(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},r.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},r.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},r.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(n){return new boe(n.target,n.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},r.prototype.clearActive=function(){this.activeObservations_.splice(0)},r.prototype.hasActive=function(){return this.activeObservations_.length>0},r})(),jh=typeof WeakMap<"u"?new WeakMap:new zh,Gh=(function(){function r(e){if(!(this instanceof r))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=coe.getInstance(),n=new woe(e,t,this);jh.set(this,n)}return r})();["observe","unobserve","disconnect"].forEach(function(r){Gh.prototype[r]=function(){var e;return(e=jh.get(this))[r].apply(e,arguments)}});var koe=(function(){return typeof ta.ResizeObserver<"u"?ta.ResizeObserver:Gh})(),Coe=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.execCommand=function(t){var n=at(t.target,"li");this.props.execCommand("heading",{level:Number(n.getAttribute("data-level"))})},e.prototype.render=function(){var t=this;return $(Jh||(Jh=_([`
      <ul
        onClick=`,`
        aria-role="menu"
        aria-label="`,`"
      >
        `,`
        <li data-type="Paragraph" aria-role="menuitem">
          <div>`,`</div>
        </li>
      </ul>
    `],[`
      <ul
        onClick=`,`
        aria-role="menu"
        aria-label="`,`"
      >
        `,`
        <li data-type="Paragraph" aria-role="menuitem">
          <div>`,`</div>
        </li>
      </ul>
    `])),function(n){return t.execCommand(n)},B.get("Headings"),[1,2,3,4,5,6].map(function(n){return $(Kh||(Kh=_([`
              <li data-level="`,`" data-type="Heading" aria-role="menuitem">
                <`,">"," ",`</$>
              </li>
            `],[`
              <li data-level="`,`" data-type="Heading" aria-role="menuitem">
                <`,">"," ",`</$>
              </li>
            `])),n,"h"+n,B.get("Heading"),n)}),B.get("Paragraph"))},e})(we),Kh,Jh,Xh=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.toggleTab=function(t,n){this.props.onClick(t,n)},e.prototype.render=function(){var t=this;return $(Qh||(Qh=_([`
      <div class="`,`" aria-role="tabpanel">
        `,`
      </div>
    `],[`
      <div class="`,`" aria-role="tabpanel">
        `,`
      </div>
    `])),N("tabs"),this.props.tabs.map(function(n){var i=n.name,a=n.text,o=t.props.activeTab===i;return $(Yh||(Yh=_([`
            <div
              class="tab-item`,`"
              onClick=`,`
              aria-role="tab"
              aria-label="`,`"
              aria-selected="`,`"
              tabindex="`,`"
            >
              `,`
            </div>
          `],[`
            <div
              class="tab-item`,`"
              onClick=`,`
              aria-role="tab"
              aria-label="`,`"
              aria-selected="`,`"
              tabindex="`,`"
            >
              `,`
            </div>
          `])),o?" active":"",function(s){return t.toggleTab(s,i)},B.get(a),o?"true":"false",o?"0":"-1",B.get(a))}))},e})(we),Yh,Qh,Toe="ui",xoe=(function(r){O(e,r);function e(t){var n=r.call(this,t)||this;return n.initialize=function(i){i===void 0&&(i="file");var a=n.refs.url;a.value="",n.refs.altText.value="",n.refs.file.value="",Ge(a,"wrong"),n.setState({activeTab:i,file:null,fileNameElClassName:""})},n.execCommand=function(){n.state.activeTab==="file"?n.emitAddImageBlob():n.emitAddImage()},n.toggleTab=function(i,a){a!==n.state.activeTab&&n.initialize(a)},n.showFileSelectBox=function(){n.refs.file.click()},n.changeFile=function(i){var a=i.target.files;a!=null&&a.length&&n.setState({file:a[0]})},n.state={activeTab:"file",file:null,fileNameElClassName:""},n.tabs=[{name:"file",text:"File"},{name:"url",text:"URL"}],n}return e.prototype.emitAddImageBlob=function(){var t=this,n=this.refs.file.files,i=this.refs.altText,a=" wrong";if(n!=null&&n.length){a="";var o=n.item(0),s=function(l,u){return t.props.execCommand("addImage",{imageUrl:l,altText:u||i.value})};this.props.eventEmitter.emit("addImageBlobHook",o,s,Toe)}this.setState({fileNameElClassName:a})},e.prototype.emitAddImage=function(){var t=this.refs.url,n=this.refs.altText,i=t.value,a=n.value||"image";if(Ge(t,"wrong"),!i.length){nt(t,"wrong");return}i&&this.props.execCommand("addImage",{imageUrl:i,altText:a})},e.prototype.preventSelectStart=function(t){t.preventDefault()},e.prototype.updated=function(){this.props.show||this.initialize()},e.prototype.render=function(){var t=this,n=this.state,i=n.activeTab,a=n.file,o=n.fileNameElClassName;return $(Zh||(Zh=_([`
      <div aria-label="`,`">
        <`," tabs="," activeTab="," onClick=",` />
        <div style="display:`,`">
          <label for="toastuiImageUrlInput">`,`</label>
          <input
            id="toastuiImageUrlInput"
            type="text"
            ref=`,`
          />
        </div>
        <div style="display:`,`;position: relative;">
          <label for="toastuiImageFileInput">`,`</label>
          <span
            class="`,"",`"
            onClick=`,`
            onSelectstart=`,`
          >
            `,`
          </span>
          <button
            type="button"
            class="`,`"
            onClick=`,`
          >
            `,`
          </button>
          <input
            id="toastuiImageFileInput"
            type="file"
            accept="image/*"
            onChange=`,`
            ref=`,`
          />
        </div>
        <label for="toastuiAltTextInput">`,`</label>
        <input
          id="toastuiAltTextInput"
          type="text"
          ref=`,`
        />
        <div class="`,`">
          <button type="button" class="`,'" onClick=',`>
            `,`
          </button>
          <button type="button" class="`,'" onClick=',`>
            `,`
          </button>
        </div>
      </div>
    `],[`
      <div aria-label="`,`">
        <`," tabs="," activeTab="," onClick=",` />
        <div style="display:`,`">
          <label for="toastuiImageUrlInput">`,`</label>
          <input
            id="toastuiImageUrlInput"
            type="text"
            ref=`,`
          />
        </div>
        <div style="display:`,`;position: relative;">
          <label for="toastuiImageFileInput">`,`</label>
          <span
            class="`,"",`"
            onClick=`,`
            onSelectstart=`,`
          >
            `,`
          </span>
          <button
            type="button"
            class="`,`"
            onClick=`,`
          >
            `,`
          </button>
          <input
            id="toastuiImageFileInput"
            type="file"
            accept="image/*"
            onChange=`,`
            ref=`,`
          />
        </div>
        <label for="toastuiAltTextInput">`,`</label>
        <input
          id="toastuiAltTextInput"
          type="text"
          ref=`,`
        />
        <div class="`,`">
          <button type="button" class="`,'" onClick=',`>
            `,`
          </button>
          <button type="button" class="`,'" onClick=',`>
            `,`
          </button>
        </div>
      </div>
    `])),B.get("Insert image"),Xh,this.tabs,i,this.toggleTab,i==="url"?"block":"none",B.get("Image URL"),function(s){return t.refs.url=s},i==="file"?"block":"none",B.get("Select image file"),N("file-name"),a?" has-file":o,this.showFileSelectBox,this.preventSelectStart,a?a.name:B.get("No file"),N("file-select-button"),this.showFileSelectBox,B.get("Choose a file"),this.changeFile,function(s){return t.refs.file=s},B.get("Description"),function(s){return t.refs.altText=s},N("button-container"),N("close-button"),this.props.hidePopup,B.get("Cancel"),N("ok-button"),this.execCommand,B.get("OK"))},e})(we),Zh,Eoe=(function(r){O(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.execCommand=function(){var n=t.refs.url,i=t.refs.text;if(Ge(n,"wrong"),Ge(i,"wrong"),n.value.length<1){nt(n,"wrong");return}var a=je(t.props.initialValues.linkUrl);if(a&&i.value.length<1){nt(i,"wrong");return}t.props.execCommand("addLink",{linkUrl:n.value,linkText:i.value})},t}return e.prototype.initialize=function(){var t=this.props.initialValues,n=t.linkUrl,i=t.linkText,a=this.refs.url,o=this.refs.text;Ge(a,"wrong"),Ge(o,"wrong","disabled"),o.removeAttribute("disabled"),n&&(nt(o,"disabled"),o.setAttribute("disabled","disabled")),a.value=n||"",o.value=i||""},e.prototype.mounted=function(){this.initialize()},e.prototype.updated=function(t){!t.show&&this.props.show&&this.initialize()},e.prototype.render=function(){var t=this;return $(ep||(ep=_([`
      <div aria-label="`,`">
        <label for="toastuiLinkUrlInput">`,`</label>
        <input
          id="toastuiLinkUrlInput"
          type="text"
          ref=`,`
        />
        <label for="toastuiLinkTextInput">`,`</label>
        <input
          id="toastuiLinkTextInput"
          type="text"
          ref=`,`
        />
        <div class="`,`">
          <button type="button" class="`,'" onClick=',`>
            `,`
          </button>
          <button type="button" class="`,'" onClick=',`>
            `,`
          </button>
        </div>
      </div>
    `],[`
      <div aria-label="`,`">
        <label for="toastuiLinkUrlInput">`,`</label>
        <input
          id="toastuiLinkUrlInput"
          type="text"
          ref=`,`
        />
        <label for="toastuiLinkTextInput">`,`</label>
        <input
          id="toastuiLinkTextInput"
          type="text"
          ref=`,`
        />
        <div class="`,`">
          <button type="button" class="`,'" onClick=',`>
            `,`
          </button>
          <button type="button" class="`,'" onClick=',`>
            `,`
          </button>
        </div>
      </div>
    `])),B.get("Insert link"),B.get("URL"),function(n){return t.refs.url=n},B.get("Link text"),function(n){return t.refs.text=n},N("button-container"),N("close-button"),this.props.hidePopup,B.get("Cancel"),N("ok-button"),this.execCommand,B.get("OK"))},e})(we),ep,tp=20,rp=20,np=5,ip=14,ap=5,op=9,Moe=1,Soe=1,sp=1,Ooe=(function(r){O(e,r);function e(t){var n=r.call(this,t)||this;return n.extendSelectionRange=function(i){var a=i.pageX,o=i.pageY,s=a-n.offsetRect.left,l=o-n.offsetRect.top,u=n.getSelectionRangeByOffset(s,l);n.setState(b({},u))},n.execCommand=function(){n.props.execCommand("addTable",{rowCount:n.state.rowIdx+1,columnCount:n.state.colIdx+1})},n.state={rowIdx:-1,colIdx:-1},n}return e.prototype.getDescription=function(){return this.state.colIdx===-1?"":this.state.colIdx+1+" x "+(this.state.rowIdx+1)},e.prototype.getBoundByRange=function(t,n){return{width:(t+1)*tp,height:(n+1)*rp}},e.prototype.getRangeByOffset=function(t,n){return{colIdx:Math.floor(t/tp),rowIdx:Math.floor(n/rp)}},e.prototype.getTableRange=function(){var t=this.state,n=t.colIdx,i=t.rowIdx,a=Math.max(n,ap),o=Math.max(i,np);return n>=ap&&a<op&&(a+=1),i>=np&&o<ip&&(o+=1),{colIdx:a+1,rowIdx:o+1}},e.prototype.getSelectionAreaBound=function(){var t=this.getBoundByRange(this.state.colIdx,this.state.rowIdx),n=t.width,i=t.height;return!n&&!i?{display:"none"}:{width:n-sp,height:i-sp,display:"block"}},e.prototype.getSelectionRangeByOffset=function(t,n){var i=this.getRangeByOffset(t,n);return i.rowIdx=Math.min(Math.max(i.rowIdx,Moe),ip),i.colIdx=Math.min(Math.max(i.colIdx,Soe),op),i},e.prototype.updated=function(){if(!this.props.show)this.setState({colIdx:-1,rowIdx:-1});else if(this.state.colIdx===-1&&this.state.rowIdx===-1){var t=this.refs.tableEl.getBoundingClientRect(),n=t.left,i=t.top;this.offsetRect={left:window.pageXOffset+n,top:window.pageYOffset+i}}},e.prototype.createTableArea=function(t){for(var n=t.colIdx,i=t.rowIdx,a=[],o=0;o<i;o+=1){for(var s=[],l=0;l<n;l+=1){var u=""+N("table-cell")+(o>0?"":" header");s.push($(lp||(lp=_(['<div class="','"></div>'],['<div class="','"></div>'])),u))}a.push($(up||(up=_(['<div class="','">',"</div>"],['<div class="','">',"</div>"])),N("table-row"),s))}return $(cp||(cp=_(['<div class="','">',"</div>"],['<div class="','">',"</div>"])),N("table"),a)},e.prototype.render=function(){var t=this,n=this.getTableRange(),i=this.getSelectionAreaBound();return $(fp||(fp=_([`
      <div aria-label="`,`">
        <div
          class="`,`"
          ref=`,`
          onMousemove=`,`
          onClick=`,`
        >
          `,`
          <div class="`,'" style=',`></div>
        </div>
        <p class="`,'">',`</p>
      </div>
    `],[`
      <div aria-label="`,`">
        <div
          class="`,`"
          ref=`,`
          onMousemove=`,`
          onClick=`,`
        >
          `,`
          <div class="`,'" style=',`></div>
        </div>
        <p class="`,'">',`</p>
      </div>
    `])),B.get("Insert table"),N("table-selection"),function(a){return t.refs.tableEl=a},this.extendSelectionRange,this.execCommand,this.createTableArea(n),N("table-selection-layer"),i,N("table-description"),this.getDescription())},e})(we),lp,up,cp,fp,Loe=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.mounted=function(){this.refs.el.appendChild(this.props.body)},e.prototype.updated=function(t){this.refs.el.replaceChild(this.props.body,t.body)},e.prototype.render=function(){var t=this;return $(dp||(dp=_(["<div ref=","></div>"],["<div ref=","></div>"])),function(n){return t.refs.el=n})},e})(we),dp;function As(r){return pt(r)?Aoe(r):r}function Noe(){var r=document.createElement("label"),e=document.createElement("input"),t=document.createElement("span");r.className="scroll-sync active",e.type="checkbox",e.checked=!0,t.className="switch";var n=function(i){return e.addEventListener("change",function(a){var o=a.target.checked;o?nt(r,"active"):Ge(r,"active"),i("toggleScrollSync",{active:o})})};return r.appendChild(e),r.appendChild(t),{name:"scrollSync",el:r,onMounted:n}}function Aoe(r){var e;switch(r){case"heading":e={name:"heading",className:"heading",tooltip:B.get("Headings"),state:"heading"};break;case"bold":e={name:"bold",className:"bold",command:"bold",tooltip:B.get("Bold"),state:"strong"};break;case"italic":e={name:"italic",className:"italic",command:"italic",tooltip:B.get("Italic"),state:"emph"};break;case"strike":e={name:"strike",className:"strike",command:"strike",tooltip:B.get("Strike"),state:"strike"};break;case"hr":e={name:"hr",className:"hrline",command:"hr",tooltip:B.get("Line"),state:"thematicBreak"};break;case"quote":e={name:"quote",className:"quote",command:"blockQuote",tooltip:B.get("Blockquote"),state:"blockQuote"};break;case"ul":e={name:"ul",className:"bullet-list",command:"bulletList",tooltip:B.get("Unordered list"),state:"bulletList"};break;case"ol":e={name:"ol",className:"ordered-list",command:"orderedList",tooltip:B.get("Ordered list"),state:"orderedList"};break;case"task":e={name:"task",className:"task-list",command:"taskList",tooltip:B.get("Task"),state:"taskList"};break;case"table":e={name:"table",className:"table",tooltip:B.get("Insert table"),state:"table"};break;case"image":e={name:"image",className:"image",tooltip:B.get("Insert image")};break;case"link":e={name:"link",className:"link",tooltip:B.get("Insert link")};break;case"code":e={name:"code",className:"code",command:"code",tooltip:B.get("Code"),state:"code"};break;case"codeblock":e={name:"codeblock",className:"codeblock",command:"codeBlock",tooltip:B.get("Insert CodeBlock"),state:"codeBlock"};break;case"indent":e={name:"indent",className:"indent",command:"indent",tooltip:B.get("Indent"),state:"indent"};break;case"outdent":e={name:"outdent",className:"outdent",command:"outdent",tooltip:B.get("Outdent"),state:"outdent"};break;case"scrollSync":e=Noe();break;case"more":e={name:"more",className:"more",tooltip:B.get("More")};break}return e.name!=="scrollSync"&&(e.className+=" "+N("toolbar-icons")),e}function Ds(r,e){var t=e.el,n=e.pos,i=e.popup,a=e.initialValues;switch(r){case"heading":return{render:function(o){return $(hp||(hp=_(["<"," ..."," />"],["<"," ..."," />"])),Coe,o)},className:N("popup-add-heading"),fromEl:t,pos:n};case"link":return{render:function(o){return $(pp||(pp=_(["<"," ..."," />"],["<"," ..."," />"])),Eoe,o)},className:N("popup-add-link"),fromEl:t,pos:n,initialValues:a};case"image":return{render:function(o){return $(vp||(vp=_(["<"," ..."," />"],["<"," ..."," />"])),xoe,o)},className:N("popup-add-image"),fromEl:t,pos:n};case"table":return{render:function(o){return $(mp||(mp=_(["<"," ..."," />"],["<"," ..."," />"])),Ooe,o)},className:N("popup-add-table"),fromEl:t,pos:n};case"customPopupBody":return i?b({render:function(o){return $(gp||(gp=_(["<"," ..."," body="," />"],["<"," ..."," body="," />"])),Loe,o,i.body)},fromEl:t,pos:n},i):null;default:return null}}function ia(r){r.hidden=r.length===r.filter(function(e){return e.hidden}).length}function Doe(r,e){var t=function(n){return n.hidden=n.name==="scrollSync"&&e,n};return r.reduce(function(n,i){n.push(i.map(function(o){return t(As(o))}));var a=n[(n.length||1)-1];return a&&ia(a),n},[])}function Ioe(r,e){r.forEach(function(t){t.forEach(function(n){return n.hidden=n.name==="scrollSync"&&e}),ia(t)})}var hp,pp,vp,mp,gp,Roe=20,Boe=(function(r){O(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.handleMousedown=function(n){!at(n.target,"."+N("popup"))&&!at(n.target,t.props.info.fromEl)&&t.props.hidePopup()},t}return e.prototype.mounted=function(){document.addEventListener("mousedown",this.handleMousedown),this.props.eventEmitter.listen("closePopup",this.props.hidePopup)},e.prototype.beforeDestroy=function(){document.removeEventListener("mousedown",this.handleMousedown)},e.prototype.updated=function(t){var n=this.props,i=n.show,a=n.info;if(i&&a.pos&&t.show!==i){var o=b({},a.pos),s=this.refs.el.offsetWidth,l=at(this.refs.el,"."+N("toolbar")),u=l.offsetWidth;o.left+s>=u&&(o.left=u-s-Roe),fo(this.state.popupPos,o)||this.setState({popupPos:o})}},e.prototype.render=function(){var t=this,n=this.props,i=n.info,a=n.show,o=n.hidePopup,s=n.eventEmitter,l=n.execCommand,u=i||{},c=u.className,f=c===void 0?"":c,d=u.style,h=u.render,p=u.initialValues,v=p===void 0?{}:p,m=b(b({display:a?"block":"none"},d),this.state.popupPos);return $(yp||(yp=_([`
      <div
        class="`," ",`"
        style=`,`
        ref=`,`
        aria-role="dialog"
      >
        <div class="`,`">
          `,`
        </div>
      </div>
    `],[`
      <div
        class="`," ",`"
        style=`,`
        ref=`,`
        aria-role="dialog"
      >
        <div class="`,`">
          `,`
        </div>
      </div>
    `])),N("popup"),f,m,function(g){return t.refs.el=g},N("popup-body"),h&&h({eventEmitter:s,show:a,hidePopup:o,execCommand:l,initialValues:v}))},e})(we),yp,bp=6;function Is(r){return(function(e){O(t,e);function t(n){var i=e.call(this,n)||this;return i.showTooltip=function(a){var o=i.props.item.tooltip;if(!i.props.disabled&&o){var s=i.getBound(a),l=s.left+bp+"px",u=s.top+bp+"px";rt(i.props.tooltipRef.current,{display:"block",left:l,top:u}),i.props.tooltipRef.current.querySelector(".text").textContent=o}},i.hideTooltip=function(){rt(i.props.tooltipRef.current,"display","none")},i.state={active:!1,disabled:n.disabled},i.addEvent(),i}return t.prototype.addEvent=function(){var n=this,i=this.props,a=i.item,o=i.eventEmitter;a.state&&o.listen("changeToolbarState",function(s){var l,u=s.toolbarState,c=(l=u[a.state])!==null&&l!==void 0?l:{},f=c.active,d=c.disabled;n.setState({active:!!f,disabled:d??n.props.disabled})})},t.prototype.getBound=function(n){var i=Xc(n,at(n,"."+N("toolbar"))),a=i.offsetLeft,o=i.offsetTop;return{left:a,top:n.offsetHeight+o}},t.prototype.render=function(){return $(wp||(wp=_([`
        <`,`
          ...`,`
          active=`,`
          showTooltip=`,`
          hideTooltip=`,`
          getBound=`,`
          disabled=`,`
        />
      `],[`
        <`,`
          ...`,`
          active=`,`
          showTooltip=`,`
          hideTooltip=`,`
          getBound=`,`
          disabled=`,`
        />
      `])),r,this.props,this.state.active,this.showTooltip,this.hideTooltip,this.getBound,this.state.disabled||this.props.disabled)},t})(we)}var wp,Poe=80,Hoe=(function(r){O(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.showTooltip=function(){t.props.showTooltip(t.refs.el)},t.execCommand=function(){var n=t.props,i=n.item,a=n.execCommand,o=n.setPopupInfo,s=n.getBound,l=n.eventEmitter,u=i.command,c=i.name,f=i.popup;if(u)a(u);else{var d=f?"customPopupBody":c,h=l.emit("query","getPopupInitialValues",{popupName:d})[0],p=Ds(d,{el:t.refs.el,pos:s(t.refs.el),popup:f,initialValues:h});p&&o(p)}},t}return e.prototype.mounted=function(){this.setItemWidth()},e.prototype.updated=function(t){t.item.name!==this.props.item.name&&this.setItemWidth()},e.prototype.setItemWidth=function(){var t=this.props,n=t.setItemWidth,i=t.item;n&&n(i.name,To(this.refs.el)+(i.hidden?Poe:0))},e.prototype.render=function(){var t=this,n=this.props,i=n.hideTooltip,a=n.disabled,o=n.item,s=n.active,l=b({display:o.hidden?"none":null},o.style),u=""+(o.className||"")+(s?" active":"");return $(kp||(kp=_([`
      <button
        ref=`,`
        type="button"
        style=`,`
        class=`,`
        onClick=`,`
        onMouseover=`,`
        onMouseout=`,`
        disabled=`,`
        aria-label=`,`
      >
        `,`
      </button>
    `],[`
      <button
        ref=`,`
        type="button"
        style=`,`
        class=`,`
        onClick=`,`
        onMouseover=`,`
        onMouseout=`,`
        disabled=`,`
        aria-label=`,`
      >
        `,`
      </button>
    `])),function(c){return t.refs.el=c},l,u,this.execCommand,this.showTooltip,i,!!a,o.text||o.tooltip||"",o.text||"")},e})(we),Foe=Is(Hoe),kp,qoe=(function(r){O(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.showTooltip=function(){t.props.showTooltip(t.refs.el)},t.showPopup=function(){var n=Ds("customPopupBody",{el:t.refs.el,pos:t.props.getBound(t.refs.el),popup:t.props.item.popup});n&&t.props.setPopupInfo(n)},t}return e.prototype.mounted=function(){var t=this.props,n=t.setItemWidth,i=t.item;this.refs.el.appendChild(i.el),n&&n(i.name,To(this.refs.el)),i.onMounted&&i.onMounted(this.props.execCommand)},e.prototype.updated=function(t){var n,i=this.props,a=i.item,o=i.active,s=i.disabled;(t.active!==o||t.disabled!==s)&&((n=a.onUpdated)===null||n===void 0||n.call(a,{active:o,disabled:s}))},e.prototype.render=function(){var t=this,n=this.props,i=n.disabled,a=n.item,o={display:a.hidden?"none":"inline-block"},s=function(l){return i?null:l};return $(Cp||(Cp=_([`
      <div
        ref=`,`
        style=`,`
        class=`,`
        onClick=`,`
        onMouseover=`,`
        onMouseout=`,`
      ></div>
    `],[`
      <div
        ref=`,`
        style=`,`
        class=`,`
        onClick=`,`
        onMouseover=`,`
        onMouseout=`,`
      ></div>
    `])),function(l){return t.refs.el=l},o,N("toolbar-item-wrapper"),s(this.showPopup),s(this.showTooltip),s(this.props.hideTooltip))},e})(we),_oe=Is(qoe),Cp,Tp=(function(r){O(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(){var t=this,n=this.props,i=n.group,a=n.hiddenDivider,o=i.hidden?{display:"none"}:null,s=a?{display:"none"}:null;return $(Ep||(Ep=_([`
      <div class="`,'" style=',`>
        `,`
        <div class="`,'" style=',`></div>
      </div>
    `],[`
      <div class="`,'" style=',`>
        `,`
        <div class="`,'" style=',`></div>
      </div>
    `])),N("toolbar-group"),o,i.map(function(l){var u=l.el?_oe:Foe;return $(xp||(xp=_(["<"," key="," ..."," item="," />"],["<"," key="," ..."," item="," />"])),u,l.name,t.props,l)}),N("toolbar-divider"),s)},e})(we),xp,Ep,$oe=4,zoe=(function(r){O(e,r);function e(t){var n=r.call(this,t)||this;return n.handleClickDocument=function(i){var a=i.target;!at(a,"."+N("dropdown-toolbar"))&&!at(a,".more")&&n.setState({showDropdown:!1,dropdownPos:null})},n.showTooltip=function(){n.props.showTooltip(n.refs.el)},n.state={showDropdown:!1,dropdownPos:null},n}return e.prototype.getBound=function(){var t=this.props.getBound(this.refs.el);return t.top+=$oe,b(b({},t),{left:null,right:10})},e.prototype.mounted=function(){document.addEventListener("click",this.handleClickDocument)},e.prototype.updated=function(){this.state.showDropdown&&!this.state.dropdownPos&&this.setState({dropdownPos:this.getBound()})},e.prototype.beforeDestroy=function(){document.removeEventListener("click",this.handleClickDocument)},e.prototype.render=function(){var t=this,n=this.state,i=n.showDropdown,a=n.dropdownPos,o=this.props,s=o.disabled,l=o.item,u=o.items,c=o.hideTooltip,f=u.filter(function(p){return!p.hidden}),d=f.length?null:{display:"none"},h=i?null:{display:"none"};return $(Sp||(Sp=_([`
      <div class="`,'" style=',`>
        <button
          ref=`,`
          type="button"
          class=`,`
          onClick=`,`
          onMouseover=`,`
          onMouseout=`,`
          disabled=`,`
        ></button>
        <div
          class="`,`"
          style=`,`
          ref=`,`
        >
          `,`
        </div>
      </div>
    `],[`
      <div class="`,'" style=',`>
        <button
          ref=`,`
          type="button"
          class=`,`
          onClick=`,`
          onMouseover=`,`
          onMouseout=`,`
          disabled=`,`
        ></button>
        <div
          class="`,`"
          style=`,`
          ref=`,`
        >
          `,`
        </div>
      </div>
    `])),N("toolbar-group"),d,function(p){return t.refs.el=p},l.className,function(){return t.setState({showDropdown:!0})},this.showTooltip,c,s,N("dropdown-toolbar"),b(b({},h),a),function(p){return t.refs.dropdownEl=p},f.length?f.map(function(p,v){var m;return $(Mp||(Mp=_([`
                  <`,`
                    group=`,`
                    hiddenDivider=`,`
                    ...`,`
                  />
                `],[`
                  <`,`
                    group=`,`
                    hiddenDivider=`,`
                    ...`,`
                  />
                `])),Tp,p,v===f.length-1||((m=f[v+1])===null||m===void 0?void 0:m.hidden),t.props)}):null)},e})(we),Voe=Is(zoe),Mp,Sp,Uoe=50,Woe=(function(r){O(e,r);function e(t){var n=r.call(this,t)||this;return n.toggleTab=function(i,a){var o=n.props.eventEmitter;if(n.state.activeTab!==a){var s=a==="write"?"changePreviewTabWrite":"changePreviewTabPreview";o.emit(s),n.setState({activeTab:a})}},n.setItemWidth=function(i,a){n.itemWidthMap[i]=a},n.setPopupInfo=function(i){n.setState({showPopup:!0,popupInfo:i})},n.openPopup=function(i,a){a===void 0&&(a={});var o=n.refs.el.querySelector("."+N("toolbar-group")+" ."+i);if(o){var s=Xc(o,at(o,"."+N("toolbar"))),l=s.offsetLeft,u=s.offsetTop,c=Ds(i,{el:o,pos:{left:l,top:o.offsetHeight+u},initialValues:a});c&&n.setPopupInfo(c)}},n.hidePopup=function(){n.state.showPopup&&n.setState({showPopup:!1})},n.execCommand=function(i,a){var o=n.props.eventEmitter;o.emit("command",i,a),n.hidePopup()},n.tabs=[{name:"write",text:"Write"},{name:"preview",text:"Preview"}],n.itemWidthMap={},n.initialItems=Doe(t.toolbarItems||[],n.hiddenScrollSync()),n.state={items:n.initialItems,dropdownItems:[],showPopup:!1,popupInfo:{},activeTab:"write"},n.tooltipRef={current:null},n.resizeObserver=new koe(function(){return n.handleResize()}),n.addEvent(),n}return e.prototype.insertToolbarItem=function(t,n){var i=t.groupIndex,a=t.itemIndex,o=this.initialItems[i];n=As(n),o?o.splice(a,0,n):this.initialItems.push([n]),this.setState(this.classifyToolbarItems())},e.prototype.removeToolbarItem=function(t){var n=this;Ar(this.initialItems,function(i){var a=!1;return Ar(i,function(o,s){return o.name===t?(a=!0,i.splice(s,1),n.setState(n.classifyToolbarItems()),!1):!0}),!a})},e.prototype.addEvent=function(){var t=this,n=this.props.eventEmitter;this.handleResize=noe(function(){t.setState({items:t.initialItems,dropdownItems:[]}),t.setState(t.classifyToolbarItems())},200),n.listen("openPopup",this.openPopup)},e.prototype.appendTooltipToRoot=function(){var t='<div class="'+N("tooltip")+`" style="display:none">
        <div class="arrow"></div>
        <span class="text"></span>
      </div>`;this.tooltipRef.current=Jc(t,this.refs.el)},e.prototype.hiddenScrollSync=function(){return this.props.editorType==="wysiwyg"||this.props.previewStyle==="tab"},e.prototype.movePrevItemToDropdownToolbar=function(t,n,i,a){var o=function(l){var u=l.pop();u&&a.push(u)};if(t>1)o(i);else{var s=be(n);s&&o(s)}},e.prototype.classifyToolbarItems=function(){var t=this,n=0,i=this.refs.el.clientWidth,a=this.refs.el.querySelector("."+N("toolbar-divider")),o=a?To(a):0,s=[],l=[],u=!1;return this.initialItems.forEach(function(c,f){var d=[],h=[];c.forEach(function(p,v){p.hidden||(n+=t.itemWidthMap[p.name],n>i-Uoe?(u||(t.movePrevItemToDropdownToolbar(v,s,d,h),u=!0),h.push(p)):d.push(p))}),d.length&&(ia(d),s.push(d)),h.length&&(ia(h),l.push(h)),f<t.state.items.length-1&&(n+=o)}),{items:s,dropdownItems:l}},e.prototype.mounted=function(){this.props.previewStyle==="tab"&&this.props.eventEmitter.emit("changePreviewTabWrite",!0),this.setState(this.classifyToolbarItems()),this.appendTooltipToRoot(),this.resizeObserver.observe(this.refs.el)},e.prototype.updated=function(t){var n=this.props,i=n.editorType,a=n.previewStyle,o=n.eventEmitter,s=a!==t.previewStyle,l=i!==t.editorType;if(s||l){Ioe(this.initialItems,this.hiddenScrollSync());var u=this.classifyToolbarItems();(s||a==="tab"&&i==="markdown")&&(o.emit("changePreviewTabWrite"),u.activeTab="write"),this.setState(u)}},e.prototype.beforeDestroy=function(){window.removeEventListener("resize",this.handleResize),this.resizeObserver.disconnect(),lr(this.tooltipRef.current)},e.prototype.render=function(){var t=this,n=this.props,i=n.previewStyle,a=n.eventEmitter,o=n.editorType,s=this.state,l=s.popupInfo,u=s.showPopup,c=s.activeTab,f=s.items,d=s.dropdownItems,h={eventEmitter:a,tooltipRef:this.tooltipRef,disabled:o==="markdown"&&i==="tab"&&c==="preview",execCommand:this.execCommand,setPopupInfo:this.setPopupInfo},p=i==="tab"?{borderTopLeftRadius:0}:null;return $(Lp||(Lp=_([`
      <div class="`,`">
        <div
          class="`,`"
          style="display: `,`"
        >
          <`," tabs="," activeTab="," onClick=",` />
        </div>
        <div
          class="`,`"
          ref=`,`
          style=`,`
        >
          `,`
          <`,`
            item=`,`
            items=`,`
            ...`,`
          />
        </div>
        <`,`
          info=`,`
          show=`,`
          eventEmitter=`,`
          hidePopup=`,`
          execCommand=`,`
        />
      </div>
    `],[`
      <div class="`,`">
        <div
          class="`,`"
          style="display: `,`"
        >
          <`," tabs="," activeTab="," onClick=",` />
        </div>
        <div
          class="`,`"
          ref=`,`
          style=`,`
        >
          `,`
          <`,`
            item=`,`
            items=`,`
            ...`,`
          />
        </div>
        <`,`
          info=`,`
          show=`,`
          eventEmitter=`,`
          hidePopup=`,`
          execCommand=`,`
        />
      </div>
    `])),N("toolbar"),N("md-tab-container"),o==="wysiwyg"||i==="vertical"?"none":"block",Xh,this.tabs,c,this.toggleTab,N("defaultUI-toolbar"),function(v){return t.refs.el=v},p,f.map(function(v,m){var g;return $(Op||(Op=_([`
              <`,`
                group=`,`
                hiddenDivider=`,`
                setItemWidth=`,`
                ...`,`
              />
            `],[`
              <`,`
                group=`,`
                hiddenDivider=`,`
                setItemWidth=`,`
                ...`,`
              />
            `])),Tp,v,m===f.length-1||((g=f[m+1])===null||g===void 0?void 0:g.hidden),t.setItemWidth,h)}),Voe,As("more"),d,h,Boe,l,u,a,this.hidePopup,this.execCommand)},e})(we),Op,Lp,joe=(function(r){O(e,r);function e(t){var n=r.call(this,t)||this;return n.handleClickDocument=function(i){at(i.target,"."+N("context-menu"))||n.setState({pos:null})},n.state={pos:null,menuGroups:[]},n.addEvent(),n}return e.prototype.addEvent=function(){var t=this;this.props.eventEmitter.listen("contextmenu",function(n){var i=n.pos,a=n.menuGroups;t.setState({pos:i,menuGroups:a})})},e.prototype.mounted=function(){document.addEventListener("click",this.handleClickDocument)},e.prototype.beforeDestroy=function(){document.removeEventListener("click",this.handleClickDocument)},e.prototype.getMenuGroupElements=function(){var t=this,n=this.state,i=n.pos,a=n.menuGroups;return i?a.reduce(function(o,s){var l=[];return s.forEach(function(u){var c=u.label,f=u.className,d=f===void 0?!1:f,h=u.disabled,p=u.onClick,v=function(){h||(p(),t.setState({pos:null}))};l.push($(Np||(Np=_([`
                <li
                  onClick=`,`
                  class="menu-item`,`"
                  aria-role="menuitem"
                >
                  <span class="`,'">',`</span>
                </li>
              `],[`
                <li
                  onClick=`,`
                  class="menu-item`,`"
                  aria-role="menuitem"
                >
                  <span class="`,'">',`</span>
                </li>
              `])),v,h?" disabled":"",d,c))}),o.push($(Ap||(Ap=_([`<ul class="menu-group">
              `,`
            </ul>`],[`<ul class="menu-group">
              `,`
            </ul>`])),l)),o},[]):[]},e.prototype.render=function(){var t=b({display:this.state.pos?"block":"none"},this.state.pos);return $(Dp||(Dp=_(['<div class="','" style=',` aria-role="menu">
      `,`
    </div>`],['<div class="','" style=',` aria-role="menu">
      `,`
    </div>`])),N("context-menu"),t,this.getMenuGroupElements())},e})(we),Np,Ap,Dp,Goe=(function(r){O(e,r);function e(t){var n=r.call(this,t)||this;n.changeMode=function(o){o!==n.state.editorType&&n.setState({editorType:o})},n.changePreviewStyle=function(o){o!==n.state.previewStyle&&n.setState({previewStyle:o})},n.hide=function(){n.setState({hide:!0})},n.show=function(){n.setState({hide:!1})};var i=t.editorType,a=t.previewStyle;return n.state={editorType:i,previewStyle:a,hide:!1},n.addEvent(),n}return e.prototype.mounted=function(){var t=this.props.slots,n=t.wwEditor,i=t.mdEditor,a=t.mdPreview;this.refs.wwContainer.appendChild(n),this.refs.mdContainer.insertAdjacentElement("afterbegin",i),this.refs.mdContainer.appendChild(a)},e.prototype.insertToolbarItem=function(t,n){this.toolbar.insertToolbarItem(t,n)},e.prototype.removeToolbarItem=function(t){this.toolbar.removeToolbarItem(t)},e.prototype.render=function(){var t=this,n=this.props,i=n.eventEmitter,a=n.hideModeSwitch,o=n.toolbarItems,s=n.theme,l=this.state,u=l.hide,c=l.previewStyle,f=l.editorType,d=u?" hidden":"",h=N(f==="markdown"?"md-mode":"ww-mode"),p=N("md")+"-"+c+"-style",v=N([s!=="light",s+" "]);return $(Rp||(Rp=_([`
      <div
        class="`,"","",`"
        ref=`,`
      >
        <`,`
          ref=`,`
          eventEmitter=`,`
          previewStyle=`,`
          toolbarItems=`,`
          editorType=`,`
        />
        <div
          class="`," ",`"
          ref=`,`
        >
          <div class="`,`">
            <div
              class="`," ",`"
              ref=`,`
            >
              <div class="`,`"></div>
            </div>
            <div
              class="`,`"
              ref=`,`
            />
          </div>
        </div>
        `,`
        <`," eventEmitter=",` />
      </div>
    `],[`
      <div
        class="`,"","",`"
        ref=`,`
      >
        <`,`
          ref=`,`
          eventEmitter=`,`
          previewStyle=`,`
          toolbarItems=`,`
          editorType=`,`
        />
        <div
          class="`," ",`"
          ref=`,`
        >
          <div class="`,`">
            <div
              class="`," ",`"
              ref=`,`
            >
              <div class="`,`"></div>
            </div>
            <div
              class="`,`"
              ref=`,`
            />
          </div>
        </div>
        `,`
        <`," eventEmitter=",` />
      </div>
    `])),v,N("defaultUI"),d,function(m){return t.refs.el=m},Woe,function(m){return t.toolbar=m},i,c,o,f,N("main"),h,function(m){return t.refs.editorSection=m},N("main-container"),N("md-container"),p,function(m){return t.refs.mdContainer=m},N("md-splitter"),N("ww-container"),function(m){return t.refs.wwContainer=m},!a&&$(Ip||(Ip=_(["<"," eventEmitter="," editorType="," />"],["<"," eventEmitter="," editorType="," />"])),Qae,i,f),joe,i)},e.prototype.addEvent=function(){var t=this.props.eventEmitter;t.listen("hide",this.hide),t.listen("show",this.show),t.listen("changeMode",this.changeMode),t.listen("changePreviewStyle",this.changePreviewStyle)},e})(we),Ip,Rp,Koe=(function(r){O(e,r);function e(t){var n,i=r.call(this,t)||this,a,o=Yae(i.options.el,$(Bp||(Bp=_([`
        <`,`
          ref=`,`
          eventEmitter=`,`
          slots=`,`
          hideModeSwitch=`,`
          toolbarItems=`,`
          previewStyle=`,`
          editorType=`,`
          theme=`,`
        />
      `],[`
        <`,`
          ref=`,`
          eventEmitter=`,`
          slots=`,`
          hideModeSwitch=`,`
          toolbarItems=`,`
          previewStyle=`,`
          editorType=`,`
          theme=`,`
        />
      `])),Goe,function(s){return a=s},i.eventEmitter,i.getEditorElements(),i.options.hideModeSwitch,i.options.toolbarItems,i.options.previewStyle,i.options.initialEditType,i.options.theme));return i.setMinHeight(i.options.minHeight),i.setHeight(i.options.height),i.defaultUI={insertToolbarItem:a.insertToolbarItem.bind(a),removeToolbarItem:a.removeToolbarItem.bind(a),destroy:o},(n=i.pluginInfo.toolbarItems)===null||n===void 0||n.forEach(function(s){var l=s.groupIndex,u=s.itemIndex,c=s.item;i.defaultUI.insertToolbarItem({groupIndex:l,itemIndex:u},c)}),i.eventEmitter.emit("loadUI",i),i}return e.factory=function(t){return t.viewer?new Nh(t):new e(t)},e.prototype.insertToolbarItem=function(t,n){this.defaultUI.insertToolbarItem(t,n)},e.prototype.removeToolbarItem=function(t){this.defaultUI.removeToolbarItem(t)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.defaultUI.destroy()},e})(Ih),Bp;return Ih.setLanguage(["en","en-US"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Write",Preview:"Preview",Headings:"Headings",Paragraph:"Paragraph",Bold:"Bold",Italic:"Italic",Strike:"Strike",Code:"Inline code",Line:"Line",Blockquote:"Blockquote","Unordered list":"Unordered list","Ordered list":"Ordered list",Task:"Task",Indent:"Indent",Outdent:"Outdent","Insert link":"Insert link","Insert CodeBlock":"Insert codeBlock","Insert table":"Insert table","Insert image":"Insert image",Heading:"Heading","Image URL":"Image URL","Select image file":"Select image file","Choose a file":"Choose a file","No file":"No file",Description:"Description",OK:"OK",More:"More",Cancel:"Cancel",File:"File",URL:"URL","Link text":"Link text","Add row to up":"Add row to up","Add row to down":"Add row to down","Add column to left":"Add column to left","Add column to right":"Add column to right","Remove row":"Remove row","Remove column":"Remove column","Align column to left":"Align column to left","Align column to center":"Align column to center","Align column to right":"Align column to right","Remove table":"Remove table","Would you like to paste as table?":"Would you like to paste as table?","Text color":"Text color","Auto scroll enabled":"Auto scroll enabled","Auto scroll disabled":"Auto scroll disabled","Choose language":"Choose language"}),ca.Editor=Koe,Object.defineProperty(ca,Symbol.toStringTag,{value:"Module"}),ca})({});