diff --git a/prose/prose.js b/prose/prose.js index 6f1d744..45af432 100644 --- a/prose/prose.js +++ b/prose/prose.js @@ -14,15 +14,40 @@ import {EditorState} from "prosemirror-state" import {schema, defaultMarkdownParser, defaultMarkdownSerializer} from "prosemirror-markdown" import {exampleSetup} from "prosemirror-example-setup" +let $title = document.querySelector('#title') +let $content = document.querySelector('#content') + class ProseMirrorView { constructor(target, content) { this.view = new EditorView(target, { state: EditorState.create({ - doc: defaultMarkdownParser.parse(content), + doc: function(content) { + // console.log('loading '+window.draftKey) + let localDraft = localStorage.getItem(window.draftKey); + if (localDraft != null) { + content = localDraft + } + if (content.indexOf("# ") === 0) { + let eol = content.indexOf("\n"); + let title = content.substring("# ".length, eol); + content = content.substring(eol+"\n\n".length); + $title.value = title; + } + return defaultMarkdownParser.parse(content) + }(content), plugins: exampleSetup({schema}) }), dispatchTransaction(transaction) { - document.querySelector('#content').value = defaultMarkdownSerializer.serialize(transaction.doc) + // console.log('saving to '+window.draftKey) + $content.value = defaultMarkdownSerializer.serialize(transaction.doc) + localStorage.setItem(window.draftKey, function() { + let draft = ""; + if ($title.value != null && $title.value !== "") { + draft = "# "+$title.value+"\n\n" + } + draft += $content.value + return draft + }()); let newState = this.state.apply(transaction) this.updateState(newState) } @@ -37,7 +62,7 @@ class ProseMirrorView { } let place = document.querySelector("#editor") -let view = new ProseMirrorView(place, document.querySelector('#content').value) +let view = new ProseMirrorView(place, $content.value) // document.querySelectorAll("input[type=radio]").forEach(button => { // button.addEventListener("change", () => { diff --git a/static/js/prose.bundle.js b/static/js/prose.bundle.js index c6fe84f..a72fe9d 100644 --- a/static/js/prose.bundle.js +++ b/static/js/prose.bundle.js @@ -1,2 +1,1136 @@ -!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=70)}([function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=Object.prototype.hasOwnProperty;function i(t,e){return o.call(t,e)}function s(t){return!(t>=55296&&t<=57343)&&(!(t>=64976&&t<=65007)&&(65535!=(65535&t)&&65534!=(65535&t)&&(!(t>=0&&t<=8)&&(11!==t&&(!(t>=14&&t<=31)&&(!(t>=127&&t<=159)&&!(t>1114111)))))))}function a(t){if(t>65535){var e=55296+((t-=65536)>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}var c=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,l=new RegExp(c.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),u=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,p=n(4);var h=/[&<>"]/,f=/[&<>"]/g,d={"&":"&","<":"<",">":">",'"':"""};function m(t){return d[t]}var v=/[.?*+^$[\]\\(){}|-]/g;var g=n(1);e.lib={},e.lib.mdurl=n(5),e.lib.ucmicro=n(20),e.assign=function(t){var e=Array.prototype.slice.call(arguments,1);return e.forEach((function(e){if(e){if("object"!==r(e))throw new TypeError(e+"must be object");Object.keys(e).forEach((function(n){t[n]=e[n]}))}})),t},e.isString=function(t){return"[object String]"===function(t){return Object.prototype.toString.call(t)}(t)},e.has=i,e.unescapeMd=function(t){return t.indexOf("\\")<0?t:t.replace(c,"$1")},e.unescapeAll=function(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(l,(function(t,e,n){return e||function(t,e){var n=0;return i(p,e)?p[e]:35===e.charCodeAt(0)&&u.test(e)&&s(n="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10))?a(n):t}(t,n)}))},e.isValidEntityCode=s,e.fromCodePoint=a,e.escapeHtml=function(t){return h.test(t)?t.replace(f,m):t},e.arrayReplaceAt=function(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))},e.isSpace=function(t){switch(t){case 9:case 32:return!0}return!1},e.isWhiteSpace=function(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},e.isMdAsciiPunct=function(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},e.isPunctChar=function(t){return g.test(t)},e.escapeRE=function(t){return t.replace(v,"\\$&")},e.normalizeReference=function(t){return t=t.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}},function(t,e){t.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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\u09FD\u0A76\u0AF0\u0C84\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-\u2E4E\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]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},function(t,e,n){"use strict";function r(){this.__rules__=[],this.__cache__=null}r.prototype.__find__=function(t){for(var e=0;e=0&&(n=this.attrs[e][1]),n},r.prototype.attrJoin=function(t,e){var n=this.attrIndex(t);n<0?this.attrPush([t,e]):this.attrs[n][1]=this.attrs[n][1]+" "+e},t.exports=r},function(t,e,n){"use strict";t.exports=n(15)},function(t,e,n){"use strict";t.exports.encode=n(16),t.exports.decode=n(17),t.exports.format=n(18),t.exports.parse=n(19)},function(t,e){t.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},function(t,e){t.exports=/[\0-\x1F\x7F-\x9F]/},function(t,e){t.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/},function(t,e,n){"use strict";var r="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",o="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",i=new RegExp("^(?:"+r+"|"+o+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?].*?[?]>|]*>|)"),s=new RegExp("^(?:"+r+"|"+o+")");t.exports.HTML_TAG_RE=i,t.exports.HTML_OPEN_CLOSE_TAG_RE=s},function(t,e,n){"use strict";function r(t,e){var n,r,o,i,s,a=[],c=e.length;for(n=0;n=0;n--)95!==(r=e[n]).marker&&42!==r.marker||-1!==r.end&&(o=e[r.end],a=n>0&&e[n-1].end===r.end+1&&e[n-1].token===r.token-1&&e[r.end+1].token===o.token+1&&e[n-1].marker===r.marker,s=String.fromCharCode(r.marker),(i=t.tokens[r.token]).type=a?"strong_open":"em_open",i.tag=a?"strong":"em",i.nesting=1,i.markup=a?s+s:s,i.content="",(i=t.tokens[o.token]).type=a?"strong_close":"em_close",i.tag=a?"strong":"em",i.nesting=-1,i.markup=a?s+s:s,i.content="",a&&(t.tokens[e[n-1].token].content="",t.tokens[e[r.end+1].token].content="",n--))}t.exports.tokenize=function(t,e){var n,r,o=t.pos,i=t.src.charCodeAt(o);if(e)return!1;if(95!==i&&42!==i)return!1;for(r=t.scanDelims(t.pos,42===i),n=0;n=0))try{e.hostname=p.toASCII(e.hostname)}catch(t){}return u.encode(u.format(e))}function y(t){var e=u.parse(t,!0);if(e.hostname&&(!e.protocol||v.indexOf(e.protocol)>=0))try{e.hostname=p.toUnicode(e.hostname)}catch(t){}return u.decode(u.format(e))}function b(t,e){if(!(this instanceof b))return new b(t,e);e||r.isString(t)||(e=t||{},t="default"),this.inline=new c,this.block=new a,this.core=new s,this.renderer=new i,this.linkify=new l,this.validateLink=m,this.normalizeLink=g,this.normalizeLinkText=y,this.utils=r,this.helpers=r.assign({},o),this.options={},this.configure(t),e&&this.set(e)}b.prototype.set=function(t){return r.assign(this.options,t),this},b.prototype.configure=function(t){var e,n=this;if(r.isString(t)&&!(t=h[e=t]))throw new Error('Wrong `markdown-it` preset "'+e+'", check name');if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&n.set(t.options),t.components&&Object.keys(t.components).forEach((function(e){t.components[e].rules&&n[e].ruler.enableOnly(t.components[e].rules),t.components[e].rules2&&n[e].ruler2.enableOnly(t.components[e].rules2)})),this},b.prototype.enable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach((function(e){n=n.concat(this[e].ruler.enable(t,!0))}),this),n=n.concat(this.inline.ruler2.enable(t,!0));var r=t.filter((function(t){return n.indexOf(t)<0}));if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},b.prototype.disable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach((function(e){n=n.concat(this[e].ruler.disable(t,!0))}),this),n=n.concat(this.inline.ruler2.disable(t,!0));var r=t.filter((function(t){return n.indexOf(t)<0}));if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},b.prototype.use=function(t){var e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},b.prototype.parse=function(t,e){if("string"!=typeof t)throw new Error("Input data should be a String");var n=new this.core.State(t,this,e);return this.core.process(n),n.tokens},b.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},b.prototype.parseInline=function(t,e){var n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens},b.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)},t.exports=b},function(t){t.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}')},function(t,e,n){"use strict";var r={};function o(t,e,n){var i,s,a,c,l,u="";for("string"!=typeof e&&(n=e,e=o.defaultChars),void 0===n&&(n=!0),l=function(t){var e,n,o=r[t];if(o)return o;for(o=r[t]=[],e=0;e<128;e++)n=String.fromCharCode(e),/^[0-9a-z]$/i.test(n)?o.push(n):o.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2));for(e=0;e=55296&&a<=57343){if(a>=55296&&a<=56319&&i+1=56320&&c<=57343){u+=encodeURIComponent(t[i]+t[i+1]),i++;continue}u+="%EF%BF%BD"}else u+=encodeURIComponent(t[i]);return u}o.defaultChars=";/?:@&=+$,-_.!~*'()#",o.componentChars="-_.!~*'()",t.exports=o},function(t,e,n){"use strict";var r={};function o(t,e){var n;return"string"!=typeof e&&(e=o.defaultChars),n=function(t){var e,n,o=r[t];if(o)return o;for(o=r[t]=[],e=0;e<128;e++)n=String.fromCharCode(e),o.push(n);for(e=0;e=55296&&c<=57343?"���":String.fromCharCode(c),e+=6):240==(248&o)&&e+91114111?l+="����":(c-=65536,l+=String.fromCharCode(55296+(c>>10),56320+(1023&c))),e+=9):l+="�";return l}))}o.defaultChars=";/?:@&=+$,#",o.componentChars="",t.exports=o},function(t,e,n){"use strict";t.exports=function(t){var e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&-1!==t.hostname.indexOf(":")?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||""}},function(t,e,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var o=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,a=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(a),l=["%","/","?",";","#"].concat(c),u=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},d={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};r.prototype.parse=function(t,e){var n,r,i,a,c,m=t;if(m=m.trim(),!e&&1===t.split("#").length){var v=s.exec(m);if(v)return this.pathname=v[1],v[2]&&(this.search=v[2]),this}var g=o.exec(m);if(g&&(i=(g=g[0]).toLowerCase(),this.protocol=g,m=m.substr(g.length)),(e||g||m.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(c="//"===m.substr(0,2))||g&&f[g]||(m=m.substr(2),this.slashes=!0)),!f[g]&&(c||g&&!d[g])){var y,b,k=-1;for(n=0;n127?S+="x":S+=_[A];if(!S.match(p)){var D=C.slice(0,n),E=C.slice(n+1),O=_.match(h);O&&(D.push(O[1]),E.unshift(O[2])),E.length&&(m=E.join(".")+m),this.hostname=D.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var T=m.indexOf("#");-1!==T&&(this.hash=m.substr(T),m=m.slice(0,T));var N=m.indexOf("?");return-1!==N&&(this.search=m.substr(N),m=m.slice(0,N)),m&&(this.pathname=m),d[i]&&this.hostname&&!this.pathname&&(this.pathname=""),this},r.prototype.parseHost=function(t){var e=i.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},t.exports=function(t,e){if(t&&t instanceof r)return t;var n=new r;return n.parse(t,e),n}},function(t,e,n){"use strict";e.Any=n(6),e.Cc=n(7),e.Cf=n(21),e.P=n(1),e.Z=n(8)},function(t,e){t.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},function(t,e,n){"use strict";e.parseLinkLabel=n(23),e.parseLinkDestination=n(24),e.parseLinkTitle=n(25)},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,o,i,s,a=-1,c=t.posMax,l=t.pos;for(t.pos=e+1,r=1;t.pos=n)return c;if(34!==(i=t.charCodeAt(e))&&39!==i&&40!==i)return c;for(e++,40===i&&(i=41);e"+i(t[e].content)+""},s.code_block=function(t,e,n,r,o){var s=t[e];return""+i(t[e].content)+"\n"},s.fence=function(t,e,n,r,s){var a,c,l,u,p=t[e],h=p.info?o(p.info).trim():"",f="";return h&&(f=h.split(/\s+/g)[0]),0===(a=n.highlight&&n.highlight(p.content,f)||i(p.content)).indexOf(""+a+"\n"):"
"+a+"
\n"},s.image=function(t,e,n,r,o){var i=t[e];return i.attrs[i.attrIndex("alt")][1]=o.renderInlineAsText(i.children,n,r),o.renderToken(t,e,n)},s.hardbreak=function(t,e,n){return n.xhtmlOut?"
\n":"
\n"},s.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?"
\n":"
\n":"\n"},s.text=function(t,e){return i(t[e].content)},s.html_block=function(t,e){return t[e].content},s.html_inline=function(t,e){return t[e].content},a.prototype.renderAttrs=function(t){var e,n,r;if(!t.attrs)return"";for(r="",e=0,n=t.attrs.length;e\n":">")},a.prototype.renderInline=function(t,e,n){for(var r,o="",i=this.rules,s=0,a=t.length;s/i.test(t)}t.exports=function(t){var e,n,i,s,a,c,l,u,p,h,f,d,m,v,g,y,b,k,w=t.tokens;if(t.md.options.linkify)for(n=0,i=w.length;n=0;e--)if("link_close"!==(c=s[e]).type){if("html_inline"===c.type&&(k=c.content,/^\s]/i.test(k)&&m>0&&m--,o(c.content)&&m++),!(m>0)&&"text"===c.type&&t.md.linkify.test(c.content)){for(p=c.content,b=t.md.linkify.match(p),l=[],d=c.level,f=0,u=0;uf&&((a=new t.Token("text","",0)).content=p.slice(f,h),a.level=d,l.push(a)),(a=new t.Token("link_open","a",1)).attrs=[["href",g]],a.level=d++,a.markup="linkify",a.info="auto",l.push(a),(a=new t.Token("text","",0)).content=y,a.level=d,l.push(a),(a=new t.Token("link_close","a",-1)).level=--d,a.markup="linkify",a.info="auto",l.push(a),f=b[u].lastIndex);f=0;e--)"text"!==(n=t[e]).type||r||(n.content=n.content.replace(i,a)),"link_open"===n.type&&"auto"===n.info&&r--,"link_close"===n.type&&"auto"===n.info&&r++}function l(t){var e,n,o=0;for(e=t.length-1;e>=0;e--)"text"!==(n=t[e]).type||o||r.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),"link_open"===n.type&&"auto"===n.info&&o--,"link_close"===n.type&&"auto"===n.info&&o++}t.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&(o.test(t.tokens[e].content)&&c(t.tokens[e].children),r.test(t.tokens[e].content)&&l(t.tokens[e].children))}},function(t,e,n){"use strict";var r=n(0).isWhiteSpace,o=n(0).isPunctChar,i=n(0).isMdAsciiPunct,s=/['"]/,a=/['"]/g;function c(t,e,n){return t.substr(0,e)+n+t.substr(e+1)}function l(t,e){var n,s,l,u,p,h,f,d,m,v,g,y,b,k,w,x,C,_,S,A,M;for(S=[],n=0;n=0&&!(S[C].level<=f);C--);if(S.length=C+1,"text"===s.type){p=0,h=(l=s.content).length;t:for(;p=0)m=l.charCodeAt(u.index-1);else for(C=n-1;C>=0&&("softbreak"!==t[C].type&&"hardbreak"!==t[C].type);C--)if("text"===t[C].type){m=t[C].content.charCodeAt(t[C].content.length-1);break}if(v=32,p=48&&m<=57&&(x=w=!1),w&&x&&(w=!1,x=y),w||x){if(x)for(C=S.length-1;C>=0&&(d=S[C],!(S[C].level=0;e--)"inline"===t.tokens[e].type&&s.test(t.tokens[e].content)&&l(t.tokens[e].children,t)}},function(t,e,n){"use strict";var r=n(3);function o(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}o.prototype.Token=r,t.exports=o},function(t,e,n){"use strict";var r=n(2),o=[["table",n(36),["paragraph","reference"]],["code",n(37)],["fence",n(38),["paragraph","reference","blockquote","list"]],["blockquote",n(39),["paragraph","reference","blockquote","list"]],["hr",n(40),["paragraph","reference","blockquote","list"]],["list",n(41),["paragraph","reference","blockquote"]],["reference",n(42)],["heading",n(43),["paragraph","reference","blockquote"]],["lheading",n(44)],["html_block",n(45),["paragraph","reference","blockquote"]],["paragraph",n(47)]];function i(){this.ruler=new r;for(var t=0;t=n))&&!(t.sCount[s]=c){t.line=n;break}for(r=0;rn)return!1;if(p=e+1,t.sCount[p]=4)return!1;if((l=t.bMarks[p]+t.tShift[p])>=t.eMarks[p])return!1;if(124!==(a=t.src.charCodeAt(l++))&&45!==a&&58!==a)return!1;for(;l=4)return!1;if((f=(h=i(c.replace(/^\||\|$/g,""))).length)>m.length)return!1;if(s)return!0;for((d=t.push("table_open","table",1)).map=g=[e,0],(d=t.push("thead_open","thead",1)).map=[e,e+1],(d=t.push("tr_open","tr",1)).map=[e,e+1],u=0;u=4);p++){for(h=i(c.replace(/^\||\|$/g,"")),d=t.push("tr_open","tr",1),u=0;u=4))break;o=++r}return t.line=o,(i=t.push("code_block","code",0)).content=t.getLines(e,o,4+t.blkIndent,!0),i.map=[e,t.line],!0}},function(t,e,n){"use strict";t.exports=function(t,e,n,r){var o,i,s,a,c,l,u,p=!1,h=t.bMarks[e]+t.tShift[e],f=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(h+3>f)return!1;if(126!==(o=t.src.charCodeAt(h))&&96!==o)return!1;if(c=h,(i=(h=t.skipChars(h,o))-c)<3)return!1;if(u=t.src.slice(c,h),s=t.src.slice(h,f),96===o&&s.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;for(a=e;!(++a>=n)&&!((h=c=t.bMarks[a]+t.tShift[a])<(f=t.eMarks[a])&&t.sCount[a]=4||(h=t.skipChars(h,o))-c=4)return!1;if(62!==t.src.charCodeAt(A++))return!1;if(o)return!0;for(c=f=t.sCount[e]+A-(t.bMarks[e]+t.tShift[e]),32===t.src.charCodeAt(A)?(A++,c++,f++,i=!1,k=!0):9===t.src.charCodeAt(A)?(k=!0,(t.bsCount[e]+f)%4==3?(A++,c++,f++,i=!1):i=!0):k=!1,d=[t.bMarks[e]],t.bMarks[e]=A;A=M,y=[t.sCount[e]],t.sCount[e]=f-c,b=[t.tShift[e]],t.tShift[e]=A-t.bMarks[e],x=t.md.block.ruler.getRules("blockquote"),g=t.parentType,t.parentType="blockquote",_=!1,h=e+1;h=(M=t.eMarks[h])));h++)if(62!==t.src.charCodeAt(A++)||_){if(u)break;for(w=!1,a=0,l=x.length;a=M,m.push(t.bsCount[h]),t.bsCount[h]=t.sCount[h]+1+(k?1:0),y.push(t.sCount[h]),t.sCount[h]=f-c,b.push(t.tShift[h]),t.tShift[h]=A-t.bMarks[h]}for(v=t.blkIndent,t.blkIndent=0,(C=t.push("blockquote_open","blockquote",1)).markup=">",C.map=p=[e,0],t.md.block.tokenize(t,e,h),(C=t.push("blockquote_close","blockquote",-1)).markup=">",t.lineMax=S,t.parentType=g,p[1]=t.line,a=0;a=4)return!1;if(42!==(i=t.src.charCodeAt(l++))&&45!==i&&95!==i)return!1;for(s=1;l=s)return-1;if((n=t.src.charCodeAt(i++))<48||n>57)return-1;for(;;){if(i>=s)return-1;if(!((n=t.src.charCodeAt(i++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(i-o>=10)return-1}return i=4)return!1;if(t.listIndent>=0&&t.sCount[e]-t.listIndent>=4&&t.sCount[e]=t.blkIndent&&(q=!0),(D=i(t,e))>=0){if(h=!0,O=t.bMarks[e]+t.tShift[e],y=Number(t.src.substr(O,D-O-1)),q&&1!==y)return!1}else{if(!((D=o(t,e))>=0))return!1;h=!1}if(q&&t.skipSpaces(D)>=t.eMarks[e])return!1;if(g=t.src.charCodeAt(D-1),r)return!0;for(v=t.tokens.length,h?(z=t.push("ordered_list_open","ol",1),1!==y&&(z.attrs=[["start",y]])):z=t.push("bullet_list_open","ul",1),z.map=m=[e,0],z.markup=String.fromCharCode(g),k=e,E=!1,N=t.md.block.ruler.getRules("list"),C=t.parentType,t.parentType="list";k=b?1:w-p)>4&&(u=1),l=p+u,(z=t.push("list_item_open","li",1)).markup=String.fromCharCode(g),z.map=f=[e,0],A=t.tight,S=t.tShift[e],_=t.sCount[e],x=t.listIndent,t.listIndent=t.blkIndent,t.blkIndent=l,t.tight=!0,t.tShift[e]=a-t.bMarks[e],t.sCount[e]=w,a>=b&&t.isEmpty(e+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,e,n,!0),t.tight&&!E||(I=!1),E=t.line-e>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=x,t.tShift[e]=S,t.sCount[e]=_,t.tight=A,(z=t.push("list_item_close","li",-1)).markup=String.fromCharCode(g),k=e=t.line,f[1]=k,a=t.bMarks[e],k>=n)break;if(t.sCount[k]=4)break;for(T=!1,c=0,d=N.length;c=4)return!1;if(91!==t.src.charCodeAt(C))return!1;for(;++C<_;)if(93===t.src.charCodeAt(C)&&92!==t.src.charCodeAt(C-1)){if(C+1===_)return!1;if(58!==t.src.charCodeAt(C+1))return!1;break}for(l=t.lineMax,k=t.md.block.ruler.getRules("reference"),m=t.parentType,t.parentType="reference";S3||t.sCount[S]<0)){for(b=!1,p=0,h=k.length;p=4)return!1;if(35!==(i=t.src.charCodeAt(l))||l>=u)return!1;for(s=1,i=t.src.charCodeAt(++l);35===i&&l6||ll&&r(t.src.charCodeAt(a-1))&&(u=a),t.line=e+1,(c=t.push("heading_open","h"+String(s),1)).markup="########".slice(0,s),c.map=[e,t.line],(c=t.push("inline","",0)).content=t.src.slice(l,u).trim(),c.map=[e,t.line],c.children=[],(c=t.push("heading_close","h"+String(s),-1)).markup="########".slice(0,s)),!0)}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,o,i,s,a,c,l,u,p,h,f=e+1,d=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;for(h=t.parentType,t.parentType="paragraph";f3)){if(t.sCount[f]>=t.blkIndent&&(c=t.bMarks[f]+t.tShift[f])<(l=t.eMarks[f])&&(45===(p=t.src.charCodeAt(c))||61===p)&&(c=t.skipChars(c,p),(c=t.skipSpaces(c))>=l)){u=61===p?1:2;break}if(!(t.sCount[f]<0)){for(o=!1,i=0,s=d.length;i|$))/i,/<\/(script|pre|style)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(o.source+"\\s*$"),/^$/,!1]];t.exports=function(t,e,n,r){var o,s,a,c,l=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(!t.md.options.html)return!1;if(60!==t.src.charCodeAt(l))return!1;for(c=t.src.slice(l,u),o=0;o3||t.sCount[c]<0)){for(r=!1,o=0,i=l.length;o0&&this.level++,this.tokens.push(o),o},i.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},i.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;te;)if(!o(this.src.charCodeAt(--t)))return t+1;return t},i.prototype.skipChars=function(t,e){for(var n=this.src.length;tn;)if(e!==this.src.charCodeAt(--t))return t+1;return t},i.prototype.getLines=function(t,e,n,r){var i,s,a,c,l,u,p,h=t;if(t>=e)return"";for(u=new Array(e-t),i=0;hn?new Array(s-n+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return u.join("")},i.prototype.Token=r,t.exports=i},function(t,e,n){"use strict";var r=n(2),o=[["text",n(50)],["newline",n(51)],["escape",n(52)],["backticks",n(53)],["strikethrough",n(10).tokenize],["emphasis",n(11).tokenize],["link",n(54)],["image",n(55)],["autolink",n(56)],["html_inline",n(57)],["entity",n(58)]],i=[["balance_pairs",n(59)],["strikethrough",n(10).postProcess],["emphasis",n(11).postProcess],["text_collapse",n(60)]];function s(){var t;for(this.ruler=new r,t=0;t=i)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},s.prototype.parse=function(t,e,n,r){var o,i,s,a=new this.State(t,e,n,r);for(this.tokenize(a),s=(i=this.ruler2.getRules("")).length,o=0;o=0&&32===t.pending.charCodeAt(n)?n>=1&&32===t.pending.charCodeAt(n-1)?(t.pending=t.pending.replace(/ +$/,""),t.push("hardbreak","br",0)):(t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0)):t.push("softbreak","br",0)),i++;i?@[]^_`{|}~-".split("").forEach((function(t){o[t.charCodeAt(0)]=1})),t.exports=function(t,e){var n,i=t.pos,s=t.posMax;if(92!==t.src.charCodeAt(i))return!1;if(++i=m)return!1;for(v=l,(u=t.md.helpers.parseLinkDestination(t.src,l,t.posMax)).ok&&(f=t.md.normalizeLink(u.str),t.md.validateLink(f)?l=u.pos:f=""),v=l;l=m||41!==t.src.charCodeAt(l))&&(g=!0),l++}if(g){if(void 0===t.env.references)return!1;if(l=0?s=t.src.slice(v,l++):l=a+1):l=a+1,s||(s=t.src.slice(c,a)),!(p=t.env.references[r(s)]))return t.pos=d,!1;f=p.href,h=p.title}return e||(t.pos=c,t.posMax=a,t.push("link_open","a",1).attrs=n=[["href",f]],h&&n.push(["title",h]),t.md.inline.tokenize(t),t.push("link_close","a",-1)),t.pos=l,t.posMax=m,!0}},function(t,e,n){"use strict";var r=n(0).normalizeReference,o=n(0).isSpace;t.exports=function(t,e){var n,i,s,a,c,l,u,p,h,f,d,m,v,g="",y=t.pos,b=t.posMax;if(33!==t.src.charCodeAt(t.pos))return!1;if(91!==t.src.charCodeAt(t.pos+1))return!1;if(l=t.pos+2,(c=t.md.helpers.parseLinkLabel(t,t.pos+1,!1))<0)return!1;if((u=c+1)=b)return!1;for(v=u,(h=t.md.helpers.parseLinkDestination(t.src,u,t.posMax)).ok&&(g=t.md.normalizeLink(h.str),t.md.validateLink(g)?u=h.pos:g=""),v=u;u=b||41!==t.src.charCodeAt(u))return t.pos=y,!1;u++}else{if(void 0===t.env.references)return!1;if(u=0?a=t.src.slice(v,u++):u=c+1):u=c+1,a||(a=t.src.slice(l,c)),!(p=t.env.references[r(a)]))return t.pos=y,!1;g=p.href,f=p.title}return e||(s=t.src.slice(l,c),t.md.inline.parse(s,t.md,t.env,m=[]),(d=t.push("image","img",0)).attrs=n=[["src",g],["alt",""]],d.children=m,d.content=s,f&&n.push(["title",f])),t.pos=u,t.posMax=b,!0}},function(t,e,n){"use strict";var r=/^<([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])?)*)>/,o=/^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;t.exports=function(t,e){var n,i,s,a,c,l,u=t.pos;return 60===t.src.charCodeAt(u)&&(!((n=t.src.slice(u)).indexOf(">")<0)&&(o.test(n)?(a=(i=n.match(o))[0].slice(1,-1),c=t.md.normalizeLink(a),!!t.md.validateLink(c)&&(e||((l=t.push("link_open","a",1)).attrs=[["href",c]],l.markup="autolink",l.info="auto",(l=t.push("text","",0)).content=t.md.normalizeLinkText(a),(l=t.push("link_close","a",-1)).markup="autolink",l.info="auto"),t.pos+=i[0].length,!0)):!!r.test(n)&&(a=(s=n.match(r))[0].slice(1,-1),c=t.md.normalizeLink("mailto:"+a),!!t.md.validateLink(c)&&(e||((l=t.push("link_open","a",1)).attrs=[["href",c]],l.markup="autolink",l.info="auto",(l=t.push("text","",0)).content=t.md.normalizeLinkText(a),(l=t.push("link_close","a",-1)).markup="autolink",l.info="auto"),t.pos+=s[0].length,!0))))}},function(t,e,n){"use strict";var r=n(9).HTML_TAG_RE;t.exports=function(t,e){var n,o,i,s=t.pos;return!!t.md.options.html&&(i=t.posMax,!(60!==t.src.charCodeAt(s)||s+2>=i)&&(!(33!==(n=t.src.charCodeAt(s+1))&&63!==n&&47!==n&&!function(t){var e=32|t;return e>=97&&e<=122}(n))&&(!!(o=t.src.slice(s).match(r))&&(e||(t.push("html_inline","",0).content=t.src.slice(s,s+o[0].length)),t.pos+=o[0].length,!0))))}},function(t,e,n){"use strict";var r=n(4),o=n(0).has,i=n(0).isValidEntityCode,s=n(0).fromCodePoint,a=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,c=/^&([a-z][a-z0-9]{1,31});/i;t.exports=function(t,e){var n,l,u=t.pos,p=t.posMax;if(38!==t.src.charCodeAt(u))return!1;if(u+1s;r-=i.jump+1)if((i=e[r]).marker===o.marker&&(-1===a&&(a=r),i.open&&i.end<0&&i.level===o.level&&(c=!1,(i.close||o.open)&&(i.length+o.length)%3==0&&(i.length%3==0&&o.length%3==0||(c=!0)),!c))){l=r>0&&!e[r-1].open?e[r-1].jump+1:0,o.jump=n-r+l,o.open=!1,i.end=n,i.jump=l,i.close=!1,a=-1;break}-1!==a&&(u[o.marker][(o.length||0)%3]=a)}}t.exports=function(t){var e,n=t.tokens_meta,o=t.tokens_meta.length;for(r(0,t.delimiters),e=0;e0&&r++,"text"===o[e].type&&e+10&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(i),o},a.prototype.scanDelims=function(t,e){var n,r,a,c,l,u,p,h,f,d=t,m=!0,v=!0,g=this.posMax,y=this.src.charCodeAt(t);for(n=t>0?this.src.charCodeAt(t-1):32;d=3&&":"===t[e-3]||e>=3&&"/"===t[e-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){var r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},l="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function u(t){var e=t.re=n(63)(t.__opts__),r=t.__tlds__.slice();function a(t){return t.replace("%TLDS%",e.src_tlds)}t.onCompile(),t.__tlds_replaced__||r.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),r.push(e.src_xn),e.src_tlds=r.join("|"),e.email_fuzzy=RegExp(a(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(a(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(a(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(a(e.tpl_host_fuzzy_test),"i");var c=[];function l(t,e){throw new Error('(LinkifyIt) Invalid schema "'+t+'": '+e)}t.__compiled__={},Object.keys(t.__schemas__).forEach((function(e){var n=t.__schemas__[e];if(null!==n){var r={validate:null,link:null};if(t.__compiled__[e]=r,"[object Object]"===o(n))return!function(t){return"[object RegExp]"===o(t)}(n.validate)?i(n.validate)?r.validate=n.validate:l(e,n):r.validate=function(t){return function(e,n){var r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}(n.validate),void(i(n.normalize)?r.normalize=n.normalize:n.normalize?l(e,n):r.normalize=function(t,e){e.normalize(t)});!function(t){return"[object String]"===o(t)}(n)?l(e,n):c.push(e)}})),c.forEach((function(e){t.__compiled__[t.__schemas__[e]]&&(t.__compiled__[e].validate=t.__compiled__[t.__schemas__[e]].validate,t.__compiled__[e].normalize=t.__compiled__[t.__schemas__[e]].normalize)})),t.__compiled__[""]={validate:null,normalize:function(t,e){e.normalize(t)}};var u=Object.keys(t.__compiled__).filter((function(e){return e.length>0&&t.__compiled__[e]})).map(s).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+u+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+u+")","ig"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),function(t){t.__index__=-1,t.__text_cache__=""}(t)}function p(t,e){var n=t.__index__,r=t.__last_index__,o=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=o,this.text=o,this.url=o}function h(t,e){var n=new p(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function f(t,e){if(!(this instanceof f))return new f(t,e);var n;e||(n=t,Object.keys(n||{}).reduce((function(t,e){return t||a.hasOwnProperty(e)}),!1)&&(e=t,t={})),this.__opts__=r({},a,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=r({},c,t),this.__compiled__={},this.__tlds__=l,this.__tlds_replaced__=!1,this.re={},u(this)}f.prototype.add=function(t,e){return this.__schemas__[t]=e,u(this),this},f.prototype.set=function(t){return this.__opts__=r(this.__opts__,t),this},f.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;var e,n,r,o,i,s,a,c;if(this.re.schema_test.test(t))for((a=this.re.schema_search).lastIndex=0;null!==(e=a.exec(t));)if(o=this.testSchemaAt(t,e[2],a.lastIndex)){this.__schema__=e[2],this.__index__=e.index+e[1].length,this.__last_index__=e.index+e[0].length+o;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||c=0&&null!==(r=t.match(this.re.email_fuzzy))&&(i=r.index+r[1].length,s=r.index+r[0].length,(this.__index__<0||ithis.__last_index__)&&(this.__schema__="mailto:",this.__index__=i,this.__last_index__=s)),this.__index__>=0},f.prototype.pretest=function(t){return this.re.pretest.test(t)},f.prototype.testSchemaAt=function(t,e,n){return this.__compiled__[e.toLowerCase()]?this.__compiled__[e.toLowerCase()].validate(t,n,this):0},f.prototype.match=function(t){var e=0,n=[];this.__index__>=0&&this.__text_cache__===t&&(n.push(h(this,e)),e=this.__last_index__);for(var r=e?t.slice(e):t;this.test(r);)n.push(h(this,e)),r=r.slice(this.__last_index__),e+=this.__last_index__;return n.length?n:null},f.prototype.tlds=function(t,e){return t=Array.isArray(t)?t:[t],e?(this.__tlds__=this.__tlds__.concat(t).sort().filter((function(t,e,n){return t!==n[e-1]})).reverse(),u(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,u(this),this)},f.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),"mailto:"!==t.schema||/^mailto:/i.test(t.url)||(t.url="mailto:"+t.url)},f.prototype.onCompile=function(){},t.exports=f},function(t,e,n){"use strict";t.exports=function(t){var e={};e.src_Any=n(6).source,e.src_Cc=n(7).source,e.src_Z=n(8).source,e.src_P=n(1).source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");return e.src_pseudo_letter="(?:(?![><|]|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|[><|]|"+e.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-]).|\\.{2,4}[a-zA-Z0-9%/]|\\.(?!"+e.src_ZCc+"|[.]).|"+(t&&t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+e.src_ZCc+").|\\!(?!"+e.src_ZCc+"|[!]).|\\?(?!"+e.src_ZCc+"|[?]).)+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy='(^|[><|]|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}},function(t,e,n){(function(t,r){var o;function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)} -/*! https://mths.be/punycode v1.4.1 by @mathias */!function(s){var a="object"==i(e)&&e&&!e.nodeType&&e,c="object"==i(t)&&t&&!t.nodeType&&t,l="object"==(void 0===r?"undefined":i(r))&&r;l.global!==l&&l.window!==l&&l.self!==l||(s=l);var u,p,h=2147483647,f=/^xn--/,d=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=Math.floor,y=String.fromCharCode;function b(t){throw new RangeError(v[t])}function k(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function w(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+k((t=t.replace(m,".")).split("."),e).join(".")}function x(t){for(var e,n,r=[],o=0,i=t.length;o=55296&&e<=56319&&o65535&&(e+=y((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=y(t)})).join("")}function _(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function S(t,e,n){var r=0;for(t=n?g(t/700):t>>1,t+=g(t/e);t>455;r+=36)t=g(t/35);return g(r+36*t/(t+38))}function A(t){var e,n,r,o,i,s,a,c,l,u,p,f=[],d=t.length,m=0,v=128,y=72;for((n=t.lastIndexOf("-"))<0&&(n=0),r=0;r=128&&b("not-basic"),f.push(t.charCodeAt(r));for(o=n>0?n+1:0;o=d&&b("invalid-input"),((c=(p=t.charCodeAt(o++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36)>=36||c>g((h-m)/s))&&b("overflow"),m+=c*s,!(c<(l=a<=y?1:a>=y+26?26:a-y));a+=36)s>g(h/(u=36-l))&&b("overflow"),s*=u;y=S(m-i,e=f.length+1,0==i),g(m/e)>h-v&&b("overflow"),v+=g(m/e),m%=e,f.splice(m++,0,v)}return C(f)}function M(t){var e,n,r,o,i,s,a,c,l,u,p,f,d,m,v,k=[];for(f=(t=x(t)).length,e=128,n=0,i=72,s=0;s=e&&pg((h-n)/(d=r+1))&&b("overflow"),n+=(a-e)*d,e=a,s=0;sh&&b("overflow"),p==e){for(c=n,l=36;!(c<(u=l<=i?1:l>=i+26?26:l-i));l+=36)v=c-u,m=36-u,k.push(y(_(u+v%m,0))),c=g(v/m);k.push(y(_(c,0))),i=S(n,d,r==o),n=0,++r}++n,++e}return k.join("")}if(u={version:"1.4.1",ucs2:{decode:x,encode:C},decode:A,encode:M,toASCII:function(t){return w(t,(function(t){return d.test(t)?"xn--"+M(t):t}))},toUnicode:function(t){return w(t,(function(t){return f.test(t)?A(t.slice(4).toLowerCase()):t}))}},"object"==i(n(12))&&n(12))void 0===(o=function(){return u}.call(e,n,e,t))||(t.exports=o);else if(a&&c)if(t.exports==a)c.exports=u;else for(p in u)u.hasOwnProperty(p)&&(a[p]=u[p]);else s.punycode=u}(this)}).call(this,n(65)(t),n(66))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"===("undefined"==typeof window?"undefined":n(window))&&(r=window)}t.exports=r},function(t,e,n){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},function(t,e,n){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}},function(t,e,n){"use strict";t.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}},function(t,e,n){"use strict";function r(t){this.content=t}n.r(e),r.prototype={constructor:r,find:function(t){for(var e=0;e>1}},r.from=function(t){if(t instanceof r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new r(e)};var o=r;function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=function(t,e){if(this.content=t,this.size=e||0,null==e)for(var n=0;nt&&!1!==n(a,r+s,o,i)&&a.content.size){var l=s+1;a.nodesBetween(Math.max(0,t-l),Math.min(a.content.size,e-l),n,r+l)}s=c}},s.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},s.prototype.textBetween=function(t,e,n,r){var o="",i=!0;return this.nodesBetween(t,e,(function(s,a){s.isText?(o+=s.text.slice(Math.max(t,a)-a,e-a),i=!n):s.isLeaf&&r?(o+=r,i=!n):!i&&s.isBlock&&(o+=n,i=!0)}),0),o},s.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,n=t.firstChild,r=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),o=1);ot)for(var o=0,i=0;it&&((ie)&&(a=a.isText?a.cut(Math.max(0,t-i),Math.min(a.text.length,e-i)):a.cut(Math.max(0,t-i-1),Math.min(a.content.size,e-i-1))),n.push(a),r+=a.nodeSize),i=c}return new s(n,r)},s.prototype.cutByIndex=function(t,e){return t==e?s.empty:0==t&&e==this.content.length?this:new s(this.content.slice(t,e))},s.prototype.replaceChild=function(t,e){var n=this.content[t];if(n==e)return this;var r=this.content.slice(),o=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new s(r,o)},s.prototype.addToStart=function(t){return new s([t].concat(this.content),this.size+t.nodeSize)},s.prototype.addToEnd=function(t){return new s(this.content.concat(t),this.size+t.nodeSize)},s.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;ethis.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var o=r+this.child(n).nodeSize;if(o>=t)return o==t||e>0?l(n+1,o):l(n,r);r=o}},s.prototype.toString=function(){return"<"+this.toStringInner()+">"},s.prototype.toStringInner=function(){return this.content.join(", ")},s.prototype.toJSON=function(){return this.content.length?this.content.map((function(t){return t.toJSON()})):null},s.fromJSON=function(t,e){if(!e)return s.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new s(e.map(t.nodeFromJSON))},s.fromArray=function(t){if(!t.length)return s.empty;for(var e,n=0,r=0;rthis.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(o)}}return e||(e=t.slice()),n||e.push(this),e},p.prototype.removeFromSet=function(t){for(var e=0;et.depth)throw new h("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new h("Inconsistent open depths");return function t(e,n,r,o){var i=e.index(o),a=e.node(o);if(i==n.index(o)&&o=0;o--)r=e.node(o).copy(s.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(r,e),u=l.start,p=l.end;return k(a,function t(e,n,r,o,i){var a=e.depth>i&&g(e,n,i+1),c=o.depth>i&&g(r,o,i+1),l=[];b(null,e,i,l),a&&c&&n.index(i)==r.index(i)?(v(a,c),y(k(a,t(e,n,r,o,i+1)),l)):(a&&y(k(a,w(e,n,i+1)),l),b(n,r,i,l),c&&y(k(c,w(r,o,i+1)),l));return b(o,null,i,l),new s(l)}(e,u,p,n,o))}var h=e.parent,f=h.content;return k(h,f.cut(0,e.parentOffset).append(r.content).append(f.cut(n.parentOffset)))}return k(a,w(e,n,o))}(t,e,n,0)}function v(t,e){if(!e.type.compatibleContent(t.type))throw new h("Cannot join "+e.type.name+" onto "+t.type.name)}function g(t,e,n){var r=t.node(n);return v(r,e.node(n)),r}function y(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function b(t,e,n,r){var o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(y(t.nodeAfter,r),i++));for(var a=i;an)&&y(k(g(t,e,n+1),w(t,e,n+1)),r);return b(e,null,n,r),new s(r)}d.size.get=function(){return this.content.size-this.openStart-this.openEnd},f.prototype.insertAt=function(t,e){var n=function t(e,n,r,o){var i=e.findIndex(n),s=i.index,a=i.offset,c=e.maybeChild(s);if(a==n||c.isText)return o&&!o.canReplace(s,s,r)?null:e.cut(0,n).append(r).append(e.cut(n));var l=t(c.content,n-a-1,r);return l&&e.replaceChild(s,c.copy(l))}(this.content,t+this.openStart,e,null);return n&&new f(n,this.openStart,this.openEnd)},f.prototype.removeBetween=function(t,e){return new f(function t(e,n,r){var o=e.findIndex(n),i=o.index,s=o.offset,a=e.maybeChild(i),c=e.findIndex(r),l=c.index,u=c.offset;if(s==n||a.isText){if(u!=r&&!e.child(l).isText)throw new RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(r))}if(i!=l)throw new RangeError("Removing non-flat range");return e.replaceChild(i,a.copy(t(a.content,n-s-1,r-s-1)))}(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)},f.prototype.eq=function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd},f.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},f.prototype.toJSON=function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},f.fromJSON=function(t,e){if(!e)return f.empty;var n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new f(s.fromJSON(t,e.content),e.openStart||0,e.openEnd||0)},f.maxOpen=function(t,e){void 0===e&&(e=!0);for(var n=0,r=0,o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)n++;for(var i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new f(t,n,r)},Object.defineProperties(f.prototype,d),f.empty=new f(s.empty,0,0);var x=function(t,e,n){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=n},C={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};x.prototype.resolveDepth=function(t){return null==t?this.depth:t<0?this.depth+t:t},C.parent.get=function(){return this.node(this.depth)},C.doc.get=function(){return this.node(0)},x.prototype.node=function(t){return this.path[3*this.resolveDepth(t)]},x.prototype.index=function(t){return this.path[3*this.resolveDepth(t)+1]},x.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)},x.prototype.start=function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1},x.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},x.prototype.before=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]},x.prototype.after=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize},C.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},C.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r},C.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)},x.prototype.marks=function(){var t=this.parent,e=this.index();if(0==t.content.size)return p.none;if(this.textOffset)return t.child(e).marks;var n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){var o=n;n=r,r=o}for(var i=n.marks,s=0;s0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},x.prototype.blockRange=function(t,e){if(void 0===t&&(t=this),t.pos=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new M(this,t,n)},x.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},x.prototype.max=function(t){return t.pos>this.pos?t:this},x.prototype.min=function(t){return t.pos=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var n=[],r=0,o=e,i=t;;){var s=i.content.findIndex(o),a=s.index,c=s.offset,l=o-c;if(n.push(i,a,r+c),!l)break;if((i=i.child(a)).isText)break;o=l-1,r+=c+1}return new x(e,n,o)},x.resolveCached=function(t,e){for(var n=0;n<_.length;n++){var r=_[n];if(r.pos==e&&r.doc==t)return r}var o=_[S]=x.resolve(t,e);return S=(S+1)%A,o},Object.defineProperties(x.prototype,C);var _=[],S=0,A=12,M=function(t,e,n){this.$from=t,this.$to=e,this.depth=n},D={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};D.start.get=function(){return this.$from.before(this.depth+1)},D.end.get=function(){return this.$to.after(this.depth+1)},D.parent.get=function(){return this.$from.node(this.depth)},D.startIndex.get=function(){return this.$from.index(this.depth)},D.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(M.prototype,D);var E=Object.create(null),O=function(t,e,n,r){this.type=t,this.attrs=e,this.content=n||s.empty,this.marks=r||p.none},T={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};T.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},T.childCount.get=function(){return this.content.childCount},O.prototype.child=function(t){return this.content.child(t)},O.prototype.maybeChild=function(t){return this.content.maybeChild(t)},O.prototype.forEach=function(t){this.content.forEach(t)},O.prototype.nodesBetween=function(t,e,n,r){void 0===r&&(r=0),this.content.nodesBetween(t,e,n,r,this)},O.prototype.descendants=function(t){this.nodesBetween(0,this.content.size,t)},T.textContent.get=function(){return this.textBetween(0,this.content.size,"")},O.prototype.textBetween=function(t,e,n,r){return this.content.textBetween(t,e,n,r)},T.firstChild.get=function(){return this.content.firstChild},T.lastChild.get=function(){return this.content.lastChild},O.prototype.eq=function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)},O.prototype.sameMarkup=function(t){return this.hasMarkup(t.type,t.attrs,t.marks)},O.prototype.hasMarkup=function(t,e,n){return this.type==t&&u(this.attrs,e||t.defaultAttrs||E)&&p.sameSet(this.marks,n||p.none)},O.prototype.copy=function(t){return void 0===t&&(t=null),t==this.content?this:new this.constructor(this.type,this.attrs,t,this.marks)},O.prototype.mark=function(t){return t==this.marks?this:new this.constructor(this.type,this.attrs,this.content,t)},O.prototype.cut=function(t,e){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))},O.prototype.slice=function(t,e,n){if(void 0===e&&(e=this.content.size),void 0===n&&(n=!1),t==e)return f.empty;var r=this.resolve(t),o=this.resolve(e),i=n?0:r.sharedDepth(e),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new f(a,r.depth-i,o.depth-i)},O.prototype.replace=function(t,e,n){return m(this.resolve(t),this.resolve(e),n)},O.prototype.nodeAt=function(t){for(var e=this;;){var n=e.content.findIndex(t),r=n.index,o=n.offset;if(!(e=e.maybeChild(r)))return null;if(o==t||e.isText)return e;t-=o+1}},O.prototype.childAfter=function(t){var e=this.content.findIndex(t),n=e.index,r=e.offset;return{node:this.content.maybeChild(n),index:n,offset:r}},O.prototype.childBefore=function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,r=e.offset;if(rt&&this.nodesBetween(t,e,(function(t){return n.isInSet(t.marks)&&(r=!0),!r})),r},T.isBlock.get=function(){return this.type.isBlock},T.isTextblock.get=function(){return this.type.isTextblock},T.inlineContent.get=function(){return this.type.inlineContent},T.isInline.get=function(){return this.type.isInline},T.isText.get=function(){return this.type.isText},T.isLeaf.get=function(){return this.type.isLeaf},T.isAtom.get=function(){return this.type.isAtom},O.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),z(this.marks,t)},O.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},O.prototype.canReplace=function(t,e,n,r,o){void 0===n&&(n=s.empty),void 0===r&&(r=0),void 0===o&&(o=n.childCount);var i=this.contentMatchAt(t).matchFragment(n,r,o),a=i&&i.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(var c=r;c=0;n--)e=t[n].type.name+"("+e+")";return e}var q=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},I={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};q.parse=function(t,e){var n=new R(t,e);if(null==n.next)return q.empty;var r=L(n);n.next&&n.err("Unexpected trailing text");var o=function(t){var e=Object.create(null);return function n(r){var o=[];r.forEach((function(e){t[e].forEach((function(e){var n=e.term,r=e.to;if(n){var i=o.indexOf(n),s=i>-1&&o[i+1];J(t,r).forEach((function(t){s||o.push(n,s=[]),-1==s.indexOf(t)&&s.push(t)}))}}))}));for(var i=e[r.join(",")]=new q(r.indexOf(t.length-1)>-1),s=0;s>1},q.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},q.prototype.toString=function(){var t=[];return function e(n){t.push(n);for(var r=1;r"+t.indexOf(e.next[o+1]);return r})).join("\n")},Object.defineProperties(q.prototype,I),q.empty=new q(!0);var R=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.unshift()},F={next:{configurable:!0}};function L(t){var e=[];do{e.push(B(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function B(t){var e=[];do{e.push(P(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function P(t){for(var e=function(t){if(t.eat("(")){var e=L(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){var n=function(t,e){var n=t.nodeTypes,r=n[e];if(r)return[r];var o=[];for(var i in n){var s=n[i];s.groups.indexOf(e)>-1&&o.push(s)}0==o.length&&t.err("No node type or group '"+e+"' found");return o}(t,t.next).map((function(e){return null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}}));return t.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}t.err("Unexpected token '"+t.next+"'")}(t);;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=$(t,e)}return e}function V(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function $(t,e){var n=V(t),r=n;return t.eat(",")&&(r="}"!=t.next?V(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function j(t,e){return e-t}function J(t,e){var n=[];return function e(r){var o=t[r];if(1==o.length&&!o[0].term)return e(o[0].to);n.push(r);for(var i=0;i-1},K.prototype.allowsMarks=function(t){if(null==this.markSet)return!0;for(var e=0;e-1};var X=function(t){for(var e in this.spec={},t)this.spec[e]=t[e];this.spec.nodes=o.from(t.nodes),this.spec.marks=o.from(t.marks),this.nodes=K.compile(this.spec.nodes,this),this.marks=Q.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var i=this.nodes[r],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[s]||(n[s]=q.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==a?null:a?tt(this,a.split(" ")):""!=a&&i.inlineContent?null:[]}for(var c in this.marks){var l=this.marks[c],u=l.spec.excludes;l.excluded=null==u?[l]:""==u?[]:tt(this,u.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};function tt(t,e){for(var n=[],r=0;r-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}X.prototype.node=function(t,e,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof K))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)},X.prototype.text=function(t,e){var n=this.nodes.text;return new N(n,n.defaultAttrs,t,p.setFrom(e))},X.prototype.mark=function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)},X.prototype.nodeFromJSON=function(t){return O.fromJSON(this,t)},X.prototype.markFromJSON=function(t){return p.fromJSON(this,t)},X.prototype.nodeType=function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e};var et=function(t,e){var n=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((function(t){t.tag?n.tags.push(t):t.style&&n.styles.push(t)}))};et.prototype.parse=function(t,e){void 0===e&&(e={});var n=new at(this,e,!1);return n.addAll(t,null,e.from,e.to),n.finish()},et.prototype.parseSlice=function(t,e){void 0===e&&(e={});var n=new at(this,e,!0);return n.addAll(t,null,e.from,e.to),f.maxOpen(n.finish())},et.prototype.matchTag=function(t,e){for(var n=0;nt.length&&(61!=o.style.charCodeAt(t.length)||o.style.slice(t.length+1)!=e))){if(o.getAttrs){var i=o.getAttrs(e);if(!1===i)continue;o.attrs=i}return o}}},et.schemaRules=function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,r=0;r=0;r--){var o=this.nodes[r],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(n);for(var s=0;sthis.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},at.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},at.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return void(this.open=e)},ct.currentPos.get=function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t},at.prototype.findAtPoint=function(t,e){if(this.find)for(var n=0;n-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),r=this.options.context,o=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1);return function t(s,a){for(;s>=0;s--){var c=n[s];if(""==c){if(s==n.length-1||0==s)continue;for(;a>=i;a--)if(t(s-1,a))return!0;return!1}var l=a>0||0==a&&o?e.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!l||l.name!=c&&-1==l.groups.indexOf(c))return!1;a--}return!0}(n.length-1,this.open)},at.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}},at.prototype.addPendingMark=function(t){this.top.pendingMarks=t.addToSet(this.top.pendingMarks)},at.prototype.removePendingMark=function(t,e){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1?r.pendingMarks=t.removeFromSet(r.pendingMarks):r.activeMarks=t.removeFromSet(r.activeMarks),r==e)break}},Object.defineProperties(at.prototype,ct);var ht=function(t,e){this.nodes=t||{},this.marks=e||{}};function ft(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function dt(t){return t.document||window.document}ht.prototype.serializeFragment=function(t,e,n){var r=this;void 0===e&&(e={}),n||(n=dt(e).createDocumentFragment());var o=n,i=null;return t.forEach((function(t){if(i||t.marks.length){i||(i=[]);for(var n=0,s=0;n=0;r--){var o=this.serializeMark(t.marks[r],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},ht.prototype.serializeMark=function(t,e,n){void 0===n&&(n={});var r=this.marks[t.type.name];return r&&ht.renderSpec(dt(n),r(t,e))},ht.renderSpec=function(t,e,n){if(void 0===n&&(n=null),"string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};var r=e[0],o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));var s=null,a=n?t.createElementNS(n,r):t.createElement(r),c=e[1],l=1;if(c&&"object"==i(c)&&null==c.nodeType&&!Array.isArray(c))for(var u in l=2,c)if(null!=c[u]){var p=u.indexOf(" ");p>0?a.setAttributeNS(u.slice(0,p),u.slice(p+1),c[u]):a.setAttribute(u,c[u])}for(var h=l;hl)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}var d=ht.renderSpec(t,f,n),m=d.dom,v=d.contentDOM;if(a.appendChild(m),v){if(s)throw new RangeError("Multiple content holes");s=v}}return{dom:a,contentDOM:s}},ht.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new ht(this.nodesFromSchema(t),this.marksFromSchema(t)))},ht.nodesFromSchema=function(t){var e=ft(t.nodes);return e.text||(e.text=function(t){return t.text}),e},ht.marksFromSchema=function(t){return ft(t.marks)};var mt=Math.pow(2,16);function vt(t){return 65535&t}var gt=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.pos=t,this.deleted=e,this.recover=n},yt=function(t,e){void 0===e&&(e=!1),this.ranges=t,this.inverted=e};yt.prototype.recover=function(t){var e=0,n=vt(t);if(!this.inverted)for(var r=0;rt)break;var c=this.ranges[s+o],l=this.ranges[s+i],u=a+c;if(t<=u){var p=a+r+((c?t==a?-1:t==u?1:e:e)<0?0:l);if(n)return p;var h=s/3+(t-a)*mt;return new gt(p,e<0?t!=a:t!=u,h)}r+=l-c}return n?t+r:new gt(t+r)},yt.prototype.touches=function(t,e){for(var n=0,r=vt(e),o=this.inverted?2:1,i=this.inverted?1:2,s=0;st)break;var c=this.ranges[s+o];if(t<=a+c&&s==3*r)return!0;n+=this.ranges[s+i]-c}return!1},yt.prototype.forEach=function(t){for(var e=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r=0;e--){var r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:null)}},bt.prototype.invert=function(){var t=new bt;return t.appendMappingInverted(this),t},bt.prototype.map=function(t,e){if(void 0===e&&(e=1),this.mirror)return this._map(t,e,!0);for(var n=this.from;ni&&l0},wt.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(wt.prototype,xt);var _t=Object.create(null),St=function(){};St.prototype.apply=function(t){return Ct()},St.prototype.getMap=function(){return yt.empty},St.prototype.invert=function(t){return Ct()},St.prototype.map=function(t){return Ct()},St.prototype.merge=function(t){return null},St.prototype.toJSON=function(){return Ct()},St.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=_t[e.stepType];if(!n)throw new RangeError("No step type "+e.stepType+" defined");return n.fromJSON(t,e)},St.jsonID=function(t,e){if(t in _t)throw new RangeError("Duplicate use of step JSON ID "+t);return _t[t]=e,e.prototype.jsonID=t,e};var At=function(t,e){this.doc=t,this.failed=e};At.ok=function(t){return new At(t,null)},At.fail=function(t){return new At(null,t)},At.fromReplace=function(t,e,n,r){try{return At.ok(t.replace(e,n,r))}catch(t){if(t instanceof h)return At.fail(t.message);throw t}};var Mt=function(t){function e(e,n,r,o){t.call(this),this.from=e,this.to=n,this.slice=r,this.structure=!!o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){return this.structure&&Et(t,this.from,this.to)?At.fail("Structure replace would overwrite content"):At.fromReplace(t,this.from,this.to,this.slice)},e.prototype.getMap=function(){return new yt([this.from,this.to-this.from,this.slice.size])},e.prototype.invert=function(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)},e.prototype.merge=function(t){if(!(t instanceof e)||t.structure!=this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var n=this.slice.size+t.slice.size==0?f.empty:new f(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}var r=this.slice.size+t.slice.size==0?f.empty:new f(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),r,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,f.fromJSON(t,n.slice),!!n.structure)},e}(St);St.jsonID("replace",Mt);var Dt=function(t){function e(e,n,r,o,i,s,a){t.call(this),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=!!a}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){if(this.structure&&(Et(t,this.from,this.gapFrom)||Et(t,this.gapTo,this.to)))return At.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return At.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?At.fromReplace(t,this.from,this.to,n):At.fail("Content does not fit in gap")},e.prototype.getMap=function(){return new yt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},e.prototype.invert=function(t){var n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),o=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deleted&&r.deleted||or.pos?null:new e(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,f.fromJSON(t,n.slice),n.insert,!!n.structure)},e}(St);function Et(t,e,n){for(var r=t.resolve(e),o=n-e,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var s=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}return!1}function Ot(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Tt(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(ni;a--,c--){var l=o.node(a),u=o.index(a);if(l.type.spec.isolating)return!1;var p=l.content.cutByIndex(u,l.childCount),h=r&&r[c]||l;if(h!=l&&(p=p.replaceChild(0,h.type.create(h.attrs))),!l.canReplace(u+1,l.childCount)||!h.type.validContent(p))return!1}var f=o.indexAfter(i),d=r&&r[0];return o.node(i).canReplaceWith(f,f,d?d.type:o.node(i+1).type)}function It(t,e){var n=t.resolve(e),r=n.index();return Rt(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Rt(t,e){return t&&e&&!t.isLeaf&&t.canAppend(e)}function Ft(t,e,n){void 0===n&&(n=-1);for(var r=t.resolve(e),o=r.depth;;o--){var i=void 0,s=void 0,a=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&Rt(i,s)&&r.node(o).canReplace(a,a+1))return e;if(0==o)break;e=n<0?r.before(o):r.after(o)}}function Lt(t,e,n){var r=t.resolve(e);if(!n.content.size)return e;for(var o=n.content,i=0;i=0;a--){var c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,l=r.index(a)+(c>0?1:0);if(1==s?r.node(a).canReplace(l,l,o):r.node(a).contentMatchAt(l).findWrapping(o.firstChild.type))return 0==c?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function Bt(t,e,n){for(var r=[],o=0;oe;h--)d||n.index(h)>0?(d=!0,u=s.from(n.node(h).copy(u)),p++):c--;for(var m=s.empty,v=0,g=o,y=!1;g>e;g--)y||r.after(g+1)=0;r--)n=s.from(e[r].type.create(e[r].attrs,n));var o=t.start,i=t.end;return this.step(new Dt(o,i,o,i,new f(n,0,0),e.length,!0))},wt.prototype.setBlockType=function(t,e,n,r){var o=this;if(void 0===e&&(e=t),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var i=this.steps.length;return this.doc.nodesBetween(t,e,(function(t,e){if(t.isTextblock&&!t.hasMarkup(n,r)&&function(t,e,n){var r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(o.doc,o.mapping.slice(i).map(e),n)){o.clearIncompatible(o.mapping.slice(i).map(e,1),n);var a=o.mapping.slice(i),c=a.map(e,1),l=a.map(e+t.nodeSize,1);return o.step(new Dt(c,l,c+1,l-1,new f(s.from(n.create(r,null,t.marks)),0,0),1,!0)),!1}})),this},wt.prototype.setNodeMarkup=function(t,e,n,r){var o=this.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");e||(e=o.type);var i=e.create(n,null,r||o.marks);if(o.isLeaf)return this.replaceWith(t,t+o.nodeSize,i);if(!e.validContent(o.content))throw new RangeError("Invalid content for node type "+e.name);return this.step(new Dt(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new f(s.from(i),0,0),1,!0))},wt.prototype.split=function(t,e,n){void 0===e&&(e=1);for(var r=this.doc.resolve(t),o=s.empty,i=s.empty,a=r.depth,c=r.depth-e,l=e-1;a>c;a--,l--){o=s.from(r.node(a).copy(o));var u=n&&n[l];i=s.from(u?u.type.create(u.attrs,i):r.node(a).copy(i))}return this.step(new Mt(t,t,new f(o.append(i),e,e),!0))},wt.prototype.join=function(t,e){void 0===e&&(e=1);var n=new Mt(t-e,t+e,f.empty,!0);return this.step(n)};var Pt=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=t.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new f(Bt(n.content,(function(t,n){return n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t}),o),n.openStart,n.openEnd);return At.fromReplace(t,this.from,this.to,i)},e.prototype.invert=function(){return new Vt(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(St);St.jsonID("addMark",Pt);var Vt=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=new f(Bt(n.content,(function(t){return t.mark(e.mark.removeFromSet(t.marks))})),n.openStart,n.openEnd);return At.fromReplace(t,this.from,this.to,r)},e.prototype.invert=function(){return new Pt(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(St);function $t(t,e,n,r){if(void 0===n&&(n=e),void 0===r&&(r=f.empty),e==n&&!r.size)return null;var o=t.resolve(e),i=t.resolve(n);if(Ht(o,i,r))return new Mt(e,n,r);var a=function(t,e){var n=function t(e,n,r,o){var i=s.empty,a=0,c=r[n];if(e.depth>n){var l=t(e,n+1,r,o||c);a=l.openEnd+1,i=s.from(e.node(n+1).copy(l.content))}c&&(i=i.append(c.content),a=c.openEnd);o&&(i=i.append(e.node(n).contentMatchAt(e.indexAfter(n)).fillBefore(s.empty,!0)),a=0);return{content:i,openEnd:a}}(t,0,e,!1),r=n.content,o=n.openEnd;return new f(r,t.depth,o||0)}(o,function(t,e){for(var n=new Wt(t),r=1;e.size&&r<=3;r++){var o=n.placeSlice(e.content,e.openStart,e.openEnd,r);3==r&&o!=e&&o.size&&(r=0),e=o}for(;n.open.length;)n.closeNode();return n.placed}(o,r)),c=Jt(o,i,a);if(!c)return null;if(a.size!=c.size&&function(t,e,n){if(!e.parent.isTextblock)return!1;var r,o=n.openEnd?function(t,e){for(var n=1;n1&&u==i.end(--l);)++u;var p=Jt(o,t.resolve(u),a);if(p)return new Dt(e,u,n,i.end(),p,a.size)}return c.size||e!=n?new Mt(e,n,c):null}function jt(t,e,n,r,o,i,a){var c,l=t.childCount,u=l-(a>0?1:0),p=i<0?e:n.node(o);c=i<0?p.contentMatchAt(u):1==l&&a>0?p.contentMatchAt(i?n.index(o):n.indexAfter(o)):p.contentMatchAt(n.indexAfter(o)).matchFragment(t,l>0&&i?1:0,u);var h=r.node(o);if(a>0&&o0&&1==l&&(d=null),d){var m=jt(t.lastChild.content,t.lastChild,n,r,o+1,1==l?i-1:-1,a-1);if(m){var v=t.lastChild.copy(m);return d.size?t.cutByIndex(0,l-1).append(d).addToEnd(v):t.replaceChild(l-1,v)}}}a>0&&(c=c.matchType((1==l&&i>0?n.node(o+1):t.lastChild).type));var g=r.index(o);if(g==h.childCount&&!h.type.compatibleContent(e.type))return null;for(var y=c.fillBefore(h.content,!0,g),b=g;y&&b0){var k=function t(e,n,r,o,i){var a,c=e.content,l=c.childCount;a=i>=0?r.node(o).contentMatchAt(r.indexAfter(o)).matchFragment(c,i>0?1:0,l):e.contentMatchAt(l);if(n>0){var u=t(c.lastChild,n-1,r,o+1,1==l?i-1:-1);c=c.replaceChild(l-1,u)}return e.copy(c.append(a.fillBefore(s.empty,!0)))}(t.lastChild,a-1,n,o+1,1==l?i-1:-1);t=t.replaceChild(l-1,k)}return t=t.append(y),r.depth>o&&(t=t.addToEnd(function t(e,n){var r=e.node(n),o=r.contentMatchAt(0).fillBefore(r.content,!0,e.index(n));e.depth>n&&(o=o.addToEnd(t(e,n+1)));return r.copy(o)}(r,o+1))),t}function Jt(t,e,n){var r=jt(n.content,t.node(0),t,e,0,n.openStart,n.openEnd);return r?function(t,e,n){for(;e>0&&n>0&&1==t.childCount;)t=t.firstChild.content,e--,n--;return new f(t,e,n)}(r,n.openStart,e.depth):null}function Ht(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}St.jsonID("removeMark",Vt),wt.prototype.addMark=function(t,e,n){var r=this,o=[],i=[],s=null,a=null;return this.doc.nodesBetween(t,e,(function(r,c,l){if(r.isInline){var u=r.marks;if(!n.isInSet(u)&&l.type.allowsMarkType(n.type)){for(var p=Math.max(c,t),h=Math.min(c+r.nodeSize,e),f=n.addToSet(u),d=0;d=0;d--)this.step(o[d]);return this},wt.prototype.replace=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=f.empty);var r=$t(this.doc,t,e,n);return r&&this.step(r),this},wt.prototype.replaceWith=function(t,e,n){return this.replace(t,e,new f(s.from(n),0,0))},wt.prototype.delete=function(t,e){return this.replace(t,e,f.empty)},wt.prototype.insert=function(t,e){return this.replaceWith(t,t,e)};var Wt=function(t){this.open=[];for(var e=0;e<=t.depth;e++){var n=t.node(e),r=n.contentMatchAt(t.indexAfter(e));this.open.push({parent:n,match:r,content:s.empty,wrapper:!1,openEnd:0,depth:e})}this.placed=[]};function Ut(t,e,n){var r=t.content;if(e>1){var o=Ut(t.firstChild,e-1,1==t.childCount?n-1:0);r=t.content.replaceChild(0,o)}var i=t.type.contentMatch.fillBefore(r,0==n);return t.copy(i.append(r))}function Kt(t,e,n,r,o){if(er){var a=o.contentMatchAt(0),c=a.fillBefore(t).append(t);t=c.append(a.matchFragment(c).fillBefore(s.empty,!0))}return t}function Gt(t,e){for(var n=[],r=Math.min(t.depth,e.depth);r>=0;r--){var o=t.start(r);if(oe.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;o==e.start(r)&&n.push(r)}return n}function Zt(t){return(Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Wt.prototype.placeSlice=function(t,e,n,r,o){if(e>0){var i=t.firstChild,a=this.placeSlice(i.content,Math.max(0,e-1),n&&1==t.childCount?n-1:0,r,i);a.content!=i.content&&(a.content.size?(t=t.replaceChild(0,i.copy(a.content)),e=a.openStart+1):(1==t.childCount&&(n=0),t=t.cutByIndex(1),e=0))}var c=this.placeContent(t,e,n,r,o);if(r>2&&c.size&&0==e){var l=c.content.firstChild,u=1==c.content.childCount;this.placeContent(l.content,0,n&&u?n-1:0,r,l),c=u?s.empty:new f(c.content.cutByIndex(1),0,n)}return c},Wt.prototype.placeContent=function(t,e,n,r,o){for(var i=0;i=0;u--){var p=this.open[u],h=void 0;if(r>1&&(h=p.match.findWrapping(a.type))&&(!o||!h.length||h[h.length-1]!=o.type)){for(;this.open.length-1>u;)this.closeNode();for(var d=0;du;)this.closeNode();a=a.mark(p.parent.type.allowedMarks(a.marks)),e&&(a=Ut(a,e,l?n:0),e=0),this.addNode(p,a,l?n:0),p.match=m,l&&(n=0),c=!0;break}if(!c)break}return this.open.length>1&&(i>0&&i==t.childCount||o&&this.open[this.open.length-1].parent.type==o.type)&&this.closeNode(),new f(t.cutByIndex(i),e,n)},Wt.prototype.addNode=function(t,e,n){var r,o;t.content=(r=t.content,o=t.openEnd,o?r.replaceChild(r.childCount-1,function t(e,n){var r=e.content;if(n>1){var o=t(e.lastChild,n-1);r=e.content.replaceChild(e.childCount-1,o)}var i=e.contentMatchAt(e.childCount).fillBefore(s.empty,!0);return e.copy(r.append(i))}(r.lastChild,o)):r).addToEnd(e),t.openEnd=n},Wt.prototype.closeNode=function(){var t=this.open.pop();0==t.content.size||(t.wrapper?this.addNode(this.open[this.open.length-1],t.parent.copy(t.content),t.openEnd+1):this.placed[t.depth]={depth:t.depth,content:t.content,openEnd:t.openEnd})},wt.prototype.replaceRange=function(t,e,n){if(!n.size)return this.deleteRange(t,e);var r=this.doc.resolve(t),o=this.doc.resolve(e);if(Ht(r,o,n))return this.step(new Mt(t,e,n));var i=Gt(r,this.doc.resolve(e));0==i[i.length-1]&&i.pop();var s=-(r.depth+1);i.unshift(s);for(var a=r.depth,c=r.pos-1;a>0;a--,c--){var l=r.node(a).type.spec;if(l.defining||l.isolating)break;i.indexOf(a)>-1?s=a:r.before(a)==c&&i.splice(1,0,-a)}for(var u=i.indexOf(s),p=[],h=n.openStart,d=n.content,m=0;;m++){var v=d.firstChild;if(p.push(v),m==n.openStart)break;d=v.content}h>0&&p[h-1].type.spec.defining&&r.node(u).type!=p[h-1].type?h-=1:h>=2&&p[h-1].isTextblock&&p[h-2].type.spec.defining&&r.node(u).type!=p[h-2].type&&(h-=2);for(var g=n.openStart;g>=0;g--){var y=(g+h+1)%(n.openStart+1),b=p[y];if(b)for(var k=0;k=0&&(this.replace(t,e,n),!(this.steps.length>S));A--){var M=i[A];A<0||(t=r.before(M),e=o.after(M))}return this},wt.prototype.replaceRangeWith=function(t,e,n){if(!n.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var r=function(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var s=r.depth-1;s>=0;s--){var a=r.indexAfter(s);if(r.node(s).canReplaceWith(a,a,n))return r.after(s+1);if(a0&&(a||n.node(s-1).canReplace(n.index(s-1),r.indexAfter(s-1))))return this.delete(n.before(s),r.after(s))}for(var c=1;c<=n.depth&&c<=r.depth;c++)if(t-n.start(c)==n.depth-c&&e>n.end(c)&&r.end(c)-e!=r.depth-c)return this.delete(n.before(c),e);return this.delete(t,e)};var Yt=Object.create(null),Qt=function(t,e,n){this.ranges=n||[new te(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},Xt={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};Xt.anchor.get=function(){return this.$anchor.pos},Xt.head.get=function(){return this.$head.pos},Xt.from.get=function(){return this.$from.pos},Xt.to.get=function(){return this.$to.pos},Xt.$from.get=function(){return this.ranges[0].$from},Xt.$to.get=function(){return this.ranges[0].$to},Xt.empty.get=function(){for(var t=this.ranges,e=0;e=0;o--){var i=e<0?ae(t.node(0),t.node(o),t.before(o+1),t.index(o),e,n):ae(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,n);if(i)return i}},Qt.near=function(t,e){return void 0===e&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new ie(t.node(0))},Qt.atStart=function(t){return ae(t,t,0,0,1)||new ie(t)},Qt.atEnd=function(t){return ae(t,t,t.content.size,t.childCount,-1)||new ie(t)},Qt.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=Yt[e.type];if(!n)throw new RangeError("No selection type "+e.type+" defined");return n.fromJSON(t,e)},Qt.jsonID=function(t,e){if(t in Yt)throw new RangeError("Duplicate use of selection JSON ID "+t);return Yt[t]=e,e.prototype.jsonID=t,e},Qt.prototype.getBookmark=function(){return ee.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(Qt.prototype,Xt),Qt.prototype.visible=!0;var te=function(t,e){this.$from=t,this.$to=e},ee=function(t){function e(e,n){void 0===n&&(n=e),t.call(this,e,n)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));if(!o.parent.inlineContent)return t.near(o);var i=n.resolve(r.map(this.anchor));return new e(i.parent.inlineContent?i:o,o)},e.prototype.replace=function(e,n){if(void 0===n&&(n=f.empty),t.prototype.replace.call(this,e,n),n==f.empty){var r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head},e.prototype.getBookmark=function(){return new ne(this.anchor,this.head)},e.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,e,n){void 0===n&&(n=e);var r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))},e.between=function(n,r,o){var i=n.pos-r.pos;if(o&&!i||(o=i>=0?1:-1),!r.parent.inlineContent){var s=t.findFrom(r,o,!0)||t.findFrom(r,-o,!0);if(!s)return t.near(r,o);r=s.$head}return n.parent.inlineContent||(0==i||(n=(t.findFrom(n,-o,!0)||t.findFrom(n,o,!0)).$anchor).pos0?0:1);o>0?s=0;s+=o){var a=e.child(s);if(a.isAtom){if(!i&&re.isSelectable(a))return re.create(t,n-(o<0?a.nodeSize:0))}else{var c=ae(t,a,n+o,o<0?a.childCount:0,o,i);if(c)return c}n+=a.nodeSize*o}}function ce(t,e,n){var r=t.steps.length-1;if(!(r0},e.prototype.setStoredMarks=function(t){return this.storedMarks=t,this.updated|=2,this},e.prototype.ensureMarks=function(t){return p.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this},e.prototype.addStoredMark=function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))},e.prototype.removeStoredMark=function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},e.prototype.addStep=function(e,n){t.prototype.addStep.call(this,e,n),this.updated=-3&this.updated,this.storedMarks=null},e.prototype.setTime=function(t){return this.time=t,this},e.prototype.replaceSelection=function(t){return this.selection.replace(this,t),this},e.prototype.replaceSelectionWith=function(t,e){var n=this.selection;return!1!==e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||p.none))),n.replaceWith(this,t),this},e.prototype.deleteSelection=function(){return this.selection.replace(this),this},e.prototype.insertText=function(t,e,n){void 0===n&&(n=e);var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(!t)return this.deleteRange(e,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(e);o=n==e?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,o)),this.selection.empty||this.setSelection(Qt.near(this.selection.$to)),this},e.prototype.setMeta=function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this},e.prototype.getMeta=function(t){return this.meta["string"==typeof t?t:t.key]},n.isGeneric.get=function(){for(var t in this.meta)return!1;return!0},e.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(e.prototype,n),e}(wt);function ue(t,e){return e&&t?t.bind(e):t}var pe=function(t,e,n){this.name=t,this.init=ue(e.init,n),this.apply=ue(e.apply,n)},he=[new pe("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new pe("selection",{init:function(t,e){return t.selection||Qt.atStart(e.doc)},apply:function(t){return t.selection}}),new pe("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new pe("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],fe=function(t,e){var n=this;this.schema=t,this.fields=he.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach((function(t){if(n.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");n.plugins.push(t),n.pluginsByKey[t.key]=t,t.spec.state&&n.fields.push(new pe(t.key,t.spec.state,t))}))},de=function(t){this.config=t},me={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};me.schema.get=function(){return this.config.schema},me.plugins.get=function(){return this.config.plugins},de.prototype.apply=function(t){return this.applyTransaction(t).state},de.prototype.filterTransaction=function(t,e){void 0===e&&(e=-1);for(var n=0;n-1&&ve.splice(e,1)},Object.defineProperties(de.prototype,me);var ve=[];var ge=function(t){this.props={},t.props&&function t(e,n,r){for(var o in e){var i=e[o];i instanceof Function?i=i.bind(n):"handleDOMEvents"==o&&(i=t(i,n,{})),r[o]=i}return r}(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:be("plugin")};ge.prototype.getState=function(t){return t[this.key]};var ye=Object.create(null);function be(t){return t in ye?t+"$"+ ++ye[t]:(ye[t]=0,t+"$")}var ke=function(t){void 0===t&&(t="key"),this.key=be(t)};ke.prototype.get=function(t){return t.config.pluginsByKey[this.key]},ke.prototype.getState=function(t){return t[this.key]};var we={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var xe=/Edge\/(\d+)/.exec(navigator.userAgent),Ce=/MSIE \d/.test(navigator.userAgent),_e=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);we.mac=/Mac/.test(navigator.platform);var Se=we.ie=!!(Ce||_e||xe);we.ie_version=Ce?document.documentMode||6:_e?+_e[1]:xe?+xe[1]:null,we.gecko=!Se&&/gecko\/(\d+)/i.test(navigator.userAgent),we.gecko_version=we.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var Ae=!Se&&/Chrome\/(\d+)/.exec(navigator.userAgent);we.chrome=!!Ae,we.chrome_version=Ae&&+Ae[1],we.ios=!Se&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),we.android=/Android \d/.test(navigator.userAgent),we.webkit=!Se&&"WebkitAppearance"in document.documentElement.style,we.safari=/Apple Computer/.test(navigator.vendor),we.webkit_version=we.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var Me=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},De=function(t){var e=t.parentNode;return e&&11==e.nodeType?e.host:e},Ee=function(t,e,n){var r=document.createRange();return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},Oe=function(t,e,n,r){return n&&(Ne(t,e,n,r,-1)||Ne(t,e,n,r,1))},Te=/^(img|br|input|textarea|hr)$/i;function Ne(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:ze(t))){var i=t.parentNode;if(1!=i.nodeType||qe(t)||Te.test(t.nodeName)||"false"==t.contentEditable)return!1;e=Me(t)+(o<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(o<0?-1:0)]).contentEditable)return!1;e=o<0?ze(t):0}}}function ze(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function qe(t){for(var e,n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var Ie=function(t){var e=t.isCollapsed;return e&&we.chrome&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function Re(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Fe(t){return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function Le(t,e){return"number"==typeof t?t:t[e]}function Be(t,e,n){for(var r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument,s=i.defaultView,a=n||t.dom;a;a=De(a))if(1==a.nodeType){var c=a==i.body||1!=a.nodeType,l=c?Fe(s):a.getBoundingClientRect(),u=0,p=0;if(e.topl.bottom-Le(r,"bottom")&&(p=e.bottom-l.bottom+Le(o,"bottom")),e.leftl.right-Le(r,"right")&&(u=e.right-l.right+Le(o,"right")),(u||p)&&(c?s.scrollBy(u,p):(p&&(a.scrollTop+=p),u&&(a.scrollLeft+=u),e={left:e.left-u,top:e.top-p,right:e.right-u,bottom:e.bottom-p})),c)break}}function Pe(t){for(var e=[],n=t.ownerDocument;t&&(e.push({dom:t,top:t.scrollTop,left:t.scrollLeft}),t!=n);t=De(t));return e}function Ve(t,e){for(var n=0;n=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);var f=h.left>e.left?h.left-e.left:h.right=(h.left+h.right)/2?1:0));continue}}!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(i=l+1)}}return n&&3==n.nodeType?function(t,e){for(var n=t.nodeValue.length,r=document.createRange(),o=0;o=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:t,offset:i}:je(n,r)}function Je(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function He(t,e){var n,r,o,i,s=t.root;if(s.caretPositionFromPoint)try{var a=s.caretPositionFromPoint(e.left,e.top);a&&(o=(n=a).offsetNode,i=n.offset)}catch(t){}if(!o&&s.caretRangeFromPoint){var c=s.caretRangeFromPoint(e.left,e.top);c&&(o=(r=c).startContainer,i=r.startOffset)}var l,u=s.elementFromPoint(e.left,e.top+1);if(!u||!t.dom.contains(1!=u.nodeType?u.parentNode:u)){var p=t.dom.getBoundingClientRect();if(!Je(e,p))return null;if(!(u=function t(e,n,r){var o=e.childNodes.length;if(o&&r.tope.top&&i++}o==t.dom&&i==o.childNodes.length-1&&1==o.lastChild.nodeType&&e.top>o.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:0!=i&&1==o.nodeType&&"BR"==o.childNodes[i-1].nodeName||(l=function(t,e,n,r){for(var o=-1,i=e;i!=t.dom;){var s=t.docView.nearestDesc(i,!0);if(!s)return null;if(s.node.isBlock&&s.parent){var a=s.dom.getBoundingClientRect();if(a.left>r.left||a.top>r.top)o=s.posBefore;else{if(!(a.right-1?o:t.docView.posFromDOM(e,n)}(t,o,i,e))}null==l&&(l=function(t,e,n){var r=je(e,n),o=r.node,i=r.offset,s=-1;if(1==o.nodeType&&!o.firstChild){var a=o.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(o,i,s)}(t,u,e));var d=t.docView.nearestDesc(u,!0);return{pos:l,inside:d?d.posAtStart-d.border:-1}}function We(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}function Ue(t,e){var n=t.docView.domFromPos(e),r=n.node,o=n.offset;if(3==r.nodeType&&(we.chrome||we.gecko)){var i=We(Ee(r,o,o),0);if(we.gecko&&o&&/\s/.test(r.nodeValue[o-1])&&o0&&ol.top&&("up"==n?l.bottomi.bottom-1))return!1}}return!0}))}(t,e,n):function(t,e,n){var r=e.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=getSelection();return Ze.test(r.parent.textContent)&&a.modify?Ge(t,e,(function(){var e=a.getRangeAt(0),o=a.focusNode,i=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");var c=!(r.depth?t.docView.domAfterPos(r.before()):t.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||o==a.focusNode&&i==a.focusOffset;return a.removeAllRanges(),a.addRange(e),null!=s&&(a.caretBidiLevel=s),c})):"left"==n||"backward"==n?i:s}(t,e,n))}var en=function(t,e,n,r){this.parent=t,this.children=e,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},nn={beforePosition:{configurable:!0},size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0}};en.prototype.matchesWidget=function(){return!1},en.prototype.matchesMark=function(){return!1},en.prototype.matchesNode=function(){return!1},en.prototype.matchesHack=function(){return!1},nn.beforePosition.get=function(){return!1},en.prototype.parseRule=function(){return null},en.prototype.stopEvent=function(){return!1},nn.size.get=function(){for(var t=0,e=0;e0:a)?this.posAtEnd:this.posAtStart},en.prototype.nearestDesc=function(t,e){for(var n=!0,r=t;r;r=r.parentNode){var o=this.getDesc(r);if(o&&(!e||o.node)){if(!n||!o.nodeDOM||(1==o.nodeDOM.nodeType?o.nodeDOM.contains(t):o.nodeDOM==t))return o;n=!1}}},en.prototype.getDesc=function(t){for(var e=t.pmViewDesc,n=e;n;n=n.parent)if(n==this)return e},en.prototype.posFromDOM=function(t,e,n){for(var r=t;;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(t,e,n)}},en.prototype.descAt=function(t){for(var e=0,n=0;e=l&&e<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(t,e,l);t=i;for(var u=s;u>0;u--){var p=this.children[u-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){r=Me(p.dom)+1;break}t-=p.size}-1==r&&(r=0)}if(r>-1&&e<=c){e=c;for(var h=s+1;ha&&ie){var d=u;u=p,p=d}f.setEnd(p.node,p.offset),f.setStart(u.node,u.offset)}h.removeAllRanges(),h.addRange(f),h.extend&&h.extend(p.node,p.offset)}},en.prototype.ignoreMutation=function(t){return!this.contentDOM&&"selection"!=t.type},nn.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},en.prototype.markDirty=function(t,e){for(var n=0,r=0;r=n:tn){var s=n+o.border,a=i-o.border;if(t>=s&&e<=a)return this.dirty=t==n||e==i?2:1,void(t!=s||e!=a||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-s,e-s):o.dirty=3);o.dirty=3}n=i}this.dirty=2},en.prototype.markParentsDirty=function(){for(var t=this.parent;t;t=t.parent){t.dirty<2&&(t.dirty=2)}},Object.defineProperties(en.prototype,nn);var rn=[],on=function(t){function e(e,n,r,o){var i,s=n.type.toDOM;if("function"==typeof s&&(s=s(r,(function(){return i?i.parent?i.parent.posBeforeChild(i):void 0:o}))),!n.type.spec.raw){if(1!=s.nodeType){var a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable=!1,s.classList.add("ProseMirror-widget")}t.call(this,e,rn,s,null),this.widget=n,i=this}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={beforePosition:{configurable:!0}};return n.beforePosition.get=function(){return this.widget.type.side<0},e.prototype.matchesWidget=function(t){return 0==this.dirty&&t.type.eq(this.widget.type)},e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.stopEvent=function(t){var e=this.widget.spec.stopEvent;return!!e&&e(t)},e.prototype.ignoreMutation=function(t){return"selection"!=t.type||this.widget.spec.ignoreSelection},Object.defineProperties(e.prototype,n),e}(en),sn=function(t){function e(e,n,r,o){t.call(this,e,rn,n,null),this.textDOM=r,this.text=o}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0}};return n.size.get=function(){return this.text.length},e.prototype.localPosFromDOM=function(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e},e.prototype.domFromPos=function(t){return{node:this.textDOM,offset:t}},e.prototype.ignoreMutation=function(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue},Object.defineProperties(e.prototype,n),e}(en),an=function(t){function e(e,n,r,o){t.call(this,e,[],r,o),this.mark=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t,n,r,o){var i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return s&&s.dom||(s=ht.renderSpec(document,n.type.spec.toDOM(n,r))),new e(t,n,s.dom,s.contentDOM||s.dom)},e.prototype.parseRule=function(){return{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},e.prototype.matchesMark=function(t){return 3!=this.dirty&&this.mark.eq(t)},e.prototype.markDirty=function(e,n){if(t.prototype.markDirty.call(this,e,n),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty0&&(i=Cn(i,0,t,r));for(var a=0;a=0&&!a&&s.syncToMarks(i==n.node.childCount?p.none:n.node.child(i).marks,r,t),s.placeWidget(e,t,o)}),(function(e,n,i,a){s.syncToMarks(e.marks,r,t),s.findNodeMatch(e,n,i,a)||s.updateNextNode(e,n,i,t,a)||s.addNode(e,n,i,t,o),o+=e.nodeSize})),s.syncToMarks(rn,r,t),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||2==this.dirty)&&(i&&this.protectLocalComposition(t,i),this.renderChildren())},e.prototype.renderChildren=function(){!function t(e,n){for(var r=e.firstChild,o=0;oe+this.node.content.size)){var i=t.root.getSelection(),s=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];t=t.childNodes[e-1],e=ze(t)}else{if(!(1==t.nodeType&&e=n){var u=c.lastIndexOf(e,r-a);if(u>=0&&u+e.length+a>=n)return a+u}}}return-1}(this.node.content,a,r-e,o-e);return c<0?null:{node:s,pos:c,text:a}}}},e.prototype.protectLocalComposition=function(t,e){var n=e.node,r=e.pos,o=e.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=null)}var s=new sn(this,i,n,o);t.compositionNodes.push(s),this.children=Cn(this.children,r,r+o.length,t,s)}},e.prototype.update=function(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)},e.prototype.updateInner=function(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},e.prototype.updateOuterDeco=function(t){if(!bn(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=vn(this.dom,this.nodeDOM,mn(this.outerDeco,this.node,e),mn(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=t}},e.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},e.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!1)},Object.defineProperties(e.prototype,n),e}(en);function ln(t,e,n,r,o){return yn(r,e,t),new cn(null,t,e,n,r,r,r,o,0)}var un=function(t){function e(e,n,r,o,i,s,a){t.call(this,e,n,r,o,i,null,s,a)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.parseRule=function(){return{skip:this.nodeDOM.parentNode||!0}},e.prototype.update=function(t,e){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text),this.node=t,this.dirty=0,!0)},e.prototype.inParent=function(){for(var t=this.parent.contentDOM,e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1},e.prototype.domFromPos=function(t){return{node:this.nodeDOM,offset:t}},e.prototype.localPosFromDOM=function(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):t.prototype.localPosFromDOM.call(this,e,n,r)},e.prototype.ignoreMutation=function(t){return"characterData"!=t.type&&"selection"!=t.type},e.prototype.slice=function(t,n,r){var o=this.node.cut(t,n),i=document.createTextNode(o.text);return new e(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)},e}(cn),pn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.matchesHack=function(){return 0==this.dirty},e}(en),hn=function(t){function e(e,n,r,o,i,s,a,c,l,u){t.call(this,e,n,r,o,i,s,a,l,u),this.spec=c}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(e,n,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(e,n);return i&&this.updateInner(e,n,r,o),i}return!(!this.contentDOM&&!e.isLeaf)&&t.prototype.update.call(this,e,n,r,o)},e.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():t.prototype.selectNode.call(this)},e.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():t.prototype.deselectNode.call(this)},e.prototype.setSelection=function(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):t.prototype.setSelection.call(this,e,n,r,o)},e.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),t.prototype.destroy.call(this)},e.prototype.stopEvent=function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)},e.prototype.ignoreMutation=function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):t.prototype.ignoreMutation.call(this,e)},e}(cn);function fn(t){t&&(this.nodeName=t)}fn.prototype=Object.create(null);var dn=[new fn];function mn(t,e,n){if(0==t.length)return dn;for(var r=n?dn[0]:new fn,o=[r],i=0;i0&&o>=0;o--){var i=e[o],s=i.node;if(s){if(s!=t.child(r-1))break;n.push(i),--r}}return{nodes:n.reverse(),offset:r}}(t.node.content,t.children);this.preMatched=n.nodes,this.preMatchOffset=n.offset};function xn(t,e){return t.type.side-e.type.side}function Cn(t,e,n,r,o){for(var i=[],s=0,a=0;s=n||u<=e?i.push(c):(ln&&i.push(c.slice(n-l,c.size,r)))}return i}function _n(t,e){var n=t.selection,r=n.$anchor,o=n.$head,i=e>0?r.max(o):r.min(o),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&Qt.findFrom(s,e)}function Sn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function An(t,e,n){var r=t.state.selection;if(r instanceof ee){if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){var o=_n(t.state,e);return!!(o&&o instanceof re)&&Sn(t,o)}var i,s=r.$head,a=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!a||a.isText)return!1;var c=e<0?s.pos-a.nodeSize:s.pos;return!!(a.isAtom||(i=t.docView.descAt(c))&&!i.contentDOM)&&(re.isSelectable(a)?Sn(t,new re(e<0?t.state.doc.resolve(s.pos-a.nodeSize):s)):!!we.webkit&&Sn(t,new ee(t.state.doc.resolve(e<0?c:c+a.nodeSize))))}if(r instanceof re&&r.node.isInline)return Sn(t,new ee(e>0?r.$to:r.$from));var l=_n(t.state,e);return!!l&&Sn(t,l)}function Mn(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Dn(t){var e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function En(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){var o,i,s=!1;for(we.gecko&&1==n.nodeType&&r0){if(1!=n.nodeType)break;var a=n.childNodes[r-1];if(Dn(a))o=n,i=--r;else{if(3!=a.nodeType)break;r=(n=a).nodeValue.length}}else{if(Tn(n))break;for(var c=n.previousSibling;c&&Dn(c);)o=n.parentNode,i=Me(c),c=c.previousSibling;if(c)r=Mn(n=c);else{if((n=n.parentNode)==t.dom)break;r=0}}s?Nn(t,e,n,r):o&&Nn(t,e,o,i)}}function On(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){for(var o,i,s=Mn(n);;)if(r-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){var s=_n(t.state,e);if(s&&s instanceof re)return Sn(t,s)}if(!o.parent.inlineContent){var a=Qt.findFrom(e<0?o:i,e);return!a||Sn(t,a)}return!1}function qn(t,e){if(!(t.state.selection instanceof ee))return!0;var n=t.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var s=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(s&&!s.isText){var a=t.state.tr;return e<0?a.delete(r.pos-s.nodeSize,r.pos):a.delete(r.pos,r.pos+s.nodeSize),t.dispatch(a),!0}return!1}function In(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Rn(t,e){var n=e.keyCode,r=function(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||we.mac&&72==n&&"c"==r?qn(t,-1)||En(t):46==n||we.mac&&68==n&&"c"==r?qn(t,1)||On(t):13==n&&!we.ios||27==n||(37==n?An(t,-1,r)||En(t):39==n?An(t,1,r)||On(t):38==n?zn(t,-1,r)||En(t):40==n?function(t){if(we.chrome&&!(t.state.selection.$head.parentOffset>0)){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;In(t,o,!0),setTimeout((function(){return In(t,o,!1)}),20)}}}(t)||zn(t,1,r)||On(t):r==(we.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function Fn(t,e){var n,r,o=t.root.getSelection(),i=t.state.doc,s=t.docView.nearestDesc(o.focusNode),a=s&&0==s.size,c=t.docView.posFromDOM(o.focusNode,o.focusOffset),l=i.resolve(c);if(Ie(o)){for(n=l;s&&!s.node;)s=s.parent;if(s&&s.node.isAtom&&re.isSelectable(s.node)&&s.parent&&(!s.node.isInline||!function(t,e,n){for(var r=0==e,o=e==ze(t);r||o;){if(t==n)return!0;var i=Me(t);if(!(t=t.parentNode))return!1;r=r&&0==i,o=o&&i==ze(t)}}(o.focusNode,o.focusOffset,s.dom))){var u=s.posBefore;r=new re(c==u?l:i.resolve(u))}}else n=i.resolve(t.docView.posFromDOM(o.anchorNode,o.anchorOffset));r||(r=Hn(t,n,l,"pointer"==e||t.state.selection.head=this.preMatchOffset?this.preMatched[t-this.preMatchOffset]:null},wn.prototype.destroyBetween=function(t,e){if(t!=e){for(var n=t;n>1,i=Math.min(o,t.length);r-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{var c=an.create(this.top,t[o],e,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}},wn.prototype.findNodeMatch=function(t,e,n,r){var o=-1,i=r<0?void 0:this.getPreMatch(r),s=this.top.children;if(i&&i.matchesNode(t,e,n))o=s.indexOf(i);else for(var a=this.index,c=Math.min(s.length,a+5);a-1&&s+this.preMatchOffset!=o)return!1;var a=i.dom;if(!(this.lock&&(a==this.lock||1==a.nodeType&&a.contains(this.lock.parentNode))&&!(t.isText&&i.node&&i.node.isText&&i.nodeDOM.nodeValue==t.text&&3!=i.dirty&&bn(e,i.outerDeco)))&&i.update(t,e,n,r))return i.dom!=a&&(this.changed=!0),this.index++,!0}return!1},wn.prototype.addNode=function(t,e,n,r,o){this.top.children.splice(this.index++,0,cn.create(this.top,t,e,n,r,o)),this.changed=!0},wn.prototype.placeWidget=function(t,e,n){if(this.indexDate.now()-50?t.lastSelectionOrigin:null,a=Fn(t,i);if(!t.state.selection.eq(a)){var c=t.state.tr.setSelection(a);"pointer"==i?c.setMeta("pointer",!0):"key"==i&&c.scrollIntoView(),t.dispatch(c)}}else{var l=t.state.doc.resolve(e),u=l.sharedDepth(n);e=l.before(u+1),n=t.state.doc.resolve(n).after(u+1);var p,h,f=t.state.selection,d=function(t,e,n){var r=t.docView.parseRange(e,n),o=r.node,i=r.fromOffset,s=r.toOffset,a=r.from,c=r.to,l=t.root.getSelection(),u=null,p=l.anchorNode;if(p&&t.dom.contains(1==p.nodeType?p:p.parentNode)&&(u=[{node:p,offset:l.anchorOffset}],Ie(l)||u.push({node:l.focusNode,offset:l.focusOffset})),we.chrome&&8===t.lastKeyCode)for(var h=s;h>i;h--){var f=o.childNodes[h-1],d=f.pmViewDesc;if("BR"==f.nodeType&&!d){s=h;break}if(!d||d.size)break}var m=t.state.doc,v=t.someProp("domParser")||et.fromSchema(t.state.schema),g=m.resolve(a),y=null,b=v.parse(o,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:s,preserveWhitespace:!g.parent.type.spec.code||"full",editableContent:!0,findPositions:u,ruleFromNode:Un,context:g});if(u&&null!=u[0].pos){var k=u[0].pos,w=u[1]&&u[1].pos;null==w&&(w=k),y={anchor:k+a,head:w+a}}return{doc:b,sel:y,from:a,to:c}}(t,e,n),m=t.state.doc,v=m.slice(d.from,d.to);8===t.lastKeyCode&&Date.now()-100=a?i-r:0)+(c-a),a=i}else if(c=c?i-r:0)+(a-c),c=i}return{start:i,endA:a,endB:c}}(v.content,d.doc.content,d.from,p,h);if(!g){if(!(r&&f instanceof ee&&!f.empty&&f.$head.sameParent(f.$anchor))||t.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){var y=Gn(t,t.state.doc,d.sel);y&&!y.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(y))}return}g={start:f.from,endA:f.to,endB:f.to}}t.domChangeCount++,t.state.selection.fromt.state.selection.from&&g.start<=t.state.selection.from+2?g.start=t.state.selection.from:g.endA=t.state.selection.to-2&&(g.endB+=t.state.selection.to-g.endA,g.endA=t.state.selection.to)),we.ie&&we.ie_version<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>d.from&&"  "==d.doc.textBetween(g.start-d.from-1,g.start-d.from+1)&&(g.start--,g.endA--,g.endB--);var b,k=d.doc.resolveNoCache(g.start-d.from),w=d.doc.resolveNoCache(g.endB-d.from);if((we.ios&&t.lastIOSEnter>Date.now()-100&&(!k.sameParent(w)||o.some((function(t){return"DIV"==t.nodeName})))||!k.sameParent(w)&&k.posg.start&&function(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||Zn(r,!0,!1)n||Zn(s,!0,!1)e.content.size?null:Hn(t,e.resolve(n.anchor),e.resolve(n.head))}function Zn(t,e,n){for(var r=t.depth,o=e?t.end():t.pos;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n)for(var i=t.node(r).maybeChild(t.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}function Yn(t,e){for(var n=[],r=e.content,o=e.openStart,i=e.openEnd;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;var s=r.firstChild;n.push(s.type.name,s.type.hasRequiredAttrs()?s.attrs:null),r=s.content}var a=t.someProp("clipboardSerializer")||ht.fromSchema(t.state.schema),c=rr(),l=c.createElement("div");l.appendChild(a.serializeFragment(r,{document:c}));for(var u,p=l.firstChild;p&&1==p.nodeType&&(u=er[p.nodeName.toLowerCase()]);){for(var h=u.length-1;h>=0;h--){for(var f=c.createElement(u[h]);l.firstChild;)f.appendChild(l.firstChild);l.appendChild(f)}p=l.firstChild}return p&&1==p.nodeType&&p.setAttribute("data-pm-slice",o+" "+i+" "+JSON.stringify(n)),{dom:l,text:t.someProp("clipboardTextSerializer",(function(t){return t(e)}))||e.content.textBetween(0,e.content.size,"\n\n")}}function Qn(t,e,n,r,o){var i,a,c=o.parent.type.spec.code;if(!n&&!e)return null;var l=e&&(r||c||!n);if(l){if(t.someProp("transformPastedText",(function(t){e=t(e)})),c)return new f(s.from(t.state.schema.text(e)),0,0);var u=t.someProp("clipboardTextParser",(function(t){return t(e,o)}));u?a=u:(i=document.createElement("div"),e.trim().split(/(?:\r\n?|\n)+/).forEach((function(t){i.appendChild(document.createElement("p")).textContent=t})))}else t.someProp("transformPastedHTML",(function(t){n=t(n)})),i=function(t){var e=/(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,r=rr().createElement("div"),o=/(?:]*>)*<([a-z][^>\s]+)/i.exec(t),i=0;(n=o&&er[o[1].toLowerCase()])&&(t=n.map((function(t){return"<"+t+">"})).join("")+t+n.map((function(t){return""})).reverse().join(""),i=n.length);r.innerHTML=t;for(var s=0;s=0;c-=2){var l=r.nodes[n[c]];if(!l||l.hasRequiredAttrs())break;o=s.from(l.create(n[c+1],o)),i++,a++}return new f(o,i,a)}(function(t,e,n){e=0;r--){var o=n(r);if(o)return o.v}return t}(a.content,o),!1),t.someProp("transformPasted",(function(t){a=t(a)})),a}function Xn(t,e,n){void 0===n&&(n=0);for(var r=e.length-1;r>=n;r--)t=e[r].create(null,s.from(t));return t}function tr(t,e,n,r,o,i){var a=e<0?t.firstChild:t.lastChild,c=a.content;return o=n&&(c=e<0?a.contentMatchAt(0).fillBefore(c,t.childCount>1||i<=o).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(s.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(c))}var er={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},nr=null;function rr(){return nr||(nr=document.implementation.createHTMLDocument("title"))}var or={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ir=we.ie&&we.ie_version<=11,sr=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};sr.prototype.set=function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset},sr.prototype.eq=function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset};var ar=function(t,e){var n=this;this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=!1,this.observer=window.MutationObserver&&new window.MutationObserver((function(t){for(var e=0;et.target.nodeValue.length}))?n.flushSoon():n.flush()})),this.currentSelection=new sr,ir&&(this.onCharData=function(t){n.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};ar.prototype.flushSoon=function(){var t=this;this.flushingSoon||(this.flushingSoon=!0,window.setTimeout((function(){t.flushingSoon=!1,t.flush()}),20))},ar.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,or),ir&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},ar.prototype.stop=function(){var t=this;if(this.observer){var e=this.observer.takeRecords();if(e.length){for(var n=0;n1){var l=s.filter((function(t){return"BR"==t.nodeName}));if(2==l.length){var u=l[0],p=l[1];u.parentNode&&u.parentNode.parentNode==p.parentNode?p.remove():u.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(t){if(cr)return;cr=!0,"normal"==getComputedStyle(t.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(r,o,i,s),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(e)||Ln(this.view))}},ar.prototype.registerMutation=function(t,e){if(e.indexOf(t.target)>-1)return null;var n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){var r=t.previousSibling,o=t.nextSibling;if(we.ie&&we.ie_version<=11&&t.addedNodes.length)for(var i=0;ii.depth?e(t,n,i.nodeAfter,i.before(r),o,!0):e(t,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},a=i.depth+1;a>0;a--){var c=s(a);if(c)return c.v}return!1}function vr(t,e,n){t.focused||t.focus();var r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function gr(t,e,n,r,o){return mr(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(function(n){return n(t,e,r)}))||(o?function(t,e){if(-1==e)return!1;var n,r,o=t.state.selection;o instanceof re&&(n=o.node);for(var i=t.state.doc.resolve(e),s=i.depth+1;s>0;s--){var a=s>i.depth?i.nodeAfter:i.node(s);if(re.isSelectable(a)){r=n&&o.$from.depth>0&&s>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(s);break}}return null!=r&&(vr(t,re.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&re.isSelectable(r))&&(vr(t,new re(n),"pointer"),!0)}(t,n))}function yr(t,e,n,r){return mr(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(function(n){return n(t,e,r)}))}function br(t,e,n,r){return mr(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(function(n){return n(t,e,r)}))||function(t,e){var n=t.state.doc;if(-1==e)return!!n.inlineContent&&(vr(t,ee.create(n,0,n.content.size),"pointer"),!0);for(var r=n.resolve(e),o=r.depth+1;o>0;o--){var i=o>r.depth?r.nodeAfter:r.node(o),s=r.before(o);if(i.inlineContent)vr(t,ee.create(n,s+1,s+1+i.content.size),"pointer");else{if(!re.isSelectable(i))continue;vr(t,re.create(n,s),"pointer")}return!0}}(t,n)}function kr(t){return Ar(t)}ur.keydown=function(t,e){t.shiftKey=16==e.keyCode||e.shiftKey,Cr(t,e)||(t.lastKeyCode=e.keyCode,t.lastKeyCodeTime=Date.now(),!we.ios||13!=e.keyCode||e.ctrlKey||e.altKey||e.metaKey?t.someProp("handleKeyDown",(function(n){return n(t,e)}))||Rn(t,e)?e.preventDefault():pr(t,"key"):t.lastIOSEnter=Date.now())},ur.keyup=function(t,e){16==e.keyCode&&(t.shiftKey=!1)},ur.keypress=function(t,e){if(!(Cr(t,e)||!e.charCode||e.ctrlKey&&!e.altKey||we.mac&&e.metaKey))if(t.someProp("handleKeyPress",(function(n){return n(t,e)})))e.preventDefault();else{var n=t.state.selection;if(!(n instanceof ee&&n.$from.sameParent(n.$to))){var r=String.fromCharCode(e.charCode);t.someProp("handleTextInput",(function(e){return e(t,n.$from.pos,n.$to.pos,r)}))||t.dispatch(t.state.tr.insertText(r).scrollIntoView()),e.preventDefault()}}};var wr=we.mac?"metaKey":"ctrlKey";lr.mousedown=function(t,e){t.shiftKey=e.shiftKey;var n=kr(t),r=Date.now(),o="singleClick";r-t.lastClick.time<500&&function(t,e){var n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(e,t.lastClick)&&!e[wr]&&("singleClick"==t.lastClick.type?o="doubleClick":"doubleClick"==t.lastClick.type&&(o="tripleClick")),t.lastClick={time:r,x:e.clientX,y:e.clientY,type:o};var i=t.posAtCoords(dr(e));i&&("singleClick"==o?t.mouseDown=new xr(t,i,e,n):("doubleClick"==o?yr:br)(t,i.pos,i.inside,e)?e.preventDefault():pr(t,"pointer"))};var xr=function(t,e,n,r){var o,i,s=this;if(this.view=t,this.startDoc=t.state.doc,this.pos=e,this.event=n,this.flushed=r,this.selectNode=n[wr],this.allowDefault=n.shiftKey,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{var a=t.state.doc.resolve(e.pos);o=a.parent,i=a.depth?a.before():0}this.mightDrag=null;var c=r?null:n.target,l=c?t.docView.nearestDesc(c,!0):null;this.target=l?l.dom:null,(o.type.spec.draggable&&!1!==o.type.spec.selectable||t.state.selection instanceof re&&i==t.state.selection.from)&&(this.mightDrag={node:o,pos:i,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&we.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((function(){return s.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),pr(t,"pointer")};function Cr(t,e){return!!t.composing||!!(we.safari&&Math.abs(e.timeStamp-t.compositionEndedAt)<500)&&(t.compositionEndedAt=-2e8,!0)}xr.prototype.done=function(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!1),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.view.mouseDown=null},xr.prototype.up=function(t){if(this.done(),this.view.dom.contains(3==t.target.nodeType?t.target.parentNode:t.target)){var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(dr(t))),this.allowDefault||!e?pr(this.view,"pointer"):gr(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():!this.flushed&&(!we.chrome||this.view.state.selection instanceof ee||e.pos!=this.view.state.selection.from&&e.pos!=this.view.state.selection.to)?pr(this.view,"pointer"):(vr(this.view,Qt.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault())}},xr.prototype.move=function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),pr(this.view,"pointer")},lr.touchdown=function(t){kr(t),pr(t,"pointer")},lr.contextmenu=function(t){return kr(t)};var _r=we.android?5e3:-1;function Sr(t,e){clearTimeout(t.composingTimeout),e>-1&&(t.composingTimeout=setTimeout((function(){return Ar(t)}),e))}function Ar(t,e){for(t.composing=!1;t.compositionNodes.length>0;)t.compositionNodes.pop().markParentsDirty();return!(!e&&!t.docView.dirty)&&(t.updateState(t.state),!0)}ur.compositionstart=ur.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var e=t.state,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(t){return!1===t.type.spec.inclusive}))))t.markCursor=t.state.storedMarks||n.marks(),Ar(t,!0),t.markCursor=null;else if(Ar(t),we.gecko&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=t.root.getSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(3==s.nodeType){r.collapse(s,s.nodeValue.length);break}o=s,i=-1}t.composing=!0}Sr(t,_r)},ur.compositionend=function(t,e){t.composing&&(t.composing=!1,t.compositionEndedAt=e.timeStamp,Sr(t,20))};var Mr=we.ie&&we.ie_version<15||we.ios&&we.webkit_version<604;function Dr(t,e,n,r){var o=Qn(t,e,n,t.shiftKey,t.state.selection.$from);if(!t.someProp("handlePaste",(function(e){return e(t,r,o||f.empty)}))&&o){var i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(o),s=i?t.state.tr.replaceSelectionWith(i,t.shiftKey):t.state.tr.replaceSelection(o);t.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste"))}}lr.copy=ur.cut=function(t,e){var n=t.state.selection,r="cut"==e.type;if(!n.empty){var o=Mr?null:e.clipboardData,i=Yn(t,n.content()),s=i.dom,a=i.text;o?(e.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",a)):function(t,e){var n=t.dom.ownerDocument,r=n.body.appendChild(n.createElement("div"));r.appendChild(e),r.style.cssText="position: fixed; left: -10000px; top: 10px";var o=getSelection(),i=n.createRange();i.selectNodeContents(e),t.dom.blur(),o.removeAllRanges(),o.addRange(i),setTimeout((function(){n.body.removeChild(r),t.focus()}),50)}(t,s),r&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},ur.paste=function(t,e){var n=Mr?null:e.clipboardData,r=n&&n.getData("text/html"),o=n&&n.getData("text/plain");n&&(r||o||n.files.length)?(Dr(t,o,r,e),e.preventDefault()):function(t,e){var n=t.dom.ownerDocument,r=t.shiftKey||t.state.selection.$from.parent.type.spec.code,o=n.body.appendChild(n.createElement(r?"textarea":"div"));r||(o.contentEditable="true"),o.style.cssText="position: fixed; left: -10000px; top: 10px",o.focus(),setTimeout((function(){t.focus(),n.body.removeChild(o),r?Dr(t,o.value,null,e):Dr(t,o.textContent,o.innerHTML,e)}),50)}(t,e)};var Er=function(t,e){this.slice=t,this.move=e},Or=we.mac?"altKey":"ctrlKey";for(var Tr in lr.dragstart=function(t,e){var n=t.mouseDown;if(n&&n.done(),e.dataTransfer){var r=t.state.selection,o=r.empty?null:t.posAtCoords(dr(e));if(o&&o.pos>=r.from&&o.pos<=(r instanceof re?r.to-1:r.to));else if(n&&n.mightDrag)t.dispatch(t.state.tr.setSelection(re.create(t.state.doc,n.mightDrag.pos)));else if(e.target&&1==e.target.nodeType){var i=t.docView.nearestDesc(e.target,!0);if(!i||!i.node.type.spec.draggable||i==t.docView)return;t.dispatch(t.state.tr.setSelection(re.create(t.state.doc,i.posBefore)))}var s=t.state.selection.content(),a=Yn(t,s),c=a.dom,l=a.text;e.dataTransfer.clearData(),e.dataTransfer.setData(Mr?"Text":"text/html",c.innerHTML),Mr||e.dataTransfer.setData("text/plain",l),t.dragging=new Er(s,!e[Or])}},lr.dragend=function(t){window.setTimeout((function(){return t.dragging=null}),50)},ur.dragover=ur.dragenter=function(t,e){return e.preventDefault()},ur.drop=function(t,e){var n=t.dragging;if(t.dragging=null,e.dataTransfer){var r=t.posAtCoords(dr(e));if(r){var o=t.state.doc.resolve(r.pos);if(o){var i=n&&n.slice||Qn(t,e.dataTransfer.getData(Mr?"Text":"text/plain"),Mr?null:e.dataTransfer.getData("text/html"),!1,o);if(i&&(e.preventDefault(),!t.someProp("handleDrop",(function(r){return r(t,e,i,n&&n.move)})))){var s=i?Lt(t.state.doc,o.pos,i):o.pos;null==s&&(s=o.pos);var a=t.state.tr;n&&n.move&&a.deleteSelection();var c=a.mapping.map(s),l=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,u=a.doc;if(l?a.replaceRangeWith(c,c,i.content.firstChild):a.replaceRange(c,c,i),!a.doc.eq(u)){var p=a.doc.resolve(c);l&&re.isSelectable(i.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(i.content.firstChild)?a.setSelection(new re(p)):a.setSelection(Hn(t,p,a.doc.resolve(a.mapping.map(s)))),t.focus(),t.dispatch(a.setMeta("uiEvent","drop"))}}}}}},lr.focus=function(t){t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.root.getSelection())&&Ln(t)}),20))},lr.blur=function(t){t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),t.domObserver.currentSelection.set({}),t.focused=!1)},lr.beforeinput=function(t,e){if(we.chrome&&we.android&&"deleteContentBackward"==e.inputType){var n=t.domChangeCount;setTimeout((function(){if(t.domChangeCount==n&&(t.dom.blur(),t.focus(),!t.someProp("handleKeyDown",(function(e){return e(t,Re(8,"Backspace"))})))){var e=t.state.selection.$cursor;e&&e.pos>0&&t.dispatch(t.state.tr.delete(e.pos-1,e.pos).scrollIntoView())}}),50)}},ur)lr[Tr]=ur[Tr];function Nr(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var r in e)if(!(r in t))return!1;return!0}var zr=function(t,e){this.spec=e||Br,this.side=this.spec.side||0,this.toDOM=t};zr.prototype.map=function(t,e,n,r){var o=t.mapResult(e.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new Rr(i-n,i-n,this)},zr.prototype.valid=function(){return!0},zr.prototype.eq=function(t){return this==t||t instanceof zr&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Nr(this.spec,t.spec))};var qr=function(t,e){this.spec=e||Br,this.attrs=t};qr.prototype.map=function(t,e,n,r){var o=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Rr(o,i,this)},qr.prototype.valid=function(t,e){return e.from=t&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(var a=0;at){var c=this.children[a]+1;this.children[a+2].findInner(t-c,e-c,n,r+c,o)}},Pr.prototype.map=function(t,e,n){return this==Vr||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Br)},Pr.prototype.mapInner=function(t,e,n,r,o){for(var i,s=0;sc+i||(e>=a[s]+i?a[s+1]=-1:(l=r-n-(e-t)+(i-o))&&(a[s]+=l,a[s+1]+=l))}},l=0;l=r.content.size){u=!0;continue}var d=n.map(t[p+1]+i,-1)-o,m=r.content.findIndex(f),v=m.index,g=m.offset,y=r.maybeChild(v);if(y&&g==f&&g+y.nodeSize==d){var b=a[p+2].mapInner(n,y,h+1,a[p]+i+1,s);b!=Vr?(a[p]=f,a[p+1]=d,a[p+2]=b):(a[p+1]=-2,u=!0)}else u=!0}if(u){var k=Wr(function(t,e,n,r,o,i,s){function a(t,e){for(var i=0;is&&l.to=t){this.children[o]==t&&(n=this.children[o+2]);break}for(var i=t+1,s=i+e.content.size,a=0;ai&&c.type instanceof qr){var l=Math.max(i,c.from)-i,u=Math.min(s,c.to)-i;ln&&s.to0;)e++;t.splice(e,0,n)}function Zr(t){var e=[];return t.someProp("decorations",(function(n){var r=n(t.state);r&&r!=Vr&&e.push(r)})),t.cursorWrapper&&e.push(Pr.create(t.state.doc,[t.cursorWrapper.deco])),$r.from(e)}$r.prototype.forChild=function(t,e){if(e.isLeaf)return Pr.empty;for(var n=[],r=0;rr.scrollToSelection?"to selection":"preserve",k=o||!this.docView.matchesNode(t.doc,y,g),w=k||!t.selection.eq(r.selection),x="preserve"==b&&w&&null==this.dom.style.overflowAnchor&&function(t){for(var e,n,r=t.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,s=o+1;s=o-20){e=a,n=c.top;break}}}return{refDOM:e,refTop:n,stack:Pe(t.dom)}}(this);if(w){this.domObserver.stop();var C=k&&(we.ie||we.chrome)&&!r.selection.empty&&!t.selection.empty&&(l=r.selection,u=t.selection,p=Math.min(l.$anchor.sharedDepth(l.head),u.$anchor.sharedDepth(u.head)),l.$anchor.node(p)!=u.$anchor.node(p));k&&(!o&&this.docView.update(t.doc,y,g,this)||(this.docView.destroy(),this.docView=ln(t.doc,y,g,this.dom,this))),C||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(s=this,a=s.docView.domFromPos(s.state.selection.anchor),c=s.root.getSelection(),Oe(a.node,a.offset,c.anchorNode,c.anchorOffset)))?Ln(this,C):(jn(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),"reset"==b)this.dom.scrollTop=0;else if("to selection"==b){var _=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",(function(t){return t(n)}))||(t.selection instanceof re?Be(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect(),_):Be(this,this.coordsAtPos(t.selection.head),_))}else x&&(f=(h=x).refDOM,d=h.refTop,m=h.stack,v=f?f.getBoundingClientRect().top:0,Ve(m,0==v?0:v-d))},Yr.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()},Yr.prototype.updatePluginViews=function(t){if(t&&t.plugins==this.state.plugins)for(var e=0;e ",null,e,(function(){return t.renderContent(e)}))},code_block:function(t,e){t.write("```"+(e.attrs.params||"")+"\n"),t.text(e.textContent,!1),t.ensureNewLine(),t.write("```"),t.closeBlock(e)},heading:function(t,e){t.write(t.repeat("#",e.attrs.level)+" "),t.renderInline(e),t.closeBlock(e)},horizontal_rule:function(t,e){t.write(e.attrs.markup||"---"),t.closeBlock(e)},bullet_list:function(t,e){t.renderList(e," ",(function(){return(e.attrs.bullet||"*")+" "}))},ordered_list:function(t,e){var n=e.attrs.order||1,r=String(n+e.childCount-1).length,o=t.repeat(" ",r+2);t.renderList(e,o,(function(e){var o=String(n+e);return t.repeat(" ",r-o.length)+o+". "}))},list_item:function(t,e){t.renderContent(e)},paragraph:function(t,e){t.renderInline(e),t.closeBlock(e)},image:function(t,e){t.write("!["+t.esc(e.attrs.alt||"")+"]("+t.esc(e.attrs.src)+(e.attrs.title?" "+t.quote(e.attrs.title):"")+")")},hard_break:function(t,e,n,r){for(var o=r+1;o":"]("+t.esc(e.attrs.href)+(e.attrs.title?" "+t.quote(e.attrs.title):"")+")"}},code:{open:function(t,e,n,r){return vo(n.child(r),-1)},close:function(t,e,n,r){return vo(n.child(r-1),1)},escape:!1}});function vo(t,e){var n,r=/`+/g,o=0;if(t.isText)for(;n=r.exec(t.text);)o=Math.max(o,n[0].length);for(var i=o>0&&e>0?" `":"`",s=0;s0&&e<0&&(i+=" "),i}function go(t,e,n,r){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;var o=e.child(n+(r<0?-1:0));if(!o.isText||o.text!=t.attrs.href||o.marks[o.marks.length-1]!=t)return!1;if(n==(r<0?1:e.childCount-1))return!0;var i=e.child(n+(r<0?-2:1));return!t.isInSet(i.marks)}var yo=function(t,e,n){this.nodes=t,this.marks=e,this.delim=this.out="",this.closed=!1,this.inTightList=!1,this.options=n||{},void 0===this.options.tightLists&&(this.options.tightLists=!1)};yo.prototype.flushClose=function(t){if(this.closed){if(this.atBlank()||(this.out+="\n"),null==t&&(t=2),t>1){var e=this.delim,n=/\s+$/.exec(e);n&&(e=e.slice(0,e.length-n[0].length));for(var r=1;ry?a=a.slice(0,y).concat(g).concat(a.slice(y,v)).concat(a.slice(v+1,m)):y>v&&(a=a.slice(0,v).concat(a.slice(v+1,y)).concat(g).concat(a.slice(y,m)));continue t}}}for(var k=0;k",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},xo="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Co="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),_o="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),So="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Ao="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Mo=xo&&(So||+xo[1]<57)||_o&&So,Do=0;Do<10;Do++)bo[48+Do]=bo[96+Do]=String(Do);for(Do=1;Do<=24;Do++)bo[Do+111]="F"+Do;for(Do=65;Do<=90;Do++)bo[Do]=String.fromCharCode(Do+32),wo[Do]=String.fromCharCode(Do);for(var Eo in bo)wo.hasOwnProperty(Eo)||(wo[Eo]=bo[Eo]);var Oo=function(t){var e=!(Mo&&(t.ctrlKey||t.altKey||t.metaKey)||(Co||Ao)&&t.shiftKey&&t.key&&1==t.key.length)&&t.key||(t.shiftKey?wo:bo)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e},To="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);function No(t){var e,n,r,o,i=t.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(var a=0;a=e?Ro.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Ro.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Ro.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Ro.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Ro.from=function(t){return t instanceof Ro?t:t&&t.length?new Fo(t):Ro.empty};var Fo=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var o=e;o=n;o--)if(!1===t(this.values[o],r+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Ro);Ro.empty=new Fo([]);var Lo=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return to&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(n,o)-o,r+o))&&(!(n=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Ro),Bo=Ro,Po=function(t,e){this.items=t,this.eventCount=e};Po.prototype.popEvent=function(t,e){var n=this;if(0==this.eventCount)return null;for(var r,o,i=this.items.length;;i--){if(this.items.get(i-1).selection){--i;break}}e&&(r=this.remapping(i,this.items.length),o=r.maps.length);var s,a,c=t.tr,l=[],u=[];return this.items.forEach((function(t,e){if(!t.step)return r||(r=n.remapping(i,e+1),o=r.maps.length),o--,void u.push(t);if(r){u.push(new Vo(t.map));var p,h=t.step.map(r.slice(o));h&&c.maybeStep(h).doc&&(p=c.mapping.maps[c.mapping.maps.length-1],l.push(new Vo(p,null,null,l.length+u.length))),o--,p&&r.appendMap(p,o)}else c.maybeStep(t.step);return t.selection?(s=r?t.selection.map(r.slice(o)):t.selection,a=new Po(n.items.slice(0,i).append(u.reverse().concat(l)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:a,transform:c,selection:s}},Po.prototype.addTransform=function(t,e,n,r){for(var o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null,c=0;cjo&&(f=m,(h=s).forEach((function(t,e){if(t.selection&&0==f--)return d=e,!1})),s=h.slice(d),i-=m),new Po(s.append(o),i)},Po.prototype.remapping=function(t,e){var n=new bt;return this.items.forEach((function(e,r){var o=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:null;n.appendMap(e.map,o)}),t,e),n},Po.prototype.addMaps=function(t){return 0==this.eventCount?this:new Po(this.items.append(t.map((function(t){return new Vo(t)}))),this.eventCount)},Po.prototype.rebased=function(t,e){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((function(t){t.selection&&s--}),r);var a=e;this.items.forEach((function(e){var r=o.getMirror(--a);if(null!=r){i=Math.min(i,r);var c=o.maps[r];if(e.step){var l=t.steps[r].invert(t.docs[r]),u=e.selection&&e.selection.map(o.slice(a+1,r));u&&s++,n.push(new Vo(c,l,u))}else n.push(new Vo(c))}}),r);for(var c=[],l=e;l500&&(p=p.compress(this.items.length-n.length)),p},Po.prototype.emptyItemCount=function(){var t=0;return this.items.forEach((function(e){e.step||t++})),t},Po.prototype.compress=function(t){void 0===t&&(t=this.items.length);var e=this.remapping(0,t),n=e.maps.length,r=[],o=0;return this.items.forEach((function(i,s){if(s>=t)r.push(i),i.selection&&o++;else if(i.step){var a=i.step.map(e.slice(n)),c=a&&a.getMap();if(n--,c&&e.appendMap(c,n),a){var l=i.selection&&i.selection.map(e.slice(n));l&&o++;var u,p=new Vo(c.invert(),a,l),h=r.length-1;(u=r.length&&r[h].merge(p))?r[h]=u:r.push(p)}}else i.map&&n--}),this.items.length,0),new Po(Bo.from(r.reverse()),o)},Po.empty=new Po(Bo.empty,0);var Vo=function(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r};Vo.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var e=t.step.merge(this.step);if(e)return new Vo(e.getMap().invert(),e,this.selection)}};var $o=function(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r},jo=20;function Jo(t){var e=[];return t.forEach((function(t,n,r,o){return e.push(r,o)})),e}function Ho(t,e){if(!t)return null;for(var n=[],r=0;r=e[o]&&(n=!0)})),n}(n,t.prevRanges)),c=s?Ho(t.prevRanges,n.mapping):Jo(n.mapping.maps[n.steps.length-1]);return new $o(t.done.addTransform(n,a?e.selection.getBookmark():null,r,Go(e)),Po.empty,c,n.time)}(n,r,e,t)}},config:t})}function Xo(t,e){var n=Zo.getState(t);return!(!n||0==n.done.eventCount)&&(e&&Wo(n,t,e,!1),!0)}function ti(t,e){var n=Zo.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&Wo(n,t,e,!0),!0)}function ei(t,e){return!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0)}function ni(t,e){for(;t;t="start"==e?t.firstChild:t.lastChild)if(t.isTextblock)return!0;return!1}function ri(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function oi(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){var n=t.node(e);if(t.index(e)+1=0;u--)l=s.from(r[u].create(null,l));l=s.from(i.copy(l));var p=t.tr.step(new Dt(e.pos-1,c,e.pos,c,new f(l,1,0),r.length,!0)),h=c+2*r.length;It(p.doc,h)&&p.join(h),n(p.scrollIntoView())}return!0}var d=Qt.findFrom(e,1),m=d&&d.$from.blockRange(d.$to),v=m&&Tt(m);return null!=v&&v>=e.depth&&(n&&n(t.tr.lift(m,v).scrollIntoView()),!0)}function fi(t,e){return function(n,r){var o=n.selection,i=o.$from,s=o.$to,a=i.blockRange(s),c=a&&Nt(a,t,e);return!!c&&(r&&r(n.tr.wrap(a,c).scrollIntoView()),!0)}}function di(t,e){return function(n,r){var o=n.selection,i=o.from,s=o.to,a=!1;return n.doc.nodesBetween(i,s,(function(r,o){if(a)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)a=!0;else{var i=n.doc.resolve(o),s=i.index();a=i.parent.canReplaceWith(s,s+1,t)}})),!!a&&(r&&r(n.tr.setBlockType(i,s,t,e).scrollIntoView()),!0)}}function mi(t,e){return function(n,r){var o=n.selection,i=o.empty,s=o.$cursor,a=o.ranges;if(i&&!s||!function(t,e,n){for(var r=function(r){var o=e[r],i=o.$from,s=o.$to,a=0==i.depth&&t.type.allowsMarkType(n);if(t.nodesBetween(i.pos,s.pos,(function(t){if(a)return!1;a=t.inlineContent&&t.type.allowsMarkType(n)})),a)return{v:!0}},o=0;o0))return!1;var o=ri(r);if(!o){var i=r.blockRange(),s=i&&Tt(i);return null!=s&&(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)}var a=o.nodeBefore;if(!a.type.spec.isolating&&hi(t,o,e))return!0;if(0==r.parent.content.size&&(ni(a,"end")||re.isSelectable(a))){if(e){var c=t.tr.deleteRange(r.before(),r.after());c.setSelection(ni(a,"end")?Qt.findFrom(c.doc.resolve(c.mapping.map(o.pos,-1)),-1):re.create(c.doc,o.pos-a.nodeSize)),e(c.scrollIntoView())}return!0}return!(!a.isAtom||o.depth!=r.depth-1)&&(e&&e(t.tr.delete(o.pos-a.nodeSize,o.pos).scrollIntoView()),!0)}),(function(t,e,n){var r=t.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",t):r.parentOffset>0))return!1;var o=ri(r),i=o&&o.nodeBefore;return!(!i||!re.isSelectable(i))&&(e&&e(t.tr.setSelection(re.create(t.doc,o.pos-i.nodeSize)).scrollIntoView()),!0)})),yi=vi(ei,(function(t,e,n){var r=t.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",t):r.parentOffset1&&n.after()!=n.end(-1)){var r=n.before();if(qt(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&Tt(o);return null!=i&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)}),ui),"Mod-Enter":li,Backspace:gi,"Mod-Backspace":gi,Delete:yi,"Mod-Delete":yi,"Mod-a":function(t,e){return e&&e(t.tr.setSelection(new ie(t.doc))),!0}},ki={"Ctrl-h":bi.Backspace,"Alt-Backspace":bi["Mod-Backspace"],"Ctrl-d":bi.Delete,"Ctrl-Alt-Backspace":bi["Mod-Delete"],"Alt-Delete":bi["Mod-Delete"],"Alt-d":bi["Mod-Delete"]};for(var wi in bi)ki[wi]=bi[wi];var xi=("undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?ki:bi;function Ci(t){return void 0===t&&(t={}),new ge({view:function(e){return new _i(e,t)}})}var _i=function(t,e){var n=this;this.editorView=t,this.width=e.width||1,this.color=e.color||"black",this.class=e.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var r=function(t){return n[e](t)};return t.dom.addEventListener(e,r),{name:e,handler:r}}))};_i.prototype.destroy=function(){var t=this;this.handlers.forEach((function(e){var n=e.name,r=e.handler;return t.editorView.dom.removeEventListener(n,r)}))},_i.prototype.update=function(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&this.updateOverlay()},_i.prototype.setCursor=function(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},_i.prototype.updateOverlay=function(){var t,e=this.editorView.state.doc.resolve(this.cursorPos);if(!e.parent.inlineContent){var n=e.nodeBefore,r=e.nodeAfter;if(n||r){var o=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!t){var s=this.editorView.coordsAtPos(this.cursorPos);t={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}var a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color);var c=!a||a==document.body&&"static"==getComputedStyle(a).position?{left:-pageXOffset,top:-pageYOffset}:a.getBoundingClientRect();this.element.style.left=t.left-c.left+"px",this.element.style.top=t.top-c.top+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"},_i.prototype.scheduleRemoval=function(t){var e=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return e.setCursor(null)}),t)},_i.prototype.dragover=function(t){if(this.editorView.editable){var e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY});if(e){var n=e.pos;this.editorView.dragging&&this.editorView.dragging.slice&&null==(n=Lt(this.editorView.state.doc,n,this.editorView.dragging.slice))&&(n=e.pos),this.setCursor(n),this.scheduleRemoval(5e3)}}},_i.prototype.dragend=function(){this.scheduleRemoval(20)},_i.prototype.drop=function(){this.scheduleRemoval(20)},_i.prototype.dragleave=function(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)};var Si=function(t){function e(e){t.call(this,e,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,r){var o=n.resolve(r.map(this.head));return e.valid(o)?new e(o):t.near(o)},e.prototype.content=function(){return f.empty},e.prototype.eq=function(t){return t instanceof e&&t.head==this.head},e.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new e(t.resolve(n.pos))},e.prototype.getBookmark=function(){return new Ai(this.anchor)},e.valid=function(t){var e=t.parent;if(e.isTextblock||!function(t){for(var e=t.depth;e>=0;e--){var n=t.index(e);if(0!=n)for(var r=t.node(e).child(n-1);;r=r.lastChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}(t)||!function(t){for(var e=t.depth;e>=0;e--){var n=t.indexAfter(e),r=t.node(e);if(n!=r.childCount)for(var o=r.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}(t))return!1;var n=e.type.spec.allowGapCursor;if(null!=n)return n;var r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock},e.findFrom=function(t,n,r){if(!r&&e.valid(t))return t;for(var o=t.pos,i=null,s=t.depth;;s--){var a=t.node(s);if(n>0?t.indexAfter(s)0){i=a.maybeChild(n>0?t.indexAfter(s):t.index(s)-1);break}if(0==s)return null;o+=n;var c=t.doc.resolve(o);if(e.valid(c))return c}for(;i=n>0?i.firstChild:i.lastChild;){o+=n;var l=t.doc.resolve(o);if(e.valid(l))return l}return null},e}(Qt);Si.prototype.visible=!1,Qt.jsonID("gapcursor",Si);var Ai=function(t){this.pos=t};Ai.prototype.map=function(t){return new Ai(t.map(this.pos))},Ai.prototype.resolve=function(t){var e=t.resolve(this.pos);return Si.valid(e)?new Si(e):Qt.near(e)};var Mi=Io({ArrowLeft:Di("horiz",-1),ArrowRight:Di("horiz",1),ArrowUp:Di("vert",-1),ArrowDown:Di("vert",1)});function Di(t,e){var n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,o){var i=t.selection,s=e>0?i.$to:i.$from,a=i.empty;if(i instanceof ee){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=t.doc.resolve(e>0?s.after():s.before())}var c=Si.findFrom(s,e,a);return!!c&&(r&&r(t.tr.setSelection(new Si(c))),!0)}}function Ei(t,e,n){if(!t.editable)return!1;var r=t.state.doc.resolve(e);if(!Si.valid(r))return!1;var o=t.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(o>-1&&re.isSelectable(t.state.doc.nodeAt(o)))&&(t.dispatch(t.state.tr.setSelection(new Si(r))),!0)}function Oi(t){if(!(t.selection instanceof Si))return null;var e=document.createElement("div");return e.className="ProseMirror-gapcursor",Pr.create(t.doc,[Rr.widget(t.selection.head,e,{key:"gapcursor"})])}function Ti(t){return(Ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Ni=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){!function(e){var n,r="function",o=function(t,e){return Ti(t)===e},i=function t(e,n){null!==n&&(Array.isArray(n)?n.map((function(n){return t(e,n)})):(s.isNode(n)||(n=document.createTextNode(n)),e.appendChild(n)))};function s(t,e){var n,a,c=arguments,l=1;if(t=s.isElement(t)?t:document.createElement(t),o(e,"object")&&!s.isNode(e)&&!Array.isArray(e))for(n in l++,e)a=e[n],n=s.attrMap[n]||n,o(n,r)?n(t,a):o(a,r)?t[n]=a:t.setAttribute(n,a);for(;lthis.maxHeight&&(this.maxHeight=this.menu.offsetHeight,this.menu.style.minHeight=this.maxHeight+"px"))},es.prototype.updateScrollCursor=function(){var t=this.editorView.root.getSelection();if(t.focusNode){var e=t.getRangeAt(0).getClientRects(),n=e[function(t){if(t.anchorNode==t.focusNode)return t.anchorOffset>t.focusOffset;return t.anchorNode.compareDocumentPosition(t.focusNode)==Node.DOCUMENT_POSITION_FOLLOWING}(t)?0:e.length-1];if(n){var r=this.menu.getBoundingClientRect();if(n.topr.top){var o=function(t){for(var e=t.parentNode;e;e=e.parentNode)if(e.scrollHeight>e.clientHeight)return e}(this.wrapper);o&&(o.scrollTop-=r.bottom-n.top)}}}},es.prototype.updateFloat=function(t){var e=this.wrapper,n=e.getBoundingClientRect(),r=t?Math.max(0,t.getBoundingClientRect().top):0;if(this.floating)if(n.top>=r||n.bottomwindow.innerHeight?"none":"",t&&(this.menu.style.top=r+"px")}else if(n.top=this.menu.offsetHeight+10){this.floating=!0;var i=this.menu.getBoundingClientRect();this.menu.style.left=i.left+"px",this.menu.style.width=i.width+"px",t&&(this.menu.style.top=r+"px"),this.menu.style.position="fixed",this.spacer=Ni("div",{class:ts+"-spacer",style:"height: "+i.height+"px"}),e.insertBefore(this.spacer,this.menu)}},es.prototype.destroy=function(){this.wrapper.parentNode&&this.wrapper.parentNode.replaceChild(this.editorView.dom,this.wrapper)};function ns(t,e){return function(n,r){var o=n.selection,i=o.$from,a=o.$to,c=i.blockRange(a),l=!1,u=c;if(!c)return!1;if(c.depth>=2&&i.node(c.depth-1).type.compatibleContent(t)&&0==c.startIndex){if(0==i.index(c.depth-1))return!1;var p=n.doc.resolve(c.start-2);u=new M(p,p,c.depth),c.endIndex=0;a--)i=s.from(n[a].type.create(n[a].attrs,i));t.step(new Dt(e.start-(r?2:0),e.end,e.start,e.end,new f(i,0,0),n.length,!0));for(var c=0,l=0;lc;a--)i-=o.child(a).nodeSize,r.delete(i-1,i+1);var l=r.doc.resolve(n.start),u=l.nodeAfter,p=0==n.startIndex,h=n.endIndex==o.childCount,d=l.node(-1),m=l.index(-1);if(!d.canReplace(m+(p?0:1),m+1,u.content.append(h?s.empty:s.from(o))))return!1;var v=l.pos,g=v+u.nodeSize;return r.step(new Dt(v-(p?1:0),g+(h?1:0),v+1,g-1,new f((p?s.empty:s.from(o.copy(s.empty))).append(h?s.empty:s.from(o.copy(s.empty))),p?0:1,h?0:1),p?0:1)),e(r.scrollIntoView()),!0}(e,n,a)))}}var is=function(t,e){var n;this.match=t,this.handler="string"==typeof e?(n=e,function(t,e,r,o){var i=n;if(e[1]){var s=e[0].lastIndexOf(e[1]);i+=e[0].slice(s+e[1].length);var a=(r+=s)-o;a>0&&(i=e[0].slice(s-a,s)+i,r=o)}return t.tr.insertText(i,r,o)}):e};function ss(t,e,n,r,o,i){if(t.composing)return!1;var s=t.state,a=s.doc.resolve(e);if(a.parent.type.spec.code)return!1;for(var c=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r,l=0;l=0;c--)s.step(a.steps[c].invert(a.docs[c]));var l=s.doc.resolve(i.from).marks();e(s.replaceWith(i.from,i.to,t.schema.text(i.text,l)))}return!0}}return!1}var cs=new is(/--$/,"—"),ls=new is(/\.\.\.$/,"…"),us=[new is(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new is(/"$/,"”"),new is(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new is(/'$/,"’")];function ps(t,e,n,r){return new is(t,(function(t,o,i,s){var a=n instanceof Function?n(o):n,c=t.tr.delete(i,s),l=c.doc.resolve(i).blockRange(),u=l&&Nt(l,e,a);if(!u)return null;c.wrap(l,u);var p=c.doc.resolve(i-1).nodeBefore;return p&&p.type==e&&It(c.doc,i-1)&&(!r||r(o,p))&&c.join(i-1),c}))}function hs(t,e,n){return new is(t,(function(t,r,o,i){var s=t.doc.resolve(o),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e)?t.tr.delete(o,i).setBlockType(o,o,e,a):null}))}function fs(t){var e=document.body.appendChild(document.createElement("div"));e.className="ProseMirror-prompt";var n=function(t){e.contains(t.target)||r()};setTimeout((function(){return window.addEventListener("mousedown",n)}),50);var r=function(){window.removeEventListener("mousedown",n),e.parentNode&&e.parentNode.removeChild(e)},o=[];for(var i in t.fields)o.push(t.fields[i].render());var s=document.createElement("button");s.type="submit",s.className="ProseMirror-prompt-submit",s.textContent="OK";var a=document.createElement("button");a.type="button",a.className="ProseMirror-prompt-cancel",a.textContent="Cancel",a.addEventListener("click",r);var c=e.appendChild(document.createElement("form"));t.title&&(c.appendChild(document.createElement("h5")).textContent=t.title),o.forEach((function(t){c.appendChild(document.createElement("div")).appendChild(t)}));var l=c.appendChild(document.createElement("div"));l.className="ProseMirror-prompt-buttons",l.appendChild(s),l.appendChild(document.createTextNode(" ")),l.appendChild(a);var u=e.getBoundingClientRect();e.style.top=(window.innerHeight-u.height)/2+"px",e.style.left=(window.innerWidth-u.width)/2+"px";var p=function(){var e=function(t,e){var n=Object.create(null),r=0;for(var o in t){var i=t[o],s=e[r++],a=i.read(s),c=i.validate(a);if(c)return ds(s,c),null;n[o]=i.clean(a)}return n}(t.fields,o);e&&(r(),t.callback(e))};c.addEventListener("submit",(function(t){t.preventDefault(),p()})),c.addEventListener("keydown",(function(t){27==t.keyCode?(t.preventDefault(),r()):13!=t.keyCode||t.ctrlKey||t.metaKey||t.shiftKey?9==t.keyCode&&window.setTimeout((function(){e.contains(document.activeElement)||r()}),500):(t.preventDefault(),p())}));var h=c.elements[0];h&&h.focus()}function ds(t,e){var n=t.parentNode,r=n.appendChild(document.createElement("div"));r.style.left=t.offsetLeft+t.offsetWidth+2+"px",r.style.top=t.offsetTop-5+"px",r.className="ProseMirror-invalid",r.textContent=e,setTimeout((function(){return n.removeChild(r)}),1500)}var ms=function(t){this.options=t};ms.prototype.read=function(t){return t.value},ms.prototype.validateType=function(t){},ms.prototype.validate=function(t){return!t&&this.options.required?"Required field":this.validateType(t)||this.options.validate&&this.options.validate(t)},ms.prototype.clean=function(t){return this.options.clean?this.options.clean(t):t};var vs=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){var t=document.createElement("input");return t.type="text",t.placeholder=this.options.label,t.value=this.options.value||"",t.autocomplete="off",t},e}(ms);function gs(t,e){for(var n=t.selection.$from,r=n.depth;r>=0;r--){var o=n.index(r);if(n.node(r).canReplaceWith(o,o,e))return!0}return!1}function ys(t,e){var n={label:e.title,run:t};for(var r in e)n[r]=e[r];return e.enable&&!0!==e.enable||e.select||(n[e.enable?"enable":"select"]=function(e){return t(e)}),new Fi(n)}function bs(t,e){var n=t.selection,r=n.from,o=n.$from,i=n.to;return n.empty?e.isInSet(t.storedMarks||o.marks()):t.doc.rangeHasMark(r,i,e)}function ks(t,e){var n={active:function(e){return bs(e,t)},enable:!0};for(var r in e)n[r]=e[r];return ys(mi(t),n)}function ws(t,e){return ys(ns(t,e.attrs),e)}function xs(t){var e,n,r,o={};if((e=t.marks.strong)&&(o.toggleStrong=ks(e,{title:"Toggle strong style",icon:Wi.strong})),(e=t.marks.em)&&(o.toggleEm=ks(e,{title:"Toggle emphasis",icon:Wi.em})),(e=t.marks.code)&&(o.toggleCode=ks(e,{title:"Toggle code font",icon:Wi.code})),(e=t.marks.link)&&(o.toggleLink=(n=e,new Fi({title:"Add or remove link",icon:Wi.link,active:function(t){return bs(t,n)},enable:function(t){return!t.selection.empty},run:function(t,e,r){if(bs(t,n))return mi(n)(t,e),!0;fs({title:"Create a link",fields:{href:new vs({label:"Link target",required:!0}),title:new vs({label:"Title"})},callback:function(t){mi(n,t)(r.state,r.dispatch),r.focus()}})}}))),(e=t.nodes.image)&&(o.insertImage=(r=e,new Fi({title:"Insert image",label:"Image",enable:function(t){return gs(t,r)},run:function(t,e,n){var o=t.selection,i=o.from,s=o.to,a=null;t.selection instanceof re&&t.selection.node.type==r&&(a=t.selection.node.attrs),fs({title:"Insert image",fields:{src:new vs({label:"Location",required:!0,value:a&&a.src}),title:new vs({label:"Title",value:a&&a.title}),alt:new vs({label:"Description",value:a?a.alt:t.doc.textBetween(i,s," ")})},callback:function(t){n.dispatch(n.state.tr.replaceSelectionWith(r.createAndFill(t))),n.focus()}})}}))),(e=t.nodes.bullet_list)&&(o.wrapBulletList=ws(e,{title:"Wrap in bullet list",icon:Wi.bulletList})),(e=t.nodes.ordered_list)&&(o.wrapOrderedList=ws(e,{title:"Wrap in ordered list",icon:Wi.orderedList})),(e=t.nodes.blockquote)&&(o.wrapBlockQuote=function(t,e){var n={run:function(n,r){return fi(t,e.attrs)(n,r)},select:function(n){return fi(t,e.attrs instanceof Function?null:e.attrs)(n)}};for(var r in e)n[r]=e[r];return new Fi(n)}(e,{title:"Wrap in block quote",icon:Wi.blockquote})),(e=t.nodes.paragraph)&&(o.makeParagraph=Qi(e,{title:"Change to paragraph",label:"Plain"})),(e=t.nodes.code_block)&&(o.makeCodeBlock=Qi(e,{title:"Change to code block",label:"Code"})),e=t.nodes.heading)for(var i=1;i<=10;i++)o["makeHead"+i]=Qi(e,{title:"Change to heading "+i,label:"Level "+i,attrs:{level:i}});if(e=t.nodes.horizontal_rule){var s=e;o.insertHorizontalRule=new Fi({title:"Insert horizontal rule",label:"Horizontal rule",enable:function(t){return gs(t,s)},run:function(t,e){e(t.tr.replaceSelectionWith(s.create()))}})}var a=function(t){return t.filter((function(t){return t}))};return o.insertMenu=new $i(a([o.insertImage,o.insertHorizontalRule]),{label:"Insert"}),o.typeMenu=new $i(a([o.makeParagraph,o.makeCodeBlock,o.makeHead1&&new Hi(a([o.makeHead1,o.makeHead2,o.makeHead3,o.makeHead4,o.makeHead5,o.makeHead6]),{label:"Heading"})]),{label:"Type..."}),o.inlineMenu=[a([o.toggleStrong,o.toggleEm,o.toggleCode,o.toggleLink])],o.blockMenu=[a([o.wrapBulletList,o.wrapOrderedList,o.wrapBlockQuote,Ui,Ki,Gi])],o.fullMenu=o.inlineMenu.concat([[o.insertMenu,o.typeMenu]],[[Zi,Yi]],o.blockMenu),o}var Cs="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);function _s(t,e){var n,r,o={};function i(t,n){if(e){var r=e[t];if(!1===r)return;r&&(t=r)}o[t]=n}if(i("Mod-z",Xo),i("Shift-Mod-z",ti),i("Backspace",as),Cs||i("Mod-y",ti),i("Alt-ArrowUp",ii),i("Alt-ArrowDown",si),i("Mod-BracketLeft",ai),i("Escape",pi),(n=t.marks.strong)&&(i("Mod-b",mi(n)),i("Mod-B",mi(n))),(n=t.marks.em)&&(i("Mod-i",mi(n)),i("Mod-I",mi(n))),(n=t.marks.code)&&i("Mod-`",mi(n)),(n=t.nodes.bullet_list)&&i("Shift-Ctrl-8",ns(n)),(n=t.nodes.ordered_list)&&i("Shift-Ctrl-9",ns(n)),(n=t.nodes.blockquote)&&i("Ctrl->",fi(n)),n=t.nodes.hard_break){var a=n,c=vi(li,(function(t,e){return e(t.tr.replaceSelectionWith(a.create()).scrollIntoView()),!0}));i("Mod-Enter",c),i("Shift-Enter",c),Cs&&i("Ctrl-Enter",c)}if((n=t.nodes.list_item)&&(i("Enter",(r=n,function(t,e){var n=t.selection,o=n.$from,i=n.$to,a=n.node;if(a&&a.isBlock||o.depth<2||!o.sameParent(i))return!1;var c=o.node(-1);if(c.type!=r)return!1;if(0==o.parent.content.size){if(2==o.depth||o.node(-3).type!=r||o.index(-2)!=o.node(-2).childCount-1)return!1;if(e){for(var l=s.empty,u=o.index(-1)>0,p=o.depth-(u?1:2);p>=o.depth-3;p--)l=s.from(o.node(p).copy(l));l=l.append(s.from(r.createAndFill()));var h=t.tr.replace(o.before(u?null:-1),o.after(-3),new f(l,u?3:2,2));h.setSelection(t.selection.constructor.near(h.doc.resolve(o.pos+(u?3:2)))),e(h.scrollIntoView())}return!0}var d=i.pos==o.end()?c.contentMatchAt(0).defaultType:null,m=t.tr.delete(o.pos,i.pos),v=d&&[null,{type:d}];return!!qt(m.doc,o.pos,2,v)&&(e&&e(m.split(o.pos,2,v).scrollIntoView()),!0)})),i("Mod-[",rs(n)),i("Mod-]",function(t){return function(e,n){var r=e.selection,o=r.$from,i=r.$to,a=o.blockRange(i,(function(e){return e.childCount&&e.firstChild.type==t}));if(!a)return!1;var c=a.startIndex;if(0==c)return!1;var l=a.parent,u=l.child(c-1);if(u.type!=t)return!1;if(n){var p=u.lastChild&&u.lastChild.type==l.type,h=s.from(p?t.create():null),d=new f(s.from(t.create(null,s.from(l.type.create(null,h)))),p?3:1,0),m=a.start,v=a.end;n(e.tr.step(new Dt(m-(p?3:1),v,m,v,d,1,!0)).scrollIntoView())}return!0}}(n))),(n=t.nodes.paragraph)&&i("Shift-Ctrl-0",di(n)),(n=t.nodes.code_block)&&i("Shift-Ctrl-\\",di(n)),n=t.nodes.heading)for(var l=1;l<=6;l++)i("Shift-Ctrl-"+l,di(n,{level:l}));if(n=t.nodes.horizontal_rule){var u=n;i("Mod-_",(function(t,e){return e(t.tr.replaceSelectionWith(u.create()).scrollIntoView()),!0}))}return o}function Ss(t){var e,n=us.concat(ls,cs);return(e=t.nodes.blockquote)&&n.push(ps(/^\s*>\s$/,e)),(e=t.nodes.ordered_list)&&n.push(function(t){return ps(/^(\d+)\.\s$/,t,(function(t){return{order:+t[1]}}),(function(t,e){return e.childCount+e.attrs.order==+t[1]}))}(e)),(e=t.nodes.bullet_list)&&n.push(function(t){return ps(/^\s*([-+*])\s$/,t)}(e)),(e=t.nodes.code_block)&&n.push(function(t){return hs(/^```$/,t)}(e)),(e=t.nodes.heading)&&n.push(function(t,e){return hs(new RegExp("^(#{1,"+e+"})\\s$"),t,(function(t){return{level:t[1].length}}))}(e,6)),function(t){var e=t.rules,n=new ge({state:{init:function(){return null},apply:function(t,e){var n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:function(t,r,o,i){return ss(t,r,o,i,e,n)},handleDOMEvents:{compositionend:function(t){setTimeout((function(){var r=t.state.selection.$cursor;r&&ss(t,r.pos,r.pos,"",e,n)}))}}},isInputRules:!0});return n}({rules:n})}function As(t){var e=[Ss(t.schema),qo(_s(t.schema,t.mapKeys)),qo(xi),Ci(),new ge({props:{decorations:Oi,createSelectionBetween:function(t,e,n){if(e.pos==n.pos&&Si.valid(n))return new Si(n)},handleClick:Ei,handleKeyDown:Mi}})];return!1!==t.menuBar&&e.push(function(t){return new ge({view:function(e){return new es(e,t)}})}({floating:!1!==t.floatingMenu,content:t.menuContent||xs(t.schema).fullMenu})),!1!==t.history&&e.push(Qo()),e.concat(new ge({props:{attributes:{class:"ProseMirror-example-setup-style"}}}))}function Ms(t,e){for(var n=0;n\\\",\\\"GT\\\":\\\">\\\",\\\"Gt\\\":\\\"≫\\\",\\\"gtdot\\\":\\\"⋗\\\",\\\"gtlPar\\\":\\\"⦕\\\",\\\"gtquest\\\":\\\"⩼\\\",\\\"gtrapprox\\\":\\\"⪆\\\",\\\"gtrarr\\\":\\\"⥸\\\",\\\"gtrdot\\\":\\\"⋗\\\",\\\"gtreqless\\\":\\\"⋛\\\",\\\"gtreqqless\\\":\\\"⪌\\\",\\\"gtrless\\\":\\\"≷\\\",\\\"gtrsim\\\":\\\"≳\\\",\\\"gvertneqq\\\":\\\"≩︀\\\",\\\"gvnE\\\":\\\"≩︀\\\",\\\"Hacek\\\":\\\"ˇ\\\",\\\"hairsp\\\":\\\" \\\",\\\"half\\\":\\\"½\\\",\\\"hamilt\\\":\\\"ℋ\\\",\\\"HARDcy\\\":\\\"Ъ\\\",\\\"hardcy\\\":\\\"ъ\\\",\\\"harrcir\\\":\\\"⥈\\\",\\\"harr\\\":\\\"↔\\\",\\\"hArr\\\":\\\"⇔\\\",\\\"harrw\\\":\\\"↭\\\",\\\"Hat\\\":\\\"^\\\",\\\"hbar\\\":\\\"ℏ\\\",\\\"Hcirc\\\":\\\"Ĥ\\\",\\\"hcirc\\\":\\\"ĥ\\\",\\\"hearts\\\":\\\"♥\\\",\\\"heartsuit\\\":\\\"♥\\\",\\\"hellip\\\":\\\"…\\\",\\\"hercon\\\":\\\"⊹\\\",\\\"hfr\\\":\\\"𝔥\\\",\\\"Hfr\\\":\\\"ℌ\\\",\\\"HilbertSpace\\\":\\\"ℋ\\\",\\\"hksearow\\\":\\\"⤥\\\",\\\"hkswarow\\\":\\\"⤦\\\",\\\"hoarr\\\":\\\"⇿\\\",\\\"homtht\\\":\\\"∻\\\",\\\"hookleftarrow\\\":\\\"↩\\\",\\\"hookrightarrow\\\":\\\"↪\\\",\\\"hopf\\\":\\\"𝕙\\\",\\\"Hopf\\\":\\\"ℍ\\\",\\\"horbar\\\":\\\"―\\\",\\\"HorizontalLine\\\":\\\"─\\\",\\\"hscr\\\":\\\"𝒽\\\",\\\"Hscr\\\":\\\"ℋ\\\",\\\"hslash\\\":\\\"ℏ\\\",\\\"Hstrok\\\":\\\"Ħ\\\",\\\"hstrok\\\":\\\"ħ\\\",\\\"HumpDownHump\\\":\\\"≎\\\",\\\"HumpEqual\\\":\\\"≏\\\",\\\"hybull\\\":\\\"⁃\\\",\\\"hyphen\\\":\\\"‐\\\",\\\"Iacute\\\":\\\"Í\\\",\\\"iacute\\\":\\\"í\\\",\\\"ic\\\":\\\"⁣\\\",\\\"Icirc\\\":\\\"Î\\\",\\\"icirc\\\":\\\"î\\\",\\\"Icy\\\":\\\"И\\\",\\\"icy\\\":\\\"и\\\",\\\"Idot\\\":\\\"İ\\\",\\\"IEcy\\\":\\\"Е\\\",\\\"iecy\\\":\\\"е\\\",\\\"iexcl\\\":\\\"¡\\\",\\\"iff\\\":\\\"⇔\\\",\\\"ifr\\\":\\\"𝔦\\\",\\\"Ifr\\\":\\\"ℑ\\\",\\\"Igrave\\\":\\\"Ì\\\",\\\"igrave\\\":\\\"ì\\\",\\\"ii\\\":\\\"ⅈ\\\",\\\"iiiint\\\":\\\"⨌\\\",\\\"iiint\\\":\\\"∭\\\",\\\"iinfin\\\":\\\"⧜\\\",\\\"iiota\\\":\\\"℩\\\",\\\"IJlig\\\":\\\"IJ\\\",\\\"ijlig\\\":\\\"ij\\\",\\\"Imacr\\\":\\\"Ī\\\",\\\"imacr\\\":\\\"ī\\\",\\\"image\\\":\\\"ℑ\\\",\\\"ImaginaryI\\\":\\\"ⅈ\\\",\\\"imagline\\\":\\\"ℐ\\\",\\\"imagpart\\\":\\\"ℑ\\\",\\\"imath\\\":\\\"ı\\\",\\\"Im\\\":\\\"ℑ\\\",\\\"imof\\\":\\\"⊷\\\",\\\"imped\\\":\\\"Ƶ\\\",\\\"Implies\\\":\\\"⇒\\\",\\\"incare\\\":\\\"℅\\\",\\\"in\\\":\\\"∈\\\",\\\"infin\\\":\\\"∞\\\",\\\"infintie\\\":\\\"⧝\\\",\\\"inodot\\\":\\\"ı\\\",\\\"intcal\\\":\\\"⊺\\\",\\\"int\\\":\\\"∫\\\",\\\"Int\\\":\\\"∬\\\",\\\"integers\\\":\\\"ℤ\\\",\\\"Integral\\\":\\\"∫\\\",\\\"intercal\\\":\\\"⊺\\\",\\\"Intersection\\\":\\\"⋂\\\",\\\"intlarhk\\\":\\\"⨗\\\",\\\"intprod\\\":\\\"⨼\\\",\\\"InvisibleComma\\\":\\\"⁣\\\",\\\"InvisibleTimes\\\":\\\"⁢\\\",\\\"IOcy\\\":\\\"Ё\\\",\\\"iocy\\\":\\\"ё\\\",\\\"Iogon\\\":\\\"Į\\\",\\\"iogon\\\":\\\"į\\\",\\\"Iopf\\\":\\\"𝕀\\\",\\\"iopf\\\":\\\"𝕚\\\",\\\"Iota\\\":\\\"Ι\\\",\\\"iota\\\":\\\"ι\\\",\\\"iprod\\\":\\\"⨼\\\",\\\"iquest\\\":\\\"¿\\\",\\\"iscr\\\":\\\"𝒾\\\",\\\"Iscr\\\":\\\"ℐ\\\",\\\"isin\\\":\\\"∈\\\",\\\"isindot\\\":\\\"⋵\\\",\\\"isinE\\\":\\\"⋹\\\",\\\"isins\\\":\\\"⋴\\\",\\\"isinsv\\\":\\\"⋳\\\",\\\"isinv\\\":\\\"∈\\\",\\\"it\\\":\\\"⁢\\\",\\\"Itilde\\\":\\\"Ĩ\\\",\\\"itilde\\\":\\\"ĩ\\\",\\\"Iukcy\\\":\\\"І\\\",\\\"iukcy\\\":\\\"і\\\",\\\"Iuml\\\":\\\"Ï\\\",\\\"iuml\\\":\\\"ï\\\",\\\"Jcirc\\\":\\\"Ĵ\\\",\\\"jcirc\\\":\\\"ĵ\\\",\\\"Jcy\\\":\\\"Й\\\",\\\"jcy\\\":\\\"й\\\",\\\"Jfr\\\":\\\"𝔍\\\",\\\"jfr\\\":\\\"𝔧\\\",\\\"jmath\\\":\\\"ȷ\\\",\\\"Jopf\\\":\\\"𝕁\\\",\\\"jopf\\\":\\\"𝕛\\\",\\\"Jscr\\\":\\\"𝒥\\\",\\\"jscr\\\":\\\"𝒿\\\",\\\"Jsercy\\\":\\\"Ј\\\",\\\"jsercy\\\":\\\"ј\\\",\\\"Jukcy\\\":\\\"Є\\\",\\\"jukcy\\\":\\\"є\\\",\\\"Kappa\\\":\\\"Κ\\\",\\\"kappa\\\":\\\"κ\\\",\\\"kappav\\\":\\\"ϰ\\\",\\\"Kcedil\\\":\\\"Ķ\\\",\\\"kcedil\\\":\\\"ķ\\\",\\\"Kcy\\\":\\\"К\\\",\\\"kcy\\\":\\\"к\\\",\\\"Kfr\\\":\\\"𝔎\\\",\\\"kfr\\\":\\\"𝔨\\\",\\\"kgreen\\\":\\\"ĸ\\\",\\\"KHcy\\\":\\\"Х\\\",\\\"khcy\\\":\\\"х\\\",\\\"KJcy\\\":\\\"Ќ\\\",\\\"kjcy\\\":\\\"ќ\\\",\\\"Kopf\\\":\\\"𝕂\\\",\\\"kopf\\\":\\\"𝕜\\\",\\\"Kscr\\\":\\\"𝒦\\\",\\\"kscr\\\":\\\"𝓀\\\",\\\"lAarr\\\":\\\"⇚\\\",\\\"Lacute\\\":\\\"Ĺ\\\",\\\"lacute\\\":\\\"ĺ\\\",\\\"laemptyv\\\":\\\"⦴\\\",\\\"lagran\\\":\\\"ℒ\\\",\\\"Lambda\\\":\\\"Λ\\\",\\\"lambda\\\":\\\"λ\\\",\\\"lang\\\":\\\"⟨\\\",\\\"Lang\\\":\\\"⟪\\\",\\\"langd\\\":\\\"⦑\\\",\\\"langle\\\":\\\"⟨\\\",\\\"lap\\\":\\\"⪅\\\",\\\"Laplacetrf\\\":\\\"ℒ\\\",\\\"laquo\\\":\\\"«\\\",\\\"larrb\\\":\\\"⇤\\\",\\\"larrbfs\\\":\\\"⤟\\\",\\\"larr\\\":\\\"←\\\",\\\"Larr\\\":\\\"↞\\\",\\\"lArr\\\":\\\"⇐\\\",\\\"larrfs\\\":\\\"⤝\\\",\\\"larrhk\\\":\\\"↩\\\",\\\"larrlp\\\":\\\"↫\\\",\\\"larrpl\\\":\\\"⤹\\\",\\\"larrsim\\\":\\\"⥳\\\",\\\"larrtl\\\":\\\"↢\\\",\\\"latail\\\":\\\"⤙\\\",\\\"lAtail\\\":\\\"⤛\\\",\\\"lat\\\":\\\"⪫\\\",\\\"late\\\":\\\"⪭\\\",\\\"lates\\\":\\\"⪭︀\\\",\\\"lbarr\\\":\\\"⤌\\\",\\\"lBarr\\\":\\\"⤎\\\",\\\"lbbrk\\\":\\\"❲\\\",\\\"lbrace\\\":\\\"{\\\",\\\"lbrack\\\":\\\"[\\\",\\\"lbrke\\\":\\\"⦋\\\",\\\"lbrksld\\\":\\\"⦏\\\",\\\"lbrkslu\\\":\\\"⦍\\\",\\\"Lcaron\\\":\\\"Ľ\\\",\\\"lcaron\\\":\\\"ľ\\\",\\\"Lcedil\\\":\\\"Ļ\\\",\\\"lcedil\\\":\\\"ļ\\\",\\\"lceil\\\":\\\"⌈\\\",\\\"lcub\\\":\\\"{\\\",\\\"Lcy\\\":\\\"Л\\\",\\\"lcy\\\":\\\"л\\\",\\\"ldca\\\":\\\"⤶\\\",\\\"ldquo\\\":\\\"“\\\",\\\"ldquor\\\":\\\"„\\\",\\\"ldrdhar\\\":\\\"⥧\\\",\\\"ldrushar\\\":\\\"⥋\\\",\\\"ldsh\\\":\\\"↲\\\",\\\"le\\\":\\\"≤\\\",\\\"lE\\\":\\\"≦\\\",\\\"LeftAngleBracket\\\":\\\"⟨\\\",\\\"LeftArrowBar\\\":\\\"⇤\\\",\\\"leftarrow\\\":\\\"←\\\",\\\"LeftArrow\\\":\\\"←\\\",\\\"Leftarrow\\\":\\\"⇐\\\",\\\"LeftArrowRightArrow\\\":\\\"⇆\\\",\\\"leftarrowtail\\\":\\\"↢\\\",\\\"LeftCeiling\\\":\\\"⌈\\\",\\\"LeftDoubleBracket\\\":\\\"⟦\\\",\\\"LeftDownTeeVector\\\":\\\"⥡\\\",\\\"LeftDownVectorBar\\\":\\\"⥙\\\",\\\"LeftDownVector\\\":\\\"⇃\\\",\\\"LeftFloor\\\":\\\"⌊\\\",\\\"leftharpoondown\\\":\\\"↽\\\",\\\"leftharpoonup\\\":\\\"↼\\\",\\\"leftleftarrows\\\":\\\"⇇\\\",\\\"leftrightarrow\\\":\\\"↔\\\",\\\"LeftRightArrow\\\":\\\"↔\\\",\\\"Leftrightarrow\\\":\\\"⇔\\\",\\\"leftrightarrows\\\":\\\"⇆\\\",\\\"leftrightharpoons\\\":\\\"⇋\\\",\\\"leftrightsquigarrow\\\":\\\"↭\\\",\\\"LeftRightVector\\\":\\\"⥎\\\",\\\"LeftTeeArrow\\\":\\\"↤\\\",\\\"LeftTee\\\":\\\"⊣\\\",\\\"LeftTeeVector\\\":\\\"⥚\\\",\\\"leftthreetimes\\\":\\\"⋋\\\",\\\"LeftTriangleBar\\\":\\\"⧏\\\",\\\"LeftTriangle\\\":\\\"⊲\\\",\\\"LeftTriangleEqual\\\":\\\"⊴\\\",\\\"LeftUpDownVector\\\":\\\"⥑\\\",\\\"LeftUpTeeVector\\\":\\\"⥠\\\",\\\"LeftUpVectorBar\\\":\\\"⥘\\\",\\\"LeftUpVector\\\":\\\"↿\\\",\\\"LeftVectorBar\\\":\\\"⥒\\\",\\\"LeftVector\\\":\\\"↼\\\",\\\"lEg\\\":\\\"⪋\\\",\\\"leg\\\":\\\"⋚\\\",\\\"leq\\\":\\\"≤\\\",\\\"leqq\\\":\\\"≦\\\",\\\"leqslant\\\":\\\"⩽\\\",\\\"lescc\\\":\\\"⪨\\\",\\\"les\\\":\\\"⩽\\\",\\\"lesdot\\\":\\\"⩿\\\",\\\"lesdoto\\\":\\\"⪁\\\",\\\"lesdotor\\\":\\\"⪃\\\",\\\"lesg\\\":\\\"⋚︀\\\",\\\"lesges\\\":\\\"⪓\\\",\\\"lessapprox\\\":\\\"⪅\\\",\\\"lessdot\\\":\\\"⋖\\\",\\\"lesseqgtr\\\":\\\"⋚\\\",\\\"lesseqqgtr\\\":\\\"⪋\\\",\\\"LessEqualGreater\\\":\\\"⋚\\\",\\\"LessFullEqual\\\":\\\"≦\\\",\\\"LessGreater\\\":\\\"≶\\\",\\\"lessgtr\\\":\\\"≶\\\",\\\"LessLess\\\":\\\"⪡\\\",\\\"lesssim\\\":\\\"≲\\\",\\\"LessSlantEqual\\\":\\\"⩽\\\",\\\"LessTilde\\\":\\\"≲\\\",\\\"lfisht\\\":\\\"⥼\\\",\\\"lfloor\\\":\\\"⌊\\\",\\\"Lfr\\\":\\\"𝔏\\\",\\\"lfr\\\":\\\"𝔩\\\",\\\"lg\\\":\\\"≶\\\",\\\"lgE\\\":\\\"⪑\\\",\\\"lHar\\\":\\\"⥢\\\",\\\"lhard\\\":\\\"↽\\\",\\\"lharu\\\":\\\"↼\\\",\\\"lharul\\\":\\\"⥪\\\",\\\"lhblk\\\":\\\"▄\\\",\\\"LJcy\\\":\\\"Љ\\\",\\\"ljcy\\\":\\\"љ\\\",\\\"llarr\\\":\\\"⇇\\\",\\\"ll\\\":\\\"≪\\\",\\\"Ll\\\":\\\"⋘\\\",\\\"llcorner\\\":\\\"⌞\\\",\\\"Lleftarrow\\\":\\\"⇚\\\",\\\"llhard\\\":\\\"⥫\\\",\\\"lltri\\\":\\\"◺\\\",\\\"Lmidot\\\":\\\"Ŀ\\\",\\\"lmidot\\\":\\\"ŀ\\\",\\\"lmoustache\\\":\\\"⎰\\\",\\\"lmoust\\\":\\\"⎰\\\",\\\"lnap\\\":\\\"⪉\\\",\\\"lnapprox\\\":\\\"⪉\\\",\\\"lne\\\":\\\"⪇\\\",\\\"lnE\\\":\\\"≨\\\",\\\"lneq\\\":\\\"⪇\\\",\\\"lneqq\\\":\\\"≨\\\",\\\"lnsim\\\":\\\"⋦\\\",\\\"loang\\\":\\\"⟬\\\",\\\"loarr\\\":\\\"⇽\\\",\\\"lobrk\\\":\\\"⟦\\\",\\\"longleftarrow\\\":\\\"⟵\\\",\\\"LongLeftArrow\\\":\\\"⟵\\\",\\\"Longleftarrow\\\":\\\"⟸\\\",\\\"longleftrightarrow\\\":\\\"⟷\\\",\\\"LongLeftRightArrow\\\":\\\"⟷\\\",\\\"Longleftrightarrow\\\":\\\"⟺\\\",\\\"longmapsto\\\":\\\"⟼\\\",\\\"longrightarrow\\\":\\\"⟶\\\",\\\"LongRightArrow\\\":\\\"⟶\\\",\\\"Longrightarrow\\\":\\\"⟹\\\",\\\"looparrowleft\\\":\\\"↫\\\",\\\"looparrowright\\\":\\\"↬\\\",\\\"lopar\\\":\\\"⦅\\\",\\\"Lopf\\\":\\\"𝕃\\\",\\\"lopf\\\":\\\"𝕝\\\",\\\"loplus\\\":\\\"⨭\\\",\\\"lotimes\\\":\\\"⨴\\\",\\\"lowast\\\":\\\"∗\\\",\\\"lowbar\\\":\\\"_\\\",\\\"LowerLeftArrow\\\":\\\"↙\\\",\\\"LowerRightArrow\\\":\\\"↘\\\",\\\"loz\\\":\\\"◊\\\",\\\"lozenge\\\":\\\"◊\\\",\\\"lozf\\\":\\\"⧫\\\",\\\"lpar\\\":\\\"(\\\",\\\"lparlt\\\":\\\"⦓\\\",\\\"lrarr\\\":\\\"⇆\\\",\\\"lrcorner\\\":\\\"⌟\\\",\\\"lrhar\\\":\\\"⇋\\\",\\\"lrhard\\\":\\\"⥭\\\",\\\"lrm\\\":\\\"‎\\\",\\\"lrtri\\\":\\\"⊿\\\",\\\"lsaquo\\\":\\\"‹\\\",\\\"lscr\\\":\\\"𝓁\\\",\\\"Lscr\\\":\\\"ℒ\\\",\\\"lsh\\\":\\\"↰\\\",\\\"Lsh\\\":\\\"↰\\\",\\\"lsim\\\":\\\"≲\\\",\\\"lsime\\\":\\\"⪍\\\",\\\"lsimg\\\":\\\"⪏\\\",\\\"lsqb\\\":\\\"[\\\",\\\"lsquo\\\":\\\"‘\\\",\\\"lsquor\\\":\\\"‚\\\",\\\"Lstrok\\\":\\\"Ł\\\",\\\"lstrok\\\":\\\"ł\\\",\\\"ltcc\\\":\\\"⪦\\\",\\\"ltcir\\\":\\\"⩹\\\",\\\"lt\\\":\\\"<\\\",\\\"LT\\\":\\\"<\\\",\\\"Lt\\\":\\\"≪\\\",\\\"ltdot\\\":\\\"⋖\\\",\\\"lthree\\\":\\\"⋋\\\",\\\"ltimes\\\":\\\"⋉\\\",\\\"ltlarr\\\":\\\"⥶\\\",\\\"ltquest\\\":\\\"⩻\\\",\\\"ltri\\\":\\\"◃\\\",\\\"ltrie\\\":\\\"⊴\\\",\\\"ltrif\\\":\\\"◂\\\",\\\"ltrPar\\\":\\\"⦖\\\",\\\"lurdshar\\\":\\\"⥊\\\",\\\"luruhar\\\":\\\"⥦\\\",\\\"lvertneqq\\\":\\\"≨︀\\\",\\\"lvnE\\\":\\\"≨︀\\\",\\\"macr\\\":\\\"¯\\\",\\\"male\\\":\\\"♂\\\",\\\"malt\\\":\\\"✠\\\",\\\"maltese\\\":\\\"✠\\\",\\\"Map\\\":\\\"⤅\\\",\\\"map\\\":\\\"↦\\\",\\\"mapsto\\\":\\\"↦\\\",\\\"mapstodown\\\":\\\"↧\\\",\\\"mapstoleft\\\":\\\"↤\\\",\\\"mapstoup\\\":\\\"↥\\\",\\\"marker\\\":\\\"▮\\\",\\\"mcomma\\\":\\\"⨩\\\",\\\"Mcy\\\":\\\"М\\\",\\\"mcy\\\":\\\"м\\\",\\\"mdash\\\":\\\"—\\\",\\\"mDDot\\\":\\\"∺\\\",\\\"measuredangle\\\":\\\"∡\\\",\\\"MediumSpace\\\":\\\" \\\",\\\"Mellintrf\\\":\\\"ℳ\\\",\\\"Mfr\\\":\\\"𝔐\\\",\\\"mfr\\\":\\\"𝔪\\\",\\\"mho\\\":\\\"℧\\\",\\\"micro\\\":\\\"µ\\\",\\\"midast\\\":\\\"*\\\",\\\"midcir\\\":\\\"⫰\\\",\\\"mid\\\":\\\"∣\\\",\\\"middot\\\":\\\"·\\\",\\\"minusb\\\":\\\"⊟\\\",\\\"minus\\\":\\\"−\\\",\\\"minusd\\\":\\\"∸\\\",\\\"minusdu\\\":\\\"⨪\\\",\\\"MinusPlus\\\":\\\"∓\\\",\\\"mlcp\\\":\\\"⫛\\\",\\\"mldr\\\":\\\"…\\\",\\\"mnplus\\\":\\\"∓\\\",\\\"models\\\":\\\"⊧\\\",\\\"Mopf\\\":\\\"𝕄\\\",\\\"mopf\\\":\\\"𝕞\\\",\\\"mp\\\":\\\"∓\\\",\\\"mscr\\\":\\\"𝓂\\\",\\\"Mscr\\\":\\\"ℳ\\\",\\\"mstpos\\\":\\\"∾\\\",\\\"Mu\\\":\\\"Μ\\\",\\\"mu\\\":\\\"μ\\\",\\\"multimap\\\":\\\"⊸\\\",\\\"mumap\\\":\\\"⊸\\\",\\\"nabla\\\":\\\"∇\\\",\\\"Nacute\\\":\\\"Ń\\\",\\\"nacute\\\":\\\"ń\\\",\\\"nang\\\":\\\"∠⃒\\\",\\\"nap\\\":\\\"≉\\\",\\\"napE\\\":\\\"⩰̸\\\",\\\"napid\\\":\\\"≋̸\\\",\\\"napos\\\":\\\"ʼn\\\",\\\"napprox\\\":\\\"≉\\\",\\\"natural\\\":\\\"♮\\\",\\\"naturals\\\":\\\"ℕ\\\",\\\"natur\\\":\\\"♮\\\",\\\"nbsp\\\":\\\" \\\",\\\"nbump\\\":\\\"≎̸\\\",\\\"nbumpe\\\":\\\"≏̸\\\",\\\"ncap\\\":\\\"⩃\\\",\\\"Ncaron\\\":\\\"Ň\\\",\\\"ncaron\\\":\\\"ň\\\",\\\"Ncedil\\\":\\\"Ņ\\\",\\\"ncedil\\\":\\\"ņ\\\",\\\"ncong\\\":\\\"≇\\\",\\\"ncongdot\\\":\\\"⩭̸\\\",\\\"ncup\\\":\\\"⩂\\\",\\\"Ncy\\\":\\\"Н\\\",\\\"ncy\\\":\\\"н\\\",\\\"ndash\\\":\\\"–\\\",\\\"nearhk\\\":\\\"⤤\\\",\\\"nearr\\\":\\\"↗\\\",\\\"neArr\\\":\\\"⇗\\\",\\\"nearrow\\\":\\\"↗\\\",\\\"ne\\\":\\\"≠\\\",\\\"nedot\\\":\\\"≐̸\\\",\\\"NegativeMediumSpace\\\":\\\"​\\\",\\\"NegativeThickSpace\\\":\\\"​\\\",\\\"NegativeThinSpace\\\":\\\"​\\\",\\\"NegativeVeryThinSpace\\\":\\\"​\\\",\\\"nequiv\\\":\\\"≢\\\",\\\"nesear\\\":\\\"⤨\\\",\\\"nesim\\\":\\\"≂̸\\\",\\\"NestedGreaterGreater\\\":\\\"≫\\\",\\\"NestedLessLess\\\":\\\"≪\\\",\\\"NewLine\\\":\\\"\\\\n\\\",\\\"nexist\\\":\\\"∄\\\",\\\"nexists\\\":\\\"∄\\\",\\\"Nfr\\\":\\\"𝔑\\\",\\\"nfr\\\":\\\"𝔫\\\",\\\"ngE\\\":\\\"≧̸\\\",\\\"nge\\\":\\\"≱\\\",\\\"ngeq\\\":\\\"≱\\\",\\\"ngeqq\\\":\\\"≧̸\\\",\\\"ngeqslant\\\":\\\"⩾̸\\\",\\\"nges\\\":\\\"⩾̸\\\",\\\"nGg\\\":\\\"⋙̸\\\",\\\"ngsim\\\":\\\"≵\\\",\\\"nGt\\\":\\\"≫⃒\\\",\\\"ngt\\\":\\\"≯\\\",\\\"ngtr\\\":\\\"≯\\\",\\\"nGtv\\\":\\\"≫̸\\\",\\\"nharr\\\":\\\"↮\\\",\\\"nhArr\\\":\\\"⇎\\\",\\\"nhpar\\\":\\\"⫲\\\",\\\"ni\\\":\\\"∋\\\",\\\"nis\\\":\\\"⋼\\\",\\\"nisd\\\":\\\"⋺\\\",\\\"niv\\\":\\\"∋\\\",\\\"NJcy\\\":\\\"Њ\\\",\\\"njcy\\\":\\\"њ\\\",\\\"nlarr\\\":\\\"↚\\\",\\\"nlArr\\\":\\\"⇍\\\",\\\"nldr\\\":\\\"‥\\\",\\\"nlE\\\":\\\"≦̸\\\",\\\"nle\\\":\\\"≰\\\",\\\"nleftarrow\\\":\\\"↚\\\",\\\"nLeftarrow\\\":\\\"⇍\\\",\\\"nleftrightarrow\\\":\\\"↮\\\",\\\"nLeftrightarrow\\\":\\\"⇎\\\",\\\"nleq\\\":\\\"≰\\\",\\\"nleqq\\\":\\\"≦̸\\\",\\\"nleqslant\\\":\\\"⩽̸\\\",\\\"nles\\\":\\\"⩽̸\\\",\\\"nless\\\":\\\"≮\\\",\\\"nLl\\\":\\\"⋘̸\\\",\\\"nlsim\\\":\\\"≴\\\",\\\"nLt\\\":\\\"≪⃒\\\",\\\"nlt\\\":\\\"≮\\\",\\\"nltri\\\":\\\"⋪\\\",\\\"nltrie\\\":\\\"⋬\\\",\\\"nLtv\\\":\\\"≪̸\\\",\\\"nmid\\\":\\\"∤\\\",\\\"NoBreak\\\":\\\"⁠\\\",\\\"NonBreakingSpace\\\":\\\" \\\",\\\"nopf\\\":\\\"𝕟\\\",\\\"Nopf\\\":\\\"ℕ\\\",\\\"Not\\\":\\\"⫬\\\",\\\"not\\\":\\\"¬\\\",\\\"NotCongruent\\\":\\\"≢\\\",\\\"NotCupCap\\\":\\\"≭\\\",\\\"NotDoubleVerticalBar\\\":\\\"∦\\\",\\\"NotElement\\\":\\\"∉\\\",\\\"NotEqual\\\":\\\"≠\\\",\\\"NotEqualTilde\\\":\\\"≂̸\\\",\\\"NotExists\\\":\\\"∄\\\",\\\"NotGreater\\\":\\\"≯\\\",\\\"NotGreaterEqual\\\":\\\"≱\\\",\\\"NotGreaterFullEqual\\\":\\\"≧̸\\\",\\\"NotGreaterGreater\\\":\\\"≫̸\\\",\\\"NotGreaterLess\\\":\\\"≹\\\",\\\"NotGreaterSlantEqual\\\":\\\"⩾̸\\\",\\\"NotGreaterTilde\\\":\\\"≵\\\",\\\"NotHumpDownHump\\\":\\\"≎̸\\\",\\\"NotHumpEqual\\\":\\\"≏̸\\\",\\\"notin\\\":\\\"∉\\\",\\\"notindot\\\":\\\"⋵̸\\\",\\\"notinE\\\":\\\"⋹̸\\\",\\\"notinva\\\":\\\"∉\\\",\\\"notinvb\\\":\\\"⋷\\\",\\\"notinvc\\\":\\\"⋶\\\",\\\"NotLeftTriangleBar\\\":\\\"⧏̸\\\",\\\"NotLeftTriangle\\\":\\\"⋪\\\",\\\"NotLeftTriangleEqual\\\":\\\"⋬\\\",\\\"NotLess\\\":\\\"≮\\\",\\\"NotLessEqual\\\":\\\"≰\\\",\\\"NotLessGreater\\\":\\\"≸\\\",\\\"NotLessLess\\\":\\\"≪̸\\\",\\\"NotLessSlantEqual\\\":\\\"⩽̸\\\",\\\"NotLessTilde\\\":\\\"≴\\\",\\\"NotNestedGreaterGreater\\\":\\\"⪢̸\\\",\\\"NotNestedLessLess\\\":\\\"⪡̸\\\",\\\"notni\\\":\\\"∌\\\",\\\"notniva\\\":\\\"∌\\\",\\\"notnivb\\\":\\\"⋾\\\",\\\"notnivc\\\":\\\"⋽\\\",\\\"NotPrecedes\\\":\\\"⊀\\\",\\\"NotPrecedesEqual\\\":\\\"⪯̸\\\",\\\"NotPrecedesSlantEqual\\\":\\\"⋠\\\",\\\"NotReverseElement\\\":\\\"∌\\\",\\\"NotRightTriangleBar\\\":\\\"⧐̸\\\",\\\"NotRightTriangle\\\":\\\"⋫\\\",\\\"NotRightTriangleEqual\\\":\\\"⋭\\\",\\\"NotSquareSubset\\\":\\\"⊏̸\\\",\\\"NotSquareSubsetEqual\\\":\\\"⋢\\\",\\\"NotSquareSuperset\\\":\\\"⊐̸\\\",\\\"NotSquareSupersetEqual\\\":\\\"⋣\\\",\\\"NotSubset\\\":\\\"⊂⃒\\\",\\\"NotSubsetEqual\\\":\\\"⊈\\\",\\\"NotSucceeds\\\":\\\"⊁\\\",\\\"NotSucceedsEqual\\\":\\\"⪰̸\\\",\\\"NotSucceedsSlantEqual\\\":\\\"⋡\\\",\\\"NotSucceedsTilde\\\":\\\"≿̸\\\",\\\"NotSuperset\\\":\\\"⊃⃒\\\",\\\"NotSupersetEqual\\\":\\\"⊉\\\",\\\"NotTilde\\\":\\\"≁\\\",\\\"NotTildeEqual\\\":\\\"≄\\\",\\\"NotTildeFullEqual\\\":\\\"≇\\\",\\\"NotTildeTilde\\\":\\\"≉\\\",\\\"NotVerticalBar\\\":\\\"∤\\\",\\\"nparallel\\\":\\\"∦\\\",\\\"npar\\\":\\\"∦\\\",\\\"nparsl\\\":\\\"⫽⃥\\\",\\\"npart\\\":\\\"∂̸\\\",\\\"npolint\\\":\\\"⨔\\\",\\\"npr\\\":\\\"⊀\\\",\\\"nprcue\\\":\\\"⋠\\\",\\\"nprec\\\":\\\"⊀\\\",\\\"npreceq\\\":\\\"⪯̸\\\",\\\"npre\\\":\\\"⪯̸\\\",\\\"nrarrc\\\":\\\"⤳̸\\\",\\\"nrarr\\\":\\\"↛\\\",\\\"nrArr\\\":\\\"⇏\\\",\\\"nrarrw\\\":\\\"↝̸\\\",\\\"nrightarrow\\\":\\\"↛\\\",\\\"nRightarrow\\\":\\\"⇏\\\",\\\"nrtri\\\":\\\"⋫\\\",\\\"nrtrie\\\":\\\"⋭\\\",\\\"nsc\\\":\\\"⊁\\\",\\\"nsccue\\\":\\\"⋡\\\",\\\"nsce\\\":\\\"⪰̸\\\",\\\"Nscr\\\":\\\"𝒩\\\",\\\"nscr\\\":\\\"𝓃\\\",\\\"nshortmid\\\":\\\"∤\\\",\\\"nshortparallel\\\":\\\"∦\\\",\\\"nsim\\\":\\\"≁\\\",\\\"nsime\\\":\\\"≄\\\",\\\"nsimeq\\\":\\\"≄\\\",\\\"nsmid\\\":\\\"∤\\\",\\\"nspar\\\":\\\"∦\\\",\\\"nsqsube\\\":\\\"⋢\\\",\\\"nsqsupe\\\":\\\"⋣\\\",\\\"nsub\\\":\\\"⊄\\\",\\\"nsubE\\\":\\\"⫅̸\\\",\\\"nsube\\\":\\\"⊈\\\",\\\"nsubset\\\":\\\"⊂⃒\\\",\\\"nsubseteq\\\":\\\"⊈\\\",\\\"nsubseteqq\\\":\\\"⫅̸\\\",\\\"nsucc\\\":\\\"⊁\\\",\\\"nsucceq\\\":\\\"⪰̸\\\",\\\"nsup\\\":\\\"⊅\\\",\\\"nsupE\\\":\\\"⫆̸\\\",\\\"nsupe\\\":\\\"⊉\\\",\\\"nsupset\\\":\\\"⊃⃒\\\",\\\"nsupseteq\\\":\\\"⊉\\\",\\\"nsupseteqq\\\":\\\"⫆̸\\\",\\\"ntgl\\\":\\\"≹\\\",\\\"Ntilde\\\":\\\"Ñ\\\",\\\"ntilde\\\":\\\"ñ\\\",\\\"ntlg\\\":\\\"≸\\\",\\\"ntriangleleft\\\":\\\"⋪\\\",\\\"ntrianglelefteq\\\":\\\"⋬\\\",\\\"ntriangleright\\\":\\\"⋫\\\",\\\"ntrianglerighteq\\\":\\\"⋭\\\",\\\"Nu\\\":\\\"Ν\\\",\\\"nu\\\":\\\"ν\\\",\\\"num\\\":\\\"#\\\",\\\"numero\\\":\\\"№\\\",\\\"numsp\\\":\\\" \\\",\\\"nvap\\\":\\\"≍⃒\\\",\\\"nvdash\\\":\\\"⊬\\\",\\\"nvDash\\\":\\\"⊭\\\",\\\"nVdash\\\":\\\"⊮\\\",\\\"nVDash\\\":\\\"⊯\\\",\\\"nvge\\\":\\\"≥⃒\\\",\\\"nvgt\\\":\\\">⃒\\\",\\\"nvHarr\\\":\\\"⤄\\\",\\\"nvinfin\\\":\\\"⧞\\\",\\\"nvlArr\\\":\\\"⤂\\\",\\\"nvle\\\":\\\"≤⃒\\\",\\\"nvlt\\\":\\\"<⃒\\\",\\\"nvltrie\\\":\\\"⊴⃒\\\",\\\"nvrArr\\\":\\\"⤃\\\",\\\"nvrtrie\\\":\\\"⊵⃒\\\",\\\"nvsim\\\":\\\"∼⃒\\\",\\\"nwarhk\\\":\\\"⤣\\\",\\\"nwarr\\\":\\\"↖\\\",\\\"nwArr\\\":\\\"⇖\\\",\\\"nwarrow\\\":\\\"↖\\\",\\\"nwnear\\\":\\\"⤧\\\",\\\"Oacute\\\":\\\"Ó\\\",\\\"oacute\\\":\\\"ó\\\",\\\"oast\\\":\\\"⊛\\\",\\\"Ocirc\\\":\\\"Ô\\\",\\\"ocirc\\\":\\\"ô\\\",\\\"ocir\\\":\\\"⊚\\\",\\\"Ocy\\\":\\\"О\\\",\\\"ocy\\\":\\\"о\\\",\\\"odash\\\":\\\"⊝\\\",\\\"Odblac\\\":\\\"Ő\\\",\\\"odblac\\\":\\\"ő\\\",\\\"odiv\\\":\\\"⨸\\\",\\\"odot\\\":\\\"⊙\\\",\\\"odsold\\\":\\\"⦼\\\",\\\"OElig\\\":\\\"Œ\\\",\\\"oelig\\\":\\\"œ\\\",\\\"ofcir\\\":\\\"⦿\\\",\\\"Ofr\\\":\\\"𝔒\\\",\\\"ofr\\\":\\\"𝔬\\\",\\\"ogon\\\":\\\"˛\\\",\\\"Ograve\\\":\\\"Ò\\\",\\\"ograve\\\":\\\"ò\\\",\\\"ogt\\\":\\\"⧁\\\",\\\"ohbar\\\":\\\"⦵\\\",\\\"ohm\\\":\\\"Ω\\\",\\\"oint\\\":\\\"∮\\\",\\\"olarr\\\":\\\"↺\\\",\\\"olcir\\\":\\\"⦾\\\",\\\"olcross\\\":\\\"⦻\\\",\\\"oline\\\":\\\"‾\\\",\\\"olt\\\":\\\"⧀\\\",\\\"Omacr\\\":\\\"Ō\\\",\\\"omacr\\\":\\\"ō\\\",\\\"Omega\\\":\\\"Ω\\\",\\\"omega\\\":\\\"ω\\\",\\\"Omicron\\\":\\\"Ο\\\",\\\"omicron\\\":\\\"ο\\\",\\\"omid\\\":\\\"⦶\\\",\\\"ominus\\\":\\\"⊖\\\",\\\"Oopf\\\":\\\"𝕆\\\",\\\"oopf\\\":\\\"𝕠\\\",\\\"opar\\\":\\\"⦷\\\",\\\"OpenCurlyDoubleQuote\\\":\\\"“\\\",\\\"OpenCurlyQuote\\\":\\\"‘\\\",\\\"operp\\\":\\\"⦹\\\",\\\"oplus\\\":\\\"⊕\\\",\\\"orarr\\\":\\\"↻\\\",\\\"Or\\\":\\\"⩔\\\",\\\"or\\\":\\\"∨\\\",\\\"ord\\\":\\\"⩝\\\",\\\"order\\\":\\\"ℴ\\\",\\\"orderof\\\":\\\"ℴ\\\",\\\"ordf\\\":\\\"ª\\\",\\\"ordm\\\":\\\"º\\\",\\\"origof\\\":\\\"⊶\\\",\\\"oror\\\":\\\"⩖\\\",\\\"orslope\\\":\\\"⩗\\\",\\\"orv\\\":\\\"⩛\\\",\\\"oS\\\":\\\"Ⓢ\\\",\\\"Oscr\\\":\\\"𝒪\\\",\\\"oscr\\\":\\\"ℴ\\\",\\\"Oslash\\\":\\\"Ø\\\",\\\"oslash\\\":\\\"ø\\\",\\\"osol\\\":\\\"⊘\\\",\\\"Otilde\\\":\\\"Õ\\\",\\\"otilde\\\":\\\"õ\\\",\\\"otimesas\\\":\\\"⨶\\\",\\\"Otimes\\\":\\\"⨷\\\",\\\"otimes\\\":\\\"⊗\\\",\\\"Ouml\\\":\\\"Ö\\\",\\\"ouml\\\":\\\"ö\\\",\\\"ovbar\\\":\\\"⌽\\\",\\\"OverBar\\\":\\\"‾\\\",\\\"OverBrace\\\":\\\"⏞\\\",\\\"OverBracket\\\":\\\"⎴\\\",\\\"OverParenthesis\\\":\\\"⏜\\\",\\\"para\\\":\\\"¶\\\",\\\"parallel\\\":\\\"∥\\\",\\\"par\\\":\\\"∥\\\",\\\"parsim\\\":\\\"⫳\\\",\\\"parsl\\\":\\\"⫽\\\",\\\"part\\\":\\\"∂\\\",\\\"PartialD\\\":\\\"∂\\\",\\\"Pcy\\\":\\\"П\\\",\\\"pcy\\\":\\\"п\\\",\\\"percnt\\\":\\\"%\\\",\\\"period\\\":\\\".\\\",\\\"permil\\\":\\\"‰\\\",\\\"perp\\\":\\\"⊥\\\",\\\"pertenk\\\":\\\"‱\\\",\\\"Pfr\\\":\\\"𝔓\\\",\\\"pfr\\\":\\\"𝔭\\\",\\\"Phi\\\":\\\"Φ\\\",\\\"phi\\\":\\\"φ\\\",\\\"phiv\\\":\\\"ϕ\\\",\\\"phmmat\\\":\\\"ℳ\\\",\\\"phone\\\":\\\"☎\\\",\\\"Pi\\\":\\\"Π\\\",\\\"pi\\\":\\\"π\\\",\\\"pitchfork\\\":\\\"⋔\\\",\\\"piv\\\":\\\"ϖ\\\",\\\"planck\\\":\\\"ℏ\\\",\\\"planckh\\\":\\\"ℎ\\\",\\\"plankv\\\":\\\"ℏ\\\",\\\"plusacir\\\":\\\"⨣\\\",\\\"plusb\\\":\\\"⊞\\\",\\\"pluscir\\\":\\\"⨢\\\",\\\"plus\\\":\\\"+\\\",\\\"plusdo\\\":\\\"∔\\\",\\\"plusdu\\\":\\\"⨥\\\",\\\"pluse\\\":\\\"⩲\\\",\\\"PlusMinus\\\":\\\"±\\\",\\\"plusmn\\\":\\\"±\\\",\\\"plussim\\\":\\\"⨦\\\",\\\"plustwo\\\":\\\"⨧\\\",\\\"pm\\\":\\\"±\\\",\\\"Poincareplane\\\":\\\"ℌ\\\",\\\"pointint\\\":\\\"⨕\\\",\\\"popf\\\":\\\"𝕡\\\",\\\"Popf\\\":\\\"ℙ\\\",\\\"pound\\\":\\\"£\\\",\\\"prap\\\":\\\"⪷\\\",\\\"Pr\\\":\\\"⪻\\\",\\\"pr\\\":\\\"≺\\\",\\\"prcue\\\":\\\"≼\\\",\\\"precapprox\\\":\\\"⪷\\\",\\\"prec\\\":\\\"≺\\\",\\\"preccurlyeq\\\":\\\"≼\\\",\\\"Precedes\\\":\\\"≺\\\",\\\"PrecedesEqual\\\":\\\"⪯\\\",\\\"PrecedesSlantEqual\\\":\\\"≼\\\",\\\"PrecedesTilde\\\":\\\"≾\\\",\\\"preceq\\\":\\\"⪯\\\",\\\"precnapprox\\\":\\\"⪹\\\",\\\"precneqq\\\":\\\"⪵\\\",\\\"precnsim\\\":\\\"⋨\\\",\\\"pre\\\":\\\"⪯\\\",\\\"prE\\\":\\\"⪳\\\",\\\"precsim\\\":\\\"≾\\\",\\\"prime\\\":\\\"′\\\",\\\"Prime\\\":\\\"″\\\",\\\"primes\\\":\\\"ℙ\\\",\\\"prnap\\\":\\\"⪹\\\",\\\"prnE\\\":\\\"⪵\\\",\\\"prnsim\\\":\\\"⋨\\\",\\\"prod\\\":\\\"∏\\\",\\\"Product\\\":\\\"∏\\\",\\\"profalar\\\":\\\"⌮\\\",\\\"profline\\\":\\\"⌒\\\",\\\"profsurf\\\":\\\"⌓\\\",\\\"prop\\\":\\\"∝\\\",\\\"Proportional\\\":\\\"∝\\\",\\\"Proportion\\\":\\\"∷\\\",\\\"propto\\\":\\\"∝\\\",\\\"prsim\\\":\\\"≾\\\",\\\"prurel\\\":\\\"⊰\\\",\\\"Pscr\\\":\\\"𝒫\\\",\\\"pscr\\\":\\\"𝓅\\\",\\\"Psi\\\":\\\"Ψ\\\",\\\"psi\\\":\\\"ψ\\\",\\\"puncsp\\\":\\\" \\\",\\\"Qfr\\\":\\\"𝔔\\\",\\\"qfr\\\":\\\"𝔮\\\",\\\"qint\\\":\\\"⨌\\\",\\\"qopf\\\":\\\"𝕢\\\",\\\"Qopf\\\":\\\"ℚ\\\",\\\"qprime\\\":\\\"⁗\\\",\\\"Qscr\\\":\\\"𝒬\\\",\\\"qscr\\\":\\\"𝓆\\\",\\\"quaternions\\\":\\\"ℍ\\\",\\\"quatint\\\":\\\"⨖\\\",\\\"quest\\\":\\\"?\\\",\\\"questeq\\\":\\\"≟\\\",\\\"quot\\\":\\\"\\\\\\\"\\\",\\\"QUOT\\\":\\\"\\\\\\\"\\\",\\\"rAarr\\\":\\\"⇛\\\",\\\"race\\\":\\\"∽̱\\\",\\\"Racute\\\":\\\"Ŕ\\\",\\\"racute\\\":\\\"ŕ\\\",\\\"radic\\\":\\\"√\\\",\\\"raemptyv\\\":\\\"⦳\\\",\\\"rang\\\":\\\"⟩\\\",\\\"Rang\\\":\\\"⟫\\\",\\\"rangd\\\":\\\"⦒\\\",\\\"range\\\":\\\"⦥\\\",\\\"rangle\\\":\\\"⟩\\\",\\\"raquo\\\":\\\"»\\\",\\\"rarrap\\\":\\\"⥵\\\",\\\"rarrb\\\":\\\"⇥\\\",\\\"rarrbfs\\\":\\\"⤠\\\",\\\"rarrc\\\":\\\"⤳\\\",\\\"rarr\\\":\\\"→\\\",\\\"Rarr\\\":\\\"↠\\\",\\\"rArr\\\":\\\"⇒\\\",\\\"rarrfs\\\":\\\"⤞\\\",\\\"rarrhk\\\":\\\"↪\\\",\\\"rarrlp\\\":\\\"↬\\\",\\\"rarrpl\\\":\\\"⥅\\\",\\\"rarrsim\\\":\\\"⥴\\\",\\\"Rarrtl\\\":\\\"⤖\\\",\\\"rarrtl\\\":\\\"↣\\\",\\\"rarrw\\\":\\\"↝\\\",\\\"ratail\\\":\\\"⤚\\\",\\\"rAtail\\\":\\\"⤜\\\",\\\"ratio\\\":\\\"∶\\\",\\\"rationals\\\":\\\"ℚ\\\",\\\"rbarr\\\":\\\"⤍\\\",\\\"rBarr\\\":\\\"⤏\\\",\\\"RBarr\\\":\\\"⤐\\\",\\\"rbbrk\\\":\\\"❳\\\",\\\"rbrace\\\":\\\"}\\\",\\\"rbrack\\\":\\\"]\\\",\\\"rbrke\\\":\\\"⦌\\\",\\\"rbrksld\\\":\\\"⦎\\\",\\\"rbrkslu\\\":\\\"⦐\\\",\\\"Rcaron\\\":\\\"Ř\\\",\\\"rcaron\\\":\\\"ř\\\",\\\"Rcedil\\\":\\\"Ŗ\\\",\\\"rcedil\\\":\\\"ŗ\\\",\\\"rceil\\\":\\\"⌉\\\",\\\"rcub\\\":\\\"}\\\",\\\"Rcy\\\":\\\"Р\\\",\\\"rcy\\\":\\\"р\\\",\\\"rdca\\\":\\\"⤷\\\",\\\"rdldhar\\\":\\\"⥩\\\",\\\"rdquo\\\":\\\"”\\\",\\\"rdquor\\\":\\\"”\\\",\\\"rdsh\\\":\\\"↳\\\",\\\"real\\\":\\\"ℜ\\\",\\\"realine\\\":\\\"ℛ\\\",\\\"realpart\\\":\\\"ℜ\\\",\\\"reals\\\":\\\"ℝ\\\",\\\"Re\\\":\\\"ℜ\\\",\\\"rect\\\":\\\"▭\\\",\\\"reg\\\":\\\"®\\\",\\\"REG\\\":\\\"®\\\",\\\"ReverseElement\\\":\\\"∋\\\",\\\"ReverseEquilibrium\\\":\\\"⇋\\\",\\\"ReverseUpEquilibrium\\\":\\\"⥯\\\",\\\"rfisht\\\":\\\"⥽\\\",\\\"rfloor\\\":\\\"⌋\\\",\\\"rfr\\\":\\\"𝔯\\\",\\\"Rfr\\\":\\\"ℜ\\\",\\\"rHar\\\":\\\"⥤\\\",\\\"rhard\\\":\\\"⇁\\\",\\\"rharu\\\":\\\"⇀\\\",\\\"rharul\\\":\\\"⥬\\\",\\\"Rho\\\":\\\"Ρ\\\",\\\"rho\\\":\\\"ρ\\\",\\\"rhov\\\":\\\"ϱ\\\",\\\"RightAngleBracket\\\":\\\"⟩\\\",\\\"RightArrowBar\\\":\\\"⇥\\\",\\\"rightarrow\\\":\\\"→\\\",\\\"RightArrow\\\":\\\"→\\\",\\\"Rightarrow\\\":\\\"⇒\\\",\\\"RightArrowLeftArrow\\\":\\\"⇄\\\",\\\"rightarrowtail\\\":\\\"↣\\\",\\\"RightCeiling\\\":\\\"⌉\\\",\\\"RightDoubleBracket\\\":\\\"⟧\\\",\\\"RightDownTeeVector\\\":\\\"⥝\\\",\\\"RightDownVectorBar\\\":\\\"⥕\\\",\\\"RightDownVector\\\":\\\"⇂\\\",\\\"RightFloor\\\":\\\"⌋\\\",\\\"rightharpoondown\\\":\\\"⇁\\\",\\\"rightharpoonup\\\":\\\"⇀\\\",\\\"rightleftarrows\\\":\\\"⇄\\\",\\\"rightleftharpoons\\\":\\\"⇌\\\",\\\"rightrightarrows\\\":\\\"⇉\\\",\\\"rightsquigarrow\\\":\\\"↝\\\",\\\"RightTeeArrow\\\":\\\"↦\\\",\\\"RightTee\\\":\\\"⊢\\\",\\\"RightTeeVector\\\":\\\"⥛\\\",\\\"rightthreetimes\\\":\\\"⋌\\\",\\\"RightTriangleBar\\\":\\\"⧐\\\",\\\"RightTriangle\\\":\\\"⊳\\\",\\\"RightTriangleEqual\\\":\\\"⊵\\\",\\\"RightUpDownVector\\\":\\\"⥏\\\",\\\"RightUpTeeVector\\\":\\\"⥜\\\",\\\"RightUpVectorBar\\\":\\\"⥔\\\",\\\"RightUpVector\\\":\\\"↾\\\",\\\"RightVectorBar\\\":\\\"⥓\\\",\\\"RightVector\\\":\\\"⇀\\\",\\\"ring\\\":\\\"˚\\\",\\\"risingdotseq\\\":\\\"≓\\\",\\\"rlarr\\\":\\\"⇄\\\",\\\"rlhar\\\":\\\"⇌\\\",\\\"rlm\\\":\\\"‏\\\",\\\"rmoustache\\\":\\\"⎱\\\",\\\"rmoust\\\":\\\"⎱\\\",\\\"rnmid\\\":\\\"⫮\\\",\\\"roang\\\":\\\"⟭\\\",\\\"roarr\\\":\\\"⇾\\\",\\\"robrk\\\":\\\"⟧\\\",\\\"ropar\\\":\\\"⦆\\\",\\\"ropf\\\":\\\"𝕣\\\",\\\"Ropf\\\":\\\"ℝ\\\",\\\"roplus\\\":\\\"⨮\\\",\\\"rotimes\\\":\\\"⨵\\\",\\\"RoundImplies\\\":\\\"⥰\\\",\\\"rpar\\\":\\\")\\\",\\\"rpargt\\\":\\\"⦔\\\",\\\"rppolint\\\":\\\"⨒\\\",\\\"rrarr\\\":\\\"⇉\\\",\\\"Rrightarrow\\\":\\\"⇛\\\",\\\"rsaquo\\\":\\\"›\\\",\\\"rscr\\\":\\\"𝓇\\\",\\\"Rscr\\\":\\\"ℛ\\\",\\\"rsh\\\":\\\"↱\\\",\\\"Rsh\\\":\\\"↱\\\",\\\"rsqb\\\":\\\"]\\\",\\\"rsquo\\\":\\\"’\\\",\\\"rsquor\\\":\\\"’\\\",\\\"rthree\\\":\\\"⋌\\\",\\\"rtimes\\\":\\\"⋊\\\",\\\"rtri\\\":\\\"▹\\\",\\\"rtrie\\\":\\\"⊵\\\",\\\"rtrif\\\":\\\"▸\\\",\\\"rtriltri\\\":\\\"⧎\\\",\\\"RuleDelayed\\\":\\\"⧴\\\",\\\"ruluhar\\\":\\\"⥨\\\",\\\"rx\\\":\\\"℞\\\",\\\"Sacute\\\":\\\"Ś\\\",\\\"sacute\\\":\\\"ś\\\",\\\"sbquo\\\":\\\"‚\\\",\\\"scap\\\":\\\"⪸\\\",\\\"Scaron\\\":\\\"Š\\\",\\\"scaron\\\":\\\"š\\\",\\\"Sc\\\":\\\"⪼\\\",\\\"sc\\\":\\\"≻\\\",\\\"sccue\\\":\\\"≽\\\",\\\"sce\\\":\\\"⪰\\\",\\\"scE\\\":\\\"⪴\\\",\\\"Scedil\\\":\\\"Ş\\\",\\\"scedil\\\":\\\"ş\\\",\\\"Scirc\\\":\\\"Ŝ\\\",\\\"scirc\\\":\\\"ŝ\\\",\\\"scnap\\\":\\\"⪺\\\",\\\"scnE\\\":\\\"⪶\\\",\\\"scnsim\\\":\\\"⋩\\\",\\\"scpolint\\\":\\\"⨓\\\",\\\"scsim\\\":\\\"≿\\\",\\\"Scy\\\":\\\"С\\\",\\\"scy\\\":\\\"с\\\",\\\"sdotb\\\":\\\"⊡\\\",\\\"sdot\\\":\\\"⋅\\\",\\\"sdote\\\":\\\"⩦\\\",\\\"searhk\\\":\\\"⤥\\\",\\\"searr\\\":\\\"↘\\\",\\\"seArr\\\":\\\"⇘\\\",\\\"searrow\\\":\\\"↘\\\",\\\"sect\\\":\\\"§\\\",\\\"semi\\\":\\\";\\\",\\\"seswar\\\":\\\"⤩\\\",\\\"setminus\\\":\\\"∖\\\",\\\"setmn\\\":\\\"∖\\\",\\\"sext\\\":\\\"✶\\\",\\\"Sfr\\\":\\\"𝔖\\\",\\\"sfr\\\":\\\"𝔰\\\",\\\"sfrown\\\":\\\"⌢\\\",\\\"sharp\\\":\\\"♯\\\",\\\"SHCHcy\\\":\\\"Щ\\\",\\\"shchcy\\\":\\\"щ\\\",\\\"SHcy\\\":\\\"Ш\\\",\\\"shcy\\\":\\\"ш\\\",\\\"ShortDownArrow\\\":\\\"↓\\\",\\\"ShortLeftArrow\\\":\\\"←\\\",\\\"shortmid\\\":\\\"∣\\\",\\\"shortparallel\\\":\\\"∥\\\",\\\"ShortRightArrow\\\":\\\"→\\\",\\\"ShortUpArrow\\\":\\\"↑\\\",\\\"shy\\\":\\\"­\\\",\\\"Sigma\\\":\\\"Σ\\\",\\\"sigma\\\":\\\"σ\\\",\\\"sigmaf\\\":\\\"ς\\\",\\\"sigmav\\\":\\\"ς\\\",\\\"sim\\\":\\\"∼\\\",\\\"simdot\\\":\\\"⩪\\\",\\\"sime\\\":\\\"≃\\\",\\\"simeq\\\":\\\"≃\\\",\\\"simg\\\":\\\"⪞\\\",\\\"simgE\\\":\\\"⪠\\\",\\\"siml\\\":\\\"⪝\\\",\\\"simlE\\\":\\\"⪟\\\",\\\"simne\\\":\\\"≆\\\",\\\"simplus\\\":\\\"⨤\\\",\\\"simrarr\\\":\\\"⥲\\\",\\\"slarr\\\":\\\"←\\\",\\\"SmallCircle\\\":\\\"∘\\\",\\\"smallsetminus\\\":\\\"∖\\\",\\\"smashp\\\":\\\"⨳\\\",\\\"smeparsl\\\":\\\"⧤\\\",\\\"smid\\\":\\\"∣\\\",\\\"smile\\\":\\\"⌣\\\",\\\"smt\\\":\\\"⪪\\\",\\\"smte\\\":\\\"⪬\\\",\\\"smtes\\\":\\\"⪬︀\\\",\\\"SOFTcy\\\":\\\"Ь\\\",\\\"softcy\\\":\\\"ь\\\",\\\"solbar\\\":\\\"⌿\\\",\\\"solb\\\":\\\"⧄\\\",\\\"sol\\\":\\\"/\\\",\\\"Sopf\\\":\\\"𝕊\\\",\\\"sopf\\\":\\\"𝕤\\\",\\\"spades\\\":\\\"♠\\\",\\\"spadesuit\\\":\\\"♠\\\",\\\"spar\\\":\\\"∥\\\",\\\"sqcap\\\":\\\"⊓\\\",\\\"sqcaps\\\":\\\"⊓︀\\\",\\\"sqcup\\\":\\\"⊔\\\",\\\"sqcups\\\":\\\"⊔︀\\\",\\\"Sqrt\\\":\\\"√\\\",\\\"sqsub\\\":\\\"⊏\\\",\\\"sqsube\\\":\\\"⊑\\\",\\\"sqsubset\\\":\\\"⊏\\\",\\\"sqsubseteq\\\":\\\"⊑\\\",\\\"sqsup\\\":\\\"⊐\\\",\\\"sqsupe\\\":\\\"⊒\\\",\\\"sqsupset\\\":\\\"⊐\\\",\\\"sqsupseteq\\\":\\\"⊒\\\",\\\"square\\\":\\\"□\\\",\\\"Square\\\":\\\"□\\\",\\\"SquareIntersection\\\":\\\"⊓\\\",\\\"SquareSubset\\\":\\\"⊏\\\",\\\"SquareSubsetEqual\\\":\\\"⊑\\\",\\\"SquareSuperset\\\":\\\"⊐\\\",\\\"SquareSupersetEqual\\\":\\\"⊒\\\",\\\"SquareUnion\\\":\\\"⊔\\\",\\\"squarf\\\":\\\"▪\\\",\\\"squ\\\":\\\"□\\\",\\\"squf\\\":\\\"▪\\\",\\\"srarr\\\":\\\"→\\\",\\\"Sscr\\\":\\\"𝒮\\\",\\\"sscr\\\":\\\"𝓈\\\",\\\"ssetmn\\\":\\\"∖\\\",\\\"ssmile\\\":\\\"⌣\\\",\\\"sstarf\\\":\\\"⋆\\\",\\\"Star\\\":\\\"⋆\\\",\\\"star\\\":\\\"☆\\\",\\\"starf\\\":\\\"★\\\",\\\"straightepsilon\\\":\\\"ϵ\\\",\\\"straightphi\\\":\\\"ϕ\\\",\\\"strns\\\":\\\"¯\\\",\\\"sub\\\":\\\"⊂\\\",\\\"Sub\\\":\\\"⋐\\\",\\\"subdot\\\":\\\"⪽\\\",\\\"subE\\\":\\\"⫅\\\",\\\"sube\\\":\\\"⊆\\\",\\\"subedot\\\":\\\"⫃\\\",\\\"submult\\\":\\\"⫁\\\",\\\"subnE\\\":\\\"⫋\\\",\\\"subne\\\":\\\"⊊\\\",\\\"subplus\\\":\\\"⪿\\\",\\\"subrarr\\\":\\\"⥹\\\",\\\"subset\\\":\\\"⊂\\\",\\\"Subset\\\":\\\"⋐\\\",\\\"subseteq\\\":\\\"⊆\\\",\\\"subseteqq\\\":\\\"⫅\\\",\\\"SubsetEqual\\\":\\\"⊆\\\",\\\"subsetneq\\\":\\\"⊊\\\",\\\"subsetneqq\\\":\\\"⫋\\\",\\\"subsim\\\":\\\"⫇\\\",\\\"subsub\\\":\\\"⫕\\\",\\\"subsup\\\":\\\"⫓\\\",\\\"succapprox\\\":\\\"⪸\\\",\\\"succ\\\":\\\"≻\\\",\\\"succcurlyeq\\\":\\\"≽\\\",\\\"Succeeds\\\":\\\"≻\\\",\\\"SucceedsEqual\\\":\\\"⪰\\\",\\\"SucceedsSlantEqual\\\":\\\"≽\\\",\\\"SucceedsTilde\\\":\\\"≿\\\",\\\"succeq\\\":\\\"⪰\\\",\\\"succnapprox\\\":\\\"⪺\\\",\\\"succneqq\\\":\\\"⪶\\\",\\\"succnsim\\\":\\\"⋩\\\",\\\"succsim\\\":\\\"≿\\\",\\\"SuchThat\\\":\\\"∋\\\",\\\"sum\\\":\\\"∑\\\",\\\"Sum\\\":\\\"∑\\\",\\\"sung\\\":\\\"♪\\\",\\\"sup1\\\":\\\"¹\\\",\\\"sup2\\\":\\\"²\\\",\\\"sup3\\\":\\\"³\\\",\\\"sup\\\":\\\"⊃\\\",\\\"Sup\\\":\\\"⋑\\\",\\\"supdot\\\":\\\"⪾\\\",\\\"supdsub\\\":\\\"⫘\\\",\\\"supE\\\":\\\"⫆\\\",\\\"supe\\\":\\\"⊇\\\",\\\"supedot\\\":\\\"⫄\\\",\\\"Superset\\\":\\\"⊃\\\",\\\"SupersetEqual\\\":\\\"⊇\\\",\\\"suphsol\\\":\\\"⟉\\\",\\\"suphsub\\\":\\\"⫗\\\",\\\"suplarr\\\":\\\"⥻\\\",\\\"supmult\\\":\\\"⫂\\\",\\\"supnE\\\":\\\"⫌\\\",\\\"supne\\\":\\\"⊋\\\",\\\"supplus\\\":\\\"⫀\\\",\\\"supset\\\":\\\"⊃\\\",\\\"Supset\\\":\\\"⋑\\\",\\\"supseteq\\\":\\\"⊇\\\",\\\"supseteqq\\\":\\\"⫆\\\",\\\"supsetneq\\\":\\\"⊋\\\",\\\"supsetneqq\\\":\\\"⫌\\\",\\\"supsim\\\":\\\"⫈\\\",\\\"supsub\\\":\\\"⫔\\\",\\\"supsup\\\":\\\"⫖\\\",\\\"swarhk\\\":\\\"⤦\\\",\\\"swarr\\\":\\\"↙\\\",\\\"swArr\\\":\\\"⇙\\\",\\\"swarrow\\\":\\\"↙\\\",\\\"swnwar\\\":\\\"⤪\\\",\\\"szlig\\\":\\\"ß\\\",\\\"Tab\\\":\\\"\\\\t\\\",\\\"target\\\":\\\"⌖\\\",\\\"Tau\\\":\\\"Τ\\\",\\\"tau\\\":\\\"τ\\\",\\\"tbrk\\\":\\\"⎴\\\",\\\"Tcaron\\\":\\\"Ť\\\",\\\"tcaron\\\":\\\"ť\\\",\\\"Tcedil\\\":\\\"Ţ\\\",\\\"tcedil\\\":\\\"ţ\\\",\\\"Tcy\\\":\\\"Т\\\",\\\"tcy\\\":\\\"т\\\",\\\"tdot\\\":\\\"⃛\\\",\\\"telrec\\\":\\\"⌕\\\",\\\"Tfr\\\":\\\"𝔗\\\",\\\"tfr\\\":\\\"𝔱\\\",\\\"there4\\\":\\\"∴\\\",\\\"therefore\\\":\\\"∴\\\",\\\"Therefore\\\":\\\"∴\\\",\\\"Theta\\\":\\\"Θ\\\",\\\"theta\\\":\\\"θ\\\",\\\"thetasym\\\":\\\"ϑ\\\",\\\"thetav\\\":\\\"ϑ\\\",\\\"thickapprox\\\":\\\"≈\\\",\\\"thicksim\\\":\\\"∼\\\",\\\"ThickSpace\\\":\\\"  \\\",\\\"ThinSpace\\\":\\\" \\\",\\\"thinsp\\\":\\\" \\\",\\\"thkap\\\":\\\"≈\\\",\\\"thksim\\\":\\\"∼\\\",\\\"THORN\\\":\\\"Þ\\\",\\\"thorn\\\":\\\"þ\\\",\\\"tilde\\\":\\\"˜\\\",\\\"Tilde\\\":\\\"∼\\\",\\\"TildeEqual\\\":\\\"≃\\\",\\\"TildeFullEqual\\\":\\\"≅\\\",\\\"TildeTilde\\\":\\\"≈\\\",\\\"timesbar\\\":\\\"⨱\\\",\\\"timesb\\\":\\\"⊠\\\",\\\"times\\\":\\\"×\\\",\\\"timesd\\\":\\\"⨰\\\",\\\"tint\\\":\\\"∭\\\",\\\"toea\\\":\\\"⤨\\\",\\\"topbot\\\":\\\"⌶\\\",\\\"topcir\\\":\\\"⫱\\\",\\\"top\\\":\\\"⊤\\\",\\\"Topf\\\":\\\"𝕋\\\",\\\"topf\\\":\\\"𝕥\\\",\\\"topfork\\\":\\\"⫚\\\",\\\"tosa\\\":\\\"⤩\\\",\\\"tprime\\\":\\\"‴\\\",\\\"trade\\\":\\\"™\\\",\\\"TRADE\\\":\\\"™\\\",\\\"triangle\\\":\\\"▵\\\",\\\"triangledown\\\":\\\"▿\\\",\\\"triangleleft\\\":\\\"◃\\\",\\\"trianglelefteq\\\":\\\"⊴\\\",\\\"triangleq\\\":\\\"≜\\\",\\\"triangleright\\\":\\\"▹\\\",\\\"trianglerighteq\\\":\\\"⊵\\\",\\\"tridot\\\":\\\"◬\\\",\\\"trie\\\":\\\"≜\\\",\\\"triminus\\\":\\\"⨺\\\",\\\"TripleDot\\\":\\\"⃛\\\",\\\"triplus\\\":\\\"⨹\\\",\\\"trisb\\\":\\\"⧍\\\",\\\"tritime\\\":\\\"⨻\\\",\\\"trpezium\\\":\\\"⏢\\\",\\\"Tscr\\\":\\\"𝒯\\\",\\\"tscr\\\":\\\"𝓉\\\",\\\"TScy\\\":\\\"Ц\\\",\\\"tscy\\\":\\\"ц\\\",\\\"TSHcy\\\":\\\"Ћ\\\",\\\"tshcy\\\":\\\"ћ\\\",\\\"Tstrok\\\":\\\"Ŧ\\\",\\\"tstrok\\\":\\\"ŧ\\\",\\\"twixt\\\":\\\"≬\\\",\\\"twoheadleftarrow\\\":\\\"↞\\\",\\\"twoheadrightarrow\\\":\\\"↠\\\",\\\"Uacute\\\":\\\"Ú\\\",\\\"uacute\\\":\\\"ú\\\",\\\"uarr\\\":\\\"↑\\\",\\\"Uarr\\\":\\\"↟\\\",\\\"uArr\\\":\\\"⇑\\\",\\\"Uarrocir\\\":\\\"⥉\\\",\\\"Ubrcy\\\":\\\"Ў\\\",\\\"ubrcy\\\":\\\"ў\\\",\\\"Ubreve\\\":\\\"Ŭ\\\",\\\"ubreve\\\":\\\"ŭ\\\",\\\"Ucirc\\\":\\\"Û\\\",\\\"ucirc\\\":\\\"û\\\",\\\"Ucy\\\":\\\"У\\\",\\\"ucy\\\":\\\"у\\\",\\\"udarr\\\":\\\"⇅\\\",\\\"Udblac\\\":\\\"Ű\\\",\\\"udblac\\\":\\\"ű\\\",\\\"udhar\\\":\\\"⥮\\\",\\\"ufisht\\\":\\\"⥾\\\",\\\"Ufr\\\":\\\"𝔘\\\",\\\"ufr\\\":\\\"𝔲\\\",\\\"Ugrave\\\":\\\"Ù\\\",\\\"ugrave\\\":\\\"ù\\\",\\\"uHar\\\":\\\"⥣\\\",\\\"uharl\\\":\\\"↿\\\",\\\"uharr\\\":\\\"↾\\\",\\\"uhblk\\\":\\\"▀\\\",\\\"ulcorn\\\":\\\"⌜\\\",\\\"ulcorner\\\":\\\"⌜\\\",\\\"ulcrop\\\":\\\"⌏\\\",\\\"ultri\\\":\\\"◸\\\",\\\"Umacr\\\":\\\"Ū\\\",\\\"umacr\\\":\\\"ū\\\",\\\"uml\\\":\\\"¨\\\",\\\"UnderBar\\\":\\\"_\\\",\\\"UnderBrace\\\":\\\"⏟\\\",\\\"UnderBracket\\\":\\\"⎵\\\",\\\"UnderParenthesis\\\":\\\"⏝\\\",\\\"Union\\\":\\\"⋃\\\",\\\"UnionPlus\\\":\\\"⊎\\\",\\\"Uogon\\\":\\\"Ų\\\",\\\"uogon\\\":\\\"ų\\\",\\\"Uopf\\\":\\\"𝕌\\\",\\\"uopf\\\":\\\"𝕦\\\",\\\"UpArrowBar\\\":\\\"⤒\\\",\\\"uparrow\\\":\\\"↑\\\",\\\"UpArrow\\\":\\\"↑\\\",\\\"Uparrow\\\":\\\"⇑\\\",\\\"UpArrowDownArrow\\\":\\\"⇅\\\",\\\"updownarrow\\\":\\\"↕\\\",\\\"UpDownArrow\\\":\\\"↕\\\",\\\"Updownarrow\\\":\\\"⇕\\\",\\\"UpEquilibrium\\\":\\\"⥮\\\",\\\"upharpoonleft\\\":\\\"↿\\\",\\\"upharpoonright\\\":\\\"↾\\\",\\\"uplus\\\":\\\"⊎\\\",\\\"UpperLeftArrow\\\":\\\"↖\\\",\\\"UpperRightArrow\\\":\\\"↗\\\",\\\"upsi\\\":\\\"υ\\\",\\\"Upsi\\\":\\\"ϒ\\\",\\\"upsih\\\":\\\"ϒ\\\",\\\"Upsilon\\\":\\\"Υ\\\",\\\"upsilon\\\":\\\"υ\\\",\\\"UpTeeArrow\\\":\\\"↥\\\",\\\"UpTee\\\":\\\"⊥\\\",\\\"upuparrows\\\":\\\"⇈\\\",\\\"urcorn\\\":\\\"⌝\\\",\\\"urcorner\\\":\\\"⌝\\\",\\\"urcrop\\\":\\\"⌎\\\",\\\"Uring\\\":\\\"Ů\\\",\\\"uring\\\":\\\"ů\\\",\\\"urtri\\\":\\\"◹\\\",\\\"Uscr\\\":\\\"𝒰\\\",\\\"uscr\\\":\\\"𝓊\\\",\\\"utdot\\\":\\\"⋰\\\",\\\"Utilde\\\":\\\"Ũ\\\",\\\"utilde\\\":\\\"ũ\\\",\\\"utri\\\":\\\"▵\\\",\\\"utrif\\\":\\\"▴\\\",\\\"uuarr\\\":\\\"⇈\\\",\\\"Uuml\\\":\\\"Ü\\\",\\\"uuml\\\":\\\"ü\\\",\\\"uwangle\\\":\\\"⦧\\\",\\\"vangrt\\\":\\\"⦜\\\",\\\"varepsilon\\\":\\\"ϵ\\\",\\\"varkappa\\\":\\\"ϰ\\\",\\\"varnothing\\\":\\\"∅\\\",\\\"varphi\\\":\\\"ϕ\\\",\\\"varpi\\\":\\\"ϖ\\\",\\\"varpropto\\\":\\\"∝\\\",\\\"varr\\\":\\\"↕\\\",\\\"vArr\\\":\\\"⇕\\\",\\\"varrho\\\":\\\"ϱ\\\",\\\"varsigma\\\":\\\"ς\\\",\\\"varsubsetneq\\\":\\\"⊊︀\\\",\\\"varsubsetneqq\\\":\\\"⫋︀\\\",\\\"varsupsetneq\\\":\\\"⊋︀\\\",\\\"varsupsetneqq\\\":\\\"⫌︀\\\",\\\"vartheta\\\":\\\"ϑ\\\",\\\"vartriangleleft\\\":\\\"⊲\\\",\\\"vartriangleright\\\":\\\"⊳\\\",\\\"vBar\\\":\\\"⫨\\\",\\\"Vbar\\\":\\\"⫫\\\",\\\"vBarv\\\":\\\"⫩\\\",\\\"Vcy\\\":\\\"В\\\",\\\"vcy\\\":\\\"в\\\",\\\"vdash\\\":\\\"⊢\\\",\\\"vDash\\\":\\\"⊨\\\",\\\"Vdash\\\":\\\"⊩\\\",\\\"VDash\\\":\\\"⊫\\\",\\\"Vdashl\\\":\\\"⫦\\\",\\\"veebar\\\":\\\"⊻\\\",\\\"vee\\\":\\\"∨\\\",\\\"Vee\\\":\\\"⋁\\\",\\\"veeeq\\\":\\\"≚\\\",\\\"vellip\\\":\\\"⋮\\\",\\\"verbar\\\":\\\"|\\\",\\\"Verbar\\\":\\\"‖\\\",\\\"vert\\\":\\\"|\\\",\\\"Vert\\\":\\\"‖\\\",\\\"VerticalBar\\\":\\\"∣\\\",\\\"VerticalLine\\\":\\\"|\\\",\\\"VerticalSeparator\\\":\\\"❘\\\",\\\"VerticalTilde\\\":\\\"≀\\\",\\\"VeryThinSpace\\\":\\\" \\\",\\\"Vfr\\\":\\\"𝔙\\\",\\\"vfr\\\":\\\"𝔳\\\",\\\"vltri\\\":\\\"⊲\\\",\\\"vnsub\\\":\\\"⊂⃒\\\",\\\"vnsup\\\":\\\"⊃⃒\\\",\\\"Vopf\\\":\\\"𝕍\\\",\\\"vopf\\\":\\\"𝕧\\\",\\\"vprop\\\":\\\"∝\\\",\\\"vrtri\\\":\\\"⊳\\\",\\\"Vscr\\\":\\\"𝒱\\\",\\\"vscr\\\":\\\"𝓋\\\",\\\"vsubnE\\\":\\\"⫋︀\\\",\\\"vsubne\\\":\\\"⊊︀\\\",\\\"vsupnE\\\":\\\"⫌︀\\\",\\\"vsupne\\\":\\\"⊋︀\\\",\\\"Vvdash\\\":\\\"⊪\\\",\\\"vzigzag\\\":\\\"⦚\\\",\\\"Wcirc\\\":\\\"Ŵ\\\",\\\"wcirc\\\":\\\"ŵ\\\",\\\"wedbar\\\":\\\"⩟\\\",\\\"wedge\\\":\\\"∧\\\",\\\"Wedge\\\":\\\"⋀\\\",\\\"wedgeq\\\":\\\"≙\\\",\\\"weierp\\\":\\\"℘\\\",\\\"Wfr\\\":\\\"𝔚\\\",\\\"wfr\\\":\\\"𝔴\\\",\\\"Wopf\\\":\\\"𝕎\\\",\\\"wopf\\\":\\\"𝕨\\\",\\\"wp\\\":\\\"℘\\\",\\\"wr\\\":\\\"≀\\\",\\\"wreath\\\":\\\"≀\\\",\\\"Wscr\\\":\\\"𝒲\\\",\\\"wscr\\\":\\\"𝓌\\\",\\\"xcap\\\":\\\"⋂\\\",\\\"xcirc\\\":\\\"◯\\\",\\\"xcup\\\":\\\"⋃\\\",\\\"xdtri\\\":\\\"▽\\\",\\\"Xfr\\\":\\\"𝔛\\\",\\\"xfr\\\":\\\"𝔵\\\",\\\"xharr\\\":\\\"⟷\\\",\\\"xhArr\\\":\\\"⟺\\\",\\\"Xi\\\":\\\"Ξ\\\",\\\"xi\\\":\\\"ξ\\\",\\\"xlarr\\\":\\\"⟵\\\",\\\"xlArr\\\":\\\"⟸\\\",\\\"xmap\\\":\\\"⟼\\\",\\\"xnis\\\":\\\"⋻\\\",\\\"xodot\\\":\\\"⨀\\\",\\\"Xopf\\\":\\\"𝕏\\\",\\\"xopf\\\":\\\"𝕩\\\",\\\"xoplus\\\":\\\"⨁\\\",\\\"xotime\\\":\\\"⨂\\\",\\\"xrarr\\\":\\\"⟶\\\",\\\"xrArr\\\":\\\"⟹\\\",\\\"Xscr\\\":\\\"𝒳\\\",\\\"xscr\\\":\\\"𝓍\\\",\\\"xsqcup\\\":\\\"⨆\\\",\\\"xuplus\\\":\\\"⨄\\\",\\\"xutri\\\":\\\"△\\\",\\\"xvee\\\":\\\"⋁\\\",\\\"xwedge\\\":\\\"⋀\\\",\\\"Yacute\\\":\\\"Ý\\\",\\\"yacute\\\":\\\"ý\\\",\\\"YAcy\\\":\\\"Я\\\",\\\"yacy\\\":\\\"я\\\",\\\"Ycirc\\\":\\\"Ŷ\\\",\\\"ycirc\\\":\\\"ŷ\\\",\\\"Ycy\\\":\\\"Ы\\\",\\\"ycy\\\":\\\"ы\\\",\\\"yen\\\":\\\"¥\\\",\\\"Yfr\\\":\\\"𝔜\\\",\\\"yfr\\\":\\\"𝔶\\\",\\\"YIcy\\\":\\\"Ї\\\",\\\"yicy\\\":\\\"ї\\\",\\\"Yopf\\\":\\\"𝕐\\\",\\\"yopf\\\":\\\"𝕪\\\",\\\"Yscr\\\":\\\"𝒴\\\",\\\"yscr\\\":\\\"𝓎\\\",\\\"YUcy\\\":\\\"Ю\\\",\\\"yucy\\\":\\\"ю\\\",\\\"yuml\\\":\\\"ÿ\\\",\\\"Yuml\\\":\\\"Ÿ\\\",\\\"Zacute\\\":\\\"Ź\\\",\\\"zacute\\\":\\\"ź\\\",\\\"Zcaron\\\":\\\"Ž\\\",\\\"zcaron\\\":\\\"ž\\\",\\\"Zcy\\\":\\\"З\\\",\\\"zcy\\\":\\\"з\\\",\\\"Zdot\\\":\\\"Ż\\\",\\\"zdot\\\":\\\"ż\\\",\\\"zeetrf\\\":\\\"ℨ\\\",\\\"ZeroWidthSpace\\\":\\\"​\\\",\\\"Zeta\\\":\\\"Ζ\\\",\\\"zeta\\\":\\\"ζ\\\",\\\"zfr\\\":\\\"𝔷\\\",\\\"Zfr\\\":\\\"ℨ\\\",\\\"ZHcy\\\":\\\"Ж\\\",\\\"zhcy\\\":\\\"ж\\\",\\\"zigrarr\\\":\\\"⇝\\\",\\\"zopf\\\":\\\"𝕫\\\",\\\"Zopf\\\":\\\"ℤ\\\",\\\"Zscr\\\":\\\"𝒵\\\",\\\"zscr\\\":\\\"𝓏\\\",\\\"zwj\\\":\\\"‍\\\",\\\"zwnj\\\":\\\"‌\\\"}\");\n\n//# sourceURL=webpack:///./node_modules/entities/lib/maps/entities.json?"); + +/***/ }), + +/***/ "./node_modules/linkify-it/index.js": +/*!******************************************!*\ + !*** ./node_modules/linkify-it/index.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n\n////////////////////////////////////////////////////////////////////////////////\n// Helpers\n\n// Merge objects\n//\nfunction assign(obj /*from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n\n sources.forEach(function (source) {\n if (!source) { return; }\n\n Object.keys(source).forEach(function (key) {\n obj[key] = source[key];\n });\n });\n\n return obj;\n}\n\nfunction _class(obj) { return Object.prototype.toString.call(obj); }\nfunction isString(obj) { return _class(obj) === '[object String]'; }\nfunction isObject(obj) { return _class(obj) === '[object Object]'; }\nfunction isRegExp(obj) { return _class(obj) === '[object RegExp]'; }\nfunction isFunction(obj) { return _class(obj) === '[object Function]'; }\n\n\nfunction escapeRE(str) { return str.replace(/[.?*+^$[\\]\\\\(){}|-]/g, '\\\\$&'); }\n\n////////////////////////////////////////////////////////////////////////////////\n\n\nvar defaultOptions = {\n fuzzyLink: true,\n fuzzyEmail: true,\n fuzzyIP: false\n};\n\n\nfunction isOptionsObj(obj) {\n return Object.keys(obj || {}).reduce(function (acc, k) {\n return acc || defaultOptions.hasOwnProperty(k);\n }, false);\n}\n\n\nvar defaultSchemas = {\n 'http:': {\n validate: function (text, pos, self) {\n var tail = text.slice(pos);\n\n if (!self.re.http) {\n // compile lazily, because \"host\"-containing variables can change on tlds update.\n self.re.http = new RegExp(\n '^\\\\/\\\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'\n );\n }\n if (self.re.http.test(tail)) {\n return tail.match(self.re.http)[0].length;\n }\n return 0;\n }\n },\n 'https:': 'http:',\n 'ftp:': 'http:',\n '//': {\n validate: function (text, pos, self) {\n var tail = text.slice(pos);\n\n if (!self.re.no_http) {\n // compile lazily, because \"host\"-containing variables can change on tlds update.\n self.re.no_http = new RegExp(\n '^' +\n self.re.src_auth +\n // Don't allow single-level domains, because of false positives like '//test'\n // with code comments\n '(?:localhost|(?:(?:' + self.re.src_domain + ')\\\\.)+' + self.re.src_domain_root + ')' +\n self.re.src_port +\n self.re.src_host_terminator +\n self.re.src_path,\n\n 'i'\n );\n }\n\n if (self.re.no_http.test(tail)) {\n // should not be `://` & `///`, that protects from errors in protocol name\n if (pos >= 3 && text[pos - 3] === ':') { return 0; }\n if (pos >= 3 && text[pos - 3] === '/') { return 0; }\n return tail.match(self.re.no_http)[0].length;\n }\n return 0;\n }\n },\n 'mailto:': {\n validate: function (text, pos, self) {\n var tail = text.slice(pos);\n\n if (!self.re.mailto) {\n self.re.mailto = new RegExp(\n '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'\n );\n }\n if (self.re.mailto.test(tail)) {\n return tail.match(self.re.mailto)[0].length;\n }\n return 0;\n }\n }\n};\n\n/*eslint-disable max-len*/\n\n// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)\nvar tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';\n\n// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead\nvar tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');\n\n/*eslint-enable max-len*/\n\n////////////////////////////////////////////////////////////////////////////////\n\nfunction resetScanCache(self) {\n self.__index__ = -1;\n self.__text_cache__ = '';\n}\n\nfunction createValidator(re) {\n return function (text, pos) {\n var tail = text.slice(pos);\n\n if (re.test(tail)) {\n return tail.match(re)[0].length;\n }\n return 0;\n };\n}\n\nfunction createNormalizer() {\n return function (match, self) {\n self.normalize(match);\n };\n}\n\n// Schemas compiler. Build regexps.\n//\nfunction compile(self) {\n\n // Load & clone RE patterns.\n var re = self.re = __webpack_require__(/*! ./lib/re */ \"./node_modules/linkify-it/lib/re.js\")(self.__opts__);\n\n // Define dynamic patterns\n var tlds = self.__tlds__.slice();\n\n self.onCompile();\n\n if (!self.__tlds_replaced__) {\n tlds.push(tlds_2ch_src_re);\n }\n tlds.push(re.src_xn);\n\n re.src_tlds = tlds.join('|');\n\n function untpl(tpl) { return tpl.replace('%TLDS%', re.src_tlds); }\n\n re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i');\n re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i');\n re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i');\n re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i');\n\n //\n // Compile each schema\n //\n\n var aliases = [];\n\n self.__compiled__ = {}; // Reset compiled data\n\n function schemaError(name, val) {\n throw new Error('(LinkifyIt) Invalid schema \"' + name + '\": ' + val);\n }\n\n Object.keys(self.__schemas__).forEach(function (name) {\n var val = self.__schemas__[name];\n\n // skip disabled methods\n if (val === null) { return; }\n\n var compiled = { validate: null, link: null };\n\n self.__compiled__[name] = compiled;\n\n if (isObject(val)) {\n if (isRegExp(val.validate)) {\n compiled.validate = createValidator(val.validate);\n } else if (isFunction(val.validate)) {\n compiled.validate = val.validate;\n } else {\n schemaError(name, val);\n }\n\n if (isFunction(val.normalize)) {\n compiled.normalize = val.normalize;\n } else if (!val.normalize) {\n compiled.normalize = createNormalizer();\n } else {\n schemaError(name, val);\n }\n\n return;\n }\n\n if (isString(val)) {\n aliases.push(name);\n return;\n }\n\n schemaError(name, val);\n });\n\n //\n // Compile postponed aliases\n //\n\n aliases.forEach(function (alias) {\n if (!self.__compiled__[self.__schemas__[alias]]) {\n // Silently fail on missed schemas to avoid errons on disable.\n // schemaError(alias, self.__schemas__[alias]);\n return;\n }\n\n self.__compiled__[alias].validate =\n self.__compiled__[self.__schemas__[alias]].validate;\n self.__compiled__[alias].normalize =\n self.__compiled__[self.__schemas__[alias]].normalize;\n });\n\n //\n // Fake record for guessed links\n //\n self.__compiled__[''] = { validate: null, normalize: createNormalizer() };\n\n //\n // Build schema condition\n //\n var slist = Object.keys(self.__compiled__)\n .filter(function (name) {\n // Filter disabled & fake schemas\n return name.length > 0 && self.__compiled__[name];\n })\n .map(escapeRE)\n .join('|');\n // (?!_) cause 1.5x slowdown\n self.re.schema_test = RegExp('(^|(?!_)(?:[><\\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i');\n self.re.schema_search = RegExp('(^|(?!_)(?:[><\\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig');\n\n self.re.pretest = RegExp(\n '(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@',\n 'i'\n );\n\n //\n // Cleanup\n //\n\n resetScanCache(self);\n}\n\n/**\n * class Match\n *\n * Match result. Single element of array, returned by [[LinkifyIt#match]]\n **/\nfunction Match(self, shift) {\n var start = self.__index__,\n end = self.__last_index__,\n text = self.__text_cache__.slice(start, end);\n\n /**\n * Match#schema -> String\n *\n * Prefix (protocol) for matched string.\n **/\n this.schema = self.__schema__.toLowerCase();\n /**\n * Match#index -> Number\n *\n * First position of matched string.\n **/\n this.index = start + shift;\n /**\n * Match#lastIndex -> Number\n *\n * Next position after matched string.\n **/\n this.lastIndex = end + shift;\n /**\n * Match#raw -> String\n *\n * Matched string.\n **/\n this.raw = text;\n /**\n * Match#text -> String\n *\n * Notmalized text of matched string.\n **/\n this.text = text;\n /**\n * Match#url -> String\n *\n * Normalized url of matched string.\n **/\n this.url = text;\n}\n\nfunction createMatch(self, shift) {\n var match = new Match(self, shift);\n\n self.__compiled__[match.schema].normalize(match, self);\n\n return match;\n}\n\n\n/**\n * class LinkifyIt\n **/\n\n/**\n * new LinkifyIt(schemas, options)\n * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)\n * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }\n *\n * Creates new linkifier instance with optional additional schemas.\n * Can be called without `new` keyword for convenience.\n *\n * By default understands:\n *\n * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links\n * - \"fuzzy\" links and emails (example.com, foo@bar.com).\n *\n * `schemas` is an object, where each key/value describes protocol/rule:\n *\n * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`\n * for example). `linkify-it` makes shure that prefix is not preceeded with\n * alphanumeric char and symbols. Only whitespaces and punctuation allowed.\n * - __value__ - rule to check tail after link prefix\n * - _String_ - just alias to existing rule\n * - _Object_\n * - _validate_ - validator function (should return matched length on success),\n * or `RegExp`.\n * - _normalize_ - optional function to normalize text & url of matched result\n * (for example, for @twitter mentions).\n *\n * `options`:\n *\n * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.\n * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts\n * like version numbers. Default `false`.\n * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.\n *\n **/\nfunction LinkifyIt(schemas, options) {\n if (!(this instanceof LinkifyIt)) {\n return new LinkifyIt(schemas, options);\n }\n\n if (!options) {\n if (isOptionsObj(schemas)) {\n options = schemas;\n schemas = {};\n }\n }\n\n this.__opts__ = assign({}, defaultOptions, options);\n\n // Cache last tested result. Used to skip repeating steps on next `match` call.\n this.__index__ = -1;\n this.__last_index__ = -1; // Next scan position\n this.__schema__ = '';\n this.__text_cache__ = '';\n\n this.__schemas__ = assign({}, defaultSchemas, schemas);\n this.__compiled__ = {};\n\n this.__tlds__ = tlds_default;\n this.__tlds_replaced__ = false;\n\n this.re = {};\n\n compile(this);\n}\n\n\n/** chainable\n * LinkifyIt#add(schema, definition)\n * - schema (String): rule name (fixed pattern prefix)\n * - definition (String|RegExp|Object): schema definition\n *\n * Add new rule definition. See constructor description for details.\n **/\nLinkifyIt.prototype.add = function add(schema, definition) {\n this.__schemas__[schema] = definition;\n compile(this);\n return this;\n};\n\n\n/** chainable\n * LinkifyIt#set(options)\n * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }\n *\n * Set recognition options for links without schema.\n **/\nLinkifyIt.prototype.set = function set(options) {\n this.__opts__ = assign(this.__opts__, options);\n return this;\n};\n\n\n/**\n * LinkifyIt#test(text) -> Boolean\n *\n * Searches linkifiable pattern and returns `true` on success or `false` on fail.\n **/\nLinkifyIt.prototype.test = function test(text) {\n // Reset scan cache\n this.__text_cache__ = text;\n this.__index__ = -1;\n\n if (!text.length) { return false; }\n\n var m, ml, me, len, shift, next, re, tld_pos, at_pos;\n\n // try to scan for link with schema - that's the most simple rule\n if (this.re.schema_test.test(text)) {\n re = this.re.schema_search;\n re.lastIndex = 0;\n while ((m = re.exec(text)) !== null) {\n len = this.testSchemaAt(text, m[2], re.lastIndex);\n if (len) {\n this.__schema__ = m[2];\n this.__index__ = m.index + m[1].length;\n this.__last_index__ = m.index + m[0].length + len;\n break;\n }\n }\n }\n\n if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {\n // guess schemaless links\n tld_pos = text.search(this.re.host_fuzzy_test);\n if (tld_pos >= 0) {\n // if tld is located after found link - no need to check fuzzy pattern\n if (this.__index__ < 0 || tld_pos < this.__index__) {\n if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {\n\n shift = ml.index + ml[1].length;\n\n if (this.__index__ < 0 || shift < this.__index__) {\n this.__schema__ = '';\n this.__index__ = shift;\n this.__last_index__ = ml.index + ml[0].length;\n }\n }\n }\n }\n }\n\n if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {\n // guess schemaless emails\n at_pos = text.indexOf('@');\n if (at_pos >= 0) {\n // We can't skip this check, because this cases are possible:\n // 192.168.1.1@gmail.com, my.in@example.com\n if ((me = text.match(this.re.email_fuzzy)) !== null) {\n\n shift = me.index + me[1].length;\n next = me.index + me[0].length;\n\n if (this.__index__ < 0 || shift < this.__index__ ||\n (shift === this.__index__ && next > this.__last_index__)) {\n this.__schema__ = 'mailto:';\n this.__index__ = shift;\n this.__last_index__ = next;\n }\n }\n }\n }\n\n return this.__index__ >= 0;\n};\n\n\n/**\n * LinkifyIt#pretest(text) -> Boolean\n *\n * Very quick check, that can give false positives. Returns true if link MAY BE\n * can exists. Can be used for speed optimization, when you need to check that\n * link NOT exists.\n **/\nLinkifyIt.prototype.pretest = function pretest(text) {\n return this.re.pretest.test(text);\n};\n\n\n/**\n * LinkifyIt#testSchemaAt(text, name, position) -> Number\n * - text (String): text to scan\n * - name (String): rule (schema) name\n * - position (Number): text offset to check from\n *\n * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly\n * at given position. Returns length of found pattern (0 on fail).\n **/\nLinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) {\n // If not supported schema check requested - terminate\n if (!this.__compiled__[schema.toLowerCase()]) {\n return 0;\n }\n return this.__compiled__[schema.toLowerCase()].validate(text, pos, this);\n};\n\n\n/**\n * LinkifyIt#match(text) -> Array|null\n *\n * Returns array of found link descriptions or `null` on fail. We strongly\n * recommend to use [[LinkifyIt#test]] first, for best speed.\n *\n * ##### Result match description\n *\n * - __schema__ - link schema, can be empty for fuzzy links, or `//` for\n * protocol-neutral links.\n * - __index__ - offset of matched text\n * - __lastIndex__ - index of next char after mathch end\n * - __raw__ - matched text\n * - __text__ - normalized text\n * - __url__ - link, generated from matched text\n **/\nLinkifyIt.prototype.match = function match(text) {\n var shift = 0, result = [];\n\n // Try to take previous element from cache, if .test() called before\n if (this.__index__ >= 0 && this.__text_cache__ === text) {\n result.push(createMatch(this, shift));\n shift = this.__last_index__;\n }\n\n // Cut head if cache was used\n var tail = shift ? text.slice(shift) : text;\n\n // Scan string until end reached\n while (this.test(tail)) {\n result.push(createMatch(this, shift));\n\n tail = tail.slice(this.__last_index__);\n shift += this.__last_index__;\n }\n\n if (result.length) {\n return result;\n }\n\n return null;\n};\n\n\n/** chainable\n * LinkifyIt#tlds(list [, keepOld]) -> this\n * - list (Array): list of tlds\n * - keepOld (Boolean): merge with current list if `true` (`false` by default)\n *\n * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)\n * to avoid false positives. By default this algorythm used:\n *\n * - hostname with any 2-letter root zones are ok.\n * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф\n * are ok.\n * - encoded (`xn--...`) root zones are ok.\n *\n * If list is replaced, then exact match for 2-chars root zones will be checked.\n **/\nLinkifyIt.prototype.tlds = function tlds(list, keepOld) {\n list = Array.isArray(list) ? list : [ list ];\n\n if (!keepOld) {\n this.__tlds__ = list.slice();\n this.__tlds_replaced__ = true;\n compile(this);\n return this;\n }\n\n this.__tlds__ = this.__tlds__.concat(list)\n .sort()\n .filter(function (el, idx, arr) {\n return el !== arr[idx - 1];\n })\n .reverse();\n\n compile(this);\n return this;\n};\n\n/**\n * LinkifyIt#normalize(match)\n *\n * Default normalizer (if schema does not define it's own).\n **/\nLinkifyIt.prototype.normalize = function normalize(match) {\n\n // Do minimal possible changes by default. Need to collect feedback prior\n // to move forward https://github.com/markdown-it/linkify-it/issues/1\n\n if (!match.schema) { match.url = 'http://' + match.url; }\n\n if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {\n match.url = 'mailto:' + match.url;\n }\n};\n\n\n/**\n * LinkifyIt#onCompile()\n *\n * Override to modify basic RegExp-s.\n **/\nLinkifyIt.prototype.onCompile = function onCompile() {\n};\n\n\nmodule.exports = LinkifyIt;\n\n\n//# sourceURL=webpack:///./node_modules/linkify-it/index.js?"); + +/***/ }), + +/***/ "./node_modules/linkify-it/lib/re.js": +/*!*******************************************!*\ + !*** ./node_modules/linkify-it/lib/re.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n\nmodule.exports = function (opts) {\n var re = {};\n\n // Use direct extract instead of `regenerate` to reduse browserified size\n re.src_Any = __webpack_require__(/*! uc.micro/properties/Any/regex */ \"./node_modules/uc.micro/properties/Any/regex.js\").source;\n re.src_Cc = __webpack_require__(/*! uc.micro/categories/Cc/regex */ \"./node_modules/uc.micro/categories/Cc/regex.js\").source;\n re.src_Z = __webpack_require__(/*! uc.micro/categories/Z/regex */ \"./node_modules/uc.micro/categories/Z/regex.js\").source;\n re.src_P = __webpack_require__(/*! uc.micro/categories/P/regex */ \"./node_modules/uc.micro/categories/P/regex.js\").source;\n\n // \\p{\\Z\\P\\Cc\\CF} (white spaces + control + format + punctuation)\n re.src_ZPCc = [ re.src_Z, re.src_P, re.src_Cc ].join('|');\n\n // \\p{\\Z\\Cc} (white spaces + control)\n re.src_ZCc = [ re.src_Z, re.src_Cc ].join('|');\n\n // Experimental. List of chars, completely prohibited in links\n // because can separate it from other part of text\n var text_separators = '[><\\uff5c]';\n\n // All possible word characters (everything without punctuation, spaces & controls)\n // Defined via punctuation & spaces to save space\n // Should be something like \\p{\\L\\N\\S\\M} (\\w but without `_`)\n re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')';\n // The same as abothe but without [0-9]\n // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';\n\n ////////////////////////////////////////////////////////////////////////////////\n\n re.src_ip4 =\n\n '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';\n\n // Prohibit any of \"@/[]()\" in user/pass to avoid wrong domain fetch.\n re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\\\[\\\\]()]).)+@)?';\n\n re.src_port =\n\n '(?::(?:6(?:[0-4]\\\\d{3}|5(?:[0-4]\\\\d{2}|5(?:[0-2]\\\\d|3[0-5])))|[1-5]?\\\\d{1,4}))?';\n\n re.src_host_terminator =\n\n '(?=$|' + text_separators + '|' + re.src_ZPCc + ')(?!-|_|:\\\\d|\\\\.-|\\\\.(?!$|' + re.src_ZPCc + '))';\n\n re.src_path =\n\n '(?:' +\n '[/?#]' +\n '(?:' +\n '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\\\]{}.,\"\\'?!\\\\-]).|' +\n '\\\\[(?:(?!' + re.src_ZCc + '|\\\\]).)*\\\\]|' +\n '\\\\((?:(?!' + re.src_ZCc + '|[)]).)*\\\\)|' +\n '\\\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\\\}|' +\n '\\\\\"(?:(?!' + re.src_ZCc + '|[\"]).)+\\\\\"|' +\n \"\\\\'(?:(?!\" + re.src_ZCc + \"|[']).)+\\\\'|\" +\n \"\\\\'(?=\" + re.src_pseudo_letter + '|[-]).|' + // allow `I'm_king` if no pair found\n '\\\\.{2,4}[a-zA-Z0-9%/]|' + // github has ... in commit range links,\n // google has .... in links (issue #66)\n // Restrict to\n // - english\n // - percent-encoded\n // - parts of file path\n // until more examples found.\n '\\\\.(?!' + re.src_ZCc + '|[.]).|' +\n (opts && opts['---'] ?\n '\\\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate\n :\n '\\\\-+|'\n ) +\n '\\\\,(?!' + re.src_ZCc + ').|' + // allow `,,,` in paths\n '\\\\!(?!' + re.src_ZCc + '|[!]).|' +\n '\\\\?(?!' + re.src_ZCc + '|[?]).' +\n ')+' +\n '|\\\\/' +\n ')?';\n\n // Allow anything in markdown spec, forbid quote (\") at the first position\n // because emails enclosed in quotes are far more common\n re.src_email_name =\n\n '[\\\\-;:&=\\\\+\\\\$,\\\\.a-zA-Z0-9_][\\\\-;:&=\\\\+\\\\$,\\\\\"\\\\.a-zA-Z0-9_]*';\n\n re.src_xn =\n\n 'xn--[a-z0-9\\\\-]{1,59}';\n\n // More to read about domain names\n // http://serverfault.com/questions/638260/\n\n re.src_domain_root =\n\n // Allow letters & digits (http://test1)\n '(?:' +\n re.src_xn +\n '|' +\n re.src_pseudo_letter + '{1,63}' +\n ')';\n\n re.src_domain =\n\n '(?:' +\n re.src_xn +\n '|' +\n '(?:' + re.src_pseudo_letter + ')' +\n '|' +\n '(?:' + re.src_pseudo_letter + '(?:-|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' +\n ')';\n\n re.src_host =\n\n '(?:' +\n // Don't need IP check, because digits are already allowed in normal domain names\n // src_ip4 +\n // '|' +\n '(?:(?:(?:' + re.src_domain + ')\\\\.)*' + re.src_domain/*_root*/ + ')' +\n ')';\n\n re.tpl_host_fuzzy =\n\n '(?:' +\n re.src_ip4 +\n '|' +\n '(?:(?:(?:' + re.src_domain + ')\\\\.)+(?:%TLDS%))' +\n ')';\n\n re.tpl_host_no_ip_fuzzy =\n\n '(?:(?:(?:' + re.src_domain + ')\\\\.)+(?:%TLDS%))';\n\n re.src_host_strict =\n\n re.src_host + re.src_host_terminator;\n\n re.tpl_host_fuzzy_strict =\n\n re.tpl_host_fuzzy + re.src_host_terminator;\n\n re.src_host_port_strict =\n\n re.src_host + re.src_port + re.src_host_terminator;\n\n re.tpl_host_port_fuzzy_strict =\n\n re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;\n\n re.tpl_host_port_no_ip_fuzzy_strict =\n\n re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;\n\n\n ////////////////////////////////////////////////////////////////////////////////\n // Main rules\n\n // Rude test fuzzy links by host, for quick deny\n re.tpl_host_fuzzy_test =\n\n 'localhost|www\\\\.|\\\\.\\\\d{1,3}\\\\.|(?:\\\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))';\n\n re.tpl_email_fuzzy =\n\n '(^|' + text_separators + '|\"|\\\\(|' + re.src_ZCc + ')' +\n '(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')';\n\n re.tpl_link_fuzzy =\n // Fuzzy link can't be prepended with .:/\\- and non punctuation.\n // but can start with > (markdown blockquote)\n '(^|(?![.:/\\\\-_@])(?:[$+<=>^`|\\uff5c]|' + re.src_ZPCc + '))' +\n '((?![$+<=>^`|\\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')';\n\n re.tpl_link_no_ip_fuzzy =\n // Fuzzy link can't be prepended with .:/\\- and non punctuation.\n // but can start with > (markdown blockquote)\n '(^|(?![.:/\\\\-_@])(?:[$+<=>^`|\\uff5c]|' + re.src_ZPCc + '))' +\n '((?![$+<=>^`|\\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')';\n\n return re;\n};\n\n\n//# sourceURL=webpack:///./node_modules/linkify-it/lib/re.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/index.js": +/*!*******************************************!*\ + !*** ./node_modules/markdown-it/index.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n\nmodule.exports = __webpack_require__(/*! ./lib/ */ \"./node_modules/markdown-it/lib/index.js\");\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/index.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/common/entities.js": +/*!*********************************************************!*\ + !*** ./node_modules/markdown-it/lib/common/entities.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// HTML5 entities map: { name -> utf16string }\n//\n\n\n/*eslint quotes:0*/\nmodule.exports = __webpack_require__(/*! entities/lib/maps/entities.json */ \"./node_modules/entities/lib/maps/entities.json\");\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/common/entities.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/common/html_blocks.js": +/*!************************************************************!*\ + !*** ./node_modules/markdown-it/lib/common/html_blocks.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// List of valid html blocks names, accorting to commonmark spec\n// http://jgm.github.io/CommonMark/spec.html#html-blocks\n\n\n\n\nmodule.exports = [\n 'address',\n 'article',\n 'aside',\n 'base',\n 'basefont',\n 'blockquote',\n 'body',\n 'caption',\n 'center',\n 'col',\n 'colgroup',\n 'dd',\n 'details',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'frame',\n 'frameset',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hr',\n 'html',\n 'iframe',\n 'legend',\n 'li',\n 'link',\n 'main',\n 'menu',\n 'menuitem',\n 'meta',\n 'nav',\n 'noframes',\n 'ol',\n 'optgroup',\n 'option',\n 'p',\n 'param',\n 'section',\n 'source',\n 'summary',\n 'table',\n 'tbody',\n 'td',\n 'tfoot',\n 'th',\n 'thead',\n 'title',\n 'tr',\n 'track',\n 'ul'\n];\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/common/html_blocks.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/common/html_re.js": +/*!********************************************************!*\ + !*** ./node_modules/markdown-it/lib/common/html_re.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Regexps to match html elements\n\n\n\nvar attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*';\n\nvar unquoted = '[^\"\\'=<>`\\\\x00-\\\\x20]+';\nvar single_quoted = \"'[^']*'\";\nvar double_quoted = '\"[^\"]*\"';\n\nvar attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')';\n\nvar attribute = '(?:\\\\s+' + attr_name + '(?:\\\\s*=\\\\s*' + attr_value + ')?)';\n\nvar open_tag = '<[A-Za-z][A-Za-z0-9\\\\-]*' + attribute + '*\\\\s*\\\\/?>';\n\nvar close_tag = '<\\\\/[A-Za-z][A-Za-z0-9\\\\-]*\\\\s*>';\nvar comment = '|';\nvar processing = '<[?].*?[?]>';\nvar declaration = ']*>';\nvar cdata = '';\n\nvar HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment +\n '|' + processing + '|' + declaration + '|' + cdata + ')');\nvar HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')');\n\nmodule.exports.HTML_TAG_RE = HTML_TAG_RE;\nmodule.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE;\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/common/html_re.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/common/utils.js": +/*!******************************************************!*\ + !*** ./node_modules/markdown-it/lib/common/utils.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Utilities\n//\n\n\n\nfunction _class(obj) { return Object.prototype.toString.call(obj); }\n\nfunction isString(obj) { return _class(obj) === '[object String]'; }\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction has(object, key) {\n return _hasOwnProperty.call(object, key);\n}\n\n// Merge objects\n//\nfunction assign(obj /*from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n\n sources.forEach(function (source) {\n if (!source) { return; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be object');\n }\n\n Object.keys(source).forEach(function (key) {\n obj[key] = source[key];\n });\n });\n\n return obj;\n}\n\n// Remove element from array and put another array at those position.\n// Useful for some operations with tokens\nfunction arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}\n\n////////////////////////////////////////////////////////////////////////////////\n\nfunction isValidEntityCode(c) {\n /*eslint no-bitwise:0*/\n // broken sequence\n if (c >= 0xD800 && c <= 0xDFFF) { return false; }\n // never used\n if (c >= 0xFDD0 && c <= 0xFDEF) { return false; }\n if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false; }\n // control codes\n if (c >= 0x00 && c <= 0x08) { return false; }\n if (c === 0x0B) { return false; }\n if (c >= 0x0E && c <= 0x1F) { return false; }\n if (c >= 0x7F && c <= 0x9F) { return false; }\n // out of range\n if (c > 0x10FFFF) { return false; }\n return true;\n}\n\nfunction fromCodePoint(c) {\n /*eslint no-bitwise:0*/\n if (c > 0xffff) {\n c -= 0x10000;\n var surrogate1 = 0xd800 + (c >> 10),\n surrogate2 = 0xdc00 + (c & 0x3ff);\n\n return String.fromCharCode(surrogate1, surrogate2);\n }\n return String.fromCharCode(c);\n}\n\n\nvar UNESCAPE_MD_RE = /\\\\([!\"#$%&'()*+,\\-.\\/:;<=>?@[\\\\\\]^_`{|}~])/g;\nvar ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;\nvar UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi');\n\nvar DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;\n\nvar entities = __webpack_require__(/*! ./entities */ \"./node_modules/markdown-it/lib/common/entities.js\");\n\nfunction replaceEntityPattern(match, name) {\n var code = 0;\n\n if (has(entities, name)) {\n return entities[name];\n }\n\n if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) {\n code = name[1].toLowerCase() === 'x' ?\n parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10);\n\n if (isValidEntityCode(code)) {\n return fromCodePoint(code);\n }\n }\n\n return match;\n}\n\n/*function replaceEntities(str) {\n if (str.indexOf('&') < 0) { return str; }\n\n return str.replace(ENTITY_RE, replaceEntityPattern);\n}*/\n\nfunction unescapeMd(str) {\n if (str.indexOf('\\\\') < 0) { return str; }\n return str.replace(UNESCAPE_MD_RE, '$1');\n}\n\nfunction unescapeAll(str) {\n if (str.indexOf('\\\\') < 0 && str.indexOf('&') < 0) { return str; }\n\n return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) {\n if (escaped) { return escaped; }\n return replaceEntityPattern(match, entity);\n });\n}\n\n////////////////////////////////////////////////////////////////////////////////\n\nvar HTML_ESCAPE_TEST_RE = /[&<>\"]/;\nvar HTML_ESCAPE_REPLACE_RE = /[&<>\"]/g;\nvar HTML_REPLACEMENTS = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"'\n};\n\nfunction replaceUnsafeChar(ch) {\n return HTML_REPLACEMENTS[ch];\n}\n\nfunction escapeHtml(str) {\n if (HTML_ESCAPE_TEST_RE.test(str)) {\n return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);\n }\n return str;\n}\n\n////////////////////////////////////////////////////////////////////////////////\n\nvar REGEXP_ESCAPE_RE = /[.?*+^$[\\]\\\\(){}|-]/g;\n\nfunction escapeRE(str) {\n return str.replace(REGEXP_ESCAPE_RE, '\\\\$&');\n}\n\n////////////////////////////////////////////////////////////////////////////////\n\nfunction isSpace(code) {\n switch (code) {\n case 0x09:\n case 0x20:\n return true;\n }\n return false;\n}\n\n// Zs (unicode class) || [\\t\\f\\v\\r\\n]\nfunction isWhiteSpace(code) {\n if (code >= 0x2000 && code <= 0x200A) { return true; }\n switch (code) {\n case 0x09: // \\t\n case 0x0A: // \\n\n case 0x0B: // \\v\n case 0x0C: // \\f\n case 0x0D: // \\r\n case 0x20:\n case 0xA0:\n case 0x1680:\n case 0x202F:\n case 0x205F:\n case 0x3000:\n return true;\n }\n return false;\n}\n\n////////////////////////////////////////////////////////////////////////////////\n\n/*eslint-disable max-len*/\nvar UNICODE_PUNCT_RE = __webpack_require__(/*! uc.micro/categories/P/regex */ \"./node_modules/uc.micro/categories/P/regex.js\");\n\n// Currently without astral characters support.\nfunction isPunctChar(ch) {\n return UNICODE_PUNCT_RE.test(ch);\n}\n\n\n// Markdown ASCII punctuation characters.\n//\n// !, \", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \\, ], ^, _, `, {, |, }, or ~\n// http://spec.commonmark.org/0.15/#ascii-punctuation-character\n//\n// Don't confuse with unicode punctuation !!! It lacks some chars in ascii range.\n//\nfunction isMdAsciiPunct(ch) {\n switch (ch) {\n case 0x21/* ! */:\n case 0x22/* \" */:\n case 0x23/* # */:\n case 0x24/* $ */:\n case 0x25/* % */:\n case 0x26/* & */:\n case 0x27/* ' */:\n case 0x28/* ( */:\n case 0x29/* ) */:\n case 0x2A/* * */:\n case 0x2B/* + */:\n case 0x2C/* , */:\n case 0x2D/* - */:\n case 0x2E/* . */:\n case 0x2F/* / */:\n case 0x3A/* : */:\n case 0x3B/* ; */:\n case 0x3C/* < */:\n case 0x3D/* = */:\n case 0x3E/* > */:\n case 0x3F/* ? */:\n case 0x40/* @ */:\n case 0x5B/* [ */:\n case 0x5C/* \\ */:\n case 0x5D/* ] */:\n case 0x5E/* ^ */:\n case 0x5F/* _ */:\n case 0x60/* ` */:\n case 0x7B/* { */:\n case 0x7C/* | */:\n case 0x7D/* } */:\n case 0x7E/* ~ */:\n return true;\n default:\n return false;\n }\n}\n\n// Hepler to unify [reference labels].\n//\nfunction normalizeReference(str) {\n // Trim and collapse whitespace\n //\n str = str.trim().replace(/\\s+/g, ' ');\n\n // In node v10 'ẞ'.toLowerCase() === 'Ṿ', which is presumed to be a bug\n // fixed in v12 (couldn't find any details).\n //\n // So treat this one as a special case\n // (remove this when node v10 is no longer supported).\n //\n if ('ẞ'.toLowerCase() === 'Ṿ') {\n str = str.replace(/ẞ/g, 'ß');\n }\n\n // .toLowerCase().toUpperCase() should get rid of all differences\n // between letter variants.\n //\n // Simple .toLowerCase() doesn't normalize 125 code points correctly,\n // and .toUpperCase doesn't normalize 6 of them (list of exceptions:\n // İ, ϴ, ẞ, Ω, K, Å - those are already uppercased, but have differently\n // uppercased versions).\n //\n // Here's an example showing how it happens. Lets take greek letter omega:\n // uppercase U+0398 (Θ), U+03f4 (ϴ) and lowercase U+03b8 (θ), U+03d1 (ϑ)\n //\n // Unicode entries:\n // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8;\n // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398\n // 03D1;GREEK THETA SYMBOL;Ll;0;L; 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398\n // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L; 0398;;;;N;;;;03B8;\n //\n // Case-insensitive comparison should treat all of them as equivalent.\n //\n // But .toLowerCase() doesn't change ϑ (it's already lowercase),\n // and .toUpperCase() doesn't change ϴ (already uppercase).\n //\n // Applying first lower then upper case normalizes any character:\n // '\\u0398\\u03f4\\u03b8\\u03d1'.toLowerCase().toUpperCase() === '\\u0398\\u0398\\u0398\\u0398'\n //\n // Note: this is equivalent to unicode case folding; unicode normalization\n // is a different step that is not required here.\n //\n // Final result should be uppercased, because it's later stored in an object\n // (this avoid a conflict with Object.prototype members,\n // most notably, `__proto__`)\n //\n return str.toLowerCase().toUpperCase();\n}\n\n////////////////////////////////////////////////////////////////////////////////\n\n// Re-export libraries commonly used in both markdown-it and its plugins,\n// so plugins won't have to depend on them explicitly, which reduces their\n// bundled size (e.g. a browser build).\n//\nexports.lib = {};\nexports.lib.mdurl = __webpack_require__(/*! mdurl */ \"./node_modules/mdurl/index.js\");\nexports.lib.ucmicro = __webpack_require__(/*! uc.micro */ \"./node_modules/uc.micro/index.js\");\n\nexports.assign = assign;\nexports.isString = isString;\nexports.has = has;\nexports.unescapeMd = unescapeMd;\nexports.unescapeAll = unescapeAll;\nexports.isValidEntityCode = isValidEntityCode;\nexports.fromCodePoint = fromCodePoint;\n// exports.replaceEntities = replaceEntities;\nexports.escapeHtml = escapeHtml;\nexports.arrayReplaceAt = arrayReplaceAt;\nexports.isSpace = isSpace;\nexports.isWhiteSpace = isWhiteSpace;\nexports.isMdAsciiPunct = isMdAsciiPunct;\nexports.isPunctChar = isPunctChar;\nexports.escapeRE = escapeRE;\nexports.normalizeReference = normalizeReference;\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/common/utils.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/helpers/index.js": +/*!*******************************************************!*\ + !*** ./node_modules/markdown-it/lib/helpers/index.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Just a shortcut for bulk export\n\n\n\nexports.parseLinkLabel = __webpack_require__(/*! ./parse_link_label */ \"./node_modules/markdown-it/lib/helpers/parse_link_label.js\");\nexports.parseLinkDestination = __webpack_require__(/*! ./parse_link_destination */ \"./node_modules/markdown-it/lib/helpers/parse_link_destination.js\");\nexports.parseLinkTitle = __webpack_require__(/*! ./parse_link_title */ \"./node_modules/markdown-it/lib/helpers/parse_link_title.js\");\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/helpers/index.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/helpers/parse_link_destination.js": +/*!************************************************************************!*\ + !*** ./node_modules/markdown-it/lib/helpers/parse_link_destination.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Parse link destination\n//\n\n\n\nvar unescapeAll = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").unescapeAll;\n\n\nmodule.exports = function parseLinkDestination(str, pos, max) {\n var code, level,\n lines = 0,\n start = pos,\n result = {\n ok: false,\n pos: 0,\n lines: 0,\n str: ''\n };\n\n if (str.charCodeAt(pos) === 0x3C /* < */) {\n pos++;\n while (pos < max) {\n code = str.charCodeAt(pos);\n if (code === 0x0A /* \\n */) { return result; }\n if (code === 0x3E /* > */) {\n result.pos = pos + 1;\n result.str = unescapeAll(str.slice(start + 1, pos));\n result.ok = true;\n return result;\n }\n if (code === 0x5C /* \\ */ && pos + 1 < max) {\n pos += 2;\n continue;\n }\n\n pos++;\n }\n\n // no closing '>'\n return result;\n }\n\n // this should be ... } else { ... branch\n\n level = 0;\n while (pos < max) {\n code = str.charCodeAt(pos);\n\n if (code === 0x20) { break; }\n\n // ascii control characters\n if (code < 0x20 || code === 0x7F) { break; }\n\n if (code === 0x5C /* \\ */ && pos + 1 < max) {\n pos += 2;\n continue;\n }\n\n if (code === 0x28 /* ( */) {\n level++;\n }\n\n if (code === 0x29 /* ) */) {\n if (level === 0) { break; }\n level--;\n }\n\n pos++;\n }\n\n if (start === pos) { return result; }\n if (level !== 0) { return result; }\n\n result.str = unescapeAll(str.slice(start, pos));\n result.lines = lines;\n result.pos = pos;\n result.ok = true;\n return result;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/helpers/parse_link_destination.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/helpers/parse_link_label.js": +/*!******************************************************************!*\ + !*** ./node_modules/markdown-it/lib/helpers/parse_link_label.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Parse link label\n//\n// this function assumes that first character (\"[\") already matches;\n// returns the end of the label\n//\n\n\nmodule.exports = function parseLinkLabel(state, start, disableNested) {\n var level, found, marker, prevPos,\n labelEnd = -1,\n max = state.posMax,\n oldPos = state.pos;\n\n state.pos = start + 1;\n level = 1;\n\n while (state.pos < max) {\n marker = state.src.charCodeAt(state.pos);\n if (marker === 0x5D /* ] */) {\n level--;\n if (level === 0) {\n found = true;\n break;\n }\n }\n\n prevPos = state.pos;\n state.md.inline.skipToken(state);\n if (marker === 0x5B /* [ */) {\n if (prevPos === state.pos - 1) {\n // increase level if we find text `[`, which is not a part of any token\n level++;\n } else if (disableNested) {\n state.pos = oldPos;\n return -1;\n }\n }\n }\n\n if (found) {\n labelEnd = state.pos;\n }\n\n // restore old state\n state.pos = oldPos;\n\n return labelEnd;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/helpers/parse_link_label.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/helpers/parse_link_title.js": +/*!******************************************************************!*\ + !*** ./node_modules/markdown-it/lib/helpers/parse_link_title.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Parse link title\n//\n\n\n\nvar unescapeAll = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").unescapeAll;\n\n\nmodule.exports = function parseLinkTitle(str, pos, max) {\n var code,\n marker,\n lines = 0,\n start = pos,\n result = {\n ok: false,\n pos: 0,\n lines: 0,\n str: ''\n };\n\n if (pos >= max) { return result; }\n\n marker = str.charCodeAt(pos);\n\n if (marker !== 0x22 /* \" */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return result; }\n\n pos++;\n\n // if opening marker is \"(\", switch it to closing marker \")\"\n if (marker === 0x28) { marker = 0x29; }\n\n while (pos < max) {\n code = str.charCodeAt(pos);\n if (code === marker) {\n result.pos = pos + 1;\n result.lines = lines;\n result.str = unescapeAll(str.slice(start + 1, pos));\n result.ok = true;\n return result;\n } else if (code === 0x0A) {\n lines++;\n } else if (code === 0x5C /* \\ */ && pos + 1 < max) {\n pos++;\n if (str.charCodeAt(pos) === 0x0A) {\n lines++;\n }\n }\n\n pos++;\n }\n\n return result;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/helpers/parse_link_title.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/index.js": +/*!***********************************************!*\ + !*** ./node_modules/markdown-it/lib/index.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Main parser class\n\n\n\n\nvar utils = __webpack_require__(/*! ./common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\");\nvar helpers = __webpack_require__(/*! ./helpers */ \"./node_modules/markdown-it/lib/helpers/index.js\");\nvar Renderer = __webpack_require__(/*! ./renderer */ \"./node_modules/markdown-it/lib/renderer.js\");\nvar ParserCore = __webpack_require__(/*! ./parser_core */ \"./node_modules/markdown-it/lib/parser_core.js\");\nvar ParserBlock = __webpack_require__(/*! ./parser_block */ \"./node_modules/markdown-it/lib/parser_block.js\");\nvar ParserInline = __webpack_require__(/*! ./parser_inline */ \"./node_modules/markdown-it/lib/parser_inline.js\");\nvar LinkifyIt = __webpack_require__(/*! linkify-it */ \"./node_modules/linkify-it/index.js\");\nvar mdurl = __webpack_require__(/*! mdurl */ \"./node_modules/mdurl/index.js\");\nvar punycode = __webpack_require__(/*! punycode */ \"./node_modules/node-libs-browser/node_modules/punycode/punycode.js\");\n\n\nvar config = {\n 'default': __webpack_require__(/*! ./presets/default */ \"./node_modules/markdown-it/lib/presets/default.js\"),\n zero: __webpack_require__(/*! ./presets/zero */ \"./node_modules/markdown-it/lib/presets/zero.js\"),\n commonmark: __webpack_require__(/*! ./presets/commonmark */ \"./node_modules/markdown-it/lib/presets/commonmark.js\")\n};\n\n////////////////////////////////////////////////////////////////////////////////\n//\n// This validator can prohibit more than really needed to prevent XSS. It's a\n// tradeoff to keep code simple and to be secure by default.\n//\n// If you need different setup - override validator method as you wish. Or\n// replace it with dummy function and use external sanitizer.\n//\n\nvar BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;\nvar GOOD_DATA_RE = /^data:image\\/(gif|png|jpeg|webp);/;\n\nfunction validateLink(url) {\n // url should be normalized at this point, and existing entities are decoded\n var str = url.trim().toLowerCase();\n\n return BAD_PROTO_RE.test(str) ? (GOOD_DATA_RE.test(str) ? true : false) : true;\n}\n\n////////////////////////////////////////////////////////////////////////////////\n\n\nvar RECODE_HOSTNAME_FOR = [ 'http:', 'https:', 'mailto:' ];\n\nfunction normalizeLink(url) {\n var parsed = mdurl.parse(url, true);\n\n if (parsed.hostname) {\n // Encode hostnames in urls like:\n // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`\n //\n // We don't encode unknown schemas, because it's likely that we encode\n // something we shouldn't (e.g. `skype:name` treated as `skype:host`)\n //\n if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {\n try {\n parsed.hostname = punycode.toASCII(parsed.hostname);\n } catch (er) { /**/ }\n }\n }\n\n return mdurl.encode(mdurl.format(parsed));\n}\n\nfunction normalizeLinkText(url) {\n var parsed = mdurl.parse(url, true);\n\n if (parsed.hostname) {\n // Encode hostnames in urls like:\n // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`\n //\n // We don't encode unknown schemas, because it's likely that we encode\n // something we shouldn't (e.g. `skype:name` treated as `skype:host`)\n //\n if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {\n try {\n parsed.hostname = punycode.toUnicode(parsed.hostname);\n } catch (er) { /**/ }\n }\n }\n\n return mdurl.decode(mdurl.format(parsed));\n}\n\n\n/**\n * class MarkdownIt\n *\n * Main parser/renderer class.\n *\n * ##### Usage\n *\n * ```javascript\n * // node.js, \"classic\" way:\n * var MarkdownIt = require('markdown-it'),\n * md = new MarkdownIt();\n * var result = md.render('# markdown-it rulezz!');\n *\n * // node.js, the same, but with sugar:\n * var md = require('markdown-it')();\n * var result = md.render('# markdown-it rulezz!');\n *\n * // browser without AMD, added to \"window\" on script load\n * // Note, there are no dash.\n * var md = window.markdownit();\n * var result = md.render('# markdown-it rulezz!');\n * ```\n *\n * Single line rendering, without paragraph wrap:\n *\n * ```javascript\n * var md = require('markdown-it')();\n * var result = md.renderInline('__markdown-it__ rulezz!');\n * ```\n **/\n\n/**\n * new MarkdownIt([presetName, options])\n * - presetName (String): optional, `commonmark` / `zero`\n * - options (Object)\n *\n * Creates parser instanse with given config. Can be called without `new`.\n *\n * ##### presetName\n *\n * MarkdownIt provides named presets as a convenience to quickly\n * enable/disable active syntax rules and options for common use cases.\n *\n * - [\"commonmark\"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) -\n * configures parser to strict [CommonMark](http://commonmark.org/) mode.\n * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) -\n * similar to GFM, used when no preset name given. Enables all available rules,\n * but still without html, typographer & autolinker.\n * - [\"zero\"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) -\n * all rules disabled. Useful to quickly setup your config via `.enable()`.\n * For example, when you need only `bold` and `italic` markup and nothing else.\n *\n * ##### options:\n *\n * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful!\n * That's not safe! You may need external sanitizer to protect output from XSS.\n * It's better to extend features via plugins, instead of enabling HTML.\n * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags\n * (`
`). This is needed only for full CommonMark compatibility. In real\n * world you will need HTML output.\n * - __breaks__ - `false`. Set `true` to convert `\\n` in paragraphs into `
`.\n * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks.\n * Can be useful for external highlighters.\n * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links.\n * - __typographer__ - `false`. Set `true` to enable [some language-neutral\n * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) +\n * quotes beautification (smartquotes).\n * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement\n * pairs, when typographer enabled and smartquotes on. For example, you can\n * use `'«»„“'` for Russian, `'„“‚‘'` for German, and\n * `['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›']` for French (including nbsp).\n * - __highlight__ - `null`. Highlighter function for fenced code blocks.\n * Highlighter `function (str, lang)` should return escaped HTML. It can also\n * return empty string if the source was not changed and should be escaped\n * externaly. If result starts with `):\n *\n * ```javascript\n * var hljs = require('highlight.js') // https://highlightjs.org/\n *\n * // Actual default values\n * var md = require('markdown-it')({\n * highlight: function (str, lang) {\n * if (lang && hljs.getLanguage(lang)) {\n * try {\n * return '
' +\n *                hljs.highlight(lang, str, true).value +\n *                '
';\n * } catch (__) {}\n * }\n *\n * return '
' + md.utils.escapeHtml(str) + '
';\n * }\n * });\n * ```\n *\n **/\nfunction MarkdownIt(presetName, options) {\n if (!(this instanceof MarkdownIt)) {\n return new MarkdownIt(presetName, options);\n }\n\n if (!options) {\n if (!utils.isString(presetName)) {\n options = presetName || {};\n presetName = 'default';\n }\n }\n\n /**\n * MarkdownIt#inline -> ParserInline\n *\n * Instance of [[ParserInline]]. You may need it to add new rules when\n * writing plugins. For simple rules control use [[MarkdownIt.disable]] and\n * [[MarkdownIt.enable]].\n **/\n this.inline = new ParserInline();\n\n /**\n * MarkdownIt#block -> ParserBlock\n *\n * Instance of [[ParserBlock]]. You may need it to add new rules when\n * writing plugins. For simple rules control use [[MarkdownIt.disable]] and\n * [[MarkdownIt.enable]].\n **/\n this.block = new ParserBlock();\n\n /**\n * MarkdownIt#core -> Core\n *\n * Instance of [[Core]] chain executor. You may need it to add new rules when\n * writing plugins. For simple rules control use [[MarkdownIt.disable]] and\n * [[MarkdownIt.enable]].\n **/\n this.core = new ParserCore();\n\n /**\n * MarkdownIt#renderer -> Renderer\n *\n * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering\n * rules for new token types, generated by plugins.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * function myToken(tokens, idx, options, env, self) {\n * //...\n * return result;\n * };\n *\n * md.renderer.rules['my_token'] = myToken\n * ```\n *\n * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js).\n **/\n this.renderer = new Renderer();\n\n /**\n * MarkdownIt#linkify -> LinkifyIt\n *\n * [linkify-it](https://github.com/markdown-it/linkify-it) instance.\n * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js)\n * rule.\n **/\n this.linkify = new LinkifyIt();\n\n /**\n * MarkdownIt#validateLink(url) -> Boolean\n *\n * Link validation function. CommonMark allows too much in links. By default\n * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas\n * except some embedded image types.\n *\n * You can change this behaviour:\n *\n * ```javascript\n * var md = require('markdown-it')();\n * // enable everything\n * md.validateLink = function () { return true; }\n * ```\n **/\n this.validateLink = validateLink;\n\n /**\n * MarkdownIt#normalizeLink(url) -> String\n *\n * Function used to encode link url to a machine-readable format,\n * which includes url-encoding, punycode, etc.\n **/\n this.normalizeLink = normalizeLink;\n\n /**\n * MarkdownIt#normalizeLinkText(url) -> String\n *\n * Function used to decode link url to a human-readable format`\n **/\n this.normalizeLinkText = normalizeLinkText;\n\n\n // Expose utils & helpers for easy acces from plugins\n\n /**\n * MarkdownIt#utils -> utils\n *\n * Assorted utility functions, useful to write plugins. See details\n * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js).\n **/\n this.utils = utils;\n\n /**\n * MarkdownIt#helpers -> helpers\n *\n * Link components parser functions, useful to write plugins. See details\n * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).\n **/\n this.helpers = utils.assign({}, helpers);\n\n\n this.options = {};\n this.configure(presetName);\n\n if (options) { this.set(options); }\n}\n\n\n/** chainable\n * MarkdownIt.set(options)\n *\n * Set parser options (in the same format as in constructor). Probably, you\n * will never need it, but you can change options after constructor call.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')()\n * .set({ html: true, breaks: true })\n * .set({ typographer, true });\n * ```\n *\n * __Note:__ To achieve the best possible performance, don't modify a\n * `markdown-it` instance options on the fly. If you need multiple configurations\n * it's best to create multiple instances and initialize each with separate\n * config.\n **/\nMarkdownIt.prototype.set = function (options) {\n utils.assign(this.options, options);\n return this;\n};\n\n\n/** chainable, internal\n * MarkdownIt.configure(presets)\n *\n * Batch load of all options and compenent settings. This is internal method,\n * and you probably will not need it. But if you with - see available presets\n * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)\n *\n * We strongly recommend to use presets instead of direct config loads. That\n * will give better compatibility with next versions.\n **/\nMarkdownIt.prototype.configure = function (presets) {\n var self = this, presetName;\n\n if (utils.isString(presets)) {\n presetName = presets;\n presets = config[presetName];\n if (!presets) { throw new Error('Wrong `markdown-it` preset \"' + presetName + '\", check name'); }\n }\n\n if (!presets) { throw new Error('Wrong `markdown-it` preset, can\\'t be empty'); }\n\n if (presets.options) { self.set(presets.options); }\n\n if (presets.components) {\n Object.keys(presets.components).forEach(function (name) {\n if (presets.components[name].rules) {\n self[name].ruler.enableOnly(presets.components[name].rules);\n }\n if (presets.components[name].rules2) {\n self[name].ruler2.enableOnly(presets.components[name].rules2);\n }\n });\n }\n return this;\n};\n\n\n/** chainable\n * MarkdownIt.enable(list, ignoreInvalid)\n * - list (String|Array): rule name or list of rule names to enable\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Enable list or rules. It will automatically find appropriate components,\n * containing rules with given names. If rule not found, and `ignoreInvalid`\n * not set - throws exception.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')()\n * .enable(['sub', 'sup'])\n * .disable('smartquotes');\n * ```\n **/\nMarkdownIt.prototype.enable = function (list, ignoreInvalid) {\n var result = [];\n\n if (!Array.isArray(list)) { list = [ list ]; }\n\n [ 'core', 'block', 'inline' ].forEach(function (chain) {\n result = result.concat(this[chain].ruler.enable(list, true));\n }, this);\n\n result = result.concat(this.inline.ruler2.enable(list, true));\n\n var missed = list.filter(function (name) { return result.indexOf(name) < 0; });\n\n if (missed.length && !ignoreInvalid) {\n throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed);\n }\n\n return this;\n};\n\n\n/** chainable\n * MarkdownIt.disable(list, ignoreInvalid)\n * - list (String|Array): rule name or list of rule names to disable.\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * The same as [[MarkdownIt.enable]], but turn specified rules off.\n **/\nMarkdownIt.prototype.disable = function (list, ignoreInvalid) {\n var result = [];\n\n if (!Array.isArray(list)) { list = [ list ]; }\n\n [ 'core', 'block', 'inline' ].forEach(function (chain) {\n result = result.concat(this[chain].ruler.disable(list, true));\n }, this);\n\n result = result.concat(this.inline.ruler2.disable(list, true));\n\n var missed = list.filter(function (name) { return result.indexOf(name) < 0; });\n\n if (missed.length && !ignoreInvalid) {\n throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed);\n }\n return this;\n};\n\n\n/** chainable\n * MarkdownIt.use(plugin, params)\n *\n * Load specified plugin with given params into current parser instance.\n * It's just a sugar to call `plugin(md, params)` with curring.\n *\n * ##### Example\n *\n * ```javascript\n * var iterator = require('markdown-it-for-inline');\n * var md = require('markdown-it')()\n * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {\n * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');\n * });\n * ```\n **/\nMarkdownIt.prototype.use = function (plugin /*, params, ... */) {\n var args = [ this ].concat(Array.prototype.slice.call(arguments, 1));\n plugin.apply(plugin, args);\n return this;\n};\n\n\n/** internal\n * MarkdownIt.parse(src, env) -> Array\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * Parse input string and returns list of block tokens (special token type\n * \"inline\" will contain list of inline tokens). You should not call this\n * method directly, until you write custom renderer (for example, to produce\n * AST).\n *\n * `env` is used to pass data between \"distributed\" rules and return additional\n * metadata like reference info, needed for the renderer. It also can be used to\n * inject data in specific cases. Usually, you will be ok to pass `{}`,\n * and then pass updated object to renderer.\n **/\nMarkdownIt.prototype.parse = function (src, env) {\n if (typeof src !== 'string') {\n throw new Error('Input data should be a String');\n }\n\n var state = new this.core.State(src, this, env);\n\n this.core.process(state);\n\n return state.tokens;\n};\n\n\n/**\n * MarkdownIt.render(src [, env]) -> String\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * Render markdown string into html. It does all magic for you :).\n *\n * `env` can be used to inject additional metadata (`{}` by default).\n * But you will not need it with high probability. See also comment\n * in [[MarkdownIt.parse]].\n **/\nMarkdownIt.prototype.render = function (src, env) {\n env = env || {};\n\n return this.renderer.render(this.parse(src, env), this.options, env);\n};\n\n\n/** internal\n * MarkdownIt.parseInline(src, env) -> Array\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the\n * block tokens list with the single `inline` element, containing parsed inline\n * tokens in `children` property. Also updates `env` object.\n **/\nMarkdownIt.prototype.parseInline = function (src, env) {\n var state = new this.core.State(src, this, env);\n\n state.inlineMode = true;\n this.core.process(state);\n\n return state.tokens;\n};\n\n\n/**\n * MarkdownIt.renderInline(src [, env]) -> String\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * Similar to [[MarkdownIt.render]] but for single paragraph content. Result\n * will NOT be wrapped into `

` tags.\n **/\nMarkdownIt.prototype.renderInline = function (src, env) {\n env = env || {};\n\n return this.renderer.render(this.parseInline(src, env), this.options, env);\n};\n\n\nmodule.exports = MarkdownIt;\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/index.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/parser_block.js": +/*!******************************************************!*\ + !*** ./node_modules/markdown-it/lib/parser_block.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/** internal\n * class ParserBlock\n *\n * Block-level tokenizer.\n **/\n\n\n\nvar Ruler = __webpack_require__(/*! ./ruler */ \"./node_modules/markdown-it/lib/ruler.js\");\n\n\nvar _rules = [\n // First 2 params - rule name & source. Secondary array - list of rules,\n // which can be terminated by this one.\n [ 'table', __webpack_require__(/*! ./rules_block/table */ \"./node_modules/markdown-it/lib/rules_block/table.js\"), [ 'paragraph', 'reference' ] ],\n [ 'code', __webpack_require__(/*! ./rules_block/code */ \"./node_modules/markdown-it/lib/rules_block/code.js\") ],\n [ 'fence', __webpack_require__(/*! ./rules_block/fence */ \"./node_modules/markdown-it/lib/rules_block/fence.js\"), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],\n [ 'blockquote', __webpack_require__(/*! ./rules_block/blockquote */ \"./node_modules/markdown-it/lib/rules_block/blockquote.js\"), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],\n [ 'hr', __webpack_require__(/*! ./rules_block/hr */ \"./node_modules/markdown-it/lib/rules_block/hr.js\"), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],\n [ 'list', __webpack_require__(/*! ./rules_block/list */ \"./node_modules/markdown-it/lib/rules_block/list.js\"), [ 'paragraph', 'reference', 'blockquote' ] ],\n [ 'reference', __webpack_require__(/*! ./rules_block/reference */ \"./node_modules/markdown-it/lib/rules_block/reference.js\") ],\n [ 'heading', __webpack_require__(/*! ./rules_block/heading */ \"./node_modules/markdown-it/lib/rules_block/heading.js\"), [ 'paragraph', 'reference', 'blockquote' ] ],\n [ 'lheading', __webpack_require__(/*! ./rules_block/lheading */ \"./node_modules/markdown-it/lib/rules_block/lheading.js\") ],\n [ 'html_block', __webpack_require__(/*! ./rules_block/html_block */ \"./node_modules/markdown-it/lib/rules_block/html_block.js\"), [ 'paragraph', 'reference', 'blockquote' ] ],\n [ 'paragraph', __webpack_require__(/*! ./rules_block/paragraph */ \"./node_modules/markdown-it/lib/rules_block/paragraph.js\") ]\n];\n\n\n/**\n * new ParserBlock()\n **/\nfunction ParserBlock() {\n /**\n * ParserBlock#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of block rules.\n **/\n this.ruler = new Ruler();\n\n for (var i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() });\n }\n}\n\n\n// Generate tokens for input range\n//\nParserBlock.prototype.tokenize = function (state, startLine, endLine) {\n var ok, i,\n rules = this.ruler.getRules(''),\n len = rules.length,\n line = startLine,\n hasEmptyLines = false,\n maxNesting = state.md.options.maxNesting;\n\n while (line < endLine) {\n state.line = line = state.skipEmptyLines(line);\n if (line >= endLine) { break; }\n\n // Termination condition for nested calls.\n // Nested calls currently used for blockquotes & lists\n if (state.sCount[line] < state.blkIndent) { break; }\n\n // If nesting level exceeded - skip tail to the end. That's not ordinary\n // situation and we should not care about content.\n if (state.level >= maxNesting) {\n state.line = endLine;\n break;\n }\n\n // Try all possible rules.\n // On success, rule should:\n //\n // - update `state.line`\n // - update `state.tokens`\n // - return true\n\n for (i = 0; i < len; i++) {\n ok = rules[i](state, line, endLine, false);\n if (ok) { break; }\n }\n\n // set state.tight if we had an empty line before current tag\n // i.e. latest empty line should not count\n state.tight = !hasEmptyLines;\n\n // paragraph might \"eat\" one newline after it in nested lists\n if (state.isEmpty(state.line - 1)) {\n hasEmptyLines = true;\n }\n\n line = state.line;\n\n if (line < endLine && state.isEmpty(line)) {\n hasEmptyLines = true;\n line++;\n state.line = line;\n }\n }\n};\n\n\n/**\n * ParserBlock.parse(str, md, env, outTokens)\n *\n * Process input string and push block tokens into `outTokens`\n **/\nParserBlock.prototype.parse = function (src, md, env, outTokens) {\n var state;\n\n if (!src) { return; }\n\n state = new this.State(src, md, env, outTokens);\n\n this.tokenize(state, state.line, state.lineMax);\n};\n\n\nParserBlock.prototype.State = __webpack_require__(/*! ./rules_block/state_block */ \"./node_modules/markdown-it/lib/rules_block/state_block.js\");\n\n\nmodule.exports = ParserBlock;\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/parser_block.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/parser_core.js": +/*!*****************************************************!*\ + !*** ./node_modules/markdown-it/lib/parser_core.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/** internal\n * class Core\n *\n * Top-level rules executor. Glues block/inline parsers and does intermediate\n * transformations.\n **/\n\n\n\nvar Ruler = __webpack_require__(/*! ./ruler */ \"./node_modules/markdown-it/lib/ruler.js\");\n\n\nvar _rules = [\n [ 'normalize', __webpack_require__(/*! ./rules_core/normalize */ \"./node_modules/markdown-it/lib/rules_core/normalize.js\") ],\n [ 'block', __webpack_require__(/*! ./rules_core/block */ \"./node_modules/markdown-it/lib/rules_core/block.js\") ],\n [ 'inline', __webpack_require__(/*! ./rules_core/inline */ \"./node_modules/markdown-it/lib/rules_core/inline.js\") ],\n [ 'linkify', __webpack_require__(/*! ./rules_core/linkify */ \"./node_modules/markdown-it/lib/rules_core/linkify.js\") ],\n [ 'replacements', __webpack_require__(/*! ./rules_core/replacements */ \"./node_modules/markdown-it/lib/rules_core/replacements.js\") ],\n [ 'smartquotes', __webpack_require__(/*! ./rules_core/smartquotes */ \"./node_modules/markdown-it/lib/rules_core/smartquotes.js\") ]\n];\n\n\n/**\n * new Core()\n **/\nfunction Core() {\n /**\n * Core#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of core rules.\n **/\n this.ruler = new Ruler();\n\n for (var i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1]);\n }\n}\n\n\n/**\n * Core.process(state)\n *\n * Executes core chain rules.\n **/\nCore.prototype.process = function (state) {\n var i, l, rules;\n\n rules = this.ruler.getRules('');\n\n for (i = 0, l = rules.length; i < l; i++) {\n rules[i](state);\n }\n};\n\nCore.prototype.State = __webpack_require__(/*! ./rules_core/state_core */ \"./node_modules/markdown-it/lib/rules_core/state_core.js\");\n\n\nmodule.exports = Core;\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/parser_core.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/parser_inline.js": +/*!*******************************************************!*\ + !*** ./node_modules/markdown-it/lib/parser_inline.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/** internal\n * class ParserInline\n *\n * Tokenizes paragraph content.\n **/\n\n\n\nvar Ruler = __webpack_require__(/*! ./ruler */ \"./node_modules/markdown-it/lib/ruler.js\");\n\n\n////////////////////////////////////////////////////////////////////////////////\n// Parser rules\n\nvar _rules = [\n [ 'text', __webpack_require__(/*! ./rules_inline/text */ \"./node_modules/markdown-it/lib/rules_inline/text.js\") ],\n [ 'newline', __webpack_require__(/*! ./rules_inline/newline */ \"./node_modules/markdown-it/lib/rules_inline/newline.js\") ],\n [ 'escape', __webpack_require__(/*! ./rules_inline/escape */ \"./node_modules/markdown-it/lib/rules_inline/escape.js\") ],\n [ 'backticks', __webpack_require__(/*! ./rules_inline/backticks */ \"./node_modules/markdown-it/lib/rules_inline/backticks.js\") ],\n [ 'strikethrough', __webpack_require__(/*! ./rules_inline/strikethrough */ \"./node_modules/markdown-it/lib/rules_inline/strikethrough.js\").tokenize ],\n [ 'emphasis', __webpack_require__(/*! ./rules_inline/emphasis */ \"./node_modules/markdown-it/lib/rules_inline/emphasis.js\").tokenize ],\n [ 'link', __webpack_require__(/*! ./rules_inline/link */ \"./node_modules/markdown-it/lib/rules_inline/link.js\") ],\n [ 'image', __webpack_require__(/*! ./rules_inline/image */ \"./node_modules/markdown-it/lib/rules_inline/image.js\") ],\n [ 'autolink', __webpack_require__(/*! ./rules_inline/autolink */ \"./node_modules/markdown-it/lib/rules_inline/autolink.js\") ],\n [ 'html_inline', __webpack_require__(/*! ./rules_inline/html_inline */ \"./node_modules/markdown-it/lib/rules_inline/html_inline.js\") ],\n [ 'entity', __webpack_require__(/*! ./rules_inline/entity */ \"./node_modules/markdown-it/lib/rules_inline/entity.js\") ]\n];\n\nvar _rules2 = [\n [ 'balance_pairs', __webpack_require__(/*! ./rules_inline/balance_pairs */ \"./node_modules/markdown-it/lib/rules_inline/balance_pairs.js\") ],\n [ 'strikethrough', __webpack_require__(/*! ./rules_inline/strikethrough */ \"./node_modules/markdown-it/lib/rules_inline/strikethrough.js\").postProcess ],\n [ 'emphasis', __webpack_require__(/*! ./rules_inline/emphasis */ \"./node_modules/markdown-it/lib/rules_inline/emphasis.js\").postProcess ],\n [ 'text_collapse', __webpack_require__(/*! ./rules_inline/text_collapse */ \"./node_modules/markdown-it/lib/rules_inline/text_collapse.js\") ]\n];\n\n\n/**\n * new ParserInline()\n **/\nfunction ParserInline() {\n var i;\n\n /**\n * ParserInline#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of inline rules.\n **/\n this.ruler = new Ruler();\n\n for (i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1]);\n }\n\n /**\n * ParserInline#ruler2 -> Ruler\n *\n * [[Ruler]] instance. Second ruler used for post-processing\n * (e.g. in emphasis-like rules).\n **/\n this.ruler2 = new Ruler();\n\n for (i = 0; i < _rules2.length; i++) {\n this.ruler2.push(_rules2[i][0], _rules2[i][1]);\n }\n}\n\n\n// Skip single token by running all rules in validation mode;\n// returns `true` if any rule reported success\n//\nParserInline.prototype.skipToken = function (state) {\n var ok, i, pos = state.pos,\n rules = this.ruler.getRules(''),\n len = rules.length,\n maxNesting = state.md.options.maxNesting,\n cache = state.cache;\n\n\n if (typeof cache[pos] !== 'undefined') {\n state.pos = cache[pos];\n return;\n }\n\n if (state.level < maxNesting) {\n for (i = 0; i < len; i++) {\n // Increment state.level and decrement it later to limit recursion.\n // It's harmless to do here, because no tokens are created. But ideally,\n // we'd need a separate private state variable for this purpose.\n //\n state.level++;\n ok = rules[i](state, true);\n state.level--;\n\n if (ok) { break; }\n }\n } else {\n // Too much nesting, just skip until the end of the paragraph.\n //\n // NOTE: this will cause links to behave incorrectly in the following case,\n // when an amount of `[` is exactly equal to `maxNesting + 1`:\n //\n // [[[[[[[[[[[[[[[[[[[[[foo]()\n //\n // TODO: remove this workaround when CM standard will allow nested links\n // (we can replace it by preventing links from being parsed in\n // validation mode)\n //\n state.pos = state.posMax;\n }\n\n if (!ok) { state.pos++; }\n cache[pos] = state.pos;\n};\n\n\n// Generate tokens for input range\n//\nParserInline.prototype.tokenize = function (state) {\n var ok, i,\n rules = this.ruler.getRules(''),\n len = rules.length,\n end = state.posMax,\n maxNesting = state.md.options.maxNesting;\n\n while (state.pos < end) {\n // Try all possible rules.\n // On success, rule should:\n //\n // - update `state.pos`\n // - update `state.tokens`\n // - return true\n\n if (state.level < maxNesting) {\n for (i = 0; i < len; i++) {\n ok = rules[i](state, false);\n if (ok) { break; }\n }\n }\n\n if (ok) {\n if (state.pos >= end) { break; }\n continue;\n }\n\n state.pending += state.src[state.pos++];\n }\n\n if (state.pending) {\n state.pushPending();\n }\n};\n\n\n/**\n * ParserInline.parse(str, md, env, outTokens)\n *\n * Process input string and push inline tokens into `outTokens`\n **/\nParserInline.prototype.parse = function (str, md, env, outTokens) {\n var i, rules, len;\n var state = new this.State(str, md, env, outTokens);\n\n this.tokenize(state);\n\n rules = this.ruler2.getRules('');\n len = rules.length;\n\n for (i = 0; i < len; i++) {\n rules[i](state);\n }\n};\n\n\nParserInline.prototype.State = __webpack_require__(/*! ./rules_inline/state_inline */ \"./node_modules/markdown-it/lib/rules_inline/state_inline.js\");\n\n\nmodule.exports = ParserInline;\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/parser_inline.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/presets/commonmark.js": +/*!************************************************************!*\ + !*** ./node_modules/markdown-it/lib/presets/commonmark.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Commonmark default options\n\n\n\n\nmodule.exports = {\n options: {\n html: true, // Enable HTML tags in source\n xhtmlOut: true, // Use '/' to close single tags (
)\n breaks: false, // Convert '\\n' in paragraphs into
\n langPrefix: 'language-', // CSS language prefix for fenced blocks\n linkify: false, // autoconvert URL-like texts to links\n\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n //\n // For example, you can use '«»„“' for Russian, '„“‚‘' for German,\n // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp).\n quotes: '\\u201c\\u201d\\u2018\\u2019', /* “”‘’ */\n\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with )\n breaks: false, // Convert '\\n' in paragraphs into
\n langPrefix: 'language-', // CSS language prefix for fenced blocks\n linkify: false, // autoconvert URL-like texts to links\n\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n //\n // For example, you can use '«»„“' for Russian, '„“‚‘' for German,\n // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp).\n quotes: '\\u201c\\u201d\\u2018\\u2019', /* “”‘’ */\n\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with )\n breaks: false, // Convert '\\n' in paragraphs into
\n langPrefix: 'language-', // CSS language prefix for fenced blocks\n linkify: false, // autoconvert URL-like texts to links\n\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n //\n // For example, you can use '«»„“' for Russian, '„“‚‘' for German,\n // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp).\n quotes: '\\u201c\\u201d\\u2018\\u2019', /* “”‘’ */\n\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with ' +\n escapeHtml(tokens[idx].content) +\n '';\n};\n\n\ndefault_rules.code_block = function (tokens, idx, options, env, slf) {\n var token = tokens[idx];\n\n return '' +\n escapeHtml(tokens[idx].content) +\n '\\n';\n};\n\n\ndefault_rules.fence = function (tokens, idx, options, env, slf) {\n var token = tokens[idx],\n info = token.info ? unescapeAll(token.info).trim() : '',\n langName = '',\n highlighted, i, tmpAttrs, tmpToken;\n\n if (info) {\n langName = info.split(/\\s+/g)[0];\n }\n\n if (options.highlight) {\n highlighted = options.highlight(token.content, langName) || escapeHtml(token.content);\n } else {\n highlighted = escapeHtml(token.content);\n }\n\n if (highlighted.indexOf(''\n + highlighted\n + '\\n';\n }\n\n\n return '

'\n        + highlighted\n        + '
\\n';\n};\n\n\ndefault_rules.image = function (tokens, idx, options, env, slf) {\n var token = tokens[idx];\n\n // \"alt\" attr MUST be set, even if empty. Because it's mandatory and\n // should be placed on proper position for tests.\n //\n // Replace content with actual value\n\n token.attrs[token.attrIndex('alt')][1] =\n slf.renderInlineAsText(token.children, options, env);\n\n return slf.renderToken(tokens, idx, options);\n};\n\n\ndefault_rules.hardbreak = function (tokens, idx, options /*, env */) {\n return options.xhtmlOut ? '
\\n' : '
\\n';\n};\ndefault_rules.softbreak = function (tokens, idx, options /*, env */) {\n return options.breaks ? (options.xhtmlOut ? '
\\n' : '
\\n') : '\\n';\n};\n\n\ndefault_rules.text = function (tokens, idx /*, options, env */) {\n return escapeHtml(tokens[idx].content);\n};\n\n\ndefault_rules.html_block = function (tokens, idx /*, options, env */) {\n return tokens[idx].content;\n};\ndefault_rules.html_inline = function (tokens, idx /*, options, env */) {\n return tokens[idx].content;\n};\n\n\n/**\n * new Renderer()\n *\n * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults.\n **/\nfunction Renderer() {\n\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return ''; };\n * md.renderer.rules.strong_close = function () { return ''; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)\n * for more details and examples.\n **/\n this.rules = assign({}, default_rules);\n}\n\n\n/**\n * Renderer.renderAttrs(token) -> String\n *\n * Render token attributes to string.\n **/\nRenderer.prototype.renderAttrs = function renderAttrs(token) {\n var i, l, result;\n\n if (!token.attrs) { return ''; }\n\n result = '';\n\n for (i = 0, l = token.attrs.length; i < l; i++) {\n result += ' ' + escapeHtml(token.attrs[i][0]) + '=\"' + escapeHtml(token.attrs[i][1]) + '\"';\n }\n\n return result;\n};\n\n\n/**\n * Renderer.renderToken(tokens, idx, options) -> String\n * - tokens (Array): list of tokens\n * - idx (Numbed): token index to render\n * - options (Object): params of parser instance\n *\n * Default token renderer. Can be overriden by custom function\n * in [[Renderer#rules]].\n **/\nRenderer.prototype.renderToken = function renderToken(tokens, idx, options) {\n var nextToken,\n result = '',\n needLf = false,\n token = tokens[idx];\n\n // Tight list paragraphs\n if (token.hidden) {\n return '';\n }\n\n // Insert a newline between hidden paragraph and subsequent opening\n // block-level tag.\n //\n // For example, here we should insert a newline before blockquote:\n // - a\n // >\n //\n if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {\n result += '\\n';\n }\n\n // Add token name, e.g. ``.\n //\n needLf = false;\n }\n }\n }\n }\n\n result += needLf ? '>\\n' : '>';\n\n return result;\n};\n\n\n/**\n * Renderer.renderInline(tokens, options, env) -> String\n * - tokens (Array): list on block tokens to renter\n * - options (Object): params of parser instance\n * - env (Object): additional data from parsed input (references, for example)\n *\n * The same as [[Renderer.render]], but for single token of `inline` type.\n **/\nRenderer.prototype.renderInline = function (tokens, options, env) {\n var type,\n result = '',\n rules = this.rules;\n\n for (var i = 0, len = tokens.length; i < len; i++) {\n type = tokens[i].type;\n\n if (typeof rules[type] !== 'undefined') {\n result += rules[type](tokens, i, options, env, this);\n } else {\n result += this.renderToken(tokens, i, options);\n }\n }\n\n return result;\n};\n\n\n/** internal\n * Renderer.renderInlineAsText(tokens, options, env) -> String\n * - tokens (Array): list on block tokens to renter\n * - options (Object): params of parser instance\n * - env (Object): additional data from parsed input (references, for example)\n *\n * Special kludge for image `alt` attributes to conform CommonMark spec.\n * Don't try to use it! Spec requires to show `alt` content with stripped markup,\n * instead of simple escaping.\n **/\nRenderer.prototype.renderInlineAsText = function (tokens, options, env) {\n var result = '';\n\n for (var i = 0, len = tokens.length; i < len; i++) {\n if (tokens[i].type === 'text') {\n result += tokens[i].content;\n } else if (tokens[i].type === 'image') {\n result += this.renderInlineAsText(tokens[i].children, options, env);\n }\n }\n\n return result;\n};\n\n\n/**\n * Renderer.render(tokens, options, env) -> String\n * - tokens (Array): list on block tokens to renter\n * - options (Object): params of parser instance\n * - env (Object): additional data from parsed input (references, for example)\n *\n * Takes token stream and generates HTML. Probably, you will never need to call\n * this method directly.\n **/\nRenderer.prototype.render = function (tokens, options, env) {\n var i, len, type,\n result = '',\n rules = this.rules;\n\n for (i = 0, len = tokens.length; i < len; i++) {\n type = tokens[i].type;\n\n if (type === 'inline') {\n result += this.renderInline(tokens[i].children, options, env);\n } else if (typeof rules[type] !== 'undefined') {\n result += rules[tokens[i].type](tokens, i, options, env, this);\n } else {\n result += this.renderToken(tokens, i, options, env);\n }\n }\n\n return result;\n};\n\nmodule.exports = Renderer;\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/renderer.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/ruler.js": +/*!***********************************************!*\ + !*** ./node_modules/markdown-it/lib/ruler.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/**\n * class Ruler\n *\n * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and\n * [[MarkdownIt#inline]] to manage sequences of functions (rules):\n *\n * - keep rules in defined order\n * - assign the name to each rule\n * - enable/disable rules\n * - add/replace rules\n * - allow assign rules to additional named chains (in the same)\n * - cacheing lists of active rules\n *\n * You will not need use this class directly until write plugins. For simple\n * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and\n * [[MarkdownIt.use]].\n **/\n\n\n\n/**\n * new Ruler()\n **/\nfunction Ruler() {\n // List of added rules. Each element is:\n //\n // {\n // name: XXX,\n // enabled: Boolean,\n // fn: Function(),\n // alt: [ name2, name3 ]\n // }\n //\n this.__rules__ = [];\n\n // Cached rule chains.\n //\n // First level - chain name, '' for default.\n // Second level - diginal anchor for fast filtering by charcodes.\n //\n this.__cache__ = null;\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// Helper methods, should not be used directly\n\n\n// Find rule index by name\n//\nRuler.prototype.__find__ = function (name) {\n for (var i = 0; i < this.__rules__.length; i++) {\n if (this.__rules__[i].name === name) {\n return i;\n }\n }\n return -1;\n};\n\n\n// Build rules lookup cache\n//\nRuler.prototype.__compile__ = function () {\n var self = this;\n var chains = [ '' ];\n\n // collect unique names\n self.__rules__.forEach(function (rule) {\n if (!rule.enabled) { return; }\n\n rule.alt.forEach(function (altName) {\n if (chains.indexOf(altName) < 0) {\n chains.push(altName);\n }\n });\n });\n\n self.__cache__ = {};\n\n chains.forEach(function (chain) {\n self.__cache__[chain] = [];\n self.__rules__.forEach(function (rule) {\n if (!rule.enabled) { return; }\n\n if (chain && rule.alt.indexOf(chain) < 0) { return; }\n\n self.__cache__[chain].push(rule.fn);\n });\n });\n};\n\n\n/**\n * Ruler.at(name, fn [, options])\n * - name (String): rule name to replace.\n * - fn (Function): new rule function.\n * - options (Object): new rule options (not mandatory).\n *\n * Replace rule by name with new function & options. Throws error if name not\n * found.\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * Replace existing typographer replacement rule with new one:\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.core.ruler.at('replacements', function replace(state) {\n * //...\n * });\n * ```\n **/\nRuler.prototype.at = function (name, fn, options) {\n var index = this.__find__(name);\n var opt = options || {};\n\n if (index === -1) { throw new Error('Parser rule not found: ' + name); }\n\n this.__rules__[index].fn = fn;\n this.__rules__[index].alt = opt.alt || [];\n this.__cache__ = null;\n};\n\n\n/**\n * Ruler.before(beforeName, ruleName, fn [, options])\n * - beforeName (String): new rule will be added before this one.\n * - ruleName (String): name of added rule.\n * - fn (Function): rule function.\n * - options (Object): rule options (not mandatory).\n *\n * Add new rule to chain before one with given name. See also\n * [[Ruler.after]], [[Ruler.push]].\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {\n * //...\n * });\n * ```\n **/\nRuler.prototype.before = function (beforeName, ruleName, fn, options) {\n var index = this.__find__(beforeName);\n var opt = options || {};\n\n if (index === -1) { throw new Error('Parser rule not found: ' + beforeName); }\n\n this.__rules__.splice(index, 0, {\n name: ruleName,\n enabled: true,\n fn: fn,\n alt: opt.alt || []\n });\n\n this.__cache__ = null;\n};\n\n\n/**\n * Ruler.after(afterName, ruleName, fn [, options])\n * - afterName (String): new rule will be added after this one.\n * - ruleName (String): name of added rule.\n * - fn (Function): rule function.\n * - options (Object): rule options (not mandatory).\n *\n * Add new rule to chain after one with given name. See also\n * [[Ruler.before]], [[Ruler.push]].\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.inline.ruler.after('text', 'my_rule', function replace(state) {\n * //...\n * });\n * ```\n **/\nRuler.prototype.after = function (afterName, ruleName, fn, options) {\n var index = this.__find__(afterName);\n var opt = options || {};\n\n if (index === -1) { throw new Error('Parser rule not found: ' + afterName); }\n\n this.__rules__.splice(index + 1, 0, {\n name: ruleName,\n enabled: true,\n fn: fn,\n alt: opt.alt || []\n });\n\n this.__cache__ = null;\n};\n\n/**\n * Ruler.push(ruleName, fn [, options])\n * - ruleName (String): name of added rule.\n * - fn (Function): rule function.\n * - options (Object): rule options (not mandatory).\n *\n * Push new rule to the end of chain. See also\n * [[Ruler.before]], [[Ruler.after]].\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.core.ruler.push('my_rule', function replace(state) {\n * //...\n * });\n * ```\n **/\nRuler.prototype.push = function (ruleName, fn, options) {\n var opt = options || {};\n\n this.__rules__.push({\n name: ruleName,\n enabled: true,\n fn: fn,\n alt: opt.alt || []\n });\n\n this.__cache__ = null;\n};\n\n\n/**\n * Ruler.enable(list [, ignoreInvalid]) -> Array\n * - list (String|Array): list of rule names to enable.\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Enable rules with given names. If any rule name not found - throw Error.\n * Errors can be disabled by second param.\n *\n * Returns list of found rule names (if no exception happened).\n *\n * See also [[Ruler.disable]], [[Ruler.enableOnly]].\n **/\nRuler.prototype.enable = function (list, ignoreInvalid) {\n if (!Array.isArray(list)) { list = [ list ]; }\n\n var result = [];\n\n // Search by name and enable\n list.forEach(function (name) {\n var idx = this.__find__(name);\n\n if (idx < 0) {\n if (ignoreInvalid) { return; }\n throw new Error('Rules manager: invalid rule name ' + name);\n }\n this.__rules__[idx].enabled = true;\n result.push(name);\n }, this);\n\n this.__cache__ = null;\n return result;\n};\n\n\n/**\n * Ruler.enableOnly(list [, ignoreInvalid])\n * - list (String|Array): list of rule names to enable (whitelist).\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Enable rules with given names, and disable everything else. If any rule name\n * not found - throw Error. Errors can be disabled by second param.\n *\n * See also [[Ruler.disable]], [[Ruler.enable]].\n **/\nRuler.prototype.enableOnly = function (list, ignoreInvalid) {\n if (!Array.isArray(list)) { list = [ list ]; }\n\n this.__rules__.forEach(function (rule) { rule.enabled = false; });\n\n this.enable(list, ignoreInvalid);\n};\n\n\n/**\n * Ruler.disable(list [, ignoreInvalid]) -> Array\n * - list (String|Array): list of rule names to disable.\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Disable rules with given names. If any rule name not found - throw Error.\n * Errors can be disabled by second param.\n *\n * Returns list of found rule names (if no exception happened).\n *\n * See also [[Ruler.enable]], [[Ruler.enableOnly]].\n **/\nRuler.prototype.disable = function (list, ignoreInvalid) {\n if (!Array.isArray(list)) { list = [ list ]; }\n\n var result = [];\n\n // Search by name and disable\n list.forEach(function (name) {\n var idx = this.__find__(name);\n\n if (idx < 0) {\n if (ignoreInvalid) { return; }\n throw new Error('Rules manager: invalid rule name ' + name);\n }\n this.__rules__[idx].enabled = false;\n result.push(name);\n }, this);\n\n this.__cache__ = null;\n return result;\n};\n\n\n/**\n * Ruler.getRules(chainName) -> Array\n *\n * Return array of active functions (rules) for given chain name. It analyzes\n * rules configuration, compiles caches if not exists and returns result.\n *\n * Default chain name is `''` (empty string). It can't be skipped. That's\n * done intentionally, to keep signature monomorphic for high speed.\n **/\nRuler.prototype.getRules = function (chainName) {\n if (this.__cache__ === null) {\n this.__compile__();\n }\n\n // Chain can be empty, if rules disabled. But we still have to return Array.\n return this.__cache__[chainName] || [];\n};\n\nmodule.exports = Ruler;\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/ruler.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_block/blockquote.js": +/*!****************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_block/blockquote.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Block quotes\n\n\n\nvar isSpace = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isSpace;\n\n\nmodule.exports = function blockquote(state, startLine, endLine, silent) {\n var adjustTab,\n ch,\n i,\n initial,\n l,\n lastLineEmpty,\n lines,\n nextLine,\n offset,\n oldBMarks,\n oldBSCount,\n oldIndent,\n oldParentType,\n oldSCount,\n oldTShift,\n spaceAfterMarker,\n terminate,\n terminatorRules,\n token,\n wasOutdented,\n oldLineMax = state.lineMax,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }\n\n // check the block quote marker\n if (state.src.charCodeAt(pos++) !== 0x3E/* > */) { return false; }\n\n // we know that it's going to be a valid blockquote,\n // so no point trying to find the end of it in silent mode\n if (silent) { return true; }\n\n // skip spaces after \">\" and re-calculate offset\n initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);\n\n // skip one optional space after '>'\n if (state.src.charCodeAt(pos) === 0x20 /* space */) {\n // ' > test '\n // ^ -- position start of line here:\n pos++;\n initial++;\n offset++;\n adjustTab = false;\n spaceAfterMarker = true;\n } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {\n spaceAfterMarker = true;\n\n if ((state.bsCount[startLine] + offset) % 4 === 3) {\n // ' >\\t test '\n // ^ -- position start of line here (tab has width===1)\n pos++;\n initial++;\n offset++;\n adjustTab = false;\n } else {\n // ' >\\t test '\n // ^ -- position start of line here + shift bsCount slightly\n // to make extra space appear\n adjustTab = true;\n }\n } else {\n spaceAfterMarker = false;\n }\n\n oldBMarks = [ state.bMarks[startLine] ];\n state.bMarks[startLine] = pos;\n\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n\n pos++;\n }\n\n oldBSCount = [ state.bsCount[startLine] ];\n state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0);\n\n lastLineEmpty = pos >= max;\n\n oldSCount = [ state.sCount[startLine] ];\n state.sCount[startLine] = offset - initial;\n\n oldTShift = [ state.tShift[startLine] ];\n state.tShift[startLine] = pos - state.bMarks[startLine];\n\n terminatorRules = state.md.block.ruler.getRules('blockquote');\n\n oldParentType = state.parentType;\n state.parentType = 'blockquote';\n wasOutdented = false;\n\n // Search the end of the block\n //\n // Block ends with either:\n // 1. an empty line outside:\n // ```\n // > test\n //\n // ```\n // 2. an empty line inside:\n // ```\n // >\n // test\n // ```\n // 3. another tag:\n // ```\n // > test\n // - - -\n // ```\n for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {\n // check if it's outdented, i.e. it's inside list item and indented\n // less than said list item:\n //\n // ```\n // 1. anything\n // > current blockquote\n // 2. checking this line\n // ```\n if (state.sCount[nextLine] < state.blkIndent) wasOutdented = true;\n\n pos = state.bMarks[nextLine] + state.tShift[nextLine];\n max = state.eMarks[nextLine];\n\n if (pos >= max) {\n // Case 1: line is not inside the blockquote, and this line is empty.\n break;\n }\n\n if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !wasOutdented) {\n // This line is inside the blockquote.\n\n // skip spaces after \">\" and re-calculate offset\n initial = offset = state.sCount[nextLine] + pos - (state.bMarks[nextLine] + state.tShift[nextLine]);\n\n // skip one optional space after '>'\n if (state.src.charCodeAt(pos) === 0x20 /* space */) {\n // ' > test '\n // ^ -- position start of line here:\n pos++;\n initial++;\n offset++;\n adjustTab = false;\n spaceAfterMarker = true;\n } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {\n spaceAfterMarker = true;\n\n if ((state.bsCount[nextLine] + offset) % 4 === 3) {\n // ' >\\t test '\n // ^ -- position start of line here (tab has width===1)\n pos++;\n initial++;\n offset++;\n adjustTab = false;\n } else {\n // ' >\\t test '\n // ^ -- position start of line here + shift bsCount slightly\n // to make extra space appear\n adjustTab = true;\n }\n } else {\n spaceAfterMarker = false;\n }\n\n oldBMarks.push(state.bMarks[nextLine]);\n state.bMarks[nextLine] = pos;\n\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n\n pos++;\n }\n\n lastLineEmpty = pos >= max;\n\n oldBSCount.push(state.bsCount[nextLine]);\n state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);\n\n oldSCount.push(state.sCount[nextLine]);\n state.sCount[nextLine] = offset - initial;\n\n oldTShift.push(state.tShift[nextLine]);\n state.tShift[nextLine] = pos - state.bMarks[nextLine];\n continue;\n }\n\n // Case 2: line is not inside the blockquote, and the last line was empty.\n if (lastLineEmpty) { break; }\n\n // Case 3: another tag found.\n terminate = false;\n for (i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n\n if (terminate) {\n // Quirk to enforce \"hard termination mode\" for paragraphs;\n // normally if you call `tokenize(state, startLine, nextLine)`,\n // paragraphs will look below nextLine for paragraph continuation,\n // but if blockquote is terminated by another tag, they shouldn't\n state.lineMax = nextLine;\n\n if (state.blkIndent !== 0) {\n // state.blkIndent was non-zero, we now set it to zero,\n // so we need to re-calculate all offsets to appear as\n // if indent wasn't changed\n oldBMarks.push(state.bMarks[nextLine]);\n oldBSCount.push(state.bsCount[nextLine]);\n oldTShift.push(state.tShift[nextLine]);\n oldSCount.push(state.sCount[nextLine]);\n state.sCount[nextLine] -= state.blkIndent;\n }\n\n break;\n }\n\n oldBMarks.push(state.bMarks[nextLine]);\n oldBSCount.push(state.bsCount[nextLine]);\n oldTShift.push(state.tShift[nextLine]);\n oldSCount.push(state.sCount[nextLine]);\n\n // A negative indentation means that this is a paragraph continuation\n //\n state.sCount[nextLine] = -1;\n }\n\n oldIndent = state.blkIndent;\n state.blkIndent = 0;\n\n token = state.push('blockquote_open', 'blockquote', 1);\n token.markup = '>';\n token.map = lines = [ startLine, 0 ];\n\n state.md.block.tokenize(state, startLine, nextLine);\n\n token = state.push('blockquote_close', 'blockquote', -1);\n token.markup = '>';\n\n state.lineMax = oldLineMax;\n state.parentType = oldParentType;\n lines[1] = state.line;\n\n // Restore original tShift; this might not be necessary since the parser\n // has already been here, but just to make sure we can do that.\n for (i = 0; i < oldTShift.length; i++) {\n state.bMarks[i + startLine] = oldBMarks[i];\n state.tShift[i + startLine] = oldTShift[i];\n state.sCount[i + startLine] = oldSCount[i];\n state.bsCount[i + startLine] = oldBSCount[i];\n }\n state.blkIndent = oldIndent;\n\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_block/blockquote.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_block/code.js": +/*!**********************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_block/code.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Code block (4 spaces padded)\n\n\n\n\nmodule.exports = function code(state, startLine, endLine/*, silent*/) {\n var nextLine, last, token;\n\n if (state.sCount[startLine] - state.blkIndent < 4) { return false; }\n\n last = nextLine = startLine + 1;\n\n while (nextLine < endLine) {\n if (state.isEmpty(nextLine)) {\n nextLine++;\n continue;\n }\n\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n nextLine++;\n last = nextLine;\n continue;\n }\n break;\n }\n\n state.line = last;\n\n token = state.push('code_block', 'code', 0);\n token.content = state.getLines(startLine, last, 4 + state.blkIndent, true);\n token.map = [ startLine, state.line ];\n\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_block/code.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_block/fence.js": +/*!***********************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_block/fence.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// fences (``` lang, ~~~ lang)\n\n\n\n\nmodule.exports = function fence(state, startLine, endLine, silent) {\n var marker, len, params, nextLine, mem, token, markup,\n haveEndMarker = false,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }\n\n if (pos + 3 > max) { return false; }\n\n marker = state.src.charCodeAt(pos);\n\n if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {\n return false;\n }\n\n // scan marker length\n mem = pos;\n pos = state.skipChars(pos, marker);\n\n len = pos - mem;\n\n if (len < 3) { return false; }\n\n markup = state.src.slice(mem, pos);\n params = state.src.slice(pos, max);\n\n if (marker === 0x60 /* ` */) {\n if (params.indexOf(String.fromCharCode(marker)) >= 0) {\n return false;\n }\n }\n\n // Since start is found, we can report success here in validation mode\n if (silent) { return true; }\n\n // search end of block\n nextLine = startLine;\n\n for (;;) {\n nextLine++;\n if (nextLine >= endLine) {\n // unclosed block should be autoclosed by end of document.\n // also block seems to be autoclosed by end of parent\n break;\n }\n\n pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];\n max = state.eMarks[nextLine];\n\n if (pos < max && state.sCount[nextLine] < state.blkIndent) {\n // non-empty line with negative indent should stop the list:\n // - ```\n // test\n break;\n }\n\n if (state.src.charCodeAt(pos) !== marker) { continue; }\n\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n // closing fence should be indented less than 4 spaces\n continue;\n }\n\n pos = state.skipChars(pos, marker);\n\n // closing code fence must be at least as long as the opening one\n if (pos - mem < len) { continue; }\n\n // make sure tail has spaces only\n pos = state.skipSpaces(pos);\n\n if (pos < max) { continue; }\n\n haveEndMarker = true;\n // found!\n break;\n }\n\n // If a fence has heading spaces, they should be removed from its inner block\n len = state.sCount[startLine];\n\n state.line = nextLine + (haveEndMarker ? 1 : 0);\n\n token = state.push('fence', 'code', 0);\n token.info = params;\n token.content = state.getLines(startLine + 1, nextLine, len, true);\n token.markup = markup;\n token.map = [ startLine, state.line ];\n\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_block/fence.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_block/heading.js": +/*!*************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_block/heading.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// heading (#, ##, ...)\n\n\n\nvar isSpace = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isSpace;\n\n\nmodule.exports = function heading(state, startLine, endLine, silent) {\n var ch, level, tmp, token,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }\n\n ch = state.src.charCodeAt(pos);\n\n if (ch !== 0x23/* # */ || pos >= max) { return false; }\n\n // count heading level\n level = 1;\n ch = state.src.charCodeAt(++pos);\n while (ch === 0x23/* # */ && pos < max && level <= 6) {\n level++;\n ch = state.src.charCodeAt(++pos);\n }\n\n if (level > 6 || (pos < max && !isSpace(ch))) { return false; }\n\n if (silent) { return true; }\n\n // Let's cut tails like ' ### ' from the end of string\n\n max = state.skipSpacesBack(max, pos);\n tmp = state.skipCharsBack(max, 0x23, pos); // #\n if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {\n max = tmp;\n }\n\n state.line = startLine + 1;\n\n token = state.push('heading_open', 'h' + String(level), 1);\n token.markup = '########'.slice(0, level);\n token.map = [ startLine, state.line ];\n\n token = state.push('inline', '', 0);\n token.content = state.src.slice(pos, max).trim();\n token.map = [ startLine, state.line ];\n token.children = [];\n\n token = state.push('heading_close', 'h' + String(level), -1);\n token.markup = '########'.slice(0, level);\n\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_block/heading.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_block/hr.js": +/*!********************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_block/hr.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Horizontal rule\n\n\n\nvar isSpace = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isSpace;\n\n\nmodule.exports = function hr(state, startLine, endLine, silent) {\n var marker, cnt, ch, token,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }\n\n marker = state.src.charCodeAt(pos++);\n\n // Check hr marker\n if (marker !== 0x2A/* * */ &&\n marker !== 0x2D/* - */ &&\n marker !== 0x5F/* _ */) {\n return false;\n }\n\n // markers can be mixed with spaces, but there should be at least 3 of them\n\n cnt = 1;\n while (pos < max) {\n ch = state.src.charCodeAt(pos++);\n if (ch !== marker && !isSpace(ch)) { return false; }\n if (ch === marker) { cnt++; }\n }\n\n if (cnt < 3) { return false; }\n\n if (silent) { return true; }\n\n state.line = startLine + 1;\n\n token = state.push('hr', 'hr', 0);\n token.map = [ startLine, state.line ];\n token.markup = Array(cnt + 1).join(String.fromCharCode(marker));\n\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_block/hr.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_block/html_block.js": +/*!****************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_block/html_block.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// HTML block\n\n\n\n\nvar block_names = __webpack_require__(/*! ../common/html_blocks */ \"./node_modules/markdown-it/lib/common/html_blocks.js\");\nvar HTML_OPEN_CLOSE_TAG_RE = __webpack_require__(/*! ../common/html_re */ \"./node_modules/markdown-it/lib/common/html_re.js\").HTML_OPEN_CLOSE_TAG_RE;\n\n// An array of opening and corresponding closing sequences for html tags,\n// last argument defines whether it can terminate a paragraph or not\n//\nvar HTML_SEQUENCES = [\n [ /^<(script|pre|style)(?=(\\s|>|$))/i, /<\\/(script|pre|style)>/i, true ],\n [ /^/, true ],\n [ /^<\\?/, /\\?>/, true ],\n [ /^/, true ],\n [ /^/, true ],\n [ new RegExp('^|$))', 'i'), /^$/, true ],\n [ new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\\\s*$'), /^$/, false ]\n];\n\n\nmodule.exports = function html_block(state, startLine, endLine, silent) {\n var i, nextLine, token, lineText,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }\n\n if (!state.md.options.html) { return false; }\n\n if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }\n\n lineText = state.src.slice(pos, max);\n\n for (i = 0; i < HTML_SEQUENCES.length; i++) {\n if (HTML_SEQUENCES[i][0].test(lineText)) { break; }\n }\n\n if (i === HTML_SEQUENCES.length) { return false; }\n\n if (silent) {\n // true if this sequence can be a terminator, false otherwise\n return HTML_SEQUENCES[i][2];\n }\n\n nextLine = startLine + 1;\n\n // If we are here - we detected HTML block.\n // Let's roll down till block end.\n if (!HTML_SEQUENCES[i][1].test(lineText)) {\n for (; nextLine < endLine; nextLine++) {\n if (state.sCount[nextLine] < state.blkIndent) { break; }\n\n pos = state.bMarks[nextLine] + state.tShift[nextLine];\n max = state.eMarks[nextLine];\n lineText = state.src.slice(pos, max);\n\n if (HTML_SEQUENCES[i][1].test(lineText)) {\n if (lineText.length !== 0) { nextLine++; }\n break;\n }\n }\n }\n\n state.line = nextLine;\n\n token = state.push('html_block', '', 0);\n token.map = [ startLine, nextLine ];\n token.content = state.getLines(startLine, nextLine, state.blkIndent, true);\n\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_block/html_block.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_block/lheading.js": +/*!**************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_block/lheading.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// lheading (---, ===)\n\n\n\n\nmodule.exports = function lheading(state, startLine, endLine/*, silent*/) {\n var content, terminate, i, l, token, pos, max, level, marker,\n nextLine = startLine + 1, oldParentType,\n terminatorRules = state.md.block.ruler.getRules('paragraph');\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }\n\n oldParentType = state.parentType;\n state.parentType = 'paragraph'; // use paragraph to match terminatorRules\n\n // jump line-by-line until empty one or EOF\n for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }\n\n //\n // Check for underline in setext header\n //\n if (state.sCount[nextLine] >= state.blkIndent) {\n pos = state.bMarks[nextLine] + state.tShift[nextLine];\n max = state.eMarks[nextLine];\n\n if (pos < max) {\n marker = state.src.charCodeAt(pos);\n\n if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {\n pos = state.skipChars(pos, marker);\n pos = state.skipSpaces(pos);\n\n if (pos >= max) {\n level = (marker === 0x3D/* = */ ? 1 : 2);\n break;\n }\n }\n }\n }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { continue; }\n\n // Some tags can terminate paragraph without empty line.\n terminate = false;\n for (i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n if (terminate) { break; }\n }\n\n if (!level) {\n // Didn't find valid underline\n return false;\n }\n\n content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();\n\n state.line = nextLine + 1;\n\n token = state.push('heading_open', 'h' + String(level), 1);\n token.markup = String.fromCharCode(marker);\n token.map = [ startLine, state.line ];\n\n token = state.push('inline', '', 0);\n token.content = content;\n token.map = [ startLine, state.line - 1 ];\n token.children = [];\n\n token = state.push('heading_close', 'h' + String(level), -1);\n token.markup = String.fromCharCode(marker);\n\n state.parentType = oldParentType;\n\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_block/lheading.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_block/list.js": +/*!**********************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_block/list.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Lists\n\n\n\nvar isSpace = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isSpace;\n\n\n// Search `[-+*][\\n ]`, returns next pos after marker on success\n// or -1 on fail.\nfunction skipBulletListMarker(state, startLine) {\n var marker, pos, max, ch;\n\n pos = state.bMarks[startLine] + state.tShift[startLine];\n max = state.eMarks[startLine];\n\n marker = state.src.charCodeAt(pos++);\n // Check bullet\n if (marker !== 0x2A/* * */ &&\n marker !== 0x2D/* - */ &&\n marker !== 0x2B/* + */) {\n return -1;\n }\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" -test \" - is not a list item\n return -1;\n }\n }\n\n return pos;\n}\n\n// Search `\\d+[.)][\\n ]`, returns next pos after marker on success\n// or -1 on fail.\nfunction skipOrderedListMarker(state, startLine) {\n var ch,\n start = state.bMarks[startLine] + state.tShift[startLine],\n pos = start,\n max = state.eMarks[startLine];\n\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }\n\n for (;;) {\n // EOL -> fail\n if (pos >= max) { return -1; }\n\n ch = state.src.charCodeAt(pos++);\n\n if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {\n\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) { return -1; }\n\n continue;\n }\n\n // found valid marker\n if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {\n break;\n }\n\n return -1;\n }\n\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n}\n\nfunction markTightParagraphs(state, idx) {\n var i, l,\n level = state.level + 2;\n\n for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) {\n if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {\n state.tokens[i + 2].hidden = true;\n state.tokens[i].hidden = true;\n i += 2;\n }\n }\n}\n\n\nmodule.exports = function list(state, startLine, endLine, silent) {\n var ch,\n contentStart,\n i,\n indent,\n indentAfterMarker,\n initial,\n isOrdered,\n itemLines,\n l,\n listLines,\n listTokIdx,\n markerCharCode,\n markerValue,\n max,\n nextLine,\n offset,\n oldListIndent,\n oldParentType,\n oldSCount,\n oldTShift,\n oldTight,\n pos,\n posAfterMarker,\n prevEmptyEnd,\n start,\n terminate,\n terminatorRules,\n token,\n isTerminatingParagraph = false,\n tight = true;\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }\n\n // Special case:\n // - item 1\n // - item 2\n // - item 3\n // - item 4\n // - this one is a paragraph continuation\n if (state.listIndent >= 0 &&\n state.sCount[startLine] - state.listIndent >= 4 &&\n state.sCount[startLine] < state.blkIndent) {\n return false;\n }\n\n // limit conditions when list can interrupt\n // a paragraph (validation mode only)\n if (silent && state.parentType === 'paragraph') {\n // Next list item should still terminate previous list item;\n //\n // This code can fail if plugins use blkIndent as well as lists,\n // but I hope the spec gets fixed long before that happens.\n //\n if (state.tShift[startLine] >= state.blkIndent) {\n isTerminatingParagraph = true;\n }\n }\n\n // Detect list type and position after marker\n if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) {\n isOrdered = true;\n start = state.bMarks[startLine] + state.tShift[startLine];\n markerValue = Number(state.src.substr(start, posAfterMarker - start - 1));\n\n // If we're starting a new ordered list right after\n // a paragraph, it should start with 1.\n if (isTerminatingParagraph && markerValue !== 1) return false;\n\n } else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) {\n isOrdered = false;\n\n } else {\n return false;\n }\n\n // If we're starting a new unordered list right after\n // a paragraph, first line should not be empty.\n if (isTerminatingParagraph) {\n if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine]) return false;\n }\n\n // We should terminate list on style change. Remember first one to compare.\n markerCharCode = state.src.charCodeAt(posAfterMarker - 1);\n\n // For validation mode we can terminate immediately\n if (silent) { return true; }\n\n // Start list\n listTokIdx = state.tokens.length;\n\n if (isOrdered) {\n token = state.push('ordered_list_open', 'ol', 1);\n if (markerValue !== 1) {\n token.attrs = [ [ 'start', markerValue ] ];\n }\n\n } else {\n token = state.push('bullet_list_open', 'ul', 1);\n }\n\n token.map = listLines = [ startLine, 0 ];\n token.markup = String.fromCharCode(markerCharCode);\n\n //\n // Iterate list items\n //\n\n nextLine = startLine;\n prevEmptyEnd = false;\n terminatorRules = state.md.block.ruler.getRules('list');\n\n oldParentType = state.parentType;\n state.parentType = 'list';\n\n while (nextLine < endLine) {\n pos = posAfterMarker;\n max = state.eMarks[nextLine];\n\n initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]);\n\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (ch === 0x09) {\n offset += 4 - (offset + state.bsCount[nextLine]) % 4;\n } else if (ch === 0x20) {\n offset++;\n } else {\n break;\n }\n\n pos++;\n }\n\n contentStart = pos;\n\n if (contentStart >= max) {\n // trimming space in \"- \\n 3\" case, indent is 1 here\n indentAfterMarker = 1;\n } else {\n indentAfterMarker = offset - initial;\n }\n\n // If we have more than 4 spaces, the indent is 1\n // (the rest is just indented code block)\n if (indentAfterMarker > 4) { indentAfterMarker = 1; }\n\n // \" - test\"\n // ^^^^^ - calculating total length of this thing\n indent = initial + indentAfterMarker;\n\n // Run subparser & write tokens\n token = state.push('list_item_open', 'li', 1);\n token.markup = String.fromCharCode(markerCharCode);\n token.map = itemLines = [ startLine, 0 ];\n\n // change current state, then restore it after parser subcall\n oldTight = state.tight;\n oldTShift = state.tShift[startLine];\n oldSCount = state.sCount[startLine];\n\n // - example list\n // ^ listIndent position will be here\n // ^ blkIndent position will be here\n //\n oldListIndent = state.listIndent;\n state.listIndent = state.blkIndent;\n state.blkIndent = indent;\n\n state.tight = true;\n state.tShift[startLine] = contentStart - state.bMarks[startLine];\n state.sCount[startLine] = offset;\n\n if (contentStart >= max && state.isEmpty(startLine + 1)) {\n // workaround for this case\n // (list item is empty, list terminates before \"foo\"):\n // ~~~~~~~~\n // -\n //\n // foo\n // ~~~~~~~~\n state.line = Math.min(state.line + 2, endLine);\n } else {\n state.md.block.tokenize(state, startLine, endLine, true);\n }\n\n // If any of list item is tight, mark list as tight\n if (!state.tight || prevEmptyEnd) {\n tight = false;\n }\n // Item become loose if finish with empty line,\n // but we should filter last element, because it means list finish\n prevEmptyEnd = (state.line - startLine) > 1 && state.isEmpty(state.line - 1);\n\n state.blkIndent = state.listIndent;\n state.listIndent = oldListIndent;\n state.tShift[startLine] = oldTShift;\n state.sCount[startLine] = oldSCount;\n state.tight = oldTight;\n\n token = state.push('list_item_close', 'li', -1);\n token.markup = String.fromCharCode(markerCharCode);\n\n nextLine = startLine = state.line;\n itemLines[1] = nextLine;\n contentStart = state.bMarks[startLine];\n\n if (nextLine >= endLine) { break; }\n\n //\n // Try to check if list is terminated or continued.\n //\n if (state.sCount[nextLine] < state.blkIndent) { break; }\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { break; }\n\n // fail if terminating block found\n terminate = false;\n for (i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n if (terminate) { break; }\n\n // fail if list has another type\n if (isOrdered) {\n posAfterMarker = skipOrderedListMarker(state, nextLine);\n if (posAfterMarker < 0) { break; }\n } else {\n posAfterMarker = skipBulletListMarker(state, nextLine);\n if (posAfterMarker < 0) { break; }\n }\n\n if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break; }\n }\n\n // Finalize list\n if (isOrdered) {\n token = state.push('ordered_list_close', 'ol', -1);\n } else {\n token = state.push('bullet_list_close', 'ul', -1);\n }\n token.markup = String.fromCharCode(markerCharCode);\n\n listLines[1] = nextLine;\n state.line = nextLine;\n\n state.parentType = oldParentType;\n\n // mark paragraphs tight if needed\n if (tight) {\n markTightParagraphs(state, listTokIdx);\n }\n\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_block/list.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_block/paragraph.js": +/*!***************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_block/paragraph.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Paragraph\n\n\n\n\nmodule.exports = function paragraph(state, startLine/*, endLine*/) {\n var content, terminate, i, l, token, oldParentType,\n nextLine = startLine + 1,\n terminatorRules = state.md.block.ruler.getRules('paragraph'),\n endLine = state.lineMax;\n\n oldParentType = state.parentType;\n state.parentType = 'paragraph';\n\n // jump line-by-line until empty one or EOF\n for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { continue; }\n\n // Some tags can terminate paragraph without empty line.\n terminate = false;\n for (i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n if (terminate) { break; }\n }\n\n content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();\n\n state.line = nextLine;\n\n token = state.push('paragraph_open', 'p', 1);\n token.map = [ startLine, state.line ];\n\n token = state.push('inline', '', 0);\n token.content = content;\n token.map = [ startLine, state.line ];\n token.children = [];\n\n token = state.push('paragraph_close', 'p', -1);\n\n state.parentType = oldParentType;\n\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_block/paragraph.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_block/reference.js": +/*!***************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_block/reference.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n\nvar normalizeReference = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").normalizeReference;\nvar isSpace = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isSpace;\n\n\nmodule.exports = function reference(state, startLine, _endLine, silent) {\n var ch,\n destEndPos,\n destEndLineNo,\n endLine,\n href,\n i,\n l,\n label,\n labelEnd,\n oldParentType,\n res,\n start,\n str,\n terminate,\n terminatorRules,\n title,\n lines = 0,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine],\n nextLine = startLine + 1;\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }\n\n if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false; }\n\n // Simple check to quickly interrupt scan on [link](url) at the start of line.\n // Can be useful on practice: https://github.com/markdown-it/markdown-it/issues/54\n while (++pos < max) {\n if (state.src.charCodeAt(pos) === 0x5D /* ] */ &&\n state.src.charCodeAt(pos - 1) !== 0x5C/* \\ */) {\n if (pos + 1 === max) { return false; }\n if (state.src.charCodeAt(pos + 1) !== 0x3A/* : */) { return false; }\n break;\n }\n }\n\n endLine = state.lineMax;\n\n // jump line-by-line until empty one or EOF\n terminatorRules = state.md.block.ruler.getRules('reference');\n\n oldParentType = state.parentType;\n state.parentType = 'reference';\n\n for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }\n\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) { continue; }\n\n // Some tags can terminate paragraph without empty line.\n terminate = false;\n for (i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n if (terminate) { break; }\n }\n\n str = state.getLines(startLine, nextLine, state.blkIndent, false).trim();\n max = str.length;\n\n for (pos = 1; pos < max; pos++) {\n ch = str.charCodeAt(pos);\n if (ch === 0x5B /* [ */) {\n return false;\n } else if (ch === 0x5D /* ] */) {\n labelEnd = pos;\n break;\n } else if (ch === 0x0A /* \\n */) {\n lines++;\n } else if (ch === 0x5C /* \\ */) {\n pos++;\n if (pos < max && str.charCodeAt(pos) === 0x0A) {\n lines++;\n }\n }\n }\n\n if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false; }\n\n // [label]: destination 'title'\n // ^^^ skip optional whitespace here\n for (pos = labelEnd + 2; pos < max; pos++) {\n ch = str.charCodeAt(pos);\n if (ch === 0x0A) {\n lines++;\n } else if (isSpace(ch)) {\n /*eslint no-empty:0*/\n } else {\n break;\n }\n }\n\n // [label]: destination 'title'\n // ^^^^^^^^^^^ parse this\n res = state.md.helpers.parseLinkDestination(str, pos, max);\n if (!res.ok) { return false; }\n\n href = state.md.normalizeLink(res.str);\n if (!state.md.validateLink(href)) { return false; }\n\n pos = res.pos;\n lines += res.lines;\n\n // save cursor state, we could require to rollback later\n destEndPos = pos;\n destEndLineNo = lines;\n\n // [label]: destination 'title'\n // ^^^ skipping those spaces\n start = pos;\n for (; pos < max; pos++) {\n ch = str.charCodeAt(pos);\n if (ch === 0x0A) {\n lines++;\n } else if (isSpace(ch)) {\n /*eslint no-empty:0*/\n } else {\n break;\n }\n }\n\n // [label]: destination 'title'\n // ^^^^^^^ parse this\n res = state.md.helpers.parseLinkTitle(str, pos, max);\n if (pos < max && start !== pos && res.ok) {\n title = res.str;\n pos = res.pos;\n lines += res.lines;\n } else {\n title = '';\n pos = destEndPos;\n lines = destEndLineNo;\n }\n\n // skip trailing spaces until the rest of the line\n while (pos < max) {\n ch = str.charCodeAt(pos);\n if (!isSpace(ch)) { break; }\n pos++;\n }\n\n if (pos < max && str.charCodeAt(pos) !== 0x0A) {\n if (title) {\n // garbage at the end of the line after title,\n // but it could still be a valid reference if we roll back\n title = '';\n pos = destEndPos;\n lines = destEndLineNo;\n while (pos < max) {\n ch = str.charCodeAt(pos);\n if (!isSpace(ch)) { break; }\n pos++;\n }\n }\n }\n\n if (pos < max && str.charCodeAt(pos) !== 0x0A) {\n // garbage at the end of the line\n return false;\n }\n\n label = normalizeReference(str.slice(1, labelEnd));\n if (!label) {\n // CommonMark 0.20 disallows empty labels\n return false;\n }\n\n // Reference can not terminate anything. This check is for safety only.\n /*istanbul ignore if*/\n if (silent) { return true; }\n\n if (typeof state.env.references === 'undefined') {\n state.env.references = {};\n }\n if (typeof state.env.references[label] === 'undefined') {\n state.env.references[label] = { title: title, href: href };\n }\n\n state.parentType = oldParentType;\n\n state.line = startLine + lines + 1;\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_block/reference.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_block/state_block.js": +/*!*****************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_block/state_block.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Parser state class\n\n\n\nvar Token = __webpack_require__(/*! ../token */ \"./node_modules/markdown-it/lib/token.js\");\nvar isSpace = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isSpace;\n\n\nfunction StateBlock(src, md, env, tokens) {\n var ch, s, start, pos, len, indent, offset, indent_found;\n\n this.src = src;\n\n // link to parser instance\n this.md = md;\n\n this.env = env;\n\n //\n // Internal state vartiables\n //\n\n this.tokens = tokens;\n\n this.bMarks = []; // line begin offsets for fast jumps\n this.eMarks = []; // line end offsets for fast jumps\n this.tShift = []; // offsets of the first non-space characters (tabs not expanded)\n this.sCount = []; // indents for each line (tabs expanded)\n\n // An amount of virtual spaces (tabs expanded) between beginning\n // of each line (bMarks) and real beginning of that line.\n //\n // It exists only as a hack because blockquotes override bMarks\n // losing information in the process.\n //\n // It's used only when expanding tabs, you can think about it as\n // an initial tab length, e.g. bsCount=21 applied to string `\\t123`\n // means first tab should be expanded to 4-21%4 === 3 spaces.\n //\n this.bsCount = [];\n\n // block parser variables\n this.blkIndent = 0; // required block content indent (for example, if we are\n // inside a list, it would be positioned after list marker)\n this.line = 0; // line index in src\n this.lineMax = 0; // lines count\n this.tight = false; // loose/tight mode for lists\n this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any)\n this.listIndent = -1; // indent of the current list block (-1 if there isn't any)\n\n // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'\n // used in lists to determine if they interrupt a paragraph\n this.parentType = 'root';\n\n this.level = 0;\n\n // renderer\n this.result = '';\n\n // Create caches\n // Generate markers.\n s = this.src;\n indent_found = false;\n\n for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) {\n ch = s.charCodeAt(pos);\n\n if (!indent_found) {\n if (isSpace(ch)) {\n indent++;\n\n if (ch === 0x09) {\n offset += 4 - offset % 4;\n } else {\n offset++;\n }\n continue;\n } else {\n indent_found = true;\n }\n }\n\n if (ch === 0x0A || pos === len - 1) {\n if (ch !== 0x0A) { pos++; }\n this.bMarks.push(start);\n this.eMarks.push(pos);\n this.tShift.push(indent);\n this.sCount.push(offset);\n this.bsCount.push(0);\n\n indent_found = false;\n indent = 0;\n offset = 0;\n start = pos + 1;\n }\n }\n\n // Push fake entry to simplify cache bounds checks\n this.bMarks.push(s.length);\n this.eMarks.push(s.length);\n this.tShift.push(0);\n this.sCount.push(0);\n this.bsCount.push(0);\n\n this.lineMax = this.bMarks.length - 1; // don't count last fake line\n}\n\n// Push new token to \"stream\".\n//\nStateBlock.prototype.push = function (type, tag, nesting) {\n var token = new Token(type, tag, nesting);\n token.block = true;\n\n if (nesting < 0) this.level--; // closing tag\n token.level = this.level;\n if (nesting > 0) this.level++; // opening tag\n\n this.tokens.push(token);\n return token;\n};\n\nStateBlock.prototype.isEmpty = function isEmpty(line) {\n return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];\n};\n\nStateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {\n for (var max = this.lineMax; from < max; from++) {\n if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {\n break;\n }\n }\n return from;\n};\n\n// Skip spaces from given position.\nStateBlock.prototype.skipSpaces = function skipSpaces(pos) {\n var ch;\n\n for (var max = this.src.length; pos < max; pos++) {\n ch = this.src.charCodeAt(pos);\n if (!isSpace(ch)) { break; }\n }\n return pos;\n};\n\n// Skip spaces from given position in reverse.\nStateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {\n if (pos <= min) { return pos; }\n\n while (pos > min) {\n if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1; }\n }\n return pos;\n};\n\n// Skip char codes from given position\nStateBlock.prototype.skipChars = function skipChars(pos, code) {\n for (var max = this.src.length; pos < max; pos++) {\n if (this.src.charCodeAt(pos) !== code) { break; }\n }\n return pos;\n};\n\n// Skip char codes reverse from given position - 1\nStateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) {\n if (pos <= min) { return pos; }\n\n while (pos > min) {\n if (code !== this.src.charCodeAt(--pos)) { return pos + 1; }\n }\n return pos;\n};\n\n// cut lines range from source.\nStateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) {\n var i, lineIndent, ch, first, last, queue, lineStart,\n line = begin;\n\n if (begin >= end) {\n return '';\n }\n\n queue = new Array(end - begin);\n\n for (i = 0; line < end; line++, i++) {\n lineIndent = 0;\n lineStart = first = this.bMarks[line];\n\n if (line + 1 < end || keepLastLF) {\n // No need for bounds check because we have fake entry on tail.\n last = this.eMarks[line] + 1;\n } else {\n last = this.eMarks[line];\n }\n\n while (first < last && lineIndent < indent) {\n ch = this.src.charCodeAt(first);\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;\n } else {\n lineIndent++;\n }\n } else if (first - lineStart < this.tShift[line]) {\n // patched tShift masked characters to look like spaces (blockquotes, list markers)\n lineIndent++;\n } else {\n break;\n }\n\n first++;\n }\n\n if (lineIndent > indent) {\n // partially expanding tabs in code blocks, e.g '\\t\\tfoobar'\n // with indent=2 becomes ' \\tfoobar'\n queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last);\n } else {\n queue[i] = this.src.slice(first, last);\n }\n }\n\n return queue.join('');\n};\n\n// re-export Token class to use in block rules\nStateBlock.prototype.Token = Token;\n\n\nmodule.exports = StateBlock;\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_block/state_block.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_block/table.js": +/*!***********************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_block/table.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// GFM table, non-standard\n\n\n\nvar isSpace = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isSpace;\n\n\nfunction getLine(state, line) {\n var pos = state.bMarks[line] + state.blkIndent,\n max = state.eMarks[line];\n\n return state.src.substr(pos, max - pos);\n}\n\nfunction escapedSplit(str) {\n var result = [],\n pos = 0,\n max = str.length,\n ch,\n escapes = 0,\n lastPos = 0,\n backTicked = false,\n lastBackTick = 0;\n\n ch = str.charCodeAt(pos);\n\n while (pos < max) {\n if (ch === 0x60/* ` */) {\n if (backTicked) {\n // make \\` close code sequence, but not open it;\n // the reason is: `\\` is correct code block\n backTicked = false;\n lastBackTick = pos;\n } else if (escapes % 2 === 0) {\n backTicked = true;\n lastBackTick = pos;\n }\n } else if (ch === 0x7c/* | */ && (escapes % 2 === 0) && !backTicked) {\n result.push(str.substring(lastPos, pos));\n lastPos = pos + 1;\n }\n\n if (ch === 0x5c/* \\ */) {\n escapes++;\n } else {\n escapes = 0;\n }\n\n pos++;\n\n // If there was an un-closed backtick, go back to just after\n // the last backtick, but as if it was a normal character\n if (pos === max && backTicked) {\n backTicked = false;\n pos = lastBackTick + 1;\n }\n\n ch = str.charCodeAt(pos);\n }\n\n result.push(str.substring(lastPos));\n\n return result;\n}\n\n\nmodule.exports = function table(state, startLine, endLine, silent) {\n var ch, lineText, pos, i, nextLine, columns, columnCount, token,\n aligns, t, tableLines, tbodyLines;\n\n // should have at least two lines\n if (startLine + 2 > endLine) { return false; }\n\n nextLine = startLine + 1;\n\n if (state.sCount[nextLine] < state.blkIndent) { return false; }\n\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) { return false; }\n\n // first character of the second line should be '|', '-', ':',\n // and no other characters are allowed but spaces;\n // basically, this is the equivalent of /^[-:|][-:|\\s]*$/ regexp\n\n pos = state.bMarks[nextLine] + state.tShift[nextLine];\n if (pos >= state.eMarks[nextLine]) { return false; }\n\n ch = state.src.charCodeAt(pos++);\n if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */) { return false; }\n\n while (pos < state.eMarks[nextLine]) {\n ch = state.src.charCodeAt(pos);\n\n if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */ && !isSpace(ch)) { return false; }\n\n pos++;\n }\n\n lineText = getLine(state, startLine + 1);\n\n columns = lineText.split('|');\n aligns = [];\n for (i = 0; i < columns.length; i++) {\n t = columns[i].trim();\n if (!t) {\n // allow empty columns before and after table, but not in between columns;\n // e.g. allow ` |---| `, disallow ` ---||--- `\n if (i === 0 || i === columns.length - 1) {\n continue;\n } else {\n return false;\n }\n }\n\n if (!/^:?-+:?$/.test(t)) { return false; }\n if (t.charCodeAt(t.length - 1) === 0x3A/* : */) {\n aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right');\n } else if (t.charCodeAt(0) === 0x3A/* : */) {\n aligns.push('left');\n } else {\n aligns.push('');\n }\n }\n\n lineText = getLine(state, startLine).trim();\n if (lineText.indexOf('|') === -1) { return false; }\n if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }\n columns = escapedSplit(lineText.replace(/^\\||\\|$/g, ''));\n\n // header row will define an amount of columns in the entire table,\n // and align row shouldn't be smaller than that (the rest of the rows can)\n columnCount = columns.length;\n if (columnCount > aligns.length) { return false; }\n\n if (silent) { return true; }\n\n token = state.push('table_open', 'table', 1);\n token.map = tableLines = [ startLine, 0 ];\n\n token = state.push('thead_open', 'thead', 1);\n token.map = [ startLine, startLine + 1 ];\n\n token = state.push('tr_open', 'tr', 1);\n token.map = [ startLine, startLine + 1 ];\n\n for (i = 0; i < columns.length; i++) {\n token = state.push('th_open', 'th', 1);\n token.map = [ startLine, startLine + 1 ];\n if (aligns[i]) {\n token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];\n }\n\n token = state.push('inline', '', 0);\n token.content = columns[i].trim();\n token.map = [ startLine, startLine + 1 ];\n token.children = [];\n\n token = state.push('th_close', 'th', -1);\n }\n\n token = state.push('tr_close', 'tr', -1);\n token = state.push('thead_close', 'thead', -1);\n\n token = state.push('tbody_open', 'tbody', 1);\n token.map = tbodyLines = [ startLine + 2, 0 ];\n\n for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {\n if (state.sCount[nextLine] < state.blkIndent) { break; }\n\n lineText = getLine(state, nextLine).trim();\n if (lineText.indexOf('|') === -1) { break; }\n if (state.sCount[nextLine] - state.blkIndent >= 4) { break; }\n columns = escapedSplit(lineText.replace(/^\\||\\|$/g, ''));\n\n token = state.push('tr_open', 'tr', 1);\n for (i = 0; i < columnCount; i++) {\n token = state.push('td_open', 'td', 1);\n if (aligns[i]) {\n token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];\n }\n\n token = state.push('inline', '', 0);\n token.content = columns[i] ? columns[i].trim() : '';\n token.children = [];\n\n token = state.push('td_close', 'td', -1);\n }\n token = state.push('tr_close', 'tr', -1);\n }\n token = state.push('tbody_close', 'tbody', -1);\n token = state.push('table_close', 'table', -1);\n\n tableLines[1] = tbodyLines[1] = nextLine;\n state.line = nextLine;\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_block/table.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_core/block.js": +/*!**********************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_core/block.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n\nmodule.exports = function block(state) {\n var token;\n\n if (state.inlineMode) {\n token = new state.Token('inline', '', 0);\n token.content = state.src;\n token.map = [ 0, 1 ];\n token.children = [];\n state.tokens.push(token);\n } else {\n state.md.block.parse(state.src, state.md, state.env, state.tokens);\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_core/block.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_core/inline.js": +/*!***********************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_core/inline.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nmodule.exports = function inline(state) {\n var tokens = state.tokens, tok, i, l;\n\n // Parse inlines\n for (i = 0, l = tokens.length; i < l; i++) {\n tok = tokens[i];\n if (tok.type === 'inline') {\n state.md.inline.parse(tok.content, state.md, state.env, tok.children);\n }\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_core/inline.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_core/linkify.js": +/*!************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_core/linkify.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Replace link-like texts with link nodes.\n//\n// Currently restricted by `md.validateLink()` to http/https/ftp\n//\n\n\n\nvar arrayReplaceAt = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").arrayReplaceAt;\n\n\nfunction isLinkOpen(str) {\n return /^\\s]/i.test(str);\n}\nfunction isLinkClose(str) {\n return /^<\\/a\\s*>/i.test(str);\n}\n\n\nmodule.exports = function linkify(state) {\n var i, j, l, tokens, token, currentToken, nodes, ln, text, pos, lastPos,\n level, htmlLinkLevel, url, fullUrl, urlText,\n blockTokens = state.tokens,\n links;\n\n if (!state.md.options.linkify) { return; }\n\n for (j = 0, l = blockTokens.length; j < l; j++) {\n if (blockTokens[j].type !== 'inline' ||\n !state.md.linkify.pretest(blockTokens[j].content)) {\n continue;\n }\n\n tokens = blockTokens[j].children;\n\n htmlLinkLevel = 0;\n\n // We scan from the end, to keep position when new tags added.\n // Use reversed logic in links start/end match\n for (i = tokens.length - 1; i >= 0; i--) {\n currentToken = tokens[i];\n\n // Skip content of markdown links\n if (currentToken.type === 'link_close') {\n i--;\n while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {\n i--;\n }\n continue;\n }\n\n // Skip content of html tag links\n if (currentToken.type === 'html_inline') {\n if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {\n htmlLinkLevel--;\n }\n if (isLinkClose(currentToken.content)) {\n htmlLinkLevel++;\n }\n }\n if (htmlLinkLevel > 0) { continue; }\n\n if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {\n\n text = currentToken.content;\n links = state.md.linkify.match(text);\n\n // Now split string to nodes\n nodes = [];\n level = currentToken.level;\n lastPos = 0;\n\n for (ln = 0; ln < links.length; ln++) {\n\n url = links[ln].url;\n fullUrl = state.md.normalizeLink(url);\n if (!state.md.validateLink(fullUrl)) { continue; }\n\n urlText = links[ln].text;\n\n // Linkifier might send raw hostnames like \"example.com\", where url\n // starts with domain name. So we prepend http:// in those cases,\n // and remove it afterwards.\n //\n if (!links[ln].schema) {\n urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\\/\\//, '');\n } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {\n urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '');\n } else {\n urlText = state.md.normalizeLinkText(urlText);\n }\n\n pos = links[ln].index;\n\n if (pos > lastPos) {\n token = new state.Token('text', '', 0);\n token.content = text.slice(lastPos, pos);\n token.level = level;\n nodes.push(token);\n }\n\n token = new state.Token('link_open', 'a', 1);\n token.attrs = [ [ 'href', fullUrl ] ];\n token.level = level++;\n token.markup = 'linkify';\n token.info = 'auto';\n nodes.push(token);\n\n token = new state.Token('text', '', 0);\n token.content = urlText;\n token.level = level;\n nodes.push(token);\n\n token = new state.Token('link_close', 'a', -1);\n token.level = --level;\n token.markup = 'linkify';\n token.info = 'auto';\n nodes.push(token);\n\n lastPos = links[ln].lastIndex;\n }\n if (lastPos < text.length) {\n token = new state.Token('text', '', 0);\n token.content = text.slice(lastPos);\n token.level = level;\n nodes.push(token);\n }\n\n // replace current node\n blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);\n }\n }\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_core/linkify.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_core/normalize.js": +/*!**************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_core/normalize.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Normalize input string\n\n\n\n\n// https://spec.commonmark.org/0.29/#line-ending\nvar NEWLINES_RE = /\\r\\n?|\\n/g;\nvar NULL_RE = /\\0/g;\n\n\nmodule.exports = function normalize(state) {\n var str;\n\n // Normalize newlines\n str = state.src.replace(NEWLINES_RE, '\\n');\n\n // Replace NULL characters\n str = str.replace(NULL_RE, '\\uFFFD');\n\n state.src = str;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_core/normalize.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_core/replacements.js": +/*!*****************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_core/replacements.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Simple typographic replacements\n//\n// (c) (C) → ©\n// (tm) (TM) → ™\n// (r) (R) → ®\n// +- → ±\n// (p) (P) -> §\n// ... → … (also ?.... → ?.., !.... → !..)\n// ???????? → ???, !!!!! → !!!, `,,` → `,`\n// -- → –, --- → —\n//\n\n\n// TODO:\n// - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾\n// - miltiplication 2 x 4 -> 2 × 4\n\nvar RARE_RE = /\\+-|\\.\\.|\\?\\?\\?\\?|!!!!|,,|--/;\n\n// Workaround for phantomjs - need regex without /g flag,\n// or root check will fail every second time\nvar SCOPED_ABBR_TEST_RE = /\\((c|tm|r|p)\\)/i;\n\nvar SCOPED_ABBR_RE = /\\((c|tm|r|p)\\)/ig;\nvar SCOPED_ABBR = {\n c: '©',\n r: '®',\n p: '§',\n tm: '™'\n};\n\nfunction replaceFn(match, name) {\n return SCOPED_ABBR[name.toLowerCase()];\n}\n\nfunction replace_scoped(inlineTokens) {\n var i, token, inside_autolink = 0;\n\n for (i = inlineTokens.length - 1; i >= 0; i--) {\n token = inlineTokens[i];\n\n if (token.type === 'text' && !inside_autolink) {\n token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);\n }\n\n if (token.type === 'link_open' && token.info === 'auto') {\n inside_autolink--;\n }\n\n if (token.type === 'link_close' && token.info === 'auto') {\n inside_autolink++;\n }\n }\n}\n\nfunction replace_rare(inlineTokens) {\n var i, token, inside_autolink = 0;\n\n for (i = inlineTokens.length - 1; i >= 0; i--) {\n token = inlineTokens[i];\n\n if (token.type === 'text' && !inside_autolink) {\n if (RARE_RE.test(token.content)) {\n token.content = token.content\n .replace(/\\+-/g, '±')\n // .., ..., ....... -> …\n // but ?..... & !..... -> ?.. & !..\n .replace(/\\.{2,}/g, '…').replace(/([?!])…/g, '$1..')\n .replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')\n // em-dash\n .replace(/(^|[^-])---([^-]|$)/mg, '$1\\u2014$2')\n // en-dash\n .replace(/(^|\\s)--(\\s|$)/mg, '$1\\u2013$2')\n .replace(/(^|[^-\\s])--([^-\\s]|$)/mg, '$1\\u2013$2');\n }\n }\n\n if (token.type === 'link_open' && token.info === 'auto') {\n inside_autolink--;\n }\n\n if (token.type === 'link_close' && token.info === 'auto') {\n inside_autolink++;\n }\n }\n}\n\n\nmodule.exports = function replace(state) {\n var blkIdx;\n\n if (!state.md.options.typographer) { return; }\n\n for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {\n\n if (state.tokens[blkIdx].type !== 'inline') { continue; }\n\n if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {\n replace_scoped(state.tokens[blkIdx].children);\n }\n\n if (RARE_RE.test(state.tokens[blkIdx].content)) {\n replace_rare(state.tokens[blkIdx].children);\n }\n\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_core/replacements.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_core/smartquotes.js": +/*!****************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_core/smartquotes.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Convert straight quotation marks to typographic ones\n//\n\n\n\nvar isWhiteSpace = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isWhiteSpace;\nvar isPunctChar = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isPunctChar;\nvar isMdAsciiPunct = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isMdAsciiPunct;\n\nvar QUOTE_TEST_RE = /['\"]/;\nvar QUOTE_RE = /['\"]/g;\nvar APOSTROPHE = '\\u2019'; /* ’ */\n\n\nfunction replaceAt(str, index, ch) {\n return str.substr(0, index) + ch + str.substr(index + 1);\n}\n\nfunction process_inlines(tokens, state) {\n var i, token, text, t, pos, max, thisLevel, item, lastChar, nextChar,\n isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace,\n canOpen, canClose, j, isSingle, stack, openQuote, closeQuote;\n\n stack = [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n\n thisLevel = tokens[i].level;\n\n for (j = stack.length - 1; j >= 0; j--) {\n if (stack[j].level <= thisLevel) { break; }\n }\n stack.length = j + 1;\n\n if (token.type !== 'text') { continue; }\n\n text = token.content;\n pos = 0;\n max = text.length;\n\n /*eslint no-labels:0,block-scoped-var:0*/\n OUTER:\n while (pos < max) {\n QUOTE_RE.lastIndex = pos;\n t = QUOTE_RE.exec(text);\n if (!t) { break; }\n\n canOpen = canClose = true;\n pos = t.index + 1;\n isSingle = (t[0] === \"'\");\n\n // Find previous character,\n // default to space if it's the beginning of the line\n //\n lastChar = 0x20;\n\n if (t.index - 1 >= 0) {\n lastChar = text.charCodeAt(t.index - 1);\n } else {\n for (j = i - 1; j >= 0; j--) {\n if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // lastChar defaults to 0x20\n if (tokens[j].type !== 'text') continue;\n\n lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);\n break;\n }\n }\n\n // Find next character,\n // default to space if it's the end of the line\n //\n nextChar = 0x20;\n\n if (pos < max) {\n nextChar = text.charCodeAt(pos);\n } else {\n for (j = i + 1; j < tokens.length; j++) {\n if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // nextChar defaults to 0x20\n if (tokens[j].type !== 'text') continue;\n\n nextChar = tokens[j].content.charCodeAt(0);\n break;\n }\n }\n\n isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));\n isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));\n\n isLastWhiteSpace = isWhiteSpace(lastChar);\n isNextWhiteSpace = isWhiteSpace(nextChar);\n\n if (isNextWhiteSpace) {\n canOpen = false;\n } else if (isNextPunctChar) {\n if (!(isLastWhiteSpace || isLastPunctChar)) {\n canOpen = false;\n }\n }\n\n if (isLastWhiteSpace) {\n canClose = false;\n } else if (isLastPunctChar) {\n if (!(isNextWhiteSpace || isNextPunctChar)) {\n canClose = false;\n }\n }\n\n if (nextChar === 0x22 /* \" */ && t[0] === '\"') {\n if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {\n // special case: 1\"\" - count first quote as an inch\n canClose = canOpen = false;\n }\n }\n\n if (canOpen && canClose) {\n // treat this as the middle of the word\n canOpen = false;\n canClose = isNextPunctChar;\n }\n\n if (!canOpen && !canClose) {\n // middle of word\n if (isSingle) {\n token.content = replaceAt(token.content, t.index, APOSTROPHE);\n }\n continue;\n }\n\n if (canClose) {\n // this could be a closing quote, rewind the stack to get a match\n for (j = stack.length - 1; j >= 0; j--) {\n item = stack[j];\n if (stack[j].level < thisLevel) { break; }\n if (item.single === isSingle && stack[j].level === thisLevel) {\n item = stack[j];\n\n if (isSingle) {\n openQuote = state.md.options.quotes[2];\n closeQuote = state.md.options.quotes[3];\n } else {\n openQuote = state.md.options.quotes[0];\n closeQuote = state.md.options.quotes[1];\n }\n\n // replace token.content *before* tokens[item.token].content,\n // because, if they are pointing at the same token, replaceAt\n // could mess up indices when quote length != 1\n token.content = replaceAt(token.content, t.index, closeQuote);\n tokens[item.token].content = replaceAt(\n tokens[item.token].content, item.pos, openQuote);\n\n pos += closeQuote.length - 1;\n if (item.token === i) { pos += openQuote.length - 1; }\n\n text = token.content;\n max = text.length;\n\n stack.length = j;\n continue OUTER;\n }\n }\n }\n\n if (canOpen) {\n stack.push({\n token: i,\n pos: t.index,\n single: isSingle,\n level: thisLevel\n });\n } else if (canClose && isSingle) {\n token.content = replaceAt(token.content, t.index, APOSTROPHE);\n }\n }\n }\n}\n\n\nmodule.exports = function smartquotes(state) {\n /*eslint max-depth:0*/\n var blkIdx;\n\n if (!state.md.options.typographer) { return; }\n\n for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {\n\n if (state.tokens[blkIdx].type !== 'inline' ||\n !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {\n continue;\n }\n\n process_inlines(state.tokens[blkIdx].children, state);\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_core/smartquotes.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_core/state_core.js": +/*!***************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_core/state_core.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Core state object\n//\n\n\nvar Token = __webpack_require__(/*! ../token */ \"./node_modules/markdown-it/lib/token.js\");\n\n\nfunction StateCore(src, md, env) {\n this.src = src;\n this.env = env;\n this.tokens = [];\n this.inlineMode = false;\n this.md = md; // link to parser instance\n}\n\n// re-export Token class to use in core rules\nStateCore.prototype.Token = Token;\n\n\nmodule.exports = StateCore;\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_core/state_core.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_inline/autolink.js": +/*!***************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_inline/autolink.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Process autolinks ''\n\n\n\n\n/*eslint max-len:0*/\nvar EMAIL_RE = /^<([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])?)*)>/;\nvar AUTOLINK_RE = /^<([a-zA-Z][a-zA-Z0-9+.\\-]{1,31}):([^<>\\x00-\\x20]*)>/;\n\n\nmodule.exports = function autolink(state, silent) {\n var tail, linkMatch, emailMatch, url, fullUrl, token,\n pos = state.pos;\n\n if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }\n\n tail = state.src.slice(pos);\n\n if (tail.indexOf('>') < 0) { return false; }\n\n if (AUTOLINK_RE.test(tail)) {\n linkMatch = tail.match(AUTOLINK_RE);\n\n url = linkMatch[0].slice(1, -1);\n fullUrl = state.md.normalizeLink(url);\n if (!state.md.validateLink(fullUrl)) { return false; }\n\n if (!silent) {\n token = state.push('link_open', 'a', 1);\n token.attrs = [ [ 'href', fullUrl ] ];\n token.markup = 'autolink';\n token.info = 'auto';\n\n token = state.push('text', '', 0);\n token.content = state.md.normalizeLinkText(url);\n\n token = state.push('link_close', 'a', -1);\n token.markup = 'autolink';\n token.info = 'auto';\n }\n\n state.pos += linkMatch[0].length;\n return true;\n }\n\n if (EMAIL_RE.test(tail)) {\n emailMatch = tail.match(EMAIL_RE);\n\n url = emailMatch[0].slice(1, -1);\n fullUrl = state.md.normalizeLink('mailto:' + url);\n if (!state.md.validateLink(fullUrl)) { return false; }\n\n if (!silent) {\n token = state.push('link_open', 'a', 1);\n token.attrs = [ [ 'href', fullUrl ] ];\n token.markup = 'autolink';\n token.info = 'auto';\n\n token = state.push('text', '', 0);\n token.content = state.md.normalizeLinkText(url);\n\n token = state.push('link_close', 'a', -1);\n token.markup = 'autolink';\n token.info = 'auto';\n }\n\n state.pos += emailMatch[0].length;\n return true;\n }\n\n return false;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_inline/autolink.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_inline/backticks.js": +/*!****************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_inline/backticks.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Parse backticks\n\n\n\nmodule.exports = function backtick(state, silent) {\n var start, max, marker, matchStart, matchEnd, token,\n pos = state.pos,\n ch = state.src.charCodeAt(pos);\n\n if (ch !== 0x60/* ` */) { return false; }\n\n start = pos;\n pos++;\n max = state.posMax;\n\n while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++; }\n\n marker = state.src.slice(start, pos);\n\n matchStart = matchEnd = pos;\n\n while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) {\n matchEnd = matchStart + 1;\n\n while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++; }\n\n if (matchEnd - matchStart === marker.length) {\n if (!silent) {\n token = state.push('code_inline', 'code', 0);\n token.markup = marker;\n token.content = state.src.slice(pos, matchStart)\n .replace(/\\n/g, ' ')\n .replace(/^ (.+) $/, '$1');\n }\n state.pos = matchEnd;\n return true;\n }\n }\n\n if (!silent) { state.pending += marker; }\n state.pos += marker.length;\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_inline/backticks.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_inline/balance_pairs.js": +/*!********************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_inline/balance_pairs.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// For each opening emphasis-like marker find a matching closing one\n//\n\n\n\nfunction processDelimiters(state, delimiters) {\n var closerIdx, openerIdx, closer, opener, minOpenerIdx, newMinOpenerIdx,\n isOddMatch, lastJump,\n openersBottom = {},\n max = delimiters.length;\n\n for (closerIdx = 0; closerIdx < max; closerIdx++) {\n closer = delimiters[closerIdx];\n\n // Length is only used for emphasis-specific \"rule of 3\",\n // if it's not defined (in strikethrough or 3rd party plugins),\n // we can default it to 0 to disable those checks.\n //\n closer.length = closer.length || 0;\n\n if (!closer.close) continue;\n\n // Previously calculated lower bounds (previous fails)\n // for each marker and each delimiter length modulo 3.\n if (!openersBottom.hasOwnProperty(closer.marker)) {\n openersBottom[closer.marker] = [ -1, -1, -1 ];\n }\n\n minOpenerIdx = openersBottom[closer.marker][closer.length % 3];\n newMinOpenerIdx = -1;\n\n openerIdx = closerIdx - closer.jump - 1;\n\n for (; openerIdx > minOpenerIdx; openerIdx -= opener.jump + 1) {\n opener = delimiters[openerIdx];\n\n if (opener.marker !== closer.marker) continue;\n\n if (newMinOpenerIdx === -1) newMinOpenerIdx = openerIdx;\n\n if (opener.open &&\n opener.end < 0 &&\n opener.level === closer.level) {\n\n isOddMatch = false;\n\n // from spec:\n //\n // If one of the delimiters can both open and close emphasis, then the\n // sum of the lengths of the delimiter runs containing the opening and\n // closing delimiters must not be a multiple of 3 unless both lengths\n // are multiples of 3.\n //\n if (opener.close || closer.open) {\n if ((opener.length + closer.length) % 3 === 0) {\n if (opener.length % 3 !== 0 || closer.length % 3 !== 0) {\n isOddMatch = true;\n }\n }\n }\n\n if (!isOddMatch) {\n // If previous delimiter cannot be an opener, we can safely skip\n // the entire sequence in future checks. This is required to make\n // sure algorithm has linear complexity (see *_*_*_*_*_... case).\n //\n lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ?\n delimiters[openerIdx - 1].jump + 1 :\n 0;\n\n closer.jump = closerIdx - openerIdx + lastJump;\n closer.open = false;\n opener.end = closerIdx;\n opener.jump = lastJump;\n opener.close = false;\n newMinOpenerIdx = -1;\n break;\n }\n }\n }\n\n if (newMinOpenerIdx !== -1) {\n // If match for this delimiter run failed, we want to set lower bound for\n // future lookups. This is required to make sure algorithm has linear\n // complexity.\n //\n // See details here:\n // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442\n //\n openersBottom[closer.marker][(closer.length || 0) % 3] = newMinOpenerIdx;\n }\n }\n}\n\n\nmodule.exports = function link_pairs(state) {\n var curr,\n tokens_meta = state.tokens_meta,\n max = state.tokens_meta.length;\n\n processDelimiters(state, state.delimiters);\n\n for (curr = 0; curr < max; curr++) {\n if (tokens_meta[curr] && tokens_meta[curr].delimiters) {\n processDelimiters(state, tokens_meta[curr].delimiters);\n }\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_inline/balance_pairs.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_inline/emphasis.js": +/*!***************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_inline/emphasis.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Process *this* and _that_\n//\n\n\n\n// Insert each marker as a separate text token, and add it to delimiter list\n//\nmodule.exports.tokenize = function emphasis(state, silent) {\n var i, scanned, token,\n start = state.pos,\n marker = state.src.charCodeAt(start);\n\n if (silent) { return false; }\n\n if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false; }\n\n scanned = state.scanDelims(state.pos, marker === 0x2A);\n\n for (i = 0; i < scanned.length; i++) {\n token = state.push('text', '', 0);\n token.content = String.fromCharCode(marker);\n\n state.delimiters.push({\n // Char code of the starting marker (number).\n //\n marker: marker,\n\n // Total length of these series of delimiters.\n //\n length: scanned.length,\n\n // An amount of characters before this one that's equivalent to\n // current one. In plain English: if this delimiter does not open\n // an emphasis, neither do previous `jump` characters.\n //\n // Used to skip sequences like \"*****\" in one step, for 1st asterisk\n // value will be 0, for 2nd it's 1 and so on.\n //\n jump: i,\n\n // A position of the token this delimiter corresponds to.\n //\n token: state.tokens.length - 1,\n\n // If this delimiter is matched as a valid opener, `end` will be\n // equal to its position, otherwise it's `-1`.\n //\n end: -1,\n\n // Boolean flags that determine if this delimiter could open or close\n // an emphasis.\n //\n open: scanned.can_open,\n close: scanned.can_close\n });\n }\n\n state.pos += scanned.length;\n\n return true;\n};\n\n\nfunction postProcess(state, delimiters) {\n var i,\n startDelim,\n endDelim,\n token,\n ch,\n isStrong,\n max = delimiters.length;\n\n for (i = max - 1; i >= 0; i--) {\n startDelim = delimiters[i];\n\n if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) {\n continue;\n }\n\n // Process only opening markers\n if (startDelim.end === -1) {\n continue;\n }\n\n endDelim = delimiters[startDelim.end];\n\n // If the previous delimiter has the same marker and is adjacent to this one,\n // merge those into one strong delimiter.\n //\n // `whatever` -> `whatever`\n //\n isStrong = i > 0 &&\n delimiters[i - 1].end === startDelim.end + 1 &&\n delimiters[i - 1].token === startDelim.token - 1 &&\n delimiters[startDelim.end + 1].token === endDelim.token + 1 &&\n delimiters[i - 1].marker === startDelim.marker;\n\n ch = String.fromCharCode(startDelim.marker);\n\n token = state.tokens[startDelim.token];\n token.type = isStrong ? 'strong_open' : 'em_open';\n token.tag = isStrong ? 'strong' : 'em';\n token.nesting = 1;\n token.markup = isStrong ? ch + ch : ch;\n token.content = '';\n\n token = state.tokens[endDelim.token];\n token.type = isStrong ? 'strong_close' : 'em_close';\n token.tag = isStrong ? 'strong' : 'em';\n token.nesting = -1;\n token.markup = isStrong ? ch + ch : ch;\n token.content = '';\n\n if (isStrong) {\n state.tokens[delimiters[i - 1].token].content = '';\n state.tokens[delimiters[startDelim.end + 1].token].content = '';\n i--;\n }\n }\n}\n\n\n// Walk through delimiter list and replace text tokens with tags\n//\nmodule.exports.postProcess = function emphasis(state) {\n var curr,\n tokens_meta = state.tokens_meta,\n max = state.tokens_meta.length;\n\n postProcess(state, state.delimiters);\n\n for (curr = 0; curr < max; curr++) {\n if (tokens_meta[curr] && tokens_meta[curr].delimiters) {\n postProcess(state, tokens_meta[curr].delimiters);\n }\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_inline/emphasis.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_inline/entity.js": +/*!*************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_inline/entity.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Process html entity - {, ¯, ", ...\n\n\n\nvar entities = __webpack_require__(/*! ../common/entities */ \"./node_modules/markdown-it/lib/common/entities.js\");\nvar has = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").has;\nvar isValidEntityCode = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isValidEntityCode;\nvar fromCodePoint = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").fromCodePoint;\n\n\nvar DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;\nvar NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;\n\n\nmodule.exports = function entity(state, silent) {\n var ch, code, match, pos = state.pos, max = state.posMax;\n\n if (state.src.charCodeAt(pos) !== 0x26/* & */) { return false; }\n\n if (pos + 1 < max) {\n ch = state.src.charCodeAt(pos + 1);\n\n if (ch === 0x23 /* # */) {\n match = state.src.slice(pos).match(DIGITAL_RE);\n if (match) {\n if (!silent) {\n code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);\n state.pending += isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD);\n }\n state.pos += match[0].length;\n return true;\n }\n } else {\n match = state.src.slice(pos).match(NAMED_RE);\n if (match) {\n if (has(entities, match[1])) {\n if (!silent) { state.pending += entities[match[1]]; }\n state.pos += match[0].length;\n return true;\n }\n }\n }\n }\n\n if (!silent) { state.pending += '&'; }\n state.pos++;\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_inline/entity.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_inline/escape.js": +/*!*************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_inline/escape.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Process escaped chars and hardbreaks\n\n\n\nvar isSpace = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isSpace;\n\nvar ESCAPED = [];\n\nfor (var i = 0; i < 256; i++) { ESCAPED.push(0); }\n\n'\\\\!\"#$%&\\'()*+,./:;<=>?@[]^_`{|}~-'\n .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1; });\n\n\nmodule.exports = function escape(state, silent) {\n var ch, pos = state.pos, max = state.posMax;\n\n if (state.src.charCodeAt(pos) !== 0x5C/* \\ */) { return false; }\n\n pos++;\n\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (ch < 256 && ESCAPED[ch] !== 0) {\n if (!silent) { state.pending += state.src[pos]; }\n state.pos += 2;\n return true;\n }\n\n if (ch === 0x0A) {\n if (!silent) {\n state.push('hardbreak', 'br', 0);\n }\n\n pos++;\n // skip leading whitespaces from next line\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n if (!isSpace(ch)) { break; }\n pos++;\n }\n\n state.pos = pos;\n return true;\n }\n }\n\n if (!silent) { state.pending += '\\\\'; }\n state.pos++;\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_inline/escape.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_inline/html_inline.js": +/*!******************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_inline/html_inline.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Process html tags\n\n\n\n\nvar HTML_TAG_RE = __webpack_require__(/*! ../common/html_re */ \"./node_modules/markdown-it/lib/common/html_re.js\").HTML_TAG_RE;\n\n\nfunction isLetter(ch) {\n /*eslint no-bitwise:0*/\n var lc = ch | 0x20; // to lower case\n return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */);\n}\n\n\nmodule.exports = function html_inline(state, silent) {\n var ch, match, max, token,\n pos = state.pos;\n\n if (!state.md.options.html) { return false; }\n\n // Check start\n max = state.posMax;\n if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||\n pos + 2 >= max) {\n return false;\n }\n\n // Quick fail on second char\n ch = state.src.charCodeAt(pos + 1);\n if (ch !== 0x21/* ! */ &&\n ch !== 0x3F/* ? */ &&\n ch !== 0x2F/* / */ &&\n !isLetter(ch)) {\n return false;\n }\n\n match = state.src.slice(pos).match(HTML_TAG_RE);\n if (!match) { return false; }\n\n if (!silent) {\n token = state.push('html_inline', '', 0);\n token.content = state.src.slice(pos, pos + match[0].length);\n }\n state.pos += match[0].length;\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_inline/html_inline.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_inline/image.js": +/*!************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_inline/image.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Process ![image]( \"title\")\n\n\n\nvar normalizeReference = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").normalizeReference;\nvar isSpace = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isSpace;\n\n\nmodule.exports = function image(state, silent) {\n var attrs,\n code,\n content,\n label,\n labelEnd,\n labelStart,\n pos,\n ref,\n res,\n title,\n token,\n tokens,\n start,\n href = '',\n oldPos = state.pos,\n max = state.posMax;\n\n if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false; }\n if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false; }\n\n labelStart = state.pos + 2;\n labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);\n\n // parser failed to find ']', so it's not a valid link\n if (labelEnd < 0) { return false; }\n\n pos = labelEnd + 1;\n if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {\n //\n // Inline link\n //\n\n // [link]( \"title\" )\n // ^^ skipping these spaces\n pos++;\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 0x0A) { break; }\n }\n if (pos >= max) { return false; }\n\n // [link]( \"title\" )\n // ^^^^^^ parsing link destination\n start = pos;\n res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);\n if (res.ok) {\n href = state.md.normalizeLink(res.str);\n if (state.md.validateLink(href)) {\n pos = res.pos;\n } else {\n href = '';\n }\n }\n\n // [link]( \"title\" )\n // ^^ skipping these spaces\n start = pos;\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 0x0A) { break; }\n }\n\n // [link]( \"title\" )\n // ^^^^^^^ parsing link title\n res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);\n if (pos < max && start !== pos && res.ok) {\n title = res.str;\n pos = res.pos;\n\n // [link]( \"title\" )\n // ^^ skipping these spaces\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 0x0A) { break; }\n }\n } else {\n title = '';\n }\n\n if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {\n state.pos = oldPos;\n return false;\n }\n pos++;\n } else {\n //\n // Link reference\n //\n if (typeof state.env.references === 'undefined') { return false; }\n\n if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {\n start = pos + 1;\n pos = state.md.helpers.parseLinkLabel(state, pos);\n if (pos >= 0) {\n label = state.src.slice(start, pos++);\n } else {\n pos = labelEnd + 1;\n }\n } else {\n pos = labelEnd + 1;\n }\n\n // covers label === '' and label === undefined\n // (collapsed reference link and shortcut reference link respectively)\n if (!label) { label = state.src.slice(labelStart, labelEnd); }\n\n ref = state.env.references[normalizeReference(label)];\n if (!ref) {\n state.pos = oldPos;\n return false;\n }\n href = ref.href;\n title = ref.title;\n }\n\n //\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n content = state.src.slice(labelStart, labelEnd);\n\n state.md.inline.parse(\n content,\n state.md,\n state.env,\n tokens = []\n );\n\n token = state.push('image', 'img', 0);\n token.attrs = attrs = [ [ 'src', href ], [ 'alt', '' ] ];\n token.children = tokens;\n token.content = content;\n\n if (title) {\n attrs.push([ 'title', title ]);\n }\n }\n\n state.pos = pos;\n state.posMax = max;\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_inline/image.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_inline/link.js": +/*!***********************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_inline/link.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Process [link]( \"stuff\")\n\n\n\nvar normalizeReference = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").normalizeReference;\nvar isSpace = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isSpace;\n\n\nmodule.exports = function link(state, silent) {\n var attrs,\n code,\n label,\n labelEnd,\n labelStart,\n pos,\n res,\n ref,\n title,\n token,\n href = '',\n oldPos = state.pos,\n max = state.posMax,\n start = state.pos,\n parseReference = true;\n\n if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false; }\n\n labelStart = state.pos + 1;\n labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);\n\n // parser failed to find ']', so it's not a valid link\n if (labelEnd < 0) { return false; }\n\n pos = labelEnd + 1;\n if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {\n //\n // Inline link\n //\n\n // might have found a valid shortcut link, disable reference parsing\n parseReference = false;\n\n // [link]( \"title\" )\n // ^^ skipping these spaces\n pos++;\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 0x0A) { break; }\n }\n if (pos >= max) { return false; }\n\n // [link]( \"title\" )\n // ^^^^^^ parsing link destination\n start = pos;\n res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);\n if (res.ok) {\n href = state.md.normalizeLink(res.str);\n if (state.md.validateLink(href)) {\n pos = res.pos;\n } else {\n href = '';\n }\n }\n\n // [link]( \"title\" )\n // ^^ skipping these spaces\n start = pos;\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 0x0A) { break; }\n }\n\n // [link]( \"title\" )\n // ^^^^^^^ parsing link title\n res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);\n if (pos < max && start !== pos && res.ok) {\n title = res.str;\n pos = res.pos;\n\n // [link]( \"title\" )\n // ^^ skipping these spaces\n for (; pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 0x0A) { break; }\n }\n } else {\n title = '';\n }\n\n if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {\n // parsing a valid shortcut link failed, fallback to reference\n parseReference = true;\n }\n pos++;\n }\n\n if (parseReference) {\n //\n // Link reference\n //\n if (typeof state.env.references === 'undefined') { return false; }\n\n if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {\n start = pos + 1;\n pos = state.md.helpers.parseLinkLabel(state, pos);\n if (pos >= 0) {\n label = state.src.slice(start, pos++);\n } else {\n pos = labelEnd + 1;\n }\n } else {\n pos = labelEnd + 1;\n }\n\n // covers label === '' and label === undefined\n // (collapsed reference link and shortcut reference link respectively)\n if (!label) { label = state.src.slice(labelStart, labelEnd); }\n\n ref = state.env.references[normalizeReference(label)];\n if (!ref) {\n state.pos = oldPos;\n return false;\n }\n href = ref.href;\n title = ref.title;\n }\n\n //\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n state.pos = labelStart;\n state.posMax = labelEnd;\n\n token = state.push('link_open', 'a', 1);\n token.attrs = attrs = [ [ 'href', href ] ];\n if (title) {\n attrs.push([ 'title', title ]);\n }\n\n state.md.inline.tokenize(state);\n\n token = state.push('link_close', 'a', -1);\n }\n\n state.pos = pos;\n state.posMax = max;\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_inline/link.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_inline/newline.js": +/*!**************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_inline/newline.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Proceess '\\n'\n\n\n\nvar isSpace = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isSpace;\n\n\nmodule.exports = function newline(state, silent) {\n var pmax, max, pos = state.pos;\n\n if (state.src.charCodeAt(pos) !== 0x0A/* \\n */) { return false; }\n\n pmax = state.pending.length - 1;\n max = state.posMax;\n\n // ' \\n' -> hardbreak\n // Lookup in pending chars is bad practice! Don't copy to other rules!\n // Pending string is stored in concat mode, indexed lookups will cause\n // convertion to flat mode.\n if (!silent) {\n if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {\n if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {\n state.pending = state.pending.replace(/ +$/, '');\n state.push('hardbreak', 'br', 0);\n } else {\n state.pending = state.pending.slice(0, -1);\n state.push('softbreak', 'br', 0);\n }\n\n } else {\n state.push('softbreak', 'br', 0);\n }\n }\n\n pos++;\n\n // skip heading spaces for next line\n while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++; }\n\n state.pos = pos;\n return true;\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_inline/newline.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_inline/state_inline.js": +/*!*******************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_inline/state_inline.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Inline parser state\n\n\n\n\nvar Token = __webpack_require__(/*! ../token */ \"./node_modules/markdown-it/lib/token.js\");\nvar isWhiteSpace = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isWhiteSpace;\nvar isPunctChar = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isPunctChar;\nvar isMdAsciiPunct = __webpack_require__(/*! ../common/utils */ \"./node_modules/markdown-it/lib/common/utils.js\").isMdAsciiPunct;\n\n\nfunction StateInline(src, md, env, outTokens) {\n this.src = src;\n this.env = env;\n this.md = md;\n this.tokens = outTokens;\n this.tokens_meta = Array(outTokens.length);\n\n this.pos = 0;\n this.posMax = this.src.length;\n this.level = 0;\n this.pending = '';\n this.pendingLevel = 0;\n\n // Stores { start: end } pairs. Useful for backtrack\n // optimization of pairs parse (emphasis, strikes).\n this.cache = {};\n\n // List of emphasis-like delimiters for current tag\n this.delimiters = [];\n\n // Stack of delimiter lists for upper level tags\n this._prev_delimiters = [];\n}\n\n\n// Flush pending text\n//\nStateInline.prototype.pushPending = function () {\n var token = new Token('text', '', 0);\n token.content = this.pending;\n token.level = this.pendingLevel;\n this.tokens.push(token);\n this.pending = '';\n return token;\n};\n\n\n// Push new token to \"stream\".\n// If pending text exists - flush it as text token\n//\nStateInline.prototype.push = function (type, tag, nesting) {\n if (this.pending) {\n this.pushPending();\n }\n\n var token = new Token(type, tag, nesting);\n var token_meta = null;\n\n if (nesting < 0) {\n // closing tag\n this.level--;\n this.delimiters = this._prev_delimiters.pop();\n }\n\n token.level = this.level;\n\n if (nesting > 0) {\n // opening tag\n this.level++;\n this._prev_delimiters.push(this.delimiters);\n this.delimiters = [];\n token_meta = { delimiters: this.delimiters };\n }\n\n this.pendingLevel = this.level;\n this.tokens.push(token);\n this.tokens_meta.push(token_meta);\n return token;\n};\n\n\n// Scan a sequence of emphasis-like markers, and determine whether\n// it can start an emphasis sequence or end an emphasis sequence.\n//\n// - start - position to scan from (it should point at a valid marker);\n// - canSplitWord - determine if these markers can be found inside a word\n//\nStateInline.prototype.scanDelims = function (start, canSplitWord) {\n var pos = start, lastChar, nextChar, count, can_open, can_close,\n isLastWhiteSpace, isLastPunctChar,\n isNextWhiteSpace, isNextPunctChar,\n left_flanking = true,\n right_flanking = true,\n max = this.posMax,\n marker = this.src.charCodeAt(start);\n\n // treat beginning of the line as a whitespace\n lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20;\n\n while (pos < max && this.src.charCodeAt(pos) === marker) { pos++; }\n\n count = pos - start;\n\n // treat end of the line as a whitespace\n nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20;\n\n isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));\n isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));\n\n isLastWhiteSpace = isWhiteSpace(lastChar);\n isNextWhiteSpace = isWhiteSpace(nextChar);\n\n if (isNextWhiteSpace) {\n left_flanking = false;\n } else if (isNextPunctChar) {\n if (!(isLastWhiteSpace || isLastPunctChar)) {\n left_flanking = false;\n }\n }\n\n if (isLastWhiteSpace) {\n right_flanking = false;\n } else if (isLastPunctChar) {\n if (!(isNextWhiteSpace || isNextPunctChar)) {\n right_flanking = false;\n }\n }\n\n if (!canSplitWord) {\n can_open = left_flanking && (!right_flanking || isLastPunctChar);\n can_close = right_flanking && (!left_flanking || isNextPunctChar);\n } else {\n can_open = left_flanking;\n can_close = right_flanking;\n }\n\n return {\n can_open: can_open,\n can_close: can_close,\n length: count\n };\n};\n\n\n// re-export Token class to use in block rules\nStateInline.prototype.Token = Token;\n\n\nmodule.exports = StateInline;\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_inline/state_inline.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_inline/strikethrough.js": +/*!********************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_inline/strikethrough.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// ~~strike through~~\n//\n\n\n\n// Insert each marker as a separate text token, and add it to delimiter list\n//\nmodule.exports.tokenize = function strikethrough(state, silent) {\n var i, scanned, token, len, ch,\n start = state.pos,\n marker = state.src.charCodeAt(start);\n\n if (silent) { return false; }\n\n if (marker !== 0x7E/* ~ */) { return false; }\n\n scanned = state.scanDelims(state.pos, true);\n len = scanned.length;\n ch = String.fromCharCode(marker);\n\n if (len < 2) { return false; }\n\n if (len % 2) {\n token = state.push('text', '', 0);\n token.content = ch;\n len--;\n }\n\n for (i = 0; i < len; i += 2) {\n token = state.push('text', '', 0);\n token.content = ch + ch;\n\n state.delimiters.push({\n marker: marker,\n length: 0, // disable \"rule of 3\" length checks meant for emphasis\n jump: i,\n token: state.tokens.length - 1,\n end: -1,\n open: scanned.can_open,\n close: scanned.can_close\n });\n }\n\n state.pos += scanned.length;\n\n return true;\n};\n\n\nfunction postProcess(state, delimiters) {\n var i, j,\n startDelim,\n endDelim,\n token,\n loneMarkers = [],\n max = delimiters.length;\n\n for (i = 0; i < max; i++) {\n startDelim = delimiters[i];\n\n if (startDelim.marker !== 0x7E/* ~ */) {\n continue;\n }\n\n if (startDelim.end === -1) {\n continue;\n }\n\n endDelim = delimiters[startDelim.end];\n\n token = state.tokens[startDelim.token];\n token.type = 's_open';\n token.tag = 's';\n token.nesting = 1;\n token.markup = '~~';\n token.content = '';\n\n token = state.tokens[endDelim.token];\n token.type = 's_close';\n token.tag = 's';\n token.nesting = -1;\n token.markup = '~~';\n token.content = '';\n\n if (state.tokens[endDelim.token - 1].type === 'text' &&\n state.tokens[endDelim.token - 1].content === '~') {\n\n loneMarkers.push(endDelim.token - 1);\n }\n }\n\n // If a marker sequence has an odd number of characters, it's splitted\n // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the\n // start of the sequence.\n //\n // So, we have to move all those markers after subsequent s_close tags.\n //\n while (loneMarkers.length) {\n i = loneMarkers.pop();\n j = i + 1;\n\n while (j < state.tokens.length && state.tokens[j].type === 's_close') {\n j++;\n }\n\n j--;\n\n if (i !== j) {\n token = state.tokens[j];\n state.tokens[j] = state.tokens[i];\n state.tokens[i] = token;\n }\n }\n}\n\n\n// Walk through delimiter list and replace text tokens with tags\n//\nmodule.exports.postProcess = function strikethrough(state) {\n var curr,\n tokens_meta = state.tokens_meta,\n max = state.tokens_meta.length;\n\n postProcess(state, state.delimiters);\n\n for (curr = 0; curr < max; curr++) {\n if (tokens_meta[curr] && tokens_meta[curr].delimiters) {\n postProcess(state, tokens_meta[curr].delimiters);\n }\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_inline/strikethrough.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_inline/text.js": +/*!***********************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_inline/text.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Skip text characters for text token, place those to pending buffer\n// and increment current pos\n\n\n\n\n// Rule to skip pure text\n// '{}$%@~+=:' reserved for extentions\n\n// !, \", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \\, ], ^, _, `, {, |, }, or ~\n\n// !!!! Don't confuse with \"Markdown ASCII Punctuation\" chars\n// http://spec.commonmark.org/0.15/#ascii-punctuation-character\nfunction isTerminatorChar(ch) {\n switch (ch) {\n case 0x0A/* \\n */:\n case 0x21/* ! */:\n case 0x23/* # */:\n case 0x24/* $ */:\n case 0x25/* % */:\n case 0x26/* & */:\n case 0x2A/* * */:\n case 0x2B/* + */:\n case 0x2D/* - */:\n case 0x3A/* : */:\n case 0x3C/* < */:\n case 0x3D/* = */:\n case 0x3E/* > */:\n case 0x40/* @ */:\n case 0x5B/* [ */:\n case 0x5C/* \\ */:\n case 0x5D/* ] */:\n case 0x5E/* ^ */:\n case 0x5F/* _ */:\n case 0x60/* ` */:\n case 0x7B/* { */:\n case 0x7D/* } */:\n case 0x7E/* ~ */:\n return true;\n default:\n return false;\n }\n}\n\nmodule.exports = function text(state, silent) {\n var pos = state.pos;\n\n while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {\n pos++;\n }\n\n if (pos === state.pos) { return false; }\n\n if (!silent) { state.pending += state.src.slice(state.pos, pos); }\n\n state.pos = pos;\n\n return true;\n};\n\n// Alternative implementation, for memory.\n//\n// It costs 10% of performance, but allows extend terminators list, if place it\n// to `ParcerInline` property. Probably, will switch to it sometime, such\n// flexibility required.\n\n/*\nvar TERMINATOR_RE = /[\\n!#$%&*+\\-:<=>@[\\\\\\]^_`{}~]/;\n\nmodule.exports = function text(state, silent) {\n var pos = state.pos,\n idx = state.src.slice(pos).search(TERMINATOR_RE);\n\n // first char is terminator -> empty text\n if (idx === 0) { return false; }\n\n // no terminator -> text till end of string\n if (idx < 0) {\n if (!silent) { state.pending += state.src.slice(pos); }\n state.pos = state.src.length;\n return true;\n }\n\n if (!silent) { state.pending += state.src.slice(pos, pos + idx); }\n\n state.pos += idx;\n\n return true;\n};*/\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_inline/text.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/rules_inline/text_collapse.js": +/*!********************************************************************!*\ + !*** ./node_modules/markdown-it/lib/rules_inline/text_collapse.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Clean up tokens after emphasis and strikethrough postprocessing:\n// merge adjacent text nodes into one and re-calculate all token levels\n//\n// This is necessary because initially emphasis delimiter markers (*, _, ~)\n// are treated as their own separate text tokens. Then emphasis rule either\n// leaves them as text (needed to merge with adjacent text) or turns them\n// into opening/closing tags (which messes up levels inside).\n//\n\n\n\nmodule.exports = function text_collapse(state) {\n var curr, last,\n level = 0,\n tokens = state.tokens,\n max = state.tokens.length;\n\n for (curr = last = 0; curr < max; curr++) {\n // re-calculate levels after emphasis/strikethrough turns some text nodes\n // into opening/closing tags\n if (tokens[curr].nesting < 0) level--; // closing tag\n tokens[curr].level = level;\n if (tokens[curr].nesting > 0) level++; // opening tag\n\n if (tokens[curr].type === 'text' &&\n curr + 1 < max &&\n tokens[curr + 1].type === 'text') {\n\n // collapse two adjacent text nodes\n tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;\n } else {\n if (curr !== last) { tokens[last] = tokens[curr]; }\n\n last++;\n }\n }\n\n if (curr !== last) {\n tokens.length = last;\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/rules_inline/text_collapse.js?"); + +/***/ }), + +/***/ "./node_modules/markdown-it/lib/token.js": +/*!***********************************************!*\ + !*** ./node_modules/markdown-it/lib/token.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Token class\n\n\n\n\n/**\n * class Token\n **/\n\n/**\n * new Token(type, tag, nesting)\n *\n * Create new token and fill passed properties.\n **/\nfunction Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/\n this.tag = tag;\n\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/\n this.attrs = null;\n\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/\n this.map = null;\n\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/\n this.nesting = nesting;\n\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/\n this.level = 0;\n\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/\n this.children = null;\n\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/\n this.content = '';\n\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/\n this.markup = '';\n\n /**\n * Token#info -> String\n *\n * fence infostring\n **/\n this.info = '';\n\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/\n this.meta = null;\n\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/\n this.block = false;\n\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/\n this.hidden = false;\n}\n\n\n/**\n * Token.attrIndex(name) -> Number\n *\n * Search attribute index by name.\n **/\nToken.prototype.attrIndex = function attrIndex(name) {\n var attrs, i, len;\n\n if (!this.attrs) { return -1; }\n\n attrs = this.attrs;\n\n for (i = 0, len = attrs.length; i < len; i++) {\n if (attrs[i][0] === name) { return i; }\n }\n return -1;\n};\n\n\n/**\n * Token.attrPush(attrData)\n *\n * Add `[ name, value ]` attribute to list. Init attrs if necessary\n **/\nToken.prototype.attrPush = function attrPush(attrData) {\n if (this.attrs) {\n this.attrs.push(attrData);\n } else {\n this.attrs = [ attrData ];\n }\n};\n\n\n/**\n * Token.attrSet(name, value)\n *\n * Set `name` attribute to `value`. Override old value if exists.\n **/\nToken.prototype.attrSet = function attrSet(name, value) {\n var idx = this.attrIndex(name),\n attrData = [ name, value ];\n\n if (idx < 0) {\n this.attrPush(attrData);\n } else {\n this.attrs[idx] = attrData;\n }\n};\n\n\n/**\n * Token.attrGet(name)\n *\n * Get the value of attribute `name`, or null if it does not exist.\n **/\nToken.prototype.attrGet = function attrGet(name) {\n var idx = this.attrIndex(name), value = null;\n if (idx >= 0) {\n value = this.attrs[idx][1];\n }\n return value;\n};\n\n\n/**\n * Token.attrJoin(name, value)\n *\n * Join value to existing attribute via space. Or create new attribute if not\n * exists. Useful to operate with token classes.\n **/\nToken.prototype.attrJoin = function attrJoin(name, value) {\n var idx = this.attrIndex(name);\n\n if (idx < 0) {\n this.attrPush([ name, value ]);\n } else {\n this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value;\n }\n};\n\n\nmodule.exports = Token;\n\n\n//# sourceURL=webpack:///./node_modules/markdown-it/lib/token.js?"); + +/***/ }), + +/***/ "./node_modules/mdurl/decode.js": +/*!**************************************!*\ + !*** ./node_modules/mdurl/decode.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n\n\n/* eslint-disable no-bitwise */\n\nvar decodeCache = {};\n\nfunction getDecodeCache(exclude) {\n var i, ch, cache = decodeCache[exclude];\n if (cache) { return cache; }\n\n cache = decodeCache[exclude] = [];\n\n for (i = 0; i < 128; i++) {\n ch = String.fromCharCode(i);\n cache.push(ch);\n }\n\n for (i = 0; i < exclude.length; i++) {\n ch = exclude.charCodeAt(i);\n cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2);\n }\n\n return cache;\n}\n\n\n// Decode percent-encoded string.\n//\nfunction decode(string, exclude) {\n var cache;\n\n if (typeof exclude !== 'string') {\n exclude = decode.defaultChars;\n }\n\n cache = getDecodeCache(exclude);\n\n return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) {\n var i, l, b1, b2, b3, b4, chr,\n result = '';\n\n for (i = 0, l = seq.length; i < l; i += 3) {\n b1 = parseInt(seq.slice(i + 1, i + 3), 16);\n\n if (b1 < 0x80) {\n result += cache[b1];\n continue;\n }\n\n if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {\n // 110xxxxx 10xxxxxx\n b2 = parseInt(seq.slice(i + 4, i + 6), 16);\n\n if ((b2 & 0xC0) === 0x80) {\n chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F);\n\n if (chr < 0x80) {\n result += '\\ufffd\\ufffd';\n } else {\n result += String.fromCharCode(chr);\n }\n\n i += 3;\n continue;\n }\n }\n\n if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {\n // 1110xxxx 10xxxxxx 10xxxxxx\n b2 = parseInt(seq.slice(i + 4, i + 6), 16);\n b3 = parseInt(seq.slice(i + 7, i + 9), 16);\n\n if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {\n chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F);\n\n if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {\n result += '\\ufffd\\ufffd\\ufffd';\n } else {\n result += String.fromCharCode(chr);\n }\n\n i += 6;\n continue;\n }\n }\n\n if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {\n // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx\n b2 = parseInt(seq.slice(i + 4, i + 6), 16);\n b3 = parseInt(seq.slice(i + 7, i + 9), 16);\n b4 = parseInt(seq.slice(i + 10, i + 12), 16);\n\n if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {\n chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F);\n\n if (chr < 0x10000 || chr > 0x10FFFF) {\n result += '\\ufffd\\ufffd\\ufffd\\ufffd';\n } else {\n chr -= 0x10000;\n result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF));\n }\n\n i += 9;\n continue;\n }\n }\n\n result += '\\ufffd';\n }\n\n return result;\n });\n}\n\n\ndecode.defaultChars = ';/?:@&=+$,#';\ndecode.componentChars = '';\n\n\nmodule.exports = decode;\n\n\n//# sourceURL=webpack:///./node_modules/mdurl/decode.js?"); + +/***/ }), + +/***/ "./node_modules/mdurl/encode.js": +/*!**************************************!*\ + !*** ./node_modules/mdurl/encode.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n\n\nvar encodeCache = {};\n\n\n// Create a lookup array where anything but characters in `chars` string\n// and alphanumeric chars is percent-encoded.\n//\nfunction getEncodeCache(exclude) {\n var i, ch, cache = encodeCache[exclude];\n if (cache) { return cache; }\n\n cache = encodeCache[exclude] = [];\n\n for (i = 0; i < 128; i++) {\n ch = String.fromCharCode(i);\n\n if (/^[0-9a-z]$/i.test(ch)) {\n // always allow unencoded alphanumeric characters\n cache.push(ch);\n } else {\n cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2));\n }\n }\n\n for (i = 0; i < exclude.length; i++) {\n cache[exclude.charCodeAt(i)] = exclude[i];\n }\n\n return cache;\n}\n\n\n// Encode unsafe characters with percent-encoding, skipping already\n// encoded sequences.\n//\n// - string - string to encode\n// - exclude - list of characters to ignore (in addition to a-zA-Z0-9)\n// - keepEscaped - don't encode '%' in a correct escape sequence (default: true)\n//\nfunction encode(string, exclude, keepEscaped) {\n var i, l, code, nextCode, cache,\n result = '';\n\n if (typeof exclude !== 'string') {\n // encode(string, keepEscaped)\n keepEscaped = exclude;\n exclude = encode.defaultChars;\n }\n\n if (typeof keepEscaped === 'undefined') {\n keepEscaped = true;\n }\n\n cache = getEncodeCache(exclude);\n\n for (i = 0, l = string.length; i < l; i++) {\n code = string.charCodeAt(i);\n\n if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {\n if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {\n result += string.slice(i, i + 3);\n i += 2;\n continue;\n }\n }\n\n if (code < 128) {\n result += cache[code];\n continue;\n }\n\n if (code >= 0xD800 && code <= 0xDFFF) {\n if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {\n nextCode = string.charCodeAt(i + 1);\n if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {\n result += encodeURIComponent(string[i] + string[i + 1]);\n i++;\n continue;\n }\n }\n result += '%EF%BF%BD';\n continue;\n }\n\n result += encodeURIComponent(string[i]);\n }\n\n return result;\n}\n\nencode.defaultChars = \";/?:@&=+$,-_.!~*'()#\";\nencode.componentChars = \"-_.!~*'()\";\n\n\nmodule.exports = encode;\n\n\n//# sourceURL=webpack:///./node_modules/mdurl/encode.js?"); + +/***/ }), + +/***/ "./node_modules/mdurl/format.js": +/*!**************************************!*\ + !*** ./node_modules/mdurl/format.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n\n\nmodule.exports = function format(url) {\n var result = '';\n\n result += url.protocol || '';\n result += url.slashes ? '//' : '';\n result += url.auth ? url.auth + '@' : '';\n\n if (url.hostname && url.hostname.indexOf(':') !== -1) {\n // ipv6 address\n result += '[' + url.hostname + ']';\n } else {\n result += url.hostname || '';\n }\n\n result += url.port ? ':' + url.port : '';\n result += url.pathname || '';\n result += url.search || '';\n result += url.hash || '';\n\n return result;\n};\n\n\n//# sourceURL=webpack:///./node_modules/mdurl/format.js?"); + +/***/ }), + +/***/ "./node_modules/mdurl/index.js": +/*!*************************************!*\ + !*** ./node_modules/mdurl/index.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n\nmodule.exports.encode = __webpack_require__(/*! ./encode */ \"./node_modules/mdurl/encode.js\");\nmodule.exports.decode = __webpack_require__(/*! ./decode */ \"./node_modules/mdurl/decode.js\");\nmodule.exports.format = __webpack_require__(/*! ./format */ \"./node_modules/mdurl/format.js\");\nmodule.exports.parse = __webpack_require__(/*! ./parse */ \"./node_modules/mdurl/parse.js\");\n\n\n//# sourceURL=webpack:///./node_modules/mdurl/index.js?"); + +/***/ }), + +/***/ "./node_modules/mdurl/parse.js": +/*!*************************************!*\ + !*** ./node_modules/mdurl/parse.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n//\n// Changes from joyent/node:\n//\n// 1. No leading slash in paths,\n// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`\n//\n// 2. Backslashes are not replaced with slashes,\n// so `http:\\\\example.org\\` is treated like a relative path\n//\n// 3. Trailing colon is treated like a part of the path,\n// i.e. in `http://example.org:foo` pathname is `:foo`\n//\n// 4. Nothing is URL-encoded in the resulting object,\n// (in joyent/node some chars in auth and paths are encoded)\n//\n// 5. `url.parse()` does not have `parseQueryString` argument\n//\n// 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,\n// which can be constructed using other parts of the url.\n//\n\n\nfunction Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n delims = [ '<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t' ],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = [ '{', '}', '|', '\\\\', '^', '`' ].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = [ '\\'' ].concat(unwise),\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n nonHostChars = [ '%', '/', '?', ';', '#' ].concat(autoEscape),\n hostEndingChars = [ '/', '?', '#' ],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n /* eslint-disable no-script-url */\n // protocols that never have a hostname.\n hostlessProtocol = {\n 'javascript': true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n 'http': true,\n 'https': true,\n 'ftp': true,\n 'gopher': true,\n 'file': true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n };\n /* eslint-enable no-script-url */\n\nfunction urlParse(url, slashesDenoteHost) {\n if (url && url instanceof Url) { return url; }\n\n var u = new Url();\n u.parse(url, slashesDenoteHost);\n return u;\n}\n\nUrl.prototype.parse = function(url, slashesDenoteHost) {\n var i, l, lowerProto, hec, slashes,\n rest = url;\n\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n }\n return this;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n lowerProto = proto.toLowerCase();\n this.protocol = proto;\n rest = rest.substr(proto.length);\n }\n\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n\n if (!hostlessProtocol[proto] &&\n (slashes || (proto && !slashedProtocol[proto]))) {\n\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n //\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n //\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (i = 0; i < hostEndingChars.length; i++) {\n hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {\n hostEnd = hec;\n }\n }\n\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = auth;\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (i = 0; i < nonHostChars.length; i++) {\n hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {\n hostEnd = hec;\n }\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1) {\n hostEnd = rest.length;\n }\n\n if (rest[hostEnd - 1] === ':') { hostEnd--; }\n var host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n this.parseHost(host);\n\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || '';\n\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n var ipv6Hostname = this.hostname[0] === '[' &&\n this.hostname[this.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) { continue; }\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = notHost.join('.') + rest;\n }\n this.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = '';\n }\n\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n }\n }\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n this.search = rest.substr(qm);\n rest = rest.slice(0, qm);\n }\n if (rest) { this.pathname = rest; }\n if (slashedProtocol[lowerProto] &&\n this.hostname && !this.pathname) {\n this.pathname = '';\n }\n\n return this;\n};\n\nUrl.prototype.parseHost = function(host) {\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) { this.hostname = host; }\n};\n\nmodule.exports = urlParse;\n\n\n//# sourceURL=webpack:///./node_modules/mdurl/parse.js?"); + +/***/ }), + +/***/ "./node_modules/node-libs-browser/node_modules/punycode/punycode.js": +/*!**************************************************************************!*\ + !*** ./node_modules/node-libs-browser/node_modules/punycode/punycode.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = true && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = true && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow new RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see \n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t counter = 0,\n\t\t length = string.length,\n\t\t value,\n\t\t extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * https://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t inputLength = input.length,\n\t\t out,\n\t\t i = 0,\n\t\t n = initialN,\n\t\t bias = initialBias,\n\t\t basic,\n\t\t j,\n\t\t index,\n\t\t oldi,\n\t\t w,\n\t\t k,\n\t\t digit,\n\t\t t,\n\t\t /** Cached calculation results */\n\t\t baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t delta,\n\t\t handledCPCount,\n\t\t basicLength,\n\t\t bias,\n\t\t j,\n\t\t m,\n\t\t q,\n\t\t k,\n\t\t t,\n\t\t currentValue,\n\t\t output = [],\n\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t inputLength,\n\t\t /** Cached calculation results */\n\t\t handledCPCountPlusOne,\n\t\t baseMinusT,\n\t\t qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.4.1',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see \n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttrue\n\t) {\n\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {\n\t\t\treturn punycode;\n\t\t}).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else {}\n\n}(this));\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module), __webpack_require__(/*! ./../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/node-libs-browser/node_modules/punycode/punycode.js?"); + +/***/ }), + +/***/ "./node_modules/orderedmap/index.es.js": +/*!*********************************************!*\ + !*** ./node_modules/orderedmap/index.es.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n// ::- Persistent data structure representing an ordered mapping from\n// strings to values, with some convenient update methods.\nfunction OrderedMap(content) {\n this.content = content;\n}\n\nOrderedMap.prototype = {\n constructor: OrderedMap,\n\n find: function(key) {\n for (var i = 0; i < this.content.length; i += 2)\n if (this.content[i] === key) return i\n return -1\n },\n\n // :: (string) → ?any\n // Retrieve the value stored under `key`, or return undefined when\n // no such key exists.\n get: function(key) {\n var found = this.find(key);\n return found == -1 ? undefined : this.content[found + 1]\n },\n\n // :: (string, any, ?string) → OrderedMap\n // Create a new map by replacing the value of `key` with a new\n // value, or adding a binding to the end of the map. If `newKey` is\n // given, the key of the binding will be replaced with that key.\n update: function(key, value, newKey) {\n var self = newKey && newKey != key ? this.remove(newKey) : this;\n var found = self.find(key), content = self.content.slice();\n if (found == -1) {\n content.push(newKey || key, value);\n } else {\n content[found + 1] = value;\n if (newKey) content[found] = newKey;\n }\n return new OrderedMap(content)\n },\n\n // :: (string) → OrderedMap\n // Return a map with the given key removed, if it existed.\n remove: function(key) {\n var found = this.find(key);\n if (found == -1) return this\n var content = this.content.slice();\n content.splice(found, 2);\n return new OrderedMap(content)\n },\n\n // :: (string, any) → OrderedMap\n // Add a new key to the start of the map.\n addToStart: function(key, value) {\n return new OrderedMap([key, value].concat(this.remove(key).content))\n },\n\n // :: (string, any) → OrderedMap\n // Add a new key to the end of the map.\n addToEnd: function(key, value) {\n var content = this.remove(key).content.slice();\n content.push(key, value);\n return new OrderedMap(content)\n },\n\n // :: (string, string, any) → OrderedMap\n // Add a key after the given key. If `place` is not found, the new\n // key is added to the end.\n addBefore: function(place, key, value) {\n var without = this.remove(key), content = without.content.slice();\n var found = without.find(place);\n content.splice(found == -1 ? content.length : found, 0, key, value);\n return new OrderedMap(content)\n },\n\n // :: ((key: string, value: any))\n // Call the given function for each key/value pair in the map, in\n // order.\n forEach: function(f) {\n for (var i = 0; i < this.content.length; i += 2)\n f(this.content[i], this.content[i + 1]);\n },\n\n // :: (union) → OrderedMap\n // Create a new map by prepending the keys in this map that don't\n // appear in `map` before the keys in `map`.\n prepend: function(map) {\n map = OrderedMap.from(map);\n if (!map.size) return this\n return new OrderedMap(map.content.concat(this.subtract(map).content))\n },\n\n // :: (union) → OrderedMap\n // Create a new map by appending the keys in this map that don't\n // appear in `map` after the keys in `map`.\n append: function(map) {\n map = OrderedMap.from(map);\n if (!map.size) return this\n return new OrderedMap(this.subtract(map).content.concat(map.content))\n },\n\n // :: (union) → OrderedMap\n // Create a map containing all the keys in this map that don't\n // appear in `map`.\n subtract: function(map) {\n var result = this;\n map = OrderedMap.from(map);\n for (var i = 0; i < map.content.length; i += 2)\n result = result.remove(map.content[i]);\n return result\n },\n\n // :: number\n // The amount of keys in this map.\n get size() {\n return this.content.length >> 1\n }\n};\n\n// :: (?union) → OrderedMap\n// Return a map with the given content. If null, create an empty\n// map. If given an ordered map, return that map itself. If given an\n// object, create a map from the object's properties.\nOrderedMap.from = function(value) {\n if (value instanceof OrderedMap) return value\n var content = [];\n if (value) for (var prop in value) content.push(prop, value[prop]);\n return new OrderedMap(content)\n};\n\nvar orderedmap = OrderedMap;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (orderedmap);\n\n\n//# sourceURL=webpack:///./node_modules/orderedmap/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/prosemirror-commands/dist/index.es.js": +/*!************************************************************!*\ + !*** ./node_modules/prosemirror-commands/dist/index.es.js ***! + \************************************************************/ +/*! exports provided: autoJoin, baseKeymap, chainCommands, createParagraphNear, deleteSelection, exitCode, joinBackward, joinDown, joinForward, joinUp, lift, liftEmptyBlock, macBaseKeymap, newlineInCode, pcBaseKeymap, selectAll, selectNodeBackward, selectNodeForward, selectParentNode, setBlockType, splitBlock, splitBlockKeepMarks, toggleMark, wrapIn */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"autoJoin\", function() { return autoJoin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"baseKeymap\", function() { return baseKeymap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"chainCommands\", function() { return chainCommands; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createParagraphNear\", function() { return createParagraphNear; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deleteSelection\", function() { return deleteSelection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exitCode\", function() { return exitCode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"joinBackward\", function() { return joinBackward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"joinDown\", function() { return joinDown; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"joinForward\", function() { return joinForward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"joinUp\", function() { return joinUp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lift\", function() { return lift; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"liftEmptyBlock\", function() { return liftEmptyBlock; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"macBaseKeymap\", function() { return macBaseKeymap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newlineInCode\", function() { return newlineInCode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pcBaseKeymap\", function() { return pcBaseKeymap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"selectAll\", function() { return selectAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"selectNodeBackward\", function() { return selectNodeBackward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"selectNodeForward\", function() { return selectNodeForward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"selectParentNode\", function() { return selectParentNode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setBlockType\", function() { return setBlockType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"splitBlock\", function() { return splitBlock; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"splitBlockKeepMarks\", function() { return splitBlockKeepMarks; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toggleMark\", function() { return toggleMark; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"wrapIn\", function() { return wrapIn; });\n/* harmony import */ var prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prosemirror-transform */ \"./node_modules/prosemirror-transform/dist/index.es.js\");\n/* harmony import */ var prosemirror_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prosemirror-model */ \"./node_modules/prosemirror-model/dist/index.es.js\");\n/* harmony import */ var prosemirror_state__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prosemirror-state */ \"./node_modules/prosemirror-state/dist/index.es.js\");\n\n\n\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Delete the selection, if there is one.\nfunction deleteSelection(state, dispatch) {\n if (state.selection.empty) { return false }\n if (dispatch) { dispatch(state.tr.deleteSelection().scrollIntoView()); }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction), ?EditorView) → bool\n// If the selection is empty and at the start of a textblock, try to\n// reduce the distance between that block and the one before it—if\n// there's a block directly before it that can be joined, join them.\n// If not, try to move the selected block closer to the next one in\n// the document structure by lifting it out of its parent or moving it\n// into a parent of the previous block. Will use the view for accurate\n// (bidi-aware) start-of-textblock detection if given.\nfunction joinBackward(state, dispatch, view) {\n var ref = state.selection;\n var $cursor = ref.$cursor;\n if (!$cursor || (view ? !view.endOfTextblock(\"backward\", state)\n : $cursor.parentOffset > 0))\n { return false }\n\n var $cut = findCutBefore($cursor);\n\n // If there is no node before this, try to lift\n if (!$cut) {\n var range = $cursor.blockRange(), target = range && Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"liftTarget\"])(range);\n if (target == null) { return false }\n if (dispatch) { dispatch(state.tr.lift(range, target).scrollIntoView()); }\n return true\n }\n\n var before = $cut.nodeBefore;\n // Apply the joining algorithm\n if (!before.type.spec.isolating && deleteBarrier(state, $cut, dispatch))\n { return true }\n\n // If the node below has no content and the node above is\n // selectable, delete the node below and select the one above.\n if ($cursor.parent.content.size == 0 &&\n (textblockAt(before, \"end\") || prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"NodeSelection\"].isSelectable(before))) {\n if (dispatch) {\n var tr = state.tr.deleteRange($cursor.before(), $cursor.after());\n tr.setSelection(textblockAt(before, \"end\") ? prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"Selection\"].findFrom(tr.doc.resolve(tr.mapping.map($cut.pos, -1)), -1)\n : prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"NodeSelection\"].create(tr.doc, $cut.pos - before.nodeSize));\n dispatch(tr.scrollIntoView());\n }\n return true\n }\n\n // If the node before is an atom, delete it\n if (before.isAtom && $cut.depth == $cursor.depth - 1) {\n if (dispatch) { dispatch(state.tr.delete($cut.pos - before.nodeSize, $cut.pos).scrollIntoView()); }\n return true\n }\n\n return false\n}\n\nfunction textblockAt(node, side) {\n for (; node; node = (side == \"start\" ? node.firstChild : node.lastChild))\n { if (node.isTextblock) { return true } }\n return false\n}\n\n// :: (EditorState, ?(tr: Transaction), ?EditorView) → bool\n// When the selection is empty and at the start of a textblock, select\n// the node before that textblock, if possible. This is intended to be\n// bound to keys like backspace, after\n// [`joinBackward`](#commands.joinBackward) or other deleting\n// commands, as a fall-back behavior when the schema doesn't allow\n// deletion at the selected point.\nfunction selectNodeBackward(state, dispatch, view) {\n var ref = state.selection;\n var $cursor = ref.$cursor;\n if (!$cursor || (view ? !view.endOfTextblock(\"backward\", state)\n : $cursor.parentOffset > 0))\n { return false }\n\n var $cut = findCutBefore($cursor), node = $cut && $cut.nodeBefore;\n if (!node || !prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"NodeSelection\"].isSelectable(node)) { return false }\n if (dispatch)\n { dispatch(state.tr.setSelection(prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"NodeSelection\"].create(state.doc, $cut.pos - node.nodeSize)).scrollIntoView()); }\n return true\n}\n\nfunction findCutBefore($pos) {\n if (!$pos.parent.type.spec.isolating) { for (var i = $pos.depth - 1; i >= 0; i--) {\n if ($pos.index(i) > 0) { return $pos.doc.resolve($pos.before(i + 1)) }\n if ($pos.node(i).type.spec.isolating) { break }\n } }\n return null\n}\n\n// :: (EditorState, ?(tr: Transaction), ?EditorView) → bool\n// If the selection is empty and the cursor is at the end of a\n// textblock, try to reduce or remove the boundary between that block\n// and the one after it, either by joining them or by moving the other\n// block closer to this one in the tree structure. Will use the view\n// for accurate start-of-textblock detection if given.\nfunction joinForward(state, dispatch, view) {\n var ref = state.selection;\n var $cursor = ref.$cursor;\n if (!$cursor || (view ? !view.endOfTextblock(\"forward\", state)\n : $cursor.parentOffset < $cursor.parent.content.size))\n { return false }\n\n var $cut = findCutAfter($cursor);\n\n // If there is no node after this, there's nothing to do\n if (!$cut) { return false }\n\n var after = $cut.nodeAfter;\n // Try the joining algorithm\n if (deleteBarrier(state, $cut, dispatch)) { return true }\n\n // If the node above has no content and the node below is\n // selectable, delete the node above and select the one below.\n if ($cursor.parent.content.size == 0 &&\n (textblockAt(after, \"start\") || prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"NodeSelection\"].isSelectable(after))) {\n if (dispatch) {\n var tr = state.tr.deleteRange($cursor.before(), $cursor.after());\n tr.setSelection(textblockAt(after, \"start\") ? prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"Selection\"].findFrom(tr.doc.resolve(tr.mapping.map($cut.pos)), 1)\n : prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"NodeSelection\"].create(tr.doc, tr.mapping.map($cut.pos)));\n dispatch(tr.scrollIntoView());\n }\n return true\n }\n\n // If the next node is an atom, delete it\n if (after.isAtom && $cut.depth == $cursor.depth - 1) {\n if (dispatch) { dispatch(state.tr.delete($cut.pos, $cut.pos + after.nodeSize).scrollIntoView()); }\n return true\n }\n\n return false\n}\n\n// :: (EditorState, ?(tr: Transaction), ?EditorView) → bool\n// When the selection is empty and at the end of a textblock, select\n// the node coming after that textblock, if possible. This is intended\n// to be bound to keys like delete, after\n// [`joinForward`](#commands.joinForward) and similar deleting\n// commands, to provide a fall-back behavior when the schema doesn't\n// allow deletion at the selected point.\nfunction selectNodeForward(state, dispatch, view) {\n var ref = state.selection;\n var $cursor = ref.$cursor;\n if (!$cursor || (view ? !view.endOfTextblock(\"forward\", state)\n : $cursor.parentOffset < $cursor.parent.content.size))\n { return false }\n\n var $cut = findCutAfter($cursor), node = $cut && $cut.nodeAfter;\n if (!node || !prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"NodeSelection\"].isSelectable(node)) { return false }\n if (dispatch)\n { dispatch(state.tr.setSelection(prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"NodeSelection\"].create(state.doc, $cut.pos)).scrollIntoView()); }\n return true\n}\n\nfunction findCutAfter($pos) {\n if (!$pos.parent.type.spec.isolating) { for (var i = $pos.depth - 1; i >= 0; i--) {\n var parent = $pos.node(i);\n if ($pos.index(i) + 1 < parent.childCount) { return $pos.doc.resolve($pos.after(i + 1)) }\n if (parent.type.spec.isolating) { break }\n } }\n return null\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Join the selected block or, if there is a text selection, the\n// closest ancestor block of the selection that can be joined, with\n// the sibling above it.\nfunction joinUp(state, dispatch) {\n var sel = state.selection, nodeSel = sel instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"NodeSelection\"], point;\n if (nodeSel) {\n if (sel.node.isTextblock || !Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"canJoin\"])(state.doc, sel.from)) { return false }\n point = sel.from;\n } else {\n point = Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"joinPoint\"])(state.doc, sel.from, -1);\n if (point == null) { return false }\n }\n if (dispatch) {\n var tr = state.tr.join(point);\n if (nodeSel) { tr.setSelection(prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"NodeSelection\"].create(tr.doc, point - state.doc.resolve(point).nodeBefore.nodeSize)); }\n dispatch(tr.scrollIntoView());\n }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Join the selected block, or the closest ancestor of the selection\n// that can be joined, with the sibling after it.\nfunction joinDown(state, dispatch) {\n var sel = state.selection, point;\n if (sel instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"NodeSelection\"]) {\n if (sel.node.isTextblock || !Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"canJoin\"])(state.doc, sel.to)) { return false }\n point = sel.to;\n } else {\n point = Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"joinPoint\"])(state.doc, sel.to, 1);\n if (point == null) { return false }\n }\n if (dispatch)\n { dispatch(state.tr.join(point).scrollIntoView()); }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Lift the selected block, or the closest ancestor block of the\n// selection that can be lifted, out of its parent node.\nfunction lift(state, dispatch) {\n var ref = state.selection;\n var $from = ref.$from;\n var $to = ref.$to;\n var range = $from.blockRange($to), target = range && Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"liftTarget\"])(range);\n if (target == null) { return false }\n if (dispatch) { dispatch(state.tr.lift(range, target).scrollIntoView()); }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// If the selection is in a node whose type has a truthy\n// [`code`](#model.NodeSpec.code) property in its spec, replace the\n// selection with a newline character.\nfunction newlineInCode(state, dispatch) {\n var ref = state.selection;\n var $head = ref.$head;\n var $anchor = ref.$anchor;\n if (!$head.parent.type.spec.code || !$head.sameParent($anchor)) { return false }\n if (dispatch) { dispatch(state.tr.insertText(\"\\n\").scrollIntoView()); }\n return true\n}\n\nfunction defaultBlockAt(match) {\n for (var i = 0; i < match.edgeCount; i++) {\n var ref = match.edge(i);\n var type = ref.type;\n if (type.isTextblock && !type.hasRequiredAttrs()) { return type }\n }\n return null\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// When the selection is in a node with a truthy\n// [`code`](#model.NodeSpec.code) property in its spec, create a\n// default block after the code block, and move the cursor there.\nfunction exitCode(state, dispatch) {\n var ref = state.selection;\n var $head = ref.$head;\n var $anchor = ref.$anchor;\n if (!$head.parent.type.spec.code || !$head.sameParent($anchor)) { return false }\n var above = $head.node(-1), after = $head.indexAfter(-1), type = defaultBlockAt(above.contentMatchAt(after));\n if (!above.canReplaceWith(after, after, type)) { return false }\n if (dispatch) {\n var pos = $head.after(), tr = state.tr.replaceWith(pos, pos, type.createAndFill());\n tr.setSelection(prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"Selection\"].near(tr.doc.resolve(pos), 1));\n dispatch(tr.scrollIntoView());\n }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// If a block node is selected, create an empty paragraph before (if\n// it is its parent's first child) or after it.\nfunction createParagraphNear(state, dispatch) {\n var ref = state.selection;\n var $from = ref.$from;\n var $to = ref.$to;\n if ($from.parent.inlineContent || $to.parent.inlineContent) { return false }\n var type = defaultBlockAt($from.parent.contentMatchAt($to.indexAfter()));\n if (!type || !type.isTextblock) { return false }\n if (dispatch) {\n var side = (!$from.parentOffset && $to.index() < $to.parent.childCount ? $from : $to).pos;\n var tr = state.tr.insert(side, type.createAndFill());\n tr.setSelection(prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"TextSelection\"].create(tr.doc, side + 1));\n dispatch(tr.scrollIntoView());\n }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// If the cursor is in an empty textblock that can be lifted, lift the\n// block.\nfunction liftEmptyBlock(state, dispatch) {\n var ref = state.selection;\n var $cursor = ref.$cursor;\n if (!$cursor || $cursor.parent.content.size) { return false }\n if ($cursor.depth > 1 && $cursor.after() != $cursor.end(-1)) {\n var before = $cursor.before();\n if (Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"canSplit\"])(state.doc, before)) {\n if (dispatch) { dispatch(state.tr.split(before).scrollIntoView()); }\n return true\n }\n }\n var range = $cursor.blockRange(), target = range && Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"liftTarget\"])(range);\n if (target == null) { return false }\n if (dispatch) { dispatch(state.tr.lift(range, target).scrollIntoView()); }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Split the parent block of the selection. If the selection is a text\n// selection, also delete its content.\nfunction splitBlock(state, dispatch) {\n var ref = state.selection;\n var $from = ref.$from;\n var $to = ref.$to;\n if (state.selection instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"NodeSelection\"] && state.selection.node.isBlock) {\n if (!$from.parentOffset || !Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"canSplit\"])(state.doc, $from.pos)) { return false }\n if (dispatch) { dispatch(state.tr.split($from.pos).scrollIntoView()); }\n return true\n }\n\n if (!$from.parent.isBlock) { return false }\n\n if (dispatch) {\n var atEnd = $to.parentOffset == $to.parent.content.size;\n var tr = state.tr;\n if (state.selection instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"TextSelection\"]) { tr.deleteSelection(); }\n var deflt = $from.depth == 0 ? null : defaultBlockAt($from.node(-1).contentMatchAt($from.indexAfter(-1)));\n var types = atEnd && deflt ? [{type: deflt}] : null;\n var can = Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"canSplit\"])(tr.doc, tr.mapping.map($from.pos), 1, types);\n if (!types && !can && Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"canSplit\"])(tr.doc, tr.mapping.map($from.pos), 1, deflt && [{type: deflt}])) {\n types = [{type: deflt}];\n can = true;\n }\n if (can) {\n tr.split(tr.mapping.map($from.pos), 1, types);\n if (!atEnd && !$from.parentOffset && $from.parent.type != deflt &&\n $from.node(-1).canReplace($from.index(-1), $from.indexAfter(-1), prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(deflt.create(), $from.parent)))\n { tr.setNodeMarkup(tr.mapping.map($from.before()), deflt); }\n }\n dispatch(tr.scrollIntoView());\n }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Acts like [`splitBlock`](#commands.splitBlock), but without\n// resetting the set of active marks at the cursor.\nfunction splitBlockKeepMarks(state, dispatch) {\n return splitBlock(state, dispatch && (function (tr) {\n var marks = state.storedMarks || (state.selection.$to.parentOffset && state.selection.$from.marks());\n if (marks) { tr.ensureMarks(marks); }\n dispatch(tr);\n }))\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Move the selection to the node wrapping the current selection, if\n// any. (Will not select the document node.)\nfunction selectParentNode(state, dispatch) {\n var ref = state.selection;\n var $from = ref.$from;\n var to = ref.to;\n var pos;\n var same = $from.sharedDepth(to);\n if (same == 0) { return false }\n pos = $from.before(same);\n if (dispatch) { dispatch(state.tr.setSelection(prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"NodeSelection\"].create(state.doc, pos))); }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// Select the whole document.\nfunction selectAll(state, dispatch) {\n if (dispatch) { dispatch(state.tr.setSelection(new prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"AllSelection\"](state.doc))); }\n return true\n}\n\nfunction joinMaybeClear(state, $pos, dispatch) {\n var before = $pos.nodeBefore, after = $pos.nodeAfter, index = $pos.index();\n if (!before || !after || !before.type.compatibleContent(after.type)) { return false }\n if (!before.content.size && $pos.parent.canReplace(index - 1, index)) {\n if (dispatch) { dispatch(state.tr.delete($pos.pos - before.nodeSize, $pos.pos).scrollIntoView()); }\n return true\n }\n if (!$pos.parent.canReplace(index, index + 1) || !(after.isTextblock || Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"canJoin\"])(state.doc, $pos.pos)))\n { return false }\n if (dispatch)\n { dispatch(state.tr\n .clearIncompatible($pos.pos, before.type, before.contentMatchAt(before.childCount))\n .join($pos.pos)\n .scrollIntoView()); }\n return true\n}\n\nfunction deleteBarrier(state, $cut, dispatch) {\n var before = $cut.nodeBefore, after = $cut.nodeAfter, conn, match;\n if (before.type.spec.isolating || after.type.spec.isolating) { return false }\n if (joinMaybeClear(state, $cut, dispatch)) { return true }\n\n if ($cut.parent.canReplace($cut.index(), $cut.index() + 1) &&\n (conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) &&\n match.matchType(conn[0] || after.type).validEnd) {\n if (dispatch) {\n var end = $cut.pos + after.nodeSize, wrap = prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].empty;\n for (var i = conn.length - 1; i >= 0; i--)\n { wrap = prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(conn[i].create(null, wrap)); }\n wrap = prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(before.copy(wrap));\n var tr = state.tr.step(new prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"ReplaceAroundStep\"]($cut.pos - 1, end, $cut.pos, end, new prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Slice\"](wrap, 1, 0), conn.length, true));\n var joinAt = end + 2 * conn.length;\n if (Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"canJoin\"])(tr.doc, joinAt)) { tr.join(joinAt); }\n dispatch(tr.scrollIntoView());\n }\n return true\n }\n\n var selAfter = prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"Selection\"].findFrom($cut, 1);\n var range = selAfter && selAfter.$from.blockRange(selAfter.$to), target = range && Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"liftTarget\"])(range);\n if (target != null && target >= $cut.depth) {\n if (dispatch) { dispatch(state.tr.lift(range, target).scrollIntoView()); }\n return true\n }\n\n return false\n}\n\n// Parameterized commands\n\n// :: (NodeType, ?Object) → (state: EditorState, dispatch: ?(tr: Transaction)) → bool\n// Wrap the selection in a node of the given type with the given\n// attributes.\nfunction wrapIn(nodeType, attrs) {\n return function(state, dispatch) {\n var ref = state.selection;\n var $from = ref.$from;\n var $to = ref.$to;\n var range = $from.blockRange($to), wrapping = range && Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"findWrapping\"])(range, nodeType, attrs);\n if (!wrapping) { return false }\n if (dispatch) { dispatch(state.tr.wrap(range, wrapping).scrollIntoView()); }\n return true\n }\n}\n\n// :: (NodeType, ?Object) → (state: EditorState, dispatch: ?(tr: Transaction)) → bool\n// Returns a command that tries to set the selected textblocks to the\n// given node type with the given attributes.\nfunction setBlockType(nodeType, attrs) {\n return function(state, dispatch) {\n var ref = state.selection;\n var from = ref.from;\n var to = ref.to;\n var applicable = false;\n state.doc.nodesBetween(from, to, function (node, pos) {\n if (applicable) { return false }\n if (!node.isTextblock || node.hasMarkup(nodeType, attrs)) { return }\n if (node.type == nodeType) {\n applicable = true;\n } else {\n var $pos = state.doc.resolve(pos), index = $pos.index();\n applicable = $pos.parent.canReplaceWith(index, index + 1, nodeType);\n }\n });\n if (!applicable) { return false }\n if (dispatch) { dispatch(state.tr.setBlockType(from, to, nodeType, attrs).scrollIntoView()); }\n return true\n }\n}\n\nfunction markApplies(doc, ranges, type) {\n var loop = function ( i ) {\n var ref = ranges[i];\n var $from = ref.$from;\n var $to = ref.$to;\n var can = $from.depth == 0 ? doc.type.allowsMarkType(type) : false;\n doc.nodesBetween($from.pos, $to.pos, function (node) {\n if (can) { return false }\n can = node.inlineContent && node.type.allowsMarkType(type);\n });\n if (can) { return { v: true } }\n };\n\n for (var i = 0; i < ranges.length; i++) {\n var returned = loop( i );\n\n if ( returned ) return returned.v;\n }\n return false\n}\n\n// :: (MarkType, ?Object) → (state: EditorState, dispatch: ?(tr: Transaction)) → bool\n// Create a command function that toggles the given mark with the\n// given attributes. Will return `false` when the current selection\n// doesn't support that mark. This will remove the mark if any marks\n// of that type exist in the selection, or add it otherwise. If the\n// selection is empty, this applies to the [stored\n// marks](#state.EditorState.storedMarks) instead of a range of the\n// document.\nfunction toggleMark(markType, attrs) {\n return function(state, dispatch) {\n var ref = state.selection;\n var empty = ref.empty;\n var $cursor = ref.$cursor;\n var ranges = ref.ranges;\n if ((empty && !$cursor) || !markApplies(state.doc, ranges, markType)) { return false }\n if (dispatch) {\n if ($cursor) {\n if (markType.isInSet(state.storedMarks || $cursor.marks()))\n { dispatch(state.tr.removeStoredMark(markType)); }\n else\n { dispatch(state.tr.addStoredMark(markType.create(attrs))); }\n } else {\n var has = false, tr = state.tr;\n for (var i = 0; !has && i < ranges.length; i++) {\n var ref$1 = ranges[i];\n var $from = ref$1.$from;\n var $to = ref$1.$to;\n has = state.doc.rangeHasMark($from.pos, $to.pos, markType);\n }\n for (var i$1 = 0; i$1 < ranges.length; i$1++) {\n var ref$2 = ranges[i$1];\n var $from$1 = ref$2.$from;\n var $to$1 = ref$2.$to;\n if (has) { tr.removeMark($from$1.pos, $to$1.pos, markType); }\n else { tr.addMark($from$1.pos, $to$1.pos, markType.create(attrs)); }\n }\n dispatch(tr.scrollIntoView());\n }\n }\n return true\n }\n}\n\nfunction wrapDispatchForJoin(dispatch, isJoinable) {\n return function (tr) {\n if (!tr.isGeneric) { return dispatch(tr) }\n\n var ranges = [];\n for (var i = 0; i < tr.mapping.maps.length; i++) {\n var map = tr.mapping.maps[i];\n for (var j = 0; j < ranges.length; j++)\n { ranges[j] = map.map(ranges[j]); }\n map.forEach(function (_s, _e, from, to) { return ranges.push(from, to); });\n }\n\n // Figure out which joinable points exist inside those ranges,\n // by checking all node boundaries in their parent nodes.\n var joinable = [];\n for (var i$1 = 0; i$1 < ranges.length; i$1 += 2) {\n var from = ranges[i$1], to = ranges[i$1 + 1];\n var $from = tr.doc.resolve(from), depth = $from.sharedDepth(to), parent = $from.node(depth);\n for (var index = $from.indexAfter(depth), pos = $from.after(depth + 1); pos <= to; ++index) {\n var after = parent.maybeChild(index);\n if (!after) { break }\n if (index && joinable.indexOf(pos) == -1) {\n var before = parent.child(index - 1);\n if (before.type == after.type && isJoinable(before, after))\n { joinable.push(pos); }\n }\n pos += after.nodeSize;\n }\n }\n // Join the joinable points\n joinable.sort(function (a, b) { return a - b; });\n for (var i$2 = joinable.length - 1; i$2 >= 0; i$2--) {\n if (Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"canJoin\"])(tr.doc, joinable[i$2])) { tr.join(joinable[i$2]); }\n }\n dispatch(tr);\n }\n}\n\n// :: ((state: EditorState, ?(tr: Transaction)) → bool, union<(before: Node, after: Node) → bool, [string]>) → (state: EditorState, ?(tr: Transaction)) → bool\n// Wrap a command so that, when it produces a transform that causes\n// two joinable nodes to end up next to each other, those are joined.\n// Nodes are considered joinable when they are of the same type and\n// when the `isJoinable` predicate returns true for them or, if an\n// array of strings was passed, if their node type name is in that\n// array.\nfunction autoJoin(command, isJoinable) {\n if (Array.isArray(isJoinable)) {\n var types = isJoinable;\n isJoinable = function (node) { return types.indexOf(node.type.name) > -1; };\n }\n return function (state, dispatch) { return command(state, dispatch && wrapDispatchForJoin(dispatch, isJoinable)); }\n}\n\n// :: (...[(EditorState, ?(tr: Transaction), ?EditorView) → bool]) → (EditorState, ?(tr: Transaction), ?EditorView) → bool\n// Combine a number of command functions into a single function (which\n// calls them one by one until one returns true).\nfunction chainCommands() {\n var commands = [], len = arguments.length;\n while ( len-- ) commands[ len ] = arguments[ len ];\n\n return function(state, dispatch, view) {\n for (var i = 0; i < commands.length; i++)\n { if (commands[i](state, dispatch, view)) { return true } }\n return false\n }\n}\n\nvar backspace = chainCommands(deleteSelection, joinBackward, selectNodeBackward);\nvar del = chainCommands(deleteSelection, joinForward, selectNodeForward);\n\n// :: Object\n// A basic keymap containing bindings not specific to any schema.\n// Binds the following keys (when multiple commands are listed, they\n// are chained with [`chainCommands`](#commands.chainCommands)):\n//\n// * **Enter** to `newlineInCode`, `createParagraphNear`, `liftEmptyBlock`, `splitBlock`\n// * **Mod-Enter** to `exitCode`\n// * **Backspace** and **Mod-Backspace** to `deleteSelection`, `joinBackward`, `selectNodeBackward`\n// * **Delete** and **Mod-Delete** to `deleteSelection`, `joinForward`, `selectNodeForward`\n// * **Mod-Delete** to `deleteSelection`, `joinForward`, `selectNodeForward`\n// * **Mod-a** to `selectAll`\nvar pcBaseKeymap = {\n \"Enter\": chainCommands(newlineInCode, createParagraphNear, liftEmptyBlock, splitBlock),\n \"Mod-Enter\": exitCode,\n \"Backspace\": backspace,\n \"Mod-Backspace\": backspace,\n \"Delete\": del,\n \"Mod-Delete\": del,\n \"Mod-a\": selectAll\n};\n\n// :: Object\n// A copy of `pcBaseKeymap` that also binds **Ctrl-h** like Backspace,\n// **Ctrl-d** like Delete, **Alt-Backspace** like Ctrl-Backspace, and\n// **Ctrl-Alt-Backspace**, **Alt-Delete**, and **Alt-d** like\n// Ctrl-Delete.\nvar macBaseKeymap = {\n \"Ctrl-h\": pcBaseKeymap[\"Backspace\"],\n \"Alt-Backspace\": pcBaseKeymap[\"Mod-Backspace\"],\n \"Ctrl-d\": pcBaseKeymap[\"Delete\"],\n \"Ctrl-Alt-Backspace\": pcBaseKeymap[\"Mod-Delete\"],\n \"Alt-Delete\": pcBaseKeymap[\"Mod-Delete\"],\n \"Alt-d\": pcBaseKeymap[\"Mod-Delete\"]\n};\nfor (var key in pcBaseKeymap) { macBaseKeymap[key] = pcBaseKeymap[key]; }\n\n// declare global: os, navigator\nvar mac = typeof navigator != \"undefined\" ? /Mac/.test(navigator.platform)\n : typeof os != \"undefined\" ? os.platform() == \"darwin\" : false;\n\n// :: Object\n// Depending on the detected platform, this will hold\n// [`pcBasekeymap`](#commands.pcBaseKeymap) or\n// [`macBaseKeymap`](#commands.macBaseKeymap).\nvar baseKeymap = mac ? macBaseKeymap : pcBaseKeymap;\n\n\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/prosemirror-commands/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/prosemirror-dropcursor/dist/index.es.js": +/*!**************************************************************!*\ + !*** ./node_modules/prosemirror-dropcursor/dist/index.es.js ***! + \**************************************************************/ +/*! exports provided: dropCursor */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dropCursor\", function() { return dropCursor; });\n/* harmony import */ var prosemirror_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prosemirror-state */ \"./node_modules/prosemirror-state/dist/index.es.js\");\n/* harmony import */ var prosemirror_transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prosemirror-transform */ \"./node_modules/prosemirror-transform/dist/index.es.js\");\n\n\n\n// :: (options: ?Object) → Plugin\n// Create a plugin that, when added to a ProseMirror instance,\n// causes a decoration to show up at the drop position when something\n// is dragged over the editor.\n//\n// options::- These options are supported:\n//\n// color:: ?string\n// The color of the cursor. Defaults to `black`.\n//\n// width:: ?number\n// The precise width of the cursor in pixels. Defaults to 1.\n//\n// class:: ?string\n// A CSS class name to add to the cursor element.\nfunction dropCursor(options) {\n if ( options === void 0 ) options = {};\n\n return new prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"Plugin\"]({\n view: function view(editorView) { return new DropCursorView(editorView, options) }\n })\n}\n\nvar DropCursorView = function DropCursorView(editorView, options) {\n var this$1 = this;\n\n this.editorView = editorView;\n this.width = options.width || 1;\n this.color = options.color || \"black\";\n this.class = options.class;\n this.cursorPos = null;\n this.element = null;\n this.timeout = null;\n\n this.handlers = [\"dragover\", \"dragend\", \"drop\", \"dragleave\"].map(function (name) {\n var handler = function (e) { return this$1[name](e); };\n editorView.dom.addEventListener(name, handler);\n return {name: name, handler: handler}\n });\n};\n\nDropCursorView.prototype.destroy = function destroy () {\n var this$1 = this;\n\n this.handlers.forEach(function (ref) {\n var name = ref.name;\n var handler = ref.handler;\n\n return this$1.editorView.dom.removeEventListener(name, handler);\n });\n};\n\nDropCursorView.prototype.update = function update (editorView, prevState) {\n if (this.cursorPos != null && prevState.doc != editorView.state.doc) { this.updateOverlay(); }\n};\n\nDropCursorView.prototype.setCursor = function setCursor (pos) {\n if (pos == this.cursorPos) { return }\n this.cursorPos = pos;\n if (pos == null) {\n this.element.parentNode.removeChild(this.element);\n this.element = null;\n } else {\n this.updateOverlay();\n }\n};\n\nDropCursorView.prototype.updateOverlay = function updateOverlay () {\n var $pos = this.editorView.state.doc.resolve(this.cursorPos), rect;\n if (!$pos.parent.inlineContent) {\n var before = $pos.nodeBefore, after = $pos.nodeAfter;\n if (before || after) {\n var nodeRect = this.editorView.nodeDOM(this.cursorPos - (before ?before.nodeSize : 0)).getBoundingClientRect();\n var top = before ? nodeRect.bottom : nodeRect.top;\n if (before && after)\n { top = (top + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2; }\n rect = {left: nodeRect.left, right: nodeRect.right, top: top - this.width / 2, bottom: top + this.width / 2};\n }\n }\n if (!rect) {\n var coords = this.editorView.coordsAtPos(this.cursorPos);\n rect = {left: coords.left - this.width / 2, right: coords.left + this.width / 2, top: coords.top, bottom: coords.bottom};\n }\n\n var parent = this.editorView.dom.offsetParent;\n if (!this.element) {\n this.element = parent.appendChild(document.createElement(\"div\"));\n if (this.class) { this.element.className = this.class; }\n this.element.style.cssText = \"position: absolute; z-index: 50; pointer-events: none; background-color: \" + this.color;\n }\n var parentRect = !parent || parent == document.body && getComputedStyle(parent).position == \"static\"\n ? {left: -pageXOffset, top: -pageYOffset} : parent.getBoundingClientRect();\n this.element.style.left = (rect.left - parentRect.left) + \"px\";\n this.element.style.top = (rect.top - parentRect.top) + \"px\";\n this.element.style.width = (rect.right - rect.left) + \"px\";\n this.element.style.height = (rect.bottom - rect.top) + \"px\";\n};\n\nDropCursorView.prototype.scheduleRemoval = function scheduleRemoval (timeout) {\n var this$1 = this;\n\n clearTimeout(this.timeout);\n this.timeout = setTimeout(function () { return this$1.setCursor(null); }, timeout);\n};\n\nDropCursorView.prototype.dragover = function dragover (event) {\n if (!this.editorView.editable) { return }\n var pos = this.editorView.posAtCoords({left: event.clientX, top: event.clientY});\n if (pos) {\n var target = pos.pos;\n if (this.editorView.dragging && this.editorView.dragging.slice) {\n target = Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_1__[\"dropPoint\"])(this.editorView.state.doc, target, this.editorView.dragging.slice);\n if (target == null) { target = pos.pos; }\n }\n this.setCursor(target);\n this.scheduleRemoval(5000);\n }\n};\n\nDropCursorView.prototype.dragend = function dragend () {\n this.scheduleRemoval(20);\n};\n\nDropCursorView.prototype.drop = function drop () {\n this.scheduleRemoval(20);\n};\n\nDropCursorView.prototype.dragleave = function dragleave (event) {\n if (event.target == this.editorView.dom || !this.editorView.dom.contains(event.relatedTarget))\n { this.setCursor(null); }\n};\n\n\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/prosemirror-dropcursor/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/prosemirror-example-setup/dist/index.es.js": +/*!*****************************************************************!*\ + !*** ./node_modules/prosemirror-example-setup/dist/index.es.js ***! + \*****************************************************************/ +/*! exports provided: buildInputRules, buildKeymap, buildMenuItems, exampleSetup */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"buildInputRules\", function() { return buildInputRules; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"buildKeymap\", function() { return buildKeymap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"buildMenuItems\", function() { return buildMenuItems; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exampleSetup\", function() { return exampleSetup; });\n/* harmony import */ var prosemirror_keymap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prosemirror-keymap */ \"./node_modules/prosemirror-keymap/dist/index.es.js\");\n/* harmony import */ var prosemirror_history__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prosemirror-history */ \"./node_modules/prosemirror-history/dist/index.es.js\");\n/* harmony import */ var prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prosemirror-commands */ \"./node_modules/prosemirror-commands/dist/index.es.js\");\n/* harmony import */ var prosemirror_state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prosemirror-state */ \"./node_modules/prosemirror-state/dist/index.es.js\");\n/* harmony import */ var prosemirror_dropcursor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prosemirror-dropcursor */ \"./node_modules/prosemirror-dropcursor/dist/index.es.js\");\n/* harmony import */ var prosemirror_gapcursor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prosemirror-gapcursor */ \"./node_modules/prosemirror-gapcursor/dist/index.es.js\");\n/* harmony import */ var prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prosemirror-menu */ \"./node_modules/prosemirror-menu/dist/index.es.js\");\n/* harmony import */ var prosemirror_schema_list__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prosemirror-schema-list */ \"./node_modules/prosemirror-schema-list/dist/index.es.js\");\n/* harmony import */ var prosemirror_inputrules__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prosemirror-inputrules */ \"./node_modules/prosemirror-inputrules/dist/index.es.js\");\n\n\n\n\n\n\n\n\n\n\nvar prefix = \"ProseMirror-prompt\";\n\nfunction openPrompt(options) {\n var wrapper = document.body.appendChild(document.createElement(\"div\"));\n wrapper.className = prefix;\n\n var mouseOutside = function (e) { if (!wrapper.contains(e.target)) { close(); } };\n setTimeout(function () { return window.addEventListener(\"mousedown\", mouseOutside); }, 50);\n var close = function () {\n window.removeEventListener(\"mousedown\", mouseOutside);\n if (wrapper.parentNode) { wrapper.parentNode.removeChild(wrapper); }\n };\n\n var domFields = [];\n for (var name in options.fields) { domFields.push(options.fields[name].render()); }\n\n var submitButton = document.createElement(\"button\");\n submitButton.type = \"submit\";\n submitButton.className = prefix + \"-submit\";\n submitButton.textContent = \"OK\";\n var cancelButton = document.createElement(\"button\");\n cancelButton.type = \"button\";\n cancelButton.className = prefix + \"-cancel\";\n cancelButton.textContent = \"Cancel\";\n cancelButton.addEventListener(\"click\", close);\n\n var form = wrapper.appendChild(document.createElement(\"form\"));\n if (options.title) { form.appendChild(document.createElement(\"h5\")).textContent = options.title; }\n domFields.forEach(function (field) {\n form.appendChild(document.createElement(\"div\")).appendChild(field);\n });\n var buttons = form.appendChild(document.createElement(\"div\"));\n buttons.className = prefix + \"-buttons\";\n buttons.appendChild(submitButton);\n buttons.appendChild(document.createTextNode(\" \"));\n buttons.appendChild(cancelButton);\n\n var box = wrapper.getBoundingClientRect();\n wrapper.style.top = ((window.innerHeight - box.height) / 2) + \"px\";\n wrapper.style.left = ((window.innerWidth - box.width) / 2) + \"px\";\n\n var submit = function () {\n var params = getValues(options.fields, domFields);\n if (params) {\n close();\n options.callback(params);\n }\n };\n\n form.addEventListener(\"submit\", function (e) {\n e.preventDefault();\n submit();\n });\n\n form.addEventListener(\"keydown\", function (e) {\n if (e.keyCode == 27) {\n e.preventDefault();\n close();\n } else if (e.keyCode == 13 && !(e.ctrlKey || e.metaKey || e.shiftKey)) {\n e.preventDefault();\n submit();\n } else if (e.keyCode == 9) {\n window.setTimeout(function () {\n if (!wrapper.contains(document.activeElement)) { close(); }\n }, 500);\n }\n });\n\n var input = form.elements[0];\n if (input) { input.focus(); }\n}\n\nfunction getValues(fields, domFields) {\n var result = Object.create(null), i = 0;\n for (var name in fields) {\n var field = fields[name], dom = domFields[i++];\n var value = field.read(dom), bad = field.validate(value);\n if (bad) {\n reportInvalid(dom, bad);\n return null\n }\n result[name] = field.clean(value);\n }\n return result\n}\n\nfunction reportInvalid(dom, message) {\n // FIXME this is awful and needs a lot more work\n var parent = dom.parentNode;\n var msg = parent.appendChild(document.createElement(\"div\"));\n msg.style.left = (dom.offsetLeft + dom.offsetWidth + 2) + \"px\";\n msg.style.top = (dom.offsetTop - 5) + \"px\";\n msg.className = \"ProseMirror-invalid\";\n msg.textContent = message;\n setTimeout(function () { return parent.removeChild(msg); }, 1500);\n}\n\n// ::- The type of field that `FieldPrompt` expects to be passed to it.\nvar Field = function Field(options) { this.options = options; };\n\n// render:: (state: EditorState, props: Object) → dom.Node\n// Render the field to the DOM. Should be implemented by all subclasses.\n\n// :: (dom.Node) → any\n// Read the field's value from its DOM node.\nField.prototype.read = function read (dom) { return dom.value };\n\n// :: (any) → ?string\n// A field-type-specific validation function.\nField.prototype.validateType = function validateType (_value) {};\n\nField.prototype.validate = function validate (value) {\n if (!value && this.options.required)\n { return \"Required field\" }\n return this.validateType(value) || (this.options.validate && this.options.validate(value))\n};\n\nField.prototype.clean = function clean (value) {\n return this.options.clean ? this.options.clean(value) : value\n};\n\n// ::- A field class for single-line text fields.\nvar TextField = /*@__PURE__*/(function (Field) {\n function TextField () {\n Field.apply(this, arguments);\n }\n\n if ( Field ) TextField.__proto__ = Field;\n TextField.prototype = Object.create( Field && Field.prototype );\n TextField.prototype.constructor = TextField;\n\n TextField.prototype.render = function render () {\n var input = document.createElement(\"input\");\n input.type = \"text\";\n input.placeholder = this.options.label;\n input.value = this.options.value || \"\";\n input.autocomplete = \"off\";\n return input\n };\n\n return TextField;\n}(Field));\n\n// Helpers to create specific types of items\n\nfunction canInsert(state, nodeType) {\n var $from = state.selection.$from;\n for (var d = $from.depth; d >= 0; d--) {\n var index = $from.index(d);\n if ($from.node(d).canReplaceWith(index, index, nodeType)) { return true }\n }\n return false\n}\n\nfunction insertImageItem(nodeType) {\n return new prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"MenuItem\"]({\n title: \"Insert image\",\n label: \"Image\",\n enable: function enable(state) { return canInsert(state, nodeType) },\n run: function run(state, _, view) {\n var ref = state.selection;\n var from = ref.from;\n var to = ref.to;\n var attrs = null;\n if (state.selection instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_3__[\"NodeSelection\"] && state.selection.node.type == nodeType)\n { attrs = state.selection.node.attrs; }\n openPrompt({\n title: \"Insert image\",\n fields: {\n src: new TextField({label: \"Location\", required: true, value: attrs && attrs.src}),\n title: new TextField({label: \"Title\", value: attrs && attrs.title}),\n alt: new TextField({label: \"Description\",\n value: attrs ? attrs.alt : state.doc.textBetween(from, to, \" \")})\n },\n callback: function callback(attrs) {\n view.dispatch(view.state.tr.replaceSelectionWith(nodeType.createAndFill(attrs)));\n view.focus();\n }\n });\n }\n })\n}\n\nfunction cmdItem(cmd, options) {\n var passedOptions = {\n label: options.title,\n run: cmd\n };\n for (var prop in options) { passedOptions[prop] = options[prop]; }\n if ((!options.enable || options.enable === true) && !options.select)\n { passedOptions[options.enable ? \"enable\" : \"select\"] = function (state) { return cmd(state); }; }\n\n return new prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"MenuItem\"](passedOptions)\n}\n\nfunction markActive(state, type) {\n var ref = state.selection;\n var from = ref.from;\n var $from = ref.$from;\n var to = ref.to;\n var empty = ref.empty;\n if (empty) { return type.isInSet(state.storedMarks || $from.marks()) }\n else { return state.doc.rangeHasMark(from, to, type) }\n}\n\nfunction markItem(markType, options) {\n var passedOptions = {\n active: function active(state) { return markActive(state, markType) },\n enable: true\n };\n for (var prop in options) { passedOptions[prop] = options[prop]; }\n return cmdItem(Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"toggleMark\"])(markType), passedOptions)\n}\n\nfunction linkItem(markType) {\n return new prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"MenuItem\"]({\n title: \"Add or remove link\",\n icon: prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"icons\"].link,\n active: function active(state) { return markActive(state, markType) },\n enable: function enable(state) { return !state.selection.empty },\n run: function run(state, dispatch, view) {\n if (markActive(state, markType)) {\n Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"toggleMark\"])(markType)(state, dispatch);\n return true\n }\n openPrompt({\n title: \"Create a link\",\n fields: {\n href: new TextField({\n label: \"Link target\",\n required: true\n }),\n title: new TextField({label: \"Title\"})\n },\n callback: function callback(attrs) {\n Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"toggleMark\"])(markType, attrs)(view.state, view.dispatch);\n view.focus();\n }\n });\n }\n })\n}\n\nfunction wrapListItem(nodeType, options) {\n return cmdItem(Object(prosemirror_schema_list__WEBPACK_IMPORTED_MODULE_7__[\"wrapInList\"])(nodeType, options.attrs), options)\n}\n\n// :: (Schema) → Object\n// Given a schema, look for default mark and node types in it and\n// return an object with relevant menu items relating to those marks:\n//\n// **`toggleStrong`**`: MenuItem`\n// : A menu item to toggle the [strong mark](#schema-basic.StrongMark).\n//\n// **`toggleEm`**`: MenuItem`\n// : A menu item to toggle the [emphasis mark](#schema-basic.EmMark).\n//\n// **`toggleCode`**`: MenuItem`\n// : A menu item to toggle the [code font mark](#schema-basic.CodeMark).\n//\n// **`toggleLink`**`: MenuItem`\n// : A menu item to toggle the [link mark](#schema-basic.LinkMark).\n//\n// **`insertImage`**`: MenuItem`\n// : A menu item to insert an [image](#schema-basic.Image).\n//\n// **`wrapBulletList`**`: MenuItem`\n// : A menu item to wrap the selection in a [bullet list](#schema-list.BulletList).\n//\n// **`wrapOrderedList`**`: MenuItem`\n// : A menu item to wrap the selection in an [ordered list](#schema-list.OrderedList).\n//\n// **`wrapBlockQuote`**`: MenuItem`\n// : A menu item to wrap the selection in a [block quote](#schema-basic.BlockQuote).\n//\n// **`makeParagraph`**`: MenuItem`\n// : A menu item to set the current textblock to be a normal\n// [paragraph](#schema-basic.Paragraph).\n//\n// **`makeCodeBlock`**`: MenuItem`\n// : A menu item to set the current textblock to be a\n// [code block](#schema-basic.CodeBlock).\n//\n// **`makeHead[N]`**`: MenuItem`\n// : Where _N_ is 1 to 6. Menu items to set the current textblock to\n// be a [heading](#schema-basic.Heading) of level _N_.\n//\n// **`insertHorizontalRule`**`: MenuItem`\n// : A menu item to insert a horizontal rule.\n//\n// The return value also contains some prefabricated menu elements and\n// menus, that you can use instead of composing your own menu from\n// scratch:\n//\n// **`insertMenu`**`: Dropdown`\n// : A dropdown containing the `insertImage` and\n// `insertHorizontalRule` items.\n//\n// **`typeMenu`**`: Dropdown`\n// : A dropdown containing the items for making the current\n// textblock a paragraph, code block, or heading.\n//\n// **`fullMenu`**`: [[MenuElement]]`\n// : An array of arrays of menu elements for use as the full menu\n// for, for example the [menu bar](https://github.com/prosemirror/prosemirror-menu#user-content-menubar).\nfunction buildMenuItems(schema) {\n var r = {}, type;\n if (type = schema.marks.strong)\n { r.toggleStrong = markItem(type, {title: \"Toggle strong style\", icon: prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"icons\"].strong}); }\n if (type = schema.marks.em)\n { r.toggleEm = markItem(type, {title: \"Toggle emphasis\", icon: prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"icons\"].em}); }\n if (type = schema.marks.code)\n { r.toggleCode = markItem(type, {title: \"Toggle code font\", icon: prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"icons\"].code}); }\n if (type = schema.marks.link)\n { r.toggleLink = linkItem(type); }\n\n if (type = schema.nodes.image)\n { r.insertImage = insertImageItem(type); }\n if (type = schema.nodes.bullet_list)\n { r.wrapBulletList = wrapListItem(type, {\n title: \"Wrap in bullet list\",\n icon: prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"icons\"].bulletList\n }); }\n if (type = schema.nodes.ordered_list)\n { r.wrapOrderedList = wrapListItem(type, {\n title: \"Wrap in ordered list\",\n icon: prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"icons\"].orderedList\n }); }\n if (type = schema.nodes.blockquote)\n { r.wrapBlockQuote = Object(prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"wrapItem\"])(type, {\n title: \"Wrap in block quote\",\n icon: prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"icons\"].blockquote\n }); }\n if (type = schema.nodes.paragraph)\n { r.makeParagraph = Object(prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"blockTypeItem\"])(type, {\n title: \"Change to paragraph\",\n label: \"Plain\"\n }); }\n if (type = schema.nodes.code_block)\n { r.makeCodeBlock = Object(prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"blockTypeItem\"])(type, {\n title: \"Change to code block\",\n label: \"Code\"\n }); }\n if (type = schema.nodes.heading)\n { for (var i = 1; i <= 10; i++)\n { r[\"makeHead\" + i] = Object(prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"blockTypeItem\"])(type, {\n title: \"Change to heading \" + i,\n label: \"Level \" + i,\n attrs: {level: i}\n }); } }\n if (type = schema.nodes.horizontal_rule) {\n var hr = type;\n r.insertHorizontalRule = new prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"MenuItem\"]({\n title: \"Insert horizontal rule\",\n label: \"Horizontal rule\",\n enable: function enable(state) { return canInsert(state, hr) },\n run: function run(state, dispatch) { dispatch(state.tr.replaceSelectionWith(hr.create())); }\n });\n }\n\n var cut = function (arr) { return arr.filter(function (x) { return x; }); };\n r.insertMenu = new prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"Dropdown\"](cut([r.insertImage, r.insertHorizontalRule]), {label: \"Insert\"});\n r.typeMenu = new prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"Dropdown\"](cut([r.makeParagraph, r.makeCodeBlock, r.makeHead1 && new prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"DropdownSubmenu\"](cut([\n r.makeHead1, r.makeHead2, r.makeHead3, r.makeHead4, r.makeHead5, r.makeHead6\n ]), {label: \"Heading\"})]), {label: \"Type...\"});\n\n r.inlineMenu = [cut([r.toggleStrong, r.toggleEm, r.toggleCode, r.toggleLink])];\n r.blockMenu = [cut([r.wrapBulletList, r.wrapOrderedList, r.wrapBlockQuote, prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"joinUpItem\"],\n prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"liftItem\"], prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"selectParentNodeItem\"]])];\n r.fullMenu = r.inlineMenu.concat([[r.insertMenu, r.typeMenu]], [[prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"undoItem\"], prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"redoItem\"]]], r.blockMenu);\n\n return r\n}\n\nvar mac = typeof navigator != \"undefined\" ? /Mac/.test(navigator.platform) : false;\n\n// :: (Schema, ?Object) → Object\n// Inspect the given schema looking for marks and nodes from the\n// basic schema, and if found, add key bindings related to them.\n// This will add:\n//\n// * **Mod-b** for toggling [strong](#schema-basic.StrongMark)\n// * **Mod-i** for toggling [emphasis](#schema-basic.EmMark)\n// * **Mod-`** for toggling [code font](#schema-basic.CodeMark)\n// * **Ctrl-Shift-0** for making the current textblock a paragraph\n// * **Ctrl-Shift-1** to **Ctrl-Shift-Digit6** for making the current\n// textblock a heading of the corresponding level\n// * **Ctrl-Shift-Backslash** to make the current textblock a code block\n// * **Ctrl-Shift-8** to wrap the selection in an ordered list\n// * **Ctrl-Shift-9** to wrap the selection in a bullet list\n// * **Ctrl->** to wrap the selection in a block quote\n// * **Enter** to split a non-empty textblock in a list item while at\n// the same time splitting the list item\n// * **Mod-Enter** to insert a hard break\n// * **Mod-_** to insert a horizontal rule\n// * **Backspace** to undo an input rule\n// * **Alt-ArrowUp** to `joinUp`\n// * **Alt-ArrowDown** to `joinDown`\n// * **Mod-BracketLeft** to `lift`\n// * **Escape** to `selectParentNode`\n//\n// You can suppress or map these bindings by passing a `mapKeys`\n// argument, which maps key names (say `\"Mod-B\"` to either `false`, to\n// remove the binding, or a new key name string.\nfunction buildKeymap(schema, mapKeys) {\n var keys = {}, type;\n function bind(key, cmd) {\n if (mapKeys) {\n var mapped = mapKeys[key];\n if (mapped === false) { return }\n if (mapped) { key = mapped; }\n }\n keys[key] = cmd;\n }\n\n\n bind(\"Mod-z\", prosemirror_history__WEBPACK_IMPORTED_MODULE_1__[\"undo\"]);\n bind(\"Shift-Mod-z\", prosemirror_history__WEBPACK_IMPORTED_MODULE_1__[\"redo\"]);\n bind(\"Backspace\", prosemirror_inputrules__WEBPACK_IMPORTED_MODULE_8__[\"undoInputRule\"]);\n if (!mac) { bind(\"Mod-y\", prosemirror_history__WEBPACK_IMPORTED_MODULE_1__[\"redo\"]); }\n\n bind(\"Alt-ArrowUp\", prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"joinUp\"]);\n bind(\"Alt-ArrowDown\", prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"joinDown\"]);\n bind(\"Mod-BracketLeft\", prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"lift\"]);\n bind(\"Escape\", prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"selectParentNode\"]);\n\n if (type = schema.marks.strong) {\n bind(\"Mod-b\", Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"toggleMark\"])(type));\n bind(\"Mod-B\", Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"toggleMark\"])(type));\n }\n if (type = schema.marks.em) {\n bind(\"Mod-i\", Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"toggleMark\"])(type));\n bind(\"Mod-I\", Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"toggleMark\"])(type));\n }\n if (type = schema.marks.code)\n { bind(\"Mod-`\", Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"toggleMark\"])(type)); }\n\n if (type = schema.nodes.bullet_list)\n { bind(\"Shift-Ctrl-8\", Object(prosemirror_schema_list__WEBPACK_IMPORTED_MODULE_7__[\"wrapInList\"])(type)); }\n if (type = schema.nodes.ordered_list)\n { bind(\"Shift-Ctrl-9\", Object(prosemirror_schema_list__WEBPACK_IMPORTED_MODULE_7__[\"wrapInList\"])(type)); }\n if (type = schema.nodes.blockquote)\n { bind(\"Ctrl->\", Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"wrapIn\"])(type)); }\n if (type = schema.nodes.hard_break) {\n var br = type, cmd = Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"chainCommands\"])(prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"exitCode\"], function (state, dispatch) {\n dispatch(state.tr.replaceSelectionWith(br.create()).scrollIntoView());\n return true\n });\n bind(\"Mod-Enter\", cmd);\n bind(\"Shift-Enter\", cmd);\n if (mac) { bind(\"Ctrl-Enter\", cmd); }\n }\n if (type = schema.nodes.list_item) {\n bind(\"Enter\", Object(prosemirror_schema_list__WEBPACK_IMPORTED_MODULE_7__[\"splitListItem\"])(type));\n bind(\"Mod-[\", Object(prosemirror_schema_list__WEBPACK_IMPORTED_MODULE_7__[\"liftListItem\"])(type));\n bind(\"Mod-]\", Object(prosemirror_schema_list__WEBPACK_IMPORTED_MODULE_7__[\"sinkListItem\"])(type));\n }\n if (type = schema.nodes.paragraph)\n { bind(\"Shift-Ctrl-0\", Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"setBlockType\"])(type)); }\n if (type = schema.nodes.code_block)\n { bind(\"Shift-Ctrl-\\\\\", Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"setBlockType\"])(type)); }\n if (type = schema.nodes.heading)\n { for (var i = 1; i <= 6; i++) { bind(\"Shift-Ctrl-\" + i, Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"setBlockType\"])(type, {level: i})); } }\n if (type = schema.nodes.horizontal_rule) {\n var hr = type;\n bind(\"Mod-_\", function (state, dispatch) {\n dispatch(state.tr.replaceSelectionWith(hr.create()).scrollIntoView());\n return true\n });\n }\n\n return keys\n}\n\n// : (NodeType) → InputRule\n// Given a blockquote node type, returns an input rule that turns `\"> \"`\n// at the start of a textblock into a blockquote.\nfunction blockQuoteRule(nodeType) {\n return Object(prosemirror_inputrules__WEBPACK_IMPORTED_MODULE_8__[\"wrappingInputRule\"])(/^\\s*>\\s$/, nodeType)\n}\n\n// : (NodeType) → InputRule\n// Given a list node type, returns an input rule that turns a number\n// followed by a dot at the start of a textblock into an ordered list.\nfunction orderedListRule(nodeType) {\n return Object(prosemirror_inputrules__WEBPACK_IMPORTED_MODULE_8__[\"wrappingInputRule\"])(/^(\\d+)\\.\\s$/, nodeType, function (match) { return ({order: +match[1]}); },\n function (match, node) { return node.childCount + node.attrs.order == +match[1]; })\n}\n\n// : (NodeType) → InputRule\n// Given a list node type, returns an input rule that turns a bullet\n// (dash, plush, or asterisk) at the start of a textblock into a\n// bullet list.\nfunction bulletListRule(nodeType) {\n return Object(prosemirror_inputrules__WEBPACK_IMPORTED_MODULE_8__[\"wrappingInputRule\"])(/^\\s*([-+*])\\s$/, nodeType)\n}\n\n// : (NodeType) → InputRule\n// Given a code block node type, returns an input rule that turns a\n// textblock starting with three backticks into a code block.\nfunction codeBlockRule(nodeType) {\n return Object(prosemirror_inputrules__WEBPACK_IMPORTED_MODULE_8__[\"textblockTypeInputRule\"])(/^```$/, nodeType)\n}\n\n// : (NodeType, number) → InputRule\n// Given a node type and a maximum level, creates an input rule that\n// turns up to that number of `#` characters followed by a space at\n// the start of a textblock into a heading whose level corresponds to\n// the number of `#` signs.\nfunction headingRule(nodeType, maxLevel) {\n return Object(prosemirror_inputrules__WEBPACK_IMPORTED_MODULE_8__[\"textblockTypeInputRule\"])(new RegExp(\"^(#{1,\" + maxLevel + \"})\\\\s$\"),\n nodeType, function (match) { return ({level: match[1].length}); })\n}\n\n// : (Schema) → Plugin\n// A set of input rules for creating the basic block quotes, lists,\n// code blocks, and heading.\nfunction buildInputRules(schema) {\n var rules = prosemirror_inputrules__WEBPACK_IMPORTED_MODULE_8__[\"smartQuotes\"].concat(prosemirror_inputrules__WEBPACK_IMPORTED_MODULE_8__[\"ellipsis\"], prosemirror_inputrules__WEBPACK_IMPORTED_MODULE_8__[\"emDash\"]), type;\n if (type = schema.nodes.blockquote) { rules.push(blockQuoteRule(type)); }\n if (type = schema.nodes.ordered_list) { rules.push(orderedListRule(type)); }\n if (type = schema.nodes.bullet_list) { rules.push(bulletListRule(type)); }\n if (type = schema.nodes.code_block) { rules.push(codeBlockRule(type)); }\n if (type = schema.nodes.heading) { rules.push(headingRule(type, 6)); }\n return Object(prosemirror_inputrules__WEBPACK_IMPORTED_MODULE_8__[\"inputRules\"])({rules: rules})\n}\n\n// !! This module exports helper functions for deriving a set of basic\n// menu items, input rules, or key bindings from a schema. These\n// values need to know about the schema for two reasons—they need\n// access to specific instances of node and mark types, and they need\n// to know which of the node and mark types that they know about are\n// actually present in the schema.\n//\n// The `exampleSetup` plugin ties these together into a plugin that\n// will automatically enable this basic functionality in an editor.\n\n// :: (Object) → [Plugin]\n// A convenience plugin that bundles together a simple menu with basic\n// key bindings, input rules, and styling for the example schema.\n// Probably only useful for quickly setting up a passable\n// editor—you'll need more control over your settings in most\n// real-world situations.\n//\n// options::- The following options are recognized:\n//\n// schema:: Schema\n// The schema to generate key bindings and menu items for.\n//\n// mapKeys:: ?Object\n// Can be used to [adjust](#example-setup.buildKeymap) the key bindings created.\n//\n// menuBar:: ?bool\n// Set to false to disable the menu bar.\n//\n// history:: ?bool\n// Set to false to disable the history plugin.\n//\n// floatingMenu:: ?bool\n// Set to false to make the menu bar non-floating.\n//\n// menuContent:: [[MenuItem]]\n// Can be used to override the menu content.\nfunction exampleSetup(options) {\n var plugins = [\n buildInputRules(options.schema),\n Object(prosemirror_keymap__WEBPACK_IMPORTED_MODULE_0__[\"keymap\"])(buildKeymap(options.schema, options.mapKeys)),\n Object(prosemirror_keymap__WEBPACK_IMPORTED_MODULE_0__[\"keymap\"])(prosemirror_commands__WEBPACK_IMPORTED_MODULE_2__[\"baseKeymap\"]),\n Object(prosemirror_dropcursor__WEBPACK_IMPORTED_MODULE_4__[\"dropCursor\"])(),\n Object(prosemirror_gapcursor__WEBPACK_IMPORTED_MODULE_5__[\"gapCursor\"])()\n ];\n if (options.menuBar !== false)\n { plugins.push(Object(prosemirror_menu__WEBPACK_IMPORTED_MODULE_6__[\"menuBar\"])({floating: options.floatingMenu !== false,\n content: options.menuContent || buildMenuItems(options.schema).fullMenu})); }\n if (options.history !== false)\n { plugins.push(Object(prosemirror_history__WEBPACK_IMPORTED_MODULE_1__[\"history\"])()); }\n\n return plugins.concat(new prosemirror_state__WEBPACK_IMPORTED_MODULE_3__[\"Plugin\"]({\n props: {\n attributes: {class: \"ProseMirror-example-setup-style\"}\n }\n }))\n}\n\n\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/prosemirror-example-setup/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/prosemirror-gapcursor/dist/index.es.js": +/*!*************************************************************!*\ + !*** ./node_modules/prosemirror-gapcursor/dist/index.es.js ***! + \*************************************************************/ +/*! exports provided: GapCursor, gapCursor */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GapCursor\", function() { return GapCursor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gapCursor\", function() { return gapCursor; });\n/* harmony import */ var prosemirror_keymap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prosemirror-keymap */ \"./node_modules/prosemirror-keymap/dist/index.es.js\");\n/* harmony import */ var prosemirror_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prosemirror-state */ \"./node_modules/prosemirror-state/dist/index.es.js\");\n/* harmony import */ var prosemirror_view__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prosemirror-view */ \"./node_modules/prosemirror-view/dist/index.es.js\");\n/* harmony import */ var prosemirror_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prosemirror-model */ \"./node_modules/prosemirror-model/dist/index.es.js\");\n\n\n\n\n\n// ::- Gap cursor selections are represented using this class. Its\n// `$anchor` and `$head` properties both point at the cursor position.\nvar GapCursor = /*@__PURE__*/(function (Selection) {\n function GapCursor($pos) {\n Selection.call(this, $pos, $pos);\n }\n\n if ( Selection ) GapCursor.__proto__ = Selection;\n GapCursor.prototype = Object.create( Selection && Selection.prototype );\n GapCursor.prototype.constructor = GapCursor;\n\n GapCursor.prototype.map = function map (doc, mapping) {\n var $pos = doc.resolve(mapping.map(this.head));\n return GapCursor.valid($pos) ? new GapCursor($pos) : Selection.near($pos)\n };\n\n GapCursor.prototype.content = function content () { return prosemirror_model__WEBPACK_IMPORTED_MODULE_3__[\"Slice\"].empty };\n\n GapCursor.prototype.eq = function eq (other) {\n return other instanceof GapCursor && other.head == this.head\n };\n\n GapCursor.prototype.toJSON = function toJSON () {\n return {type: \"gapcursor\", pos: this.head}\n };\n\n GapCursor.fromJSON = function fromJSON (doc, json) {\n if (typeof json.pos != \"number\") { throw new RangeError(\"Invalid input for GapCursor.fromJSON\") }\n return new GapCursor(doc.resolve(json.pos))\n };\n\n GapCursor.prototype.getBookmark = function getBookmark () { return new GapBookmark(this.anchor) };\n\n GapCursor.valid = function valid ($pos) {\n var parent = $pos.parent;\n if (parent.isTextblock || !closedBefore($pos) || !closedAfter($pos)) { return false }\n var override = parent.type.spec.allowGapCursor;\n if (override != null) { return override }\n var deflt = parent.contentMatchAt($pos.index()).defaultType;\n return deflt && deflt.isTextblock\n };\n\n GapCursor.findFrom = function findFrom ($pos, dir, mustMove) {\n if (!mustMove && GapCursor.valid($pos)) { return $pos }\n\n var pos = $pos.pos, next = null;\n // Scan up from this position\n for (var d = $pos.depth;; d--) {\n var parent = $pos.node(d);\n if (dir > 0 ? $pos.indexAfter(d) < parent.childCount : $pos.index(d) > 0) {\n next = parent.maybeChild(dir > 0 ? $pos.indexAfter(d) : $pos.index(d) - 1);\n break\n } else if (d == 0) {\n return null\n }\n pos += dir;\n var $cur = $pos.doc.resolve(pos);\n if (GapCursor.valid($cur)) { return $cur }\n }\n\n // And then down into the next node\n for (;;) {\n next = dir > 0 ? next.firstChild : next.lastChild;\n if (!next) { break }\n pos += dir;\n var $cur$1 = $pos.doc.resolve(pos);\n if (GapCursor.valid($cur$1)) { return $cur$1 }\n }\n\n return null\n };\n\n return GapCursor;\n}(prosemirror_state__WEBPACK_IMPORTED_MODULE_1__[\"Selection\"]));\n\nGapCursor.prototype.visible = false;\n\nprosemirror_state__WEBPACK_IMPORTED_MODULE_1__[\"Selection\"].jsonID(\"gapcursor\", GapCursor);\n\nvar GapBookmark = function GapBookmark(pos) {\n this.pos = pos;\n};\nGapBookmark.prototype.map = function map (mapping) {\n return new GapBookmark(mapping.map(this.pos))\n};\nGapBookmark.prototype.resolve = function resolve (doc) {\n var $pos = doc.resolve(this.pos);\n return GapCursor.valid($pos) ? new GapCursor($pos) : prosemirror_state__WEBPACK_IMPORTED_MODULE_1__[\"Selection\"].near($pos)\n};\n\nfunction closedBefore($pos) {\n for (var d = $pos.depth; d >= 0; d--) {\n var index = $pos.index(d);\n // At the start of this parent, look at next one\n if (index == 0) { continue }\n // See if the node before (or its first ancestor) is closed\n for (var before = $pos.node(d).child(index - 1);; before = before.lastChild) {\n if ((before.childCount == 0 && !before.inlineContent) || before.isAtom || before.type.spec.isolating) { return true }\n if (before.inlineContent) { return false }\n }\n }\n // Hit start of document\n return true\n}\n\nfunction closedAfter($pos) {\n for (var d = $pos.depth; d >= 0; d--) {\n var index = $pos.indexAfter(d), parent = $pos.node(d);\n if (index == parent.childCount) { continue }\n for (var after = parent.child(index);; after = after.firstChild) {\n if ((after.childCount == 0 && !after.inlineContent) || after.isAtom || after.type.spec.isolating) { return true }\n if (after.inlineContent) { return false }\n }\n }\n return true\n}\n\n// :: () → Plugin\n// Create a gap cursor plugin. When enabled, this will capture clicks\n// near and arrow-key-motion past places that don't have a normally\n// selectable position nearby, and create a gap cursor selection for\n// them. The cursor is drawn as an element with class\n// `ProseMirror-gapcursor`. You can either include\n// `style/gapcursor.css` from the package's directory or add your own\n// styles to make it visible.\nvar gapCursor = function() {\n return new prosemirror_state__WEBPACK_IMPORTED_MODULE_1__[\"Plugin\"]({\n props: {\n decorations: drawGapCursor,\n\n createSelectionBetween: function createSelectionBetween(_view, $anchor, $head) {\n if ($anchor.pos == $head.pos && GapCursor.valid($head)) { return new GapCursor($head) }\n },\n\n handleClick: handleClick,\n handleKeyDown: handleKeyDown\n }\n })\n};\n\nvar handleKeyDown = Object(prosemirror_keymap__WEBPACK_IMPORTED_MODULE_0__[\"keydownHandler\"])({\n \"ArrowLeft\": arrow(\"horiz\", -1),\n \"ArrowRight\": arrow(\"horiz\", 1),\n \"ArrowUp\": arrow(\"vert\", -1),\n \"ArrowDown\": arrow(\"vert\", 1)\n});\n\nfunction arrow(axis, dir) {\n var dirStr = axis == \"vert\" ? (dir > 0 ? \"down\" : \"up\") : (dir > 0 ? \"right\" : \"left\");\n return function(state, dispatch, view) {\n var sel = state.selection;\n var $start = dir > 0 ? sel.$to : sel.$from, mustMove = sel.empty;\n if (sel instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_1__[\"TextSelection\"]) {\n if (!view.endOfTextblock(dirStr) || $start.depth == 0) { return false }\n mustMove = false;\n $start = state.doc.resolve(dir > 0 ? $start.after() : $start.before());\n }\n var $found = GapCursor.findFrom($start, dir, mustMove);\n if (!$found) { return false }\n if (dispatch) { dispatch(state.tr.setSelection(new GapCursor($found))); }\n return true\n }\n}\n\nfunction handleClick(view, pos, event) {\n if (!view.editable) { return false }\n var $pos = view.state.doc.resolve(pos);\n if (!GapCursor.valid($pos)) { return false }\n var ref = view.posAtCoords({left: event.clientX, top: event.clientY});\n var inside = ref.inside;\n if (inside > -1 && prosemirror_state__WEBPACK_IMPORTED_MODULE_1__[\"NodeSelection\"].isSelectable(view.state.doc.nodeAt(inside))) { return false }\n view.dispatch(view.state.tr.setSelection(new GapCursor($pos)));\n return true\n}\n\nfunction drawGapCursor(state) {\n if (!(state.selection instanceof GapCursor)) { return null }\n var node = document.createElement(\"div\");\n node.className = \"ProseMirror-gapcursor\";\n return prosemirror_view__WEBPACK_IMPORTED_MODULE_2__[\"DecorationSet\"].create(state.doc, [prosemirror_view__WEBPACK_IMPORTED_MODULE_2__[\"Decoration\"].widget(state.selection.head, node, {key: \"gapcursor\"})])\n}\n\n\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/prosemirror-gapcursor/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/prosemirror-history/dist/index.es.js": +/*!***********************************************************!*\ + !*** ./node_modules/prosemirror-history/dist/index.es.js ***! + \***********************************************************/ +/*! exports provided: HistoryState, closeHistory, history, redo, redoDepth, undo, undoDepth */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HistoryState\", function() { return HistoryState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"closeHistory\", function() { return closeHistory; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"history\", function() { return history; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"redo\", function() { return redo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"redoDepth\", function() { return redoDepth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"undo\", function() { return undo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"undoDepth\", function() { return undoDepth; });\n/* harmony import */ var rope_sequence__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rope-sequence */ \"./node_modules/rope-sequence/dist/index.es.js\");\n/* harmony import */ var prosemirror_transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prosemirror-transform */ \"./node_modules/prosemirror-transform/dist/index.es.js\");\n/* harmony import */ var prosemirror_state__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prosemirror-state */ \"./node_modules/prosemirror-state/dist/index.es.js\");\n\n\n\n\n// ProseMirror's history isn't simply a way to roll back to a previous\n// state, because ProseMirror supports applying changes without adding\n// them to the history (for example during collaboration).\n//\n// To this end, each 'Branch' (one for the undo history and one for\n// the redo history) keeps an array of 'Items', which can optionally\n// hold a step (an actual undoable change), and always hold a position\n// map (which is needed to move changes below them to apply to the\n// current document).\n//\n// An item that has both a step and a selection bookmark is the start\n// of an 'event' — a group of changes that will be undone or redone at\n// once. (It stores only the bookmark, since that way we don't have to\n// provide a document until the selection is actually applied, which\n// is useful when compressing.)\n\n// Used to schedule history compression\nvar max_empty_items = 500;\n\nvar Branch = function Branch(items, eventCount) {\n this.items = items;\n this.eventCount = eventCount;\n};\n\n// : (EditorState, bool) → ?{transform: Transform, selection: ?SelectionBookmark, remaining: Branch}\n// Pop the latest event off the branch's history and apply it\n// to a document transform.\nBranch.prototype.popEvent = function popEvent (state, preserveItems) {\n var this$1 = this;\n\n if (this.eventCount == 0) { return null }\n\n var end = this.items.length;\n for (;; end--) {\n var next = this.items.get(end - 1);\n if (next.selection) { --end; break }\n }\n\n var remap, mapFrom;\n if (preserveItems) {\n remap = this.remapping(end, this.items.length);\n mapFrom = remap.maps.length;\n }\n var transform = state.tr;\n var selection, remaining;\n var addAfter = [], addBefore = [];\n\n this.items.forEach(function (item, i) {\n if (!item.step) {\n if (!remap) {\n remap = this$1.remapping(end, i + 1);\n mapFrom = remap.maps.length;\n }\n mapFrom--;\n addBefore.push(item);\n return\n }\n\n if (remap) {\n addBefore.push(new Item(item.map));\n var step = item.step.map(remap.slice(mapFrom)), map;\n\n if (step && transform.maybeStep(step).doc) {\n map = transform.mapping.maps[transform.mapping.maps.length - 1];\n addAfter.push(new Item(map, null, null, addAfter.length + addBefore.length));\n }\n mapFrom--;\n if (map) { remap.appendMap(map, mapFrom); }\n } else {\n transform.maybeStep(item.step);\n }\n\n if (item.selection) {\n selection = remap ? item.selection.map(remap.slice(mapFrom)) : item.selection;\n remaining = new Branch(this$1.items.slice(0, end).append(addBefore.reverse().concat(addAfter)), this$1.eventCount - 1);\n return false\n }\n }, this.items.length, 0);\n\n return {remaining: remaining, transform: transform, selection: selection}\n};\n\n// : (Transform, ?SelectionBookmark, Object) → Branch\n// Create a new branch with the given transform added.\nBranch.prototype.addTransform = function addTransform (transform, selection, histOptions, preserveItems) {\n var newItems = [], eventCount = this.eventCount;\n var oldItems = this.items, lastItem = !preserveItems && oldItems.length ? oldItems.get(oldItems.length - 1) : null;\n\n for (var i = 0; i < transform.steps.length; i++) {\n var step = transform.steps[i].invert(transform.docs[i]);\n var item = new Item(transform.mapping.maps[i], step, selection), merged = (void 0);\n if (merged = lastItem && lastItem.merge(item)) {\n item = merged;\n if (i) { newItems.pop(); }\n else { oldItems = oldItems.slice(0, oldItems.length - 1); }\n }\n newItems.push(item);\n if (selection) {\n eventCount++;\n selection = null;\n }\n if (!preserveItems) { lastItem = item; }\n }\n var overflow = eventCount - histOptions.depth;\n if (overflow > DEPTH_OVERFLOW) {\n oldItems = cutOffEvents(oldItems, overflow);\n eventCount -= overflow;\n }\n return new Branch(oldItems.append(newItems), eventCount)\n};\n\nBranch.prototype.remapping = function remapping (from, to) {\n var maps = new prosemirror_transform__WEBPACK_IMPORTED_MODULE_1__[\"Mapping\"];\n this.items.forEach(function (item, i) {\n var mirrorPos = item.mirrorOffset != null && i - item.mirrorOffset >= from\n ? maps.maps.length - item.mirrorOffset : null;\n maps.appendMap(item.map, mirrorPos);\n }, from, to);\n return maps\n};\n\nBranch.prototype.addMaps = function addMaps (array) {\n if (this.eventCount == 0) { return this }\n return new Branch(this.items.append(array.map(function (map) { return new Item(map); })), this.eventCount)\n};\n\n// : (Transform, number)\n// When the collab module receives remote changes, the history has\n// to know about those, so that it can adjust the steps that were\n// rebased on top of the remote changes, and include the position\n// maps for the remote changes in its array of items.\nBranch.prototype.rebased = function rebased (rebasedTransform, rebasedCount) {\n if (!this.eventCount) { return this }\n\n var rebasedItems = [], start = Math.max(0, this.items.length - rebasedCount);\n\n var mapping = rebasedTransform.mapping;\n var newUntil = rebasedTransform.steps.length;\n var eventCount = this.eventCount;\n this.items.forEach(function (item) { if (item.selection) { eventCount--; } }, start);\n\n var iRebased = rebasedCount;\n this.items.forEach(function (item) {\n var pos = mapping.getMirror(--iRebased);\n if (pos == null) { return }\n newUntil = Math.min(newUntil, pos);\n var map = mapping.maps[pos];\n if (item.step) {\n var step = rebasedTransform.steps[pos].invert(rebasedTransform.docs[pos]);\n var selection = item.selection && item.selection.map(mapping.slice(iRebased + 1, pos));\n if (selection) { eventCount++; }\n rebasedItems.push(new Item(map, step, selection));\n } else {\n rebasedItems.push(new Item(map));\n }\n }, start);\n\n var newMaps = [];\n for (var i = rebasedCount; i < newUntil; i++)\n { newMaps.push(new Item(mapping.maps[i])); }\n var items = this.items.slice(0, start).append(newMaps).append(rebasedItems);\n var branch = new Branch(items, eventCount);\n\n if (branch.emptyItemCount() > max_empty_items)\n { branch = branch.compress(this.items.length - rebasedItems.length); }\n return branch\n};\n\nBranch.prototype.emptyItemCount = function emptyItemCount () {\n var count = 0;\n this.items.forEach(function (item) { if (!item.step) { count++; } });\n return count\n};\n\n// Compressing a branch means rewriting it to push the air (map-only\n// items) out. During collaboration, these naturally accumulate\n// because each remote change adds one. The `upto` argument is used\n// to ensure that only the items below a given level are compressed,\n// because `rebased` relies on a clean, untouched set of items in\n// order to associate old items with rebased steps.\nBranch.prototype.compress = function compress (upto) {\n if ( upto === void 0 ) upto = this.items.length;\n\n var remap = this.remapping(0, upto), mapFrom = remap.maps.length;\n var items = [], events = 0;\n this.items.forEach(function (item, i) {\n if (i >= upto) {\n items.push(item);\n if (item.selection) { events++; }\n } else if (item.step) {\n var step = item.step.map(remap.slice(mapFrom)), map = step && step.getMap();\n mapFrom--;\n if (map) { remap.appendMap(map, mapFrom); }\n if (step) {\n var selection = item.selection && item.selection.map(remap.slice(mapFrom));\n if (selection) { events++; }\n var newItem = new Item(map.invert(), step, selection), merged, last = items.length - 1;\n if (merged = items.length && items[last].merge(newItem))\n { items[last] = merged; }\n else\n { items.push(newItem); }\n }\n } else if (item.map) {\n mapFrom--;\n }\n }, this.items.length, 0);\n return new Branch(rope_sequence__WEBPACK_IMPORTED_MODULE_0__[\"default\"].from(items.reverse()), events)\n};\n\nBranch.empty = new Branch(rope_sequence__WEBPACK_IMPORTED_MODULE_0__[\"default\"].empty, 0);\n\nfunction cutOffEvents(items, n) {\n var cutPoint;\n items.forEach(function (item, i) {\n if (item.selection && (n-- == 0)) {\n cutPoint = i;\n return false\n }\n });\n return items.slice(cutPoint)\n}\n\nvar Item = function Item(map, step, selection, mirrorOffset) {\n // The (forward) step map for this item.\n this.map = map;\n // The inverted step\n this.step = step;\n // If this is non-null, this item is the start of a group, and\n // this selection is the starting selection for the group (the one\n // that was active before the first step was applied)\n this.selection = selection;\n // If this item is the inverse of a previous mapping on the stack,\n // this points at the inverse's offset\n this.mirrorOffset = mirrorOffset;\n};\n\nItem.prototype.merge = function merge (other) {\n if (this.step && other.step && !other.selection) {\n var step = other.step.merge(this.step);\n if (step) { return new Item(step.getMap().invert(), step, this.selection) }\n }\n};\n\n// The value of the state field that tracks undo/redo history for that\n// state. Will be stored in the plugin state when the history plugin\n// is active.\nvar HistoryState = function HistoryState(done, undone, prevRanges, prevTime) {\n this.done = done;\n this.undone = undone;\n this.prevRanges = prevRanges;\n this.prevTime = prevTime;\n};\n\nvar DEPTH_OVERFLOW = 20;\n\n// : (HistoryState, EditorState, Transaction, Object)\n// Record a transformation in undo history.\nfunction applyTransaction(history, state, tr, options) {\n var historyTr = tr.getMeta(historyKey), rebased;\n if (historyTr) { return historyTr.historyState }\n\n if (tr.getMeta(closeHistoryKey)) { history = new HistoryState(history.done, history.undone, null, 0); }\n\n var appended = tr.getMeta(\"appendedTransaction\");\n\n if (tr.steps.length == 0) {\n return history\n } else if (appended && appended.getMeta(historyKey)) {\n if (appended.getMeta(historyKey).redo)\n { return new HistoryState(history.done.addTransform(tr, null, options, mustPreserveItems(state)),\n history.undone, rangesFor(tr.mapping.maps[tr.steps.length - 1]), history.prevTime) }\n else\n { return new HistoryState(history.done, history.undone.addTransform(tr, null, options, mustPreserveItems(state)),\n null, history.prevTime) }\n } else if (tr.getMeta(\"addToHistory\") !== false && !(appended && appended.getMeta(\"addToHistory\") === false)) {\n // Group transforms that occur in quick succession into one event.\n var newGroup = history.prevTime == 0 || !appended && (history.prevTime < (tr.time || 0) - options.newGroupDelay ||\n !isAdjacentTo(tr, history.prevRanges));\n var prevRanges = appended ? mapRanges(history.prevRanges, tr.mapping) : rangesFor(tr.mapping.maps[tr.steps.length - 1]);\n return new HistoryState(history.done.addTransform(tr, newGroup ? state.selection.getBookmark() : null,\n options, mustPreserveItems(state)),\n Branch.empty, prevRanges, tr.time)\n } else if (rebased = tr.getMeta(\"rebased\")) {\n // Used by the collab module to tell the history that some of its\n // content has been rebased.\n return new HistoryState(history.done.rebased(tr, rebased),\n history.undone.rebased(tr, rebased),\n mapRanges(history.prevRanges, tr.mapping), history.prevTime)\n } else {\n return new HistoryState(history.done.addMaps(tr.mapping.maps),\n history.undone.addMaps(tr.mapping.maps),\n mapRanges(history.prevRanges, tr.mapping), history.prevTime)\n }\n}\n\nfunction isAdjacentTo(transform, prevRanges) {\n if (!prevRanges) { return false }\n if (!transform.docChanged) { return true }\n var adjacent = false;\n transform.mapping.maps[0].forEach(function (start, end) {\n for (var i = 0; i < prevRanges.length; i += 2)\n { if (start <= prevRanges[i + 1] && end >= prevRanges[i])\n { adjacent = true; } }\n });\n return adjacent\n}\n\nfunction rangesFor(map) {\n var result = [];\n map.forEach(function (_from, _to, from, to) { return result.push(from, to); });\n return result\n}\n\nfunction mapRanges(ranges, mapping) {\n if (!ranges) { return null }\n var result = [];\n for (var i = 0; i < ranges.length; i += 2) {\n var from = mapping.map(ranges[i], 1), to = mapping.map(ranges[i + 1], -1);\n if (from <= to) { result.push(from, to); }\n }\n return result\n}\n\n// : (HistoryState, EditorState, (tr: Transaction), bool)\n// Apply the latest event from one branch to the document and shift the event\n// onto the other branch.\nfunction histTransaction(history, state, dispatch, redo) {\n var preserveItems = mustPreserveItems(state), histOptions = historyKey.get(state).spec.config;\n var pop = (redo ? history.undone : history.done).popEvent(state, preserveItems);\n if (!pop) { return }\n\n var selection = pop.selection.resolve(pop.transform.doc);\n var added = (redo ? history.done : history.undone).addTransform(pop.transform, state.selection.getBookmark(),\n histOptions, preserveItems);\n\n var newHist = new HistoryState(redo ? added : pop.remaining, redo ? pop.remaining : added, null, 0);\n dispatch(pop.transform.setSelection(selection).setMeta(historyKey, {redo: redo, historyState: newHist}).scrollIntoView());\n}\n\nvar cachedPreserveItems = false, cachedPreserveItemsPlugins = null;\n// Check whether any plugin in the given state has a\n// `historyPreserveItems` property in its spec, in which case we must\n// preserve steps exactly as they came in, so that they can be\n// rebased.\nfunction mustPreserveItems(state) {\n var plugins = state.plugins;\n if (cachedPreserveItemsPlugins != plugins) {\n cachedPreserveItems = false;\n cachedPreserveItemsPlugins = plugins;\n for (var i = 0; i < plugins.length; i++) { if (plugins[i].spec.historyPreserveItems) {\n cachedPreserveItems = true;\n break\n } }\n }\n return cachedPreserveItems\n}\n\n// :: (Transaction) → Transaction\n// Set a flag on the given transaction that will prevent further steps\n// from being appended to an existing history event (so that they\n// require a separate undo command to undo).\nfunction closeHistory(tr) {\n return tr.setMeta(closeHistoryKey, true)\n}\n\nvar historyKey = new prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"PluginKey\"](\"history\");\nvar closeHistoryKey = new prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"PluginKey\"](\"closeHistory\");\n\n// :: (?Object) → Plugin\n// Returns a plugin that enables the undo history for an editor. The\n// plugin will track undo and redo stacks, which can be used with the\n// [`undo`](#history.undo) and [`redo`](#history.redo) commands.\n//\n// You can set an `\"addToHistory\"` [metadata\n// property](#state.Transaction.setMeta) of `false` on a transaction\n// to prevent it from being rolled back by undo.\n//\n// config::-\n// Supports the following configuration options:\n//\n// depth:: ?number\n// The amount of history events that are collected before the\n// oldest events are discarded. Defaults to 100.\n//\n// newGroupDelay:: ?number\n// The delay between changes after which a new group should be\n// started. Defaults to 500 (milliseconds). Note that when changes\n// aren't adjacent, a new group is always started.\nfunction history(config) {\n config = {depth: config && config.depth || 100,\n newGroupDelay: config && config.newGroupDelay || 500};\n return new prosemirror_state__WEBPACK_IMPORTED_MODULE_2__[\"Plugin\"]({\n key: historyKey,\n\n state: {\n init: function init() {\n return new HistoryState(Branch.empty, Branch.empty, null, 0)\n },\n apply: function apply(tr, hist, state) {\n return applyTransaction(hist, state, tr, config)\n }\n },\n\n config: config\n })\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// A command function that undoes the last change, if any.\nfunction undo(state, dispatch) {\n var hist = historyKey.getState(state);\n if (!hist || hist.done.eventCount == 0) { return false }\n if (dispatch) { histTransaction(hist, state, dispatch, false); }\n return true\n}\n\n// :: (EditorState, ?(tr: Transaction)) → bool\n// A command function that redoes the last undone change, if any.\nfunction redo(state, dispatch) {\n var hist = historyKey.getState(state);\n if (!hist || hist.undone.eventCount == 0) { return false }\n if (dispatch) { histTransaction(hist, state, dispatch, true); }\n return true\n}\n\n// :: (EditorState) → number\n// The amount of undoable events available in a given state.\nfunction undoDepth(state) {\n var hist = historyKey.getState(state);\n return hist ? hist.done.eventCount : 0\n}\n\n// :: (EditorState) → number\n// The amount of redoable events available in a given editor state.\nfunction redoDepth(state) {\n var hist = historyKey.getState(state);\n return hist ? hist.undone.eventCount : 0\n}\n\n\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/prosemirror-history/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/prosemirror-inputrules/dist/index.es.js": +/*!**************************************************************!*\ + !*** ./node_modules/prosemirror-inputrules/dist/index.es.js ***! + \**************************************************************/ +/*! exports provided: InputRule, closeDoubleQuote, closeSingleQuote, ellipsis, emDash, inputRules, openDoubleQuote, openSingleQuote, smartQuotes, textblockTypeInputRule, undoInputRule, wrappingInputRule */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InputRule\", function() { return InputRule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"closeDoubleQuote\", function() { return closeDoubleQuote; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"closeSingleQuote\", function() { return closeSingleQuote; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ellipsis\", function() { return ellipsis; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"emDash\", function() { return emDash; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inputRules\", function() { return inputRules; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"openDoubleQuote\", function() { return openDoubleQuote; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"openSingleQuote\", function() { return openSingleQuote; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"smartQuotes\", function() { return smartQuotes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"textblockTypeInputRule\", function() { return textblockTypeInputRule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"undoInputRule\", function() { return undoInputRule; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"wrappingInputRule\", function() { return wrappingInputRule; });\n/* harmony import */ var prosemirror_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prosemirror-state */ \"./node_modules/prosemirror-state/dist/index.es.js\");\n/* harmony import */ var prosemirror_transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prosemirror-transform */ \"./node_modules/prosemirror-transform/dist/index.es.js\");\n\n\n\n// ::- Input rules are regular expressions describing a piece of text\n// that, when typed, causes something to happen. This might be\n// changing two dashes into an emdash, wrapping a paragraph starting\n// with `\"> \"` into a blockquote, or something entirely different.\nvar InputRule = function InputRule(match, handler) {\n this.match = match;\n this.handler = typeof handler == \"string\" ? stringHandler(handler) : handler;\n};\n\nfunction stringHandler(string) {\n return function(state, match, start, end) {\n var insert = string;\n if (match[1]) {\n var offset = match[0].lastIndexOf(match[1]);\n insert += match[0].slice(offset + match[1].length);\n start += offset;\n var cutOff = start - end;\n if (cutOff > 0) {\n insert = match[0].slice(offset - cutOff, offset) + insert;\n start = end;\n }\n }\n return state.tr.insertText(insert, start, end)\n }\n}\n\nvar MAX_MATCH = 500;\n\n// :: (config: {rules: [InputRule]}) → Plugin\n// Create an input rules plugin. When enabled, it will cause text\n// input that matches any of the given rules to trigger the rule's\n// action.\nfunction inputRules(ref) {\n var rules = ref.rules;\n\n var plugin = new prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"Plugin\"]({\n state: {\n init: function init() { return null },\n apply: function apply(tr, prev) {\n var stored = tr.getMeta(this);\n if (stored) { return stored }\n return tr.selectionSet || tr.docChanged ? null : prev\n }\n },\n\n props: {\n handleTextInput: function handleTextInput(view, from, to, text) {\n return run(view, from, to, text, rules, plugin)\n },\n handleDOMEvents: {\n compositionend: function (view) {\n setTimeout(function () {\n var ref = view.state.selection;\n var $cursor = ref.$cursor;\n if ($cursor) { run(view, $cursor.pos, $cursor.pos, \"\", rules, plugin); }\n });\n }\n }\n },\n\n isInputRules: true\n });\n return plugin\n}\n\nfunction run(view, from, to, text, rules, plugin) {\n if (view.composing) { return false }\n var state = view.state, $from = state.doc.resolve(from);\n if ($from.parent.type.spec.code) { return false }\n var textBefore = $from.parent.textBetween(Math.max(0, $from.parentOffset - MAX_MATCH), $from.parentOffset,\n null, \"\\ufffc\") + text;\n for (var i = 0; i < rules.length; i++) {\n var match = rules[i].match.exec(textBefore);\n var tr = match && rules[i].handler(state, match, from - (match[0].length - text.length), to);\n if (!tr) { continue }\n view.dispatch(tr.setMeta(plugin, {transform: tr, from: from, to: to, text: text}));\n return true\n }\n return false\n}\n\n// :: (EditorState, ?(Transaction)) → bool\n// This is a command that will undo an input rule, if applying such a\n// rule was the last thing that the user did.\nfunction undoInputRule(state, dispatch) {\n var plugins = state.plugins;\n for (var i = 0; i < plugins.length; i++) {\n var plugin = plugins[i], undoable = (void 0);\n if (plugin.spec.isInputRules && (undoable = plugin.getState(state))) {\n if (dispatch) {\n var tr = state.tr, toUndo = undoable.transform;\n for (var j = toUndo.steps.length - 1; j >= 0; j--)\n { tr.step(toUndo.steps[j].invert(toUndo.docs[j])); }\n var marks = tr.doc.resolve(undoable.from).marks();\n dispatch(tr.replaceWith(undoable.from, undoable.to, state.schema.text(undoable.text, marks)));\n }\n return true\n }\n }\n return false\n}\n\n// :: InputRule Converts double dashes to an emdash.\nvar emDash = new InputRule(/--$/, \"—\");\n// :: InputRule Converts three dots to an ellipsis character.\nvar ellipsis = new InputRule(/\\.\\.\\.$/, \"…\");\n// :: InputRule “Smart” opening double quotes.\nvar openDoubleQuote = new InputRule(/(?:^|[\\s\\{\\[\\(\\<'\"\\u2018\\u201C])(\")$/, \"“\");\n// :: InputRule “Smart” closing double quotes.\nvar closeDoubleQuote = new InputRule(/\"$/, \"”\");\n// :: InputRule “Smart” opening single quotes.\nvar openSingleQuote = new InputRule(/(?:^|[\\s\\{\\[\\(\\<'\"\\u2018\\u201C])(')$/, \"‘\");\n// :: InputRule “Smart” closing single quotes.\nvar closeSingleQuote = new InputRule(/'$/, \"’\");\n\n// :: [InputRule] Smart-quote related input rules.\nvar smartQuotes = [openDoubleQuote, closeDoubleQuote, openSingleQuote, closeSingleQuote];\n\n// :: (RegExp, NodeType, ?union, ?([string], Node) → bool) → InputRule\n// Build an input rule for automatically wrapping a textblock when a\n// given string is typed. The `regexp` argument is\n// directly passed through to the `InputRule` constructor. You'll\n// probably want the regexp to start with `^`, so that the pattern can\n// only occur at the start of a textblock.\n//\n// `nodeType` is the type of node to wrap in. If it needs attributes,\n// you can either pass them directly, or pass a function that will\n// compute them from the regular expression match.\n//\n// By default, if there's a node with the same type above the newly\n// wrapped node, the rule will try to [join](#transform.Transform.join) those\n// two nodes. You can pass a join predicate, which takes a regular\n// expression match and the node before the wrapped node, and can\n// return a boolean to indicate whether a join should happen.\nfunction wrappingInputRule(regexp, nodeType, getAttrs, joinPredicate) {\n return new InputRule(regexp, function (state, match, start, end) {\n var attrs = getAttrs instanceof Function ? getAttrs(match) : getAttrs;\n var tr = state.tr.delete(start, end);\n var $start = tr.doc.resolve(start), range = $start.blockRange(), wrapping = range && Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_1__[\"findWrapping\"])(range, nodeType, attrs);\n if (!wrapping) { return null }\n tr.wrap(range, wrapping);\n var before = tr.doc.resolve(start - 1).nodeBefore;\n if (before && before.type == nodeType && Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_1__[\"canJoin\"])(tr.doc, start - 1) &&\n (!joinPredicate || joinPredicate(match, before)))\n { tr.join(start - 1); }\n return tr\n })\n}\n\n// :: (RegExp, NodeType, ?union) → InputRule\n// Build an input rule that changes the type of a textblock when the\n// matched text is typed into it. You'll usually want to start your\n// regexp with `^` to that it is only matched at the start of a\n// textblock. The optional `getAttrs` parameter can be used to compute\n// the new node's attributes, and works the same as in the\n// `wrappingInputRule` function.\nfunction textblockTypeInputRule(regexp, nodeType, getAttrs) {\n return new InputRule(regexp, function (state, match, start, end) {\n var $start = state.doc.resolve(start);\n var attrs = getAttrs instanceof Function ? getAttrs(match) : getAttrs;\n if (!$start.node(-1).canReplaceWith($start.index(-1), $start.indexAfter(-1), nodeType)) { return null }\n return state.tr\n .delete(start, end)\n .setBlockType(start, start, nodeType, attrs)\n })\n}\n\n\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/prosemirror-inputrules/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/prosemirror-keymap/dist/index.es.js": +/*!**********************************************************!*\ + !*** ./node_modules/prosemirror-keymap/dist/index.es.js ***! + \**********************************************************/ +/*! exports provided: keydownHandler, keymap */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keydownHandler\", function() { return keydownHandler; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keymap\", function() { return keymap; });\n/* harmony import */ var w3c_keyname__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! w3c-keyname */ \"./node_modules/w3c-keyname/index.es.js\");\n/* harmony import */ var prosemirror_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prosemirror-state */ \"./node_modules/prosemirror-state/dist/index.es.js\");\n\n\n\n// declare global: navigator\n\nvar mac = typeof navigator != \"undefined\" ? /Mac/.test(navigator.platform) : false;\n\nfunction normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/), result = parts[parts.length - 1];\n if (result == \"Space\") { result = \" \"; }\n var alt, ctrl, shift, meta;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { meta = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else if (/^mod$/i.test(mod)) { if (mac) { meta = true; } else { ctrl = true; } }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { result = \"Alt-\" + result; }\n if (ctrl) { result = \"Ctrl-\" + result; }\n if (meta) { result = \"Meta-\" + result; }\n if (shift) { result = \"Shift-\" + result; }\n return result\n}\n\nfunction normalize(map) {\n var copy = Object.create(null);\n for (var prop in map) { copy[normalizeKeyName(prop)] = map[prop]; }\n return copy\n}\n\nfunction modifiers(name, event, shift) {\n if (event.altKey) { name = \"Alt-\" + name; }\n if (event.ctrlKey) { name = \"Ctrl-\" + name; }\n if (event.metaKey) { name = \"Meta-\" + name; }\n if (shift !== false && event.shiftKey) { name = \"Shift-\" + name; }\n return name\n}\n\n// :: (Object) → Plugin\n// Create a keymap plugin for the given set of bindings.\n//\n// Bindings should map key names to [command](#commands)-style\n// functions, which will be called with `(EditorState, dispatch,\n// EditorView)` arguments, and should return true when they've handled\n// the key. Note that the view argument isn't part of the command\n// protocol, but can be used as an escape hatch if a binding needs to\n// directly interact with the UI.\n//\n// Key names may be strings like `\"Shift-Ctrl-Enter\"`—a key\n// identifier prefixed with zero or more modifiers. Key identifiers\n// are based on the strings that can appear in\n// [`KeyEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key).\n// Use lowercase letters to refer to letter keys (or uppercase letters\n// if you want shift to be held). You may use `\"Space\"` as an alias\n// for the `\" \"` name.\n//\n// Modifiers can be given in any order. `Shift-` (or `s-`), `Alt-` (or\n// `a-`), `Ctrl-` (or `c-` or `Control-`) and `Cmd-` (or `m-` or\n// `Meta-`) are recognized. For characters that are created by holding\n// shift, the `Shift-` prefix is implied, and should not be added\n// explicitly.\n//\n// You can use `Mod-` as a shorthand for `Cmd-` on Mac and `Ctrl-` on\n// other platforms.\n//\n// You can add multiple keymap plugins to an editor. The order in\n// which they appear determines their precedence (the ones early in\n// the array get to dispatch first).\nfunction keymap(bindings) {\n return new prosemirror_state__WEBPACK_IMPORTED_MODULE_1__[\"Plugin\"]({props: {handleKeyDown: keydownHandler(bindings)}})\n}\n\n// :: (Object) → (view: EditorView, event: dom.Event) → bool\n// Given a set of bindings (using the same format as\n// [`keymap`](#keymap.keymap), return a [keydown\n// handler](#view.EditorProps.handleKeyDown) that handles them.\nfunction keydownHandler(bindings) {\n var map = normalize(bindings);\n return function(view, event) {\n var name = Object(w3c_keyname__WEBPACK_IMPORTED_MODULE_0__[\"keyName\"])(event), isChar = name.length == 1 && name != \" \", baseName;\n var direct = map[modifiers(name, event, !isChar)];\n if (direct && direct(view.state, view.dispatch, view)) { return true }\n if (isChar && (event.shiftKey || event.altKey || event.metaKey) &&\n (baseName = w3c_keyname__WEBPACK_IMPORTED_MODULE_0__[\"base\"][event.keyCode]) && baseName != name) {\n var fromCode = map[modifiers(baseName, event, true)];\n if (fromCode && fromCode(view.state, view.dispatch, view)) { return true }\n } else if (isChar && event.shiftKey) {\n var withShift = map[modifiers(name, event, true)];\n if (withShift && withShift(view.state, view.dispatch, view)) { return true }\n }\n return false\n }\n}\n\n\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/prosemirror-keymap/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/prosemirror-markdown/dist/index.es.js": +/*!************************************************************!*\ + !*** ./node_modules/prosemirror-markdown/dist/index.es.js ***! + \************************************************************/ +/*! exports provided: MarkdownParser, MarkdownSerializer, MarkdownSerializerState, defaultMarkdownParser, defaultMarkdownSerializer, schema */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MarkdownParser\", function() { return MarkdownParser; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MarkdownSerializer\", function() { return MarkdownSerializer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MarkdownSerializerState\", function() { return MarkdownSerializerState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultMarkdownParser\", function() { return defaultMarkdownParser; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultMarkdownSerializer\", function() { return defaultMarkdownSerializer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"schema\", function() { return schema; });\n/* harmony import */ var prosemirror_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prosemirror-model */ \"./node_modules/prosemirror-model/dist/index.es.js\");\n/* harmony import */ var markdown_it__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! markdown-it */ \"./node_modules/markdown-it/index.js\");\n/* harmony import */ var markdown_it__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(markdown_it__WEBPACK_IMPORTED_MODULE_1__);\n\n\n\n// ::Schema Document schema for the data model used by CommonMark.\nvar schema = new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Schema\"]({\n nodes: {\n doc: {\n content: \"block+\"\n },\n\n paragraph: {\n content: \"inline*\",\n group: \"block\",\n parseDOM: [{tag: \"p\"}],\n toDOM: function toDOM() { return [\"p\", 0] }\n },\n\n blockquote: {\n content: \"block+\",\n group: \"block\",\n parseDOM: [{tag: \"blockquote\"}],\n toDOM: function toDOM() { return [\"blockquote\", 0] }\n },\n\n horizontal_rule: {\n group: \"block\",\n parseDOM: [{tag: \"hr\"}],\n toDOM: function toDOM() { return [\"div\", [\"hr\"]] }\n },\n\n heading: {\n attrs: {level: {default: 1}},\n content: \"inline*\",\n group: \"block\",\n defining: true,\n parseDOM: [{tag: \"h1\", attrs: {level: 1}},\n {tag: \"h2\", attrs: {level: 2}},\n {tag: \"h3\", attrs: {level: 3}},\n {tag: \"h4\", attrs: {level: 4}},\n {tag: \"h5\", attrs: {level: 5}},\n {tag: \"h6\", attrs: {level: 6}}],\n toDOM: function toDOM(node) { return [\"h\" + node.attrs.level, 0] }\n },\n\n code_block: {\n content: \"text*\",\n group: \"block\",\n code: true,\n defining: true,\n marks: \"\",\n attrs: {params: {default: \"\"}},\n parseDOM: [{tag: \"pre\", preserveWhitespace: \"full\", getAttrs: function (node) { return (\n {params: node.getAttribute(\"data-params\") || \"\"}\n ); }}],\n toDOM: function toDOM(node) { return [\"pre\", node.attrs.params ? {\"data-params\": node.attrs.params} : {}, [\"code\", 0]] }\n },\n\n ordered_list: {\n content: \"list_item+\",\n group: \"block\",\n attrs: {order: {default: 1}, tight: {default: false}},\n parseDOM: [{tag: \"ol\", getAttrs: function getAttrs(dom) {\n return {order: dom.hasAttribute(\"start\") ? +dom.getAttribute(\"start\") : 1,\n tight: dom.hasAttribute(\"data-tight\")}\n }}],\n toDOM: function toDOM(node) {\n return [\"ol\", {start: node.attrs.order == 1 ? null : node.attrs.order,\n \"data-tight\": node.attrs.tight ? \"true\" : null}, 0]\n }\n },\n\n bullet_list: {\n content: \"list_item+\",\n group: \"block\",\n attrs: {tight: {default: false}},\n parseDOM: [{tag: \"ul\", getAttrs: function (dom) { return ({tight: dom.hasAttribute(\"data-tight\")}); }}],\n toDOM: function toDOM(node) { return [\"ul\", {\"data-tight\": node.attrs.tight ? \"true\" : null}, 0] }\n },\n\n list_item: {\n content: \"paragraph block*\",\n defining: true,\n parseDOM: [{tag: \"li\"}],\n toDOM: function toDOM() { return [\"li\", 0] }\n },\n\n text: {\n group: \"inline\"\n },\n\n image: {\n inline: true,\n attrs: {\n src: {},\n alt: {default: null},\n title: {default: null}\n },\n group: \"inline\",\n draggable: true,\n parseDOM: [{tag: \"img[src]\", getAttrs: function getAttrs(dom) {\n return {\n src: dom.getAttribute(\"src\"),\n title: dom.getAttribute(\"title\"),\n alt: dom.getAttribute(\"alt\")\n }\n }}],\n toDOM: function toDOM(node) { return [\"img\", node.attrs] }\n },\n\n hard_break: {\n inline: true,\n group: \"inline\",\n selectable: false,\n parseDOM: [{tag: \"br\"}],\n toDOM: function toDOM() { return [\"br\"] }\n }\n },\n\n marks: {\n em: {\n parseDOM: [{tag: \"i\"}, {tag: \"em\"},\n {style: \"font-style\", getAttrs: function (value) { return value == \"italic\" && null; }}],\n toDOM: function toDOM() { return [\"em\"] }\n },\n\n strong: {\n parseDOM: [{tag: \"b\"}, {tag: \"strong\"},\n {style: \"font-weight\", getAttrs: function (value) { return /^(bold(er)?|[5-9]\\d{2,})$/.test(value) && null; }}],\n toDOM: function toDOM() { return [\"strong\"] }\n },\n\n link: {\n attrs: {\n href: {},\n title: {default: null}\n },\n inclusive: false,\n parseDOM: [{tag: \"a[href]\", getAttrs: function getAttrs(dom) {\n return {href: dom.getAttribute(\"href\"), title: dom.getAttribute(\"title\")}\n }}],\n toDOM: function toDOM(node) { return [\"a\", node.attrs] }\n },\n\n code: {\n parseDOM: [{tag: \"code\"}],\n toDOM: function toDOM() { return [\"code\"] }\n }\n }\n});\n\nfunction maybeMerge(a, b) {\n if (a.isText && b.isText && prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Mark\"].sameSet(a.marks, b.marks))\n { return a.withText(a.text + b.text) }\n}\n\n// Object used to track the context of a running parse.\nvar MarkdownParseState = function MarkdownParseState(schema, tokenHandlers) {\n this.schema = schema;\n this.stack = [{type: schema.topNodeType, content: []}];\n this.marks = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Mark\"].none;\n this.tokenHandlers = tokenHandlers;\n};\n\nMarkdownParseState.prototype.top = function top () {\n return this.stack[this.stack.length - 1]\n};\n\nMarkdownParseState.prototype.push = function push (elt) {\n if (this.stack.length) { this.top().content.push(elt); }\n};\n\n// : (string)\n// Adds the given text to the current position in the document,\n// using the current marks as styling.\nMarkdownParseState.prototype.addText = function addText (text) {\n if (!text) { return }\n var nodes = this.top().content, last = nodes[nodes.length - 1];\n var node = this.schema.text(text, this.marks), merged;\n if (last && (merged = maybeMerge(last, node))) { nodes[nodes.length - 1] = merged; }\n else { nodes.push(node); }\n};\n\n// : (Mark)\n// Adds the given mark to the set of active marks.\nMarkdownParseState.prototype.openMark = function openMark (mark) {\n this.marks = mark.addToSet(this.marks);\n};\n\n// : (Mark)\n// Removes the given mark from the set of active marks.\nMarkdownParseState.prototype.closeMark = function closeMark (mark) {\n this.marks = mark.removeFromSet(this.marks);\n};\n\nMarkdownParseState.prototype.parseTokens = function parseTokens (toks) {\n for (var i = 0; i < toks.length; i++) {\n var tok = toks[i];\n var handler = this.tokenHandlers[tok.type];\n if (!handler)\n { throw new Error(\"Token type `\" + tok.type + \"` not supported by Markdown parser\") }\n handler(this, tok);\n }\n};\n\n// : (NodeType, ?Object, ?[Node]) → ?Node\n// Add a node at the current position.\nMarkdownParseState.prototype.addNode = function addNode (type, attrs, content) {\n var node = type.createAndFill(attrs, content, this.marks);\n if (!node) { return null }\n this.push(node);\n return node\n};\n\n// : (NodeType, ?Object)\n// Wrap subsequent content in a node of the given type.\nMarkdownParseState.prototype.openNode = function openNode (type, attrs) {\n this.stack.push({type: type, attrs: attrs, content: []});\n};\n\n// : () → ?Node\n// Close and return the node that is currently on top of the stack.\nMarkdownParseState.prototype.closeNode = function closeNode () {\n if (this.marks.length) { this.marks = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Mark\"].none; }\n var info = this.stack.pop();\n return this.addNode(info.type, info.attrs, info.content)\n};\n\nfunction attrs(spec, token) {\n if (spec.getAttrs) { return spec.getAttrs(token) }\n // For backwards compatibility when `attrs` is a Function\n else if (spec.attrs instanceof Function) { return spec.attrs(token) }\n else { return spec.attrs }\n}\n\n// Code content is represented as a single token with a `content`\n// property in Markdown-it.\nfunction noOpenClose(type) {\n return type == \"code_inline\" || type == \"code_block\" || type == \"fence\"\n}\n\nfunction withoutTrailingNewline(str) {\n return str[str.length - 1] == \"\\n\" ? str.slice(0, str.length - 1) : str\n}\n\nfunction noOp() {}\n\nfunction tokenHandlers(schema, tokens) {\n var handlers = Object.create(null);\n var loop = function ( type ) {\n var spec = tokens[type];\n if (spec.block) {\n var nodeType = schema.nodeType(spec.block);\n if (noOpenClose(type)) {\n handlers[type] = function (state, tok) {\n state.openNode(nodeType, attrs(spec, tok));\n state.addText(withoutTrailingNewline(tok.content));\n state.closeNode();\n };\n } else {\n handlers[type + \"_open\"] = function (state, tok) { return state.openNode(nodeType, attrs(spec, tok)); };\n handlers[type + \"_close\"] = function (state) { return state.closeNode(); };\n }\n } else if (spec.node) {\n var nodeType$1 = schema.nodeType(spec.node);\n handlers[type] = function (state, tok) { return state.addNode(nodeType$1, attrs(spec, tok)); };\n } else if (spec.mark) {\n var markType = schema.marks[spec.mark];\n if (noOpenClose(type)) {\n handlers[type] = function (state, tok) {\n state.openMark(markType.create(attrs(spec, tok)));\n state.addText(withoutTrailingNewline(tok.content));\n state.closeMark(markType);\n };\n } else {\n handlers[type + \"_open\"] = function (state, tok) { return state.openMark(markType.create(attrs(spec, tok))); };\n handlers[type + \"_close\"] = function (state) { return state.closeMark(markType); };\n }\n } else if (spec.ignore) {\n if (noOpenClose(type)) {\n handlers[type] = noOp;\n } else {\n handlers[type + '_open'] = noOp;\n handlers[type + '_close'] = noOp;\n }\n } else {\n throw new RangeError(\"Unrecognized parsing spec \" + JSON.stringify(spec))\n }\n };\n\n for (var type in tokens) loop( type );\n\n handlers.text = function (state, tok) { return state.addText(tok.content); };\n handlers.inline = function (state, tok) { return state.parseTokens(tok.children); };\n handlers.softbreak = handlers.softbreak || (function (state) { return state.addText(\"\\n\"); });\n\n return handlers\n}\n\n// ::- A configuration of a Markdown parser. Such a parser uses\n// [markdown-it](https://github.com/markdown-it/markdown-it) to\n// tokenize a file, and then runs the custom rules it is given over\n// the tokens to create a ProseMirror document tree.\nvar MarkdownParser = function MarkdownParser(schema, tokenizer, tokens) {\n // :: Object The value of the `tokens` object used to construct\n // this parser. Can be useful to copy and modify to base other\n // parsers on.\n this.tokens = tokens;\n this.schema = schema;\n this.tokenizer = tokenizer;\n this.tokenHandlers = tokenHandlers(schema, tokens);\n};\n\n// :: (string) → Node\n// Parse a string as [CommonMark](http://commonmark.org/) markup,\n// and create a ProseMirror document as prescribed by this parser's\n// rules.\nMarkdownParser.prototype.parse = function parse (text) {\n var state = new MarkdownParseState(this.schema, this.tokenHandlers), doc;\n state.parseTokens(this.tokenizer.parse(text, {}));\n do { doc = state.closeNode(); } while (state.stack.length)\n return doc\n};\n\n// :: MarkdownParser\n// A parser parsing unextended [CommonMark](http://commonmark.org/),\n// without inline HTML, and producing a document in the basic schema.\nvar defaultMarkdownParser = new MarkdownParser(schema, markdown_it__WEBPACK_IMPORTED_MODULE_1___default()(\"commonmark\", {html: false}), {\n blockquote: {block: \"blockquote\"},\n paragraph: {block: \"paragraph\"},\n list_item: {block: \"list_item\"},\n bullet_list: {block: \"bullet_list\"},\n ordered_list: {block: \"ordered_list\", getAttrs: function (tok) { return ({order: +tok.attrGet(\"start\") || 1}); }},\n heading: {block: \"heading\", getAttrs: function (tok) { return ({level: +tok.tag.slice(1)}); }},\n code_block: {block: \"code_block\"},\n fence: {block: \"code_block\", getAttrs: function (tok) { return ({params: tok.info || \"\"}); }},\n hr: {node: \"horizontal_rule\"},\n image: {node: \"image\", getAttrs: function (tok) { return ({\n src: tok.attrGet(\"src\"),\n title: tok.attrGet(\"title\") || null,\n alt: tok.children[0] && tok.children[0].content || null\n }); }},\n hardbreak: {node: \"hard_break\"},\n\n em: {mark: \"em\"},\n strong: {mark: \"strong\"},\n link: {mark: \"link\", getAttrs: function (tok) { return ({\n href: tok.attrGet(\"href\"),\n title: tok.attrGet(\"title\") || null\n }); }},\n code_inline: {mark: \"code\"}\n});\n\n// ::- A specification for serializing a ProseMirror document as\n// Markdown/CommonMark text.\nvar MarkdownSerializer = function MarkdownSerializer(nodes, marks) {\n // :: Object<(MarkdownSerializerState, Node)> The node serializer\n // functions for this serializer.\n this.nodes = nodes;\n // :: Object The mark serializer info.\n this.marks = marks;\n};\n\n// :: (Node, ?Object) → string\n// Serialize the content of the given node to\n// [CommonMark](http://commonmark.org/).\nMarkdownSerializer.prototype.serialize = function serialize (content, options) {\n var state = new MarkdownSerializerState(this.nodes, this.marks, options);\n state.renderContent(content);\n return state.out\n};\n\n// :: MarkdownSerializer\n// A serializer for the [basic schema](#schema).\nvar defaultMarkdownSerializer = new MarkdownSerializer({\n blockquote: function blockquote(state, node) {\n state.wrapBlock(\"> \", null, node, function () { return state.renderContent(node); });\n },\n code_block: function code_block(state, node) {\n state.write(\"```\" + (node.attrs.params || \"\") + \"\\n\");\n state.text(node.textContent, false);\n state.ensureNewLine();\n state.write(\"```\");\n state.closeBlock(node);\n },\n heading: function heading(state, node) {\n state.write(state.repeat(\"#\", node.attrs.level) + \" \");\n state.renderInline(node);\n state.closeBlock(node);\n },\n horizontal_rule: function horizontal_rule(state, node) {\n state.write(node.attrs.markup || \"---\");\n state.closeBlock(node);\n },\n bullet_list: function bullet_list(state, node) {\n state.renderList(node, \" \", function () { return (node.attrs.bullet || \"*\") + \" \"; });\n },\n ordered_list: function ordered_list(state, node) {\n var start = node.attrs.order || 1;\n var maxW = String(start + node.childCount - 1).length;\n var space = state.repeat(\" \", maxW + 2);\n state.renderList(node, space, function (i) {\n var nStr = String(start + i);\n return state.repeat(\" \", maxW - nStr.length) + nStr + \". \"\n });\n },\n list_item: function list_item(state, node) {\n state.renderContent(node);\n },\n paragraph: function paragraph(state, node) {\n state.renderInline(node);\n state.closeBlock(node);\n },\n\n image: function image(state, node) {\n state.write(\"![\" + state.esc(node.attrs.alt || \"\") + \"](\" + state.esc(node.attrs.src) +\n (node.attrs.title ? \" \" + state.quote(node.attrs.title) : \"\") + \")\");\n },\n hard_break: function hard_break(state, node, parent, index) {\n for (var i = index + 1; i < parent.childCount; i++)\n { if (parent.child(i).type != node.type) {\n state.write(\"\\\\\\n\");\n return\n } }\n },\n text: function text(state, node) {\n state.text(node.text);\n }\n}, {\n em: {open: \"*\", close: \"*\", mixable: true, expelEnclosingWhitespace: true},\n strong: {open: \"**\", close: \"**\", mixable: true, expelEnclosingWhitespace: true},\n link: {\n open: function open(_state, mark, parent, index) {\n return isPlainURL(mark, parent, index, 1) ? \"<\" : \"[\"\n },\n close: function close(state, mark, parent, index) {\n return isPlainURL(mark, parent, index, -1) ? \">\"\n : \"](\" + state.esc(mark.attrs.href) + (mark.attrs.title ? \" \" + state.quote(mark.attrs.title) : \"\") + \")\"\n }\n },\n code: {open: function open(_state, _mark, parent, index) { return backticksFor(parent.child(index), -1) },\n close: function close(_state, _mark, parent, index) { return backticksFor(parent.child(index - 1), 1) },\n escape: false}\n});\n\nfunction backticksFor(node, side) {\n var ticks = /`+/g, m, len = 0;\n if (node.isText) { while (m = ticks.exec(node.text)) { len = Math.max(len, m[0].length); } }\n var result = len > 0 && side > 0 ? \" `\" : \"`\";\n for (var i = 0; i < len; i++) { result += \"`\"; }\n if (len > 0 && side < 0) { result += \" \"; }\n return result\n}\n\nfunction isPlainURL(link, parent, index, side) {\n if (link.attrs.title || !/^\\w+:/.test(link.attrs.href)) { return false }\n var content = parent.child(index + (side < 0 ? -1 : 0));\n if (!content.isText || content.text != link.attrs.href || content.marks[content.marks.length - 1] != link) { return false }\n if (index == (side < 0 ? 1 : parent.childCount - 1)) { return true }\n var next = parent.child(index + (side < 0 ? -2 : 1));\n return !link.isInSet(next.marks)\n}\n\n// ::- This is an object used to track state and expose\n// methods related to markdown serialization. Instances are passed to\n// node and mark serialization methods (see `toMarkdown`).\nvar MarkdownSerializerState = function MarkdownSerializerState(nodes, marks, options) {\n this.nodes = nodes;\n this.marks = marks;\n this.delim = this.out = \"\";\n this.closed = false;\n this.inTightList = false;\n // :: Object\n // The options passed to the serializer.\n // tightLists:: ?bool\n // Whether to render lists in a tight style. This can be overridden\n // on a node level by specifying a tight attribute on the node.\n // Defaults to false.\n this.options = options || {};\n if (typeof this.options.tightLists == \"undefined\")\n { this.options.tightLists = false; }\n};\n\nMarkdownSerializerState.prototype.flushClose = function flushClose (size) {\n if (this.closed) {\n if (!this.atBlank()) { this.out += \"\\n\"; }\n if (size == null) { size = 2; }\n if (size > 1) {\n var delimMin = this.delim;\n var trim = /\\s+$/.exec(delimMin);\n if (trim) { delimMin = delimMin.slice(0, delimMin.length - trim[0].length); }\n for (var i = 1; i < size; i++)\n { this.out += delimMin + \"\\n\"; }\n }\n this.closed = false;\n }\n};\n\n// :: (string, ?string, Node, ())\n// Render a block, prefixing each line with `delim`, and the first\n// line in `firstDelim`. `node` should be the node that is closed at\n// the end of the block, and `f` is a function that renders the\n// content of the block.\nMarkdownSerializerState.prototype.wrapBlock = function wrapBlock (delim, firstDelim, node, f) {\n var old = this.delim;\n this.write(firstDelim || delim);\n this.delim += delim;\n f();\n this.delim = old;\n this.closeBlock(node);\n};\n\nMarkdownSerializerState.prototype.atBlank = function atBlank () {\n return /(^|\\n)$/.test(this.out)\n};\n\n// :: ()\n// Ensure the current content ends with a newline.\nMarkdownSerializerState.prototype.ensureNewLine = function ensureNewLine () {\n if (!this.atBlank()) { this.out += \"\\n\"; }\n};\n\n// :: (?string)\n// Prepare the state for writing output (closing closed paragraphs,\n// adding delimiters, and so on), and then optionally add content\n// (unescaped) to the output.\nMarkdownSerializerState.prototype.write = function write (content) {\n this.flushClose();\n if (this.delim && this.atBlank())\n { this.out += this.delim; }\n if (content) { this.out += content; }\n};\n\n// :: (Node)\n// Close the block for the given node.\nMarkdownSerializerState.prototype.closeBlock = function closeBlock (node) {\n this.closed = node;\n};\n\n// :: (string, ?bool)\n// Add the given text to the document. When escape is not `false`,\n// it will be escaped.\nMarkdownSerializerState.prototype.text = function text (text$1, escape) {\n var lines = text$1.split(\"\\n\");\n for (var i = 0; i < lines.length; i++) {\n var startOfLine = this.atBlank() || this.closed;\n this.write();\n this.out += escape !== false ? this.esc(lines[i], startOfLine) : lines[i];\n if (i != lines.length - 1) { this.out += \"\\n\"; }\n }\n};\n\n// :: (Node)\n// Render the given node as a block.\nMarkdownSerializerState.prototype.render = function render (node, parent, index) {\n if (typeof parent == \"number\") { throw new Error(\"!\") }\n this.nodes[node.type.name](this, node, parent, index);\n};\n\n// :: (Node)\n// Render the contents of `parent` as block nodes.\nMarkdownSerializerState.prototype.renderContent = function renderContent (parent) {\n var this$1 = this;\n\n parent.forEach(function (node, _, i) { return this$1.render(node, parent, i); });\n};\n\n// :: (Node)\n// Render the contents of `parent` as inline content.\nMarkdownSerializerState.prototype.renderInline = function renderInline (parent) {\n var this$1 = this;\n\n var active = [], trailing = \"\";\n var progress = function (node, _, index) {\n var marks = node ? node.marks : [];\n\n // Remove marks from `hard_break` that are the last node inside\n // that mark to prevent parser edge cases with new lines just\n // before closing marks.\n // (FIXME it'd be nice if we had a schema-agnostic way to\n // identify nodes that serialize as hard breaks)\n if (node && node.type.name === \"hard_break\")\n { marks = marks.filter(function (m) {\n if (index + 1 == parent.childCount) { return false }\n var next = parent.child(index + 1);\n return m.isInSet(next.marks) && (!next.isText || /\\S/.test(next.text))\n }); }\n\n var leading = trailing;\n trailing = \"\";\n // If whitespace has to be expelled from the node, adjust\n // leading and trailing accordingly.\n if (node && node.isText && marks.some(function (mark) {\n var info = this$1.marks[mark.type.name];\n return info && info.expelEnclosingWhitespace\n })) {\n var ref = /^(\\s*)(.*?)(\\s*)$/m.exec(node.text);\n var _$1 = ref[0];\n var lead = ref[1];\n var inner$1 = ref[2];\n var trail = ref[3];\n leading += lead;\n trailing = trail;\n if (lead || trail) {\n node = inner$1 ? node.withText(inner$1) : null;\n if (!node) { marks = active; }\n }\n }\n\n var inner = marks.length && marks[marks.length - 1], noEsc = inner && this$1.marks[inner.type.name].escape === false;\n var len = marks.length - (noEsc ? 1 : 0);\n\n // Try to reorder 'mixable' marks, such as em and strong, which\n // in Markdown may be opened and closed in different order, so\n // that order of the marks for the token matches the order in\n // active.\n outer: for (var i = 0; i < len; i++) {\n var mark = marks[i];\n if (!this$1.marks[mark.type.name].mixable) { break }\n for (var j = 0; j < active.length; j++) {\n var other = active[j];\n if (!this$1.marks[other.type.name].mixable) { break }\n if (mark.eq(other)) {\n if (i > j)\n { marks = marks.slice(0, j).concat(mark).concat(marks.slice(j, i)).concat(marks.slice(i + 1, len)); }\n else if (j > i)\n { marks = marks.slice(0, i).concat(marks.slice(i + 1, j)).concat(mark).concat(marks.slice(j, len)); }\n continue outer\n }\n }\n }\n\n // Find the prefix of the mark set that didn't change\n var keep = 0;\n while (keep < Math.min(active.length, len) && marks[keep].eq(active[keep])) { ++keep; }\n\n // Close the marks that need to be closed\n while (keep < active.length)\n { this$1.text(this$1.markString(active.pop(), false, parent, index), false); }\n\n // Output any previously expelled trailing whitespace outside the marks\n if (leading) { this$1.text(leading); }\n\n // Open the marks that need to be opened\n if (node) {\n while (active.length < len) {\n var add = marks[active.length];\n active.push(add);\n this$1.text(this$1.markString(add, true, parent, index), false);\n }\n\n // Render the node. Special case code marks, since their content\n // may not be escaped.\n if (noEsc && node.isText)\n { this$1.text(this$1.markString(inner, true, parent, index) + node.text +\n this$1.markString(inner, false, parent, index + 1), false); }\n else\n { this$1.render(node, parent, index); }\n }\n };\n parent.forEach(progress);\n progress(null, null, parent.childCount);\n};\n\n// :: (Node, string, (number) → string)\n// Render a node's content as a list. `delim` should be the extra\n// indentation added to all lines except the first in an item,\n// `firstDelim` is a function going from an item index to a\n// delimiter for the first line of the item.\nMarkdownSerializerState.prototype.renderList = function renderList (node, delim, firstDelim) {\n var this$1 = this;\n\n if (this.closed && this.closed.type == node.type)\n { this.flushClose(3); }\n else if (this.inTightList)\n { this.flushClose(1); }\n\n var isTight = typeof node.attrs.tight != \"undefined\" ? node.attrs.tight : this.options.tightLists;\n var prevTight = this.inTightList;\n this.inTightList = isTight;\n node.forEach(function (child, _, i) {\n if (i && isTight) { this$1.flushClose(1); }\n this$1.wrapBlock(delim, firstDelim(i), node, function () { return this$1.render(child, node, i); });\n });\n this.inTightList = prevTight;\n};\n\n// :: (string, ?bool) → string\n// Escape the given string so that it can safely appear in Markdown\n// content. If `startOfLine` is true, also escape characters that\n// has special meaning only at the start of the line.\nMarkdownSerializerState.prototype.esc = function esc (str, startOfLine) {\n str = str.replace(/[`*\\\\~\\[\\]]/g, \"\\\\$&\");\n if (startOfLine) { str = str.replace(/^[:#\\-*+]/, \"\\\\$&\").replace(/^(\\d+)\\./, \"$1\\\\.\"); }\n return str\n};\n\nMarkdownSerializerState.prototype.quote = function quote (str) {\n var wrap = str.indexOf('\"') == -1 ? '\"\"' : str.indexOf(\"'\") == -1 ? \"''\" : \"()\";\n return wrap[0] + str + wrap[1]\n};\n\n// :: (string, number) → string\n// Repeat the given string `n` times.\nMarkdownSerializerState.prototype.repeat = function repeat (str, n) {\n var out = \"\";\n for (var i = 0; i < n; i++) { out += str; }\n return out\n};\n\n// : (Mark, bool, string?) → string\n// Get the markdown string for a given opening or closing mark.\nMarkdownSerializerState.prototype.markString = function markString (mark, open, parent, index) {\n var info = this.marks[mark.type.name];\n var value = open ? info.open : info.close;\n return typeof value == \"string\" ? value : value(this, mark, parent, index)\n};\n\n// :: (string) → { leading: ?string, trailing: ?string }\n// Get leading and trailing whitespace from a string. Values of\n// leading or trailing property of the return object will be undefined\n// if there is no match.\nMarkdownSerializerState.prototype.getEnclosingWhitespace = function getEnclosingWhitespace (text) {\n return {\n leading: (text.match(/^(\\s+)/) || [])[0],\n trailing: (text.match(/(\\s+)$/) || [])[0]\n }\n};\n\n\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/prosemirror-markdown/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/prosemirror-menu/dist/index.es.js": +/*!********************************************************!*\ + !*** ./node_modules/prosemirror-menu/dist/index.es.js ***! + \********************************************************/ +/*! exports provided: Dropdown, DropdownSubmenu, MenuItem, blockTypeItem, icons, joinUpItem, liftItem, menuBar, redoItem, renderGrouped, selectParentNodeItem, undoItem, wrapItem */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Dropdown\", function() { return Dropdown; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DropdownSubmenu\", function() { return DropdownSubmenu; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MenuItem\", function() { return MenuItem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"blockTypeItem\", function() { return blockTypeItem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"icons\", function() { return icons; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"joinUpItem\", function() { return joinUpItem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"liftItem\", function() { return liftItem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"menuBar\", function() { return menuBar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"redoItem\", function() { return redoItem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"renderGrouped\", function() { return renderGrouped; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"selectParentNodeItem\", function() { return selectParentNodeItem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"undoItem\", function() { return undoItem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"wrapItem\", function() { return wrapItem; });\n/* harmony import */ var crel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! crel */ \"./node_modules/crel/crel.es.js\");\n/* harmony import */ var prosemirror_commands__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prosemirror-commands */ \"./node_modules/prosemirror-commands/dist/index.es.js\");\n/* harmony import */ var prosemirror_history__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prosemirror-history */ \"./node_modules/prosemirror-history/dist/index.es.js\");\n/* harmony import */ var prosemirror_state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prosemirror-state */ \"./node_modules/prosemirror-state/dist/index.es.js\");\n\n\n\n\n\nvar SVG = \"http://www.w3.org/2000/svg\";\nvar XLINK = \"http://www.w3.org/1999/xlink\";\n\nvar prefix = \"ProseMirror-icon\";\n\nfunction hashPath(path) {\n var hash = 0;\n for (var i = 0; i < path.length; i++)\n { hash = (((hash << 5) - hash) + path.charCodeAt(i)) | 0; }\n return hash\n}\n\nfunction getIcon(icon) {\n var node = document.createElement(\"div\");\n node.className = prefix;\n if (icon.path) {\n var name = \"pm-icon-\" + hashPath(icon.path).toString(16);\n if (!document.getElementById(name)) { buildSVG(name, icon); }\n var svg = node.appendChild(document.createElementNS(SVG, \"svg\"));\n svg.style.width = (icon.width / icon.height) + \"em\";\n var use = svg.appendChild(document.createElementNS(SVG, \"use\"));\n use.setAttributeNS(XLINK, \"href\", /([^#]*)/.exec(document.location)[1] + \"#\" + name);\n } else if (icon.dom) {\n node.appendChild(icon.dom.cloneNode(true));\n } else {\n node.appendChild(document.createElement(\"span\")).textContent = icon.text || '';\n if (icon.css) { node.firstChild.style.cssText = icon.css; }\n }\n return node\n}\n\nfunction buildSVG(name, data) {\n var collection = document.getElementById(prefix + \"-collection\");\n if (!collection) {\n collection = document.createElementNS(SVG, \"svg\");\n collection.id = prefix + \"-collection\";\n collection.style.display = \"none\";\n document.body.insertBefore(collection, document.body.firstChild);\n }\n var sym = document.createElementNS(SVG, \"symbol\");\n sym.id = name;\n sym.setAttribute(\"viewBox\", \"0 0 \" + data.width + \" \" + data.height);\n var path = sym.appendChild(document.createElementNS(SVG, \"path\"));\n path.setAttribute(\"d\", data.path);\n collection.appendChild(sym);\n}\n\nvar prefix$1 = \"ProseMirror-menu\";\n\n// ::- An icon or label that, when clicked, executes a command.\nvar MenuItem = function MenuItem(spec) {\n // :: MenuItemSpec\n // The spec used to create the menu item.\n this.spec = spec;\n};\n\n// :: (EditorView) → {dom: dom.Node, update: (EditorState) → bool}\n// Renders the icon according to its [display\n// spec](#menu.MenuItemSpec.display), and adds an event handler which\n// executes the command when the representation is clicked.\nMenuItem.prototype.render = function render (view) {\n var spec = this.spec;\n var dom = spec.render ? spec.render(view)\n : spec.icon ? getIcon(spec.icon)\n : spec.label ? Object(crel__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"div\", null, translate(view, spec.label))\n : null;\n if (!dom) { throw new RangeError(\"MenuItem without icon or label property\") }\n if (spec.title) {\n var title = (typeof spec.title === \"function\" ? spec.title(view.state) : spec.title);\n dom.setAttribute(\"title\", translate(view, title));\n }\n if (spec.class) { dom.classList.add(spec.class); }\n if (spec.css) { dom.style.cssText += spec.css; }\n\n dom.addEventListener(\"mousedown\", function (e) {\n e.preventDefault();\n if (!dom.classList.contains(prefix$1 + \"-disabled\"))\n { spec.run(view.state, view.dispatch, view, e); }\n });\n\n function update(state) {\n if (spec.select) {\n var selected = spec.select(state);\n dom.style.display = selected ? \"\" : \"none\";\n if (!selected) { return false }\n }\n var enabled = true;\n if (spec.enable) {\n enabled = spec.enable(state) || false;\n setClass(dom, prefix$1 + \"-disabled\", !enabled);\n }\n if (spec.active) {\n var active = enabled && spec.active(state) || false;\n setClass(dom, prefix$1 + \"-active\", active);\n }\n return true\n }\n\n return {dom: dom, update: update}\n};\n\nfunction translate(view, text) {\n return view._props.translate ? view._props.translate(text) : text\n}\n\n// MenuItemSpec:: interface\n// The configuration object passed to the `MenuItem` constructor.\n//\n// run:: (EditorState, (Transaction), EditorView, dom.Event)\n// The function to execute when the menu item is activated.\n//\n// select:: ?(EditorState) → bool\n// Optional function that is used to determine whether the item is\n// appropriate at the moment. Deselected items will be hidden.\n//\n// enable:: ?(EditorState) → bool\n// Function that is used to determine if the item is enabled. If\n// given and returning false, the item will be given a disabled\n// styling.\n//\n// active:: ?(EditorState) → bool\n// A predicate function to determine whether the item is 'active' (for\n// example, the item for toggling the strong mark might be active then\n// the cursor is in strong text).\n//\n// render:: ?(EditorView) → dom.Node\n// A function that renders the item. You must provide either this,\n// [`icon`](#menu.MenuItemSpec.icon), or [`label`](#MenuItemSpec.label).\n//\n// icon:: ?Object\n// Describes an icon to show for this item. The object may specify\n// an SVG icon, in which case its `path` property should be an [SVG\n// path\n// spec](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d),\n// and `width` and `height` should provide the viewbox in which that\n// path exists. Alternatively, it may have a `text` property\n// specifying a string of text that makes up the icon, with an\n// optional `css` property giving additional CSS styling for the\n// text. _Or_ it may contain `dom` property containing a DOM node.\n//\n// label:: ?string\n// Makes the item show up as a text label. Mostly useful for items\n// wrapped in a [drop-down](#menu.Dropdown) or similar menu. The object\n// should have a `label` property providing the text to display.\n//\n// title:: ?union\n// Defines DOM title (mouseover) text for the item.\n//\n// class:: ?string\n// Optionally adds a CSS class to the item's DOM representation.\n//\n// css:: ?string\n// Optionally adds a string of inline CSS to the item's DOM\n// representation.\n\nvar lastMenuEvent = {time: 0, node: null};\nfunction markMenuEvent(e) {\n lastMenuEvent.time = Date.now();\n lastMenuEvent.node = e.target;\n}\nfunction isMenuEvent(wrapper) {\n return Date.now() - 100 < lastMenuEvent.time &&\n lastMenuEvent.node && wrapper.contains(lastMenuEvent.node)\n}\n\n// ::- A drop-down menu, displayed as a label with a downwards-pointing\n// triangle to the right of it.\nvar Dropdown = function Dropdown(content, options) {\n this.options = options || {};\n this.content = Array.isArray(content) ? content : [content];\n};\n\n// :: (EditorView) → {dom: dom.Node, update: (EditorState)}\n// Render the dropdown menu and sub-items.\nDropdown.prototype.render = function render (view) {\n var this$1 = this;\n\n var content = renderDropdownItems(this.content, view);\n\n var label = Object(crel__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"div\", {class: prefix$1 + \"-dropdown \" + (this.options.class || \"\"),\n style: this.options.css},\n translate(view, this.options.label));\n if (this.options.title) { label.setAttribute(\"title\", translate(view, this.options.title)); }\n var wrap = Object(crel__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"div\", {class: prefix$1 + \"-dropdown-wrap\"}, label);\n var open = null, listeningOnClose = null;\n var close = function () {\n if (open && open.close()) {\n open = null;\n window.removeEventListener(\"mousedown\", listeningOnClose);\n }\n };\n label.addEventListener(\"mousedown\", function (e) {\n e.preventDefault();\n markMenuEvent(e);\n if (open) {\n close();\n } else {\n open = this$1.expand(wrap, content.dom);\n window.addEventListener(\"mousedown\", listeningOnClose = function () {\n if (!isMenuEvent(wrap)) { close(); }\n });\n }\n });\n\n function update(state) {\n var inner = content.update(state);\n wrap.style.display = inner ? \"\" : \"none\";\n return inner\n }\n\n return {dom: wrap, update: update}\n};\n\nDropdown.prototype.expand = function expand (dom, items) {\n var menuDOM = Object(crel__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"div\", {class: prefix$1 + \"-dropdown-menu \" + (this.options.class || \"\")}, items);\n\n var done = false;\n function close() {\n if (done) { return }\n done = true;\n dom.removeChild(menuDOM);\n return true\n }\n dom.appendChild(menuDOM);\n return {close: close, node: menuDOM}\n};\n\nfunction renderDropdownItems(items, view) {\n var rendered = [], updates = [];\n for (var i = 0; i < items.length; i++) {\n var ref = items[i].render(view);\n var dom = ref.dom;\n var update = ref.update;\n rendered.push(Object(crel__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"div\", {class: prefix$1 + \"-dropdown-item\"}, dom));\n updates.push(update);\n }\n return {dom: rendered, update: combineUpdates(updates, rendered)}\n}\n\nfunction combineUpdates(updates, nodes) {\n return function (state) {\n var something = false;\n for (var i = 0; i < updates.length; i++) {\n var up = updates[i](state);\n nodes[i].style.display = up ? \"\" : \"none\";\n if (up) { something = true; }\n }\n return something\n }\n}\n\n// ::- Represents a submenu wrapping a group of elements that start\n// hidden and expand to the right when hovered over or tapped.\nvar DropdownSubmenu = function DropdownSubmenu(content, options) {\n this.options = options || {};\n this.content = Array.isArray(content) ? content : [content];\n};\n\n// :: (EditorView) → {dom: dom.Node, update: (EditorState) → bool}\n// Renders the submenu.\nDropdownSubmenu.prototype.render = function render (view) {\n var items = renderDropdownItems(this.content, view);\n\n var label = Object(crel__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"div\", {class: prefix$1 + \"-submenu-label\"}, translate(view, this.options.label));\n var wrap = Object(crel__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"div\", {class: prefix$1 + \"-submenu-wrap\"}, label,\n Object(crel__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"div\", {class: prefix$1 + \"-submenu\"}, items.dom));\n var listeningOnClose = null;\n label.addEventListener(\"mousedown\", function (e) {\n e.preventDefault();\n markMenuEvent(e);\n setClass(wrap, prefix$1 + \"-submenu-wrap-active\");\n if (!listeningOnClose)\n { window.addEventListener(\"mousedown\", listeningOnClose = function () {\n if (!isMenuEvent(wrap)) {\n wrap.classList.remove(prefix$1 + \"-submenu-wrap-active\");\n window.removeEventListener(\"mousedown\", listeningOnClose);\n listeningOnClose = null;\n }\n }); }\n });\n\n function update(state) {\n var inner = items.update(state);\n wrap.style.display = inner ? \"\" : \"none\";\n return inner\n }\n return {dom: wrap, update: update}\n};\n\n// :: (EditorView, [union]) → {dom: ?dom.DocumentFragment, update: (EditorState) → bool}\n// Render the given, possibly nested, array of menu elements into a\n// document fragment, placing separators between them (and ensuring no\n// superfluous separators appear when some of the groups turn out to\n// be empty).\nfunction renderGrouped(view, content) {\n var result = document.createDocumentFragment();\n var updates = [], separators = [];\n for (var i = 0; i < content.length; i++) {\n var items = content[i], localUpdates = [], localNodes = [];\n for (var j = 0; j < items.length; j++) {\n var ref = items[j].render(view);\n var dom = ref.dom;\n var update$1 = ref.update;\n var span = Object(crel__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"span\", {class: prefix$1 + \"item\"}, dom);\n result.appendChild(span);\n localNodes.push(span);\n localUpdates.push(update$1);\n }\n if (localUpdates.length) {\n updates.push(combineUpdates(localUpdates, localNodes));\n if (i < content.length - 1)\n { separators.push(result.appendChild(separator())); }\n }\n }\n\n function update(state) {\n var something = false, needSep = false;\n for (var i = 0; i < updates.length; i++) {\n var hasContent = updates[i](state);\n if (i) { separators[i - 1].style.display = needSep && hasContent ? \"\" : \"none\"; }\n needSep = hasContent;\n if (hasContent) { something = true; }\n }\n return something\n }\n return {dom: result, update: update}\n}\n\nfunction separator() {\n return Object(crel__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"span\", {class: prefix$1 + \"separator\"})\n}\n\n// :: Object\n// A set of basic editor-related icons. Contains the properties\n// `join`, `lift`, `selectParentNode`, `undo`, `redo`, `strong`, `em`,\n// `code`, `link`, `bulletList`, `orderedList`, and `blockquote`, each\n// holding an object that can be used as the `icon` option to\n// `MenuItem`.\nvar icons = {\n join: {\n width: 800, height: 900,\n path: \"M0 75h800v125h-800z M0 825h800v-125h-800z M250 400h100v-100h100v100h100v100h-100v100h-100v-100h-100z\"\n },\n lift: {\n width: 1024, height: 1024,\n path: \"M219 310v329q0 7-5 12t-12 5q-8 0-13-5l-164-164q-5-5-5-13t5-13l164-164q5-5 13-5 7 0 12 5t5 12zM1024 749v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12zM1024 530v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 310v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 91v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12z\"\n },\n selectParentNode: {text: \"\\u2b1a\", css: \"font-weight: bold\"},\n undo: {\n width: 1024, height: 1024,\n path: \"M761 1024c113-206 132-520-313-509v253l-384-384 384-384v248c534-13 594 472 313 775z\"\n },\n redo: {\n width: 1024, height: 1024,\n path: \"M576 248v-248l384 384-384 384v-253c-446-10-427 303-313 509-280-303-221-789 313-775z\"\n },\n strong: {\n width: 805, height: 1024,\n path: \"M317 869q42 18 80 18 214 0 214-191 0-65-23-102-15-25-35-42t-38-26-46-14-48-6-54-1q-41 0-57 5 0 30-0 90t-0 90q0 4-0 38t-0 55 2 47 6 38zM309 442q24 4 62 4 46 0 81-7t62-25 42-51 14-81q0-40-16-70t-45-46-61-24-70-8q-28 0-74 7 0 28 2 86t2 86q0 15-0 45t-0 45q0 26 0 39zM0 950l1-53q8-2 48-9t60-15q4-6 7-15t4-19 3-18 1-21 0-19v-37q0-561-12-585-2-4-12-8t-25-6-28-4-27-2-17-1l-2-47q56-1 194-6t213-5q13 0 39 0t38 0q40 0 78 7t73 24 61 40 42 59 16 78q0 29-9 54t-22 41-36 32-41 25-48 22q88 20 146 76t58 141q0 57-20 102t-53 74-78 48-93 27-100 8q-25 0-75-1t-75-1q-60 0-175 6t-132 6z\"\n },\n em: {\n width: 585, height: 1024,\n path: \"M0 949l9-48q3-1 46-12t63-21q16-20 23-57 0-4 35-165t65-310 29-169v-14q-13-7-31-10t-39-4-33-3l10-58q18 1 68 3t85 4 68 1q27 0 56-1t69-4 56-3q-2 22-10 50-17 5-58 16t-62 19q-4 10-8 24t-5 22-4 26-3 24q-15 84-50 239t-44 203q-1 5-7 33t-11 51-9 47-3 32l0 10q9 2 105 17-1 25-9 56-6 0-18 0t-18 0q-16 0-49-5t-49-5q-78-1-117-1-29 0-81 5t-69 6z\"\n },\n code: {\n width: 896, height: 1024,\n path: \"M608 192l-96 96 224 224-224 224 96 96 288-320-288-320zM288 192l-288 320 288 320 96-96-224-224 224-224-96-96z\"\n },\n link: {\n width: 951, height: 1024,\n path: \"M832 694q0-22-16-38l-118-118q-16-16-38-16-24 0-41 18 1 1 10 10t12 12 8 10 7 14 2 15q0 22-16 38t-38 16q-8 0-15-2t-14-7-10-8-12-12-10-10q-18 17-18 41 0 22 16 38l117 118q15 15 38 15 22 0 38-14l84-83q16-16 16-38zM430 292q0-22-16-38l-117-118q-16-16-38-16-22 0-38 15l-84 83q-16 16-16 38 0 22 16 38l118 118q15 15 38 15 24 0 41-17-1-1-10-10t-12-12-8-10-7-14-2-15q0-22 16-38t38-16q8 0 15 2t14 7 10 8 12 12 10 10q18-17 18-41zM941 694q0 68-48 116l-84 83q-47 47-116 47-69 0-116-48l-117-118q-47-47-47-116 0-70 50-119l-50-50q-49 50-118 50-68 0-116-48l-118-118q-48-48-48-116t48-116l84-83q47-47 116-47 69 0 116 48l117 118q47 47 47 116 0 70-50 119l50 50q49-50 118-50 68 0 116 48l118 118q48 48 48 116z\"\n },\n bulletList: {\n width: 768, height: 896,\n path: \"M0 512h128v-128h-128v128zM0 256h128v-128h-128v128zM0 768h128v-128h-128v128zM256 512h512v-128h-512v128zM256 256h512v-128h-512v128zM256 768h512v-128h-512v128z\"\n },\n orderedList: {\n width: 768, height: 896,\n path: \"M320 512h448v-128h-448v128zM320 768h448v-128h-448v128zM320 128v128h448v-128h-448zM79 384h78v-256h-36l-85 23v50l43-2v185zM189 590c0-36-12-78-96-78-33 0-64 6-83 16l1 66c21-10 42-15 67-15s32 11 32 28c0 26-30 58-110 112v50h192v-67l-91 2c49-30 87-66 87-113l1-1z\"\n },\n blockquote: {\n width: 640, height: 896,\n path: \"M0 448v256h256v-256h-128c0 0 0-128 128-128v-128c0 0-256 0-256 256zM640 320v-128c0 0-256 0-256 256v256h256v-256h-128c0 0 0-128 128-128z\"\n }\n};\n\n// :: MenuItem\n// Menu item for the `joinUp` command.\nvar joinUpItem = new MenuItem({\n title: \"Join with above block\",\n run: prosemirror_commands__WEBPACK_IMPORTED_MODULE_1__[\"joinUp\"],\n select: function (state) { return Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_1__[\"joinUp\"])(state); },\n icon: icons.join\n});\n\n// :: MenuItem\n// Menu item for the `lift` command.\nvar liftItem = new MenuItem({\n title: \"Lift out of enclosing block\",\n run: prosemirror_commands__WEBPACK_IMPORTED_MODULE_1__[\"lift\"],\n select: function (state) { return Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_1__[\"lift\"])(state); },\n icon: icons.lift\n});\n\n// :: MenuItem\n// Menu item for the `selectParentNode` command.\nvar selectParentNodeItem = new MenuItem({\n title: \"Select parent node\",\n run: prosemirror_commands__WEBPACK_IMPORTED_MODULE_1__[\"selectParentNode\"],\n select: function (state) { return Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_1__[\"selectParentNode\"])(state); },\n icon: icons.selectParentNode\n});\n\n// :: MenuItem\n// Menu item for the `undo` command.\nvar undoItem = new MenuItem({\n title: \"Undo last change\",\n run: prosemirror_history__WEBPACK_IMPORTED_MODULE_2__[\"undo\"],\n enable: function (state) { return Object(prosemirror_history__WEBPACK_IMPORTED_MODULE_2__[\"undo\"])(state); },\n icon: icons.undo\n});\n\n// :: MenuItem\n// Menu item for the `redo` command.\nvar redoItem = new MenuItem({\n title: \"Redo last undone change\",\n run: prosemirror_history__WEBPACK_IMPORTED_MODULE_2__[\"redo\"],\n enable: function (state) { return Object(prosemirror_history__WEBPACK_IMPORTED_MODULE_2__[\"redo\"])(state); },\n icon: icons.redo\n});\n\n// :: (NodeType, Object) → MenuItem\n// Build a menu item for wrapping the selection in a given node type.\n// Adds `run` and `select` properties to the ones present in\n// `options`. `options.attrs` may be an object or a function.\nfunction wrapItem(nodeType, options) {\n var passedOptions = {\n run: function run(state, dispatch) {\n // FIXME if (options.attrs instanceof Function) options.attrs(state, attrs => wrapIn(nodeType, attrs)(state))\n return Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_1__[\"wrapIn\"])(nodeType, options.attrs)(state, dispatch)\n },\n select: function select(state) {\n return Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_1__[\"wrapIn\"])(nodeType, options.attrs instanceof Function ? null : options.attrs)(state)\n }\n };\n for (var prop in options) { passedOptions[prop] = options[prop]; }\n return new MenuItem(passedOptions)\n}\n\n// :: (NodeType, Object) → MenuItem\n// Build a menu item for changing the type of the textblock around the\n// selection to the given type. Provides `run`, `active`, and `select`\n// properties. Others must be given in `options`. `options.attrs` may\n// be an object to provide the attributes for the textblock node.\nfunction blockTypeItem(nodeType, options) {\n var command = Object(prosemirror_commands__WEBPACK_IMPORTED_MODULE_1__[\"setBlockType\"])(nodeType, options.attrs);\n var passedOptions = {\n run: command,\n enable: function enable(state) { return command(state) },\n active: function active(state) {\n var ref = state.selection;\n var $from = ref.$from;\n var to = ref.to;\n var node = ref.node;\n if (node) { return node.hasMarkup(nodeType, options.attrs) }\n return to <= $from.end() && $from.parent.hasMarkup(nodeType, options.attrs)\n }\n };\n for (var prop in options) { passedOptions[prop] = options[prop]; }\n return new MenuItem(passedOptions)\n}\n\n// Work around classList.toggle being broken in IE11\nfunction setClass(dom, cls, on) {\n if (on) { dom.classList.add(cls); }\n else { dom.classList.remove(cls); }\n}\n\nvar prefix$2 = \"ProseMirror-menubar\";\n\nfunction isIOS() {\n if (typeof navigator == \"undefined\") { return false }\n var agent = navigator.userAgent;\n return !/Edge\\/\\d/.test(agent) && /AppleWebKit/.test(agent) && /Mobile\\/\\w+/.test(agent)\n}\n\n// :: (Object) → Plugin\n// A plugin that will place a menu bar above the editor. Note that\n// this involves wrapping the editor in an additional `
`.\n//\n// options::-\n// Supports the following options:\n//\n// content:: [[MenuElement]]\n// Provides the content of the menu, as a nested array to be\n// passed to `renderGrouped`.\n//\n// floating:: ?bool\n// Determines whether the menu floats, i.e. whether it sticks to\n// the top of the viewport when the editor is partially scrolled\n// out of view.\nfunction menuBar(options) {\n return new prosemirror_state__WEBPACK_IMPORTED_MODULE_3__[\"Plugin\"]({\n view: function view(editorView) { return new MenuBarView(editorView, options) }\n })\n}\n\nvar MenuBarView = function MenuBarView(editorView, options) {\n var this$1 = this;\n\n this.editorView = editorView;\n this.options = options;\n\n this.wrapper = Object(crel__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"div\", {class: prefix$2 + \"-wrapper\"});\n this.menu = this.wrapper.appendChild(Object(crel__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"div\", {class: prefix$2}));\n this.menu.className = prefix$2;\n this.spacer = null;\n\n editorView.dom.parentNode.replaceChild(this.wrapper, editorView.dom);\n this.wrapper.appendChild(editorView.dom);\n\n this.maxHeight = 0;\n this.widthForMaxHeight = 0;\n this.floating = false;\n\n var ref = renderGrouped(this.editorView, this.options.content);\n var dom = ref.dom;\n var update = ref.update;\n this.contentUpdate = update;\n this.menu.appendChild(dom);\n this.update();\n\n if (options.floating && !isIOS()) {\n this.updateFloat();\n var potentialScrollers = getAllWrapping(this.wrapper);\n this.scrollFunc = function (e) {\n var root = this$1.editorView.root;\n if (!(root.body || root).contains(this$1.wrapper)) {\n potentialScrollers.forEach(function (el) { return el.removeEventListener(\"scroll\", this$1.scrollFunc); });\n } else {\n this$1.updateFloat(e.target.getBoundingClientRect && e.target);\n }\n };\n potentialScrollers.forEach(function (el) { return el.addEventListener('scroll', this$1.scrollFunc); });\n }\n};\n\nMenuBarView.prototype.update = function update () {\n this.contentUpdate(this.editorView.state);\n\n if (this.floating) {\n this.updateScrollCursor();\n } else {\n if (this.menu.offsetWidth != this.widthForMaxHeight) {\n this.widthForMaxHeight = this.menu.offsetWidth;\n this.maxHeight = 0;\n }\n if (this.menu.offsetHeight > this.maxHeight) {\n this.maxHeight = this.menu.offsetHeight;\n this.menu.style.minHeight = this.maxHeight + \"px\";\n }\n }\n};\n\nMenuBarView.prototype.updateScrollCursor = function updateScrollCursor () {\n var selection = this.editorView.root.getSelection();\n if (!selection.focusNode) { return }\n var rects = selection.getRangeAt(0).getClientRects();\n var selRect = rects[selectionIsInverted(selection) ? 0 : rects.length - 1];\n if (!selRect) { return }\n var menuRect = this.menu.getBoundingClientRect();\n if (selRect.top < menuRect.bottom && selRect.bottom > menuRect.top) {\n var scrollable = findWrappingScrollable(this.wrapper);\n if (scrollable) { scrollable.scrollTop -= (menuRect.bottom - selRect.top); }\n }\n};\n\nMenuBarView.prototype.updateFloat = function updateFloat (scrollAncestor) {\n var parent = this.wrapper, editorRect = parent.getBoundingClientRect(),\n top = scrollAncestor ? Math.max(0, scrollAncestor.getBoundingClientRect().top) : 0;\n\n if (this.floating) {\n if (editorRect.top >= top || editorRect.bottom < this.menu.offsetHeight + 10) {\n this.floating = false;\n this.menu.style.position = this.menu.style.left = this.menu.style.top = this.menu.style.width = \"\";\n this.menu.style.display = \"\";\n this.spacer.parentNode.removeChild(this.spacer);\n this.spacer = null;\n } else {\n var border = (parent.offsetWidth - parent.clientWidth) / 2;\n this.menu.style.left = (editorRect.left + border) + \"px\";\n this.menu.style.display = (editorRect.top > window.innerHeight ? \"none\" : \"\");\n if (scrollAncestor) { this.menu.style.top = top + \"px\"; }\n }\n } else {\n if (editorRect.top < top && editorRect.bottom >= this.menu.offsetHeight + 10) {\n this.floating = true;\n var menuRect = this.menu.getBoundingClientRect();\n this.menu.style.left = menuRect.left + \"px\";\n this.menu.style.width = menuRect.width + \"px\";\n if (scrollAncestor) { this.menu.style.top = top + \"px\"; }\n this.menu.style.position = \"fixed\";\n this.spacer = Object(crel__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"div\", {class: prefix$2 + \"-spacer\", style: (\"height: \" + (menuRect.height) + \"px\")});\n parent.insertBefore(this.spacer, this.menu);\n }\n }\n};\n\nMenuBarView.prototype.destroy = function destroy () {\n if (this.wrapper.parentNode)\n { this.wrapper.parentNode.replaceChild(this.editorView.dom, this.wrapper); }\n};\n\n// Not precise, but close enough\nfunction selectionIsInverted(selection) {\n if (selection.anchorNode == selection.focusNode) { return selection.anchorOffset > selection.focusOffset }\n return selection.anchorNode.compareDocumentPosition(selection.focusNode) == Node.DOCUMENT_POSITION_FOLLOWING\n}\n\nfunction findWrappingScrollable(node) {\n for (var cur = node.parentNode; cur; cur = cur.parentNode)\n { if (cur.scrollHeight > cur.clientHeight) { return cur } }\n}\n\nfunction getAllWrapping(node) {\n var res = [window];\n for (var cur = node.parentNode; cur; cur = cur.parentNode)\n { res.push(cur); }\n return res\n}\n\n\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/prosemirror-menu/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/prosemirror-model/dist/index.es.js": +/*!*********************************************************!*\ + !*** ./node_modules/prosemirror-model/dist/index.es.js ***! + \*********************************************************/ +/*! exports provided: ContentMatch, DOMParser, DOMSerializer, Fragment, Mark, MarkType, Node, NodeRange, NodeType, ReplaceError, ResolvedPos, Schema, Slice */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ContentMatch\", function() { return ContentMatch; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DOMParser\", function() { return DOMParser; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DOMSerializer\", function() { return DOMSerializer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Fragment\", function() { return Fragment; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Mark\", function() { return Mark; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MarkType\", function() { return MarkType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Node\", function() { return Node; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NodeRange\", function() { return NodeRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NodeType\", function() { return NodeType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ReplaceError\", function() { return ReplaceError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ResolvedPos\", function() { return ResolvedPos; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Schema\", function() { return Schema; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Slice\", function() { return Slice; });\n/* harmony import */ var orderedmap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! orderedmap */ \"./node_modules/orderedmap/index.es.js\");\n\n\nfunction findDiffStart(a, b, pos) {\n for (var i = 0;; i++) {\n if (i == a.childCount || i == b.childCount)\n { return a.childCount == b.childCount ? null : pos }\n\n var childA = a.child(i), childB = b.child(i);\n if (childA == childB) { pos += childA.nodeSize; continue }\n\n if (!childA.sameMarkup(childB)) { return pos }\n\n if (childA.isText && childA.text != childB.text) {\n for (var j = 0; childA.text[j] == childB.text[j]; j++)\n { pos++; }\n return pos\n }\n if (childA.content.size || childB.content.size) {\n var inner = findDiffStart(childA.content, childB.content, pos + 1);\n if (inner != null) { return inner }\n }\n pos += childA.nodeSize;\n }\n}\n\nfunction findDiffEnd(a, b, posA, posB) {\n for (var iA = a.childCount, iB = b.childCount;;) {\n if (iA == 0 || iB == 0)\n { return iA == iB ? null : {a: posA, b: posB} }\n\n var childA = a.child(--iA), childB = b.child(--iB), size = childA.nodeSize;\n if (childA == childB) {\n posA -= size; posB -= size;\n continue\n }\n\n if (!childA.sameMarkup(childB)) { return {a: posA, b: posB} }\n\n if (childA.isText && childA.text != childB.text) {\n var same = 0, minSize = Math.min(childA.text.length, childB.text.length);\n while (same < minSize && childA.text[childA.text.length - same - 1] == childB.text[childB.text.length - same - 1]) {\n same++; posA--; posB--;\n }\n return {a: posA, b: posB}\n }\n if (childA.content.size || childB.content.size) {\n var inner = findDiffEnd(childA.content, childB.content, posA - 1, posB - 1);\n if (inner) { return inner }\n }\n posA -= size; posB -= size;\n }\n}\n\n// ::- A fragment represents a node's collection of child nodes.\n//\n// Like nodes, fragments are persistent data structures, and you\n// should not mutate them or their content. Rather, you create new\n// instances whenever needed. The API tries to make this easy.\nvar Fragment = function Fragment(content, size) {\n this.content = content;\n // :: number\n // The size of the fragment, which is the total of the size of its\n // content nodes.\n this.size = size || 0;\n if (size == null) { for (var i = 0; i < content.length; i++)\n { this.size += content[i].nodeSize; } }\n};\n\nvar prototypeAccessors = { firstChild: { configurable: true },lastChild: { configurable: true },childCount: { configurable: true } };\n\n// :: (number, number, (node: Node, start: number, parent: Node, index: number) → ?bool, ?number)\n// Invoke a callback for all descendant nodes between the given two\n// positions (relative to start of this fragment). Doesn't descend\n// into a node when the callback returns `false`.\nFragment.prototype.nodesBetween = function nodesBetween (from, to, f, nodeStart, parent) {\n if ( nodeStart === void 0 ) nodeStart = 0;\n\n for (var i = 0, pos = 0; pos < to; i++) {\n var child = this.content[i], end = pos + child.nodeSize;\n if (end > from && f(child, nodeStart + pos, parent, i) !== false && child.content.size) {\n var start = pos + 1;\n child.nodesBetween(Math.max(0, from - start),\n Math.min(child.content.size, to - start),\n f, nodeStart + start);\n }\n pos = end;\n }\n};\n\n// :: ((node: Node, pos: number, parent: Node) → ?bool)\n// Call the given callback for every descendant node. The callback\n// may return `false` to prevent traversal of a given node's children.\nFragment.prototype.descendants = function descendants (f) {\n this.nodesBetween(0, this.size, f);\n};\n\n// : (number, number, ?string, ?string) → string\nFragment.prototype.textBetween = function textBetween (from, to, blockSeparator, leafText) {\n var text = \"\", separated = true;\n this.nodesBetween(from, to, function (node, pos) {\n if (node.isText) {\n text += node.text.slice(Math.max(from, pos) - pos, to - pos);\n separated = !blockSeparator;\n } else if (node.isLeaf && leafText) {\n text += leafText;\n separated = !blockSeparator;\n } else if (!separated && node.isBlock) {\n text += blockSeparator;\n separated = true;\n }\n }, 0);\n return text\n};\n\n// :: (Fragment) → Fragment\n// Create a new fragment containing the combined content of this\n// fragment and the other.\nFragment.prototype.append = function append (other) {\n if (!other.size) { return this }\n if (!this.size) { return other }\n var last = this.lastChild, first = other.firstChild, content = this.content.slice(), i = 0;\n if (last.isText && last.sameMarkup(first)) {\n content[content.length - 1] = last.withText(last.text + first.text);\n i = 1;\n }\n for (; i < other.content.length; i++) { content.push(other.content[i]); }\n return new Fragment(content, this.size + other.size)\n};\n\n// :: (number, ?number) → Fragment\n// Cut out the sub-fragment between the two given positions.\nFragment.prototype.cut = function cut (from, to) {\n if (to == null) { to = this.size; }\n if (from == 0 && to == this.size) { return this }\n var result = [], size = 0;\n if (to > from) { for (var i = 0, pos = 0; pos < to; i++) {\n var child = this.content[i], end = pos + child.nodeSize;\n if (end > from) {\n if (pos < from || end > to) {\n if (child.isText)\n { child = child.cut(Math.max(0, from - pos), Math.min(child.text.length, to - pos)); }\n else\n { child = child.cut(Math.max(0, from - pos - 1), Math.min(child.content.size, to - pos - 1)); }\n }\n result.push(child);\n size += child.nodeSize;\n }\n pos = end;\n } }\n return new Fragment(result, size)\n};\n\nFragment.prototype.cutByIndex = function cutByIndex (from, to) {\n if (from == to) { return Fragment.empty }\n if (from == 0 && to == this.content.length) { return this }\n return new Fragment(this.content.slice(from, to))\n};\n\n// :: (number, Node) → Fragment\n// Create a new fragment in which the node at the given index is\n// replaced by the given node.\nFragment.prototype.replaceChild = function replaceChild (index, node) {\n var current = this.content[index];\n if (current == node) { return this }\n var copy = this.content.slice();\n var size = this.size + node.nodeSize - current.nodeSize;\n copy[index] = node;\n return new Fragment(copy, size)\n};\n\n// : (Node) → Fragment\n// Create a new fragment by prepending the given node to this\n// fragment.\nFragment.prototype.addToStart = function addToStart (node) {\n return new Fragment([node].concat(this.content), this.size + node.nodeSize)\n};\n\n// : (Node) → Fragment\n// Create a new fragment by appending the given node to this\n// fragment.\nFragment.prototype.addToEnd = function addToEnd (node) {\n return new Fragment(this.content.concat(node), this.size + node.nodeSize)\n};\n\n// :: (Fragment) → bool\n// Compare this fragment to another one.\nFragment.prototype.eq = function eq (other) {\n if (this.content.length != other.content.length) { return false }\n for (var i = 0; i < this.content.length; i++)\n { if (!this.content[i].eq(other.content[i])) { return false } }\n return true\n};\n\n// :: ?Node\n// The first child of the fragment, or `null` if it is empty.\nprototypeAccessors.firstChild.get = function () { return this.content.length ? this.content[0] : null };\n\n// :: ?Node\n// The last child of the fragment, or `null` if it is empty.\nprototypeAccessors.lastChild.get = function () { return this.content.length ? this.content[this.content.length - 1] : null };\n\n// :: number\n// The number of child nodes in this fragment.\nprototypeAccessors.childCount.get = function () { return this.content.length };\n\n// :: (number) → Node\n// Get the child node at the given index. Raise an error when the\n// index is out of range.\nFragment.prototype.child = function child (index) {\n var found = this.content[index];\n if (!found) { throw new RangeError(\"Index \" + index + \" out of range for \" + this) }\n return found\n};\n\n// :: (number) → ?Node\n// Get the child node at the given index, if it exists.\nFragment.prototype.maybeChild = function maybeChild (index) {\n return this.content[index]\n};\n\n// :: ((node: Node, offset: number, index: number))\n// Call `f` for every child node, passing the node, its offset\n// into this parent node, and its index.\nFragment.prototype.forEach = function forEach (f) {\n for (var i = 0, p = 0; i < this.content.length; i++) {\n var child = this.content[i];\n f(child, p, i);\n p += child.nodeSize;\n }\n};\n\n// :: (Fragment) → ?number\n// Find the first position at which this fragment and another\n// fragment differ, or `null` if they are the same.\nFragment.prototype.findDiffStart = function findDiffStart$1 (other, pos) {\n if ( pos === void 0 ) pos = 0;\n\n return findDiffStart(this, other, pos)\n};\n\n// :: (Fragment) → ?{a: number, b: number}\n// Find the first position, searching from the end, at which this\n// fragment and the given fragment differ, or `null` if they are the\n// same. Since this position will not be the same in both nodes, an\n// object with two separate positions is returned.\nFragment.prototype.findDiffEnd = function findDiffEnd$1 (other, pos, otherPos) {\n if ( pos === void 0 ) pos = this.size;\n if ( otherPos === void 0 ) otherPos = other.size;\n\n return findDiffEnd(this, other, pos, otherPos)\n};\n\n// : (number, ?number) → {index: number, offset: number}\n// Find the index and inner offset corresponding to a given relative\n// position in this fragment. The result object will be reused\n// (overwritten) the next time the function is called. (Not public.)\nFragment.prototype.findIndex = function findIndex (pos, round) {\n if ( round === void 0 ) round = -1;\n\n if (pos == 0) { return retIndex(0, pos) }\n if (pos == this.size) { return retIndex(this.content.length, pos) }\n if (pos > this.size || pos < 0) { throw new RangeError((\"Position \" + pos + \" outside of fragment (\" + (this) + \")\")) }\n for (var i = 0, curPos = 0;; i++) {\n var cur = this.child(i), end = curPos + cur.nodeSize;\n if (end >= pos) {\n if (end == pos || round > 0) { return retIndex(i + 1, end) }\n return retIndex(i, curPos)\n }\n curPos = end;\n }\n};\n\n// :: () → string\n// Return a debugging string that describes this fragment.\nFragment.prototype.toString = function toString () { return \"<\" + this.toStringInner() + \">\" };\n\nFragment.prototype.toStringInner = function toStringInner () { return this.content.join(\", \") };\n\n// :: () → ?Object\n// Create a JSON-serializeable representation of this fragment.\nFragment.prototype.toJSON = function toJSON () {\n return this.content.length ? this.content.map(function (n) { return n.toJSON(); }) : null\n};\n\n// :: (Schema, ?Object) → Fragment\n// Deserialize a fragment from its JSON representation.\nFragment.fromJSON = function fromJSON (schema, value) {\n if (!value) { return Fragment.empty }\n if (!Array.isArray(value)) { throw new RangeError(\"Invalid input for Fragment.fromJSON\") }\n return new Fragment(value.map(schema.nodeFromJSON))\n};\n\n// :: ([Node]) → Fragment\n// Build a fragment from an array of nodes. Ensures that adjacent\n// text nodes with the same marks are joined together.\nFragment.fromArray = function fromArray (array) {\n if (!array.length) { return Fragment.empty }\n var joined, size = 0;\n for (var i = 0; i < array.length; i++) {\n var node = array[i];\n size += node.nodeSize;\n if (i && node.isText && array[i - 1].sameMarkup(node)) {\n if (!joined) { joined = array.slice(0, i); }\n joined[joined.length - 1] = node.withText(joined[joined.length - 1].text + node.text);\n } else if (joined) {\n joined.push(node);\n }\n }\n return new Fragment(joined || array, size)\n};\n\n// :: (?union) → Fragment\n// Create a fragment from something that can be interpreted as a set\n// of nodes. For `null`, it returns the empty fragment. For a\n// fragment, the fragment itself. For a node or array of nodes, a\n// fragment containing those nodes.\nFragment.from = function from (nodes) {\n if (!nodes) { return Fragment.empty }\n if (nodes instanceof Fragment) { return nodes }\n if (Array.isArray(nodes)) { return this.fromArray(nodes) }\n if (nodes.attrs) { return new Fragment([nodes], nodes.nodeSize) }\n throw new RangeError(\"Can not convert \" + nodes + \" to a Fragment\" +\n (nodes.nodesBetween ? \" (looks like multiple versions of prosemirror-model were loaded)\" : \"\"))\n};\n\nObject.defineProperties( Fragment.prototype, prototypeAccessors );\n\nvar found = {index: 0, offset: 0};\nfunction retIndex(index, offset) {\n found.index = index;\n found.offset = offset;\n return found\n}\n\n// :: Fragment\n// An empty fragment. Intended to be reused whenever a node doesn't\n// contain anything (rather than allocating a new empty fragment for\n// each leaf node).\nFragment.empty = new Fragment([], 0);\n\nfunction compareDeep(a, b) {\n if (a === b) { return true }\n if (!(a && typeof a == \"object\") ||\n !(b && typeof b == \"object\")) { return false }\n var array = Array.isArray(a);\n if (Array.isArray(b) != array) { return false }\n if (array) {\n if (a.length != b.length) { return false }\n for (var i = 0; i < a.length; i++) { if (!compareDeep(a[i], b[i])) { return false } }\n } else {\n for (var p in a) { if (!(p in b) || !compareDeep(a[p], b[p])) { return false } }\n for (var p$1 in b) { if (!(p$1 in a)) { return false } }\n }\n return true\n}\n\n// ::- A mark is a piece of information that can be attached to a node,\n// such as it being emphasized, in code font, or a link. It has a type\n// and optionally a set of attributes that provide further information\n// (such as the target of the link). Marks are created through a\n// `Schema`, which controls which types exist and which\n// attributes they have.\nvar Mark = function Mark(type, attrs) {\n // :: MarkType\n // The type of this mark.\n this.type = type;\n // :: Object\n // The attributes associated with this mark.\n this.attrs = attrs;\n};\n\n// :: ([Mark]) → [Mark]\n// Given a set of marks, create a new set which contains this one as\n// well, in the right position. If this mark is already in the set,\n// the set itself is returned. If any marks that are set to be\n// [exclusive](#model.MarkSpec.excludes) with this mark are present,\n// those are replaced by this one.\nMark.prototype.addToSet = function addToSet (set) {\n var copy, placed = false;\n for (var i = 0; i < set.length; i++) {\n var other = set[i];\n if (this.eq(other)) { return set }\n if (this.type.excludes(other.type)) {\n if (!copy) { copy = set.slice(0, i); }\n } else if (other.type.excludes(this.type)) {\n return set\n } else {\n if (!placed && other.type.rank > this.type.rank) {\n if (!copy) { copy = set.slice(0, i); }\n copy.push(this);\n placed = true;\n }\n if (copy) { copy.push(other); }\n }\n }\n if (!copy) { copy = set.slice(); }\n if (!placed) { copy.push(this); }\n return copy\n};\n\n// :: ([Mark]) → [Mark]\n// Remove this mark from the given set, returning a new set. If this\n// mark is not in the set, the set itself is returned.\nMark.prototype.removeFromSet = function removeFromSet (set) {\n for (var i = 0; i < set.length; i++)\n { if (this.eq(set[i]))\n { return set.slice(0, i).concat(set.slice(i + 1)) } }\n return set\n};\n\n// :: ([Mark]) → bool\n// Test whether this mark is in the given set of marks.\nMark.prototype.isInSet = function isInSet (set) {\n for (var i = 0; i < set.length; i++)\n { if (this.eq(set[i])) { return true } }\n return false\n};\n\n// :: (Mark) → bool\n// Test whether this mark has the same type and attributes as\n// another mark.\nMark.prototype.eq = function eq (other) {\n return this == other ||\n (this.type == other.type && compareDeep(this.attrs, other.attrs))\n};\n\n// :: () → Object\n// Convert this mark to a JSON-serializeable representation.\nMark.prototype.toJSON = function toJSON () {\n var obj = {type: this.type.name};\n for (var _ in this.attrs) {\n obj.attrs = this.attrs;\n break\n }\n return obj\n};\n\n// :: (Schema, Object) → Mark\nMark.fromJSON = function fromJSON (schema, json) {\n if (!json) { throw new RangeError(\"Invalid input for Mark.fromJSON\") }\n var type = schema.marks[json.type];\n if (!type) { throw new RangeError((\"There is no mark type \" + (json.type) + \" in this schema\")) }\n return type.create(json.attrs)\n};\n\n// :: ([Mark], [Mark]) → bool\n// Test whether two sets of marks are identical.\nMark.sameSet = function sameSet (a, b) {\n if (a == b) { return true }\n if (a.length != b.length) { return false }\n for (var i = 0; i < a.length; i++)\n { if (!a[i].eq(b[i])) { return false } }\n return true\n};\n\n// :: (?union) → [Mark]\n// Create a properly sorted mark set from null, a single mark, or an\n// unsorted array of marks.\nMark.setFrom = function setFrom (marks) {\n if (!marks || marks.length == 0) { return Mark.none }\n if (marks instanceof Mark) { return [marks] }\n var copy = marks.slice();\n copy.sort(function (a, b) { return a.type.rank - b.type.rank; });\n return copy\n};\n\n// :: [Mark] The empty set of marks.\nMark.none = [];\n\n// ReplaceError:: class extends Error\n// Error type raised by [`Node.replace`](#model.Node.replace) when\n// given an invalid replacement.\n\nfunction ReplaceError(message) {\n var err = Error.call(this, message);\n err.__proto__ = ReplaceError.prototype;\n return err\n}\n\nReplaceError.prototype = Object.create(Error.prototype);\nReplaceError.prototype.constructor = ReplaceError;\nReplaceError.prototype.name = \"ReplaceError\";\n\n// ::- A slice represents a piece cut out of a larger document. It\n// stores not only a fragment, but also the depth up to which nodes on\n// both side are ‘open’ (cut through).\nvar Slice = function Slice(content, openStart, openEnd) {\n // :: Fragment The slice's content.\n this.content = content;\n // :: number The open depth at the start.\n this.openStart = openStart;\n // :: number The open depth at the end.\n this.openEnd = openEnd;\n};\n\nvar prototypeAccessors$1 = { size: { configurable: true } };\n\n// :: number\n// The size this slice would add when inserted into a document.\nprototypeAccessors$1.size.get = function () {\n return this.content.size - this.openStart - this.openEnd\n};\n\nSlice.prototype.insertAt = function insertAt (pos, fragment) {\n var content = insertInto(this.content, pos + this.openStart, fragment, null);\n return content && new Slice(content, this.openStart, this.openEnd)\n};\n\nSlice.prototype.removeBetween = function removeBetween (from, to) {\n return new Slice(removeRange(this.content, from + this.openStart, to + this.openStart), this.openStart, this.openEnd)\n};\n\n// :: (Slice) → bool\n// Tests whether this slice is equal to another slice.\nSlice.prototype.eq = function eq (other) {\n return this.content.eq(other.content) && this.openStart == other.openStart && this.openEnd == other.openEnd\n};\n\nSlice.prototype.toString = function toString () {\n return this.content + \"(\" + this.openStart + \",\" + this.openEnd + \")\"\n};\n\n// :: () → ?Object\n// Convert a slice to a JSON-serializable representation.\nSlice.prototype.toJSON = function toJSON () {\n if (!this.content.size) { return null }\n var json = {content: this.content.toJSON()};\n if (this.openStart > 0) { json.openStart = this.openStart; }\n if (this.openEnd > 0) { json.openEnd = this.openEnd; }\n return json\n};\n\n// :: (Schema, ?Object) → Slice\n// Deserialize a slice from its JSON representation.\nSlice.fromJSON = function fromJSON (schema, json) {\n if (!json) { return Slice.empty }\n var openStart = json.openStart || 0, openEnd = json.openEnd || 0;\n if (typeof openStart != \"number\" || typeof openEnd != \"number\")\n { throw new RangeError(\"Invalid input for Slice.fromJSON\") }\n return new Slice(Fragment.fromJSON(schema, json.content), json.openStart || 0, json.openEnd || 0)\n};\n\n// :: (Fragment, ?bool) → Slice\n// Create a slice from a fragment by taking the maximum possible\n// open value on both side of the fragment.\nSlice.maxOpen = function maxOpen (fragment, openIsolating) {\n if ( openIsolating === void 0 ) openIsolating=true;\n\n var openStart = 0, openEnd = 0;\n for (var n = fragment.firstChild; n && !n.isLeaf && (openIsolating || !n.type.spec.isolating); n = n.firstChild) { openStart++; }\n for (var n$1 = fragment.lastChild; n$1 && !n$1.isLeaf && (openIsolating || !n$1.type.spec.isolating); n$1 = n$1.lastChild) { openEnd++; }\n return new Slice(fragment, openStart, openEnd)\n};\n\nObject.defineProperties( Slice.prototype, prototypeAccessors$1 );\n\nfunction removeRange(content, from, to) {\n var ref = content.findIndex(from);\n var index = ref.index;\n var offset = ref.offset;\n var child = content.maybeChild(index);\n var ref$1 = content.findIndex(to);\n var indexTo = ref$1.index;\n var offsetTo = ref$1.offset;\n if (offset == from || child.isText) {\n if (offsetTo != to && !content.child(indexTo).isText) { throw new RangeError(\"Removing non-flat range\") }\n return content.cut(0, from).append(content.cut(to))\n }\n if (index != indexTo) { throw new RangeError(\"Removing non-flat range\") }\n return content.replaceChild(index, child.copy(removeRange(child.content, from - offset - 1, to - offset - 1)))\n}\n\nfunction insertInto(content, dist, insert, parent) {\n var ref = content.findIndex(dist);\n var index = ref.index;\n var offset = ref.offset;\n var child = content.maybeChild(index);\n if (offset == dist || child.isText) {\n if (parent && !parent.canReplace(index, index, insert)) { return null }\n return content.cut(0, dist).append(insert).append(content.cut(dist))\n }\n var inner = insertInto(child.content, dist - offset - 1, insert);\n return inner && content.replaceChild(index, child.copy(inner))\n}\n\n// :: Slice\n// The empty slice.\nSlice.empty = new Slice(Fragment.empty, 0, 0);\n\nfunction replace($from, $to, slice) {\n if (slice.openStart > $from.depth)\n { throw new ReplaceError(\"Inserted content deeper than insertion position\") }\n if ($from.depth - slice.openStart != $to.depth - slice.openEnd)\n { throw new ReplaceError(\"Inconsistent open depths\") }\n return replaceOuter($from, $to, slice, 0)\n}\n\nfunction replaceOuter($from, $to, slice, depth) {\n var index = $from.index(depth), node = $from.node(depth);\n if (index == $to.index(depth) && depth < $from.depth - slice.openStart) {\n var inner = replaceOuter($from, $to, slice, depth + 1);\n return node.copy(node.content.replaceChild(index, inner))\n } else if (!slice.content.size) {\n return close(node, replaceTwoWay($from, $to, depth))\n } else if (!slice.openStart && !slice.openEnd && $from.depth == depth && $to.depth == depth) { // Simple, flat case\n var parent = $from.parent, content = parent.content;\n return close(parent, content.cut(0, $from.parentOffset).append(slice.content).append(content.cut($to.parentOffset)))\n } else {\n var ref = prepareSliceForReplace(slice, $from);\n var start = ref.start;\n var end = ref.end;\n return close(node, replaceThreeWay($from, start, end, $to, depth))\n }\n}\n\nfunction checkJoin(main, sub) {\n if (!sub.type.compatibleContent(main.type))\n { throw new ReplaceError(\"Cannot join \" + sub.type.name + \" onto \" + main.type.name) }\n}\n\nfunction joinable($before, $after, depth) {\n var node = $before.node(depth);\n checkJoin(node, $after.node(depth));\n return node\n}\n\nfunction addNode(child, target) {\n var last = target.length - 1;\n if (last >= 0 && child.isText && child.sameMarkup(target[last]))\n { target[last] = child.withText(target[last].text + child.text); }\n else\n { target.push(child); }\n}\n\nfunction addRange($start, $end, depth, target) {\n var node = ($end || $start).node(depth);\n var startIndex = 0, endIndex = $end ? $end.index(depth) : node.childCount;\n if ($start) {\n startIndex = $start.index(depth);\n if ($start.depth > depth) {\n startIndex++;\n } else if ($start.textOffset) {\n addNode($start.nodeAfter, target);\n startIndex++;\n }\n }\n for (var i = startIndex; i < endIndex; i++) { addNode(node.child(i), target); }\n if ($end && $end.depth == depth && $end.textOffset)\n { addNode($end.nodeBefore, target); }\n}\n\nfunction close(node, content) {\n if (!node.type.validContent(content))\n { throw new ReplaceError(\"Invalid content for node \" + node.type.name) }\n return node.copy(content)\n}\n\nfunction replaceThreeWay($from, $start, $end, $to, depth) {\n var openStart = $from.depth > depth && joinable($from, $start, depth + 1);\n var openEnd = $to.depth > depth && joinable($end, $to, depth + 1);\n\n var content = [];\n addRange(null, $from, depth, content);\n if (openStart && openEnd && $start.index(depth) == $end.index(depth)) {\n checkJoin(openStart, openEnd);\n addNode(close(openStart, replaceThreeWay($from, $start, $end, $to, depth + 1)), content);\n } else {\n if (openStart)\n { addNode(close(openStart, replaceTwoWay($from, $start, depth + 1)), content); }\n addRange($start, $end, depth, content);\n if (openEnd)\n { addNode(close(openEnd, replaceTwoWay($end, $to, depth + 1)), content); }\n }\n addRange($to, null, depth, content);\n return new Fragment(content)\n}\n\nfunction replaceTwoWay($from, $to, depth) {\n var content = [];\n addRange(null, $from, depth, content);\n if ($from.depth > depth) {\n var type = joinable($from, $to, depth + 1);\n addNode(close(type, replaceTwoWay($from, $to, depth + 1)), content);\n }\n addRange($to, null, depth, content);\n return new Fragment(content)\n}\n\nfunction prepareSliceForReplace(slice, $along) {\n var extra = $along.depth - slice.openStart, parent = $along.node(extra);\n var node = parent.copy(slice.content);\n for (var i = extra - 1; i >= 0; i--)\n { node = $along.node(i).copy(Fragment.from(node)); }\n return {start: node.resolveNoCache(slice.openStart + extra),\n end: node.resolveNoCache(node.content.size - slice.openEnd - extra)}\n}\n\n// ::- You can [_resolve_](#model.Node.resolve) a position to get more\n// information about it. Objects of this class represent such a\n// resolved position, providing various pieces of context information,\n// and some helper methods.\n//\n// Throughout this interface, methods that take an optional `depth`\n// parameter will interpret undefined as `this.depth` and negative\n// numbers as `this.depth + value`.\nvar ResolvedPos = function ResolvedPos(pos, path, parentOffset) {\n // :: number The position that was resolved.\n this.pos = pos;\n this.path = path;\n // :: number\n // The number of levels the parent node is from the root. If this\n // position points directly into the root node, it is 0. If it\n // points into a top-level paragraph, 1, and so on.\n this.depth = path.length / 3 - 1;\n // :: number The offset this position has into its parent node.\n this.parentOffset = parentOffset;\n};\n\nvar prototypeAccessors$2 = { parent: { configurable: true },doc: { configurable: true },textOffset: { configurable: true },nodeAfter: { configurable: true },nodeBefore: { configurable: true } };\n\nResolvedPos.prototype.resolveDepth = function resolveDepth (val) {\n if (val == null) { return this.depth }\n if (val < 0) { return this.depth + val }\n return val\n};\n\n// :: Node\n// The parent node that the position points into. Note that even if\n// a position points into a text node, that node is not considered\n// the parent—text nodes are ‘flat’ in this model, and have no content.\nprototypeAccessors$2.parent.get = function () { return this.node(this.depth) };\n\n// :: Node\n// The root node in which the position was resolved.\nprototypeAccessors$2.doc.get = function () { return this.node(0) };\n\n// :: (?number) → Node\n// The ancestor node at the given level. `p.node(p.depth)` is the\n// same as `p.parent`.\nResolvedPos.prototype.node = function node (depth) { return this.path[this.resolveDepth(depth) * 3] };\n\n// :: (?number) → number\n// The index into the ancestor at the given level. If this points at\n// the 3rd node in the 2nd paragraph on the top level, for example,\n// `p.index(0)` is 1 and `p.index(1)` is 2.\nResolvedPos.prototype.index = function index (depth) { return this.path[this.resolveDepth(depth) * 3 + 1] };\n\n// :: (?number) → number\n// The index pointing after this position into the ancestor at the\n// given level.\nResolvedPos.prototype.indexAfter = function indexAfter (depth) {\n depth = this.resolveDepth(depth);\n return this.index(depth) + (depth == this.depth && !this.textOffset ? 0 : 1)\n};\n\n// :: (?number) → number\n// The (absolute) position at the start of the node at the given\n// level.\nResolvedPos.prototype.start = function start (depth) {\n depth = this.resolveDepth(depth);\n return depth == 0 ? 0 : this.path[depth * 3 - 1] + 1\n};\n\n// :: (?number) → number\n// The (absolute) position at the end of the node at the given\n// level.\nResolvedPos.prototype.end = function end (depth) {\n depth = this.resolveDepth(depth);\n return this.start(depth) + this.node(depth).content.size\n};\n\n// :: (?number) → number\n// The (absolute) position directly before the wrapping node at the\n// given level, or, when `depth` is `this.depth + 1`, the original\n// position.\nResolvedPos.prototype.before = function before (depth) {\n depth = this.resolveDepth(depth);\n if (!depth) { throw new RangeError(\"There is no position before the top-level node\") }\n return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1]\n};\n\n// :: (?number) → number\n// The (absolute) position directly after the wrapping node at the\n// given level, or the original position when `depth` is `this.depth + 1`.\nResolvedPos.prototype.after = function after (depth) {\n depth = this.resolveDepth(depth);\n if (!depth) { throw new RangeError(\"There is no position after the top-level node\") }\n return depth == this.depth + 1 ? this.pos : this.path[depth * 3 - 1] + this.path[depth * 3].nodeSize\n};\n\n// :: number\n// When this position points into a text node, this returns the\n// distance between the position and the start of the text node.\n// Will be zero for positions that point between nodes.\nprototypeAccessors$2.textOffset.get = function () { return this.pos - this.path[this.path.length - 1] };\n\n// :: ?Node\n// Get the node directly after the position, if any. If the position\n// points into a text node, only the part of that node after the\n// position is returned.\nprototypeAccessors$2.nodeAfter.get = function () {\n var parent = this.parent, index = this.index(this.depth);\n if (index == parent.childCount) { return null }\n var dOff = this.pos - this.path[this.path.length - 1], child = parent.child(index);\n return dOff ? parent.child(index).cut(dOff) : child\n};\n\n// :: ?Node\n// Get the node directly before the position, if any. If the\n// position points into a text node, only the part of that node\n// before the position is returned.\nprototypeAccessors$2.nodeBefore.get = function () {\n var index = this.index(this.depth);\n var dOff = this.pos - this.path[this.path.length - 1];\n if (dOff) { return this.parent.child(index).cut(0, dOff) }\n return index == 0 ? null : this.parent.child(index - 1)\n};\n\n// :: () → [Mark]\n// Get the marks at this position, factoring in the surrounding\n// marks' [`inclusive`](#model.MarkSpec.inclusive) property. If the\n// position is at the start of a non-empty node, the marks of the\n// node after it (if any) are returned.\nResolvedPos.prototype.marks = function marks () {\n var parent = this.parent, index = this.index();\n\n // In an empty parent, return the empty array\n if (parent.content.size == 0) { return Mark.none }\n\n // When inside a text node, just return the text node's marks\n if (this.textOffset) { return parent.child(index).marks }\n\n var main = parent.maybeChild(index - 1), other = parent.maybeChild(index);\n // If the `after` flag is true of there is no node before, make\n // the node after this position the main reference.\n if (!main) { var tmp = main; main = other; other = tmp; }\n\n // Use all marks in the main node, except those that have\n // `inclusive` set to false and are not present in the other node.\n var marks = main.marks;\n for (var i = 0; i < marks.length; i++)\n { if (marks[i].type.spec.inclusive === false && (!other || !marks[i].isInSet(other.marks)))\n { marks = marks[i--].removeFromSet(marks); } }\n\n return marks\n};\n\n// :: (ResolvedPos) → ?[Mark]\n// Get the marks after the current position, if any, except those\n// that are non-inclusive and not present at position `$end`. This\n// is mostly useful for getting the set of marks to preserve after a\n// deletion. Will return `null` if this position is at the end of\n// its parent node or its parent node isn't a textblock (in which\n// case no marks should be preserved).\nResolvedPos.prototype.marksAcross = function marksAcross ($end) {\n var after = this.parent.maybeChild(this.index());\n if (!after || !after.isInline) { return null }\n\n var marks = after.marks, next = $end.parent.maybeChild($end.index());\n for (var i = 0; i < marks.length; i++)\n { if (marks[i].type.spec.inclusive === false && (!next || !marks[i].isInSet(next.marks)))\n { marks = marks[i--].removeFromSet(marks); } }\n return marks\n};\n\n// :: (number) → number\n// The depth up to which this position and the given (non-resolved)\n// position share the same parent nodes.\nResolvedPos.prototype.sharedDepth = function sharedDepth (pos) {\n for (var depth = this.depth; depth > 0; depth--)\n { if (this.start(depth) <= pos && this.end(depth) >= pos) { return depth } }\n return 0\n};\n\n// :: (?ResolvedPos, ?(Node) → bool) → ?NodeRange\n// Returns a range based on the place where this position and the\n// given position diverge around block content. If both point into\n// the same textblock, for example, a range around that textblock\n// will be returned. If they point into different blocks, the range\n// around those blocks in their shared ancestor is returned. You can\n// pass in an optional predicate that will be called with a parent\n// node to see if a range into that parent is acceptable.\nResolvedPos.prototype.blockRange = function blockRange (other, pred) {\n if ( other === void 0 ) other = this;\n\n if (other.pos < this.pos) { return other.blockRange(this) }\n for (var d = this.depth - (this.parent.inlineContent || this.pos == other.pos ? 1 : 0); d >= 0; d--)\n { if (other.pos <= this.end(d) && (!pred || pred(this.node(d))))\n { return new NodeRange(this, other, d) } }\n};\n\n// :: (ResolvedPos) → bool\n// Query whether the given position shares the same parent node.\nResolvedPos.prototype.sameParent = function sameParent (other) {\n return this.pos - this.parentOffset == other.pos - other.parentOffset\n};\n\n// :: (ResolvedPos) → ResolvedPos\n// Return the greater of this and the given position.\nResolvedPos.prototype.max = function max (other) {\n return other.pos > this.pos ? other : this\n};\n\n// :: (ResolvedPos) → ResolvedPos\n// Return the smaller of this and the given position.\nResolvedPos.prototype.min = function min (other) {\n return other.pos < this.pos ? other : this\n};\n\nResolvedPos.prototype.toString = function toString () {\n var str = \"\";\n for (var i = 1; i <= this.depth; i++)\n { str += (str ? \"/\" : \"\") + this.node(i).type.name + \"_\" + this.index(i - 1); }\n return str + \":\" + this.parentOffset\n};\n\nResolvedPos.resolve = function resolve (doc, pos) {\n if (!(pos >= 0 && pos <= doc.content.size)) { throw new RangeError(\"Position \" + pos + \" out of range\") }\n var path = [];\n var start = 0, parentOffset = pos;\n for (var node = doc;;) {\n var ref = node.content.findIndex(parentOffset);\n var index = ref.index;\n var offset = ref.offset;\n var rem = parentOffset - offset;\n path.push(node, index, start + offset);\n if (!rem) { break }\n node = node.child(index);\n if (node.isText) { break }\n parentOffset = rem - 1;\n start += offset + 1;\n }\n return new ResolvedPos(pos, path, parentOffset)\n};\n\nResolvedPos.resolveCached = function resolveCached (doc, pos) {\n for (var i = 0; i < resolveCache.length; i++) {\n var cached = resolveCache[i];\n if (cached.pos == pos && cached.doc == doc) { return cached }\n }\n var result = resolveCache[resolveCachePos] = ResolvedPos.resolve(doc, pos);\n resolveCachePos = (resolveCachePos + 1) % resolveCacheSize;\n return result\n};\n\nObject.defineProperties( ResolvedPos.prototype, prototypeAccessors$2 );\n\nvar resolveCache = [], resolveCachePos = 0, resolveCacheSize = 12;\n\n// ::- Represents a flat range of content, i.e. one that starts and\n// ends in the same node.\nvar NodeRange = function NodeRange($from, $to, depth) {\n // :: ResolvedPos A resolved position along the start of the\n // content. May have a `depth` greater than this object's `depth`\n // property, since these are the positions that were used to\n // compute the range, not re-resolved positions directly at its\n // boundaries.\n this.$from = $from;\n // :: ResolvedPos A position along the end of the content. See\n // caveat for [`$from`](#model.NodeRange.$from).\n this.$to = $to;\n // :: number The depth of the node that this range points into.\n this.depth = depth;\n};\n\nvar prototypeAccessors$1$1 = { start: { configurable: true },end: { configurable: true },parent: { configurable: true },startIndex: { configurable: true },endIndex: { configurable: true } };\n\n// :: number The position at the start of the range.\nprototypeAccessors$1$1.start.get = function () { return this.$from.before(this.depth + 1) };\n// :: number The position at the end of the range.\nprototypeAccessors$1$1.end.get = function () { return this.$to.after(this.depth + 1) };\n\n// :: Node The parent node that the range points into.\nprototypeAccessors$1$1.parent.get = function () { return this.$from.node(this.depth) };\n// :: number The start index of the range in the parent node.\nprototypeAccessors$1$1.startIndex.get = function () { return this.$from.index(this.depth) };\n// :: number The end index of the range in the parent node.\nprototypeAccessors$1$1.endIndex.get = function () { return this.$to.indexAfter(this.depth) };\n\nObject.defineProperties( NodeRange.prototype, prototypeAccessors$1$1 );\n\nvar emptyAttrs = Object.create(null);\n\n// ::- This class represents a node in the tree that makes up a\n// ProseMirror document. So a document is an instance of `Node`, with\n// children that are also instances of `Node`.\n//\n// Nodes are persistent data structures. Instead of changing them, you\n// create new ones with the content you want. Old ones keep pointing\n// at the old document shape. This is made cheaper by sharing\n// structure between the old and new data as much as possible, which a\n// tree shape like this (without back pointers) makes easy.\n//\n// **Do not** directly mutate the properties of a `Node` object. See\n// [the guide](/docs/guide/#doc) for more information.\nvar Node = function Node(type, attrs, content, marks) {\n // :: NodeType\n // The type of node that this is.\n this.type = type;\n\n // :: Object\n // An object mapping attribute names to values. The kind of\n // attributes allowed and required are\n // [determined](#model.NodeSpec.attrs) by the node type.\n this.attrs = attrs;\n\n // :: Fragment\n // A container holding the node's children.\n this.content = content || Fragment.empty;\n\n // :: [Mark]\n // The marks (things like whether it is emphasized or part of a\n // link) applied to this node.\n this.marks = marks || Mark.none;\n};\n\nvar prototypeAccessors$3 = { nodeSize: { configurable: true },childCount: { configurable: true },textContent: { configurable: true },firstChild: { configurable: true },lastChild: { configurable: true },isBlock: { configurable: true },isTextblock: { configurable: true },inlineContent: { configurable: true },isInline: { configurable: true },isText: { configurable: true },isLeaf: { configurable: true },isAtom: { configurable: true } };\n\n// text:: ?string\n// For text nodes, this contains the node's text content.\n\n// :: number\n// The size of this node, as defined by the integer-based [indexing\n// scheme](/docs/guide/#doc.indexing). For text nodes, this is the\n// amount of characters. For other leaf nodes, it is one. For\n// non-leaf nodes, it is the size of the content plus two (the start\n// and end token).\nprototypeAccessors$3.nodeSize.get = function () { return this.isLeaf ? 1 : 2 + this.content.size };\n\n// :: number\n// The number of children that the node has.\nprototypeAccessors$3.childCount.get = function () { return this.content.childCount };\n\n// :: (number) → Node\n// Get the child node at the given index. Raises an error when the\n// index is out of range.\nNode.prototype.child = function child (index) { return this.content.child(index) };\n\n// :: (number) → ?Node\n// Get the child node at the given index, if it exists.\nNode.prototype.maybeChild = function maybeChild (index) { return this.content.maybeChild(index) };\n\n// :: ((node: Node, offset: number, index: number))\n// Call `f` for every child node, passing the node, its offset\n// into this parent node, and its index.\nNode.prototype.forEach = function forEach (f) { this.content.forEach(f); };\n\n// :: (number, number, (node: Node, pos: number, parent: Node, index: number) → ?bool, ?number)\n// Invoke a callback for all descendant nodes recursively between\n// the given two positions that are relative to start of this node's\n// content. The callback is invoked with the node, its\n// parent-relative position, its parent node, and its child index.\n// When the callback returns false for a given node, that node's\n// children will not be recursed over. The last parameter can be\n// used to specify a starting position to count from.\nNode.prototype.nodesBetween = function nodesBetween (from, to, f, startPos) {\n if ( startPos === void 0 ) startPos = 0;\n\n this.content.nodesBetween(from, to, f, startPos, this);\n};\n\n// :: ((node: Node, pos: number, parent: Node) → ?bool)\n// Call the given callback for every descendant node. Doesn't\n// descend into a node when the callback returns `false`.\nNode.prototype.descendants = function descendants (f) {\n this.nodesBetween(0, this.content.size, f);\n};\n\n// :: string\n// Concatenates all the text nodes found in this fragment and its\n// children.\nprototypeAccessors$3.textContent.get = function () { return this.textBetween(0, this.content.size, \"\") };\n\n// :: (number, number, ?string, ?string) → string\n// Get all text between positions `from` and `to`. When\n// `blockSeparator` is given, it will be inserted whenever a new\n// block node is started. When `leafText` is given, it'll be\n// inserted for every non-text leaf node encountered.\nNode.prototype.textBetween = function textBetween (from, to, blockSeparator, leafText) {\n return this.content.textBetween(from, to, blockSeparator, leafText)\n};\n\n// :: ?Node\n// Returns this node's first child, or `null` if there are no\n// children.\nprototypeAccessors$3.firstChild.get = function () { return this.content.firstChild };\n\n// :: ?Node\n// Returns this node's last child, or `null` if there are no\n// children.\nprototypeAccessors$3.lastChild.get = function () { return this.content.lastChild };\n\n// :: (Node) → bool\n// Test whether two nodes represent the same piece of document.\nNode.prototype.eq = function eq (other) {\n return this == other || (this.sameMarkup(other) && this.content.eq(other.content))\n};\n\n// :: (Node) → bool\n// Compare the markup (type, attributes, and marks) of this node to\n// those of another. Returns `true` if both have the same markup.\nNode.prototype.sameMarkup = function sameMarkup (other) {\n return this.hasMarkup(other.type, other.attrs, other.marks)\n};\n\n// :: (NodeType, ?Object, ?[Mark]) → bool\n// Check whether this node's markup correspond to the given type,\n// attributes, and marks.\nNode.prototype.hasMarkup = function hasMarkup (type, attrs, marks) {\n return this.type == type &&\n compareDeep(this.attrs, attrs || type.defaultAttrs || emptyAttrs) &&\n Mark.sameSet(this.marks, marks || Mark.none)\n};\n\n// :: (?Fragment) → Node\n// Create a new node with the same markup as this node, containing\n// the given content (or empty, if no content is given).\nNode.prototype.copy = function copy (content) {\n if ( content === void 0 ) content = null;\n\n if (content == this.content) { return this }\n return new this.constructor(this.type, this.attrs, content, this.marks)\n};\n\n// :: ([Mark]) → Node\n// Create a copy of this node, with the given set of marks instead\n// of the node's own marks.\nNode.prototype.mark = function mark (marks) {\n return marks == this.marks ? this : new this.constructor(this.type, this.attrs, this.content, marks)\n};\n\n// :: (number, ?number) → Node\n// Create a copy of this node with only the content between the\n// given positions. If `to` is not given, it defaults to the end of\n// the node.\nNode.prototype.cut = function cut (from, to) {\n if (from == 0 && to == this.content.size) { return this }\n return this.copy(this.content.cut(from, to))\n};\n\n// :: (number, ?number) → Slice\n// Cut out the part of the document between the given positions, and\n// return it as a `Slice` object.\nNode.prototype.slice = function slice (from, to, includeParents) {\n if ( to === void 0 ) to = this.content.size;\n if ( includeParents === void 0 ) includeParents = false;\n\n if (from == to) { return Slice.empty }\n\n var $from = this.resolve(from), $to = this.resolve(to);\n var depth = includeParents ? 0 : $from.sharedDepth(to);\n var start = $from.start(depth), node = $from.node(depth);\n var content = node.content.cut($from.pos - start, $to.pos - start);\n return new Slice(content, $from.depth - depth, $to.depth - depth)\n};\n\n// :: (number, number, Slice) → Node\n// Replace the part of the document between the given positions with\n// the given slice. The slice must 'fit', meaning its open sides\n// must be able to connect to the surrounding content, and its\n// content nodes must be valid children for the node they are placed\n// into. If any of this is violated, an error of type\n// [`ReplaceError`](#model.ReplaceError) is thrown.\nNode.prototype.replace = function replace$1 (from, to, slice) {\n return replace(this.resolve(from), this.resolve(to), slice)\n};\n\n// :: (number) → ?Node\n// Find the node directly after the given position.\nNode.prototype.nodeAt = function nodeAt (pos) {\n for (var node = this;;) {\n var ref = node.content.findIndex(pos);\n var index = ref.index;\n var offset = ref.offset;\n node = node.maybeChild(index);\n if (!node) { return null }\n if (offset == pos || node.isText) { return node }\n pos -= offset + 1;\n }\n};\n\n// :: (number) → {node: ?Node, index: number, offset: number}\n// Find the (direct) child node after the given offset, if any,\n// and return it along with its index and offset relative to this\n// node.\nNode.prototype.childAfter = function childAfter (pos) {\n var ref = this.content.findIndex(pos);\n var index = ref.index;\n var offset = ref.offset;\n return {node: this.content.maybeChild(index), index: index, offset: offset}\n};\n\n// :: (number) → {node: ?Node, index: number, offset: number}\n// Find the (direct) child node before the given offset, if any,\n// and return it along with its index and offset relative to this\n// node.\nNode.prototype.childBefore = function childBefore (pos) {\n if (pos == 0) { return {node: null, index: 0, offset: 0} }\n var ref = this.content.findIndex(pos);\n var index = ref.index;\n var offset = ref.offset;\n if (offset < pos) { return {node: this.content.child(index), index: index, offset: offset} }\n var node = this.content.child(index - 1);\n return {node: node, index: index - 1, offset: offset - node.nodeSize}\n};\n\n// :: (number) → ResolvedPos\n// Resolve the given position in the document, returning an\n// [object](#model.ResolvedPos) with information about its context.\nNode.prototype.resolve = function resolve (pos) { return ResolvedPos.resolveCached(this, pos) };\n\nNode.prototype.resolveNoCache = function resolveNoCache (pos) { return ResolvedPos.resolve(this, pos) };\n\n// :: (number, number, MarkType) → bool\n// Test whether a mark of the given type occurs in this document\n// between the two given positions.\nNode.prototype.rangeHasMark = function rangeHasMark (from, to, type) {\n var found = false;\n if (to > from) { this.nodesBetween(from, to, function (node) {\n if (type.isInSet(node.marks)) { found = true; }\n return !found\n }); }\n return found\n};\n\n// :: bool\n// True when this is a block (non-inline node)\nprototypeAccessors$3.isBlock.get = function () { return this.type.isBlock };\n\n// :: bool\n// True when this is a textblock node, a block node with inline\n// content.\nprototypeAccessors$3.isTextblock.get = function () { return this.type.isTextblock };\n\n// :: bool\n// True when this node allows inline content.\nprototypeAccessors$3.inlineContent.get = function () { return this.type.inlineContent };\n\n// :: bool\n// True when this is an inline node (a text node or a node that can\n// appear among text).\nprototypeAccessors$3.isInline.get = function () { return this.type.isInline };\n\n// :: bool\n// True when this is a text node.\nprototypeAccessors$3.isText.get = function () { return this.type.isText };\n\n// :: bool\n// True when this is a leaf node.\nprototypeAccessors$3.isLeaf.get = function () { return this.type.isLeaf };\n\n// :: bool\n// True when this is an atom, i.e. when it does not have directly\n// editable content. This is usually the same as `isLeaf`, but can\n// be configured with the [`atom` property](#model.NodeSpec.atom) on\n// a node's spec (typically used when the node is displayed as an\n// uneditable [node view](#view.NodeView)).\nprototypeAccessors$3.isAtom.get = function () { return this.type.isAtom };\n\n// :: () → string\n// Return a string representation of this node for debugging\n// purposes.\nNode.prototype.toString = function toString () {\n if (this.type.spec.toDebugString) { return this.type.spec.toDebugString(this) }\n var name = this.type.name;\n if (this.content.size)\n { name += \"(\" + this.content.toStringInner() + \")\"; }\n return wrapMarks(this.marks, name)\n};\n\n// :: (number) → ContentMatch\n// Get the content match in this node at the given index.\nNode.prototype.contentMatchAt = function contentMatchAt (index) {\n var match = this.type.contentMatch.matchFragment(this.content, 0, index);\n if (!match) { throw new Error(\"Called contentMatchAt on a node with invalid content\") }\n return match\n};\n\n// :: (number, number, ?Fragment, ?number, ?number) → bool\n// Test whether replacing the range between `from` and `to` (by\n// child index) with the given replacement fragment (which defaults\n// to the empty fragment) would leave the node's content valid. You\n// can optionally pass `start` and `end` indices into the\n// replacement fragment.\nNode.prototype.canReplace = function canReplace (from, to, replacement, start, end) {\n if ( replacement === void 0 ) replacement = Fragment.empty;\n if ( start === void 0 ) start = 0;\n if ( end === void 0 ) end = replacement.childCount;\n\n var one = this.contentMatchAt(from).matchFragment(replacement, start, end);\n var two = one && one.matchFragment(this.content, to);\n if (!two || !two.validEnd) { return false }\n for (var i = start; i < end; i++) { if (!this.type.allowsMarks(replacement.child(i).marks)) { return false } }\n return true\n};\n\n// :: (number, number, NodeType, ?[Mark]) → bool\n// Test whether replacing the range `from` to `to` (by index) with a\n// node of the given type would leave the node's content valid.\nNode.prototype.canReplaceWith = function canReplaceWith (from, to, type, marks) {\n if (marks && !this.type.allowsMarks(marks)) { return false }\n var start = this.contentMatchAt(from).matchType(type);\n var end = start && start.matchFragment(this.content, to);\n return end ? end.validEnd : false\n};\n\n// :: (Node) → bool\n// Test whether the given node's content could be appended to this\n// node. If that node is empty, this will only return true if there\n// is at least one node type that can appear in both nodes (to avoid\n// merging completely incompatible nodes).\nNode.prototype.canAppend = function canAppend (other) {\n if (other.content.size) { return this.canReplace(this.childCount, this.childCount, other.content) }\n else { return this.type.compatibleContent(other.type) }\n};\n\n// :: ()\n// Check whether this node and its descendants conform to the\n// schema, and raise error when they do not.\nNode.prototype.check = function check () {\n if (!this.type.validContent(this.content))\n { throw new RangeError((\"Invalid content for node \" + (this.type.name) + \": \" + (this.content.toString().slice(0, 50)))) }\n this.content.forEach(function (node) { return node.check(); });\n};\n\n// :: () → Object\n// Return a JSON-serializeable representation of this node.\nNode.prototype.toJSON = function toJSON () {\n var obj = {type: this.type.name};\n for (var _ in this.attrs) {\n obj.attrs = this.attrs;\n break\n }\n if (this.content.size)\n { obj.content = this.content.toJSON(); }\n if (this.marks.length)\n { obj.marks = this.marks.map(function (n) { return n.toJSON(); }); }\n return obj\n};\n\n// :: (Schema, Object) → Node\n// Deserialize a node from its JSON representation.\nNode.fromJSON = function fromJSON (schema, json) {\n if (!json) { throw new RangeError(\"Invalid input for Node.fromJSON\") }\n var marks = null;\n if (json.marks) {\n if (!Array.isArray(json.marks)) { throw new RangeError(\"Invalid mark data for Node.fromJSON\") }\n marks = json.marks.map(schema.markFromJSON);\n }\n if (json.type == \"text\") {\n if (typeof json.text != \"string\") { throw new RangeError(\"Invalid text node in JSON\") }\n return schema.text(json.text, marks)\n }\n var content = Fragment.fromJSON(schema, json.content);\n return schema.nodeType(json.type).create(json.attrs, content, marks)\n};\n\nObject.defineProperties( Node.prototype, prototypeAccessors$3 );\n\nvar TextNode = /*@__PURE__*/(function (Node) {\n function TextNode(type, attrs, content, marks) {\n Node.call(this, type, attrs, null, marks);\n\n if (!content) { throw new RangeError(\"Empty text nodes are not allowed\") }\n\n this.text = content;\n }\n\n if ( Node ) TextNode.__proto__ = Node;\n TextNode.prototype = Object.create( Node && Node.prototype );\n TextNode.prototype.constructor = TextNode;\n\n var prototypeAccessors$1 = { textContent: { configurable: true },nodeSize: { configurable: true } };\n\n TextNode.prototype.toString = function toString () {\n if (this.type.spec.toDebugString) { return this.type.spec.toDebugString(this) }\n return wrapMarks(this.marks, JSON.stringify(this.text))\n };\n\n prototypeAccessors$1.textContent.get = function () { return this.text };\n\n TextNode.prototype.textBetween = function textBetween (from, to) { return this.text.slice(from, to) };\n\n prototypeAccessors$1.nodeSize.get = function () { return this.text.length };\n\n TextNode.prototype.mark = function mark (marks) {\n return marks == this.marks ? this : new TextNode(this.type, this.attrs, this.text, marks)\n };\n\n TextNode.prototype.withText = function withText (text) {\n if (text == this.text) { return this }\n return new TextNode(this.type, this.attrs, text, this.marks)\n };\n\n TextNode.prototype.cut = function cut (from, to) {\n if ( from === void 0 ) from = 0;\n if ( to === void 0 ) to = this.text.length;\n\n if (from == 0 && to == this.text.length) { return this }\n return this.withText(this.text.slice(from, to))\n };\n\n TextNode.prototype.eq = function eq (other) {\n return this.sameMarkup(other) && this.text == other.text\n };\n\n TextNode.prototype.toJSON = function toJSON () {\n var base = Node.prototype.toJSON.call(this);\n base.text = this.text;\n return base\n };\n\n Object.defineProperties( TextNode.prototype, prototypeAccessors$1 );\n\n return TextNode;\n}(Node));\n\nfunction wrapMarks(marks, str) {\n for (var i = marks.length - 1; i >= 0; i--)\n { str = marks[i].type.name + \"(\" + str + \")\"; }\n return str\n}\n\n// ::- Instances of this class represent a match state of a node\n// type's [content expression](#model.NodeSpec.content), and can be\n// used to find out whether further content matches here, and whether\n// a given position is a valid end of the node.\nvar ContentMatch = function ContentMatch(validEnd) {\n // :: bool\n // True when this match state represents a valid end of the node.\n this.validEnd = validEnd;\n this.next = [];\n this.wrapCache = [];\n};\n\nvar prototypeAccessors$4 = { inlineContent: { configurable: true },defaultType: { configurable: true },edgeCount: { configurable: true } };\n\nContentMatch.parse = function parse (string, nodeTypes) {\n var stream = new TokenStream(string, nodeTypes);\n if (stream.next == null) { return ContentMatch.empty }\n var expr = parseExpr(stream);\n if (stream.next) { stream.err(\"Unexpected trailing text\"); }\n var match = dfa(nfa(expr));\n checkForDeadEnds(match, stream);\n return match\n};\n\n// :: (NodeType) → ?ContentMatch\n// Match a node type, returning a match after that node if\n// successful.\nContentMatch.prototype.matchType = function matchType (type) {\n for (var i = 0; i < this.next.length; i += 2)\n { if (this.next[i] == type) { return this.next[i + 1] } }\n return null\n};\n\n// :: (Fragment, ?number, ?number) → ?ContentMatch\n// Try to match a fragment. Returns the resulting match when\n// successful.\nContentMatch.prototype.matchFragment = function matchFragment (frag, start, end) {\n if ( start === void 0 ) start = 0;\n if ( end === void 0 ) end = frag.childCount;\n\n var cur = this;\n for (var i = start; cur && i < end; i++)\n { cur = cur.matchType(frag.child(i).type); }\n return cur\n};\n\nprototypeAccessors$4.inlineContent.get = function () {\n var first = this.next[0];\n return first ? first.isInline : false\n};\n\n// :: ?NodeType\n// Get the first matching node type at this match position that can\n// be generated.\nprototypeAccessors$4.defaultType.get = function () {\n for (var i = 0; i < this.next.length; i += 2) {\n var type = this.next[i];\n if (!(type.isText || type.hasRequiredAttrs())) { return type }\n }\n};\n\nContentMatch.prototype.compatible = function compatible (other) {\n for (var i = 0; i < this.next.length; i += 2)\n { for (var j = 0; j < other.next.length; j += 2)\n { if (this.next[i] == other.next[j]) { return true } } }\n return false\n};\n\n// :: (Fragment, bool, ?number) → ?Fragment\n// Try to match the given fragment, and if that fails, see if it can\n// be made to match by inserting nodes in front of it. When\n// successful, return a fragment of inserted nodes (which may be\n// empty if nothing had to be inserted). When `toEnd` is true, only\n// return a fragment if the resulting match goes to the end of the\n// content expression.\nContentMatch.prototype.fillBefore = function fillBefore (after, toEnd, startIndex) {\n if ( toEnd === void 0 ) toEnd = false;\n if ( startIndex === void 0 ) startIndex = 0;\n\n var seen = [this];\n function search(match, types) {\n var finished = match.matchFragment(after, startIndex);\n if (finished && (!toEnd || finished.validEnd))\n { return Fragment.from(types.map(function (tp) { return tp.createAndFill(); })) }\n\n for (var i = 0; i < match.next.length; i += 2) {\n var type = match.next[i], next = match.next[i + 1];\n if (!(type.isText || type.hasRequiredAttrs()) && seen.indexOf(next) == -1) {\n seen.push(next);\n var found = search(next, types.concat(type));\n if (found) { return found }\n }\n }\n }\n\n return search(this, [])\n};\n\n// :: (NodeType) → ?[NodeType]\n// Find a set of wrapping node types that would allow a node of the\n// given type to appear at this position. The result may be empty\n// (when it fits directly) and will be null when no such wrapping\n// exists.\nContentMatch.prototype.findWrapping = function findWrapping (target) {\n for (var i = 0; i < this.wrapCache.length; i += 2)\n { if (this.wrapCache[i] == target) { return this.wrapCache[i + 1] } }\n var computed = this.computeWrapping(target);\n this.wrapCache.push(target, computed);\n return computed\n};\n\nContentMatch.prototype.computeWrapping = function computeWrapping (target) {\n var seen = Object.create(null), active = [{match: this, type: null, via: null}];\n while (active.length) {\n var current = active.shift(), match = current.match;\n if (match.matchType(target)) {\n var result = [];\n for (var obj = current; obj.type; obj = obj.via)\n { result.push(obj.type); }\n return result.reverse()\n }\n for (var i = 0; i < match.next.length; i += 2) {\n var type = match.next[i];\n if (!type.isLeaf && !type.hasRequiredAttrs() && !(type.name in seen) && (!current.type || match.next[i + 1].validEnd)) {\n active.push({match: type.contentMatch, type: type, via: current});\n seen[type.name] = true;\n }\n }\n }\n};\n\n// :: number\n// The number of outgoing edges this node has in the finite\n// automaton that describes the content expression.\nprototypeAccessors$4.edgeCount.get = function () {\n return this.next.length >> 1\n};\n\n// :: (number) → {type: NodeType, next: ContentMatch}\n// Get the _n_​th outgoing edge from this node in the finite\n// automaton that describes the content expression.\nContentMatch.prototype.edge = function edge (n) {\n var i = n << 1;\n if (i >= this.next.length) { throw new RangeError((\"There's no \" + n + \"th edge in this content match\")) }\n return {type: this.next[i], next: this.next[i + 1]}\n};\n\nContentMatch.prototype.toString = function toString () {\n var seen = [];\n function scan(m) {\n seen.push(m);\n for (var i = 1; i < m.next.length; i += 2)\n { if (seen.indexOf(m.next[i]) == -1) { scan(m.next[i]); } }\n }\n scan(this);\n return seen.map(function (m, i) {\n var out = i + (m.validEnd ? \"*\" : \" \") + \" \";\n for (var i$1 = 0; i$1 < m.next.length; i$1 += 2)\n { out += (i$1 ? \", \" : \"\") + m.next[i$1].name + \"->\" + seen.indexOf(m.next[i$1 + 1]); }\n return out\n }).join(\"\\n\")\n};\n\nObject.defineProperties( ContentMatch.prototype, prototypeAccessors$4 );\n\nContentMatch.empty = new ContentMatch(true);\n\nvar TokenStream = function TokenStream(string, nodeTypes) {\n this.string = string;\n this.nodeTypes = nodeTypes;\n this.inline = null;\n this.pos = 0;\n this.tokens = string.split(/\\s*(?=\\b|\\W|$)/);\n if (this.tokens[this.tokens.length - 1] == \"\") { this.tokens.pop(); }\n if (this.tokens[0] == \"\") { this.tokens.unshift(); }\n};\n\nvar prototypeAccessors$1$2 = { next: { configurable: true } };\n\nprototypeAccessors$1$2.next.get = function () { return this.tokens[this.pos] };\n\nTokenStream.prototype.eat = function eat (tok) { return this.next == tok && (this.pos++ || true) };\n\nTokenStream.prototype.err = function err (str) { throw new SyntaxError(str + \" (in content expression '\" + this.string + \"')\") };\n\nObject.defineProperties( TokenStream.prototype, prototypeAccessors$1$2 );\n\nfunction parseExpr(stream) {\n var exprs = [];\n do { exprs.push(parseExprSeq(stream)); }\n while (stream.eat(\"|\"))\n return exprs.length == 1 ? exprs[0] : {type: \"choice\", exprs: exprs}\n}\n\nfunction parseExprSeq(stream) {\n var exprs = [];\n do { exprs.push(parseExprSubscript(stream)); }\n while (stream.next && stream.next != \")\" && stream.next != \"|\")\n return exprs.length == 1 ? exprs[0] : {type: \"seq\", exprs: exprs}\n}\n\nfunction parseExprSubscript(stream) {\n var expr = parseExprAtom(stream);\n for (;;) {\n if (stream.eat(\"+\"))\n { expr = {type: \"plus\", expr: expr}; }\n else if (stream.eat(\"*\"))\n { expr = {type: \"star\", expr: expr}; }\n else if (stream.eat(\"?\"))\n { expr = {type: \"opt\", expr: expr}; }\n else if (stream.eat(\"{\"))\n { expr = parseExprRange(stream, expr); }\n else { break }\n }\n return expr\n}\n\nfunction parseNum(stream) {\n if (/\\D/.test(stream.next)) { stream.err(\"Expected number, got '\" + stream.next + \"'\"); }\n var result = Number(stream.next);\n stream.pos++;\n return result\n}\n\nfunction parseExprRange(stream, expr) {\n var min = parseNum(stream), max = min;\n if (stream.eat(\",\")) {\n if (stream.next != \"}\") { max = parseNum(stream); }\n else { max = -1; }\n }\n if (!stream.eat(\"}\")) { stream.err(\"Unclosed braced range\"); }\n return {type: \"range\", min: min, max: max, expr: expr}\n}\n\nfunction resolveName(stream, name) {\n var types = stream.nodeTypes, type = types[name];\n if (type) { return [type] }\n var result = [];\n for (var typeName in types) {\n var type$1 = types[typeName];\n if (type$1.groups.indexOf(name) > -1) { result.push(type$1); }\n }\n if (result.length == 0) { stream.err(\"No node type or group '\" + name + \"' found\"); }\n return result\n}\n\nfunction parseExprAtom(stream) {\n if (stream.eat(\"(\")) {\n var expr = parseExpr(stream);\n if (!stream.eat(\")\")) { stream.err(\"Missing closing paren\"); }\n return expr\n } else if (!/\\W/.test(stream.next)) {\n var exprs = resolveName(stream, stream.next).map(function (type) {\n if (stream.inline == null) { stream.inline = type.isInline; }\n else if (stream.inline != type.isInline) { stream.err(\"Mixing inline and block content\"); }\n return {type: \"name\", value: type}\n });\n stream.pos++;\n return exprs.length == 1 ? exprs[0] : {type: \"choice\", exprs: exprs}\n } else {\n stream.err(\"Unexpected token '\" + stream.next + \"'\");\n }\n}\n\n// The code below helps compile a regular-expression-like language\n// into a deterministic finite automaton. For a good introduction to\n// these concepts, see https://swtch.com/~rsc/regexp/regexp1.html\n\n// : (Object) → [[{term: ?any, to: number}]]\n// Construct an NFA from an expression as returned by the parser. The\n// NFA is represented as an array of states, which are themselves\n// arrays of edges, which are `{term, to}` objects. The first state is\n// the entry state and the last node is the success state.\n//\n// Note that unlike typical NFAs, the edge ordering in this one is\n// significant, in that it is used to contruct filler content when\n// necessary.\nfunction nfa(expr) {\n var nfa = [[]];\n connect(compile(expr, 0), node());\n return nfa\n\n function node() { return nfa.push([]) - 1 }\n function edge(from, to, term) {\n var edge = {term: term, to: to};\n nfa[from].push(edge);\n return edge\n }\n function connect(edges, to) { edges.forEach(function (edge) { return edge.to = to; }); }\n\n function compile(expr, from) {\n if (expr.type == \"choice\") {\n return expr.exprs.reduce(function (out, expr) { return out.concat(compile(expr, from)); }, [])\n } else if (expr.type == \"seq\") {\n for (var i = 0;; i++) {\n var next = compile(expr.exprs[i], from);\n if (i == expr.exprs.length - 1) { return next }\n connect(next, from = node());\n }\n } else if (expr.type == \"star\") {\n var loop = node();\n edge(from, loop);\n connect(compile(expr.expr, loop), loop);\n return [edge(loop)]\n } else if (expr.type == \"plus\") {\n var loop$1 = node();\n connect(compile(expr.expr, from), loop$1);\n connect(compile(expr.expr, loop$1), loop$1);\n return [edge(loop$1)]\n } else if (expr.type == \"opt\") {\n return [edge(from)].concat(compile(expr.expr, from))\n } else if (expr.type == \"range\") {\n var cur = from;\n for (var i$1 = 0; i$1 < expr.min; i$1++) {\n var next$1 = node();\n connect(compile(expr.expr, cur), next$1);\n cur = next$1;\n }\n if (expr.max == -1) {\n connect(compile(expr.expr, cur), cur);\n } else {\n for (var i$2 = expr.min; i$2 < expr.max; i$2++) {\n var next$2 = node();\n edge(cur, next$2);\n connect(compile(expr.expr, cur), next$2);\n cur = next$2;\n }\n }\n return [edge(cur)]\n } else if (expr.type == \"name\") {\n return [edge(from, null, expr.value)]\n }\n }\n}\n\nfunction cmp(a, b) { return b - a }\n\n// Get the set of nodes reachable by null edges from `node`. Omit\n// nodes with only a single null-out-edge, since they may lead to\n// needless duplicated nodes.\nfunction nullFrom(nfa, node) {\n var result = [];\n scan(node);\n return result.sort(cmp)\n\n function scan(node) {\n var edges = nfa[node];\n if (edges.length == 1 && !edges[0].term) { return scan(edges[0].to) }\n result.push(node);\n for (var i = 0; i < edges.length; i++) {\n var ref = edges[i];\n var term = ref.term;\n var to = ref.to;\n if (!term && result.indexOf(to) == -1) { scan(to); }\n }\n }\n}\n\n// : ([[{term: ?any, to: number}]]) → ContentMatch\n// Compiles an NFA as produced by `nfa` into a DFA, modeled as a set\n// of state objects (`ContentMatch` instances) with transitions\n// between them.\nfunction dfa(nfa) {\n var labeled = Object.create(null);\n return explore(nullFrom(nfa, 0))\n\n function explore(states) {\n var out = [];\n states.forEach(function (node) {\n nfa[node].forEach(function (ref) {\n var term = ref.term;\n var to = ref.to;\n\n if (!term) { return }\n var known = out.indexOf(term), set = known > -1 && out[known + 1];\n nullFrom(nfa, to).forEach(function (node) {\n if (!set) { out.push(term, set = []); }\n if (set.indexOf(node) == -1) { set.push(node); }\n });\n });\n });\n var state = labeled[states.join(\",\")] = new ContentMatch(states.indexOf(nfa.length - 1) > -1);\n for (var i = 0; i < out.length; i += 2) {\n var states$1 = out[i + 1].sort(cmp);\n state.next.push(out[i], labeled[states$1.join(\",\")] || explore(states$1));\n }\n return state\n }\n}\n\nfunction checkForDeadEnds(match, stream) {\n for (var i = 0, work = [match]; i < work.length; i++) {\n var state = work[i], dead = !state.validEnd, nodes = [];\n for (var j = 0; j < state.next.length; j += 2) {\n var node = state.next[j], next = state.next[j + 1];\n nodes.push(node.name);\n if (dead && !(node.isText || node.hasRequiredAttrs())) { dead = false; }\n if (work.indexOf(next) == -1) { work.push(next); }\n }\n if (dead) { stream.err(\"Only non-generatable nodes (\" + nodes.join(\", \") + \") in a required position\"); }\n }\n}\n\n// For node types where all attrs have a default value (or which don't\n// have any attributes), build up a single reusable default attribute\n// object, and use it for all nodes that don't specify specific\n// attributes.\nfunction defaultAttrs(attrs) {\n var defaults = Object.create(null);\n for (var attrName in attrs) {\n var attr = attrs[attrName];\n if (!attr.hasDefault) { return null }\n defaults[attrName] = attr.default;\n }\n return defaults\n}\n\nfunction computeAttrs(attrs, value) {\n var built = Object.create(null);\n for (var name in attrs) {\n var given = value && value[name];\n if (given === undefined) {\n var attr = attrs[name];\n if (attr.hasDefault) { given = attr.default; }\n else { throw new RangeError(\"No value supplied for attribute \" + name) }\n }\n built[name] = given;\n }\n return built\n}\n\nfunction initAttrs(attrs) {\n var result = Object.create(null);\n if (attrs) { for (var name in attrs) { result[name] = new Attribute(attrs[name]); } }\n return result\n}\n\n// ::- Node types are objects allocated once per `Schema` and used to\n// [tag](#model.Node.type) `Node` instances. They contain information\n// about the node type, such as its name and what kind of node it\n// represents.\nvar NodeType = function NodeType(name, schema, spec) {\n // :: string\n // The name the node type has in this schema.\n this.name = name;\n\n // :: Schema\n // A link back to the `Schema` the node type belongs to.\n this.schema = schema;\n\n // :: NodeSpec\n // The spec that this type is based on\n this.spec = spec;\n\n this.groups = spec.group ? spec.group.split(\" \") : [];\n this.attrs = initAttrs(spec.attrs);\n\n this.defaultAttrs = defaultAttrs(this.attrs);\n\n // :: ContentMatch\n // The starting match of the node type's content expression.\n this.contentMatch = null;\n\n // : ?[MarkType]\n // The set of marks allowed in this node. `null` means all marks\n // are allowed.\n this.markSet = null;\n\n // :: bool\n // True if this node type has inline content.\n this.inlineContent = null;\n\n // :: bool\n // True if this is a block type\n this.isBlock = !(spec.inline || name == \"text\");\n\n // :: bool\n // True if this is the text node type.\n this.isText = name == \"text\";\n};\n\nvar prototypeAccessors$5 = { isInline: { configurable: true },isTextblock: { configurable: true },isLeaf: { configurable: true },isAtom: { configurable: true } };\n\n// :: bool\n// True if this is an inline type.\nprototypeAccessors$5.isInline.get = function () { return !this.isBlock };\n\n// :: bool\n// True if this is a textblock type, a block that contains inline\n// content.\nprototypeAccessors$5.isTextblock.get = function () { return this.isBlock && this.inlineContent };\n\n// :: bool\n// True for node types that allow no content.\nprototypeAccessors$5.isLeaf.get = function () { return this.contentMatch == ContentMatch.empty };\n\n// :: bool\n// True when this node is an atom, i.e. when it does not have\n// directly editable content.\nprototypeAccessors$5.isAtom.get = function () { return this.isLeaf || this.spec.atom };\n\n// :: () → bool\n// Tells you whether this node type has any required attributes.\nNodeType.prototype.hasRequiredAttrs = function hasRequiredAttrs () {\n for (var n in this.attrs) { if (this.attrs[n].isRequired) { return true } }\n return false\n};\n\nNodeType.prototype.compatibleContent = function compatibleContent (other) {\n return this == other || this.contentMatch.compatible(other.contentMatch)\n};\n\nNodeType.prototype.computeAttrs = function computeAttrs$1 (attrs) {\n if (!attrs && this.defaultAttrs) { return this.defaultAttrs }\n else { return computeAttrs(this.attrs, attrs) }\n};\n\n// :: (?Object, ?union, ?[Mark]) → Node\n// Create a `Node` of this type. The given attributes are\n// checked and defaulted (you can pass `null` to use the type's\n// defaults entirely, if no required attributes exist). `content`\n// may be a `Fragment`, a node, an array of nodes, or\n// `null`. Similarly `marks` may be `null` to default to the empty\n// set of marks.\nNodeType.prototype.create = function create (attrs, content, marks) {\n if (this.isText) { throw new Error(\"NodeType.create can't construct text nodes\") }\n return new Node(this, this.computeAttrs(attrs), Fragment.from(content), Mark.setFrom(marks))\n};\n\n// :: (?Object, ?union, ?[Mark]) → Node\n// Like [`create`](#model.NodeType.create), but check the given content\n// against the node type's content restrictions, and throw an error\n// if it doesn't match.\nNodeType.prototype.createChecked = function createChecked (attrs, content, marks) {\n content = Fragment.from(content);\n if (!this.validContent(content))\n { throw new RangeError(\"Invalid content for node \" + this.name) }\n return new Node(this, this.computeAttrs(attrs), content, Mark.setFrom(marks))\n};\n\n// :: (?Object, ?union, ?[Mark]) → ?Node\n// Like [`create`](#model.NodeType.create), but see if it is necessary to\n// add nodes to the start or end of the given fragment to make it\n// fit the node. If no fitting wrapping can be found, return null.\n// Note that, due to the fact that required nodes can always be\n// created, this will always succeed if you pass null or\n// `Fragment.empty` as content.\nNodeType.prototype.createAndFill = function createAndFill (attrs, content, marks) {\n attrs = this.computeAttrs(attrs);\n content = Fragment.from(content);\n if (content.size) {\n var before = this.contentMatch.fillBefore(content);\n if (!before) { return null }\n content = before.append(content);\n }\n var after = this.contentMatch.matchFragment(content).fillBefore(Fragment.empty, true);\n if (!after) { return null }\n return new Node(this, attrs, content.append(after), Mark.setFrom(marks))\n};\n\n// :: (Fragment) → bool\n// Returns true if the given fragment is valid content for this node\n// type with the given attributes.\nNodeType.prototype.validContent = function validContent (content) {\n var result = this.contentMatch.matchFragment(content);\n if (!result || !result.validEnd) { return false }\n for (var i = 0; i < content.childCount; i++)\n { if (!this.allowsMarks(content.child(i).marks)) { return false } }\n return true\n};\n\n// :: (MarkType) → bool\n// Check whether the given mark type is allowed in this node.\nNodeType.prototype.allowsMarkType = function allowsMarkType (markType) {\n return this.markSet == null || this.markSet.indexOf(markType) > -1\n};\n\n// :: ([Mark]) → bool\n// Test whether the given set of marks are allowed in this node.\nNodeType.prototype.allowsMarks = function allowsMarks (marks) {\n if (this.markSet == null) { return true }\n for (var i = 0; i < marks.length; i++) { if (!this.allowsMarkType(marks[i].type)) { return false } }\n return true\n};\n\n// :: ([Mark]) → [Mark]\n// Removes the marks that are not allowed in this node from the given set.\nNodeType.prototype.allowedMarks = function allowedMarks (marks) {\n if (this.markSet == null) { return marks }\n var copy;\n for (var i = 0; i < marks.length; i++) {\n if (!this.allowsMarkType(marks[i].type)) {\n if (!copy) { copy = marks.slice(0, i); }\n } else if (copy) {\n copy.push(marks[i]);\n }\n }\n return !copy ? marks : copy.length ? copy : Mark.empty\n};\n\nNodeType.compile = function compile (nodes, schema) {\n var result = Object.create(null);\n nodes.forEach(function (name, spec) { return result[name] = new NodeType(name, schema, spec); });\n\n var topType = schema.spec.topNode || \"doc\";\n if (!result[topType]) { throw new RangeError(\"Schema is missing its top node type ('\" + topType + \"')\") }\n if (!result.text) { throw new RangeError(\"Every schema needs a 'text' type\") }\n for (var _ in result.text.attrs) { throw new RangeError(\"The text node type should not have attributes\") }\n\n return result\n};\n\nObject.defineProperties( NodeType.prototype, prototypeAccessors$5 );\n\n// Attribute descriptors\n\nvar Attribute = function Attribute(options) {\n this.hasDefault = Object.prototype.hasOwnProperty.call(options, \"default\");\n this.default = options.default;\n};\n\nvar prototypeAccessors$1$3 = { isRequired: { configurable: true } };\n\nprototypeAccessors$1$3.isRequired.get = function () {\n return !this.hasDefault\n};\n\nObject.defineProperties( Attribute.prototype, prototypeAccessors$1$3 );\n\n// Marks\n\n// ::- Like nodes, marks (which are associated with nodes to signify\n// things like emphasis or being part of a link) are\n// [tagged](#model.Mark.type) with type objects, which are\n// instantiated once per `Schema`.\nvar MarkType = function MarkType(name, rank, schema, spec) {\n // :: string\n // The name of the mark type.\n this.name = name;\n\n // :: Schema\n // The schema that this mark type instance is part of.\n this.schema = schema;\n\n // :: MarkSpec\n // The spec on which the type is based.\n this.spec = spec;\n\n this.attrs = initAttrs(spec.attrs);\n\n this.rank = rank;\n this.excluded = null;\n var defaults = defaultAttrs(this.attrs);\n this.instance = defaults && new Mark(this, defaults);\n};\n\n// :: (?Object) → Mark\n// Create a mark of this type. `attrs` may be `null` or an object\n// containing only some of the mark's attributes. The others, if\n// they have defaults, will be added.\nMarkType.prototype.create = function create (attrs) {\n if (!attrs && this.instance) { return this.instance }\n return new Mark(this, computeAttrs(this.attrs, attrs))\n};\n\nMarkType.compile = function compile (marks, schema) {\n var result = Object.create(null), rank = 0;\n marks.forEach(function (name, spec) { return result[name] = new MarkType(name, rank++, schema, spec); });\n return result\n};\n\n// :: ([Mark]) → [Mark]\n// When there is a mark of this type in the given set, a new set\n// without it is returned. Otherwise, the input set is returned.\nMarkType.prototype.removeFromSet = function removeFromSet (set) {\n for (var i = 0; i < set.length; i++)\n { if (set[i].type == this)\n { return set.slice(0, i).concat(set.slice(i + 1)) } }\n return set\n};\n\n// :: ([Mark]) → ?Mark\n// Tests whether there is a mark of this type in the given set.\nMarkType.prototype.isInSet = function isInSet (set) {\n for (var i = 0; i < set.length; i++)\n { if (set[i].type == this) { return set[i] } }\n};\n\n// :: (MarkType) → bool\n// Queries whether a given mark type is\n// [excluded](#model.MarkSpec.excludes) by this one.\nMarkType.prototype.excludes = function excludes (other) {\n return this.excluded.indexOf(other) > -1\n};\n\n// SchemaSpec:: interface\n// An object describing a schema, as passed to the [`Schema`](#model.Schema)\n// constructor.\n//\n// nodes:: union, OrderedMap>\n// The node types in this schema. Maps names to\n// [`NodeSpec`](#model.NodeSpec) objects that describe the node type\n// associated with that name. Their order is significant—it\n// determines which [parse rules](#model.NodeSpec.parseDOM) take\n// precedence by default, and which nodes come first in a given\n// [group](#model.NodeSpec.group).\n//\n// marks:: ?union, OrderedMap>\n// The mark types that exist in this schema. The order in which they\n// are provided determines the order in which [mark\n// sets](#model.Mark.addToSet) are sorted and in which [parse\n// rules](#model.MarkSpec.parseDOM) are tried.\n//\n// topNode:: ?string\n// The name of the default top-level node for the schema. Defaults\n// to `\"doc\"`.\n\n// NodeSpec:: interface\n//\n// content:: ?string\n// The content expression for this node, as described in the [schema\n// guide](/docs/guide/#schema.content_expressions). When not given,\n// the node does not allow any content.\n//\n// marks:: ?string\n// The marks that are allowed inside of this node. May be a\n// space-separated string referring to mark names or groups, `\"_\"`\n// to explicitly allow all marks, or `\"\"` to disallow marks. When\n// not given, nodes with inline content default to allowing all\n// marks, other nodes default to not allowing marks.\n//\n// group:: ?string\n// The group or space-separated groups to which this node belongs,\n// which can be referred to in the content expressions for the\n// schema.\n//\n// inline:: ?bool\n// Should be set to true for inline nodes. (Implied for text nodes.)\n//\n// atom:: ?bool\n// Can be set to true to indicate that, though this isn't a [leaf\n// node](#model.NodeType.isLeaf), it doesn't have directly editable\n// content and should be treated as a single unit in the view.\n//\n// attrs:: ?Object\n// The attributes that nodes of this type get.\n//\n// selectable:: ?bool\n// Controls whether nodes of this type can be selected as a [node\n// selection](#state.NodeSelection). Defaults to true for non-text\n// nodes.\n//\n// draggable:: ?bool\n// Determines whether nodes of this type can be dragged without\n// being selected. Defaults to false.\n//\n// code:: ?bool\n// Can be used to indicate that this node contains code, which\n// causes some commands to behave differently.\n//\n// defining:: ?bool\n// Determines whether this node is considered an important parent\n// node during replace operations (such as paste). Non-defining (the\n// default) nodes get dropped when their entire content is replaced,\n// whereas defining nodes persist and wrap the inserted content.\n// Likewise, in _inserted_ content the defining parents of the\n// content are preserved when possible. Typically,\n// non-default-paragraph textblock types, and possibly list items,\n// are marked as defining.\n//\n// isolating:: ?bool\n// When enabled (default is false), the sides of nodes of this type\n// count as boundaries that regular editing operations, like\n// backspacing or lifting, won't cross. An example of a node that\n// should probably have this enabled is a table cell.\n//\n// toDOM:: ?(node: Node) → DOMOutputSpec\n// Defines the default way a node of this type should be serialized\n// to DOM/HTML (as used by\n// [`DOMSerializer.fromSchema`](#model.DOMSerializer^fromSchema)).\n// Should return a DOM node or an [array\n// structure](#model.DOMOutputSpec) that describes one, with an\n// optional number zero (“hole”) in it to indicate where the node's\n// content should be inserted.\n//\n// For text nodes, the default is to create a text DOM node. Though\n// it is possible to create a serializer where text is rendered\n// differently, this is not supported inside the editor, so you\n// shouldn't override that in your text node spec.\n//\n// parseDOM:: ?[ParseRule]\n// Associates DOM parser information with this node, which can be\n// used by [`DOMParser.fromSchema`](#model.DOMParser^fromSchema) to\n// automatically derive a parser. The `node` field in the rules is\n// implied (the name of this node will be filled in automatically).\n// If you supply your own parser, you do not need to also specify\n// parsing rules in your schema.\n//\n// toDebugString:: ?(node: Node) -> string\n// Defines the default way a node of this type should be serialized\n// to a string representation for debugging (e.g. in error messages).\n\n// MarkSpec:: interface\n//\n// attrs:: ?Object\n// The attributes that marks of this type get.\n//\n// inclusive:: ?bool\n// Whether this mark should be active when the cursor is positioned\n// at its end (or at its start when that is also the start of the\n// parent node). Defaults to true.\n//\n// excludes:: ?string\n// Determines which other marks this mark can coexist with. Should\n// be a space-separated strings naming other marks or groups of marks.\n// When a mark is [added](#model.Mark.addToSet) to a set, all marks\n// that it excludes are removed in the process. If the set contains\n// any mark that excludes the new mark but is not, itself, excluded\n// by the new mark, the mark can not be added an the set. You can\n// use the value `\"_\"` to indicate that the mark excludes all\n// marks in the schema.\n//\n// Defaults to only being exclusive with marks of the same type. You\n// can set it to an empty string (or any string not containing the\n// mark's own name) to allow multiple marks of a given type to\n// coexist (as long as they have different attributes).\n//\n// group:: ?string\n// The group or space-separated groups to which this mark belongs.\n//\n// spanning:: ?bool\n// Determines whether marks of this type can span multiple adjacent\n// nodes when serialized to DOM/HTML. Defaults to true.\n//\n// toDOM:: ?(mark: Mark, inline: bool) → DOMOutputSpec\n// Defines the default way marks of this type should be serialized\n// to DOM/HTML. When the resulting spec contains a hole, that is\n// where the marked content is placed. Otherwise, it is appended to\n// the top node.\n//\n// parseDOM:: ?[ParseRule]\n// Associates DOM parser information with this mark (see the\n// corresponding [node spec field](#model.NodeSpec.parseDOM)). The\n// `mark` field in the rules is implied.\n\n// AttributeSpec:: interface\n//\n// Used to [define](#model.NodeSpec.attrs) attributes on nodes or\n// marks.\n//\n// default:: ?any\n// The default value for this attribute, to use when no explicit\n// value is provided. Attributes that have no default must be\n// provided whenever a node or mark of a type that has them is\n// created.\n\n// ::- A document schema. Holds [node](#model.NodeType) and [mark\n// type](#model.MarkType) objects for the nodes and marks that may\n// occur in conforming documents, and provides functionality for\n// creating and deserializing such documents.\nvar Schema = function Schema(spec) {\n // :: SchemaSpec\n // The [spec](#model.SchemaSpec) on which the schema is based,\n // with the added guarantee that its `nodes` and `marks`\n // properties are\n // [`OrderedMap`](https://github.com/marijnh/orderedmap) instances\n // (not raw objects).\n this.spec = {};\n for (var prop in spec) { this.spec[prop] = spec[prop]; }\n this.spec.nodes = orderedmap__WEBPACK_IMPORTED_MODULE_0__[\"default\"].from(spec.nodes);\n this.spec.marks = orderedmap__WEBPACK_IMPORTED_MODULE_0__[\"default\"].from(spec.marks);\n\n // :: Object\n // An object mapping the schema's node names to node type objects.\n this.nodes = NodeType.compile(this.spec.nodes, this);\n\n // :: Object\n // A map from mark names to mark type objects.\n this.marks = MarkType.compile(this.spec.marks, this);\n\n var contentExprCache = Object.create(null);\n for (var prop$1 in this.nodes) {\n if (prop$1 in this.marks)\n { throw new RangeError(prop$1 + \" can not be both a node and a mark\") }\n var type = this.nodes[prop$1], contentExpr = type.spec.content || \"\", markExpr = type.spec.marks;\n type.contentMatch = contentExprCache[contentExpr] ||\n (contentExprCache[contentExpr] = ContentMatch.parse(contentExpr, this.nodes));\n type.inlineContent = type.contentMatch.inlineContent;\n type.markSet = markExpr == \"_\" ? null :\n markExpr ? gatherMarks(this, markExpr.split(\" \")) :\n markExpr == \"\" || !type.inlineContent ? [] : null;\n }\n for (var prop$2 in this.marks) {\n var type$1 = this.marks[prop$2], excl = type$1.spec.excludes;\n type$1.excluded = excl == null ? [type$1] : excl == \"\" ? [] : gatherMarks(this, excl.split(\" \"));\n }\n\n this.nodeFromJSON = this.nodeFromJSON.bind(this);\n this.markFromJSON = this.markFromJSON.bind(this);\n\n // :: NodeType\n // The type of the [default top node](#model.SchemaSpec.topNode)\n // for this schema.\n this.topNodeType = this.nodes[this.spec.topNode || \"doc\"];\n\n // :: Object\n // An object for storing whatever values modules may want to\n // compute and cache per schema. (If you want to store something\n // in it, try to use property names unlikely to clash.)\n this.cached = Object.create(null);\n this.cached.wrappings = Object.create(null);\n};\n\n// :: (union, ?Object, ?union, ?[Mark]) → Node\n// Create a node in this schema. The `type` may be a string or a\n// `NodeType` instance. Attributes will be extended\n// with defaults, `content` may be a `Fragment`,\n// `null`, a `Node`, or an array of nodes.\nSchema.prototype.node = function node (type, attrs, content, marks) {\n if (typeof type == \"string\")\n { type = this.nodeType(type); }\n else if (!(type instanceof NodeType))\n { throw new RangeError(\"Invalid node type: \" + type) }\n else if (type.schema != this)\n { throw new RangeError(\"Node type from different schema used (\" + type.name + \")\") }\n\n return type.createChecked(attrs, content, marks)\n};\n\n// :: (string, ?[Mark]) → Node\n// Create a text node in the schema. Empty text nodes are not\n// allowed.\nSchema.prototype.text = function text (text$1, marks) {\n var type = this.nodes.text;\n return new TextNode(type, type.defaultAttrs, text$1, Mark.setFrom(marks))\n};\n\n// :: (union, ?Object) → Mark\n// Create a mark with the given type and attributes.\nSchema.prototype.mark = function mark (type, attrs) {\n if (typeof type == \"string\") { type = this.marks[type]; }\n return type.create(attrs)\n};\n\n// :: (Object) → Node\n// Deserialize a node from its JSON representation. This method is\n// bound.\nSchema.prototype.nodeFromJSON = function nodeFromJSON (json) {\n return Node.fromJSON(this, json)\n};\n\n// :: (Object) → Mark\n// Deserialize a mark from its JSON representation. This method is\n// bound.\nSchema.prototype.markFromJSON = function markFromJSON (json) {\n return Mark.fromJSON(this, json)\n};\n\nSchema.prototype.nodeType = function nodeType (name) {\n var found = this.nodes[name];\n if (!found) { throw new RangeError(\"Unknown node type: \" + name) }\n return found\n};\n\nfunction gatherMarks(schema, marks) {\n var found = [];\n for (var i = 0; i < marks.length; i++) {\n var name = marks[i], mark = schema.marks[name], ok = mark;\n if (mark) {\n found.push(mark);\n } else {\n for (var prop in schema.marks) {\n var mark$1 = schema.marks[prop];\n if (name == \"_\" || (mark$1.spec.group && mark$1.spec.group.split(\" \").indexOf(name) > -1))\n { found.push(ok = mark$1); }\n }\n }\n if (!ok) { throw new SyntaxError(\"Unknown mark type: '\" + marks[i] + \"'\") }\n }\n return found\n}\n\n// ParseOptions:: interface\n// These are the options recognized by the\n// [`parse`](#model.DOMParser.parse) and\n// [`parseSlice`](#model.DOMParser.parseSlice) methods.\n//\n// preserveWhitespace:: ?union\n// By default, whitespace is collapsed as per HTML's rules. Pass\n// `true` to preserve whitespace, but normalize newlines to\n// spaces, and `\"full\"` to preserve whitespace entirely.\n//\n// findPositions:: ?[{node: dom.Node, offset: number}]\n// When given, the parser will, beside parsing the content,\n// record the document positions of the given DOM positions. It\n// will do so by writing to the objects, adding a `pos` property\n// that holds the document position. DOM positions that are not\n// in the parsed content will not be written to.\n//\n// from:: ?number\n// The child node index to start parsing from.\n//\n// to:: ?number\n// The child node index to stop parsing at.\n//\n// topNode:: ?Node\n// By default, the content is parsed into the schema's default\n// [top node type](#model.Schema.topNodeType). You can pass this\n// option to use the type and attributes from a different node\n// as the top container.\n//\n// topMatch:: ?ContentMatch\n// Provide the starting content match that content parsed into the\n// top node is matched against.\n//\n// context:: ?ResolvedPos\n// A set of additional nodes to count as\n// [context](#model.ParseRule.context) when parsing, above the\n// given [top node](#model.ParseOptions.topNode).\n\n// ParseRule:: interface\n// A value that describes how to parse a given DOM node or inline\n// style as a ProseMirror node or mark.\n//\n// tag:: ?string\n// A CSS selector describing the kind of DOM elements to match. A\n// single rule should have _either_ a `tag` or a `style` property.\n//\n// namespace:: ?string\n// The namespace to match. This should be used with `tag`.\n// Nodes are only matched when the namespace matches or this property\n// is null.\n//\n// style:: ?string\n// A CSS property name to match. When given, this rule matches\n// inline styles that list that property. May also have the form\n// `\"property=value\"`, in which case the rule only matches if the\n// propery's value exactly matches the given value. (For more\n// complicated filters, use [`getAttrs`](#model.ParseRule.getAttrs)\n// and return false to indicate that the match failed.)\n//\n// priority:: ?number\n// Can be used to change the order in which the parse rules in a\n// schema are tried. Those with higher priority come first. Rules\n// without a priority are counted as having priority 50. This\n// property is only meaningful in a schema—when directly\n// constructing a parser, the order of the rule array is used.\n//\n// context:: ?string\n// When given, restricts this rule to only match when the current\n// context—the parent nodes into which the content is being\n// parsed—matches this expression. Should contain one or more node\n// names or node group names followed by single or double slashes.\n// For example `\"paragraph/\"` means the rule only matches when the\n// parent node is a paragraph, `\"blockquote/paragraph/\"` restricts\n// it to be in a paragraph that is inside a blockquote, and\n// `\"section//\"` matches any position inside a section—a double\n// slash matches any sequence of ancestor nodes. To allow multiple\n// different contexts, they can be separated by a pipe (`|`)\n// character, as in `\"blockquote/|list_item/\"`.\n//\n// node:: ?string\n// The name of the node type to create when this rule matches. Only\n// valid for rules with a `tag` property, not for style rules. Each\n// rule should have one of a `node`, `mark`, or `ignore` property\n// (except when it appears in a [node](#model.NodeSpec.parseDOM) or\n// [mark spec](#model.MarkSpec.parseDOM), in which case the `node`\n// or `mark` property will be derived from its position).\n//\n// mark:: ?string\n// The name of the mark type to wrap the matched content in.\n//\n// ignore:: ?bool\n// When true, ignore content that matches this rule.\n//\n// skip:: ?bool\n// When true, ignore the node that matches this rule, but do parse\n// its content.\n//\n// attrs:: ?Object\n// Attributes for the node or mark created by this rule. When\n// `getAttrs` is provided, it takes precedence.\n//\n// getAttrs:: ?(union) → ?union\n// A function used to compute the attributes for the node or mark\n// created by this rule. Can also be used to describe further\n// conditions the DOM element or style must match. When it returns\n// `false`, the rule won't match. When it returns null or undefined,\n// that is interpreted as an empty/default set of attributes.\n//\n// Called with a DOM Element for `tag` rules, and with a string (the\n// style's value) for `style` rules.\n//\n// contentElement:: ?union\n// For `tag` rules that produce non-leaf nodes or marks, by default\n// the content of the DOM element is parsed as content of the mark\n// or node. If the child nodes are in a descendent node, this may be\n// a CSS selector string that the parser must use to find the actual\n// content element, or a function that returns the actual content\n// element to the parser.\n//\n// getContent:: ?(dom.Node, schema: Schema) → Fragment\n// Can be used to override the content of a matched node. When\n// present, instead of parsing the node's child nodes, the result of\n// this function is used.\n//\n// preserveWhitespace:: ?union\n// Controls whether whitespace should be preserved when parsing the\n// content inside the matched element. `false` means whitespace may\n// be collapsed, `true` means that whitespace should be preserved\n// but newlines normalized to spaces, and `\"full\"` means that\n// newlines should also be preserved.\n\n// ::- A DOM parser represents a strategy for parsing DOM content into\n// a ProseMirror document conforming to a given schema. Its behavior\n// is defined by an array of [rules](#model.ParseRule).\nvar DOMParser = function DOMParser(schema, rules) {\n var this$1 = this;\n\n // :: Schema\n // The schema into which the parser parses.\n this.schema = schema;\n // :: [ParseRule]\n // The set of [parse rules](#model.ParseRule) that the parser\n // uses, in order of precedence.\n this.rules = rules;\n this.tags = [];\n this.styles = [];\n\n rules.forEach(function (rule) {\n if (rule.tag) { this$1.tags.push(rule); }\n else if (rule.style) { this$1.styles.push(rule); }\n });\n};\n\n// :: (dom.Node, ?ParseOptions) → Node\n// Parse a document from the content of a DOM node.\nDOMParser.prototype.parse = function parse (dom, options) {\n if ( options === void 0 ) options = {};\n\n var context = new ParseContext(this, options, false);\n context.addAll(dom, null, options.from, options.to);\n return context.finish()\n};\n\n// :: (dom.Node, ?ParseOptions) → Slice\n// Parses the content of the given DOM node, like\n// [`parse`](#model.DOMParser.parse), and takes the same set of\n// options. But unlike that method, which produces a whole node,\n// this one returns a slice that is open at the sides, meaning that\n// the schema constraints aren't applied to the start of nodes to\n// the left of the input and the end of nodes at the end.\nDOMParser.prototype.parseSlice = function parseSlice (dom, options) {\n if ( options === void 0 ) options = {};\n\n var context = new ParseContext(this, options, true);\n context.addAll(dom, null, options.from, options.to);\n return Slice.maxOpen(context.finish())\n};\n\nDOMParser.prototype.matchTag = function matchTag (dom, context) {\n for (var i = 0; i < this.tags.length; i++) {\n var rule = this.tags[i];\n if (matches(dom, rule.tag) &&\n (rule.namespace === undefined || dom.namespaceURI == rule.namespace) &&\n (!rule.context || context.matchesContext(rule.context))) {\n if (rule.getAttrs) {\n var result = rule.getAttrs(dom);\n if (result === false) { continue }\n rule.attrs = result;\n }\n return rule\n }\n }\n};\n\nDOMParser.prototype.matchStyle = function matchStyle (prop, value, context) {\n for (var i = 0; i < this.styles.length; i++) {\n var rule = this.styles[i];\n if (rule.style.indexOf(prop) != 0 ||\n rule.context && !context.matchesContext(rule.context) ||\n // Test that the style string either precisely matches the prop,\n // or has an '=' sign after the prop, followed by the given\n // value.\n rule.style.length > prop.length &&\n (rule.style.charCodeAt(prop.length) != 61 || rule.style.slice(prop.length + 1) != value))\n { continue }\n if (rule.getAttrs) {\n var result = rule.getAttrs(value);\n if (result === false) { continue }\n rule.attrs = result;\n }\n return rule\n }\n};\n\n// : (Schema) → [ParseRule]\nDOMParser.schemaRules = function schemaRules (schema) {\n var result = [];\n function insert(rule) {\n var priority = rule.priority == null ? 50 : rule.priority, i = 0;\n for (; i < result.length; i++) {\n var next = result[i], nextPriority = next.priority == null ? 50 : next.priority;\n if (nextPriority < priority) { break }\n }\n result.splice(i, 0, rule);\n }\n\n var loop = function ( name ) {\n var rules = schema.marks[name].spec.parseDOM;\n if (rules) { rules.forEach(function (rule) {\n insert(rule = copy(rule));\n rule.mark = name;\n }); }\n };\n\n for (var name in schema.marks) loop( name );\n var loop$1 = function ( name ) {\n var rules$1 = schema.nodes[name$1].spec.parseDOM;\n if (rules$1) { rules$1.forEach(function (rule) {\n insert(rule = copy(rule));\n rule.node = name$1;\n }); }\n };\n\n for (var name$1 in schema.nodes) loop$1();\n return result\n};\n\n// :: (Schema) → DOMParser\n// Construct a DOM parser using the parsing rules listed in a\n// schema's [node specs](#model.NodeSpec.parseDOM), reordered by\n// [priority](#model.ParseRule.priority).\nDOMParser.fromSchema = function fromSchema (schema) {\n return schema.cached.domParser ||\n (schema.cached.domParser = new DOMParser(schema, DOMParser.schemaRules(schema)))\n};\n\n// : Object The block-level tags in HTML5\nvar blockTags = {\n address: true, article: true, aside: true, blockquote: true, canvas: true,\n dd: true, div: true, dl: true, fieldset: true, figcaption: true, figure: true,\n footer: true, form: true, h1: true, h2: true, h3: true, h4: true, h5: true,\n h6: true, header: true, hgroup: true, hr: true, li: true, noscript: true, ol: true,\n output: true, p: true, pre: true, section: true, table: true, tfoot: true, ul: true\n};\n\n// : Object The tags that we normally ignore.\nvar ignoreTags = {\n head: true, noscript: true, object: true, script: true, style: true, title: true\n};\n\n// : Object List tags.\nvar listTags = {ol: true, ul: true};\n\n// Using a bitfield for node context options\nvar OPT_PRESERVE_WS = 1, OPT_PRESERVE_WS_FULL = 2, OPT_OPEN_LEFT = 4;\n\nfunction wsOptionsFor(preserveWhitespace) {\n return (preserveWhitespace ? OPT_PRESERVE_WS : 0) | (preserveWhitespace === \"full\" ? OPT_PRESERVE_WS_FULL : 0)\n}\n\nvar NodeContext = function NodeContext(type, attrs, marks, pendingMarks, solid, match, options) {\n this.type = type;\n this.attrs = attrs;\n this.solid = solid;\n this.match = match || (options & OPT_OPEN_LEFT ? null : type.contentMatch);\n this.options = options;\n this.content = [];\n // Marks applied to this node itself\n this.marks = marks;\n // Marks applied to its children\n this.activeMarks = Mark.none;\n // Marks that can't apply here, but will be used in children if possible\n this.pendingMarks = pendingMarks;\n};\n\nNodeContext.prototype.findWrapping = function findWrapping (node) {\n if (!this.match) {\n if (!this.type) { return [] }\n var fill = this.type.contentMatch.fillBefore(Fragment.from(node));\n if (fill) {\n this.match = this.type.contentMatch.matchFragment(fill);\n } else {\n var start = this.type.contentMatch, wrap;\n if (wrap = start.findWrapping(node.type)) {\n this.match = start;\n return wrap\n } else {\n return null\n }\n }\n }\n return this.match.findWrapping(node.type)\n};\n\nNodeContext.prototype.finish = function finish (openEnd) {\n if (!(this.options & OPT_PRESERVE_WS)) { // Strip trailing whitespace\n var last = this.content[this.content.length - 1], m;\n if (last && last.isText && (m = /[ \\t\\r\\n\\u000c]+$/.exec(last.text))) {\n if (last.text.length == m[0].length) { this.content.pop(); }\n else { this.content[this.content.length - 1] = last.withText(last.text.slice(0, last.text.length - m[0].length)); }\n }\n }\n var content = Fragment.from(this.content);\n if (!openEnd && this.match)\n { content = content.append(this.match.fillBefore(Fragment.empty, true)); }\n return this.type ? this.type.create(this.attrs, content, this.marks) : content\n};\n\nNodeContext.prototype.applyPending = function applyPending (nextType) {\n for (var i = 0, pending = this.pendingMarks; i < pending.length; i++) {\n var mark = pending[i];\n if ((this.type ? this.type.allowsMarkType(mark.type) : markMayApply(mark.type, nextType)) &&\n !mark.isInSet(this.activeMarks)) {\n this.activeMarks = mark.addToSet(this.activeMarks);\n this.pendingMarks = mark.removeFromSet(this.pendingMarks);\n }\n }\n};\n\nvar ParseContext = function ParseContext(parser, options, open) {\n // : DOMParser The parser we are using.\n this.parser = parser;\n // : Object The options passed to this parse.\n this.options = options;\n this.isOpen = open;\n var topNode = options.topNode, topContext;\n var topOptions = wsOptionsFor(options.preserveWhitespace) | (open ? OPT_OPEN_LEFT : 0);\n if (topNode)\n { topContext = new NodeContext(topNode.type, topNode.attrs, Mark.none, Mark.none, true,\n options.topMatch || topNode.type.contentMatch, topOptions); }\n else if (open)\n { topContext = new NodeContext(null, null, Mark.none, Mark.none, true, null, topOptions); }\n else\n { topContext = new NodeContext(parser.schema.topNodeType, null, Mark.none, Mark.none, true, null, topOptions); }\n this.nodes = [topContext];\n // : [Mark] The current set of marks\n this.open = 0;\n this.find = options.findPositions;\n this.needsBlock = false;\n};\n\nvar prototypeAccessors$6 = { top: { configurable: true },currentPos: { configurable: true } };\n\nprototypeAccessors$6.top.get = function () {\n return this.nodes[this.open]\n};\n\n// : (dom.Node)\n// Add a DOM node to the content. Text is inserted as text node,\n// otherwise, the node is passed to `addElement` or, if it has a\n// `style` attribute, `addElementWithStyles`.\nParseContext.prototype.addDOM = function addDOM (dom) {\n if (dom.nodeType == 3) {\n this.addTextNode(dom);\n } else if (dom.nodeType == 1) {\n var style = dom.getAttribute(\"style\");\n var marks = style ? this.readStyles(parseStyles(style)) : null, top = this.top;\n if (marks != null) { for (var i = 0; i < marks.length; i++) { this.addPendingMark(marks[i]); } }\n this.addElement(dom);\n if (marks != null) { for (var i$1 = 0; i$1 < marks.length; i$1++) { this.removePendingMark(marks[i$1], top); } }\n }\n};\n\nParseContext.prototype.addTextNode = function addTextNode (dom) {\n var value = dom.nodeValue;\n var top = this.top;\n if ((top.type ? top.type.inlineContent : top.content.length && top.content[0].isInline) || /[^ \\t\\r\\n\\u000c]/.test(value)) {\n if (!(top.options & OPT_PRESERVE_WS)) {\n value = value.replace(/[ \\t\\r\\n\\u000c]+/g, \" \");\n // If this starts with whitespace, and there is no node before it, or\n // a hard break, or a text node that ends with whitespace, strip the\n // leading space.\n if (/^[ \\t\\r\\n\\u000c]/.test(value) && this.open == this.nodes.length - 1) {\n var nodeBefore = top.content[top.content.length - 1];\n var domNodeBefore = dom.previousSibling;\n if (!nodeBefore ||\n (domNodeBefore && domNodeBefore.nodeName == 'BR') ||\n (nodeBefore.isText && /[ \\t\\r\\n\\u000c]$/.test(nodeBefore.text)))\n { value = value.slice(1); }\n }\n } else if (!(top.options & OPT_PRESERVE_WS_FULL)) {\n value = value.replace(/\\r?\\n|\\r/g, \" \");\n }\n if (value) { this.insertNode(this.parser.schema.text(value)); }\n this.findInText(dom);\n } else {\n this.findInside(dom);\n }\n};\n\n// : (dom.Element)\n// Try to find a handler for the given tag and use that to parse. If\n// none is found, the element's content nodes are added directly.\nParseContext.prototype.addElement = function addElement (dom) {\n var name = dom.nodeName.toLowerCase();\n if (listTags.hasOwnProperty(name)) { normalizeList(dom); }\n var rule = (this.options.ruleFromNode && this.options.ruleFromNode(dom)) || this.parser.matchTag(dom, this);\n if (rule ? rule.ignore : ignoreTags.hasOwnProperty(name)) {\n this.findInside(dom);\n } else if (!rule || rule.skip) {\n if (rule && rule.skip.nodeType) { dom = rule.skip; }\n var sync, top = this.top, oldNeedsBlock = this.needsBlock;\n if (blockTags.hasOwnProperty(name)) {\n sync = true;\n if (!top.type) { this.needsBlock = true; }\n } else if (!dom.firstChild) {\n this.leafFallback(dom);\n return\n }\n this.addAll(dom);\n if (sync) { this.sync(top); }\n this.needsBlock = oldNeedsBlock;\n } else {\n this.addElementByRule(dom, rule);\n }\n};\n\n// Called for leaf DOM nodes that would otherwise be ignored\nParseContext.prototype.leafFallback = function leafFallback (dom) {\n if (dom.nodeName == \"BR\" && this.top.type && this.top.type.inlineContent)\n { this.addTextNode(dom.ownerDocument.createTextNode(\"\\n\")); }\n};\n\n// Run any style parser associated with the node's styles. Either\n// return an array of marks, or null to indicate some of the styles\n// had a rule with `ignore` set.\nParseContext.prototype.readStyles = function readStyles (styles) {\n var marks = Mark.none;\n for (var i = 0; i < styles.length; i += 2) {\n var rule = this.parser.matchStyle(styles[i], styles[i + 1], this);\n if (!rule) { continue }\n if (rule.ignore) { return null }\n marks = this.parser.schema.marks[rule.mark].create(rule.attrs).addToSet(marks);\n }\n return marks\n};\n\n// : (dom.Element, ParseRule) → bool\n// Look up a handler for the given node. If none are found, return\n// false. Otherwise, apply it, use its return value to drive the way\n// the node's content is wrapped, and return true.\nParseContext.prototype.addElementByRule = function addElementByRule (dom, rule) {\n var this$1 = this;\n\n var sync, nodeType, markType, mark;\n if (rule.node) {\n nodeType = this.parser.schema.nodes[rule.node];\n if (!nodeType.isLeaf) {\n sync = this.enter(nodeType, rule.attrs, rule.preserveWhitespace);\n } else if (!this.insertNode(nodeType.create(rule.attrs))) {\n this.leafFallback(dom);\n }\n } else {\n markType = this.parser.schema.marks[rule.mark];\n mark = markType.create(rule.attrs);\n this.addPendingMark(mark);\n }\n var startIn = this.top;\n\n if (nodeType && nodeType.isLeaf) {\n this.findInside(dom);\n } else if (rule.getContent) {\n this.findInside(dom);\n rule.getContent(dom, this.parser.schema).forEach(function (node) { return this$1.insertNode(node); });\n } else {\n var contentDOM = rule.contentElement;\n if (typeof contentDOM == \"string\") { contentDOM = dom.querySelector(contentDOM); }\n else if (typeof contentDOM == \"function\") { contentDOM = contentDOM(dom); }\n if (!contentDOM) { contentDOM = dom; }\n this.findAround(dom, contentDOM, true);\n this.addAll(contentDOM, sync);\n }\n if (sync) { this.sync(startIn); this.open--; }\n if (mark) { this.removePendingMark(mark, startIn); }\n};\n\n// : (dom.Node, ?NodeBuilder, ?number, ?number)\n// Add all child nodes between `startIndex` and `endIndex` (or the\n// whole node, if not given). If `sync` is passed, use it to\n// synchronize after every block element.\nParseContext.prototype.addAll = function addAll (parent, sync, startIndex, endIndex) {\n var index = startIndex || 0;\n for (var dom = startIndex ? parent.childNodes[startIndex] : parent.firstChild,\n end = endIndex == null ? null : parent.childNodes[endIndex];\n dom != end; dom = dom.nextSibling, ++index) {\n this.findAtPoint(parent, index);\n this.addDOM(dom);\n if (sync && blockTags.hasOwnProperty(dom.nodeName.toLowerCase()))\n { this.sync(sync); }\n }\n this.findAtPoint(parent, index);\n};\n\n// Try to find a way to fit the given node type into the current\n// context. May add intermediate wrappers and/or leave non-solid\n// nodes that we're in.\nParseContext.prototype.findPlace = function findPlace (node) {\n var route, sync;\n for (var depth = this.open; depth >= 0; depth--) {\n var cx = this.nodes[depth];\n var found = cx.findWrapping(node);\n if (found && (!route || route.length > found.length)) {\n route = found;\n sync = cx;\n if (!found.length) { break }\n }\n if (cx.solid) { break }\n }\n if (!route) { return false }\n this.sync(sync);\n for (var i = 0; i < route.length; i++)\n { this.enterInner(route[i], null, false); }\n return true\n};\n\n// : (Node) → ?Node\n// Try to insert the given node, adjusting the context when needed.\nParseContext.prototype.insertNode = function insertNode (node) {\n if (node.isInline && this.needsBlock && !this.top.type) {\n var block = this.textblockFromContext();\n if (block) { this.enterInner(block); }\n }\n if (this.findPlace(node)) {\n this.closeExtra();\n var top = this.top;\n top.applyPending(node.type);\n if (top.match) { top.match = top.match.matchType(node.type); }\n var marks = top.activeMarks;\n for (var i = 0; i < node.marks.length; i++)\n { if (!top.type || top.type.allowsMarkType(node.marks[i].type))\n { marks = node.marks[i].addToSet(marks); } }\n top.content.push(node.mark(marks));\n return true\n }\n return false\n};\n\n// : (NodeType, ?Object) → bool\n// Try to start a node of the given type, adjusting the context when\n// necessary.\nParseContext.prototype.enter = function enter (type, attrs, preserveWS) {\n var ok = this.findPlace(type.create(attrs));\n if (ok) { this.enterInner(type, attrs, true, preserveWS); }\n return ok\n};\n\n// Open a node of the given type\nParseContext.prototype.enterInner = function enterInner (type, attrs, solid, preserveWS) {\n this.closeExtra();\n var top = this.top;\n top.applyPending(type);\n top.match = top.match && top.match.matchType(type, attrs);\n var options = preserveWS == null ? top.options & ~OPT_OPEN_LEFT : wsOptionsFor(preserveWS);\n if ((top.options & OPT_OPEN_LEFT) && top.content.length == 0) { options |= OPT_OPEN_LEFT; }\n this.nodes.push(new NodeContext(type, attrs, top.activeMarks, top.pendingMarks, solid, null, options));\n this.open++;\n};\n\n// Make sure all nodes above this.open are finished and added to\n// their parents\nParseContext.prototype.closeExtra = function closeExtra (openEnd) {\n var i = this.nodes.length - 1;\n if (i > this.open) {\n for (; i > this.open; i--) { this.nodes[i - 1].content.push(this.nodes[i].finish(openEnd)); }\n this.nodes.length = this.open + 1;\n }\n};\n\nParseContext.prototype.finish = function finish () {\n this.open = 0;\n this.closeExtra(this.isOpen);\n return this.nodes[0].finish(this.isOpen || this.options.topOpen)\n};\n\nParseContext.prototype.sync = function sync (to) {\n for (var i = this.open; i >= 0; i--) { if (this.nodes[i] == to) {\n this.open = i;\n return\n } }\n};\n\nprototypeAccessors$6.currentPos.get = function () {\n this.closeExtra();\n var pos = 0;\n for (var i = this.open; i >= 0; i--) {\n var content = this.nodes[i].content;\n for (var j = content.length - 1; j >= 0; j--)\n { pos += content[j].nodeSize; }\n if (i) { pos++; }\n }\n return pos\n};\n\nParseContext.prototype.findAtPoint = function findAtPoint (parent, offset) {\n if (this.find) { for (var i = 0; i < this.find.length; i++) {\n if (this.find[i].node == parent && this.find[i].offset == offset)\n { this.find[i].pos = this.currentPos; }\n } }\n};\n\nParseContext.prototype.findInside = function findInside (parent) {\n if (this.find) { for (var i = 0; i < this.find.length; i++) {\n if (this.find[i].pos == null && parent.nodeType == 1 && parent.contains(this.find[i].node))\n { this.find[i].pos = this.currentPos; }\n } }\n};\n\nParseContext.prototype.findAround = function findAround (parent, content, before) {\n if (parent != content && this.find) { for (var i = 0; i < this.find.length; i++) {\n if (this.find[i].pos == null && parent.nodeType == 1 && parent.contains(this.find[i].node)) {\n var pos = content.compareDocumentPosition(this.find[i].node);\n if (pos & (before ? 2 : 4))\n { this.find[i].pos = this.currentPos; }\n }\n } }\n};\n\nParseContext.prototype.findInText = function findInText (textNode) {\n if (this.find) { for (var i = 0; i < this.find.length; i++) {\n if (this.find[i].node == textNode)\n { this.find[i].pos = this.currentPos - (textNode.nodeValue.length - this.find[i].offset); }\n } }\n};\n\n// : (string) → bool\n// Determines whether the given [context\n// string](#ParseRule.context) matches this context.\nParseContext.prototype.matchesContext = function matchesContext (context) {\n var this$1 = this;\n\n if (context.indexOf(\"|\") > -1)\n { return context.split(/\\s*\\|\\s*/).some(this.matchesContext, this) }\n\n var parts = context.split(\"/\");\n var option = this.options.context;\n var useRoot = !this.isOpen && (!option || option.parent.type == this.nodes[0].type);\n var minDepth = -(option ? option.depth + 1 : 0) + (useRoot ? 0 : 1);\n var match = function (i, depth) {\n for (; i >= 0; i--) {\n var part = parts[i];\n if (part == \"\") {\n if (i == parts.length - 1 || i == 0) { continue }\n for (; depth >= minDepth; depth--)\n { if (match(i - 1, depth)) { return true } }\n return false\n } else {\n var next = depth > 0 || (depth == 0 && useRoot) ? this$1.nodes[depth].type\n : option && depth >= minDepth ? option.node(depth - minDepth).type\n : null;\n if (!next || (next.name != part && next.groups.indexOf(part) == -1))\n { return false }\n depth--;\n }\n }\n return true\n };\n return match(parts.length - 1, this.open)\n};\n\nParseContext.prototype.textblockFromContext = function textblockFromContext () {\n var $context = this.options.context;\n if ($context) { for (var d = $context.depth; d >= 0; d--) {\n var deflt = $context.node(d).contentMatchAt($context.indexAfter(d)).defaultType;\n if (deflt && deflt.isTextblock && deflt.defaultAttrs) { return deflt }\n } }\n for (var name in this.parser.schema.nodes) {\n var type = this.parser.schema.nodes[name];\n if (type.isTextblock && type.defaultAttrs) { return type }\n }\n};\n\nParseContext.prototype.addPendingMark = function addPendingMark (mark) {\n this.top.pendingMarks = mark.addToSet(this.top.pendingMarks);\n};\n\nParseContext.prototype.removePendingMark = function removePendingMark (mark, upto) {\n for (var depth = this.open; depth >= 0; depth--) {\n var level = this.nodes[depth];\n var found = level.pendingMarks.lastIndexOf(mark);\n if (found > -1) { level.pendingMarks = mark.removeFromSet(level.pendingMarks); }\n else { level.activeMarks = mark.removeFromSet(level.activeMarks); }\n if (level == upto) { break }\n }\n};\n\nObject.defineProperties( ParseContext.prototype, prototypeAccessors$6 );\n\n// Kludge to work around directly nested list nodes produced by some\n// tools and allowed by browsers to mean that the nested list is\n// actually part of the list item above it.\nfunction normalizeList(dom) {\n for (var child = dom.firstChild, prevItem = null; child; child = child.nextSibling) {\n var name = child.nodeType == 1 ? child.nodeName.toLowerCase() : null;\n if (name && listTags.hasOwnProperty(name) && prevItem) {\n prevItem.appendChild(child);\n child = prevItem;\n } else if (name == \"li\") {\n prevItem = child;\n } else if (name) {\n prevItem = null;\n }\n }\n}\n\n// Apply a CSS selector.\nfunction matches(dom, selector) {\n return (dom.matches || dom.msMatchesSelector || dom.webkitMatchesSelector || dom.mozMatchesSelector).call(dom, selector)\n}\n\n// : (string) → [string]\n// Tokenize a style attribute into property/value pairs.\nfunction parseStyles(style) {\n var re = /\\s*([\\w-]+)\\s*:\\s*([^;]+)/g, m, result = [];\n while (m = re.exec(style)) { result.push(m[1], m[2].trim()); }\n return result\n}\n\nfunction copy(obj) {\n var copy = {};\n for (var prop in obj) { copy[prop] = obj[prop]; }\n return copy\n}\n\n// Used when finding a mark at the top level of a fragment parse.\n// Checks whether it would be reasonable to apply a given mark type to\n// a given node, by looking at the way the mark occurs in the schema.\nfunction markMayApply(markType, nodeType) {\n var nodes = nodeType.schema.nodes;\n var loop = function ( name ) {\n var parent = nodes[name];\n if (!parent.allowsMarkType(markType)) { return }\n var seen = [], scan = function (match) {\n seen.push(match);\n for (var i = 0; i < match.edgeCount; i++) {\n var ref = match.edge(i);\n var type = ref.type;\n var next = ref.next;\n if (type == nodeType) { return true }\n if (seen.indexOf(next) < 0 && scan(next)) { return true }\n }\n };\n if (scan(parent.contentMatch)) { return { v: true } }\n };\n\n for (var name in nodes) {\n var returned = loop( name );\n\n if ( returned ) return returned.v;\n }\n}\n\n// DOMOutputSpec:: interface\n// A description of a DOM structure. Can be either a string, which is\n// interpreted as a text node, a DOM node, which is interpreted as\n// itself, or an array.\n//\n// An array describes a DOM element. The first value in the array\n// should be a string—the name of the DOM element, optionally prefixed\n// by a namespace URL and a space. If the second element is plain\n// object, it is interpreted as a set of attributes for the element.\n// Any elements after that (including the 2nd if it's not an attribute\n// object) are interpreted as children of the DOM elements, and must\n// either be valid `DOMOutputSpec` values, or the number zero.\n//\n// The number zero (pronounced “hole”) is used to indicate the place\n// where a node's child nodes should be inserted. If it occurs in an\n// output spec, it should be the only child element in its parent\n// node.\n\n// ::- A DOM serializer knows how to convert ProseMirror nodes and\n// marks of various types to DOM nodes.\nvar DOMSerializer = function DOMSerializer(nodes, marks) {\n // :: Object<(node: Node) → DOMOutputSpec>\n // The node serialization functions.\n this.nodes = nodes || {};\n // :: Object\n // The mark serialization functions.\n this.marks = marks || {};\n};\n\n// :: (Fragment, ?Object) → dom.DocumentFragment\n// Serialize the content of this fragment to a DOM fragment. When\n// not in the browser, the `document` option, containing a DOM\n// document, should be passed so that the serializer can create\n// nodes.\nDOMSerializer.prototype.serializeFragment = function serializeFragment (fragment, options, target) {\n var this$1 = this;\n if ( options === void 0 ) options = {};\n\n if (!target) { target = doc(options).createDocumentFragment(); }\n\n var top = target, active = null;\n fragment.forEach(function (node) {\n if (active || node.marks.length) {\n if (!active) { active = []; }\n var keep = 0, rendered = 0;\n while (keep < active.length && rendered < node.marks.length) {\n var next = node.marks[rendered];\n if (!this$1.marks[next.type.name]) { rendered++; continue }\n if (!next.eq(active[keep]) || next.type.spec.spanning === false) { break }\n keep += 2; rendered++;\n }\n while (keep < active.length) {\n top = active.pop();\n active.pop();\n }\n while (rendered < node.marks.length) {\n var add = node.marks[rendered++];\n var markDOM = this$1.serializeMark(add, node.isInline, options);\n if (markDOM) {\n active.push(add, top);\n top.appendChild(markDOM.dom);\n top = markDOM.contentDOM || markDOM.dom;\n }\n }\n }\n top.appendChild(this$1.serializeNode(node, options));\n });\n\n return target\n};\n\n// :: (Node, ?Object) → dom.Node\n// Serialize this node to a DOM node. This can be useful when you\n// need to serialize a part of a document, as opposed to the whole\n// document. To serialize a whole document, use\n// [`serializeFragment`](#model.DOMSerializer.serializeFragment) on\n// its [content](#model.Node.content).\nDOMSerializer.prototype.serializeNode = function serializeNode (node, options) {\n if ( options === void 0 ) options = {};\n\n var ref =\n DOMSerializer.renderSpec(doc(options), this.nodes[node.type.name](node));\n var dom = ref.dom;\n var contentDOM = ref.contentDOM;\n if (contentDOM) {\n if (node.isLeaf)\n { throw new RangeError(\"Content hole not allowed in a leaf node spec\") }\n if (options.onContent)\n { options.onContent(node, contentDOM, options); }\n else\n { this.serializeFragment(node.content, options, contentDOM); }\n }\n return dom\n};\n\nDOMSerializer.prototype.serializeNodeAndMarks = function serializeNodeAndMarks (node, options) {\n if ( options === void 0 ) options = {};\n\n var dom = this.serializeNode(node, options);\n for (var i = node.marks.length - 1; i >= 0; i--) {\n var wrap = this.serializeMark(node.marks[i], node.isInline, options);\n if (wrap) {\n(wrap.contentDOM || wrap.dom).appendChild(dom);\n dom = wrap.dom;\n }\n }\n return dom\n};\n\nDOMSerializer.prototype.serializeMark = function serializeMark (mark, inline, options) {\n if ( options === void 0 ) options = {};\n\n var toDOM = this.marks[mark.type.name];\n return toDOM && DOMSerializer.renderSpec(doc(options), toDOM(mark, inline))\n};\n\n// :: (dom.Document, DOMOutputSpec) → {dom: dom.Node, contentDOM: ?dom.Node}\n// Render an [output spec](#model.DOMOutputSpec) to a DOM node. If\n// the spec has a hole (zero) in it, `contentDOM` will point at the\n// node with the hole.\nDOMSerializer.renderSpec = function renderSpec (doc, structure, xmlNS) {\n if ( xmlNS === void 0 ) xmlNS = null;\n\n if (typeof structure == \"string\")\n { return {dom: doc.createTextNode(structure)} }\n if (structure.nodeType != null)\n { return {dom: structure} }\n var tagName = structure[0], space = tagName.indexOf(\" \");\n if (space > 0) {\n xmlNS = tagName.slice(0, space);\n tagName = tagName.slice(space + 1);\n }\n var contentDOM = null, dom = xmlNS ? doc.createElementNS(xmlNS, tagName) : doc.createElement(tagName);\n var attrs = structure[1], start = 1;\n if (attrs && typeof attrs == \"object\" && attrs.nodeType == null && !Array.isArray(attrs)) {\n start = 2;\n for (var name in attrs) { if (attrs[name] != null) {\n var space$1 = name.indexOf(\" \");\n if (space$1 > 0) { dom.setAttributeNS(name.slice(0, space$1), name.slice(space$1 + 1), attrs[name]); }\n else { dom.setAttribute(name, attrs[name]); }\n } }\n }\n for (var i = start; i < structure.length; i++) {\n var child = structure[i];\n if (child === 0) {\n if (i < structure.length - 1 || i > start)\n { throw new RangeError(\"Content hole must be the only child of its parent node\") }\n return {dom: dom, contentDOM: dom}\n } else {\n var ref = DOMSerializer.renderSpec(doc, child, xmlNS);\n var inner = ref.dom;\n var innerContent = ref.contentDOM;\n dom.appendChild(inner);\n if (innerContent) {\n if (contentDOM) { throw new RangeError(\"Multiple content holes\") }\n contentDOM = innerContent;\n }\n }\n }\n return {dom: dom, contentDOM: contentDOM}\n};\n\n// :: (Schema) → DOMSerializer\n// Build a serializer using the [`toDOM`](#model.NodeSpec.toDOM)\n// properties in a schema's node and mark specs.\nDOMSerializer.fromSchema = function fromSchema (schema) {\n return schema.cached.domSerializer ||\n (schema.cached.domSerializer = new DOMSerializer(this.nodesFromSchema(schema), this.marksFromSchema(schema)))\n};\n\n// : (Schema) → Object<(node: Node) → DOMOutputSpec>\n// Gather the serializers in a schema's node specs into an object.\n// This can be useful as a base to build a custom serializer from.\nDOMSerializer.nodesFromSchema = function nodesFromSchema (schema) {\n var result = gatherToDOM(schema.nodes);\n if (!result.text) { result.text = function (node) { return node.text; }; }\n return result\n};\n\n// : (Schema) → Object<(mark: Mark) → DOMOutputSpec>\n// Gather the serializers in a schema's mark specs into an object.\nDOMSerializer.marksFromSchema = function marksFromSchema (schema) {\n return gatherToDOM(schema.marks)\n};\n\nfunction gatherToDOM(obj) {\n var result = {};\n for (var name in obj) {\n var toDOM = obj[name].spec.toDOM;\n if (toDOM) { result[name] = toDOM; }\n }\n return result\n}\n\nfunction doc(options) {\n // declare global: window\n return options.document || window.document\n}\n\n\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/prosemirror-model/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/prosemirror-schema-list/dist/index.es.js": +/*!***************************************************************!*\ + !*** ./node_modules/prosemirror-schema-list/dist/index.es.js ***! + \***************************************************************/ +/*! exports provided: addListNodes, bulletList, liftListItem, listItem, orderedList, sinkListItem, splitListItem, wrapInList */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addListNodes\", function() { return addListNodes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bulletList\", function() { return bulletList; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"liftListItem\", function() { return liftListItem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"listItem\", function() { return listItem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"orderedList\", function() { return orderedList; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sinkListItem\", function() { return sinkListItem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"splitListItem\", function() { return splitListItem; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"wrapInList\", function() { return wrapInList; });\n/* harmony import */ var prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prosemirror-transform */ \"./node_modules/prosemirror-transform/dist/index.es.js\");\n/* harmony import */ var prosemirror_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prosemirror-model */ \"./node_modules/prosemirror-model/dist/index.es.js\");\n\n\n\nvar olDOM = [\"ol\", 0], ulDOM = [\"ul\", 0], liDOM = [\"li\", 0];\n\n// :: NodeSpec\n// An ordered list [node spec](#model.NodeSpec). Has a single\n// attribute, `order`, which determines the number at which the list\n// starts counting, and defaults to 1. Represented as an `
    `\n// element.\nvar orderedList = {\n attrs: {order: {default: 1}},\n parseDOM: [{tag: \"ol\", getAttrs: function getAttrs(dom) {\n return {order: dom.hasAttribute(\"start\") ? +dom.getAttribute(\"start\") : 1}\n }}],\n toDOM: function toDOM(node) {\n return node.attrs.order == 1 ? olDOM : [\"ol\", {start: node.attrs.order}, 0]\n }\n};\n\n// :: NodeSpec\n// A bullet list node spec, represented in the DOM as `
      `.\nvar bulletList = {\n parseDOM: [{tag: \"ul\"}],\n toDOM: function toDOM() { return ulDOM }\n};\n\n// :: NodeSpec\n// A list item (`
    • `) spec.\nvar listItem = {\n parseDOM: [{tag: \"li\"}],\n toDOM: function toDOM() { return liDOM },\n defining: true\n};\n\nfunction add(obj, props) {\n var copy = {};\n for (var prop in obj) { copy[prop] = obj[prop]; }\n for (var prop$1 in props) { copy[prop$1] = props[prop$1]; }\n return copy\n}\n\n// :: (OrderedMap, string, ?string) → OrderedMap\n// Convenience function for adding list-related node types to a map\n// specifying the nodes for a schema. Adds\n// [`orderedList`](#schema-list.orderedList) as `\"ordered_list\"`,\n// [`bulletList`](#schema-list.bulletList) as `\"bullet_list\"`, and\n// [`listItem`](#schema-list.listItem) as `\"list_item\"`.\n//\n// `itemContent` determines the content expression for the list items.\n// If you want the commands defined in this module to apply to your\n// list structure, it should have a shape like `\"paragraph block*\"` or\n// `\"paragraph (ordered_list | bullet_list)*\"`. `listGroup` can be\n// given to assign a group name to the list node types, for example\n// `\"block\"`.\nfunction addListNodes(nodes, itemContent, listGroup) {\n return nodes.append({\n ordered_list: add(orderedList, {content: \"list_item+\", group: listGroup}),\n bullet_list: add(bulletList, {content: \"list_item+\", group: listGroup}),\n list_item: add(listItem, {content: itemContent})\n })\n}\n\n// :: (NodeType, ?Object) → (state: EditorState, dispatch: ?(tr: Transaction)) → bool\n// Returns a command function that wraps the selection in a list with\n// the given type an attributes. If `dispatch` is null, only return a\n// value to indicate whether this is possible, but don't actually\n// perform the change.\nfunction wrapInList(listType, attrs) {\n return function(state, dispatch) {\n var ref = state.selection;\n var $from = ref.$from;\n var $to = ref.$to;\n var range = $from.blockRange($to), doJoin = false, outerRange = range;\n if (!range) { return false }\n // This is at the top of an existing list item\n if (range.depth >= 2 && $from.node(range.depth - 1).type.compatibleContent(listType) && range.startIndex == 0) {\n // Don't do anything if this is the top of the list\n if ($from.index(range.depth - 1) == 0) { return false }\n var $insert = state.doc.resolve(range.start - 2);\n outerRange = new prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"NodeRange\"]($insert, $insert, range.depth);\n if (range.endIndex < range.parent.childCount)\n { range = new prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"NodeRange\"]($from, state.doc.resolve($to.end(range.depth)), range.depth); }\n doJoin = true;\n }\n var wrap = Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"findWrapping\"])(outerRange, listType, attrs, range);\n if (!wrap) { return false }\n if (dispatch) { dispatch(doWrapInList(state.tr, range, wrap, doJoin, listType).scrollIntoView()); }\n return true\n }\n}\n\nfunction doWrapInList(tr, range, wrappers, joinBefore, listType) {\n var content = prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].empty;\n for (var i = wrappers.length - 1; i >= 0; i--)\n { content = prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(wrappers[i].type.create(wrappers[i].attrs, content)); }\n\n tr.step(new prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"ReplaceAroundStep\"](range.start - (joinBefore ? 2 : 0), range.end, range.start, range.end,\n new prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Slice\"](content, 0, 0), wrappers.length, true));\n\n var found = 0;\n for (var i$1 = 0; i$1 < wrappers.length; i$1++) { if (wrappers[i$1].type == listType) { found = i$1 + 1; } }\n var splitDepth = wrappers.length - found;\n\n var splitPos = range.start + wrappers.length - (joinBefore ? 2 : 0), parent = range.parent;\n for (var i$2 = range.startIndex, e = range.endIndex, first = true; i$2 < e; i$2++, first = false) {\n if (!first && Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"canSplit\"])(tr.doc, splitPos, splitDepth)) {\n tr.split(splitPos, splitDepth);\n splitPos += 2 * splitDepth;\n }\n splitPos += parent.child(i$2).nodeSize;\n }\n return tr\n}\n\n// :: (NodeType) → (state: EditorState, dispatch: ?(tr: Transaction)) → bool\n// Build a command that splits a non-empty textblock at the top level\n// of a list item by also splitting that list item.\nfunction splitListItem(itemType) {\n return function(state, dispatch) {\n var ref = state.selection;\n var $from = ref.$from;\n var $to = ref.$to;\n var node = ref.node;\n if ((node && node.isBlock) || $from.depth < 2 || !$from.sameParent($to)) { return false }\n var grandParent = $from.node(-1);\n if (grandParent.type != itemType) { return false }\n if ($from.parent.content.size == 0) {\n // In an empty block. If this is a nested list, the wrapping\n // list item should be split. Otherwise, bail out and let next\n // command handle lifting.\n if ($from.depth == 2 || $from.node(-3).type != itemType ||\n $from.index(-2) != $from.node(-2).childCount - 1) { return false }\n if (dispatch) {\n var wrap = prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].empty, keepItem = $from.index(-1) > 0;\n // Build a fragment containing empty versions of the structure\n // from the outer list item to the parent node of the cursor\n for (var d = $from.depth - (keepItem ? 1 : 2); d >= $from.depth - 3; d--)\n { wrap = prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from($from.node(d).copy(wrap)); }\n // Add a second list item with an empty default start node\n wrap = wrap.append(prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(itemType.createAndFill()));\n var tr$1 = state.tr.replace($from.before(keepItem ? null : -1), $from.after(-3), new prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Slice\"](wrap, keepItem ? 3 : 2, 2));\n tr$1.setSelection(state.selection.constructor.near(tr$1.doc.resolve($from.pos + (keepItem ? 3 : 2))));\n dispatch(tr$1.scrollIntoView());\n }\n return true\n }\n var nextType = $to.pos == $from.end() ? grandParent.contentMatchAt(0).defaultType : null;\n var tr = state.tr.delete($from.pos, $to.pos);\n var types = nextType && [null, {type: nextType}];\n if (!Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"canSplit\"])(tr.doc, $from.pos, 2, types)) { return false }\n if (dispatch) { dispatch(tr.split($from.pos, 2, types).scrollIntoView()); }\n return true\n }\n}\n\n// :: (NodeType) → (state: EditorState, dispatch: ?(tr: Transaction)) → bool\n// Create a command to lift the list item around the selection up into\n// a wrapping list.\nfunction liftListItem(itemType) {\n return function(state, dispatch) {\n var ref = state.selection;\n var $from = ref.$from;\n var $to = ref.$to;\n var range = $from.blockRange($to, function (node) { return node.childCount && node.firstChild.type == itemType; });\n if (!range) { return false }\n if (!dispatch) { return true }\n if ($from.node(range.depth - 1).type == itemType) // Inside a parent list\n { return liftToOuterList(state, dispatch, itemType, range) }\n else // Outer list node\n { return liftOutOfList(state, dispatch, range) }\n }\n}\n\nfunction liftToOuterList(state, dispatch, itemType, range) {\n var tr = state.tr, end = range.end, endOfList = range.$to.end(range.depth);\n if (end < endOfList) {\n // There are siblings after the lifted items, which must become\n // children of the last item\n tr.step(new prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"ReplaceAroundStep\"](end - 1, endOfList, end, endOfList,\n new prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Slice\"](prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));\n range = new prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"NodeRange\"](tr.doc.resolve(range.$from.pos), tr.doc.resolve(endOfList), range.depth);\n }\n dispatch(tr.lift(range, Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"liftTarget\"])(range)).scrollIntoView());\n return true\n}\n\nfunction liftOutOfList(state, dispatch, range) {\n var tr = state.tr, list = range.parent;\n // Merge the list items into a single big item\n for (var pos = range.end, i = range.endIndex - 1, e = range.startIndex; i > e; i--) {\n pos -= list.child(i).nodeSize;\n tr.delete(pos - 1, pos + 1);\n }\n var $start = tr.doc.resolve(range.start), item = $start.nodeAfter;\n var atStart = range.startIndex == 0, atEnd = range.endIndex == list.childCount;\n var parent = $start.node(-1), indexBefore = $start.index(-1);\n if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1,\n item.content.append(atEnd ? prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].empty : prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(list))))\n { return false }\n var start = $start.pos, end = start + item.nodeSize;\n // Strip off the surrounding list. At the sides where we're not at\n // the end of the list, the existing list is closed. At sides where\n // this is the end, it is overwritten to its end.\n tr.step(new prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"ReplaceAroundStep\"](start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1,\n new prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Slice\"]((atStart ? prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].empty : prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(list.copy(prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].empty)))\n .append(atEnd ? prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].empty : prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(list.copy(prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].empty))),\n atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));\n dispatch(tr.scrollIntoView());\n return true\n}\n\n// :: (NodeType) → (state: EditorState, dispatch: ?(tr: Transaction)) → bool\n// Create a command to sink the list item around the selection down\n// into an inner list.\nfunction sinkListItem(itemType) {\n return function(state, dispatch) {\n var ref = state.selection;\n var $from = ref.$from;\n var $to = ref.$to;\n var range = $from.blockRange($to, function (node) { return node.childCount && node.firstChild.type == itemType; });\n if (!range) { return false }\n var startIndex = range.startIndex;\n if (startIndex == 0) { return false }\n var parent = range.parent, nodeBefore = parent.child(startIndex - 1);\n if (nodeBefore.type != itemType) { return false }\n\n if (dispatch) {\n var nestedBefore = nodeBefore.lastChild && nodeBefore.lastChild.type == parent.type;\n var inner = prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(nestedBefore ? itemType.create() : null);\n var slice = new prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Slice\"](prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(itemType.create(null, prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(parent.type.create(null, inner)))),\n nestedBefore ? 3 : 1, 0);\n var before = range.start, after = range.end;\n dispatch(state.tr.step(new prosemirror_transform__WEBPACK_IMPORTED_MODULE_0__[\"ReplaceAroundStep\"](before - (nestedBefore ? 3 : 1), after,\n before, after, slice, 1, true))\n .scrollIntoView());\n }\n return true\n }\n}\n\n\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/prosemirror-schema-list/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/prosemirror-state/dist/index.es.js": +/*!*********************************************************!*\ + !*** ./node_modules/prosemirror-state/dist/index.es.js ***! + \*********************************************************/ +/*! exports provided: AllSelection, EditorState, NodeSelection, Plugin, PluginKey, Selection, SelectionRange, TextSelection, Transaction */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AllSelection\", function() { return AllSelection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EditorState\", function() { return EditorState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NodeSelection\", function() { return NodeSelection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Plugin\", function() { return Plugin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PluginKey\", function() { return PluginKey; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Selection\", function() { return Selection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SelectionRange\", function() { return SelectionRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TextSelection\", function() { return TextSelection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Transaction\", function() { return Transaction; });\n/* harmony import */ var prosemirror_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prosemirror-model */ \"./node_modules/prosemirror-model/dist/index.es.js\");\n/* harmony import */ var prosemirror_transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prosemirror-transform */ \"./node_modules/prosemirror-transform/dist/index.es.js\");\n\n\n\nvar classesById = Object.create(null);\n\n// ::- Superclass for editor selections. Every selection type should\n// extend this. Should not be instantiated directly.\nvar Selection = function Selection($anchor, $head, ranges) {\n // :: [SelectionRange]\n // The ranges covered by the selection.\n this.ranges = ranges || [new SelectionRange($anchor.min($head), $anchor.max($head))];\n // :: ResolvedPos\n // The resolved anchor of the selection (the side that stays in\n // place when the selection is modified).\n this.$anchor = $anchor;\n // :: ResolvedPos\n // The resolved head of the selection (the side that moves when\n // the selection is modified).\n this.$head = $head;\n};\n\nvar prototypeAccessors = { anchor: { configurable: true },head: { configurable: true },from: { configurable: true },to: { configurable: true },$from: { configurable: true },$to: { configurable: true },empty: { configurable: true } };\n\n// :: number\n// The selection's anchor, as an unresolved position.\nprototypeAccessors.anchor.get = function () { return this.$anchor.pos };\n\n// :: number\n// The selection's head.\nprototypeAccessors.head.get = function () { return this.$head.pos };\n\n// :: number\n// The lower bound of the selection's main range.\nprototypeAccessors.from.get = function () { return this.$from.pos };\n\n// :: number\n// The upper bound of the selection's main range.\nprototypeAccessors.to.get = function () { return this.$to.pos };\n\n// :: ResolvedPos\n// The resolved lowerbound of the selection's main range.\nprototypeAccessors.$from.get = function () {\n return this.ranges[0].$from\n};\n\n// :: ResolvedPos\n// The resolved upper bound of the selection's main range.\nprototypeAccessors.$to.get = function () {\n return this.ranges[0].$to\n};\n\n// :: bool\n// Indicates whether the selection contains any content.\nprototypeAccessors.empty.get = function () {\n var ranges = this.ranges;\n for (var i = 0; i < ranges.length; i++)\n { if (ranges[i].$from.pos != ranges[i].$to.pos) { return false } }\n return true\n};\n\n// eq:: (Selection) → bool\n// Test whether the selection is the same as another selection.\n\n// map:: (doc: Node, mapping: Mappable) → Selection\n// Map this selection through a [mappable](#transform.Mappable) thing. `doc`\n// should be the new document to which we are mapping.\n\n// :: () → Slice\n// Get the content of this selection as a slice.\nSelection.prototype.content = function content () {\n return this.$from.node(0).slice(this.from, this.to, true)\n};\n\n// :: (Transaction, ?Slice)\n// Replace the selection with a slice or, if no slice is given,\n// delete the selection. Will append to the given transaction.\nSelection.prototype.replace = function replace (tr, content) {\n if ( content === void 0 ) content = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"].empty;\n\n // Put the new selection at the position after the inserted\n // content. When that ended in an inline node, search backwards,\n // to get the position after that node. If not, search forward.\n var lastNode = content.content.lastChild, lastParent = null;\n for (var i = 0; i < content.openEnd; i++) {\n lastParent = lastNode;\n lastNode = lastNode.lastChild;\n }\n\n var mapFrom = tr.steps.length, ranges = this.ranges;\n for (var i$1 = 0; i$1 < ranges.length; i$1++) {\n var ref = ranges[i$1];\n var $from = ref.$from;\n var $to = ref.$to;\n var mapping = tr.mapping.slice(mapFrom);\n tr.replaceRange(mapping.map($from.pos), mapping.map($to.pos), i$1 ? prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"].empty : content);\n if (i$1 == 0)\n { selectionToInsertionEnd(tr, mapFrom, (lastNode ? lastNode.isInline : lastParent && lastParent.isTextblock) ? -1 : 1); }\n }\n};\n\n// :: (Transaction, Node)\n// Replace the selection with the given node, appending the changes\n// to the given transaction.\nSelection.prototype.replaceWith = function replaceWith (tr, node) {\n var mapFrom = tr.steps.length, ranges = this.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var ref = ranges[i];\n var $from = ref.$from;\n var $to = ref.$to;\n var mapping = tr.mapping.slice(mapFrom);\n var from = mapping.map($from.pos), to = mapping.map($to.pos);\n if (i) {\n tr.deleteRange(from, to);\n } else {\n tr.replaceRangeWith(from, to, node);\n selectionToInsertionEnd(tr, mapFrom, node.isInline ? -1 : 1);\n }\n }\n};\n\n// toJSON:: () → Object\n// Convert the selection to a JSON representation. When implementing\n// this for a custom selection class, make sure to give the object a\n// `type` property whose value matches the ID under which you\n// [registered](#state.Selection^jsonID) your class.\n\n// :: (ResolvedPos, number, ?bool) → ?Selection\n// Find a valid cursor or leaf node selection starting at the given\n// position and searching back if `dir` is negative, and forward if\n// positive. When `textOnly` is true, only consider cursor\n// selections. Will return null when no valid selection position is\n// found.\nSelection.findFrom = function findFrom ($pos, dir, textOnly) {\n var inner = $pos.parent.inlineContent ? new TextSelection($pos)\n : findSelectionIn($pos.node(0), $pos.parent, $pos.pos, $pos.index(), dir, textOnly);\n if (inner) { return inner }\n\n for (var depth = $pos.depth - 1; depth >= 0; depth--) {\n var found = dir < 0\n ? findSelectionIn($pos.node(0), $pos.node(depth), $pos.before(depth + 1), $pos.index(depth), dir, textOnly)\n : findSelectionIn($pos.node(0), $pos.node(depth), $pos.after(depth + 1), $pos.index(depth) + 1, dir, textOnly);\n if (found) { return found }\n }\n};\n\n// :: (ResolvedPos, ?number) → Selection\n// Find a valid cursor or leaf node selection near the given\n// position. Searches forward first by default, but if `bias` is\n// negative, it will search backwards first.\nSelection.near = function near ($pos, bias) {\n if ( bias === void 0 ) bias = 1;\n\n return this.findFrom($pos, bias) || this.findFrom($pos, -bias) || new AllSelection($pos.node(0))\n};\n\n// :: (Node) → Selection\n// Find the cursor or leaf node selection closest to the start of\n// the given document. Will return an\n// [`AllSelection`](#state.AllSelection) if no valid position\n// exists.\nSelection.atStart = function atStart (doc) {\n return findSelectionIn(doc, doc, 0, 0, 1) || new AllSelection(doc)\n};\n\n// :: (Node) → Selection\n// Find the cursor or leaf node selection closest to the end of the\n// given document.\nSelection.atEnd = function atEnd (doc) {\n return findSelectionIn(doc, doc, doc.content.size, doc.childCount, -1) || new AllSelection(doc)\n};\n\n// :: (Node, Object) → Selection\n// Deserialize the JSON representation of a selection. Must be\n// implemented for custom classes (as a static class method).\nSelection.fromJSON = function fromJSON (doc, json) {\n if (!json || !json.type) { throw new RangeError(\"Invalid input for Selection.fromJSON\") }\n var cls = classesById[json.type];\n if (!cls) { throw new RangeError((\"No selection type \" + (json.type) + \" defined\")) }\n return cls.fromJSON(doc, json)\n};\n\n// :: (string, constructor)\n// To be able to deserialize selections from JSON, custom selection\n// classes must register themselves with an ID string, so that they\n// can be disambiguated. Try to pick something that's unlikely to\n// clash with classes from other modules.\nSelection.jsonID = function jsonID (id, selectionClass) {\n if (id in classesById) { throw new RangeError(\"Duplicate use of selection JSON ID \" + id) }\n classesById[id] = selectionClass;\n selectionClass.prototype.jsonID = id;\n return selectionClass\n};\n\n// :: () → SelectionBookmark\n// Get a [bookmark](#state.SelectionBookmark) for this selection,\n// which is a value that can be mapped without having access to a\n// current document, and later resolved to a real selection for a\n// given document again. (This is used mostly by the history to\n// track and restore old selections.) The default implementation of\n// this method just converts the selection to a text selection and\n// returns the bookmark for that.\nSelection.prototype.getBookmark = function getBookmark () {\n return TextSelection.between(this.$anchor, this.$head).getBookmark()\n};\n\nObject.defineProperties( Selection.prototype, prototypeAccessors );\n\n// :: bool\n// Controls whether, when a selection of this type is active in the\n// browser, the selected range should be visible to the user. Defaults\n// to `true`.\nSelection.prototype.visible = true;\n\n// SelectionBookmark:: interface\n// A lightweight, document-independent representation of a selection.\n// You can define a custom bookmark type for a custom selection class\n// to make the history handle it well.\n//\n// map:: (mapping: Mapping) → SelectionBookmark\n// Map the bookmark through a set of changes.\n//\n// resolve:: (doc: Node) → Selection\n// Resolve the bookmark to a real selection again. This may need to\n// do some error checking and may fall back to a default (usually\n// [`TextSelection.between`](#state.TextSelection^between)) if\n// mapping made the bookmark invalid.\n\n// ::- Represents a selected range in a document.\nvar SelectionRange = function SelectionRange($from, $to) {\n // :: ResolvedPos\n // The lower bound of the range.\n this.$from = $from;\n // :: ResolvedPos\n // The upper bound of the range.\n this.$to = $to;\n};\n\n// ::- A text selection represents a classical editor selection, with\n// a head (the moving side) and anchor (immobile side), both of which\n// point into textblock nodes. It can be empty (a regular cursor\n// position).\nvar TextSelection = /*@__PURE__*/(function (Selection) {\n function TextSelection($anchor, $head) {\n if ( $head === void 0 ) $head = $anchor;\n\n Selection.call(this, $anchor, $head);\n }\n\n if ( Selection ) TextSelection.__proto__ = Selection;\n TextSelection.prototype = Object.create( Selection && Selection.prototype );\n TextSelection.prototype.constructor = TextSelection;\n\n var prototypeAccessors$1 = { $cursor: { configurable: true } };\n\n // :: ?ResolvedPos\n // Returns a resolved position if this is a cursor selection (an\n // empty text selection), and null otherwise.\n prototypeAccessors$1.$cursor.get = function () { return this.$anchor.pos == this.$head.pos ? this.$head : null };\n\n TextSelection.prototype.map = function map (doc, mapping) {\n var $head = doc.resolve(mapping.map(this.head));\n if (!$head.parent.inlineContent) { return Selection.near($head) }\n var $anchor = doc.resolve(mapping.map(this.anchor));\n return new TextSelection($anchor.parent.inlineContent ? $anchor : $head, $head)\n };\n\n TextSelection.prototype.replace = function replace (tr, content) {\n if ( content === void 0 ) content = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"].empty;\n\n Selection.prototype.replace.call(this, tr, content);\n if (content == prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"].empty) {\n var marks = this.$from.marksAcross(this.$to);\n if (marks) { tr.ensureMarks(marks); }\n }\n };\n\n TextSelection.prototype.eq = function eq (other) {\n return other instanceof TextSelection && other.anchor == this.anchor && other.head == this.head\n };\n\n TextSelection.prototype.getBookmark = function getBookmark () {\n return new TextBookmark(this.anchor, this.head)\n };\n\n TextSelection.prototype.toJSON = function toJSON () {\n return {type: \"text\", anchor: this.anchor, head: this.head}\n };\n\n TextSelection.fromJSON = function fromJSON (doc, json) {\n if (typeof json.anchor != \"number\" || typeof json.head != \"number\")\n { throw new RangeError(\"Invalid input for TextSelection.fromJSON\") }\n return new TextSelection(doc.resolve(json.anchor), doc.resolve(json.head))\n };\n\n // :: (Node, number, ?number) → TextSelection\n // Create a text selection from non-resolved positions.\n TextSelection.create = function create (doc, anchor, head) {\n if ( head === void 0 ) head = anchor;\n\n var $anchor = doc.resolve(anchor);\n return new this($anchor, head == anchor ? $anchor : doc.resolve(head))\n };\n\n // :: (ResolvedPos, ResolvedPos, ?number) → Selection\n // Return a text selection that spans the given positions or, if\n // they aren't text positions, find a text selection near them.\n // `bias` determines whether the method searches forward (default)\n // or backwards (negative number) first. Will fall back to calling\n // [`Selection.near`](#state.Selection^near) when the document\n // doesn't contain a valid text position.\n TextSelection.between = function between ($anchor, $head, bias) {\n var dPos = $anchor.pos - $head.pos;\n if (!bias || dPos) { bias = dPos >= 0 ? 1 : -1; }\n if (!$head.parent.inlineContent) {\n var found = Selection.findFrom($head, bias, true) || Selection.findFrom($head, -bias, true);\n if (found) { $head = found.$head; }\n else { return Selection.near($head, bias) }\n }\n if (!$anchor.parent.inlineContent) {\n if (dPos == 0) {\n $anchor = $head;\n } else {\n $anchor = (Selection.findFrom($anchor, -bias, true) || Selection.findFrom($anchor, bias, true)).$anchor;\n if (($anchor.pos < $head.pos) != (dPos < 0)) { $anchor = $head; }\n }\n }\n return new TextSelection($anchor, $head)\n };\n\n Object.defineProperties( TextSelection.prototype, prototypeAccessors$1 );\n\n return TextSelection;\n}(Selection));\n\nSelection.jsonID(\"text\", TextSelection);\n\nvar TextBookmark = function TextBookmark(anchor, head) {\n this.anchor = anchor;\n this.head = head;\n};\nTextBookmark.prototype.map = function map (mapping) {\n return new TextBookmark(mapping.map(this.anchor), mapping.map(this.head))\n};\nTextBookmark.prototype.resolve = function resolve (doc) {\n return TextSelection.between(doc.resolve(this.anchor), doc.resolve(this.head))\n};\n\n// ::- A node selection is a selection that points at a single node.\n// All nodes marked [selectable](#model.NodeSpec.selectable) can be\n// the target of a node selection. In such a selection, `from` and\n// `to` point directly before and after the selected node, `anchor`\n// equals `from`, and `head` equals `to`..\nvar NodeSelection = /*@__PURE__*/(function (Selection) {\n function NodeSelection($pos) {\n var node = $pos.nodeAfter;\n var $end = $pos.node(0).resolve($pos.pos + node.nodeSize);\n Selection.call(this, $pos, $end);\n // :: Node The selected node.\n this.node = node;\n }\n\n if ( Selection ) NodeSelection.__proto__ = Selection;\n NodeSelection.prototype = Object.create( Selection && Selection.prototype );\n NodeSelection.prototype.constructor = NodeSelection;\n\n NodeSelection.prototype.map = function map (doc, mapping) {\n var ref = mapping.mapResult(this.anchor);\n var deleted = ref.deleted;\n var pos = ref.pos;\n var $pos = doc.resolve(pos);\n if (deleted) { return Selection.near($pos) }\n return new NodeSelection($pos)\n };\n\n NodeSelection.prototype.content = function content () {\n return new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].from(this.node), 0, 0)\n };\n\n NodeSelection.prototype.eq = function eq (other) {\n return other instanceof NodeSelection && other.anchor == this.anchor\n };\n\n NodeSelection.prototype.toJSON = function toJSON () {\n return {type: \"node\", anchor: this.anchor}\n };\n\n NodeSelection.prototype.getBookmark = function getBookmark () { return new NodeBookmark(this.anchor) };\n\n NodeSelection.fromJSON = function fromJSON (doc, json) {\n if (typeof json.anchor != \"number\")\n { throw new RangeError(\"Invalid input for NodeSelection.fromJSON\") }\n return new NodeSelection(doc.resolve(json.anchor))\n };\n\n // :: (Node, number) → NodeSelection\n // Create a node selection from non-resolved positions.\n NodeSelection.create = function create (doc, from) {\n return new this(doc.resolve(from))\n };\n\n // :: (Node) → bool\n // Determines whether the given node may be selected as a node\n // selection.\n NodeSelection.isSelectable = function isSelectable (node) {\n return !node.isText && node.type.spec.selectable !== false\n };\n\n return NodeSelection;\n}(Selection));\n\nNodeSelection.prototype.visible = false;\n\nSelection.jsonID(\"node\", NodeSelection);\n\nvar NodeBookmark = function NodeBookmark(anchor) {\n this.anchor = anchor;\n};\nNodeBookmark.prototype.map = function map (mapping) {\n var ref = mapping.mapResult(this.anchor);\n var deleted = ref.deleted;\n var pos = ref.pos;\n return deleted ? new TextBookmark(pos, pos) : new NodeBookmark(pos)\n};\nNodeBookmark.prototype.resolve = function resolve (doc) {\n var $pos = doc.resolve(this.anchor), node = $pos.nodeAfter;\n if (node && NodeSelection.isSelectable(node)) { return new NodeSelection($pos) }\n return Selection.near($pos)\n};\n\n// ::- A selection type that represents selecting the whole document\n// (which can not necessarily be expressed with a text selection, when\n// there are for example leaf block nodes at the start or end of the\n// document).\nvar AllSelection = /*@__PURE__*/(function (Selection) {\n function AllSelection(doc) {\n Selection.call(this, doc.resolve(0), doc.resolve(doc.content.size));\n }\n\n if ( Selection ) AllSelection.__proto__ = Selection;\n AllSelection.prototype = Object.create( Selection && Selection.prototype );\n AllSelection.prototype.constructor = AllSelection;\n\n AllSelection.prototype.toJSON = function toJSON () { return {type: \"all\"} };\n\n AllSelection.fromJSON = function fromJSON (doc) { return new AllSelection(doc) };\n\n AllSelection.prototype.map = function map (doc) { return new AllSelection(doc) };\n\n AllSelection.prototype.eq = function eq (other) { return other instanceof AllSelection };\n\n AllSelection.prototype.getBookmark = function getBookmark () { return AllBookmark };\n\n return AllSelection;\n}(Selection));\n\nSelection.jsonID(\"all\", AllSelection);\n\nvar AllBookmark = {\n map: function map() { return this },\n resolve: function resolve(doc) { return new AllSelection(doc) }\n};\n\n// FIXME we'll need some awareness of text direction when scanning for selections\n\n// Try to find a selection inside the given node. `pos` points at the\n// position where the search starts. When `text` is true, only return\n// text selections.\nfunction findSelectionIn(doc, node, pos, index, dir, text) {\n if (node.inlineContent) { return TextSelection.create(doc, pos) }\n for (var i = index - (dir > 0 ? 0 : 1); dir > 0 ? i < node.childCount : i >= 0; i += dir) {\n var child = node.child(i);\n if (!child.isAtom) {\n var inner = findSelectionIn(doc, child, pos + dir, dir < 0 ? child.childCount : 0, dir, text);\n if (inner) { return inner }\n } else if (!text && NodeSelection.isSelectable(child)) {\n return NodeSelection.create(doc, pos - (dir < 0 ? child.nodeSize : 0))\n }\n pos += child.nodeSize * dir;\n }\n}\n\nfunction selectionToInsertionEnd(tr, startLen, bias) {\n var last = tr.steps.length - 1;\n if (last < startLen) { return }\n var step = tr.steps[last];\n if (!(step instanceof prosemirror_transform__WEBPACK_IMPORTED_MODULE_1__[\"ReplaceStep\"] || step instanceof prosemirror_transform__WEBPACK_IMPORTED_MODULE_1__[\"ReplaceAroundStep\"])) { return }\n var map = tr.mapping.maps[last], end;\n map.forEach(function (_from, _to, _newFrom, newTo) { if (end == null) { end = newTo; } });\n tr.setSelection(Selection.near(tr.doc.resolve(end), bias));\n}\n\nvar UPDATED_SEL = 1, UPDATED_MARKS = 2, UPDATED_SCROLL = 4;\n\n// ::- An editor state transaction, which can be applied to a state to\n// create an updated state. Use\n// [`EditorState.tr`](#state.EditorState.tr) to create an instance.\n//\n// Transactions track changes to the document (they are a subclass of\n// [`Transform`](#transform.Transform)), but also other state changes,\n// like selection updates and adjustments of the set of [stored\n// marks](#state.EditorState.storedMarks). In addition, you can store\n// metadata properties in a transaction, which are extra pieces of\n// information that client code or plugins can use to describe what a\n// transacion represents, so that they can update their [own\n// state](#state.StateField) accordingly.\n//\n// The [editor view](#view.EditorView) uses a few metadata properties:\n// it will attach a property `\"pointer\"` with the value `true` to\n// selection transactions directly caused by mouse or touch input, and\n// a `\"uiEvent\"` property of that may be `\"paste\"`, `\"cut\"`, or `\"drop\"`.\nvar Transaction = /*@__PURE__*/(function (Transform) {\n function Transaction(state) {\n Transform.call(this, state.doc);\n // :: number\n // The timestamp associated with this transaction, in the same\n // format as `Date.now()`.\n this.time = Date.now();\n this.curSelection = state.selection;\n // The step count for which the current selection is valid.\n this.curSelectionFor = 0;\n // :: ?[Mark]\n // The stored marks set by this transaction, if any.\n this.storedMarks = state.storedMarks;\n // Bitfield to track which aspects of the state were updated by\n // this transaction.\n this.updated = 0;\n // Object used to store metadata properties for the transaction.\n this.meta = Object.create(null);\n }\n\n if ( Transform ) Transaction.__proto__ = Transform;\n Transaction.prototype = Object.create( Transform && Transform.prototype );\n Transaction.prototype.constructor = Transaction;\n\n var prototypeAccessors = { selection: { configurable: true },selectionSet: { configurable: true },storedMarksSet: { configurable: true },isGeneric: { configurable: true },scrolledIntoView: { configurable: true } };\n\n // :: Selection\n // The transaction's current selection. This defaults to the editor\n // selection [mapped](#state.Selection.map) through the steps in the\n // transaction, but can be overwritten with\n // [`setSelection`](#state.Transaction.setSelection).\n prototypeAccessors.selection.get = function () {\n if (this.curSelectionFor < this.steps.length) {\n this.curSelection = this.curSelection.map(this.doc, this.mapping.slice(this.curSelectionFor));\n this.curSelectionFor = this.steps.length;\n }\n return this.curSelection\n };\n\n // :: (Selection) → Transaction\n // Update the transaction's current selection. Will determine the\n // selection that the editor gets when the transaction is applied.\n Transaction.prototype.setSelection = function setSelection (selection) {\n if (selection.$from.doc != this.doc)\n { throw new RangeError(\"Selection passed to setSelection must point at the current document\") }\n this.curSelection = selection;\n this.curSelectionFor = this.steps.length;\n this.updated = (this.updated | UPDATED_SEL) & ~UPDATED_MARKS;\n this.storedMarks = null;\n return this\n };\n\n // :: bool\n // Whether the selection was explicitly updated by this transaction.\n prototypeAccessors.selectionSet.get = function () {\n return (this.updated & UPDATED_SEL) > 0\n };\n\n // :: (?[Mark]) → Transaction\n // Set the current stored marks.\n Transaction.prototype.setStoredMarks = function setStoredMarks (marks) {\n this.storedMarks = marks;\n this.updated |= UPDATED_MARKS;\n return this\n };\n\n // :: ([Mark]) → Transaction\n // Make sure the current stored marks or, if that is null, the marks\n // at the selection, match the given set of marks. Does nothing if\n // this is already the case.\n Transaction.prototype.ensureMarks = function ensureMarks (marks) {\n if (!prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Mark\"].sameSet(this.storedMarks || this.selection.$from.marks(), marks))\n { this.setStoredMarks(marks); }\n return this\n };\n\n // :: (Mark) → Transaction\n // Add a mark to the set of stored marks.\n Transaction.prototype.addStoredMark = function addStoredMark (mark) {\n return this.ensureMarks(mark.addToSet(this.storedMarks || this.selection.$head.marks()))\n };\n\n // :: (union) → Transaction\n // Remove a mark or mark type from the set of stored marks.\n Transaction.prototype.removeStoredMark = function removeStoredMark (mark) {\n return this.ensureMarks(mark.removeFromSet(this.storedMarks || this.selection.$head.marks()))\n };\n\n // :: bool\n // Whether the stored marks were explicitly set for this transaction.\n prototypeAccessors.storedMarksSet.get = function () {\n return (this.updated & UPDATED_MARKS) > 0\n };\n\n Transaction.prototype.addStep = function addStep (step, doc) {\n Transform.prototype.addStep.call(this, step, doc);\n this.updated = this.updated & ~UPDATED_MARKS;\n this.storedMarks = null;\n };\n\n // :: (number) → Transaction\n // Update the timestamp for the transaction.\n Transaction.prototype.setTime = function setTime (time) {\n this.time = time;\n return this\n };\n\n // :: (Slice) → Transaction\n // Replace the current selection with the given slice.\n Transaction.prototype.replaceSelection = function replaceSelection (slice) {\n this.selection.replace(this, slice);\n return this\n };\n\n // :: (Node, ?bool) → Transaction\n // Replace the selection with the given node. When `inheritMarks` is\n // true and the content is inline, it inherits the marks from the\n // place where it is inserted.\n Transaction.prototype.replaceSelectionWith = function replaceSelectionWith (node, inheritMarks) {\n var selection = this.selection;\n if (inheritMarks !== false)\n { node = node.mark(this.storedMarks || (selection.empty ? selection.$from.marks() : (selection.$from.marksAcross(selection.$to) || prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Mark\"].none))); }\n selection.replaceWith(this, node);\n return this\n };\n\n // :: () → Transaction\n // Delete the selection.\n Transaction.prototype.deleteSelection = function deleteSelection () {\n this.selection.replace(this);\n return this\n };\n\n // :: (string, from: ?number, to: ?number) → Transaction\n // Replace the given range, or the selection if no range is given,\n // with a text node containing the given string.\n Transaction.prototype.insertText = function insertText (text, from, to) {\n if ( to === void 0 ) to = from;\n\n var schema = this.doc.type.schema;\n if (from == null) {\n if (!text) { return this.deleteSelection() }\n return this.replaceSelectionWith(schema.text(text), true)\n } else {\n if (!text) { return this.deleteRange(from, to) }\n var marks = this.storedMarks;\n if (!marks) {\n var $from = this.doc.resolve(from);\n marks = to == from ? $from.marks() : $from.marksAcross(this.doc.resolve(to));\n }\n this.replaceRangeWith(from, to, schema.text(text, marks));\n if (!this.selection.empty) { this.setSelection(Selection.near(this.selection.$to)); }\n return this\n }\n };\n\n // :: (union, any) → Transaction\n // Store a metadata property in this transaction, keyed either by\n // name or by plugin.\n Transaction.prototype.setMeta = function setMeta (key, value) {\n this.meta[typeof key == \"string\" ? key : key.key] = value;\n return this\n };\n\n // :: (union) → any\n // Retrieve a metadata property for a given name or plugin.\n Transaction.prototype.getMeta = function getMeta (key) {\n return this.meta[typeof key == \"string\" ? key : key.key]\n };\n\n // :: bool\n // Returns true if this transaction doesn't contain any metadata,\n // and can thus safely be extended.\n prototypeAccessors.isGeneric.get = function () {\n for (var _ in this.meta) { return false }\n return true\n };\n\n // :: () → Transaction\n // Indicate that the editor should scroll the selection into view\n // when updated to the state produced by this transaction.\n Transaction.prototype.scrollIntoView = function scrollIntoView () {\n this.updated |= UPDATED_SCROLL;\n return this\n };\n\n prototypeAccessors.scrolledIntoView.get = function () {\n return (this.updated & UPDATED_SCROLL) > 0\n };\n\n Object.defineProperties( Transaction.prototype, prototypeAccessors );\n\n return Transaction;\n}(prosemirror_transform__WEBPACK_IMPORTED_MODULE_1__[\"Transform\"]));\n\nfunction bind(f, self) {\n return !self || !f ? f : f.bind(self)\n}\n\nvar FieldDesc = function FieldDesc(name, desc, self) {\n this.name = name;\n this.init = bind(desc.init, self);\n this.apply = bind(desc.apply, self);\n};\n\nvar baseFields = [\n new FieldDesc(\"doc\", {\n init: function init(config) { return config.doc || config.schema.topNodeType.createAndFill() },\n apply: function apply(tr) { return tr.doc }\n }),\n\n new FieldDesc(\"selection\", {\n init: function init(config, instance) { return config.selection || Selection.atStart(instance.doc) },\n apply: function apply(tr) { return tr.selection }\n }),\n\n new FieldDesc(\"storedMarks\", {\n init: function init(config) { return config.storedMarks || null },\n apply: function apply(tr, _marks, _old, state) { return state.selection.$cursor ? tr.storedMarks : null }\n }),\n\n new FieldDesc(\"scrollToSelection\", {\n init: function init() { return 0 },\n apply: function apply(tr, prev) { return tr.scrolledIntoView ? prev + 1 : prev }\n })\n];\n\n// Object wrapping the part of a state object that stays the same\n// across transactions. Stored in the state's `config` property.\nvar Configuration = function Configuration(schema, plugins) {\n var this$1 = this;\n\n this.schema = schema;\n this.fields = baseFields.concat();\n this.plugins = [];\n this.pluginsByKey = Object.create(null);\n if (plugins) { plugins.forEach(function (plugin) {\n if (this$1.pluginsByKey[plugin.key])\n { throw new RangeError(\"Adding different instances of a keyed plugin (\" + plugin.key + \")\") }\n this$1.plugins.push(plugin);\n this$1.pluginsByKey[plugin.key] = plugin;\n if (plugin.spec.state)\n { this$1.fields.push(new FieldDesc(plugin.key, plugin.spec.state, plugin)); }\n }); }\n};\n\n// ::- The state of a ProseMirror editor is represented by an object\n// of this type. A state is a persistent data structure—it isn't\n// updated, but rather a new state value is computed from an old one\n// using the [`apply`](#state.EditorState.apply) method.\n//\n// A state holds a number of built-in fields, and plugins can\n// [define](#state.PluginSpec.state) additional fields.\nvar EditorState = function EditorState(config) {\n this.config = config;\n};\n\nvar prototypeAccessors$1 = { schema: { configurable: true },plugins: { configurable: true },tr: { configurable: true } };\n\n// doc:: Node\n// The current document.\n\n// selection:: Selection\n// The selection.\n\n// storedMarks:: ?[Mark]\n// A set of marks to apply to the next input. Will be null when\n// no explicit marks have been set.\n\n// :: Schema\n// The schema of the state's document.\nprototypeAccessors$1.schema.get = function () {\n return this.config.schema\n};\n\n// :: [Plugin]\n// The plugins that are active in this state.\nprototypeAccessors$1.plugins.get = function () {\n return this.config.plugins\n};\n\n// :: (Transaction) → EditorState\n// Apply the given transaction to produce a new state.\nEditorState.prototype.apply = function apply (tr) {\n return this.applyTransaction(tr).state\n};\n\n// : (Transaction) → bool\nEditorState.prototype.filterTransaction = function filterTransaction (tr, ignore) {\n if ( ignore === void 0 ) ignore = -1;\n\n for (var i = 0; i < this.config.plugins.length; i++) { if (i != ignore) {\n var plugin = this.config.plugins[i];\n if (plugin.spec.filterTransaction && !plugin.spec.filterTransaction.call(plugin, tr, this))\n { return false }\n } }\n return true\n};\n\n// :: (Transaction) → {state: EditorState, transactions: [Transaction]}\n// Verbose variant of [`apply`](#state.EditorState.apply) that\n// returns the precise transactions that were applied (which might\n// be influenced by the [transaction\n// hooks](#state.PluginSpec.filterTransaction) of\n// plugins) along with the new state.\nEditorState.prototype.applyTransaction = function applyTransaction (rootTr) {\n if (!this.filterTransaction(rootTr)) { return {state: this, transactions: []} }\n\n var trs = [rootTr], newState = this.applyInner(rootTr), seen = null;\n // This loop repeatedly gives plugins a chance to respond to\n // transactions as new transactions are added, making sure to only\n // pass the transactions the plugin did not see before.\n for (;;) {\n var haveNew = false;\n for (var i = 0; i < this.config.plugins.length; i++) {\n var plugin = this.config.plugins[i];\n if (plugin.spec.appendTransaction) {\n var n = seen ? seen[i].n : 0, oldState = seen ? seen[i].state : this;\n var tr = n < trs.length &&\n plugin.spec.appendTransaction.call(plugin, n ? trs.slice(n) : trs, oldState, newState);\n if (tr && newState.filterTransaction(tr, i)) {\n tr.setMeta(\"appendedTransaction\", rootTr);\n if (!seen) {\n seen = [];\n for (var j = 0; j < this.config.plugins.length; j++)\n { seen.push(j < i ? {state: newState, n: trs.length} : {state: this, n: 0}); }\n }\n trs.push(tr);\n newState = newState.applyInner(tr);\n haveNew = true;\n }\n if (seen) { seen[i] = {state: newState, n: trs.length}; }\n }\n }\n if (!haveNew) { return {state: newState, transactions: trs} }\n }\n};\n\n// : (Transaction) → EditorState\nEditorState.prototype.applyInner = function applyInner (tr) {\n if (!tr.before.eq(this.doc)) { throw new RangeError(\"Applying a mismatched transaction\") }\n var newInstance = new EditorState(this.config), fields = this.config.fields;\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n newInstance[field.name] = field.apply(tr, this[field.name], this, newInstance);\n }\n for (var i$1 = 0; i$1 < applyListeners.length; i$1++) { applyListeners[i$1](this, tr, newInstance); }\n return newInstance\n};\n\n// :: Transaction\n// Start a [transaction](#state.Transaction) from this state.\nprototypeAccessors$1.tr.get = function () { return new Transaction(this) };\n\n// :: (Object) → EditorState\n// Create a new state.\n//\n// config::- Configuration options. Must contain `schema` or `doc` (or both).\n//\n// schema:: ?Schema\n// The schema to use.\n//\n// doc:: ?Node\n// The starting document.\n//\n// selection:: ?Selection\n// A valid selection in the document.\n//\n// storedMarks:: ?[Mark]\n// The initial set of [stored marks](#state.EditorState.storedMarks).\n//\n// plugins:: ?[Plugin]\n// The plugins that should be active in this state.\nEditorState.create = function create (config) {\n var $config = new Configuration(config.schema || config.doc.type.schema, config.plugins);\n var instance = new EditorState($config);\n for (var i = 0; i < $config.fields.length; i++)\n { instance[$config.fields[i].name] = $config.fields[i].init(config, instance); }\n return instance\n};\n\n// :: (Object) → EditorState\n// Create a new state based on this one, but with an adjusted set of\n// active plugins. State fields that exist in both sets of plugins\n// are kept unchanged. Those that no longer exist are dropped, and\n// those that are new are initialized using their\n// [`init`](#state.StateField.init) method, passing in the new\n// configuration object..\n//\n// config::- configuration options\n//\n// schema:: ?Schema\n// New schema to use.\n//\n// plugins:: ?[Plugin]\n// New set of active plugins.\nEditorState.prototype.reconfigure = function reconfigure (config) {\n var $config = new Configuration(config.schema || this.schema, config.plugins);\n var fields = $config.fields, instance = new EditorState($config);\n for (var i = 0; i < fields.length; i++) {\n var name = fields[i].name;\n instance[name] = this.hasOwnProperty(name) ? this[name] : fields[i].init(config, instance);\n }\n return instance\n};\n\n// :: (?union, string, number>) → Object\n// Serialize this state to JSON. If you want to serialize the state\n// of plugins, pass an object mapping property names to use in the\n// resulting JSON object to plugin objects. The argument may also be\n// a string or number, in which case it is ignored, to support the\n// way `JSON.stringify` calls `toString` methods.\nEditorState.prototype.toJSON = function toJSON (pluginFields) {\n var result = {doc: this.doc.toJSON(), selection: this.selection.toJSON()};\n if (this.storedMarks) { result.storedMarks = this.storedMarks.map(function (m) { return m.toJSON(); }); }\n if (pluginFields && typeof pluginFields == 'object') { for (var prop in pluginFields) {\n if (prop == \"doc\" || prop == \"selection\")\n { throw new RangeError(\"The JSON fields `doc` and `selection` are reserved\") }\n var plugin = pluginFields[prop], state = plugin.spec.state;\n if (state && state.toJSON) { result[prop] = state.toJSON.call(plugin, this[plugin.key]); }\n } }\n return result\n};\n\n// :: (Object, Object, ?Object) → EditorState\n// Deserialize a JSON representation of a state. `config` should\n// have at least a `schema` field, and should contain array of\n// plugins to initialize the state with. `pluginFields` can be used\n// to deserialize the state of plugins, by associating plugin\n// instances with the property names they use in the JSON object.\n//\n// config::- configuration options\n//\n// schema:: Schema\n// The schema to use.\n//\n// plugins:: ?[Plugin]\n// The set of active plugins.\nEditorState.fromJSON = function fromJSON (config, json, pluginFields) {\n if (!json) { throw new RangeError(\"Invalid input for EditorState.fromJSON\") }\n if (!config.schema) { throw new RangeError(\"Required config field 'schema' missing\") }\n var $config = new Configuration(config.schema, config.plugins);\n var instance = new EditorState($config);\n $config.fields.forEach(function (field) {\n if (field.name == \"doc\") {\n instance.doc = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Node\"].fromJSON(config.schema, json.doc);\n } else if (field.name == \"selection\") {\n instance.selection = Selection.fromJSON(instance.doc, json.selection);\n } else if (field.name == \"storedMarks\") {\n if (json.storedMarks) { instance.storedMarks = json.storedMarks.map(config.schema.markFromJSON); }\n } else {\n if (pluginFields) { for (var prop in pluginFields) {\n var plugin = pluginFields[prop], state = plugin.spec.state;\n if (plugin.key == field.name && state && state.fromJSON &&\n Object.prototype.hasOwnProperty.call(json, prop)) {\n // This field belongs to a plugin mapped to a JSON field, read it from there.\n instance[field.name] = state.fromJSON.call(plugin, config, json[prop], instance);\n return\n }\n } }\n instance[field.name] = field.init(config, instance);\n }\n });\n return instance\n};\n\n// Kludge to allow the view to track mappings between different\n// instances of a state.\n//\n// FIXME this is no longer needed as of prosemirror-view 1.9.0,\n// though due to backwards-compat we should probably keep it around\n// for a while (if only as a no-op)\nEditorState.addApplyListener = function addApplyListener (f) {\n applyListeners.push(f);\n};\nEditorState.removeApplyListener = function removeApplyListener (f) {\n var found = applyListeners.indexOf(f);\n if (found > -1) { applyListeners.splice(found, 1); }\n};\n\nObject.defineProperties( EditorState.prototype, prototypeAccessors$1 );\n\nvar applyListeners = [];\n\n// PluginSpec:: interface\n//\n// This is the type passed to the [`Plugin`](#state.Plugin)\n// constructor. It provides a definition for a plugin.\n//\n// props:: ?EditorProps\n// The [view props](#view.EditorProps) added by this plugin. Props\n// that are functions will be bound to have the plugin instance as\n// their `this` binding.\n//\n// state:: ?StateField\n// Allows a plugin to define a [state field](#state.StateField), an\n// extra slot in the state object in which it can keep its own data.\n//\n// key:: ?PluginKey\n// Can be used to make this a keyed plugin. You can have only one\n// plugin with a given key in a given state, but it is possible to\n// access the plugin's configuration and state through the key,\n// without having access to the plugin instance object.\n//\n// view:: ?(EditorView) → Object\n// When the plugin needs to interact with the editor view, or\n// set something up in the DOM, use this field. The function\n// will be called when the plugin's state is associated with an\n// editor view.\n//\n// return::-\n// Should return an object with the following optional\n// properties:\n//\n// update:: ?(view: EditorView, prevState: EditorState)\n// Called whenever the view's state is updated.\n//\n// destroy:: ?()\n// Called when the view is destroyed or receives a state\n// with different plugins.\n//\n// filterTransaction:: ?(Transaction, EditorState) → bool\n// When present, this will be called before a transaction is\n// applied by the state, allowing the plugin to cancel it (by\n// returning false).\n//\n// appendTransaction:: ?(transactions: [Transaction], oldState: EditorState, newState: EditorState) → ?Transaction\n// Allows the plugin to append another transaction to be applied\n// after the given array of transactions. When another plugin\n// appends a transaction after this was called, it is called again\n// with the new state and new transactions—but only the new\n// transactions, i.e. it won't be passed transactions that it\n// already saw.\n\nfunction bindProps(obj, self, target) {\n for (var prop in obj) {\n var val = obj[prop];\n if (val instanceof Function) { val = val.bind(self); }\n else if (prop == \"handleDOMEvents\") { val = bindProps(val, self, {}); }\n target[prop] = val;\n }\n return target\n}\n\n// ::- Plugins bundle functionality that can be added to an editor.\n// They are part of the [editor state](#state.EditorState) and\n// may influence that state and the view that contains it.\nvar Plugin = function Plugin(spec) {\n // :: EditorProps\n // The [props](#view.EditorProps) exported by this plugin.\n this.props = {};\n if (spec.props) { bindProps(spec.props, this, this.props); }\n // :: Object\n // The plugin's [spec object](#state.PluginSpec).\n this.spec = spec;\n this.key = spec.key ? spec.key.key : createKey(\"plugin\");\n};\n\n// :: (EditorState) → any\n// Extract the plugin's state field from an editor state.\nPlugin.prototype.getState = function getState (state) { return state[this.key] };\n\n// StateField:: interface\n// A plugin spec may provide a state field (under its\n// [`state`](#state.PluginSpec.state) property) of this type, which\n// describes the state it wants to keep. Functions provided here are\n// always called with the plugin instance as their `this` binding.\n//\n// init:: (config: Object, instance: EditorState) → T\n// Initialize the value of the field. `config` will be the object\n// passed to [`EditorState.create`](#state.EditorState^create). Note\n// that `instance` is a half-initialized state instance, and will\n// not have values for plugin fields initialized after this one.\n//\n// apply:: (tr: Transaction, value: T, oldState: EditorState, newState: EditorState) → T\n// Apply the given transaction to this state field, producing a new\n// field value. Note that the `newState` argument is again a partially\n// constructed state does not yet contain the state from plugins\n// coming after this one.\n//\n// toJSON:: ?(value: T) → *\n// Convert this field to JSON. Optional, can be left off to disable\n// JSON serialization for the field.\n//\n// fromJSON:: ?(config: Object, value: *, state: EditorState) → T\n// Deserialize the JSON representation of this field. Note that the\n// `state` argument is again a half-initialized state.\n\nvar keys = Object.create(null);\n\nfunction createKey(name) {\n if (name in keys) { return name + \"$\" + ++keys[name] }\n keys[name] = 0;\n return name + \"$\"\n}\n\n// ::- A key is used to [tag](#state.PluginSpec.key)\n// plugins in a way that makes it possible to find them, given an\n// editor state. Assigning a key does mean only one plugin of that\n// type can be active in a state.\nvar PluginKey = function PluginKey(name) {\nif ( name === void 0 ) name = \"key\";\n this.key = createKey(name); };\n\n// :: (EditorState) → ?Plugin\n// Get the active plugin with this key, if any, from an editor\n// state.\nPluginKey.prototype.get = function get (state) { return state.config.pluginsByKey[this.key] };\n\n// :: (EditorState) → ?any\n// Get the plugin's state from an editor state.\nPluginKey.prototype.getState = function getState (state) { return state[this.key] };\n\n\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/prosemirror-state/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/prosemirror-transform/dist/index.es.js": +/*!*************************************************************!*\ + !*** ./node_modules/prosemirror-transform/dist/index.es.js ***! + \*************************************************************/ +/*! exports provided: AddMarkStep, MapResult, Mapping, RemoveMarkStep, ReplaceAroundStep, ReplaceStep, Step, StepMap, StepResult, Transform, TransformError, canJoin, canSplit, dropPoint, findWrapping, insertPoint, joinPoint, liftTarget, replaceStep */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AddMarkStep\", function() { return AddMarkStep; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MapResult\", function() { return MapResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Mapping\", function() { return Mapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RemoveMarkStep\", function() { return RemoveMarkStep; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ReplaceAroundStep\", function() { return ReplaceAroundStep; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ReplaceStep\", function() { return ReplaceStep; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Step\", function() { return Step; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StepMap\", function() { return StepMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StepResult\", function() { return StepResult; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Transform\", function() { return Transform; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TransformError\", function() { return TransformError; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"canJoin\", function() { return canJoin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"canSplit\", function() { return canSplit; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dropPoint\", function() { return dropPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findWrapping\", function() { return findWrapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"insertPoint\", function() { return insertPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"joinPoint\", function() { return joinPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"liftTarget\", function() { return liftTarget; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"replaceStep\", function() { return replaceStep; });\n/* harmony import */ var prosemirror_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prosemirror-model */ \"./node_modules/prosemirror-model/dist/index.es.js\");\n\n\n// Mappable:: interface\n// There are several things that positions can be mapped through.\n// Such objects conform to this interface.\n//\n// map:: (pos: number, assoc: ?number) → number\n// Map a position through this object. When given, `assoc` (should\n// be -1 or 1, defaults to 1) determines with which side the\n// position is associated, which determines in which direction to\n// move when a chunk of content is inserted at the mapped position.\n//\n// mapResult:: (pos: number, assoc: ?number) → MapResult\n// Map a position, and return an object containing additional\n// information about the mapping. The result's `deleted` field tells\n// you whether the position was deleted (completely enclosed in a\n// replaced range) during the mapping. When content on only one side\n// is deleted, the position itself is only considered deleted when\n// `assoc` points in the direction of the deleted content.\n\n// Recovery values encode a range index and an offset. They are\n// represented as numbers, because tons of them will be created when\n// mapping, for example, a large number of decorations. The number's\n// lower 16 bits provide the index, the remaining bits the offset.\n//\n// Note: We intentionally don't use bit shift operators to en- and\n// decode these, since those clip to 32 bits, which we might in rare\n// cases want to overflow. A 64-bit float can represent 48-bit\n// integers precisely.\n\nvar lower16 = 0xffff;\nvar factor16 = Math.pow(2, 16);\n\nfunction makeRecover(index, offset) { return index + offset * factor16 }\nfunction recoverIndex(value) { return value & lower16 }\nfunction recoverOffset(value) { return (value - (value & lower16)) / factor16 }\n\n// ::- An object representing a mapped position with extra\n// information.\nvar MapResult = function MapResult(pos, deleted, recover) {\n if ( deleted === void 0 ) deleted = false;\n if ( recover === void 0 ) recover = null;\n\n // :: number The mapped version of the position.\n this.pos = pos;\n // :: bool Tells you whether the position was deleted, that is,\n // whether the step removed its surroundings from the document.\n this.deleted = deleted;\n this.recover = recover;\n};\n\n// :: class extends Mappable\n// A map describing the deletions and insertions made by a step, which\n// can be used to find the correspondence between positions in the\n// pre-step version of a document and the same position in the\n// post-step version.\nvar StepMap = function StepMap(ranges, inverted) {\n if ( inverted === void 0 ) inverted = false;\n\n this.ranges = ranges;\n this.inverted = inverted;\n};\n\nStepMap.prototype.recover = function recover (value) {\n var diff = 0, index = recoverIndex(value);\n if (!this.inverted) { for (var i = 0; i < index; i++)\n { diff += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1]; } }\n return this.ranges[index * 3] + diff + recoverOffset(value)\n};\n\n// : (number, ?number) → MapResult\nStepMap.prototype.mapResult = function mapResult (pos, assoc) {\n if ( assoc === void 0 ) assoc = 1;\n return this._map(pos, assoc, false) };\n\n// : (number, ?number) → number\nStepMap.prototype.map = function map (pos, assoc) {\n if ( assoc === void 0 ) assoc = 1;\n return this._map(pos, assoc, true) };\n\nStepMap.prototype._map = function _map (pos, assoc, simple) {\n var diff = 0, oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2;\n for (var i = 0; i < this.ranges.length; i += 3) {\n var start = this.ranges[i] - (this.inverted ? diff : 0);\n if (start > pos) { break }\n var oldSize = this.ranges[i + oldIndex], newSize = this.ranges[i + newIndex], end = start + oldSize;\n if (pos <= end) {\n var side = !oldSize ? assoc : pos == start ? -1 : pos == end ? 1 : assoc;\n var result = start + diff + (side < 0 ? 0 : newSize);\n if (simple) { return result }\n var recover = makeRecover(i / 3, pos - start);\n return new MapResult(result, assoc < 0 ? pos != start : pos != end, recover)\n }\n diff += newSize - oldSize;\n }\n return simple ? pos + diff : new MapResult(pos + diff)\n};\n\nStepMap.prototype.touches = function touches (pos, recover) {\n var diff = 0, index = recoverIndex(recover);\n var oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2;\n for (var i = 0; i < this.ranges.length; i += 3) {\n var start = this.ranges[i] - (this.inverted ? diff : 0);\n if (start > pos) { break }\n var oldSize = this.ranges[i + oldIndex], end = start + oldSize;\n if (pos <= end && i == index * 3) { return true }\n diff += this.ranges[i + newIndex] - oldSize;\n }\n return false\n};\n\n// :: ((oldStart: number, oldEnd: number, newStart: number, newEnd: number))\n// Calls the given function on each of the changed ranges included in\n// this map.\nStepMap.prototype.forEach = function forEach (f) {\n var oldIndex = this.inverted ? 2 : 1, newIndex = this.inverted ? 1 : 2;\n for (var i = 0, diff = 0; i < this.ranges.length; i += 3) {\n var start = this.ranges[i], oldStart = start - (this.inverted ? diff : 0), newStart = start + (this.inverted ? 0 : diff);\n var oldSize = this.ranges[i + oldIndex], newSize = this.ranges[i + newIndex];\n f(oldStart, oldStart + oldSize, newStart, newStart + newSize);\n diff += newSize - oldSize;\n }\n};\n\n// :: () → StepMap\n// Create an inverted version of this map. The result can be used to\n// map positions in the post-step document to the pre-step document.\nStepMap.prototype.invert = function invert () {\n return new StepMap(this.ranges, !this.inverted)\n};\n\nStepMap.prototype.toString = function toString () {\n return (this.inverted ? \"-\" : \"\") + JSON.stringify(this.ranges)\n};\n\n// :: (n: number) → StepMap\n// Create a map that moves all positions by offset `n` (which may be\n// negative). This can be useful when applying steps meant for a\n// sub-document to a larger document, or vice-versa.\nStepMap.offset = function offset (n) {\n return n == 0 ? StepMap.empty : new StepMap(n < 0 ? [0, -n, 0] : [0, 0, n])\n};\n\nStepMap.empty = new StepMap([]);\n\n// :: class extends Mappable\n// A mapping represents a pipeline of zero or more [step\n// maps](#transform.StepMap). It has special provisions for losslessly\n// handling mapping positions through a series of steps in which some\n// steps are inverted versions of earlier steps. (This comes up when\n// ‘[rebasing](/docs/guide/#transform.rebasing)’ steps for\n// collaboration or history management.)\nvar Mapping = function Mapping(maps, mirror, from, to) {\n // :: [StepMap]\n // The step maps in this mapping.\n this.maps = maps || [];\n // :: number\n // The starting position in the `maps` array, used when `map` or\n // `mapResult` is called.\n this.from = from || 0;\n // :: number\n // The end position in the `maps` array.\n this.to = to == null ? this.maps.length : to;\n this.mirror = mirror;\n};\n\n// :: (?number, ?number) → Mapping\n// Create a mapping that maps only through a part of this one.\nMapping.prototype.slice = function slice (from, to) {\n if ( from === void 0 ) from = 0;\n if ( to === void 0 ) to = this.maps.length;\n\n return new Mapping(this.maps, this.mirror, from, to)\n};\n\nMapping.prototype.copy = function copy () {\n return new Mapping(this.maps.slice(), this.mirror && this.mirror.slice(), this.from, this.to)\n};\n\n// :: (StepMap, ?number)\n// Add a step map to the end of this mapping. If `mirrors` is\n// given, it should be the index of the step map that is the mirror\n// image of this one.\nMapping.prototype.appendMap = function appendMap (map, mirrors) {\n this.to = this.maps.push(map);\n if (mirrors != null) { this.setMirror(this.maps.length - 1, mirrors); }\n};\n\n// :: (Mapping)\n// Add all the step maps in a given mapping to this one (preserving\n// mirroring information).\nMapping.prototype.appendMapping = function appendMapping (mapping) {\n for (var i = 0, startSize = this.maps.length; i < mapping.maps.length; i++) {\n var mirr = mapping.getMirror(i);\n this.appendMap(mapping.maps[i], mirr != null && mirr < i ? startSize + mirr : null);\n }\n};\n\n// :: (number) → ?number\n// Finds the offset of the step map that mirrors the map at the\n// given offset, in this mapping (as per the second argument to\n// `appendMap`).\nMapping.prototype.getMirror = function getMirror (n) {\n if (this.mirror) { for (var i = 0; i < this.mirror.length; i++)\n { if (this.mirror[i] == n) { return this.mirror[i + (i % 2 ? -1 : 1)] } } }\n};\n\nMapping.prototype.setMirror = function setMirror (n, m) {\n if (!this.mirror) { this.mirror = []; }\n this.mirror.push(n, m);\n};\n\n// :: (Mapping)\n// Append the inverse of the given mapping to this one.\nMapping.prototype.appendMappingInverted = function appendMappingInverted (mapping) {\n for (var i = mapping.maps.length - 1, totalSize = this.maps.length + mapping.maps.length; i >= 0; i--) {\n var mirr = mapping.getMirror(i);\n this.appendMap(mapping.maps[i].invert(), mirr != null && mirr > i ? totalSize - mirr - 1 : null);\n }\n};\n\n// :: () → Mapping\n// Create an inverted version of this mapping.\nMapping.prototype.invert = function invert () {\n var inverse = new Mapping;\n inverse.appendMappingInverted(this);\n return inverse\n};\n\n// : (number, ?number) → number\n// Map a position through this mapping.\nMapping.prototype.map = function map (pos, assoc) {\n if ( assoc === void 0 ) assoc = 1;\n\n if (this.mirror) { return this._map(pos, assoc, true) }\n for (var i = this.from; i < this.to; i++)\n { pos = this.maps[i].map(pos, assoc); }\n return pos\n};\n\n// : (number, ?number) → MapResult\n// Map a position through this mapping, returning a mapping\n// result.\nMapping.prototype.mapResult = function mapResult (pos, assoc) {\n if ( assoc === void 0 ) assoc = 1;\n return this._map(pos, assoc, false) };\n\nMapping.prototype._map = function _map (pos, assoc, simple) {\n var deleted = false, recoverables = null;\n\n for (var i = this.from; i < this.to; i++) {\n var map = this.maps[i], rec = recoverables && recoverables[i];\n if (rec != null && map.touches(pos, rec)) {\n pos = map.recover(rec);\n continue\n }\n\n var result = map.mapResult(pos, assoc);\n if (result.recover != null) {\n var corr = this.getMirror(i);\n if (corr != null && corr > i && corr < this.to) {\n if (result.deleted) {\n i = corr;\n pos = this.maps[corr].recover(result.recover);\n continue\n } else {\n(recoverables || (recoverables = Object.create(null)))[corr] = result.recover;\n }\n }\n }\n\n if (result.deleted) { deleted = true; }\n pos = result.pos;\n }\n\n return simple ? pos : new MapResult(pos, deleted)\n};\n\nfunction TransformError(message) {\n var err = Error.call(this, message);\n err.__proto__ = TransformError.prototype;\n return err\n}\n\nTransformError.prototype = Object.create(Error.prototype);\nTransformError.prototype.constructor = TransformError;\nTransformError.prototype.name = \"TransformError\";\n\n// ::- Abstraction to build up and track an array of\n// [steps](#transform.Step) representing a document transformation.\n//\n// Most transforming methods return the `Transform` object itself, so\n// that they can be chained.\nvar Transform = function Transform(doc) {\n // :: Node\n // The current document (the result of applying the steps in the\n // transform).\n this.doc = doc;\n // :: [Step]\n // The steps in this transform.\n this.steps = [];\n // :: [Node]\n // The documents before each of the steps.\n this.docs = [];\n // :: Mapping\n // A mapping with the maps for each of the steps in this transform.\n this.mapping = new Mapping;\n};\n\nvar prototypeAccessors = { before: { configurable: true },docChanged: { configurable: true } };\n\n// :: Node The starting document.\nprototypeAccessors.before.get = function () { return this.docs.length ? this.docs[0] : this.doc };\n\n// :: (step: Step) → this\n// Apply a new step in this transform, saving the result. Throws an\n// error when the step fails.\nTransform.prototype.step = function step (object) {\n var result = this.maybeStep(object);\n if (result.failed) { throw new TransformError(result.failed) }\n return this\n};\n\n// :: (Step) → StepResult\n// Try to apply a step in this transformation, ignoring it if it\n// fails. Returns the step result.\nTransform.prototype.maybeStep = function maybeStep (step) {\n var result = step.apply(this.doc);\n if (!result.failed) { this.addStep(step, result.doc); }\n return result\n};\n\n// :: bool\n// True when the document has been changed (when there are any\n// steps).\nprototypeAccessors.docChanged.get = function () {\n return this.steps.length > 0\n};\n\nTransform.prototype.addStep = function addStep (step, doc) {\n this.docs.push(this.doc);\n this.steps.push(step);\n this.mapping.appendMap(step.getMap());\n this.doc = doc;\n};\n\nObject.defineProperties( Transform.prototype, prototypeAccessors );\n\nfunction mustOverride() { throw new Error(\"Override me\") }\n\nvar stepsByID = Object.create(null);\n\n// ::- A step object represents an atomic change. It generally applies\n// only to the document it was created for, since the positions\n// stored in it will only make sense for that document.\n//\n// New steps are defined by creating classes that extend `Step`,\n// overriding the `apply`, `invert`, `map`, `getMap` and `fromJSON`\n// methods, and registering your class with a unique\n// JSON-serialization identifier using\n// [`Step.jsonID`](#transform.Step^jsonID).\nvar Step = function Step () {};\n\nStep.prototype.apply = function apply (_doc) { return mustOverride() };\n\n// :: () → StepMap\n// Get the step map that represents the changes made by this step,\n// and which can be used to transform between positions in the old\n// and the new document.\nStep.prototype.getMap = function getMap () { return StepMap.empty };\n\n// :: (doc: Node) → Step\n// Create an inverted version of this step. Needs the document as it\n// was before the step as argument.\nStep.prototype.invert = function invert (_doc) { return mustOverride() };\n\n// :: (mapping: Mappable) → ?Step\n// Map this step through a mappable thing, returning either a\n// version of that step with its positions adjusted, or `null` if\n// the step was entirely deleted by the mapping.\nStep.prototype.map = function map (_mapping) { return mustOverride() };\n\n// :: (other: Step) → ?Step\n// Try to merge this step with another one, to be applied directly\n// after it. Returns the merged step when possible, null if the\n// steps can't be merged.\nStep.prototype.merge = function merge (_other) { return null };\n\n// :: () → Object\n// Create a JSON-serializeable representation of this step. When\n// defining this for a custom subclass, make sure the result object\n// includes the step type's [JSON id](#transform.Step^jsonID) under\n// the `stepType` property.\nStep.prototype.toJSON = function toJSON () { return mustOverride() };\n\n// :: (Schema, Object) → Step\n// Deserialize a step from its JSON representation. Will call\n// through to the step class' own implementation of this method.\nStep.fromJSON = function fromJSON (schema, json) {\n if (!json || !json.stepType) { throw new RangeError(\"Invalid input for Step.fromJSON\") }\n var type = stepsByID[json.stepType];\n if (!type) { throw new RangeError((\"No step type \" + (json.stepType) + \" defined\")) }\n return type.fromJSON(schema, json)\n};\n\n// :: (string, constructor)\n// To be able to serialize steps to JSON, each step needs a string\n// ID to attach to its JSON representation. Use this method to\n// register an ID for your step classes. Try to pick something\n// that's unlikely to clash with steps from other modules.\nStep.jsonID = function jsonID (id, stepClass) {\n if (id in stepsByID) { throw new RangeError(\"Duplicate use of step JSON ID \" + id) }\n stepsByID[id] = stepClass;\n stepClass.prototype.jsonID = id;\n return stepClass\n};\n\n// ::- The result of [applying](#transform.Step.apply) a step. Contains either a\n// new document or a failure value.\nvar StepResult = function StepResult(doc, failed) {\n // :: ?Node The transformed document.\n this.doc = doc;\n // :: ?string Text providing information about a failed step.\n this.failed = failed;\n};\n\n// :: (Node) → StepResult\n// Create a successful step result.\nStepResult.ok = function ok (doc) { return new StepResult(doc, null) };\n\n// :: (string) → StepResult\n// Create a failed step result.\nStepResult.fail = function fail (message) { return new StepResult(null, message) };\n\n// :: (Node, number, number, Slice) → StepResult\n// Call [`Node.replace`](#model.Node.replace) with the given\n// arguments. Create a successful result if it succeeds, and a\n// failed one if it throws a `ReplaceError`.\nStepResult.fromReplace = function fromReplace (doc, from, to, slice) {\n try {\n return StepResult.ok(doc.replace(from, to, slice))\n } catch (e) {\n if (e instanceof prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"ReplaceError\"]) { return StepResult.fail(e.message) }\n throw e\n }\n};\n\n// ::- Replace a part of the document with a slice of new content.\nvar ReplaceStep = /*@__PURE__*/(function (Step) {\n function ReplaceStep(from, to, slice, structure) {\n Step.call(this);\n this.from = from;\n this.to = to;\n this.slice = slice;\n this.structure = !!structure;\n }\n\n if ( Step ) ReplaceStep.__proto__ = Step;\n ReplaceStep.prototype = Object.create( Step && Step.prototype );\n ReplaceStep.prototype.constructor = ReplaceStep;\n\n ReplaceStep.prototype.apply = function apply (doc) {\n if (this.structure && contentBetween(doc, this.from, this.to))\n { return StepResult.fail(\"Structure replace would overwrite content\") }\n return StepResult.fromReplace(doc, this.from, this.to, this.slice)\n };\n\n ReplaceStep.prototype.getMap = function getMap () {\n return new StepMap([this.from, this.to - this.from, this.slice.size])\n };\n\n ReplaceStep.prototype.invert = function invert (doc) {\n return new ReplaceStep(this.from, this.from + this.slice.size, doc.slice(this.from, this.to))\n };\n\n ReplaceStep.prototype.map = function map (mapping) {\n var from = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);\n if (from.deleted && to.deleted) { return null }\n return new ReplaceStep(from.pos, Math.max(from.pos, to.pos), this.slice)\n };\n\n ReplaceStep.prototype.merge = function merge (other) {\n if (!(other instanceof ReplaceStep) || other.structure != this.structure) { return null }\n\n if (this.from + this.slice.size == other.from && !this.slice.openEnd && !other.slice.openStart) {\n var slice = this.slice.size + other.slice.size == 0 ? prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"].empty\n : new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](this.slice.content.append(other.slice.content), this.slice.openStart, other.slice.openEnd);\n return new ReplaceStep(this.from, this.to + (other.to - other.from), slice, this.structure)\n } else if (other.to == this.from && !this.slice.openStart && !other.slice.openEnd) {\n var slice$1 = this.slice.size + other.slice.size == 0 ? prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"].empty\n : new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](other.slice.content.append(this.slice.content), other.slice.openStart, this.slice.openEnd);\n return new ReplaceStep(other.from, this.to, slice$1, this.structure)\n } else {\n return null\n }\n };\n\n ReplaceStep.prototype.toJSON = function toJSON () {\n var json = {stepType: \"replace\", from: this.from, to: this.to};\n if (this.slice.size) { json.slice = this.slice.toJSON(); }\n if (this.structure) { json.structure = true; }\n return json\n };\n\n ReplaceStep.fromJSON = function fromJSON (schema, json) {\n if (typeof json.from != \"number\" || typeof json.to != \"number\")\n { throw new RangeError(\"Invalid input for ReplaceStep.fromJSON\") }\n return new ReplaceStep(json.from, json.to, prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"].fromJSON(schema, json.slice), !!json.structure)\n };\n\n return ReplaceStep;\n}(Step));\n\nStep.jsonID(\"replace\", ReplaceStep);\n\n// ::- Replace a part of the document with a slice of content, but\n// preserve a range of the replaced content by moving it into the\n// slice.\nvar ReplaceAroundStep = /*@__PURE__*/(function (Step) {\n function ReplaceAroundStep(from, to, gapFrom, gapTo, slice, insert, structure) {\n Step.call(this);\n this.from = from;\n this.to = to;\n this.gapFrom = gapFrom;\n this.gapTo = gapTo;\n this.slice = slice;\n this.insert = insert;\n this.structure = !!structure;\n }\n\n if ( Step ) ReplaceAroundStep.__proto__ = Step;\n ReplaceAroundStep.prototype = Object.create( Step && Step.prototype );\n ReplaceAroundStep.prototype.constructor = ReplaceAroundStep;\n\n ReplaceAroundStep.prototype.apply = function apply (doc) {\n if (this.structure && (contentBetween(doc, this.from, this.gapFrom) ||\n contentBetween(doc, this.gapTo, this.to)))\n { return StepResult.fail(\"Structure gap-replace would overwrite content\") }\n\n var gap = doc.slice(this.gapFrom, this.gapTo);\n if (gap.openStart || gap.openEnd)\n { return StepResult.fail(\"Gap is not a flat range\") }\n var inserted = this.slice.insertAt(this.insert, gap.content);\n if (!inserted) { return StepResult.fail(\"Content does not fit in gap\") }\n return StepResult.fromReplace(doc, this.from, this.to, inserted)\n };\n\n ReplaceAroundStep.prototype.getMap = function getMap () {\n return new StepMap([this.from, this.gapFrom - this.from, this.insert,\n this.gapTo, this.to - this.gapTo, this.slice.size - this.insert])\n };\n\n ReplaceAroundStep.prototype.invert = function invert (doc) {\n var gap = this.gapTo - this.gapFrom;\n return new ReplaceAroundStep(this.from, this.from + this.slice.size + gap,\n this.from + this.insert, this.from + this.insert + gap,\n doc.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from),\n this.gapFrom - this.from, this.structure)\n };\n\n ReplaceAroundStep.prototype.map = function map (mapping) {\n var from = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);\n var gapFrom = mapping.map(this.gapFrom, -1), gapTo = mapping.map(this.gapTo, 1);\n if ((from.deleted && to.deleted) || gapFrom < from.pos || gapTo > to.pos) { return null }\n return new ReplaceAroundStep(from.pos, to.pos, gapFrom, gapTo, this.slice, this.insert, this.structure)\n };\n\n ReplaceAroundStep.prototype.toJSON = function toJSON () {\n var json = {stepType: \"replaceAround\", from: this.from, to: this.to,\n gapFrom: this.gapFrom, gapTo: this.gapTo, insert: this.insert};\n if (this.slice.size) { json.slice = this.slice.toJSON(); }\n if (this.structure) { json.structure = true; }\n return json\n };\n\n ReplaceAroundStep.fromJSON = function fromJSON (schema, json) {\n if (typeof json.from != \"number\" || typeof json.to != \"number\" ||\n typeof json.gapFrom != \"number\" || typeof json.gapTo != \"number\" || typeof json.insert != \"number\")\n { throw new RangeError(\"Invalid input for ReplaceAroundStep.fromJSON\") }\n return new ReplaceAroundStep(json.from, json.to, json.gapFrom, json.gapTo,\n prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"].fromJSON(schema, json.slice), json.insert, !!json.structure)\n };\n\n return ReplaceAroundStep;\n}(Step));\n\nStep.jsonID(\"replaceAround\", ReplaceAroundStep);\n\nfunction contentBetween(doc, from, to) {\n var $from = doc.resolve(from), dist = to - from, depth = $from.depth;\n while (dist > 0 && depth > 0 && $from.indexAfter(depth) == $from.node(depth).childCount) {\n depth--;\n dist--;\n }\n if (dist > 0) {\n var next = $from.node(depth).maybeChild($from.indexAfter(depth));\n while (dist > 0) {\n if (!next || next.isLeaf) { return true }\n next = next.firstChild;\n dist--;\n }\n }\n return false\n}\n\nfunction canCut(node, start, end) {\n return (start == 0 || node.canReplace(start, node.childCount)) &&\n (end == node.childCount || node.canReplace(0, end))\n}\n\n// :: (NodeRange) → ?number\n// Try to find a target depth to which the content in the given range\n// can be lifted. Will not go across\n// [isolating](#model.NodeSpec.isolating) parent nodes.\nfunction liftTarget(range) {\n var parent = range.parent;\n var content = parent.content.cutByIndex(range.startIndex, range.endIndex);\n for (var depth = range.depth;; --depth) {\n var node = range.$from.node(depth);\n var index = range.$from.index(depth), endIndex = range.$to.indexAfter(depth);\n if (depth < range.depth && node.canReplace(index, endIndex, content))\n { return depth }\n if (depth == 0 || node.type.spec.isolating || !canCut(node, index, endIndex)) { break }\n }\n}\n\n// :: (NodeRange, number) → this\n// Split the content in the given range off from its parent, if there\n// is sibling content before or after it, and move it up the tree to\n// the depth specified by `target`. You'll probably want to use\n// [`liftTarget`](#transform.liftTarget) to compute `target`, to make\n// sure the lift is valid.\nTransform.prototype.lift = function(range, target) {\n var $from = range.$from;\n var $to = range.$to;\n var depth = range.depth;\n\n var gapStart = $from.before(depth + 1), gapEnd = $to.after(depth + 1);\n var start = gapStart, end = gapEnd;\n\n var before = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].empty, openStart = 0;\n for (var d = depth, splitting = false; d > target; d--)\n { if (splitting || $from.index(d) > 0) {\n splitting = true;\n before = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].from($from.node(d).copy(before));\n openStart++;\n } else {\n start--;\n } }\n var after = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].empty, openEnd = 0;\n for (var d$1 = depth, splitting$1 = false; d$1 > target; d$1--)\n { if (splitting$1 || $to.after(d$1 + 1) < $to.end(d$1)) {\n splitting$1 = true;\n after = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].from($to.node(d$1).copy(after));\n openEnd++;\n } else {\n end++;\n } }\n\n return this.step(new ReplaceAroundStep(start, end, gapStart, gapEnd,\n new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](before.append(after), openStart, openEnd),\n before.size - openStart, true))\n};\n\n// :: (NodeRange, NodeType, ?Object, ?NodeRange) → ?[{type: NodeType, attrs: ?Object}]\n// Try to find a valid way to wrap the content in the given range in a\n// node of the given type. May introduce extra nodes around and inside\n// the wrapper node, if necessary. Returns null if no valid wrapping\n// could be found. When `innerRange` is given, that range's content is\n// used as the content to fit into the wrapping, instead of the\n// content of `range`.\nfunction findWrapping(range, nodeType, attrs, innerRange) {\n if ( innerRange === void 0 ) innerRange = range;\n\n var around = findWrappingOutside(range, nodeType);\n var inner = around && findWrappingInside(innerRange, nodeType);\n if (!inner) { return null }\n return around.map(withAttrs).concat({type: nodeType, attrs: attrs}).concat(inner.map(withAttrs))\n}\n\nfunction withAttrs(type) { return {type: type, attrs: null} }\n\nfunction findWrappingOutside(range, type) {\n var parent = range.parent;\n var startIndex = range.startIndex;\n var endIndex = range.endIndex;\n var around = parent.contentMatchAt(startIndex).findWrapping(type);\n if (!around) { return null }\n var outer = around.length ? around[0] : type;\n return parent.canReplaceWith(startIndex, endIndex, outer) ? around : null\n}\n\nfunction findWrappingInside(range, type) {\n var parent = range.parent;\n var startIndex = range.startIndex;\n var endIndex = range.endIndex;\n var inner = parent.child(startIndex);\n var inside = type.contentMatch.findWrapping(inner.type);\n if (!inside) { return null }\n var lastType = inside.length ? inside[inside.length - 1] : type;\n var innerMatch = lastType.contentMatch;\n for (var i = startIndex; innerMatch && i < endIndex; i++)\n { innerMatch = innerMatch.matchType(parent.child(i).type); }\n if (!innerMatch || !innerMatch.validEnd) { return null }\n return inside\n}\n\n// :: (NodeRange, [{type: NodeType, attrs: ?Object}]) → this\n// Wrap the given [range](#model.NodeRange) in the given set of wrappers.\n// The wrappers are assumed to be valid in this position, and should\n// probably be computed with [`findWrapping`](#transform.findWrapping).\nTransform.prototype.wrap = function(range, wrappers) {\n var content = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].empty;\n for (var i = wrappers.length - 1; i >= 0; i--)\n { content = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].from(wrappers[i].type.create(wrappers[i].attrs, content)); }\n\n var start = range.start, end = range.end;\n return this.step(new ReplaceAroundStep(start, end, start, end, new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](content, 0, 0), wrappers.length, true))\n};\n\n// :: (number, ?number, NodeType, ?Object) → this\n// Set the type of all textblocks (partly) between `from` and `to` to\n// the given node type with the given attributes.\nTransform.prototype.setBlockType = function(from, to, type, attrs) {\n var this$1 = this;\n if ( to === void 0 ) to = from;\n\n if (!type.isTextblock) { throw new RangeError(\"Type given to setBlockType should be a textblock\") }\n var mapFrom = this.steps.length;\n this.doc.nodesBetween(from, to, function (node, pos) {\n if (node.isTextblock && !node.hasMarkup(type, attrs) && canChangeType(this$1.doc, this$1.mapping.slice(mapFrom).map(pos), type)) {\n // Ensure all markup that isn't allowed in the new node type is cleared\n this$1.clearIncompatible(this$1.mapping.slice(mapFrom).map(pos, 1), type);\n var mapping = this$1.mapping.slice(mapFrom);\n var startM = mapping.map(pos, 1), endM = mapping.map(pos + node.nodeSize, 1);\n this$1.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1,\n new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].from(type.create(attrs, null, node.marks)), 0, 0), 1, true));\n return false\n }\n });\n return this\n};\n\nfunction canChangeType(doc, pos, type) {\n var $pos = doc.resolve(pos), index = $pos.index();\n return $pos.parent.canReplaceWith(index, index + 1, type)\n}\n\n// :: (number, ?NodeType, ?Object, ?[Mark]) → this\n// Change the type, attributes, and/or marks of the node at `pos`.\n// When `type` isn't given, the existing node type is preserved,\nTransform.prototype.setNodeMarkup = function(pos, type, attrs, marks) {\n var node = this.doc.nodeAt(pos);\n if (!node) { throw new RangeError(\"No node at given position\") }\n if (!type) { type = node.type; }\n var newNode = type.create(attrs, null, marks || node.marks);\n if (node.isLeaf)\n { return this.replaceWith(pos, pos + node.nodeSize, newNode) }\n\n if (!type.validContent(node.content))\n { throw new RangeError(\"Invalid content for node type \" + type.name) }\n\n return this.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1,\n new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].from(newNode), 0, 0), 1, true))\n};\n\n// :: (Node, number, number, ?[?{type: NodeType, attrs: ?Object}]) → bool\n// Check whether splitting at the given position is allowed.\nfunction canSplit(doc, pos, depth, typesAfter) {\n if ( depth === void 0 ) depth = 1;\n\n var $pos = doc.resolve(pos), base = $pos.depth - depth;\n var innerType = (typesAfter && typesAfter[typesAfter.length - 1]) || $pos.parent;\n if (base < 0 || $pos.parent.type.spec.isolating ||\n !$pos.parent.canReplace($pos.index(), $pos.parent.childCount) ||\n !innerType.type.validContent($pos.parent.content.cutByIndex($pos.index(), $pos.parent.childCount)))\n { return false }\n for (var d = $pos.depth - 1, i = depth - 2; d > base; d--, i--) {\n var node = $pos.node(d), index$1 = $pos.index(d);\n if (node.type.spec.isolating) { return false }\n var rest = node.content.cutByIndex(index$1, node.childCount);\n var after = (typesAfter && typesAfter[i]) || node;\n if (after != node) { rest = rest.replaceChild(0, after.type.create(after.attrs)); }\n if (!node.canReplace(index$1 + 1, node.childCount) || !after.type.validContent(rest))\n { return false }\n }\n var index = $pos.indexAfter(base);\n var baseType = typesAfter && typesAfter[0];\n return $pos.node(base).canReplaceWith(index, index, baseType ? baseType.type : $pos.node(base + 1).type)\n}\n\n// :: (number, ?number, ?[?{type: NodeType, attrs: ?Object}]) → this\n// Split the node at the given position, and optionally, if `depth` is\n// greater than one, any number of nodes above that. By default, the\n// parts split off will inherit the node type of the original node.\n// This can be changed by passing an array of types and attributes to\n// use after the split.\nTransform.prototype.split = function(pos, depth, typesAfter) {\n if ( depth === void 0 ) depth = 1;\n\n var $pos = this.doc.resolve(pos), before = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].empty, after = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].empty;\n for (var d = $pos.depth, e = $pos.depth - depth, i = depth - 1; d > e; d--, i--) {\n before = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].from($pos.node(d).copy(before));\n var typeAfter = typesAfter && typesAfter[i];\n after = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));\n }\n return this.step(new ReplaceStep(pos, pos, new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](before.append(after), depth, depth), true))\n};\n\n// :: (Node, number) → bool\n// Test whether the blocks before and after a given position can be\n// joined.\nfunction canJoin(doc, pos) {\n var $pos = doc.resolve(pos), index = $pos.index();\n return joinable($pos.nodeBefore, $pos.nodeAfter) &&\n $pos.parent.canReplace(index, index + 1)\n}\n\nfunction joinable(a, b) {\n return a && b && !a.isLeaf && a.canAppend(b)\n}\n\n// :: (Node, number, ?number) → ?number\n// Find an ancestor of the given position that can be joined to the\n// block before (or after if `dir` is positive). Returns the joinable\n// point, if any.\nfunction joinPoint(doc, pos, dir) {\n if ( dir === void 0 ) dir = -1;\n\n var $pos = doc.resolve(pos);\n for (var d = $pos.depth;; d--) {\n var before = (void 0), after = (void 0), index = $pos.index(d);\n if (d == $pos.depth) {\n before = $pos.nodeBefore;\n after = $pos.nodeAfter;\n } else if (dir > 0) {\n before = $pos.node(d + 1);\n index++;\n after = $pos.node(d).maybeChild(index);\n } else {\n before = $pos.node(d).maybeChild(index - 1);\n after = $pos.node(d + 1);\n }\n if (before && !before.isTextblock && joinable(before, after) &&\n $pos.node(d).canReplace(index, index + 1)) { return pos }\n if (d == 0) { break }\n pos = dir < 0 ? $pos.before(d) : $pos.after(d);\n }\n}\n\n// :: (number, ?number) → this\n// Join the blocks around the given position. If depth is 2, their\n// last and first siblings are also joined, and so on.\nTransform.prototype.join = function(pos, depth) {\n if ( depth === void 0 ) depth = 1;\n\n var step = new ReplaceStep(pos - depth, pos + depth, prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"].empty, true);\n return this.step(step)\n};\n\n// :: (Node, number, NodeType) → ?number\n// Try to find a point where a node of the given type can be inserted\n// near `pos`, by searching up the node hierarchy when `pos` itself\n// isn't a valid place but is at the start or end of a node. Return\n// null if no position was found.\nfunction insertPoint(doc, pos, nodeType) {\n var $pos = doc.resolve(pos);\n if ($pos.parent.canReplaceWith($pos.index(), $pos.index(), nodeType)) { return pos }\n\n if ($pos.parentOffset == 0)\n { for (var d = $pos.depth - 1; d >= 0; d--) {\n var index = $pos.index(d);\n if ($pos.node(d).canReplaceWith(index, index, nodeType)) { return $pos.before(d + 1) }\n if (index > 0) { return null }\n } }\n if ($pos.parentOffset == $pos.parent.content.size)\n { for (var d$1 = $pos.depth - 1; d$1 >= 0; d$1--) {\n var index$1 = $pos.indexAfter(d$1);\n if ($pos.node(d$1).canReplaceWith(index$1, index$1, nodeType)) { return $pos.after(d$1 + 1) }\n if (index$1 < $pos.node(d$1).childCount) { return null }\n } }\n}\n\n// :: (Node, number, Slice) → ?number\n// Finds a position at or around the given position where the given\n// slice can be inserted. Will look at parent nodes' nearest boundary\n// and try there, even if the original position wasn't directly at the\n// start or end of that node. Returns null when no position was found.\nfunction dropPoint(doc, pos, slice) {\n var $pos = doc.resolve(pos);\n if (!slice.content.size) { return pos }\n var content = slice.content;\n for (var i = 0; i < slice.openStart; i++) { content = content.firstChild.content; }\n for (var pass = 1; pass <= (slice.openStart == 0 && slice.size ? 2 : 1); pass++) {\n for (var d = $pos.depth; d >= 0; d--) {\n var bias = d == $pos.depth ? 0 : $pos.pos <= ($pos.start(d + 1) + $pos.end(d + 1)) / 2 ? -1 : 1;\n var insertPos = $pos.index(d) + (bias > 0 ? 1 : 0);\n if (pass == 1\n ? $pos.node(d).canReplace(insertPos, insertPos, content)\n : $pos.node(d).contentMatchAt(insertPos).findWrapping(content.firstChild.type))\n { return bias == 0 ? $pos.pos : bias < 0 ? $pos.before(d + 1) : $pos.after(d + 1) }\n }\n }\n return null\n}\n\nfunction mapFragment(fragment, f, parent) {\n var mapped = [];\n for (var i = 0; i < fragment.childCount; i++) {\n var child = fragment.child(i);\n if (child.content.size) { child = child.copy(mapFragment(child.content, f, child)); }\n if (child.isInline) { child = f(child, parent, i); }\n mapped.push(child);\n }\n return prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].fromArray(mapped)\n}\n\n// ::- Add a mark to all inline content between two positions.\nvar AddMarkStep = /*@__PURE__*/(function (Step) {\n function AddMarkStep(from, to, mark) {\n Step.call(this);\n this.from = from;\n this.to = to;\n this.mark = mark;\n }\n\n if ( Step ) AddMarkStep.__proto__ = Step;\n AddMarkStep.prototype = Object.create( Step && Step.prototype );\n AddMarkStep.prototype.constructor = AddMarkStep;\n\n AddMarkStep.prototype.apply = function apply (doc) {\n var this$1 = this;\n\n var oldSlice = doc.slice(this.from, this.to), $from = doc.resolve(this.from);\n var parent = $from.node($from.sharedDepth(this.to));\n var slice = new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](mapFragment(oldSlice.content, function (node, parent) {\n if (!parent.type.allowsMarkType(this$1.mark.type)) { return node }\n return node.mark(this$1.mark.addToSet(node.marks))\n }, parent), oldSlice.openStart, oldSlice.openEnd);\n return StepResult.fromReplace(doc, this.from, this.to, slice)\n };\n\n AddMarkStep.prototype.invert = function invert () {\n return new RemoveMarkStep(this.from, this.to, this.mark)\n };\n\n AddMarkStep.prototype.map = function map (mapping) {\n var from = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);\n if (from.deleted && to.deleted || from.pos >= to.pos) { return null }\n return new AddMarkStep(from.pos, to.pos, this.mark)\n };\n\n AddMarkStep.prototype.merge = function merge (other) {\n if (other instanceof AddMarkStep &&\n other.mark.eq(this.mark) &&\n this.from <= other.to && this.to >= other.from)\n { return new AddMarkStep(Math.min(this.from, other.from),\n Math.max(this.to, other.to), this.mark) }\n };\n\n AddMarkStep.prototype.toJSON = function toJSON () {\n return {stepType: \"addMark\", mark: this.mark.toJSON(),\n from: this.from, to: this.to}\n };\n\n AddMarkStep.fromJSON = function fromJSON (schema, json) {\n if (typeof json.from != \"number\" || typeof json.to != \"number\")\n { throw new RangeError(\"Invalid input for AddMarkStep.fromJSON\") }\n return new AddMarkStep(json.from, json.to, schema.markFromJSON(json.mark))\n };\n\n return AddMarkStep;\n}(Step));\n\nStep.jsonID(\"addMark\", AddMarkStep);\n\n// ::- Remove a mark from all inline content between two positions.\nvar RemoveMarkStep = /*@__PURE__*/(function (Step) {\n function RemoveMarkStep(from, to, mark) {\n Step.call(this);\n this.from = from;\n this.to = to;\n this.mark = mark;\n }\n\n if ( Step ) RemoveMarkStep.__proto__ = Step;\n RemoveMarkStep.prototype = Object.create( Step && Step.prototype );\n RemoveMarkStep.prototype.constructor = RemoveMarkStep;\n\n RemoveMarkStep.prototype.apply = function apply (doc) {\n var this$1 = this;\n\n var oldSlice = doc.slice(this.from, this.to);\n var slice = new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](mapFragment(oldSlice.content, function (node) {\n return node.mark(this$1.mark.removeFromSet(node.marks))\n }), oldSlice.openStart, oldSlice.openEnd);\n return StepResult.fromReplace(doc, this.from, this.to, slice)\n };\n\n RemoveMarkStep.prototype.invert = function invert () {\n return new AddMarkStep(this.from, this.to, this.mark)\n };\n\n RemoveMarkStep.prototype.map = function map (mapping) {\n var from = mapping.mapResult(this.from, 1), to = mapping.mapResult(this.to, -1);\n if (from.deleted && to.deleted || from.pos >= to.pos) { return null }\n return new RemoveMarkStep(from.pos, to.pos, this.mark)\n };\n\n RemoveMarkStep.prototype.merge = function merge (other) {\n if (other instanceof RemoveMarkStep &&\n other.mark.eq(this.mark) &&\n this.from <= other.to && this.to >= other.from)\n { return new RemoveMarkStep(Math.min(this.from, other.from),\n Math.max(this.to, other.to), this.mark) }\n };\n\n RemoveMarkStep.prototype.toJSON = function toJSON () {\n return {stepType: \"removeMark\", mark: this.mark.toJSON(),\n from: this.from, to: this.to}\n };\n\n RemoveMarkStep.fromJSON = function fromJSON (schema, json) {\n if (typeof json.from != \"number\" || typeof json.to != \"number\")\n { throw new RangeError(\"Invalid input for RemoveMarkStep.fromJSON\") }\n return new RemoveMarkStep(json.from, json.to, schema.markFromJSON(json.mark))\n };\n\n return RemoveMarkStep;\n}(Step));\n\nStep.jsonID(\"removeMark\", RemoveMarkStep);\n\n// :: (number, number, Mark) → this\n// Add the given mark to the inline content between `from` and `to`.\nTransform.prototype.addMark = function(from, to, mark) {\n var this$1 = this;\n\n var removed = [], added = [], removing = null, adding = null;\n this.doc.nodesBetween(from, to, function (node, pos, parent) {\n if (!node.isInline) { return }\n var marks = node.marks;\n if (!mark.isInSet(marks) && parent.type.allowsMarkType(mark.type)) {\n var start = Math.max(pos, from), end = Math.min(pos + node.nodeSize, to);\n var newSet = mark.addToSet(marks);\n\n for (var i = 0; i < marks.length; i++) {\n if (!marks[i].isInSet(newSet)) {\n if (removing && removing.to == start && removing.mark.eq(marks[i]))\n { removing.to = end; }\n else\n { removed.push(removing = new RemoveMarkStep(start, end, marks[i])); }\n }\n }\n\n if (adding && adding.to == start)\n { adding.to = end; }\n else\n { added.push(adding = new AddMarkStep(start, end, mark)); }\n }\n });\n\n removed.forEach(function (s) { return this$1.step(s); });\n added.forEach(function (s) { return this$1.step(s); });\n return this\n};\n\n// :: (number, number, ?union) → this\n// Remove marks from inline nodes between `from` and `to`. When `mark`\n// is a single mark, remove precisely that mark. When it is a mark type,\n// remove all marks of that type. When it is null, remove all marks of\n// any type.\nTransform.prototype.removeMark = function(from, to, mark) {\n var this$1 = this;\n if ( mark === void 0 ) mark = null;\n\n var matched = [], step = 0;\n this.doc.nodesBetween(from, to, function (node, pos) {\n if (!node.isInline) { return }\n step++;\n var toRemove = null;\n if (mark instanceof prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"MarkType\"]) {\n var found = mark.isInSet(node.marks);\n if (found) { toRemove = [found]; }\n } else if (mark) {\n if (mark.isInSet(node.marks)) { toRemove = [mark]; }\n } else {\n toRemove = node.marks;\n }\n if (toRemove && toRemove.length) {\n var end = Math.min(pos + node.nodeSize, to);\n for (var i = 0; i < toRemove.length; i++) {\n var style = toRemove[i], found$1 = (void 0);\n for (var j = 0; j < matched.length; j++) {\n var m = matched[j];\n if (m.step == step - 1 && style.eq(matched[j].style)) { found$1 = m; }\n }\n if (found$1) {\n found$1.to = end;\n found$1.step = step;\n } else {\n matched.push({style: style, from: Math.max(pos, from), to: end, step: step});\n }\n }\n }\n });\n matched.forEach(function (m) { return this$1.step(new RemoveMarkStep(m.from, m.to, m.style)); });\n return this\n};\n\n// :: (number, NodeType, ?ContentMatch) → this\n// Removes all marks and nodes from the content of the node at `pos`\n// that don't match the given new parent node type. Accepts an\n// optional starting [content match](#model.ContentMatch) as third\n// argument.\nTransform.prototype.clearIncompatible = function(pos, parentType, match) {\n if ( match === void 0 ) match = parentType.contentMatch;\n\n var node = this.doc.nodeAt(pos);\n var delSteps = [], cur = pos + 1;\n for (var i = 0; i < node.childCount; i++) {\n var child = node.child(i), end = cur + child.nodeSize;\n var allowed = match.matchType(child.type, child.attrs);\n if (!allowed) {\n delSteps.push(new ReplaceStep(cur, end, prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"].empty));\n } else {\n match = allowed;\n for (var j = 0; j < child.marks.length; j++) { if (!parentType.allowsMarkType(child.marks[j].type))\n { this.step(new RemoveMarkStep(cur, end, child.marks[j])); } }\n }\n cur = end;\n }\n if (!match.validEnd) {\n var fill = match.fillBefore(prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].empty, true);\n this.replace(cur, cur, new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](fill, 0, 0));\n }\n for (var i$1 = delSteps.length - 1; i$1 >= 0; i$1--) { this.step(delSteps[i$1]); }\n return this\n};\n\n// :: (Node, number, ?number, ?Slice) → ?Step\n// ‘Fit’ a slice into a given position in the document, producing a\n// [step](#transform.Step) that inserts it. Will return null if\n// there's no meaningful way to insert the slice here, or inserting it\n// would be a no-op (an empty slice over an empty range).\nfunction replaceStep(doc, from, to, slice) {\n if ( to === void 0 ) to = from;\n if ( slice === void 0 ) slice = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"].empty;\n\n if (from == to && !slice.size) { return null }\n\n var $from = doc.resolve(from), $to = doc.resolve(to);\n // Optimization -- avoid work if it's obvious that it's not needed.\n if (fitsTrivially($from, $to, slice)) { return new ReplaceStep(from, to, slice) }\n var placed = placeSlice($from, slice);\n\n var fittedLeft = fitLeft($from, placed);\n var fitted = fitRight($from, $to, fittedLeft);\n if (!fitted) { return null }\n if (fittedLeft.size != fitted.size && canMoveText($from, $to, fittedLeft)) {\n var d = $to.depth, after = $to.after(d);\n while (d > 1 && after == $to.end(--d)) { ++after; }\n var fittedAfter = fitRight($from, doc.resolve(after), fittedLeft);\n if (fittedAfter)\n { return new ReplaceAroundStep(from, after, to, $to.end(), fittedAfter, fittedLeft.size) }\n }\n return fitted.size || from != to ? new ReplaceStep(from, to, fitted) : null\n}\n\n// :: (number, ?number, ?Slice) → this\n// Replace the part of the document between `from` and `to` with the\n// given `slice`.\nTransform.prototype.replace = function(from, to, slice) {\n if ( to === void 0 ) to = from;\n if ( slice === void 0 ) slice = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"].empty;\n\n var step = replaceStep(this.doc, from, to, slice);\n if (step) { this.step(step); }\n return this\n};\n\n// :: (number, number, union) → this\n// Replace the given range with the given content, which may be a\n// fragment, node, or array of nodes.\nTransform.prototype.replaceWith = function(from, to, content) {\n return this.replace(from, to, new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].from(content), 0, 0))\n};\n\n// :: (number, number) → this\n// Delete the content between the given positions.\nTransform.prototype.delete = function(from, to) {\n return this.replace(from, to, prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"].empty)\n};\n\n// :: (number, union) → this\n// Insert the given content at the given position.\nTransform.prototype.insert = function(pos, content) {\n return this.replaceWith(pos, pos, content)\n};\n\n\n\nfunction fitLeftInner($from, depth, placed, placedBelow) {\n var content = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].empty, openEnd = 0, placedHere = placed[depth];\n if ($from.depth > depth) {\n var inner = fitLeftInner($from, depth + 1, placed, placedBelow || placedHere);\n openEnd = inner.openEnd + 1;\n content = prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].from($from.node(depth + 1).copy(inner.content));\n }\n\n if (placedHere) {\n content = content.append(placedHere.content);\n openEnd = placedHere.openEnd;\n }\n if (placedBelow) {\n content = content.append($from.node(depth).contentMatchAt($from.indexAfter(depth)).fillBefore(prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].empty, true));\n openEnd = 0;\n }\n\n return {content: content, openEnd: openEnd}\n}\n\nfunction fitLeft($from, placed) {\n var ref = fitLeftInner($from, 0, placed, false);\n var content = ref.content;\n var openEnd = ref.openEnd;\n return new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](content, $from.depth, openEnd || 0)\n}\n\nfunction fitRightJoin(content, parent, $from, $to, depth, openStart, openEnd) {\n var match, count = content.childCount, matchCount = count - (openEnd > 0 ? 1 : 0);\n var parentNode = openStart < 0 ? parent : $from.node(depth);\n if (openStart < 0)\n { match = parentNode.contentMatchAt(matchCount); }\n else if (count == 1 && openEnd > 0)\n { match = parentNode.contentMatchAt(openStart ? $from.index(depth) : $from.indexAfter(depth)); }\n else\n { match = parentNode.contentMatchAt($from.indexAfter(depth))\n .matchFragment(content, count > 0 && openStart ? 1 : 0, matchCount); }\n\n var toNode = $to.node(depth);\n if (openEnd > 0 && depth < $to.depth) {\n var after = toNode.content.cutByIndex($to.indexAfter(depth)).addToStart(content.lastChild);\n var joinable$1 = match.fillBefore(after, true);\n // Can't insert content if there's a single node stretched across this gap\n if (joinable$1 && joinable$1.size && openStart > 0 && count == 1) { joinable$1 = null; }\n\n if (joinable$1) {\n var inner = fitRightJoin(content.lastChild.content, content.lastChild, $from, $to,\n depth + 1, count == 1 ? openStart - 1 : -1, openEnd - 1);\n if (inner) {\n var last = content.lastChild.copy(inner);\n if (joinable$1.size)\n { return content.cutByIndex(0, count - 1).append(joinable$1).addToEnd(last) }\n else\n { return content.replaceChild(count - 1, last) }\n }\n }\n }\n if (openEnd > 0)\n { match = match.matchType((count == 1 && openStart > 0 ? $from.node(depth + 1) : content.lastChild).type); }\n\n // If we're here, the next level can't be joined, so we see what\n // happens if we leave it open.\n var toIndex = $to.index(depth);\n if (toIndex == toNode.childCount && !toNode.type.compatibleContent(parent.type)) { return null }\n var joinable = match.fillBefore(toNode.content, true, toIndex);\n for (var i = toIndex; joinable && i < toNode.content.childCount; i++)\n { if (!parentNode.type.allowsMarks(toNode.content.child(i).marks)) { joinable = null; } }\n if (!joinable) { return null }\n\n if (openEnd > 0) {\n var closed = fitRightClosed(content.lastChild, openEnd - 1, $from, depth + 1,\n count == 1 ? openStart - 1 : -1);\n content = content.replaceChild(count - 1, closed);\n }\n content = content.append(joinable);\n if ($to.depth > depth)\n { content = content.addToEnd(fitRightSeparate($to, depth + 1)); }\n return content\n}\n\nfunction fitRightClosed(node, openEnd, $from, depth, openStart) {\n var match, content = node.content, count = content.childCount;\n if (openStart >= 0)\n { match = $from.node(depth).contentMatchAt($from.indexAfter(depth))\n .matchFragment(content, openStart > 0 ? 1 : 0, count); }\n else\n { match = node.contentMatchAt(count); }\n\n if (openEnd > 0) {\n var closed = fitRightClosed(content.lastChild, openEnd - 1, $from, depth + 1,\n count == 1 ? openStart - 1 : -1);\n content = content.replaceChild(count - 1, closed);\n }\n\n return node.copy(content.append(match.fillBefore(prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].empty, true)))\n}\n\nfunction fitRightSeparate($to, depth) {\n var node = $to.node(depth);\n var fill = node.contentMatchAt(0).fillBefore(node.content, true, $to.index(depth));\n if ($to.depth > depth) { fill = fill.addToEnd(fitRightSeparate($to, depth + 1)); }\n return node.copy(fill)\n}\n\nfunction normalizeSlice(content, openStart, openEnd) {\n while (openStart > 0 && openEnd > 0 && content.childCount == 1) {\n content = content.firstChild.content;\n openStart--;\n openEnd--;\n }\n return new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](content, openStart, openEnd)\n}\n\n// : (ResolvedPos, ResolvedPos, number, Slice) → Slice\nfunction fitRight($from, $to, slice) {\n var fitted = fitRightJoin(slice.content, $from.node(0), $from, $to, 0, slice.openStart, slice.openEnd);\n if (!fitted) { return null }\n return normalizeSlice(fitted, slice.openStart, $to.depth)\n}\n\nfunction fitsTrivially($from, $to, slice) {\n return !slice.openStart && !slice.openEnd && $from.start() == $to.start() &&\n $from.parent.canReplace($from.index(), $to.index(), slice.content)\n}\n\nfunction canMoveText($from, $to, slice) {\n if (!$to.parent.isTextblock) { return false }\n\n var parent = slice.openEnd ? nodeRight(slice.content, slice.openEnd)\n : $from.node($from.depth - (slice.openStart - slice.openEnd));\n if (!parent.isTextblock) { return false }\n for (var i = $to.index(); i < $to.parent.childCount; i++)\n { if (!parent.type.allowsMarks($to.parent.child(i).marks)) { return false } }\n var match;\n if (slice.openEnd) {\n match = parent.contentMatchAt(parent.childCount);\n } else {\n match = parent.contentMatchAt(parent.childCount);\n if (slice.size) { match = match.matchFragment(slice.content, slice.openStart ? 1 : 0); }\n }\n match = match.matchFragment($to.parent.content, $to.index());\n return match && match.validEnd\n}\n\nfunction nodeRight(content, depth) {\n for (var i = 1; i < depth; i++) { content = content.lastChild.content; }\n return content.lastChild\n}\n\n// Algorithm for 'placing' the elements of a slice into a gap:\n//\n// We consider the content of each node that is open to the left to be\n// independently placeable. I.e. in , when the\n// paragraph on the left is open, \"foo\" can be placed (somewhere on\n// the left side of the replacement gap) independently from p(\"bar\").\n//\n// So placeSlice splits up a slice into a number of sub-slices,\n// along with information on where they can be placed on the given\n// left-side edge. It works by walking the open side of the slice,\n// from the inside out, and trying to find a landing spot for each\n// element, by simultaneously scanning over the gap side. When no\n// place is found for an open node's content, it is left in that node.\n\n// : (ResolvedPos, Slice) → [{content: Fragment, openEnd: number, depth: number}]\nfunction placeSlice($from, slice) {\n var frontier = new Frontier($from);\n for (var pass = 1; slice.size && pass <= 3; pass++) {\n var value = frontier.placeSlice(slice.content, slice.openStart, slice.openEnd, pass);\n if (pass == 3 && value != slice && value.size) { pass = 0; } // Restart if the 3rd pass made progress but left content\n slice = value;\n }\n while (frontier.open.length) { frontier.closeNode(); }\n return frontier.placed\n}\n\n// Helper class that models the open side of the insert position,\n// keeping track of the content match and already inserted content\n// at each depth.\nvar Frontier = function Frontier($pos) {\n // : [{parent: Node, match: ContentMatch, content: Fragment, wrapper: bool, openEnd: number, depth: number}]\n this.open = [];\n for (var d = 0; d <= $pos.depth; d++) {\n var parent = $pos.node(d), match = parent.contentMatchAt($pos.indexAfter(d));\n this.open.push({parent: parent, match: match, content: prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].empty, wrapper: false, openEnd: 0, depth: d});\n }\n this.placed = [];\n};\n\n// : (Fragment, number, number, number, ?Node) → Slice\n// Tries to place the content of the given slice, and returns a\n// slice containing unplaced content.\n//\n// pass 1: try to fit directly\n// pass 2: allow wrapper nodes to be introduced\n// pass 3: allow unwrapping of nodes that aren't open\nFrontier.prototype.placeSlice = function placeSlice (fragment, openStart, openEnd, pass, parent) {\n if (openStart > 0) {\n var first = fragment.firstChild;\n var inner = this.placeSlice(first.content, Math.max(0, openStart - 1),\n openEnd && fragment.childCount == 1 ? openEnd - 1 : 0,\n pass, first);\n if (inner.content != first.content) {\n if (inner.content.size) {\n fragment = fragment.replaceChild(0, first.copy(inner.content));\n openStart = inner.openStart + 1;\n } else {\n if (fragment.childCount == 1) { openEnd = 0; }\n fragment = fragment.cutByIndex(1);\n openStart = 0;\n }\n }\n }\n var result = this.placeContent(fragment, openStart, openEnd, pass, parent);\n if (pass > 2 && result.size && openStart == 0) {\n var child = result.content.firstChild, single = result.content.childCount == 1;\n this.placeContent(child.content, 0, openEnd && single ? openEnd - 1 : 0, pass, child);\n result = single ? prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].empty : new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](result.content.cutByIndex(1), 0, openEnd);\n }\n return result\n};\n\nFrontier.prototype.placeContent = function placeContent (fragment, openStart, openEnd, pass, parent) {\n var i = 0;\n // Go over the fragment's children\n for (; i < fragment.childCount; i++) {\n var child = fragment.child(i), placed = false, last = i == fragment.childCount - 1;\n // Try each open node in turn, starting from the innermost\n for (var d = this.open.length - 1; d >= 0; d--) {\n var open = this.open[d], wrap = (void 0);\n\n // If pass > 1, it is allowed to wrap the node to help find a\n // fit, so if findWrapping returns something, we add open\n // nodes to the frontier for that wrapping.\n if (pass > 1 && (wrap = open.match.findWrapping(child.type)) &&\n !(parent && wrap.length && wrap[wrap.length - 1] == parent.type)) {\n while (this.open.length - 1 > d) { this.closeNode(); }\n for (var w = 0; w < wrap.length; w++) {\n open.match = open.match.matchType(wrap[w]);\n d++;\n open = {parent: wrap[w].create(),\n match: wrap[w].contentMatch,\n content: prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].empty, wrapper: true, openEnd: 0, depth: d + w};\n this.open.push(open);\n }\n }\n\n // See if the child fits here\n var match = open.match.matchType(child.type);\n if (!match) {\n var fill = open.match.fillBefore(prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].from(child));\n if (fill) {\n for (var j = 0; j < fill.childCount; j++) {\n var ch = fill.child(j);\n this.addNode(open, ch, 0);\n match = open.match.matchFragment(ch);\n }\n } else if (parent && open.match.matchType(parent.type)) {\n // Don't continue looking further up if the parent node\n // would fit here.\n break\n } else {\n continue\n }\n }\n\n // Close open nodes above this one, since we're starting to\n // add to this.\n while (this.open.length - 1 > d) { this.closeNode(); }\n // Strip marks from the child or close its start when necessary\n child = child.mark(open.parent.type.allowedMarks(child.marks));\n if (openStart) {\n child = closeNodeStart(child, openStart, last ? openEnd : 0);\n openStart = 0;\n }\n // Add the child to this open node and adjust its metadata\n this.addNode(open, child, last ? openEnd : 0);\n open.match = match;\n if (last) { openEnd = 0; }\n placed = true;\n break\n }\n // As soon as we've failed to place a node we stop looking at\n // later nodes\n if (!placed) { break }\n }\n // Close the current open node if it's not the the root and we\n // either placed up to the end of the node or the the current\n // slice depth's node type matches the open node's type\n if (this.open.length > 1 &&\n (i > 0 && i == fragment.childCount ||\n parent && this.open[this.open.length - 1].parent.type == parent.type))\n { this.closeNode(); }\n\n return new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](fragment.cutByIndex(i), openStart, openEnd)\n};\n\nFrontier.prototype.addNode = function addNode (open, node, openEnd) {\n open.content = closeFragmentEnd(open.content, open.openEnd).addToEnd(node);\n open.openEnd = openEnd;\n};\n\nFrontier.prototype.closeNode = function closeNode () {\n var open = this.open.pop();\n if (open.content.size == 0) ; else if (open.wrapper) {\n this.addNode(this.open[this.open.length - 1], open.parent.copy(open.content), open.openEnd + 1);\n } else {\n this.placed[open.depth] = {depth: open.depth, content: open.content, openEnd: open.openEnd};\n }\n};\n\nfunction closeNodeStart(node, openStart, openEnd) {\n var content = node.content;\n if (openStart > 1) {\n var first = closeNodeStart(node.firstChild, openStart - 1, node.childCount == 1 ? openEnd - 1 : 0);\n content = node.content.replaceChild(0, first);\n }\n var fill = node.type.contentMatch.fillBefore(content, openEnd == 0);\n return node.copy(fill.append(content))\n}\n\nfunction closeNodeEnd(node, depth) {\n var content = node.content;\n if (depth > 1) {\n var last = closeNodeEnd(node.lastChild, depth - 1);\n content = node.content.replaceChild(node.childCount - 1, last);\n }\n var fill = node.contentMatchAt(node.childCount).fillBefore(prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].empty, true);\n return node.copy(content.append(fill))\n}\n\nfunction closeFragmentEnd(fragment, depth) {\n return depth ? fragment.replaceChild(fragment.childCount - 1, closeNodeEnd(fragment.lastChild, depth)) : fragment\n}\n\n// :: (number, number, Slice) → this\n// Replace a range of the document with a given slice, using `from`,\n// `to`, and the slice's [`openStart`](#model.Slice.openStart) property\n// as hints, rather than fixed start and end points. This method may\n// grow the replaced area or close open nodes in the slice in order to\n// get a fit that is more in line with WYSIWYG expectations, by\n// dropping fully covered parent nodes of the replaced region when\n// they are marked [non-defining](#model.NodeSpec.defining), or\n// including an open parent node from the slice that _is_ marked as\n// [defining](#model.NodeSpec.defining).\n//\n// This is the method, for example, to handle paste. The similar\n// [`replace`](#transform.Transform.replace) method is a more\n// primitive tool which will _not_ move the start and end of its given\n// range, and is useful in situations where you need more precise\n// control over what happens.\nTransform.prototype.replaceRange = function(from, to, slice) {\n if (!slice.size) { return this.deleteRange(from, to) }\n\n var $from = this.doc.resolve(from), $to = this.doc.resolve(to);\n if (fitsTrivially($from, $to, slice))\n { return this.step(new ReplaceStep(from, to, slice)) }\n\n var targetDepths = coveredDepths($from, this.doc.resolve(to));\n // Can't replace the whole document, so remove 0 if it's present\n if (targetDepths[targetDepths.length - 1] == 0) { targetDepths.pop(); }\n // Negative numbers represent not expansion over the whole node at\n // that depth, but replacing from $from.before(-D) to $to.pos.\n var preferredTarget = -($from.depth + 1);\n targetDepths.unshift(preferredTarget);\n // This loop picks a preferred target depth, if one of the covering\n // depths is not outside of a defining node, and adds negative\n // depths for any depth that has $from at its start and does not\n // cross a defining node.\n for (var d = $from.depth, pos = $from.pos - 1; d > 0; d--, pos--) {\n var spec = $from.node(d).type.spec;\n if (spec.defining || spec.isolating) { break }\n if (targetDepths.indexOf(d) > -1) { preferredTarget = d; }\n else if ($from.before(d) == pos) { targetDepths.splice(1, 0, -d); }\n }\n // Try to fit each possible depth of the slice into each possible\n // target depth, starting with the preferred depths.\n var preferredTargetIndex = targetDepths.indexOf(preferredTarget);\n\n var leftNodes = [], preferredDepth = slice.openStart;\n for (var content = slice.content, i = 0;; i++) {\n var node = content.firstChild;\n leftNodes.push(node);\n if (i == slice.openStart) { break }\n content = node.content;\n }\n // Back up if the node directly above openStart, or the node above\n // that separated only by a non-defining textblock node, is defining.\n if (preferredDepth > 0 && leftNodes[preferredDepth - 1].type.spec.defining &&\n $from.node(preferredTargetIndex).type != leftNodes[preferredDepth - 1].type)\n { preferredDepth -= 1; }\n else if (preferredDepth >= 2 && leftNodes[preferredDepth - 1].isTextblock && leftNodes[preferredDepth - 2].type.spec.defining &&\n $from.node(preferredTargetIndex).type != leftNodes[preferredDepth - 2].type)\n { preferredDepth -= 2; }\n\n for (var j = slice.openStart; j >= 0; j--) {\n var openDepth = (j + preferredDepth + 1) % (slice.openStart + 1);\n var insert = leftNodes[openDepth];\n if (!insert) { continue }\n for (var i$1 = 0; i$1 < targetDepths.length; i$1++) {\n // Loop over possible expansion levels, starting with the\n // preferred one\n var targetDepth = targetDepths[(i$1 + preferredTargetIndex) % targetDepths.length], expand = true;\n if (targetDepth < 0) { expand = false; targetDepth = -targetDepth; }\n var parent = $from.node(targetDepth - 1), index = $from.index(targetDepth - 1);\n if (parent.canReplaceWith(index, index, insert.type, insert.marks))\n { return this.replace($from.before(targetDepth), expand ? $to.after(targetDepth) : to,\n new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](closeFragment(slice.content, 0, slice.openStart, openDepth),\n openDepth, slice.openEnd)) }\n }\n }\n\n var startSteps = this.steps.length;\n for (var i$2 = targetDepths.length - 1; i$2 >= 0; i$2--) {\n this.replace(from, to, slice);\n if (this.steps.length > startSteps) { break }\n var depth = targetDepths[i$2];\n if (i$2 < 0) { continue }\n from = $from.before(depth); to = $to.after(depth);\n }\n return this\n};\n\nfunction closeFragment(fragment, depth, oldOpen, newOpen, parent) {\n if (depth < oldOpen) {\n var first = fragment.firstChild;\n fragment = fragment.replaceChild(0, first.copy(closeFragment(first.content, depth + 1, oldOpen, newOpen, first)));\n }\n if (depth > newOpen) {\n var match = parent.contentMatchAt(0);\n var start = match.fillBefore(fragment).append(fragment);\n fragment = start.append(match.matchFragment(start).fillBefore(prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].empty, true));\n }\n return fragment\n}\n\n// :: (number, number, Node) → this\n// Replace the given range with a node, but use `from` and `to` as\n// hints, rather than precise positions. When from and to are the same\n// and are at the start or end of a parent node in which the given\n// node doesn't fit, this method may _move_ them out towards a parent\n// that does allow the given node to be placed. When the given range\n// completely covers a parent node, this method may completely replace\n// that parent node.\nTransform.prototype.replaceRangeWith = function(from, to, node) {\n if (!node.isInline && from == to && this.doc.resolve(from).parent.content.size) {\n var point = insertPoint(this.doc, from, node.type);\n if (point != null) { from = to = point; }\n }\n return this.replaceRange(from, to, new prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"](prosemirror_model__WEBPACK_IMPORTED_MODULE_0__[\"Fragment\"].from(node), 0, 0))\n};\n\n// :: (number, number) → this\n// Delete the given range, expanding it to cover fully covered\n// parent nodes until a valid replace is found.\nTransform.prototype.deleteRange = function(from, to) {\n var $from = this.doc.resolve(from), $to = this.doc.resolve(to);\n var covered = coveredDepths($from, $to);\n for (var i = 0; i < covered.length; i++) {\n var depth = covered[i], last = i == covered.length - 1;\n if ((last && depth == 0) || $from.node(depth).type.contentMatch.validEnd)\n { return this.delete($from.start(depth), $to.end(depth)) }\n if (depth > 0 && (last || $from.node(depth - 1).canReplace($from.index(depth - 1), $to.indexAfter(depth - 1))))\n { return this.delete($from.before(depth), $to.after(depth)) }\n }\n for (var d = 1; d <= $from.depth && d <= $to.depth; d++) {\n if (from - $from.start(d) == $from.depth - d && to > $from.end(d) && $to.end(d) - to != $to.depth - d)\n { return this.delete($from.before(d), to) }\n }\n return this.delete(from, to)\n};\n\n// : (ResolvedPos, ResolvedPos) → [number]\n// Returns an array of all depths for which $from - $to spans the\n// whole content of the nodes at that depth.\nfunction coveredDepths($from, $to) {\n var result = [], minDepth = Math.min($from.depth, $to.depth);\n for (var d = minDepth; d >= 0; d--) {\n var start = $from.start(d);\n if (start < $from.pos - ($from.depth - d) ||\n $to.end(d) > $to.pos + ($to.depth - d) ||\n $from.node(d).type.spec.isolating ||\n $to.node(d).type.spec.isolating) { break }\n if (start == $to.start(d)) { result.push(d); }\n }\n return result\n}\n\n\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/prosemirror-transform/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/prosemirror-view/dist/index.es.js": +/*!********************************************************!*\ + !*** ./node_modules/prosemirror-view/dist/index.es.js ***! + \********************************************************/ +/*! exports provided: Decoration, DecorationSet, EditorView, __endComposition, __parseFromClipboard, __serializeForClipboard */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Decoration\", function() { return Decoration; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DecorationSet\", function() { return DecorationSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EditorView\", function() { return EditorView; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__endComposition\", function() { return endComposition; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__parseFromClipboard\", function() { return parseFromClipboard; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__serializeForClipboard\", function() { return serializeForClipboard; });\n/* harmony import */ var prosemirror_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prosemirror-state */ \"./node_modules/prosemirror-state/dist/index.es.js\");\n/* harmony import */ var prosemirror_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prosemirror-model */ \"./node_modules/prosemirror-model/dist/index.es.js\");\n/* harmony import */ var prosemirror_transform__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prosemirror-transform */ \"./node_modules/prosemirror-transform/dist/index.es.js\");\n\n\n\n\nvar result = {};\n\nif (typeof navigator != \"undefined\" && typeof document != \"undefined\") {\n var ie_edge = /Edge\\/(\\d+)/.exec(navigator.userAgent);\n var ie_upto10 = /MSIE \\d/.test(navigator.userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent);\n\n result.mac = /Mac/.test(navigator.platform);\n var ie = result.ie = !!(ie_upto10 || ie_11up || ie_edge);\n result.ie_version = ie_upto10 ? document.documentMode || 6 : ie_11up ? +ie_11up[1] : ie_edge ? +ie_edge[1] : null;\n result.gecko = !ie && /gecko\\/(\\d+)/i.test(navigator.userAgent);\n result.gecko_version = result.gecko && +(/Firefox\\/(\\d+)/.exec(navigator.userAgent) || [0, 0])[1];\n var chrome = !ie && /Chrome\\/(\\d+)/.exec(navigator.userAgent);\n result.chrome = !!chrome;\n result.chrome_version = chrome && +chrome[1];\n result.ios = !ie && /AppleWebKit/.test(navigator.userAgent) && /Mobile\\/\\w+/.test(navigator.userAgent);\n result.android = /Android \\d/.test(navigator.userAgent);\n result.webkit = !ie && 'WebkitAppearance' in document.documentElement.style;\n result.safari = /Apple Computer/.test(navigator.vendor);\n result.webkit_version = result.webkit && +(/\\bAppleWebKit\\/(\\d+)/.exec(navigator.userAgent) || [0, 0])[1];\n}\n\nvar domIndex = function(node) {\n for (var index = 0;; index++) {\n node = node.previousSibling;\n if (!node) { return index }\n }\n};\n\nvar parentNode = function(node) {\n var parent = node.parentNode;\n return parent && parent.nodeType == 11 ? parent.host : parent\n};\n\nvar textRange = function(node, from, to) {\n var range = document.createRange();\n range.setEnd(node, to == null ? node.nodeValue.length : to);\n range.setStart(node, from || 0);\n return range\n};\n\n// Scans forward and backward through DOM positions equivalent to the\n// given one to see if the two are in the same place (i.e. after a\n// text node vs at the end of that text node)\nvar isEquivalentPosition = function(node, off, targetNode, targetOff) {\n return targetNode && (scanFor(node, off, targetNode, targetOff, -1) ||\n scanFor(node, off, targetNode, targetOff, 1))\n};\n\nvar atomElements = /^(img|br|input|textarea|hr)$/i;\n\nfunction scanFor(node, off, targetNode, targetOff, dir) {\n for (;;) {\n if (node == targetNode && off == targetOff) { return true }\n if (off == (dir < 0 ? 0 : nodeSize(node))) {\n var parent = node.parentNode;\n if (parent.nodeType != 1 || hasBlockDesc(node) || atomElements.test(node.nodeName) || node.contentEditable == \"false\")\n { return false }\n off = domIndex(node) + (dir < 0 ? 0 : 1);\n node = parent;\n } else if (node.nodeType == 1) {\n node = node.childNodes[off + (dir < 0 ? -1 : 0)];\n if (node.contentEditable == \"false\") { return false }\n off = dir < 0 ? nodeSize(node) : 0;\n } else {\n return false\n }\n }\n}\n\nfunction nodeSize(node) {\n return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length\n}\n\nfunction isOnEdge(node, offset, parent) {\n for (var atStart = offset == 0, atEnd = offset == nodeSize(node); atStart || atEnd;) {\n if (node == parent) { return true }\n var index = domIndex(node);\n node = node.parentNode;\n if (!node) { return false }\n atStart = atStart && index == 0;\n atEnd = atEnd && index == nodeSize(node);\n }\n}\n\nfunction hasBlockDesc(dom) {\n var desc;\n for (var cur = dom; cur; cur = cur.parentNode) { if (desc = cur.pmViewDesc) { break } }\n return desc && desc.node && desc.node.isBlock && (desc.dom == dom || desc.contentDOM == dom)\n}\n\n// Work around Chrome issue https://bugs.chromium.org/p/chromium/issues/detail?id=447523\n// (isCollapsed inappropriately returns true in shadow dom)\nvar selectionCollapsed = function(domSel) {\n var collapsed = domSel.isCollapsed;\n if (collapsed && result.chrome && domSel.rangeCount && !domSel.getRangeAt(0).collapsed)\n { collapsed = false; }\n return collapsed\n};\n\nfunction keyEvent(keyCode, key) {\n var event = document.createEvent(\"Event\");\n event.initEvent(\"keydown\", true, true);\n event.keyCode = keyCode;\n event.key = event.code = key;\n return event\n}\n\nfunction windowRect(win) {\n return {left: 0, right: win.innerWidth,\n top: 0, bottom: win.innerHeight}\n}\n\nfunction getSide(value, side) {\n return typeof value == \"number\" ? value : value[side]\n}\n\nfunction scrollRectIntoView(view, rect, startDOM) {\n var scrollThreshold = view.someProp(\"scrollThreshold\") || 0, scrollMargin = view.someProp(\"scrollMargin\") || 5;\n var doc = view.dom.ownerDocument, win = doc.defaultView;\n for (var parent = startDOM || view.dom;; parent = parentNode(parent)) {\n if (!parent) { break }\n if (parent.nodeType != 1) { continue }\n var atTop = parent == doc.body || parent.nodeType != 1;\n var bounding = atTop ? windowRect(win) : parent.getBoundingClientRect();\n var moveX = 0, moveY = 0;\n if (rect.top < bounding.top + getSide(scrollThreshold, \"top\"))\n { moveY = -(bounding.top - rect.top + getSide(scrollMargin, \"top\")); }\n else if (rect.bottom > bounding.bottom - getSide(scrollThreshold, \"bottom\"))\n { moveY = rect.bottom - bounding.bottom + getSide(scrollMargin, \"bottom\"); }\n if (rect.left < bounding.left + getSide(scrollThreshold, \"left\"))\n { moveX = -(bounding.left - rect.left + getSide(scrollMargin, \"left\")); }\n else if (rect.right > bounding.right - getSide(scrollThreshold, \"right\"))\n { moveX = rect.right - bounding.right + getSide(scrollMargin, \"right\"); }\n if (moveX || moveY) {\n if (atTop) {\n win.scrollBy(moveX, moveY);\n } else {\n if (moveY) { parent.scrollTop += moveY; }\n if (moveX) { parent.scrollLeft += moveX; }\n rect = {left: rect.left - moveX, top: rect.top - moveY, right: rect.right - moveX, bottom: rect.bottom - moveY};\n }\n }\n if (atTop) { break }\n }\n}\n\n// Store the scroll position of the editor's parent nodes, along with\n// the top position of an element near the top of the editor, which\n// will be used to make sure the visible viewport remains stable even\n// when the size of the content above changes.\nfunction storeScrollPos(view) {\n var rect = view.dom.getBoundingClientRect(), startY = Math.max(0, rect.top);\n var refDOM, refTop;\n for (var x = (rect.left + rect.right) / 2, y = startY + 1;\n y < Math.min(innerHeight, rect.bottom); y += 5) {\n var dom = view.root.elementFromPoint(x, y);\n if (dom == view.dom || !view.dom.contains(dom)) { continue }\n var localRect = dom.getBoundingClientRect();\n if (localRect.top >= startY - 20) {\n refDOM = dom;\n refTop = localRect.top;\n break\n }\n }\n return {refDOM: refDOM, refTop: refTop, stack: scrollStack(view.dom)}\n}\n\nfunction scrollStack(dom) {\n var stack = [], doc = dom.ownerDocument;\n for (; dom; dom = parentNode(dom)) {\n stack.push({dom: dom, top: dom.scrollTop, left: dom.scrollLeft});\n if (dom == doc) { break }\n }\n return stack\n}\n\n// Reset the scroll position of the editor's parent nodes to that what\n// it was before, when storeScrollPos was called.\nfunction resetScrollPos(ref) {\n var refDOM = ref.refDOM;\n var refTop = ref.refTop;\n var stack = ref.stack;\n\n var newRefTop = refDOM ? refDOM.getBoundingClientRect().top : 0;\n restoreScrollStack(stack, newRefTop == 0 ? 0 : newRefTop - refTop);\n}\n\nfunction restoreScrollStack(stack, dTop) {\n for (var i = 0; i < stack.length; i++) {\n var ref = stack[i];\n var dom = ref.dom;\n var top = ref.top;\n var left = ref.left;\n if (dom.scrollTop != top + dTop) { dom.scrollTop = top + dTop; }\n if (dom.scrollLeft != left) { dom.scrollLeft = left; }\n }\n}\n\nvar preventScrollSupported = null;\n// Feature-detects support for .focus({preventScroll: true}), and uses\n// a fallback kludge when not supported.\nfunction focusPreventScroll(dom) {\n if (dom.setActive) { return dom.setActive() } // in IE\n if (preventScrollSupported) { return dom.focus(preventScrollSupported) }\n\n var stored = scrollStack(dom);\n dom.focus(preventScrollSupported == null ? {\n get preventScroll() {\n preventScrollSupported = {preventScroll: true};\n return true\n }\n } : undefined);\n if (!preventScrollSupported) {\n preventScrollSupported = false;\n restoreScrollStack(stored, 0);\n }\n}\n\nfunction findOffsetInNode(node, coords) {\n var closest, dxClosest = 2e8, coordsClosest, offset = 0;\n var rowBot = coords.top, rowTop = coords.top;\n for (var child = node.firstChild, childIndex = 0; child; child = child.nextSibling, childIndex++) {\n var rects = (void 0);\n if (child.nodeType == 1) { rects = child.getClientRects(); }\n else if (child.nodeType == 3) { rects = textRange(child).getClientRects(); }\n else { continue }\n\n for (var i = 0; i < rects.length; i++) {\n var rect = rects[i];\n if (rect.top <= rowBot && rect.bottom >= rowTop) {\n rowBot = Math.max(rect.bottom, rowBot);\n rowTop = Math.min(rect.top, rowTop);\n var dx = rect.left > coords.left ? rect.left - coords.left\n : rect.right < coords.left ? coords.left - rect.right : 0;\n if (dx < dxClosest) {\n closest = child;\n dxClosest = dx;\n coordsClosest = dx && closest.nodeType == 3 ? {left: rect.right < coords.left ? rect.right : rect.left, top: coords.top} : coords;\n if (child.nodeType == 1 && dx)\n { offset = childIndex + (coords.left >= (rect.left + rect.right) / 2 ? 1 : 0); }\n continue\n }\n }\n if (!closest && (coords.left >= rect.right && coords.top >= rect.top ||\n coords.left >= rect.left && coords.top >= rect.bottom))\n { offset = childIndex + 1; }\n }\n }\n if (closest && closest.nodeType == 3) { return findOffsetInText(closest, coordsClosest) }\n if (!closest || (dxClosest && closest.nodeType == 1)) { return {node: node, offset: offset} }\n return findOffsetInNode(closest, coordsClosest)\n}\n\nfunction findOffsetInText(node, coords) {\n var len = node.nodeValue.length;\n var range = document.createRange();\n for (var i = 0; i < len; i++) {\n range.setEnd(node, i + 1);\n range.setStart(node, i);\n var rect = singleRect(range, 1);\n if (rect.top == rect.bottom) { continue }\n if (inRect(coords, rect))\n { return {node: node, offset: i + (coords.left >= (rect.left + rect.right) / 2 ? 1 : 0)} }\n }\n return {node: node, offset: 0}\n}\n\nfunction inRect(coords, rect) {\n return coords.left >= rect.left - 1 && coords.left <= rect.right + 1&&\n coords.top >= rect.top - 1 && coords.top <= rect.bottom + 1\n}\n\nfunction targetKludge(dom, coords) {\n var parent = dom.parentNode;\n if (parent && /^li$/i.test(parent.nodeName) && coords.left < dom.getBoundingClientRect().left)\n { return parent }\n return dom\n}\n\nfunction posFromElement(view, elt, coords) {\n var ref = findOffsetInNode(elt, coords);\n var node = ref.node;\n var offset = ref.offset;\n var bias = -1;\n if (node.nodeType == 1 && !node.firstChild) {\n var rect = node.getBoundingClientRect();\n bias = rect.left != rect.right && coords.left > (rect.left + rect.right) / 2 ? 1 : -1;\n }\n return view.docView.posFromDOM(node, offset, bias)\n}\n\nfunction posFromCaret(view, node, offset, coords) {\n // Browser (in caretPosition/RangeFromPoint) will agressively\n // normalize towards nearby inline nodes. Since we are interested in\n // positions between block nodes too, we first walk up the hierarchy\n // of nodes to see if there are block nodes that the coordinates\n // fall outside of. If so, we take the position before/after that\n // block. If not, we call `posFromDOM` on the raw node/offset.\n var outside = -1;\n for (var cur = node;;) {\n if (cur == view.dom) { break }\n var desc = view.docView.nearestDesc(cur, true);\n if (!desc) { return null }\n if (desc.node.isBlock && desc.parent) {\n var rect = desc.dom.getBoundingClientRect();\n if (rect.left > coords.left || rect.top > coords.top) { outside = desc.posBefore; }\n else if (rect.right < coords.left || rect.bottom < coords.top) { outside = desc.posAfter; }\n else { break }\n }\n cur = desc.dom.parentNode;\n }\n return outside > -1 ? outside : view.docView.posFromDOM(node, offset)\n}\n\nfunction elementFromPoint(element, coords, box) {\n var len = element.childNodes.length;\n if (len && box.top < box.bottom) {\n for (var startI = Math.max(0, Math.min(len - 1, Math.floor(len * (coords.top - box.top) / (box.bottom - box.top)) - 2)), i = startI;;) {\n var child = element.childNodes[i];\n if (child.nodeType == 1) {\n var rects = child.getClientRects();\n for (var j = 0; j < rects.length; j++) {\n var rect = rects[j];\n if (inRect(coords, rect)) { return elementFromPoint(child, coords, rect) }\n }\n }\n if ((i = (i + 1) % len) == startI) { break }\n }\n }\n return element\n}\n\n// Given an x,y position on the editor, get the position in the document.\nfunction posAtCoords(view, coords) {\n var assign, assign$1;\n\n var root = view.root, node, offset;\n if (root.caretPositionFromPoint) {\n try { // Firefox throws for this call in hard-to-predict circumstances (#994)\n var pos$1 = root.caretPositionFromPoint(coords.left, coords.top);\n if (pos$1) { ((assign = pos$1, node = assign.offsetNode, offset = assign.offset)); }\n } catch (_) {}\n }\n if (!node && root.caretRangeFromPoint) {\n var range = root.caretRangeFromPoint(coords.left, coords.top);\n if (range) { ((assign$1 = range, node = assign$1.startContainer, offset = assign$1.startOffset)); }\n }\n\n var elt = root.elementFromPoint(coords.left, coords.top + 1), pos;\n if (!elt || !view.dom.contains(elt.nodeType != 1 ? elt.parentNode : elt)) {\n var box = view.dom.getBoundingClientRect();\n if (!inRect(coords, box)) { return null }\n elt = elementFromPoint(view.dom, coords, box);\n if (!elt) { return null }\n }\n elt = targetKludge(elt, coords);\n if (node) {\n if (result.gecko && node.nodeType == 1) {\n // Firefox will sometimes return offsets into nodes, which\n // have no actual children, from caretPositionFromPoint (#953)\n offset = Math.min(offset, node.childNodes.length);\n // It'll also move the returned position before image nodes,\n // even if those are behind it.\n if (offset < node.childNodes.length) {\n var next = node.childNodes[offset], box$1;\n if (next.nodeName == \"IMG\" && (box$1 = next.getBoundingClientRect()).right <= coords.left &&\n box$1.bottom > coords.top)\n { offset++; }\n }\n }\n // Suspiciously specific kludge to work around caret*FromPoint\n // never returning a position at the end of the document\n if (node == view.dom && offset == node.childNodes.length - 1 && node.lastChild.nodeType == 1 &&\n coords.top > node.lastChild.getBoundingClientRect().bottom)\n { pos = view.state.doc.content.size; }\n // Ignore positions directly after a BR, since caret*FromPoint\n // 'round up' positions that would be more accurately placed\n // before the BR node.\n else if (offset == 0 || node.nodeType != 1 || node.childNodes[offset - 1].nodeName != \"BR\")\n { pos = posFromCaret(view, node, offset, coords); }\n }\n if (pos == null) { pos = posFromElement(view, elt, coords); }\n\n var desc = view.docView.nearestDesc(elt, true);\n return {pos: pos, inside: desc ? desc.posAtStart - desc.border : -1}\n}\n\nfunction singleRect(object, bias) {\n var rects = object.getClientRects();\n return !rects.length ? object.getBoundingClientRect() : rects[bias < 0 ? 0 : rects.length - 1]\n}\n\n// : (EditorView, number) → {left: number, top: number, right: number, bottom: number}\n// Given a position in the document model, get a bounding box of the\n// character at that position, relative to the window.\nfunction coordsAtPos(view, pos) {\n var ref = view.docView.domFromPos(pos);\n var node = ref.node;\n var offset = ref.offset;\n\n // These browsers support querying empty text ranges\n if (node.nodeType == 3 && (result.chrome || result.gecko)) {\n var rect = singleRect(textRange(node, offset, offset), 0);\n // Firefox returns bad results (the position before the space)\n // when querying a position directly after line-broken\n // whitespace. Detect this situation and and kludge around it\n if (result.gecko && offset && /\\s/.test(node.nodeValue[offset - 1]) && offset < node.nodeValue.length) {\n var rectBefore = singleRect(textRange(node, offset - 1, offset - 1), -1);\n if (Math.abs(rectBefore.left - rect.left) < 1 && rectBefore.top == rect.top) {\n var rectAfter = singleRect(textRange(node, offset, offset + 1), -1);\n return flattenV(rectAfter, rectAfter.left < rectBefore.left)\n }\n }\n return rect\n }\n\n if (node.nodeType == 1 && !view.state.doc.resolve(pos).parent.inlineContent) {\n // Return a horizontal line in block context\n var top = true, rect$1;\n if (offset < node.childNodes.length) {\n var after = node.childNodes[offset];\n if (after.nodeType == 1) { rect$1 = after.getBoundingClientRect(); }\n }\n if (!rect$1 && offset) {\n var before = node.childNodes[offset - 1];\n if (before.nodeType == 1) { rect$1 = before.getBoundingClientRect(); top = false; }\n }\n return flattenH(rect$1 || node.getBoundingClientRect(), top)\n }\n\n // Not Firefox/Chrome, or not in a text node, so we have to use\n // actual element/character rectangles to get a solution (this part\n // is not very bidi-safe)\n //\n // Try the left side first, fall back to the right one if that\n // doesn't work.\n for (var dir = -1; dir < 2; dir += 2) {\n if (dir < 0 && offset) {\n var prev = (void 0), target = node.nodeType == 3 ? textRange(node, offset - 1, offset)\n : (prev = node.childNodes[offset - 1]).nodeType == 3 ? textRange(prev)\n : prev.nodeType == 1 && prev.nodeName != \"BR\" ? prev : null; // BR nodes tend to only return the rectangle before them\n if (target) {\n var rect$2 = singleRect(target, 1);\n if (rect$2.top < rect$2.bottom) { return flattenV(rect$2, false) }\n }\n } else if (dir > 0 && offset < nodeSize(node)) {\n var next = (void 0), target$1 = node.nodeType == 3 ? textRange(node, offset, offset + 1)\n : (next = node.childNodes[offset]).nodeType == 3 ? textRange(next)\n : next.nodeType == 1 ? next : null;\n if (target$1) {\n var rect$3 = singleRect(target$1, -1);\n if (rect$3.top < rect$3.bottom) { return flattenV(rect$3, true) }\n }\n }\n }\n // All else failed, just try to get a rectangle for the target node\n return flattenV(singleRect(node.nodeType == 3 ? textRange(node) : node, 0), false)\n}\n\nfunction flattenV(rect, left) {\n if (rect.width == 0) { return rect }\n var x = left ? rect.left : rect.right;\n return {top: rect.top, bottom: rect.bottom, left: x, right: x}\n}\n\nfunction flattenH(rect, top) {\n if (rect.height == 0) { return rect }\n var y = top ? rect.top : rect.bottom;\n return {top: y, bottom: y, left: rect.left, right: rect.right}\n}\n\nfunction withFlushedState(view, state, f) {\n var viewState = view.state, active = view.root.activeElement;\n if (viewState != state) { view.updateState(state); }\n if (active != view.dom) { view.focus(); }\n try {\n return f()\n } finally {\n if (viewState != state) { view.updateState(viewState); }\n if (active != view.dom) { active.focus(); }\n }\n}\n\n// : (EditorView, number, number)\n// Whether vertical position motion in a given direction\n// from a position would leave a text block.\nfunction endOfTextblockVertical(view, state, dir) {\n var sel = state.selection;\n var $pos = dir == \"up\" ? sel.$anchor.min(sel.$head) : sel.$anchor.max(sel.$head);\n return withFlushedState(view, state, function () {\n var ref = view.docView.domFromPos($pos.pos);\n var dom = ref.node;\n for (;;) {\n var nearest = view.docView.nearestDesc(dom, true);\n if (!nearest) { break }\n if (nearest.node.isBlock) { dom = nearest.dom; break }\n dom = nearest.dom.parentNode;\n }\n var coords = coordsAtPos(view, $pos.pos);\n for (var child = dom.firstChild; child; child = child.nextSibling) {\n var boxes = (void 0);\n if (child.nodeType == 1) { boxes = child.getClientRects(); }\n else if (child.nodeType == 3) { boxes = textRange(child, 0, child.nodeValue.length).getClientRects(); }\n else { continue }\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n if (box.bottom > box.top && (dir == \"up\" ? box.bottom < coords.top + 1 : box.top > coords.bottom - 1))\n { return false }\n }\n }\n return true\n })\n}\n\nvar maybeRTL = /[\\u0590-\\u08ac]/;\n\nfunction endOfTextblockHorizontal(view, state, dir) {\n var ref = state.selection;\n var $head = ref.$head;\n if (!$head.parent.isTextblock) { return false }\n var offset = $head.parentOffset, atStart = !offset, atEnd = offset == $head.parent.content.size;\n var sel = getSelection();\n // If the textblock is all LTR, or the browser doesn't support\n // Selection.modify (Edge), fall back to a primitive approach\n if (!maybeRTL.test($head.parent.textContent) || !sel.modify)\n { return dir == \"left\" || dir == \"backward\" ? atStart : atEnd }\n\n return withFlushedState(view, state, function () {\n // This is a huge hack, but appears to be the best we can\n // currently do: use `Selection.modify` to move the selection by\n // one character, and see if that moves the cursor out of the\n // textblock (or doesn't move it at all, when at the start/end of\n // the document).\n var oldRange = sel.getRangeAt(0), oldNode = sel.focusNode, oldOff = sel.focusOffset;\n var oldBidiLevel = sel.caretBidiLevel; // Only for Firefox\n sel.modify(\"move\", dir, \"character\");\n var parentDOM = $head.depth ? view.docView.domAfterPos($head.before()) : view.dom;\n var result = !parentDOM.contains(sel.focusNode.nodeType == 1 ? sel.focusNode : sel.focusNode.parentNode) ||\n (oldNode == sel.focusNode && oldOff == sel.focusOffset);\n // Restore the previous selection\n sel.removeAllRanges();\n sel.addRange(oldRange);\n if (oldBidiLevel != null) { sel.caretBidiLevel = oldBidiLevel; }\n return result\n })\n}\n\nvar cachedState = null, cachedDir = null, cachedResult = false;\nfunction endOfTextblock(view, state, dir) {\n if (cachedState == state && cachedDir == dir) { return cachedResult }\n cachedState = state; cachedDir = dir;\n return cachedResult = dir == \"up\" || dir == \"down\"\n ? endOfTextblockVertical(view, state, dir)\n : endOfTextblockHorizontal(view, state, dir)\n}\n\n// NodeView:: interface\n//\n// By default, document nodes are rendered using the result of the\n// [`toDOM`](#model.NodeSpec.toDOM) method of their spec, and managed\n// entirely by the editor. For some use cases, such as embedded\n// node-specific editing interfaces, you want more control over\n// the behavior of a node's in-editor representation, and need to\n// [define](#view.EditorProps.nodeViews) a custom node view.\n//\n// Objects returned as node views must conform to this interface.\n//\n// dom:: ?dom.Node\n// The outer DOM node that represents the document node. When not\n// given, the default strategy is used to create a DOM node.\n//\n// contentDOM:: ?dom.Node\n// The DOM node that should hold the node's content. Only meaningful\n// if the node view also defines a `dom` property and if its node\n// type is not a leaf node type. When this is present, ProseMirror\n// will take care of rendering the node's children into it. When it\n// is not present, the node view itself is responsible for rendering\n// (or deciding not to render) its child nodes.\n//\n// update:: ?(node: Node, decorations: [Decoration]) → bool\n// When given, this will be called when the view is updating itself.\n// It will be given a node (possibly of a different type), and an\n// array of active decorations (which are automatically drawn, and\n// the node view may ignore if it isn't interested in them), and\n// should return true if it was able to update to that node, and\n// false otherwise. If the node view has a `contentDOM` property (or\n// no `dom` property), updating its child nodes will be handled by\n// ProseMirror.\n//\n// selectNode:: ?()\n// Can be used to override the way the node's selected status (as a\n// node selection) is displayed.\n//\n// deselectNode:: ?()\n// When defining a `selectNode` method, you should also provide a\n// `deselectNode` method to remove the effect again.\n//\n// setSelection:: ?(anchor: number, head: number, root: dom.Document)\n// This will be called to handle setting the selection inside the\n// node. The `anchor` and `head` positions are relative to the start\n// of the node. By default, a DOM selection will be created between\n// the DOM positions corresponding to those positions, but if you\n// override it you can do something else.\n//\n// stopEvent:: ?(event: dom.Event) → bool\n// Can be used to prevent the editor view from trying to handle some\n// or all DOM events that bubble up from the node view. Events for\n// which this returns true are not handled by the editor.\n//\n// ignoreMutation:: ?(dom.MutationRecord) → bool\n// Called when a DOM\n// [mutation](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver)\n// or a selection change happens within the view. When the change is\n// a selection change, the record will have a `type` property of\n// `\"selection\"` (which doesn't occur for native mutation records).\n// Return false if the editor should re-read the selection or\n// re-parse the range around the mutation, true if it can safely be\n// ignored.\n//\n// destroy:: ?()\n// Called when the node view is removed from the editor or the whole\n// editor is destroyed.\n\n// View descriptions are data structures that describe the DOM that is\n// used to represent the editor's content. They are used for:\n//\n// - Incremental redrawing when the document changes\n//\n// - Figuring out what part of the document a given DOM position\n// corresponds to\n//\n// - Wiring in custom implementations of the editing interface for a\n// given node\n//\n// They form a doubly-linked mutable tree, starting at `view.docView`.\n\nvar NOT_DIRTY = 0, CHILD_DIRTY = 1, CONTENT_DIRTY = 2, NODE_DIRTY = 3;\n\n// Superclass for the various kinds of descriptions. Defines their\n// basic structure and shared methods.\nvar ViewDesc = function ViewDesc(parent, children, dom, contentDOM) {\n this.parent = parent;\n this.children = children;\n this.dom = dom;\n // An expando property on the DOM node provides a link back to its\n // description.\n dom.pmViewDesc = this;\n // This is the node that holds the child views. It may be null for\n // descs that don't have children.\n this.contentDOM = contentDOM;\n this.dirty = NOT_DIRTY;\n};\n\nvar prototypeAccessors = { beforePosition: { configurable: true },size: { configurable: true },border: { configurable: true },posBefore: { configurable: true },posAtStart: { configurable: true },posAfter: { configurable: true },posAtEnd: { configurable: true },contentLost: { configurable: true } };\n\n// Used to check whether a given description corresponds to a\n// widget/mark/node.\nViewDesc.prototype.matchesWidget = function matchesWidget () { return false };\nViewDesc.prototype.matchesMark = function matchesMark () { return false };\nViewDesc.prototype.matchesNode = function matchesNode () { return false };\nViewDesc.prototype.matchesHack = function matchesHack () { return false };\n\nprototypeAccessors.beforePosition.get = function () { return false };\n\n// : () → ?ParseRule\n// When parsing in-editor content (in domchange.js), we allow\n// descriptions to determine the parse rules that should be used to\n// parse them.\nViewDesc.prototype.parseRule = function parseRule () { return null };\n\n// : (dom.Event) → bool\n// Used by the editor's event handler to ignore events that come\n// from certain descs.\nViewDesc.prototype.stopEvent = function stopEvent () { return false };\n\n// The size of the content represented by this desc.\nprototypeAccessors.size.get = function () {\n var size = 0;\n for (var i = 0; i < this.children.length; i++) { size += this.children[i].size; }\n return size\n};\n\n// For block nodes, this represents the space taken up by their\n// start/end tokens.\nprototypeAccessors.border.get = function () { return 0 };\n\nViewDesc.prototype.destroy = function destroy () {\n this.parent = null;\n if (this.dom.pmViewDesc == this) { this.dom.pmViewDesc = null; }\n for (var i = 0; i < this.children.length; i++)\n { this.children[i].destroy(); }\n};\n\nViewDesc.prototype.posBeforeChild = function posBeforeChild (child) {\n for (var i = 0, pos = this.posAtStart; i < this.children.length; i++) {\n var cur = this.children[i];\n if (cur == child) { return pos }\n pos += cur.size;\n }\n};\n\nprototypeAccessors.posBefore.get = function () {\n return this.parent.posBeforeChild(this)\n};\n\nprototypeAccessors.posAtStart.get = function () {\n return this.parent ? this.parent.posBeforeChild(this) + this.border : 0\n};\n\nprototypeAccessors.posAfter.get = function () {\n return this.posBefore + this.size\n};\n\nprototypeAccessors.posAtEnd.get = function () {\n return this.posAtStart + this.size - 2 * this.border\n};\n\n// : (dom.Node, number, ?number) → number\nViewDesc.prototype.localPosFromDOM = function localPosFromDOM (dom, offset, bias) {\n // If the DOM position is in the content, use the child desc after\n // it to figure out a position.\n if (this.contentDOM && this.contentDOM.contains(dom.nodeType == 1 ? dom : dom.parentNode)) {\n if (bias < 0) {\n var domBefore, desc;\n if (dom == this.contentDOM) {\n domBefore = dom.childNodes[offset - 1];\n } else {\n while (dom.parentNode != this.contentDOM) { dom = dom.parentNode; }\n domBefore = dom.previousSibling;\n }\n while (domBefore && !((desc = domBefore.pmViewDesc) && desc.parent == this)) { domBefore = domBefore.previousSibling; }\n return domBefore ? this.posBeforeChild(desc) + desc.size : this.posAtStart\n } else {\n var domAfter, desc$1;\n if (dom == this.contentDOM) {\n domAfter = dom.childNodes[offset];\n } else {\n while (dom.parentNode != this.contentDOM) { dom = dom.parentNode; }\n domAfter = dom.nextSibling;\n }\n while (domAfter && !((desc$1 = domAfter.pmViewDesc) && desc$1.parent == this)) { domAfter = domAfter.nextSibling; }\n return domAfter ? this.posBeforeChild(desc$1) : this.posAtEnd\n }\n }\n // Otherwise, use various heuristics, falling back on the bias\n // parameter, to determine whether to return the position at the\n // start or at the end of this view desc.\n var atEnd;\n if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM)) {\n atEnd = dom.compareDocumentPosition(this.contentDOM) & 2;\n } else if (this.dom.firstChild) {\n if (offset == 0) { for (var search = dom;; search = search.parentNode) {\n if (search == this.dom) { atEnd = false; break }\n if (search.parentNode.firstChild != search) { break }\n } }\n if (atEnd == null && offset == dom.childNodes.length) { for (var search$1 = dom;; search$1 = search$1.parentNode) {\n if (search$1 == this.dom) { atEnd = true; break }\n if (search$1.parentNode.lastChild != search$1) { break }\n } }\n }\n return (atEnd == null ? bias > 0 : atEnd) ? this.posAtEnd : this.posAtStart\n};\n\n// Scan up the dom finding the first desc that is a descendant of\n// this one.\nViewDesc.prototype.nearestDesc = function nearestDesc (dom, onlyNodes) {\n for (var first = true, cur = dom; cur; cur = cur.parentNode) {\n var desc = this.getDesc(cur);\n if (desc && (!onlyNodes || desc.node)) {\n // If dom is outside of this desc's nodeDOM, don't count it.\n if (first && desc.nodeDOM && !(desc.nodeDOM.nodeType == 1 ? desc.nodeDOM.contains(dom) : desc.nodeDOM == dom)) { first = false; }\n else { return desc }\n }\n }\n};\n\nViewDesc.prototype.getDesc = function getDesc (dom) {\n var desc = dom.pmViewDesc;\n for (var cur = desc; cur; cur = cur.parent) { if (cur == this) { return desc } }\n};\n\nViewDesc.prototype.posFromDOM = function posFromDOM (dom, offset, bias) {\n for (var scan = dom;; scan = scan.parentNode) {\n var desc = this.getDesc(scan);\n if (desc) { return desc.localPosFromDOM(dom, offset, bias) }\n }\n};\n\n// : (number) → ?NodeViewDesc\n// Find the desc for the node after the given pos, if any. (When a\n// parent node overrode rendering, there might not be one.)\nViewDesc.prototype.descAt = function descAt (pos) {\n for (var i = 0, offset = 0; i < this.children.length; i++) {\n var child = this.children[i], end = offset + child.size;\n if (offset == pos && end != offset) {\n while (!child.border && child.children.length) { child = child.children[0]; }\n return child\n }\n if (pos < end) { return child.descAt(pos - offset - child.border) }\n offset = end;\n }\n};\n\n// : (number) → {node: dom.Node, offset: number}\nViewDesc.prototype.domFromPos = function domFromPos (pos) {\n if (!this.contentDOM) { return {node: this.dom, offset: 0} }\n for (var offset = 0, i = 0;; i++) {\n if (offset == pos) {\n while (i < this.children.length && (this.children[i].beforePosition || this.children[i].dom.parentNode != this.contentDOM)) { i++; }\n return {node: this.contentDOM,\n offset: i == this.children.length ? this.contentDOM.childNodes.length : domIndex(this.children[i].dom)}\n }\n if (i == this.children.length) { throw new Error(\"Invalid position \" + pos) }\n var child = this.children[i], end = offset + child.size;\n if (pos < end) { return child.domFromPos(pos - offset - child.border) }\n offset = end;\n }\n};\n\n// Used to find a DOM range in a single parent for a given changed\n// range.\nViewDesc.prototype.parseRange = function parseRange (from, to, base) {\n if ( base === void 0 ) base = 0;\n\n if (this.children.length == 0)\n { return {node: this.contentDOM, from: from, to: to, fromOffset: 0, toOffset: this.contentDOM.childNodes.length} }\n\n var fromOffset = -1, toOffset = -1;\n for (var offset = base, i = 0;; i++) {\n var child = this.children[i], end = offset + child.size;\n if (fromOffset == -1 && from <= end) {\n var childBase = offset + child.border;\n // FIXME maybe descend mark views to parse a narrower range?\n if (from >= childBase && to <= end - child.border && child.node &&\n child.contentDOM && this.contentDOM.contains(child.contentDOM))\n { return child.parseRange(from, to, childBase) }\n\n from = offset;\n for (var j = i; j > 0; j--) {\n var prev = this.children[j - 1];\n if (prev.size && prev.dom.parentNode == this.contentDOM && !prev.emptyChildAt(1)) {\n fromOffset = domIndex(prev.dom) + 1;\n break\n }\n from -= prev.size;\n }\n if (fromOffset == -1) { fromOffset = 0; }\n }\n if (fromOffset > -1 && to <= end) {\n to = end;\n for (var j$1 = i + 1; j$1 < this.children.length; j$1++) {\n var next = this.children[j$1];\n if (next.size && next.dom.parentNode == this.contentDOM && !next.emptyChildAt(-1)) {\n toOffset = domIndex(next.dom);\n break\n }\n to += next.size;\n }\n if (toOffset == -1) { toOffset = this.contentDOM.childNodes.length; }\n break\n }\n offset = end;\n }\n return {node: this.contentDOM, from: from, to: to, fromOffset: fromOffset, toOffset: toOffset}\n};\n\nViewDesc.prototype.emptyChildAt = function emptyChildAt (side) {\n if (this.border || !this.contentDOM || !this.children.length) { return false }\n var child = this.children[side < 0 ? 0 : this.children.length - 1];\n return child.size == 0 || child.emptyChildAt(side)\n};\n\n// : (number) → dom.Node\nViewDesc.prototype.domAfterPos = function domAfterPos (pos) {\n var ref = this.domFromPos(pos);\n var node = ref.node;\n var offset = ref.offset;\n if (node.nodeType != 1 || offset == node.childNodes.length)\n { throw new RangeError(\"No node after pos \" + pos) }\n return node.childNodes[offset]\n};\n\n// : (number, number, dom.Document)\n// View descs are responsible for setting any selection that falls\n// entirely inside of them, so that custom implementations can do\n// custom things with the selection. Note that this falls apart when\n// a selection starts in such a node and ends in another, in which\n// case we just use whatever domFromPos produces as a best effort.\nViewDesc.prototype.setSelection = function setSelection (anchor, head, root, force) {\n // If the selection falls entirely in a child, give it to that child\n var from = Math.min(anchor, head), to = Math.max(anchor, head);\n for (var i = 0, offset = 0; i < this.children.length; i++) {\n var child = this.children[i], end = offset + child.size;\n if (from > offset && to < end)\n { return child.setSelection(anchor - offset - child.border, head - offset - child.border, root, force) }\n offset = end;\n }\n\n var anchorDOM = this.domFromPos(anchor), headDOM = this.domFromPos(head);\n var domSel = root.getSelection(), range = document.createRange();\n if (!force &&\n isEquivalentPosition(anchorDOM.node, anchorDOM.offset, domSel.anchorNode, domSel.anchorOffset) &&\n isEquivalentPosition(headDOM.node, headDOM.offset, domSel.focusNode, domSel.focusOffset))\n { return }\n\n // Selection.extend can be used to create an 'inverted' selection\n // (one where the focus is before the anchor), but not all\n // browsers support it yet.\n if (domSel.extend) {\n range.setEnd(anchorDOM.node, anchorDOM.offset);\n range.collapse(false);\n } else {\n if (anchor > head) { var tmp = anchorDOM; anchorDOM = headDOM; headDOM = tmp; }\n range.setEnd(headDOM.node, headDOM.offset);\n range.setStart(anchorDOM.node, anchorDOM.offset);\n }\n domSel.removeAllRanges();\n domSel.addRange(range);\n if (domSel.extend)\n { domSel.extend(headDOM.node, headDOM.offset); }\n};\n\n// : (dom.MutationRecord) → bool\nViewDesc.prototype.ignoreMutation = function ignoreMutation (mutation) {\n return !this.contentDOM && mutation.type != \"selection\"\n};\n\nprototypeAccessors.contentLost.get = function () {\n return this.contentDOM && this.contentDOM != this.dom && !this.dom.contains(this.contentDOM)\n};\n\n// Remove a subtree of the element tree that has been touched\n// by a DOM change, so that the next update will redraw it.\nViewDesc.prototype.markDirty = function markDirty (from, to) {\n for (var offset = 0, i = 0; i < this.children.length; i++) {\n var child = this.children[i], end = offset + child.size;\n if (offset == end ? from <= end && to >= offset : from < end && to > offset) {\n var startInside = offset + child.border, endInside = end - child.border;\n if (from >= startInside && to <= endInside) {\n this.dirty = from == offset || to == end ? CONTENT_DIRTY : CHILD_DIRTY;\n if (from == startInside && to == endInside &&\n (child.contentLost || child.dom.parentNode != this.contentDOM)) { child.dirty = NODE_DIRTY; }\n else { child.markDirty(from - startInside, to - startInside); }\n return\n } else {\n child.dirty = NODE_DIRTY;\n }\n }\n offset = end;\n }\n this.dirty = CONTENT_DIRTY;\n};\n\nViewDesc.prototype.markParentsDirty = function markParentsDirty () {\n for (var node = this.parent; node; node = node.parent) {\n var dirty = CONTENT_DIRTY ;\n if (node.dirty < dirty) { node.dirty = dirty; }\n }\n};\n\nObject.defineProperties( ViewDesc.prototype, prototypeAccessors );\n\n// Reused array to avoid allocating fresh arrays for things that will\n// stay empty anyway.\nvar nothing = [];\n\n// A widget desc represents a widget decoration, which is a DOM node\n// drawn between the document nodes.\nvar WidgetViewDesc = /*@__PURE__*/(function (ViewDesc) {\n function WidgetViewDesc(parent, widget, view, pos) {\n var self, dom = widget.type.toDOM;\n if (typeof dom == \"function\") { dom = dom(view, function () {\n if (!self) { return pos }\n if (self.parent) { return self.parent.posBeforeChild(self) }\n }); }\n if (!widget.type.spec.raw) {\n if (dom.nodeType != 1) {\n var wrap = document.createElement(\"span\");\n wrap.appendChild(dom);\n dom = wrap;\n }\n dom.contentEditable = false;\n dom.classList.add(\"ProseMirror-widget\");\n }\n ViewDesc.call(this, parent, nothing, dom, null);\n this.widget = widget;\n self = this;\n }\n\n if ( ViewDesc ) WidgetViewDesc.__proto__ = ViewDesc;\n WidgetViewDesc.prototype = Object.create( ViewDesc && ViewDesc.prototype );\n WidgetViewDesc.prototype.constructor = WidgetViewDesc;\n\n var prototypeAccessors$1 = { beforePosition: { configurable: true } };\n\n prototypeAccessors$1.beforePosition.get = function () {\n return this.widget.type.side < 0\n };\n\n WidgetViewDesc.prototype.matchesWidget = function matchesWidget (widget) {\n return this.dirty == NOT_DIRTY && widget.type.eq(this.widget.type)\n };\n\n WidgetViewDesc.prototype.parseRule = function parseRule () { return {ignore: true} };\n\n WidgetViewDesc.prototype.stopEvent = function stopEvent (event) {\n var stop = this.widget.spec.stopEvent;\n return stop ? stop(event) : false\n };\n\n WidgetViewDesc.prototype.ignoreMutation = function ignoreMutation (mutation) {\n return mutation.type != \"selection\" || this.widget.spec.ignoreSelection\n };\n\n Object.defineProperties( WidgetViewDesc.prototype, prototypeAccessors$1 );\n\n return WidgetViewDesc;\n}(ViewDesc));\n\nvar CompositionViewDesc = /*@__PURE__*/(function (ViewDesc) {\n function CompositionViewDesc(parent, dom, textDOM, text) {\n ViewDesc.call(this, parent, nothing, dom, null);\n this.textDOM = textDOM;\n this.text = text;\n }\n\n if ( ViewDesc ) CompositionViewDesc.__proto__ = ViewDesc;\n CompositionViewDesc.prototype = Object.create( ViewDesc && ViewDesc.prototype );\n CompositionViewDesc.prototype.constructor = CompositionViewDesc;\n\n var prototypeAccessors$2 = { size: { configurable: true } };\n\n prototypeAccessors$2.size.get = function () { return this.text.length };\n\n CompositionViewDesc.prototype.localPosFromDOM = function localPosFromDOM (dom, offset) {\n if (dom != this.textDOM) { return this.posAtStart + (offset ? this.size : 0) }\n return this.posAtStart + offset\n };\n\n CompositionViewDesc.prototype.domFromPos = function domFromPos (pos) {\n return {node: this.textDOM, offset: pos}\n };\n\n CompositionViewDesc.prototype.ignoreMutation = function ignoreMutation (mut) {\n return mut.type === 'characterData' && mut.target.nodeValue == mut.oldValue\n };\n\n Object.defineProperties( CompositionViewDesc.prototype, prototypeAccessors$2 );\n\n return CompositionViewDesc;\n}(ViewDesc));\n\n// A mark desc represents a mark. May have multiple children,\n// depending on how the mark is split. Note that marks are drawn using\n// a fixed nesting order, for simplicity and predictability, so in\n// some cases they will be split more often than would appear\n// necessary.\nvar MarkViewDesc = /*@__PURE__*/(function (ViewDesc) {\n function MarkViewDesc(parent, mark, dom, contentDOM) {\n ViewDesc.call(this, parent, [], dom, contentDOM);\n this.mark = mark;\n }\n\n if ( ViewDesc ) MarkViewDesc.__proto__ = ViewDesc;\n MarkViewDesc.prototype = Object.create( ViewDesc && ViewDesc.prototype );\n MarkViewDesc.prototype.constructor = MarkViewDesc;\n\n MarkViewDesc.create = function create (parent, mark, inline, view) {\n var custom = view.nodeViews[mark.type.name];\n var spec = custom && custom(mark, view, inline);\n if (!spec || !spec.dom)\n { spec = prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"DOMSerializer\"].renderSpec(document, mark.type.spec.toDOM(mark, inline)); }\n return new MarkViewDesc(parent, mark, spec.dom, spec.contentDOM || spec.dom)\n };\n\n MarkViewDesc.prototype.parseRule = function parseRule () { return {mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM} };\n\n MarkViewDesc.prototype.matchesMark = function matchesMark (mark) { return this.dirty != NODE_DIRTY && this.mark.eq(mark) };\n\n MarkViewDesc.prototype.markDirty = function markDirty (from, to) {\n ViewDesc.prototype.markDirty.call(this, from, to);\n // Move dirty info to nearest node view\n if (this.dirty != NOT_DIRTY) {\n var parent = this.parent;\n while (!parent.node) { parent = parent.parent; }\n if (parent.dirty < this.dirty) { parent.dirty = this.dirty; }\n this.dirty = NOT_DIRTY;\n }\n };\n\n MarkViewDesc.prototype.slice = function slice (from, to, view) {\n var copy = MarkViewDesc.create(this.parent, this.mark, true, view);\n var nodes = this.children, size = this.size;\n if (to < size) { nodes = replaceNodes(nodes, to, size, view); }\n if (from > 0) { nodes = replaceNodes(nodes, 0, from, view); }\n for (var i = 0; i < nodes.length; i++) { nodes[i].parent = copy; }\n copy.children = nodes;\n return copy\n };\n\n return MarkViewDesc;\n}(ViewDesc));\n\n// Node view descs are the main, most common type of view desc, and\n// correspond to an actual node in the document. Unlike mark descs,\n// they populate their child array themselves.\nvar NodeViewDesc = /*@__PURE__*/(function (ViewDesc) {\n function NodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, view, pos) {\n ViewDesc.call(this, parent, node.isLeaf ? nothing : [], dom, contentDOM);\n this.nodeDOM = nodeDOM;\n this.node = node;\n this.outerDeco = outerDeco;\n this.innerDeco = innerDeco;\n if (contentDOM) { this.updateChildren(view, pos); }\n }\n\n if ( ViewDesc ) NodeViewDesc.__proto__ = ViewDesc;\n NodeViewDesc.prototype = Object.create( ViewDesc && ViewDesc.prototype );\n NodeViewDesc.prototype.constructor = NodeViewDesc;\n\n var prototypeAccessors$3 = { size: { configurable: true },border: { configurable: true } };\n\n // By default, a node is rendered using the `toDOM` method from the\n // node type spec. But client code can use the `nodeViews` spec to\n // supply a custom node view, which can influence various aspects of\n // the way the node works.\n //\n // (Using subclassing for this was intentionally decided against,\n // since it'd require exposing a whole slew of finnicky\n // implementation details to the user code that they probably will\n // never need.)\n NodeViewDesc.create = function create (parent, node, outerDeco, innerDeco, view, pos) {\n var assign;\n\n var custom = view.nodeViews[node.type.name], descObj;\n var spec = custom && custom(node, view, function () {\n // (This is a function that allows the custom view to find its\n // own position)\n if (!descObj) { return pos }\n if (descObj.parent) { return descObj.parent.posBeforeChild(descObj) }\n }, outerDeco);\n\n var dom = spec && spec.dom, contentDOM = spec && spec.contentDOM;\n if (node.isText) {\n if (!dom) { dom = document.createTextNode(node.text); }\n else if (dom.nodeType != 3) { throw new RangeError(\"Text must be rendered as a DOM text node\") }\n } else if (!dom) {\n((assign = prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"DOMSerializer\"].renderSpec(document, node.type.spec.toDOM(node)), dom = assign.dom, contentDOM = assign.contentDOM));\n }\n if (!contentDOM && !node.isText && dom.nodeName != \"BR\") { // Chrome gets confused by
      \n if (!dom.hasAttribute(\"contenteditable\")) { dom.contentEditable = false; }\n if (node.type.spec.draggable) { dom.draggable = true; }\n }\n\n var nodeDOM = dom;\n dom = applyOuterDeco(dom, outerDeco, node);\n\n if (spec)\n { return descObj = new CustomNodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM,\n spec, view, pos + 1) }\n else if (node.isText)\n { return new TextViewDesc(parent, node, outerDeco, innerDeco, dom, nodeDOM, view) }\n else\n { return new NodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, view, pos + 1) }\n };\n\n NodeViewDesc.prototype.parseRule = function parseRule () {\n var this$1 = this;\n\n // Experimental kludge to allow opt-in re-parsing of nodes\n if (this.node.type.spec.reparseInView) { return null }\n // FIXME the assumption that this can always return the current\n // attrs means that if the user somehow manages to change the\n // attrs in the dom, that won't be picked up. Not entirely sure\n // whether this is a problem\n var rule = {node: this.node.type.name, attrs: this.node.attrs};\n if (this.node.type.spec.code) { rule.preserveWhitespace = \"full\"; }\n if (this.contentDOM && !this.contentLost) { rule.contentElement = this.contentDOM; }\n else { rule.getContent = function () { return this$1.contentDOM ? prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].empty : this$1.node.content; }; }\n return rule\n };\n\n NodeViewDesc.prototype.matchesNode = function matchesNode (node, outerDeco, innerDeco) {\n return this.dirty == NOT_DIRTY && node.eq(this.node) &&\n sameOuterDeco(outerDeco, this.outerDeco) && innerDeco.eq(this.innerDeco)\n };\n\n prototypeAccessors$3.size.get = function () { return this.node.nodeSize };\n\n prototypeAccessors$3.border.get = function () { return this.node.isLeaf ? 0 : 1 };\n\n // Syncs `this.children` to match `this.node.content` and the local\n // decorations, possibly introducing nesting for marks. Then, in a\n // separate step, syncs the DOM inside `this.contentDOM` to\n // `this.children`.\n NodeViewDesc.prototype.updateChildren = function updateChildren (view, pos) {\n var this$1 = this;\n\n var inline = this.node.inlineContent, off = pos;\n var composition = inline && view.composing && this.localCompositionNode(view, pos);\n var updater = new ViewTreeUpdater(this, composition && composition.node);\n iterDeco(this.node, this.innerDeco, function (widget, i, insideNode) {\n if (widget.spec.marks)\n { updater.syncToMarks(widget.spec.marks, inline, view); }\n else if (widget.type.side >= 0 && !insideNode)\n { updater.syncToMarks(i == this$1.node.childCount ? prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Mark\"].none : this$1.node.child(i).marks, inline, view); }\n // If the next node is a desc matching this widget, reuse it,\n // otherwise insert the widget as a new view desc.\n updater.placeWidget(widget, view, off);\n }, function (child, outerDeco, innerDeco, i) {\n // Make sure the wrapping mark descs match the node's marks.\n updater.syncToMarks(child.marks, inline, view);\n // Either find an existing desc that exactly matches this node,\n // and drop the descs before it.\n updater.findNodeMatch(child, outerDeco, innerDeco, i) ||\n // Or try updating the next desc to reflect this node.\n updater.updateNextNode(child, outerDeco, innerDeco, view, i) ||\n // Or just add it as a new desc.\n updater.addNode(child, outerDeco, innerDeco, view, off);\n off += child.nodeSize;\n });\n // Drop all remaining descs after the current position.\n updater.syncToMarks(nothing, inline, view);\n if (this.node.isTextblock) { updater.addTextblockHacks(); }\n updater.destroyRest();\n\n // Sync the DOM if anything changed\n if (updater.changed || this.dirty == CONTENT_DIRTY) {\n // May have to protect focused DOM from being changed if a composition is active\n if (composition) { this.protectLocalComposition(view, composition); }\n this.renderChildren();\n }\n };\n\n NodeViewDesc.prototype.renderChildren = function renderChildren () {\n renderDescs(this.contentDOM, this.children);\n if (result.ios) { iosHacks(this.dom); }\n };\n\n NodeViewDesc.prototype.localCompositionNode = function localCompositionNode (view, pos) {\n // Only do something if both the selection and a focused text node\n // are inside of this node, and the node isn't already part of a\n // view that's a child of this view\n var ref = view.state.selection;\n var from = ref.from;\n var to = ref.to;\n if (!(view.state.selection instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"TextSelection\"]) || from < pos || to > pos + this.node.content.size) { return }\n var sel = view.root.getSelection();\n var textNode = nearbyTextNode(sel.focusNode, sel.focusOffset);\n if (!textNode || !this.dom.contains(textNode.parentNode)) { return }\n\n // Find the text in the focused node in the node, stop if it's not\n // there (may have been modified through other means, in which\n // case it should overwritten)\n var text = textNode.nodeValue;\n var textPos = findTextInFragment(this.node.content, text, from - pos, to - pos);\n\n return textPos < 0 ? null : {node: textNode, pos: textPos, text: text}\n };\n\n NodeViewDesc.prototype.protectLocalComposition = function protectLocalComposition (view, ref) {\n var node = ref.node;\n var pos = ref.pos;\n var text = ref.text;\n\n // The node is already part of a local view desc, leave it there\n if (this.getDesc(node)) { return }\n\n // Create a composition view for the orphaned nodes\n var topNode = node;\n for (;; topNode = topNode.parentNode) {\n if (topNode.parentNode == this.contentDOM) { break }\n while (topNode.previousSibling) { topNode.parentNode.removeChild(topNode.previousSibling); }\n while (topNode.nextSibling) { topNode.parentNode.removeChild(topNode.nextSibling); }\n if (topNode.pmViewDesc) { topNode.pmViewDesc = null; }\n }\n var desc = new CompositionViewDesc(this, topNode, node, text);\n view.compositionNodes.push(desc);\n\n // Patch up this.children to contain the composition view\n this.children = replaceNodes(this.children, pos, pos + text.length, view, desc);\n };\n\n // : (Node, [Decoration], DecorationSet, EditorView) → bool\n // If this desc be updated to match the given node decoration,\n // do so and return true.\n NodeViewDesc.prototype.update = function update (node, outerDeco, innerDeco, view) {\n if (this.dirty == NODE_DIRTY ||\n !node.sameMarkup(this.node)) { return false }\n this.updateInner(node, outerDeco, innerDeco, view);\n return true\n };\n\n NodeViewDesc.prototype.updateInner = function updateInner (node, outerDeco, innerDeco, view) {\n this.updateOuterDeco(outerDeco);\n this.node = node;\n this.innerDeco = innerDeco;\n if (this.contentDOM) { this.updateChildren(view, this.posAtStart); }\n this.dirty = NOT_DIRTY;\n };\n\n NodeViewDesc.prototype.updateOuterDeco = function updateOuterDeco (outerDeco) {\n if (sameOuterDeco(outerDeco, this.outerDeco)) { return }\n var needsWrap = this.nodeDOM.nodeType != 1;\n var oldDOM = this.dom;\n this.dom = patchOuterDeco(this.dom, this.nodeDOM,\n computeOuterDeco(this.outerDeco, this.node, needsWrap),\n computeOuterDeco(outerDeco, this.node, needsWrap));\n if (this.dom != oldDOM) {\n oldDOM.pmViewDesc = null;\n this.dom.pmViewDesc = this;\n }\n this.outerDeco = outerDeco;\n };\n\n // Mark this node as being the selected node.\n NodeViewDesc.prototype.selectNode = function selectNode () {\n this.nodeDOM.classList.add(\"ProseMirror-selectednode\");\n if (this.contentDOM || !this.node.type.spec.draggable) { this.dom.draggable = true; }\n };\n\n // Remove selected node marking from this node.\n NodeViewDesc.prototype.deselectNode = function deselectNode () {\n this.nodeDOM.classList.remove(\"ProseMirror-selectednode\");\n if (this.contentDOM || !this.node.type.spec.draggable) { this.dom.draggable = false; }\n };\n\n Object.defineProperties( NodeViewDesc.prototype, prototypeAccessors$3 );\n\n return NodeViewDesc;\n}(ViewDesc));\n\n// Create a view desc for the top-level document node, to be exported\n// and used by the view class.\nfunction docViewDesc(doc, outerDeco, innerDeco, dom, view) {\n applyOuterDeco(dom, outerDeco, doc);\n return new NodeViewDesc(null, doc, outerDeco, innerDeco, dom, dom, dom, view, 0)\n}\n\nvar TextViewDesc = /*@__PURE__*/(function (NodeViewDesc) {\n function TextViewDesc(parent, node, outerDeco, innerDeco, dom, nodeDOM, view) {\n NodeViewDesc.call(this, parent, node, outerDeco, innerDeco, dom, null, nodeDOM, view);\n }\n\n if ( NodeViewDesc ) TextViewDesc.__proto__ = NodeViewDesc;\n TextViewDesc.prototype = Object.create( NodeViewDesc && NodeViewDesc.prototype );\n TextViewDesc.prototype.constructor = TextViewDesc;\n\n TextViewDesc.prototype.parseRule = function parseRule () {\n return {skip: this.nodeDOM.parentNode || true}\n };\n\n TextViewDesc.prototype.update = function update (node, outerDeco) {\n if (this.dirty == NODE_DIRTY || (this.dirty != NOT_DIRTY && !this.inParent()) ||\n !node.sameMarkup(this.node)) { return false }\n this.updateOuterDeco(outerDeco);\n if ((this.dirty != NOT_DIRTY || node.text != this.node.text) && node.text != this.nodeDOM.nodeValue)\n { this.nodeDOM.nodeValue = node.text; }\n this.node = node;\n this.dirty = NOT_DIRTY;\n return true\n };\n\n TextViewDesc.prototype.inParent = function inParent () {\n var parentDOM = this.parent.contentDOM;\n for (var n = this.nodeDOM; n; n = n.parentNode) { if (n == parentDOM) { return true } }\n return false\n };\n\n TextViewDesc.prototype.domFromPos = function domFromPos (pos) {\n return {node: this.nodeDOM, offset: pos}\n };\n\n TextViewDesc.prototype.localPosFromDOM = function localPosFromDOM (dom, offset, bias) {\n if (dom == this.nodeDOM) { return this.posAtStart + Math.min(offset, this.node.text.length) }\n return NodeViewDesc.prototype.localPosFromDOM.call(this, dom, offset, bias)\n };\n\n TextViewDesc.prototype.ignoreMutation = function ignoreMutation (mutation) {\n return mutation.type != \"characterData\" && mutation.type != \"selection\"\n };\n\n TextViewDesc.prototype.slice = function slice (from, to, view) {\n var node = this.node.cut(from, to), dom = document.createTextNode(node.text);\n return new TextViewDesc(this.parent, node, this.outerDeco, this.innerDeco, dom, dom, view)\n };\n\n return TextViewDesc;\n}(NodeViewDesc));\n\n// A dummy desc used to tag trailing BR or span nodes created to work\n// around contentEditable terribleness.\nvar BRHackViewDesc = /*@__PURE__*/(function (ViewDesc) {\n function BRHackViewDesc () {\n ViewDesc.apply(this, arguments);\n }\n\n if ( ViewDesc ) BRHackViewDesc.__proto__ = ViewDesc;\n BRHackViewDesc.prototype = Object.create( ViewDesc && ViewDesc.prototype );\n BRHackViewDesc.prototype.constructor = BRHackViewDesc;\n\n BRHackViewDesc.prototype.parseRule = function parseRule () { return {ignore: true} };\n BRHackViewDesc.prototype.matchesHack = function matchesHack () { return this.dirty == NOT_DIRTY };\n\n return BRHackViewDesc;\n}(ViewDesc));\n\n// A separate subclass is used for customized node views, so that the\n// extra checks only have to be made for nodes that are actually\n// customized.\nvar CustomNodeViewDesc = /*@__PURE__*/(function (NodeViewDesc) {\n function CustomNodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, spec, view, pos) {\n NodeViewDesc.call(this, parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, view, pos);\n this.spec = spec;\n }\n\n if ( NodeViewDesc ) CustomNodeViewDesc.__proto__ = NodeViewDesc;\n CustomNodeViewDesc.prototype = Object.create( NodeViewDesc && NodeViewDesc.prototype );\n CustomNodeViewDesc.prototype.constructor = CustomNodeViewDesc;\n\n // A custom `update` method gets to decide whether the update goes\n // through. If it does, and there's a `contentDOM` node, our logic\n // updates the children.\n CustomNodeViewDesc.prototype.update = function update (node, outerDeco, innerDeco, view) {\n if (this.dirty == NODE_DIRTY) { return false }\n if (this.spec.update) {\n var result = this.spec.update(node, outerDeco);\n if (result) { this.updateInner(node, outerDeco, innerDeco, view); }\n return result\n } else if (!this.contentDOM && !node.isLeaf) {\n return false\n } else {\n return NodeViewDesc.prototype.update.call(this, node, outerDeco, innerDeco, view)\n }\n };\n\n CustomNodeViewDesc.prototype.selectNode = function selectNode () {\n this.spec.selectNode ? this.spec.selectNode() : NodeViewDesc.prototype.selectNode.call(this);\n };\n\n CustomNodeViewDesc.prototype.deselectNode = function deselectNode () {\n this.spec.deselectNode ? this.spec.deselectNode() : NodeViewDesc.prototype.deselectNode.call(this);\n };\n\n CustomNodeViewDesc.prototype.setSelection = function setSelection (anchor, head, root, force) {\n this.spec.setSelection ? this.spec.setSelection(anchor, head, root)\n : NodeViewDesc.prototype.setSelection.call(this, anchor, head, root, force);\n };\n\n CustomNodeViewDesc.prototype.destroy = function destroy () {\n if (this.spec.destroy) { this.spec.destroy(); }\n NodeViewDesc.prototype.destroy.call(this);\n };\n\n CustomNodeViewDesc.prototype.stopEvent = function stopEvent (event) {\n return this.spec.stopEvent ? this.spec.stopEvent(event) : false\n };\n\n CustomNodeViewDesc.prototype.ignoreMutation = function ignoreMutation (mutation) {\n return this.spec.ignoreMutation ? this.spec.ignoreMutation(mutation) : NodeViewDesc.prototype.ignoreMutation.call(this, mutation)\n };\n\n return CustomNodeViewDesc;\n}(NodeViewDesc));\n\n// : (dom.Node, [ViewDesc])\n// Sync the content of the given DOM node with the nodes associated\n// with the given array of view descs, recursing into mark descs\n// because this should sync the subtree for a whole node at a time.\nfunction renderDescs(parentDOM, descs) {\n var dom = parentDOM.firstChild;\n for (var i = 0; i < descs.length; i++) {\n var desc = descs[i], childDOM = desc.dom;\n if (childDOM.parentNode == parentDOM) {\n while (childDOM != dom) { dom = rm(dom); }\n dom = dom.nextSibling;\n } else {\n parentDOM.insertBefore(childDOM, dom);\n }\n if (desc instanceof MarkViewDesc) {\n var pos = dom ? dom.previousSibling : parentDOM.lastChild;\n renderDescs(desc.contentDOM, desc.children);\n dom = pos ? pos.nextSibling : parentDOM.firstChild;\n }\n }\n while (dom) { dom = rm(dom); }\n}\n\nfunction OuterDecoLevel(nodeName) {\n if (nodeName) { this.nodeName = nodeName; }\n}\nOuterDecoLevel.prototype = Object.create(null);\n\nvar noDeco = [new OuterDecoLevel];\n\nfunction computeOuterDeco(outerDeco, node, needsWrap) {\n if (outerDeco.length == 0) { return noDeco }\n\n var top = needsWrap ? noDeco[0] : new OuterDecoLevel, result = [top];\n\n for (var i = 0; i < outerDeco.length; i++) {\n var attrs = outerDeco[i].type.attrs, cur = top;\n if (!attrs) { continue }\n if (attrs.nodeName)\n { result.push(cur = new OuterDecoLevel(attrs.nodeName)); }\n\n for (var name in attrs) {\n var val = attrs[name];\n if (val == null) { continue }\n if (needsWrap && result.length == 1)\n { result.push(cur = top = new OuterDecoLevel(node.isInline ? \"span\" : \"div\")); }\n if (name == \"class\") { cur.class = (cur.class ? cur.class + \" \" : \"\") + val; }\n else if (name == \"style\") { cur.style = (cur.style ? cur.style + \";\" : \"\") + val; }\n else if (name != \"nodeName\") { cur[name] = val; }\n }\n }\n\n return result\n}\n\nfunction patchOuterDeco(outerDOM, nodeDOM, prevComputed, curComputed) {\n // Shortcut for trivial case\n if (prevComputed == noDeco && curComputed == noDeco) { return nodeDOM }\n\n var curDOM = nodeDOM;\n for (var i = 0; i < curComputed.length; i++) {\n var deco = curComputed[i], prev = prevComputed[i];\n if (i) {\n var parent = (void 0);\n if (prev && prev.nodeName == deco.nodeName && curDOM != outerDOM &&\n (parent = curDOM.parentNode) && parent.tagName.toLowerCase() == deco.nodeName) {\n curDOM = parent;\n } else {\n parent = document.createElement(deco.nodeName);\n parent.appendChild(curDOM);\n prev = noDeco[0];\n curDOM = parent;\n }\n }\n patchAttributes(curDOM, prev || noDeco[0], deco);\n }\n return curDOM\n}\n\nfunction patchAttributes(dom, prev, cur) {\n for (var name in prev)\n { if (name != \"class\" && name != \"style\" && name != \"nodeName\" && !(name in cur))\n { dom.removeAttribute(name); } }\n for (var name$1 in cur)\n { if (name$1 != \"class\" && name$1 != \"style\" && name$1 != \"nodeName\" && cur[name$1] != prev[name$1])\n { dom.setAttribute(name$1, cur[name$1]); } }\n if (prev.class != cur.class) {\n var prevList = prev.class ? prev.class.split(\" \") : nothing;\n var curList = cur.class ? cur.class.split(\" \") : nothing;\n for (var i = 0; i < prevList.length; i++) { if (curList.indexOf(prevList[i]) == -1)\n { dom.classList.remove(prevList[i]); } }\n for (var i$1 = 0; i$1 < curList.length; i$1++) { if (prevList.indexOf(curList[i$1]) == -1)\n { dom.classList.add(curList[i$1]); } }\n }\n if (prev.style != cur.style) {\n if (prev.style) {\n var prop = /\\s*([\\w\\-\\xa1-\\uffff]+)\\s*:(?:\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|\\(.*?\\)|[^;])*/g, m;\n while (m = prop.exec(prev.style))\n { dom.style.removeProperty(m[1]); }\n }\n if (cur.style)\n { dom.style.cssText += cur.style; }\n }\n}\n\nfunction applyOuterDeco(dom, deco, node) {\n return patchOuterDeco(dom, dom, noDeco, computeOuterDeco(deco, node, dom.nodeType != 1))\n}\n\n// : ([Decoration], [Decoration]) → bool\nfunction sameOuterDeco(a, b) {\n if (a.length != b.length) { return false }\n for (var i = 0; i < a.length; i++) { if (!a[i].type.eq(b[i].type)) { return false } }\n return true\n}\n\n// Remove a DOM node and return its next sibling.\nfunction rm(dom) {\n var next = dom.nextSibling;\n dom.parentNode.removeChild(dom);\n return next\n}\n\n// Helper class for incrementally updating a tree of mark descs and\n// the widget and node descs inside of them.\nvar ViewTreeUpdater = function ViewTreeUpdater(top, lockedNode) {\n this.top = top;\n this.lock = lockedNode;\n // Index into `this.top`'s child array, represents the current\n // update position.\n this.index = 0;\n // When entering a mark, the current top and index are pushed\n // onto this.\n this.stack = [];\n // Tracks whether anything was changed\n this.changed = false;\n\n var pre = preMatch(top.node.content, top.children);\n this.preMatched = pre.nodes;\n this.preMatchOffset = pre.offset;\n};\n\nViewTreeUpdater.prototype.getPreMatch = function getPreMatch (index) {\n return index >= this.preMatchOffset ? this.preMatched[index - this.preMatchOffset] : null\n};\n\n// Destroy and remove the children between the given indices in\n// `this.top`.\nViewTreeUpdater.prototype.destroyBetween = function destroyBetween (start, end) {\n if (start == end) { return }\n for (var i = start; i < end; i++) { this.top.children[i].destroy(); }\n this.top.children.splice(start, end - start);\n this.changed = true;\n};\n\n// Destroy all remaining children in `this.top`.\nViewTreeUpdater.prototype.destroyRest = function destroyRest () {\n this.destroyBetween(this.index, this.top.children.length);\n};\n\n// : ([Mark], EditorView)\n// Sync the current stack of mark descs with the given array of\n// marks, reusing existing mark descs when possible.\nViewTreeUpdater.prototype.syncToMarks = function syncToMarks (marks, inline, view) {\n var keep = 0, depth = this.stack.length >> 1;\n var maxKeep = Math.min(depth, marks.length);\n while (keep < maxKeep &&\n (keep == depth - 1 ? this.top : this.stack[(keep + 1) << 1]).matchesMark(marks[keep]) && marks[keep].type.spec.spanning !== false)\n { keep++; }\n\n while (keep < depth) {\n this.destroyRest();\n this.top.dirty = NOT_DIRTY;\n this.index = this.stack.pop();\n this.top = this.stack.pop();\n depth--;\n }\n while (depth < marks.length) {\n this.stack.push(this.top, this.index + 1);\n var found = -1;\n for (var i = this.index; i < Math.min(this.index + 3, this.top.children.length); i++) {\n if (this.top.children[i].matchesMark(marks[depth])) { found = i; break }\n }\n if (found > -1) {\n if (found > this.index) {\n this.changed = true;\n this.destroyBetween(this.index, found);\n }\n this.top = this.top.children[this.index];\n } else {\n var markDesc = MarkViewDesc.create(this.top, marks[depth], inline, view);\n this.top.children.splice(this.index, 0, markDesc);\n this.top = markDesc;\n this.changed = true;\n }\n this.index = 0;\n depth++;\n }\n};\n\n// : (Node, [Decoration], DecorationSet) → bool\n// Try to find a node desc matching the given data. Skip over it and\n// return true when successful.\nViewTreeUpdater.prototype.findNodeMatch = function findNodeMatch (node, outerDeco, innerDeco, index) {\n var found = -1, preMatch = index < 0 ? undefined : this.getPreMatch(index), children = this.top.children;\n if (preMatch && preMatch.matchesNode(node, outerDeco, innerDeco)) {\n found = children.indexOf(preMatch);\n } else {\n for (var i = this.index, e = Math.min(children.length, i + 5); i < e; i++) {\n var child = children[i];\n if (child.matchesNode(node, outerDeco, innerDeco) && this.preMatched.indexOf(child) < 0) {\n found = i;\n break\n }\n }\n }\n if (found < 0) { return false }\n this.destroyBetween(this.index, found);\n this.index++;\n return true\n};\n\n// : (Node, [Decoration], DecorationSet, EditorView, Fragment, number) → bool\n// Try to update the next node, if any, to the given data. Checks\n// pre-matches to avoid overwriting nodes that could still be used.\nViewTreeUpdater.prototype.updateNextNode = function updateNextNode (node, outerDeco, innerDeco, view, index) {\n if (this.index == this.top.children.length) { return false }\n var next = this.top.children[this.index];\n if (next instanceof NodeViewDesc) {\n var preMatch = this.preMatched.indexOf(next);\n if (preMatch > -1 && preMatch + this.preMatchOffset != index) { return false }\n var nextDOM = next.dom;\n\n // Can't update if nextDOM is or contains this.lock, except if\n // it's a text node whose content already matches the new text\n // and whose decorations match the new ones.\n var locked = this.lock && (nextDOM == this.lock || nextDOM.nodeType == 1 && nextDOM.contains(this.lock.parentNode)) &&\n !(node.isText && next.node && next.node.isText && next.nodeDOM.nodeValue == node.text &&\n next.dirty != NODE_DIRTY && sameOuterDeco(outerDeco, next.outerDeco));\n if (!locked && next.update(node, outerDeco, innerDeco, view)) {\n if (next.dom != nextDOM) { this.changed = true; }\n this.index++;\n return true\n }\n }\n return false\n};\n\n// : (Node, [Decoration], DecorationSet, EditorView)\n// Insert the node as a newly created node desc.\nViewTreeUpdater.prototype.addNode = function addNode (node, outerDeco, innerDeco, view, pos) {\n this.top.children.splice(this.index++, 0, NodeViewDesc.create(this.top, node, outerDeco, innerDeco, view, pos));\n this.changed = true;\n};\n\nViewTreeUpdater.prototype.placeWidget = function placeWidget (widget, view, pos) {\n if (this.index < this.top.children.length && this.top.children[this.index].matchesWidget(widget)) {\n this.index++;\n } else {\n var desc = new WidgetViewDesc(this.top, widget, view, pos);\n this.top.children.splice(this.index++, 0, desc);\n this.changed = true;\n }\n};\n\n// Make sure a textblock looks and behaves correctly in\n// contentEditable.\nViewTreeUpdater.prototype.addTextblockHacks = function addTextblockHacks () {\n var lastChild = this.top.children[this.index - 1];\n while (lastChild instanceof MarkViewDesc) { lastChild = lastChild.children[lastChild.children.length - 1]; }\n\n if (!lastChild || // Empty textblock\n !(lastChild instanceof TextViewDesc) ||\n /\\n$/.test(lastChild.node.text)) {\n if (this.index < this.top.children.length && this.top.children[this.index].matchesHack()) {\n this.index++;\n } else {\n var dom = document.createElement(\"br\");\n this.top.children.splice(this.index++, 0, new BRHackViewDesc(this.top, nothing, dom, null));\n this.changed = true;\n }\n }\n};\n\n// : (Fragment, [ViewDesc]) → [ViewDesc]\n// Iterate from the end of the fragment and array of descs to find\n// directly matching ones, in order to avoid overeagerly reusing\n// those for other nodes. Returns an array whose positions correspond\n// to node positions in the fragment, and whose elements are either\n// descs matched to the child at that index, or empty.\nfunction preMatch(frag, descs) {\n var result = [], end = frag.childCount;\n for (var i = descs.length - 1; end > 0 && i >= 0; i--) {\n var desc = descs[i], node = desc.node;\n if (!node) { continue }\n if (node != frag.child(end - 1)) { break }\n result.push(desc);\n --end;\n }\n return {nodes: result.reverse(), offset: end}\n}\n\nfunction compareSide(a, b) { return a.type.side - b.type.side }\n\n// : (ViewDesc, DecorationSet, (Decoration, number), (Node, [Decoration], DecorationSet, number))\n// This function abstracts iterating over the nodes and decorations in\n// a fragment. Calls `onNode` for each node, with its local and child\n// decorations. Splits text nodes when there is a decoration starting\n// or ending inside of them. Calls `onWidget` for each widget.\nfunction iterDeco(parent, deco, onWidget, onNode) {\n var locals = deco.locals(parent), offset = 0;\n // Simple, cheap variant for when there are no local decorations\n if (locals.length == 0) {\n for (var i = 0; i < parent.childCount; i++) {\n var child = parent.child(i);\n onNode(child, locals, deco.forChild(offset, child), i);\n offset += child.nodeSize;\n }\n return\n }\n\n var decoIndex = 0, active = [], restNode = null;\n for (var parentIndex = 0;;) {\n if (decoIndex < locals.length && locals[decoIndex].to == offset) {\n var widget = locals[decoIndex++], widgets = (void 0);\n while (decoIndex < locals.length && locals[decoIndex].to == offset)\n { (widgets || (widgets = [widget])).push(locals[decoIndex++]); }\n if (widgets) {\n widgets.sort(compareSide);\n for (var i$1 = 0; i$1 < widgets.length; i$1++) { onWidget(widgets[i$1], parentIndex, !!restNode); }\n } else {\n onWidget(widget, parentIndex, !!restNode);\n }\n }\n\n var child$1 = (void 0), index = (void 0);\n if (restNode) {\n index = -1;\n child$1 = restNode;\n restNode = null;\n } else if (parentIndex < parent.childCount) {\n index = parentIndex;\n child$1 = parent.child(parentIndex++);\n } else {\n break\n }\n\n for (var i$2 = 0; i$2 < active.length; i$2++) { if (active[i$2].to <= offset) { active.splice(i$2--, 1); } }\n while (decoIndex < locals.length && locals[decoIndex].from == offset) { active.push(locals[decoIndex++]); }\n\n var end = offset + child$1.nodeSize;\n if (child$1.isText) {\n var cutAt = end;\n if (decoIndex < locals.length && locals[decoIndex].from < cutAt) { cutAt = locals[decoIndex].from; }\n for (var i$3 = 0; i$3 < active.length; i$3++) { if (active[i$3].to < cutAt) { cutAt = active[i$3].to; } }\n if (cutAt < end) {\n restNode = child$1.cut(cutAt - offset);\n child$1 = child$1.cut(0, cutAt - offset);\n end = cutAt;\n index = -1;\n }\n }\n\n onNode(child$1, active.length ? active.slice() : nothing, deco.forChild(offset, child$1), index);\n offset = end;\n }\n}\n\n// List markers in Mobile Safari will mysteriously disappear\n// sometimes. This works around that.\nfunction iosHacks(dom) {\n if (dom.nodeName == \"UL\" || dom.nodeName == \"OL\") {\n var oldCSS = dom.style.cssText;\n dom.style.cssText = oldCSS + \"; list-style: square !important\";\n window.getComputedStyle(dom).listStyle;\n dom.style.cssText = oldCSS;\n }\n}\n\nfunction nearbyTextNode(node, offset) {\n for (;;) {\n if (node.nodeType == 3) { return node }\n if (node.nodeType == 1 && offset > 0) {\n if (node.childNodes.length > offset && node.childNodes[offset].nodeType == 3)\n { return node.childNodes[offset] }\n node = node.childNodes[offset - 1];\n offset = nodeSize(node);\n } else if (node.nodeType == 1 && offset < node.childNodes.length) {\n node = node.childNodes[offset];\n offset = 0;\n } else {\n return null\n }\n }\n}\n\n// Find a piece of text in an inline fragment, overlapping from-to\nfunction findTextInFragment(frag, text, from, to) {\n for (var i = 0, pos = 0; i < frag.childCount && pos <= to;) {\n var child = frag.child(i++), childStart = pos;\n pos += child.nodeSize;\n if (!child.isText) { continue }\n var str = child.text;\n while (i < frag.childCount) {\n var next = frag.child(i++);\n pos += next.nodeSize;\n if (!next.isText) { break }\n str += next.text;\n }\n if (pos >= from) {\n var found = str.lastIndexOf(text, to - childStart);\n if (found >= 0 && found + text.length + childStart >= from)\n { return childStart + found }\n }\n }\n return -1\n}\n\n// Replace range from-to in an array of view descs with replacement\n// (may be null to just delete). This goes very much against the grain\n// of the rest of this code, which tends to create nodes with the\n// right shape in one go, rather than messing with them after\n// creation, but is necessary in the composition hack.\nfunction replaceNodes(nodes, from, to, view, replacement) {\n var result = [];\n for (var i = 0, off = 0; i < nodes.length; i++) {\n var child = nodes[i], start = off, end = off += child.size;\n if (start >= to || end <= from) {\n result.push(child);\n } else {\n if (start < from) { result.push(child.slice(0, from - start, view)); }\n if (replacement) {\n result.push(replacement);\n replacement = null;\n }\n if (end > to) { result.push(child.slice(to - start, child.size, view)); }\n }\n }\n return result\n}\n\nfunction moveSelectionBlock(state, dir) {\n var ref = state.selection;\n var $anchor = ref.$anchor;\n var $head = ref.$head;\n var $side = dir > 0 ? $anchor.max($head) : $anchor.min($head);\n var $start = !$side.parent.inlineContent ? $side : $side.depth ? state.doc.resolve(dir > 0 ? $side.after() : $side.before()) : null;\n return $start && prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"Selection\"].findFrom($start, dir)\n}\n\nfunction apply(view, sel) {\n view.dispatch(view.state.tr.setSelection(sel).scrollIntoView());\n return true\n}\n\nfunction selectHorizontally(view, dir, mods) {\n var sel = view.state.selection;\n if (sel instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"TextSelection\"]) {\n if (!sel.empty || mods.indexOf(\"s\") > -1) {\n return false\n } else if (view.endOfTextblock(dir > 0 ? \"right\" : \"left\")) {\n var next = moveSelectionBlock(view.state, dir);\n if (next && (next instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"])) { return apply(view, next) }\n return false\n } else {\n var $head = sel.$head, node = $head.textOffset ? null : dir < 0 ? $head.nodeBefore : $head.nodeAfter, desc;\n if (!node || node.isText) { return false }\n var nodePos = dir < 0 ? $head.pos - node.nodeSize : $head.pos;\n if (!(node.isAtom || (desc = view.docView.descAt(nodePos)) && !desc.contentDOM)) { return false }\n if (prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"].isSelectable(node)) {\n return apply(view, new prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"](dir < 0 ? view.state.doc.resolve($head.pos - node.nodeSize) : $head))\n } else if (result.webkit) {\n // Chrome and Safari will introduce extra pointless cursor\n // positions around inline uneditable nodes, so we have to\n // take over and move the cursor past them (#937)\n return apply(view, new prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"TextSelection\"](view.state.doc.resolve(dir < 0 ? nodePos : nodePos + node.nodeSize)))\n } else {\n return false\n }\n }\n } else if (sel instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"] && sel.node.isInline) {\n return apply(view, new prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"TextSelection\"](dir > 0 ? sel.$to : sel.$from))\n } else {\n var next$1 = moveSelectionBlock(view.state, dir);\n if (next$1) { return apply(view, next$1) }\n return false\n }\n}\n\nfunction nodeLen(node) {\n return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length\n}\n\nfunction isIgnorable(dom) {\n var desc = dom.pmViewDesc;\n return desc && desc.size == 0 && (dom.nextSibling || dom.nodeName != \"BR\")\n}\n\n// Make sure the cursor isn't directly after one or more ignored\n// nodes, which will confuse the browser's cursor motion logic.\nfunction skipIgnoredNodesLeft(view) {\n var sel = view.root.getSelection();\n var node = sel.focusNode, offset = sel.focusOffset;\n if (!node) { return }\n var moveNode, moveOffset, force = false;\n // Gecko will do odd things when the selection is directly in front\n // of a non-editable node, so in that case, move it into the next\n // node if possible. Issue prosemirror/prosemirror#832.\n if (result.gecko && node.nodeType == 1 && offset < nodeLen(node) && isIgnorable(node.childNodes[offset])) { force = true; }\n for (;;) {\n if (offset > 0) {\n if (node.nodeType != 1) {\n break\n } else {\n var before = node.childNodes[offset - 1];\n if (isIgnorable(before)) {\n moveNode = node;\n moveOffset = --offset;\n } else if (before.nodeType == 3) {\n node = before;\n offset = node.nodeValue.length;\n } else { break }\n }\n } else if (isBlockNode(node)) {\n break\n } else {\n var prev = node.previousSibling;\n while (prev && isIgnorable(prev)) {\n moveNode = node.parentNode;\n moveOffset = domIndex(prev);\n prev = prev.previousSibling;\n }\n if (!prev) {\n node = node.parentNode;\n if (node == view.dom) { break }\n offset = 0;\n } else {\n node = prev;\n offset = nodeLen(node);\n }\n }\n }\n if (force) { setSelFocus(view, sel, node, offset); }\n else if (moveNode) { setSelFocus(view, sel, moveNode, moveOffset); }\n}\n\n// Make sure the cursor isn't directly before one or more ignored\n// nodes.\nfunction skipIgnoredNodesRight(view) {\n var sel = view.root.getSelection();\n var node = sel.focusNode, offset = sel.focusOffset;\n if (!node) { return }\n var len = nodeLen(node);\n var moveNode, moveOffset;\n for (;;) {\n if (offset < len) {\n if (node.nodeType != 1) { break }\n var after = node.childNodes[offset];\n if (isIgnorable(after)) {\n moveNode = node;\n moveOffset = ++offset;\n }\n else { break }\n } else if (isBlockNode(node)) {\n break\n } else {\n var next = node.nextSibling;\n while (next && isIgnorable(next)) {\n moveNode = next.parentNode;\n moveOffset = domIndex(next) + 1;\n next = next.nextSibling;\n }\n if (!next) {\n node = node.parentNode;\n if (node == view.dom) { break }\n offset = len = 0;\n } else {\n node = next;\n offset = 0;\n len = nodeLen(node);\n }\n }\n }\n if (moveNode) { setSelFocus(view, sel, moveNode, moveOffset); }\n}\n\nfunction isBlockNode(dom) {\n var desc = dom.pmViewDesc;\n return desc && desc.node && desc.node.isBlock\n}\n\nfunction setSelFocus(view, sel, node, offset) {\n if (selectionCollapsed(sel)) {\n var range = document.createRange();\n range.setEnd(node, offset);\n range.setStart(node, offset);\n sel.removeAllRanges();\n sel.addRange(range);\n } else if (sel.extend) {\n sel.extend(node, offset);\n }\n view.domObserver.setCurSelection();\n}\n\n// : (EditorState, number)\n// Check whether vertical selection motion would involve node\n// selections. If so, apply it (if not, the result is left to the\n// browser)\nfunction selectVertically(view, dir, mods) {\n var sel = view.state.selection;\n if (sel instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"TextSelection\"] && !sel.empty || mods.indexOf(\"s\") > -1) { return false }\n var $from = sel.$from;\n var $to = sel.$to;\n\n if (!$from.parent.inlineContent || view.endOfTextblock(dir < 0 ? \"up\" : \"down\")) {\n var next = moveSelectionBlock(view.state, dir);\n if (next && (next instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"]))\n { return apply(view, next) }\n }\n if (!$from.parent.inlineContent) {\n var beyond = prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"Selection\"].findFrom(dir < 0 ? $from : $to, dir);\n return beyond ? apply(view, beyond) : true\n }\n return false\n}\n\nfunction stopNativeHorizontalDelete(view, dir) {\n if (!(view.state.selection instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"TextSelection\"])) { return true }\n var ref = view.state.selection;\n var $head = ref.$head;\n var $anchor = ref.$anchor;\n var empty = ref.empty;\n if (!$head.sameParent($anchor)) { return true }\n if (!empty) { return false }\n if (view.endOfTextblock(dir > 0 ? \"forward\" : \"backward\")) { return true }\n var nextNode = !$head.textOffset && (dir < 0 ? $head.nodeBefore : $head.nodeAfter);\n if (nextNode && !nextNode.isText) {\n var tr = view.state.tr;\n if (dir < 0) { tr.delete($head.pos - nextNode.nodeSize, $head.pos); }\n else { tr.delete($head.pos, $head.pos + nextNode.nodeSize); }\n view.dispatch(tr);\n return true\n }\n return false\n}\n\nfunction switchEditable(view, node, state) {\n view.domObserver.stop();\n node.contentEditable = state;\n view.domObserver.start();\n}\n\n// Issue #867 / https://bugs.chromium.org/p/chromium/issues/detail?id=903821\n// In which Chrome does really wrong things when the down arrow is\n// pressed when the cursor is directly at the start of a textblock and\n// has an uneditable node after it\nfunction chromeDownArrowBug(view) {\n if (!result.chrome || view.state.selection.$head.parentOffset > 0) { return }\n var ref = view.root.getSelection();\n var focusNode = ref.focusNode;\n var focusOffset = ref.focusOffset;\n if (focusNode && focusNode.nodeType == 1 && focusOffset == 0 &&\n focusNode.firstChild && focusNode.firstChild.contentEditable == \"false\") {\n var child = focusNode.firstChild;\n switchEditable(view, child, true);\n setTimeout(function () { return switchEditable(view, child, false); }, 20);\n }\n}\n\n// A backdrop key mapping used to make sure we always suppress keys\n// that have a dangerous default effect, even if the commands they are\n// bound to return false, and to make sure that cursor-motion keys\n// find a cursor (as opposed to a node selection) when pressed. For\n// cursor-motion keys, the code in the handlers also takes care of\n// block selections.\n\nfunction getMods(event) {\n var result = \"\";\n if (event.ctrlKey) { result += \"c\"; }\n if (event.metaKey) { result += \"m\"; }\n if (event.altKey) { result += \"a\"; }\n if (event.shiftKey) { result += \"s\"; }\n return result\n}\n\nfunction captureKeyDown(view, event) {\n var code = event.keyCode, mods = getMods(event);\n if (code == 8 || (result.mac && code == 72 && mods == \"c\")) { // Backspace, Ctrl-h on Mac\n return stopNativeHorizontalDelete(view, -1) || skipIgnoredNodesLeft(view)\n } else if (code == 46 || (result.mac && code == 68 && mods == \"c\")) { // Delete, Ctrl-d on Mac\n return stopNativeHorizontalDelete(view, 1) || skipIgnoredNodesRight(view)\n } else if ((code == 13 && !result.ios) || code == 27) { // Enter (let through on iOS, to avoid keyboard sync issues), Esc\n return true\n } else if (code == 37) { // Left arrow\n return selectHorizontally(view, -1, mods) || skipIgnoredNodesLeft(view)\n } else if (code == 39) { // Right arrow\n return selectHorizontally(view, 1, mods) || skipIgnoredNodesRight(view)\n } else if (code == 38) { // Up arrow\n return selectVertically(view, -1, mods) || skipIgnoredNodesLeft(view)\n } else if (code == 40) { // Down arrow\n return chromeDownArrowBug(view) || selectVertically(view, 1, mods) || skipIgnoredNodesRight(view)\n } else if (mods == (result.mac ? \"m\" : \"c\") &&\n (code == 66 || code == 73 || code == 89 || code == 90)) { // Mod-[biyz]\n return true\n }\n return false\n}\n\nfunction selectionFromDOM(view, origin) {\n var domSel = view.root.getSelection(), doc = view.state.doc;\n var nearestDesc = view.docView.nearestDesc(domSel.focusNode), inWidget = nearestDesc && nearestDesc.size == 0;\n var head = view.docView.posFromDOM(domSel.focusNode, domSel.focusOffset);\n var $head = doc.resolve(head), $anchor, selection;\n if (selectionCollapsed(domSel)) {\n $anchor = $head;\n while (nearestDesc && !nearestDesc.node) { nearestDesc = nearestDesc.parent; }\n if (nearestDesc && nearestDesc.node.isAtom && prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"].isSelectable(nearestDesc.node) && nearestDesc.parent\n && !(nearestDesc.node.isInline && isOnEdge(domSel.focusNode, domSel.focusOffset, nearestDesc.dom))) {\n var pos = nearestDesc.posBefore;\n selection = new prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"](head == pos ? $head : doc.resolve(pos));\n }\n } else {\n $anchor = doc.resolve(view.docView.posFromDOM(domSel.anchorNode, domSel.anchorOffset));\n }\n\n if (!selection) {\n var bias = origin == \"pointer\" || (view.state.selection.head < $head.pos && !inWidget) ? 1 : -1;\n selection = selectionBetween(view, $anchor, $head, bias);\n }\n return selection\n}\n\nfunction selectionToDOM(view, force) {\n var sel = view.state.selection;\n syncNodeSelection(view, sel);\n\n if (view.editable ? !view.hasFocus() : !(hasSelection(view) && document.activeElement.contains(view.dom))) { return }\n\n view.domObserver.disconnectSelection();\n\n if (view.cursorWrapper) {\n selectCursorWrapper(view);\n } else {\n var anchor = sel.anchor;\n var head = sel.head;\n var resetEditableFrom, resetEditableTo;\n if (brokenSelectBetweenUneditable && !(sel instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"TextSelection\"])) {\n if (!sel.$from.parent.inlineContent)\n { resetEditableFrom = temporarilyEditableNear(view, sel.from); }\n if (!sel.empty && !sel.$from.parent.inlineContent)\n { resetEditableTo = temporarilyEditableNear(view, sel.to); }\n }\n view.docView.setSelection(anchor, head, view.root, force);\n if (brokenSelectBetweenUneditable) {\n if (resetEditableFrom) { resetEditable(resetEditableFrom); }\n if (resetEditableTo) { resetEditable(resetEditableTo); }\n }\n if (sel.visible) {\n view.dom.classList.remove(\"ProseMirror-hideselection\");\n } else if (anchor != head) {\n view.dom.classList.add(\"ProseMirror-hideselection\");\n if (\"onselectionchange\" in document) { removeClassOnSelectionChange(view); }\n }\n }\n\n view.domObserver.setCurSelection();\n view.domObserver.connectSelection();\n}\n\n// Kludge to work around Webkit not allowing a selection to start/end\n// between non-editable block nodes. We briefly make something\n// editable, set the selection, then set it uneditable again.\n\nvar brokenSelectBetweenUneditable = result.safari || result.chrome && result.chrome_version < 63;\n\nfunction temporarilyEditableNear(view, pos) {\n var ref = view.docView.domFromPos(pos);\n var node = ref.node;\n var offset = ref.offset;\n var after = offset < node.childNodes.length ? node.childNodes[offset] : null;\n var before = offset ? node.childNodes[offset - 1] : null;\n if (result.safari && after && after.contentEditable == \"false\") { return setEditable(after) }\n if ((!after || after.contentEditable == \"false\") && (!before || before.contentEditable == \"false\")) {\n if (after) { return setEditable(after) }\n else if (before) { return setEditable(before) }\n }\n}\n\nfunction setEditable(element) {\n element.contentEditable = \"true\";\n if (result.safari && element.draggable) { element.draggable = false; element.wasDraggable = true; }\n return element\n}\n\nfunction resetEditable(element) {\n element.contentEditable = \"false\";\n if (element.wasDraggable) { element.draggable = true; element.wasDraggable = null; }\n}\n\nfunction removeClassOnSelectionChange(view) {\n var doc = view.dom.ownerDocument;\n doc.removeEventListener(\"selectionchange\", view.hideSelectionGuard);\n var domSel = view.root.getSelection();\n var node = domSel.anchorNode, offset = domSel.anchorOffset;\n doc.addEventListener(\"selectionchange\", view.hideSelectionGuard = function () {\n if (domSel.anchorNode != node || domSel.anchorOffset != offset) {\n doc.removeEventListener(\"selectionchange\", view.hideSelectionGuard);\n view.dom.classList.remove(\"ProseMirror-hideselection\");\n }\n });\n}\n\nfunction selectCursorWrapper(view) {\n var domSel = view.root.getSelection(), range = document.createRange();\n var node = view.cursorWrapper.dom, img = node.nodeName == \"IMG\";\n if (img) { range.setEnd(node.parentNode, domIndex(node) + 1); }\n else { range.setEnd(node, 0); }\n range.collapse(false);\n domSel.removeAllRanges();\n domSel.addRange(range);\n // Kludge to kill 'control selection' in IE11 when selecting an\n // invisible cursor wrapper, since that would result in those weird\n // resize handles and a selection that considers the absolutely\n // positioned wrapper, rather than the root editable node, the\n // focused element.\n if (!img && !view.state.selection.visible && result.ie && result.ie_version <= 11) {\n node.disabled = true;\n node.disabled = false;\n }\n}\n\nfunction syncNodeSelection(view, sel) {\n if (sel instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"]) {\n var desc = view.docView.descAt(sel.from);\n if (desc != view.lastSelectedViewDesc) {\n clearNodeSelection(view);\n if (desc) { desc.selectNode(); }\n view.lastSelectedViewDesc = desc;\n }\n } else {\n clearNodeSelection(view);\n }\n}\n\n// Clear all DOM statefulness of the last node selection.\nfunction clearNodeSelection(view) {\n if (view.lastSelectedViewDesc) {\n if (view.lastSelectedViewDesc.parent)\n { view.lastSelectedViewDesc.deselectNode(); }\n view.lastSelectedViewDesc = null;\n }\n}\n\nfunction selectionBetween(view, $anchor, $head, bias) {\n return view.someProp(\"createSelectionBetween\", function (f) { return f(view, $anchor, $head); })\n || prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"TextSelection\"].between($anchor, $head, bias)\n}\n\nfunction hasFocusAndSelection(view) {\n if (view.editable && view.root.activeElement != view.dom) { return false }\n return hasSelection(view)\n}\n\nfunction hasSelection(view) {\n var sel = view.root.getSelection();\n if (!sel.anchorNode) { return false }\n try {\n // Firefox will raise 'permission denied' errors when accessing\n // properties of `sel.anchorNode` when it's in a generated CSS\n // element.\n return view.dom.contains(sel.anchorNode.nodeType == 3 ? sel.anchorNode.parentNode : sel.anchorNode) &&\n (view.editable || view.dom.contains(sel.focusNode.nodeType == 3 ? sel.focusNode.parentNode : sel.focusNode))\n } catch(_) {\n return false\n }\n}\n\nfunction anchorInRightPlace(view) {\n var anchorDOM = view.docView.domFromPos(view.state.selection.anchor);\n var domSel = view.root.getSelection();\n return isEquivalentPosition(anchorDOM.node, anchorDOM.offset, domSel.anchorNode, domSel.anchorOffset)\n}\n\n// Note that all referencing and parsing is done with the\n// start-of-operation selection and document, since that's the one\n// that the DOM represents. If any changes came in in the meantime,\n// the modification is mapped over those before it is applied, in\n// readDOMChange.\n\nfunction parseBetween(view, from_, to_) {\n var ref = view.docView.parseRange(from_, to_);\n var parent = ref.node;\n var fromOffset = ref.fromOffset;\n var toOffset = ref.toOffset;\n var from = ref.from;\n var to = ref.to;\n\n var domSel = view.root.getSelection(), find = null, anchor = domSel.anchorNode;\n if (anchor && view.dom.contains(anchor.nodeType == 1 ? anchor : anchor.parentNode)) {\n find = [{node: anchor, offset: domSel.anchorOffset}];\n if (!selectionCollapsed(domSel))\n { find.push({node: domSel.focusNode, offset: domSel.focusOffset}); }\n }\n // Work around issue in Chrome where backspacing sometimes replaces\n // the deleted content with a random BR node (issues #799, #831)\n if (result.chrome && view.lastKeyCode === 8) {\n for (var off = toOffset; off > fromOffset; off--) {\n var node = parent.childNodes[off - 1], desc = node.pmViewDesc;\n if (node.nodeType == \"BR\" && !desc) { toOffset = off; break }\n if (!desc || desc.size) { break }\n }\n }\n var startDoc = view.state.doc;\n var parser = view.someProp(\"domParser\") || prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"DOMParser\"].fromSchema(view.state.schema);\n var $from = startDoc.resolve(from);\n\n var sel = null, doc = parser.parse(parent, {\n topNode: $from.parent,\n topMatch: $from.parent.contentMatchAt($from.index()),\n topOpen: true,\n from: fromOffset,\n to: toOffset,\n preserveWhitespace: $from.parent.type.spec.code ? \"full\" : true,\n editableContent: true,\n findPositions: find,\n ruleFromNode: ruleFromNode,\n context: $from\n });\n if (find && find[0].pos != null) {\n var anchor$1 = find[0].pos, head = find[1] && find[1].pos;\n if (head == null) { head = anchor$1; }\n sel = {anchor: anchor$1 + from, head: head + from};\n }\n return {doc: doc, sel: sel, from: from, to: to}\n}\n\nfunction ruleFromNode(dom) {\n var desc = dom.pmViewDesc;\n if (desc) {\n return desc.parseRule()\n } else if (dom.nodeName == \"BR\" && dom.parentNode) {\n // Safari replaces the list item or table cell with a BR\n // directly in the list node (?!) if you delete the last\n // character in a list item or table cell (#708, #862)\n if (result.safari && /^(ul|ol)$/i.test(dom.parentNode.nodeName)) {\n var skip = document.createElement(\"div\");\n skip.appendChild(document.createElement(\"li\"));\n return {skip: skip}\n } else if (dom.parentNode.lastChild == dom || result.safari && /^(tr|table)$/i.test(dom.parentNode.nodeName)) {\n return {ignore: true}\n }\n } else if (dom.nodeName == \"IMG\" && dom.getAttribute(\"mark-placeholder\")) {\n return {ignore: true}\n }\n}\n\nfunction readDOMChange(view, from, to, typeOver, addedNodes) {\n if (from < 0) {\n var origin = view.lastSelectionTime > Date.now() - 50 ? view.lastSelectionOrigin : null;\n var newSel = selectionFromDOM(view, origin);\n if (!view.state.selection.eq(newSel)) {\n var tr$1 = view.state.tr.setSelection(newSel);\n if (origin == \"pointer\") { tr$1.setMeta(\"pointer\", true); }\n else if (origin == \"key\") { tr$1.scrollIntoView(); }\n view.dispatch(tr$1);\n }\n return\n }\n\n var $before = view.state.doc.resolve(from);\n var shared = $before.sharedDepth(to);\n from = $before.before(shared + 1);\n to = view.state.doc.resolve(to).after(shared + 1);\n\n var sel = view.state.selection;\n var parse = parseBetween(view, from, to);\n\n var doc = view.state.doc, compare = doc.slice(parse.from, parse.to);\n var preferredPos, preferredSide;\n // Prefer anchoring to end when Backspace is pressed\n if (view.lastKeyCode === 8 && Date.now() - 100 < view.lastKeyCodeTime) {\n preferredPos = view.state.selection.to;\n preferredSide = \"end\";\n } else {\n preferredPos = view.state.selection.from;\n preferredSide = \"start\";\n }\n view.lastKeyCode = null;\n\n var change = findDiff(compare.content, parse.doc.content, parse.from, preferredPos, preferredSide);\n if (!change) {\n if (typeOver && sel instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"TextSelection\"] && !sel.empty && sel.$head.sameParent(sel.$anchor) &&\n !view.composing && !(parse.sel && parse.sel.anchor != parse.sel.head)) {\n change = {start: sel.from, endA: sel.to, endB: sel.to};\n } else {\n if (parse.sel) {\n var sel$1 = resolveSelection(view, view.state.doc, parse.sel);\n if (sel$1 && !sel$1.eq(view.state.selection)) { view.dispatch(view.state.tr.setSelection(sel$1)); }\n }\n return\n }\n }\n view.domChangeCount++;\n // Handle the case where overwriting a selection by typing matches\n // the start or end of the selected content, creating a change\n // that's smaller than what was actually overwritten.\n if (view.state.selection.from < view.state.selection.to &&\n change.start == change.endB &&\n view.state.selection instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"TextSelection\"]) {\n if (change.start > view.state.selection.from && change.start <= view.state.selection.from + 2) {\n change.start = view.state.selection.from;\n } else if (change.endA < view.state.selection.to && change.endA >= view.state.selection.to - 2) {\n change.endB += (view.state.selection.to - change.endA);\n change.endA = view.state.selection.to;\n }\n }\n\n // IE11 will insert a non-breaking space _ahead_ of the space after\n // the cursor space when adding a space before another space. When\n // that happened, adjust the change to cover the space instead.\n if (result.ie && result.ie_version <= 11 && change.endB == change.start + 1 &&\n change.endA == change.start && change.start > parse.from &&\n parse.doc.textBetween(change.start - parse.from - 1, change.start - parse.from + 1) == \" \\u00a0\") {\n change.start--;\n change.endA--;\n change.endB--;\n }\n\n var $from = parse.doc.resolveNoCache(change.start - parse.from);\n var $to = parse.doc.resolveNoCache(change.endB - parse.from);\n var nextSel;\n // If this looks like the effect of pressing Enter (or was recorded\n // as being an iOS enter press), just dispatch an Enter key instead.\n if (((result.ios && view.lastIOSEnter > Date.now() - 100 &&\n (!$from.sameParent($to) || addedNodes.some(function (n) { return n.nodeName == \"DIV\"; }))) ||\n (!$from.sameParent($to) && $from.pos < parse.doc.content.size &&\n (nextSel = prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"Selection\"].findFrom(parse.doc.resolve($from.pos + 1), 1, true)) &&\n nextSel.head == $to.pos)) &&\n view.someProp(\"handleKeyDown\", function (f) { return f(view, keyEvent(13, \"Enter\")); })) {\n view.lastIOSEnter = 0;\n return\n }\n // Same for backspace\n if (view.state.selection.anchor > change.start &&\n looksLikeJoin(doc, change.start, change.endA, $from, $to) &&\n view.someProp(\"handleKeyDown\", function (f) { return f(view, keyEvent(8, \"Backspace\")); })) {\n if (result.android && result.chrome) { view.domObserver.suppressSelectionUpdates(); } // #820\n return\n }\n\n var chFrom = change.start, chTo = change.endA;\n\n var tr, storedMarks, markChange, $from1;\n if ($from.sameParent($to) && $from.parent.inlineContent) {\n if ($from.pos == $to.pos) { // Deletion\n // IE11 sometimes weirdly moves the DOM selection around after\n // backspacing out the first element in a textblock\n if (result.ie && result.ie_version <= 11 && $from.parentOffset == 0) {\n view.domObserver.suppressSelectionUpdates();\n setTimeout(function () { return selectionToDOM(view); }, 20);\n }\n tr = view.state.tr.delete(chFrom, chTo);\n storedMarks = doc.resolve(change.start).marksAcross(doc.resolve(change.endA));\n } else if ( // Adding or removing a mark\n change.endA == change.endB && ($from1 = doc.resolve(change.start)) &&\n (markChange = isMarkChange($from.parent.content.cut($from.parentOffset, $to.parentOffset),\n $from1.parent.content.cut($from1.parentOffset, change.endA - $from1.start())))\n ) {\n tr = view.state.tr;\n if (markChange.type == \"add\") { tr.addMark(chFrom, chTo, markChange.mark); }\n else { tr.removeMark(chFrom, chTo, markChange.mark); }\n } else if ($from.parent.child($from.index()).isText && $from.index() == $to.index() - ($to.textOffset ? 0 : 1)) {\n // Both positions in the same text node -- simply insert text\n var text = $from.parent.textBetween($from.parentOffset, $to.parentOffset);\n if (view.someProp(\"handleTextInput\", function (f) { return f(view, chFrom, chTo, text); })) { return }\n tr = view.state.tr.insertText(text, chFrom, chTo);\n }\n }\n\n if (!tr)\n { tr = view.state.tr.replace(chFrom, chTo, parse.doc.slice(change.start - parse.from, change.endB - parse.from)); }\n if (parse.sel) {\n var sel$2 = resolveSelection(view, tr.doc, parse.sel);\n // Chrome Android will sometimes, during composition, report the\n // selection in the wrong place. If it looks like that is\n // happening, don't update the selection.\n // Edge just doesn't move the cursor forward when you start typing\n // in an empty block or between br nodes.\n if (sel$2 && !(result.chrome && result.android && view.composing && sel$2.empty && sel$2.head == chFrom ||\n result.ie && sel$2.empty && sel$2.head == chFrom))\n { tr.setSelection(sel$2); }\n }\n if (storedMarks) { tr.ensureMarks(storedMarks); }\n view.dispatch(tr.scrollIntoView());\n}\n\nfunction resolveSelection(view, doc, parsedSel) {\n if (Math.max(parsedSel.anchor, parsedSel.head) > doc.content.size) { return null }\n return selectionBetween(view, doc.resolve(parsedSel.anchor), doc.resolve(parsedSel.head))\n}\n\n// : (Fragment, Fragment) → ?{mark: Mark, type: string}\n// Given two same-length, non-empty fragments of inline content,\n// determine whether the first could be created from the second by\n// removing or adding a single mark type.\nfunction isMarkChange(cur, prev) {\n var curMarks = cur.firstChild.marks, prevMarks = prev.firstChild.marks;\n var added = curMarks, removed = prevMarks, type, mark, update;\n for (var i = 0; i < prevMarks.length; i++) { added = prevMarks[i].removeFromSet(added); }\n for (var i$1 = 0; i$1 < curMarks.length; i$1++) { removed = curMarks[i$1].removeFromSet(removed); }\n if (added.length == 1 && removed.length == 0) {\n mark = added[0];\n type = \"add\";\n update = function (node) { return node.mark(mark.addToSet(node.marks)); };\n } else if (added.length == 0 && removed.length == 1) {\n mark = removed[0];\n type = \"remove\";\n update = function (node) { return node.mark(mark.removeFromSet(node.marks)); };\n } else {\n return null\n }\n var updated = [];\n for (var i$2 = 0; i$2 < prev.childCount; i$2++) { updated.push(update(prev.child(i$2))); }\n if (prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(updated).eq(cur)) { return {mark: mark, type: type} }\n}\n\nfunction looksLikeJoin(old, start, end, $newStart, $newEnd) {\n if (!$newStart.parent.isTextblock ||\n // The content must have shrunk\n end - start <= $newEnd.pos - $newStart.pos ||\n // newEnd must point directly at or after the end of the block that newStart points into\n skipClosingAndOpening($newStart, true, false) < $newEnd.pos)\n { return false }\n\n var $start = old.resolve(start);\n // Start must be at the end of a block\n if ($start.parentOffset < $start.parent.content.size || !$start.parent.isTextblock)\n { return false }\n var $next = old.resolve(skipClosingAndOpening($start, true, true));\n // The next textblock must start before end and end near it\n if (!$next.parent.isTextblock || $next.pos > end ||\n skipClosingAndOpening($next, true, false) < end)\n { return false }\n\n // The fragments after the join point must match\n return $newStart.parent.content.cut($newStart.parentOffset).eq($next.parent.content)\n}\n\nfunction skipClosingAndOpening($pos, fromEnd, mayOpen) {\n var depth = $pos.depth, end = fromEnd ? $pos.end() : $pos.pos;\n while (depth > 0 && (fromEnd || $pos.indexAfter(depth) == $pos.node(depth).childCount)) {\n depth--;\n end++;\n fromEnd = false;\n }\n if (mayOpen) {\n var next = $pos.node(depth).maybeChild($pos.indexAfter(depth));\n while (next && !next.isLeaf) {\n next = next.firstChild;\n end++;\n }\n }\n return end\n}\n\nfunction findDiff(a, b, pos, preferredPos, preferredSide) {\n var start = a.findDiffStart(b, pos);\n if (start == null) { return null }\n var ref = a.findDiffEnd(b, pos + a.size, pos + b.size);\n var endA = ref.a;\n var endB = ref.b;\n if (preferredSide == \"end\") {\n var adjust = Math.max(0, start - Math.min(endA, endB));\n preferredPos -= endA + adjust - start;\n }\n if (endA < start && a.size < b.size) {\n var move = preferredPos <= start && preferredPos >= endA ? start - preferredPos : 0;\n start -= move;\n endB = start + (endB - endA);\n endA = start;\n } else if (endB < start) {\n var move$1 = preferredPos <= start && preferredPos >= endB ? start - preferredPos : 0;\n start -= move$1;\n endA = start + (endA - endB);\n endB = start;\n }\n return {start: start, endA: endA, endB: endB}\n}\n\nfunction serializeForClipboard(view, slice) {\n var context = [];\n var content = slice.content;\n var openStart = slice.openStart;\n var openEnd = slice.openEnd;\n while (openStart > 1 && openEnd > 1 && content.childCount == 1 && content.firstChild.childCount == 1) {\n openStart--;\n openEnd--;\n var node = content.firstChild;\n context.push(node.type.name, node.type.hasRequiredAttrs() ? node.attrs : null);\n content = node.content;\n }\n\n var serializer = view.someProp(\"clipboardSerializer\") || prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"DOMSerializer\"].fromSchema(view.state.schema);\n var doc = detachedDoc(), wrap = doc.createElement(\"div\");\n wrap.appendChild(serializer.serializeFragment(content, {document: doc}));\n\n var firstChild = wrap.firstChild, needsWrap;\n while (firstChild && firstChild.nodeType == 1 && (needsWrap = wrapMap[firstChild.nodeName.toLowerCase()])) {\n for (var i = needsWrap.length - 1; i >= 0; i--) {\n var wrapper = doc.createElement(needsWrap[i]);\n while (wrap.firstChild) { wrapper.appendChild(wrap.firstChild); }\n wrap.appendChild(wrapper);\n }\n firstChild = wrap.firstChild;\n }\n\n if (firstChild && firstChild.nodeType == 1)\n { firstChild.setAttribute(\"data-pm-slice\", (openStart + \" \" + openEnd + \" \" + (JSON.stringify(context)))); }\n\n var text = view.someProp(\"clipboardTextSerializer\", function (f) { return f(slice); }) ||\n slice.content.textBetween(0, slice.content.size, \"\\n\\n\");\n\n return {dom: wrap, text: text}\n}\n\n// : (EditorView, string, string, ?bool, ResolvedPos) → ?Slice\n// Read a slice of content from the clipboard (or drop data).\nfunction parseFromClipboard(view, text, html, plainText, $context) {\n var dom, inCode = $context.parent.type.spec.code, slice;\n if (!html && !text) { return null }\n var asText = text && (plainText || inCode || !html);\n if (asText) {\n view.someProp(\"transformPastedText\", function (f) { text = f(text); });\n if (inCode) { return new prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Slice\"](prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(view.state.schema.text(text)), 0, 0) }\n var parsed = view.someProp(\"clipboardTextParser\", function (f) { return f(text, $context); });\n if (parsed) {\n slice = parsed;\n } else {\n dom = document.createElement(\"div\");\n text.trim().split(/(?:\\r\\n?|\\n)+/).forEach(function (block) {\n dom.appendChild(document.createElement(\"p\")).textContent = block;\n });\n }\n } else {\n view.someProp(\"transformPastedHTML\", function (f) { html = f(html); });\n dom = readHTML(html);\n }\n\n var contextNode = dom && dom.querySelector(\"[data-pm-slice]\");\n var sliceData = contextNode && /^(\\d+) (\\d+) (.*)/.exec(contextNode.getAttribute(\"data-pm-slice\"));\n if (!slice) {\n var parser = view.someProp(\"clipboardParser\") || view.someProp(\"domParser\") || prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"DOMParser\"].fromSchema(view.state.schema);\n slice = parser.parseSlice(dom, {preserveWhitespace: !!(asText || sliceData), context: $context});\n }\n if (sliceData)\n { slice = addContext(closeSlice(slice, +sliceData[1], +sliceData[2]), sliceData[3]); }\n else // HTML wasn't created by ProseMirror. Make sure top-level siblings are coherent\n { slice = prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Slice\"].maxOpen(normalizeSiblings(slice.content, $context), false); }\n\n view.someProp(\"transformPasted\", function (f) { slice = f(slice); });\n return slice\n}\n\n// Takes a slice parsed with parseSlice, which means there hasn't been\n// any content-expression checking done on the top nodes, tries to\n// find a parent node in the current context that might fit the nodes,\n// and if successful, rebuilds the slice so that it fits into that parent.\n//\n// This addresses the problem that Transform.replace expects a\n// coherent slice, and will fail to place a set of siblings that don't\n// fit anywhere in the schema.\nfunction normalizeSiblings(fragment, $context) {\n if (fragment.childCount < 2) { return fragment }\n var loop = function ( d ) {\n var parent = $context.node(d);\n var match = parent.contentMatchAt($context.index(d));\n var lastWrap = (void 0), result = [];\n fragment.forEach(function (node) {\n if (!result) { return }\n var wrap = match.findWrapping(node.type), inLast;\n if (!wrap) { return result = null }\n if (inLast = result.length && lastWrap.length && addToSibling(wrap, lastWrap, node, result[result.length - 1], 0)) {\n result[result.length - 1] = inLast;\n } else {\n if (result.length) { result[result.length - 1] = closeRight(result[result.length - 1], lastWrap.length); }\n var wrapped = withWrappers(node, wrap);\n result.push(wrapped);\n match = match.matchType(wrapped.type, wrapped.attrs);\n lastWrap = wrap;\n }\n });\n if (result) { return { v: prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(result) } }\n };\n\n for (var d = $context.depth; d >= 0; d--) {\n var returned = loop( d );\n\n if ( returned ) return returned.v;\n }\n return fragment\n}\n\nfunction withWrappers(node, wrap, from) {\n if ( from === void 0 ) from = 0;\n\n for (var i = wrap.length - 1; i >= from; i--)\n { node = wrap[i].create(null, prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(node)); }\n return node\n}\n\n// Used to group adjacent nodes wrapped in similar parents by\n// normalizeSiblings into the same parent node\nfunction addToSibling(wrap, lastWrap, node, sibling, depth) {\n if (depth < wrap.length && depth < lastWrap.length && wrap[depth] == lastWrap[depth]) {\n var inner = addToSibling(wrap, lastWrap, node, sibling.lastChild, depth + 1);\n if (inner) { return sibling.copy(sibling.content.replaceChild(sibling.childCount - 1, inner)) }\n var match = sibling.contentMatchAt(sibling.childCount);\n if (match.matchType(depth == wrap.length - 1 ? node.type : wrap[depth + 1]))\n { return sibling.copy(sibling.content.append(prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(withWrappers(node, wrap, depth + 1)))) }\n }\n}\n\nfunction closeRight(node, depth) {\n if (depth == 0) { return node }\n var fragment = node.content.replaceChild(node.childCount - 1, closeRight(node.lastChild, depth - 1));\n var fill = node.contentMatchAt(node.childCount).fillBefore(prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].empty, true);\n return node.copy(fragment.append(fill))\n}\n\nfunction closeRange(fragment, side, from, to, depth, openEnd) {\n var node = side < 0 ? fragment.firstChild : fragment.lastChild, inner = node.content;\n if (depth < to - 1) { inner = closeRange(inner, side, from, to, depth + 1, openEnd); }\n if (depth >= from)\n { inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, fragment.childCount > 1 || openEnd <= depth).append(inner)\n : inner.append(node.contentMatchAt(node.childCount).fillBefore(prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].empty, true)); }\n return fragment.replaceChild(side < 0 ? 0 : fragment.childCount - 1, node.copy(inner))\n}\n\nfunction closeSlice(slice, openStart, openEnd) {\n if (openStart < slice.openStart)\n { slice = new prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Slice\"](closeRange(slice.content, -1, openStart, slice.openStart, 0, slice.openEnd), openStart, slice.openEnd); }\n if (openEnd < slice.openEnd)\n { slice = new prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Slice\"](closeRange(slice.content, 1, openEnd, slice.openEnd, 0, 0), slice.openStart, openEnd); }\n return slice\n}\n\n// Trick from jQuery -- some elements must be wrapped in other\n// elements for innerHTML to work. I.e. if you do `div.innerHTML =\n// \"..\"` the table cells are ignored.\nvar wrapMap = {\n thead: [\"table\"],\n tbody: [\"table\"],\n tfoot: [\"table\"],\n caption: [\"table\"],\n colgroup: [\"table\"],\n col: [\"table\", \"colgroup\"],\n tr: [\"table\", \"tbody\"],\n td: [\"table\", \"tbody\", \"tr\"],\n th: [\"table\", \"tbody\", \"tr\"]\n};\n\nvar _detachedDoc = null;\nfunction detachedDoc() {\n return _detachedDoc || (_detachedDoc = document.implementation.createHTMLDocument(\"title\"))\n}\n\nfunction readHTML(html) {\n var metas = /(\\s*]*>)*/.exec(html);\n if (metas) { html = html.slice(metas[0].length); }\n var elt = detachedDoc().createElement(\"div\");\n var firstTag = /(?:]*>)*<([a-z][^>\\s]+)/i.exec(html), wrap, depth = 0;\n if (wrap = firstTag && wrapMap[firstTag[1].toLowerCase()]) {\n html = wrap.map(function (n) { return \"<\" + n + \">\"; }).join(\"\") + html + wrap.map(function (n) { return \"\"; }).reverse().join(\"\");\n depth = wrap.length;\n }\n elt.innerHTML = html;\n for (var i = 0; i < depth; i++) { elt = elt.firstChild; }\n return elt\n}\n\nfunction addContext(slice, context) {\n if (!slice.size) { return slice }\n var schema = slice.content.firstChild.type.schema, array;\n try { array = JSON.parse(context); }\n catch(e) { return slice }\n var content = slice.content;\n var openStart = slice.openStart;\n var openEnd = slice.openEnd;\n for (var i = array.length - 2; i >= 0; i -= 2) {\n var type = schema.nodes[array[i]];\n if (!type || type.hasRequiredAttrs()) { break }\n content = prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Fragment\"].from(type.create(array[i + 1], content));\n openStart++; openEnd++;\n }\n return new prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Slice\"](content, openStart, openEnd)\n}\n\nvar observeOptions = {\n childList: true,\n characterData: true,\n characterDataOldValue: true,\n attributes: true,\n attributeOldValue: true,\n subtree: true\n};\n// IE11 has very broken mutation observers, so we also listen to DOMCharacterDataModified\nvar useCharData = result.ie && result.ie_version <= 11;\n\nvar SelectionState = function SelectionState() {\n this.anchorNode = this.anchorOffset = this.focusNode = this.focusOffset = null;\n};\n\nSelectionState.prototype.set = function set (sel) {\n this.anchorNode = sel.anchorNode; this.anchorOffset = sel.anchorOffset;\n this.focusNode = sel.focusNode; this.focusOffset = sel.focusOffset;\n};\n\nSelectionState.prototype.eq = function eq (sel) {\n return sel.anchorNode == this.anchorNode && sel.anchorOffset == this.anchorOffset &&\n sel.focusNode == this.focusNode && sel.focusOffset == this.focusOffset\n};\n\nvar DOMObserver = function DOMObserver(view, handleDOMChange) {\n var this$1 = this;\n\n this.view = view;\n this.handleDOMChange = handleDOMChange;\n this.queue = [];\n this.flushingSoon = false;\n this.observer = window.MutationObserver &&\n new window.MutationObserver(function (mutations) {\n for (var i = 0; i < mutations.length; i++) { this$1.queue.push(mutations[i]); }\n // IE11 will sometimes (on backspacing out a single character\n // text node after a BR node) call the observer callback\n // before actually updating the DOM, which will cause\n // ProseMirror to miss the change (see #930)\n if (result.ie && result.ie_version <= 11 && mutations.some(\n function (m) { return m.type == \"childList\" && m.removedNodes.length ||\n m.type == \"characterData\" && m.oldValue.length > m.target.nodeValue.length; }))\n { this$1.flushSoon(); }\n else\n { this$1.flush(); }\n });\n this.currentSelection = new SelectionState;\n if (useCharData) {\n this.onCharData = function (e) {\n this$1.queue.push({target: e.target, type: \"characterData\", oldValue: e.prevValue});\n this$1.flushSoon();\n };\n }\n this.onSelectionChange = this.onSelectionChange.bind(this);\n this.suppressingSelectionUpdates = false;\n};\n\nDOMObserver.prototype.flushSoon = function flushSoon () {\n var this$1 = this;\n\n if (!this.flushingSoon) {\n this.flushingSoon = true;\n window.setTimeout(function () { this$1.flushingSoon = false; this$1.flush(); }, 20);\n }\n};\n\nDOMObserver.prototype.start = function start () {\n if (this.observer)\n { this.observer.observe(this.view.dom, observeOptions); }\n if (useCharData)\n { this.view.dom.addEventListener(\"DOMCharacterDataModified\", this.onCharData); }\n this.connectSelection();\n};\n\nDOMObserver.prototype.stop = function stop () {\n var this$1 = this;\n\n if (this.observer) {\n var take = this.observer.takeRecords();\n if (take.length) {\n for (var i = 0; i < take.length; i++) { this.queue.push(take[i]); }\n window.setTimeout(function () { return this$1.flush(); }, 20);\n }\n this.observer.disconnect();\n }\n if (useCharData) { this.view.dom.removeEventListener(\"DOMCharacterDataModified\", this.onCharData); }\n this.disconnectSelection();\n};\n\nDOMObserver.prototype.connectSelection = function connectSelection () {\n this.view.dom.ownerDocument.addEventListener(\"selectionchange\", this.onSelectionChange);\n};\n\nDOMObserver.prototype.disconnectSelection = function disconnectSelection () {\n this.view.dom.ownerDocument.removeEventListener(\"selectionchange\", this.onSelectionChange);\n};\n\nDOMObserver.prototype.suppressSelectionUpdates = function suppressSelectionUpdates () {\n var this$1 = this;\n\n this.suppressingSelectionUpdates = true;\n setTimeout(function () { return this$1.suppressingSelectionUpdates = false; }, 50);\n};\n\nDOMObserver.prototype.onSelectionChange = function onSelectionChange () {\n if (!hasFocusAndSelection(this.view)) { return }\n if (this.suppressingSelectionUpdates) { return selectionToDOM(this.view) }\n // Deletions on IE11 fire their events in the wrong order, giving\n // us a selection change event before the DOM changes are\n // reported.\n if (result.ie && result.ie_version <= 11 && !this.view.state.selection.empty) {\n var sel = this.view.root.getSelection();\n // Selection.isCollapsed isn't reliable on IE\n if (sel.focusNode && isEquivalentPosition(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset))\n { return this.flushSoon() }\n }\n this.flush();\n};\n\nDOMObserver.prototype.setCurSelection = function setCurSelection () {\n this.currentSelection.set(this.view.root.getSelection());\n};\n\nDOMObserver.prototype.ignoreSelectionChange = function ignoreSelectionChange (sel) {\n if (sel.rangeCount == 0) { return true }\n var container = sel.getRangeAt(0).commonAncestorContainer;\n var desc = this.view.docView.nearestDesc(container);\n if (desc && desc.ignoreMutation({type: \"selection\", target: container.nodeType == 3 ? container.parentNode : container})) {\n this.setCurSelection();\n return true\n }\n};\n\nDOMObserver.prototype.flush = function flush () {\n if (!this.view.docView || this.flushingSoon) { return }\n var mutations = this.observer ? this.observer.takeRecords() : [];\n if (this.queue.length) {\n mutations = this.queue.concat(mutations);\n this.queue.length = 0;\n }\n\n var sel = this.view.root.getSelection();\n var newSel = !this.suppressingSelectionUpdates && !this.currentSelection.eq(sel) && hasSelection(this.view) && !this.ignoreSelectionChange(sel);\n\n var from = -1, to = -1, typeOver = false, added = [];\n if (this.view.editable) {\n for (var i = 0; i < mutations.length; i++) {\n var result$1 = this.registerMutation(mutations[i], added);\n if (result$1) {\n from = from < 0 ? result$1.from : Math.min(result$1.from, from);\n to = to < 0 ? result$1.to : Math.max(result$1.to, to);\n if (result$1.typeOver && !this.view.composing) { typeOver = true; }\n }\n }\n }\n\n if (result.gecko && added.length > 1) {\n var brs = added.filter(function (n) { return n.nodeName == \"BR\"; });\n if (brs.length == 2) {\n var a = brs[0];\n var b = brs[1];\n if (a.parentNode && a.parentNode.parentNode == b.parentNode) { b.remove(); }\n else { a.remove(); }\n }\n }\n\n if (from > -1 || newSel) {\n if (from > -1) {\n this.view.docView.markDirty(from, to);\n checkCSS(this.view);\n }\n this.handleDOMChange(from, to, typeOver, added);\n if (this.view.docView.dirty) { this.view.updateState(this.view.state); }\n else if (!this.currentSelection.eq(sel)) { selectionToDOM(this.view); }\n }\n};\n\nDOMObserver.prototype.registerMutation = function registerMutation (mut, added) {\n // Ignore mutations inside nodes that were already noted as inserted\n if (added.indexOf(mut.target) > -1) { return null }\n var desc = this.view.docView.nearestDesc(mut.target);\n if (mut.type == \"attributes\" &&\n (desc == this.view.docView || mut.attributeName == \"contenteditable\" ||\n // Firefox sometimes fires spurious events for null/empty styles\n (mut.attributeName == \"style\" && !mut.oldValue && !mut.target.getAttribute(\"style\"))))\n { return null }\n if (!desc || desc.ignoreMutation(mut)) { return null }\n\n if (mut.type == \"childList\") {\n var prev = mut.previousSibling, next = mut.nextSibling;\n if (result.ie && result.ie_version <= 11 && mut.addedNodes.length) {\n // IE11 gives us incorrect next/prev siblings for some\n // insertions, so if there are added nodes, recompute those\n for (var i = 0; i < mut.addedNodes.length; i++) {\n var ref = mut.addedNodes[i];\n var previousSibling = ref.previousSibling;\n var nextSibling = ref.nextSibling;\n if (!previousSibling || Array.prototype.indexOf.call(mut.addedNodes, previousSibling) < 0) { prev = previousSibling; }\n if (!nextSibling || Array.prototype.indexOf.call(mut.addedNodes, nextSibling) < 0) { next = nextSibling; }\n }\n }\n var fromOffset = prev && prev.parentNode == mut.target\n ? domIndex(prev) + 1 : 0;\n var from = desc.localPosFromDOM(mut.target, fromOffset, -1);\n var toOffset = next && next.parentNode == mut.target\n ? domIndex(next) : mut.target.childNodes.length;\n for (var i$1 = 0; i$1 < mut.addedNodes.length; i$1++) { added.push(mut.addedNodes[i$1]); }\n var to = desc.localPosFromDOM(mut.target, toOffset, 1);\n return {from: from, to: to}\n } else if (mut.type == \"attributes\") {\n return {from: desc.posAtStart - desc.border, to: desc.posAtEnd + desc.border}\n } else { // \"characterData\"\n return {\n from: desc.posAtStart,\n to: desc.posAtEnd,\n // An event was generated for a text change that didn't change\n // any text. Mark the dom change to fall back to assuming the\n // selection was typed over with an identical value if it can't\n // find another change.\n typeOver: mut.target.nodeValue == mut.oldValue\n }\n }\n};\n\nvar cssChecked = false;\n\nfunction checkCSS(view) {\n if (cssChecked) { return }\n cssChecked = true;\n if (getComputedStyle(view.dom).whiteSpace == \"normal\")\n { 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.\"); }\n}\n\n// A collection of DOM events that occur within the editor, and callback functions\n// to invoke when the event fires.\nvar handlers = {}, editHandlers = {};\n\nfunction initInput(view) {\n view.shiftKey = false;\n view.mouseDown = null;\n view.lastKeyCode = null;\n view.lastKeyCodeTime = 0;\n view.lastClick = {time: 0, x: 0, y: 0, type: \"\"};\n view.lastSelectionOrigin = null;\n view.lastSelectionTime = 0;\n\n view.lastIOSEnter = 0;\n\n view.composing = false;\n view.composingTimeout = null;\n view.compositionNodes = [];\n view.compositionEndedAt = -2e8;\n\n view.domObserver = new DOMObserver(view, function (from, to, typeOver, added) { return readDOMChange(view, from, to, typeOver, added); });\n view.domObserver.start();\n // Used by hacks like the beforeinput handler to check whether anything happened in the DOM\n view.domChangeCount = 0;\n\n view.eventHandlers = Object.create(null);\n var loop = function ( event ) {\n var handler = handlers[event];\n view.dom.addEventListener(event, view.eventHandlers[event] = function (event) {\n if (eventBelongsToView(view, event) && !runCustomHandler(view, event) &&\n (view.editable || !(event.type in editHandlers)))\n { handler(view, event); }\n });\n };\n\n for (var event in handlers) loop( event );\n // On Safari, for reasons beyond my understanding, adding an input\n // event handler makes an issue where the composition vanishes when\n // you press enter go away.\n if (result.safari) { view.dom.addEventListener(\"input\", function () { return null; }); }\n\n ensureListeners(view);\n}\n\nfunction setSelectionOrigin(view, origin) {\n view.lastSelectionOrigin = origin;\n view.lastSelectionTime = Date.now();\n}\n\nfunction destroyInput(view) {\n view.domObserver.stop();\n for (var type in view.eventHandlers)\n { view.dom.removeEventListener(type, view.eventHandlers[type]); }\n clearTimeout(view.composingTimeout);\n}\n\nfunction ensureListeners(view) {\n view.someProp(\"handleDOMEvents\", function (currentHandlers) {\n for (var type in currentHandlers) { if (!view.eventHandlers[type])\n { view.dom.addEventListener(type, view.eventHandlers[type] = function (event) { return runCustomHandler(view, event); }); } }\n });\n}\n\nfunction runCustomHandler(view, event) {\n return view.someProp(\"handleDOMEvents\", function (handlers) {\n var handler = handlers[event.type];\n return handler ? handler(view, event) || event.defaultPrevented : false\n })\n}\n\nfunction eventBelongsToView(view, event) {\n if (!event.bubbles) { return true }\n if (event.defaultPrevented) { return false }\n for (var node = event.target; node != view.dom; node = node.parentNode)\n { if (!node || node.nodeType == 11 ||\n (node.pmViewDesc && node.pmViewDesc.stopEvent(event)))\n { return false } }\n return true\n}\n\nfunction dispatchEvent(view, event) {\n if (!runCustomHandler(view, event) && handlers[event.type] &&\n (view.editable || !(event.type in editHandlers)))\n { handlers[event.type](view, event); }\n}\n\neditHandlers.keydown = function (view, event) {\n view.shiftKey = event.keyCode == 16 || event.shiftKey;\n if (inOrNearComposition(view, event)) { return }\n view.lastKeyCode = event.keyCode;\n view.lastKeyCodeTime = Date.now();\n // On iOS, if we preventDefault enter key presses, the virtual\n // keyboard gets confused. So the hack here is to set a flag that\n // makes the DOM change code recognize that what just happens should\n // be replaced by whatever the Enter key handlers do.\n if (result.ios && event.keyCode == 13 && !event.ctrlKey && !event.altKey && !event.metaKey)\n { view.lastIOSEnter = Date.now(); }\n else if (view.someProp(\"handleKeyDown\", function (f) { return f(view, event); }) || captureKeyDown(view, event))\n { event.preventDefault(); }\n else\n { setSelectionOrigin(view, \"key\"); }\n};\n\neditHandlers.keyup = function (view, e) {\n if (e.keyCode == 16) { view.shiftKey = false; }\n};\n\neditHandlers.keypress = function (view, event) {\n if (inOrNearComposition(view, event) || !event.charCode ||\n event.ctrlKey && !event.altKey || result.mac && event.metaKey) { return }\n\n if (view.someProp(\"handleKeyPress\", function (f) { return f(view, event); })) {\n event.preventDefault();\n return\n }\n\n var sel = view.state.selection;\n if (!(sel instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"TextSelection\"]) || !sel.$from.sameParent(sel.$to)) {\n var text = String.fromCharCode(event.charCode);\n if (!view.someProp(\"handleTextInput\", function (f) { return f(view, sel.$from.pos, sel.$to.pos, text); }))\n { view.dispatch(view.state.tr.insertText(text).scrollIntoView()); }\n event.preventDefault();\n }\n};\n\nfunction eventCoords(event) { return {left: event.clientX, top: event.clientY} }\n\nfunction isNear(event, click) {\n var dx = click.x - event.clientX, dy = click.y - event.clientY;\n return dx * dx + dy * dy < 100\n}\n\nfunction runHandlerOnContext(view, propName, pos, inside, event) {\n if (inside == -1) { return false }\n var $pos = view.state.doc.resolve(inside);\n var loop = function ( i ) {\n if (view.someProp(propName, function (f) { return i > $pos.depth ? f(view, pos, $pos.nodeAfter, $pos.before(i), event, true)\n : f(view, pos, $pos.node(i), $pos.before(i), event, false); }))\n { return { v: true } }\n };\n\n for (var i = $pos.depth + 1; i > 0; i--) {\n var returned = loop( i );\n\n if ( returned ) return returned.v;\n }\n return false\n}\n\nfunction updateSelection(view, selection, origin) {\n if (!view.focused) { view.focus(); }\n var tr = view.state.tr.setSelection(selection);\n if (origin == \"pointer\") { tr.setMeta(\"pointer\", true); }\n view.dispatch(tr);\n}\n\nfunction selectClickedLeaf(view, inside) {\n if (inside == -1) { return false }\n var $pos = view.state.doc.resolve(inside), node = $pos.nodeAfter;\n if (node && node.isAtom && prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"].isSelectable(node)) {\n updateSelection(view, new prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"]($pos), \"pointer\");\n return true\n }\n return false\n}\n\nfunction selectClickedNode(view, inside) {\n if (inside == -1) { return false }\n var sel = view.state.selection, selectedNode, selectAt;\n if (sel instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"]) { selectedNode = sel.node; }\n\n var $pos = view.state.doc.resolve(inside);\n for (var i = $pos.depth + 1; i > 0; i--) {\n var node = i > $pos.depth ? $pos.nodeAfter : $pos.node(i);\n if (prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"].isSelectable(node)) {\n if (selectedNode && sel.$from.depth > 0 &&\n i >= sel.$from.depth && $pos.before(sel.$from.depth + 1) == sel.$from.pos)\n { selectAt = $pos.before(sel.$from.depth); }\n else\n { selectAt = $pos.before(i); }\n break\n }\n }\n\n if (selectAt != null) {\n updateSelection(view, prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"].create(view.state.doc, selectAt), \"pointer\");\n return true\n } else {\n return false\n }\n}\n\nfunction handleSingleClick(view, pos, inside, event, selectNode) {\n return runHandlerOnContext(view, \"handleClickOn\", pos, inside, event) ||\n view.someProp(\"handleClick\", function (f) { return f(view, pos, event); }) ||\n (selectNode ? selectClickedNode(view, inside) : selectClickedLeaf(view, inside))\n}\n\nfunction handleDoubleClick(view, pos, inside, event) {\n return runHandlerOnContext(view, \"handleDoubleClickOn\", pos, inside, event) ||\n view.someProp(\"handleDoubleClick\", function (f) { return f(view, pos, event); })\n}\n\nfunction handleTripleClick(view, pos, inside, event) {\n return runHandlerOnContext(view, \"handleTripleClickOn\", pos, inside, event) ||\n view.someProp(\"handleTripleClick\", function (f) { return f(view, pos, event); }) ||\n defaultTripleClick(view, inside)\n}\n\nfunction defaultTripleClick(view, inside) {\n var doc = view.state.doc;\n if (inside == -1) {\n if (doc.inlineContent) {\n updateSelection(view, prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"TextSelection\"].create(doc, 0, doc.content.size), \"pointer\");\n return true\n }\n return false\n }\n\n var $pos = doc.resolve(inside);\n for (var i = $pos.depth + 1; i > 0; i--) {\n var node = i > $pos.depth ? $pos.nodeAfter : $pos.node(i);\n var nodePos = $pos.before(i);\n if (node.inlineContent)\n { updateSelection(view, prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"TextSelection\"].create(doc, nodePos + 1, nodePos + 1 + node.content.size), \"pointer\"); }\n else if (prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"].isSelectable(node))\n { updateSelection(view, prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"].create(doc, nodePos), \"pointer\"); }\n else\n { continue }\n return true\n }\n}\n\nfunction forceDOMFlush(view) {\n return endComposition(view)\n}\n\nvar selectNodeModifier = result.mac ? \"metaKey\" : \"ctrlKey\";\n\nhandlers.mousedown = function (view, event) {\n view.shiftKey = event.shiftKey;\n var flushed = forceDOMFlush(view);\n var now = Date.now(), type = \"singleClick\";\n if (now - view.lastClick.time < 500 && isNear(event, view.lastClick) && !event[selectNodeModifier]) {\n if (view.lastClick.type == \"singleClick\") { type = \"doubleClick\"; }\n else if (view.lastClick.type == \"doubleClick\") { type = \"tripleClick\"; }\n }\n view.lastClick = {time: now, x: event.clientX, y: event.clientY, type: type};\n\n var pos = view.posAtCoords(eventCoords(event));\n if (!pos) { return }\n\n if (type == \"singleClick\")\n { view.mouseDown = new MouseDown(view, pos, event, flushed); }\n else if ((type == \"doubleClick\" ? handleDoubleClick : handleTripleClick)(view, pos.pos, pos.inside, event))\n { event.preventDefault(); }\n else\n { setSelectionOrigin(view, \"pointer\"); }\n};\n\nvar MouseDown = function MouseDown(view, pos, event, flushed) {\n var this$1 = this;\n\n this.view = view;\n this.startDoc = view.state.doc;\n this.pos = pos;\n this.event = event;\n this.flushed = flushed;\n this.selectNode = event[selectNodeModifier];\n this.allowDefault = event.shiftKey;\n\n var targetNode, targetPos;\n if (pos.inside > -1) {\n targetNode = view.state.doc.nodeAt(pos.inside);\n targetPos = pos.inside;\n } else {\n var $pos = view.state.doc.resolve(pos.pos);\n targetNode = $pos.parent;\n targetPos = $pos.depth ? $pos.before() : 0;\n }\n\n this.mightDrag = null;\n\n var target = flushed ? null : event.target;\n var targetDesc = target ? view.docView.nearestDesc(target, true) : null;\n this.target = targetDesc ? targetDesc.dom : null;\n\n if (targetNode.type.spec.draggable && targetNode.type.spec.selectable !== false ||\n view.state.selection instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"] && targetPos == view.state.selection.from)\n { this.mightDrag = {node: targetNode,\n pos: targetPos,\n addAttr: this.target && !this.target.draggable,\n setUneditable: this.target && result.gecko && !this.target.hasAttribute(\"contentEditable\")}; }\n\n if (this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable)) {\n this.view.domObserver.stop();\n if (this.mightDrag.addAttr) { this.target.draggable = true; }\n if (this.mightDrag.setUneditable)\n { setTimeout(function () { return this$1.target.setAttribute(\"contentEditable\", \"false\"); }, 20); }\n this.view.domObserver.start();\n }\n\n view.root.addEventListener(\"mouseup\", this.up = this.up.bind(this));\n view.root.addEventListener(\"mousemove\", this.move = this.move.bind(this));\n setSelectionOrigin(view, \"pointer\");\n};\n\nMouseDown.prototype.done = function done () {\n this.view.root.removeEventListener(\"mouseup\", this.up);\n this.view.root.removeEventListener(\"mousemove\", this.move);\n if (this.mightDrag && this.target) {\n this.view.domObserver.stop();\n if (this.mightDrag.addAttr) { this.target.draggable = false; }\n if (this.mightDrag.setUneditable) { this.target.removeAttribute(\"contentEditable\"); }\n this.view.domObserver.start();\n }\n this.view.mouseDown = null;\n};\n\nMouseDown.prototype.up = function up (event) {\n this.done();\n\n if (!this.view.dom.contains(event.target.nodeType == 3 ? event.target.parentNode : event.target))\n { return }\n\n var pos = this.pos;\n if (this.view.state.doc != this.startDoc) { pos = this.view.posAtCoords(eventCoords(event)); }\n\n if (this.allowDefault || !pos) {\n setSelectionOrigin(this.view, \"pointer\");\n } else if (handleSingleClick(this.view, pos.pos, pos.inside, event, this.selectNode)) {\n event.preventDefault();\n } else if (this.flushed ||\n // Chrome will sometimes treat a node selection as a\n // cursor, but still report that the node is selected\n // when asked through getSelection. You'll then get a\n // situation where clicking at the point where that\n // (hidden) cursor is doesn't change the selection, and\n // thus doesn't get a reaction from ProseMirror. This\n // works around that.\n (result.chrome && !(this.view.state.selection instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"TextSelection\"]) &&\n (pos.pos == this.view.state.selection.from || pos.pos == this.view.state.selection.to))) {\n updateSelection(this.view, prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"Selection\"].near(this.view.state.doc.resolve(pos.pos)), \"pointer\");\n event.preventDefault();\n } else {\n setSelectionOrigin(this.view, \"pointer\");\n }\n};\n\nMouseDown.prototype.move = function move (event) {\n if (!this.allowDefault && (Math.abs(this.event.x - event.clientX) > 4 ||\n Math.abs(this.event.y - event.clientY) > 4))\n { this.allowDefault = true; }\n setSelectionOrigin(this.view, \"pointer\");\n};\n\nhandlers.touchdown = function (view) {\n forceDOMFlush(view);\n setSelectionOrigin(view, \"pointer\");\n};\n\nhandlers.contextmenu = function (view) { return forceDOMFlush(view); };\n\nfunction inOrNearComposition(view, event) {\n if (view.composing) { return true }\n // See https://www.stum.de/2016/06/24/handling-ime-events-in-javascript/.\n // On Japanese input method editors (IMEs), the Enter key is used to confirm character\n // selection. On Safari, when Enter is pressed, compositionend and keydown events are\n // emitted. The keydown event triggers newline insertion, which we don't want.\n // This method returns true if the keydown event should be ignored.\n // We only ignore it once, as pressing Enter a second time *should* insert a newline.\n // Furthermore, the keydown event timestamp must be close to the compositionEndedAt timestamp.\n // This guards against the case where compositionend is triggered without the keyboard\n // (e.g. character confirmation may be done with the mouse), and keydown is triggered\n // afterwards- we wouldn't want to ignore the keydown event in this case.\n if (result.safari && Math.abs(event.timeStamp - view.compositionEndedAt) < 500) {\n view.compositionEndedAt = -2e8;\n return true\n }\n return false\n}\n\n// Drop active composition after 5 seconds of inactivity on Android\nvar timeoutComposition = result.android ? 5000 : -1;\n\neditHandlers.compositionstart = editHandlers.compositionupdate = function (view) {\n if (!view.composing) {\n view.domObserver.flush();\n var state = view.state;\n var $pos = state.selection.$from;\n if (state.selection.empty &&\n (state.storedMarks || (!$pos.textOffset && $pos.parentOffset && $pos.nodeBefore.marks.some(function (m) { return m.type.spec.inclusive === false; })))) {\n // Need to wrap the cursor in mark nodes different from the ones in the DOM context\n view.markCursor = view.state.storedMarks || $pos.marks();\n endComposition(view, true);\n view.markCursor = null;\n } else {\n endComposition(view);\n // In firefox, if the cursor is after but outside a marked node,\n // the inserted text won't inherit the marks. So this moves it\n // inside if necessary.\n if (result.gecko && state.selection.empty && $pos.parentOffset && !$pos.textOffset && $pos.nodeBefore.marks.length) {\n var sel = view.root.getSelection();\n for (var node = sel.focusNode, offset = sel.focusOffset; node && node.nodeType == 1 && offset != 0;) {\n var before = offset < 0 ? node.lastChild : node.childNodes[offset - 1];\n if (!before) { break }\n if (before.nodeType == 3) {\n sel.collapse(before, before.nodeValue.length);\n break\n } else {\n node = before;\n offset = -1;\n }\n }\n }\n }\n view.composing = true;\n }\n scheduleComposeEnd(view, timeoutComposition);\n};\n\neditHandlers.compositionend = function (view, event) {\n if (view.composing) {\n view.composing = false;\n view.compositionEndedAt = event.timeStamp;\n scheduleComposeEnd(view, 20);\n }\n};\n\nfunction scheduleComposeEnd(view, delay) {\n clearTimeout(view.composingTimeout);\n if (delay > -1) { view.composingTimeout = setTimeout(function () { return endComposition(view); }, delay); }\n}\n\nfunction endComposition(view, forceUpdate) {\n view.composing = false;\n while (view.compositionNodes.length > 0) { view.compositionNodes.pop().markParentsDirty(); }\n if (forceUpdate || view.docView.dirty) {\n view.updateState(view.state);\n return true\n }\n return false\n}\n\nfunction captureCopy(view, dom) {\n // The extra wrapper is somehow necessary on IE/Edge to prevent the\n // content from being mangled when it is put onto the clipboard\n var doc = view.dom.ownerDocument;\n var wrap = doc.body.appendChild(doc.createElement(\"div\"));\n wrap.appendChild(dom);\n wrap.style.cssText = \"position: fixed; left: -10000px; top: 10px\";\n var sel = getSelection(), range = doc.createRange();\n range.selectNodeContents(dom);\n // Done because IE will fire a selectionchange moving the selection\n // to its start when removeAllRanges is called and the editor still\n // has focus (which will mess up the editor's selection state).\n view.dom.blur();\n sel.removeAllRanges();\n sel.addRange(range);\n setTimeout(function () {\n doc.body.removeChild(wrap);\n view.focus();\n }, 50);\n}\n\n// This is very crude, but unfortunately both these browsers _pretend_\n// that they have a clipboard API—all the objects and methods are\n// there, they just don't work, and they are hard to test.\nvar brokenClipboardAPI = (result.ie && result.ie_version < 15) ||\n (result.ios && result.webkit_version < 604);\n\nhandlers.copy = editHandlers.cut = function (view, e) {\n var sel = view.state.selection, cut = e.type == \"cut\";\n if (sel.empty) { return }\n\n // IE and Edge's clipboard interface is completely broken\n var data = brokenClipboardAPI ? null : e.clipboardData;\n var slice = sel.content();\n var ref = serializeForClipboard(view, slice);\n var dom = ref.dom;\n var text = ref.text;\n if (data) {\n e.preventDefault();\n data.clearData();\n data.setData(\"text/html\", dom.innerHTML);\n data.setData(\"text/plain\", text);\n } else {\n captureCopy(view, dom);\n }\n if (cut) { view.dispatch(view.state.tr.deleteSelection().scrollIntoView().setMeta(\"uiEvent\", \"cut\")); }\n};\n\nfunction sliceSingleNode(slice) {\n return slice.openStart == 0 && slice.openEnd == 0 && slice.content.childCount == 1 ? slice.content.firstChild : null\n}\n\nfunction capturePaste(view, e) {\n var doc = view.dom.ownerDocument;\n var plainText = view.shiftKey || view.state.selection.$from.parent.type.spec.code;\n var target = doc.body.appendChild(doc.createElement(plainText ? \"textarea\" : \"div\"));\n if (!plainText) { target.contentEditable = \"true\"; }\n target.style.cssText = \"position: fixed; left: -10000px; top: 10px\";\n target.focus();\n setTimeout(function () {\n view.focus();\n doc.body.removeChild(target);\n if (plainText) { doPaste(view, target.value, null, e); }\n else { doPaste(view, target.textContent, target.innerHTML, e); }\n }, 50);\n}\n\nfunction doPaste(view, text, html, e) {\n var slice = parseFromClipboard(view, text, html, view.shiftKey, view.state.selection.$from);\n if (view.someProp(\"handlePaste\", function (f) { return f(view, e, slice || prosemirror_model__WEBPACK_IMPORTED_MODULE_1__[\"Slice\"].empty); }) || !slice) { return }\n\n var singleNode = sliceSingleNode(slice);\n var tr = singleNode ? view.state.tr.replaceSelectionWith(singleNode, view.shiftKey) : view.state.tr.replaceSelection(slice);\n view.dispatch(tr.scrollIntoView().setMeta(\"paste\", true).setMeta(\"uiEvent\", \"paste\"));\n}\n\neditHandlers.paste = function (view, e) {\n var data = brokenClipboardAPI ? null : e.clipboardData;\n var html = data && data.getData(\"text/html\"), text = data && data.getData(\"text/plain\");\n if (data && (html || text || data.files.length)) {\n doPaste(view, text, html, e);\n e.preventDefault();\n } else {\n capturePaste(view, e);\n }\n};\n\nvar Dragging = function Dragging(slice, move) {\n this.slice = slice;\n this.move = move;\n};\n\nvar dragCopyModifier = result.mac ? \"altKey\" : \"ctrlKey\";\n\nhandlers.dragstart = function (view, e) {\n var mouseDown = view.mouseDown;\n if (mouseDown) { mouseDown.done(); }\n if (!e.dataTransfer) { return }\n\n var sel = view.state.selection;\n var pos = sel.empty ? null : view.posAtCoords(eventCoords(e));\n if (pos && pos.pos >= sel.from && pos.pos <= (sel instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"] ? sel.to - 1: sel.to)) ; else if (mouseDown && mouseDown.mightDrag) {\n view.dispatch(view.state.tr.setSelection(prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"].create(view.state.doc, mouseDown.mightDrag.pos)));\n } else if (e.target && e.target.nodeType == 1) {\n var desc = view.docView.nearestDesc(e.target, true);\n if (!desc || !desc.node.type.spec.draggable || desc == view.docView) { return }\n view.dispatch(view.state.tr.setSelection(prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"].create(view.state.doc, desc.posBefore)));\n }\n var slice = view.state.selection.content();\n var ref = serializeForClipboard(view, slice);\n var dom = ref.dom;\n var text = ref.text;\n e.dataTransfer.clearData();\n e.dataTransfer.setData(brokenClipboardAPI ? \"Text\" : \"text/html\", dom.innerHTML);\n if (!brokenClipboardAPI) { e.dataTransfer.setData(\"text/plain\", text); }\n view.dragging = new Dragging(slice, !e[dragCopyModifier]);\n};\n\nhandlers.dragend = function (view) {\n window.setTimeout(function () { return view.dragging = null; }, 50);\n};\n\neditHandlers.dragover = editHandlers.dragenter = function (_, e) { return e.preventDefault(); };\n\neditHandlers.drop = function (view, e) {\n var dragging = view.dragging;\n view.dragging = null;\n\n if (!e.dataTransfer) { return }\n\n var eventPos = view.posAtCoords(eventCoords(e));\n if (!eventPos) { return }\n var $mouse = view.state.doc.resolve(eventPos.pos);\n if (!$mouse) { return }\n var slice = dragging && dragging.slice ||\n parseFromClipboard(view, e.dataTransfer.getData(brokenClipboardAPI ? \"Text\" : \"text/plain\"),\n brokenClipboardAPI ? null : e.dataTransfer.getData(\"text/html\"), false, $mouse);\n if (!slice) { return }\n\n e.preventDefault();\n if (view.someProp(\"handleDrop\", function (f) { return f(view, e, slice, dragging && dragging.move); })) { return }\n var insertPos = slice ? Object(prosemirror_transform__WEBPACK_IMPORTED_MODULE_2__[\"dropPoint\"])(view.state.doc, $mouse.pos, slice) : $mouse.pos;\n if (insertPos == null) { insertPos = $mouse.pos; }\n\n var tr = view.state.tr;\n if (dragging && dragging.move) { tr.deleteSelection(); }\n\n var pos = tr.mapping.map(insertPos);\n var isNode = slice.openStart == 0 && slice.openEnd == 0 && slice.content.childCount == 1;\n var beforeInsert = tr.doc;\n if (isNode)\n { tr.replaceRangeWith(pos, pos, slice.content.firstChild); }\n else\n { tr.replaceRange(pos, pos, slice); }\n if (tr.doc.eq(beforeInsert)) { return }\n\n var $pos = tr.doc.resolve(pos);\n if (isNode && prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"].isSelectable(slice.content.firstChild) &&\n $pos.nodeAfter && $pos.nodeAfter.sameMarkup(slice.content.firstChild))\n { tr.setSelection(new prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"]($pos)); }\n else\n { tr.setSelection(selectionBetween(view, $pos, tr.doc.resolve(tr.mapping.map(insertPos)))); }\n view.focus();\n view.dispatch(tr.setMeta(\"uiEvent\", \"drop\"));\n};\n\nhandlers.focus = function (view) {\n if (!view.focused) {\n view.domObserver.stop();\n view.dom.classList.add(\"ProseMirror-focused\");\n view.domObserver.start();\n view.focused = true;\n setTimeout(function () {\n if (view.docView && view.hasFocus() && !view.domObserver.currentSelection.eq(view.root.getSelection()))\n { selectionToDOM(view); }\n }, 20);\n }\n};\n\nhandlers.blur = function (view) {\n if (view.focused) {\n view.domObserver.stop();\n view.dom.classList.remove(\"ProseMirror-focused\");\n view.domObserver.start();\n view.domObserver.currentSelection.set({});\n view.focused = false;\n }\n};\n\nhandlers.beforeinput = function (view, event) {\n // We should probably do more with beforeinput events, but support\n // is so spotty that I'm still waiting to see where they are going.\n\n // Very specific hack to deal with backspace sometimes failing on\n // Chrome Android when after an uneditable node.\n if (result.chrome && result.android && event.inputType == \"deleteContentBackward\") {\n var domChangeCount = view.domChangeCount;\n setTimeout(function () {\n if (view.domChangeCount != domChangeCount) { return } // Event already had some effect\n // This bug tends to close the virtual keyboard, so we refocus\n view.dom.blur();\n view.focus();\n if (view.someProp(\"handleKeyDown\", function (f) { return f(view, keyEvent(8, \"Backspace\")); })) { return }\n var ref = view.state.selection;\n var $cursor = ref.$cursor;\n // Crude approximation of backspace behavior when no command handled it\n if ($cursor && $cursor.pos > 0) { view.dispatch(view.state.tr.delete($cursor.pos - 1, $cursor.pos).scrollIntoView()); }\n }, 50);\n }\n};\n\n// Make sure all handlers get registered\nfor (var prop in editHandlers) { handlers[prop] = editHandlers[prop]; }\n\nfunction compareObjs(a, b) {\n if (a == b) { return true }\n for (var p in a) { if (a[p] !== b[p]) { return false } }\n for (var p$1 in b) { if (!(p$1 in a)) { return false } }\n return true\n}\n\nvar WidgetType = function WidgetType(toDOM, spec) {\n this.spec = spec || noSpec;\n this.side = this.spec.side || 0;\n this.toDOM = toDOM;\n};\n\nWidgetType.prototype.map = function map (mapping, span, offset, oldOffset) {\n var ref = mapping.mapResult(span.from + oldOffset, this.side < 0 ? -1 : 1);\n var pos = ref.pos;\n var deleted = ref.deleted;\n return deleted ? null : new Decoration(pos - offset, pos - offset, this)\n};\n\nWidgetType.prototype.valid = function valid () { return true };\n\nWidgetType.prototype.eq = function eq (other) {\n return this == other ||\n (other instanceof WidgetType &&\n (this.spec.key && this.spec.key == other.spec.key ||\n this.toDOM == other.toDOM && compareObjs(this.spec, other.spec)))\n};\n\nvar InlineType = function InlineType(attrs, spec) {\n this.spec = spec || noSpec;\n this.attrs = attrs;\n};\n\nInlineType.prototype.map = function map (mapping, span, offset, oldOffset) {\n var from = mapping.map(span.from + oldOffset, this.spec.inclusiveStart ? -1 : 1) - offset;\n var to = mapping.map(span.to + oldOffset, this.spec.inclusiveEnd ? 1 : -1) - offset;\n return from >= to ? null : new Decoration(from, to, this)\n};\n\nInlineType.prototype.valid = function valid (_, span) { return span.from < span.to };\n\nInlineType.prototype.eq = function eq (other) {\n return this == other ||\n (other instanceof InlineType && compareObjs(this.attrs, other.attrs) &&\n compareObjs(this.spec, other.spec))\n};\n\nInlineType.is = function is (span) { return span.type instanceof InlineType };\n\nvar NodeType = function NodeType(attrs, spec) {\n this.spec = spec || noSpec;\n this.attrs = attrs;\n};\n\nNodeType.prototype.map = function map (mapping, span, offset, oldOffset) {\n var from = mapping.mapResult(span.from + oldOffset, 1);\n if (from.deleted) { return null }\n var to = mapping.mapResult(span.to + oldOffset, -1);\n if (to.deleted || to.pos <= from.pos) { return null }\n return new Decoration(from.pos - offset, to.pos - offset, this)\n};\n\nNodeType.prototype.valid = function valid (node, span) {\n var ref = node.content.findIndex(span.from);\n var index = ref.index;\n var offset = ref.offset;\n return offset == span.from && offset + node.child(index).nodeSize == span.to\n};\n\nNodeType.prototype.eq = function eq (other) {\n return this == other ||\n (other instanceof NodeType && compareObjs(this.attrs, other.attrs) &&\n compareObjs(this.spec, other.spec))\n};\n\n// ::- Decoration objects can be provided to the view through the\n// [`decorations` prop](#view.EditorProps.decorations). They come in\n// several variants—see the static members of this class for details.\nvar Decoration = function Decoration(from, to, type) {\n // :: number\n // The start position of the decoration.\n this.from = from;\n // :: number\n // The end position. Will be the same as `from` for [widget\n // decorations](#view.Decoration^widget).\n this.to = to;\n this.type = type;\n};\n\nvar prototypeAccessors$1 = { spec: { configurable: true } };\n\nDecoration.prototype.copy = function copy (from, to) {\n return new Decoration(from, to, this.type)\n};\n\nDecoration.prototype.eq = function eq (other) {\n return this.type.eq(other.type) && this.from == other.from && this.to == other.to\n};\n\nDecoration.prototype.map = function map (mapping, offset, oldOffset) {\n return this.type.map(mapping, this, offset, oldOffset)\n};\n\n// :: (number, union<(view: EditorView, getPos: () → number) → dom.Node, dom.Node>, ?Object) → Decoration\n// Creates a widget decoration, which is a DOM node that's shown in\n// the document at the given position. It is recommended that you\n// delay rendering the widget by passing a function that will be\n// called when the widget is actually drawn in a view, but you can\n// also directly pass a DOM node. `getPos` can be used to find the\n// widget's current document position.\n//\n// spec::- These options are supported:\n//\n// side:: ?number\n// Controls which side of the document position this widget is\n// associated with. When negative, it is drawn before a cursor\n// at its position, and content inserted at that position ends\n// up after the widget. When zero (the default) or positive, the\n// widget is drawn after the cursor and content inserted there\n// ends up before the widget.\n//\n// When there are multiple widgets at a given position, their\n// `side` values determine the order in which they appear. Those\n// with lower values appear first. The ordering of widgets with\n// the same `side` value is unspecified.\n//\n// When `marks` is null, `side` also determines the marks that\n// the widget is wrapped in—those of the node before when\n// negative, those of the node after when positive.\n//\n// marks:: ?[Mark]\n// The precise set of marks to draw around the widget.\n//\n// stopEvent:: ?(event: dom.Event) → bool\n// Can be used to control which DOM events, when they bubble out\n// of this widget, the editor view should ignore.\n//\n// ignoreSelection:: ?bool\n// When set (defaults to false), selection changes inside the\n// widget are ignored, and don't cause ProseMirror to try and\n// re-sync the selection with its selection state.\n//\n// key:: ?string\n// When comparing decorations of this type (in order to decide\n// whether it needs to be redrawn), ProseMirror will by default\n// compare the widget DOM node by identity. If you pass a key,\n// that key will be compared instead, which can be useful when\n// you generate decorations on the fly and don't want to store\n// and reuse DOM nodes. Make sure that any widgets with the same\n// key are interchangeable—if widgets differ in, for example,\n// the behavior of some event handler, they should get\n// different keys.\nDecoration.widget = function widget (pos, toDOM, spec) {\n return new Decoration(pos, pos, new WidgetType(toDOM, spec))\n};\n\n// :: (number, number, DecorationAttrs, ?Object) → Decoration\n// Creates an inline decoration, which adds the given attributes to\n// each inline node between `from` and `to`.\n//\n// spec::- These options are recognized:\n//\n// inclusiveStart:: ?bool\n// Determines how the left side of the decoration is\n// [mapped](#transform.Position_Mapping) when content is\n// inserted directly at that position. By default, the decoration\n// won't include the new content, but you can set this to `true`\n// to make it inclusive.\n//\n// inclusiveEnd:: ?bool\n// Determines how the right side of the decoration is mapped.\n// See\n// [`inclusiveStart`](#view.Decoration^inline^spec.inclusiveStart).\nDecoration.inline = function inline (from, to, attrs, spec) {\n return new Decoration(from, to, new InlineType(attrs, spec))\n};\n\n// :: (number, number, DecorationAttrs, ?Object) → Decoration\n// Creates a node decoration. `from` and `to` should point precisely\n// before and after a node in the document. That node, and only that\n// node, will receive the given attributes.\n//\n// spec::-\n//\n// Optional information to store with the decoration. It\n// is also used when comparing decorators for equality.\nDecoration.node = function node (from, to, attrs, spec) {\n return new Decoration(from, to, new NodeType(attrs, spec))\n};\n\n// :: Object\n// The spec provided when creating this decoration. Can be useful\n// if you've stored extra information in that object.\nprototypeAccessors$1.spec.get = function () { return this.type.spec };\n\nObject.defineProperties( Decoration.prototype, prototypeAccessors$1 );\n\n// DecorationAttrs:: interface\n// A set of attributes to add to a decorated node. Most properties\n// simply directly correspond to DOM attributes of the same name,\n// which will be set to the property's value. These are exceptions:\n//\n// class:: ?string\n// A CSS class name or a space-separated set of class names to be\n// _added_ to the classes that the node already had.\n//\n// style:: ?string\n// A string of CSS to be _added_ to the node's existing `style` property.\n//\n// nodeName:: ?string\n// When non-null, the target node is wrapped in a DOM element of\n// this type (and the other attributes are applied to this element).\n\nvar none = [], noSpec = {};\n\n// ::- A collection of [decorations](#view.Decoration), organized in\n// such a way that the drawing algorithm can efficiently use and\n// compare them. This is a persistent data structure—it is not\n// modified, updates create a new value.\nvar DecorationSet = function DecorationSet(local, children) {\n this.local = local && local.length ? local : none;\n this.children = children && children.length ? children : none;\n};\n\n// :: (Node, [Decoration]) → DecorationSet\n// Create a set of decorations, using the structure of the given\n// document.\nDecorationSet.create = function create (doc, decorations) {\n return decorations.length ? buildTree(decorations, doc, 0, noSpec) : empty\n};\n\n// :: (?number, ?number, ?(spec: Object) → bool) → [Decoration]\n// Find all decorations in this set which touch the given range\n// (including decorations that start or end directly at the\n// boundaries) and match the given predicate on their spec. When\n// `start` and `end` are omitted, all decorations in the set are\n// considered. When `predicate` isn't given, all decorations are\n// assumed to match.\nDecorationSet.prototype.find = function find (start, end, predicate) {\n var result = [];\n this.findInner(start == null ? 0 : start, end == null ? 1e9 : end, result, 0, predicate);\n return result\n};\n\nDecorationSet.prototype.findInner = function findInner (start, end, result, offset, predicate) {\n for (var i = 0; i < this.local.length; i++) {\n var span = this.local[i];\n if (span.from <= end && span.to >= start && (!predicate || predicate(span.spec)))\n { result.push(span.copy(span.from + offset, span.to + offset)); }\n }\n for (var i$1 = 0; i$1 < this.children.length; i$1 += 3) {\n if (this.children[i$1] < end && this.children[i$1 + 1] > start) {\n var childOff = this.children[i$1] + 1;\n this.children[i$1 + 2].findInner(start - childOff, end - childOff, result, offset + childOff, predicate);\n }\n }\n};\n\n// :: (Mapping, Node, ?Object) → DecorationSet\n// Map the set of decorations in response to a change in the\n// document.\n//\n// options::- An optional set of options.\n//\n// onRemove:: ?(decorationSpec: Object)\n// When given, this function will be called for each decoration\n// that gets dropped as a result of the mapping, passing the\n// spec of that decoration.\nDecorationSet.prototype.map = function map (mapping, doc, options) {\n if (this == empty || mapping.maps.length == 0) { return this }\n return this.mapInner(mapping, doc, 0, 0, options || noSpec)\n};\n\nDecorationSet.prototype.mapInner = function mapInner (mapping, node, offset, oldOffset, options) {\n var newLocal;\n for (var i = 0; i < this.local.length; i++) {\n var mapped = this.local[i].map(mapping, offset, oldOffset);\n if (mapped && mapped.type.valid(node, mapped)) { (newLocal || (newLocal = [])).push(mapped); }\n else if (options.onRemove) { options.onRemove(this.local[i].spec); }\n }\n\n if (this.children.length)\n { return mapChildren(this.children, newLocal, mapping, node, offset, oldOffset, options) }\n else\n { return newLocal ? new DecorationSet(newLocal.sort(byPos)) : empty }\n};\n\n// :: (Node, [Decoration]) → DecorationSet\n// Add the given array of decorations to the ones in the set,\n// producing a new set. Needs access to the current document to\n// create the appropriate tree structure.\nDecorationSet.prototype.add = function add (doc, decorations) {\n if (!decorations.length) { return this }\n if (this == empty) { return DecorationSet.create(doc, decorations) }\n return this.addInner(doc, decorations, 0)\n};\n\nDecorationSet.prototype.addInner = function addInner (doc, decorations, offset) {\n var this$1 = this;\n\n var children, childIndex = 0;\n doc.forEach(function (childNode, childOffset) {\n var baseOffset = childOffset + offset, found;\n if (!(found = takeSpansForNode(decorations, childNode, baseOffset))) { return }\n\n if (!children) { children = this$1.children.slice(); }\n while (childIndex < children.length && children[childIndex] < childOffset) { childIndex += 3; }\n if (children[childIndex] == childOffset)\n { children[childIndex + 2] = children[childIndex + 2].addInner(childNode, found, baseOffset + 1); }\n else\n { children.splice(childIndex, 0, childOffset, childOffset + childNode.nodeSize, buildTree(found, childNode, baseOffset + 1, noSpec)); }\n childIndex += 3;\n });\n\n var local = moveSpans(childIndex ? withoutNulls(decorations) : decorations, -offset);\n return new DecorationSet(local.length ? this.local.concat(local).sort(byPos) : this.local,\n children || this.children)\n};\n\n// :: ([Decoration]) → DecorationSet\n// Create a new set that contains the decorations in this set, minus\n// the ones in the given array.\nDecorationSet.prototype.remove = function remove (decorations) {\n if (decorations.length == 0 || this == empty) { return this }\n return this.removeInner(decorations, 0)\n};\n\nDecorationSet.prototype.removeInner = function removeInner (decorations, offset) {\n var children = this.children, local = this.local;\n for (var i = 0; i < children.length; i += 3) {\n var found = (void 0), from = children[i] + offset, to = children[i + 1] + offset;\n for (var j = 0, span = (void 0); j < decorations.length; j++) { if (span = decorations[j]) {\n if (span.from > from && span.to < to) {\n decorations[j] = null\n ;(found || (found = [])).push(span);\n }\n } }\n if (!found) { continue }\n if (children == this.children) { children = this.children.slice(); }\n var removed = children[i + 2].removeInner(found, from + 1);\n if (removed != empty) {\n children[i + 2] = removed;\n } else {\n children.splice(i, 3);\n i -= 3;\n }\n }\n if (local.length) { for (var i$1 = 0, span$1 = (void 0); i$1 < decorations.length; i$1++) { if (span$1 = decorations[i$1]) {\n for (var j$1 = 0; j$1 < local.length; j$1++) { if (local[j$1].type.eq(span$1.type)) {\n if (local == this.local) { local = this.local.slice(); }\n local.splice(j$1--, 1);\n } }\n } } }\n if (children == this.children && local == this.local) { return this }\n return local.length || children.length ? new DecorationSet(local, children) : empty\n};\n\nDecorationSet.prototype.forChild = function forChild (offset, node) {\n if (this == empty) { return this }\n if (node.isLeaf) { return DecorationSet.empty }\n\n var child, local;\n for (var i = 0; i < this.children.length; i += 3) { if (this.children[i] >= offset) {\n if (this.children[i] == offset) { child = this.children[i + 2]; }\n break\n } }\n var start = offset + 1, end = start + node.content.size;\n for (var i$1 = 0; i$1 < this.local.length; i$1++) {\n var dec = this.local[i$1];\n if (dec.from < end && dec.to > start && (dec.type instanceof InlineType)) {\n var from = Math.max(start, dec.from) - start, to = Math.min(end, dec.to) - start;\n if (from < to) { (local || (local = [])).push(dec.copy(from, to)); }\n }\n }\n if (local) {\n var localSet = new DecorationSet(local.sort(byPos));\n return child ? new DecorationGroup([localSet, child]) : localSet\n }\n return child || empty\n};\n\nDecorationSet.prototype.eq = function eq (other) {\n if (this == other) { return true }\n if (!(other instanceof DecorationSet) ||\n this.local.length != other.local.length ||\n this.children.length != other.children.length) { return false }\n for (var i = 0; i < this.local.length; i++)\n { if (!this.local[i].eq(other.local[i])) { return false } }\n for (var i$1 = 0; i$1 < this.children.length; i$1 += 3)\n { if (this.children[i$1] != other.children[i$1] ||\n this.children[i$1 + 1] != other.children[i$1 + 1] ||\n !this.children[i$1 + 2].eq(other.children[i$1 + 2])) { return false } }\n return true\n};\n\nDecorationSet.prototype.locals = function locals (node) {\n return removeOverlap(this.localsInner(node))\n};\n\nDecorationSet.prototype.localsInner = function localsInner (node) {\n if (this == empty) { return none }\n if (node.inlineContent || !this.local.some(InlineType.is)) { return this.local }\n var result = [];\n for (var i = 0; i < this.local.length; i++) {\n if (!(this.local[i].type instanceof InlineType))\n { result.push(this.local[i]); }\n }\n return result\n};\n\nvar empty = new DecorationSet();\n\n// :: DecorationSet\n// The empty set of decorations.\nDecorationSet.empty = empty;\n\nDecorationSet.removeOverlap = removeOverlap;\n\n// :- An abstraction that allows the code dealing with decorations to\n// treat multiple DecorationSet objects as if it were a single object\n// with (a subset of) the same interface.\nvar DecorationGroup = function DecorationGroup(members) {\n this.members = members;\n};\n\nDecorationGroup.prototype.forChild = function forChild (offset, child) {\n if (child.isLeaf) { return DecorationSet.empty }\n var found = [];\n for (var i = 0; i < this.members.length; i++) {\n var result = this.members[i].forChild(offset, child);\n if (result == empty) { continue }\n if (result instanceof DecorationGroup) { found = found.concat(result.members); }\n else { found.push(result); }\n }\n return DecorationGroup.from(found)\n};\n\nDecorationGroup.prototype.eq = function eq (other) {\n if (!(other instanceof DecorationGroup) ||\n other.members.length != this.members.length) { return false }\n for (var i = 0; i < this.members.length; i++)\n { if (!this.members[i].eq(other.members[i])) { return false } }\n return true\n};\n\nDecorationGroup.prototype.locals = function locals (node) {\n var result, sorted = true;\n for (var i = 0; i < this.members.length; i++) {\n var locals = this.members[i].localsInner(node);\n if (!locals.length) { continue }\n if (!result) {\n result = locals;\n } else {\n if (sorted) {\n result = result.slice();\n sorted = false;\n }\n for (var j = 0; j < locals.length; j++) { result.push(locals[j]); }\n }\n }\n return result ? removeOverlap(sorted ? result : result.sort(byPos)) : none\n};\n\n// : ([DecorationSet]) → union\n// Create a group for the given array of decoration sets, or return\n// a single set when possible.\nDecorationGroup.from = function from (members) {\n switch (members.length) {\n case 0: return empty\n case 1: return members[0]\n default: return new DecorationGroup(members)\n }\n};\n\nfunction mapChildren(oldChildren, newLocal, mapping, node, offset, oldOffset, options) {\n var children = oldChildren.slice();\n\n // Mark the children that are directly touched by changes, and\n // move those that are after the changes.\n var shift = function (oldStart, oldEnd, newStart, newEnd) {\n for (var i = 0; i < children.length; i += 3) {\n var end = children[i + 1], dSize = (void 0);\n if (end == -1 || oldStart > end + oldOffset) { continue }\n if (oldEnd >= children[i] + oldOffset) {\n children[i + 1] = -1;\n } else if (dSize = (newEnd - newStart) - (oldEnd - oldStart) + (oldOffset - offset)) {\n children[i] += dSize;\n children[i + 1] += dSize;\n }\n }\n };\n for (var i = 0; i < mapping.maps.length; i++) { mapping.maps[i].forEach(shift); }\n\n // Find the child nodes that still correspond to a single node,\n // recursively call mapInner on them and update their positions.\n var mustRebuild = false;\n for (var i$1 = 0; i$1 < children.length; i$1 += 3) { if (children[i$1 + 1] == -1) { // Touched nodes\n var from = mapping.map(children[i$1] + oldOffset), fromLocal = from - offset;\n if (fromLocal < 0 || fromLocal >= node.content.size) {\n mustRebuild = true;\n continue\n }\n // Must read oldChildren because children was tagged with -1\n var to = mapping.map(oldChildren[i$1 + 1] + oldOffset, -1), toLocal = to - offset;\n var ref = node.content.findIndex(fromLocal);\n var index = ref.index;\n var childOffset = ref.offset;\n var childNode = node.maybeChild(index);\n if (childNode && childOffset == fromLocal && childOffset + childNode.nodeSize == toLocal) {\n var mapped = children[i$1 + 2].mapInner(mapping, childNode, from + 1, children[i$1] + oldOffset + 1, options);\n if (mapped != empty) {\n children[i$1] = fromLocal;\n children[i$1 + 1] = toLocal;\n children[i$1 + 2] = mapped;\n } else {\n children[i$1 + 1] = -2;\n mustRebuild = true;\n }\n } else {\n mustRebuild = true;\n }\n } }\n\n // Remaining children must be collected and rebuilt into the appropriate structure\n if (mustRebuild) {\n var decorations = mapAndGatherRemainingDecorations(children, oldChildren, newLocal || [], mapping,\n offset, oldOffset, options);\n var built = buildTree(decorations, node, 0, options);\n newLocal = built.local;\n for (var i$2 = 0; i$2 < children.length; i$2 += 3) { if (children[i$2 + 1] < 0) {\n children.splice(i$2, 3);\n i$2 -= 3;\n } }\n for (var i$3 = 0, j = 0; i$3 < built.children.length; i$3 += 3) {\n var from$1 = built.children[i$3];\n while (j < children.length && children[j] < from$1) { j += 3; }\n children.splice(j, 0, built.children[i$3], built.children[i$3 + 1], built.children[i$3 + 2]);\n }\n }\n\n return new DecorationSet(newLocal && newLocal.sort(byPos), children)\n}\n\nfunction moveSpans(spans, offset) {\n if (!offset || !spans.length) { return spans }\n var result = [];\n for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n result.push(new Decoration(span.from + offset, span.to + offset, span.type));\n }\n return result\n}\n\nfunction mapAndGatherRemainingDecorations(children, oldChildren, decorations, mapping, offset, oldOffset, options) {\n // Gather all decorations from the remaining marked children\n function gather(set, oldOffset) {\n for (var i = 0; i < set.local.length; i++) {\n var mapped = set.local[i].map(mapping, offset, oldOffset);\n if (mapped) { decorations.push(mapped); }\n else if (options.onRemove) { options.onRemove(set.local[i].spec); }\n }\n for (var i$1 = 0; i$1 < set.children.length; i$1 += 3)\n { gather(set.children[i$1 + 2], set.children[i$1] + oldOffset + 1); }\n }\n for (var i = 0; i < children.length; i += 3) { if (children[i + 1] == -1)\n { gather(children[i + 2], oldChildren[i] + oldOffset + 1); } }\n\n return decorations\n}\n\nfunction takeSpansForNode(spans, node, offset) {\n if (node.isLeaf) { return null }\n var end = offset + node.nodeSize, found = null;\n for (var i = 0, span = (void 0); i < spans.length; i++) {\n if ((span = spans[i]) && span.from > offset && span.to < end) {\n(found || (found = [])).push(span);\n spans[i] = null;\n }\n }\n return found\n}\n\nfunction withoutNulls(array) {\n var result = [];\n for (var i = 0; i < array.length; i++)\n { if (array[i] != null) { result.push(array[i]); } }\n return result\n}\n\n// : ([Decoration], Node, number) → DecorationSet\n// Build up a tree that corresponds to a set of decorations. `offset`\n// is a base offset that should be subtractet from the `from` and `to`\n// positions in the spans (so that we don't have to allocate new spans\n// for recursive calls).\nfunction buildTree(spans, node, offset, options) {\n var children = [], hasNulls = false;\n node.forEach(function (childNode, localStart) {\n var found = takeSpansForNode(spans, childNode, localStart + offset);\n if (found) {\n hasNulls = true;\n var subtree = buildTree(found, childNode, offset + localStart + 1, options);\n if (subtree != empty)\n { children.push(localStart, localStart + childNode.nodeSize, subtree); }\n }\n });\n var locals = moveSpans(hasNulls ? withoutNulls(spans) : spans, -offset).sort(byPos);\n for (var i = 0; i < locals.length; i++) { if (!locals[i].type.valid(node, locals[i])) {\n if (options.onRemove) { options.onRemove(locals[i].spec); }\n locals.splice(i--, 1);\n } }\n return locals.length || children.length ? new DecorationSet(locals, children) : empty\n}\n\n// : (Decoration, Decoration) → number\n// Used to sort decorations so that ones with a low start position\n// come first, and within a set with the same start position, those\n// with an smaller end position come first.\nfunction byPos(a, b) {\n return a.from - b.from || a.to - b.to\n}\n\n// : ([Decoration]) → [Decoration]\n// Scan a sorted array of decorations for partially overlapping spans,\n// and split those so that only fully overlapping spans are left (to\n// make subsequent rendering easier). Will return the input array if\n// no partially overlapping spans are found (the common case).\nfunction removeOverlap(spans) {\n var working = spans;\n for (var i = 0; i < working.length - 1; i++) {\n var span = working[i];\n if (span.from != span.to) { for (var j = i + 1; j < working.length; j++) {\n var next = working[j];\n if (next.from == span.from) {\n if (next.to != span.to) {\n if (working == spans) { working = spans.slice(); }\n // Followed by a partially overlapping larger span. Split that\n // span.\n working[j] = next.copy(next.from, span.to);\n insertAhead(working, j + 1, next.copy(span.to, next.to));\n }\n continue\n } else {\n if (next.from < span.to) {\n if (working == spans) { working = spans.slice(); }\n // The end of this one overlaps with a subsequent span. Split\n // this one.\n working[i] = span.copy(span.from, next.from);\n insertAhead(working, j, span.copy(next.from, span.to));\n }\n break\n }\n } }\n }\n return working\n}\n\nfunction insertAhead(array, i, deco) {\n while (i < array.length && byPos(deco, array[i]) > 0) { i++; }\n array.splice(i, 0, deco);\n}\n\n// : (EditorView) → union\n// Get the decorations associated with the current props of a view.\nfunction viewDecorations(view) {\n var found = [];\n view.someProp(\"decorations\", function (f) {\n var result = f(view.state);\n if (result && result != empty) { found.push(result); }\n });\n if (view.cursorWrapper)\n { found.push(DecorationSet.create(view.state.doc, [view.cursorWrapper.deco])); }\n return DecorationGroup.from(found)\n}\n\n// ::- An editor view manages the DOM structure that represents an\n// editable document. Its state and behavior are determined by its\n// [props](#view.DirectEditorProps).\nvar EditorView = function EditorView(place, props) {\n this._props = props;\n // :: EditorState\n // The view's current [state](#state.EditorState).\n this.state = props.state;\n\n this.dispatch = this.dispatch.bind(this);\n\n this._root = null;\n this.focused = false;\n\n // :: dom.Element\n // An editable DOM node containing the document. (You probably\n // should not directly interfere with its content.)\n this.dom = (place && place.mount) || document.createElement(\"div\");\n if (place) {\n if (place.appendChild) { place.appendChild(this.dom); }\n else if (place.apply) { place(this.dom); }\n else if (place.mount) { this.mounted = true; }\n }\n\n // :: bool\n // Indicates whether the editor is currently [editable](#view.EditorProps.editable).\n this.editable = getEditable(this);\n this.markCursor = null;\n this.cursorWrapper = null;\n updateCursorWrapper(this);\n this.nodeViews = buildNodeViews(this);\n this.docView = docViewDesc(this.state.doc, computeDocDeco(this), viewDecorations(this), this.dom, this);\n\n this.lastSelectedViewDesc = null;\n // :: ?{slice: Slice, move: bool}\n // When editor content is being dragged, this object contains\n // information about the dragged slice and whether it is being\n // copied or moved. At any other time, it is null.\n this.dragging = null;\n\n initInput(this);\n\n this.pluginViews = [];\n this.updatePluginViews();\n};\n\nvar prototypeAccessors$2 = { props: { configurable: true },root: { configurable: true } };\n\n// composing:: boolean\n// Holds `true` when a\n// [composition](https://developer.mozilla.org/en-US/docs/Mozilla/IME_handling_guide)\n// is active.\n\n// :: DirectEditorProps\n// The view's current [props](#view.EditorProps).\nprototypeAccessors$2.props.get = function () {\n if (this._props.state != this.state) {\n var prev = this._props;\n this._props = {};\n for (var name in prev) { this._props[name] = prev[name]; }\n this._props.state = this.state;\n }\n return this._props\n};\n\n// :: (DirectEditorProps)\n// Update the view's props. Will immediately cause an update to\n// the DOM.\nEditorView.prototype.update = function update (props) {\n if (props.handleDOMEvents != this._props.handleDOMEvents) { ensureListeners(this); }\n this._props = props;\n this.updateStateInner(props.state, true);\n};\n\n// :: (DirectEditorProps)\n// Update the view by updating existing props object with the object\n// given as argument. Equivalent to `view.update(Object.assign({},\n// view.props, props))`.\nEditorView.prototype.setProps = function setProps (props) {\n var updated = {};\n for (var name in this._props) { updated[name] = this._props[name]; }\n updated.state = this.state;\n for (var name$1 in props) { updated[name$1] = props[name$1]; }\n this.update(updated);\n};\n\n// :: (EditorState)\n// Update the editor's `state` prop, without touching any of the\n// other props.\nEditorView.prototype.updateState = function updateState (state) {\n this.updateStateInner(state, this.state.plugins != state.plugins);\n};\n\nEditorView.prototype.updateStateInner = function updateStateInner (state, reconfigured) {\n var this$1 = this;\n\n var prev = this.state, redraw = false;\n this.state = state;\n if (reconfigured) {\n var nodeViews = buildNodeViews(this);\n if (changedNodeViews(nodeViews, this.nodeViews)) {\n this.nodeViews = nodeViews;\n redraw = true;\n }\n ensureListeners(this);\n }\n\n this.editable = getEditable(this);\n updateCursorWrapper(this);\n var innerDeco = viewDecorations(this), outerDeco = computeDocDeco(this);\n\n var scroll = reconfigured ? \"reset\"\n : state.scrollToSelection > prev.scrollToSelection ? \"to selection\" : \"preserve\";\n var updateDoc = redraw || !this.docView.matchesNode(state.doc, outerDeco, innerDeco);\n var updateSel = updateDoc || !state.selection.eq(prev.selection);\n var oldScrollPos = scroll == \"preserve\" && updateSel && this.dom.style.overflowAnchor == null && storeScrollPos(this);\n\n if (updateSel) {\n this.domObserver.stop();\n // Work around an issue in Chrome, IE, and Edge where changing\n // the DOM around an active selection puts it into a broken\n // state where the thing the user sees differs from the\n // selection reported by the Selection object (#710, #973,\n // #1011, #1013).\n var forceSelUpdate = updateDoc && (result.ie || result.chrome) &&\n !prev.selection.empty && !state.selection.empty && selectionContextChanged(prev.selection, state.selection);\n if (updateDoc) {\n if (redraw || !this.docView.update(state.doc, outerDeco, innerDeco, this)) {\n this.docView.destroy();\n this.docView = docViewDesc(state.doc, outerDeco, innerDeco, this.dom, this);\n }\n }\n // Work around for an issue where an update arriving right between\n // a DOM selection change and the \"selectionchange\" event for it\n // can cause a spurious DOM selection update, disrupting mouse\n // drag selection.\n if (forceSelUpdate ||\n !(this.mouseDown && this.domObserver.currentSelection.eq(this.root.getSelection()) && anchorInRightPlace(this))) {\n selectionToDOM(this, forceSelUpdate);\n } else {\n syncNodeSelection(this, state.selection);\n this.domObserver.setCurSelection();\n }\n this.domObserver.start();\n }\n\n this.updatePluginViews(prev);\n\n if (scroll == \"reset\") {\n this.dom.scrollTop = 0;\n } else if (scroll == \"to selection\") {\n var startDOM = this.root.getSelection().focusNode;\n if (this.someProp(\"handleScrollToSelection\", function (f) { return f(this$1); }))\n ; // Handled\n else if (state.selection instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__[\"NodeSelection\"])\n { scrollRectIntoView(this, this.docView.domAfterPos(state.selection.from).getBoundingClientRect(), startDOM); }\n else\n { scrollRectIntoView(this, this.coordsAtPos(state.selection.head), startDOM); }\n } else if (oldScrollPos) {\n resetScrollPos(oldScrollPos);\n }\n};\n\nEditorView.prototype.destroyPluginViews = function destroyPluginViews () {\n var view;\n while (view = this.pluginViews.pop()) { if (view.destroy) { view.destroy(); } }\n};\n\nEditorView.prototype.updatePluginViews = function updatePluginViews (prevState) {\n if (!prevState || prevState.plugins != this.state.plugins) {\n this.destroyPluginViews();\n for (var i = 0; i < this.state.plugins.length; i++) {\n var plugin = this.state.plugins[i];\n if (plugin.spec.view) { this.pluginViews.push(plugin.spec.view(this)); }\n }\n } else {\n for (var i$1 = 0; i$1 < this.pluginViews.length; i$1++) {\n var pluginView = this.pluginViews[i$1];\n if (pluginView.update) { pluginView.update(this, prevState); }\n }\n }\n};\n\n// :: (string, ?(prop: *) → *) → *\n// Goes over the values of a prop, first those provided directly,\n// then those from plugins (in order), and calls `f` every time a\n// non-undefined value is found. When `f` returns a truthy value,\n// that is immediately returned. When `f` isn't provided, it is\n// treated as the identity function (the prop value is returned\n// directly).\nEditorView.prototype.someProp = function someProp (propName, f) {\n var prop = this._props && this._props[propName], value;\n if (prop != null && (value = f ? f(prop) : prop)) { return value }\n var plugins = this.state.plugins;\n if (plugins) { for (var i = 0; i < plugins.length; i++) {\n var prop$1 = plugins[i].props[propName];\n if (prop$1 != null && (value = f ? f(prop$1) : prop$1)) { return value }\n } }\n};\n\n// :: () → bool\n// Query whether the view has focus.\nEditorView.prototype.hasFocus = function hasFocus () {\n return this.root.activeElement == this.dom\n};\n\n// :: ()\n// Focus the editor.\nEditorView.prototype.focus = function focus () {\n this.domObserver.stop();\n if (this.editable) { focusPreventScroll(this.dom); }\n selectionToDOM(this);\n this.domObserver.start();\n};\n\n// :: union\n// Get the document root in which the editor exists. This will\n// usually be the top-level `document`, but might be a [shadow\n// DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Shadow_DOM)\n// root if the editor is inside one.\nprototypeAccessors$2.root.get = function () {\n var cached = this._root;\n if (cached == null) { for (var search = this.dom.parentNode; search; search = search.parentNode) {\n if (search.nodeType == 9 || (search.nodeType == 11 && search.host)) {\n if (!search.getSelection) { Object.getPrototypeOf(search).getSelection = function () { return document.getSelection(); }; }\n return this._root = search\n }\n } }\n return cached || document\n};\n\n// :: ({left: number, top: number}) → ?{pos: number, inside: number}\n// Given a pair of viewport coordinates, return the document\n// position that corresponds to them. May return null if the given\n// coordinates aren't inside of the editor. When an object is\n// returned, its `pos` property is the position nearest to the\n// coordinates, and its `inside` property holds the position of the\n// inner node that the position falls inside of, or -1 if it is at\n// the top level, not in any node.\nEditorView.prototype.posAtCoords = function posAtCoords$1 (coords) {\n return posAtCoords(this, coords)\n};\n\n// :: (number) → {left: number, right: number, top: number, bottom: number}\n// Returns the viewport rectangle at a given document position. `left`\n// and `right` will be the same number, as this returns a flat\n// cursor-ish rectangle.\nEditorView.prototype.coordsAtPos = function coordsAtPos$1 (pos) {\n return coordsAtPos(this, pos)\n};\n\n// :: (number) → {node: dom.Node, offset: number}\n// Find the DOM position that corresponds to the given document\n// position. Note that you should **not** mutate the editor's\n// internal DOM, only inspect it (and even that is usually not\n// necessary).\nEditorView.prototype.domAtPos = function domAtPos (pos) {\n return this.docView.domFromPos(pos)\n};\n\n// :: (number) → ?dom.Node\n// Find the DOM node that represents the document node after the\n// given position. May return `null` when the position doesn't point\n// in front of a node or if the node is inside an opaque node view.\n//\n// This is intended to be able to call things like\n// `getBoundingClientRect` on that DOM node. Do **not** mutate the\n// editor DOM directly, or add styling this way, since that will be\n// immediately overriden by the editor as it redraws the node.\nEditorView.prototype.nodeDOM = function nodeDOM (pos) {\n var desc = this.docView.descAt(pos);\n return desc ? desc.nodeDOM : null\n};\n\n// :: (dom.Node, number, ?number) → number\n// Find the document position that corresponds to a given DOM\n// position. (Whenever possible, it is preferable to inspect the\n// document structure directly, rather than poking around in the\n// DOM, but sometimes—for example when interpreting an event\n// target—you don't have a choice.)\n//\n// The `bias` parameter can be used to influence which side of a DOM\n// node to use when the position is inside a leaf node.\nEditorView.prototype.posAtDOM = function posAtDOM (node, offset, bias) {\n if ( bias === void 0 ) bias = -1;\n\n var pos = this.docView.posFromDOM(node, offset, bias);\n if (pos == null) { throw new RangeError(\"DOM position not inside the editor\") }\n return pos\n};\n\n// :: (union<\"up\", \"down\", \"left\", \"right\", \"forward\", \"backward\">, ?EditorState) → bool\n// Find out whether the selection is at the end of a textblock when\n// moving in a given direction. When, for example, given `\"left\"`,\n// it will return true if moving left from the current cursor\n// position would leave that position's parent textblock. Will apply\n// to the view's current state by default, but it is possible to\n// pass a different state.\nEditorView.prototype.endOfTextblock = function endOfTextblock$1 (dir, state) {\n return endOfTextblock(this, state || this.state, dir)\n};\n\n// :: ()\n// Removes the editor from the DOM and destroys all [node\n// views](#view.NodeView).\nEditorView.prototype.destroy = function destroy () {\n if (!this.docView) { return }\n destroyInput(this);\n this.destroyPluginViews();\n if (this.mounted) {\n this.docView.update(this.state.doc, [], viewDecorations(this), this);\n this.dom.textContent = \"\";\n } else if (this.dom.parentNode) {\n this.dom.parentNode.removeChild(this.dom);\n }\n this.docView.destroy();\n this.docView = null;\n};\n\n// Used for testing.\nEditorView.prototype.dispatchEvent = function dispatchEvent$1 (event) {\n return dispatchEvent(this, event)\n};\n\n// :: (Transaction)\n// Dispatch a transaction. Will call\n// [`dispatchTransaction`](#view.DirectEditorProps.dispatchTransaction)\n// when given, and otherwise defaults to applying the transaction to\n// the current state and calling\n// [`updateState`](#view.EditorView.updateState) with the result.\n// This method is bound to the view instance, so that it can be\n// easily passed around.\nEditorView.prototype.dispatch = function dispatch (tr) {\n var dispatchTransaction = this._props.dispatchTransaction;\n if (dispatchTransaction) { dispatchTransaction.call(this, tr); }\n else { this.updateState(this.state.apply(tr)); }\n};\n\nObject.defineProperties( EditorView.prototype, prototypeAccessors$2 );\n\nfunction computeDocDeco(view) {\n var attrs = Object.create(null);\n attrs.class = \"ProseMirror\";\n attrs.contenteditable = String(view.editable);\n\n view.someProp(\"attributes\", function (value) {\n if (typeof value == \"function\") { value = value(view.state); }\n if (value) { for (var attr in value) {\n if (attr == \"class\")\n { attrs.class += \" \" + value[attr]; }\n else if (!attrs[attr] && attr != \"contenteditable\" && attr != \"nodeName\")\n { attrs[attr] = String(value[attr]); }\n } }\n });\n\n return [Decoration.node(0, view.state.doc.content.size, attrs)]\n}\n\nfunction updateCursorWrapper(view) {\n var ref = view.state.selection;\n var $head = ref.$head;\n var $anchor = ref.$anchor;\n var visible = ref.visible;\n if (view.markCursor) {\n var dom = document.createElement(\"img\");\n dom.setAttribute(\"mark-placeholder\", \"true\");\n view.cursorWrapper = {dom: dom, deco: Decoration.widget($head.pos, dom, {raw: true, marks: view.markCursor})};\n } else if (visible || $head.pos != $anchor.pos) {\n view.cursorWrapper = null;\n } else {\n var dom$1;\n if (!view.cursorWrapper || view.cursorWrapper.dom.childNodes.length) {\n dom$1 = document.createElement(\"div\");\n dom$1.style.position = \"absolute\";\n dom$1.style.left = \"-100000px\";\n } else if (view.cursorWrapper.deco.pos != $head.pos) {\n dom$1 = view.cursorWrapper.dom;\n }\n if (dom$1)\n { view.cursorWrapper = {dom: dom$1, deco: Decoration.widget($head.pos, dom$1, {raw: true})}; }\n }\n}\n\nfunction getEditable(view) {\n return !view.someProp(\"editable\", function (value) { return value(view.state) === false; })\n}\n\nfunction selectionContextChanged(sel1, sel2) {\n var depth = Math.min(sel1.$anchor.sharedDepth(sel1.head), sel2.$anchor.sharedDepth(sel2.head));\n return sel1.$anchor.node(depth) != sel2.$anchor.node(depth)\n}\n\nfunction buildNodeViews(view) {\n var result = {};\n view.someProp(\"nodeViews\", function (obj) {\n for (var prop in obj) { if (!Object.prototype.hasOwnProperty.call(result, prop))\n { result[prop] = obj[prop]; } }\n });\n return result\n}\n\nfunction changedNodeViews(a, b) {\n var nA = 0, nB = 0;\n for (var prop in a) {\n if (a[prop] != b[prop]) { return true }\n nA++;\n }\n for (var _ in b) { nB++; }\n return nA != nB\n}\n\n// EditorProps:: interface\n//\n// Props are configuration values that can be passed to an editor view\n// or included in a plugin. This interface lists the supported props.\n//\n// The various event-handling functions may all return `true` to\n// indicate that they handled the given event. The view will then take\n// care to call `preventDefault` on the event, except with\n// `handleDOMEvents`, where the handler itself is responsible for that.\n//\n// How a prop is resolved depends on the prop. Handler functions are\n// called one at a time, starting with the base props and then\n// searching through the plugins (in order of appearance) until one of\n// them returns true. For some props, the first plugin that yields a\n// value gets precedence.\n//\n// handleDOMEvents:: ?Object<(view: EditorView, event: dom.Event) → bool>\n// Can be an object mapping DOM event type names to functions that\n// handle them. Such functions will be called before any handling\n// ProseMirror does of events fired on the editable DOM element.\n// Contrary to the other event handling props, when returning true\n// from such a function, you are responsible for calling\n// `preventDefault` yourself (or not, if you want to allow the\n// default behavior).\n//\n// handleKeyDown:: ?(view: EditorView, event: dom.KeyboardEvent) → bool\n// Called when the editor receives a `keydown` event.\n//\n// handleKeyPress:: ?(view: EditorView, event: dom.KeyboardEvent) → bool\n// Handler for `keypress` events.\n//\n// handleTextInput:: ?(view: EditorView, from: number, to: number, text: string) → bool\n// Whenever the user directly input text, this handler is called\n// before the input is applied. If it returns `true`, the default\n// behavior of actually inserting the text is suppressed.\n//\n// handleClickOn:: ?(view: EditorView, pos: number, node: Node, nodePos: number, event: dom.MouseEvent, direct: bool) → bool\n// Called for each node around a click, from the inside out. The\n// `direct` flag will be true for the inner node.\n//\n// handleClick:: ?(view: EditorView, pos: number, event: dom.MouseEvent) → bool\n// Called when the editor is clicked, after `handleClickOn` handlers\n// have been called.\n//\n// handleDoubleClickOn:: ?(view: EditorView, pos: number, node: Node, nodePos: number, event: dom.MouseEvent, direct: bool) → bool\n// Called for each node around a double click.\n//\n// handleDoubleClick:: ?(view: EditorView, pos: number, event: dom.MouseEvent) → bool\n// Called when the editor is double-clicked, after `handleDoubleClickOn`.\n//\n// handleTripleClickOn:: ?(view: EditorView, pos: number, node: Node, nodePos: number, event: dom.MouseEvent, direct: bool) → bool\n// Called for each node around a triple click.\n//\n// handleTripleClick:: ?(view: EditorView, pos: number, event: dom.MouseEvent) → bool\n// Called when the editor is triple-clicked, after `handleTripleClickOn`.\n//\n// handlePaste:: ?(view: EditorView, event: dom.Event, slice: Slice) → bool\n// Can be used to override the behavior of pasting. `slice` is the\n// pasted content parsed by the editor, but you can directly access\n// the event to get at the raw content.\n//\n// handleDrop:: ?(view: EditorView, event: dom.Event, slice: Slice, moved: bool) → bool\n// Called when something is dropped on the editor. `moved` will be\n// true if this drop moves from the current selection (which should\n// thus be deleted).\n//\n// handleScrollToSelection:: ?(view: EditorView) → bool\n// Called when the view, after updating its state, tries to scroll\n// the selection into view. A handler function may return false to\n// indicate that it did not handle the scrolling and further\n// handlers or the default behavior should be tried.\n//\n// createSelectionBetween:: ?(view: EditorView, anchor: ResolvedPos, head: ResolvedPos) → ?Selection\n// Can be used to override the way a selection is created when\n// reading a DOM selection between the given anchor and head.\n//\n// domParser:: ?DOMParser\n// The [parser](#model.DOMParser) to use when reading editor changes\n// from the DOM. Defaults to calling\n// [`DOMParser.fromSchema`](#model.DOMParser^fromSchema) on the\n// editor's schema.\n//\n// transformPastedHTML:: ?(html: string) → string\n// Can be used to transform pasted HTML text, _before_ it is parsed,\n// for example to clean it up.\n//\n// clipboardParser:: ?DOMParser\n// The [parser](#model.DOMParser) to use when reading content from\n// the clipboard. When not given, the value of the\n// [`domParser`](#view.EditorProps.domParser) prop is used.\n//\n// transformPastedText:: ?(text: string) → string\n// Transform pasted plain text.\n//\n// clipboardTextParser:: ?(text: string, $context: ResolvedPos) → Slice\n// A function to parse text from the clipboard into a document\n// slice. Called after\n// [`transformPastedText`](#view.EditorProps.transformPastedText).\n// The default behavior is to split the text into lines, wrap them\n// in `

      ` tags, and call\n// [`clipboardParser`](#view.EditorProps.clipboardParser) on it.\n//\n// transformPasted:: ?(Slice) → Slice\n// Can be used to transform pasted content before it is applied to\n// the document.\n//\n// nodeViews:: ?Object<(node: Node, view: EditorView, getPos: () → number, decorations: [Decoration]) → NodeView>\n// Allows you to pass custom rendering and behavior logic for nodes\n// and marks. Should map node and mark names to constructor\n// functions that produce a [`NodeView`](#view.NodeView) object\n// implementing the node's display behavior. For nodes, the third\n// argument `getPos` is a function that can be called to get the\n// node's current position, which can be useful when creating\n// transactions to update it. For marks, the third argument is a\n// boolean that indicates whether the mark's content is inline.\n//\n// `decorations` is an array of node or inline decorations that are\n// active around the node. They are automatically drawn in the\n// normal way, and you will usually just want to ignore this, but\n// they can also be used as a way to provide context information to\n// the node view without adding it to the document itself.\n//\n// clipboardSerializer:: ?DOMSerializer\n// The DOM serializer to use when putting content onto the\n// clipboard. If not given, the result of\n// [`DOMSerializer.fromSchema`](#model.DOMSerializer^fromSchema)\n// will be used.\n//\n// clipboardTextSerializer:: ?(Slice) → string\n// A function that will be called to get the text for the current\n// selection when copying text to the clipboard. By default, the\n// editor will use [`textBetween`](#model.Node.textBetween) on the\n// selected range.\n//\n// decorations:: ?(state: EditorState) → ?DecorationSet\n// A set of [document decorations](#view.Decoration) to show in the\n// view.\n//\n// editable:: ?(state: EditorState) → bool\n// When this returns false, the content of the view is not directly\n// editable.\n//\n// attributes:: ?union, (EditorState) → ?Object>\n// Control the DOM attributes of the editable element. May be either\n// an object or a function going from an editor state to an object.\n// By default, the element will get a class `\"ProseMirror\"`, and\n// will have its `contentEditable` attribute determined by the\n// [`editable` prop](#view.EditorProps.editable). Additional classes\n// provided here will be added to the class. For other attributes,\n// the value provided first (as in\n// [`someProp`](#view.EditorView.someProp)) will be used.\n//\n// scrollThreshold:: ?union\n// Determines the distance (in pixels) between the cursor and the\n// end of the visible viewport at which point, when scrolling the\n// cursor into view, scrolling takes place. Defaults to 0.\n//\n// scrollMargin:: ?union\n// Determines the extra space (in pixels) that is left above or\n// below the cursor when it is scrolled into view. Defaults to 5.\n\n// DirectEditorProps:: interface extends EditorProps\n//\n// The props object given directly to the editor view supports two\n// fields that can't be used in plugins:\n//\n// state:: EditorState\n// The current state of the editor.\n//\n// dispatchTransaction:: ?(tr: Transaction)\n// The callback over which to send transactions (state updates)\n// produced by the view. If you specify this, you probably want to\n// make sure this ends up calling the view's\n// [`updateState`](#view.EditorView.updateState) method with a new\n// state that has the transaction\n// [applied](#state.EditorState.apply). The callback will be bound to have\n// the view instance as its `this` binding.\n\n\n//# sourceMappingURL=index.es.js.map\n\n\n//# sourceURL=webpack:///./node_modules/prosemirror-view/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/rope-sequence/dist/index.es.js": +/*!*****************************************************!*\ + !*** ./node_modules/rope-sequence/dist/index.es.js ***! + \*****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar GOOD_LEAF_SIZE = 200;\n\n// :: class A rope sequence is a persistent sequence data structure\n// that supports appending, prepending, and slicing without doing a\n// full copy. It is represented as a mostly-balanced tree.\nvar RopeSequence = function RopeSequence () {};\n\nRopeSequence.prototype.append = function append (other) {\n if (!other.length) { return this }\n other = RopeSequence.from(other);\n\n return (!this.length && other) ||\n (other.length < GOOD_LEAF_SIZE && this.leafAppend(other)) ||\n (this.length < GOOD_LEAF_SIZE && other.leafPrepend(this)) ||\n this.appendInner(other)\n};\n\n// :: (union<[T], RopeSequence>) → RopeSequence\n// Prepend an array or other rope to this one, returning a new rope.\nRopeSequence.prototype.prepend = function prepend (other) {\n if (!other.length) { return this }\n return RopeSequence.from(other).append(this)\n};\n\nRopeSequence.prototype.appendInner = function appendInner (other) {\n return new Append(this, other)\n};\n\n// :: (?number, ?number) → RopeSequence\n// Create a rope repesenting a sub-sequence of this rope.\nRopeSequence.prototype.slice = function slice (from, to) {\n if ( from === void 0 ) from = 0;\n if ( to === void 0 ) to = this.length;\n\n if (from >= to) { return RopeSequence.empty }\n return this.sliceInner(Math.max(0, from), Math.min(this.length, to))\n};\n\n// :: (number) → T\n// Retrieve the element at the given position from this rope.\nRopeSequence.prototype.get = function get (i) {\n if (i < 0 || i >= this.length) { return undefined }\n return this.getInner(i)\n};\n\n// :: ((element: T, index: number) → ?bool, ?number, ?number)\n// Call the given function for each element between the given\n// indices. This tends to be more efficient than looping over the\n// indices and calling `get`, because it doesn't have to descend the\n// tree for every element.\nRopeSequence.prototype.forEach = function forEach (f, from, to) {\n if ( from === void 0 ) from = 0;\n if ( to === void 0 ) to = this.length;\n\n if (from <= to)\n { this.forEachInner(f, from, to, 0); }\n else\n { this.forEachInvertedInner(f, from, to, 0); }\n};\n\n// :: ((element: T, index: number) → U, ?number, ?number) → [U]\n// Map the given functions over the elements of the rope, producing\n// a flat array.\nRopeSequence.prototype.map = function map (f, from, to) {\n if ( from === void 0 ) from = 0;\n if ( to === void 0 ) to = this.length;\n\n var result = [];\n this.forEach(function (elt, i) { return result.push(f(elt, i)); }, from, to);\n return result\n};\n\n// :: (?union<[T], RopeSequence>) → RopeSequence\n// Create a rope representing the given array, or return the rope\n// itself if a rope was given.\nRopeSequence.from = function from (values) {\n if (values instanceof RopeSequence) { return values }\n return values && values.length ? new Leaf(values) : RopeSequence.empty\n};\n\nvar Leaf = /*@__PURE__*/(function (RopeSequence) {\n function Leaf(values) {\n RopeSequence.call(this);\n this.values = values;\n }\n\n if ( RopeSequence ) Leaf.__proto__ = RopeSequence;\n Leaf.prototype = Object.create( RopeSequence && RopeSequence.prototype );\n Leaf.prototype.constructor = Leaf;\n\n var prototypeAccessors = { length: { configurable: true },depth: { configurable: true } };\n\n Leaf.prototype.flatten = function flatten () {\n return this.values\n };\n\n Leaf.prototype.sliceInner = function sliceInner (from, to) {\n if (from == 0 && to == this.length) { return this }\n return new Leaf(this.values.slice(from, to))\n };\n\n Leaf.prototype.getInner = function getInner (i) {\n return this.values[i]\n };\n\n Leaf.prototype.forEachInner = function forEachInner (f, from, to, start) {\n for (var i = from; i < to; i++)\n { if (f(this.values[i], start + i) === false) { return false } }\n };\n\n Leaf.prototype.forEachInvertedInner = function forEachInvertedInner (f, from, to, start) {\n for (var i = from - 1; i >= to; i--)\n { if (f(this.values[i], start + i) === false) { return false } }\n };\n\n Leaf.prototype.leafAppend = function leafAppend (other) {\n if (this.length + other.length <= GOOD_LEAF_SIZE)\n { return new Leaf(this.values.concat(other.flatten())) }\n };\n\n Leaf.prototype.leafPrepend = function leafPrepend (other) {\n if (this.length + other.length <= GOOD_LEAF_SIZE)\n { return new Leaf(other.flatten().concat(this.values)) }\n };\n\n prototypeAccessors.length.get = function () { return this.values.length };\n\n prototypeAccessors.depth.get = function () { return 0 };\n\n Object.defineProperties( Leaf.prototype, prototypeAccessors );\n\n return Leaf;\n}(RopeSequence));\n\n// :: RopeSequence\n// The empty rope sequence.\nRopeSequence.empty = new Leaf([]);\n\nvar Append = /*@__PURE__*/(function (RopeSequence) {\n function Append(left, right) {\n RopeSequence.call(this);\n this.left = left;\n this.right = right;\n this.length = left.length + right.length;\n this.depth = Math.max(left.depth, right.depth) + 1;\n }\n\n if ( RopeSequence ) Append.__proto__ = RopeSequence;\n Append.prototype = Object.create( RopeSequence && RopeSequence.prototype );\n Append.prototype.constructor = Append;\n\n Append.prototype.flatten = function flatten () {\n return this.left.flatten().concat(this.right.flatten())\n };\n\n Append.prototype.getInner = function getInner (i) {\n return i < this.left.length ? this.left.get(i) : this.right.get(i - this.left.length)\n };\n\n Append.prototype.forEachInner = function forEachInner (f, from, to, start) {\n var leftLen = this.left.length;\n if (from < leftLen &&\n this.left.forEachInner(f, from, Math.min(to, leftLen), start) === false)\n { return false }\n if (to > leftLen &&\n this.right.forEachInner(f, Math.max(from - leftLen, 0), Math.min(this.length, to) - leftLen, start + leftLen) === false)\n { return false }\n };\n\n Append.prototype.forEachInvertedInner = function forEachInvertedInner (f, from, to, start) {\n var leftLen = this.left.length;\n if (from > leftLen &&\n this.right.forEachInvertedInner(f, from - leftLen, Math.max(to, leftLen) - leftLen, start + leftLen) === false)\n { return false }\n if (to < leftLen &&\n this.left.forEachInvertedInner(f, Math.min(from, leftLen), to, start) === false)\n { return false }\n };\n\n Append.prototype.sliceInner = function sliceInner (from, to) {\n if (from == 0 && to == this.length) { return this }\n var leftLen = this.left.length;\n if (to <= leftLen) { return this.left.slice(from, to) }\n if (from >= leftLen) { return this.right.slice(from - leftLen, to - leftLen) }\n return this.left.slice(from, leftLen).append(this.right.slice(0, to - leftLen))\n };\n\n Append.prototype.leafAppend = function leafAppend (other) {\n var inner = this.right.leafAppend(other);\n if (inner) { return new Append(this.left, inner) }\n };\n\n Append.prototype.leafPrepend = function leafPrepend (other) {\n var inner = this.left.leafPrepend(other);\n if (inner) { return new Append(inner, this.right) }\n };\n\n Append.prototype.appendInner = function appendInner (other) {\n if (this.left.depth >= Math.max(this.right.depth, other.depth) + 1)\n { return new Append(this.left, new Append(this.right, other)) }\n return new Append(this, other)\n };\n\n return Append;\n}(RopeSequence));\n\nvar ropeSequence = RopeSequence;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ropeSequence);\n\n\n//# sourceURL=webpack:///./node_modules/rope-sequence/dist/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/uc.micro/categories/Cc/regex.js": +/*!******************************************************!*\ + !*** ./node_modules/uc.micro/categories/Cc/regex.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("module.exports=/[\\0-\\x1F\\x7F-\\x9F]/\n\n//# sourceURL=webpack:///./node_modules/uc.micro/categories/Cc/regex.js?"); + +/***/ }), + +/***/ "./node_modules/uc.micro/categories/Cf/regex.js": +/*!******************************************************!*\ + !*** ./node_modules/uc.micro/categories/Cf/regex.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("module.exports=/[\\xAD\\u0600-\\u0605\\u061C\\u06DD\\u070F\\u08E2\\u180E\\u200B-\\u200F\\u202A-\\u202E\\u2060-\\u2064\\u2066-\\u206F\\uFEFF\\uFFF9-\\uFFFB]|\\uD804[\\uDCBD\\uDCCD]|\\uD82F[\\uDCA0-\\uDCA3]|\\uD834[\\uDD73-\\uDD7A]|\\uDB40[\\uDC01\\uDC20-\\uDC7F]/\n\n//# sourceURL=webpack:///./node_modules/uc.micro/categories/Cf/regex.js?"); + +/***/ }), + +/***/ "./node_modules/uc.micro/categories/P/regex.js": +/*!*****************************************************!*\ + !*** ./node_modules/uc.micro/categories/P/regex.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("module.exports=/[!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\\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\\u09FD\\u0A76\\u0AF0\\u0C84\\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-\\u2E4E\\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]|\\uD803[\\uDF55-\\uDF59]|\\uD804[\\uDC47-\\uDC4D\\uDCBB\\uDCBC\\uDCBE-\\uDCC1\\uDD40-\\uDD43\\uDD74\\uDD75\\uDDC5-\\uDDC8\\uDDCD\\uDDDB\\uDDDD-\\uDDDF\\uDE38-\\uDE3D\\uDEA9]|\\uD805[\\uDC4B-\\uDC4F\\uDC5B\\uDC5D\\uDCC6\\uDDC1-\\uDDD7\\uDE41-\\uDE43\\uDE60-\\uDE6C\\uDF3C-\\uDF3E]|\\uD806[\\uDC3B\\uDE3F-\\uDE46\\uDE9A-\\uDE9C\\uDE9E-\\uDEA2]|\\uD807[\\uDC41-\\uDC45\\uDC70\\uDC71\\uDEF7\\uDEF8]|\\uD809[\\uDC70-\\uDC74]|\\uD81A[\\uDE6E\\uDE6F\\uDEF5\\uDF37-\\uDF3B\\uDF44]|\\uD81B[\\uDE97-\\uDE9A]|\\uD82F\\uDC9F|\\uD836[\\uDE87-\\uDE8B]|\\uD83A[\\uDD5E\\uDD5F]/\n\n//# sourceURL=webpack:///./node_modules/uc.micro/categories/P/regex.js?"); + +/***/ }), + +/***/ "./node_modules/uc.micro/categories/Z/regex.js": +/*!*****************************************************!*\ + !*** ./node_modules/uc.micro/categories/Z/regex.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("module.exports=/[ \\xA0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]/\n\n//# sourceURL=webpack:///./node_modules/uc.micro/categories/Z/regex.js?"); + +/***/ }), + +/***/ "./node_modules/uc.micro/index.js": +/*!****************************************!*\ + !*** ./node_modules/uc.micro/index.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nexports.Any = __webpack_require__(/*! ./properties/Any/regex */ \"./node_modules/uc.micro/properties/Any/regex.js\");\nexports.Cc = __webpack_require__(/*! ./categories/Cc/regex */ \"./node_modules/uc.micro/categories/Cc/regex.js\");\nexports.Cf = __webpack_require__(/*! ./categories/Cf/regex */ \"./node_modules/uc.micro/categories/Cf/regex.js\");\nexports.P = __webpack_require__(/*! ./categories/P/regex */ \"./node_modules/uc.micro/categories/P/regex.js\");\nexports.Z = __webpack_require__(/*! ./categories/Z/regex */ \"./node_modules/uc.micro/categories/Z/regex.js\");\n\n\n//# sourceURL=webpack:///./node_modules/uc.micro/index.js?"); + +/***/ }), + +/***/ "./node_modules/uc.micro/properties/Any/regex.js": +/*!*******************************************************!*\ + !*** ./node_modules/uc.micro/properties/Any/regex.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("module.exports=/[\\0-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/\n\n//# sourceURL=webpack:///./node_modules/uc.micro/properties/Any/regex.js?"); + +/***/ }), + +/***/ "./node_modules/w3c-keyname/index.es.js": +/*!**********************************************!*\ + !*** ./node_modules/w3c-keyname/index.es.js ***! + \**********************************************/ +/*! exports provided: default, base, keyName, shift */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"base\", function() { return base_1; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"keyName\", function() { return keyName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"shift\", function() { return shift_1; });\nvar base = {\n 8: \"Backspace\",\n 9: \"Tab\",\n 10: \"Enter\",\n 12: \"NumLock\",\n 13: \"Enter\",\n 16: \"Shift\",\n 17: \"Control\",\n 18: \"Alt\",\n 20: \"CapsLock\",\n 27: \"Escape\",\n 32: \" \",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"ArrowLeft\",\n 38: \"ArrowUp\",\n 39: \"ArrowRight\",\n 40: \"ArrowDown\",\n 44: \"PrintScreen\",\n 45: \"Insert\",\n 46: \"Delete\",\n 59: \";\",\n 61: \"=\",\n 91: \"Meta\",\n 92: \"Meta\",\n 106: \"*\",\n 107: \"+\",\n 108: \",\",\n 109: \"-\",\n 110: \".\",\n 111: \"/\",\n 144: \"NumLock\",\n 145: \"ScrollLock\",\n 160: \"Shift\",\n 161: \"Shift\",\n 162: \"Control\",\n 163: \"Control\",\n 164: \"Alt\",\n 165: \"Alt\",\n 173: \"-\",\n 186: \";\",\n 187: \"=\",\n 188: \",\",\n 189: \"-\",\n 190: \".\",\n 191: \"/\",\n 192: \"`\",\n 219: \"[\",\n 220: \"\\\\\",\n 221: \"]\",\n 222: \"'\",\n 229: \"q\"\n};\nvar base_1 = base;\n\nvar shift = {\n 48: \")\",\n 49: \"!\",\n 50: \"@\",\n 51: \"#\",\n 52: \"$\",\n 53: \"%\",\n 54: \"^\",\n 55: \"&\",\n 56: \"*\",\n 57: \"(\",\n 59: \";\",\n 61: \"+\",\n 173: \"_\",\n 186: \":\",\n 187: \"+\",\n 188: \"<\",\n 189: \"_\",\n 190: \">\",\n 191: \"?\",\n 192: \"~\",\n 219: \"{\",\n 220: \"|\",\n 221: \"}\",\n 222: \"\\\"\",\n 229: \"Q\"\n};\nvar shift_1 = shift;\n\nvar chrome = typeof navigator != \"undefined\" && /Chrome\\/(\\d+)/.exec(navigator.userAgent);\nvar safari = typeof navigator != \"undefined\" && /Apple Computer/.test(navigator.vendor);\nvar gecko = typeof navigator != \"undefined\" && /Gecko\\/\\d+/.test(navigator.userAgent);\nvar mac = typeof navigator != \"undefined\" && /Mac/.test(navigator.platform);\nvar ie = typeof navigator != \"undefined\" && /MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent);\nvar brokenModifierNames = chrome && (mac || +chrome[1] < 57) || gecko && mac;\n\n// Fill in the digit keys\nfor (var i = 0; i < 10; i++) base[48 + i] = base[96 + i] = String(i);\n\n// The function keys\nfor (var i = 1; i <= 24; i++) base[i + 111] = \"F\" + i;\n\n// And the alphabetic keys\nfor (var i = 65; i <= 90; i++) {\n base[i] = String.fromCharCode(i + 32);\n shift[i] = String.fromCharCode(i);\n}\n\n// For each code that doesn't have a shift-equivalent, copy the base name\nfor (var code in base) if (!shift.hasOwnProperty(code)) shift[code] = base[code];\n\nvar keyName = function(event) {\n // Don't trust event.key in Chrome when there are modifiers until\n // they fix https://bugs.chromium.org/p/chromium/issues/detail?id=633838\n var ignoreKey = brokenModifierNames && (event.ctrlKey || event.altKey || event.metaKey) ||\n (safari || ie) && event.shiftKey && event.key && event.key.length == 1;\n var name = (!ignoreKey && event.key) ||\n (event.shiftKey ? shift : base)[event.keyCode] ||\n event.key || \"Unidentified\";\n // Edge sometimes produces wrong names (Issue #3)\n if (name == \"Esc\") name = \"Escape\";\n if (name == \"Del\") name = \"Delete\";\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/\n if (name == \"Left\") name = \"ArrowLeft\";\n if (name == \"Up\") name = \"ArrowUp\";\n if (name == \"Right\") name = \"ArrowRight\";\n if (name == \"Down\") name = \"ArrowDown\";\n return name\n};\n\nvar w3cKeyname = {\n\tbase: base_1,\n\tshift: shift_1,\n\tkeyName: keyName\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (w3cKeyname);\n\n\n\n//# sourceURL=webpack:///./node_modules/w3c-keyname/index.es.js?"); + +/***/ }), + +/***/ "./node_modules/webpack/buildin/global.js": +/*!***********************************!*\ + !*** (webpack)/buildin/global.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n\n\n//# sourceURL=webpack:///(webpack)/buildin/global.js?"); + +/***/ }), + +/***/ "./node_modules/webpack/buildin/module.js": +/*!***********************************!*\ + !*** (webpack)/buildin/module.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n\n\n//# sourceURL=webpack:///(webpack)/buildin/module.js?"); + +/***/ }), + +/***/ "./prose.js": +/*!******************!*\ + !*** ./prose.js ***! + \******************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var prosemirror_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prosemirror-view */ \"./node_modules/prosemirror-view/dist/index.es.js\");\n/* harmony import */ var prosemirror_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prosemirror-state */ \"./node_modules/prosemirror-state/dist/index.es.js\");\n/* harmony import */ var prosemirror_markdown__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prosemirror-markdown */ \"./node_modules/prosemirror-markdown/dist/index.es.js\");\n/* harmony import */ var prosemirror_example_setup__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prosemirror-example-setup */ \"./node_modules/prosemirror-example-setup/dist/index.es.js\");\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n// class MarkdownView {\n// constructor(target, content) {\n// this.textarea = target.appendChild(document.createElement(\"textarea\"))\n// this.textarea.value = content\n// }\n// get content() { return this.textarea.value }\n// focus() { this.textarea.focus() }\n// destroy() { this.textarea.remove() }\n// }\n\n\n\n\nvar $title = document.querySelector('#title');\nvar $content = document.querySelector('#content');\n\nvar ProseMirrorView = /*#__PURE__*/function () {\n function ProseMirrorView(target, content) {\n _classCallCheck(this, ProseMirrorView);\n\n this.view = new prosemirror_view__WEBPACK_IMPORTED_MODULE_0__[\"EditorView\"](target, {\n state: prosemirror_state__WEBPACK_IMPORTED_MODULE_1__[\"EditorState\"].create({\n doc: function (content) {\n // console.log('loading '+window.draftKey)\n var localDraft = localStorage.getItem(window.draftKey);\n\n if (localDraft != null) {\n content = localDraft;\n }\n\n if (content.indexOf(\"# \") === 0) {\n var eol = content.indexOf(\"\\n\");\n var title = content.substring(\"# \".length, eol);\n content = content.substring(eol + \"\\n\\n\".length);\n $title.value = title;\n }\n\n return prosemirror_markdown__WEBPACK_IMPORTED_MODULE_2__[\"defaultMarkdownParser\"].parse(content);\n }(content),\n plugins: Object(prosemirror_example_setup__WEBPACK_IMPORTED_MODULE_3__[\"exampleSetup\"])({\n schema: prosemirror_markdown__WEBPACK_IMPORTED_MODULE_2__[\"schema\"]\n })\n }),\n dispatchTransaction: function dispatchTransaction(transaction) {\n // console.log('saving to '+window.draftKey)\n $content.value = prosemirror_markdown__WEBPACK_IMPORTED_MODULE_2__[\"defaultMarkdownSerializer\"].serialize(transaction.doc);\n localStorage.setItem(window.draftKey, function () {\n var draft = \"\";\n\n if ($title.value != null && $title.value !== \"\") {\n draft = \"# \" + $title.value + \"\\n\\n\";\n }\n\n draft += $content.value;\n return draft;\n }());\n var newState = this.state.apply(transaction);\n this.updateState(newState);\n }\n });\n }\n\n _createClass(ProseMirrorView, [{\n key: \"focus\",\n value: function focus() {\n this.view.focus();\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.view.destroy();\n }\n }, {\n key: \"content\",\n get: function get() {\n return prosemirror_markdown__WEBPACK_IMPORTED_MODULE_2__[\"defaultMarkdownSerializer\"].serialize(this.view.state.doc);\n }\n }]);\n\n return ProseMirrorView;\n}();\n\nvar place = document.querySelector(\"#editor\");\nvar view = new ProseMirrorView(place, $content.value); // document.querySelectorAll(\"input[type=radio]\").forEach(button => {\n// button.addEventListener(\"change\", () => {\n// if (!button.checked) return\n// let View = button.value == \"markdown\" ? MarkdownView : ProseMirrorView\n// if (view instanceof View) return\n// let content = view.content\n// view.destroy()\n// view = new View(place, content)\n// view.focus()\n// })\n// })\n\n//# sourceURL=webpack:///./prose.js?"); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/templates/wysiwyg.tmpl b/templates/wysiwyg.tmpl index 554609d..235c590 100644 --- a/templates/wysiwyg.tmpl +++ b/templates/wysiwyg.tmpl @@ -70,7 +70,6 @@

- + {{end}}