diff --git a/themes/intotheeast/js/post/post-form.js b/themes/intotheeast/js/post/post-form.js index 796cc75..3d267fc 100644 --- a/themes/intotheeast/js/post/post-form.js +++ b/themes/intotheeast/js/post/post-form.js @@ -1,87 +1,87 @@ -import{a as vs,b as Ye,c as Rc}from"./chunk-ZWRDP37E.js";var ct=Ye((Ko,Xo)=>{(function(a,h){typeof Ko=="object"&&typeof Xo<"u"?Xo.exports=h():typeof define=="function"&&define.amd?define(h):(a=a||self,a.CodeMirror=h())})(Ko,function(){"use strict";var a=navigator.userAgent,h=navigator.platform,c=/gecko\/\d/i.test(a),l=/MSIE \d/.test(a),u=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(a),v=/Edge\/(\d+)/.exec(a),f=l||u||v,p=f&&(l?document.documentMode||6:+(v||u)[1]),y=!v&&/WebKit\//.test(a),w=y&&/Qt\/\d+\.\d+/.test(a),D=!v&&/Chrome\/(\d+)/.exec(a),T=D&&+D[1],M=/Opera\//.test(a),N=/Apple Computer/.test(navigator.vendor),O=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(a),z=/PhantomJS/.test(a),k=N&&(/Mobile\/\w+/.test(a)||navigator.maxTouchPoints>2),L=/Android/.test(a),B=k||L||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(a),I=k||/Mac/.test(h),H=/\bCrOS\b/.test(a),_=/win/i.test(h),X=M&&a.match(/Version\/(\d*\.\d*)/);X&&(X=Number(X[1])),X&&X>=15&&(M=!1,y=!0);var K=I&&(w||M&&(X==null||X<12.11)),ge=c||f&&p>=9;function G(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ue=function(e,t){var i=e.className,r=G(t).exec(i);if(r){var n=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(n?r[1]+n:"")}};function ae(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function de(e,t){return ae(e).appendChild(t)}function E(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return s+(t-o);s+=d-o,s+=i-s%i,o=d+1}}var Je=function(){this.id=null,this.f=null,this.time=0,this.handler=tt(this.onTimeout,this)};Je.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Je.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return r+Math.min(s,t-n);if(n+=o-r,n+=i-n%i,r=o+1,n>=t)return r}}var bt=[""];function Pt(e){for(;bt.length<=e;)bt.push(me(bt)+" ");return bt[e]}function me(e){return e[e.length-1]}function yt(e,t){for(var i=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Su.test(e))}function Fi(e,t){return t?t.source.indexOf("\\w")>-1&&On(e)?!0:t.test(e):On(e)}function fa(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Fu=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Hn(e){return e.charCodeAt(0)>=768&&Fu.test(e)}function ca(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var n=(t+i)/2,o=r<0?Math.ceil(n):Math.floor(n);if(o==t)return e(o)?t:i;e(o)?i=o:t=o+r}}function Eu(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,o=0;ot||t==i&&s.to==t)&&(r(Math.max(s.from,t),Math.min(s.to,i),s.level==1?"rtl":"ltr",o),n=!0)}n||r(t,i,"ltr")}var Gr=null;function Kr(e,t,i){var r;Gr=null;for(var n=0;nt)return n;o.to==t&&(o.from!=o.to&&i=="before"?r=n:Gr=n),o.from==t&&(o.from!=o.to&&i!="before"?r=n:Gr=n)}return r??Gr}var Au=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(m){return m<=247?e.charAt(m):1424<=m&&m<=1524?"R":1536<=m&&m<=1785?t.charAt(m-1536):1774<=m&&m<=2220?"r":8192<=m&&m<=8203?"w":m==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,o=/[LRr]/,s=/[Lb1n]/,d=/[1n]/;function g(m,x,C){this.level=m,this.from=x,this.to=C}return function(m,x){var C=x=="ltr"?"L":"R";if(m.length==0||x=="ltr"&&!r.test(m))return!1;for(var A=m.length,F=[],R=0;R-1&&(r[t]=n.slice(0,o).concat(n.slice(o+1)))}}}function Ie(e,t){var i=Rn(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),n=0;n0}function mr(e){e.prototype.on=function(t,i){oe(this,t,i)},e.prototype.off=function(t,i){ht(this,t,i)}}function it(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function pa(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Pn(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Xr(e){it(e),pa(e)}function _n(e){return e.target||e.srcElement}function ga(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),I&&e.ctrlKey&&t==1&&(t=3),t}var Lu=function(){if(f&&p<9)return!1;var e=E("div");return"draggable"in e||"dragDrop"in e}(),Wn;function Tu(e){if(Wn==null){var t=E("span","\u200B");de(e,E("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Wn=t.offsetWidth<=1&&t.offsetHeight>2&&!(f&&p<8))}var i=Wn?E("span","\u200B"):E("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var qn;function Mu(e){if(qn!=null)return qn;var t=de(e,document.createTextNode("A\u062EA")),i=W(t,0,1).getBoundingClientRect(),r=W(t,1,2).getBoundingClientRect();return ae(e),!i||i.left==i.right?!1:qn=r.right-i.right<3}var Un=` +import{a as ms,b as Ye,c as _c}from"./chunk-ZWRDP37E.js";var ct=Ye((Ko,Xo)=>{(function(a,d){typeof Ko=="object"&&typeof Xo<"u"?Xo.exports=d():typeof define=="function"&&define.amd?define(d):(a=a||self,a.CodeMirror=d())})(Ko,function(){"use strict";var a=navigator.userAgent,d=navigator.platform,c=/gecko\/\d/i.test(a),l=/MSIE \d/.test(a),u=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(a),g=/Edge\/(\d+)/.exec(a),f=l||u||g,p=f&&(l?document.documentMode||6:+(g||u)[1]),y=!g&&/WebKit\//.test(a),w=y&&/Qt\/\d+\.\d+/.test(a),D=!g&&/Chrome\/(\d+)/.exec(a),T=D&&+D[1],M=/Opera\//.test(a),N=/Apple Computer/.test(navigator.vendor),z=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(a),O=/PhantomJS/.test(a),k=N&&(/Mobile\/\w+/.test(a)||navigator.maxTouchPoints>2),L=/Android/.test(a),B=k||L||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(a),I=k||/Mac/.test(d),H=/\bCrOS\b/.test(a),P=/win/i.test(d),X=M&&a.match(/Version\/(\d*\.\d*)/);X&&(X=Number(X[1])),X&&X>=15&&(M=!1,y=!0);var K=I&&(w||M&&(X==null||X<12.11)),ge=c||f&&p>=9;function G(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ue=function(e,t){var i=e.className,r=G(t).exec(i);if(r){var n=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(n?r[1]+n:"")}};function ae(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function de(e,t){return ae(e).appendChild(t)}function E(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return s+(t-o);s+=h-o,s+=i-s%i,o=h+1}}var Je=function(){this.id=null,this.f=null,this.time=0,this.handler=tt(this.onTimeout,this)};Je.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Je.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return r+Math.min(s,t-n);if(n+=o-r,n+=i-n%i,r=o+1,n>=t)return r}}var bt=[""];function _t(e){for(;bt.length<=e;)bt.push(me(bt)+" ");return bt[e]}function me(e){return e[e.length-1]}function yt(e,t){for(var i=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Fu.test(e))}function Fi(e,t){return t?t.source.indexOf("\\w")>-1&&zn(e)?!0:t.test(e):zn(e)}function ca(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Eu=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Hn(e){return e.charCodeAt(0)>=768&&Eu.test(e)}function da(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var n=(t+i)/2,o=r<0?Math.ceil(n):Math.floor(n);if(o==t)return e(o)?t:i;e(o)?i=o:t=o+r}}function Au(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,o=0;ot||t==i&&s.to==t)&&(r(Math.max(s.from,t),Math.min(s.to,i),s.level==1?"rtl":"ltr",o),n=!0)}n||r(t,i,"ltr")}var Gr=null;function Kr(e,t,i){var r;Gr=null;for(var n=0;nt)return n;o.to==t&&(o.from!=o.to&&i=="before"?r=n:Gr=n),o.from==t&&(o.from!=o.to&&i!="before"?r=n:Gr=n)}return r??Gr}var Lu=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(m){return m<=247?e.charAt(m):1424<=m&&m<=1524?"R":1536<=m&&m<=1785?t.charAt(m-1536):1774<=m&&m<=2220?"r":8192<=m&&m<=8203?"w":m==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,o=/[LRr]/,s=/[Lb1n]/,h=/[1n]/;function v(m,x,C){this.level=m,this.from=x,this.to=C}return function(m,x){var C=x=="ltr"?"L":"R";if(m.length==0||x=="ltr"&&!r.test(m))return!1;for(var A=m.length,F=[],R=0;R-1&&(r[t]=n.slice(0,o).concat(n.slice(o+1)))}}}function Ie(e,t){var i=Rn(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),n=0;n0}function mr(e){e.prototype.on=function(t,i){oe(this,t,i)},e.prototype.off=function(t,i){ht(this,t,i)}}function it(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ga(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function _n(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Xr(e){it(e),ga(e)}function Pn(e){return e.target||e.srcElement}function va(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),I&&e.ctrlKey&&t==1&&(t=3),t}var Tu=function(){if(f&&p<9)return!1;var e=E("div");return"draggable"in e||"dragDrop"in e}(),Wn;function Mu(e){if(Wn==null){var t=E("span","\u200B");de(e,E("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Wn=t.offsetWidth<=1&&t.offsetHeight>2&&!(f&&p<8))}var i=Wn?E("span","\u200B"):E("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var qn;function Bu(e){if(qn!=null)return qn;var t=de(e,document.createTextNode("A\u062EA")),i=W(t,0,1).getBoundingClientRect(),r=W(t,1,2).getBoundingClientRect();return ae(e),!i||i.left==i.right?!1:qn=r.right-i.right<3}var Un=` b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf(` -`,t);n==-1&&(n=e.length);var o=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),s=o.indexOf("\r");s!=-1?(i.push(o.slice(0,s)),t+=s+1):(i.push(o),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Bu=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Nu=function(){var e=E("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),jn=null;function Iu(e){if(jn!=null)return jn;var t=de(e,E("span","x")),i=t.getBoundingClientRect(),r=W(t,0,1).getBoundingClientRect();return jn=Math.abs(i.left-r.left)>1}var Gn={},br={};function zu(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Gn[e]=t}function Ou(e,t){br[e]=t}function Ei(e){if(typeof e=="string"&&br.hasOwnProperty(e))e=br[e];else if(e&&typeof e.name=="string"&&br.hasOwnProperty(e.name)){var t=br[e.name];typeof t=="string"&&(t={name:t}),e=ua(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ei("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ei("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Kn(e,t){t=Ei(t);var i=Gn[t.name];if(!i)return Kn(e,"text/plain");var r=i(e,t);if(yr.hasOwnProperty(t.name)){var n=yr[t.name];for(var o in n)n.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=n[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)r[s]=t.modeProps[s];return r}var yr={};function Hu(e,t){var i=yr.hasOwnProperty(e)?yr[e]:yr[e]={};dt(t,i)}function Vt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function Xn(e,t){for(var i;e.innerMode&&(i=e.innerMode(t),!(!i||i.mode==e));)t=i.state,e=i.mode;return i||{mode:e,state:t}}function va(e,t,i){return e.startState?e.startState(t,i):!0}var ze=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};ze.prototype.eol=function(){return this.pos>=this.string.length},ze.prototype.sol=function(){return this.pos==this.lineStart},ze.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ze.prototype.next=function(){if(this.post},ze.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ze.prototype.skipToEnd=function(){this.pos=this.string.length},ze.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ze.prototype.backUp=function(e){this.pos-=e},ze.prototype.column=function(){return this.lastColumnPos0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},ze.prototype.current=function(){return this.string.slice(this.start,this.pos)},ze.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ze.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ze.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function re(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],o=n.chunkSize();if(t=e.first&&ti?q(i,re(e,i).text.length):Ru(t,re(e,t.line).text.length)}function Ru(e,t){var i=e.ch;return i==null||i>t?q(e.line,t):i<0?q(e.line,0):e}function ba(e,t){for(var i=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},Et.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Et.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Et.fromSaved=function(e,t,i){return t instanceof Ti?new Et(e,Vt(e.mode,t.state),i,t.lookAhead):new Et(e,Vt(e.mode,t),i)},Et.prototype.save=function(e){var t=e!==!1?Vt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ti(t,this.maxLookAhead):t};function ya(e,t,i,r){var n=[e.state.modeGen],o={};Sa(e,t.text,e.doc.mode,i,function(m,x){return n.push(m,x)},o,r);for(var s=i.state,d=function(m){i.baseTokens=n;var x=e.state.overlays[m],C=1,A=0;i.state=!0,Sa(e,t.text,x.mode,i,function(F,R){for(var P=C;AF&&n.splice(C,1,F,n[C+1],j),C+=2,A=Math.min(F,j)}if(R)if(x.opaque)n.splice(P,C-P,F,"overlay "+R),C=P+2;else for(;Pe.options.maxHighlightLength&&Vt(e.doc.mode,r.state),o=ya(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Zr(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new Et(r,!0,t);var o=Pu(e,t,i),s=o>r.first&&re(r,o-1).stateAfter,d=s?Et.fromSaved(r,s,o):new Et(r,va(r.mode),o);return r.iter(o,t,function(g){$n(e,g.text,d);var m=d.line;g.stateAfter=m==t-1||m%5==0||m>=n.viewFrom&&mt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var Ca=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function wa(e,t,i,r){var n=e.doc,o=n.mode,s;t=ce(n,t);var d=re(n,t.line),g=Zr(e,t.line,i),m=new ze(d.text,e.options.tabSize,g),x;for(r&&(x=[]);(r||m.pose.options.maxHighlightLength?(d=!1,s&&$n(e,t,r,x.pos),x.pos=t.length,C=null):C=ka(Vn(i,x,r.state,A),o),A){var F=A[0].name;F&&(C="m-"+(C?F+" "+C:F))}if(!d||m!=C){for(;gs;--d){if(d<=o.first)return o.first;var g=re(o,d-1),m=g.stateAfter;if(m&&(!i||d+(m instanceof Ti?m.lookAhead:0)<=o.modeFrontier))return d;var x=Re(g.text,null,e.options.tabSize);(n==null||r>x)&&(n=d-1,r=x)}return n}function _u(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontieri;r--){var n=re(e,r).stateAfter;if(n&&(!(n instanceof Ti)||r+n.lookAhead=t:o.to>t);(r||(r=[])).push(new Mi(s,o.from,g?null:o.to))}}return r}function Ku(e,t,i){var r;if(e)for(var n=0;n=t:o.to>t);if(d||o.from==t&&s.type=="bookmark"&&(!i||o.marker.insertLeft)){var g=o.from==null||(s.inclusiveLeft?o.from<=t:o.from0&&d)for(var $=0;$0)){var x=[g,1],C=fe(m.from,d.from),A=fe(m.to,d.to);(C<0||!s.inclusiveLeft&&!C)&&x.push({from:m.from,to:d.from}),(A>0||!s.inclusiveRight&&!A)&&x.push({from:d.to,to:m.to}),n.splice.apply(n,x),g+=x.length-3}}return n}function Aa(e){var t=e.markedSpans;if(t){for(var i=0;it)&&(!r||to(r,o.marker)<0)&&(r=o.marker)}return r}function Ba(e,t,i,r,n){var o=re(e,t),s=Bt&&o.markedSpans;if(s)for(var d=0;d=0&&C<=0||x<=0&&C>=0)&&(x<=0&&(g.marker.inclusiveRight&&n.inclusiveLeft?fe(m.to,i)>=0:fe(m.to,i)>0)||x>=0&&(g.marker.inclusiveRight&&n.inclusiveLeft?fe(m.from,r)<=0:fe(m.from,r)<0)))return!0}}}function xt(e){for(var t;t=Ma(e);)e=t.find(-1,!0).line;return e}function Zu(e){for(var t;t=Ii(e);)e=t.find(1,!0).line;return e}function Qu(e){for(var t,i;t=Ii(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function ro(e,t){var i=re(e,t),r=xt(i);return i==r?t:xe(r)}function Na(e,t){if(t>e.lastLine())return t;var i=re(e,t),r;if(!Wt(e,i))return t;for(;r=Ii(i);)i=r.find(1,!0).line;return xe(i)+1}function Wt(e,t){var i=Bt&&t.markedSpans;if(i){for(var r=void 0,n=0;nt.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)})}var xr=function(e,t,i){this.text=e,La(this,t),this.height=i?i(this):1};xr.prototype.lineNo=function(){return xe(this)},mr(xr);function Ju(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Aa(e),La(e,i);var n=r?r(e):1;n!=e.height&&Ft(e,n)}function $u(e){e.parent=null,Aa(e)}var Vu={},ef={};function Ia(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?ef:Vu;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function za(e,t){var i=U("span",null,null,y?"padding-right: .1px":null),r={pre:U("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var o=n?t.rest[n-1]:t.line,s=void 0;r.pos=0,r.addToken=rf,Mu(e.display.measure)&&(s=Mt(o,e.doc.direction))&&(r.addToken=of(r.addToken,s)),r.map=[];var d=t!=e.display.externalMeasured&&xe(o);af(o,r,xa(e,o,d)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=vt(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=vt(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Tu(e.display.measure))),n==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(y){var g=r.content.lastChild;(/\bcm-tab\b/.test(g.className)||g.querySelector&&g.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ie(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=vt(r.pre.className,r.textClass||"")),r}function tf(e){var t=E("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function rf(e,t,i,r,n,o,s){if(t){var d=e.splitSpaces?nf(t,e.trailingSpace):t,g=e.cm.state.specialChars,m=!1,x;if(!g.test(t))e.col+=t.length,x=document.createTextNode(d),e.map.push(e.pos,e.pos+t.length,x),f&&p<9&&(m=!0),e.pos+=t.length;else{x=document.createDocumentFragment();for(var C=0;;){g.lastIndex=C;var A=g.exec(t),F=A?A.index-C:t.length-C;if(F){var R=document.createTextNode(d.slice(C,C+F));f&&p<9?x.appendChild(E("span",[R])):x.appendChild(R),e.map.push(e.pos,e.pos+F,R),e.col+=F,e.pos+=F}if(!A)break;C+=F+1;var P=void 0;if(A[0]==" "){var j=e.cm.options.tabSize,Y=j-e.col%j;P=x.appendChild(E("span",Pt(Y),"cm-tab")),P.setAttribute("role","presentation"),P.setAttribute("cm-text"," "),e.col+=Y}else A[0]=="\r"||A[0]==` -`?(P=x.appendChild(E("span",A[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),P.setAttribute("cm-text",A[0]),e.col+=1):(P=e.cm.options.specialCharPlaceholder(A[0]),P.setAttribute("cm-text",A[0]),f&&p<9?x.appendChild(E("span",[P])):x.appendChild(P),e.col+=1);e.map.push(e.pos,e.pos+1,P),e.pos++}}if(e.trailingSpace=d.charCodeAt(t.length-1)==32,i||r||n||m||o||s){var Q=i||"";r&&(Q+=r),n&&(Q+=n);var Z=E("span",[x],Q,o);if(s)for(var $ in s)s.hasOwnProperty($)&&$!="style"&&$!="class"&&Z.setAttribute($,s[$]);return e.content.appendChild(Z)}e.content.appendChild(x)}}function nf(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;nm&&C.from<=m));A++);if(C.to>=x)return e(i,r,n,o,s,d,g);e(i,r.slice(0,C.to-m),n,o,null,d,g),o=null,r=r.slice(C.to-m),m=C.to}}}function Oa(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function af(e,t,i){var r=e.markedSpans,n=e.text,o=0;if(!r){for(var s=1;sg||pe.collapsed&&ie.to==g&&ie.from==g)){if(ie.to!=null&&ie.to!=g&&F>ie.to&&(F=ie.to,P=""),pe.className&&(R+=" "+pe.className),pe.css&&(A=(A?A+";":"")+pe.css),pe.startStyle&&ie.from==g&&(j+=" "+pe.startStyle),pe.endStyle&&ie.to==F&&($||($=[])).push(pe.endStyle,ie.to),pe.title&&((Q||(Q={})).title=pe.title),pe.attributes)for(var Ce in pe.attributes)(Q||(Q={}))[Ce]=pe.attributes[Ce];pe.collapsed&&(!Y||to(Y.marker,pe)<0)&&(Y=ie)}else ie.from>g&&F>ie.from&&(F=ie.from)}if($)for(var Ge=0;Ge<$.length;Ge+=2)$[Ge+1]==F&&(P+=" "+$[Ge]);if(!Y||Y.from==g)for(var Le=0;Le=d)break;for(var ft=Math.min(d,F);;){if(x){var at=g+x.length;if(!Y){var Oe=at>ft?x.slice(0,ft-g):x;t.addToken(t,Oe,C?C+R:R,j,g+Oe.length==F?P:"",A,Q)}if(at>=ft){x=x.slice(ft-g),g=ft;break}g=at,j=""}x=n.slice(o,o=i[m++]),C=Ia(i[m++],t.cm.options)}}}function Ha(e,t,i){this.line=t,this.rest=Qu(t),this.size=this.rest?xe(me(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Wt(e,t)}function Oi(e,t,i){for(var r=[],n,o=t;o2&&o.push((g.bottom+m.top)/2-i.top)}}o.push(i.bottom-i.top)}}function ja(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;ri)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}}function mf(e,t){t=xt(t);var i=xe(t),r=e.display.externalMeasured=new Ha(e.doc,t,i);r.lineN=i;var n=r.built=za(e,r);return r.text=n.pre,de(e.display.lineMeasure,n.pre),r}function Ga(e,t,i,r){return Lt(e,Cr(e,t),i,r)}function so(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(o=g-d,n=o-1,t>=g&&(s="right")),n!=null){if(r=e[m+2],d==g&&i==(r.insertLeft?"left":"right")&&(s=i),i=="left"&&n==0)for(;m&&e[m-2]==e[m-3]&&e[m-1].insertLeft;)r=e[(m-=3)+2],s="left";if(i=="right"&&n==g-d)for(;m=0&&(i=e[n]).left==i.right;n--);return i}function yf(e,t,i,r){var n=Xa(t.map,i,r),o=n.node,s=n.start,d=n.end,g=n.collapse,m;if(o.nodeType==3){for(var x=0;x<4;x++){for(;s&&Hn(t.line.text.charAt(n.coverStart+s));)--s;for(;n.coverStart+d0&&(g=r="right");var C;e.options.lineWrapping&&(C=o.getClientRects()).length>1?m=C[r=="right"?C.length-1:0]:m=o.getBoundingClientRect()}if(f&&p<9&&!s&&(!m||!m.left&&!m.right)){var A=o.parentNode.getClientRects()[0];A?m={left:A.left,right:A.left+kr(e.display),top:A.top,bottom:A.bottom}:m=Ka}for(var F=m.top-t.rect.top,R=m.bottom-t.rect.top,P=(F+R)/2,j=t.view.measure.heights,Y=0;Y=r.text.length?(g=r.text.length,m="before"):g<=0&&(g=0,m="after"),!d)return s(m=="before"?g-1:g,m=="before");function x(R,P,j){var Y=d[P],Q=Y.level==1;return s(j?R-1:R,Q!=j)}var C=Kr(d,g,m),A=Gr,F=x(g,C,m=="before");return A!=null&&(F.other=x(g,A,m!="before")),F}function Va(e,t){var i=0;t=ce(e.doc,t),e.options.lineWrapping||(i=kr(e.display)*t.ch);var r=re(e.doc,t.line),n=Nt(r)+Hi(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function fo(e,t,i,r,n){var o=q(e,t,i);return o.xRel=n,r&&(o.outside=r),o}function co(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return fo(r.first,0,null,-1,-1);var n=tr(r,i),o=r.first+r.size-1;if(n>o)return fo(r.first+r.size-1,re(r,o).text.length,null,1,1);t<0&&(t=0);for(var s=re(r,n);;){var d=Df(e,s,n,t,i),g=Yu(s,d.ch+(d.xRel>0||d.outside>0?1:0));if(!g)return d;var m=g.find(1);if(m.line==n)return m;s=re(r,n=m.line)}}function el(e,t,i,r){r-=uo(t);var n=t.text.length,o=jr(function(s){return Lt(e,i,s-1).bottom<=r},n,0);return n=jr(function(s){return Lt(e,i,s).top>r},o,n),{begin:o,end:n}}function tl(e,t,i,r){i||(i=Cr(e,t));var n=Ri(e,t,Lt(e,i,r),"line").top;return el(e,t,i,n)}function ho(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Df(e,t,i,r,n){n-=Nt(t);var o=Cr(e,t),s=uo(t),d=0,g=t.text.length,m=!0,x=Mt(t,e.doc.direction);if(x){var C=(e.options.lineWrapping?wf:Cf)(e,t,i,o,x,r,n);m=C.level!=1,d=m?C.from:C.to-1,g=m?C.to:C.from-1}var A=null,F=null,R=jr(function(ne){var ie=Lt(e,o,ne);return ie.top+=s,ie.bottom+=s,ho(ie,r,n,!1)?(ie.top<=n&&ie.left<=r&&(A=ne,F=ie),!0):!1},d,g),P,j,Y=!1;if(F){var Q=r-F.left=$.bottom?1:0}return R=ca(t.text,R,1),fo(i,R,j,Y,r-P)}function Cf(e,t,i,r,n,o,s){var d=jr(function(C){var A=n[C],F=A.level!=1;return ho(Dt(e,q(i,F?A.to:A.from,F?"before":"after"),"line",t,r),o,s,!0)},0,n.length-1),g=n[d];if(d>0){var m=g.level!=1,x=Dt(e,q(i,m?g.from:g.to,m?"after":"before"),"line",t,r);ho(x,o,s,!0)&&x.top>s&&(g=n[d-1])}return g}function wf(e,t,i,r,n,o,s){var d=el(e,t,r,s),g=d.begin,m=d.end;/\s/.test(t.text.charAt(m-1))&&m--;for(var x=null,C=null,A=0;A=m||F.to<=g)){var R=F.level!=1,P=Lt(e,r,R?Math.min(m,F.to)-1:Math.max(g,F.from)).right,j=Pj)&&(x=F,C=j)}}return x||(x=n[n.length-1]),x.fromm&&(x={from:x.from,to:m,level:x.level}),x}var ir;function wr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ir==null){ir=E("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ir.appendChild(document.createTextNode("x")),ir.appendChild(E("br"));ir.appendChild(document.createTextNode("x"))}de(e.measure,ir);var i=ir.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),ae(e.measure),i||1}function kr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=E("span","xxxxxxxxxx"),i=E("pre",[t],"CodeMirror-line-like");de(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function po(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var d=e.display.gutterSpecs[s].className;i[d]=o.offsetLeft+o.clientLeft+n,r[d]=o.clientWidth}return{fixedPos:go(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function go(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function rl(e){var t=wr(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/kr(e.display)-3);return function(n){if(Wt(e.doc,n))return 0;var o=0;if(n.widgets)for(var s=0;s0&&(m=re(e.doc,g.line).text).length==g.ch){var x=Re(m,m.length,e.options.tabSize)-m.length;g=q(g.line,Math.max(0,Math.round((o-Ua(e.display).left)/kr(e.display))-x))}return g}function or(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var i=e.display.view,r=0;rt)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)Bt&&ro(e.doc,t)n.viewFrom?Ut(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)Ut(e);else if(t<=n.viewFrom){var o=_i(e,i,i+r,1);o?(n.view=n.view.slice(o.index),n.viewFrom=o.lineN,n.viewTo+=r):Ut(e)}else if(i>=n.viewTo){var s=_i(e,t,t,-1);s?(n.view=n.view.slice(0,s.index),n.viewTo=s.lineN):Ut(e)}else{var d=_i(e,t,t,-1),g=_i(e,i,i+r,1);d&&g?(n.view=n.view.slice(0,d.index).concat(Oi(e,d.lineN,g.lineN)).concat(n.view.slice(g.index)),n.viewTo+=r):Ut(e)}var m=n.externalMeasured;m&&(i=n.lineN&&t=r.viewTo)){var o=r.view[or(e,t)];if(o.node!=null){var s=o.changes||(o.changes=[]);Fe(s,i)==-1&&s.push(i)}}}function Ut(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function _i(e,t,i,r){var n=or(e,t),o,s=e.display.view;if(!Bt||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var d=e.display.viewFrom,g=0;g0){if(n==s.length-1)return null;o=d+s[n].size-t,n++}else o=d-t;t+=o,i+=o}for(;ro(e.doc,i)!=i;){if(n==(r<0?0:s.length-1))return null;i+=r*s[n-(r<0?1:0)].size,n+=r}return{index:n,lineN:i}}function kf(e,t,i){var r=e.display,n=r.view;n.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=Oi(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=Oi(e,t,r.viewFrom).concat(r.view):r.viewFromi&&(r.view=r.view.slice(0,or(e,i)))),r.viewTo=i}function il(e){for(var t=e.display.view,i=0,r=0;r=e.display.viewTo||g.to().line0?s:e.defaultCharWidth())+"px"}if(r.other){var d=i.appendChild(E("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));d.style.display="",d.style.left=r.other.left+"px",d.style.top=r.other.top+"px",d.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Wi(e,t){return e.top-t.top||e.left-t.left}function Sf(e,t,i){var r=e.display,n=e.doc,o=document.createDocumentFragment(),s=Ua(e.display),d=s.left,g=Math.max(r.sizerWidth,rr(e)-r.sizer.offsetLeft)-s.right,m=n.direction=="ltr";function x(Z,$,ne,ie){$<0&&($=0),$=Math.round($),ie=Math.round(ie),o.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+Z+`px; - top: `+$+"px; width: "+(ne??g-Z)+`px; - height: `+(ie-$)+"px"))}function C(Z,$,ne){var ie=re(n,Z),pe=ie.text.length,Ce,Ge;function Le(Oe,lt){return Pi(e,q(Z,Oe),"div",ie,lt)}function ft(Oe,lt,Xe){var _e=tl(e,ie,null,Oe),He=lt=="ltr"==(Xe=="after")?"left":"right",Be=Xe=="after"?_e.begin:_e.end-(/\s/.test(ie.text.charAt(_e.end-1))?2:1);return Le(Be,He)[He]}var at=Mt(ie,n.direction);return Eu(at,$||0,ne??pe,function(Oe,lt,Xe,_e){var He=Xe=="ltr",Be=Le(Oe,He?"left":"right"),st=Le(lt-1,He?"right":"left"),Hr=$==null&&Oe==0,Zt=ne==null&<==pe,Qe=_e==0,Tt=!at||_e==at.length-1;if(st.top-Be.top<=3){var Ke=(m?Hr:Zt)&&Qe,jo=(m?Zt:Hr)&&Tt,Ht=Ke?d:(He?Be:st).left,fr=jo?g:(He?st:Be).right;x(Ht,Be.top,fr-Ht,Be.bottom)}else{var cr,Ve,Rr,Go;He?(cr=m&&Hr&&Qe?d:Be.left,Ve=m?g:ft(Oe,Xe,"before"),Rr=m?d:ft(lt,Xe,"after"),Go=m&&Zt&&Tt?g:st.right):(cr=m?ft(Oe,Xe,"before"):d,Ve=!m&&Hr&&Qe?g:Be.right,Rr=!m&&Zt&&Tt?d:st.left,Go=m?ft(lt,Xe,"after"):g),x(cr,Be.top,Ve-cr,Be.bottom),Be.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Sr(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function ol(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||xo(e))}function yo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Sr(e))},100)}function xo(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ie(e,"focus",e,t),e.state.focused=!0,Te(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),y&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),bo(e))}function Sr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ie(e,"blur",e,t),e.state.focused=!1,ue(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function qi(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),n=t.lineDiv.getBoundingClientRect().top,o=0,s=0;s.005||F<-.005)&&(ne.display.sizerWidth){var P=Math.ceil(x/kr(e.display));P>e.display.maxLineLength&&(e.display.maxLineLength=P,e.display.maxLine=d.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function al(e){if(e.widgets)for(var t=0;t=s&&(o=tr(t,Nt(re(t,g))-e.wrapper.clientHeight),s=g)}return{from:o,to:Math.max(s,o+1)}}function Ff(e,t){if(!We(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),n=null,o=i.wrapper.ownerDocument;if(t.top+r.top<0?n=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(n=!1),n!=null&&!z){var s=E("div","\u200B",null,`position: absolute; +`,t);n==-1&&(n=e.length);var o=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),s=o.indexOf("\r");s!=-1?(i.push(o.slice(0,s)),t+=s+1):(i.push(o),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Nu=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Iu=function(){var e=E("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),jn=null;function Ou(e){if(jn!=null)return jn;var t=de(e,E("span","x")),i=t.getBoundingClientRect(),r=W(t,0,1).getBoundingClientRect();return jn=Math.abs(i.left-r.left)>1}var Gn={},br={};function zu(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Gn[e]=t}function Hu(e,t){br[e]=t}function Ei(e){if(typeof e=="string"&&br.hasOwnProperty(e))e=br[e];else if(e&&typeof e.name=="string"&&br.hasOwnProperty(e.name)){var t=br[e.name];typeof t=="string"&&(t={name:t}),e=fa(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ei("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ei("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Kn(e,t){t=Ei(t);var i=Gn[t.name];if(!i)return Kn(e,"text/plain");var r=i(e,t);if(yr.hasOwnProperty(t.name)){var n=yr[t.name];for(var o in n)n.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=n[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)r[s]=t.modeProps[s];return r}var yr={};function Ru(e,t){var i=yr.hasOwnProperty(e)?yr[e]:yr[e]={};dt(t,i)}function Vt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function Xn(e,t){for(var i;e.innerMode&&(i=e.innerMode(t),!(!i||i.mode==e));)t=i.state,e=i.mode;return i||{mode:e,state:t}}function ma(e,t,i){return e.startState?e.startState(t,i):!0}var Oe=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Oe.prototype.eol=function(){return this.pos>=this.string.length},Oe.prototype.sol=function(){return this.pos==this.lineStart},Oe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Oe.prototype.next=function(){if(this.post},Oe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Oe.prototype.skipToEnd=function(){this.pos=this.string.length},Oe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Oe.prototype.backUp=function(e){this.pos-=e},Oe.prototype.column=function(){return this.lastColumnPos0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Oe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Oe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Oe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Oe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function re(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],o=n.chunkSize();if(t=e.first&&ti?q(i,re(e,i).text.length):_u(t,re(e,t.line).text.length)}function _u(e,t){var i=e.ch;return i==null||i>t?q(e.line,t):i<0?q(e.line,0):e}function ya(e,t){for(var i=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},Et.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Et.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Et.fromSaved=function(e,t,i){return t instanceof Ti?new Et(e,Vt(e.mode,t.state),i,t.lookAhead):new Et(e,Vt(e.mode,t),i)},Et.prototype.save=function(e){var t=e!==!1?Vt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ti(t,this.maxLookAhead):t};function xa(e,t,i,r){var n=[e.state.modeGen],o={};Fa(e,t.text,e.doc.mode,i,function(m,x){return n.push(m,x)},o,r);for(var s=i.state,h=function(m){i.baseTokens=n;var x=e.state.overlays[m],C=1,A=0;i.state=!0,Fa(e,t.text,x.mode,i,function(F,R){for(var _=C;AF&&n.splice(C,1,F,n[C+1],j),C+=2,A=Math.min(F,j)}if(R)if(x.opaque)n.splice(_,C-_,F,"overlay "+R),C=_+2;else for(;_e.options.maxHighlightLength&&Vt(e.doc.mode,r.state),o=xa(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Zr(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new Et(r,!0,t);var o=Pu(e,t,i),s=o>r.first&&re(r,o-1).stateAfter,h=s?Et.fromSaved(r,s,o):new Et(r,ma(r.mode),o);return r.iter(o,t,function(v){$n(e,v.text,h);var m=h.line;v.stateAfter=m==t-1||m%5==0||m>=n.viewFrom&&mt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var wa=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function ka(e,t,i,r){var n=e.doc,o=n.mode,s;t=ce(n,t);var h=re(n,t.line),v=Zr(e,t.line,i),m=new Oe(h.text,e.options.tabSize,v),x;for(r&&(x=[]);(r||m.pose.options.maxHighlightLength?(h=!1,s&&$n(e,t,r,x.pos),x.pos=t.length,C=null):C=Sa(Vn(i,x,r.state,A),o),A){var F=A[0].name;F&&(C="m-"+(C?F+" "+C:F))}if(!h||m!=C){for(;vs;--h){if(h<=o.first)return o.first;var v=re(o,h-1),m=v.stateAfter;if(m&&(!i||h+(m instanceof Ti?m.lookAhead:0)<=o.modeFrontier))return h;var x=Re(v.text,null,e.options.tabSize);(n==null||r>x)&&(n=h-1,r=x)}return n}function Wu(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontieri;r--){var n=re(e,r).stateAfter;if(n&&(!(n instanceof Ti)||r+n.lookAhead=t:o.to>t);(r||(r=[])).push(new Mi(s,o.from,v?null:o.to))}}return r}function Xu(e,t,i){var r;if(e)for(var n=0;n=t:o.to>t);if(h||o.from==t&&s.type=="bookmark"&&(!i||o.marker.insertLeft)){var v=o.from==null||(s.inclusiveLeft?o.from<=t:o.from0&&h)for(var $=0;$0)){var x=[v,1],C=fe(m.from,h.from),A=fe(m.to,h.to);(C<0||!s.inclusiveLeft&&!C)&&x.push({from:m.from,to:h.from}),(A>0||!s.inclusiveRight&&!A)&&x.push({from:h.to,to:m.to}),n.splice.apply(n,x),v+=x.length-3}}return n}function La(e){var t=e.markedSpans;if(t){for(var i=0;it)&&(!r||to(r,o.marker)<0)&&(r=o.marker)}return r}function Na(e,t,i,r,n){var o=re(e,t),s=Bt&&o.markedSpans;if(s)for(var h=0;h=0&&C<=0||x<=0&&C>=0)&&(x<=0&&(v.marker.inclusiveRight&&n.inclusiveLeft?fe(m.to,i)>=0:fe(m.to,i)>0)||x>=0&&(v.marker.inclusiveRight&&n.inclusiveLeft?fe(m.from,r)<=0:fe(m.from,r)<0)))return!0}}}function xt(e){for(var t;t=Ba(e);)e=t.find(-1,!0).line;return e}function Qu(e){for(var t;t=Ii(e);)e=t.find(1,!0).line;return e}function Ju(e){for(var t,i;t=Ii(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function ro(e,t){var i=re(e,t),r=xt(i);return i==r?t:xe(r)}function Ia(e,t){if(t>e.lastLine())return t;var i=re(e,t),r;if(!Wt(e,i))return t;for(;r=Ii(i);)i=r.find(1,!0).line;return xe(i)+1}function Wt(e,t){var i=Bt&&t.markedSpans;if(i){for(var r=void 0,n=0;nt.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)})}var xr=function(e,t,i){this.text=e,Ta(this,t),this.height=i?i(this):1};xr.prototype.lineNo=function(){return xe(this)},mr(xr);function $u(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),La(e),Ta(e,i);var n=r?r(e):1;n!=e.height&&Ft(e,n)}function Vu(e){e.parent=null,La(e)}var ef={},tf={};function Oa(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?tf:ef;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function za(e,t){var i=U("span",null,null,y?"padding-right: .1px":null),r={pre:U("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var o=n?t.rest[n-1]:t.line,s=void 0;r.pos=0,r.addToken=nf,Bu(e.display.measure)&&(s=Mt(o,e.doc.direction))&&(r.addToken=af(r.addToken,s)),r.map=[];var h=t!=e.display.externalMeasured&&xe(o);lf(o,r,Da(e,o,h)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=vt(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=vt(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Mu(e.display.measure))),n==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(y){var v=r.content.lastChild;(/\bcm-tab\b/.test(v.className)||v.querySelector&&v.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ie(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=vt(r.pre.className,r.textClass||"")),r}function rf(e){var t=E("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function nf(e,t,i,r,n,o,s){if(t){var h=e.splitSpaces?of(t,e.trailingSpace):t,v=e.cm.state.specialChars,m=!1,x;if(!v.test(t))e.col+=t.length,x=document.createTextNode(h),e.map.push(e.pos,e.pos+t.length,x),f&&p<9&&(m=!0),e.pos+=t.length;else{x=document.createDocumentFragment();for(var C=0;;){v.lastIndex=C;var A=v.exec(t),F=A?A.index-C:t.length-C;if(F){var R=document.createTextNode(h.slice(C,C+F));f&&p<9?x.appendChild(E("span",[R])):x.appendChild(R),e.map.push(e.pos,e.pos+F,R),e.col+=F,e.pos+=F}if(!A)break;C+=F+1;var _=void 0;if(A[0]==" "){var j=e.cm.options.tabSize,Y=j-e.col%j;_=x.appendChild(E("span",_t(Y),"cm-tab")),_.setAttribute("role","presentation"),_.setAttribute("cm-text"," "),e.col+=Y}else A[0]=="\r"||A[0]==` +`?(_=x.appendChild(E("span",A[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),_.setAttribute("cm-text",A[0]),e.col+=1):(_=e.cm.options.specialCharPlaceholder(A[0]),_.setAttribute("cm-text",A[0]),f&&p<9?x.appendChild(E("span",[_])):x.appendChild(_),e.col+=1);e.map.push(e.pos,e.pos+1,_),e.pos++}}if(e.trailingSpace=h.charCodeAt(t.length-1)==32,i||r||n||m||o||s){var Q=i||"";r&&(Q+=r),n&&(Q+=n);var Z=E("span",[x],Q,o);if(s)for(var $ in s)s.hasOwnProperty($)&&$!="style"&&$!="class"&&Z.setAttribute($,s[$]);return e.content.appendChild(Z)}e.content.appendChild(x)}}function of(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;nm&&C.from<=m));A++);if(C.to>=x)return e(i,r,n,o,s,h,v);e(i,r.slice(0,C.to-m),n,o,null,h,v),o=null,r=r.slice(C.to-m),m=C.to}}}function Ha(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function lf(e,t,i){var r=e.markedSpans,n=e.text,o=0;if(!r){for(var s=1;sv||pe.collapsed&&ie.to==v&&ie.from==v)){if(ie.to!=null&&ie.to!=v&&F>ie.to&&(F=ie.to,_=""),pe.className&&(R+=" "+pe.className),pe.css&&(A=(A?A+";":"")+pe.css),pe.startStyle&&ie.from==v&&(j+=" "+pe.startStyle),pe.endStyle&&ie.to==F&&($||($=[])).push(pe.endStyle,ie.to),pe.title&&((Q||(Q={})).title=pe.title),pe.attributes)for(var Ce in pe.attributes)(Q||(Q={}))[Ce]=pe.attributes[Ce];pe.collapsed&&(!Y||to(Y.marker,pe)<0)&&(Y=ie)}else ie.from>v&&F>ie.from&&(F=ie.from)}if($)for(var Ge=0;Ge<$.length;Ge+=2)$[Ge+1]==F&&(_+=" "+$[Ge]);if(!Y||Y.from==v)for(var Le=0;Le=h)break;for(var ft=Math.min(h,F);;){if(x){var at=v+x.length;if(!Y){var ze=at>ft?x.slice(0,ft-v):x;t.addToken(t,ze,C?C+R:R,j,v+ze.length==F?_:"",A,Q)}if(at>=ft){x=x.slice(ft-v),v=ft;break}v=at,j=""}x=n.slice(o,o=i[m++]),C=Oa(i[m++],t.cm.options)}}}function Ra(e,t,i){this.line=t,this.rest=Ju(t),this.size=this.rest?xe(me(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Wt(e,t)}function zi(e,t,i){for(var r=[],n,o=t;o2&&o.push((v.bottom+m.top)/2-i.top)}}o.push(i.bottom-i.top)}}function Ga(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;ri)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}}function bf(e,t){t=xt(t);var i=xe(t),r=e.display.externalMeasured=new Ra(e.doc,t,i);r.lineN=i;var n=r.built=za(e,r);return r.text=n.pre,de(e.display.lineMeasure,n.pre),r}function Ka(e,t,i,r){return Lt(e,Cr(e,t),i,r)}function so(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(o=v-h,n=o-1,t>=v&&(s="right")),n!=null){if(r=e[m+2],h==v&&i==(r.insertLeft?"left":"right")&&(s=i),i=="left"&&n==0)for(;m&&e[m-2]==e[m-3]&&e[m-1].insertLeft;)r=e[(m-=3)+2],s="left";if(i=="right"&&n==v-h)for(;m=0&&(i=e[n]).left==i.right;n--);return i}function xf(e,t,i,r){var n=Ya(t.map,i,r),o=n.node,s=n.start,h=n.end,v=n.collapse,m;if(o.nodeType==3){for(var x=0;x<4;x++){for(;s&&Hn(t.line.text.charAt(n.coverStart+s));)--s;for(;n.coverStart+h0&&(v=r="right");var C;e.options.lineWrapping&&(C=o.getClientRects()).length>1?m=C[r=="right"?C.length-1:0]:m=o.getBoundingClientRect()}if(f&&p<9&&!s&&(!m||!m.left&&!m.right)){var A=o.parentNode.getClientRects()[0];A?m={left:A.left,right:A.left+kr(e.display),top:A.top,bottom:A.bottom}:m=Xa}for(var F=m.top-t.rect.top,R=m.bottom-t.rect.top,_=(F+R)/2,j=t.view.measure.heights,Y=0;Y=r.text.length?(v=r.text.length,m="before"):v<=0&&(v=0,m="after"),!h)return s(m=="before"?v-1:v,m=="before");function x(R,_,j){var Y=h[_],Q=Y.level==1;return s(j?R-1:R,Q!=j)}var C=Kr(h,v,m),A=Gr,F=x(v,C,m=="before");return A!=null&&(F.other=x(v,A,m!="before")),F}function el(e,t){var i=0;t=ce(e.doc,t),e.options.lineWrapping||(i=kr(e.display)*t.ch);var r=re(e.doc,t.line),n=Nt(r)+Hi(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function fo(e,t,i,r,n){var o=q(e,t,i);return o.xRel=n,r&&(o.outside=r),o}function co(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return fo(r.first,0,null,-1,-1);var n=tr(r,i),o=r.first+r.size-1;if(n>o)return fo(r.first+r.size-1,re(r,o).text.length,null,1,1);t<0&&(t=0);for(var s=re(r,n);;){var h=Cf(e,s,n,t,i),v=Zu(s,h.ch+(h.xRel>0||h.outside>0?1:0));if(!v)return h;var m=v.find(1);if(m.line==n)return m;s=re(r,n=m.line)}}function tl(e,t,i,r){r-=uo(t);var n=t.text.length,o=jr(function(s){return Lt(e,i,s-1).bottom<=r},n,0);return n=jr(function(s){return Lt(e,i,s).top>r},o,n),{begin:o,end:n}}function rl(e,t,i,r){i||(i=Cr(e,t));var n=Ri(e,t,Lt(e,i,r),"line").top;return tl(e,t,i,n)}function ho(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Cf(e,t,i,r,n){n-=Nt(t);var o=Cr(e,t),s=uo(t),h=0,v=t.text.length,m=!0,x=Mt(t,e.doc.direction);if(x){var C=(e.options.lineWrapping?kf:wf)(e,t,i,o,x,r,n);m=C.level!=1,h=m?C.from:C.to-1,v=m?C.to:C.from-1}var A=null,F=null,R=jr(function(ne){var ie=Lt(e,o,ne);return ie.top+=s,ie.bottom+=s,ho(ie,r,n,!1)?(ie.top<=n&&ie.left<=r&&(A=ne,F=ie),!0):!1},h,v),_,j,Y=!1;if(F){var Q=r-F.left=$.bottom?1:0}return R=da(t.text,R,1),fo(i,R,j,Y,r-_)}function wf(e,t,i,r,n,o,s){var h=jr(function(C){var A=n[C],F=A.level!=1;return ho(Dt(e,q(i,F?A.to:A.from,F?"before":"after"),"line",t,r),o,s,!0)},0,n.length-1),v=n[h];if(h>0){var m=v.level!=1,x=Dt(e,q(i,m?v.from:v.to,m?"after":"before"),"line",t,r);ho(x,o,s,!0)&&x.top>s&&(v=n[h-1])}return v}function kf(e,t,i,r,n,o,s){var h=tl(e,t,r,s),v=h.begin,m=h.end;/\s/.test(t.text.charAt(m-1))&&m--;for(var x=null,C=null,A=0;A=m||F.to<=v)){var R=F.level!=1,_=Lt(e,r,R?Math.min(m,F.to)-1:Math.max(v,F.from)).right,j=_j)&&(x=F,C=j)}}return x||(x=n[n.length-1]),x.fromm&&(x={from:x.from,to:m,level:x.level}),x}var ir;function wr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ir==null){ir=E("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ir.appendChild(document.createTextNode("x")),ir.appendChild(E("br"));ir.appendChild(document.createTextNode("x"))}de(e.measure,ir);var i=ir.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),ae(e.measure),i||1}function kr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=E("span","xxxxxxxxxx"),i=E("pre",[t],"CodeMirror-line-like");de(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function po(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var h=e.display.gutterSpecs[s].className;i[h]=o.offsetLeft+o.clientLeft+n,r[h]=o.clientWidth}return{fixedPos:go(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function go(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function il(e){var t=wr(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/kr(e.display)-3);return function(n){if(Wt(e.doc,n))return 0;var o=0;if(n.widgets)for(var s=0;s0&&(m=re(e.doc,v.line).text).length==v.ch){var x=Re(m,m.length,e.options.tabSize)-m.length;v=q(v.line,Math.max(0,Math.round((o-ja(e.display).left)/kr(e.display))-x))}return v}function or(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var i=e.display.view,r=0;rt)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)Bt&&ro(e.doc,t)n.viewFrom?Ut(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)Ut(e);else if(t<=n.viewFrom){var o=Pi(e,i,i+r,1);o?(n.view=n.view.slice(o.index),n.viewFrom=o.lineN,n.viewTo+=r):Ut(e)}else if(i>=n.viewTo){var s=Pi(e,t,t,-1);s?(n.view=n.view.slice(0,s.index),n.viewTo=s.lineN):Ut(e)}else{var h=Pi(e,t,t,-1),v=Pi(e,i,i+r,1);h&&v?(n.view=n.view.slice(0,h.index).concat(zi(e,h.lineN,v.lineN)).concat(n.view.slice(v.index)),n.viewTo+=r):Ut(e)}var m=n.externalMeasured;m&&(i=n.lineN&&t=r.viewTo)){var o=r.view[or(e,t)];if(o.node!=null){var s=o.changes||(o.changes=[]);Fe(s,i)==-1&&s.push(i)}}}function Ut(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Pi(e,t,i,r){var n=or(e,t),o,s=e.display.view;if(!Bt||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var h=e.display.viewFrom,v=0;v0){if(n==s.length-1)return null;o=h+s[n].size-t,n++}else o=h-t;t+=o,i+=o}for(;ro(e.doc,i)!=i;){if(n==(r<0?0:s.length-1))return null;i+=r*s[n-(r<0?1:0)].size,n+=r}return{index:n,lineN:i}}function Sf(e,t,i){var r=e.display,n=r.view;n.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=zi(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=zi(e,t,r.viewFrom).concat(r.view):r.viewFromi&&(r.view=r.view.slice(0,or(e,i)))),r.viewTo=i}function nl(e){for(var t=e.display.view,i=0,r=0;r=e.display.viewTo||v.to().line0?s:e.defaultCharWidth())+"px"}if(r.other){var h=i.appendChild(E("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));h.style.display="",h.style.left=r.other.left+"px",h.style.top=r.other.top+"px",h.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Wi(e,t){return e.top-t.top||e.left-t.left}function Ff(e,t,i){var r=e.display,n=e.doc,o=document.createDocumentFragment(),s=ja(e.display),h=s.left,v=Math.max(r.sizerWidth,rr(e)-r.sizer.offsetLeft)-s.right,m=n.direction=="ltr";function x(Z,$,ne,ie){$<0&&($=0),$=Math.round($),ie=Math.round(ie),o.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+Z+`px; + top: `+$+"px; width: "+(ne??v-Z)+`px; + height: `+(ie-$)+"px"))}function C(Z,$,ne){var ie=re(n,Z),pe=ie.text.length,Ce,Ge;function Le(ze,lt){return _i(e,q(Z,ze),"div",ie,lt)}function ft(ze,lt,Xe){var Pe=rl(e,ie,null,ze),He=lt=="ltr"==(Xe=="after")?"left":"right",Be=Xe=="after"?Pe.begin:Pe.end-(/\s/.test(ie.text.charAt(Pe.end-1))?2:1);return Le(Be,He)[He]}var at=Mt(ie,n.direction);return Au(at,$||0,ne??pe,function(ze,lt,Xe,Pe){var He=Xe=="ltr",Be=Le(ze,He?"left":"right"),st=Le(lt-1,He?"right":"left"),Hr=$==null&&ze==0,Zt=ne==null&<==pe,Qe=Pe==0,Tt=!at||Pe==at.length-1;if(st.top-Be.top<=3){var Ke=(m?Hr:Zt)&&Qe,jo=(m?Zt:Hr)&&Tt,Ht=Ke?h:(He?Be:st).left,fr=jo?v:(He?st:Be).right;x(Ht,Be.top,fr-Ht,Be.bottom)}else{var cr,Ve,Rr,Go;He?(cr=m&&Hr&&Qe?h:Be.left,Ve=m?v:ft(ze,Xe,"before"),Rr=m?h:ft(lt,Xe,"after"),Go=m&&Zt&&Tt?v:st.right):(cr=m?ft(ze,Xe,"before"):h,Ve=!m&&Hr&&Qe?v:Be.right,Rr=!m&&Zt&&Tt?h:st.left,Go=m?ft(lt,Xe,"after"):v),x(cr,Be.top,Ve-cr,Be.bottom),Be.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Sr(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function al(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||xo(e))}function yo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Sr(e))},100)}function xo(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ie(e,"focus",e,t),e.state.focused=!0,Te(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),y&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),bo(e))}function Sr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ie(e,"blur",e,t),e.state.focused=!1,ue(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function qi(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),n=t.lineDiv.getBoundingClientRect().top,o=0,s=0;s.005||F<-.005)&&(ne.display.sizerWidth){var _=Math.ceil(x/kr(e.display));_>e.display.maxLineLength&&(e.display.maxLineLength=_,e.display.maxLine=h.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function ll(e){if(e.widgets)for(var t=0;t=s&&(o=tr(t,Nt(re(t,v))-e.wrapper.clientHeight),s=v)}return{from:o,to:Math.max(s,o+1)}}function Ef(e,t){if(!We(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),n=null,o=i.wrapper.ownerDocument;if(t.top+r.top<0?n=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(n=!1),n!=null&&!O){var s=E("div","\u200B",null,`position: absolute; top: `+(t.top-i.viewOffset-Hi(e.display))+`px; height: `+(t.bottom-t.top+At(e)+i.barHeight)+`px; - left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(n),e.display.lineSpace.removeChild(s)}}}function Ef(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?q(t.line,t.ch+1,"before"):t,t=t.ch?q(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var s=!1,d=Dt(e,t),g=!i||i==t?d:Dt(e,i);n={left:Math.min(d.left,g.left),top:Math.min(d.top,g.top)-r,right:Math.max(d.left,g.left),bottom:Math.max(d.bottom,g.bottom)+r};var m=Do(e,n),x=e.doc.scrollTop,C=e.doc.scrollLeft;if(m.scrollTop!=null&&(ii(e,m.scrollTop),Math.abs(e.doc.scrollTop-x)>1&&(s=!0)),m.scrollLeft!=null&&(ar(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-C)>1&&(s=!0)),!s)break}return n}function Af(e,t){var i=Do(e,t);i.scrollTop!=null&&ii(e,i.scrollTop),i.scrollLeft!=null&&ar(e,i.scrollLeft)}function Do(e,t){var i=e.display,r=wr(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,o=lo(e),s={};t.bottom-t.top>o&&(t.bottom=t.top+o);var d=e.doc.height+ao(i),g=t.topd-r;if(t.topn+o){var x=Math.min(t.top,(m?d:t.bottom)-o);x!=n&&(s.scrollTop=x)}var C=e.options.fixedGutter?0:i.gutters.offsetWidth,A=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-C,F=rr(e)-i.gutters.offsetWidth,R=t.right-t.left>F;return R&&(t.right=t.left+F),t.left<10?s.scrollLeft=0:t.leftF+A-3&&(s.scrollLeft=t.right+(R?0:10)-F),s}function Co(e,t){t!=null&&(ji(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Fr(e){ji(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ri(e,t,i){(t!=null||i!=null)&&ji(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Lf(e,t){ji(e),e.curOp.scrollToPos=t}function ji(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Va(e,t.from),r=Va(e,t.to);ll(e,i,r,t.margin)}}function ll(e,t,i,r){var n=Do(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});ri(e,n.scrollLeft,n.scrollTop)}function ii(e,t){Math.abs(e.doc.scrollTop-t)<2||(c||ko(e,{top:t}),sl(e,t,!0),c&&ko(e),ai(e,100))}function sl(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function ar(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,hl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function ni(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+ao(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+At(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var lr=function(e,t,i){this.cm=i;var r=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),oe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),oe(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,f&&p<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};lr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},lr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},lr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},lr.prototype.zeroWidthHack=function(){var e=I&&!O?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Je,this.disableVert=new Je},lr.prototype.enableZeroWidthBar=function(e,t,i){e.style.visibility="";function r(){var n=e.getBoundingClientRect(),o=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},lr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var oi=function(){};oi.prototype.update=function(){return{bottom:0,right:0}},oi.prototype.setScrollLeft=function(){},oi.prototype.setScrollTop=function(){},oi.prototype.clear=function(){};function Er(e,t){t||(t=ni(e));var i=e.display.barWidth,r=e.display.barHeight;ul(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&qi(e),ul(e,ni(e)),i=e.display.barWidth,r=e.display.barHeight}function ul(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var fl={native:lr,null:oi};function cl(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ue(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new fl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),oe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?ar(e,t):ii(e,t)},e),e.display.scrollbars.addClass&&Te(e.display.wrapper,e.display.scrollbars.addClass)}var Tf=0;function sr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Tf,markArrays:null},lf(e.curOp)}function ur(e){var t=e.curOp;t&&uf(t,function(i){for(var r=0;r=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Gi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Nf(e){e.updatedDisplay=e.mustUpdate&&wo(e.cm,e.update)}function If(e){var t=e.cm,i=t.display;e.updatedDisplay&&qi(t),e.barMeasure=ni(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ga(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+At(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-rr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function zf(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var i=+new Date+e.options.workTime,r=Zr(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var s=o.styles,d=o.text.length>e.options.maxHighlightLength?Vt(t.mode,r.state):null,g=ya(e,o,r,!0);d&&(r.state=d),o.styles=g.styles;var m=o.styleClasses,x=g.classes;x?o.styleClasses=x:m&&(o.styleClasses=null);for(var C=!s||s.length!=o.styles.length||m!=x&&(!m||!x||m.bgClass!=x.bgClass||m.textClass!=x.textClass),A=0;!C&&Ai)return ai(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&ut(e,function(){for(var o=0;o=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&il(e)==0)return!1;pl(e)&&(Ut(e),t.dims=po(e));var n=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),s=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFroms&&i.viewTo-s<20&&(s=Math.min(n,i.viewTo)),Bt&&(o=ro(e.doc,o),s=Na(e.doc,s));var d=o!=i.viewFrom||s!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;kf(e,o,s),i.viewOffset=Nt(re(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var g=il(e);if(!d&&g==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var m=Pf(e);return g>4&&(i.lineDiv.style.display="none"),Wf(e,i.updateLineNumbers,t.dims),g>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,_f(m),ae(i.cursorDiv),ae(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,d&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,ai(e,400)),i.updateLineNumbers=null,!0}function dl(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==rr(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+ao(e.display)-lo(e),i.top)}),t.visible=Ui(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Ui(e.display,e.doc,i));if(!wo(e,t))break;qi(e);var n=ni(e);ti(e),Er(e,n),Fo(e,n),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ko(e,t){var i=new Gi(e,t);if(wo(e,i)){qi(e),dl(e,i);var r=ni(e);ti(e),Er(e,r),Fo(e,r),i.finish()}}function Wf(e,t,i){var r=e.display,n=e.options.lineNumbers,o=r.lineDiv,s=o.firstChild;function d(R){var P=R.nextSibling;return y&&I&&e.display.currentWheelTarget==R?R.style.display="none":R.parentNode.removeChild(R),P}for(var g=r.view,m=r.viewFrom,x=0;x-1&&(F=!1),Ra(e,C,m,i)),F&&(ae(C.lineNumber),C.lineNumber.appendChild(document.createTextNode(Zn(e.options,m)))),s=C.node.nextSibling}m+=C.size}for(;s;)s=d(s)}function So(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",qe(e,"gutterChanged",e)}function Fo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+At(e)+"px"}function hl(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=go(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,o=r+"px",s=0;sd.clientWidth,m=d.scrollHeight>d.clientHeight;if(r&&g||n&&m){if(n&&I&&y){e:for(var x=t.target,C=s.view;x!=d;x=x.parentNode)for(var A=0;A=0&&fe(e,r.to())<=0)return i}return-1};var ye=function(e,t){this.anchor=e,this.head=t};ye.prototype.from=function(){return Li(this.anchor,this.head)},ye.prototype.to=function(){return Ai(this.anchor,this.head)},ye.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ct(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(A,F){return fe(A.from(),F.from())}),i=Fe(t,n);for(var o=1;o0:g>=0){var m=Li(d.from(),s.from()),x=Ai(d.to(),s.to()),C=d.empty()?s.from()==s.head:d.from()==d.head;o<=i&&--i,t.splice(--o,2,new ye(C?x:m,C?m:x))}}return new pt(t,i)}function jt(e,t){return new pt([new ye(e,t||e)],0)}function Gt(e){return e.text?q(e.from.line+e.text.length-1,me(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function bl(e,t){if(fe(e,t.from)<0)return e;if(fe(e,t.to)<=0)return Gt(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Gt(t).ch-t.to.ch),q(i,r)}function Ao(e,t){for(var i=[],r=0;r1&&e.remove(d.line+1,R-1),e.insert(d.line+1,Y)}qe(e,"change",e,t)}function Kt(e,t,i){function r(n,o,s){if(n.linked)for(var d=0;d1&&!e.done[e.done.length-2].ranges)return e.done.pop(),me(e.done)}function kl(e,t,i,r){var n=e.history;n.undone.length=0;var o=+new Date,s,d;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(s=Kf(n,n.lastOp==r)))d=me(s.changes),fe(t.from,t.to)==0&&fe(t.from,d.to)==0?d.to=Gt(t):s.changes.push(Mo(e,t));else{var g=me(n.done);for((!g||!g.ranges)&&Yi(e.sel,n.done),s={changes:[Mo(e,t)],generation:n.generation},n.done.push(s);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=o,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,d||Ie(e,"historyAdded")}function Xf(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Yf(e,t,i,r){var n=e.history,o=r&&r.origin;i==n.lastSelOp||o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||Xf(e,o,me(n.done),t))?n.done[n.done.length-1]=t:Yi(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=o,n.lastSelOp=i,r&&r.clearRedo!==!1&&wl(n.undone)}function Yi(e,t){var i=me(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Sl(e,t,i,r){var n=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(s){s.markedSpans&&((n||(n=t["spans_"+e.id]={}))[o]=s.markedSpans),++o})}function Zf(e){if(!e)return null;for(var t,i=0;i-1&&(me(d)[C]=m[C],delete m[C])}}return r}function Bo(e,t,i,r){if(r){var n=e.anchor;if(i){var o=fe(t,n)<0;o!=fe(i,n)<0?(n=t,t=i):o!=fe(t,i)<0&&(t=i)}return new ye(n,t)}else return new ye(i||t,t)}function Zi(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),Ze(e,new pt([Bo(e.sel.primary(),t,i,n)],0),r)}function El(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:d.to>t.ch))){if(n&&(Ie(g,"beforeCursorEnter"),g.explicitlyCleared))if(o.markedSpans){--s;continue}else break;if(!g.atomic)continue;if(i){var C=g.find(r<0?1:-1),A=void 0;if((r<0?x:m)&&(C=Nl(e,C,-r,C&&C.line==t.line?o:null)),C&&C.line==t.line&&(A=fe(C,i))&&(r<0?A<0:A>0))return Lr(e,C,t,r,n)}var F=g.find(r<0?-1:1);return(r<0?m:x)&&(F=Nl(e,F,r,F.line==t.line?o:null)),F?Lr(e,F,t,r,n):null}}return t}function Ji(e,t,i,r,n){var o=r||1,s=Lr(e,t,i,o,n)||!n&&Lr(e,t,i,o,!0)||Lr(e,t,i,-o,n)||!n&&Lr(e,t,i,-o,!0);return s||(e.cantEdit=!0,q(e.first,0))}function Nl(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?ce(e,q(t.line-1)):null:i>0&&t.ch==(r||re(e,t.line)).text.length?t.line=0;--n)Ol(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else Ol(e,t)}}function Ol(e,t){if(!(t.text.length==1&&t.text[0]==""&&fe(t.from,t.to)==0)){var i=Ao(e,t);kl(e,t,i,e.cm?e.cm.curOp.id:NaN),ui(e,t,i,eo(e,t));var r=[];Kt(e,function(n,o){!o&&Fe(r,n.history)==-1&&(_l(n.history,t),r.push(n.history)),ui(n,t,null,eo(n,t))})}}function $i(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var n=e.history,o,s=e.sel,d=t=="undo"?n.done:n.undone,g=t=="undo"?n.undone:n.done,m=0;m=0;--F){var R=A(F);if(R)return R.v}}}}function Hl(e,t){if(t!=0&&(e.first+=t,e.sel=new pt(yt(e.sel.ranges,function(n){return new ye(q(n.anchor.line+t,n.anchor.ch),q(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm)){nt(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:q(o,re(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=er(e,t.from,t.to),i||(i=Ao(e,t)),e.cm?$f(e.cm,t,r):To(e,t,r),Qi(e,i,rt),e.cantEdit&&Ji(e,q(e.firstLine(),0))&&(e.cantEdit=!1)}}function $f(e,t,i){var r=e.doc,n=e.display,o=t.from,s=t.to,d=!1,g=o.line;e.options.lineWrapping||(g=xe(xt(re(r,o.line))),r.iter(g,s.line+1,function(F){if(F==n.maxLine)return d=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ha(e),To(r,t,i,rl(e)),e.options.lineWrapping||(r.iter(g,o.line+t.text.length,function(F){var R=zi(F);R>n.maxLineLength&&(n.maxLine=F,n.maxLineLength=R,n.maxLineChanged=!0,d=!1)}),d&&(e.curOp.updateMaxLine=!0)),_u(r,o.line),ai(e,400);var m=t.text.length-(s.line-o.line)-1;t.full?nt(e):o.line==s.line&&t.text.length==1&&!xl(e.doc,t)?qt(e,o.line,"text"):nt(e,o.line,s.line+1,m);var x=mt(e,"changes"),C=mt(e,"change");if(C||x){var A={from:o,to:s,text:t.text,removed:t.removed,origin:t.origin};C&&qe(e,"change",e,A),x&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(A)}e.display.selForContextMenu=null}function Mr(e,t,i,r,n){var o;r||(r=i),fe(r,i)<0&&(o=[r,i],i=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Tr(e,{from:i,to:r,text:t,origin:n})}function Rl(e,t,i,r){i1||!(this.children[0]instanceof ci))){var d=[];this.collapse(d),this.children=[new ci(d)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var s=n.lines.length%25+25,d=s;d10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=m,e.display.maxLineLength=x,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&nt(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ml(e.doc)),e&&qe(e,"markerCleared",e,this,r,n),t&&ur(e),this.parent&&this.parent.clear()}},Xt.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n0||s==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=U("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Ba(e,t.line,t,i,o)||t.line!=i.line&&Ba(e,i.line,t,i,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");qu()}o.addToHistory&&kl(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var d=t.line,g=e.cm,m;if(e.iter(d,i.line+1,function(C){g&&o.collapsed&&!g.options.lineWrapping&&xt(C)==g.display.maxLine&&(m=!0),o.collapsed&&d!=t.line&&Ft(C,0),ju(C,new Mi(o,d==t.line?t.ch:null,d==i.line?i.ch:null),e.cm&&e.cm.curOp),++d}),o.collapsed&&e.iter(t.line,i.line+1,function(C){Wt(e,C)&&Ft(C,0)}),o.clearOnEnter&&oe(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Wu(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ql,o.atomic=!0),g){if(m&&(g.curOp.updateMaxLine=!0),o.collapsed)nt(g,t.line,i.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var x=t.line;x<=i.line;x++)qt(g,x,"text");o.atomic&&Ml(g.doc),qe(g,"markerAdded",g,o)}return o}var pi=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;g--)Tr(this,r[g]);d?Ll(this,d):this.cm&&Fr(this.cm)}),undo:je(function(){$i(this,"undo")}),redo:je(function(){$i(this,"redo")}),undoSelection:je(function(){$i(this,"undo",!0)}),redoSelection:je(function(){$i(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=ce(this,e),t=ce(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(o){var s=o.markedSpans;if(s)for(var d=0;d=g.to||g.from==null&&n!=e.line||g.from!=null&&n==t.line&&g.from>=t.ch)&&(!i||i(g.marker))&&r.push(g.marker.parent||g.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;re)return t=e,!0;e-=o,++i}),ce(this,q(i,t))},indexFromPos:function(e){e=ce(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var x=e.dataTransfer.getData("Text");if(x){var C;if(t.state.draggingText&&!t.state.draggingText.copy&&(C=t.listSelections()),Qi(t.doc,jt(i,i)),C)for(var A=0;A=0;d--)Mr(e.doc,"",r[d].from,r[d].to,"+delete");Fr(e)})}function Io(e,t,i){var r=ca(e.text,t+i,i);return r<0||r>e.text.length?null:r}function zo(e,t,i){var r=Io(e,t.ch,i);return r==null?null:new q(t.line,r,i<0?"after":"before")}function Oo(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var o=Mt(i,t.doc.direction);if(o){var s=n<0?me(o):o[0],d=n<0==(s.level==1),g=d?"after":"before",m;if(s.level>0||t.doc.direction=="rtl"){var x=Cr(t,i);m=n<0?i.text.length-1:0;var C=Lt(t,x,m).top;m=jr(function(A){return Lt(t,x,A).top==C},n<0==(s.level==1)?s.from:s.to-1,m),g=="before"&&(m=Io(i,m,1))}else m=n<0?s.to:s.from;return new q(r,m,g)}}return new q(r,n<0?i.text.length:0,n<0?"before":"after")}function dc(e,t,i,r){var n=Mt(t,e.doc.direction);if(!n)return zo(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var o=Kr(n,i.ch,i.sticky),s=n[o];if(e.doc.direction=="ltr"&&s.level%2==0&&(r>0?s.to>i.ch:s.from=s.from&&A>=x.begin)){var F=C?"before":"after";return new q(i.line,A,F)}}var R=function(Y,Q,Z){for(var $=function(Ce,Ge){return Ge?new q(i.line,d(Ce,1),"before"):new q(i.line,Ce,"after")};Y>=0&&Y0==(ne.level!=1),pe=ie?Z.begin:d(Z.end,-1);if(ne.from<=pe&&pe0?x.end:d(x.begin,-1);return j!=null&&!(r>0&&j==t.text.length)&&(P=R(r>0?0:n.length-1,r,m(j)),P)?P:null}var mi={selectAll:Il,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),rt)},killLine:function(e){return Ir(e,function(t){if(t.empty()){var i=re(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)n=new q(n.line,n.ch+1),e.replaceRange(o.charAt(n.ch-1)+o.charAt(n.ch-2),q(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var s=re(e.doc,n.line-1).text;s&&(n=new q(n.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),q(n.line-1,s.length-1),n,"+transpose"))}}i.push(new ye(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return ut(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;re&&fe(t,this.pos)==0&&i==this.button};var yi,xi;function yc(e,t){var i=+new Date;return xi&&xi.compare(i,e,t)?(yi=xi=null,"triple"):yi&&yi.compare(i,e,t)?(xi=new Ro(i,e,t),yi=null,"double"):(yi=new Ro(i,e,t),xi=null,"single")}function ns(e){var t=this,i=t.display;if(!(We(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,It(i,e)){y||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!Po(t,e)){var r=nr(t,e),n=ga(e),o=r?yc(r,n):"single";he(t).focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&xc(t,n,r,o,e))&&(n==1?r?Cc(t,r,o,e):_n(e)==i.scroller&&it(e):n==2?(r&&Zi(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(ge?t.display.input.onContextMenu(e):yo(t)))}}}function xc(e,t,i,r,n){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,bi(e,Zl(o,n),n,function(s){if(typeof s=="string"&&(s=mi[s]),!s)return!1;var d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),d=s(e,i)!=Pe}finally{e.state.suppressEdits=!1}return d})}function Dc(e,t,i){var r=e.getOption("configureMouse"),n=r?r(e,t,i):{};if(n.unit==null){var o=H?i.shiftKey&&i.metaKey:i.altKey;n.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),n.addNew==null&&(n.addNew=I?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(I?i.altKey:i.ctrlKey)),n}function Cc(e,t,i,r){f?setTimeout(tt(ol,e),0):e.curOp.focus=ve(ee(e));var n=Dc(e,i,r),o=e.doc.sel,s;e.options.dragDrop&&Lu&&!e.isReadOnly()&&i=="single"&&(s=o.contains(t))>-1&&(fe((s=o.ranges[s]).from(),t)<0||t.xRel>0)&&(fe(s.to(),t)>0||t.xRel<0)?wc(e,r,t,n):kc(e,r,t,n)}function wc(e,t,i,r){var n=e.display,o=!1,s=Ue(e,function(m){y&&(n.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:yo(e)),ht(n.wrapper.ownerDocument,"mouseup",s),ht(n.wrapper.ownerDocument,"mousemove",d),ht(n.scroller,"dragstart",g),ht(n.scroller,"drop",s),o||(it(m),r.addNew||Zi(e.doc,i,null,null,r.extend),y&&!N||f&&p==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),d=function(m){o=o||Math.abs(t.clientX-m.clientX)+Math.abs(t.clientY-m.clientY)>=10},g=function(){return o=!0};y&&(n.scroller.draggable=!0),e.state.draggingText=s,s.copy=!r.moveOnDrag,oe(n.wrapper.ownerDocument,"mouseup",s),oe(n.wrapper.ownerDocument,"mousemove",d),oe(n.scroller,"dragstart",g),oe(n.scroller,"drop",s),e.state.delayingBlurEvent=!0,setTimeout(function(){return n.input.focus()},20),n.scroller.dragDrop&&n.scroller.dragDrop()}function os(e,t,i){if(i=="char")return new ye(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new ye(q(t.line,0),ce(e.doc,q(t.line+1,0)));var r=i(e,t);return new ye(r.from,r.to)}function kc(e,t,i,r){f&&yo(e);var n=e.display,o=e.doc;it(t);var s,d,g=o.sel,m=g.ranges;if(r.addNew&&!r.extend?(d=o.sel.contains(i),d>-1?s=m[d]:s=new ye(i,i)):(s=o.sel.primary(),d=o.sel.primIndex),r.unit=="rectangle")r.addNew||(s=new ye(i,i)),i=nr(e,t,!0,!0),d=-1;else{var x=os(e,i,r.unit);r.extend?s=Bo(s,x.anchor,x.head,r.extend):s=x}r.addNew?d==-1?(d=m.length,Ze(o,Ct(e,m.concat([s]),d),{scroll:!1,origin:"*mouse"})):m.length>1&&m[d].empty()&&r.unit=="char"&&!r.extend?(Ze(o,Ct(e,m.slice(0,d).concat(m.slice(d+1)),0),{scroll:!1,origin:"*mouse"}),g=o.sel):No(o,d,s,Ur):(d=0,Ze(o,new pt([s],0),Ur),g=o.sel);var C=i;function A(Z){if(fe(C,Z)!=0)if(C=Z,r.unit=="rectangle"){for(var $=[],ne=e.options.tabSize,ie=Re(re(o,i.line).text,i.ch,ne),pe=Re(re(o,Z.line).text,Z.ch,ne),Ce=Math.min(ie,pe),Ge=Math.max(ie,pe),Le=Math.min(i.line,Z.line),ft=Math.min(e.lastLine(),Math.max(i.line,Z.line));Le<=ft;Le++){var at=re(o,Le).text,Oe=St(at,Ce,ne);Ce==Ge?$.push(new ye(q(Le,Oe),q(Le,Oe))):at.length>Oe&&$.push(new ye(q(Le,Oe),q(Le,St(at,Ge,ne))))}$.length||$.push(new ye(i,i)),Ze(o,Ct(e,g.ranges.slice(0,d).concat($),d),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Z)}else{var lt=s,Xe=os(e,Z,r.unit),_e=lt.anchor,He;fe(Xe.anchor,_e)>0?(He=Xe.head,_e=Li(lt.from(),Xe.anchor)):(He=Xe.anchor,_e=Ai(lt.to(),Xe.head));var Be=g.ranges.slice(0);Be[d]=Sc(e,new ye(ce(o,_e),He)),Ze(o,Ct(e,Be,d),Ur)}}var F=n.wrapper.getBoundingClientRect(),R=0;function P(Z){var $=++R,ne=nr(e,Z,!0,r.unit=="rectangle");if(ne)if(fe(ne,C)!=0){e.curOp.focus=ve(ee(e)),A(ne);var ie=Ui(n,o);(ne.line>=ie.to||ne.lineF.bottom?20:0;pe&&setTimeout(Ue(e,function(){R==$&&(n.scroller.scrollTop+=pe,P(Z))}),50)}}function j(Z){e.state.selectingText=!1,R=1/0,Z&&(it(Z),n.input.focus()),ht(n.wrapper.ownerDocument,"mousemove",Y),ht(n.wrapper.ownerDocument,"mouseup",Q),o.history.lastSelOrigin=null}var Y=Ue(e,function(Z){Z.buttons===0||!ga(Z)?j(Z):P(Z)}),Q=Ue(e,j);e.state.selectingText=Q,oe(n.wrapper.ownerDocument,"mousemove",Y),oe(n.wrapper.ownerDocument,"mouseup",Q)}function Sc(e,t){var i=t.anchor,r=t.head,n=re(e.doc,i.line);if(fe(i,r)==0&&i.sticky==r.sticky)return t;var o=Mt(n);if(!o)return t;var s=Kr(o,i.ch,i.sticky),d=o[s];if(d.from!=i.ch&&d.to!=i.ch)return t;var g=s+(d.from==i.ch==(d.level!=1)?0:1);if(g==0||g==o.length)return t;var m;if(r.line!=i.line)m=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var x=Kr(o,r.ch,r.sticky),C=x-s||(r.ch-i.ch)*(d.level==1?-1:1);x==g-1||x==g?m=C<0:m=C>0}var A=o[g+(m?-1:0)],F=m==(A.level==1),R=F?A.from:A.to,P=F?"after":"before";return i.ch==R&&i.sticky==P?t:new ye(new q(i.line,R,P),r)}function as(e,t,i,r){var n,o;if(t.touches)n=t.touches[0].clientX,o=t.touches[0].clientY;else try{n=t.clientX,o=t.clientY}catch{return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&it(t);var s=e.display,d=s.lineDiv.getBoundingClientRect();if(o>d.bottom||!mt(e,i))return Pn(t);o-=d.top-s.viewOffset;for(var g=0;g=n){var x=tr(e.doc,o),C=e.display.gutterSpecs[g];return Ie(e,i,e,x,C.className,t),Pn(t)}}}function Po(e,t){return as(e,t,"gutterClick",!0)}function ls(e,t){It(e.display,t)||Fc(e,t)||We(e,t,"contextmenu")||ge||e.display.input.onContextMenu(t)}function Fc(e,t){return mt(e,"gutterContextMenu")?as(e,t,"gutterContextMenu",!1):!1}function ss(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ei(e)}var zr={toString:function(){return"CodeMirror.Init"}},us={},rn={};function Ec(e){var t=e.optionHandlers;function i(r,n,o,s){e.defaults[r]=n,o&&(t[r]=s?function(d,g,m){m!=zr&&o(d,g,m)}:o)}e.defineOption=i,e.Init=zr,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,Lo(r)},!0),i("indentUnit",2,Lo,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){si(r),ei(r),nt(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!!n){var o=[],s=r.doc.first;r.doc.iter(function(g){for(var m=0;;){var x=g.text.indexOf(n,m);if(x==-1)break;m=x+n.length,o.push(q(s,x))}s++});for(var d=o.length-1;d>=0;d--)Mr(r.doc,n,o[d],q(o[d].line,o[d].ch+n.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,n,o){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),o!=zr&&r.refresh()}),i("specialCharPlaceholder",tf,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",B?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,n){return r.getInputField().spellcheck=n},!0),i("autocorrect",!1,function(r,n){return r.getInputField().autocorrect=n},!0),i("autocapitalize",!1,function(r,n){return r.getInputField().autocapitalize=n},!0),i("rtlMoveVisually",!_),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){ss(r),li(r)},!0),i("keyMap","default",function(r,n,o){var s=en(n),d=o!=zr&&en(o);d&&d.detach&&d.detach(r,s),s.attach&&s.attach(r,d||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Lc,!0),i("gutters",[],function(r,n){r.display.gutterSpecs=Eo(n,r.options.lineNumbers),li(r)},!0),i("fixedGutter",!0,function(r,n){r.display.gutters.style.left=n?go(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Er(r)},!0),i("scrollbarStyle","native",function(r){cl(r),Er(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,n){r.display.gutterSpecs=Eo(r.options.gutters,n),li(r)},!0),i("firstLineNumber",1,li,!0),i("lineNumberFormatter",function(r){return r},li,!0),i("showCursorWhenSelecting",!1,ti,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(Sr(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,Ac),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,ti,!0),i("singleCursorHeightPerLine",!0,ti,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,si,!0),i("addModeClass",!1,si,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,si,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function Ac(e,t,i){var r=i&&i!=zr;if(!t!=!r){var n=e.display.dragFunctions,o=t?oe:ht;o(e.display.scroller,"dragstart",n.start),o(e.display.scroller,"dragenter",n.enter),o(e.display.scroller,"dragover",n.over),o(e.display.scroller,"dragleave",n.leave),o(e.display.scroller,"drop",n.drop)}}function Lc(e){e.options.lineWrapping?(Te(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ue(e.display.wrapper,"CodeMirror-wrap"),no(e)),vo(e),nt(e),ei(e),setTimeout(function(){return Er(e)},100)}function Ee(e,t){var i=this;if(!(this instanceof Ee))return new Ee(e,t);this.options=t=t?dt(t):{},dt(us,t,!1);var r=t.value;typeof r=="string"?r=new ot(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new Ee.inputStyles[t.inputStyle](this),o=this.display=new qf(e,r,n,t);o.wrapper.CodeMirror=this,ss(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),cl(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Je,keySeq:null,specialChars:null},t.autofocus&&!B&&o.input.focus(),f&&p<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Tc(this),lc(),sr(this),this.curOp.forceUpdate=!0,Dl(this,r),t.autofocus&&!B||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&xo(i)},20):Sr(this);for(var s in rn)rn.hasOwnProperty(s)&&rn[s](this,t[s],zr);pl(this),t.finishInit&&t.finishInit(this);for(var d=0;d<_o.length;++d)_o[d](this);ur(this),y&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}Ee.defaults=us,Ee.optionHandlers=rn;function Tc(e){var t=e.display;oe(t.scroller,"mousedown",Ue(e,ns)),f&&p<11?oe(t.scroller,"dblclick",Ue(e,function(g){if(!We(e,g)){var m=nr(e,g);if(!(!m||Po(e,g)||It(e.display,g))){it(g);var x=e.findWordAt(m);Zi(e.doc,x.anchor,x.head)}}})):oe(t.scroller,"dblclick",function(g){return We(e,g)||it(g)}),oe(t.scroller,"contextmenu",function(g){return ls(e,g)}),oe(t.input.getField(),"contextmenu",function(g){t.scroller.contains(g.target)||ls(e,g)});var i,r={end:0};function n(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function o(g){if(g.touches.length!=1)return!1;var m=g.touches[0];return m.radiusX<=1&&m.radiusY<=1}function s(g,m){if(m.left==null)return!0;var x=m.left-g.left,C=m.top-g.top;return x*x+C*C>20*20}oe(t.scroller,"touchstart",function(g){if(!We(e,g)&&!o(g)&&!Po(e,g)){t.input.ensurePolled(),clearTimeout(i);var m=+new Date;t.activeTouch={start:m,moved:!1,prev:m-r.end<=300?r:null},g.touches.length==1&&(t.activeTouch.left=g.touches[0].pageX,t.activeTouch.top=g.touches[0].pageY)}}),oe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),oe(t.scroller,"touchend",function(g){var m=t.activeTouch;if(m&&!It(t,g)&&m.left!=null&&!m.moved&&new Date-m.start<300){var x=e.coordsChar(t.activeTouch,"page"),C;!m.prev||s(m,m.prev)?C=new ye(x,x):!m.prev.prev||s(m,m.prev.prev)?C=e.findWordAt(x):C=new ye(q(x.line,0),ce(e.doc,q(x.line+1,0))),e.setSelection(C.anchor,C.head),e.focus(),it(g)}n()}),oe(t.scroller,"touchcancel",n),oe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ii(e,t.scroller.scrollTop),ar(e,t.scroller.scrollLeft,!0),Ie(e,"scroll",e))}),oe(t.scroller,"mousewheel",function(g){return ml(e,g)}),oe(t.scroller,"DOMMouseScroll",function(g){return ml(e,g)}),oe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(g){We(e,g)||Xr(g)},over:function(g){We(e,g)||(ac(e,g),Xr(g))},start:function(g){return oc(e,g)},drop:Ue(e,nc),leave:function(g){We(e,g)||Gl(e)}};var d=t.input.getField();oe(d,"keyup",function(g){return rs.call(e,g)}),oe(d,"keydown",Ue(e,ts)),oe(d,"keypress",Ue(e,is)),oe(d,"focus",function(g){return xo(e,g)}),oe(d,"blur",function(g){return Sr(e,g)})}var _o=[];Ee.defineInitHook=function(e){return _o.push(e)};function Di(e,t,i,r){var n=e.doc,o;i==null&&(i="add"),i=="smart"&&(n.mode.indent?o=Zr(e,t).state:i="prev");var s=e.options.tabSize,d=re(n,t),g=Re(d.text,null,s);d.stateAfter&&(d.stateAfter=null);var m=d.text.match(/^\s*/)[0],x;if(!r&&!/\S/.test(d.text))x=0,i="not";else if(i=="smart"&&(x=n.mode.indent(o,d.text.slice(m.length),d.text),x==Pe||x>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?x=Re(re(n,t-1).text,null,s):x=0:i=="add"?x=g+e.options.indentUnit:i=="subtract"?x=g-e.options.indentUnit:typeof i=="number"&&(x=g+i),x=Math.max(0,x);var C="",A=0;if(e.options.indentWithTabs)for(var F=Math.floor(x/s);F;--F)A+=s,C+=" ";if(As,g=Un(t),m=null;if(d&&r.ranges.length>1)if(wt&&wt.text.join(` -`)==t){if(r.ranges.length%wt.text.length==0){m=[];for(var x=0;x=0;A--){var F=r.ranges[A],R=F.from(),P=F.to();F.empty()&&(i&&i>0?R=q(R.line,R.ch-i):e.state.overwrite&&!d?P=q(P.line,Math.min(re(o,P.line).text.length,P.ch+me(g).length)):d&&wt&&wt.lineWise&&wt.text.join(` -`)==g.join(` -`)&&(R=P=q(R.line,0)));var j={from:R,to:P,text:m?m[A%m.length]:g,origin:n||(d?"paste":e.state.cutIncoming>s?"cut":"+input")};Tr(e.doc,j),qe(e,"inputRead",e,j)}t&&!d&&cs(e,t),Fr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=C),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function fs(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&ut(t,function(){return Wo(t,i,0,null,"paste")}),!0}function cs(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(!(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)){var o=e.getModeAt(n.head),s=!1;if(o.electricChars){for(var d=0;d-1){s=Di(e,n.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(re(e.doc,n.head.line).text.slice(0,n.head.ch))&&(s=Di(e,n.head.line,"smart"));s&&qe(e,"electricInput",e,n.head.line)}}}function ds(e){for(var t=[],i=[],r=0;ro&&(Di(this,d.head.line,r,!0),o=d.head.line,s==this.doc.sel.primIndex&&Fr(this));else{var g=d.from(),m=d.to(),x=Math.max(o,g.line);o=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var C=x;C0&&No(this.doc,s,new ye(g,A[s].to()),rt)}}}),getTokenAt:function(r,n){return wa(this,r,n)},getLineTokens:function(r,n){return wa(this,q(r),n,!0)},getTokenTypeAt:function(r){r=ce(this.doc,r);var n=xa(this,re(this.doc,r.line)),o=0,s=(n.length-1)/2,d=r.ch,g;if(d==0)g=n[2];else for(;;){var m=o+s>>1;if((m?n[m*2-1]:0)>=d)s=m;else if(n[m*2+1]g&&(r=g,s=!0),d=re(this.doc,r)}else d=r;return Ri(this,d,{top:0,left:0},n||"page",o||s).top+(s?this.doc.height-Nt(d):0)},defaultTextHeight:function(){return wr(this.display)},defaultCharWidth:function(){return kr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,o,s,d){var g=this.display;r=Dt(this,ce(this.doc,r));var m=r.bottom,x=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),g.sizer.appendChild(n),s=="over")m=r.top;else if(s=="above"||s=="near"){var C=Math.max(g.wrapper.clientHeight,this.doc.height),A=Math.max(g.sizer.clientWidth,g.lineSpace.clientWidth);(s=="above"||r.bottom+n.offsetHeight>C)&&r.top>n.offsetHeight?m=r.top-n.offsetHeight:r.bottom+n.offsetHeight<=C&&(m=r.bottom),x+n.offsetWidth>A&&(x=A-n.offsetWidth)}n.style.top=m+"px",n.style.left=n.style.right="",d=="right"?(x=g.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(d=="left"?x=0:d=="middle"&&(x=(g.sizer.clientWidth-n.offsetWidth)/2),n.style.left=x+"px"),o&&Af(this,{left:x,top:m,right:x+n.offsetWidth,bottom:m+n.offsetHeight})},triggerOnKeyDown:$e(ts),triggerOnKeyPress:$e(is),triggerOnKeyUp:rs,triggerOnMouseDown:$e(ns),execCommand:function(r){if(mi.hasOwnProperty(r))return mi[r].call(null,this)},triggerElectric:$e(function(r){cs(this,r)}),findPosH:function(r,n,o,s){var d=1;n<0&&(d=-1,n=-n);for(var g=ce(this.doc,r),m=0;m0&&x(o.charAt(s-1));)--s;for(;d.5||this.options.lineWrapping)&&vo(this),Ie(this,"refresh",this)}),swapDoc:$e(function(r){var n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),Dl(this,r),ei(this),this.display.input.reset(),ri(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,qe(this,"swapDoc",this,n),n}),phrase:function(r){var n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,r)?n[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},mr(e),e.registerHelper=function(r,n,o){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=o},e.registerGlobalHelper=function(r,n,o,s){e.registerHelper(r,n,s),i[r]._global.push({pred:o,val:s})}}function Uo(e,t,i,r,n){var o=t,s=i,d=re(e,t.line),g=n&&e.direction=="rtl"?-i:i;function m(){var Q=t.line+g;return Q=e.first+e.size?!1:(t=new q(Q,t.ch,t.sticky),d=re(e,Q))}function x(Q){var Z;if(r=="codepoint"){var $=d.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN($))Z=null;else{var ne=i>0?$>=55296&&$<56320:$>=56320&&$<57343;Z=new q(t.line,Math.max(0,Math.min(d.text.length,t.ch+i*(ne?2:1))),-i)}}else n?Z=dc(e.cm,d,t,i):Z=zo(d,t,i);if(Z==null)if(!Q&&m())t=Oo(n,e.cm,d,t.line,g);else return!1;else t=Z;return!0}if(r=="char"||r=="codepoint")x();else if(r=="column")x(!0);else if(r=="word"||r=="group")for(var C=null,A=r=="group",F=e.cm&&e.cm.getHelper(t,"wordChars"),R=!0;!(i<0&&!x(!R));R=!1){var P=d.text.charAt(t.ch)||` -`,j=Fi(P,F)?"w":A&&P==` -`?"n":!A||/\s/.test(P)?null:"p";if(A&&!R&&!j&&(j="s"),C&&C!=j){i<0&&(i=1,x(),t.sticky="after");break}if(j&&(C=j),i>0&&!x(!R))break}var Y=Ji(e,t,o,s,!0);return Qn(o,Y)&&(Y.hitSide=!0),Y}function ps(e,t,i,r){var n=e.doc,o=t.left,s;if(r=="page"){var d=Math.min(e.display.wrapper.clientHeight,he(e).innerHeight||n(e).documentElement.clientHeight),g=Math.max(d-.5*wr(e.display),3);s=(i>0?t.bottom:t.top)+i*g}else r=="line"&&(s=i>0?t.bottom+3:t.top-3);for(var m;m=co(e,o,s),!!m.outside;){if(i<0?s<=0:s>=n.height){m.hitSide=!0;break}s+=i*5}return m}var De=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Je,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};De.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;n.contentEditable=!0,qo(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(d){for(var g=d.target;g;g=g.parentNode){if(g==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(g.className))break}return!1}oe(n,"paste",function(d){!o(d)||We(r,d)||fs(d,r)||p<=11&&setTimeout(Ue(r,function(){return t.updateFromDOM()}),20)}),oe(n,"compositionstart",function(d){t.composing={data:d.data,done:!1}}),oe(n,"compositionupdate",function(d){t.composing||(t.composing={data:d.data,done:!1})}),oe(n,"compositionend",function(d){t.composing&&(d.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),oe(n,"touchstart",function(){return i.forceCompositionEnd()}),oe(n,"input",function(){t.composing||t.readFromDOMSoon()});function s(d){if(!(!o(d)||We(r,d))){if(r.somethingSelected())nn({lineWise:!1,text:r.getSelections()}),d.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var g=ds(r);nn({lineWise:!0,text:g.text}),d.type=="cut"&&r.operation(function(){r.setSelections(g.ranges,0,rt),r.replaceSelection("",null,"cut")})}else return;if(d.clipboardData){d.clipboardData.clearData();var m=wt.text.join(` -`);if(d.clipboardData.setData("Text",m),d.clipboardData.getData("Text")==m){d.preventDefault();return}}var x=hs(),C=x.firstChild;qo(C),r.display.lineSpace.insertBefore(x,r.display.lineSpace.firstChild),C.value=wt.text.join(` -`);var A=ve(be(n));S(C),setTimeout(function(){r.display.lineSpace.removeChild(x),A.focus(),A==n&&i.showPrimarySelection()},50)}}oe(n,"copy",s),oe(n,"cut",s)},De.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},De.prototype.prepareSelection=function(){var e=nl(this.cm,!1);return e.focus=ve(be(this.div))==this.div,e},De.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},De.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},De.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),n=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||n.line=t.display.viewFrom&&gs(t,r)||{node:d[0].measure.map[2],offset:0},m=n.linee.firstLine()&&(r=q(r.line-1,re(e.doc,r.line-1).length)),n.ch==re(e.doc,n.line).text.length&&n.linet.viewTo-1)return!1;var o,s,d;r.line==t.viewFrom||(o=or(e,r.line))==0?(s=xe(t.view[0].line),d=t.view[0].node):(s=xe(t.view[o].line),d=t.view[o-1].node.nextSibling);var g=or(e,n.line),m,x;if(g==t.view.length-1?(m=t.viewTo-1,x=t.lineDiv.lastChild):(m=xe(t.view[g+1].line)-1,x=t.view[g+1].node.previousSibling),!d)return!1;for(var C=e.doc.splitLines(Nc(e,d,x,s,m)),A=er(e.doc,q(s,0),q(m,re(e.doc,m).text.length));C.length>1&&A.length>1;)if(me(C)==me(A))C.pop(),A.pop(),m--;else if(C[0]==A[0])C.shift(),A.shift(),s++;else break;for(var F=0,R=0,P=C[0],j=A[0],Y=Math.min(P.length,j.length);Fr.ch&&Q.charCodeAt(Q.length-R-1)==Z.charCodeAt(Z.length-R-1);)F--,R++;C[C.length-1]=Q.slice(0,Q.length-R).replace(/^\u200b+/,""),C[0]=C[0].slice(F).replace(/\u200b+$/,"");var ne=q(s,F),ie=q(m,A.length?me(A).length-R:0);if(C.length>1||C[0]||fe(ne,ie))return Mr(e.doc,C,ne,ie,"+input"),!0},De.prototype.ensurePolled=function(){this.forceCompositionEnd()},De.prototype.reset=function(){this.forceCompositionEnd()},De.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},De.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},De.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ut(this.cm,function(){return nt(e.cm)})},De.prototype.setUneditable=function(e){e.contentEditable="false"},De.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ue(this.cm,Wo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},De.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},De.prototype.onContextMenu=function(){},De.prototype.resetPosition=function(){},De.prototype.needsContentAttribute=!0;function gs(e,t){var i=so(e,t.line);if(!i||i.hidden)return null;var r=re(e.doc,t.line),n=ja(i,r,t.line),o=Mt(r,e.doc.direction),s="left";if(o){var d=Kr(o,t.ch);s=d%2?"right":"left"}var g=Xa(n.map,t.ch,s);return g.offset=g.collapse=="right"?g.end:g.start,g}function Bc(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Or(e,t){return t&&(e.bad=!0),e}function Nc(e,t,i,r,n){var o="",s=!1,d=e.doc.lineSeparator(),g=!1;function m(F){return function(R){return R.id==F}}function x(){s&&(o+=d,g&&(o+=d),s=g=!1)}function C(F){F&&(x(),o+=F)}function A(F){if(F.nodeType==1){var R=F.getAttribute("cm-text");if(R){C(R);return}var P=F.getAttribute("cm-marker"),j;if(P){var Y=e.findMarks(q(r,0),q(n+1,0),m(+P));Y.length&&(j=Y[0].find(0))&&C(er(e.doc,j.from,j.to).join(d));return}if(F.getAttribute("contenteditable")=="false")return;var Q=/^(pre|div|p|li|table|br)$/i.test(F.nodeName);if(!/^br$/i.test(F.nodeName)&&F.textContent.length==0)return;Q&&x();for(var Z=0;Z=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),oe(n,"paste",function(s){We(r,s)||fs(s,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())});function o(s){if(!We(r,s)){if(r.somethingSelected())nn({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var d=ds(r);nn({lineWise:!0,text:d.text}),s.type=="cut"?r.setSelections(d.ranges,null,rt):(i.prevInput="",n.value=d.text.join(` -`),S(n))}else return;s.type=="cut"&&(r.state.cutIncoming=+new Date)}}oe(n,"cut",o),oe(n,"copy",o),oe(e.scroller,"paste",function(s){if(!(It(e,s)||We(r,s))){if(!n.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var d=new Event("paste");d.clipboardData=s.clipboardData,n.dispatchEvent(d)}}),oe(e.lineSpace,"selectstart",function(s){It(e,s)||it(s)}),oe(n,"compositionstart",function(){var s=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:s,range:r.markText(s,r.getCursor("to"),{className:"CodeMirror-composing"})}}),oe(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Ne.prototype.createField=function(e){this.wrapper=hs(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;qo(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Ne.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ne.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=nl(e);if(e.options.moveInputWithCursor){var n=Dt(e,i.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+s.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+s.left-o.left))}return r},Ne.prototype.showSelection=function(e){var t=this.cm,i=t.display;de(i.cursorDiv,e.cursors),de(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ne.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&S(this.textarea),f&&p>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",f&&p>=9&&(this.hasSelection=null));this.resetting=!1}},Ne.prototype.getField=function(){return this.textarea},Ne.prototype.supportsTouch=function(){return!1},Ne.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!B||ve(be(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},Ne.prototype.blur=function(){this.textarea.blur()},Ne.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ne.prototype.receivedFocus=function(){this.slowPoll()},Ne.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ne.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},Ne.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Bu(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(f&&p>=9&&this.hasSelection===n||I&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=n.charCodeAt(0);if(o==8203&&!r&&(r="\u200B"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var s=0,d=Math.min(r.length,n.length);s1e3||n.indexOf(` -`)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ne.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ne.prototype.onKeyPress=function(){f&&p>=9&&(this.hasSelection=null),this.fastPoll()},Ne.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=nr(i,e),s=r.scroller.scrollTop;if(!o||M)return;var d=i.options.resetSelectionOnContextMenu;d&&i.doc.sel.contains(o)==-1&&Ue(i,Ze)(i.doc,jt(o),rt);var g=n.style.cssText,m=t.wrapper.style.cssText,x=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px; + left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(n),e.display.lineSpace.removeChild(s)}}}function Af(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?q(t.line,t.ch+1,"before"):t,t=t.ch?q(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var s=!1,h=Dt(e,t),v=!i||i==t?h:Dt(e,i);n={left:Math.min(h.left,v.left),top:Math.min(h.top,v.top)-r,right:Math.max(h.left,v.left),bottom:Math.max(h.bottom,v.bottom)+r};var m=Do(e,n),x=e.doc.scrollTop,C=e.doc.scrollLeft;if(m.scrollTop!=null&&(ii(e,m.scrollTop),Math.abs(e.doc.scrollTop-x)>1&&(s=!0)),m.scrollLeft!=null&&(ar(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-C)>1&&(s=!0)),!s)break}return n}function Lf(e,t){var i=Do(e,t);i.scrollTop!=null&&ii(e,i.scrollTop),i.scrollLeft!=null&&ar(e,i.scrollLeft)}function Do(e,t){var i=e.display,r=wr(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,o=lo(e),s={};t.bottom-t.top>o&&(t.bottom=t.top+o);var h=e.doc.height+ao(i),v=t.toph-r;if(t.topn+o){var x=Math.min(t.top,(m?h:t.bottom)-o);x!=n&&(s.scrollTop=x)}var C=e.options.fixedGutter?0:i.gutters.offsetWidth,A=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-C,F=rr(e)-i.gutters.offsetWidth,R=t.right-t.left>F;return R&&(t.right=t.left+F),t.left<10?s.scrollLeft=0:t.leftF+A-3&&(s.scrollLeft=t.right+(R?0:10)-F),s}function Co(e,t){t!=null&&(ji(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Fr(e){ji(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ri(e,t,i){(t!=null||i!=null)&&ji(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Tf(e,t){ji(e),e.curOp.scrollToPos=t}function ji(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=el(e,t.from),r=el(e,t.to);sl(e,i,r,t.margin)}}function sl(e,t,i,r){var n=Do(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});ri(e,n.scrollLeft,n.scrollTop)}function ii(e,t){Math.abs(e.doc.scrollTop-t)<2||(c||ko(e,{top:t}),ul(e,t,!0),c&&ko(e),ai(e,100))}function ul(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function ar(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,pl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function ni(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+ao(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+At(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var lr=function(e,t,i){this.cm=i;var r=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),oe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),oe(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,f&&p<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};lr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},lr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},lr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},lr.prototype.zeroWidthHack=function(){var e=I&&!z?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Je,this.disableVert=new Je},lr.prototype.enableZeroWidthBar=function(e,t,i){e.style.visibility="";function r(){var n=e.getBoundingClientRect(),o=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},lr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var oi=function(){};oi.prototype.update=function(){return{bottom:0,right:0}},oi.prototype.setScrollLeft=function(){},oi.prototype.setScrollTop=function(){},oi.prototype.clear=function(){};function Er(e,t){t||(t=ni(e));var i=e.display.barWidth,r=e.display.barHeight;fl(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&qi(e),fl(e,ni(e)),i=e.display.barWidth,r=e.display.barHeight}function fl(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var cl={native:lr,null:oi};function dl(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ue(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new cl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),oe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?ar(e,t):ii(e,t)},e),e.display.scrollbars.addClass&&Te(e.display.wrapper,e.display.scrollbars.addClass)}var Mf=0;function sr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Mf,markArrays:null},sf(e.curOp)}function ur(e){var t=e.curOp;t&&ff(t,function(i){for(var r=0;r=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Gi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function If(e){e.updatedDisplay=e.mustUpdate&&wo(e.cm,e.update)}function Of(e){var t=e.cm,i=t.display;e.updatedDisplay&&qi(t),e.barMeasure=ni(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ka(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+At(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-rr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function zf(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var i=+new Date+e.options.workTime,r=Zr(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var s=o.styles,h=o.text.length>e.options.maxHighlightLength?Vt(t.mode,r.state):null,v=xa(e,o,r,!0);h&&(r.state=h),o.styles=v.styles;var m=o.styleClasses,x=v.classes;x?o.styleClasses=x:m&&(o.styleClasses=null);for(var C=!s||s.length!=o.styles.length||m!=x&&(!m||!x||m.bgClass!=x.bgClass||m.textClass!=x.textClass),A=0;!C&&Ai)return ai(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&ut(e,function(){for(var o=0;o=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&nl(e)==0)return!1;gl(e)&&(Ut(e),t.dims=po(e));var n=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),s=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFroms&&i.viewTo-s<20&&(s=Math.min(n,i.viewTo)),Bt&&(o=ro(e.doc,o),s=Ia(e.doc,s));var h=o!=i.viewFrom||s!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Sf(e,o,s),i.viewOffset=Nt(re(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var v=nl(e);if(!h&&v==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var m=Pf(e);return v>4&&(i.lineDiv.style.display="none"),qf(e,i.updateLineNumbers,t.dims),v>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Wf(m),ae(i.cursorDiv),ae(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,h&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,ai(e,400)),i.updateLineNumbers=null,!0}function hl(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==rr(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+ao(e.display)-lo(e),i.top)}),t.visible=Ui(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Ui(e.display,e.doc,i));if(!wo(e,t))break;qi(e);var n=ni(e);ti(e),Er(e,n),Fo(e,n),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ko(e,t){var i=new Gi(e,t);if(wo(e,i)){qi(e),hl(e,i);var r=ni(e);ti(e),Er(e,r),Fo(e,r),i.finish()}}function qf(e,t,i){var r=e.display,n=e.options.lineNumbers,o=r.lineDiv,s=o.firstChild;function h(R){var _=R.nextSibling;return y&&I&&e.display.currentWheelTarget==R?R.style.display="none":R.parentNode.removeChild(R),_}for(var v=r.view,m=r.viewFrom,x=0;x-1&&(F=!1),_a(e,C,m,i)),F&&(ae(C.lineNumber),C.lineNumber.appendChild(document.createTextNode(Zn(e.options,m)))),s=C.node.nextSibling}m+=C.size}for(;s;)s=h(s)}function So(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",qe(e,"gutterChanged",e)}function Fo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+At(e)+"px"}function pl(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=go(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,o=r+"px",s=0;sh.clientWidth,m=h.scrollHeight>h.clientHeight;if(r&&v||n&&m){if(n&&I&&y){e:for(var x=t.target,C=s.view;x!=h;x=x.parentNode)for(var A=0;A=0&&fe(e,r.to())<=0)return i}return-1};var ye=function(e,t){this.anchor=e,this.head=t};ye.prototype.from=function(){return Li(this.anchor,this.head)},ye.prototype.to=function(){return Ai(this.anchor,this.head)},ye.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ct(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(A,F){return fe(A.from(),F.from())}),i=Fe(t,n);for(var o=1;o0:v>=0){var m=Li(h.from(),s.from()),x=Ai(h.to(),s.to()),C=h.empty()?s.from()==s.head:h.from()==h.head;o<=i&&--i,t.splice(--o,2,new ye(C?x:m,C?m:x))}}return new pt(t,i)}function jt(e,t){return new pt([new ye(e,t||e)],0)}function Gt(e){return e.text?q(e.from.line+e.text.length-1,me(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function yl(e,t){if(fe(e,t.from)<0)return e;if(fe(e,t.to)<=0)return Gt(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Gt(t).ch-t.to.ch),q(i,r)}function Ao(e,t){for(var i=[],r=0;r1&&e.remove(h.line+1,R-1),e.insert(h.line+1,Y)}qe(e,"change",e,t)}function Kt(e,t,i){function r(n,o,s){if(n.linked)for(var h=0;h1&&!e.done[e.done.length-2].ranges)return e.done.pop(),me(e.done)}function Sl(e,t,i,r){var n=e.history;n.undone.length=0;var o=+new Date,s,h;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(s=Xf(n,n.lastOp==r)))h=me(s.changes),fe(t.from,t.to)==0&&fe(t.from,h.to)==0?h.to=Gt(t):s.changes.push(Mo(e,t));else{var v=me(n.done);for((!v||!v.ranges)&&Yi(e.sel,n.done),s={changes:[Mo(e,t)],generation:n.generation},n.done.push(s);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=o,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,h||Ie(e,"historyAdded")}function Yf(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Zf(e,t,i,r){var n=e.history,o=r&&r.origin;i==n.lastSelOp||o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||Yf(e,o,me(n.done),t))?n.done[n.done.length-1]=t:Yi(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=o,n.lastSelOp=i,r&&r.clearRedo!==!1&&kl(n.undone)}function Yi(e,t){var i=me(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Fl(e,t,i,r){var n=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(s){s.markedSpans&&((n||(n=t["spans_"+e.id]={}))[o]=s.markedSpans),++o})}function Qf(e){if(!e)return null;for(var t,i=0;i-1&&(me(h)[C]=m[C],delete m[C])}}return r}function Bo(e,t,i,r){if(r){var n=e.anchor;if(i){var o=fe(t,n)<0;o!=fe(i,n)<0?(n=t,t=i):o!=fe(t,i)<0&&(t=i)}return new ye(n,t)}else return new ye(i||t,t)}function Zi(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),Ze(e,new pt([Bo(e.sel.primary(),t,i,n)],0),r)}function Al(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:h.to>t.ch))){if(n&&(Ie(v,"beforeCursorEnter"),v.explicitlyCleared))if(o.markedSpans){--s;continue}else break;if(!v.atomic)continue;if(i){var C=v.find(r<0?1:-1),A=void 0;if((r<0?x:m)&&(C=Il(e,C,-r,C&&C.line==t.line?o:null)),C&&C.line==t.line&&(A=fe(C,i))&&(r<0?A<0:A>0))return Lr(e,C,t,r,n)}var F=v.find(r<0?-1:1);return(r<0?m:x)&&(F=Il(e,F,r,F.line==t.line?o:null)),F?Lr(e,F,t,r,n):null}}return t}function Ji(e,t,i,r,n){var o=r||1,s=Lr(e,t,i,o,n)||!n&&Lr(e,t,i,o,!0)||Lr(e,t,i,-o,n)||!n&&Lr(e,t,i,-o,!0);return s||(e.cantEdit=!0,q(e.first,0))}function Il(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?ce(e,q(t.line-1)):null:i>0&&t.ch==(r||re(e,t.line)).text.length?t.line=0;--n)Hl(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else Hl(e,t)}}function Hl(e,t){if(!(t.text.length==1&&t.text[0]==""&&fe(t.from,t.to)==0)){var i=Ao(e,t);Sl(e,t,i,e.cm?e.cm.curOp.id:NaN),ui(e,t,i,eo(e,t));var r=[];Kt(e,function(n,o){!o&&Fe(r,n.history)==-1&&(Wl(n.history,t),r.push(n.history)),ui(n,t,null,eo(n,t))})}}function $i(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var n=e.history,o,s=e.sel,h=t=="undo"?n.done:n.undone,v=t=="undo"?n.undone:n.done,m=0;m=0;--F){var R=A(F);if(R)return R.v}}}}function Rl(e,t){if(t!=0&&(e.first+=t,e.sel=new pt(yt(e.sel.ranges,function(n){return new ye(q(n.anchor.line+t,n.anchor.ch),q(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm)){nt(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:q(o,re(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=er(e,t.from,t.to),i||(i=Ao(e,t)),e.cm?Vf(e.cm,t,r):To(e,t,r),Qi(e,i,rt),e.cantEdit&&Ji(e,q(e.firstLine(),0))&&(e.cantEdit=!1)}}function Vf(e,t,i){var r=e.doc,n=e.display,o=t.from,s=t.to,h=!1,v=o.line;e.options.lineWrapping||(v=xe(xt(re(r,o.line))),r.iter(v,s.line+1,function(F){if(F==n.maxLine)return h=!0,!0})),r.sel.contains(t.from,t.to)>-1&&pa(e),To(r,t,i,il(e)),e.options.lineWrapping||(r.iter(v,o.line+t.text.length,function(F){var R=Oi(F);R>n.maxLineLength&&(n.maxLine=F,n.maxLineLength=R,n.maxLineChanged=!0,h=!1)}),h&&(e.curOp.updateMaxLine=!0)),Wu(r,o.line),ai(e,400);var m=t.text.length-(s.line-o.line)-1;t.full?nt(e):o.line==s.line&&t.text.length==1&&!Dl(e.doc,t)?qt(e,o.line,"text"):nt(e,o.line,s.line+1,m);var x=mt(e,"changes"),C=mt(e,"change");if(C||x){var A={from:o,to:s,text:t.text,removed:t.removed,origin:t.origin};C&&qe(e,"change",e,A),x&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(A)}e.display.selForContextMenu=null}function Mr(e,t,i,r,n){var o;r||(r=i),fe(r,i)<0&&(o=[r,i],i=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Tr(e,{from:i,to:r,text:t,origin:n})}function _l(e,t,i,r){i1||!(this.children[0]instanceof ci))){var h=[];this.collapse(h),this.children=[new ci(h)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var s=n.lines.length%25+25,h=s;h10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=m,e.display.maxLineLength=x,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&nt(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Bl(e.doc)),e&&qe(e,"markerCleared",e,this,r,n),t&&ur(e),this.parent&&this.parent.clear()}},Xt.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n0||s==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=U("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Na(e,t.line,t,i,o)||t.line!=i.line&&Na(e,i.line,t,i,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Uu()}o.addToHistory&&Sl(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var h=t.line,v=e.cm,m;if(e.iter(h,i.line+1,function(C){v&&o.collapsed&&!v.options.lineWrapping&&xt(C)==v.display.maxLine&&(m=!0),o.collapsed&&h!=t.line&&Ft(C,0),Gu(C,new Mi(o,h==t.line?t.ch:null,h==i.line?i.ch:null),e.cm&&e.cm.curOp),++h}),o.collapsed&&e.iter(t.line,i.line+1,function(C){Wt(e,C)&&Ft(C,0)}),o.clearOnEnter&&oe(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(qu(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Ul,o.atomic=!0),v){if(m&&(v.curOp.updateMaxLine=!0),o.collapsed)nt(v,t.line,i.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var x=t.line;x<=i.line;x++)qt(v,x,"text");o.atomic&&Bl(v.doc),qe(v,"markerAdded",v,o)}return o}var pi=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;v--)Tr(this,r[v]);h?Tl(this,h):this.cm&&Fr(this.cm)}),undo:je(function(){$i(this,"undo")}),redo:je(function(){$i(this,"redo")}),undoSelection:je(function(){$i(this,"undo",!0)}),redoSelection:je(function(){$i(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=ce(this,e),t=ce(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(o){var s=o.markedSpans;if(s)for(var h=0;h=v.to||v.from==null&&n!=e.line||v.from!=null&&n==t.line&&v.from>=t.ch)&&(!i||i(v.marker))&&r.push(v.marker.parent||v.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;re)return t=e,!0;e-=o,++i}),ce(this,q(i,t))},indexFromPos:function(e){e=ce(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var x=e.dataTransfer.getData("Text");if(x){var C;if(t.state.draggingText&&!t.state.draggingText.copy&&(C=t.listSelections()),Qi(t.doc,jt(i,i)),C)for(var A=0;A=0;h--)Mr(e.doc,"",r[h].from,r[h].to,"+delete");Fr(e)})}function Io(e,t,i){var r=da(e.text,t+i,i);return r<0||r>e.text.length?null:r}function Oo(e,t,i){var r=Io(e,t.ch,i);return r==null?null:new q(t.line,r,i<0?"after":"before")}function zo(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var o=Mt(i,t.doc.direction);if(o){var s=n<0?me(o):o[0],h=n<0==(s.level==1),v=h?"after":"before",m;if(s.level>0||t.doc.direction=="rtl"){var x=Cr(t,i);m=n<0?i.text.length-1:0;var C=Lt(t,x,m).top;m=jr(function(A){return Lt(t,x,A).top==C},n<0==(s.level==1)?s.from:s.to-1,m),v=="before"&&(m=Io(i,m,1))}else m=n<0?s.to:s.from;return new q(r,m,v)}}return new q(r,n<0?i.text.length:0,n<0?"before":"after")}function hc(e,t,i,r){var n=Mt(t,e.doc.direction);if(!n)return Oo(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var o=Kr(n,i.ch,i.sticky),s=n[o];if(e.doc.direction=="ltr"&&s.level%2==0&&(r>0?s.to>i.ch:s.from=s.from&&A>=x.begin)){var F=C?"before":"after";return new q(i.line,A,F)}}var R=function(Y,Q,Z){for(var $=function(Ce,Ge){return Ge?new q(i.line,h(Ce,1),"before"):new q(i.line,Ce,"after")};Y>=0&&Y0==(ne.level!=1),pe=ie?Z.begin:h(Z.end,-1);if(ne.from<=pe&&pe0?x.end:h(x.begin,-1);return j!=null&&!(r>0&&j==t.text.length)&&(_=R(r>0?0:n.length-1,r,m(j)),_)?_:null}var mi={selectAll:Ol,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),rt)},killLine:function(e){return Ir(e,function(t){if(t.empty()){var i=re(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)n=new q(n.line,n.ch+1),e.replaceRange(o.charAt(n.ch-1)+o.charAt(n.ch-2),q(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var s=re(e.doc,n.line-1).text;s&&(n=new q(n.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),q(n.line-1,s.length-1),n,"+transpose"))}}i.push(new ye(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return ut(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;re&&fe(t,this.pos)==0&&i==this.button};var yi,xi;function xc(e,t){var i=+new Date;return xi&&xi.compare(i,e,t)?(yi=xi=null,"triple"):yi&&yi.compare(i,e,t)?(xi=new Ro(i,e,t),yi=null,"double"):(yi=new Ro(i,e,t),xi=null,"single")}function os(e){var t=this,i=t.display;if(!(We(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,It(i,e)){y||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!_o(t,e)){var r=nr(t,e),n=va(e),o=r?xc(r,n):"single";he(t).focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Dc(t,n,r,o,e))&&(n==1?r?wc(t,r,o,e):Pn(e)==i.scroller&&it(e):n==2?(r&&Zi(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(ge?t.display.input.onContextMenu(e):yo(t)))}}}function Dc(e,t,i,r,n){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,bi(e,Ql(o,n),n,function(s){if(typeof s=="string"&&(s=mi[s]),!s)return!1;var h=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),h=s(e,i)!=_e}finally{e.state.suppressEdits=!1}return h})}function Cc(e,t,i){var r=e.getOption("configureMouse"),n=r?r(e,t,i):{};if(n.unit==null){var o=H?i.shiftKey&&i.metaKey:i.altKey;n.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),n.addNew==null&&(n.addNew=I?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(I?i.altKey:i.ctrlKey)),n}function wc(e,t,i,r){f?setTimeout(tt(al,e),0):e.curOp.focus=ve(ee(e));var n=Cc(e,i,r),o=e.doc.sel,s;e.options.dragDrop&&Tu&&!e.isReadOnly()&&i=="single"&&(s=o.contains(t))>-1&&(fe((s=o.ranges[s]).from(),t)<0||t.xRel>0)&&(fe(s.to(),t)>0||t.xRel<0)?kc(e,r,t,n):Sc(e,r,t,n)}function kc(e,t,i,r){var n=e.display,o=!1,s=Ue(e,function(m){y&&(n.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:yo(e)),ht(n.wrapper.ownerDocument,"mouseup",s),ht(n.wrapper.ownerDocument,"mousemove",h),ht(n.scroller,"dragstart",v),ht(n.scroller,"drop",s),o||(it(m),r.addNew||Zi(e.doc,i,null,null,r.extend),y&&!N||f&&p==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),h=function(m){o=o||Math.abs(t.clientX-m.clientX)+Math.abs(t.clientY-m.clientY)>=10},v=function(){return o=!0};y&&(n.scroller.draggable=!0),e.state.draggingText=s,s.copy=!r.moveOnDrag,oe(n.wrapper.ownerDocument,"mouseup",s),oe(n.wrapper.ownerDocument,"mousemove",h),oe(n.scroller,"dragstart",v),oe(n.scroller,"drop",s),e.state.delayingBlurEvent=!0,setTimeout(function(){return n.input.focus()},20),n.scroller.dragDrop&&n.scroller.dragDrop()}function as(e,t,i){if(i=="char")return new ye(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new ye(q(t.line,0),ce(e.doc,q(t.line+1,0)));var r=i(e,t);return new ye(r.from,r.to)}function Sc(e,t,i,r){f&&yo(e);var n=e.display,o=e.doc;it(t);var s,h,v=o.sel,m=v.ranges;if(r.addNew&&!r.extend?(h=o.sel.contains(i),h>-1?s=m[h]:s=new ye(i,i)):(s=o.sel.primary(),h=o.sel.primIndex),r.unit=="rectangle")r.addNew||(s=new ye(i,i)),i=nr(e,t,!0,!0),h=-1;else{var x=as(e,i,r.unit);r.extend?s=Bo(s,x.anchor,x.head,r.extend):s=x}r.addNew?h==-1?(h=m.length,Ze(o,Ct(e,m.concat([s]),h),{scroll:!1,origin:"*mouse"})):m.length>1&&m[h].empty()&&r.unit=="char"&&!r.extend?(Ze(o,Ct(e,m.slice(0,h).concat(m.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),v=o.sel):No(o,h,s,Ur):(h=0,Ze(o,new pt([s],0),Ur),v=o.sel);var C=i;function A(Z){if(fe(C,Z)!=0)if(C=Z,r.unit=="rectangle"){for(var $=[],ne=e.options.tabSize,ie=Re(re(o,i.line).text,i.ch,ne),pe=Re(re(o,Z.line).text,Z.ch,ne),Ce=Math.min(ie,pe),Ge=Math.max(ie,pe),Le=Math.min(i.line,Z.line),ft=Math.min(e.lastLine(),Math.max(i.line,Z.line));Le<=ft;Le++){var at=re(o,Le).text,ze=St(at,Ce,ne);Ce==Ge?$.push(new ye(q(Le,ze),q(Le,ze))):at.length>ze&&$.push(new ye(q(Le,ze),q(Le,St(at,Ge,ne))))}$.length||$.push(new ye(i,i)),Ze(o,Ct(e,v.ranges.slice(0,h).concat($),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Z)}else{var lt=s,Xe=as(e,Z,r.unit),Pe=lt.anchor,He;fe(Xe.anchor,Pe)>0?(He=Xe.head,Pe=Li(lt.from(),Xe.anchor)):(He=Xe.anchor,Pe=Ai(lt.to(),Xe.head));var Be=v.ranges.slice(0);Be[h]=Fc(e,new ye(ce(o,Pe),He)),Ze(o,Ct(e,Be,h),Ur)}}var F=n.wrapper.getBoundingClientRect(),R=0;function _(Z){var $=++R,ne=nr(e,Z,!0,r.unit=="rectangle");if(ne)if(fe(ne,C)!=0){e.curOp.focus=ve(ee(e)),A(ne);var ie=Ui(n,o);(ne.line>=ie.to||ne.lineF.bottom?20:0;pe&&setTimeout(Ue(e,function(){R==$&&(n.scroller.scrollTop+=pe,_(Z))}),50)}}function j(Z){e.state.selectingText=!1,R=1/0,Z&&(it(Z),n.input.focus()),ht(n.wrapper.ownerDocument,"mousemove",Y),ht(n.wrapper.ownerDocument,"mouseup",Q),o.history.lastSelOrigin=null}var Y=Ue(e,function(Z){Z.buttons===0||!va(Z)?j(Z):_(Z)}),Q=Ue(e,j);e.state.selectingText=Q,oe(n.wrapper.ownerDocument,"mousemove",Y),oe(n.wrapper.ownerDocument,"mouseup",Q)}function Fc(e,t){var i=t.anchor,r=t.head,n=re(e.doc,i.line);if(fe(i,r)==0&&i.sticky==r.sticky)return t;var o=Mt(n);if(!o)return t;var s=Kr(o,i.ch,i.sticky),h=o[s];if(h.from!=i.ch&&h.to!=i.ch)return t;var v=s+(h.from==i.ch==(h.level!=1)?0:1);if(v==0||v==o.length)return t;var m;if(r.line!=i.line)m=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var x=Kr(o,r.ch,r.sticky),C=x-s||(r.ch-i.ch)*(h.level==1?-1:1);x==v-1||x==v?m=C<0:m=C>0}var A=o[v+(m?-1:0)],F=m==(A.level==1),R=F?A.from:A.to,_=F?"after":"before";return i.ch==R&&i.sticky==_?t:new ye(new q(i.line,R,_),r)}function ls(e,t,i,r){var n,o;if(t.touches)n=t.touches[0].clientX,o=t.touches[0].clientY;else try{n=t.clientX,o=t.clientY}catch{return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&it(t);var s=e.display,h=s.lineDiv.getBoundingClientRect();if(o>h.bottom||!mt(e,i))return _n(t);o-=h.top-s.viewOffset;for(var v=0;v=n){var x=tr(e.doc,o),C=e.display.gutterSpecs[v];return Ie(e,i,e,x,C.className,t),_n(t)}}}function _o(e,t){return ls(e,t,"gutterClick",!0)}function ss(e,t){It(e.display,t)||Ec(e,t)||We(e,t,"contextmenu")||ge||e.display.input.onContextMenu(t)}function Ec(e,t){return mt(e,"gutterContextMenu")?ls(e,t,"gutterContextMenu",!1):!1}function us(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ei(e)}var Or={toString:function(){return"CodeMirror.Init"}},fs={},rn={};function Ac(e){var t=e.optionHandlers;function i(r,n,o,s){e.defaults[r]=n,o&&(t[r]=s?function(h,v,m){m!=Or&&o(h,v,m)}:o)}e.defineOption=i,e.Init=Or,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,Lo(r)},!0),i("indentUnit",2,Lo,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){si(r),ei(r),nt(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!!n){var o=[],s=r.doc.first;r.doc.iter(function(v){for(var m=0;;){var x=v.text.indexOf(n,m);if(x==-1)break;m=x+n.length,o.push(q(s,x))}s++});for(var h=o.length-1;h>=0;h--)Mr(r.doc,n,o[h],q(o[h].line,o[h].ch+n.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,n,o){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),o!=Or&&r.refresh()}),i("specialCharPlaceholder",rf,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",B?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,n){return r.getInputField().spellcheck=n},!0),i("autocorrect",!1,function(r,n){return r.getInputField().autocorrect=n},!0),i("autocapitalize",!1,function(r,n){return r.getInputField().autocapitalize=n},!0),i("rtlMoveVisually",!P),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){us(r),li(r)},!0),i("keyMap","default",function(r,n,o){var s=en(n),h=o!=Or&&en(o);h&&h.detach&&h.detach(r,s),s.attach&&s.attach(r,h||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Tc,!0),i("gutters",[],function(r,n){r.display.gutterSpecs=Eo(n,r.options.lineNumbers),li(r)},!0),i("fixedGutter",!0,function(r,n){r.display.gutters.style.left=n?go(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Er(r)},!0),i("scrollbarStyle","native",function(r){dl(r),Er(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,n){r.display.gutterSpecs=Eo(r.options.gutters,n),li(r)},!0),i("firstLineNumber",1,li,!0),i("lineNumberFormatter",function(r){return r},li,!0),i("showCursorWhenSelecting",!1,ti,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(Sr(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,Lc),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,ti,!0),i("singleCursorHeightPerLine",!0,ti,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,si,!0),i("addModeClass",!1,si,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,si,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function Lc(e,t,i){var r=i&&i!=Or;if(!t!=!r){var n=e.display.dragFunctions,o=t?oe:ht;o(e.display.scroller,"dragstart",n.start),o(e.display.scroller,"dragenter",n.enter),o(e.display.scroller,"dragover",n.over),o(e.display.scroller,"dragleave",n.leave),o(e.display.scroller,"drop",n.drop)}}function Tc(e){e.options.lineWrapping?(Te(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ue(e.display.wrapper,"CodeMirror-wrap"),no(e)),vo(e),nt(e),ei(e),setTimeout(function(){return Er(e)},100)}function Ee(e,t){var i=this;if(!(this instanceof Ee))return new Ee(e,t);this.options=t=t?dt(t):{},dt(fs,t,!1);var r=t.value;typeof r=="string"?r=new ot(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new Ee.inputStyles[t.inputStyle](this),o=this.display=new Uf(e,r,n,t);o.wrapper.CodeMirror=this,us(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),dl(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Je,keySeq:null,specialChars:null},t.autofocus&&!B&&o.input.focus(),f&&p<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Mc(this),sc(),sr(this),this.curOp.forceUpdate=!0,Cl(this,r),t.autofocus&&!B||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&xo(i)},20):Sr(this);for(var s in rn)rn.hasOwnProperty(s)&&rn[s](this,t[s],Or);gl(this),t.finishInit&&t.finishInit(this);for(var h=0;h20*20}oe(t.scroller,"touchstart",function(v){if(!We(e,v)&&!o(v)&&!_o(e,v)){t.input.ensurePolled(),clearTimeout(i);var m=+new Date;t.activeTouch={start:m,moved:!1,prev:m-r.end<=300?r:null},v.touches.length==1&&(t.activeTouch.left=v.touches[0].pageX,t.activeTouch.top=v.touches[0].pageY)}}),oe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),oe(t.scroller,"touchend",function(v){var m=t.activeTouch;if(m&&!It(t,v)&&m.left!=null&&!m.moved&&new Date-m.start<300){var x=e.coordsChar(t.activeTouch,"page"),C;!m.prev||s(m,m.prev)?C=new ye(x,x):!m.prev.prev||s(m,m.prev.prev)?C=e.findWordAt(x):C=new ye(q(x.line,0),ce(e.doc,q(x.line+1,0))),e.setSelection(C.anchor,C.head),e.focus(),it(v)}n()}),oe(t.scroller,"touchcancel",n),oe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ii(e,t.scroller.scrollTop),ar(e,t.scroller.scrollLeft,!0),Ie(e,"scroll",e))}),oe(t.scroller,"mousewheel",function(v){return bl(e,v)}),oe(t.scroller,"DOMMouseScroll",function(v){return bl(e,v)}),oe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(v){We(e,v)||Xr(v)},over:function(v){We(e,v)||(lc(e,v),Xr(v))},start:function(v){return ac(e,v)},drop:Ue(e,oc),leave:function(v){We(e,v)||Kl(e)}};var h=t.input.getField();oe(h,"keyup",function(v){return is.call(e,v)}),oe(h,"keydown",Ue(e,rs)),oe(h,"keypress",Ue(e,ns)),oe(h,"focus",function(v){return xo(e,v)}),oe(h,"blur",function(v){return Sr(e,v)})}var Po=[];Ee.defineInitHook=function(e){return Po.push(e)};function Di(e,t,i,r){var n=e.doc,o;i==null&&(i="add"),i=="smart"&&(n.mode.indent?o=Zr(e,t).state:i="prev");var s=e.options.tabSize,h=re(n,t),v=Re(h.text,null,s);h.stateAfter&&(h.stateAfter=null);var m=h.text.match(/^\s*/)[0],x;if(!r&&!/\S/.test(h.text))x=0,i="not";else if(i=="smart"&&(x=n.mode.indent(o,h.text.slice(m.length),h.text),x==_e||x>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?x=Re(re(n,t-1).text,null,s):x=0:i=="add"?x=v+e.options.indentUnit:i=="subtract"?x=v-e.options.indentUnit:typeof i=="number"&&(x=v+i),x=Math.max(0,x);var C="",A=0;if(e.options.indentWithTabs)for(var F=Math.floor(x/s);F;--F)A+=s,C+=" ";if(As,v=Un(t),m=null;if(h&&r.ranges.length>1)if(wt&&wt.text.join(` +`)==t){if(r.ranges.length%wt.text.length==0){m=[];for(var x=0;x=0;A--){var F=r.ranges[A],R=F.from(),_=F.to();F.empty()&&(i&&i>0?R=q(R.line,R.ch-i):e.state.overwrite&&!h?_=q(_.line,Math.min(re(o,_.line).text.length,_.ch+me(v).length)):h&&wt&&wt.lineWise&&wt.text.join(` +`)==v.join(` +`)&&(R=_=q(R.line,0)));var j={from:R,to:_,text:m?m[A%m.length]:v,origin:n||(h?"paste":e.state.cutIncoming>s?"cut":"+input")};Tr(e.doc,j),qe(e,"inputRead",e,j)}t&&!h&&ds(e,t),Fr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=C),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function cs(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&ut(t,function(){return Wo(t,i,0,null,"paste")}),!0}function ds(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(!(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)){var o=e.getModeAt(n.head),s=!1;if(o.electricChars){for(var h=0;h-1){s=Di(e,n.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(re(e.doc,n.head.line).text.slice(0,n.head.ch))&&(s=Di(e,n.head.line,"smart"));s&&qe(e,"electricInput",e,n.head.line)}}}function hs(e){for(var t=[],i=[],r=0;ro&&(Di(this,h.head.line,r,!0),o=h.head.line,s==this.doc.sel.primIndex&&Fr(this));else{var v=h.from(),m=h.to(),x=Math.max(o,v.line);o=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var C=x;C0&&No(this.doc,s,new ye(v,A[s].to()),rt)}}}),getTokenAt:function(r,n){return ka(this,r,n)},getLineTokens:function(r,n){return ka(this,q(r),n,!0)},getTokenTypeAt:function(r){r=ce(this.doc,r);var n=Da(this,re(this.doc,r.line)),o=0,s=(n.length-1)/2,h=r.ch,v;if(h==0)v=n[2];else for(;;){var m=o+s>>1;if((m?n[m*2-1]:0)>=h)s=m;else if(n[m*2+1]v&&(r=v,s=!0),h=re(this.doc,r)}else h=r;return Ri(this,h,{top:0,left:0},n||"page",o||s).top+(s?this.doc.height-Nt(h):0)},defaultTextHeight:function(){return wr(this.display)},defaultCharWidth:function(){return kr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,o,s,h){var v=this.display;r=Dt(this,ce(this.doc,r));var m=r.bottom,x=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),v.sizer.appendChild(n),s=="over")m=r.top;else if(s=="above"||s=="near"){var C=Math.max(v.wrapper.clientHeight,this.doc.height),A=Math.max(v.sizer.clientWidth,v.lineSpace.clientWidth);(s=="above"||r.bottom+n.offsetHeight>C)&&r.top>n.offsetHeight?m=r.top-n.offsetHeight:r.bottom+n.offsetHeight<=C&&(m=r.bottom),x+n.offsetWidth>A&&(x=A-n.offsetWidth)}n.style.top=m+"px",n.style.left=n.style.right="",h=="right"?(x=v.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(h=="left"?x=0:h=="middle"&&(x=(v.sizer.clientWidth-n.offsetWidth)/2),n.style.left=x+"px"),o&&Lf(this,{left:x,top:m,right:x+n.offsetWidth,bottom:m+n.offsetHeight})},triggerOnKeyDown:$e(rs),triggerOnKeyPress:$e(ns),triggerOnKeyUp:is,triggerOnMouseDown:$e(os),execCommand:function(r){if(mi.hasOwnProperty(r))return mi[r].call(null,this)},triggerElectric:$e(function(r){ds(this,r)}),findPosH:function(r,n,o,s){var h=1;n<0&&(h=-1,n=-n);for(var v=ce(this.doc,r),m=0;m0&&x(o.charAt(s-1));)--s;for(;h.5||this.options.lineWrapping)&&vo(this),Ie(this,"refresh",this)}),swapDoc:$e(function(r){var n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),Cl(this,r),ei(this),this.display.input.reset(),ri(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,qe(this,"swapDoc",this,n),n}),phrase:function(r){var n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,r)?n[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},mr(e),e.registerHelper=function(r,n,o){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=o},e.registerGlobalHelper=function(r,n,o,s){e.registerHelper(r,n,s),i[r]._global.push({pred:o,val:s})}}function Uo(e,t,i,r,n){var o=t,s=i,h=re(e,t.line),v=n&&e.direction=="rtl"?-i:i;function m(){var Q=t.line+v;return Q=e.first+e.size?!1:(t=new q(Q,t.ch,t.sticky),h=re(e,Q))}function x(Q){var Z;if(r=="codepoint"){var $=h.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN($))Z=null;else{var ne=i>0?$>=55296&&$<56320:$>=56320&&$<57343;Z=new q(t.line,Math.max(0,Math.min(h.text.length,t.ch+i*(ne?2:1))),-i)}}else n?Z=hc(e.cm,h,t,i):Z=Oo(h,t,i);if(Z==null)if(!Q&&m())t=zo(n,e.cm,h,t.line,v);else return!1;else t=Z;return!0}if(r=="char"||r=="codepoint")x();else if(r=="column")x(!0);else if(r=="word"||r=="group")for(var C=null,A=r=="group",F=e.cm&&e.cm.getHelper(t,"wordChars"),R=!0;!(i<0&&!x(!R));R=!1){var _=h.text.charAt(t.ch)||` +`,j=Fi(_,F)?"w":A&&_==` +`?"n":!A||/\s/.test(_)?null:"p";if(A&&!R&&!j&&(j="s"),C&&C!=j){i<0&&(i=1,x(),t.sticky="after");break}if(j&&(C=j),i>0&&!x(!R))break}var Y=Ji(e,t,o,s,!0);return Qn(o,Y)&&(Y.hitSide=!0),Y}function gs(e,t,i,r){var n=e.doc,o=t.left,s;if(r=="page"){var h=Math.min(e.display.wrapper.clientHeight,he(e).innerHeight||n(e).documentElement.clientHeight),v=Math.max(h-.5*wr(e.display),3);s=(i>0?t.bottom:t.top)+i*v}else r=="line"&&(s=i>0?t.bottom+3:t.top-3);for(var m;m=co(e,o,s),!!m.outside;){if(i<0?s<=0:s>=n.height){m.hitSide=!0;break}s+=i*5}return m}var De=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Je,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};De.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;n.contentEditable=!0,qo(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(h){for(var v=h.target;v;v=v.parentNode){if(v==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(v.className))break}return!1}oe(n,"paste",function(h){!o(h)||We(r,h)||cs(h,r)||p<=11&&setTimeout(Ue(r,function(){return t.updateFromDOM()}),20)}),oe(n,"compositionstart",function(h){t.composing={data:h.data,done:!1}}),oe(n,"compositionupdate",function(h){t.composing||(t.composing={data:h.data,done:!1})}),oe(n,"compositionend",function(h){t.composing&&(h.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),oe(n,"touchstart",function(){return i.forceCompositionEnd()}),oe(n,"input",function(){t.composing||t.readFromDOMSoon()});function s(h){if(!(!o(h)||We(r,h))){if(r.somethingSelected())nn({lineWise:!1,text:r.getSelections()}),h.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var v=hs(r);nn({lineWise:!0,text:v.text}),h.type=="cut"&&r.operation(function(){r.setSelections(v.ranges,0,rt),r.replaceSelection("",null,"cut")})}else return;if(h.clipboardData){h.clipboardData.clearData();var m=wt.text.join(` +`);if(h.clipboardData.setData("Text",m),h.clipboardData.getData("Text")==m){h.preventDefault();return}}var x=ps(),C=x.firstChild;qo(C),r.display.lineSpace.insertBefore(x,r.display.lineSpace.firstChild),C.value=wt.text.join(` +`);var A=ve(be(n));S(C),setTimeout(function(){r.display.lineSpace.removeChild(x),A.focus(),A==n&&i.showPrimarySelection()},50)}}oe(n,"copy",s),oe(n,"cut",s)},De.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},De.prototype.prepareSelection=function(){var e=ol(this.cm,!1);return e.focus=ve(be(this.div))==this.div,e},De.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},De.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},De.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),n=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||n.line=t.display.viewFrom&&vs(t,r)||{node:h[0].measure.map[2],offset:0},m=n.linee.firstLine()&&(r=q(r.line-1,re(e.doc,r.line-1).length)),n.ch==re(e.doc,n.line).text.length&&n.linet.viewTo-1)return!1;var o,s,h;r.line==t.viewFrom||(o=or(e,r.line))==0?(s=xe(t.view[0].line),h=t.view[0].node):(s=xe(t.view[o].line),h=t.view[o-1].node.nextSibling);var v=or(e,n.line),m,x;if(v==t.view.length-1?(m=t.viewTo-1,x=t.lineDiv.lastChild):(m=xe(t.view[v+1].line)-1,x=t.view[v+1].node.previousSibling),!h)return!1;for(var C=e.doc.splitLines(Ic(e,h,x,s,m)),A=er(e.doc,q(s,0),q(m,re(e.doc,m).text.length));C.length>1&&A.length>1;)if(me(C)==me(A))C.pop(),A.pop(),m--;else if(C[0]==A[0])C.shift(),A.shift(),s++;else break;for(var F=0,R=0,_=C[0],j=A[0],Y=Math.min(_.length,j.length);Fr.ch&&Q.charCodeAt(Q.length-R-1)==Z.charCodeAt(Z.length-R-1);)F--,R++;C[C.length-1]=Q.slice(0,Q.length-R).replace(/^\u200b+/,""),C[0]=C[0].slice(F).replace(/\u200b+$/,"");var ne=q(s,F),ie=q(m,A.length?me(A).length-R:0);if(C.length>1||C[0]||fe(ne,ie))return Mr(e.doc,C,ne,ie,"+input"),!0},De.prototype.ensurePolled=function(){this.forceCompositionEnd()},De.prototype.reset=function(){this.forceCompositionEnd()},De.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},De.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},De.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ut(this.cm,function(){return nt(e.cm)})},De.prototype.setUneditable=function(e){e.contentEditable="false"},De.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ue(this.cm,Wo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},De.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},De.prototype.onContextMenu=function(){},De.prototype.resetPosition=function(){},De.prototype.needsContentAttribute=!0;function vs(e,t){var i=so(e,t.line);if(!i||i.hidden)return null;var r=re(e.doc,t.line),n=Ga(i,r,t.line),o=Mt(r,e.doc.direction),s="left";if(o){var h=Kr(o,t.ch);s=h%2?"right":"left"}var v=Ya(n.map,t.ch,s);return v.offset=v.collapse=="right"?v.end:v.start,v}function Nc(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function zr(e,t){return t&&(e.bad=!0),e}function Ic(e,t,i,r,n){var o="",s=!1,h=e.doc.lineSeparator(),v=!1;function m(F){return function(R){return R.id==F}}function x(){s&&(o+=h,v&&(o+=h),s=v=!1)}function C(F){F&&(x(),o+=F)}function A(F){if(F.nodeType==1){var R=F.getAttribute("cm-text");if(R){C(R);return}var _=F.getAttribute("cm-marker"),j;if(_){var Y=e.findMarks(q(r,0),q(n+1,0),m(+_));Y.length&&(j=Y[0].find(0))&&C(er(e.doc,j.from,j.to).join(h));return}if(F.getAttribute("contenteditable")=="false")return;var Q=/^(pre|div|p|li|table|br)$/i.test(F.nodeName);if(!/^br$/i.test(F.nodeName)&&F.textContent.length==0)return;Q&&x();for(var Z=0;Z=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),oe(n,"paste",function(s){We(r,s)||cs(s,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())});function o(s){if(!We(r,s)){if(r.somethingSelected())nn({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var h=hs(r);nn({lineWise:!0,text:h.text}),s.type=="cut"?r.setSelections(h.ranges,null,rt):(i.prevInput="",n.value=h.text.join(` +`),S(n))}else return;s.type=="cut"&&(r.state.cutIncoming=+new Date)}}oe(n,"cut",o),oe(n,"copy",o),oe(e.scroller,"paste",function(s){if(!(It(e,s)||We(r,s))){if(!n.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var h=new Event("paste");h.clipboardData=s.clipboardData,n.dispatchEvent(h)}}),oe(e.lineSpace,"selectstart",function(s){It(e,s)||it(s)}),oe(n,"compositionstart",function(){var s=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:s,range:r.markText(s,r.getCursor("to"),{className:"CodeMirror-composing"})}}),oe(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Ne.prototype.createField=function(e){this.wrapper=ps(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;qo(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Ne.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ne.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=ol(e);if(e.options.moveInputWithCursor){var n=Dt(e,i.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+s.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+s.left-o.left))}return r},Ne.prototype.showSelection=function(e){var t=this.cm,i=t.display;de(i.cursorDiv,e.cursors),de(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ne.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&S(this.textarea),f&&p>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",f&&p>=9&&(this.hasSelection=null));this.resetting=!1}},Ne.prototype.getField=function(){return this.textarea},Ne.prototype.supportsTouch=function(){return!1},Ne.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!B||ve(be(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},Ne.prototype.blur=function(){this.textarea.blur()},Ne.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ne.prototype.receivedFocus=function(){this.slowPoll()},Ne.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ne.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},Ne.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Nu(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(f&&p>=9&&this.hasSelection===n||I&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=n.charCodeAt(0);if(o==8203&&!r&&(r="\u200B"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var s=0,h=Math.min(r.length,n.length);s1e3||n.indexOf(` +`)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ne.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ne.prototype.onKeyPress=function(){f&&p>=9&&(this.hasSelection=null),this.fastPoll()},Ne.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=nr(i,e),s=r.scroller.scrollTop;if(!o||M)return;var h=i.options.resetSelectionOnContextMenu;h&&i.doc.sel.contains(o)==-1&&Ue(i,Ze)(i.doc,jt(o),rt);var v=n.style.cssText,m=t.wrapper.style.cssText,x=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-x.top-5)+"px; left: "+(e.clientX-x.left-5)+`px; z-index: 1000; background: `+(f?"rgba(255, 255, 255, .05)":"transparent")+`; - outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var C;y&&(C=n.ownerDocument.defaultView.scrollY),r.input.focus(),y&&n.ownerDocument.defaultView.scrollTo(null,C),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=F,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function A(){if(n.selectionStart!=null){var P=i.somethingSelected(),j="\u200B"+(P?n.value:"");n.value="\u21DA",n.value=j,t.prevInput=P?"":"\u200B",n.selectionStart=1,n.selectionEnd=j.length,r.selForContextMenu=i.doc.sel}}function F(){if(t.contextMenuPending==F&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,n.style.cssText=g,f&&p<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=s),n.selectionStart!=null)){(!f||f&&p<9)&&A();var P=0,j=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="\u200B"?Ue(i,Il)(i):P++<10?r.detectingSelectAll=setTimeout(j,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(j,200)}}if(f&&p>=9&&A(),ge){Xr(e);var R=function(){ht(window,"mouseup",R),setTimeout(F,20)};oe(window,"mouseup",R)}else setTimeout(F,50)},Ne.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ne.prototype.setUneditable=function(){},Ne.prototype.needsContentAttribute=!1;function zc(e,t){if(t=t?dt(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=ve(be(e));t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=d.getValue()}var n;if(e.form&&(oe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;n=o.submit;try{var s=o.submit=function(){r(),o.submit=n,o.submit(),o.submit=s}}catch{}}t.finishInit=function(g){g.save=r,g.getTextArea=function(){return e},g.toTextArea=function(){g.toTextArea=isNaN,r(),e.parentNode.removeChild(g.getWrapperElement()),e.style.display="",e.form&&(ht(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var d=Ee(function(g){return e.parentNode.insertBefore(g,e.nextSibling)},t);return d}function Oc(e){e.off=ht,e.on=oe,e.wheelEventPixels=Uf,e.Doc=ot,e.splitLines=Un,e.countColumn=Re,e.findColumn=St,e.isWordChar=On,e.Pass=Pe,e.signal=Ie,e.Line=xr,e.changeEnd=Gt,e.scrollbarModel=fl,e.Pos=q,e.cmpPos=fe,e.modes=Gn,e.mimeModes=br,e.resolveMode=Ei,e.getMode=Kn,e.modeExtensions=yr,e.extendMode=Hu,e.copyState=Vt,e.startState=va,e.innerMode=Xn,e.commands=mi,e.keyMap=Ot,e.keyName=Ql,e.isModifierKey=Yl,e.lookupKey=Nr,e.normalizeKeyMap=cc,e.StringStream=ze,e.SharedTextMarker=pi,e.TextMarker=Xt,e.LineWidget=hi,e.e_preventDefault=it,e.e_stopPropagation=pa,e.e_stop=Xr,e.addClass=Te,e.contains=V,e.rmClass=ue,e.keyNames=Yt}Ec(Ee),Mc(Ee);var Hc="iter insert remove copy getEditor constructor".split(" ");for(var an in ot.prototype)ot.prototype.hasOwnProperty(an)&&Fe(Hc,an)<0&&(Ee.prototype[an]=function(e){return function(){return e.apply(this.doc,arguments)}}(ot.prototype[an]));return mr(ot),Ee.inputStyles={textarea:Ne,contenteditable:De},Ee.defineMode=function(e){!Ee.defaults.mode&&e!="null"&&(Ee.defaults.mode=e),zu.apply(this,arguments)},Ee.defineMIME=Ou,Ee.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ee.defineMIME("text/plain","null"),Ee.defineExtension=function(e,t){Ee.prototype[e]=t},Ee.defineDocExtension=function(e,t){ot.prototype[e]=t},Ee.fromTextArea=zc,Oc(Ee),Ee.version="5.65.21",Ee})});var ys=Ye((ms,bs)=>{(function(a){typeof ms=="object"&&typeof bs=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";var h=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,c=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,l=/[*+-]\s/;a.commands.newlineAndIndentContinueMarkdownList=function(v){if(v.getOption("disableInput"))return a.Pass;for(var f=v.listSelections(),p=[],y=0;y\s*$/.test(O),B=!/>\s*$/.test(O);(L||B)&&v.replaceRange("",{line:w.line,ch:0},{line:w.line,ch:w.ch+1}),p[y]=` -`}else{var I=z[1],H=z[5],_=!(l.test(z[2])||z[2].indexOf(">")>=0),X=_?parseInt(z[3],10)+1+z[4]:z[2].replace("x"," ");p[y]=` -`+I+X+H,_&&u(v,w)}}v.replaceSelections(p)};function u(v,f){var p=f.line,y=0,w=0,D=h.exec(v.getLine(p)),T=D[1];do{y+=1;var M=p+y,N=v.getLine(M),O=h.exec(N);if(O){var z=O[1],k=parseInt(D[3],10)+y-w,L=parseInt(O[3],10),B=L;if(T===z&&!isNaN(L))k===L&&(B=L+1),k>L&&(B=k+1),v.replaceRange(N.replace(h,z+B+O[4]+O[5]),{line:M,ch:0},{line:M,ch:N.length});else{if(T.length>z.length||T.length{var xs=ct();xs.commands.tabAndIndentMarkdownList=function(a){var h=a.listSelections(),c=h[0].head,l=a.getStateAfter(c.line),u=l.list!==!1;if(u){a.execCommand("indentMore");return}if(a.options.indentWithTabs)a.execCommand("insertTab");else{var v=Array(a.options.tabSize+1).join(" ");a.replaceSelection(v)}};xs.commands.shiftTabAndUnindentMarkdownList=function(a){var h=a.listSelections(),c=h[0].head,l=a.getStateAfter(c.line),u=l.list!==!1;if(u){a.execCommand("indentLess");return}if(a.options.indentWithTabs)a.execCommand("insertTab");else{var v=Array(a.options.tabSize+1).join(" ");a.replaceSelection(v)}}});var ks=Ye((Cs,ws)=>{(function(a){typeof Cs=="object"&&typeof ws=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.defineOption("fullScreen",!1,function(l,u,v){v==a.Init&&(v=!1),!v!=!u&&(u?h(l):c(l))});function h(l){var u=l.getWrapperElement();l.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:u.style.width,height:u.style.height},u.style.width="",u.style.height="auto",u.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",l.refresh()}function c(l){var u=l.getWrapperElement();u.className=u.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var v=l.state.fullScreenRestore;u.style.width=v.width,u.style.height=v.height,window.scrollTo(v.scrollLeft,v.scrollTop),l.refresh()}})});var Yo=Ye((Ss,Fs)=>{(function(a){typeof Ss=="object"&&typeof Fs=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";var h={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},c={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};a.defineMode("xml",function(l,u){var v=l.indentUnit,f={},p=u.htmlMode?h:c;for(var y in p)f[y]=p[y];for(var y in u)f[y]=u[y];var w,D;function T(E,U){function W(Te){return U.tokenize=Te,Te(E,U)}var V=E.next();if(V=="<")return E.eat("!")?E.eat("[")?E.match("CDATA[")?W(O("atom","]]>")):null:E.match("--")?W(O("comment","-->")):E.match("DOCTYPE",!0,!0)?(E.eatWhile(/[\w\._\-]/),W(z(1))):null:E.eat("?")?(E.eatWhile(/[\w\._\-]/),U.tokenize=O("meta","?>"),"meta"):(w=E.eat("/")?"closeTag":"openTag",U.tokenize=M,"tag bracket");if(V=="&"){var ve;return E.eat("#")?E.eat("x")?ve=E.eatWhile(/[a-fA-F\d]/)&&E.eat(";"):ve=E.eatWhile(/[\d]/)&&E.eat(";"):ve=E.eatWhile(/[\w\.\-:]/)&&E.eat(";"),ve?"atom":"error"}else return E.eatWhile(/[^&<]/),null}T.isInText=!0;function M(E,U){var W=E.next();if(W==">"||W=="/"&&E.eat(">"))return U.tokenize=T,w=W==">"?"endTag":"selfcloseTag","tag bracket";if(W=="=")return w="equals",null;if(W=="<"){U.tokenize=T,U.state=H,U.tagName=U.tagStart=null;var V=U.tokenize(E,U);return V?V+" tag error":"tag error"}else return/[\'\"]/.test(W)?(U.tokenize=N(W),U.stringStartCol=E.column(),U.tokenize(E,U)):(E.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function N(E){var U=function(W,V){for(;!W.eol();)if(W.next()==E){V.tokenize=M;break}return"string"};return U.isInAttribute=!0,U}function O(E,U){return function(W,V){for(;!W.eol();){if(W.match(U)){V.tokenize=T;break}W.next()}return E}}function z(E){return function(U,W){for(var V;(V=U.next())!=null;){if(V=="<")return W.tokenize=z(E+1),W.tokenize(U,W);if(V==">")if(E==1){W.tokenize=T;break}else return W.tokenize=z(E-1),W.tokenize(U,W)}return"meta"}}function k(E){return E&&E.toLowerCase()}function L(E,U,W){this.prev=E.context,this.tagName=U||"",this.indent=E.indented,this.startOfLine=W,(f.doNotIndent.hasOwnProperty(U)||E.context&&E.context.noIndent)&&(this.noIndent=!0)}function B(E){E.context&&(E.context=E.context.prev)}function I(E,U){for(var W;;){if(!E.context||(W=E.context.tagName,!f.contextGrabbers.hasOwnProperty(k(W))||!f.contextGrabbers[k(W)].hasOwnProperty(k(U))))return;B(E)}}function H(E,U,W){return E=="openTag"?(W.tagStart=U.column(),_):E=="closeTag"?X:H}function _(E,U,W){return E=="word"?(W.tagName=U.current(),D="tag",G):f.allowMissingTagName&&E=="endTag"?(D="tag bracket",G(E,U,W)):(D="error",_)}function X(E,U,W){if(E=="word"){var V=U.current();return W.context&&W.context.tagName!=V&&f.implicitlyClosed.hasOwnProperty(k(W.context.tagName))&&B(W),W.context&&W.context.tagName==V||f.matchClosing===!1?(D="tag",K):(D="tag error",ge)}else return f.allowMissingTagName&&E=="endTag"?(D="tag bracket",K(E,U,W)):(D="error",ge)}function K(E,U,W){return E!="endTag"?(D="error",K):(B(W),H)}function ge(E,U,W){return D="error",K(E,U,W)}function G(E,U,W){if(E=="word")return D="attribute",ue;if(E=="endTag"||E=="selfcloseTag"){var V=W.tagName,ve=W.tagStart;return W.tagName=W.tagStart=null,E=="selfcloseTag"||f.autoSelfClosers.hasOwnProperty(k(V))?I(W,V):(I(W,V),W.context=new L(W,V,ve==W.indented)),H}return D="error",G}function ue(E,U,W){return E=="equals"?ae:(f.allowMissing||(D="error"),G(E,U,W))}function ae(E,U,W){return E=="string"?de:E=="word"&&f.allowUnquoted?(D="string",G):(D="error",G(E,U,W))}function de(E,U,W){return E=="string"?de:G(E,U,W)}return{startState:function(E){var U={tokenize:T,state:H,indented:E||0,tagName:null,tagStart:null,context:null};return E!=null&&(U.baseIndent=E),U},token:function(E,U){if(!U.tagName&&E.sol()&&(U.indented=E.indentation()),E.eatSpace())return null;w=null;var W=U.tokenize(E,U);return(W||w)&&W!="comment"&&(D=null,U.state=U.state(w||W,E,U),D&&(W=D=="error"?W+" error":D)),W},indent:function(E,U,W){var V=E.context;if(E.tokenize.isInAttribute)return E.tagStart==E.indented?E.stringStartCol+1:E.indented+v;if(V&&V.noIndent)return a.Pass;if(E.tokenize!=M&&E.tokenize!=T)return W?W.match(/^(\s*)/)[0].length:0;if(E.tagName)return f.multilineTagIndentPastTag!==!1?E.tagStart+E.tagName.length+2:E.tagStart+v*(f.multilineTagIndentFactor||1);if(f.alignCDATA&&/$/,blockCommentStart:"",configuration:f.htmlMode?"html":"xml",helperType:f.htmlMode?"html":"xml",skipAttribute:function(E){E.state==ae&&(E.state=G)},xmlCurrentTag:function(E){return E.tagName?{name:E.tagName,close:E.type=="closeTag"}:null},xmlCurrentContext:function(E){for(var U=[],W=E.context;W;W=W.prev)U.push(W.tagName);return U.reverse()}}}),a.defineMIME("text/xml","xml"),a.defineMIME("application/xml","xml"),a.mimeModes.hasOwnProperty("text/html")||a.defineMIME("text/html",{name:"xml",htmlMode:!0})})});var Ls=Ye((Es,As)=>{(function(a){typeof Es=="object"&&typeof As=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var h=0;h-1&&l.substring(f+1,l.length);if(p)return a.findModeByExtension(p)},a.findModeByName=function(l){l=l.toLowerCase();for(var u=0;u{(function(a){typeof Ts=="object"&&typeof Ms=="object"?a(ct(),Yo(),Ls()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],a):a(CodeMirror)})(function(a){"use strict";a.defineMode("markdown",function(h,c){var l=a.getMode(h,"text/html"),u=l.name=="null";function v(S){if(a.findModeByName){var b=a.findModeByName(S);b&&(S=b.mime||b.mimes[0])}var ee=a.getMode(h,S);return ee.name=="null"?null:ee}c.highlightFormatting===void 0&&(c.highlightFormatting=!1),c.maxBlockquoteDepth===void 0&&(c.maxBlockquoteDepth=0),c.taskLists===void 0&&(c.taskLists=!1),c.strikethrough===void 0&&(c.strikethrough=!1),c.emoji===void 0&&(c.emoji=!1),c.fencedCodeBlockHighlighting===void 0&&(c.fencedCodeBlockHighlighting=!0),c.fencedCodeBlockDefaultMode===void 0&&(c.fencedCodeBlockDefaultMode="text/plain"),c.xml===void 0&&(c.xml=!0),c.tokenTypeOverrides===void 0&&(c.tokenTypeOverrides={});var f={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var p in f)f.hasOwnProperty(p)&&c.tokenTypeOverrides[p]&&(f[p]=c.tokenTypeOverrides[p]);var y=/^([*\-_])(?:\s*\1){2,}\s*$/,w=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,D=/^\[(x| )\](?=\s)/i,T=c.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,M=/^ {0,3}(?:\={1,}|-{2,})\s*$/,N=/^[^#!\[\]*_\\<>` "'(~:]+/,O=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,z=/^\s*\[[^\]]+?\]:.*$/,k=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,L=" ";function B(S,b,ee){return b.f=b.inline=ee,ee(S,b)}function I(S,b,ee){return b.f=b.block=ee,ee(S,b)}function H(S){return!S||!/\S/.test(S.string)}function _(S){if(S.linkTitle=!1,S.linkHref=!1,S.linkText=!1,S.em=!1,S.strong=!1,S.strikethrough=!1,S.quote=0,S.indentedCode=!1,S.f==K){var b=u;if(!b){var ee=a.innerMode(l,S.htmlState);b=ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText}b&&(S.f=ae,S.block=X,S.htmlState=null)}return S.trailingSpace=0,S.trailingSpaceNewLine=!1,S.prevLine=S.thisLine,S.thisLine={stream:null},null}function X(S,b){var ee=S.column()===b.indentation,be=H(b.prevLine.stream),he=b.indentedCode,tt=b.prevLine.hr,dt=b.list!==!1,Re=(b.listStack[b.listStack.length-1]||0)+3;b.indentedCode=!1;var Je=b.indentation;if(b.indentationDiff===null&&(b.indentationDiff=b.indentation,dt)){for(b.list=null;Je=4&&(he||b.prevLine.fencedCodeEnd||b.prevLine.header||be))return S.skipToEnd(),b.indentedCode=!0,f.code;if(S.eatSpace())return null;if(ee&&b.indentation<=Re&&(Pe=S.match(T))&&Pe[1].length<=6)return b.quote=0,b.header=Pe[1].length,b.thisLine.header=!0,c.highlightFormatting&&(b.formatting="header"),b.f=b.inline,G(b);if(b.indentation<=Re&&S.eat(">"))return b.quote=ee?1:b.quote+1,c.highlightFormatting&&(b.formatting="quote"),S.eatSpace(),G(b);if(!Me&&!b.setext&&ee&&b.indentation<=Re&&(Pe=S.match(w))){var rt=Pe[1]?"ol":"ul";return b.indentation=Je+S.current().length,b.list=!0,b.quote=0,b.listStack.push(b.indentation),b.em=!1,b.strong=!1,b.code=!1,b.strikethrough=!1,c.taskLists&&S.match(D,!1)&&(b.taskList=!0),b.f=b.inline,c.highlightFormatting&&(b.formatting=["list","list-"+rt]),G(b)}else{if(ee&&b.indentation<=Re&&(Pe=S.match(O,!0)))return b.quote=0,b.fencedEndRE=new RegExp(Pe[1]+"+ *$"),b.localMode=c.fencedCodeBlockHighlighting&&v(Pe[2]||c.fencedCodeBlockDefaultMode),b.localMode&&(b.localState=a.startState(b.localMode)),b.f=b.block=ge,c.highlightFormatting&&(b.formatting="code-block"),b.code=-1,G(b);if(b.setext||(!Fe||!dt)&&!b.quote&&b.list===!1&&!b.code&&!Me&&!z.test(S.string)&&(Pe=S.lookAhead(1))&&(Pe=Pe.match(M)))return b.setext?(b.header=b.setext,b.setext=0,S.skipToEnd(),c.highlightFormatting&&(b.formatting="header")):(b.header=Pe[0].charAt(0)=="="?1:2,b.setext=b.header),b.thisLine.header=!0,b.f=b.inline,G(b);if(Me)return S.skipToEnd(),b.hr=!0,b.thisLine.hr=!0,f.hr;if(S.peek()==="[")return B(S,b,V)}return B(S,b,b.inline)}function K(S,b){var ee=l.token(S,b.htmlState);if(!u){var be=a.innerMode(l,b.htmlState);(be.mode.name=="xml"&&be.state.tagStart===null&&!be.state.context&&be.state.tokenize.isInText||b.md_inside&&S.current().indexOf(">")>-1)&&(b.f=ae,b.block=X,b.htmlState=null)}return ee}function ge(S,b){var ee=b.listStack[b.listStack.length-1]||0,be=b.indentation=S.quote?b.push(f.formatting+"-"+S.formatting[ee]+"-"+S.quote):b.push("error"))}if(S.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(S.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(S.linkHref?b.push(f.linkHref,"url"):(S.strong&&b.push(f.strong),S.em&&b.push(f.em),S.strikethrough&&b.push(f.strikethrough),S.emoji&&b.push(f.emoji),S.linkText&&b.push(f.linkText),S.code&&b.push(f.code),S.image&&b.push(f.image),S.imageAltText&&b.push(f.imageAltText,"link"),S.imageMarker&&b.push(f.imageMarker)),S.header&&b.push(f.header,f.header+"-"+S.header),S.quote&&(b.push(f.quote),!c.maxBlockquoteDepth||c.maxBlockquoteDepth>=S.quote?b.push(f.quote+"-"+S.quote):b.push(f.quote+"-"+c.maxBlockquoteDepth)),S.list!==!1){var be=(S.listStack.length-1)%3;be?be===1?b.push(f.list2):b.push(f.list3):b.push(f.list1)}return S.trailingSpaceNewLine?b.push("trailing-space-new-line"):S.trailingSpace&&b.push("trailing-space-"+(S.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function ue(S,b){if(S.match(N,!0))return G(b)}function ae(S,b){var ee=b.text(S,b);if(typeof ee<"u")return ee;if(b.list)return b.list=null,G(b);if(b.taskList){var be=S.match(D,!0)[1]===" ";return be?b.taskOpen=!0:b.taskClosed=!0,c.highlightFormatting&&(b.formatting="task"),b.taskList=!1,G(b)}if(b.taskOpen=!1,b.taskClosed=!1,b.header&&S.match(/^#+$/,!0))return c.highlightFormatting&&(b.formatting="header"),G(b);var he=S.next();if(b.linkTitle){b.linkTitle=!1;var tt=he;he==="("&&(tt=")"),tt=(tt+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var dt="^\\s*(?:[^"+tt+"\\\\]+|\\\\\\\\|\\\\.)"+tt;if(S.match(new RegExp(dt),!0))return f.linkHref}if(he==="`"){var Re=b.formatting;c.highlightFormatting&&(b.formatting="code"),S.eatWhile("`");var Je=S.current().length;if(b.code==0&&(!b.quote||Je==1))return b.code=Je,G(b);if(Je==b.code){var Fe=G(b);return b.code=0,Fe}else return b.formatting=Re,G(b)}else if(b.code)return G(b);if(he==="\\"&&(S.next(),c.highlightFormatting)){var Me=G(b),Pe=f.formatting+"-escape";return Me?Me+" "+Pe:Pe}if(he==="!"&&S.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.imageMarker=!0,b.image=!0,c.highlightFormatting&&(b.formatting="image"),G(b);if(he==="["&&b.imageMarker&&S.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return b.imageMarker=!1,b.imageAltText=!0,c.highlightFormatting&&(b.formatting="image"),G(b);if(he==="]"&&b.imageAltText){c.highlightFormatting&&(b.formatting="image");var Me=G(b);return b.imageAltText=!1,b.image=!1,b.inline=b.f=E,Me}if(he==="["&&!b.image)return b.linkText&&S.match(/^.*?\]/)||(b.linkText=!0,c.highlightFormatting&&(b.formatting="link")),G(b);if(he==="]"&&b.linkText){c.highlightFormatting&&(b.formatting="link");var Me=G(b);return b.linkText=!1,b.inline=b.f=S.match(/\(.*?\)| ?\[.*?\]/,!1)?E:ae,Me}if(he==="<"&&S.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=de,c.highlightFormatting&&(b.formatting="link");var Me=G(b);return Me?Me+=" ":Me="",Me+f.linkInline}if(he==="<"&&S.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=de,c.highlightFormatting&&(b.formatting="link");var Me=G(b);return Me?Me+=" ":Me="",Me+f.linkEmail}if(c.xml&&he==="<"&&S.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var rt=S.string.indexOf(">",S.pos);if(rt!=-1){var Ur=S.string.substring(S.start,rt);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ur)&&(b.md_inside=!0)}return S.backUp(1),b.htmlState=a.startState(l),I(S,b,K)}if(c.xml&&he==="<"&&S.match(/^\/\w*?>/))return b.md_inside=!1,"tag";if(he==="*"||he==="_"){for(var kt=1,St=S.pos==1?" ":S.string.charAt(S.pos-2);kt<3&&S.eat(he);)kt++;var bt=S.peek()||" ",Pt=!/\s/.test(bt)&&(!k.test(bt)||/\s/.test(St)||k.test(St)),me=!/\s/.test(St)&&(!k.test(St)||/\s/.test(bt)||k.test(bt)),yt=null,_t=null;if(kt%2&&(!b.em&&Pt&&(he==="*"||!me||k.test(St))?yt=!0:b.em==he&&me&&(he==="*"||!Pt||k.test(bt))&&(yt=!1)),kt>1&&(!b.strong&&Pt&&(he==="*"||!me||k.test(St))?_t=!0:b.strong==he&&me&&(he==="*"||!Pt||k.test(bt))&&(_t=!1)),_t!=null||yt!=null){c.highlightFormatting&&(b.formatting=yt==null?"strong":_t==null?"em":"strong em"),yt===!0&&(b.em=he),_t===!0&&(b.strong=he);var Fe=G(b);return yt===!1&&(b.em=!1),_t===!1&&(b.strong=!1),Fe}}else if(he===" "&&(S.eat("*")||S.eat("_"))){if(S.peek()===" ")return G(b);S.backUp(1)}if(c.strikethrough){if(he==="~"&&S.eatWhile(he)){if(b.strikethrough){c.highlightFormatting&&(b.formatting="strikethrough");var Fe=G(b);return b.strikethrough=!1,Fe}else if(S.match(/^[^\s]/,!1))return b.strikethrough=!0,c.highlightFormatting&&(b.formatting="strikethrough"),G(b)}else if(he===" "&&S.match("~~",!0)){if(S.peek()===" ")return G(b);S.backUp(2)}}if(c.emoji&&he===":"&&S.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){b.emoji=!0,c.highlightFormatting&&(b.formatting="emoji");var Si=G(b);return b.emoji=!1,Si}return he===" "&&(S.match(/^ +$/,!1)?b.trailingSpace++:b.trailingSpace&&(b.trailingSpaceNewLine=!0)),G(b)}function de(S,b){var ee=S.next();if(ee===">"){b.f=b.inline=ae,c.highlightFormatting&&(b.formatting="link");var be=G(b);return be?be+=" ":be="",be+f.linkInline}return S.match(/^[^>]+/,!0),f.linkInline}function E(S,b){if(S.eatSpace())return null;var ee=S.next();return ee==="("||ee==="["?(b.f=b.inline=W(ee==="("?")":"]"),c.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,G(b)):"error"}var U={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function W(S){return function(b,ee){var be=b.next();if(be===S){ee.f=ee.inline=ae,c.highlightFormatting&&(ee.formatting="link-string");var he=G(ee);return ee.linkHref=!1,he}return b.match(U[S]),ee.linkHref=!0,G(ee)}}function V(S,b){return S.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=ve,S.next(),c.highlightFormatting&&(b.formatting="link"),b.linkText=!0,G(b)):B(S,b,ae)}function ve(S,b){if(S.match("]:",!0)){b.f=b.inline=Te,c.highlightFormatting&&(b.formatting="link");var ee=G(b);return b.linkText=!1,ee}return S.match(/^([^\]\\]|\\.)+/,!0),f.linkText}function Te(S,b){return S.eatSpace()?null:(S.match(/^[^\s]+/,!0),S.peek()===void 0?b.linkTitle=!0:S.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),b.f=b.inline=ae,f.linkHref+" url")}var vt={startState:function(){return{f:X,prevLine:{stream:null},thisLine:{stream:null},block:X,htmlState:null,indentation:0,inline:ae,text:ue,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(S){return{f:S.f,prevLine:S.prevLine,thisLine:S.thisLine,block:S.block,htmlState:S.htmlState&&a.copyState(l,S.htmlState),indentation:S.indentation,localMode:S.localMode,localState:S.localMode?a.copyState(S.localMode,S.localState):null,inline:S.inline,text:S.text,formatting:!1,linkText:S.linkText,linkTitle:S.linkTitle,linkHref:S.linkHref,code:S.code,em:S.em,strong:S.strong,strikethrough:S.strikethrough,emoji:S.emoji,header:S.header,setext:S.setext,hr:S.hr,taskList:S.taskList,list:S.list,listStack:S.listStack.slice(0),quote:S.quote,indentedCode:S.indentedCode,trailingSpace:S.trailingSpace,trailingSpaceNewLine:S.trailingSpaceNewLine,md_inside:S.md_inside,fencedEndRE:S.fencedEndRE}},token:function(S,b){if(b.formatting=!1,S!=b.thisLine.stream){if(b.header=0,b.hr=!1,S.match(/^\s*$/,!0))return _(b),null;if(b.prevLine=b.thisLine,b.thisLine={stream:S},b.taskList=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,!b.localState&&(b.f=b.block,b.f!=K)){var ee=S.match(/^\s*/,!0)[0].replace(/\t/g,L).length;if(b.indentation=ee,b.indentationDiff=null,ee>0)return null}}return b.f(S,b)},innerMode:function(S){return S.block==K?{state:S.htmlState,mode:l}:S.localState?{state:S.localState,mode:S.localMode}:{state:S,mode:vt}},indent:function(S,b,ee){return S.block==K&&l.indent?l.indent(S.htmlState,b,ee):S.localState&&S.localMode.indent?S.localMode.indent(S.localState,b,ee):a.Pass},blankLine:_,getType:G,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return vt},"xml"),a.defineMIME("text/markdown","markdown"),a.defineMIME("text/x-markdown","markdown")})});var Qo=Ye((Bs,Ns)=>{(function(a){typeof Bs=="object"&&typeof Ns=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.overlayMode=function(h,c,l){return{startState:function(){return{base:a.startState(h),overlay:a.startState(c),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(u){return{base:a.copyState(h,u.base),overlay:a.copyState(c,u.overlay),basePos:u.basePos,baseCur:null,overlayPos:u.overlayPos,overlayCur:null}},token:function(u,v){return(u!=v.streamSeen||Math.min(v.basePos,v.overlayPos){(function(a){typeof Is=="object"&&typeof zs=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){a.defineOption("placeholder","",function(p,y,w){var D=w&&w!=a.Init;if(y&&!D)p.on("blur",u),p.on("change",v),p.on("swapDoc",v),a.on(p.getInputField(),"compositionupdate",p.state.placeholderCompose=function(){l(p)}),v(p);else if(!y&&D){p.off("blur",u),p.off("change",v),p.off("swapDoc",v),a.off(p.getInputField(),"compositionupdate",p.state.placeholderCompose),h(p);var T=p.getWrapperElement();T.className=T.className.replace(" CodeMirror-empty","")}y&&!p.hasFocus()&&u(p)});function h(p){p.state.placeholder&&(p.state.placeholder.parentNode.removeChild(p.state.placeholder),p.state.placeholder=null)}function c(p){h(p);var y=p.state.placeholder=document.createElement("pre");y.style.cssText="height: 0; overflow: visible",y.style.direction=p.getOption("direction"),y.className="CodeMirror-placeholder CodeMirror-line-like";var w=p.getOption("placeholder");typeof w=="string"&&(w=document.createTextNode(w)),y.appendChild(w),p.display.lineSpace.insertBefore(y,p.display.lineSpace.firstChild)}function l(p){setTimeout(function(){var y=!1;if(p.lineCount()==1){var w=p.getInputField();y=w.nodeName=="TEXTAREA"?!p.getLine(0).length:!/[^\u200b]/.test(w.querySelector(".CodeMirror-line").textContent)}y?c(p):h(p)},20)}function u(p){f(p)&&c(p)}function v(p){var y=p.getWrapperElement(),w=f(p);y.className=y.className.replace(" CodeMirror-empty","")+(w?" CodeMirror-empty":""),w?c(p):h(p)}function f(p){return p.lineCount()===1&&p.getLine(0)===""}})});var Ps=Ye((Hs,Rs)=>{(function(a){typeof Hs=="object"&&typeof Rs=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.defineOption("autoRefresh",!1,function(l,u){l.state.autoRefresh&&(c(l,l.state.autoRefresh),l.state.autoRefresh=null),u&&l.display.wrapper.offsetHeight==0&&h(l,l.state.autoRefresh={delay:u.delay||250})});function h(l,u){function v(){l.display.wrapper.offsetHeight?(c(l,u),l.display.lastWrapHeight!=l.display.wrapper.clientHeight&&l.refresh()):u.timeout=setTimeout(v,u.delay)}u.timeout=setTimeout(v,u.delay),u.hurry=function(){clearTimeout(u.timeout),u.timeout=setTimeout(v,50)},a.on(window,"mouseup",u.hurry),a.on(window,"keyup",u.hurry)}function c(l,u){clearTimeout(u.timeout),a.off(window,"mouseup",u.hurry),a.off(window,"keyup",u.hurry)}})});var qs=Ye((_s,Ws)=>{(function(a){typeof _s=="object"&&typeof Ws=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.defineOption("styleSelectedText",!1,function(D,T,M){var N=M&&M!=a.Init;T&&!N?(D.state.markedSelection=[],D.state.markedSelectionStyle=typeof T=="string"?T:"CodeMirror-selectedtext",y(D),D.on("cursorActivity",h),D.on("change",c)):!T&&N&&(D.off("cursorActivity",h),D.off("change",c),p(D),D.state.markedSelection=D.state.markedSelectionStyle=null)});function h(D){D.state.markedSelection&&D.operation(function(){w(D)})}function c(D){D.state.markedSelection&&D.state.markedSelection.length&&D.operation(function(){p(D)})}var l=8,u=a.Pos,v=a.cmpPos;function f(D,T,M,N){if(v(T,M)!=0)for(var O=D.state.markedSelection,z=D.state.markedSelectionStyle,k=T.line;;){var L=k==T.line?T:u(k,0),B=k+l,I=B>=M.line,H=I?M:u(B,0),_=D.markText(L,H,{className:z});if(N==null?O.push(_):O.splice(N++,0,_),I)break;k=B}}function p(D){for(var T=D.state.markedSelection,M=0;M1)return y(D);var T=D.getCursor("start"),M=D.getCursor("end"),N=D.state.markedSelection;if(!N.length)return f(D,T,M);var O=N[0].find(),z=N[N.length-1].find();if(!O||!z||M.line-T.line<=l||v(T,z.to)>=0||v(M,O.from)<=0)return y(D);for(;v(T,O.from)>0;)N.shift().clear(),O=N[0].find();for(v(T,O.from)<0&&(O.to.line-T.line0&&(M.line-z.from.line{(function(a){typeof Us=="object"&&typeof js=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";var h=a.Pos;function c(k){var L=k.flags;return L??(k.ignoreCase?"i":"")+(k.global?"g":"")+(k.multiline?"m":"")}function l(k,L){for(var B=c(k),I=B,H=0;HX);K++){var ge=k.getLine(_++);I=I==null?ge:I+` + outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var C;y&&(C=n.ownerDocument.defaultView.scrollY),r.input.focus(),y&&n.ownerDocument.defaultView.scrollTo(null,C),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=F,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function A(){if(n.selectionStart!=null){var _=i.somethingSelected(),j="\u200B"+(_?n.value:"");n.value="\u21DA",n.value=j,t.prevInput=_?"":"\u200B",n.selectionStart=1,n.selectionEnd=j.length,r.selForContextMenu=i.doc.sel}}function F(){if(t.contextMenuPending==F&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,n.style.cssText=v,f&&p<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=s),n.selectionStart!=null)){(!f||f&&p<9)&&A();var _=0,j=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="\u200B"?Ue(i,Ol)(i):_++<10?r.detectingSelectAll=setTimeout(j,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(j,200)}}if(f&&p>=9&&A(),ge){Xr(e);var R=function(){ht(window,"mouseup",R),setTimeout(F,20)};oe(window,"mouseup",R)}else setTimeout(F,50)},Ne.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ne.prototype.setUneditable=function(){},Ne.prototype.needsContentAttribute=!1;function zc(e,t){if(t=t?dt(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=ve(be(e));t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=h.getValue()}var n;if(e.form&&(oe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;n=o.submit;try{var s=o.submit=function(){r(),o.submit=n,o.submit(),o.submit=s}}catch{}}t.finishInit=function(v){v.save=r,v.getTextArea=function(){return e},v.toTextArea=function(){v.toTextArea=isNaN,r(),e.parentNode.removeChild(v.getWrapperElement()),e.style.display="",e.form&&(ht(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var h=Ee(function(v){return e.parentNode.insertBefore(v,e.nextSibling)},t);return h}function Hc(e){e.off=ht,e.on=oe,e.wheelEventPixels=jf,e.Doc=ot,e.splitLines=Un,e.countColumn=Re,e.findColumn=St,e.isWordChar=zn,e.Pass=_e,e.signal=Ie,e.Line=xr,e.changeEnd=Gt,e.scrollbarModel=cl,e.Pos=q,e.cmpPos=fe,e.modes=Gn,e.mimeModes=br,e.resolveMode=Ei,e.getMode=Kn,e.modeExtensions=yr,e.extendMode=Ru,e.copyState=Vt,e.startState=ma,e.innerMode=Xn,e.commands=mi,e.keyMap=zt,e.keyName=Jl,e.isModifierKey=Zl,e.lookupKey=Nr,e.normalizeKeyMap=dc,e.StringStream=Oe,e.SharedTextMarker=pi,e.TextMarker=Xt,e.LineWidget=hi,e.e_preventDefault=it,e.e_stopPropagation=ga,e.e_stop=Xr,e.addClass=Te,e.contains=V,e.rmClass=ue,e.keyNames=Yt}Ac(Ee),Bc(Ee);var Rc="iter insert remove copy getEditor constructor".split(" ");for(var an in ot.prototype)ot.prototype.hasOwnProperty(an)&&Fe(Rc,an)<0&&(Ee.prototype[an]=function(e){return function(){return e.apply(this.doc,arguments)}}(ot.prototype[an]));return mr(ot),Ee.inputStyles={textarea:Ne,contenteditable:De},Ee.defineMode=function(e){!Ee.defaults.mode&&e!="null"&&(Ee.defaults.mode=e),zu.apply(this,arguments)},Ee.defineMIME=Hu,Ee.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ee.defineMIME("text/plain","null"),Ee.defineExtension=function(e,t){Ee.prototype[e]=t},Ee.defineDocExtension=function(e,t){ot.prototype[e]=t},Ee.fromTextArea=zc,Hc(Ee),Ee.version="5.65.21",Ee})});var xs=Ye((bs,ys)=>{(function(a){typeof bs=="object"&&typeof ys=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";var d=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,c=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,l=/[*+-]\s/;a.commands.newlineAndIndentContinueMarkdownList=function(g){if(g.getOption("disableInput"))return a.Pass;for(var f=g.listSelections(),p=[],y=0;y\s*$/.test(z),B=!/>\s*$/.test(z);(L||B)&&g.replaceRange("",{line:w.line,ch:0},{line:w.line,ch:w.ch+1}),p[y]=` +`}else{var I=O[1],H=O[5],P=!(l.test(O[2])||O[2].indexOf(">")>=0),X=P?parseInt(O[3],10)+1+O[4]:O[2].replace("x"," ");p[y]=` +`+I+X+H,P&&u(g,w)}}g.replaceSelections(p)};function u(g,f){var p=f.line,y=0,w=0,D=d.exec(g.getLine(p)),T=D[1];do{y+=1;var M=p+y,N=g.getLine(M),z=d.exec(N);if(z){var O=z[1],k=parseInt(D[3],10)+y-w,L=parseInt(z[3],10),B=L;if(T===O&&!isNaN(L))k===L&&(B=L+1),k>L&&(B=k+1),g.replaceRange(N.replace(d,O+B+z[4]+z[5]),{line:M,ch:0},{line:M,ch:N.length});else{if(T.length>O.length||T.length{var Ds=ct();Ds.commands.tabAndIndentMarkdownList=function(a){var d=a.listSelections(),c=d[0].head,l=a.getStateAfter(c.line),u=l.list!==!1;if(u){a.execCommand("indentMore");return}if(a.options.indentWithTabs)a.execCommand("insertTab");else{var g=Array(a.options.tabSize+1).join(" ");a.replaceSelection(g)}};Ds.commands.shiftTabAndUnindentMarkdownList=function(a){var d=a.listSelections(),c=d[0].head,l=a.getStateAfter(c.line),u=l.list!==!1;if(u){a.execCommand("indentLess");return}if(a.options.indentWithTabs)a.execCommand("insertTab");else{var g=Array(a.options.tabSize+1).join(" ");a.replaceSelection(g)}}});var Ss=Ye((ws,ks)=>{(function(a){typeof ws=="object"&&typeof ks=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.defineOption("fullScreen",!1,function(l,u,g){g==a.Init&&(g=!1),!g!=!u&&(u?d(l):c(l))});function d(l){var u=l.getWrapperElement();l.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:u.style.width,height:u.style.height},u.style.width="",u.style.height="auto",u.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",l.refresh()}function c(l){var u=l.getWrapperElement();u.className=u.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var g=l.state.fullScreenRestore;u.style.width=g.width,u.style.height=g.height,window.scrollTo(g.scrollLeft,g.scrollTop),l.refresh()}})});var Yo=Ye((Fs,Es)=>{(function(a){typeof Fs=="object"&&typeof Es=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";var d={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},c={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};a.defineMode("xml",function(l,u){var g=l.indentUnit,f={},p=u.htmlMode?d:c;for(var y in p)f[y]=p[y];for(var y in u)f[y]=u[y];var w,D;function T(E,U){function W(Te){return U.tokenize=Te,Te(E,U)}var V=E.next();if(V=="<")return E.eat("!")?E.eat("[")?E.match("CDATA[")?W(z("atom","]]>")):null:E.match("--")?W(z("comment","-->")):E.match("DOCTYPE",!0,!0)?(E.eatWhile(/[\w\._\-]/),W(O(1))):null:E.eat("?")?(E.eatWhile(/[\w\._\-]/),U.tokenize=z("meta","?>"),"meta"):(w=E.eat("/")?"closeTag":"openTag",U.tokenize=M,"tag bracket");if(V=="&"){var ve;return E.eat("#")?E.eat("x")?ve=E.eatWhile(/[a-fA-F\d]/)&&E.eat(";"):ve=E.eatWhile(/[\d]/)&&E.eat(";"):ve=E.eatWhile(/[\w\.\-:]/)&&E.eat(";"),ve?"atom":"error"}else return E.eatWhile(/[^&<]/),null}T.isInText=!0;function M(E,U){var W=E.next();if(W==">"||W=="/"&&E.eat(">"))return U.tokenize=T,w=W==">"?"endTag":"selfcloseTag","tag bracket";if(W=="=")return w="equals",null;if(W=="<"){U.tokenize=T,U.state=H,U.tagName=U.tagStart=null;var V=U.tokenize(E,U);return V?V+" tag error":"tag error"}else return/[\'\"]/.test(W)?(U.tokenize=N(W),U.stringStartCol=E.column(),U.tokenize(E,U)):(E.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function N(E){var U=function(W,V){for(;!W.eol();)if(W.next()==E){V.tokenize=M;break}return"string"};return U.isInAttribute=!0,U}function z(E,U){return function(W,V){for(;!W.eol();){if(W.match(U)){V.tokenize=T;break}W.next()}return E}}function O(E){return function(U,W){for(var V;(V=U.next())!=null;){if(V=="<")return W.tokenize=O(E+1),W.tokenize(U,W);if(V==">")if(E==1){W.tokenize=T;break}else return W.tokenize=O(E-1),W.tokenize(U,W)}return"meta"}}function k(E){return E&&E.toLowerCase()}function L(E,U,W){this.prev=E.context,this.tagName=U||"",this.indent=E.indented,this.startOfLine=W,(f.doNotIndent.hasOwnProperty(U)||E.context&&E.context.noIndent)&&(this.noIndent=!0)}function B(E){E.context&&(E.context=E.context.prev)}function I(E,U){for(var W;;){if(!E.context||(W=E.context.tagName,!f.contextGrabbers.hasOwnProperty(k(W))||!f.contextGrabbers[k(W)].hasOwnProperty(k(U))))return;B(E)}}function H(E,U,W){return E=="openTag"?(W.tagStart=U.column(),P):E=="closeTag"?X:H}function P(E,U,W){return E=="word"?(W.tagName=U.current(),D="tag",G):f.allowMissingTagName&&E=="endTag"?(D="tag bracket",G(E,U,W)):(D="error",P)}function X(E,U,W){if(E=="word"){var V=U.current();return W.context&&W.context.tagName!=V&&f.implicitlyClosed.hasOwnProperty(k(W.context.tagName))&&B(W),W.context&&W.context.tagName==V||f.matchClosing===!1?(D="tag",K):(D="tag error",ge)}else return f.allowMissingTagName&&E=="endTag"?(D="tag bracket",K(E,U,W)):(D="error",ge)}function K(E,U,W){return E!="endTag"?(D="error",K):(B(W),H)}function ge(E,U,W){return D="error",K(E,U,W)}function G(E,U,W){if(E=="word")return D="attribute",ue;if(E=="endTag"||E=="selfcloseTag"){var V=W.tagName,ve=W.tagStart;return W.tagName=W.tagStart=null,E=="selfcloseTag"||f.autoSelfClosers.hasOwnProperty(k(V))?I(W,V):(I(W,V),W.context=new L(W,V,ve==W.indented)),H}return D="error",G}function ue(E,U,W){return E=="equals"?ae:(f.allowMissing||(D="error"),G(E,U,W))}function ae(E,U,W){return E=="string"?de:E=="word"&&f.allowUnquoted?(D="string",G):(D="error",G(E,U,W))}function de(E,U,W){return E=="string"?de:G(E,U,W)}return{startState:function(E){var U={tokenize:T,state:H,indented:E||0,tagName:null,tagStart:null,context:null};return E!=null&&(U.baseIndent=E),U},token:function(E,U){if(!U.tagName&&E.sol()&&(U.indented=E.indentation()),E.eatSpace())return null;w=null;var W=U.tokenize(E,U);return(W||w)&&W!="comment"&&(D=null,U.state=U.state(w||W,E,U),D&&(W=D=="error"?W+" error":D)),W},indent:function(E,U,W){var V=E.context;if(E.tokenize.isInAttribute)return E.tagStart==E.indented?E.stringStartCol+1:E.indented+g;if(V&&V.noIndent)return a.Pass;if(E.tokenize!=M&&E.tokenize!=T)return W?W.match(/^(\s*)/)[0].length:0;if(E.tagName)return f.multilineTagIndentPastTag!==!1?E.tagStart+E.tagName.length+2:E.tagStart+g*(f.multilineTagIndentFactor||1);if(f.alignCDATA&&/$/,blockCommentStart:"",configuration:f.htmlMode?"html":"xml",helperType:f.htmlMode?"html":"xml",skipAttribute:function(E){E.state==ae&&(E.state=G)},xmlCurrentTag:function(E){return E.tagName?{name:E.tagName,close:E.type=="closeTag"}:null},xmlCurrentContext:function(E){for(var U=[],W=E.context;W;W=W.prev)U.push(W.tagName);return U.reverse()}}}),a.defineMIME("text/xml","xml"),a.defineMIME("application/xml","xml"),a.mimeModes.hasOwnProperty("text/html")||a.defineMIME("text/html",{name:"xml",htmlMode:!0})})});var Ts=Ye((As,Ls)=>{(function(a){typeof As=="object"&&typeof Ls=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var d=0;d-1&&l.substring(f+1,l.length);if(p)return a.findModeByExtension(p)},a.findModeByName=function(l){l=l.toLowerCase();for(var u=0;u{(function(a){typeof Ms=="object"&&typeof Bs=="object"?a(ct(),Yo(),Ts()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],a):a(CodeMirror)})(function(a){"use strict";a.defineMode("markdown",function(d,c){var l=a.getMode(d,"text/html"),u=l.name=="null";function g(S){if(a.findModeByName){var b=a.findModeByName(S);b&&(S=b.mime||b.mimes[0])}var ee=a.getMode(d,S);return ee.name=="null"?null:ee}c.highlightFormatting===void 0&&(c.highlightFormatting=!1),c.maxBlockquoteDepth===void 0&&(c.maxBlockquoteDepth=0),c.taskLists===void 0&&(c.taskLists=!1),c.strikethrough===void 0&&(c.strikethrough=!1),c.emoji===void 0&&(c.emoji=!1),c.fencedCodeBlockHighlighting===void 0&&(c.fencedCodeBlockHighlighting=!0),c.fencedCodeBlockDefaultMode===void 0&&(c.fencedCodeBlockDefaultMode="text/plain"),c.xml===void 0&&(c.xml=!0),c.tokenTypeOverrides===void 0&&(c.tokenTypeOverrides={});var f={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var p in f)f.hasOwnProperty(p)&&c.tokenTypeOverrides[p]&&(f[p]=c.tokenTypeOverrides[p]);var y=/^([*\-_])(?:\s*\1){2,}\s*$/,w=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,D=/^\[(x| )\](?=\s)/i,T=c.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,M=/^ {0,3}(?:\={1,}|-{2,})\s*$/,N=/^[^#!\[\]*_\\<>` "'(~:]+/,z=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,O=/^\s*\[[^\]]+?\]:.*$/,k=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,L=" ";function B(S,b,ee){return b.f=b.inline=ee,ee(S,b)}function I(S,b,ee){return b.f=b.block=ee,ee(S,b)}function H(S){return!S||!/\S/.test(S.string)}function P(S){if(S.linkTitle=!1,S.linkHref=!1,S.linkText=!1,S.em=!1,S.strong=!1,S.strikethrough=!1,S.quote=0,S.indentedCode=!1,S.f==K){var b=u;if(!b){var ee=a.innerMode(l,S.htmlState);b=ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText}b&&(S.f=ae,S.block=X,S.htmlState=null)}return S.trailingSpace=0,S.trailingSpaceNewLine=!1,S.prevLine=S.thisLine,S.thisLine={stream:null},null}function X(S,b){var ee=S.column()===b.indentation,be=H(b.prevLine.stream),he=b.indentedCode,tt=b.prevLine.hr,dt=b.list!==!1,Re=(b.listStack[b.listStack.length-1]||0)+3;b.indentedCode=!1;var Je=b.indentation;if(b.indentationDiff===null&&(b.indentationDiff=b.indentation,dt)){for(b.list=null;Je=4&&(he||b.prevLine.fencedCodeEnd||b.prevLine.header||be))return S.skipToEnd(),b.indentedCode=!0,f.code;if(S.eatSpace())return null;if(ee&&b.indentation<=Re&&(_e=S.match(T))&&_e[1].length<=6)return b.quote=0,b.header=_e[1].length,b.thisLine.header=!0,c.highlightFormatting&&(b.formatting="header"),b.f=b.inline,G(b);if(b.indentation<=Re&&S.eat(">"))return b.quote=ee?1:b.quote+1,c.highlightFormatting&&(b.formatting="quote"),S.eatSpace(),G(b);if(!Me&&!b.setext&&ee&&b.indentation<=Re&&(_e=S.match(w))){var rt=_e[1]?"ol":"ul";return b.indentation=Je+S.current().length,b.list=!0,b.quote=0,b.listStack.push(b.indentation),b.em=!1,b.strong=!1,b.code=!1,b.strikethrough=!1,c.taskLists&&S.match(D,!1)&&(b.taskList=!0),b.f=b.inline,c.highlightFormatting&&(b.formatting=["list","list-"+rt]),G(b)}else{if(ee&&b.indentation<=Re&&(_e=S.match(z,!0)))return b.quote=0,b.fencedEndRE=new RegExp(_e[1]+"+ *$"),b.localMode=c.fencedCodeBlockHighlighting&&g(_e[2]||c.fencedCodeBlockDefaultMode),b.localMode&&(b.localState=a.startState(b.localMode)),b.f=b.block=ge,c.highlightFormatting&&(b.formatting="code-block"),b.code=-1,G(b);if(b.setext||(!Fe||!dt)&&!b.quote&&b.list===!1&&!b.code&&!Me&&!O.test(S.string)&&(_e=S.lookAhead(1))&&(_e=_e.match(M)))return b.setext?(b.header=b.setext,b.setext=0,S.skipToEnd(),c.highlightFormatting&&(b.formatting="header")):(b.header=_e[0].charAt(0)=="="?1:2,b.setext=b.header),b.thisLine.header=!0,b.f=b.inline,G(b);if(Me)return S.skipToEnd(),b.hr=!0,b.thisLine.hr=!0,f.hr;if(S.peek()==="[")return B(S,b,V)}return B(S,b,b.inline)}function K(S,b){var ee=l.token(S,b.htmlState);if(!u){var be=a.innerMode(l,b.htmlState);(be.mode.name=="xml"&&be.state.tagStart===null&&!be.state.context&&be.state.tokenize.isInText||b.md_inside&&S.current().indexOf(">")>-1)&&(b.f=ae,b.block=X,b.htmlState=null)}return ee}function ge(S,b){var ee=b.listStack[b.listStack.length-1]||0,be=b.indentation=S.quote?b.push(f.formatting+"-"+S.formatting[ee]+"-"+S.quote):b.push("error"))}if(S.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(S.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(S.linkHref?b.push(f.linkHref,"url"):(S.strong&&b.push(f.strong),S.em&&b.push(f.em),S.strikethrough&&b.push(f.strikethrough),S.emoji&&b.push(f.emoji),S.linkText&&b.push(f.linkText),S.code&&b.push(f.code),S.image&&b.push(f.image),S.imageAltText&&b.push(f.imageAltText,"link"),S.imageMarker&&b.push(f.imageMarker)),S.header&&b.push(f.header,f.header+"-"+S.header),S.quote&&(b.push(f.quote),!c.maxBlockquoteDepth||c.maxBlockquoteDepth>=S.quote?b.push(f.quote+"-"+S.quote):b.push(f.quote+"-"+c.maxBlockquoteDepth)),S.list!==!1){var be=(S.listStack.length-1)%3;be?be===1?b.push(f.list2):b.push(f.list3):b.push(f.list1)}return S.trailingSpaceNewLine?b.push("trailing-space-new-line"):S.trailingSpace&&b.push("trailing-space-"+(S.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function ue(S,b){if(S.match(N,!0))return G(b)}function ae(S,b){var ee=b.text(S,b);if(typeof ee<"u")return ee;if(b.list)return b.list=null,G(b);if(b.taskList){var be=S.match(D,!0)[1]===" ";return be?b.taskOpen=!0:b.taskClosed=!0,c.highlightFormatting&&(b.formatting="task"),b.taskList=!1,G(b)}if(b.taskOpen=!1,b.taskClosed=!1,b.header&&S.match(/^#+$/,!0))return c.highlightFormatting&&(b.formatting="header"),G(b);var he=S.next();if(b.linkTitle){b.linkTitle=!1;var tt=he;he==="("&&(tt=")"),tt=(tt+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var dt="^\\s*(?:[^"+tt+"\\\\]+|\\\\\\\\|\\\\.)"+tt;if(S.match(new RegExp(dt),!0))return f.linkHref}if(he==="`"){var Re=b.formatting;c.highlightFormatting&&(b.formatting="code"),S.eatWhile("`");var Je=S.current().length;if(b.code==0&&(!b.quote||Je==1))return b.code=Je,G(b);if(Je==b.code){var Fe=G(b);return b.code=0,Fe}else return b.formatting=Re,G(b)}else if(b.code)return G(b);if(he==="\\"&&(S.next(),c.highlightFormatting)){var Me=G(b),_e=f.formatting+"-escape";return Me?Me+" "+_e:_e}if(he==="!"&&S.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.imageMarker=!0,b.image=!0,c.highlightFormatting&&(b.formatting="image"),G(b);if(he==="["&&b.imageMarker&&S.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return b.imageMarker=!1,b.imageAltText=!0,c.highlightFormatting&&(b.formatting="image"),G(b);if(he==="]"&&b.imageAltText){c.highlightFormatting&&(b.formatting="image");var Me=G(b);return b.imageAltText=!1,b.image=!1,b.inline=b.f=E,Me}if(he==="["&&!b.image)return b.linkText&&S.match(/^.*?\]/)||(b.linkText=!0,c.highlightFormatting&&(b.formatting="link")),G(b);if(he==="]"&&b.linkText){c.highlightFormatting&&(b.formatting="link");var Me=G(b);return b.linkText=!1,b.inline=b.f=S.match(/\(.*?\)| ?\[.*?\]/,!1)?E:ae,Me}if(he==="<"&&S.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=de,c.highlightFormatting&&(b.formatting="link");var Me=G(b);return Me?Me+=" ":Me="",Me+f.linkInline}if(he==="<"&&S.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=de,c.highlightFormatting&&(b.formatting="link");var Me=G(b);return Me?Me+=" ":Me="",Me+f.linkEmail}if(c.xml&&he==="<"&&S.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var rt=S.string.indexOf(">",S.pos);if(rt!=-1){var Ur=S.string.substring(S.start,rt);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ur)&&(b.md_inside=!0)}return S.backUp(1),b.htmlState=a.startState(l),I(S,b,K)}if(c.xml&&he==="<"&&S.match(/^\/\w*?>/))return b.md_inside=!1,"tag";if(he==="*"||he==="_"){for(var kt=1,St=S.pos==1?" ":S.string.charAt(S.pos-2);kt<3&&S.eat(he);)kt++;var bt=S.peek()||" ",_t=!/\s/.test(bt)&&(!k.test(bt)||/\s/.test(St)||k.test(St)),me=!/\s/.test(St)&&(!k.test(St)||/\s/.test(bt)||k.test(bt)),yt=null,Pt=null;if(kt%2&&(!b.em&&_t&&(he==="*"||!me||k.test(St))?yt=!0:b.em==he&&me&&(he==="*"||!_t||k.test(bt))&&(yt=!1)),kt>1&&(!b.strong&&_t&&(he==="*"||!me||k.test(St))?Pt=!0:b.strong==he&&me&&(he==="*"||!_t||k.test(bt))&&(Pt=!1)),Pt!=null||yt!=null){c.highlightFormatting&&(b.formatting=yt==null?"strong":Pt==null?"em":"strong em"),yt===!0&&(b.em=he),Pt===!0&&(b.strong=he);var Fe=G(b);return yt===!1&&(b.em=!1),Pt===!1&&(b.strong=!1),Fe}}else if(he===" "&&(S.eat("*")||S.eat("_"))){if(S.peek()===" ")return G(b);S.backUp(1)}if(c.strikethrough){if(he==="~"&&S.eatWhile(he)){if(b.strikethrough){c.highlightFormatting&&(b.formatting="strikethrough");var Fe=G(b);return b.strikethrough=!1,Fe}else if(S.match(/^[^\s]/,!1))return b.strikethrough=!0,c.highlightFormatting&&(b.formatting="strikethrough"),G(b)}else if(he===" "&&S.match("~~",!0)){if(S.peek()===" ")return G(b);S.backUp(2)}}if(c.emoji&&he===":"&&S.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){b.emoji=!0,c.highlightFormatting&&(b.formatting="emoji");var Si=G(b);return b.emoji=!1,Si}return he===" "&&(S.match(/^ +$/,!1)?b.trailingSpace++:b.trailingSpace&&(b.trailingSpaceNewLine=!0)),G(b)}function de(S,b){var ee=S.next();if(ee===">"){b.f=b.inline=ae,c.highlightFormatting&&(b.formatting="link");var be=G(b);return be?be+=" ":be="",be+f.linkInline}return S.match(/^[^>]+/,!0),f.linkInline}function E(S,b){if(S.eatSpace())return null;var ee=S.next();return ee==="("||ee==="["?(b.f=b.inline=W(ee==="("?")":"]"),c.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,G(b)):"error"}var U={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function W(S){return function(b,ee){var be=b.next();if(be===S){ee.f=ee.inline=ae,c.highlightFormatting&&(ee.formatting="link-string");var he=G(ee);return ee.linkHref=!1,he}return b.match(U[S]),ee.linkHref=!0,G(ee)}}function V(S,b){return S.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=ve,S.next(),c.highlightFormatting&&(b.formatting="link"),b.linkText=!0,G(b)):B(S,b,ae)}function ve(S,b){if(S.match("]:",!0)){b.f=b.inline=Te,c.highlightFormatting&&(b.formatting="link");var ee=G(b);return b.linkText=!1,ee}return S.match(/^([^\]\\]|\\.)+/,!0),f.linkText}function Te(S,b){return S.eatSpace()?null:(S.match(/^[^\s]+/,!0),S.peek()===void 0?b.linkTitle=!0:S.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),b.f=b.inline=ae,f.linkHref+" url")}var vt={startState:function(){return{f:X,prevLine:{stream:null},thisLine:{stream:null},block:X,htmlState:null,indentation:0,inline:ae,text:ue,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(S){return{f:S.f,prevLine:S.prevLine,thisLine:S.thisLine,block:S.block,htmlState:S.htmlState&&a.copyState(l,S.htmlState),indentation:S.indentation,localMode:S.localMode,localState:S.localMode?a.copyState(S.localMode,S.localState):null,inline:S.inline,text:S.text,formatting:!1,linkText:S.linkText,linkTitle:S.linkTitle,linkHref:S.linkHref,code:S.code,em:S.em,strong:S.strong,strikethrough:S.strikethrough,emoji:S.emoji,header:S.header,setext:S.setext,hr:S.hr,taskList:S.taskList,list:S.list,listStack:S.listStack.slice(0),quote:S.quote,indentedCode:S.indentedCode,trailingSpace:S.trailingSpace,trailingSpaceNewLine:S.trailingSpaceNewLine,md_inside:S.md_inside,fencedEndRE:S.fencedEndRE}},token:function(S,b){if(b.formatting=!1,S!=b.thisLine.stream){if(b.header=0,b.hr=!1,S.match(/^\s*$/,!0))return P(b),null;if(b.prevLine=b.thisLine,b.thisLine={stream:S},b.taskList=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,!b.localState&&(b.f=b.block,b.f!=K)){var ee=S.match(/^\s*/,!0)[0].replace(/\t/g,L).length;if(b.indentation=ee,b.indentationDiff=null,ee>0)return null}}return b.f(S,b)},innerMode:function(S){return S.block==K?{state:S.htmlState,mode:l}:S.localState?{state:S.localState,mode:S.localMode}:{state:S,mode:vt}},indent:function(S,b,ee){return S.block==K&&l.indent?l.indent(S.htmlState,b,ee):S.localState&&S.localMode.indent?S.localMode.indent(S.localState,b,ee):a.Pass},blankLine:P,getType:G,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return vt},"xml"),a.defineMIME("text/markdown","markdown"),a.defineMIME("text/x-markdown","markdown")})});var Qo=Ye((Ns,Is)=>{(function(a){typeof Ns=="object"&&typeof Is=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.overlayMode=function(d,c,l){return{startState:function(){return{base:a.startState(d),overlay:a.startState(c),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(u){return{base:a.copyState(d,u.base),overlay:a.copyState(c,u.overlay),basePos:u.basePos,baseCur:null,overlayPos:u.overlayPos,overlayCur:null}},token:function(u,g){return(u!=g.streamSeen||Math.min(g.basePos,g.overlayPos){(function(a){typeof Os=="object"&&typeof zs=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){a.defineOption("placeholder","",function(p,y,w){var D=w&&w!=a.Init;if(y&&!D)p.on("blur",u),p.on("change",g),p.on("swapDoc",g),a.on(p.getInputField(),"compositionupdate",p.state.placeholderCompose=function(){l(p)}),g(p);else if(!y&&D){p.off("blur",u),p.off("change",g),p.off("swapDoc",g),a.off(p.getInputField(),"compositionupdate",p.state.placeholderCompose),d(p);var T=p.getWrapperElement();T.className=T.className.replace(" CodeMirror-empty","")}y&&!p.hasFocus()&&u(p)});function d(p){p.state.placeholder&&(p.state.placeholder.parentNode.removeChild(p.state.placeholder),p.state.placeholder=null)}function c(p){d(p);var y=p.state.placeholder=document.createElement("pre");y.style.cssText="height: 0; overflow: visible",y.style.direction=p.getOption("direction"),y.className="CodeMirror-placeholder CodeMirror-line-like";var w=p.getOption("placeholder");typeof w=="string"&&(w=document.createTextNode(w)),y.appendChild(w),p.display.lineSpace.insertBefore(y,p.display.lineSpace.firstChild)}function l(p){setTimeout(function(){var y=!1;if(p.lineCount()==1){var w=p.getInputField();y=w.nodeName=="TEXTAREA"?!p.getLine(0).length:!/[^\u200b]/.test(w.querySelector(".CodeMirror-line").textContent)}y?c(p):d(p)},20)}function u(p){f(p)&&c(p)}function g(p){var y=p.getWrapperElement(),w=f(p);y.className=y.className.replace(" CodeMirror-empty","")+(w?" CodeMirror-empty":""),w?c(p):d(p)}function f(p){return p.lineCount()===1&&p.getLine(0)===""}})});var Ps=Ye((Rs,_s)=>{(function(a){typeof Rs=="object"&&typeof _s=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.defineOption("autoRefresh",!1,function(l,u){l.state.autoRefresh&&(c(l,l.state.autoRefresh),l.state.autoRefresh=null),u&&l.display.wrapper.offsetHeight==0&&d(l,l.state.autoRefresh={delay:u.delay||250})});function d(l,u){function g(){l.display.wrapper.offsetHeight?(c(l,u),l.display.lastWrapHeight!=l.display.wrapper.clientHeight&&l.refresh()):u.timeout=setTimeout(g,u.delay)}u.timeout=setTimeout(g,u.delay),u.hurry=function(){clearTimeout(u.timeout),u.timeout=setTimeout(g,50)},a.on(window,"mouseup",u.hurry),a.on(window,"keyup",u.hurry)}function c(l,u){clearTimeout(u.timeout),a.off(window,"mouseup",u.hurry),a.off(window,"keyup",u.hurry)}})});var Us=Ye((Ws,qs)=>{(function(a){typeof Ws=="object"&&typeof qs=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.defineOption("styleSelectedText",!1,function(D,T,M){var N=M&&M!=a.Init;T&&!N?(D.state.markedSelection=[],D.state.markedSelectionStyle=typeof T=="string"?T:"CodeMirror-selectedtext",y(D),D.on("cursorActivity",d),D.on("change",c)):!T&&N&&(D.off("cursorActivity",d),D.off("change",c),p(D),D.state.markedSelection=D.state.markedSelectionStyle=null)});function d(D){D.state.markedSelection&&D.operation(function(){w(D)})}function c(D){D.state.markedSelection&&D.state.markedSelection.length&&D.operation(function(){p(D)})}var l=8,u=a.Pos,g=a.cmpPos;function f(D,T,M,N){if(g(T,M)!=0)for(var z=D.state.markedSelection,O=D.state.markedSelectionStyle,k=T.line;;){var L=k==T.line?T:u(k,0),B=k+l,I=B>=M.line,H=I?M:u(B,0),P=D.markText(L,H,{className:O});if(N==null?z.push(P):z.splice(N++,0,P),I)break;k=B}}function p(D){for(var T=D.state.markedSelection,M=0;M1)return y(D);var T=D.getCursor("start"),M=D.getCursor("end"),N=D.state.markedSelection;if(!N.length)return f(D,T,M);var z=N[0].find(),O=N[N.length-1].find();if(!z||!O||M.line-T.line<=l||g(T,O.to)>=0||g(M,z.from)<=0)return y(D);for(;g(T,z.from)>0;)N.shift().clear(),z=N[0].find();for(g(T,z.from)<0&&(z.to.line-T.line0&&(M.line-O.from.line{(function(a){typeof js=="object"&&typeof Gs=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";var d=a.Pos;function c(k){var L=k.flags;return L??(k.ignoreCase?"i":"")+(k.global?"g":"")+(k.multiline?"m":"")}function l(k,L){for(var B=c(k),I=B,H=0;HX);K++){var ge=k.getLine(P++);I=I==null?ge:I+` `+ge}H=H*2,L.lastIndex=B.ch;var G=L.exec(I);if(G){var ue=I.slice(0,G.index).split(` `),ae=G[0].split(` -`),de=B.line+ue.length-1,E=ue[ue.length-1].length;return{from:h(de,E),to:h(de+ae.length-1,ae.length==1?E+ae[0].length:ae[ae.length-1].length),match:G}}}}function p(k,L,B){for(var I,H=0;H<=k.length;){L.lastIndex=H;var _=L.exec(k);if(!_)break;var X=_.index+_[0].length;if(X>k.length-B)break;(!I||X>I.index+I[0].length)&&(I=_),H=_.index+1}return I}function y(k,L,B){L=l(L,"g");for(var I=B.line,H=B.ch,_=k.firstLine();I>=_;I--,H=-1){var X=k.getLine(I),K=p(X,L,H<0?0:X.length-H);if(K)return{from:h(I,K.index),to:h(I,K.index+K[0].length),match:K}}}function w(k,L,B){if(!u(L))return y(k,L,B);L=l(L,"gm");for(var I,H=1,_=k.getLine(B.line).length-B.ch,X=B.line,K=k.firstLine();X>=K;){for(var ge=0;ge=K;ge++){var G=k.getLine(X--);I=I==null?G:G+` -`+I}H*=2;var ue=p(I,L,_);if(ue){var ae=I.slice(0,ue.index).split(` +`),de=B.line+ue.length-1,E=ue[ue.length-1].length;return{from:d(de,E),to:d(de+ae.length-1,ae.length==1?E+ae[0].length:ae[ae.length-1].length),match:G}}}}function p(k,L,B){for(var I,H=0;H<=k.length;){L.lastIndex=H;var P=L.exec(k);if(!P)break;var X=P.index+P[0].length;if(X>k.length-B)break;(!I||X>I.index+I[0].length)&&(I=P),H=P.index+1}return I}function y(k,L,B){L=l(L,"g");for(var I=B.line,H=B.ch,P=k.firstLine();I>=P;I--,H=-1){var X=k.getLine(I),K=p(X,L,H<0?0:X.length-H);if(K)return{from:d(I,K.index),to:d(I,K.index+K[0].length),match:K}}}function w(k,L,B){if(!u(L))return y(k,L,B);L=l(L,"gm");for(var I,H=1,P=k.getLine(B.line).length-B.ch,X=B.line,K=k.firstLine();X>=K;){for(var ge=0;ge=K;ge++){var G=k.getLine(X--);I=I==null?G:G+` +`+I}H*=2;var ue=p(I,L,P);if(ue){var ae=I.slice(0,ue.index).split(` `),de=ue[0].split(` -`),E=X+ae.length,U=ae[ae.length-1].length;return{from:h(E,U),to:h(E+de.length-1,de.length==1?U+de[0].length:de[de.length-1].length),match:ue}}}}var D,T;String.prototype.normalize?(D=function(k){return k.normalize("NFD").toLowerCase()},T=function(k){return k.normalize("NFD")}):(D=function(k){return k.toLowerCase()},T=function(k){return k});function M(k,L,B,I){if(k.length==L.length)return B;for(var H=0,_=B+Math.max(0,k.length-L.length);;){if(H==_)return H;var X=H+_>>1,K=I(k.slice(0,X)).length;if(K==B)return X;K>B?_=X:H=X+1}}function N(k,L,B,I){if(!L.length)return null;var H=I?D:T,_=H(L).split(/\r|\n\r?/);e:for(var X=B.line,K=B.ch,ge=k.lastLine()+1-_.length;X<=ge;X++,K=0){var G=k.getLine(X).slice(K),ue=H(G);if(_.length==1){var ae=ue.indexOf(_[0]);if(ae==-1)continue e;var B=M(G,ue,ae,H)+K;return{from:h(X,M(G,ue,ae,H)+K),to:h(X,M(G,ue,ae+_[0].length,H)+K)}}else{var de=ue.length-_[0].length;if(ue.slice(de)!=_[0])continue e;for(var E=1;E<_.length-1;E++)if(H(k.getLine(X+E))!=_[E])continue e;var U=k.getLine(X+_.length-1),W=H(U),V=_[_.length-1];if(W.slice(0,V.length)!=V)continue e;return{from:h(X,M(G,ue,de,H)+K),to:h(X+_.length-1,M(U,W,V.length,H))}}}}function O(k,L,B,I){if(!L.length)return null;var H=I?D:T,_=H(L).split(/\r|\n\r?/);e:for(var X=B.line,K=B.ch,ge=k.firstLine()-1+_.length;X>=ge;X--,K=-1){var G=k.getLine(X);K>-1&&(G=G.slice(0,K));var ue=H(G);if(_.length==1){var ae=ue.lastIndexOf(_[0]);if(ae==-1)continue e;return{from:h(X,M(G,ue,ae,H)),to:h(X,M(G,ue,ae+_[0].length,H))}}else{var de=_[_.length-1];if(ue.slice(0,de.length)!=de)continue e;for(var E=1,B=X-_.length+1;E<_.length-1;E++)if(H(k.getLine(B+E))!=_[E])continue e;var U=k.getLine(X+1-_.length),W=H(U);if(W.slice(W.length-_[0].length)!=_[0])continue e;return{from:h(X+1-_.length,M(U,W,U.length-_[0].length,H)),to:h(X,M(G,ue,de.length,H))}}}}function z(k,L,B,I){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=k,B=B?k.clipPos(B):h(0,0),this.pos={from:B,to:B};var H;typeof I=="object"?H=I.caseFold:(H=I,I=null),typeof L=="string"?(H==null&&(H=!1),this.matches=function(_,X){return(_?O:N)(k,L,X,H)}):(L=l(L,"gm"),!I||I.multiline!==!1?this.matches=function(_,X){return(_?w:f)(k,L,X)}:this.matches=function(_,X){return(_?y:v)(k,L,X)})}z.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(k){var L=this.doc.clipPos(k?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(L=h(L.line,L.ch),k?(L.ch--,L.ch<0&&(L.line--,L.ch=(this.doc.getLine(L.line)||"").length)):(L.ch++,L.ch>(this.doc.getLine(L.line)||"").length&&(L.ch=0,L.line++)),a.cmpPos(L,this.doc.clipPos(L))!=0))return this.atOccurrence=!1;var B=this.matches(k,L);if(this.afterEmptyMatch=B&&a.cmpPos(B.from,B.to)==0,B)return this.pos=B,this.atOccurrence=!0,this.pos.match||!0;var I=h(k?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:I,to:I},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(k,L){if(this.atOccurrence){var B=a.splitLines(k);this.doc.replaceRange(B,this.pos.from,this.pos.to,L),this.pos.to=h(this.pos.from.line+B.length-1,B[B.length-1].length+(B.length==1?this.pos.from.ch:0))}}},a.defineExtension("getSearchCursor",function(k,L,B){return new z(this.doc,k,L,B)}),a.defineDocExtension("getSearchCursor",function(k,L,B){return new z(this,k,L,B)}),a.defineExtension("selectMatches",function(k,L){for(var B=[],I=this.getSearchCursor(k,this.getCursor("from"),L);I.findNext()&&!(a.cmpPos(I.to(),this.getCursor("to"))>0);)B.push({anchor:I.from(),head:I.to()});B.length&&this.setSelections(B,0)})})});var Ys=Ye((Ks,Xs)=>{(function(a){typeof Ks=="object"&&typeof Xs=="object"?a(ct(),Zo(),Qo()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],a):a(CodeMirror)})(function(a){"use strict";var h=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;a.defineMode("gfm",function(c,l){var u=0;function v(w){return w.code=!1,null}var f={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(w){return{code:w.code,codeBlock:w.codeBlock,ateSpace:w.ateSpace}},token:function(w,D){if(D.combineTokens=null,D.codeBlock)return w.match(/^```+/)?(D.codeBlock=!1,null):(w.skipToEnd(),null);if(w.sol()&&(D.code=!1),w.sol()&&w.match(/^```+/))return w.skipToEnd(),D.codeBlock=!0,null;if(w.peek()==="`"){w.next();var T=w.pos;w.eatWhile("`");var M=1+w.pos-T;return D.code?M===u&&(D.code=!1):(u=M,D.code=!0),null}else if(D.code)return w.next(),null;if(w.eatSpace())return D.ateSpace=!0,null;if((w.sol()||D.ateSpace)&&(D.ateSpace=!1,l.gitHubSpice!==!1)){if(w.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return D.combineTokens=!0,"link";if(w.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return D.combineTokens=!0,"link"}return w.match(h)&&w.string.slice(w.start-2,w.start)!="]("&&(w.start==0||/\W/.test(w.string.charAt(w.start-1)))?(D.combineTokens=!0,"link"):(w.next(),null)},blankLine:v},p={taskLists:!0,strikethrough:!0,emoji:!0};for(var y in l)p[y]=l[y];return p.name="markdown",a.overlayMode(a.getMode(c,p),f)},"markdown"),a.defineMIME("text/x-gfm","gfm")})});var Zs=Ye(()=>{});var Qs=Ye((Ud,$o)=>{var Jo;(function(){"use strict";Jo=function(a,h,c,l){l=l||{},this.dictionary=null,this.rules={},this.dictionaryTable=new Map,this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=l.flags||{},this.memoized={},this.loaded=!1;var u=this,v,f,p,y,w;a&&(u.dictionary=a,h&&c?N():(typeof window<"u"?(l.dictionaryPath?v=l.dictionaryPath:v="typo/dictionaries",window.chrome&&window.chrome.runtime&&window.chrome.runtime.getURL?v=window.chrome.runtime.getURL(v):window.browser&&window.browser.runtime&&window.browser.runtime.getURL&&(v=window.browser.runtime.getURL(v))):typeof __dirname<"u"?v=__dirname+"/dictionaries":v="./dictionaries",h||D(v+"/"+a+"/"+a+".aff",T),c||D(v+"/"+a+"/"+a+".dic",M)));function D(O,z){var k=u._readFile(O,null,l?.asyncLoad);l?.asyncLoad?k.then(function(L){z(L)}):z(k)}function T(O){h=O,c&&N()}function M(O){c=O,h&&N()}function N(){for(u.rules=u._parseAFF(h),u.compoundRuleCodes={},f=0,y=u.compoundRules.length;f0&&(_.continuationClasses=I),H!=="."&&(M==="SFX"?_.match=new RegExp(H+"$"):_.match=new RegExp("^"+H)),k!="0"&&(M==="SFX"?_.remove=new RegExp(k+"$"):_.remove=k),z.push(_)}h[N]={type:M,combineable:O==="Y",entries:z},f+=u}else if(M==="COMPOUNDRULE"){for(u=parseInt(T[1],10),p=f+1,w=f+1+u;p0&&(c.get(ue)===null&&c.set(ue,[]),c.get(ue).push(ae))}for(var u=1,v=h.length;u1){var D=this.parseRuleCodes(y[1]);(!("NEEDAFFIX"in this.flags)||D.indexOf(this.flags.NEEDAFFIX)===-1)&&l(w,D);for(var T=0,M=D.length;T"u"){if("COMPOUNDMIN"in this.flags&&a.length>=this.flags.COMPOUNDMIN){for(c=0,l=this.compoundRules.length;c"u"&&(c=Array.prototype.concat.apply([],this.dictionaryTable.get(a))),c&&c.indexOf(this.flags[h])!==-1))},alphabet:"",suggest:function(a,h){if(!this.loaded)throw"Dictionary not loaded.";if(h=h||5,this.memoized.hasOwnProperty(a)){var c=this.memoized[a].limit;if(h<=c||this.memoized[a].suggestions.length1&&K[1][1]!==K[1][0]&&(H=K[0]+K[1][1]+K[1][0]+K[1].substring(2),(!N||w.check(H))&&(H in O?O[H]+=1:O[H]=1)),K[1]){var ge=K[1].substring(0,1).toUpperCase()===K[1].substring(0,1)?"uppercase":"lowercase";for(k=0;k<_;k++){var G=w.alphabet[k];ge==="uppercase"&&(G=G.toUpperCase()),G!=K[1].substring(0,1)&&(H=K[0]+G+K[1].substring(1),(!N||w.check(H))&&(H in O?O[H]+=1:O[H]=1))}}if(K[1])for(k=0;k<_;k++){var ge=K[0].substring(-1).toUpperCase()===K[0].substring(-1)&&K[1].substring(0,1).toUpperCase()===K[1].substring(0,1)?"uppercase":"lowercase",G=w.alphabet[k];ge==="uppercase"&&(G=G.toUpperCase()),H=K[0]+G+K[1],(!N||w.check(H))&&(H in O?O[H]+=1:O[H]=1)}}return O}function T(M){var N,O=D((N={},N[M]=!0,N)),z=D(O,!0),k=z;for(var L in O)w.check(L)&&(L in k?k[L]+=O[L]:k[L]=O[L]);var B,I,H=[];for(B in k)k.hasOwnProperty(B)&&(w.hasFlag(B,"PRIORITYSUGGEST")&&(k[B]+=1e3),H.push([B,k[B]]));function _(G,ue){var ae=G[1],de=ue[1];return aede?1:ue[0].localeCompare(G[0])}H.sort(_).reverse();var X=[],K="lowercase";M.toUpperCase()===M?K="uppercase":M.substr(0,1).toUpperCase()+M.substr(1).toLowerCase()===M&&(K="capitalized");var ge=h;for(B=0;B{"use strict";var Js=Qs();function Ae(a){if(a=a||{},typeof a.codeMirrorInstance!="function"||typeof a.codeMirrorInstance.defineMode!="function"){console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`");return}String.prototype.includes||(String.prototype.includes=function(){"use strict";return String.prototype.indexOf.apply(this,arguments)!==-1}),a.codeMirrorInstance.defineMode("spell-checker",function(h){if(!Ae.aff_loading){Ae.aff_loading=!0;var c=new XMLHttpRequest;c.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),c.onload=function(){c.readyState===4&&c.status===200&&(Ae.aff_data=c.responseText,Ae.num_loaded++,Ae.num_loaded==2&&(Ae.typo=new Js("en_US",Ae.aff_data,Ae.dic_data,{platform:"any"})))},c.send(null)}if(!Ae.dic_loading){Ae.dic_loading=!0;var l=new XMLHttpRequest;l.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),l.onload=function(){l.readyState===4&&l.status===200&&(Ae.dic_data=l.responseText,Ae.num_loaded++,Ae.num_loaded==2&&(Ae.typo=new Js("en_US",Ae.aff_data,Ae.dic_data,{platform:"any"})))},l.send(null)}var u='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',v={token:function(p){var y=p.peek(),w="";if(u.includes(y))return p.next(),null;for(;(y=p.peek())!=null&&!u.includes(y);)w+=y,p.next();return Ae.typo&&!Ae.typo.check(w)?"spell-error":null}},f=a.codeMirrorInstance.getMode(h,h.backdrop||"text/plain");return a.codeMirrorInstance.overlayMode(f,v,!0)})}Ae.num_loaded=0;Ae.aff_loading=!1;Ae.dic_loading=!1;Ae.aff_data="";Ae.dic_data="";Ae.typo;$s.exports=Ae});var du=Ye(Se=>{"use strict";function eu(a,h){for(var c=0;ca.length)&&(h=a.length);for(var c=0,l=new Array(h);c=a.length?{done:!0}:{done:!1,value:a[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wc(a,h){if(typeof a!="object"||a===null)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var l=c.call(a,h||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(a)}function qc(a){var h=Wc(a,"string");return typeof h=="symbol"?h:String(h)}function Vo(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}Se.defaults=Vo();function Uc(a){Se.defaults=a}var su=/[&<>"']/,jc=new RegExp(su.source,"g"),uu=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Gc=new RegExp(uu.source,"g"),Kc={"&":"&","<":"<",">":">",'"':""","'":"'"},ru=function(h){return Kc[h]};function et(a,h){if(h){if(su.test(a))return a.replace(jc,ru)}else if(uu.test(a))return a.replace(Gc,ru);return a}var Xc=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function fu(a){return a.replace(Xc,function(h,c){return c=c.toLowerCase(),c==="colon"?":":c.charAt(0)==="#"?c.charAt(1)==="x"?String.fromCharCode(parseInt(c.substring(2),16)):String.fromCharCode(+c.substring(1)):""})}var Yc=/(^|[^\[])\^/g;function we(a,h){a=typeof a=="string"?a:a.source,h=h||"";var c={replace:function(u,v){return v=v.source||v,v=v.replace(Yc,"$1"),a=a.replace(u,v),c},getRegex:function(){return new RegExp(a,h)}};return c}var Zc=/[^\w:]/g,Qc=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function iu(a,h,c){if(a){var l;try{l=decodeURIComponent(fu(c)).replace(Zc,"").toLowerCase()}catch{return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}h&&!Qc.test(c)&&(c=ed(h,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch{return null}return c}var sn={},Jc=/^[^:]+:\/*[^/]*$/,$c=/^([^:]+:)[\s\S]*$/,Vc=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ed(a,h){sn[" "+a]||(Jc.test(a)?sn[" "+a]=a+"/":sn[" "+a]=un(a,"/",!0)),a=sn[" "+a];var c=a.indexOf(":")===-1;return h.substring(0,2)==="//"?c?h:a.replace($c,"$1")+h:h.charAt(0)==="/"?c?h:a.replace(Vc,"$1")+h:a+h}var fn={exec:function(){}};function nu(a,h){var c=a.replace(/\|/g,function(v,f,p){for(var y=!1,w=f;--w>=0&&p[w]==="\\";)y=!y;return y?"|":" |"}),l=c.split(/ \|/),u=0;if(l[0].trim()||l.shift(),l.length>0&&!l[l.length-1].trim()&&l.pop(),l.length>h)l.splice(h);else for(;l.length1;)h&1&&(c+=a),h>>=1,a+=a;return c+a}function au(a,h,c,l){var u=h.href,v=h.title?et(h.title):null,f=a[1].replace(/\\([\[\]])/g,"$1");if(a[0].charAt(0)!=="!"){l.state.inLink=!0;var p={type:"link",raw:c,href:u,title:v,text:f,tokens:l.inlineTokens(f)};return l.state.inLink=!1,p}return{type:"image",raw:c,href:u,title:v,text:et(f)}}function id(a,h){var c=a.match(/^(\s+)(?:```)/);if(c===null)return h;var l=c[1];return h.split(` -`).map(function(u){var v=u.match(/^\s+/);if(v===null)return u;var f=v[0];return f.length>=l.length?u.slice(l.length):u}).join(` -`)}var cn=function(){function a(c){this.options=c||Se.defaults}var h=a.prototype;return h.space=function(l){var u=this.rules.block.newline.exec(l);if(u&&u[0].length>0)return{type:"space",raw:u[0]}},h.code=function(l){var u=this.rules.block.code.exec(l);if(u){var v=u[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:u[0],codeBlockStyle:"indented",text:this.options.pedantic?v:un(v,` -`)}}},h.fences=function(l){var u=this.rules.block.fences.exec(l);if(u){var v=u[0],f=id(v,u[3]||"");return{type:"code",raw:v,lang:u[2]?u[2].trim().replace(this.rules.inline._escapes,"$1"):u[2],text:f}}},h.heading=function(l){var u=this.rules.block.heading.exec(l);if(u){var v=u[2].trim();if(/#$/.test(v)){var f=un(v,"#");(this.options.pedantic||!f||/ $/.test(f))&&(v=f.trim())}return{type:"heading",raw:u[0],depth:u[1].length,text:v,tokens:this.lexer.inline(v)}}},h.hr=function(l){var u=this.rules.block.hr.exec(l);if(u)return{type:"hr",raw:u[0]}},h.blockquote=function(l){var u=this.rules.block.blockquote.exec(l);if(u){var v=u[0].replace(/^ *>[ \t]?/gm,""),f=this.lexer.state.top;this.lexer.state.top=!0;var p=this.lexer.blockTokens(v);return this.lexer.state.top=f,{type:"blockquote",raw:u[0],tokens:p,text:v}}},h.list=function(l){var u=this.rules.block.list.exec(l);if(u){var v,f,p,y,w,D,T,M,N,O,z,k,L=u[1].trim(),B=L.length>1,I={type:"list",raw:"",ordered:B,start:B?+L.slice(0,-1):"",loose:!1,items:[]};L=B?"\\d{1,9}\\"+L.slice(-1):"\\"+L,this.options.pedantic&&(L=B?L:"[*+-]");for(var H=new RegExp("^( {0,3}"+L+")((?:[ ][^\\n]*)?(?:\\n|$))");l&&(k=!1,!(!(u=H.exec(l))||this.rules.block.hr.test(l)));){if(v=u[0],l=l.substring(v.length),M=u[2].split(` +`),E=X+ae.length,U=ae[ae.length-1].length;return{from:d(E,U),to:d(E+de.length-1,de.length==1?U+de[0].length:de[de.length-1].length),match:ue}}}}var D,T;String.prototype.normalize?(D=function(k){return k.normalize("NFD").toLowerCase()},T=function(k){return k.normalize("NFD")}):(D=function(k){return k.toLowerCase()},T=function(k){return k});function M(k,L,B,I){if(k.length==L.length)return B;for(var H=0,P=B+Math.max(0,k.length-L.length);;){if(H==P)return H;var X=H+P>>1,K=I(k.slice(0,X)).length;if(K==B)return X;K>B?P=X:H=X+1}}function N(k,L,B,I){if(!L.length)return null;var H=I?D:T,P=H(L).split(/\r|\n\r?/);e:for(var X=B.line,K=B.ch,ge=k.lastLine()+1-P.length;X<=ge;X++,K=0){var G=k.getLine(X).slice(K),ue=H(G);if(P.length==1){var ae=ue.indexOf(P[0]);if(ae==-1)continue e;var B=M(G,ue,ae,H)+K;return{from:d(X,M(G,ue,ae,H)+K),to:d(X,M(G,ue,ae+P[0].length,H)+K)}}else{var de=ue.length-P[0].length;if(ue.slice(de)!=P[0])continue e;for(var E=1;E=ge;X--,K=-1){var G=k.getLine(X);K>-1&&(G=G.slice(0,K));var ue=H(G);if(P.length==1){var ae=ue.lastIndexOf(P[0]);if(ae==-1)continue e;return{from:d(X,M(G,ue,ae,H)),to:d(X,M(G,ue,ae+P[0].length,H))}}else{var de=P[P.length-1];if(ue.slice(0,de.length)!=de)continue e;for(var E=1,B=X-P.length+1;E(this.doc.getLine(L.line)||"").length&&(L.ch=0,L.line++)),a.cmpPos(L,this.doc.clipPos(L))!=0))return this.atOccurrence=!1;var B=this.matches(k,L);if(this.afterEmptyMatch=B&&a.cmpPos(B.from,B.to)==0,B)return this.pos=B,this.atOccurrence=!0,this.pos.match||!0;var I=d(k?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:I,to:I},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(k,L){if(this.atOccurrence){var B=a.splitLines(k);this.doc.replaceRange(B,this.pos.from,this.pos.to,L),this.pos.to=d(this.pos.from.line+B.length-1,B[B.length-1].length+(B.length==1?this.pos.from.ch:0))}}},a.defineExtension("getSearchCursor",function(k,L,B){return new O(this.doc,k,L,B)}),a.defineDocExtension("getSearchCursor",function(k,L,B){return new O(this,k,L,B)}),a.defineExtension("selectMatches",function(k,L){for(var B=[],I=this.getSearchCursor(k,this.getCursor("from"),L);I.findNext()&&!(a.cmpPos(I.to(),this.getCursor("to"))>0);)B.push({anchor:I.from(),head:I.to()});B.length&&this.setSelections(B,0)})})});var Zs=Ye((Xs,Ys)=>{(function(a){typeof Xs=="object"&&typeof Ys=="object"?a(ct(),Zo(),Qo()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],a):a(CodeMirror)})(function(a){"use strict";var d=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;a.defineMode("gfm",function(c,l){var u=0;function g(w){return w.code=!1,null}var f={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(w){return{code:w.code,codeBlock:w.codeBlock,ateSpace:w.ateSpace}},token:function(w,D){if(D.combineTokens=null,D.codeBlock)return w.match(/^```+/)?(D.codeBlock=!1,null):(w.skipToEnd(),null);if(w.sol()&&(D.code=!1),w.sol()&&w.match(/^```+/))return w.skipToEnd(),D.codeBlock=!0,null;if(w.peek()==="`"){w.next();var T=w.pos;w.eatWhile("`");var M=1+w.pos-T;return D.code?M===u&&(D.code=!1):(u=M,D.code=!0),null}else if(D.code)return w.next(),null;if(w.eatSpace())return D.ateSpace=!0,null;if((w.sol()||D.ateSpace)&&(D.ateSpace=!1,l.gitHubSpice!==!1)){if(w.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return D.combineTokens=!0,"link";if(w.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return D.combineTokens=!0,"link"}return w.match(d)&&w.string.slice(w.start-2,w.start)!="]("&&(w.start==0||/\W/.test(w.string.charAt(w.start-1)))?(D.combineTokens=!0,"link"):(w.next(),null)},blankLine:g},p={taskLists:!0,strikethrough:!0,emoji:!0};for(var y in l)p[y]=l[y];return p.name="markdown",a.overlayMode(a.getMode(c,p),f)},"markdown"),a.defineMIME("text/x-gfm","gfm")})});var Qs=Ye(()=>{});var Js=Ye((Xd,$o)=>{var Jo;(function(){"use strict";Jo=function(a,d,c,l){l=l||{},this.dictionary=null,this.rules={},this.dictionaryTable=new Map,this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=l.flags||{},this.memoized={},this.loaded=!1;var u=this,g,f,p,y,w;a&&(u.dictionary=a,d&&c?N():(typeof window<"u"?(l.dictionaryPath?g=l.dictionaryPath:g="typo/dictionaries",window.chrome&&window.chrome.runtime&&window.chrome.runtime.getURL?g=window.chrome.runtime.getURL(g):window.browser&&window.browser.runtime&&window.browser.runtime.getURL&&(g=window.browser.runtime.getURL(g))):typeof __dirname<"u"?g=__dirname+"/dictionaries":g="./dictionaries",d||D(g+"/"+a+"/"+a+".aff",T),c||D(g+"/"+a+"/"+a+".dic",M)));function D(z,O){var k=u._readFile(z,null,l?.asyncLoad);l?.asyncLoad?k.then(function(L){O(L)}):O(k)}function T(z){d=z,c&&N()}function M(z){c=z,d&&N()}function N(){for(u.rules=u._parseAFF(d),u.compoundRuleCodes={},f=0,y=u.compoundRules.length;f0&&(P.continuationClasses=I),H!=="."&&(M==="SFX"?P.match=new RegExp(H+"$"):P.match=new RegExp("^"+H)),k!="0"&&(M==="SFX"?P.remove=new RegExp(k+"$"):P.remove=k),O.push(P)}d[N]={type:M,combineable:z==="Y",entries:O},f+=u}else if(M==="COMPOUNDRULE"){for(u=parseInt(T[1],10),p=f+1,w=f+1+u;p0&&(c.get(ue)===null&&c.set(ue,[]),c.get(ue).push(ae))}for(var u=1,g=d.length;u1){var D=this.parseRuleCodes(y[1]);(!("NEEDAFFIX"in this.flags)||D.indexOf(this.flags.NEEDAFFIX)===-1)&&l(w,D);for(var T=0,M=D.length;T"u"){if("COMPOUNDMIN"in this.flags&&a.length>=this.flags.COMPOUNDMIN){for(c=0,l=this.compoundRules.length;c"u"&&(c=Array.prototype.concat.apply([],this.dictionaryTable.get(a))),c&&c.indexOf(this.flags[d])!==-1))},alphabet:"",suggest:function(a,d){if(!this.loaded)throw"Dictionary not loaded.";if(d=d||5,this.memoized.hasOwnProperty(a)){var c=this.memoized[a].limit;if(d<=c||this.memoized[a].suggestions.length1&&K[1][1]!==K[1][0]&&(H=K[0]+K[1][1]+K[1][0]+K[1].substring(2),(!N||w.check(H))&&(H in z?z[H]+=1:z[H]=1)),K[1]){var ge=K[1].substring(0,1).toUpperCase()===K[1].substring(0,1)?"uppercase":"lowercase";for(k=0;kde?1:ue[0].localeCompare(G[0])}H.sort(P).reverse();var X=[],K="lowercase";M.toUpperCase()===M?K="uppercase":M.substr(0,1).toUpperCase()+M.substr(1).toLowerCase()===M&&(K="capitalized");var ge=d;for(B=0;B{"use strict";var $s=Js();function Ae(a){if(a=a||{},typeof a.codeMirrorInstance!="function"||typeof a.codeMirrorInstance.defineMode!="function"){console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`");return}String.prototype.includes||(String.prototype.includes=function(){"use strict";return String.prototype.indexOf.apply(this,arguments)!==-1}),a.codeMirrorInstance.defineMode("spell-checker",function(d){if(!Ae.aff_loading){Ae.aff_loading=!0;var c=new XMLHttpRequest;c.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),c.onload=function(){c.readyState===4&&c.status===200&&(Ae.aff_data=c.responseText,Ae.num_loaded++,Ae.num_loaded==2&&(Ae.typo=new $s("en_US",Ae.aff_data,Ae.dic_data,{platform:"any"})))},c.send(null)}if(!Ae.dic_loading){Ae.dic_loading=!0;var l=new XMLHttpRequest;l.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),l.onload=function(){l.readyState===4&&l.status===200&&(Ae.dic_data=l.responseText,Ae.num_loaded++,Ae.num_loaded==2&&(Ae.typo=new $s("en_US",Ae.aff_data,Ae.dic_data,{platform:"any"})))},l.send(null)}var u='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',g={token:function(p){var y=p.peek(),w="";if(u.includes(y))return p.next(),null;for(;(y=p.peek())!=null&&!u.includes(y);)w+=y,p.next();return Ae.typo&&!Ae.typo.check(w)?"spell-error":null}},f=a.codeMirrorInstance.getMode(d,d.backdrop||"text/plain");return a.codeMirrorInstance.overlayMode(f,g,!0)})}Ae.num_loaded=0;Ae.aff_loading=!1;Ae.dic_loading=!1;Ae.aff_data="";Ae.dic_data="";Ae.typo;Vs.exports=Ae});var hu=Ye(Se=>{"use strict";function tu(a,d){for(var c=0;ca.length)&&(d=a.length);for(var c=0,l=new Array(d);c=a.length?{done:!0}:{done:!1,value:a[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qc(a,d){if(typeof a!="object"||a===null)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var l=c.call(a,d||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(a)}function Uc(a){var d=qc(a,"string");return typeof d=="symbol"?d:String(d)}function Vo(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}Se.defaults=Vo();function jc(a){Se.defaults=a}var uu=/[&<>"']/,Gc=new RegExp(uu.source,"g"),fu=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Kc=new RegExp(fu.source,"g"),Xc={"&":"&","<":"<",">":">",'"':""","'":"'"},iu=function(d){return Xc[d]};function et(a,d){if(d){if(uu.test(a))return a.replace(Gc,iu)}else if(fu.test(a))return a.replace(Kc,iu);return a}var Yc=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function cu(a){return a.replace(Yc,function(d,c){return c=c.toLowerCase(),c==="colon"?":":c.charAt(0)==="#"?c.charAt(1)==="x"?String.fromCharCode(parseInt(c.substring(2),16)):String.fromCharCode(+c.substring(1)):""})}var Zc=/(^|[^\[])\^/g;function we(a,d){a=typeof a=="string"?a:a.source,d=d||"";var c={replace:function(u,g){return g=g.source||g,g=g.replace(Zc,"$1"),a=a.replace(u,g),c},getRegex:function(){return new RegExp(a,d)}};return c}var Qc=/[^\w:]/g,Jc=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function nu(a,d,c){if(a){var l;try{l=decodeURIComponent(cu(c)).replace(Qc,"").toLowerCase()}catch{return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}d&&!Jc.test(c)&&(c=td(d,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch{return null}return c}var sn={},$c=/^[^:]+:\/*[^/]*$/,Vc=/^([^:]+:)[\s\S]*$/,ed=/^([^:]+:\/*[^/]*)[\s\S]*$/;function td(a,d){sn[" "+a]||($c.test(a)?sn[" "+a]=a+"/":sn[" "+a]=un(a,"/",!0)),a=sn[" "+a];var c=a.indexOf(":")===-1;return d.substring(0,2)==="//"?c?d:a.replace(Vc,"$1")+d:d.charAt(0)==="/"?c?d:a.replace(ed,"$1")+d:a+d}var fn={exec:function(){}};function ou(a,d){var c=a.replace(/\|/g,function(g,f,p){for(var y=!1,w=f;--w>=0&&p[w]==="\\";)y=!y;return y?"|":" |"}),l=c.split(/ \|/),u=0;if(l[0].trim()||l.shift(),l.length>0&&!l[l.length-1].trim()&&l.pop(),l.length>d)l.splice(d);else for(;l.length1;)d&1&&(c+=a),d>>=1,a+=a;return c+a}function lu(a,d,c,l){var u=d.href,g=d.title?et(d.title):null,f=a[1].replace(/\\([\[\]])/g,"$1");if(a[0].charAt(0)!=="!"){l.state.inLink=!0;var p={type:"link",raw:c,href:u,title:g,text:f,tokens:l.inlineTokens(f)};return l.state.inLink=!1,p}return{type:"image",raw:c,href:u,title:g,text:et(f)}}function nd(a,d){var c=a.match(/^(\s+)(?:```)/);if(c===null)return d;var l=c[1];return d.split(` +`).map(function(u){var g=u.match(/^\s+/);if(g===null)return u;var f=g[0];return f.length>=l.length?u.slice(l.length):u}).join(` +`)}var cn=function(){function a(c){this.options=c||Se.defaults}var d=a.prototype;return d.space=function(l){var u=this.rules.block.newline.exec(l);if(u&&u[0].length>0)return{type:"space",raw:u[0]}},d.code=function(l){var u=this.rules.block.code.exec(l);if(u){var g=u[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:u[0],codeBlockStyle:"indented",text:this.options.pedantic?g:un(g,` +`)}}},d.fences=function(l){var u=this.rules.block.fences.exec(l);if(u){var g=u[0],f=nd(g,u[3]||"");return{type:"code",raw:g,lang:u[2]?u[2].trim().replace(this.rules.inline._escapes,"$1"):u[2],text:f}}},d.heading=function(l){var u=this.rules.block.heading.exec(l);if(u){var g=u[2].trim();if(/#$/.test(g)){var f=un(g,"#");(this.options.pedantic||!f||/ $/.test(f))&&(g=f.trim())}return{type:"heading",raw:u[0],depth:u[1].length,text:g,tokens:this.lexer.inline(g)}}},d.hr=function(l){var u=this.rules.block.hr.exec(l);if(u)return{type:"hr",raw:u[0]}},d.blockquote=function(l){var u=this.rules.block.blockquote.exec(l);if(u){var g=u[0].replace(/^ *>[ \t]?/gm,""),f=this.lexer.state.top;this.lexer.state.top=!0;var p=this.lexer.blockTokens(g);return this.lexer.state.top=f,{type:"blockquote",raw:u[0],tokens:p,text:g}}},d.list=function(l){var u=this.rules.block.list.exec(l);if(u){var g,f,p,y,w,D,T,M,N,z,O,k,L=u[1].trim(),B=L.length>1,I={type:"list",raw:"",ordered:B,start:B?+L.slice(0,-1):"",loose:!1,items:[]};L=B?"\\d{1,9}\\"+L.slice(-1):"\\"+L,this.options.pedantic&&(L=B?L:"[*+-]");for(var H=new RegExp("^( {0,3}"+L+")((?:[ ][^\\n]*)?(?:\\n|$))");l&&(k=!1,!(!(u=H.exec(l))||this.rules.block.hr.test(l)));){if(g=u[0],l=l.substring(g.length),M=u[2].split(` `,1)[0].replace(/^\t+/,function(de){return" ".repeat(3*de.length)}),N=l.split(` -`,1)[0],this.options.pedantic?(y=2,z=M.trimLeft()):(y=u[2].search(/[^ ]/),y=y>4?1:y,z=M.slice(y),y+=u[1].length),D=!1,!M&&/^ *$/.test(N)&&(v+=N+` -`,l=l.substring(N.length+1),k=!0),!k)for(var _=new RegExp("^ {0,"+Math.min(3,y-1)+"}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))"),X=new RegExp("^ {0,"+Math.min(3,y-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),K=new RegExp("^ {0,"+Math.min(3,y-1)+"}(?:```|~~~)"),ge=new RegExp("^ {0,"+Math.min(3,y-1)+"}#");l&&(O=l.split(` -`,1)[0],N=O,this.options.pedantic&&(N=N.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(K.test(N)||ge.test(N)||_.test(N)||X.test(l)));){if(N.search(/[^ ]/)>=y||!N.trim())z+=` -`+N.slice(y);else{if(D||M.search(/[^ ]/)>=4||K.test(M)||ge.test(M)||X.test(M))break;z+=` -`+N}!D&&!N.trim()&&(D=!0),v+=O+` -`,l=l.substring(O.length+1),M=N.slice(y)}I.loose||(T?I.loose=!0:/\n *\n *$/.test(v)&&(T=!0)),this.options.gfm&&(f=/^\[[ xX]\] /.exec(z),f&&(p=f[0]!=="[ ] ",z=z.replace(/^\[[ xX]\] +/,""))),I.items.push({type:"list_item",raw:v,task:!!f,checked:p,loose:!1,text:z}),I.raw+=v}I.items[I.items.length-1].raw=v.trimRight(),I.items[I.items.length-1].text=z.trimRight(),I.raw=I.raw.trimRight();var G=I.items.length;for(w=0;w0&&ue.some(function(de){return/\n.*\n/.test(de.raw)});I.loose=ae}if(I.loose)for(w=0;w$/,"$1").replace(this.rules.inline._escapes,"$1"):"",p=u[3]?u[3].substring(1,u[3].length-1).replace(this.rules.inline._escapes,"$1"):u[3];return{type:"def",tag:v,raw:u[0],href:f,title:p}}},h.table=function(l){var u=this.rules.block.table.exec(l);if(u){var v={type:"table",header:nu(u[1]).map(function(T){return{text:T}}),align:u[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:u[3]&&u[3].trim()?u[3].replace(/\n[ \t]*$/,"").split(` -`):[]};if(v.header.length===v.align.length){v.raw=u[0];var f=v.align.length,p,y,w,D;for(p=0;p/i.test(u[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(u[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(u[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:u[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(u[0]):et(u[0]):u[0]}},h.link=function(l){var u=this.rules.inline.link.exec(l);if(u){var v=u[2].trim();if(!this.options.pedantic&&/^$/.test(v))return;var f=un(v.slice(0,-1),"\\");if((v.length-f.length)%2===0)return}else{var p=td(u[2],"()");if(p>-1){var y=u[0].indexOf("!")===0?5:4,w=y+u[1].length+p;u[2]=u[2].substring(0,p),u[0]=u[0].substring(0,w).trim(),u[3]=""}}var D=u[2],T="";if(this.options.pedantic){var M=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(D);M&&(D=M[1],T=M[3])}else T=u[3]?u[3].slice(1,-1):"";return D=D.trim(),/^$/.test(v)?D=D.slice(1):D=D.slice(1,-1)),au(u,{href:D&&D.replace(this.rules.inline._escapes,"$1"),title:T&&T.replace(this.rules.inline._escapes,"$1")},u[0],this.lexer)}},h.reflink=function(l,u){var v;if((v=this.rules.inline.reflink.exec(l))||(v=this.rules.inline.nolink.exec(l))){var f=(v[2]||v[1]).replace(/\s+/g," ");if(f=u[f.toLowerCase()],!f){var p=v[0].charAt(0);return{type:"text",raw:p,text:p}}return au(v,f,v[0],this.lexer)}},h.emStrong=function(l,u,v){v===void 0&&(v="");var f=this.rules.inline.emStrong.lDelim.exec(l);if(f&&!(f[3]&&v.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var p=f[1]||f[2]||"";if(!p||p&&(v===""||this.rules.inline.punctuation.exec(v))){var y=f[0].length-1,w,D,T=y,M=0,N=f[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(N.lastIndex=0,u=u.slice(-1*l.length+y);(f=N.exec(u))!=null;)if(w=f[1]||f[2]||f[3]||f[4]||f[5]||f[6],!!w){if(D=w.length,f[3]||f[4]){T+=D;continue}else if((f[5]||f[6])&&y%3&&!((y+D)%3)){M+=D;continue}if(T-=D,!(T>0)){D=Math.min(D,D+T+M);var O=l.slice(0,y+f.index+(f[0].length-w.length)+D);if(Math.min(y,D)%2){var z=O.slice(1,-1);return{type:"em",raw:O,text:z,tokens:this.lexer.inlineTokens(z)}}var k=O.slice(2,-2);return{type:"strong",raw:O,text:k,tokens:this.lexer.inlineTokens(k)}}}}}},h.codespan=function(l){var u=this.rules.inline.code.exec(l);if(u){var v=u[2].replace(/\n/g," "),f=/[^ ]/.test(v),p=/^ /.test(v)&&/ $/.test(v);return f&&p&&(v=v.substring(1,v.length-1)),v=et(v,!0),{type:"codespan",raw:u[0],text:v}}},h.br=function(l){var u=this.rules.inline.br.exec(l);if(u)return{type:"br",raw:u[0]}},h.del=function(l){var u=this.rules.inline.del.exec(l);if(u)return{type:"del",raw:u[0],text:u[2],tokens:this.lexer.inlineTokens(u[2])}},h.autolink=function(l,u){var v=this.rules.inline.autolink.exec(l);if(v){var f,p;return v[2]==="@"?(f=et(this.options.mangle?u(v[1]):v[1]),p="mailto:"+f):(f=et(v[1]),p=f),{type:"link",raw:v[0],text:f,href:p,tokens:[{type:"text",raw:f,text:f}]}}},h.url=function(l,u){var v;if(v=this.rules.inline.url.exec(l)){var f,p;if(v[2]==="@")f=et(this.options.mangle?u(v[0]):v[0]),p="mailto:"+f;else{var y;do y=v[0],v[0]=this.rules.inline._backpedal.exec(v[0])[0];while(y!==v[0]);f=et(v[0]),v[1]==="www."?p="http://"+v[0]:p=v[0]}return{type:"link",raw:v[0],text:f,href:p,tokens:[{type:"text",raw:f,text:f}]}}},h.inlineText=function(l,u){var v=this.rules.inline.text.exec(l);if(v){var f;return this.lexer.state.inRawBlock?f=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(v[0]):et(v[0]):v[0]:f=et(this.options.smartypants?u(v[0]):v[0]),{type:"text",raw:v[0],text:f}}},a}(),se={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:fn,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;se.def=we(se.def).replace("label",se._label).replace("title",se._title).getRegex();se.bullet=/(?:[*+-]|\d{1,9}[.)])/;se.listItemStart=we(/^( *)(bull) */).replace("bull",se.bullet).getRegex();se.list=we(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex();se._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";se._comment=/|$)/;se.html=we(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();se.paragraph=we(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex();se.blockquote=we(se.blockquote).replace("paragraph",se.paragraph).getRegex();se.normal=gt({},se);se.gfm=gt({},se.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});se.gfm.table=we(se.gfm.table).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex();se.gfm.paragraph=we(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",se.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex();se.pedantic=gt({},se.normal,{html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:fn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:we(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var te={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:fn,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:fn,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";te.punctuation=we(te.punctuation).replace(/punctuation/g,te._punctuation).getRegex();te.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;te.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;te._comment=we(se._comment).replace("(?:-->|$)","-->").getRegex();te.emStrong.lDelim=we(te.emStrong.lDelim).replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimAst=we(te.emStrong.rDelimAst,"g").replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimUnd=we(te.emStrong.rDelimUnd,"g").replace(/punct/g,te._punctuation).getRegex();te._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;te._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;te._email=/[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])?)+(?![-_])/;te.autolink=we(te.autolink).replace("scheme",te._scheme).replace("email",te._email).getRegex();te._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;te.tag=we(te.tag).replace("comment",te._comment).replace("attribute",te._attribute).getRegex();te._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;te._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;te._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;te.link=we(te.link).replace("label",te._label).replace("href",te._href).replace("title",te._title).getRegex();te.reflink=we(te.reflink).replace("label",te._label).replace("ref",se._label).getRegex();te.nolink=we(te.nolink).replace("ref",se._label).getRegex();te.reflinkSearch=we(te.reflinkSearch,"g").replace("reflink",te.reflink).replace("nolink",te.nolink).getRegex();te.normal=gt({},te);te.pedantic=gt({},te.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:we(/^!?\[(label)\]\((.*?)\)/).replace("label",te._label).getRegex(),reflink:we(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te._label).getRegex()});te.gfm=gt({},te.normal,{escape:we(te.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(l="x"+l.toString(16)),h+="&#"+l+";";return h}var Pr=function(){function a(c){this.tokens=[],this.tokens.links=Object.create(null),this.options=c||Se.defaults,this.options.tokenizer=this.options.tokenizer||new cn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var l={block:se.normal,inline:te.normal};this.options.pedantic?(l.block=se.pedantic,l.inline=te.pedantic):this.options.gfm&&(l.block=se.gfm,this.options.breaks?l.inline=te.breaks:l.inline=te.gfm),this.tokenizer.rules=l}a.lex=function(l,u){var v=new a(u);return v.lex(l)},a.lexInline=function(l,u){var v=new a(u);return v.inlineTokens(l)};var h=a.prototype;return h.lex=function(l){l=l.replace(/\r\n|\r/g,` -`),this.blockTokens(l,this.tokens);for(var u;u=this.inlineQueue.shift();)this.inlineTokens(u.src,u.tokens);return this.tokens},h.blockTokens=function(l,u){var v=this;u===void 0&&(u=[]),this.options.pedantic?l=l.replace(/\t/g," ").replace(/^ +$/gm,""):l=l.replace(/^( *)(\t+)/gm,function(T,M,N){return M+" ".repeat(N.length)});for(var f,p,y,w;l;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(T){return(f=T.call({lexer:v},l,u))?(l=l.substring(f.raw.length),u.push(f),!0):!1}))){if(f=this.tokenizer.space(l)){l=l.substring(f.raw.length),f.raw.length===1&&u.length>0?u[u.length-1].raw+=` +`,1)[0],this.options.pedantic?(y=2,O=M.trimLeft()):(y=u[2].search(/[^ ]/),y=y>4?1:y,O=M.slice(y),y+=u[1].length),D=!1,!M&&/^ *$/.test(N)&&(g+=N+` +`,l=l.substring(N.length+1),k=!0),!k)for(var P=new RegExp("^ {0,"+Math.min(3,y-1)+"}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))"),X=new RegExp("^ {0,"+Math.min(3,y-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),K=new RegExp("^ {0,"+Math.min(3,y-1)+"}(?:```|~~~)"),ge=new RegExp("^ {0,"+Math.min(3,y-1)+"}#");l&&(z=l.split(` +`,1)[0],N=z,this.options.pedantic&&(N=N.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(K.test(N)||ge.test(N)||P.test(N)||X.test(l)));){if(N.search(/[^ ]/)>=y||!N.trim())O+=` +`+N.slice(y);else{if(D||M.search(/[^ ]/)>=4||K.test(M)||ge.test(M)||X.test(M))break;O+=` +`+N}!D&&!N.trim()&&(D=!0),g+=z+` +`,l=l.substring(z.length+1),M=N.slice(y)}I.loose||(T?I.loose=!0:/\n *\n *$/.test(g)&&(T=!0)),this.options.gfm&&(f=/^\[[ xX]\] /.exec(O),f&&(p=f[0]!=="[ ] ",O=O.replace(/^\[[ xX]\] +/,""))),I.items.push({type:"list_item",raw:g,task:!!f,checked:p,loose:!1,text:O}),I.raw+=g}I.items[I.items.length-1].raw=g.trimRight(),I.items[I.items.length-1].text=O.trimRight(),I.raw=I.raw.trimRight();var G=I.items.length;for(w=0;w0&&ue.some(function(de){return/\n.*\n/.test(de.raw)});I.loose=ae}if(I.loose)for(w=0;w$/,"$1").replace(this.rules.inline._escapes,"$1"):"",p=u[3]?u[3].substring(1,u[3].length-1).replace(this.rules.inline._escapes,"$1"):u[3];return{type:"def",tag:g,raw:u[0],href:f,title:p}}},d.table=function(l){var u=this.rules.block.table.exec(l);if(u){var g={type:"table",header:ou(u[1]).map(function(T){return{text:T}}),align:u[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:u[3]&&u[3].trim()?u[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(g.header.length===g.align.length){g.raw=u[0];var f=g.align.length,p,y,w,D;for(p=0;p/i.test(u[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(u[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(u[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:u[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(u[0]):et(u[0]):u[0]}},d.link=function(l){var u=this.rules.inline.link.exec(l);if(u){var g=u[2].trim();if(!this.options.pedantic&&/^$/.test(g))return;var f=un(g.slice(0,-1),"\\");if((g.length-f.length)%2===0)return}else{var p=rd(u[2],"()");if(p>-1){var y=u[0].indexOf("!")===0?5:4,w=y+u[1].length+p;u[2]=u[2].substring(0,p),u[0]=u[0].substring(0,w).trim(),u[3]=""}}var D=u[2],T="";if(this.options.pedantic){var M=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(D);M&&(D=M[1],T=M[3])}else T=u[3]?u[3].slice(1,-1):"";return D=D.trim(),/^$/.test(g)?D=D.slice(1):D=D.slice(1,-1)),lu(u,{href:D&&D.replace(this.rules.inline._escapes,"$1"),title:T&&T.replace(this.rules.inline._escapes,"$1")},u[0],this.lexer)}},d.reflink=function(l,u){var g;if((g=this.rules.inline.reflink.exec(l))||(g=this.rules.inline.nolink.exec(l))){var f=(g[2]||g[1]).replace(/\s+/g," ");if(f=u[f.toLowerCase()],!f){var p=g[0].charAt(0);return{type:"text",raw:p,text:p}}return lu(g,f,g[0],this.lexer)}},d.emStrong=function(l,u,g){g===void 0&&(g="");var f=this.rules.inline.emStrong.lDelim.exec(l);if(f&&!(f[3]&&g.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var p=f[1]||f[2]||"";if(!p||p&&(g===""||this.rules.inline.punctuation.exec(g))){var y=f[0].length-1,w,D,T=y,M=0,N=f[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(N.lastIndex=0,u=u.slice(-1*l.length+y);(f=N.exec(u))!=null;)if(w=f[1]||f[2]||f[3]||f[4]||f[5]||f[6],!!w){if(D=w.length,f[3]||f[4]){T+=D;continue}else if((f[5]||f[6])&&y%3&&!((y+D)%3)){M+=D;continue}if(T-=D,!(T>0)){D=Math.min(D,D+T+M);var z=l.slice(0,y+f.index+(f[0].length-w.length)+D);if(Math.min(y,D)%2){var O=z.slice(1,-1);return{type:"em",raw:z,text:O,tokens:this.lexer.inlineTokens(O)}}var k=z.slice(2,-2);return{type:"strong",raw:z,text:k,tokens:this.lexer.inlineTokens(k)}}}}}},d.codespan=function(l){var u=this.rules.inline.code.exec(l);if(u){var g=u[2].replace(/\n/g," "),f=/[^ ]/.test(g),p=/^ /.test(g)&&/ $/.test(g);return f&&p&&(g=g.substring(1,g.length-1)),g=et(g,!0),{type:"codespan",raw:u[0],text:g}}},d.br=function(l){var u=this.rules.inline.br.exec(l);if(u)return{type:"br",raw:u[0]}},d.del=function(l){var u=this.rules.inline.del.exec(l);if(u)return{type:"del",raw:u[0],text:u[2],tokens:this.lexer.inlineTokens(u[2])}},d.autolink=function(l,u){var g=this.rules.inline.autolink.exec(l);if(g){var f,p;return g[2]==="@"?(f=et(this.options.mangle?u(g[1]):g[1]),p="mailto:"+f):(f=et(g[1]),p=f),{type:"link",raw:g[0],text:f,href:p,tokens:[{type:"text",raw:f,text:f}]}}},d.url=function(l,u){var g;if(g=this.rules.inline.url.exec(l)){var f,p;if(g[2]==="@")f=et(this.options.mangle?u(g[0]):g[0]),p="mailto:"+f;else{var y;do y=g[0],g[0]=this.rules.inline._backpedal.exec(g[0])[0];while(y!==g[0]);f=et(g[0]),g[1]==="www."?p="http://"+g[0]:p=g[0]}return{type:"link",raw:g[0],text:f,href:p,tokens:[{type:"text",raw:f,text:f}]}}},d.inlineText=function(l,u){var g=this.rules.inline.text.exec(l);if(g){var f;return this.lexer.state.inRawBlock?f=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(g[0]):et(g[0]):g[0]:f=et(this.options.smartypants?u(g[0]):g[0]),{type:"text",raw:g[0],text:f}}},a}(),se={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:fn,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;se.def=we(se.def).replace("label",se._label).replace("title",se._title).getRegex();se.bullet=/(?:[*+-]|\d{1,9}[.)])/;se.listItemStart=we(/^( *)(bull) */).replace("bull",se.bullet).getRegex();se.list=we(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex();se._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";se._comment=/|$)/;se.html=we(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();se.paragraph=we(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex();se.blockquote=we(se.blockquote).replace("paragraph",se.paragraph).getRegex();se.normal=gt({},se);se.gfm=gt({},se.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});se.gfm.table=we(se.gfm.table).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex();se.gfm.paragraph=we(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",se.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex();se.pedantic=gt({},se.normal,{html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:fn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:we(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var te={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:fn,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:fn,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";te.punctuation=we(te.punctuation).replace(/punctuation/g,te._punctuation).getRegex();te.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;te.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;te._comment=we(se._comment).replace("(?:-->|$)","-->").getRegex();te.emStrong.lDelim=we(te.emStrong.lDelim).replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimAst=we(te.emStrong.rDelimAst,"g").replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimUnd=we(te.emStrong.rDelimUnd,"g").replace(/punct/g,te._punctuation).getRegex();te._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;te._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;te._email=/[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])?)+(?![-_])/;te.autolink=we(te.autolink).replace("scheme",te._scheme).replace("email",te._email).getRegex();te._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;te.tag=we(te.tag).replace("comment",te._comment).replace("attribute",te._attribute).getRegex();te._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;te._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;te._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;te.link=we(te.link).replace("label",te._label).replace("href",te._href).replace("title",te._title).getRegex();te.reflink=we(te.reflink).replace("label",te._label).replace("ref",se._label).getRegex();te.nolink=we(te.nolink).replace("ref",se._label).getRegex();te.reflinkSearch=we(te.reflinkSearch,"g").replace("reflink",te.reflink).replace("nolink",te.nolink).getRegex();te.normal=gt({},te);te.pedantic=gt({},te.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:we(/^!?\[(label)\]\((.*?)\)/).replace("label",te._label).getRegex(),reflink:we(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te._label).getRegex()});te.gfm=gt({},te.normal,{escape:we(te.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(l="x"+l.toString(16)),d+="&#"+l+";";return d}var _r=function(){function a(c){this.tokens=[],this.tokens.links=Object.create(null),this.options=c||Se.defaults,this.options.tokenizer=this.options.tokenizer||new cn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var l={block:se.normal,inline:te.normal};this.options.pedantic?(l.block=se.pedantic,l.inline=te.pedantic):this.options.gfm&&(l.block=se.gfm,this.options.breaks?l.inline=te.breaks:l.inline=te.gfm),this.tokenizer.rules=l}a.lex=function(l,u){var g=new a(u);return g.lex(l)},a.lexInline=function(l,u){var g=new a(u);return g.inlineTokens(l)};var d=a.prototype;return d.lex=function(l){l=l.replace(/\r\n|\r/g,` +`),this.blockTokens(l,this.tokens);for(var u;u=this.inlineQueue.shift();)this.inlineTokens(u.src,u.tokens);return this.tokens},d.blockTokens=function(l,u){var g=this;u===void 0&&(u=[]),this.options.pedantic?l=l.replace(/\t/g," ").replace(/^ +$/gm,""):l=l.replace(/^( *)(\t+)/gm,function(T,M,N){return M+" ".repeat(N.length)});for(var f,p,y,w;l;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(T){return(f=T.call({lexer:g},l,u))?(l=l.substring(f.raw.length),u.push(f),!0):!1}))){if(f=this.tokenizer.space(l)){l=l.substring(f.raw.length),f.raw.length===1&&u.length>0?u[u.length-1].raw+=` `:u.push(f);continue}if(f=this.tokenizer.code(l)){l=l.substring(f.raw.length),p=u[u.length-1],p&&(p.type==="paragraph"||p.type==="text")?(p.raw+=` `+f.raw,p.text+=` `+f.text,this.inlineQueue[this.inlineQueue.length-1].src=p.text):u.push(f);continue}if(f=this.tokenizer.fences(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.heading(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.hr(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.blockquote(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.list(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.html(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.def(l)){l=l.substring(f.raw.length),p=u[u.length-1],p&&(p.type==="paragraph"||p.type==="text")?(p.raw+=` `+f.raw,p.text+=` -`+f.raw,this.inlineQueue[this.inlineQueue.length-1].src=p.text):this.tokens.links[f.tag]||(this.tokens.links[f.tag]={href:f.href,title:f.title});continue}if(f=this.tokenizer.table(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.lheading(l)){l=l.substring(f.raw.length),u.push(f);continue}if(y=l,this.options.extensions&&this.options.extensions.startBlock&&function(){var T=1/0,M=l.slice(1),N=void 0;v.options.extensions.startBlock.forEach(function(O){N=O.call({lexer:this},M),typeof N=="number"&&N>=0&&(T=Math.min(T,N))}),T<1/0&&T>=0&&(y=l.substring(0,T+1))}(),this.state.top&&(f=this.tokenizer.paragraph(y))){p=u[u.length-1],w&&p.type==="paragraph"?(p.raw+=` +`+f.raw,this.inlineQueue[this.inlineQueue.length-1].src=p.text):this.tokens.links[f.tag]||(this.tokens.links[f.tag]={href:f.href,title:f.title});continue}if(f=this.tokenizer.table(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.lheading(l)){l=l.substring(f.raw.length),u.push(f);continue}if(y=l,this.options.extensions&&this.options.extensions.startBlock&&function(){var T=1/0,M=l.slice(1),N=void 0;g.options.extensions.startBlock.forEach(function(z){N=z.call({lexer:this},M),typeof N=="number"&&N>=0&&(T=Math.min(T,N))}),T<1/0&&T>=0&&(y=l.substring(0,T+1))}(),this.state.top&&(f=this.tokenizer.paragraph(y))){p=u[u.length-1],w&&p.type==="paragraph"?(p.raw+=` `+f.raw,p.text+=` `+f.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=p.text):u.push(f),w=y.length!==l.length,l=l.substring(f.raw.length);continue}if(f=this.tokenizer.text(l)){l=l.substring(f.raw.length),p=u[u.length-1],p&&p.type==="text"?(p.raw+=` `+f.raw,p.text+=` -`+f.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=p.text):u.push(f);continue}if(l){var D="Infinite loop on byte: "+l.charCodeAt(0);if(this.options.silent){console.error(D);break}else throw new Error(D)}}return this.state.top=!0,u},h.inline=function(l,u){return u===void 0&&(u=[]),this.inlineQueue.push({src:l,tokens:u}),u},h.inlineTokens=function(l,u){var v=this;u===void 0&&(u=[]);var f,p,y,w=l,D,T,M;if(this.tokens.links){var N=Object.keys(this.tokens.links);if(N.length>0)for(;(D=this.tokenizer.rules.inline.reflinkSearch.exec(w))!=null;)N.includes(D[0].slice(D[0].lastIndexOf("[")+1,-1))&&(w=w.slice(0,D.index)+"["+ou("a",D[0].length-2)+"]"+w.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(D=this.tokenizer.rules.inline.blockSkip.exec(w))!=null;)w=w.slice(0,D.index)+"["+ou("a",D[0].length-2)+"]"+w.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(D=this.tokenizer.rules.inline.escapedEmSt.exec(w))!=null;)w=w.slice(0,D.index+D[0].length-2)+"++"+w.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;l;)if(T||(M=""),T=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(z){return(f=z.call({lexer:v},l,u))?(l=l.substring(f.raw.length),u.push(f),!0):!1}))){if(f=this.tokenizer.escape(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.tag(l)){l=l.substring(f.raw.length),p=u[u.length-1],p&&f.type==="text"&&p.type==="text"?(p.raw+=f.raw,p.text+=f.text):u.push(f);continue}if(f=this.tokenizer.link(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(f.raw.length),p=u[u.length-1],p&&f.type==="text"&&p.type==="text"?(p.raw+=f.raw,p.text+=f.text):u.push(f);continue}if(f=this.tokenizer.emStrong(l,w,M)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.codespan(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.br(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.del(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.autolink(l,lu)){l=l.substring(f.raw.length),u.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(l,lu))){l=l.substring(f.raw.length),u.push(f);continue}if(y=l,this.options.extensions&&this.options.extensions.startInline&&function(){var z=1/0,k=l.slice(1),L=void 0;v.options.extensions.startInline.forEach(function(B){L=B.call({lexer:this},k),typeof L=="number"&&L>=0&&(z=Math.min(z,L))}),z<1/0&&z>=0&&(y=l.substring(0,z+1))}(),f=this.tokenizer.inlineText(y,nd)){l=l.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(M=f.raw.slice(-1)),T=!0,p=u[u.length-1],p&&p.type==="text"?(p.raw+=f.raw,p.text+=f.text):u.push(f);continue}if(l){var O="Infinite loop on byte: "+l.charCodeAt(0);if(this.options.silent){console.error(O);break}else throw new Error(O)}}return u},Pc(a,null,[{key:"rules",get:function(){return{block:se,inline:te}}}]),a}(),dn=function(){function a(c){this.options=c||Se.defaults}var h=a.prototype;return h.code=function(l,u,v){var f=(u||"").match(/\S*/)[0];if(this.options.highlight){var p=this.options.highlight(l,f);p!=null&&p!==l&&(v=!0,l=p)}return l=l.replace(/\n$/,"")+` -`,f?'
'+(v?l:et(l,!0))+`
-`:"
"+(v?l:et(l,!0))+`
-`},h.blockquote=function(l){return`
+`+f.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=p.text):u.push(f);continue}if(l){var D="Infinite loop on byte: "+l.charCodeAt(0);if(this.options.silent){console.error(D);break}else throw new Error(D)}}return this.state.top=!0,u},d.inline=function(l,u){return u===void 0&&(u=[]),this.inlineQueue.push({src:l,tokens:u}),u},d.inlineTokens=function(l,u){var g=this;u===void 0&&(u=[]);var f,p,y,w=l,D,T,M;if(this.tokens.links){var N=Object.keys(this.tokens.links);if(N.length>0)for(;(D=this.tokenizer.rules.inline.reflinkSearch.exec(w))!=null;)N.includes(D[0].slice(D[0].lastIndexOf("[")+1,-1))&&(w=w.slice(0,D.index)+"["+au("a",D[0].length-2)+"]"+w.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(D=this.tokenizer.rules.inline.blockSkip.exec(w))!=null;)w=w.slice(0,D.index)+"["+au("a",D[0].length-2)+"]"+w.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(D=this.tokenizer.rules.inline.escapedEmSt.exec(w))!=null;)w=w.slice(0,D.index+D[0].length-2)+"++"+w.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;l;)if(T||(M=""),T=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(O){return(f=O.call({lexer:g},l,u))?(l=l.substring(f.raw.length),u.push(f),!0):!1}))){if(f=this.tokenizer.escape(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.tag(l)){l=l.substring(f.raw.length),p=u[u.length-1],p&&f.type==="text"&&p.type==="text"?(p.raw+=f.raw,p.text+=f.text):u.push(f);continue}if(f=this.tokenizer.link(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(f.raw.length),p=u[u.length-1],p&&f.type==="text"&&p.type==="text"?(p.raw+=f.raw,p.text+=f.text):u.push(f);continue}if(f=this.tokenizer.emStrong(l,w,M)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.codespan(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.br(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.del(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.autolink(l,su)){l=l.substring(f.raw.length),u.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(l,su))){l=l.substring(f.raw.length),u.push(f);continue}if(y=l,this.options.extensions&&this.options.extensions.startInline&&function(){var O=1/0,k=l.slice(1),L=void 0;g.options.extensions.startInline.forEach(function(B){L=B.call({lexer:this},k),typeof L=="number"&&L>=0&&(O=Math.min(O,L))}),O<1/0&&O>=0&&(y=l.substring(0,O+1))}(),f=this.tokenizer.inlineText(y,od)){l=l.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(M=f.raw.slice(-1)),T=!0,p=u[u.length-1],p&&p.type==="text"?(p.raw+=f.raw,p.text+=f.text):u.push(f);continue}if(l){var z="Infinite loop on byte: "+l.charCodeAt(0);if(this.options.silent){console.error(z);break}else throw new Error(z)}}return u},Pc(a,null,[{key:"rules",get:function(){return{block:se,inline:te}}}]),a}(),dn=function(){function a(c){this.options=c||Se.defaults}var d=a.prototype;return d.code=function(l,u,g){var f=(u||"").match(/\S*/)[0];if(this.options.highlight){var p=this.options.highlight(l,f);p!=null&&p!==l&&(g=!0,l=p)}return l=l.replace(/\n$/,"")+` +`,f?'
'+(g?l:et(l,!0))+`
+`:"
"+(g?l:et(l,!0))+`
+`},d.blockquote=function(l){return`
`+l+`
-`},h.html=function(l){return l},h.heading=function(l,u,v,f){if(this.options.headerIds){var p=this.options.headerPrefix+f.slug(v);return"'+l+" +`},d.html=function(l){return l},d.heading=function(l,u,g,f){if(this.options.headerIds){var p=this.options.headerPrefix+f.slug(g);return"'+l+" `}return""+l+" -`},h.hr=function(){return this.options.xhtml?`
+`},d.hr=function(){return this.options.xhtml?`
`:`
-`},h.list=function(l,u,v){var f=u?"ol":"ul",p=u&&v!==1?' start="'+v+'"':"";return"<"+f+p+`> +`},d.list=function(l,u,g){var f=u?"ol":"ul",p=u&&g!==1?' start="'+g+'"':"";return"<"+f+p+`> `+l+" -`},h.listitem=function(l){return"
  • "+l+`
  • -`},h.checkbox=function(l){return" "},h.paragraph=function(l){return"

    "+l+`

    -`},h.table=function(l,u){return u&&(u=""+u+""),` +`},d.listitem=function(l){return"
  • "+l+`
  • +`},d.checkbox=function(l){return" "},d.paragraph=function(l){return"

    "+l+`

    +`},d.table=function(l,u){return u&&(u=""+u+""),`
    `+l+` `+u+`
    -`},h.tablerow=function(l){return` +`},d.tablerow=function(l){return` `+l+` -`},h.tablecell=function(l,u){var v=u.header?"th":"td",f=u.align?"<"+v+' align="'+u.align+'">':"<"+v+">";return f+l+(" -`)},h.strong=function(l){return""+l+""},h.em=function(l){return""+l+""},h.codespan=function(l){return""+l+""},h.br=function(){return this.options.xhtml?"
    ":"
    "},h.del=function(l){return""+l+""},h.link=function(l,u,v){if(l=iu(this.options.sanitize,this.options.baseUrl,l),l===null)return v;var f='",f},h.image=function(l,u,v){if(l=iu(this.options.sanitize,this.options.baseUrl,l),l===null)return v;var f=''+v+'":">",f},h.text=function(l){return l},a}(),ea=function(){function a(){}var h=a.prototype;return h.strong=function(l){return l},h.em=function(l){return l},h.codespan=function(l){return l},h.del=function(l){return l},h.html=function(l){return l},h.text=function(l){return l},h.link=function(l,u,v){return""+v},h.image=function(l,u,v){return""+v},h.br=function(){return""},a}(),ta=function(){function a(){this.seen={}}var h=a.prototype;return h.serialize=function(l){return l.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},h.getNextSafeSlug=function(l,u){var v=l,f=0;if(this.seen.hasOwnProperty(v)){f=this.seen[l];do f++,v=l+"-"+f;while(this.seen.hasOwnProperty(v))}return u||(this.seen[l]=f,this.seen[v]=0),v},h.slug=function(l,u){u===void 0&&(u={});var v=this.serialize(l);return this.getNextSafeSlug(v,u.dryrun)},a}(),_r=function(){function a(c){this.options=c||Se.defaults,this.options.renderer=this.options.renderer||new dn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ea,this.slugger=new ta}a.parse=function(l,u){var v=new a(u);return v.parse(l)},a.parseInline=function(l,u){var v=new a(u);return v.parseInline(l)};var h=a.prototype;return h.parse=function(l,u){u===void 0&&(u=!0);var v="",f,p,y,w,D,T,M,N,O,z,k,L,B,I,H,_,X,K,ge,G=l.length;for(f=0;f0&&H.tokens[0].type==="paragraph"?(H.tokens[0].text=K+" "+H.tokens[0].text,H.tokens[0].tokens&&H.tokens[0].tokens.length>0&&H.tokens[0].tokens[0].type==="text"&&(H.tokens[0].tokens[0].text=K+" "+H.tokens[0].tokens[0].text)):H.tokens.unshift({type:"text",text:K}):I+=K),I+=this.parse(H.tokens,B),O+=this.renderer.listitem(I,X,_);v+=this.renderer.list(O,k,L);continue}case"html":{v+=this.renderer.html(z.text);continue}case"paragraph":{v+=this.renderer.paragraph(this.parseInline(z.tokens));continue}case"text":{for(O=z.tokens?this.parseInline(z.tokens):z.text;f+1";if(h)return Promise.resolve(u);if(c){c(null,u);return}return u}if(h)return Promise.reject(l);if(c){c(l);return}throw l}}function cu(a,h){return function(c,l,u){typeof l=="function"&&(u=l,l=null);var v=gt({},l);l=gt({},le.defaults,v);var f=od(l.silent,l.async,u);if(typeof c>"u"||c===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof c!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(c)+", string expected"));if(rd(l),l.hooks&&(l.hooks.options=l),u){var p=l.highlight,y;try{l.hooks&&(c=l.hooks.preprocess(c)),y=a(c,l)}catch(N){return f(N)}var w=function(O){var z;if(!O)try{l.walkTokens&&le.walkTokens(y,l.walkTokens),z=h(y,l),l.hooks&&(z=l.hooks.postprocess(z))}catch(k){O=k}return l.highlight=p,O?f(O):u(null,z)};if(!p||p.length<3||(delete l.highlight,!y.length))return w();var D=0;le.walkTokens(y,function(N){N.type==="code"&&(D++,setTimeout(function(){p(N.text,N.lang,function(O,z){if(O)return w(O);z!=null&&z!==N.text&&(N.text=z,N.escaped=!0),D--,D===0&&w()})},0))}),D===0&&w();return}if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(c):c).then(function(N){return a(N,l)}).then(function(N){return l.walkTokens?Promise.all(le.walkTokens(N,l.walkTokens)).then(function(){return N}):N}).then(function(N){return h(N,l)}).then(function(N){return l.hooks?l.hooks.postprocess(N):N}).catch(f);try{l.hooks&&(c=l.hooks.preprocess(c));var T=a(c,l);l.walkTokens&&le.walkTokens(T,l.walkTokens);var M=h(T,l);return l.hooks&&(M=l.hooks.postprocess(M)),M}catch(N){return f(N)}}}function le(a,h,c){return cu(Pr.lex,_r.parse)(a,h,c)}le.options=le.setOptions=function(a){return le.defaults=gt({},le.defaults,a),Uc(le.defaults),le};le.getDefaults=Vo;le.defaults=Se.defaults;le.use=function(){for(var a=le.defaults.extensions||{renderers:{},childTokens:{}},h=arguments.length,c=new Array(h),l=0;l{"use strict";var Wr=ct();ys();Ds();ks();Zo();Qo();Os();Ps();qs();Gs();Ys();Yo();var pd=Vs(),ra=du().marked,gu=/Mac/.test(navigator.platform),gd=new RegExp(/()+?/g),wi={toggleBold:gn,toggleItalic:vn,drawLink:An,toggleHeadingSmaller:ki,toggleHeadingBigger:xn,drawImage:Ln,toggleBlockquote:yn,toggleOrderedList:Sn,toggleUnorderedList:kn,toggleCheckList:Fn,toggleCodeBlock:bn,togglePreview:In,toggleStrikethrough:mn,toggleHeading1:Dn,toggleHeading2:Cn,toggleHeading3:wn,toggleHeading4:na,toggleHeading5:oa,toggleHeading6:aa,cleanBlock:En,drawTable:Tn,drawHorizontalRule:Mn,undo:Bn,redo:Nn,toggleSideBySide:qr,toggleFullScreen:hr},vd={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",toggleHeading1:"Ctrl+Alt+1",toggleHeading2:"Ctrl+Alt+2",toggleHeading3:"Ctrl+Alt+3",toggleHeading4:"Ctrl+Alt+4",toggleHeading5:"Ctrl+Alt+5",toggleHeading6:"Ctrl+Alt+6",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCheckList:"Shift-Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},md=function(a){for(var h in wi)if(wi[h]===a)return h;return null},ia=function(){var a=!1;return function(h){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(h)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(h.substr(0,4)))&&(a=!0)}(navigator.userAgent||navigator.vendor||window.opera),a};function bd(a){for(var h;(h=gd.exec(a))!==null;){var c=h[0];if(c.indexOf("target=")===-1){var l=c.replace(/>$/,' target="_blank">');a=a.replace(c,l)}}return a}function yd(a){for(var h=new DOMParser,c=h.parseFromString(a,"text/html"),l=c.getElementsByTagName("li"),u=0;u0){for(var N=document.createElement("i"),O=0;O':"<"+g+">";return f+l+(" +`)},d.strong=function(l){return""+l+""},d.em=function(l){return""+l+""},d.codespan=function(l){return""+l+""},d.br=function(){return this.options.xhtml?"
    ":"
    "},d.del=function(l){return""+l+""},d.link=function(l,u,g){if(l=nu(this.options.sanitize,this.options.baseUrl,l),l===null)return g;var f='
    ",f},d.image=function(l,u,g){if(l=nu(this.options.sanitize,this.options.baseUrl,l),l===null)return g;var f=''+g+'":">",f},d.text=function(l){return l},a}(),ea=function(){function a(){}var d=a.prototype;return d.strong=function(l){return l},d.em=function(l){return l},d.codespan=function(l){return l},d.del=function(l){return l},d.html=function(l){return l},d.text=function(l){return l},d.link=function(l,u,g){return""+g},d.image=function(l,u,g){return""+g},d.br=function(){return""},a}(),ta=function(){function a(){this.seen={}}var d=a.prototype;return d.serialize=function(l){return l.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},d.getNextSafeSlug=function(l,u){var g=l,f=0;if(this.seen.hasOwnProperty(g)){f=this.seen[l];do f++,g=l+"-"+f;while(this.seen.hasOwnProperty(g))}return u||(this.seen[l]=f,this.seen[g]=0),g},d.slug=function(l,u){u===void 0&&(u={});var g=this.serialize(l);return this.getNextSafeSlug(g,u.dryrun)},a}(),Pr=function(){function a(c){this.options=c||Se.defaults,this.options.renderer=this.options.renderer||new dn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ea,this.slugger=new ta}a.parse=function(l,u){var g=new a(u);return g.parse(l)},a.parseInline=function(l,u){var g=new a(u);return g.parseInline(l)};var d=a.prototype;return d.parse=function(l,u){u===void 0&&(u=!0);var g="",f,p,y,w,D,T,M,N,z,O,k,L,B,I,H,P,X,K,ge,G=l.length;for(f=0;f0&&H.tokens[0].type==="paragraph"?(H.tokens[0].text=K+" "+H.tokens[0].text,H.tokens[0].tokens&&H.tokens[0].tokens.length>0&&H.tokens[0].tokens[0].type==="text"&&(H.tokens[0].tokens[0].text=K+" "+H.tokens[0].tokens[0].text)):H.tokens.unshift({type:"text",text:K}):I+=K),I+=this.parse(H.tokens,B),z+=this.renderer.listitem(I,X,P);g+=this.renderer.list(z,k,L);continue}case"html":{g+=this.renderer.html(O.text);continue}case"paragraph":{g+=this.renderer.paragraph(this.parseInline(O.tokens));continue}case"text":{for(z=O.tokens?this.parseInline(O.tokens):O.text;f+1";if(d)return Promise.resolve(u);if(c){c(null,u);return}return u}if(d)return Promise.reject(l);if(c){c(l);return}throw l}}function du(a,d){return function(c,l,u){typeof l=="function"&&(u=l,l=null);var g=gt({},l);l=gt({},le.defaults,g);var f=ad(l.silent,l.async,u);if(typeof c>"u"||c===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof c!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(c)+", string expected"));if(id(l),l.hooks&&(l.hooks.options=l),u){var p=l.highlight,y;try{l.hooks&&(c=l.hooks.preprocess(c)),y=a(c,l)}catch(N){return f(N)}var w=function(z){var O;if(!z)try{l.walkTokens&&le.walkTokens(y,l.walkTokens),O=d(y,l),l.hooks&&(O=l.hooks.postprocess(O))}catch(k){z=k}return l.highlight=p,z?f(z):u(null,O)};if(!p||p.length<3||(delete l.highlight,!y.length))return w();var D=0;le.walkTokens(y,function(N){N.type==="code"&&(D++,setTimeout(function(){p(N.text,N.lang,function(z,O){if(z)return w(z);O!=null&&O!==N.text&&(N.text=O,N.escaped=!0),D--,D===0&&w()})},0))}),D===0&&w();return}if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(c):c).then(function(N){return a(N,l)}).then(function(N){return l.walkTokens?Promise.all(le.walkTokens(N,l.walkTokens)).then(function(){return N}):N}).then(function(N){return d(N,l)}).then(function(N){return l.hooks?l.hooks.postprocess(N):N}).catch(f);try{l.hooks&&(c=l.hooks.preprocess(c));var T=a(c,l);l.walkTokens&&le.walkTokens(T,l.walkTokens);var M=d(T,l);return l.hooks&&(M=l.hooks.postprocess(M)),M}catch(N){return f(N)}}}function le(a,d,c){return du(_r.lex,Pr.parse)(a,d,c)}le.options=le.setOptions=function(a){return le.defaults=gt({},le.defaults,a),jc(le.defaults),le};le.getDefaults=Vo;le.defaults=Se.defaults;le.use=function(){for(var a=le.defaults.extensions||{renderers:{},childTokens:{}},d=arguments.length,c=new Array(d),l=0;l{"use strict";var Wr=ct();xs();Cs();Ss();Zo();Qo();Hs();Ps();Us();Ks();Zs();Yo();var gd=eu(),ra=hu().marked,vu=/Mac/.test(navigator.platform),vd=new RegExp(/()+?/g),wi={toggleBold:gn,toggleItalic:vn,drawLink:An,toggleHeadingSmaller:ki,toggleHeadingBigger:xn,drawImage:Ln,toggleBlockquote:yn,toggleOrderedList:Sn,toggleUnorderedList:kn,toggleCheckList:Fn,toggleCodeBlock:bn,togglePreview:In,toggleStrikethrough:mn,toggleHeading1:Dn,toggleHeading2:Cn,toggleHeading3:wn,toggleHeading4:na,toggleHeading5:oa,toggleHeading6:aa,cleanBlock:En,drawTable:Tn,drawHorizontalRule:Mn,undo:Bn,redo:Nn,toggleSideBySide:qr,toggleFullScreen:hr},md={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",toggleHeading1:"Ctrl+Alt+1",toggleHeading2:"Ctrl+Alt+2",toggleHeading3:"Ctrl+Alt+3",toggleHeading4:"Ctrl+Alt+4",toggleHeading5:"Ctrl+Alt+5",toggleHeading6:"Ctrl+Alt+6",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCheckList:"Shift-Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},bd=function(a){for(var d in wi)if(wi[d]===a)return d;return null},ia=function(){var a=!1;return function(d){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(d)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(d.substr(0,4)))&&(a=!0)}(navigator.userAgent||navigator.vendor||window.opera),a};function yd(a){for(var d;(d=vd.exec(a))!==null;){var c=d[0];if(c.indexOf("target=")===-1){var l=c.replace(/>$/,' target="_blank">');a=a.replace(c,l)}}return a}function xd(a){for(var d=new DOMParser,c=d.parseFromString(a,"text/html"),l=c.getElementsByTagName("li"),u=0;u0){for(var N=document.createElement("i"),z=0;z=0&&(D=f.getLineHandle(M),!c(D));M--);var L=f.getTokenAt({line:M,ch:1}),B=l(L).fencedChars,I,H,_,X;c(f.getLineHandle(p.line))?(I="",H=p.line):c(f.getLineHandle(p.line-1))?(I="",H=p.line-1):(I=B+` -`,H=p.line),c(f.getLineHandle(y.line))?(_="",X=y.line,y.ch===0&&(X+=1)):y.ch!==0&&c(f.getLineHandle(y.line+1))?(_="",X=y.line+1):(_=B+` -`,X=y.line+1),y.ch===0&&(X-=1),f.operation(function(){f.replaceRange(_,{line:X,ch:0},{line:X+(_?0:1),ch:0}),f.replaceRange(I,{line:H,ch:0},{line:H+(I?0:1),ch:0})}),f.setSelection({line:H+(I?1:0),ch:0},{line:X+(I?1:-1),ch:0}),f.focus()}else{var K=p.line;if(c(f.getLineHandle(p.line))&&(u(f,p.line+1)==="fenced"?(M=p.line,K=p.line+1):(N=p.line,K=p.line-1)),M===void 0)for(M=K;M>=0&&(D=f.getLineHandle(M),!c(D));M--);if(N===void 0)for(O=f.lineCount(),N=K;N=0;M--)if(D=f.getLineHandle(M),!D.text.match(/^\s*$/)&&u(f,M,D)!=="indented"){M+=1;break}for(O=f.lineCount(),N=p.line;N\s+/,"unordered-list":l,"ordered-list":l,"check-list":/^(\s*)(- \[[ xX]])(\s+)/},w=function(L,B){var I={quote:">","unordered-list":c,"ordered-list":"%%i.","check-list":"- [ ]"};return I[L].replace("%%i",B)},D=function(L,B){var I={quote:">","unordered-list":"\\"+c,"ordered-list":"\\d+.","check-list":"- \\[[ xX]]"},H=new RegExp(I[L]);return B&&H.test(B)},T=function(L,B,I){var H=l.exec(B),_=w(L,M);return H!==null?(D(L,H[2])&&(_=""),B=H[1]+_+H[3]+B.replace(u,"").replace(y[L],"$1")):I==!1&&(B=_+" "+B),B},M=1,N=["unordered-list","ordered-list","check-list"],O=Object.keys(v)[0];if(!N.includes(O)){var z=a.getLine(f.line);/^\s*- \[[ xX]]\s/.test(z)?O="check-list":/^\s*\d+\.\s/.test(z)?O="ordered-list":/^\s*[*\-+]\s/.test(z)&&(O="unordered-list")}for(var k=f.line;k<=p.line;k++)(function(L){var B=a.getLine(L);v[h]?B=B.replace(y[h],"$1"):N.includes(O)&&N.includes(h)?(B=B.replace(y[O],"$1"),B=T(h,B,!1),M+=1):(B=T(h,B,!1),M+=1),a.replaceRange(B,{line:L,ch:0},{line:L,ch:99999999999999})})(k);a.focus()}}function yu(a,h,c,l){if(!(!a.codemirror||a.isPreviewActive())){var u=a.codemirror,v=Qt(u),f=v[h];if(!f){pr(u,f,c,l);return}var p=u.getCursor("start"),y=u.getCursor("end"),w=u.getLine(p.line),D=w.slice(0,p.ch),T=w.slice(p.ch);h=="link"?D=D.replace(/(.*)[^!]\[/,"$1"):h=="image"&&(D=D.replace(/(.*)!\[$/,"$1")),T=T.replace(/]\(.*?\)/,""),u.replaceRange(D+T,{line:p.line,ch:0},{line:p.line,ch:99999999999999}),p.ch-=c[0].length,p!==y&&(y.ch-=c[0].length),u.setSelection(p,y),u.focus()}}function sa(a,h,c,l){if(!(!a.codemirror||a.isPreviewActive())){l=typeof l>"u"?c:l;var u=a.codemirror,v=Qt(u),f,p=c,y=l,w=u.getCursor("start"),D=u.getCursor("end");v[h]?(f=u.getLine(w.line),p=f.slice(0,w.ch),y=f.slice(w.ch),h=="bold"?(p=p.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),y=y.replace(/(\*\*|__)/,"")):h=="italic"?(p=p.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),y=y.replace(/(\*|_)/,"")):h=="strikethrough"&&(p=p.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),y=y.replace(/(\*\*|~~)/,"")),u.replaceRange(p+y,{line:w.line,ch:0},{line:w.line,ch:99999999999999}),h=="bold"||h=="strikethrough"?(w.ch-=2,w!==D&&(D.ch-=2)):h=="italic"&&(w.ch-=1,w!==D&&(D.ch-=1))):(f=u.getSelection(),h=="bold"?(f=f.split("**").join(""),f=f.split("__").join("")):h=="italic"?(f=f.split("*").join(""),f=f.split("_").join("")):h=="strikethrough"&&(f=f.split("~~").join("")),u.replaceSelection(p+f+y),w.ch+=c.length,D.ch=w.ch+f.length),u.setSelection(w,D),u.focus()}}function wd(a){if(!a.getWrapperElement().lastChild.classList.contains("editor-preview-active"))for(var h=a.getCursor("start"),c=a.getCursor("end"),l,u=h.line;u<=c.line;u++)l=a.getLine(u),l=l.replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,""),a.replaceRange(l,{line:u,ch:0},{line:u,ch:99999999999999})}function pn(a,h){if(Math.abs(a)<1024)return""+a+h[0];var c=0;do a/=1024,++c;while(Math.abs(a)>=1024&&c=19968?l+=c[u].length:l+=1;return l}var ke={bold:"fa fa-bold",italic:"fa fa-italic",strikethrough:"fa fa-strikethrough",heading:"fa fa-header fa-heading","heading-smaller":"fa fa-header fa-heading header-smaller","heading-bigger":"fa fa-header fa-heading header-bigger","heading-1":"fa fa-header fa-heading header-1","heading-2":"fa fa-header fa-heading header-2","heading-3":"fa fa-header fa-heading header-3",code:"fa fa-code",quote:"fa fa-quote-left","ordered-list":"fa fa-list-ol","unordered-list":"fa fa-list-ul","check-list":"fa fa-check-square-o","clean-block":"fa fa-eraser",link:"fa fa-link",image:"fa fa-image","upload-image":"fa fa-image",table:"fa fa-table","horizontal-rule":"fa fa-minus",preview:"fa fa-eye","side-by-side":"fa fa-columns",fullscreen:"fa fa-arrows-alt",guide:"fa fa-question-circle",undo:"fa fa-undo",redo:"fa fa-repeat fa-redo"},dr={bold:{name:"bold",action:gn,className:ke.bold,title:"Bold",default:!0},italic:{name:"italic",action:vn,className:ke.italic,title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:mn,className:ke.strikethrough,title:"Strikethrough"},heading:{name:"heading",action:ki,className:ke.heading,title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:ki,className:ke["heading-smaller"],title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:xn,className:ke["heading-bigger"],title:"Bigger Heading"},"heading-1":{name:"heading-1",action:Dn,className:ke["heading-1"],title:"Big Heading"},"heading-2":{name:"heading-2",action:Cn,className:ke["heading-2"],title:"Medium Heading"},"heading-3":{name:"heading-3",action:wn,className:ke["heading-3"],title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:bn,className:ke.code,title:"Code"},quote:{name:"quote",action:yn,className:ke.quote,title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:kn,className:ke["unordered-list"],title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:Sn,className:ke["ordered-list"],title:"Numbered List",default:!0},"check-list":{name:"check-list",action:Fn,className:ke["check-list"],title:"Check List",default:!0},"clean-block":{name:"clean-block",action:En,className:ke["clean-block"],title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:An,className:ke.link,title:"Create Link",default:!0},image:{name:"image",action:Ln,className:ke.image,title:"Insert Image",default:!0},"upload-image":{name:"upload-image",action:la,className:ke["upload-image"],title:"Import an image"},table:{name:"table",action:Tn,className:ke.table,title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:Mn,className:ke["horizontal-rule"],title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:In,className:ke.preview,noDisable:!0,title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:qr,className:ke["side-by-side"],noDisable:!0,noMobile:!0,title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:hr,className:ke.fullscreen,noDisable:!0,noMobile:!0,title:"Toggle Fullscreen",default:!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://www.markdownguide.org/basic-syntax/",className:ke.guide,noDisable:!0,title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:Bn,className:ke.undo,noDisable:!0,title:"Undo"},redo:{name:"redo",action:Nn,className:ke.redo,noDisable:!0,title:"Redo"}},kd={link:["[","](#url#)"],image:["![","](#url#)"],uploadedImage:["![](#url#)",""],table:["",` +`,vt--),pr(U,!1,[b,ee]),U.setSelection({line:Te,ch:0},{line:vt,ch:0})}var f=a.codemirror,p=f.getCursor("start"),y=f.getCursor("end"),w=f.getTokenAt({line:p.line,ch:p.ch||1}),D=f.getLineHandle(p.line),T=u(f,p.line,D,w),M,N,z;if(T==="single"){var O=D.text.slice(0,p.ch).replace("`",""),k=D.text.slice(p.ch).replace("`","");f.replaceRange(O+k,{line:p.line,ch:0},{line:p.line,ch:99999999999999}),p.ch--,p!==y&&y.ch--,f.setSelection(p,y),f.focus()}else if(T==="fenced")if(p.line!==y.line||p.ch!==y.ch){for(M=p.line;M>=0&&(D=f.getLineHandle(M),!c(D));M--);var L=f.getTokenAt({line:M,ch:1}),B=l(L).fencedChars,I,H,P,X;c(f.getLineHandle(p.line))?(I="",H=p.line):c(f.getLineHandle(p.line-1))?(I="",H=p.line-1):(I=B+` +`,H=p.line),c(f.getLineHandle(y.line))?(P="",X=y.line,y.ch===0&&(X+=1)):y.ch!==0&&c(f.getLineHandle(y.line+1))?(P="",X=y.line+1):(P=B+` +`,X=y.line+1),y.ch===0&&(X-=1),f.operation(function(){f.replaceRange(P,{line:X,ch:0},{line:X+(P?0:1),ch:0}),f.replaceRange(I,{line:H,ch:0},{line:H+(I?0:1),ch:0})}),f.setSelection({line:H+(I?1:0),ch:0},{line:X+(I?1:-1),ch:0}),f.focus()}else{var K=p.line;if(c(f.getLineHandle(p.line))&&(u(f,p.line+1)==="fenced"?(M=p.line,K=p.line+1):(N=p.line,K=p.line-1)),M===void 0)for(M=K;M>=0&&(D=f.getLineHandle(M),!c(D));M--);if(N===void 0)for(z=f.lineCount(),N=K;N=0;M--)if(D=f.getLineHandle(M),!D.text.match(/^\s*$/)&&u(f,M,D)!=="indented"){M+=1;break}for(z=f.lineCount(),N=p.line;N\s+/,"unordered-list":l,"ordered-list":l,"check-list":/^(\s*)(- \[[ xX]])(\s+)/},w=function(L,B){var I={quote:">","unordered-list":c,"ordered-list":"%%i.","check-list":"- [ ]"};return I[L].replace("%%i",B)},D=function(L,B){var I={quote:">","unordered-list":"\\"+c,"ordered-list":"\\d+.","check-list":"- \\[[ xX]]"},H=new RegExp(I[L]);return B&&H.test(B)},T=function(L,B,I){var H=l.exec(B),P=w(L,M);return H!==null?(D(L,H[2])&&(P=""),B=H[1]+P+H[3]+B.replace(u,"").replace(y[L],"$1")):I==!1&&(B=P+" "+B),B},M=1,N=["unordered-list","ordered-list","check-list"],z=Object.keys(g)[0];if(!N.includes(z)){var O=a.getLine(f.line);/^\s*- \[[ xX]]\s/.test(O)?z="check-list":/^\s*\d+\.\s/.test(O)?z="ordered-list":/^\s*[*\-+]\s/.test(O)&&(z="unordered-list")}for(var k=f.line;k<=p.line;k++)(function(L){var B=a.getLine(L);g[d]?B=B.replace(y[d],"$1"):N.includes(z)&&N.includes(d)?(B=B.replace(y[z],"$1"),B=T(d,B,!1),M+=1):(B=T(d,B,!1),M+=1),a.replaceRange(B,{line:L,ch:0},{line:L,ch:99999999999999})})(k);a.focus()}}function xu(a,d,c,l){if(!(!a.codemirror||a.isPreviewActive())){var u=a.codemirror,g=Qt(u),f=g[d];if(!f){pr(u,f,c,l);return}var p=u.getCursor("start"),y=u.getCursor("end"),w=u.getLine(p.line),D=w.slice(0,p.ch),T=w.slice(p.ch);d=="link"?D=D.replace(/(.*)[^!]\[/,"$1"):d=="image"&&(D=D.replace(/(.*)!\[$/,"$1")),T=T.replace(/]\(.*?\)/,""),u.replaceRange(D+T,{line:p.line,ch:0},{line:p.line,ch:99999999999999}),p.ch-=c[0].length,p!==y&&(y.ch-=c[0].length),u.setSelection(p,y),u.focus()}}function sa(a,d,c,l){if(!(!a.codemirror||a.isPreviewActive())){l=typeof l>"u"?c:l;var u=a.codemirror,g=Qt(u),f,p=c,y=l,w=u.getCursor("start"),D=u.getCursor("end");g[d]?(f=u.getLine(w.line),p=f.slice(0,w.ch),y=f.slice(w.ch),d=="bold"?(p=p.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),y=y.replace(/(\*\*|__)/,"")):d=="italic"?(p=p.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),y=y.replace(/(\*|_)/,"")):d=="strikethrough"&&(p=p.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),y=y.replace(/(\*\*|~~)/,"")),u.replaceRange(p+y,{line:w.line,ch:0},{line:w.line,ch:99999999999999}),d=="bold"||d=="strikethrough"?(w.ch-=2,w!==D&&(D.ch-=2)):d=="italic"&&(w.ch-=1,w!==D&&(D.ch-=1))):(f=u.getSelection(),d=="bold"?(f=f.split("**").join(""),f=f.split("__").join("")):d=="italic"?(f=f.split("*").join(""),f=f.split("_").join("")):d=="strikethrough"&&(f=f.split("~~").join("")),u.replaceSelection(p+f+y),w.ch+=c.length,D.ch=w.ch+f.length),u.setSelection(w,D),u.focus()}}function kd(a){if(!a.getWrapperElement().lastChild.classList.contains("editor-preview-active"))for(var d=a.getCursor("start"),c=a.getCursor("end"),l,u=d.line;u<=c.line;u++)l=a.getLine(u),l=l.replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,""),a.replaceRange(l,{line:u,ch:0},{line:u,ch:99999999999999})}function pn(a,d){if(Math.abs(a)<1024)return""+a+d[0];var c=0;do a/=1024,++c;while(Math.abs(a)>=1024&&c=19968?l+=c[u].length:l+=1;return l}var ke={bold:"fa fa-bold",italic:"fa fa-italic",strikethrough:"fa fa-strikethrough",heading:"fa fa-header fa-heading","heading-smaller":"fa fa-header fa-heading header-smaller","heading-bigger":"fa fa-header fa-heading header-bigger","heading-1":"fa fa-header fa-heading header-1","heading-2":"fa fa-header fa-heading header-2","heading-3":"fa fa-header fa-heading header-3",code:"fa fa-code",quote:"fa fa-quote-left","ordered-list":"fa fa-list-ol","unordered-list":"fa fa-list-ul","check-list":"fa fa-check-square-o","clean-block":"fa fa-eraser",link:"fa fa-link",image:"fa fa-image","upload-image":"fa fa-image",table:"fa fa-table","horizontal-rule":"fa fa-minus",preview:"fa fa-eye","side-by-side":"fa fa-columns",fullscreen:"fa fa-arrows-alt",guide:"fa fa-question-circle",undo:"fa fa-undo",redo:"fa fa-repeat fa-redo"},dr={bold:{name:"bold",action:gn,className:ke.bold,title:"Bold",default:!0},italic:{name:"italic",action:vn,className:ke.italic,title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:mn,className:ke.strikethrough,title:"Strikethrough"},heading:{name:"heading",action:ki,className:ke.heading,title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:ki,className:ke["heading-smaller"],title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:xn,className:ke["heading-bigger"],title:"Bigger Heading"},"heading-1":{name:"heading-1",action:Dn,className:ke["heading-1"],title:"Big Heading"},"heading-2":{name:"heading-2",action:Cn,className:ke["heading-2"],title:"Medium Heading"},"heading-3":{name:"heading-3",action:wn,className:ke["heading-3"],title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:bn,className:ke.code,title:"Code"},quote:{name:"quote",action:yn,className:ke.quote,title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:kn,className:ke["unordered-list"],title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:Sn,className:ke["ordered-list"],title:"Numbered List",default:!0},"check-list":{name:"check-list",action:Fn,className:ke["check-list"],title:"Check List",default:!0},"clean-block":{name:"clean-block",action:En,className:ke["clean-block"],title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:An,className:ke.link,title:"Create Link",default:!0},image:{name:"image",action:Ln,className:ke.image,title:"Insert Image",default:!0},"upload-image":{name:"upload-image",action:la,className:ke["upload-image"],title:"Import an image"},table:{name:"table",action:Tn,className:ke.table,title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:Mn,className:ke["horizontal-rule"],title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:In,className:ke.preview,noDisable:!0,title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:qr,className:ke["side-by-side"],noDisable:!0,noMobile:!0,title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:hr,className:ke.fullscreen,noDisable:!0,noMobile:!0,title:"Toggle Fullscreen",default:!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://www.markdownguide.org/basic-syntax/",className:ke.guide,noDisable:!0,title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:Bn,className:ke.undo,noDisable:!0,title:"Undo"},redo:{name:"redo",action:Nn,className:ke.redo,noDisable:!0,title:"Redo"}},Sd={link:["[","](#url#)"],image:["![","](#url#)"],uploadedImage:["![](#url#)",""],table:["",` | Column 1 | Column 2 | Column 3 | | -------- | -------- | -------- | @@ -91,5 +91,5 @@ Please report this to https://github.com/markedjs/marked.`,a){var u="

    An error ----- -`]},Sd={link:"URL for the link:",image:"URL of the image:"},Fd={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},Ed={bold:"**",code:"```",italic:"*"},Ad={sbInit:"Attach files by drag and dropping or pasting from clipboard.",sbOnDragEnter:"Drop image to upload it.",sbOnDrop:"Uploading image #images_names#...",sbProgress:"Uploading #file_name#: #progress#%",sbOnUploaded:"Uploaded #image_name#",sizeUnits:" B, KB, MB"},Ld={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:`Image #image_name# is too big (#image_size#). -Maximum file size is #image_max_size#.`,importError:"Something went wrong when uploading the image #image_name#."};function J(a){a=a||{},a.parent=this;var h=!0;if(a.autoDownloadFontAwesome===!1&&(h=!1),a.autoDownloadFontAwesome!==!0)for(var c=document.styleSheets,l=0;l-1&&(h=!1);if(h){var u=document.createElement("link");u.rel="stylesheet",u.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(u)}if(a.element)this.element=a.element;else if(a.element===null){console.log("EasyMDE: Error. No element was found.");return}if(a.toolbar===void 0){a.toolbar=[];for(var v in dr)Object.prototype.hasOwnProperty.call(dr,v)&&(v.indexOf("separator-")!=-1&&a.toolbar.push("|"),(dr[v].default===!0||a.showIcons&&a.showIcons.constructor===Array&&a.showIcons.indexOf(v)!=-1)&&a.toolbar.push(v))}if(Object.prototype.hasOwnProperty.call(a,"previewClass")||(a.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(a,"status")||(a.status=["autosave","lines","words","cursor"],a.uploadImage&&a.status.unshift("upload-image")),a.previewRender||(a.previewRender=function(p){return this.parent.markdown(p)}),a.parsingConfig=Rt({highlightFormatting:!0},a.parsingConfig||{}),a.insertTexts=Rt({},kd,a.insertTexts||{}),a.promptTexts=Rt({},Sd,a.promptTexts||{}),a.blockStyles=Rt({},Ed,a.blockStyles||{}),a.autosave!=null&&(a.autosave.timeFormat=Rt({},Fd,a.autosave.timeFormat||{})),a.iconClassMap=Rt({},ke,a.iconClassMap||{}),a.shortcuts=Rt({},vd,a.shortcuts||{}),a.maxHeight=a.maxHeight||void 0,a.direction=a.direction||"ltr",typeof a.maxHeight<"u"?a.minHeight=a.maxHeight:a.minHeight=a.minHeight||"300px",a.errorCallback=a.errorCallback||function(p){alert(p)},a.uploadImage=a.uploadImage||!1,a.imageMaxSize=a.imageMaxSize||2097152,a.imageAccept=a.imageAccept||"image/png, image/jpeg, image/gif, image/avif",a.imageTexts=Rt({},Ad,a.imageTexts||{}),a.errorMessages=Rt({},Ld,a.errorMessages||{}),a.imagePathAbsolute=a.imagePathAbsolute||!1,a.imageCSRFName=a.imageCSRFName||"csrfmiddlewaretoken",a.imageCSRFHeader=a.imageCSRFHeader||!1,a.imageInputName=a.imageInputName||"image",a.autosave!=null&&a.autosave.unique_id!=null&&a.autosave.unique_id!=""&&(a.autosave.uniqueId=a.autosave.unique_id),a.overlayMode&&a.overlayMode.combine===void 0&&(a.overlayMode.combine=!0),this.options=a,this.render(),a.initialValue&&(!this.options.autosave||this.options.autosave.foundSavedValue!==!0)&&this.value(a.initialValue),a.uploadImage){var f=this;this.codemirror.on("dragenter",function(p,y){f.updateStatusBar("upload-image",f.options.imageTexts.sbOnDragEnter),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragend",function(p,y){f.updateStatusBar("upload-image",f.options.imageTexts.sbInit),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragleave",function(p,y){f.updateStatusBar("upload-image",f.options.imageTexts.sbInit),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragover",function(p,y){f.updateStatusBar("upload-image",f.options.imageTexts.sbOnDragEnter),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("drop",function(p,y){y.stopPropagation(),y.preventDefault(),a.imageUploadFunction?f.uploadImagesUsingCustomFunction(a.imageUploadFunction,y.dataTransfer.files):f.uploadImages(y.dataTransfer.files)}),this.codemirror.on("paste",function(p,y){a.imageUploadFunction?f.uploadImagesUsingCustomFunction(a.imageUploadFunction,y.clipboardData.files):f.uploadImages(y.clipboardData.files)})}}J.prototype.uploadImages=function(a,h,c){if(a.length!==0){for(var l=[],u=0;u=2){var I=B[1];if(h.imagesPreviewHandler){var H=h.imagesPreviewHandler(B[1]);typeof H=="string"&&(I=H)}if(window.EMDEimagesCache[I])N(L,window.EMDEimagesCache[I]);else{window.EMDEimagesCache[I]={};var _=document.createElement("img");_.onload=function(){window.EMDEimagesCache[I]={naturalWidth:_.naturalWidth,naturalHeight:_.naturalHeight,url:I},N(L,window.EMDEimagesCache[I])},_.src=I}}}})}this.codemirror.on("update",function(){O()}),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element,(h.autofocus===!0||a.autofocus)&&this.codemirror.focus();var z=this.codemirror;setTimeout(function(){z.refresh()}.bind(z),0)};J.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)};function Du(){if(typeof localStorage=="object")try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch{return!1}else return!1;return!0}J.prototype.autosave=function(){if(Du()){var a=this;if(this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to use the autosave feature");return}this.options.autosave.binded!==!0&&(a.element.form!=null&&a.element.form!=null&&a.element.form.addEventListener("submit",function(){clearTimeout(a.autosaveTimeoutId),a.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+a.options.autosave.uniqueId)}),this.options.autosave.binded=!0),this.options.autosave.loaded!==!0&&(typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)=="string"&&localStorage.getItem("smde_"+this.options.autosave.uniqueId)!=""&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0);var h=a.value();h!==""?localStorage.setItem("smde_"+this.options.autosave.uniqueId,h):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var c=document.getElementById("autosaved");if(c!=null&&c!=null&&c!=""){var l=new Date,u=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(l),v=this.options.autosave.text==null?"Autosaved: ":this.options.autosave.text;c.innerHTML=v+u}}else console.log("EasyMDE: localStorage not available, cannot autosave")};J.prototype.clearAutosavedValue=function(){if(Du()){if(this.options.autosave==null||this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to clear the autosave value");return}localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("EasyMDE: localStorage not available, cannot autosave")};J.prototype.openBrowseFileWindow=function(a,h){var c=this,l=this.gui.toolbar.getElementsByClassName("imageInput")[0];l.click();function u(v){c.options.imageUploadFunction?c.uploadImagesUsingCustomFunction(c.options.imageUploadFunction,v.target.files):c.uploadImages(v.target.files,a,h),l.removeEventListener("change",u)}l.addEventListener("change",u)};J.prototype.uploadImage=function(a,h,c){var l=this;h=h||function(w){bu(l,w)};function u(y){l.updateStatusBar("upload-image",y),setTimeout(function(){l.updateStatusBar("upload-image",l.options.imageTexts.sbInit)},1e4),c&&typeof c=="function"&&c(y),l.options.errorCallback(y)}function v(y){var w=l.options.imageTexts.sizeUnits.split(",");return y.replace("#image_name#",a.name).replace("#image_size#",pn(a.size,w)).replace("#image_max_size#",pn(l.options.imageMaxSize,w))}if(a.size>this.options.imageMaxSize){u(v(this.options.errorMessages.fileTooLarge));return}var f=new FormData;f.append("image",a),l.options.imageCSRFToken&&!l.options.imageCSRFHeader&&f.append(l.options.imageCSRFName,l.options.imageCSRFToken);var p=new XMLHttpRequest;p.upload.onprogress=function(y){if(y.lengthComputable){var w=""+Math.round(y.loaded*100/y.total);l.updateStatusBar("upload-image",l.options.imageTexts.sbProgress.replace("#file_name#",a.name).replace("#progress#",w))}},p.open("POST",this.options.imageUploadEndpoint),l.options.imageCSRFToken&&l.options.imageCSRFHeader&&p.setRequestHeader(l.options.imageCSRFName,l.options.imageCSRFToken),p.onload=function(){try{var y=JSON.parse(this.responseText)}catch{console.error("EasyMDE: The server did not return a valid json."),u(v(l.options.errorMessages.importError));return}this.status===200&&y&&!y.error&&y.data&&y.data.filePath?h((l.options.imagePathAbsolute?"":window.location.origin+"/")+y.data.filePath):y.error&&y.error in l.options.errorMessages?u(v(l.options.errorMessages[y.error])):y.error?u(v(y.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),u(v(l.options.errorMessages.importError)))},p.onerror=function(y){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+y.target.status+" ("+y.target.statusText+")"),u(l.options.errorMessages.importError)},p.send(f)};J.prototype.uploadImageUsingCustomFunction=function(a,h){var c=this;function l(f){bu(c,f)}function u(f){var p=v(f);c.updateStatusBar("upload-image",p),setTimeout(function(){c.updateStatusBar("upload-image",c.options.imageTexts.sbInit)},1e4),c.options.errorCallback(p)}function v(f){var p=c.options.imageTexts.sizeUnits.split(",");return f.replace("#image_name#",h.name).replace("#image_size#",pn(h.size,p)).replace("#image_max_size#",pn(c.options.imageMaxSize,p))}a.apply(this,[h,l,u])};J.prototype.setPreviewMaxHeight=function(){var a=this.codemirror,h=a.getWrapperElement(),c=h.nextSibling,l=parseInt(window.getComputedStyle(h).paddingTop),u=parseInt(window.getComputedStyle(h).borderTopWidth),v=parseInt(this.options.maxHeight),f=v+l*2+u*2,p=f.toString()+"px";c.style.height=p};J.prototype.createSideBySide=function(){var a=this.codemirror,h=a.getWrapperElement(),c=h.nextSibling;if(!c||!c.classList.contains("editor-preview-side")){if(c=document.createElement("div"),c.className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(var l=0;l0),a.classList.toggle("is-busy",w>0)}function N(k){var L=document.createElement("li");L.className="photo-card is-converting";var B=document.createElement("img");B.className="photo-card__thumb",B.alt=k.name||"photo";var I=document.createElement("span");return I.className="photo-card__state",I.textContent="converting\u2026",L.appendChild(B),L.appendChild(I),c&&c.appendChild(L),{li:L,img:B,state:I}}function O(k,L){var B=new FormData;return B.append("__form-name__",D("__form-name__")),B.append("__unique_form_id__",D("__unique_form_id__")),B.append("__form-file-uploader__","1"),B.append("form-nonce",D("form-nonce")),B.append("name",v),B.append("data["+v+"][]",k,L),fetch(f,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:B,credentials:"same-origin"}).then(function(I){return I.json()}).then(function(I){if(!I||I.status==="error")throw new Error(I&&I.message||"Upload failed");return I})}function z(k){if(y>=p){T("You can attach up to "+p+" photos.","err");return}y++,w++,M();var L=N(k);Bd(k).then(function(B){return B?import("./heic-to-CN7JBE7H.js").then(function(I){var H=I.heicTo||I.default&&I.default.heicTo;return H({blob:k,type:"image/jpeg",quality:.85})}):k}).then(function(B){var I=B===k,H=I&&/\.(jpe?g|png)$/i.test(k.name)?k.name:Nd(k.name);try{L.img.src=URL.createObjectURL(B)}catch{}return L.state.textContent="uploading\u2026",O(B,H)}).then(function(){L.li.classList.remove("is-converting"),L.li.classList.add("is-done"),L.state.textContent="\u2713"}).catch(function(){y--,L.li.classList.remove("is-converting"),L.li.classList.add("is-error"),L.state.textContent="\u2717 skipped",T("A photo could not be processed and was skipped \u2014 the others are fine.","err")}).then(function(){w--,M()})}h.addEventListener("change",function(){T(""),Array.prototype.slice.call(h.files||[]).forEach(z),h.value=""}),u.addEventListener("submit",function(k){w>0&&(k.preventDefault(),T("Hang on \u2014 photos are still uploading.","err"))},!0)}function vr(a){return document.querySelector('[name="data['+a+']"]')}function zd(){var a=Array.prototype.slice.call(document.querySelectorAll(".advanced-field"));if(a.length){var h=[];if(a.forEach(function(v){var f=v.closest(".form-field");f&&h.indexOf(f)===-1&&h.push(f)}),!!h.length){var c=document.createElement("details");c.className="more-options";var l=document.createElement("summary");l.className="more-options__summary",l.textContent="More options",c.appendChild(l),h[0].parentNode.insertBefore(c,h[0]),h.forEach(function(v){c.appendChild(v)});var u=h.some(function(v){var f=v.querySelector('input[type="text"]');if(f&&f.value.trim())return!0;var p=v.querySelector('input[type="radio"]:checked');return!!(p&&p.value&&p.value!=="0")});u&&(c.open=!0)}}}var Od={0:"Sunny",1:"Partly cloudy",2:"Partly cloudy",3:"Cloudy",45:"Foggy",48:"Foggy",51:"Drizzle",53:"Drizzle",55:"Drizzle",56:"Drizzle",57:"Drizzle",61:"Rain",63:"Rain",65:"Rain",66:"Rain",67:"Rain",80:"Rain",81:"Rain",82:"Rain",71:"Snow",73:"Snow",75:"Snow",77:"Snow",85:"Snow",86:"Snow",95:"Thunderstorm",96:"Thunderstorm",99:"Thunderstorm"};function $t(a,h,c){a&&(a.className="form-status"+(c?" form-status--"+c:""),a.textContent=h||"")}function Hd(){var a=document.getElementById("get-location"),h=document.getElementById("get-weather");if(!a&&!h)return;var c=document.getElementById("location-status"),l=document.getElementById("weather-status");function u(){var f=vr("lat"),p=vr("lng"),y=f?f.value.trim():"",w=p?p.value.trim():"";return y&&w?{lat:y,lng:w}:null}function v(){if(h){var f=!!u();h.disabled=!f,h.title=f?"":"Get location first"}}v(),a&&a.addEventListener("click",function(){if(!navigator.geolocation){$t(c,"Geolocation is not supported on this device.","err");return}a.classList.add("is-loading"),a.disabled=!0,$t(c,"Getting location\u2026"),navigator.geolocation.getCurrentPosition(function(f){var p=f.coords.latitude.toFixed(6),y=f.coords.longitude.toFixed(6),w=vr("lat"),D=vr("lng");w&&(w.value=p),D&&(D.value=y),a.classList.remove("is-loading"),a.disabled=!1,$t(c,"\u2713 Location captured \xB7 "+p+", "+y,"ok"),v()},function(f){a.classList.remove("is-loading"),a.disabled=!1,$t(c,"\u2717 "+(f&&f.message?f.message:"Could not get location")+" \u2014 enter coordinates manually if needed.","err")},{enableHighAccuracy:!0,timeout:15e3})}),h&&h.addEventListener("click",function(){var f=u();if(!f){$t(l,"Get location first, then fetch weather.","err");return}h.classList.add("is-loading"),h.disabled=!0,$t(l,"Fetching weather\u2026");var p="https://api.open-meteo.com/v1/forecast?latitude="+f.lat+"&longitude="+f.lng+"¤t=temperature_2m,weather_code&temperature_unit=celsius";fetch(p).then(function(y){return y.json()}).then(function(y){var w=Math.round(y.current.temperature_2m),D=Od[y.current.weather_code]||"Cloudy",T=vr("weather_temp_c"),M=vr("weather_desc");T&&(T.value=w),M&&(M.value=D),h.classList.remove("is-loading"),v(),$t(l,"\u2713 Weather set \xB7 "+D+" \xB7 "+w+"\xB0C (edit above if needed)","ok")}).catch(function(){h.classList.remove("is-loading"),v(),$t(l,"\u2717 Could not fetch weather \u2014 set it manually above.","err")})})}function Rd(){var a={title:"Title",content:"Content"},h=document.querySelector('form[name="new-entry"]');if(!h)return;function c(){h.querySelectorAll(".field-error").forEach(function(u){u.remove()}),h.querySelectorAll(".field-invalid").forEach(function(u){u.classList.remove("field-invalid")})}function l(u,v){u.classList.add("field-invalid");var f=document.createElement("span");f.className="field-error",f.textContent=v,u.parentNode.insertBefore(f,u.nextSibling)}h.addEventListener("submit",function(u){c();var v=null;Object.keys(a).forEach(function(f){var p=vr(f);p&&!String(p.value).trim()&&(l(p,a[f]+" is required."),v||(v=p))}),v&&(u.preventDefault(),v.focus(),v.scrollIntoView({behavior:"smooth",block:"center"}))})}function ku(){window.postFormEditor=Td(),Id(),zd(),Hd(),Rd()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ku):ku(); +`]},Fd={link:"URL for the link:",image:"URL of the image:"},Ed={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},Ad={bold:"**",code:"```",italic:"*"},Ld={sbInit:"Attach files by drag and dropping or pasting from clipboard.",sbOnDragEnter:"Drop image to upload it.",sbOnDrop:"Uploading image #images_names#...",sbProgress:"Uploading #file_name#: #progress#%",sbOnUploaded:"Uploaded #image_name#",sizeUnits:" B, KB, MB"},Td={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:`Image #image_name# is too big (#image_size#). +Maximum file size is #image_max_size#.`,importError:"Something went wrong when uploading the image #image_name#."};function J(a){a=a||{},a.parent=this;var d=!0;if(a.autoDownloadFontAwesome===!1&&(d=!1),a.autoDownloadFontAwesome!==!0)for(var c=document.styleSheets,l=0;l-1&&(d=!1);if(d){var u=document.createElement("link");u.rel="stylesheet",u.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(u)}if(a.element)this.element=a.element;else if(a.element===null){console.log("EasyMDE: Error. No element was found.");return}if(a.toolbar===void 0){a.toolbar=[];for(var g in dr)Object.prototype.hasOwnProperty.call(dr,g)&&(g.indexOf("separator-")!=-1&&a.toolbar.push("|"),(dr[g].default===!0||a.showIcons&&a.showIcons.constructor===Array&&a.showIcons.indexOf(g)!=-1)&&a.toolbar.push(g))}if(Object.prototype.hasOwnProperty.call(a,"previewClass")||(a.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(a,"status")||(a.status=["autosave","lines","words","cursor"],a.uploadImage&&a.status.unshift("upload-image")),a.previewRender||(a.previewRender=function(p){return this.parent.markdown(p)}),a.parsingConfig=Rt({highlightFormatting:!0},a.parsingConfig||{}),a.insertTexts=Rt({},Sd,a.insertTexts||{}),a.promptTexts=Rt({},Fd,a.promptTexts||{}),a.blockStyles=Rt({},Ad,a.blockStyles||{}),a.autosave!=null&&(a.autosave.timeFormat=Rt({},Ed,a.autosave.timeFormat||{})),a.iconClassMap=Rt({},ke,a.iconClassMap||{}),a.shortcuts=Rt({},md,a.shortcuts||{}),a.maxHeight=a.maxHeight||void 0,a.direction=a.direction||"ltr",typeof a.maxHeight<"u"?a.minHeight=a.maxHeight:a.minHeight=a.minHeight||"300px",a.errorCallback=a.errorCallback||function(p){alert(p)},a.uploadImage=a.uploadImage||!1,a.imageMaxSize=a.imageMaxSize||2097152,a.imageAccept=a.imageAccept||"image/png, image/jpeg, image/gif, image/avif",a.imageTexts=Rt({},Ld,a.imageTexts||{}),a.errorMessages=Rt({},Td,a.errorMessages||{}),a.imagePathAbsolute=a.imagePathAbsolute||!1,a.imageCSRFName=a.imageCSRFName||"csrfmiddlewaretoken",a.imageCSRFHeader=a.imageCSRFHeader||!1,a.imageInputName=a.imageInputName||"image",a.autosave!=null&&a.autosave.unique_id!=null&&a.autosave.unique_id!=""&&(a.autosave.uniqueId=a.autosave.unique_id),a.overlayMode&&a.overlayMode.combine===void 0&&(a.overlayMode.combine=!0),this.options=a,this.render(),a.initialValue&&(!this.options.autosave||this.options.autosave.foundSavedValue!==!0)&&this.value(a.initialValue),a.uploadImage){var f=this;this.codemirror.on("dragenter",function(p,y){f.updateStatusBar("upload-image",f.options.imageTexts.sbOnDragEnter),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragend",function(p,y){f.updateStatusBar("upload-image",f.options.imageTexts.sbInit),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragleave",function(p,y){f.updateStatusBar("upload-image",f.options.imageTexts.sbInit),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragover",function(p,y){f.updateStatusBar("upload-image",f.options.imageTexts.sbOnDragEnter),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("drop",function(p,y){y.stopPropagation(),y.preventDefault(),a.imageUploadFunction?f.uploadImagesUsingCustomFunction(a.imageUploadFunction,y.dataTransfer.files):f.uploadImages(y.dataTransfer.files)}),this.codemirror.on("paste",function(p,y){a.imageUploadFunction?f.uploadImagesUsingCustomFunction(a.imageUploadFunction,y.clipboardData.files):f.uploadImages(y.clipboardData.files)})}}J.prototype.uploadImages=function(a,d,c){if(a.length!==0){for(var l=[],u=0;u=2){var I=B[1];if(d.imagesPreviewHandler){var H=d.imagesPreviewHandler(B[1]);typeof H=="string"&&(I=H)}if(window.EMDEimagesCache[I])N(L,window.EMDEimagesCache[I]);else{window.EMDEimagesCache[I]={};var P=document.createElement("img");P.onload=function(){window.EMDEimagesCache[I]={naturalWidth:P.naturalWidth,naturalHeight:P.naturalHeight,url:I},N(L,window.EMDEimagesCache[I])},P.src=I}}}})}this.codemirror.on("update",function(){z()}),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element,(d.autofocus===!0||a.autofocus)&&this.codemirror.focus();var O=this.codemirror;setTimeout(function(){O.refresh()}.bind(O),0)};J.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)};function Cu(){if(typeof localStorage=="object")try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch{return!1}else return!1;return!0}J.prototype.autosave=function(){if(Cu()){var a=this;if(this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to use the autosave feature");return}this.options.autosave.binded!==!0&&(a.element.form!=null&&a.element.form!=null&&a.element.form.addEventListener("submit",function(){clearTimeout(a.autosaveTimeoutId),a.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+a.options.autosave.uniqueId)}),this.options.autosave.binded=!0),this.options.autosave.loaded!==!0&&(typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)=="string"&&localStorage.getItem("smde_"+this.options.autosave.uniqueId)!=""&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0);var d=a.value();d!==""?localStorage.setItem("smde_"+this.options.autosave.uniqueId,d):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var c=document.getElementById("autosaved");if(c!=null&&c!=null&&c!=""){var l=new Date,u=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(l),g=this.options.autosave.text==null?"Autosaved: ":this.options.autosave.text;c.innerHTML=g+u}}else console.log("EasyMDE: localStorage not available, cannot autosave")};J.prototype.clearAutosavedValue=function(){if(Cu()){if(this.options.autosave==null||this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to clear the autosave value");return}localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("EasyMDE: localStorage not available, cannot autosave")};J.prototype.openBrowseFileWindow=function(a,d){var c=this,l=this.gui.toolbar.getElementsByClassName("imageInput")[0];l.click();function u(g){c.options.imageUploadFunction?c.uploadImagesUsingCustomFunction(c.options.imageUploadFunction,g.target.files):c.uploadImages(g.target.files,a,d),l.removeEventListener("change",u)}l.addEventListener("change",u)};J.prototype.uploadImage=function(a,d,c){var l=this;d=d||function(w){yu(l,w)};function u(y){l.updateStatusBar("upload-image",y),setTimeout(function(){l.updateStatusBar("upload-image",l.options.imageTexts.sbInit)},1e4),c&&typeof c=="function"&&c(y),l.options.errorCallback(y)}function g(y){var w=l.options.imageTexts.sizeUnits.split(",");return y.replace("#image_name#",a.name).replace("#image_size#",pn(a.size,w)).replace("#image_max_size#",pn(l.options.imageMaxSize,w))}if(a.size>this.options.imageMaxSize){u(g(this.options.errorMessages.fileTooLarge));return}var f=new FormData;f.append("image",a),l.options.imageCSRFToken&&!l.options.imageCSRFHeader&&f.append(l.options.imageCSRFName,l.options.imageCSRFToken);var p=new XMLHttpRequest;p.upload.onprogress=function(y){if(y.lengthComputable){var w=""+Math.round(y.loaded*100/y.total);l.updateStatusBar("upload-image",l.options.imageTexts.sbProgress.replace("#file_name#",a.name).replace("#progress#",w))}},p.open("POST",this.options.imageUploadEndpoint),l.options.imageCSRFToken&&l.options.imageCSRFHeader&&p.setRequestHeader(l.options.imageCSRFName,l.options.imageCSRFToken),p.onload=function(){try{var y=JSON.parse(this.responseText)}catch{console.error("EasyMDE: The server did not return a valid json."),u(g(l.options.errorMessages.importError));return}this.status===200&&y&&!y.error&&y.data&&y.data.filePath?d((l.options.imagePathAbsolute?"":window.location.origin+"/")+y.data.filePath):y.error&&y.error in l.options.errorMessages?u(g(l.options.errorMessages[y.error])):y.error?u(g(y.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),u(g(l.options.errorMessages.importError)))},p.onerror=function(y){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+y.target.status+" ("+y.target.statusText+")"),u(l.options.errorMessages.importError)},p.send(f)};J.prototype.uploadImageUsingCustomFunction=function(a,d){var c=this;function l(f){yu(c,f)}function u(f){var p=g(f);c.updateStatusBar("upload-image",p),setTimeout(function(){c.updateStatusBar("upload-image",c.options.imageTexts.sbInit)},1e4),c.options.errorCallback(p)}function g(f){var p=c.options.imageTexts.sizeUnits.split(",");return f.replace("#image_name#",d.name).replace("#image_size#",pn(d.size,p)).replace("#image_max_size#",pn(c.options.imageMaxSize,p))}a.apply(this,[d,l,u])};J.prototype.setPreviewMaxHeight=function(){var a=this.codemirror,d=a.getWrapperElement(),c=d.nextSibling,l=parseInt(window.getComputedStyle(d).paddingTop),u=parseInt(window.getComputedStyle(d).borderTopWidth),g=parseInt(this.options.maxHeight),f=g+l*2+u*2,p=f.toString()+"px";c.style.height=p};J.prototype.createSideBySide=function(){var a=this.codemirror,d=a.getWrapperElement(),c=d.nextSibling;if(!c||!c.classList.contains("editor-preview-side")){if(c=document.createElement("div"),c.className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(var l=0;l0),a.classList.toggle("is-busy",w>0)}function N(k){var L=document.createElement("li");L.className="photo-card is-converting";var B=document.createElement("img");B.className="photo-card__thumb",B.alt=k.name||"photo";var I=document.createElement("span");return I.className="photo-card__state",I.textContent="converting\u2026",L.appendChild(B),L.appendChild(I),c&&c.appendChild(L),{li:L,img:B,state:I}}function z(k,L){var B=new FormData;return B.append("__form-name__",D("__form-name__")),B.append("__unique_form_id__",D("__unique_form_id__")),B.append("__form-file-uploader__","1"),B.append("form-nonce",D("form-nonce")),B.append("name",g),B.append("data["+g+"][]",k,L),fetch(f,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:B,credentials:"same-origin"}).then(function(I){return I.json()}).then(function(I){if(!I||I.status==="error")throw new Error(I&&I.message||"Upload failed");return I})}function O(k){if(y>=p){T("You can attach up to "+p+" photos.","err");return}y++,w++,M();var L=N(k);Nd(k).then(function(B){return B?import("./heic-to-CN7JBE7H.js").then(function(I){var H=I.heicTo||I.default&&I.default.heicTo;return H({blob:k,type:"image/jpeg",quality:.85})}):k}).then(function(B){var I=B===k,H=I&&/\.(jpe?g|png)$/i.test(k.name)?k.name:Id(k.name);try{L.img.src=URL.createObjectURL(B)}catch{}return L.state.textContent="uploading\u2026",z(B,H)}).then(function(){L.li.classList.remove("is-converting"),L.li.classList.add("is-done"),L.state.textContent="\u2713"}).catch(function(){y--,L.li.classList.remove("is-converting"),L.li.classList.add("is-error"),L.state.textContent="\u2717 skipped",T("A photo could not be processed and was skipped \u2014 the others are fine.","err")}).then(function(){w--,M()})}d.addEventListener("change",function(){T(""),Array.prototype.slice.call(d.files||[]).forEach(O),d.value=""}),u.addEventListener("submit",function(k){w>0&&(k.preventDefault(),T("Hang on \u2014 photos are still uploading.","err"))},!0)}function vr(a){return document.querySelector('[name="data['+a+']"]')}function zd(){var a=Array.prototype.slice.call(document.querySelectorAll(".advanced-field"));if(a.length){var d=[];if(a.forEach(function(g){var f=g.closest(".form-field");f&&d.indexOf(f)===-1&&d.push(f)}),!!d.length){var c=document.createElement("details");c.className="more-options";var l=document.createElement("summary");l.className="more-options__summary",l.textContent="More options",c.appendChild(l),d[0].parentNode.insertBefore(c,d[0]),d.forEach(function(g){c.appendChild(g)});var u=d.some(function(g){var f=g.querySelector('input[type="text"]');if(f&&f.value.trim())return!0;var p=g.querySelector('input[type="radio"]:checked');return!!(p&&p.value&&p.value!=="0")});u&&(c.open=!0)}}}var Hd={0:"Sunny",1:"Partly cloudy",2:"Partly cloudy",3:"Cloudy",45:"Foggy",48:"Foggy",51:"Drizzle",53:"Drizzle",55:"Drizzle",56:"Drizzle",57:"Drizzle",61:"Rain",63:"Rain",65:"Rain",66:"Rain",67:"Rain",80:"Rain",81:"Rain",82:"Rain",71:"Snow",73:"Snow",75:"Snow",77:"Snow",85:"Snow",86:"Snow",95:"Thunderstorm",96:"Thunderstorm",99:"Thunderstorm"};function $t(a,d,c){a&&(a.className="form-status"+(c?" form-status--"+c:""),a.textContent=d||"")}function Rd(){var a=document.getElementById("get-location"),d=document.getElementById("get-weather");if(!a&&!d)return;var c=document.getElementById("location-status"),l=document.getElementById("weather-status");function u(){var f=vr("lat"),p=vr("lng"),y=f?f.value.trim():"",w=p?p.value.trim():"";return y&&w?{lat:y,lng:w}:null}function g(){if(d){var f=!!u();d.disabled=!f,d.title=f?"":"Get location first"}}g(),a&&a.addEventListener("click",function(){if(!navigator.geolocation){$t(c,"Geolocation is not supported on this device.","err");return}a.classList.add("is-loading"),a.disabled=!0,$t(c,"Getting location\u2026"),navigator.geolocation.getCurrentPosition(function(f){var p=f.coords.latitude.toFixed(6),y=f.coords.longitude.toFixed(6),w=vr("lat"),D=vr("lng");w&&(w.value=p),D&&(D.value=y),a.classList.remove("is-loading"),a.disabled=!1,$t(c,"\u2713 Location captured \xB7 "+p+", "+y,"ok"),g()},function(f){a.classList.remove("is-loading"),a.disabled=!1,$t(c,"\u2717 "+(f&&f.message?f.message:"Could not get location")+" \u2014 enter coordinates manually if needed.","err")},{enableHighAccuracy:!0,timeout:15e3})}),d&&d.addEventListener("click",function(){var f=u();if(!f){$t(l,"Get location first, then fetch weather.","err");return}d.classList.add("is-loading"),d.disabled=!0,$t(l,"Fetching weather\u2026");var p="https://api.open-meteo.com/v1/forecast?latitude="+f.lat+"&longitude="+f.lng+"¤t=temperature_2m,weather_code&temperature_unit=celsius";fetch(p).then(function(y){return y.json()}).then(function(y){var w=Math.round(y.current.temperature_2m),D=Hd[y.current.weather_code]||"Cloudy",T=vr("weather_temp_c"),M=vr("weather_desc");T&&(T.value=w),M&&(M.value=D),d.classList.remove("is-loading"),g(),$t(l,"\u2713 Weather set \xB7 "+D+" \xB7 "+w+"\xB0C (edit above if needed)","ok")}).catch(function(){d.classList.remove("is-loading"),g(),$t(l,"\u2717 Could not fetch weather \u2014 set it manually above.","err")})})}function _d(){var a={title:"Title",content:"Content"},d=document.querySelector('form[name="new-entry"]');if(!d)return;function c(){d.querySelectorAll(".field-error").forEach(function(u){u.remove()}),d.querySelectorAll(".field-invalid").forEach(function(u){u.classList.remove("field-invalid")})}function l(u,g){u.classList.add("field-invalid");var f=document.createElement("span");f.className="field-error",f.textContent=g,u.parentNode.insertBefore(f,u.nextSibling)}d.addEventListener("submit",function(u){c();var g=null;Object.keys(a).forEach(function(f){var p=vr(f);p&&!String(p.value).trim()&&(l(p,a[f]+" is required."),g||(g=p))}),g&&(u.preventDefault(),g.focus(),g.scrollIntoView({behavior:"smooth",block:"center"}))})}var ua="intotheeast:new-entry-draft";function Pd(a){return Array.prototype.slice.call(a.querySelectorAll('[name^="data["]')).filter(function(d){if(d.type==="file")return!1;var c=d.name;return c.indexOf("data[_json")!==0&&c.indexOf("data[photos")!==0})}function Wd(){var a=document.querySelector(".photo-picker");if(!(!a||a.querySelector(".photo-picker__reauth-hint"))){var d=document.createElement("p");d.className="photo-picker__reauth-hint is-shown",d.textContent="Your text was restored \u2014 photos need re-selecting (they can\u2019t be saved in a draft).",a.appendChild(d)}}function qd(){var a=document.querySelector('form[name="new-entry"]');if(!a)return;if(document.querySelector(".notices.success")){try{localStorage.removeItem(ua)}catch{}return}function d(){var g={};Pd(a).forEach(function(f){f.type==="radio"?f.checked&&(g[f.name]=f.value):g[f.name]=f.value});try{localStorage.setItem(ua,JSON.stringify(g))}catch{}}var c=null;try{c=localStorage.getItem(ua)}catch{c=null}if(c){var l=null;try{l=JSON.parse(c)}catch{l=null}if(l){var u=!1;Object.keys(l).forEach(function(g){var f=l[g];if(f!=null&&String(f).trim()&&(u=!0),g!=="data[content]"){var p=a.querySelectorAll('input[type="radio"][name="'+g+'"]');if(p.length){p.forEach(function(w){w.checked=w.value===f});return}var y=a.querySelector('[name="'+g+'"]');y&&y.type!=="file"&&(y.value=f)}}),window.postFormEditor&&l["data[content]"]!=null&&window.postFormEditor.value(l["data[content]"]),u&&Wd()}}a.addEventListener("input",d),a.addEventListener("change",d),window.postFormEditor&&window.postFormEditor.codemirror.on("change",d)}function Su(){window.postFormEditor=Md(),qd(),Od(),zd(),Rd(),_d()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Su):Su(); diff --git a/themes/intotheeast/js/src/post-form.js b/themes/intotheeast/js/src/post-form.js index f2ef61a..bef22cd 100644 --- a/themes/intotheeast/js/src/post-form.js +++ b/themes/intotheeast/js/src/post-form.js @@ -401,11 +401,97 @@ function initValidation() { }); } +/* ── Draft persistence (U6, R19 preserve-on-failure + R20, KTD6) ── + * Text field values are mirrored to localStorage so a failed submit or an + * expired session mid-compose never loses the writing. Photos can't be + * serialized (File/Blob) so they are NOT persisted — an inline hint says so + * on restore. The draft is cleared ONLY when the server confirms a successful + * post (

    ), which is exactly what guarantees the + * text survives every non-success outcome, independent of failure-type sniffing. + */ +var DRAFT_KEY = 'intotheeast:new-entry-draft'; + +function draftEls(form) { + return Array.prototype.slice.call(form.querySelectorAll('[name^="data["]')) + .filter(function (el) { + if (el.type === 'file') return false; + var n = el.name; + return n.indexOf('data[_json') !== 0 && n.indexOf('data[photos') !== 0; + }); +} + +function showReauthHint() { + var picker = document.querySelector('.photo-picker'); + if (!picker || picker.querySelector('.photo-picker__reauth-hint')) return; + var p = document.createElement('p'); + p.className = 'photo-picker__reauth-hint is-shown'; + p.textContent = 'Your text was restored — photos need re-selecting (they can’t be saved in a draft).'; + picker.appendChild(p); +} + +function initDraft() { + var form = document.querySelector('form[name="new-entry"]'); + if (!form) return; // e.g. session expired → login form shown; draft is left intact + + // A confirmed successful post: clear the draft and do NOT restore onto the + // freshly reset form. This runs before any save, so process.reset can't + // round-trip blank fields back into storage. + if (document.querySelector('.notices.success')) { + try { localStorage.removeItem(DRAFT_KEY); } catch (e) { /* ignore */ } + return; + } + + function save() { + var data = {}; + draftEls(form).forEach(function (el) { + if (el.type === 'radio') { if (el.checked) { data[el.name] = el.value; } } + else { data[el.name] = el.value; } + }); + try { localStorage.setItem(DRAFT_KEY, JSON.stringify(data)); } catch (e) { /* quota / private mode */ } + } + + var raw = null; + try { raw = localStorage.getItem(DRAFT_KEY); } catch (e) { raw = null; } + if (raw) { + var data = null; + try { data = JSON.parse(raw); } catch (e) { data = null; } + if (data) { + var restoredSomething = false; + Object.keys(data).forEach(function (name) { + var val = data[name]; + if (val != null && String(val).trim()) { restoredSomething = true; } + if (name === 'data[content]') { return; } // restored via the editor below + var radios = form.querySelectorAll('input[type="radio"][name="' + name + '"]'); + if (radios.length) { + radios.forEach(function (r) { r.checked = (r.value === val); }); + return; + } + var el = form.querySelector('[name="' + name + '"]'); + if (el && el.type !== 'file') { el.value = val; } + }); + if (window.postFormEditor && data['data[content]'] != null) { + window.postFormEditor.value(data['data[content]']); + } + if (restoredSomething) { showReauthHint(); } + } + } + + // Save text on every edit (change covers selects/toggles; input covers text). + form.addEventListener('input', save); + form.addEventListener('change', save); + if (window.postFormEditor) { + window.postFormEditor.codemirror.on('change', save); + } +} + /* ── Boot ────────────────────────────────────────────────── */ function boot() { - // Exposed for later units (U6 draft restore) and the Playwright specs; - // null when this bundle loads on a page without the content field. + // Exposed for U6 draft restore and the Playwright specs; null when this + // bundle loads on a page without the content field. window.postFormEditor = initEditor(); + // Restore before disclosure/geo so their on-load checks (auto-open, + // weather-button enable) see the restored values. + initDraft(); initPhotoPicker(); initDisclosure(); initGeo();