import{O as Df,aF as bf,Q as Cf,_ as kf,n as Ko,o as Ha,c as Xo,a as Vo,d as wf,q as Sf,w as Ff,b as Af}from"./BRQta-1x.js";import{c as Ef}from"./TDtrdbi3.js";var eu={exports:{}};(function(s,b){(function(c,m){s.exports=m()})(Df,function(){var c=navigator.userAgent,m=navigator.platform,g=/gecko\/\d/i.test(c),C=/MSIE \d/.test(c),v=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(c),x=/Edge\/(\d+)/.exec(c),y=C||v||x,A=y&&(C?document.documentMode||6:+(x||v)[1]),P=!x&&/WebKit\//.test(c),z=P&&/Qt\/\d+\.\d+/.test(c),N=!x&&/Chrome\/(\d+)/.exec(c),j=N&&+N[1],K=/Opera\//.test(c),ne=/Apple Computer/.test(navigator.vendor),J=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(c),Z=/PhantomJS/.test(c),H=ne&&(/Mobile\/\w+/.test(c)||navigator.maxTouchPoints>2),R=/Android/.test(c),U=H||R||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(c),G=H||/Mac/.test(m),te=/\bCrOS\b/.test(c),Y=/win/i.test(m),oe=K&&c.match(/Version\/(\d*\.\d*)/);oe&&(oe=Number(oe[1])),oe&&oe>=15&&(K=!1,P=!0);var pe=G&&(z||K&&(oe==null||oe<12.11)),qe=g||y&&A>=9;function re(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Ae=function(e,t){var n=e.className,r=re(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function Ee(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function De(e,t){return Ee(e).appendChild(t)}function T(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function V(e,t,n,r){var i=T(e,t,n,r);return i.setAttribute("role","presentation"),i}var $;document.createRange?$=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:$=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function ge(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function Me(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function et(e,t){var n=e.className;re(t).test(n)||(e.className+=(n?" ":"")+t)}function zt(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!re(n[r]).test(t)&&(t+=" "+n[r]);return t}var S=function(e){e.select()};H?S=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:y&&(S=function(e){try{e.select()}catch{}});function d(e){return e.display.wrapper.ownerDocument}function q(e){return Ne(e.display.wrapper)}function Ne(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function Fe(e){return d(e).defaultView}function Qe(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function ht(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Xe(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=r||0,l=i||0;;){var o=e.indexOf("	",a);if(o<0||o>=t)return l+(t-a);l+=o-a,l+=n-l%n,a=o+1}}var it=function(){this.id=null,this.f=null,this.time=0,this.handler=Qe(this.onTimeout,this)};it.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},it.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function Ie(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var We=50,Je={toString:function(){return"CodeMirror.Pass"}},dt={scroll:!1},ye={origin:"*mouse"},Bt={origin:"+move"};function Mt(e,t,n){for(var r=0,i=0;;){var a=e.indexOf("	",r);a==-1&&(a=e.length);var l=a-r;if(a==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=a-r,i+=n-i%n,r=a+1,i>=t)return r}}var At=[""];function _t(e){for(;At.length<=e;)At.push(Be(At)+" ");return At[e]}function Be(e){return e[e.length-1]}function Et(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Wt(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function Tr(){}function I(e,t){var n;return Object.create?n=Object.create(e):(Tr.prototype=e,n=new Tr),t&&ht(t,n),n}var O=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function B(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||O.test(e))}function h(e,t){return t?t.source.indexOf("\\w")>-1&&B(e)?!0:t.test(e):B(e)}function p(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var F=/[\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 w(e){return e.charCodeAt(0)>=768&&F.test(e)}function E(e,t,n){for(;(n<0?t>0:t<e.length)&&w(e.charAt(t));)t+=n;return t}function ie(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,a=r<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:n;e(a)?n=a:t=a+r}}function de(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,a=0;a<e.length;++a){var l=e[a];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),l.level==1?"rtl":"ltr",a),i=!0)}i||r(t,n,"ltr")}var fe=null;function ve(e,t,n){var r;fe=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&n=="before"?r=i:fe=i),a.from==t&&(a.from!=a.to&&n!="before"?r=i:fe=i)}return r??fe}var ke=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(f){return f<=247?e.charAt(f):1424<=f&&f<=1524?"R":1536<=f&&f<=1785?t.charAt(f-1536):1774<=f&&f<=2220?"r":8192<=f&&f<=8203?"w":f==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,o=/[1n]/;function u(f,D,k){this.level=f,this.from=D,this.to=k}return function(f,D){var k=D=="ltr"?"L":"R";if(f.length==0||D=="ltr"&&!r.test(f))return!1;for(var M=f.length,L=[],_=0;_<M;++_)L.push(n(f.charCodeAt(_)));for(var X=0,ee=k;X<M;++X){var ae=L[X];ae=="m"?L[X]=ee:ee=ae}for(var se=0,le=k;se<M;++se){var he=L[se];he=="1"&&le=="r"?L[se]="n":a.test(he)&&(le=he,he=="r"&&(L[se]="R"))}for(var be=1,xe=L[0];be<M-1;++be){var Te=L[be];Te=="+"&&xe=="1"&&L[be+1]=="1"?L[be]="1":Te==","&&xe==L[be+1]&&(xe=="1"||xe=="n")&&(L[be]=xe),xe=Te}for(var Ue=0;Ue<M;++Ue){var ft=L[Ue];if(ft==",")L[Ue]="N";else if(ft=="%"){var Ze=void 0;for(Ze=Ue+1;Ze<M&&L[Ze]=="%";++Ze);for(var Ft=Ue&&L[Ue-1]=="!"||Ze<M&&L[Ze]=="1"?"1":"N",Ct=Ue;Ct<Ze;++Ct)L[Ct]=Ft;Ue=Ze-1}}for(var rt=0,kt=k;rt<M;++rt){var gt=L[rt];kt=="L"&&gt=="1"?L[rt]="L":a.test(gt)&&(kt=gt)}for(var lt=0;lt<M;++lt)if(i.test(L[lt])){var nt=void 0;for(nt=lt+1;nt<M&&i.test(L[nt]);++nt);for(var $e=(lt?L[lt-1]:k)=="L",wt=(nt<M?L[nt]:k)=="L",$r=$e==wt?$e?"L":"R":k,cr=lt;cr<nt;++cr)L[cr]=$r;lt=nt-1}for(var mt=[],Kt,ct=0;ct<M;)if(l.test(L[ct])){var Ia=ct;for(++ct;ct<M&&l.test(L[ct]);++ct);mt.push(new u(0,Ia,ct))}else{var er=ct,Sr=mt.length,Fr=D=="rtl"?1:0;for(++ct;ct<M&&L[ct]!="L";++ct);for(var yt=er;yt<ct;)if(o.test(L[yt])){er<yt&&(mt.splice(Sr,0,new u(1,er,yt)),Sr+=Fr);var Qr=yt;for(++yt;yt<ct&&o.test(L[yt]);++yt);mt.splice(Sr,0,new u(2,Qr,yt)),Sr+=Fr,er=yt}else++yt;er<ct&&mt.splice(Sr,0,new u(1,er,ct))}return D=="ltr"&&(mt[0].level==1&&(Kt=f.match(/^\s+/))&&(mt[0].from=Kt[0].length,mt.unshift(new u(0,0,Kt[0].length))),Be(mt).level==1&&(Kt=f.match(/\s+$/))&&(Be(mt).to-=Kt[0].length,mt.push(new u(0,M-Kt[0].length,M)))),D=="rtl"?mt.reverse():mt}}();function ue(e,t){var n=e.order;return n==null&&(n=e.order=ke(e.text,t)),n}var Ce=[],W=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Ce).concat(n)}};function Pe(e,t){return e._handlers&&e._handlers[t]||Ce}function Oe(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var a=Ie(i,n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function He(e,t){var n=Pe(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Le(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),He(e,n||t.type,e,t),Yt(t)||t.codemirrorIgnore}function at(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)Ie(n,t[r])==-1&&n.push(t[r])}function pt(e,t){return Pe(e,t).length>0}function Nt(e){e.prototype.on=function(t,n){W(this,t,n)},e.prototype.off=function(t,n){Oe(this,t,n)}}function Ye(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Xt(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Yt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function It(e){Ye(e),Xt(e)}function en(e){return e.target||e.srcElement}function rr(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),G&&e.ctrlKey&&t==1&&(t=3),t}var cu=function(){if(y&&A<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}(),Mi;function hu(e){if(Mi==null){var t=T("span","​");De(e,T("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Mi=t.offsetWidth<=1&&t.offsetHeight>2&&!(y&&A<8))}var n=Mi?T("span","​"):T("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Ni;function du(e){if(Ni!=null)return Ni;var t=De(e,document.createTextNode("AخA")),n=$(t,0,1).getBoundingClientRect(),r=$(t,1,2).getBoundingClientRect();return Ee(e),!n||n.left==n.right?!1:Ni=r.right-n.right<3}var Ii=`

b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
`,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=a.indexOf("\r");l!=-1?(n.push(a.slice(0,l)),t+=l+1):(n.push(a),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},pu=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},gu=function(){var e=T("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Oi=null;function vu(e){if(Oi!=null)return Oi;var t=De(e,T("span","x")),n=t.getBoundingClientRect(),r=$(t,0,1).getBoundingClientRect();return Oi=Math.abs(n.left-r.left)>1}var Hi={},Br={};function mu(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Hi[e]=t}function xu(e,t){Br[e]=t}function Mn(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=I(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Mn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Mn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ri(e,t){t=Mn(t);var n=Hi[t.name];if(!n)return Ri(e,"text/plain");var r=n(e,t);if(Mr.hasOwnProperty(t.name)){var i=Mr[t.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=i[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var Mr={};function yu(e,t){var n=Mr.hasOwnProperty(e)?Mr[e]:Mr[e]={};ht(t,n)}function pr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Pi(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function ja(e,t,n){return e.startState?e.startState(t,n):!0}var tt=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};tt.prototype.eol=function(){return this.pos>=this.string.length},tt.prototype.sol=function(){return this.pos==this.lineStart},tt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},tt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},tt.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},tt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},tt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},tt.prototype.skipToEnd=function(){this.pos=this.string.length},tt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},tt.prototype.backUp=function(e){this.pos-=e},tt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Xe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Xe(this.string,this.lineStart,this.tabSize):0)},tt.prototype.indentation=function(){return Xe(this.string,null,this.tabSize)-(this.lineStart?Xe(this.string,this.lineStart,this.tabSize):0)},tt.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(l){return n?l.toLowerCase():l},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var a=this.string.slice(this.pos).match(e);return a&&a.index>0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},tt.prototype.current=function(){return this.string.slice(this.start,this.pos)},tt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},tt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},tt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function me(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 n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],a=i.chunkSize();if(t<a){n=i;break}t-=a}return n.lines[t]}function gr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(a){var l=a.text;i==n.line&&(l=l.slice(0,n.ch)),i==t.line&&(l=l.slice(t.ch)),r.push(l),++i}),r}function zi(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function Ut(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ze(e){if(e.parent==null)return null;for(var t=e.parent,n=Ie(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function vr(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],a=i.height;if(t<a){e=i;continue e}t-=a,n+=i.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var o=e.lines[l],u=o.height;if(t<u)break;t-=u}return n+l}function tn(e,t){return t>=e.first&&t<e.first+e.size}function _i(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Q(e,t,n){if(n===void 0&&(n=null),!(this instanceof Q))return new Q(e,t,n);this.line=e,this.ch=t,this.sticky=n}function we(e,t){return e.line-t.line||e.ch-t.ch}function Wi(e,t){return e.sticky==t.sticky&&we(e,t)==0}function Ui(e){return Q(e.line,e.ch)}function Nn(e,t){return we(e,t)<0?t:e}function In(e,t){return we(e,t)<0?e:t}function Ka(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Se(e,t){if(t.line<e.first)return Q(e.first,0);var n=e.first+e.size-1;return t.line>n?Q(n,me(e,n).text.length):Du(t,me(e,t.line).text.length)}function Du(e,t){var n=e.ch;return n==null||n>t?Q(e.line,t):n<0?Q(e.line,0):e}function Xa(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Se(e,t[r]);return n}var On=function(e,t){this.state=e,this.lookAhead=t},qt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};qt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},qt.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}},qt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},qt.fromSaved=function(e,t,n){return t instanceof On?new qt(e,pr(e.mode,t.state),n,t.lookAhead):new qt(e,pr(e.mode,t),n)},qt.prototype.save=function(e){var t=e!==!1?pr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new On(t,this.maxLookAhead):t};function Ya(e,t,n,r){var i=[e.state.modeGen],a={};el(e,t.text,e.doc.mode,n,function(f,D){return i.push(f,D)},a,r);for(var l=n.state,o=function(f){n.baseTokens=i;var D=e.state.overlays[f],k=1,M=0;n.state=!0,el(e,t.text,D.mode,n,function(L,_){for(var X=k;M<L;){var ee=i[k];ee>L&&i.splice(k,1,L,i[k+1],ee),k+=2,M=Math.min(L,ee)}if(_)if(D.opaque)i.splice(X,k-X,L,"overlay "+_),k=X+2;else for(;X<k;X+=2){var ae=i[X+1];i[X+1]=(ae?ae+" ":"")+"overlay "+_}},a),n.state=l,n.baseTokens=null,n.baseTokenPos=1},u=0;u<e.state.overlays.length;++u)o(u);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function Za(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=rn(e,ze(t)),i=t.text.length>e.options.maxHighlightLength&&pr(e.doc.mode,r.state),a=Ya(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function rn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new qt(r,!0,t);var a=bu(e,t,n),l=a>r.first&&me(r,a-1).stateAfter,o=l?qt.fromSaved(r,l,a):new qt(r,ja(r.mode),a);return r.iter(a,t,function(u){qi(e,u.text,o);var f=o.line;u.stateAfter=f==t-1||f%5==0||f>=i.viewFrom&&f<i.viewTo?o.save():null,o.nextLine()}),n&&(r.modeFrontier=o.line),o}function qi(e,t,n,r){var i=e.doc.mode,a=new tt(t,e.options.tabSize,n);for(a.start=a.pos=r||0,t==""&&$a(i,n.state);!a.eol();)Gi(i,a,n.state),a.start=a.pos}function $a(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Pi(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function Gi(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Pi(e,n).mode);var a=e.token(t,n);if(t.pos>t.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}var Qa=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Ja(e,t,n,r){var i=e.doc,a=i.mode,l;t=Se(i,t);var o=me(i,t.line),u=rn(e,t.line,n),f=new tt(o.text,e.options.tabSize,u),D;for(r&&(D=[]);(r||f.pos<t.ch)&&!f.eol();)f.start=f.pos,l=Gi(a,f,u.state),r&&D.push(new Qa(f,l,pr(i.mode,u.state)));return r?D:new Qa(f,l,u.state)}function Va(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function el(e,t,n,r,i,a,l){var o=n.flattenSpans;o==null&&(o=e.options.flattenSpans);var u=0,f=null,D=new tt(t,e.options.tabSize,r),k,M=e.options.addModeClass&&[null];for(t==""&&Va($a(n,r.state),a);!D.eol();){if(D.pos>e.options.maxHighlightLength?(o=!1,l&&qi(e,t,r,D.pos),D.pos=t.length,k=null):k=Va(Gi(n,D,r.state,M),a),M){var L=M[0].name;L&&(k="m-"+(k?L+" "+k:L))}if(!o||f!=k){for(;u<D.start;)u=Math.min(D.start,u+5e3),i(u,f);f=k}D.start=D.pos}for(;u<D.pos;){var _=Math.min(D.pos,u+5e3);i(_,f),u=_}}function bu(e,t,n){for(var r,i,a=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),o=t;o>l;--o){if(o<=a.first)return a.first;var u=me(a,o-1),f=u.stateAfter;if(f&&(!n||o+(f instanceof On?f.lookAhead:0)<=a.modeFrontier))return o;var D=Xe(u.text,null,e.options.tabSize);(i==null||r>D)&&(i=o-1,r=D)}return i}function Cu(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=me(e,r).stateAfter;if(i&&(!(i instanceof On)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var tl=!1,Zt=!1;function ku(){tl=!0}function wu(){Zt=!0}function Hn(e,t,n){this.marker=e,this.from=t,this.to=n}function nn(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Su(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Fu(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function Au(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],l=a.marker,o=a.from==null||(l.inclusiveLeft?a.from<=t:a.from<t);if(o||a.from==t&&l.type=="bookmark"&&(!n||!a.marker.insertLeft)){var u=a.to==null||(l.inclusiveRight?a.to>=t:a.to>t);(r||(r=[])).push(new Hn(l,a.from,u?null:a.to))}}return r}function Eu(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],l=a.marker,o=a.to==null||(l.inclusiveRight?a.to>=t:a.to>t);if(o||a.from==t&&l.type=="bookmark"&&(!n||a.marker.insertLeft)){var u=a.from==null||(l.inclusiveLeft?a.from<=t:a.from<t);(r||(r=[])).push(new Hn(l,u?null:a.from-t,a.to==null?null:a.to-t))}}return r}function ji(e,t){if(t.full)return null;var n=tn(e,t.from.line)&&me(e,t.from.line).markedSpans,r=tn(e,t.to.line)&&me(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,a=t.to.ch,l=we(t.from,t.to)==0,o=Au(n,i,l),u=Eu(r,a,l),f=t.text.length==1,D=Be(t.text).length+(f?i:0);if(o)for(var k=0;k<o.length;++k){var M=o[k];if(M.to==null){var L=nn(u,M.marker);L?f&&(M.to=L.to==null?null:L.to+D):M.to=i}}if(u)for(var _=0;_<u.length;++_){var X=u[_];if(X.to!=null&&(X.to+=D),X.from==null){var ee=nn(o,X.marker);ee||(X.from=D,f&&(o||(o=[])).push(X))}else X.from+=D,f&&(o||(o=[])).push(X)}o&&(o=rl(o)),u&&u!=o&&(u=rl(u));var ae=[o];if(!f){var se=t.text.length-2,le;if(se>0&&o)for(var he=0;he<o.length;++he)o[he].to==null&&(le||(le=[])).push(new Hn(o[he].marker,null,null));for(var be=0;be<se;++be)ae.push(le);ae.push(u)}return ae}function rl(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Lu(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(L){if(L.markedSpans)for(var _=0;_<L.markedSpans.length;++_){var X=L.markedSpans[_].marker;X.readOnly&&(!r||Ie(r,X)==-1)&&(r||(r=[])).push(X)}}),!r)return null;for(var i=[{from:t,to:n}],a=0;a<r.length;++a)for(var l=r[a],o=l.find(0),u=0;u<i.length;++u){var f=i[u];if(!(we(f.to,o.from)<0||we(f.from,o.to)>0)){var D=[u,1],k=we(f.from,o.from),M=we(f.to,o.to);(k<0||!l.inclusiveLeft&&!k)&&D.push({from:f.from,to:o.from}),(M>0||!l.inclusiveRight&&!M)&&D.push({from:o.to,to:f.to}),i.splice.apply(i,D),u+=D.length-3}}return i}function nl(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function il(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Rn(e){return e.inclusiveLeft?-1:0}function Pn(e){return e.inclusiveRight?1:0}function Ki(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),a=we(r.from,i.from)||Rn(e)-Rn(t);if(a)return-a;var l=we(r.to,i.to)||Pn(e)-Pn(t);return l||t.id-e.id}function al(e,t){var n=Zt&&e.markedSpans,r;if(n)for(var i=void 0,a=0;a<n.length;++a)i=n[a],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||Ki(r,i.marker)<0)&&(r=i.marker);return r}function ll(e){return al(e,!0)}function zn(e){return al(e,!1)}function Tu(e,t){var n=Zt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var a=n[i];a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!r||Ki(r,a.marker)<0)&&(r=a.marker)}return r}function ol(e,t,n,r,i){var a=me(e,t),l=Zt&&a.markedSpans;if(l)for(var o=0;o<l.length;++o){var u=l[o];if(u.marker.collapsed){var f=u.marker.find(0),D=we(f.from,n)||Rn(u.marker)-Rn(i),k=we(f.to,r)||Pn(u.marker)-Pn(i);if(!(D>=0&&k<=0||D<=0&&k>=0)&&(D<=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?we(f.to,n)>=0:we(f.to,n)>0)||D>=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?we(f.from,r)<=0:we(f.from,r)<0)))return!0}}}function Ot(e){for(var t;t=ll(e);)e=t.find(-1,!0).line;return e}function Bu(e){for(var t;t=zn(e);)e=t.find(1,!0).line;return e}function Mu(e){for(var t,n;t=zn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Xi(e,t){var n=me(e,t),r=Ot(n);return n==r?t:ze(r)}function ul(e,t){if(t>e.lastLine())return t;var n=me(e,t),r;if(!nr(e,n))return t;for(;r=zn(n);)n=r.find(1,!0).line;return ze(n)+1}function nr(e,t){var n=Zt&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&Yi(e,t,r))return!0}}}function Yi(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Yi(e,r.line,nn(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,a=0;a<t.markedSpans.length;++a)if(i=t.markedSpans[a],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Yi(e,t,i))return!0}function $t(e){e=Ot(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var a=n.parent;a;n=a,a=n.parent)for(var l=0;l<a.children.length;++l){var o=a.children[l];if(o==n)break;t+=o.height}return t}function _n(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=ll(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=zn(r);){var a=n.find(0,!0);t-=r.text.length-a.from.ch,r=a.to.line,t+=r.text.length-a.to.ch}return t}function Zi(e){var t=e.display,n=e.doc;t.maxLine=me(n,n.first),t.maxLineLength=_n(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=_n(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Nr=function(e,t,n){this.text=e,il(this,t),this.height=n?n(this):1};Nr.prototype.lineNo=function(){return ze(this)},Nt(Nr);function Nu(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),nl(e),il(e,n);var i=r?r(e):1;i!=e.height&&Ut(e,i)}function Iu(e){e.parent=null,nl(e)}var Ou={},Hu={};function sl(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Hu:Ou;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function fl(e,t){var n=V("span",null,null,P?"padding-right: .1px":null),r={pre:V("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var a=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=Pu,du(e.display.measure)&&(l=ue(a,e.doc.direction))&&(r.addToken=_u(r.addToken,l)),r.map=[];var o=t!=e.display.externalMeasured&&ze(a);Wu(a,r,Za(e,a,o)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=zt(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=zt(a.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(hu(e.display.measure))),i==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(P){var u=r.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return He(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=zt(r.pre.className,r.textClass||"")),r}function Ru(e){var t=T("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Pu(e,t,n,r,i,a,l){if(t){var o=e.splitSpaces?zu(t,e.trailingSpace):t,u=e.cm.state.specialChars,f=!1,D;if(!u.test(t))e.col+=t.length,D=document.createTextNode(o),e.map.push(e.pos,e.pos+t.length,D),y&&A<9&&(f=!0),e.pos+=t.length;else{D=document.createDocumentFragment();for(var k=0;;){u.lastIndex=k;var M=u.exec(t),L=M?M.index-k:t.length-k;if(L){var _=document.createTextNode(o.slice(k,k+L));y&&A<9?D.appendChild(T("span",[_])):D.appendChild(_),e.map.push(e.pos,e.pos+L,_),e.col+=L,e.pos+=L}if(!M)break;k+=L+1;var X=void 0;if(M[0]=="	"){var ee=e.cm.options.tabSize,ae=ee-e.col%ee;X=D.appendChild(T("span",_t(ae),"cm-tab")),X.setAttribute("role","presentation"),X.setAttribute("cm-text","	"),e.col+=ae}else M[0]=="\r"||M[0]==`
`?(X=D.appendChild(T("span",M[0]=="\r"?"␍":"␤","cm-invalidchar")),X.setAttribute("cm-text",M[0]),e.col+=1):(X=e.cm.options.specialCharPlaceholder(M[0]),X.setAttribute("cm-text",M[0]),y&&A<9?D.appendChild(T("span",[X])):D.appendChild(X),e.col+=1);e.map.push(e.pos,e.pos+1,X),e.pos++}}if(e.trailingSpace=o.charCodeAt(t.length-1)==32,n||r||i||f||a||l){var se=n||"";r&&(se+=r),i&&(se+=i);var le=T("span",[D],se,a);if(l)for(var he in l)l.hasOwnProperty(he)&&he!="style"&&he!="class"&&le.setAttribute(he,l[he]);return e.content.appendChild(le)}e.content.appendChild(D)}}function zu(e,t){if(e.length>1&&!/  /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var a=e.charAt(i);a==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(a=" "),r+=a,n=a==" "}return r}function _u(e,t){return function(n,r,i,a,l,o,u){i=i?i+" cm-force-border":"cm-force-border";for(var f=n.pos,D=f+r.length;;){for(var k=void 0,M=0;M<t.length&&(k=t[M],!(k.to>f&&k.from<=f));M++);if(k.to>=D)return e(n,r,i,a,l,o,u);e(n,r.slice(0,k.to-f),i,a,null,o,u),a=null,r=r.slice(k.to-f),f=k.to}}}function cl(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Wu(e,t,n){var r=e.markedSpans,i=e.text,a=0;if(!r){for(var l=1;l<n.length;l+=2)t.addToken(t,i.slice(a,a=n[l]),sl(n[l+1],t.cm.options));return}for(var o=i.length,u=0,f=1,D="",k,M,L=0,_,X,ee,ae,se;;){if(L==u){_=X=ee=M="",se=null,ae=null,L=1/0;for(var le=[],he=void 0,be=0;be<r.length;++be){var xe=r[be],Te=xe.marker;if(Te.type=="bookmark"&&xe.from==u&&Te.widgetNode)le.push(Te);else if(xe.from<=u&&(xe.to==null||xe.to>u||Te.collapsed&&xe.to==u&&xe.from==u)){if(xe.to!=null&&xe.to!=u&&L>xe.to&&(L=xe.to,X=""),Te.className&&(_+=" "+Te.className),Te.css&&(M=(M?M+";":"")+Te.css),Te.startStyle&&xe.from==u&&(ee+=" "+Te.startStyle),Te.endStyle&&xe.to==L&&(he||(he=[])).push(Te.endStyle,xe.to),Te.title&&((se||(se={})).title=Te.title),Te.attributes)for(var Ue in Te.attributes)(se||(se={}))[Ue]=Te.attributes[Ue];Te.collapsed&&(!ae||Ki(ae.marker,Te)<0)&&(ae=xe)}else xe.from>u&&L>xe.from&&(L=xe.from)}if(he)for(var ft=0;ft<he.length;ft+=2)he[ft+1]==L&&(X+=" "+he[ft]);if(!ae||ae.from==u)for(var Ze=0;Ze<le.length;++Ze)cl(t,0,le[Ze]);if(ae&&(ae.from||0)==u){if(cl(t,(ae.to==null?o+1:ae.to)-u,ae.marker,ae.from==null),ae.to==null)return;ae.to==u&&(ae=!1)}}if(u>=o)break;for(var Ft=Math.min(o,L);;){if(D){var Ct=u+D.length;if(!ae){var rt=Ct>Ft?D.slice(0,Ft-u):D;t.addToken(t,rt,k?k+_:_,ee,u+rt.length==L?X:"",M,se)}if(Ct>=Ft){D=D.slice(Ft-u),u=Ft;break}u=Ct,ee=""}D=i.slice(a,a=n[f++]),k=sl(n[f++],t.cm.options)}}}function hl(e,t,n){this.line=t,this.rest=Mu(t),this.size=this.rest?ze(Be(this.rest))-n+1:1,this.node=this.text=null,this.hidden=nr(e,t)}function Wn(e,t,n){for(var r=[],i,a=t;a<n;a=i){var l=new hl(e.doc,me(e.doc,a),a);i=a+l.size,r.push(l)}return r}var Ir=null;function Uu(e){Ir?Ir.ops.push(e):e.ownsGroup=Ir={ops:[e],delayedCallbacks:[]}}function qu(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Gu(e,t){var n=e.ownsGroup;if(n)try{qu(n)}finally{Ir=null,t(n)}}var an=null;function ot(e,t){var n=Pe(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Ir?i=Ir.delayedCallbacks:an?i=an:(i=an=[],setTimeout(ju,0));for(var a=function(o){i.push(function(){return n[o].apply(null,r)})},l=0;l<n.length;++l)a(l)}}function ju(){var e=an;an=null;for(var t=0;t<e.length;++t)e[t]()}function dl(e,t,n,r){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a=="text"?Xu(e,t):a=="gutter"?gl(e,t,n,r):a=="class"?$i(e,t):a=="widget"&&Yu(e,t,r)}t.changes=null}function ln(e){return e.node==e.text&&(e.node=T("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),y&&A<8&&(e.node.style.zIndex=2)),e.node}function Ku(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=ln(t);t.background=r.insertBefore(T("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function pl(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):fl(e,t)}function Xu(e,t){var n=t.text.className,r=pl(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,$i(e,t)):n&&(t.text.className=n)}function $i(e,t){Ku(e,t),t.line.wrapClass?ln(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function gl(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=ln(t);t.gutterBackground=T("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var l=ln(t),o=t.gutter=T("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(o.setAttribute("aria-hidden","true"),e.display.input.setUneditable(o),l.insertBefore(o,t.text),t.line.gutterClass&&(o.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!a||!a["CodeMirror-linenumbers"])&&(t.lineNumber=o.appendChild(T("div",_i(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var u=0;u<e.display.gutterSpecs.length;++u){var f=e.display.gutterSpecs[u].className,D=a.hasOwnProperty(f)&&a[f];D&&o.appendChild(T("div",[D],"CodeMirror-gutter-elt","left: "+r.gutterLeft[f]+"px; width: "+r.gutterWidth[f]+"px"))}}}function Yu(e,t,n){t.alignable&&(t.alignable=null);for(var r=re("CodeMirror-linewidget"),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);vl(e,t,n)}function Zu(e,t,n,r){var i=pl(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),$i(e,t),gl(e,t,n,r),vl(e,t,r),t.node}function vl(e,t,n){if(ml(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)ml(e,t.rest[r],t,n,!1)}function ml(e,t,n,r,i){if(t.widgets)for(var a=ln(n),l=0,o=t.widgets;l<o.length;++l){var u=o[l],f=T("div",[u.node],"CodeMirror-linewidget"+(u.className?" "+u.className:""));u.handleMouseEvents||f.setAttribute("cm-ignore-events","true"),$u(u,f,n,r),e.display.input.setUneditable(f),i&&u.above?a.insertBefore(f,n.gutter||n.text):a.appendChild(f),ot(u,"redraw")}}function $u(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function on(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!ge(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),De(t.display.measure,T("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Qt(e,t){for(var n=en(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Un(e){return e.lineSpace.offsetTop}function Qi(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function xl(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=De(e.measure,T("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Gt(e){return We-e.display.nativeBarWidth}function mr(e){return e.display.scroller.clientWidth-Gt(e)-e.display.barWidth}function Ji(e){return e.display.scroller.clientHeight-Gt(e)-e.display.barHeight}function Qu(e,t,n){var r=e.options.lineWrapping,i=r&&mr(e);if(!t.measure.heights||r&&t.measure.width!=i){var a=t.measure.heights=[];if(r){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),o=0;o<l.length-1;o++){var u=l[o],f=l[o+1];Math.abs(u.bottom-f.bottom)>2&&a.push((u.bottom+f.top)/2-n.top)}}a.push(n.bottom-n.top)}}function yl(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(ze(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Ju(e,t){t=Ot(t);var n=ze(t),r=e.display.externalMeasured=new hl(e.doc,t,n);r.lineN=n;var i=r.built=fl(e,r);return r.text=i.pre,De(e.display.lineMeasure,i.pre),r}function Dl(e,t,n,r){return jt(e,Or(e,t),n,r)}function Vi(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Dr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Or(e,t){var n=ze(t),r=Vi(e,n);r&&!r.text?r=null:r&&r.changes&&(dl(e,r,n,ia(e)),e.curOp.forceUpdate=!0),r||(r=Ju(e,t));var i=yl(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function jt(e,t,n,r,i){t.before&&(n=-1);var a=n+(r||""),l;return t.cache.hasOwnProperty(a)?l=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Qu(e,t.view,t.rect),t.hasHeights=!0),l=es(e,t,n,r),l.bogus||(t.cache[a]=l)),{left:l.left,right:l.right,top:i?l.rtop:l.top,bottom:i?l.rbottom:l.bottom}}var bl={left:0,right:0,top:0,bottom:0};function Cl(e,t,n){for(var r,i,a,l,o,u,f=0;f<e.length;f+=3)if(o=e[f],u=e[f+1],t<o?(i=0,a=1,l="left"):t<u?(i=t-o,a=i+1):(f==e.length-3||t==u&&e[f+3]>t)&&(a=u-o,i=a-1,t>=u&&(l="right")),i!=null){if(r=e[f+2],o==u&&n==(r.insertLeft?"left":"right")&&(l=n),n=="left"&&i==0)for(;f&&e[f-2]==e[f-3]&&e[f-1].insertLeft;)r=e[(f-=3)+2],l="left";if(n=="right"&&i==u-o)for(;f<e.length-3&&e[f+3]==e[f+4]&&!e[f+5].insertLeft;)r=e[(f+=3)+2],l="right";break}return{node:r,start:i,end:a,collapse:l,coverStart:o,coverEnd:u}}function Vu(e,t){var n=bl;if(t=="left")for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function es(e,t,n,r){var i=Cl(t.map,n,r),a=i.node,l=i.start,o=i.end,u=i.collapse,f;if(a.nodeType==3){for(var D=0;D<4;D++){for(;l&&w(t.line.text.charAt(i.coverStart+l));)--l;for(;i.coverStart+o<i.coverEnd&&w(t.line.text.charAt(i.coverStart+o));)++o;if(y&&A<9&&l==0&&o==i.coverEnd-i.coverStart?f=a.parentNode.getBoundingClientRect():f=Vu($(a,l,o).getClientRects(),r),f.left||f.right||l==0)break;o=l,l=l-1,u="right"}y&&A<11&&(f=ts(e.display.measure,f))}else{l>0&&(u=r="right");var k;e.options.lineWrapping&&(k=a.getClientRects()).length>1?f=k[r=="right"?k.length-1:0]:f=a.getBoundingClientRect()}if(y&&A<9&&!l&&(!f||!f.left&&!f.right)){var M=a.parentNode.getClientRects()[0];M?f={left:M.left,right:M.left+Rr(e.display),top:M.top,bottom:M.bottom}:f=bl}for(var L=f.top-t.rect.top,_=f.bottom-t.rect.top,X=(L+_)/2,ee=t.view.measure.heights,ae=0;ae<ee.length-1&&!(X<ee[ae]);ae++);var se=ae?ee[ae-1]:0,le=ee[ae],he={left:(u=="right"?f.right:f.left)-t.rect.left,right:(u=="left"?f.left:f.right)-t.rect.left,top:se,bottom:le};return!f.left&&!f.right&&(he.bogus=!0),e.options.singleCursorHeightPerLine||(he.rtop=L,he.rbottom=_),he}function ts(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!vu(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function kl(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function wl(e){e.display.externalMeasure=null,Ee(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)kl(e.display.view[t])}function un(e){wl(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Sl(e){return N&&R?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Fl(e){return N&&R?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function ea(e){var t=Ot(e),n=t.widgets,r=0;if(n)for(var i=0;i<n.length;++i)n[i].above&&(r+=on(n[i]));return r}function qn(e,t,n,r,i){if(!i){var a=ea(t);n.top+=a,n.bottom+=a}if(r=="line")return n;r||(r="local");var l=$t(t);if(r=="local"?l+=Un(e.display):l-=e.display.viewOffset,r=="page"||r=="window"){var o=e.display.lineSpace.getBoundingClientRect();l+=o.top+(r=="window"?0:Fl(d(e)));var u=o.left+(r=="window"?0:Sl(d(e)));n.left+=u,n.right+=u}return n.top+=l,n.bottom+=l,n}function Al(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=Sl(d(e)),i-=Fl(d(e));else if(n=="local"||!n){var a=e.display.sizer.getBoundingClientRect();r+=a.left,i+=a.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:r-l.left,top:i-l.top}}function Gn(e,t,n,r,i){return r||(r=me(e.doc,t.line)),qn(e,r,Dl(e,r,t.ch,i),n)}function Ht(e,t,n,r,i,a){r=r||me(e.doc,t.line),i||(i=Or(e,r));function l(_,X){var ee=jt(e,i,_,X?"right":"left",a);return X?ee.left=ee.right:ee.right=ee.left,qn(e,r,ee,n)}var o=ue(r,e.doc.direction),u=t.ch,f=t.sticky;if(u>=r.text.length?(u=r.text.length,f="before"):u<=0&&(u=0,f="after"),!o)return l(f=="before"?u-1:u,f=="before");function D(_,X,ee){var ae=o[X],se=ae.level==1;return l(ee?_-1:_,se!=ee)}var k=ve(o,u,f),M=fe,L=D(u,k,f=="before");return M!=null&&(L.other=D(u,M,f!="before")),L}function El(e,t){var n=0;t=Se(e.doc,t),e.options.lineWrapping||(n=Rr(e.display)*t.ch);var r=me(e.doc,t.line),i=$t(r)+Un(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function ta(e,t,n,r,i){var a=Q(e,t,n);return a.xRel=i,r&&(a.outside=r),a}function ra(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return ta(r.first,0,null,-1,-1);var i=vr(r,n),a=r.first+r.size-1;if(i>a)return ta(r.first+r.size-1,me(r,a).text.length,null,1,1);t<0&&(t=0);for(var l=me(r,i);;){var o=rs(e,l,i,t,n),u=Tu(l,o.ch+(o.xRel>0||o.outside>0?1:0));if(!u)return o;var f=u.find(1);if(f.line==i)return f;l=me(r,i=f.line)}}function Ll(e,t,n,r){r-=ea(t);var i=t.text.length,a=ie(function(l){return jt(e,n,l-1).bottom<=r},i,0);return i=ie(function(l){return jt(e,n,l).top>r},a,i),{begin:a,end:i}}function Tl(e,t,n,r){n||(n=Or(e,t));var i=qn(e,t,jt(e,n,r),"line").top;return Ll(e,t,n,i)}function na(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function rs(e,t,n,r,i){i-=$t(t);var a=Or(e,t),l=ea(t),o=0,u=t.text.length,f=!0,D=ue(t,e.doc.direction);if(D){var k=(e.options.lineWrapping?is:ns)(e,t,n,a,D,r,i);f=k.level!=1,o=f?k.from:k.to-1,u=f?k.to:k.from-1}var M=null,L=null,_=ie(function(be){var xe=jt(e,a,be);return xe.top+=l,xe.bottom+=l,na(xe,r,i,!1)?(xe.top<=i&&xe.left<=r&&(M=be,L=xe),!0):!1},o,u),X,ee,ae=!1;if(L){var se=r-L.left<L.right-r,le=se==f;_=M+(le?0:1),ee=le?"after":"before",X=se?L.left:L.right}else{!f&&(_==u||_==o)&&_++,ee=_==0?"after":_==t.text.length?"before":jt(e,a,_-(f?1:0)).bottom+l<=i==f?"after":"before";var he=Ht(e,Q(n,_,ee),"line",t,a);X=he.left,ae=i<he.top?-1:i>=he.bottom?1:0}return _=E(t.text,_,1),ta(n,_,ee,ae,r-X)}function ns(e,t,n,r,i,a,l){var o=ie(function(k){var M=i[k],L=M.level!=1;return na(Ht(e,Q(n,L?M.to:M.from,L?"before":"after"),"line",t,r),a,l,!0)},0,i.length-1),u=i[o];if(o>0){var f=u.level!=1,D=Ht(e,Q(n,f?u.from:u.to,f?"after":"before"),"line",t,r);na(D,a,l,!0)&&D.top>l&&(u=i[o-1])}return u}function is(e,t,n,r,i,a,l){var o=Ll(e,t,r,l),u=o.begin,f=o.end;/\s/.test(t.text.charAt(f-1))&&f--;for(var D=null,k=null,M=0;M<i.length;M++){var L=i[M];if(!(L.from>=f||L.to<=u)){var _=L.level!=1,X=jt(e,r,_?Math.min(f,L.to)-1:Math.max(u,L.from)).right,ee=X<a?a-X+1e9:X-a;(!D||k>ee)&&(D=L,k=ee)}}return D||(D=i[i.length-1]),D.from<u&&(D={from:u,to:D.to,level:D.level}),D.to>f&&(D={from:D.from,to:f,level:D.level}),D}var xr;function Hr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(xr==null){xr=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)xr.appendChild(document.createTextNode("x")),xr.appendChild(T("br"));xr.appendChild(document.createTextNode("x"))}De(e.measure,xr);var n=xr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Ee(e.measure),n||1}function Rr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),n=T("pre",[t],"CodeMirror-line-like");De(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function ia(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,a=t.gutters.firstChild,l=0;a;a=a.nextSibling,++l){var o=e.display.gutterSpecs[l].className;n[o]=a.offsetLeft+a.clientLeft+i,r[o]=a.clientWidth}return{fixedPos:aa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function aa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Bl(e){var t=Hr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Rr(e.display)-3);return function(i){if(nr(e.doc,i))return 0;var a=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(a+=i.widgets[l].height);return n?a+(Math.ceil(i.text.length/r)||1)*t:a+t}}function la(e){var t=e.doc,n=Bl(e);t.iter(function(r){var i=n(r);i!=r.height&&Ut(r,i)})}function yr(e,t,n,r){var i=e.display;if(!n&&en(t).getAttribute("cm-not-content")=="true")return null;var a,l,o=i.lineSpace.getBoundingClientRect();try{a=t.clientX-o.left,l=t.clientY-o.top}catch{return null}var u=ra(e,a,l),f;if(r&&u.xRel>0&&(f=me(e.doc,u.line).text).length==u.ch){var D=Xe(f,f.length,e.options.tabSize)-f.length;u=Q(u.line,Math.max(0,Math.round((a-xl(e.display).left)/Rr(e.display))-D))}return u}function Dr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function Dt(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Zt&&Xi(e.doc,t)<i.viewTo&&ar(e);else if(n<=i.viewFrom)Zt&&ul(e.doc,n+r)>i.viewFrom?ar(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)ar(e);else if(t<=i.viewFrom){var a=jn(e,n,n+r,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=r):ar(e)}else if(n>=i.viewTo){var l=jn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):ar(e)}else{var o=jn(e,t,t,-1),u=jn(e,n,n+r,1);o&&u?(i.view=i.view.slice(0,o.index).concat(Wn(e,o.lineN,u.lineN)).concat(i.view.slice(u.index)),i.viewTo+=r):ar(e)}var f=i.externalMeasured;f&&(n<f.lineN?f.lineN+=r:t<f.lineN+f.size&&(i.externalMeasured=null))}function ir(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var a=r.view[Dr(e,t)];if(a.node!=null){var l=a.changes||(a.changes=[]);Ie(l,n)==-1&&l.push(n)}}}function ar(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function jn(e,t,n,r){var i=Dr(e,t),a,l=e.display.view;if(!Zt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var o=e.display.viewFrom,u=0;u<i;u++)o+=l[u].size;if(o!=t){if(r>0){if(i==l.length-1)return null;a=o+l[i].size-t,i++}else a=o-t;t+=a,n+=a}for(;Xi(e.doc,n)!=n;){if(i==(r<0?0:l.length-1))return null;n+=r*l[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function as(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Wn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Wn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Dr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Wn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Dr(e,n)))),r.viewTo=n}function Ml(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function sn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Nl(e,t){t===void 0&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),a=r.selection=document.createDocumentFragment(),l=e.options.$customCursor;l&&(t=!0);for(var o=0;o<n.sel.ranges.length;o++)if(!(!t&&o==n.sel.primIndex)){var u=n.sel.ranges[o];if(!(u.from().line>=e.display.viewTo||u.to().line<e.display.viewFrom)){var f=u.empty();if(l){var D=l(e,u);D&&oa(e,D,i)}else(f||e.options.showCursorWhenSelecting)&&oa(e,u.head,i);f||ls(e,u,a)}}return r}function oa(e,t,n){var r=Ht(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(T("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var a=Gn(e,t,"div",null,null),l=a.right-a.left;i.style.width=(l>0?l:e.defaultCharWidth())+"px"}if(r.other){var o=n.appendChild(T("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Kn(e,t){return e.top-t.top||e.left-t.left}function ls(e,t,n){var r=e.display,i=e.doc,a=document.createDocumentFragment(),l=xl(e.display),o=l.left,u=Math.max(r.sizerWidth,mr(e)-r.sizer.offsetLeft)-l.right,f=i.direction=="ltr";function D(le,he,be,xe){he<0&&(he=0),he=Math.round(he),xe=Math.round(xe),a.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+le+`px;
                             top: `+he+"px; width: "+(be??u-le)+`px;
                             height: `+(xe-he)+"px"))}function k(le,he,be){var xe=me(i,le),Te=xe.text.length,Ue,ft;function Ze(rt,kt){return Gn(e,Q(le,rt),"div",xe,kt)}function Ft(rt,kt,gt){var lt=Tl(e,xe,null,rt),nt=kt=="ltr"==(gt=="after")?"left":"right",$e=gt=="after"?lt.begin:lt.end-(/\s/.test(xe.text.charAt(lt.end-1))?2:1);return Ze($e,nt)[nt]}var Ct=ue(xe,i.direction);return de(Ct,he||0,be??Te,function(rt,kt,gt,lt){var nt=gt=="ltr",$e=Ze(rt,nt?"left":"right"),wt=Ze(kt-1,nt?"right":"left"),$r=he==null&&rt==0,cr=be==null&&kt==Te,mt=lt==0,Kt=!Ct||lt==Ct.length-1;if(wt.top-$e.top<=3){var ct=(f?$r:cr)&&mt,Ia=(f?cr:$r)&&Kt,er=ct?o:(nt?$e:wt).left,Sr=Ia?u:(nt?wt:$e).right;D(er,$e.top,Sr-er,$e.bottom)}else{var Fr,yt,Qr,Oa;nt?(Fr=f&&$r&&mt?o:$e.left,yt=f?u:Ft(rt,gt,"before"),Qr=f?o:Ft(kt,gt,"after"),Oa=f&&cr&&Kt?u:wt.right):(Fr=f?Ft(rt,gt,"before"):o,yt=!f&&$r&&mt?u:$e.right,Qr=!f&&cr&&Kt?o:wt.left,Oa=f?Ft(kt,gt,"after"):u),D(Fr,$e.top,yt-Fr,$e.bottom),$e.bottom<wt.top&&D(o,$e.bottom,null,wt.top),D(Qr,wt.top,Oa-Qr,wt.bottom)}(!Ue||Kn($e,Ue)<0)&&(Ue=$e),Kn(wt,Ue)<0&&(Ue=wt),(!ft||Kn($e,ft)<0)&&(ft=$e),Kn(wt,ft)<0&&(ft=wt)}),{start:Ue,end:ft}}var M=t.from(),L=t.to();if(M.line==L.line)k(M.line,M.ch,L.ch);else{var _=me(i,M.line),X=me(i,L.line),ee=Ot(_)==Ot(X),ae=k(M.line,M.ch,ee?_.text.length+1:null).end,se=k(L.line,ee?0:null,L.ch).start;ee&&(ae.top<se.top-2?(D(ae.right,ae.top,null,ae.bottom),D(o,se.top,se.left,se.bottom)):D(ae.right,ae.top,se.left-ae.right,ae.bottom)),ae.bottom<se.top&&D(o,ae.bottom,null,se.top)}n.appendChild(a)}function ua(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Pr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Il(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||fa(e))}function sa(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Pr(e))},100)}function fa(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(He(e,"focus",e,t),e.state.focused=!0,et(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),P&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ua(e))}function Pr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(He(e,"blur",e,t),e.state.focused=!1,Ae(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Xn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,a=0,l=0;l<t.view.length;l++){var o=t.view[l],u=e.options.lineWrapping,f=void 0,D=0;if(!o.hidden){if(i+=o.line.height,y&&A<8){var k=o.node.offsetTop+o.node.offsetHeight;f=k-n,n=k}else{var M=o.node.getBoundingClientRect();f=M.bottom-M.top,!u&&o.text.firstChild&&(D=o.text.firstChild.getBoundingClientRect().right-M.left-1)}var L=o.line.height-f;if((L>.005||L<-.005)&&(i<r&&(a-=L),Ut(o.line,f),Ol(o.line),o.rest))for(var _=0;_<o.rest.length;_++)Ol(o.rest[_]);if(D>e.display.sizerWidth){var X=Math.ceil(D/Rr(e.display));X>e.display.maxLineLength&&(e.display.maxLineLength=X,e.display.maxLine=o.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function Ol(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Yn(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Un(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,a=vr(t,r),l=vr(t,i);if(n&&n.ensure){var o=n.ensure.from.line,u=n.ensure.to.line;o<a?(a=o,l=vr(t,$t(me(t,o))+e.wrapper.clientHeight)):Math.min(u,t.lastLine())>=l&&(a=vr(t,$t(me(t,u))-e.wrapper.clientHeight),l=u)}return{from:a,to:Math.max(l,a+1)}}function os(e,t){if(!Le(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,a=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)&&(i=!1),i!=null&&!Z){var l=T("div","​",null,`position: absolute;
                         top: `+(t.top-n.viewOffset-Un(e.display))+`px;
                         height: `+(t.bottom-t.top+Gt(e)+n.barHeight)+`px;
                         left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function us(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=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 a=0;a<5;a++){var l=!1,o=Ht(e,t),u=!n||n==t?o:Ht(e,n);i={left:Math.min(o.left,u.left),top:Math.min(o.top,u.top)-r,right:Math.max(o.left,u.left),bottom:Math.max(o.bottom,u.bottom)+r};var f=ca(e,i),D=e.doc.scrollTop,k=e.doc.scrollLeft;if(f.scrollTop!=null&&(cn(e,f.scrollTop),Math.abs(e.doc.scrollTop-D)>1&&(l=!0)),f.scrollLeft!=null&&(br(e,f.scrollLeft),Math.abs(e.doc.scrollLeft-k)>1&&(l=!0)),!l)break}return i}function ss(e,t){var n=ca(e,t);n.scrollTop!=null&&cn(e,n.scrollTop),n.scrollLeft!=null&&br(e,n.scrollLeft)}function ca(e,t){var n=e.display,r=Hr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=Ji(e),l={};t.bottom-t.top>a&&(t.bottom=t.top+a);var o=e.doc.height+Qi(n),u=t.top<r,f=t.bottom>o-r;if(t.top<i)l.scrollTop=u?0:t.top;else if(t.bottom>i+a){var D=Math.min(t.top,(f?o:t.bottom)-a);D!=i&&(l.scrollTop=D)}var k=e.options.fixedGutter?0:n.gutters.offsetWidth,M=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-k,L=mr(e)-n.gutters.offsetWidth,_=t.right-t.left>L;return _&&(t.right=t.left+L),t.left<10?l.scrollLeft=0:t.left<M?l.scrollLeft=Math.max(0,t.left+k-(_?0:10)):t.right>L+M-3&&(l.scrollLeft=t.right+(_?0:10)-L),l}function ha(e,t){t!=null&&(Zn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function zr(e){Zn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function fn(e,t,n){(t!=null||n!=null)&&Zn(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function fs(e,t){Zn(e),e.curOp.scrollToPos=t}function Zn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=El(e,t.from),r=El(e,t.to);Hl(e,n,r,t.margin)}}function Hl(e,t,n,r){var i=ca(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});fn(e,i.scrollLeft,i.scrollTop)}function cn(e,t){Math.abs(e.doc.scrollTop-t)<2||(g||pa(e,{top:t}),Rl(e,t,!0),g&&pa(e),pn(e,100))}function Rl(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function br(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,Ul(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function hn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Qi(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?n:0,docHeight:r,scrollHeight:r+Gt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Cr=function(e,t,n){this.cm=n;var r=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),W(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),W(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,y&&A<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Cr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"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=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"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:n?r:0,bottom:t?r:0}},Cr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Cr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Cr.prototype.zeroWidthHack=function(){var e=G&&!J?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new it,this.disableVert=new it},Cr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),a=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);a!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},Cr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var dn=function(){};dn.prototype.update=function(){return{bottom:0,right:0}},dn.prototype.setScrollLeft=function(){},dn.prototype.setScrollTop=function(){},dn.prototype.clear=function(){};function _r(e,t){t||(t=hn(e));var n=e.display.barWidth,r=e.display.barHeight;Pl(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Xn(e),Pl(e,hn(e)),n=e.display.barWidth,r=e.display.barHeight}function Pl(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var zl={native:Cr,null:dn};function _l(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Ae(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new zl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),W(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?br(e,t):cn(e,t)},e),e.display.scrollbars.addClass&&et(e.display.wrapper,e.display.scrollbars.addClass)}var cs=0;function kr(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:++cs,markArrays:null},Uu(e.curOp)}function wr(e){var t=e.curOp;t&&Gu(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;hs(n)})}function hs(e){for(var t=e.ops,n=0;n<t.length;n++)ds(t[n]);for(var r=0;r<t.length;r++)ps(t[r]);for(var i=0;i<t.length;i++)gs(t[i]);for(var a=0;a<t.length;a++)vs(t[a]);for(var l=0;l<t.length;l++)ms(t[l])}function ds(e){var t=e.cm,n=t.display;ys(t),e.updateMaxLine&&Zi(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new $n(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ps(e){e.updatedDisplay=e.mustUpdate&&da(e.cm,e.update)}function gs(e){var t=e.cm,n=t.display;e.updatedDisplay&&Xn(t),e.barMeasure=hn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Dl(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Gt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-mr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function vs(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&br(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==Me(q(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&_r(t,e.barMeasure),e.updatedDisplay&&va(t,e.barMeasure),e.selectionChanged&&ua(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Il(e.cm)}function ms(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&Wl(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&Rl(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&br(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=us(t,Se(r,e.scrollToPos.from),Se(r,e.scrollToPos.to),e.scrollToPos.margin);os(t,i)}var a=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(a)for(var o=0;o<a.length;++o)a[o].lines.length||He(a[o],"hide");if(l)for(var u=0;u<l.length;++u)l[u].lines.length&&He(l[u],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&He(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function St(e,t){if(e.curOp)return t();kr(e);try{return t()}finally{wr(e)}}function ut(e,t){return function(){if(e.curOp)return t.apply(e,arguments);kr(e);try{return t.apply(e,arguments)}finally{wr(e)}}}function xt(e){return function(){if(this.curOp)return e.apply(this,arguments);kr(this);try{return e.apply(this,arguments)}finally{wr(this)}}}function st(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);kr(t);try{return e.apply(this,arguments)}finally{wr(t)}}}function pn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,Qe(xs,e))}function xs(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=rn(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(r.line>=e.display.viewFrom){var l=a.styles,o=a.text.length>e.options.maxHighlightLength?pr(t.mode,r.state):null,u=Ya(e,a,r,!0);o&&(r.state=o),a.styles=u.styles;var f=a.styleClasses,D=u.classes;D?a.styleClasses=D:f&&(a.styleClasses=null);for(var k=!l||l.length!=a.styles.length||f!=D&&(!f||!D||f.bgClass!=D.bgClass||f.textClass!=D.textClass),M=0;!k&&M<l.length;++M)k=l[M]!=a.styles[M];k&&i.push(r.line),a.stateAfter=r.save(),r.nextLine()}else a.text.length<=e.options.maxHighlightLength&&qi(e,a.text,r),a.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return pn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&St(e,function(){for(var a=0;a<i.length;a++)ir(e,i[a],"text")})}}var $n=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Yn(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=mr(e),this.force=n,this.dims=ia(e),this.events=[]};$n.prototype.signal=function(e,t){pt(e,t)&&this.events.push(arguments)},$n.prototype.finish=function(){for(var e=0;e<this.events.length;e++)He.apply(null,this.events[e])};function ys(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Gt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Gt(e)+"px",t.scrollbarsClipped=!0)}function Ds(e){if(e.hasFocus())return null;var t=Me(q(e));if(!t||!ge(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=Fe(e).getSelection();r.anchorNode&&r.extend&&ge(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function bs(e){if(!(!e||!e.activeElt||e.activeElt==Me(Ne(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&ge(document.body,e.anchorNode)&&ge(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function da(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return ar(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Ml(e)==0)return!1;ql(e)&&(ar(e),t.dims=ia(e));var i=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(r.first,n.viewFrom)),n.viewTo>l&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),Zt&&(a=Xi(e.doc,a),l=ul(e.doc,l));var o=a!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;as(e,a,l),n.viewOffset=$t(me(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=Ml(e);if(!o&&u==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var f=Ds(e);return u>4&&(n.lineDiv.style.display="none"),Cs(e,n.updateLineNumbers,t.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,bs(f),Ee(n.cursorDiv),Ee(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,o&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,pn(e,400)),n.updateLineNumbers=null,!0}function Wl(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==mr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Qi(e.display)-Ji(e),n.top)}),t.visible=Yn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Yn(e.display,e.doc,n));if(!da(e,t))break;Xn(e);var i=hn(e);sn(e),_r(e,i),va(e,i),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 pa(e,t){var n=new $n(e,t);if(da(e,n)){Xn(e),Wl(e,n);var r=hn(e);sn(e),_r(e,r),va(e,r),n.finish()}}function Cs(e,t,n){var r=e.display,i=e.options.lineNumbers,a=r.lineDiv,l=a.firstChild;function o(_){var X=_.nextSibling;return P&&G&&e.display.currentWheelTarget==_?_.style.display="none":_.parentNode.removeChild(_),X}for(var u=r.view,f=r.viewFrom,D=0;D<u.length;D++){var k=u[D];if(!k.hidden)if(!k.node||k.node.parentNode!=a){var M=Zu(e,k,f,n);a.insertBefore(M,l)}else{for(;l!=k.node;)l=o(l);var L=i&&t!=null&&t<=f&&k.lineNumber;k.changes&&(Ie(k.changes,"gutter")>-1&&(L=!1),dl(e,k,f,n)),L&&(Ee(k.lineNumber),k.lineNumber.appendChild(document.createTextNode(_i(e.options,f)))),l=k.node.nextSibling}f+=k.size}for(;l;)l=o(l)}function ga(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",ot(e,"gutterChanged",e)}function va(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+Gt(e)+"px"}function Ul(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=aa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=r+"px",l=0;l<n.length;l++)if(!n[l].hidden){e.options.fixedGutter&&(n[l].gutter&&(n[l].gutter.style.left=a),n[l].gutterBackground&&(n[l].gutterBackground.style.left=a));var o=n[l].alignable;if(o)for(var u=0;u<o.length;u++)o[u].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function ql(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=_i(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(T("div",[T("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=i.firstChild.offsetWidth,l=i.offsetWidth-a;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(a,r.lineGutter.offsetWidth-l)+1,r.lineNumWidth=r.lineNumInnerWidth+l,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",ga(e.display),!0}return!1}function ma(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var a=e[i],l=null;if(typeof a!="string"&&(l=a.style,a=a.className),a=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:a,style:l})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Gl(e){var t=e.gutters,n=e.gutterSpecs;Ee(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],a=i.className,l=i.style,o=t.appendChild(T("div",null,"CodeMirror-gutter "+a));l&&(o.style.cssText=l),a=="CodeMirror-linenumbers"&&(e.lineGutter=o,o.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",ga(e)}function gn(e){Gl(e.display),Dt(e),Ul(e)}function ks(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=V("div",null,"CodeMirror-code"),i.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=T("div",null,"CodeMirror-cursors"),i.measure=T("div",null,"CodeMirror-measure"),i.lineMeasure=T("div",null,"CodeMirror-measure"),i.lineSpace=V("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var a=V("div",[i.lineSpace],"CodeMirror-lines");i.mover=T("div",[a],null,"position: relative"),i.sizer=T("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=T("div",null,null,"position: absolute; height: "+We+"px; width: 1px;"),i.gutters=T("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=T("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=T("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),N&&j>=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),y&&A<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!P&&!(g&&U)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=ma(r.gutters,r.lineNumbers),Gl(i),n.init(i)}var Qn=0,Jt=null;y?Jt=-.53:g?Jt=15:N?Jt=-.7:ne&&(Jt=-1/3);function jl(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function ws(e){var t=jl(e);return t.x*=Jt,t.y*=Jt,t}function Kl(e,t){N&&j==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=jl(t),r=n.x,i=n.y,a=Jt;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,a=1);var l=e.display,o=l.scroller,u=o.scrollWidth>o.clientWidth,f=o.scrollHeight>o.clientHeight;if(r&&u||i&&f){if(i&&G&&P){e:for(var D=t.target,k=l.view;D!=o;D=D.parentNode)for(var M=0;M<k.length;M++)if(k[M].node==D){e.display.currentWheelTarget=D;break e}}if(r&&!g&&!K&&a!=null){i&&f&&cn(e,Math.max(0,o.scrollTop+i*a)),br(e,Math.max(0,o.scrollLeft+r*a)),(!i||i&&f)&&Ye(t),l.wheelStartX=null;return}if(i&&a!=null){var L=i*a,_=e.doc.scrollTop,X=_+l.wrapper.clientHeight;L<0?_=Math.max(0,_+L-50):X=Math.min(e.doc.height,X+L+50),pa(e,{top:_,bottom:X})}Qn<20&&t.deltaMode!==0&&(l.wheelStartX==null?(l.wheelStartX=o.scrollLeft,l.wheelStartY=o.scrollTop,l.wheelDX=r,l.wheelDY=i,setTimeout(function(){if(l.wheelStartX!=null){var ee=o.scrollLeft-l.wheelStartX,ae=o.scrollTop-l.wheelStartY,se=ae&&l.wheelDY&&ae/l.wheelDY||ee&&l.wheelDX&&ee/l.wheelDX;l.wheelStartX=l.wheelStartY=null,se&&(Jt=(Jt*Qn+se)/(Qn+1),++Qn)}},200)):(l.wheelDX+=r,l.wheelDY+=i))}}var Lt=function(e,t){this.ranges=e,this.primIndex=t};Lt.prototype.primary=function(){return this.ranges[this.primIndex]},Lt.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!Wi(n.anchor,r.anchor)||!Wi(n.head,r.head))return!1}return!0},Lt.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Re(Ui(this.ranges[t].anchor),Ui(this.ranges[t].head));return new Lt(e,this.primIndex)},Lt.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Lt.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(we(t,r.from())>=0&&we(e,r.to())<=0)return n}return-1};var Re=function(e,t){this.anchor=e,this.head=t};Re.prototype.from=function(){return In(this.anchor,this.head)},Re.prototype.to=function(){return Nn(this.anchor,this.head)},Re.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Rt(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(M,L){return we(M.from(),L.from())}),n=Ie(t,i);for(var a=1;a<t.length;a++){var l=t[a],o=t[a-1],u=we(o.to(),l.from());if(r&&!l.empty()?u>0:u>=0){var f=In(o.from(),l.from()),D=Nn(o.to(),l.to()),k=o.empty()?l.from()==l.head:o.from()==o.head;a<=n&&--n,t.splice(--a,2,new Re(k?D:f,k?f:D))}}return new Lt(t,n)}function lr(e,t){return new Lt([new Re(e,t||e)],0)}function or(e){return e.text?Q(e.from.line+e.text.length-1,Be(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Xl(e,t){if(we(e,t.from)<0)return e;if(we(e,t.to)<=0)return or(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=or(t).ch-t.to.ch),Q(n,r)}function xa(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Re(Xl(i.anchor,t),Xl(i.head,t)))}return Rt(e.cm,n,e.sel.primIndex)}function Yl(e,t,n){return e.line==t.line?Q(n.line,e.ch-t.ch+n.ch):Q(n.line+(e.line-t.line),e.ch)}function Ss(e,t,n){for(var r=[],i=Q(e.first,0),a=i,l=0;l<t.length;l++){var o=t[l],u=Yl(o.from,i,a),f=Yl(or(o),i,a);if(i=o.to,a=f,n=="around"){var D=e.sel.ranges[l],k=we(D.head,D.anchor)<0;r[l]=new Re(k?f:u,k?u:f)}else r[l]=new Re(u,u)}return new Lt(r,e.sel.primIndex)}function ya(e){e.doc.mode=Ri(e.options,e.doc.modeOption),vn(e)}function vn(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,pn(e,100),e.state.modeGen++,e.curOp&&Dt(e)}function Zl(e,t){return t.from.ch==0&&t.to.ch==0&&Be(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Da(e,t,n,r){function i(se){return n?n[se]:null}function a(se,le,he){Nu(se,le,he,r),ot(se,"change",se,t)}function l(se,le){for(var he=[],be=se;be<le;++be)he.push(new Nr(f[be],i(be),r));return he}var o=t.from,u=t.to,f=t.text,D=me(e,o.line),k=me(e,u.line),M=Be(f),L=i(f.length-1),_=u.line-o.line;if(t.full)e.insert(0,l(0,f.length)),e.remove(f.length,e.size-f.length);else if(Zl(e,t)){var X=l(0,f.length-1);a(k,k.text,L),_&&e.remove(o.line,_),X.length&&e.insert(o.line,X)}else if(D==k)if(f.length==1)a(D,D.text.slice(0,o.ch)+M+D.text.slice(u.ch),L);else{var ee=l(1,f.length-1);ee.push(new Nr(M+D.text.slice(u.ch),L,r)),a(D,D.text.slice(0,o.ch)+f[0],i(0)),e.insert(o.line+1,ee)}else if(f.length==1)a(D,D.text.slice(0,o.ch)+f[0]+k.text.slice(u.ch),i(0)),e.remove(o.line+1,_);else{a(D,D.text.slice(0,o.ch)+f[0],i(0)),a(k,M+k.text.slice(u.ch),L);var ae=l(1,f.length-1);_>1&&e.remove(o.line+1,_-1),e.insert(o.line+1,ae)}ot(e,"change",e,t)}function ur(e,t,n){function r(i,a,l){if(i.linked)for(var o=0;o<i.linked.length;++o){var u=i.linked[o];if(u.doc!=a){var f=l&&u.sharedHist;n&&!f||(t(u.doc,f),r(u.doc,i,f))}}}r(e,null,!0)}function $l(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,la(e),ya(e),Ql(e),e.options.direction=t.direction,e.options.lineWrapping||Zi(e),e.options.mode=t.modeOption,Dt(e)}function Ql(e){(e.doc.direction=="rtl"?et:Ae)(e.display.lineDiv,"CodeMirror-rtl")}function Fs(e){St(e,function(){Ql(e),Dt(e)})}function Jn(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function ba(e,t){var n={from:Ui(t.from),to:or(t),text:gr(e,t.from,t.to)};return eo(e,n,t.from.line,t.to.line+1),ur(e,function(r){return eo(r,n,t.from.line,t.to.line+1)},!0),n}function Jl(e){for(;e.length;){var t=Be(e);if(t.ranges)e.pop();else break}}function As(e,t){if(t)return Jl(e.done),Be(e.done);if(e.done.length&&!Be(e.done).ranges)return Be(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Be(e.done)}function Vl(e,t,n,r){var i=e.history;i.undone.length=0;var a=+new Date,l,o;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=As(i,i.lastOp==r)))o=Be(l.changes),we(t.from,t.to)==0&&we(t.from,o.to)==0?o.to=or(t):l.changes.push(ba(e,t));else{var u=Be(i.done);for((!u||!u.ranges)&&Vn(e.sel,i.done),l={changes:[ba(e,t)],generation:i.generation},i.done.push(l);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,o||He(e,"historyAdded")}function Es(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Ls(e,t,n,r){var i=e.history,a=r&&r.origin;n==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||Es(e,a,Be(i.done),t))?i.done[i.done.length-1]=t:Vn(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=n,r&&r.clearRedo!==!1&&Jl(i.undone)}function Vn(e,t){var n=Be(t);n&&n.ranges&&n.equals(e)||t.push(e)}function eo(e,t,n,r){var i=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(l){l.markedSpans&&((i||(i=t["spans_"+e.id]={}))[a]=l.markedSpans),++a})}function Ts(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Bs(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Ts(n[i]));return r}function to(e,t){var n=Bs(e,t),r=ji(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var a=n[i],l=r[i];if(a&&l)e:for(var o=0;o<l.length;++o){for(var u=l[o],f=0;f<a.length;++f)if(a[f].marker==u.marker)continue e;a.push(u)}else l&&(n[i]=l)}return n}function Wr(e,t,n){for(var r=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){r.push(n?Lt.prototype.deepCopy.call(a):a);continue}var l=a.changes,o=[];r.push({changes:o});for(var u=0;u<l.length;++u){var f=l[u],D=void 0;if(o.push({from:f.from,to:f.to,text:f.text}),t)for(var k in f)(D=k.match(/^spans_(\d+)$/))&&Ie(t,Number(D[1]))>-1&&(Be(o)[k]=f[k],delete f[k])}}return r}function Ca(e,t,n,r){if(r){var i=e.anchor;if(n){var a=we(t,i)<0;a!=we(n,i)<0?(i=t,t=n):a!=we(t,n)<0&&(t=n)}return new Re(i,t)}else return new Re(n||t,t)}function ei(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),vt(e,new Lt([Ca(e.sel.primary(),t,n,i)],0),r)}function ro(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)r[a]=Ca(e.sel.ranges[a],t[a],null,i);var l=Rt(e.cm,r,e.sel.primIndex);vt(e,l,n)}function ka(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,vt(e,Rt(e.cm,i,e.sel.primIndex),r)}function no(e,t,n,r){vt(e,lr(t,n),r)}function Ms(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var a=0;a<i.length;a++)this.ranges[a]=new Re(Se(e,i[a].anchor),Se(e,i[a].head))},origin:n&&n.origin};return He(e,"beforeSelectionChange",e,r),e.cm&&He(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Rt(e.cm,r.ranges,r.ranges.length-1):t}function io(e,t,n){var r=e.history.done,i=Be(r);i&&i.ranges?(r[r.length-1]=t,ti(e,t,n)):vt(e,t,n)}function vt(e,t,n){ti(e,t,n),Ls(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ti(e,t,n){(pt(e,"beforeSelectionChange")||e.cm&&pt(e.cm,"beforeSelectionChange"))&&(t=Ms(e,t,n));var r=n&&n.bias||(we(t.primary().head,e.sel.primary().head)<0?-1:1);ao(e,oo(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&zr(e.cm)}function ao(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,at(e.cm)),ot(e,"cursorActivity",e))}function lo(e){ao(e,oo(e,e.sel,null,!1))}function oo(e,t,n,r){for(var i,a=0;a<t.ranges.length;a++){var l=t.ranges[a],o=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],u=ri(e,l.anchor,o&&o.anchor,n,r),f=l.head==l.anchor?u:ri(e,l.head,o&&o.head,n,r);(i||u!=l.anchor||f!=l.head)&&(i||(i=t.ranges.slice(0,a)),i[a]=new Re(u,f))}return i?Rt(e.cm,i,t.primIndex):t}function Ur(e,t,n,r,i){var a=me(e,t.line);if(a.markedSpans)for(var l=0;l<a.markedSpans.length;++l){var o=a.markedSpans[l],u=o.marker,f="selectLeft"in u?!u.selectLeft:u.inclusiveLeft,D="selectRight"in u?!u.selectRight:u.inclusiveRight;if((o.from==null||(f?o.from<=t.ch:o.from<t.ch))&&(o.to==null||(D?o.to>=t.ch:o.to>t.ch))){if(i&&(He(u,"beforeCursorEnter"),u.explicitlyCleared))if(a.markedSpans){--l;continue}else break;if(!u.atomic)continue;if(n){var k=u.find(r<0?1:-1),M=void 0;if((r<0?D:f)&&(k=uo(e,k,-r,k&&k.line==t.line?a:null)),k&&k.line==t.line&&(M=we(k,n))&&(r<0?M<0:M>0))return Ur(e,k,t,r,i)}var L=u.find(r<0?-1:1);return(r<0?f:D)&&(L=uo(e,L,r,L.line==t.line?a:null)),L?Ur(e,L,t,r,i):null}}return t}function ri(e,t,n,r,i){var a=r||1,l=Ur(e,t,n,a,i)||!i&&Ur(e,t,n,a,!0)||Ur(e,t,n,-a,i)||!i&&Ur(e,t,n,-a,!0);return l||(e.cantEdit=!0,Q(e.first,0))}function uo(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?Se(e,Q(t.line-1)):null:n>0&&t.ch==(r||me(e,t.line)).text.length?t.line<e.first+e.size-1?Q(t.line+1,0):null:new Q(t.line,t.ch+n)}function so(e){e.setSelection(Q(e.firstLine(),0),Q(e.lastLine()),dt)}function fo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,a,l,o){i&&(r.from=Se(e,i)),a&&(r.to=Se(e,a)),l&&(r.text=l),o!==void 0&&(r.origin=o)}),He(e,"beforeChange",e,r),e.cm&&He(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function qr(e,t,n){if(e.cm){if(!e.cm.curOp)return ut(e.cm,qr)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((pt(e,"beforeChange")||e.cm&&pt(e.cm,"beforeChange"))&&(t=fo(e,t,!0),!t))){var r=tl&&!n&&Lu(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)co(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else co(e,t)}}function co(e,t){if(!(t.text.length==1&&t.text[0]==""&&we(t.from,t.to)==0)){var n=xa(e,t);Vl(e,t,n,e.cm?e.cm.curOp.id:NaN),mn(e,t,n,ji(e,t));var r=[];ur(e,function(i,a){!a&&Ie(r,i.history)==-1&&(vo(i.history,t),r.push(i.history)),mn(i,t,null,ji(i,t))})}}function ni(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,a,l=e.sel,o=t=="undo"?i.done:i.undone,u=t=="undo"?i.undone:i.done,f=0;f<o.length&&(a=o[f],!(n?a.ranges&&!a.equals(e.sel):!a.ranges));f++);if(f!=o.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(a=o.pop(),a.ranges){if(Vn(a,u),n&&!a.equals(e.sel)){vt(e,a,{clearRedo:!1});return}l=a}else if(r){o.push(a);return}else break;var D=[];Vn(l,u),u.push({changes:D,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var k=pt(e,"beforeChange")||e.cm&&pt(e.cm,"beforeChange"),M=function(X){var ee=a.changes[X];if(ee.origin=t,k&&!fo(e,ee,!1))return o.length=0,{};D.push(ba(e,ee));var ae=X?xa(e,ee):Be(o);mn(e,ee,ae,to(e,ee)),!X&&e.cm&&e.cm.scrollIntoView({from:ee.from,to:or(ee)});var se=[];ur(e,function(le,he){!he&&Ie(se,le.history)==-1&&(vo(le.history,ee),se.push(le.history)),mn(le,ee,null,to(le,ee))})},L=a.changes.length-1;L>=0;--L){var _=M(L);if(_)return _.v}}}}function ho(e,t){if(t!=0&&(e.first+=t,e.sel=new Lt(Et(e.sel.ranges,function(i){return new Re(Q(i.anchor.line+t,i.anchor.ch),Q(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){Dt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)ir(e.cm,r,"gutter")}}function mn(e,t,n,r){if(e.cm&&!e.cm.curOp)return ut(e.cm,mn)(e,t,n,r);if(t.to.line<e.first){ho(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);ho(e,i),t={from:Q(e.first,0),to:Q(t.to.line+i,t.to.ch),text:[Be(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:Q(a,me(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=gr(e,t.from,t.to),n||(n=xa(e,t)),e.cm?Ns(e.cm,t,r):Da(e,t,r),ti(e,n,dt),e.cantEdit&&ri(e,Q(e.firstLine(),0))&&(e.cantEdit=!1)}}function Ns(e,t,n){var r=e.doc,i=e.display,a=t.from,l=t.to,o=!1,u=a.line;e.options.lineWrapping||(u=ze(Ot(me(r,a.line))),r.iter(u,l.line+1,function(L){if(L==i.maxLine)return o=!0,!0})),r.sel.contains(t.from,t.to)>-1&&at(e),Da(r,t,n,Bl(e)),e.options.lineWrapping||(r.iter(u,a.line+t.text.length,function(L){var _=_n(L);_>i.maxLineLength&&(i.maxLine=L,i.maxLineLength=_,i.maxLineChanged=!0,o=!1)}),o&&(e.curOp.updateMaxLine=!0)),Cu(r,a.line),pn(e,400);var f=t.text.length-(l.line-a.line)-1;t.full?Dt(e):a.line==l.line&&t.text.length==1&&!Zl(e.doc,t)?ir(e,a.line,"text"):Dt(e,a.line,l.line+1,f);var D=pt(e,"changes"),k=pt(e,"change");if(k||D){var M={from:a,to:l,text:t.text,removed:t.removed,origin:t.origin};k&&ot(e,"change",e,M),D&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(M)}e.display.selForContextMenu=null}function Gr(e,t,n,r,i){var a;r||(r=n),we(r,n)<0&&(a=[r,n],n=a[0],r=a[1]),typeof t=="string"&&(t=e.splitLines(t)),qr(e,{from:n,to:r,text:t,origin:i})}function po(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function go(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i],l=!0;if(a.ranges){a.copied||(a=e[i]=a.deepCopy(),a.copied=!0);for(var o=0;o<a.ranges.length;o++)po(a.ranges[o].anchor,t,n,r),po(a.ranges[o].head,t,n,r);continue}for(var u=0;u<a.changes.length;++u){var f=a.changes[u];if(n<f.from.line)f.from=Q(f.from.line+r,f.from.ch),f.to=Q(f.to.line+r,f.to.ch);else if(t<=f.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}function vo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;go(e.done,n,r,i),go(e.undone,n,r,i)}function xn(e,t,n,r){var i=t,a=t;return typeof t=="number"?a=me(e,Ka(e,t)):i=ze(t),i==null?null:(r(a,i)&&e.cm&&ir(e.cm,i,n),a)}function yn(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}yn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Iu(i),ot(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function Dn(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Dn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var a=Math.min(t,i-e),l=r.height;if(r.removeInner(e,a),this.height-=l-r.height,i==a&&(this.children.splice(n--,1),r.parent=null),(t-=a)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof yn))){var o=[];this.collapse(o),this.children=[new yn(o)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<=a){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var l=i.lines.length%25+25,o=l;o<i.lines.length;){var u=new yn(i.lines.slice(o,o+=25));i.height-=u.height,this.children.splice(++r,0,u),u.parent=this}i.lines=i.lines.slice(0,l),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Dn(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=Ie(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new Dn(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<a){var l=Math.min(t,a-e);if(i.iterN(e,l,n))return!0;if((t-=l)==0)break;e=0}else e-=a}}};var bn=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};bn.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=ze(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var a=on(this);Ut(n,Math.max(0,n.height-a)),e&&(St(e,function(){mo(e,n,-a),ir(e,r,"widget")}),ot(e,"lineWidgetCleared",e,this,r))}},bn.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=on(this)-t;i&&(nr(this.doc,r)||Ut(r,r.height+i),n&&St(n,function(){n.curOp.forceUpdate=!0,mo(n,r,i),ot(n,"lineWidgetChanged",n,e,ze(r))}))},Nt(bn);function mo(e,t,n){$t(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ha(e,n)}function Is(e,t,n,r){var i=new bn(e,n,r),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),xn(e,t,"widget",function(l){var o=l.widgets||(l.widgets=[]);if(i.insertAt==null?o.push(i):o.splice(Math.min(o.length,Math.max(0,i.insertAt)),0,i),i.line=l,a&&!nr(e,l)){var u=$t(l)<e.scrollTop;Ut(l,l.height+on(i)),u&&ha(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&ot(a,"lineWidgetAdded",a,i,typeof t=="number"?t:ze(t)),i}var xo=0,sr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++xo};sr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&kr(e),pt(this,"clear")){var n=this.find();n&&ot(this,"clear",n.from,n.to)}for(var r=null,i=null,a=0;a<this.lines.length;++a){var l=this.lines[a],o=nn(l.markedSpans,this);e&&!this.collapsed?ir(e,ze(l),"text"):e&&(o.to!=null&&(i=ze(l)),o.from!=null&&(r=ze(l))),l.markedSpans=Su(l.markedSpans,o),o.from==null&&this.collapsed&&!nr(this.doc,l)&&e&&Ut(l,Hr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var u=0;u<this.lines.length;++u){var f=Ot(this.lines[u]),D=_n(f);D>e.display.maxLineLength&&(e.display.maxLine=f,e.display.maxLineLength=D,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Dt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&lo(e.doc)),e&&ot(e,"markerCleared",e,this,r,i),t&&wr(e),this.parent&&this.parent.clear()}},sr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var a=this.lines[i],l=nn(a.markedSpans,this);if(l.from!=null&&(n=Q(t?a:ze(a),l.from),e==-1))return n;if(l.to!=null&&(r=Q(t?a:ze(a),l.to),e==1))return r}return n&&{from:n,to:r}},sr.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||St(r,function(){var i=t.line,a=ze(t.line),l=Vi(r,a);if(l&&(kl(l),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!nr(n.doc,i)&&n.height!=null){var o=n.height;n.height=null;var u=on(n)-o;u&&Ut(i,i.height+u)}ot(r,"markerChanged",r,e)})},sr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Ie(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},sr.prototype.detachLine=function(e){if(this.lines.splice(Ie(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Nt(sr);function jr(e,t,n,r,i){if(r&&r.shared)return Os(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return ut(e.cm,jr)(e,t,n,r,i);var a=new sr(e,i),l=we(t,n);if(r&&ht(r,a,!1),l>0||l==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=V("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(ol(e,t.line,t,n,a)||t.line!=n.line&&ol(e,n.line,t,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");wu()}a.addToHistory&&Vl(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var o=t.line,u=e.cm,f;if(e.iter(o,n.line+1,function(k){u&&a.collapsed&&!u.options.lineWrapping&&Ot(k)==u.display.maxLine&&(f=!0),a.collapsed&&o!=t.line&&Ut(k,0),Fu(k,new Hn(a,o==t.line?t.ch:null,o==n.line?n.ch:null),e.cm&&e.cm.curOp),++o}),a.collapsed&&e.iter(t.line,n.line+1,function(k){nr(e,k)&&Ut(k,0)}),a.clearOnEnter&&W(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(ku(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++xo,a.atomic=!0),u){if(f&&(u.curOp.updateMaxLine=!0),a.collapsed)Dt(u,t.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var D=t.line;D<=n.line;D++)ir(u,D,"text");a.atomic&&lo(u.doc),ot(u,"markerAdded",u,a)}return a}var Cn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Cn.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ot(this,"clear")}},Cn.prototype.find=function(e,t){return this.primary.find(e,t)},Nt(Cn);function Os(e,t,n,r,i){r=ht(r),r.shared=!1;var a=[jr(e,t,n,r,i)],l=a[0],o=r.widgetNode;return ur(e,function(u){o&&(r.widgetNode=o.cloneNode(!0)),a.push(jr(u,Se(u,t),Se(u,n),r,i));for(var f=0;f<u.linked.length;++f)if(u.linked[f].isParent)return;l=Be(a)}),new Cn(a,l)}function yo(e){return e.findMarks(Q(e.first,0),e.clipPos(Q(e.lastLine())),function(t){return t.parent})}function Hs(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),a=e.clipPos(i.from),l=e.clipPos(i.to);if(we(a,l)){var o=jr(e,a,l,r.primary,r.primary.type);r.markers.push(o),o.parent=r}}}function Rs(e){for(var t=function(r){var i=e[r],a=[i.primary.doc];ur(i.primary.doc,function(u){return a.push(u)});for(var l=0;l<i.markers.length;l++){var o=i.markers[l];Ie(a,o.doc)==-1&&(o.parent=null,i.markers.splice(l--,1))}},n=0;n<e.length;n++)t(n)}var Ps=0,bt=function(e,t,n,r,i){if(!(this instanceof bt))return new bt(e,t,n,r,i);n==null&&(n=0),Dn.call(this,[new yn([new Nr("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var a=Q(n,0);this.sel=lr(a),this.history=new Jn(null),this.id=++Ps,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Da(this,{from:a,to:a,text:e}),vt(this,lr(a),dt)};bt.prototype=I(Dn.prototype,{constructor:bt,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=zi(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:st(function(e){var t=Q(this.first,0),n=this.first+this.size-1;qr(this,{from:t,to:Q(n,me(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&fn(this.cm,0,0),vt(this,lr(t),dt)}),replaceRange:function(e,t,n,r){t=Se(this,t),n=n?Se(this,n):t,Gr(this,e,t,n,r)},getRange:function(e,t,n){var r=gr(this,Se(this,e),Se(this,t));return n===!1?r:n===""?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(tn(this,e))return me(this,e)},getLineNumber:function(e){return ze(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=me(this,e)),Ot(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Se(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:st(function(e,t,n){no(this,Se(this,typeof e=="number"?Q(e,t||0):e),null,n)}),setSelection:st(function(e,t,n){no(this,Se(this,e),Se(this,t||e),n)}),extendSelection:st(function(e,t,n){ei(this,Se(this,e),t&&Se(this,t),n)}),extendSelections:st(function(e,t){ro(this,Xa(this,e),t)}),extendSelectionsBy:st(function(e,t){var n=Et(this.sel.ranges,e);ro(this,Xa(this,n),t)}),setSelections:st(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Re(Se(this,e[i].anchor),Se(this,e[i].head||e[i].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),vt(this,Rt(this.cm,r,t),n)}}),addSelection:st(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Re(Se(this,e),Se(this,t||e))),vt(this,Rt(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=gr(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=gr(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:st(function(e,t,n){for(var r=[],i=this.sel,a=0;a<i.ranges.length;a++){var l=i.ranges[a];r[a]={from:l.from(),to:l.to(),text:this.splitLines(e[a]),origin:n}}for(var o=t&&t!="end"&&Ss(this,r,t),u=r.length-1;u>=0;u--)qr(this,r[u]);o?io(this,o):this.cm&&zr(this.cm)}),undo:st(function(){ni(this,"undo")}),redo:st(function(){ni(this,"redo")}),undoSelection:st(function(){ni(this,"undo",!0)}),redoSelection:st(function(){ni(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Jn(this.history),ur(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Wr(this.history.done),undone:Wr(this.history.undone)}},setHistory:function(e){var t=this.history=new Jn(this.history);t.done=Wr(e.done.slice(0),null,!0),t.undone=Wr(e.undone.slice(0),null,!0)},setGutterMarker:st(function(e,t,n){return xn(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&p(i)&&(r.gutterMarkers=null),!0})}),clearGutter:st(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&xn(t,n,"gutter",function(){return n.gutterMarkers[e]=null,p(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!tn(this,e)||(t=e,e=me(this,e),!e))return null}else if(t=ze(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:st(function(e,t,n){return xn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(re(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:st(function(e,t,n){return xn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",a=r[i];if(a)if(n==null)r[i]=null;else{var l=a.match(re(n));if(!l)return!1;var o=l.index+l[0].length;r[i]=a.slice(0,l.index)+(!l.index||o==a.length?"":" ")+a.slice(o)||null}else return!1;return!0})}),addLineWidget:st(function(e,t,n){return Is(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return jr(this,Se(this,e),Se(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Se(this,e),jr(this,e,e,n,"bookmark")},findMarksAt:function(e){e=Se(this,e);var t=[],n=me(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=Se(this,e),t=Se(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var l=a.markedSpans;if(l)for(var o=0;o<l.length;o++){var u=l[o];!(u.to!=null&&i==e.line&&e.ch>=u.to||u.from==null&&i!=e.line||u.from!=null&&i==t.line&&u.from>=t.ch)&&(!n||n(u.marker))&&r.push(u.marker.parent||u.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var a=i.text.length+r;if(a>e)return t=e,!0;e-=a,++n}),Se(this,Q(n,t))},indexFromPos:function(e){e=Se(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new bt(zi(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new bt(zi(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Hs(r,yo(this)),r},unlinkDoc:function(e){if(e instanceof je&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Rs(yo(this));break}}if(e.history==this.history){var r=[e.id];ur(e,function(i){return r.push(i.id)},!0),e.history=new Jn(null),e.history.done=Wr(this.history.done,r),e.history.undone=Wr(this.history.undone,r)}},iterLinkedDocs:function(e){ur(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ii(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:st(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&Fs(this.cm))})}),bt.prototype.eachLine=bt.prototype.iter;var Do=0;function zs(e){var t=this;if(bo(t),!(Le(t,e)||Qt(t.display,e))){Ye(e),y&&(Do=+new Date);var n=yr(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),l=0,o=function(){++l==i&&ut(t,function(){n=Se(t.doc,n);var L={from:n,to:n,text:t.doc.splitLines(a.filter(function(_){return _!=null}).join(t.doc.lineSeparator())),origin:"paste"};qr(t.doc,L),io(t.doc,lr(Se(t.doc,n),Se(t.doc,or(L))))})()},u=function(L,_){if(t.options.allowDropFileTypes&&Ie(t.options.allowDropFileTypes,L.type)==-1){o();return}var X=new FileReader;X.onerror=function(){return o()},X.onload=function(){var ee=X.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ee)){o();return}a[_]=ee,o()},X.readAsText(L)},f=0;f<r.length;f++)u(r[f],f);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var D=e.dataTransfer.getData("Text");if(D){var k;if(t.state.draggingText&&!t.state.draggingText.copy&&(k=t.listSelections()),ti(t.doc,lr(n,n)),k)for(var M=0;M<k.length;++M)Gr(t.doc,"",k[M].anchor,k[M].head,"drag");t.replaceSelection(D,"around","paste"),t.display.input.focus()}}catch{}}}}function _s(e,t){if(y&&(!e.state.draggingText||+new Date-Do<100)){It(t);return}if(!(Le(e,t)||Qt(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ne)){var n=T("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",K&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),K&&n.parentNode.removeChild(n)}}function Ws(e,t){var n=yr(e,t);if(n){var r=document.createDocumentFragment();oa(e,n,r),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),De(e.display.dragCursor,r)}}function bo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Co(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var a=0;a<n.length;a++)e(n[a])})}}var ko=!1;function Us(){ko||(qs(),ko=!0)}function qs(){var e;W(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Co(Gs)},100))}),W(window,"blur",function(){return Co(Pr)})}function Gs(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var fr={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},kn=0;kn<10;kn++)fr[kn+48]=fr[kn+96]=String(kn);for(var ii=65;ii<=90;ii++)fr[ii]=String.fromCharCode(ii);for(var wn=1;wn<=12;wn++)fr[wn+111]=fr[wn+63235]="F"+wn;var Vt={};Vt.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Vt.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Vt.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Vt.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Vt.default=G?Vt.macDefault:Vt.pcDefault;function js(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,a,l=0;l<t.length-1;l++){var o=t[l];if(/^(cmd|meta|m)$/i.test(o))a=!0;else if(/^a(lt)?$/i.test(o))n=!0;else if(/^(c|ctrl|control)$/i.test(o))r=!0;else if(/^s(hift)?$/i.test(o))i=!0;else throw new Error("Unrecognized modifier name: "+o)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),a&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Ks(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=Et(n.split(" "),js),a=0;a<i.length;a++){var l=void 0,o=void 0;a==i.length-1?(o=i.join(" "),l=r):(o=i.slice(0,a+1).join(" "),l="...");var u=t[o];if(!u)t[o]=l;else if(u!=l)throw new Error("Inconsistent bindings for "+o)}delete e[n]}for(var f in t)e[f]=t[f];return e}function Kr(e,t,n,r){t=ai(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Kr(e,t.fallthrough,n,r);for(var a=0;a<t.fallthrough.length;a++){var l=Kr(e,t.fallthrough[a],n,r);if(l)return l}}}function wo(e){var t=typeof e=="string"?e:fr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function So(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(pe?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(pe?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Fo(e,t){if(K&&e.keyCode==34&&e.char)return!1;var n=fr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),So(n,e,t))}function ai(e){return typeof e=="string"?Vt[e]:e}function Xr(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var a=t(n[i]);r.length&&we(a.from,Be(r).to)<=0;){var l=r.pop();if(we(l.from,a.from)<0){a.from=l.from;break}}r.push(a)}St(e,function(){for(var o=r.length-1;o>=0;o--)Gr(e.doc,"",r[o].from,r[o].to,"+delete");zr(e)})}function wa(e,t,n){var r=E(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Sa(e,t,n){var r=wa(e,t.ch,n);return r==null?null:new Q(t.line,r,n<0?"after":"before")}function Fa(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var a=ue(n,t.doc.direction);if(a){var l=i<0?Be(a):a[0],o=i<0==(l.level==1),u=o?"after":"before",f;if(l.level>0||t.doc.direction=="rtl"){var D=Or(t,n);f=i<0?n.text.length-1:0;var k=jt(t,D,f).top;f=ie(function(M){return jt(t,D,M).top==k},i<0==(l.level==1)?l.from:l.to-1,f),u=="before"&&(f=wa(n,f,1))}else f=i<0?l.to:l.from;return new Q(r,f,u)}}return new Q(r,i<0?n.text.length:0,i<0?"before":"after")}function Xs(e,t,n,r){var i=ue(t,e.doc.direction);if(!i)return Sa(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var a=ve(i,n.ch,n.sticky),l=i[a];if(e.doc.direction=="ltr"&&l.level%2==0&&(r>0?l.to>n.ch:l.from<n.ch))return Sa(t,n,r);var o=function(ae,se){return wa(t,ae instanceof Q?ae.ch:ae,se)},u,f=function(ae){return e.options.lineWrapping?(u=u||Or(e,t),Tl(e,t,u,ae)):{begin:0,end:t.text.length}},D=f(n.sticky=="before"?o(n,-1):n.ch);if(e.doc.direction=="rtl"||l.level==1){var k=l.level==1==r<0,M=o(n,k?1:-1);if(M!=null&&(k?M<=l.to&&M<=D.end:M>=l.from&&M>=D.begin)){var L=k?"before":"after";return new Q(n.line,M,L)}}var _=function(ae,se,le){for(var he=function(Ue,ft){return ft?new Q(n.line,o(Ue,1),"before"):new Q(n.line,Ue,"after")};ae>=0&&ae<i.length;ae+=se){var be=i[ae],xe=se>0==(be.level!=1),Te=xe?le.begin:o(le.end,-1);if(be.from<=Te&&Te<be.to||(Te=xe?be.from:o(be.to,-1),le.begin<=Te&&Te<le.end))return he(Te,xe)}},X=_(a+r,r,D);if(X)return X;var ee=r>0?D.end:o(D.begin,-1);return ee!=null&&!(r>0&&ee==t.text.length)&&(X=_(r>0?0:i.length-1,r,f(ee)),X)?X:null}var Sn={selectAll:so,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),dt)},killLine:function(e){return Xr(e,function(t){if(t.empty()){var n=me(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:Q(t.head.line+1,0)}:{from:t.head,to:Q(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Xr(e,function(t){return{from:Q(t.from().line,0),to:Se(e.doc,Q(t.to().line+1,0))}})},delLineLeft:function(e){return Xr(e,function(t){return{from:Q(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Xr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Xr(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Q(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Q(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ao(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Eo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Ys(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Bt)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Bt)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Eo(e,t.head):r},Bt)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("	")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var a=n[i].from(),l=Xe(e.getLine(a.line),a.ch,r);t.push(_t(r-l%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return St(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,a=me(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new Q(i.line,i.ch-1)),i.ch>0)i=new Q(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),Q(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=me(e.doc,i.line-1).text;l&&(i=new Q(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Q(i.line-1,l.length-1),i,"+transpose"))}}n.push(new Re(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return St(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);zr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ao(e,t){var n=me(e.doc,t),r=Ot(n);return r!=n&&(t=ze(r)),Fa(!0,e,r,t,1)}function Ys(e,t){var n=me(e.doc,t),r=Bu(n);return r!=n&&(t=ze(r)),Fa(!0,e,n,t,-1)}function Eo(e,t){var n=Ao(e,t.line),r=me(e.doc,n.line),i=ue(r,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(n.ch,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=a&&t.ch;return Q(n.line,l?0:a,n.sticky)}return n}function li(e,t,n){if(typeof t=="string"&&(t=Sn[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Je}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Zs(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Kr(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Kr(t,e.options.extraKeys,n,e)||Kr(t,e.options.keyMap,n,e)}var $s=new it;function Fn(e,t,n,r){var i=e.state.keySeq;if(i){if(wo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:$s.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Lo(e,i+" "+t,n,r))return!0}return Lo(e,t,n,r)}function Lo(e,t,n,r){var i=Zs(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&ot(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(Ye(n),ua(e)),!!i}function To(e,t){var n=Fo(t,!0);return n?t.shiftKey&&!e.state.keySeq?Fn(e,"Shift-"+n,t,function(r){return li(e,r,!0)})||Fn(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return li(e,r)}):Fn(e,n,t,function(r){return li(e,r)}):!1}function Qs(e,t,n){return Fn(e,"'"+n+"'",t,function(r){return li(e,r,!0)})}var Aa=null;function Bo(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=Me(q(t)),!Le(t,e))){y&&A<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=To(t,e);K&&(Aa=r?n:null,!r&&n==88&&!gu&&(G?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),g&&!G&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Js(t)}}function Js(e){var t=e.display.lineDiv;et(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(Ae(t,"CodeMirror-crosshair"),Oe(document,"keyup",n),Oe(document,"mouseover",n))}W(document,"keyup",n),W(document,"mouseover",n)}function Mo(e){e.keyCode==16&&(this.doc.sel.shift=!1),Le(this,e)}function No(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(Qt(t.display,e)||Le(t,e)||e.ctrlKey&&!e.altKey||G&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(K&&n==Aa){Aa=null,Ye(e);return}if(!(K&&(!e.which||e.which<10)&&To(t,e))){var i=String.fromCharCode(r??n);i!="\b"&&(Qs(t,e,i)||t.display.input.onKeyPress(e))}}}var Vs=400,Ea=function(e,t,n){this.time=e,this.pos=t,this.button=n};Ea.prototype.compare=function(e,t,n){return this.time+Vs>e&&we(t,this.pos)==0&&n==this.button};var An,En;function ef(e,t){var n=+new Date;return En&&En.compare(n,e,t)?(An=En=null,"triple"):An&&An.compare(n,e,t)?(En=new Ea(n,e,t),An=null,"double"):(An=new Ea(n,e,t),En=null,"single")}function Io(e){var t=this,n=t.display;if(!(Le(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Qt(n,e)){P||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!La(t,e)){var r=yr(t,e),i=rr(e),a=r?ef(r,i):"single";Fe(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&tf(t,i,r,a,e))&&(i==1?r?nf(t,r,a,e):en(e)==n.scroller&&Ye(e):i==2?(r&&ei(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(qe?t.display.input.onContextMenu(e):sa(t)))}}}function tf(e,t,n,r,i){var a="Click";return r=="double"?a="Double"+a:r=="triple"&&(a="Triple"+a),a=(t==1?"Left":t==2?"Middle":"Right")+a,Fn(e,So(a,i),i,function(l){if(typeof l=="string"&&(l=Sn[l]),!l)return!1;var o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),o=l(e,n)!=Je}finally{e.state.suppressEdits=!1}return o})}function rf(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var a=te?n.shiftKey&&n.metaKey:n.altKey;i.unit=a?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=G?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(G?n.altKey:n.ctrlKey)),i}function nf(e,t,n,r){y?setTimeout(Qe(Il,e),0):e.curOp.focus=Me(q(e));var i=rf(e,n,r),a=e.doc.sel,l;e.options.dragDrop&&cu&&!e.isReadOnly()&&n=="single"&&(l=a.contains(t))>-1&&(we((l=a.ranges[l]).from(),t)<0||t.xRel>0)&&(we(l.to(),t)>0||t.xRel<0)?af(e,r,t,i):lf(e,r,t,i)}function af(e,t,n,r){var i=e.display,a=!1,l=ut(e,function(f){P&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:sa(e)),Oe(i.wrapper.ownerDocument,"mouseup",l),Oe(i.wrapper.ownerDocument,"mousemove",o),Oe(i.scroller,"dragstart",u),Oe(i.scroller,"drop",l),a||(Ye(f),r.addNew||ei(e.doc,n,null,null,r.extend),P&&!ne||y&&A==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),o=function(f){a=a||Math.abs(t.clientX-f.clientX)+Math.abs(t.clientY-f.clientY)>=10},u=function(){return a=!0};P&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,W(i.wrapper.ownerDocument,"mouseup",l),W(i.wrapper.ownerDocument,"mousemove",o),W(i.scroller,"dragstart",u),W(i.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Oo(e,t,n){if(n=="char")return new Re(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Re(Q(t.line,0),Se(e.doc,Q(t.line+1,0)));var r=n(e,t);return new Re(r.from,r.to)}function lf(e,t,n,r){y&&sa(e);var i=e.display,a=e.doc;Ye(t);var l,o,u=a.sel,f=u.ranges;if(r.addNew&&!r.extend?(o=a.sel.contains(n),o>-1?l=f[o]:l=new Re(n,n)):(l=a.sel.primary(),o=a.sel.primIndex),r.unit=="rectangle")r.addNew||(l=new Re(n,n)),n=yr(e,t,!0,!0),o=-1;else{var D=Oo(e,n,r.unit);r.extend?l=Ca(l,D.anchor,D.head,r.extend):l=D}r.addNew?o==-1?(o=f.length,vt(a,Rt(e,f.concat([l]),o),{scroll:!1,origin:"*mouse"})):f.length>1&&f[o].empty()&&r.unit=="char"&&!r.extend?(vt(a,Rt(e,f.slice(0,o).concat(f.slice(o+1)),0),{scroll:!1,origin:"*mouse"}),u=a.sel):ka(a,o,l,ye):(o=0,vt(a,new Lt([l],0),ye),u=a.sel);var k=n;function M(le){if(we(k,le)!=0)if(k=le,r.unit=="rectangle"){for(var he=[],be=e.options.tabSize,xe=Xe(me(a,n.line).text,n.ch,be),Te=Xe(me(a,le.line).text,le.ch,be),Ue=Math.min(xe,Te),ft=Math.max(xe,Te),Ze=Math.min(n.line,le.line),Ft=Math.min(e.lastLine(),Math.max(n.line,le.line));Ze<=Ft;Ze++){var Ct=me(a,Ze).text,rt=Mt(Ct,Ue,be);Ue==ft?he.push(new Re(Q(Ze,rt),Q(Ze,rt))):Ct.length>rt&&he.push(new Re(Q(Ze,rt),Q(Ze,Mt(Ct,ft,be))))}he.length||he.push(new Re(n,n)),vt(a,Rt(e,u.ranges.slice(0,o).concat(he),o),{origin:"*mouse",scroll:!1}),e.scrollIntoView(le)}else{var kt=l,gt=Oo(e,le,r.unit),lt=kt.anchor,nt;we(gt.anchor,lt)>0?(nt=gt.head,lt=In(kt.from(),gt.anchor)):(nt=gt.anchor,lt=Nn(kt.to(),gt.head));var $e=u.ranges.slice(0);$e[o]=of(e,new Re(Se(a,lt),nt)),vt(a,Rt(e,$e,o),ye)}}var L=i.wrapper.getBoundingClientRect(),_=0;function X(le){var he=++_,be=yr(e,le,!0,r.unit=="rectangle");if(be)if(we(be,k)!=0){e.curOp.focus=Me(q(e)),M(be);var xe=Yn(i,a);(be.line>=xe.to||be.line<xe.from)&&setTimeout(ut(e,function(){_==he&&X(le)}),150)}else{var Te=le.clientY<L.top?-20:le.clientY>L.bottom?20:0;Te&&setTimeout(ut(e,function(){_==he&&(i.scroller.scrollTop+=Te,X(le))}),50)}}function ee(le){e.state.selectingText=!1,_=1/0,le&&(Ye(le),i.input.focus()),Oe(i.wrapper.ownerDocument,"mousemove",ae),Oe(i.wrapper.ownerDocument,"mouseup",se),a.history.lastSelOrigin=null}var ae=ut(e,function(le){le.buttons===0||!rr(le)?ee(le):X(le)}),se=ut(e,ee);e.state.selectingText=se,W(i.wrapper.ownerDocument,"mousemove",ae),W(i.wrapper.ownerDocument,"mouseup",se)}function of(e,t){var n=t.anchor,r=t.head,i=me(e.doc,n.line);if(we(n,r)==0&&n.sticky==r.sticky)return t;var a=ue(i);if(!a)return t;var l=ve(a,n.ch,n.sticky),o=a[l];if(o.from!=n.ch&&o.to!=n.ch)return t;var u=l+(o.from==n.ch==(o.level!=1)?0:1);if(u==0||u==a.length)return t;var f;if(r.line!=n.line)f=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var D=ve(a,r.ch,r.sticky),k=D-l||(r.ch-n.ch)*(o.level==1?-1:1);D==u-1||D==u?f=k<0:f=k>0}var M=a[u+(f?-1:0)],L=f==(M.level==1),_=L?M.from:M.to,X=L?"after":"before";return n.ch==_&&n.sticky==X?t:new Re(new Q(n.line,_,X),r)}function Ho(e,t,n,r){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ye(t);var l=e.display,o=l.lineDiv.getBoundingClientRect();if(a>o.bottom||!pt(e,n))return Yt(t);a-=o.top-l.viewOffset;for(var u=0;u<e.display.gutterSpecs.length;++u){var f=l.gutters.childNodes[u];if(f&&f.getBoundingClientRect().right>=i){var D=vr(e.doc,a),k=e.display.gutterSpecs[u];return He(e,n,e,D,k.className,t),Yt(t)}}}function La(e,t){return Ho(e,t,"gutterClick",!0)}function Ro(e,t){Qt(e.display,t)||uf(e,t)||Le(e,t,"contextmenu")||qe||e.display.input.onContextMenu(t)}function uf(e,t){return pt(e,"gutterContextMenu")?Ho(e,t,"gutterContextMenu",!1):!1}function Po(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),un(e)}var Yr={toString:function(){return"CodeMirror.Init"}},zo={},oi={};function sf(e){var t=e.optionHandlers;function n(r,i,a,l){e.defaults[r]=i,a&&(t[r]=l?function(o,u,f){f!=Yr&&a(o,u,f)}:a)}e.defineOption=n,e.Init=Yr,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,ya(r)},!0),n("indentUnit",2,ya,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){vn(r),un(r),Dt(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var a=[],l=r.doc.first;r.doc.iter(function(u){for(var f=0;;){var D=u.text.indexOf(i,f);if(D==-1)break;f=D+i.length,a.push(Q(l,D))}l++});for(var o=a.length-1;o>=0;o--)Gr(r.doc,i,a[o],Q(a[o].line,a[o].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,a){r.state.specialChars=new RegExp(i.source+(i.test("	")?"":"|	"),"g"),a!=Yr&&r.refresh()}),n("specialCharPlaceholder",Ru,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",U?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!Y),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){Po(r),gn(r)},!0),n("keyMap","default",function(r,i,a){var l=ai(i),o=a!=Yr&&ai(a);o&&o.detach&&o.detach(r,l),l.attach&&l.attach(r,o||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,cf,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=ma(i,r.options.lineNumbers),gn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?aa(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return _r(r)},!0),n("scrollbarStyle","native",function(r){_l(r),_r(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=ma(r.options.gutters,i),gn(r)},!0),n("firstLineNumber",1,gn,!0),n("lineNumberFormatter",function(r){return r},gn,!0),n("showCursorWhenSelecting",!1,sn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Pr(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,ff),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,sn,!0),n("singleCursorHeightPerLine",!0,sn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,vn,!0),n("addModeClass",!1,vn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,vn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function ff(e,t,n){var r=n&&n!=Yr;if(!t!=!r){var i=e.display.dragFunctions,a=t?W:Oe;a(e.display.scroller,"dragstart",i.start),a(e.display.scroller,"dragenter",i.enter),a(e.display.scroller,"dragover",i.over),a(e.display.scroller,"dragleave",i.leave),a(e.display.scroller,"drop",i.drop)}}function cf(e){e.options.lineWrapping?(et(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ae(e.display.wrapper,"CodeMirror-wrap"),Zi(e)),la(e),Dt(e),un(e),setTimeout(function(){return _r(e)},100)}function je(e,t){var n=this;if(!(this instanceof je))return new je(e,t);this.options=t=t?ht(t):{},ht(zo,t,!1);var r=t.value;typeof r=="string"?r=new bt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new je.inputStyles[t.inputStyle](this),a=this.display=new ks(e,r,i,t);a.wrapper.CodeMirror=this,Po(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),_l(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 it,keySeq:null,specialChars:null},t.autofocus&&!U&&a.input.focus(),y&&A<11&&setTimeout(function(){return n.display.input.reset(!0)},20),hf(this),Us(),kr(this),this.curOp.forceUpdate=!0,$l(this,r),t.autofocus&&!U||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&fa(n)},20):Pr(this);for(var l in oi)oi.hasOwnProperty(l)&&oi[l](this,t[l],Yr);ql(this),t.finishInit&&t.finishInit(this);for(var o=0;o<Ta.length;++o)Ta[o](this);wr(this),P&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"&&(a.lineDiv.style.textRendering="auto")}je.defaults=zo,je.optionHandlers=oi;function hf(e){var t=e.display;W(t.scroller,"mousedown",ut(e,Io)),y&&A<11?W(t.scroller,"dblclick",ut(e,function(u){if(!Le(e,u)){var f=yr(e,u);if(!(!f||La(e,u)||Qt(e.display,u))){Ye(u);var D=e.findWordAt(f);ei(e.doc,D.anchor,D.head)}}})):W(t.scroller,"dblclick",function(u){return Le(e,u)||Ye(u)}),W(t.scroller,"contextmenu",function(u){return Ro(e,u)}),W(t.input.getField(),"contextmenu",function(u){t.scroller.contains(u.target)||Ro(e,u)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function a(u){if(u.touches.length!=1)return!1;var f=u.touches[0];return f.radiusX<=1&&f.radiusY<=1}function l(u,f){if(f.left==null)return!0;var D=f.left-u.left,k=f.top-u.top;return D*D+k*k>20*20}W(t.scroller,"touchstart",function(u){if(!Le(e,u)&&!a(u)&&!La(e,u)){t.input.ensurePolled(),clearTimeout(n);var f=+new Date;t.activeTouch={start:f,moved:!1,prev:f-r.end<=300?r:null},u.touches.length==1&&(t.activeTouch.left=u.touches[0].pageX,t.activeTouch.top=u.touches[0].pageY)}}),W(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),W(t.scroller,"touchend",function(u){var f=t.activeTouch;if(f&&!Qt(t,u)&&f.left!=null&&!f.moved&&new Date-f.start<300){var D=e.coordsChar(t.activeTouch,"page"),k;!f.prev||l(f,f.prev)?k=new Re(D,D):!f.prev.prev||l(f,f.prev.prev)?k=e.findWordAt(D):k=new Re(Q(D.line,0),Se(e.doc,Q(D.line+1,0))),e.setSelection(k.anchor,k.head),e.focus(),Ye(u)}i()}),W(t.scroller,"touchcancel",i),W(t.scroller,"scroll",function(){t.scroller.clientHeight&&(cn(e,t.scroller.scrollTop),br(e,t.scroller.scrollLeft,!0),He(e,"scroll",e))}),W(t.scroller,"mousewheel",function(u){return Kl(e,u)}),W(t.scroller,"DOMMouseScroll",function(u){return Kl(e,u)}),W(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(u){Le(e,u)||It(u)},over:function(u){Le(e,u)||(Ws(e,u),It(u))},start:function(u){return _s(e,u)},drop:ut(e,zs),leave:function(u){Le(e,u)||bo(e)}};var o=t.input.getField();W(o,"keyup",function(u){return Mo.call(e,u)}),W(o,"keydown",ut(e,Bo)),W(o,"keypress",ut(e,No)),W(o,"focus",function(u){return fa(e,u)}),W(o,"blur",function(u){return Pr(e,u)})}var Ta=[];je.defineInitHook=function(e){return Ta.push(e)};function Ln(e,t,n,r){var i=e.doc,a;n==null&&(n="add"),n=="smart"&&(i.mode.indent?a=rn(e,t).state:n="prev");var l=e.options.tabSize,o=me(i,t),u=Xe(o.text,null,l);o.stateAfter&&(o.stateAfter=null);var f=o.text.match(/^\s*/)[0],D;if(!r&&!/\S/.test(o.text))D=0,n="not";else if(n=="smart"&&(D=i.mode.indent(a,o.text.slice(f.length),o.text),D==Je||D>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?D=Xe(me(i,t-1).text,null,l):D=0:n=="add"?D=u+e.options.indentUnit:n=="subtract"?D=u-e.options.indentUnit:typeof n=="number"&&(D=u+n),D=Math.max(0,D);var k="",M=0;if(e.options.indentWithTabs)for(var L=Math.floor(D/l);L;--L)M+=l,k+="	";if(M<D&&(k+=_t(D-M)),k!=f)return Gr(i,k,Q(t,0),Q(t,f.length),"+input"),o.stateAfter=null,!0;for(var _=0;_<i.sel.ranges.length;_++){var X=i.sel.ranges[_];if(X.head.line==t&&X.head.ch<f.length){var ee=Q(t,f.length);ka(i,_,new Re(ee,ee));break}}}var Pt=null;function ui(e){Pt=e}function Ba(e,t,n,r,i){var a=e.doc;e.display.shift=!1,r||(r=a.sel);var l=+new Date-200,o=i=="paste"||e.state.pasteIncoming>l,u=Ii(t),f=null;if(o&&r.ranges.length>1)if(Pt&&Pt.text.join(`
`)==t){if(r.ranges.length%Pt.text.length==0){f=[];for(var D=0;D<Pt.text.length;D++)f.push(a.splitLines(Pt.text[D]))}}else u.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(f=Et(u,function(ae){return[ae]}));for(var k=e.curOp.updateInput,M=r.ranges.length-1;M>=0;M--){var L=r.ranges[M],_=L.from(),X=L.to();L.empty()&&(n&&n>0?_=Q(_.line,_.ch-n):e.state.overwrite&&!o?X=Q(X.line,Math.min(me(a,X.line).text.length,X.ch+Be(u).length)):o&&Pt&&Pt.lineWise&&Pt.text.join(`
`)==u.join(`
`)&&(_=X=Q(_.line,0)));var ee={from:_,to:X,text:f?f[M%f.length]:u,origin:i||(o?"paste":e.state.cutIncoming>l?"cut":"+input")};qr(e.doc,ee),ot(e,"inputRead",e,ee)}t&&!o&&Wo(e,t),zr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=k),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function _o(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&St(t,function(){return Ba(t,n,0,null,"paste")}),!0}function Wo(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=e.getModeAt(i.head),l=!1;if(a.electricChars){for(var o=0;o<a.electricChars.length;o++)if(t.indexOf(a.electricChars.charAt(o))>-1){l=Ln(e,i.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(me(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Ln(e,i.head.line,"smart"));l&&ot(e,"electricInput",e,i.head.line)}}}function Uo(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,a={anchor:Q(i,0),head:Q(i+1,0)};n.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:n}}function Ma(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function qo(){var e=T("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=T("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return P?e.style.width="1000px":e.setAttribute("wrap","off"),H&&(e.style.border="1px solid black"),t}function df(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){Fe(this).focus(),this.display.input.focus()},setOption:function(r,i){var a=this.options,l=a[r];a[r]==i&&r!="mode"||(a[r]=i,t.hasOwnProperty(r)&&ut(this,t[r])(this,i,l),He(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](ai(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,a=0;a<i.length;++a)if(i[a]==r||i[a].name==r)return i.splice(a,1),!0},addOverlay:xt(function(r,i){var a=r.token?r:e.getMode(this.options,r);if(a.startState)throw new Error("Overlays may not be stateful.");Wt(this.state.overlays,{mode:a,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(l){return l.priority}),this.state.modeGen++,Dt(this)}),removeOverlay:xt(function(r){for(var i=this.state.overlays,a=0;a<i.length;++a){var l=i[a].modeSpec;if(l==r||typeof r=="string"&&l.name==r){i.splice(a,1),this.state.modeGen++,Dt(this);return}}}),indentLine:xt(function(r,i,a){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),tn(this.doc,r)&&Ln(this,r,i,a)}),indentSelection:xt(function(r){for(var i=this.doc.sel.ranges,a=-1,l=0;l<i.length;l++){var o=i[l];if(o.empty())o.head.line>a&&(Ln(this,o.head.line,r,!0),a=o.head.line,l==this.doc.sel.primIndex&&zr(this));else{var u=o.from(),f=o.to(),D=Math.max(a,u.line);a=Math.min(this.lastLine(),f.line-(f.ch?0:1))+1;for(var k=D;k<a;++k)Ln(this,k,r);var M=this.doc.sel.ranges;u.ch==0&&i.length==M.length&&M[l].from().ch>0&&ka(this.doc,l,new Re(u,M[l].to()),dt)}}}),getTokenAt:function(r,i){return Ja(this,r,i)},getLineTokens:function(r,i){return Ja(this,Q(r),i,!0)},getTokenTypeAt:function(r){r=Se(this.doc,r);var i=Za(this,me(this.doc,r.line)),a=0,l=(i.length-1)/2,o=r.ch,u;if(o==0)u=i[2];else for(;;){var f=a+l>>1;if((f?i[f*2-1]:0)>=o)l=f;else if(i[f*2+1]<o)a=f+1;else{u=i[f*2+2];break}}var D=u?u.indexOf("overlay "):-1;return D<0?u:D==0?null:u.slice(0,D-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var a=[];if(!n.hasOwnProperty(i))return a;var l=n[i],o=this.getModeAt(r);if(typeof o[i]=="string")l[o[i]]&&a.push(l[o[i]]);else if(o[i])for(var u=0;u<o[i].length;u++){var f=l[o[i][u]];f&&a.push(f)}else o.helperType&&l[o.helperType]?a.push(l[o.helperType]):l[o.name]&&a.push(l[o.name]);for(var D=0;D<l._global.length;D++){var k=l._global[D];k.pred(o,this)&&Ie(a,k.val)==-1&&a.push(k.val)}return a},getStateAfter:function(r,i){var a=this.doc;return r=Ka(a,r??a.first+a.size-1),rn(this,r+1,i).state},cursorCoords:function(r,i){var a,l=this.doc.sel.primary();return r==null?a=l.head:typeof r=="object"?a=Se(this.doc,r):a=r?l.from():l.to(),Ht(this,a,i||"page")},charCoords:function(r,i){return Gn(this,Se(this.doc,r),i||"page")},coordsChar:function(r,i){return r=Al(this,r,i||"page"),ra(this,r.left,r.top)},lineAtHeight:function(r,i){return r=Al(this,{top:r,left:0},i||"page").top,vr(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,a){var l=!1,o;if(typeof r=="number"){var u=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>u&&(r=u,l=!0),o=me(this.doc,r)}else o=r;return qn(this,o,{top:0,left:0},i||"page",a||l).top+(l?this.doc.height-$t(o):0)},defaultTextHeight:function(){return Hr(this.display)},defaultCharWidth:function(){return Rr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,a,l,o){var u=this.display;r=Ht(this,Se(this.doc,r));var f=r.bottom,D=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),u.sizer.appendChild(i),l=="over")f=r.top;else if(l=="above"||l=="near"){var k=Math.max(u.wrapper.clientHeight,this.doc.height),M=Math.max(u.sizer.clientWidth,u.lineSpace.clientWidth);(l=="above"||r.bottom+i.offsetHeight>k)&&r.top>i.offsetHeight?f=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=k&&(f=r.bottom),D+i.offsetWidth>M&&(D=M-i.offsetWidth)}i.style.top=f+"px",i.style.left=i.style.right="",o=="right"?(D=u.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(o=="left"?D=0:o=="middle"&&(D=(u.sizer.clientWidth-i.offsetWidth)/2),i.style.left=D+"px"),a&&ss(this,{left:D,top:f,right:D+i.offsetWidth,bottom:f+i.offsetHeight})},triggerOnKeyDown:xt(Bo),triggerOnKeyPress:xt(No),triggerOnKeyUp:Mo,triggerOnMouseDown:xt(Io),execCommand:function(r){if(Sn.hasOwnProperty(r))return Sn[r].call(null,this)},triggerElectric:xt(function(r){Wo(this,r)}),findPosH:function(r,i,a,l){var o=1;i<0&&(o=-1,i=-i);for(var u=Se(this.doc,r),f=0;f<i&&(u=Na(this.doc,u,o,a,l),!u.hitSide);++f);return u},moveH:xt(function(r,i){var a=this;this.extendSelectionsBy(function(l){return a.display.shift||a.doc.extend||l.empty()?Na(a.doc,l.head,r,i,a.options.rtlMoveVisually):r<0?l.from():l.to()},Bt)}),deleteH:xt(function(r,i){var a=this.doc.sel,l=this.doc;a.somethingSelected()?l.replaceSelection("",null,"+delete"):Xr(this,function(o){var u=Na(l,o.head,r,i,!1);return r<0?{from:u,to:o.head}:{from:o.head,to:u}})}),findPosV:function(r,i,a,l){var o=1,u=l;i<0&&(o=-1,i=-i);for(var f=Se(this.doc,r),D=0;D<i;++D){var k=Ht(this,f,"div");if(u==null?u=k.left:k.left=u,f=Go(this,k,o,a),f.hitSide)break}return f},moveV:xt(function(r,i){var a=this,l=this.doc,o=[],u=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(D){if(u)return r<0?D.from():D.to();var k=Ht(a,D.head,"div");D.goalColumn!=null&&(k.left=D.goalColumn),o.push(k.left);var M=Go(a,k,r,i);return i=="page"&&D==l.sel.primary()&&ha(a,Gn(a,M,"div").top-k.top),M},Bt),o.length)for(var f=0;f<l.sel.ranges.length;f++)l.sel.ranges[f].goalColumn=o[f]}),findWordAt:function(r){var i=this.doc,a=me(i,r.line).text,l=r.ch,o=r.ch;if(a){var u=this.getHelper(r,"wordChars");(r.sticky=="before"||o==a.length)&&l?--l:++o;for(var f=a.charAt(l),D=h(f,u)?function(k){return h(k,u)}:/\s/.test(f)?function(k){return/\s/.test(k)}:function(k){return!/\s/.test(k)&&!h(k)};l>0&&D(a.charAt(l-1));)--l;for(;o<a.length&&D(a.charAt(o));)++o}return new Re(Q(r.line,l),Q(r.line,o))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?et(this.display.cursorDiv,"CodeMirror-overwrite"):Ae(this.display.cursorDiv,"CodeMirror-overwrite"),He(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Me(q(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:xt(function(r,i){fn(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Gt(this)-this.display.barHeight,width:r.scrollWidth-Gt(this)-this.display.barWidth,clientHeight:Ji(this),clientWidth:mr(this)}},scrollIntoView:xt(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:Q(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?fs(this,r):Hl(this,r.from,r.to,r.margin)}),setSize:xt(function(r,i){var a=this,l=function(u){return typeof u=="number"||/^\d+$/.test(String(u))?u+"px":u};r!=null&&(this.display.wrapper.style.width=l(r)),i!=null&&(this.display.wrapper.style.height=l(i)),this.options.lineWrapping&&wl(this);var o=this.display.viewFrom;this.doc.iter(o,this.display.viewTo,function(u){if(u.widgets){for(var f=0;f<u.widgets.length;f++)if(u.widgets[f].noHScroll){ir(a,o,"widget");break}}++o}),this.curOp.forceUpdate=!0,He(this,"refresh",this)}),operation:function(r){return St(this,r)},startOperation:function(){return kr(this)},endOperation:function(){return wr(this)},refresh:xt(function(){var r=this.display.cachedTextHeight;Dt(this),this.curOp.forceUpdate=!0,un(this),fn(this,this.doc.scrollLeft,this.doc.scrollTop),ga(this.display),(r==null||Math.abs(r-Hr(this.display))>.5||this.options.lineWrapping)&&la(this),He(this,"refresh",this)}),swapDoc:xt(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),$l(this,r),un(this),this.display.input.reset(),fn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,ot(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[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}},Nt(e),e.registerHelper=function(r,i,a){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=a},e.registerGlobalHelper=function(r,i,a,l){e.registerHelper(r,i,l),n[r]._global.push({pred:a,val:l})}}function Na(e,t,n,r,i){var a=t,l=n,o=me(e,t.line),u=i&&e.direction=="rtl"?-n:n;function f(){var se=t.line+u;return se<e.first||se>=e.first+e.size?!1:(t=new Q(se,t.ch,t.sticky),o=me(e,se))}function D(se){var le;if(r=="codepoint"){var he=o.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(he))le=null;else{var be=n>0?he>=55296&&he<56320:he>=56320&&he<57343;le=new Q(t.line,Math.max(0,Math.min(o.text.length,t.ch+n*(be?2:1))),-n)}}else i?le=Xs(e.cm,o,t,n):le=Sa(o,t,n);if(le==null)if(!se&&f())t=Fa(i,e.cm,o,t.line,u);else return!1;else t=le;return!0}if(r=="char"||r=="codepoint")D();else if(r=="column")D(!0);else if(r=="word"||r=="group")for(var k=null,M=r=="group",L=e.cm&&e.cm.getHelper(t,"wordChars"),_=!0;!(n<0&&!D(!_));_=!1){var X=o.text.charAt(t.ch)||`
`,ee=h(X,L)?"w":M&&X==`
`?"n":!M||/\s/.test(X)?null:"p";if(M&&!_&&!ee&&(ee="s"),k&&k!=ee){n<0&&(n=1,D(),t.sticky="after");break}if(ee&&(k=ee),n>0&&!D(!_))break}var ae=ri(e,t,a,l,!0);return Wi(a,ae)&&(ae.hitSide=!0),ae}function Go(e,t,n,r){var i=e.doc,a=t.left,l;if(r=="page"){var o=Math.min(e.display.wrapper.clientHeight,Fe(e).innerHeight||i(e).documentElement.clientHeight),u=Math.max(o-.5*Hr(e.display),3);l=(n>0?t.bottom:t.top)+n*u}else r=="line"&&(l=n>0?t.bottom+3:t.top-3);for(var f;f=ra(e,a,l),!!f.outside;){if(n<0?l<=0:l>=i.height){f.hitSide=!0;break}l+=n*5}return f}var _e=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new it,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};_e.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,Ma(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function a(o){for(var u=o.target;u;u=u.parentNode){if(u==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(u.className))break}return!1}W(i,"paste",function(o){!a(o)||Le(r,o)||_o(o,r)||A<=11&&setTimeout(ut(r,function(){return t.updateFromDOM()}),20)}),W(i,"compositionstart",function(o){t.composing={data:o.data,done:!1}}),W(i,"compositionupdate",function(o){t.composing||(t.composing={data:o.data,done:!1})}),W(i,"compositionend",function(o){t.composing&&(o.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),W(i,"touchstart",function(){return n.forceCompositionEnd()}),W(i,"input",function(){t.composing||t.readFromDOMSoon()});function l(o){if(!(!a(o)||Le(r,o))){if(r.somethingSelected())ui({lineWise:!1,text:r.getSelections()}),o.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var u=Uo(r);ui({lineWise:!0,text:u.text}),o.type=="cut"&&r.operation(function(){r.setSelections(u.ranges,0,dt),r.replaceSelection("",null,"cut")})}else return;if(o.clipboardData){o.clipboardData.clearData();var f=Pt.text.join(`
`);if(o.clipboardData.setData("Text",f),o.clipboardData.getData("Text")==f){o.preventDefault();return}}var D=qo(),k=D.firstChild;Ma(k),r.display.lineSpace.insertBefore(D,r.display.lineSpace.firstChild),k.value=Pt.text.join(`
`);var M=Me(Ne(i));S(k),setTimeout(function(){r.display.lineSpace.removeChild(D),M.focus(),M==i&&n.showPrimarySelection()},50)}}W(i,"copy",l),W(i,"cut",l)},_e.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},_e.prototype.prepareSelection=function(){var e=Nl(this.cm,!1);return e.focus=Me(Ne(this.div))==this.div,e},_e.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},_e.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},_e.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var a=si(t,e.anchorNode,e.anchorOffset),l=si(t,e.focusNode,e.focusOffset);if(!(a&&!a.bad&&l&&!l.bad&&we(In(a,l),r)==0&&we(Nn(a,l),i)==0)){var o=t.display.view,u=r.line>=t.display.viewFrom&&jo(t,r)||{node:o[0].measure.map[2],offset:0},f=i.line<t.display.viewTo&&jo(t,i);if(!f){var D=o[o.length-1].measure,k=D.maps?D.maps[D.maps.length-1]:D.map;f={node:k[k.length-1],offset:k[k.length-2]-k[k.length-3]}}if(!u||!f){e.removeAllRanges();return}var M=e.rangeCount&&e.getRangeAt(0),L;try{L=$(u.node,u.offset,f.offset,f.node)}catch{}L&&(!g&&t.state.focused?(e.collapse(u.node,u.offset),L.collapsed||(e.removeAllRanges(),e.addRange(L))):(e.removeAllRanges(),e.addRange(L)),M&&e.anchorNode==null?e.addRange(M):g&&this.startGracePeriod()),this.rememberSelection()}},_e.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},_e.prototype.showMultipleSelections=function(e){De(this.cm.display.cursorDiv,e.cursors),De(this.cm.display.selectionDiv,e.selection)},_e.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},_e.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return ge(this.div,t)},_e.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||Me(Ne(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},_e.prototype.blur=function(){this.div.blur()},_e.prototype.getField=function(){return this.div},_e.prototype.supportsTouch=function(){return!0},_e.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):St(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},_e.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},_e.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(R&&N&&this.cm.display.gutterSpecs.length&&pf(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=si(t,e.anchorNode,e.anchorOffset),r=si(t,e.focusNode,e.focusOffset);n&&r&&St(t,function(){vt(t.doc,lr(n,r),dt),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},_e.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=Q(r.line-1,me(e.doc,r.line-1).length)),i.ch==me(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=Q(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,l,o;r.line==t.viewFrom||(a=Dr(e,r.line))==0?(l=ze(t.view[0].line),o=t.view[0].node):(l=ze(t.view[a].line),o=t.view[a-1].node.nextSibling);var u=Dr(e,i.line),f,D;if(u==t.view.length-1?(f=t.viewTo-1,D=t.lineDiv.lastChild):(f=ze(t.view[u+1].line)-1,D=t.view[u+1].node.previousSibling),!o)return!1;for(var k=e.doc.splitLines(gf(e,o,D,l,f)),M=gr(e.doc,Q(l,0),Q(f,me(e.doc,f).text.length));k.length>1&&M.length>1;)if(Be(k)==Be(M))k.pop(),M.pop(),f--;else if(k[0]==M[0])k.shift(),M.shift(),l++;else break;for(var L=0,_=0,X=k[0],ee=M[0],ae=Math.min(X.length,ee.length);L<ae&&X.charCodeAt(L)==ee.charCodeAt(L);)++L;for(var se=Be(k),le=Be(M),he=Math.min(se.length-(k.length==1?L:0),le.length-(M.length==1?L:0));_<he&&se.charCodeAt(se.length-_-1)==le.charCodeAt(le.length-_-1);)++_;if(k.length==1&&M.length==1&&l==r.line)for(;L&&L>r.ch&&se.charCodeAt(se.length-_-1)==le.charCodeAt(le.length-_-1);)L--,_++;k[k.length-1]=se.slice(0,se.length-_).replace(/^\u200b+/,""),k[0]=k[0].slice(L).replace(/\u200b+$/,"");var be=Q(l,L),xe=Q(f,M.length?Be(M).length-_:0);if(k.length>1||k[0]||we(be,xe))return Gr(e.doc,k,be,xe,"+input"),!0},_e.prototype.ensurePolled=function(){this.forceCompositionEnd()},_e.prototype.reset=function(){this.forceCompositionEnd()},_e.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},_e.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))},_e.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&St(this.cm,function(){return Dt(e.cm)})},_e.prototype.setUneditable=function(e){e.contentEditable="false"},_e.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ut(this.cm,Ba)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},_e.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},_e.prototype.onContextMenu=function(){},_e.prototype.resetPosition=function(){},_e.prototype.needsContentAttribute=!0;function jo(e,t){var n=Vi(e,t.line);if(!n||n.hidden)return null;var r=me(e.doc,t.line),i=yl(n,r,t.line),a=ue(r,e.doc.direction),l="left";if(a){var o=ve(a,t.ch);l=o%2?"right":"left"}var u=Cl(i.map,t.ch,l);return u.offset=u.collapse=="right"?u.end:u.start,u}function pf(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 gf(e,t,n,r,i){var a="",l=!1,o=e.doc.lineSeparator(),u=!1;function f(L){return function(_){return _.id==L}}function D(){l&&(a+=o,u&&(a+=o),l=u=!1)}function k(L){L&&(D(),a+=L)}function M(L){if(L.nodeType==1){var _=L.getAttribute("cm-text");if(_){k(_);return}var X=L.getAttribute("cm-marker"),ee;if(X){var ae=e.findMarks(Q(r,0),Q(i+1,0),f(+X));ae.length&&(ee=ae[0].find(0))&&k(gr(e.doc,ee.from,ee.to).join(o));return}if(L.getAttribute("contenteditable")=="false")return;var se=/^(pre|div|p|li|table|br)$/i.test(L.nodeName);if(!/^br$/i.test(L.nodeName)&&L.textContent.length==0)return;se&&D();for(var le=0;le<L.childNodes.length;le++)M(L.childNodes[le]);/^(pre|p)$/i.test(L.nodeName)&&(u=!0),se&&(l=!0)}else L.nodeType==3&&k(L.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;M(t),t!=n;)t=t.nextSibling,u=!1;return a}function si(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Zr(e.clipPos(Q(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var a=e.display.view[i];if(a.node==r)return vf(a,t,n)}}function vf(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!ge(r,t))return Zr(Q(ze(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var a=e.rest?Be(e.rest):e.line;return Zr(Q(ze(a),a.text.length),i)}var l=t.nodeType==3?t:null,o=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,n&&(n=l.nodeValue.length));o.parentNode!=r;)o=o.parentNode;var u=e.measure,f=u.maps;function D(ee,ae,se){for(var le=-1;le<(f?f.length:0);le++)for(var he=le<0?u.map:f[le],be=0;be<he.length;be+=3){var xe=he[be+2];if(xe==ee||xe==ae){var Te=ze(le<0?e.line:e.rest[le]),Ue=he[be]+se;return(se<0||xe!=ee)&&(Ue=he[be+(se?1:0)]),Q(Te,Ue)}}}var k=D(l,o,n);if(k)return Zr(k,i);for(var M=o.nextSibling,L=l?l.nodeValue.length-n:0;M;M=M.nextSibling){if(k=D(M,M.firstChild,0),k)return Zr(Q(k.line,k.ch-L),i);L+=M.textContent.length}for(var _=o.previousSibling,X=n;_;_=_.previousSibling){if(k=D(_,_.firstChild,-1),k)return Zr(Q(k.line,k.ch+X),i);X+=_.textContent.length}}var Ve=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new it,this.hasSelection=!1,this.composing=null,this.resetting=!1};Ve.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),H&&(i.style.width="0px"),W(i,"input",function(){y&&A>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),W(i,"paste",function(l){Le(r,l)||_o(l,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function a(l){if(!Le(r,l)){if(r.somethingSelected())ui({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var o=Uo(r);ui({lineWise:!0,text:o.text}),l.type=="cut"?r.setSelections(o.ranges,null,dt):(n.prevInput="",i.value=o.text.join(`
`),S(i))}else return;l.type=="cut"&&(r.state.cutIncoming=+new Date)}}W(i,"cut",a),W(i,"copy",a),W(e.scroller,"paste",function(l){if(!(Qt(e,l)||Le(r,l))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var o=new Event("paste");o.clipboardData=l.clipboardData,i.dispatchEvent(o)}}),W(e.lineSpace,"selectstart",function(l){Qt(e,l)||Ye(l)}),W(i,"compositionstart",function(){var l=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:r.markText(l,r.getCursor("to"),{className:"CodeMirror-composing"})}}),W(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ve.prototype.createField=function(e){this.wrapper=qo(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Ma(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Ve.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ve.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Nl(e);if(e.options.moveInputWithCursor){var i=Ht(e,n.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-a.left))}return r},Ve.prototype.showSelection=function(e){var t=this.cm,n=t.display;De(n.cursorDiv,e.cursors),De(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ve.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&S(this.textarea),y&&A>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",y&&A>=9&&(this.hasSelection=null));this.resetting=!1}},Ve.prototype.getField=function(){return this.textarea},Ve.prototype.supportsTouch=function(){return!1},Ve.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!U||Me(Ne(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},Ve.prototype.blur=function(){this.textarea.blur()},Ve.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ve.prototype.receivedFocus=function(){this.slowPoll()},Ve.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ve.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},Ve.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||pu(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(y&&A>=9&&this.hasSelection===i||G&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!r&&(r="​"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,o=Math.min(r.length,i.length);l<o&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return St(t,function(){Ba(t,i.slice(l),r.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ve.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ve.prototype.onKeyPress=function(){y&&A>=9&&(this.hasSelection=null),this.fastPoll()},Ve.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=yr(n,e),l=r.scroller.scrollTop;if(!a||K)return;var o=n.options.resetSelectionOnContextMenu;o&&n.doc.sel.contains(a)==-1&&ut(n,vt)(n.doc,lr(a),dt);var u=i.style.cssText,f=t.wrapper.style.cssText,D=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
      top: `+(e.clientY-D.top-5)+"px; left: "+(e.clientX-D.left-5)+`px;
      z-index: 1000; background: `+(y?"rgba(255, 255, 255, .05)":"transparent")+`;
      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var k;P&&(k=i.ownerDocument.defaultView.scrollY),r.input.focus(),P&&i.ownerDocument.defaultView.scrollTo(null,k),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=L,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function M(){if(i.selectionStart!=null){var X=n.somethingSelected(),ee="​"+(X?i.value:"");i.value="⇚",i.value=ee,t.prevInput=X?"":"​",i.selectionStart=1,i.selectionEnd=ee.length,r.selForContextMenu=n.doc.sel}}function L(){if(t.contextMenuPending==L&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,i.style.cssText=u,y&&A<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!y||y&&A<9)&&M();var X=0,ee=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="​"?ut(n,so)(n):X++<10?r.detectingSelectAll=setTimeout(ee,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(ee,200)}}if(y&&A>=9&&M(),qe){It(e);var _=function(){Oe(window,"mouseup",_),setTimeout(L,20)};W(window,"mouseup",_)}else setTimeout(L,50)},Ve.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ve.prototype.setUneditable=function(){},Ve.prototype.needsContentAttribute=!1;function mf(e,t){if(t=t?ht(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 n=Me(Ne(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=o.getValue()}var i;if(e.form&&(W(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var l=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=l}}catch{}}t.finishInit=function(u){u.save=r,u.getTextArea=function(){return e},u.toTextArea=function(){u.toTextArea=isNaN,r(),e.parentNode.removeChild(u.getWrapperElement()),e.style.display="",e.form&&(Oe(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var o=je(function(u){return e.parentNode.insertBefore(u,e.nextSibling)},t);return o}function xf(e){e.off=Oe,e.on=W,e.wheelEventPixels=ws,e.Doc=bt,e.splitLines=Ii,e.countColumn=Xe,e.findColumn=Mt,e.isWordChar=B,e.Pass=Je,e.signal=He,e.Line=Nr,e.changeEnd=or,e.scrollbarModel=zl,e.Pos=Q,e.cmpPos=we,e.modes=Hi,e.mimeModes=Br,e.resolveMode=Mn,e.getMode=Ri,e.modeExtensions=Mr,e.extendMode=yu,e.copyState=pr,e.startState=ja,e.innerMode=Pi,e.commands=Sn,e.keyMap=Vt,e.keyName=Fo,e.isModifierKey=wo,e.lookupKey=Kr,e.normalizeKeyMap=Ks,e.StringStream=tt,e.SharedTextMarker=Cn,e.TextMarker=sr,e.LineWidget=bn,e.e_preventDefault=Ye,e.e_stopPropagation=Xt,e.e_stop=It,e.addClass=et,e.contains=ge,e.rmClass=Ae,e.keyNames=fr}sf(je),df(je);var yf="iter insert remove copy getEditor constructor".split(" ");for(var fi in bt.prototype)bt.prototype.hasOwnProperty(fi)&&Ie(yf,fi)<0&&(je.prototype[fi]=function(e){return function(){return e.apply(this.doc,arguments)}}(bt.prototype[fi]));return Nt(bt),je.inputStyles={textarea:Ve,contenteditable:_e},je.defineMode=function(e){!je.defaults.mode&&e!="null"&&(je.defaults.mode=e),mu.apply(this,arguments)},je.defineMIME=xu,je.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),je.defineMIME("text/plain","null"),je.defineExtension=function(e,t){je.prototype[e]=t},je.defineDocExtension=function(e,t){bt.prototype[e]=t},je.fromTextArea=mf,xf(je),je.version="5.65.18",je})})(eu);var Tt=eu.exports;(function(s,b){(function(c){c(Tt)})(function(c){var m=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,g=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,C=/[*+-]\s/;c.commands.newlineAndIndentContinueMarkdownList=function(x){if(x.getOption("disableInput"))return c.Pass;for(var y=x.listSelections(),A=[],P=0;P<y.length;P++){var z=y[P].head,N=x.getStateAfter(z.line),j=c.innerMode(x.getMode(),N);if(j.mode.name!=="markdown"&&j.mode.helperType!=="markdown"){x.execCommand("newlineAndIndent");return}else N=j.state;var K=N.list!==!1,ne=N.quote!==0,J=x.getLine(z.line),Z=m.exec(J),H=/^\s*$/.test(J.slice(0,z.ch));if(!y[P].empty()||!K&&!ne||!Z||H){x.execCommand("newlineAndIndent");return}if(g.test(J)){var R=ne&&/>\s*$/.test(J),U=!/>\s*$/.test(J);(R||U)&&x.replaceRange("",{line:z.line,ch:0},{line:z.line,ch:z.ch+1}),A[P]=`
`}else{var G=Z[1],te=Z[5],Y=!(C.test(Z[2])||Z[2].indexOf(">")>=0),oe=Y?parseInt(Z[3],10)+1+Z[4]:Z[2].replace("x"," ");A[P]=`
`+G+oe+te,Y&&v(x,z)}}x.replaceSelections(A)};function v(x,y){var A=y.line,P=0,z=0,N=m.exec(x.getLine(A)),j=N[1];do{P+=1;var K=A+P,ne=x.getLine(K),J=m.exec(ne);if(J){var Z=J[1],H=parseInt(N[3],10)+P-z,R=parseInt(J[3],10),U=R;if(j===Z&&!isNaN(R))H===R&&(U=R+1),H>R&&(U=H+1),x.replaceRange(ne.replace(m,Z+U+J[4]+J[5]),{line:K,ch:0},{line:K,ch:ne.length});else{if(j.length>Z.length||j.length<Z.length&&P===1)return;z+=1}}}while(J)}})})();var tu=Tt;tu.commands.tabAndIndentMarkdownList=function(s){var b=s.listSelections(),c=b[0].head,m=s.getStateAfter(c.line),g=m.list!==!1;if(g){s.execCommand("indentMore");return}if(s.options.indentWithTabs)s.execCommand("insertTab");else{var C=Array(s.options.tabSize+1).join(" ");s.replaceSelection(C)}};tu.commands.shiftTabAndUnindentMarkdownList=function(s){var b=s.listSelections(),c=b[0].head,m=s.getStateAfter(c.line),g=m.list!==!1;if(g){s.execCommand("indentLess");return}if(s.options.indentWithTabs)s.execCommand("insertTab");else{var C=Array(s.options.tabSize+1).join(" ");s.replaceSelection(C)}};(function(s,b){(function(c){c(Tt)})(function(c){c.defineOption("fullScreen",!1,function(C,v,x){x==c.Init&&(x=!1),!x!=!v&&(v?m(C):g(C))});function m(C){var v=C.getWrapperElement();C.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:v.style.width,height:v.style.height},v.style.width="",v.style.height="auto",v.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",C.refresh()}function g(C){var v=C.getWrapperElement();v.className=v.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var x=C.state.fullScreenRestore;v.style.width=x.width,v.style.height=x.height,window.scrollTo(x.scrollLeft,x.scrollTop),C.refresh()}})})();var Lf={exports:{}},Tf={exports:{}};(function(s,b){(function(c){c(Tt)})(function(c){var m={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},g={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};c.defineMode("xml",function(C,v){var x=C.indentUnit,y={},A=v.htmlMode?m:g;for(var P in A)y[P]=A[P];for(var P in v)y[P]=v[P];var z,N;function j(T,V){function $(et){return V.tokenize=et,et(T,V)}var ge=T.next();if(ge=="<")return T.eat("!")?T.eat("[")?T.match("CDATA[")?$(J("atom","]]>")):null:T.match("--")?$(J("comment","-->")):T.match("DOCTYPE",!0,!0)?(T.eatWhile(/[\w\._\-]/),$(Z(1))):null:T.eat("?")?(T.eatWhile(/[\w\._\-]/),V.tokenize=J("meta","?>"),"meta"):(z=T.eat("/")?"closeTag":"openTag",V.tokenize=K,"tag bracket");if(ge=="&"){var Me;return T.eat("#")?T.eat("x")?Me=T.eatWhile(/[a-fA-F\d]/)&&T.eat(";"):Me=T.eatWhile(/[\d]/)&&T.eat(";"):Me=T.eatWhile(/[\w\.\-:]/)&&T.eat(";"),Me?"atom":"error"}else return T.eatWhile(/[^&<]/),null}j.isInText=!0;function K(T,V){var $=T.next();if($==">"||$=="/"&&T.eat(">"))return V.tokenize=j,z=$==">"?"endTag":"selfcloseTag","tag bracket";if($=="=")return z="equals",null;if($=="<"){V.tokenize=j,V.state=te,V.tagName=V.tagStart=null;var ge=V.tokenize(T,V);return ge?ge+" tag error":"tag error"}else return/[\'\"]/.test($)?(V.tokenize=ne($),V.stringStartCol=T.column(),V.tokenize(T,V)):(T.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function ne(T){var V=function($,ge){for(;!$.eol();)if($.next()==T){ge.tokenize=K;break}return"string"};return V.isInAttribute=!0,V}function J(T,V){return function($,ge){for(;!$.eol();){if($.match(V)){ge.tokenize=j;break}$.next()}return T}}function Z(T){return function(V,$){for(var ge;(ge=V.next())!=null;){if(ge=="<")return $.tokenize=Z(T+1),$.tokenize(V,$);if(ge==">")if(T==1){$.tokenize=j;break}else return $.tokenize=Z(T-1),$.tokenize(V,$)}return"meta"}}function H(T){return T&&T.toLowerCase()}function R(T,V,$){this.prev=T.context,this.tagName=V||"",this.indent=T.indented,this.startOfLine=$,(y.doNotIndent.hasOwnProperty(V)||T.context&&T.context.noIndent)&&(this.noIndent=!0)}function U(T){T.context&&(T.context=T.context.prev)}function G(T,V){for(var $;;){if(!T.context||($=T.context.tagName,!y.contextGrabbers.hasOwnProperty(H($))||!y.contextGrabbers[H($)].hasOwnProperty(H(V))))return;U(T)}}function te(T,V,$){return T=="openTag"?($.tagStart=V.column(),Y):T=="closeTag"?oe:te}function Y(T,V,$){return T=="word"?($.tagName=V.current(),N="tag",re):y.allowMissingTagName&&T=="endTag"?(N="tag bracket",re(T,V,$)):(N="error",Y)}function oe(T,V,$){if(T=="word"){var ge=V.current();return $.context&&$.context.tagName!=ge&&y.implicitlyClosed.hasOwnProperty(H($.context.tagName))&&U($),$.context&&$.context.tagName==ge||y.matchClosing===!1?(N="tag",pe):(N="tag error",qe)}else return y.allowMissingTagName&&T=="endTag"?(N="tag bracket",pe(T,V,$)):(N="error",qe)}function pe(T,V,$){return T!="endTag"?(N="error",pe):(U($),te)}function qe(T,V,$){return N="error",pe(T,V,$)}function re(T,V,$){if(T=="word")return N="attribute",Ae;if(T=="endTag"||T=="selfcloseTag"){var ge=$.tagName,Me=$.tagStart;return $.tagName=$.tagStart=null,T=="selfcloseTag"||y.autoSelfClosers.hasOwnProperty(H(ge))?G($,ge):(G($,ge),$.context=new R($,ge,Me==$.indented)),te}return N="error",re}function Ae(T,V,$){return T=="equals"?Ee:(y.allowMissing||(N="error"),re(T,V,$))}function Ee(T,V,$){return T=="string"?De:T=="word"&&y.allowUnquoted?(N="string",re):(N="error",re(T,V,$))}function De(T,V,$){return T=="string"?De:re(T,V,$)}return{startState:function(T){var V={tokenize:j,state:te,indented:T||0,tagName:null,tagStart:null,context:null};return T!=null&&(V.baseIndent=T),V},token:function(T,V){if(!V.tagName&&T.sol()&&(V.indented=T.indentation()),T.eatSpace())return null;z=null;var $=V.tokenize(T,V);return($||z)&&$!="comment"&&(N=null,V.state=V.state(z||$,T,V),N&&($=N=="error"?$+" error":N)),$},indent:function(T,V,$){var ge=T.context;if(T.tokenize.isInAttribute)return T.tagStart==T.indented?T.stringStartCol+1:T.indented+x;if(ge&&ge.noIndent)return c.Pass;if(T.tokenize!=K&&T.tokenize!=j)return $?$.match(/^(\s*)/)[0].length:0;if(T.tagName)return y.multilineTagIndentPastTag!==!1?T.tagStart+T.tagName.length+2:T.tagStart+x*(y.multilineTagIndentFactor||1);if(y.alignCDATA&&/<!\[CDATA\[/.test(V))return 0;var Me=V&&/^<(\/)?([\w_:\.-]*)/.exec(V);if(Me&&Me[1])for(;ge;)if(ge.tagName==Me[2]){ge=ge.prev;break}else if(y.implicitlyClosed.hasOwnProperty(H(ge.tagName)))ge=ge.prev;else break;else if(Me)for(;ge;){var et=y.contextGrabbers[H(ge.tagName)];if(et&&et.hasOwnProperty(H(Me[2])))ge=ge.prev;else break}for(;ge&&ge.prev&&!ge.startOfLine;)ge=ge.prev;return ge?ge.indent+x:T.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:y.htmlMode?"html":"xml",helperType:y.htmlMode?"html":"xml",skipAttribute:function(T){T.state==Ee&&(T.state=re)},xmlCurrentTag:function(T){return T.tagName?{name:T.tagName,close:T.type=="closeTag"}:null},xmlCurrentContext:function(T){for(var V=[],$=T.context;$;$=$.prev)V.push($.tagName);return V.reverse()}}}),c.defineMIME("text/xml","xml"),c.defineMIME("application/xml","xml"),c.mimeModes.hasOwnProperty("text/html")||c.defineMIME("text/html",{name:"xml",htmlMode:!0})})})();var Bf=Tf.exports,Yo={exports:{}},Zo;function Mf(){return Zo||(Zo=1,function(s,b){(function(c){c(Tt)})(function(c){c.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 m=0;m<c.modeInfo.length;m++){var g=c.modeInfo[m];g.mimes&&(g.mime=g.mimes[0])}c.findModeByMIME=function(C){C=C.toLowerCase();for(var v=0;v<c.modeInfo.length;v++){var x=c.modeInfo[v];if(x.mime==C)return x;if(x.mimes){for(var y=0;y<x.mimes.length;y++)if(x.mimes[y]==C)return x}}if(/\+xml$/.test(C))return c.findModeByMIME("application/xml");if(/\+json$/.test(C))return c.findModeByMIME("application/json")},c.findModeByExtension=function(C){C=C.toLowerCase();for(var v=0;v<c.modeInfo.length;v++){var x=c.modeInfo[v];if(x.ext){for(var y=0;y<x.ext.length;y++)if(x.ext[y]==C)return x}}},c.findModeByFileName=function(C){for(var v=0;v<c.modeInfo.length;v++){var x=c.modeInfo[v];if(x.file&&x.file.test(C))return x}var y=C.lastIndexOf("."),A=y>-1&&C.substring(y+1,C.length);if(A)return c.findModeByExtension(A)},c.findModeByName=function(C){C=C.toLowerCase();for(var v=0;v<c.modeInfo.length;v++){var x=c.modeInfo[v];if(x.name.toLowerCase()==C)return x;if(x.alias){for(var y=0;y<x.alias.length;y++)if(x.alias[y].toLowerCase()==C)return x}}}})}()),Yo.exports}(function(s,b){(function(c){c(Tt,Bf,Mf())})(function(c){c.defineMode("markdown",function(m,g){var C=c.getMode(m,"text/html"),v=C.name=="null";function x(S){if(c.findModeByName){var d=c.findModeByName(S);d&&(S=d.mime||d.mimes[0])}var q=c.getMode(m,S);return q.name=="null"?null:q}g.highlightFormatting===void 0&&(g.highlightFormatting=!1),g.maxBlockquoteDepth===void 0&&(g.maxBlockquoteDepth=0),g.taskLists===void 0&&(g.taskLists=!1),g.strikethrough===void 0&&(g.strikethrough=!1),g.emoji===void 0&&(g.emoji=!1),g.fencedCodeBlockHighlighting===void 0&&(g.fencedCodeBlockHighlighting=!0),g.fencedCodeBlockDefaultMode===void 0&&(g.fencedCodeBlockDefaultMode="text/plain"),g.xml===void 0&&(g.xml=!0),g.tokenTypeOverrides===void 0&&(g.tokenTypeOverrides={});var y={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 A in y)y.hasOwnProperty(A)&&g.tokenTypeOverrides[A]&&(y[A]=g.tokenTypeOverrides[A]);var P=/^([*\-_])(?:\s*\1){2,}\s*$/,z=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,N=/^\[(x| )\](?=\s)/i,j=g.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,K=/^ {0,3}(?:\={1,}|-{2,})\s*$/,ne=/^[^#!\[\]*_\\<>` "'(~:]+/,J=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,Z=/^\s*\[[^\]]+?\]:.*$/,H=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,R="    ";function U(S,d,q){return d.f=d.inline=q,q(S,d)}function G(S,d,q){return d.f=d.block=q,q(S,d)}function te(S){return!S||!/\S/.test(S.string)}function Y(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==pe){var d=v;if(!d){var q=c.innerMode(C,S.htmlState);d=q.mode.name=="xml"&&q.state.tagStart===null&&!q.state.context&&q.state.tokenize.isInText}d&&(S.f=Ee,S.block=oe,S.htmlState=null)}return S.trailingSpace=0,S.trailingSpaceNewLine=!1,S.prevLine=S.thisLine,S.thisLine={stream:null},null}function oe(S,d){var q=S.column()===d.indentation,Ne=te(d.prevLine.stream),Fe=d.indentedCode,Qe=d.prevLine.hr,ht=d.list!==!1,Xe=(d.listStack[d.listStack.length-1]||0)+3;d.indentedCode=!1;var it=d.indentation;if(d.indentationDiff===null&&(d.indentationDiff=d.indentation,ht)){for(d.list=null;it<d.listStack[d.listStack.length-1];)d.listStack.pop(),d.listStack.length?d.indentation=d.listStack[d.listStack.length-1]:d.list=!1;d.list!==!1&&(d.indentationDiff=it-d.listStack[d.listStack.length-1])}var Ie=!Ne&&!Qe&&!d.prevLine.header&&(!ht||!Fe)&&!d.prevLine.fencedCodeEnd,We=(d.list===!1||Qe||Ne)&&d.indentation<=Xe&&S.match(P),Je=null;if(d.indentationDiff>=4&&(Fe||d.prevLine.fencedCodeEnd||d.prevLine.header||Ne))return S.skipToEnd(),d.indentedCode=!0,y.code;if(S.eatSpace())return null;if(q&&d.indentation<=Xe&&(Je=S.match(j))&&Je[1].length<=6)return d.quote=0,d.header=Je[1].length,d.thisLine.header=!0,g.highlightFormatting&&(d.formatting="header"),d.f=d.inline,re(d);if(d.indentation<=Xe&&S.eat(">"))return d.quote=q?1:d.quote+1,g.highlightFormatting&&(d.formatting="quote"),S.eatSpace(),re(d);if(!We&&!d.setext&&q&&d.indentation<=Xe&&(Je=S.match(z))){var dt=Je[1]?"ol":"ul";return d.indentation=it+S.current().length,d.list=!0,d.quote=0,d.listStack.push(d.indentation),d.em=!1,d.strong=!1,d.code=!1,d.strikethrough=!1,g.taskLists&&S.match(N,!1)&&(d.taskList=!0),d.f=d.inline,g.highlightFormatting&&(d.formatting=["list","list-"+dt]),re(d)}else{if(q&&d.indentation<=Xe&&(Je=S.match(J,!0)))return d.quote=0,d.fencedEndRE=new RegExp(Je[1]+"+ *$"),d.localMode=g.fencedCodeBlockHighlighting&&x(Je[2]||g.fencedCodeBlockDefaultMode),d.localMode&&(d.localState=c.startState(d.localMode)),d.f=d.block=qe,g.highlightFormatting&&(d.formatting="code-block"),d.code=-1,re(d);if(d.setext||(!Ie||!ht)&&!d.quote&&d.list===!1&&!d.code&&!We&&!Z.test(S.string)&&(Je=S.lookAhead(1))&&(Je=Je.match(K)))return d.setext?(d.header=d.setext,d.setext=0,S.skipToEnd(),g.highlightFormatting&&(d.formatting="header")):(d.header=Je[0].charAt(0)=="="?1:2,d.setext=d.header),d.thisLine.header=!0,d.f=d.inline,re(d);if(We)return S.skipToEnd(),d.hr=!0,d.thisLine.hr=!0,y.hr;if(S.peek()==="[")return U(S,d,ge)}return U(S,d,d.inline)}function pe(S,d){var q=C.token(S,d.htmlState);if(!v){var Ne=c.innerMode(C,d.htmlState);(Ne.mode.name=="xml"&&Ne.state.tagStart===null&&!Ne.state.context&&Ne.state.tokenize.isInText||d.md_inside&&S.current().indexOf(">")>-1)&&(d.f=Ee,d.block=oe,d.htmlState=null)}return q}function qe(S,d){var q=d.listStack[d.listStack.length-1]||0,Ne=d.indentation<q,Fe=q+3;if(d.fencedEndRE&&d.indentation<=Fe&&(Ne||S.match(d.fencedEndRE))){g.highlightFormatting&&(d.formatting="code-block");var Qe;return Ne||(Qe=re(d)),d.localMode=d.localState=null,d.block=oe,d.f=Ee,d.fencedEndRE=null,d.code=0,d.thisLine.fencedCodeEnd=!0,Ne?G(S,d,d.block):Qe}else return d.localMode?d.localMode.token(S,d.localState):(S.skipToEnd(),y.code)}function re(S){var d=[];if(S.formatting){d.push(y.formatting),typeof S.formatting=="string"&&(S.formatting=[S.formatting]);for(var q=0;q<S.formatting.length;q++)d.push(y.formatting+"-"+S.formatting[q]),S.formatting[q]==="header"&&d.push(y.formatting+"-"+S.formatting[q]+"-"+S.header),S.formatting[q]==="quote"&&(!g.maxBlockquoteDepth||g.maxBlockquoteDepth>=S.quote?d.push(y.formatting+"-"+S.formatting[q]+"-"+S.quote):d.push("error"))}if(S.taskOpen)return d.push("meta"),d.length?d.join(" "):null;if(S.taskClosed)return d.push("property"),d.length?d.join(" "):null;if(S.linkHref?d.push(y.linkHref,"url"):(S.strong&&d.push(y.strong),S.em&&d.push(y.em),S.strikethrough&&d.push(y.strikethrough),S.emoji&&d.push(y.emoji),S.linkText&&d.push(y.linkText),S.code&&d.push(y.code),S.image&&d.push(y.image),S.imageAltText&&d.push(y.imageAltText,"link"),S.imageMarker&&d.push(y.imageMarker)),S.header&&d.push(y.header,y.header+"-"+S.header),S.quote&&(d.push(y.quote),!g.maxBlockquoteDepth||g.maxBlockquoteDepth>=S.quote?d.push(y.quote+"-"+S.quote):d.push(y.quote+"-"+g.maxBlockquoteDepth)),S.list!==!1){var Ne=(S.listStack.length-1)%3;Ne?Ne===1?d.push(y.list2):d.push(y.list3):d.push(y.list1)}return S.trailingSpaceNewLine?d.push("trailing-space-new-line"):S.trailingSpace&&d.push("trailing-space-"+(S.trailingSpace%2?"a":"b")),d.length?d.join(" "):null}function Ae(S,d){if(S.match(ne,!0))return re(d)}function Ee(S,d){var q=d.text(S,d);if(typeof q<"u")return q;if(d.list)return d.list=null,re(d);if(d.taskList){var Ne=S.match(N,!0)[1]===" ";return Ne?d.taskOpen=!0:d.taskClosed=!0,g.highlightFormatting&&(d.formatting="task"),d.taskList=!1,re(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&S.match(/^#+$/,!0))return g.highlightFormatting&&(d.formatting="header"),re(d);var Fe=S.next();if(d.linkTitle){d.linkTitle=!1;var Qe=Fe;Fe==="("&&(Qe=")"),Qe=(Qe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ht="^\\s*(?:[^"+Qe+"\\\\]+|\\\\\\\\|\\\\.)"+Qe;if(S.match(new RegExp(ht),!0))return y.linkHref}if(Fe==="`"){var Xe=d.formatting;g.highlightFormatting&&(d.formatting="code"),S.eatWhile("`");var it=S.current().length;if(d.code==0&&(!d.quote||it==1))return d.code=it,re(d);if(it==d.code){var Ie=re(d);return d.code=0,Ie}else return d.formatting=Xe,re(d)}else if(d.code)return re(d);if(Fe==="\\"&&(S.next(),g.highlightFormatting)){var We=re(d),Je=y.formatting+"-escape";return We?We+" "+Je:Je}if(Fe==="!"&&S.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,g.highlightFormatting&&(d.formatting="image"),re(d);if(Fe==="["&&d.imageMarker&&S.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,g.highlightFormatting&&(d.formatting="image"),re(d);if(Fe==="]"&&d.imageAltText){g.highlightFormatting&&(d.formatting="image");var We=re(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=T,We}if(Fe==="["&&!d.image)return d.linkText&&S.match(/^.*?\]/)||(d.linkText=!0,g.highlightFormatting&&(d.formatting="link")),re(d);if(Fe==="]"&&d.linkText){g.highlightFormatting&&(d.formatting="link");var We=re(d);return d.linkText=!1,d.inline=d.f=S.match(/\(.*?\)| ?\[.*?\]/,!1)?T:Ee,We}if(Fe==="<"&&S.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=De,g.highlightFormatting&&(d.formatting="link");var We=re(d);return We?We+=" ":We="",We+y.linkInline}if(Fe==="<"&&S.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=De,g.highlightFormatting&&(d.formatting="link");var We=re(d);return We?We+=" ":We="",We+y.linkEmail}if(g.xml&&Fe==="<"&&S.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var dt=S.string.indexOf(">",S.pos);if(dt!=-1){var ye=S.string.substring(S.start,dt);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ye)&&(d.md_inside=!0)}return S.backUp(1),d.htmlState=c.startState(C),G(S,d,pe)}if(g.xml&&Fe==="<"&&S.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if(Fe==="*"||Fe==="_"){for(var Bt=1,Mt=S.pos==1?" ":S.string.charAt(S.pos-2);Bt<3&&S.eat(Fe);)Bt++;var At=S.peek()||" ",_t=!/\s/.test(At)&&(!H.test(At)||/\s/.test(Mt)||H.test(Mt)),Be=!/\s/.test(Mt)&&(!H.test(Mt)||/\s/.test(At)||H.test(At)),Et=null,Wt=null;if(Bt%2&&(!d.em&&_t&&(Fe==="*"||!Be||H.test(Mt))?Et=!0:d.em==Fe&&Be&&(Fe==="*"||!_t||H.test(At))&&(Et=!1)),Bt>1&&(!d.strong&&_t&&(Fe==="*"||!Be||H.test(Mt))?Wt=!0:d.strong==Fe&&Be&&(Fe==="*"||!_t||H.test(At))&&(Wt=!1)),Wt!=null||Et!=null){g.highlightFormatting&&(d.formatting=Et==null?"strong":Wt==null?"em":"strong em"),Et===!0&&(d.em=Fe),Wt===!0&&(d.strong=Fe);var Ie=re(d);return Et===!1&&(d.em=!1),Wt===!1&&(d.strong=!1),Ie}}else if(Fe===" "&&(S.eat("*")||S.eat("_"))){if(S.peek()===" ")return re(d);S.backUp(1)}if(g.strikethrough){if(Fe==="~"&&S.eatWhile(Fe)){if(d.strikethrough){g.highlightFormatting&&(d.formatting="strikethrough");var Ie=re(d);return d.strikethrough=!1,Ie}else if(S.match(/^[^\s]/,!1))return d.strikethrough=!0,g.highlightFormatting&&(d.formatting="strikethrough"),re(d)}else if(Fe===" "&&S.match("~~",!0)){if(S.peek()===" ")return re(d);S.backUp(2)}}if(g.emoji&&Fe===":"&&S.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){d.emoji=!0,g.highlightFormatting&&(d.formatting="emoji");var Tr=re(d);return d.emoji=!1,Tr}return Fe===" "&&(S.match(/^ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),re(d)}function De(S,d){var q=S.next();if(q===">"){d.f=d.inline=Ee,g.highlightFormatting&&(d.formatting="link");var Ne=re(d);return Ne?Ne+=" ":Ne="",Ne+y.linkInline}return S.match(/^[^>]+/,!0),y.linkInline}function T(S,d){if(S.eatSpace())return null;var q=S.next();return q==="("||q==="["?(d.f=d.inline=$(q==="("?")":"]"),g.highlightFormatting&&(d.formatting="link-string"),d.linkHref=!0,re(d)):"error"}var V={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function $(S){return function(d,q){var Ne=d.next();if(Ne===S){q.f=q.inline=Ee,g.highlightFormatting&&(q.formatting="link-string");var Fe=re(q);return q.linkHref=!1,Fe}return d.match(V[S]),q.linkHref=!0,re(q)}}function ge(S,d){return S.match(/^([^\]\\]|\\.)*\]:/,!1)?(d.f=Me,S.next(),g.highlightFormatting&&(d.formatting="link"),d.linkText=!0,re(d)):U(S,d,Ee)}function Me(S,d){if(S.match("]:",!0)){d.f=d.inline=et,g.highlightFormatting&&(d.formatting="link");var q=re(d);return d.linkText=!1,q}return S.match(/^([^\]\\]|\\.)+/,!0),y.linkText}function et(S,d){return S.eatSpace()?null:(S.match(/^[^\s]+/,!0),S.peek()===void 0?d.linkTitle=!0:S.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),d.f=d.inline=Ee,y.linkHref+" url")}var zt={startState:function(){return{f:oe,prevLine:{stream:null},thisLine:{stream:null},block:oe,htmlState:null,indentation:0,inline:Ee,text:Ae,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&&c.copyState(C,S.htmlState),indentation:S.indentation,localMode:S.localMode,localState:S.localMode?c.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,d){if(d.formatting=!1,S!=d.thisLine.stream){if(d.header=0,d.hr=!1,S.match(/^\s*$/,!0))return Y(d),null;if(d.prevLine=d.thisLine,d.thisLine={stream:S},d.taskList=!1,d.trailingSpace=0,d.trailingSpaceNewLine=!1,!d.localState&&(d.f=d.block,d.f!=pe)){var q=S.match(/^\s*/,!0)[0].replace(/\t/g,R).length;if(d.indentation=q,d.indentationDiff=null,q>0)return null}}return d.f(S,d)},innerMode:function(S){return S.block==pe?{state:S.htmlState,mode:C}:S.localState?{state:S.localState,mode:S.localMode}:{state:S,mode:zt}},indent:function(S,d,q){return S.block==pe&&C.indent?C.indent(S.htmlState,d,q):S.localState&&S.localMode.indent?S.localMode.indent(S.localState,d,q):c.Pass},blankLine:Y,getType:re,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return zt},"xml"),c.defineMIME("text/markdown","markdown"),c.defineMIME("text/x-markdown","markdown")})})();var Nf=Lf.exports,If={exports:{}};(function(s,b){(function(c){c(Tt)})(function(c){c.overlayMode=function(m,g,C){return{startState:function(){return{base:c.startState(m),overlay:c.startState(g),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(v){return{base:c.copyState(m,v.base),overlay:c.copyState(g,v.overlay),basePos:v.basePos,baseCur:null,overlayPos:v.overlayPos,overlayCur:null}},token:function(v,x){return(v!=x.streamSeen||Math.min(x.basePos,x.overlayPos)<v.start)&&(x.streamSeen=v,x.basePos=x.overlayPos=v.start),v.start==x.basePos&&(x.baseCur=m.token(v,x.base),x.basePos=v.pos),v.start==x.overlayPos&&(v.pos=v.start,x.overlayCur=g.token(v,x.overlay),x.overlayPos=v.pos),v.pos=Math.min(x.basePos,x.overlayPos),x.overlayCur==null?x.baseCur:x.baseCur!=null&&x.overlay.combineTokens||C&&x.overlay.combineTokens==null?x.baseCur+" "+x.overlayCur:x.overlayCur},indent:m.indent&&function(v,x,y){return m.indent(v.base,x,y)},electricChars:m.electricChars,innerMode:function(v){return{state:v.base,mode:m}},blankLine:function(v){var x,y;return m.blankLine&&(x=m.blankLine(v.base)),g.blankLine&&(y=g.blankLine(v.overlay)),y==null?x:C&&x!=null?x+" "+y:y}}}})})();var Of=If.exports;(function(s,b){(function(c){c(Tt)})(function(c){c.defineOption("placeholder","",function(A,P,z){var N=z&&z!=c.Init;if(P&&!N)A.on("blur",v),A.on("change",x),A.on("swapDoc",x),c.on(A.getInputField(),"compositionupdate",A.state.placeholderCompose=function(){C(A)}),x(A);else if(!P&&N){A.off("blur",v),A.off("change",x),A.off("swapDoc",x),c.off(A.getInputField(),"compositionupdate",A.state.placeholderCompose),m(A);var j=A.getWrapperElement();j.className=j.className.replace(" CodeMirror-empty","")}P&&!A.hasFocus()&&v(A)});function m(A){A.state.placeholder&&(A.state.placeholder.parentNode.removeChild(A.state.placeholder),A.state.placeholder=null)}function g(A){m(A);var P=A.state.placeholder=document.createElement("pre");P.style.cssText="height: 0; overflow: visible",P.style.direction=A.getOption("direction"),P.className="CodeMirror-placeholder CodeMirror-line-like";var z=A.getOption("placeholder");typeof z=="string"&&(z=document.createTextNode(z)),P.appendChild(z),A.display.lineSpace.insertBefore(P,A.display.lineSpace.firstChild)}function C(A){setTimeout(function(){var P=!1;if(A.lineCount()==1){var z=A.getInputField();P=z.nodeName=="TEXTAREA"?!A.getLine(0).length:!/[^\u200b]/.test(z.querySelector(".CodeMirror-line").textContent)}P?g(A):m(A)},20)}function v(A){y(A)&&g(A)}function x(A){var P=A.getWrapperElement(),z=y(A);P.className=P.className.replace(" CodeMirror-empty","")+(z?" CodeMirror-empty":""),z?g(A):m(A)}function y(A){return A.lineCount()===1&&A.getLine(0)===""}})})();(function(s,b){(function(c){c(Tt)})(function(c){c.defineOption("autoRefresh",!1,function(C,v){C.state.autoRefresh&&(g(C,C.state.autoRefresh),C.state.autoRefresh=null),v&&C.display.wrapper.offsetHeight==0&&m(C,C.state.autoRefresh={delay:v.delay||250})});function m(C,v){function x(){C.display.wrapper.offsetHeight?(g(C,v),C.display.lastWrapHeight!=C.display.wrapper.clientHeight&&C.refresh()):v.timeout=setTimeout(x,v.delay)}v.timeout=setTimeout(x,v.delay),v.hurry=function(){clearTimeout(v.timeout),v.timeout=setTimeout(x,50)},c.on(window,"mouseup",v.hurry),c.on(window,"keyup",v.hurry)}function g(C,v){clearTimeout(v.timeout),c.off(window,"mouseup",v.hurry),c.off(window,"keyup",v.hurry)}})})();(function(s,b){(function(c){c(Tt)})(function(c){c.defineOption("styleSelectedText",!1,function(N,j,K){var ne=K&&K!=c.Init;j&&!ne?(N.state.markedSelection=[],N.state.markedSelectionStyle=typeof j=="string"?j:"CodeMirror-selectedtext",P(N),N.on("cursorActivity",m),N.on("change",g)):!j&&ne&&(N.off("cursorActivity",m),N.off("change",g),A(N),N.state.markedSelection=N.state.markedSelectionStyle=null)});function m(N){N.state.markedSelection&&N.operation(function(){z(N)})}function g(N){N.state.markedSelection&&N.state.markedSelection.length&&N.operation(function(){A(N)})}var C=8,v=c.Pos,x=c.cmpPos;function y(N,j,K,ne){if(x(j,K)!=0)for(var J=N.state.markedSelection,Z=N.state.markedSelectionStyle,H=j.line;;){var R=H==j.line?j:v(H,0),U=H+C,G=U>=K.line,te=G?K:v(U,0),Y=N.markText(R,te,{className:Z});if(ne==null?J.push(Y):J.splice(ne++,0,Y),G)break;H=U}}function A(N){for(var j=N.state.markedSelection,K=0;K<j.length;++K)j[K].clear();j.length=0}function P(N){A(N);for(var j=N.listSelections(),K=0;K<j.length;K++)y(N,j[K].from(),j[K].to())}function z(N){if(!N.somethingSelected())return A(N);if(N.listSelections().length>1)return P(N);var j=N.getCursor("start"),K=N.getCursor("end"),ne=N.state.markedSelection;if(!ne.length)return y(N,j,K);var J=ne[0].find(),Z=ne[ne.length-1].find();if(!J||!Z||K.line-j.line<=C||x(j,Z.to)>=0||x(K,J.from)<=0)return P(N);for(;x(j,J.from)>0;)ne.shift().clear(),J=ne[0].find();for(x(j,J.from)<0&&(J.to.line-j.line<C?(ne.shift().clear(),y(N,j,J.to,0)):y(N,j,J.from,0));x(K,Z.to)<0;)ne.pop().clear(),Z=ne[ne.length-1].find();x(K,Z.to)>0&&(K.line-Z.from.line<C?(ne.pop().clear(),y(N,Z.from,K)):y(N,Z.to,K))}})})();(function(s,b){(function(c){c(Tt)})(function(c){var m=c.Pos;function g(H){var R=H.flags;return R??(H.ignoreCase?"i":"")+(H.global?"g":"")+(H.multiline?"m":"")}function C(H,R){for(var U=g(H),G=U,te=0;te<R.length;te++)G.indexOf(R.charAt(te))==-1&&(G+=R.charAt(te));return U==G?H:new RegExp(H.source,G)}function v(H){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(H.source)}function x(H,R,U){R=C(R,"g");for(var G=U.line,te=U.ch,Y=H.lastLine();G<=Y;G++,te=0){R.lastIndex=te;var oe=H.getLine(G),pe=R.exec(oe);if(pe)return{from:m(G,pe.index),to:m(G,pe.index+pe[0].length),match:pe}}}function y(H,R,U){if(!v(R))return x(H,R,U);R=C(R,"gm");for(var G,te=1,Y=U.line,oe=H.lastLine();Y<=oe;){for(var pe=0;pe<te&&!(Y>oe);pe++){var qe=H.getLine(Y++);G=G==null?qe:G+`
`+qe}te=te*2,R.lastIndex=U.ch;var re=R.exec(G);if(re){var Ae=G.slice(0,re.index).split(`
`),Ee=re[0].split(`
`),De=U.line+Ae.length-1,T=Ae[Ae.length-1].length;return{from:m(De,T),to:m(De+Ee.length-1,Ee.length==1?T+Ee[0].length:Ee[Ee.length-1].length),match:re}}}}function A(H,R,U){for(var G,te=0;te<=H.length;){R.lastIndex=te;var Y=R.exec(H);if(!Y)break;var oe=Y.index+Y[0].length;if(oe>H.length-U)break;(!G||oe>G.index+G[0].length)&&(G=Y),te=Y.index+1}return G}function P(H,R,U){R=C(R,"g");for(var G=U.line,te=U.ch,Y=H.firstLine();G>=Y;G--,te=-1){var oe=H.getLine(G),pe=A(oe,R,te<0?0:oe.length-te);if(pe)return{from:m(G,pe.index),to:m(G,pe.index+pe[0].length),match:pe}}}function z(H,R,U){if(!v(R))return P(H,R,U);R=C(R,"gm");for(var G,te=1,Y=H.getLine(U.line).length-U.ch,oe=U.line,pe=H.firstLine();oe>=pe;){for(var qe=0;qe<te&&oe>=pe;qe++){var re=H.getLine(oe--);G=G==null?re:re+`
`+G}te*=2;var Ae=A(G,R,Y);if(Ae){var Ee=G.slice(0,Ae.index).split(`
`),De=Ae[0].split(`
`),T=oe+Ee.length,V=Ee[Ee.length-1].length;return{from:m(T,V),to:m(T+De.length-1,De.length==1?V+De[0].length:De[De.length-1].length),match:Ae}}}}var N,j;String.prototype.normalize?(N=function(H){return H.normalize("NFD").toLowerCase()},j=function(H){return H.normalize("NFD")}):(N=function(H){return H.toLowerCase()},j=function(H){return H});function K(H,R,U,G){if(H.length==R.length)return U;for(var te=0,Y=U+Math.max(0,H.length-R.length);;){if(te==Y)return te;var oe=te+Y>>1,pe=G(H.slice(0,oe)).length;if(pe==U)return oe;pe>U?Y=oe:te=oe+1}}function ne(H,R,U,G){if(!R.length)return null;var te=G?N:j,Y=te(R).split(/\r|\n\r?/);e:for(var oe=U.line,pe=U.ch,qe=H.lastLine()+1-Y.length;oe<=qe;oe++,pe=0){var re=H.getLine(oe).slice(pe),Ae=te(re);if(Y.length==1){var Ee=Ae.indexOf(Y[0]);if(Ee==-1)continue e;var U=K(re,Ae,Ee,te)+pe;return{from:m(oe,K(re,Ae,Ee,te)+pe),to:m(oe,K(re,Ae,Ee+Y[0].length,te)+pe)}}else{var De=Ae.length-Y[0].length;if(Ae.slice(De)!=Y[0])continue e;for(var T=1;T<Y.length-1;T++)if(te(H.getLine(oe+T))!=Y[T])continue e;var V=H.getLine(oe+Y.length-1),$=te(V),ge=Y[Y.length-1];if($.slice(0,ge.length)!=ge)continue e;return{from:m(oe,K(re,Ae,De,te)+pe),to:m(oe+Y.length-1,K(V,$,ge.length,te))}}}}function J(H,R,U,G){if(!R.length)return null;var te=G?N:j,Y=te(R).split(/\r|\n\r?/);e:for(var oe=U.line,pe=U.ch,qe=H.firstLine()-1+Y.length;oe>=qe;oe--,pe=-1){var re=H.getLine(oe);pe>-1&&(re=re.slice(0,pe));var Ae=te(re);if(Y.length==1){var Ee=Ae.lastIndexOf(Y[0]);if(Ee==-1)continue e;return{from:m(oe,K(re,Ae,Ee,te)),to:m(oe,K(re,Ae,Ee+Y[0].length,te))}}else{var De=Y[Y.length-1];if(Ae.slice(0,De.length)!=De)continue e;for(var T=1,U=oe-Y.length+1;T<Y.length-1;T++)if(te(H.getLine(U+T))!=Y[T])continue e;var V=H.getLine(oe+1-Y.length),$=te(V);if($.slice($.length-Y[0].length)!=Y[0])continue e;return{from:m(oe+1-Y.length,K(V,$,V.length-Y[0].length,te)),to:m(oe,K(re,Ae,De.length,te))}}}}function Z(H,R,U,G){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=H,U=U?H.clipPos(U):m(0,0),this.pos={from:U,to:U};var te;typeof G=="object"?te=G.caseFold:(te=G,G=null),typeof R=="string"?(te==null&&(te=!1),this.matches=function(Y,oe){return(Y?J:ne)(H,R,oe,te)}):(R=C(R,"gm"),!G||G.multiline!==!1?this.matches=function(Y,oe){return(Y?z:y)(H,R,oe)}:this.matches=function(Y,oe){return(Y?P:x)(H,R,oe)})}Z.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(H){var R=this.doc.clipPos(H?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(R=m(R.line,R.ch),H?(R.ch--,R.ch<0&&(R.line--,R.ch=(this.doc.getLine(R.line)||"").length)):(R.ch++,R.ch>(this.doc.getLine(R.line)||"").length&&(R.ch=0,R.line++)),c.cmpPos(R,this.doc.clipPos(R))!=0))return this.atOccurrence=!1;var U=this.matches(H,R);if(this.afterEmptyMatch=U&&c.cmpPos(U.from,U.to)==0,U)return this.pos=U,this.atOccurrence=!0,this.pos.match||!0;var G=m(H?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:G,to:G},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(H,R){if(this.atOccurrence){var U=c.splitLines(H);this.doc.replaceRange(U,this.pos.from,this.pos.to,R),this.pos.to=m(this.pos.from.line+U.length-1,U[U.length-1].length+(U.length==1?this.pos.from.ch:0))}}},c.defineExtension("getSearchCursor",function(H,R,U){return new Z(this.doc,H,R,U)}),c.defineDocExtension("getSearchCursor",function(H,R,U){return new Z(this,H,R,U)}),c.defineExtension("selectMatches",function(H,R){for(var U=[],G=this.getSearchCursor(H,this.getCursor("from"),R);G.findNext()&&!(c.cmpPos(G.to(),this.getCursor("to"))>0);)U.push({anchor:G.from(),head:G.to()});U.length&&this.setSelections(U,0)})})})();(function(s,b){(function(c){c(Tt,Nf,Of)})(function(c){var m=/^((?:(?: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;c.defineMode("gfm",function(g,C){var v=0;function x(z){return z.code=!1,null}var y={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(z){return{code:z.code,codeBlock:z.codeBlock,ateSpace:z.ateSpace}},token:function(z,N){if(N.combineTokens=null,N.codeBlock)return z.match(/^```+/)?(N.codeBlock=!1,null):(z.skipToEnd(),null);if(z.sol()&&(N.code=!1),z.sol()&&z.match(/^```+/))return z.skipToEnd(),N.codeBlock=!0,null;if(z.peek()==="`"){z.next();var j=z.pos;z.eatWhile("`");var K=1+z.pos-j;return N.code?K===v&&(N.code=!1):(v=K,N.code=!0),null}else if(N.code)return z.next(),null;if(z.eatSpace())return N.ateSpace=!0,null;if((z.sol()||N.ateSpace)&&(N.ateSpace=!1,C.gitHubSpice!==!1)){if(z.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return N.combineTokens=!0,"link";if(z.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return N.combineTokens=!0,"link"}return z.match(m)&&z.string.slice(z.start-2,z.start)!="]("&&(z.start==0||/\W/.test(z.string.charAt(z.start-1)))?(N.combineTokens=!0,"link"):(z.next(),null)},blankLine:x},A={taskLists:!0,strikethrough:!0,emoji:!0};for(var P in C)A[P]=C[P];return A.name="markdown",c.overlayMode(c.getMode(g,A),y)},"markdown"),c.defineMIME("text/x-gfm","gfm")})})();var ru={exports:{}};const Hf={},Rf=Object.freeze(Object.defineProperty({__proto__:null,default:Hf},Symbol.toStringTag,{value:"Module"})),Pf=bf(Rf);(function(s){var b;(function(){b=function(c,m,g,C){C=C||{},this.dictionary=null,this.rules={},this.dictionaryTable={},this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=C.flags||{},this.memoized={},this.loaded=!1;var v=this,x,y,A,P,z;c&&(v.dictionary=c,m&&g?ne():typeof window<"u"&&"chrome"in window&&"extension"in window.chrome&&"getURL"in window.chrome.extension?(C.dictionaryPath?x=C.dictionaryPath:x="typo/dictionaries",m||N(chrome.extension.getURL(x+"/"+c+"/"+c+".aff"),j),g||N(chrome.extension.getURL(x+"/"+c+"/"+c+".dic"),K)):(C.dictionaryPath?x=C.dictionaryPath:typeof __dirname<"u"?x=__dirname+"/dictionaries":x="./dictionaries",m||N(x+"/"+c+"/"+c+".aff",j),g||N(x+"/"+c+"/"+c+".dic",K)));function N(J,Z){var H=v._readFile(J,null,C.asyncLoad);C.asyncLoad?H.then(function(R){Z(R)}):Z(H)}function j(J){m=J,g&&ne()}function K(J){g=J,m&&ne()}function ne(){for(v.rules=v._parseAFF(m),v.compoundRuleCodes={},y=0,P=v.compoundRules.length;y<P;y++){var J=v.compoundRules[y];for(A=0,z=J.length;A<z;A++)v.compoundRuleCodes[J[A]]=[]}"ONLYINCOMPOUND"in v.flags&&(v.compoundRuleCodes[v.flags.ONLYINCOMPOUND]=[]),v.dictionaryTable=v._parseDIC(g);for(y in v.compoundRuleCodes)v.compoundRuleCodes[y].length===0&&delete v.compoundRuleCodes[y];for(y=0,P=v.compoundRules.length;y<P;y++){var Z=v.compoundRules[y],H="";for(A=0,z=Z.length;A<z;A++){var R=Z[A];R in v.compoundRuleCodes?H+="("+v.compoundRuleCodes[R].join("|")+")":H+=R}v.compoundRules[y]=new RegExp(H,"i")}v.loaded=!0,C.asyncLoad&&C.loadedCallback&&C.loadedCallback(v)}return this},b.prototype={load:function(c){for(var m in c)c.hasOwnProperty(m)&&(this[m]=c[m]);return this},_readFile:function(c,m,g){if(m=m||"utf8",typeof XMLHttpRequest<"u"){var C,v=new XMLHttpRequest;return v.open("GET",c,g),g&&(C=new Promise(function(y,A){v.onload=function(){v.status===200?y(v.responseText):A(v.statusText)},v.onerror=function(){A(v.statusText)}})),v.overrideMimeType&&v.overrideMimeType("text/plain; charset="+m),v.send(null),g?C:v.responseText}else if(typeof Ef<"u"){var x=Pf;try{if(x.existsSync(c))return x.readFileSync(c,m);console.log("Path "+c+" does not exist.")}catch(y){return console.log(y),""}}},_parseAFF:function(c){var m={},g,C,v,x,y,A,P,z,N=c.split(/\r?\n/);for(y=0,P=N.length;y<P;y++)if(g=this._removeAffixComments(N[y]),g=g.trim(),!!g){var j=g.split(/\s+/),K=j[0];if(K=="PFX"||K=="SFX"){var ne=j[1],J=j[2];v=parseInt(j[3],10);var Z=[];for(A=y+1,z=y+1+v;A<z;A++){C=N[A],x=C.split(/\s+/);var H=x[2],R=x[3].split("/"),U=R[0];U==="0"&&(U="");var G=this.parseRuleCodes(R[1]),te=x[4],Y={};Y.add=U,G.length>0&&(Y.continuationClasses=G),te!=="."&&(K==="SFX"?Y.match=new RegExp(te+"$"):Y.match=new RegExp("^"+te)),H!="0"&&(K==="SFX"?Y.remove=new RegExp(H+"$"):Y.remove=H),Z.push(Y)}m[ne]={type:K,combineable:J=="Y",entries:Z},y+=v}else if(K==="COMPOUNDRULE"){for(v=parseInt(j[1],10),A=y+1,z=y+1+v;A<z;A++)g=N[A],x=g.split(/\s+/),this.compoundRules.push(x[1]);y+=v}else K==="REP"?(x=g.split(/\s+/),x.length===3&&this.replacementTable.push([x[1],x[2]])):this.flags[K]=j[1]}return m},_removeAffixComments:function(c){return c.match(/^\s*#/,"")?"":c},_parseDIC:function(c){c=this._removeDicComments(c);var m=c.split(/\r?\n/),g={};function C(re,Ae){g.hasOwnProperty(re)||(g[re]=null),Ae.length>0&&(g[re]===null&&(g[re]=[]),g[re].push(Ae))}for(var v=1,x=m.length;v<x;v++){var y=m[v];if(y){var A=y.split("/",2),P=A[0];if(A.length>1){var z=this.parseRuleCodes(A[1]);(!("NEEDAFFIX"in this.flags)||z.indexOf(this.flags.NEEDAFFIX)==-1)&&C(P,z);for(var N=0,j=z.length;N<j;N++){var K=z[N],ne=this.rules[K];if(ne)for(var J=this._applyRule(P,ne),Z=0,H=J.length;Z<H;Z++){var R=J[Z];if(C(R,[]),ne.combineable)for(var U=N+1;U<j;U++){var G=z[U],te=this.rules[G];if(te&&te.combineable&&ne.type!=te.type)for(var Y=this._applyRule(R,te),oe=0,pe=Y.length;oe<pe;oe++){var qe=Y[oe];C(qe,[])}}}K in this.compoundRuleCodes&&this.compoundRuleCodes[K].push(P)}}else C(P.trim(),[])}}return g},_removeDicComments:function(c){return c=c.replace(/^\t.*$/mg,""),c},parseRuleCodes:function(c){if(c)if("FLAG"in this.flags)if(this.flags.FLAG==="long"){for(var m=[],g=0,C=c.length;g<C;g+=2)m.push(c.substr(g,2));return m}else return this.flags.FLAG==="num"?c.split(","):this.flags.FLAG==="UTF-8"?Array.from(c):c.split("");else return c.split("");else return[]},_applyRule:function(c,m){for(var g=m.entries,C=[],v=0,x=g.length;v<x;v++){var y=g[v];if(!y.match||c.match(y.match)){var A=c;if(y.remove&&(A=A.replace(y.remove,"")),m.type==="SFX"?A=A+y.add:A=y.add+A,C.push(A),"continuationClasses"in y)for(var P=0,z=y.continuationClasses.length;P<z;P++){var N=this.rules[y.continuationClasses[P]];N&&(C=C.concat(this._applyRule(A,N)))}}}return C},check:function(c){if(!this.loaded)throw"Dictionary not loaded.";if(!c)return!1;var m=c.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(m))return!0;if(m.toUpperCase()===m){var g=m[0]+m.substring(1).toLowerCase();if(this.hasFlag(g,"KEEPCASE"))return!1;if(this.checkExact(g)||this.checkExact(m.toLowerCase()))return!0}var C=m[0].toLowerCase()+m.substring(1);if(C!==m){if(this.hasFlag(C,"KEEPCASE"))return!1;if(this.checkExact(C))return!0}return!1},checkExact:function(c){if(!this.loaded)throw"Dictionary not loaded.";var m=this.dictionaryTable[c],g,C;if(typeof m>"u"){if("COMPOUNDMIN"in this.flags&&c.length>=this.flags.COMPOUNDMIN){for(g=0,C=this.compoundRules.length;g<C;g++)if(c.match(this.compoundRules[g]))return!0}}else{if(m===null)return!0;if(typeof m=="object"){for(g=0,C=m.length;g<C;g++)if(!this.hasFlag(c,"ONLYINCOMPOUND",m[g]))return!0}}return!1},hasFlag:function(c,m,g){if(!this.loaded)throw"Dictionary not loaded.";return!!(m in this.flags&&(typeof g>"u"&&(g=Array.prototype.concat.apply([],this.dictionaryTable[c])),g&&g.indexOf(this.flags[m])!==-1))},alphabet:"",suggest:function(c,m){if(!this.loaded)throw"Dictionary not loaded.";if(m=m||5,this.memoized.hasOwnProperty(c)){var g=this.memoized[c].limit;if(m<=g||this.memoized[c].suggestions.length<g)return this.memoized[c].suggestions.slice(0,m)}if(this.check(c))return[];for(var C=0,v=this.replacementTable.length;C<v;C++){var x=this.replacementTable[C];if(c.indexOf(x[0])!==-1){var y=c.replace(x[0],x[1]);if(this.check(y))return[y]}}if(!this.alphabet){this.alphabet="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","TRY"in this.flags&&(this.alphabet+=this.flags.TRY),"WORDCHARS"in this.flags&&(this.alphabet+=this.flags.WORDCHARS);var A=this.alphabet.split("");A.sort();for(var P={},C=0;C<A.length;C++)P[A[C]]=!0;this.alphabet="";for(var C in P)this.alphabet+=C}var z=this;function N(K,ne){var J={},Z,H,R,U,G=z.alphabet.length;if(typeof K=="string"){var te=K;K={},K[te]=!0}for(var te in K)for(Z=0,R=te.length+1;Z<R;Z++){var Y=[te.substring(0,Z),te.substring(Z)];if(Y[1]&&(U=Y[0]+Y[1].substring(1),(!ne||z.check(U))&&(U in J?J[U]+=1:J[U]=1)),Y[1].length>1&&Y[1][1]!==Y[1][0]&&(U=Y[0]+Y[1][1]+Y[1][0]+Y[1].substring(2),(!ne||z.check(U))&&(U in J?J[U]+=1:J[U]=1)),Y[1]){var oe=Y[1].substring(0,1).toUpperCase()===Y[1].substring(0,1)?"uppercase":"lowercase";for(H=0;H<G;H++){var pe=z.alphabet[H];oe==="uppercase"&&(pe=pe.toUpperCase()),pe!=Y[1].substring(0,1)&&(U=Y[0]+pe+Y[1].substring(1),(!ne||z.check(U))&&(U in J?J[U]+=1:J[U]=1))}}if(Y[1])for(H=0;H<G;H++){var oe=Y[0].substring(-1).toUpperCase()===Y[0].substring(-1)&&Y[1].substring(0,1).toUpperCase()===Y[1].substring(0,1)?"uppercase":"lowercase",pe=z.alphabet[H];oe==="uppercase"&&(pe=pe.toUpperCase()),U=Y[0]+pe+Y[1],(!ne||z.check(U))&&(U in J?J[U]+=1:J[U]=1)}}return J}function j(K){var ne=N(K),J=N(ne,!0),Z=J;for(var H in ne)z.check(H)&&(H in Z?Z[H]+=ne[H]:Z[H]=ne[H]);var R,U=[];for(R in Z)Z.hasOwnProperty(R)&&U.push([R,Z[R]]);function G(pe,qe){var re=pe[1],Ae=qe[1];return re<Ae?-1:re>Ae?1:qe[0].localeCompare(pe[0])}U.sort(G).reverse();var te=[],Y="lowercase";K.toUpperCase()===K?Y="uppercase":K.substr(0,1).toUpperCase()+K.substr(1).toLowerCase()===K&&(Y="capitalized");var oe=m;for(R=0;R<Math.min(oe,U.length);R++)Y==="uppercase"?U[R][0]=U[R][0].toUpperCase():Y==="capitalized"&&(U[R][0]=U[R][0].substr(0,1).toUpperCase()+U[R][0].substr(1)),!z.hasFlag(U[R][0],"NOSUGGEST")&&te.indexOf(U[R][0])==-1?te.push(U[R][0]):oe++;return te}return this.memoized[c]={suggestions:j(c),limit:m},this.memoized[c].suggestions}}})(),s.exports=b})(ru);var zf=ru.exports,$o=zf;function Ke(s){if(s=s||{},typeof s.codeMirrorInstance!="function"||typeof s.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(){return String.prototype.indexOf.apply(this,arguments)!==-1}),s.codeMirrorInstance.defineMode("spell-checker",function(b){if(!Ke.aff_loading){Ke.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&&(Ke.aff_data=c.responseText,Ke.num_loaded++,Ke.num_loaded==2&&(Ke.typo=new $o("en_US",Ke.aff_data,Ke.dic_data,{platform:"any"})))},c.send(null)}if(!Ke.dic_loading){Ke.dic_loading=!0;var m=new XMLHttpRequest;m.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),m.onload=function(){m.readyState===4&&m.status===200&&(Ke.dic_data=m.responseText,Ke.num_loaded++,Ke.num_loaded==2&&(Ke.typo=new $o("en_US",Ke.aff_data,Ke.dic_data,{platform:"any"})))},m.send(null)}var g='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',C={token:function(x){var y=x.peek(),A="";if(g.includes(y))return x.next(),null;for(;(y=x.peek())!=null&&!g.includes(y);)A+=y,x.next();return Ke.typo&&!Ke.typo.check(A)?"spell-error":null}},v=s.codeMirrorInstance.getMode(b,b.backdrop||"text/plain");return s.codeMirrorInstance.overlayMode(v,C,!0)})}Ke.num_loaded=0;Ke.aff_loading=!1;Ke.dic_loading=!1;Ke.aff_data="";Ke.dic_data="";Ke.typo;var _f=Ke,nu={};(function(s){function b(I,O){for(var B=0;B<O.length;B++){var h=O[B];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(I,y(h.key),h)}}function c(I,O,B){return B&&b(I,B),Object.defineProperty(I,"prototype",{writable:!1}),I}function m(){return m=Object.assign?Object.assign.bind():function(I){for(var O=1;O<arguments.length;O++){var B=arguments[O];for(var h in B)Object.prototype.hasOwnProperty.call(B,h)&&(I[h]=B[h])}return I},m.apply(this,arguments)}function g(I,O){if(I){if(typeof I=="string")return C(I,O);var B=Object.prototype.toString.call(I).slice(8,-1);if(B==="Object"&&I.constructor&&(B=I.constructor.name),B==="Map"||B==="Set")return Array.from(I);if(B==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(B))return C(I,O)}}function C(I,O){(O==null||O>I.length)&&(O=I.length);for(var B=0,h=new Array(O);B<O;B++)h[B]=I[B];return h}function v(I,O){var B=typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(B)return(B=B.call(I)).next.bind(B);if(Array.isArray(I)||(B=g(I))||O){B&&(I=B);var h=0;return function(){return h>=I.length?{done:!0}:{done:!1,value:I[h++]}}}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 x(I,O){if(typeof I!="object"||I===null)return I;var B=I[Symbol.toPrimitive];if(B!==void 0){var h=B.call(I,O);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(I)}function y(I){var O=x(I,"string");return typeof O=="symbol"?O:String(O)}function A(){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}}s.defaults=A();function P(I){s.defaults=I}var z=/[&<>"']/,N=new RegExp(z.source,"g"),j=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,K=new RegExp(j.source,"g"),ne={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},J=function(O){return ne[O]};function Z(I,O){if(O){if(z.test(I))return I.replace(N,J)}else if(j.test(I))return I.replace(K,J);return I}var H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function R(I){return I.replace(H,function(O,B){return B=B.toLowerCase(),B==="colon"?":":B.charAt(0)==="#"?B.charAt(1)==="x"?String.fromCharCode(parseInt(B.substring(2),16)):String.fromCharCode(+B.substring(1)):""})}var U=/(^|[^\[])\^/g;function G(I,O){I=typeof I=="string"?I:I.source,O=O||"";var B={replace:function(p,F){return F=F.source||F,F=F.replace(U,"$1"),I=I.replace(p,F),B},getRegex:function(){return new RegExp(I,O)}};return B}var te=/[^\w:]/g,Y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function oe(I,O,B){if(I){var h;try{h=decodeURIComponent(R(B)).replace(te,"").toLowerCase()}catch{return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}O&&!Y.test(B)&&(B=Ee(O,B));try{B=encodeURI(B).replace(/%25/g,"%")}catch{return null}return B}var pe={},qe=/^[^:]+:\/*[^/]*$/,re=/^([^:]+:)[\s\S]*$/,Ae=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Ee(I,O){pe[" "+I]||(qe.test(I)?pe[" "+I]=I+"/":pe[" "+I]=V(I,"/",!0)),I=pe[" "+I];var B=I.indexOf(":")===-1;return O.substring(0,2)==="//"?B?O:I.replace(re,"$1")+O:O.charAt(0)==="/"?B?O:I.replace(Ae,"$1")+O:I+O}var De={exec:function(){}};function T(I,O){var B=I.replace(/\|/g,function(F,w,E){for(var ie=!1,de=w;--de>=0&&E[de]==="\\";)ie=!ie;return ie?"|":" |"}),h=B.split(/ \|/),p=0;if(h[0].trim()||h.shift(),h.length>0&&!h[h.length-1].trim()&&h.pop(),h.length>O)h.splice(O);else for(;h.length<O;)h.push("");for(;p<h.length;p++)h[p]=h[p].trim().replace(/\\\|/g,"|");return h}function V(I,O,B){var h=I.length;if(h===0)return"";for(var p=0;p<h;){var F=I.charAt(h-p-1);if(F===O&&!B)p++;else if(F!==O&&B)p++;else break}return I.slice(0,h-p)}function $(I,O){if(I.indexOf(O[1])===-1)return-1;for(var B=I.length,h=0,p=0;p<B;p++)if(I[p]==="\\")p++;else if(I[p]===O[0])h++;else if(I[p]===O[1]&&(h--,h<0))return p;return-1}function ge(I){I&&I.sanitize&&!I.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Me(I,O){if(O<1)return"";for(var B="";O>1;)O&1&&(B+=I),O>>=1,I+=I;return B+I}function et(I,O,B,h){var p=O.href,F=O.title?Z(O.title):null,w=I[1].replace(/\\([\[\]])/g,"$1");if(I[0].charAt(0)!=="!"){h.state.inLink=!0;var E={type:"link",raw:B,href:p,title:F,text:w,tokens:h.inlineTokens(w)};return h.state.inLink=!1,E}return{type:"image",raw:B,href:p,title:F,text:Z(w)}}function zt(I,O){var B=I.match(/^(\s+)(?:```)/);if(B===null)return O;var h=B[1];return O.split(`
`).map(function(p){var F=p.match(/^\s+/);if(F===null)return p;var w=F[0];return w.length>=h.length?p.slice(h.length):p}).join(`
`)}var S=function(){function I(B){this.options=B||s.defaults}var O=I.prototype;return O.space=function(h){var p=this.rules.block.newline.exec(h);if(p&&p[0].length>0)return{type:"space",raw:p[0]}},O.code=function(h){var p=this.rules.block.code.exec(h);if(p){var F=p[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:p[0],codeBlockStyle:"indented",text:this.options.pedantic?F:V(F,`
`)}}},O.fences=function(h){var p=this.rules.block.fences.exec(h);if(p){var F=p[0],w=zt(F,p[3]||"");return{type:"code",raw:F,lang:p[2]?p[2].trim().replace(this.rules.inline._escapes,"$1"):p[2],text:w}}},O.heading=function(h){var p=this.rules.block.heading.exec(h);if(p){var F=p[2].trim();if(/#$/.test(F)){var w=V(F,"#");(this.options.pedantic||!w||/ $/.test(w))&&(F=w.trim())}return{type:"heading",raw:p[0],depth:p[1].length,text:F,tokens:this.lexer.inline(F)}}},O.hr=function(h){var p=this.rules.block.hr.exec(h);if(p)return{type:"hr",raw:p[0]}},O.blockquote=function(h){var p=this.rules.block.blockquote.exec(h);if(p){var F=p[0].replace(/^ *>[ \t]?/gm,""),w=this.lexer.state.top;this.lexer.state.top=!0;var E=this.lexer.blockTokens(F);return this.lexer.state.top=w,{type:"blockquote",raw:p[0],tokens:E,text:F}}},O.list=function(h){var p=this.rules.block.list.exec(h);if(p){var F,w,E,ie,de,fe,ve,ke,ue,Ce,W,Pe,Oe=p[1].trim(),He=Oe.length>1,Le={type:"list",raw:"",ordered:He,start:He?+Oe.slice(0,-1):"",loose:!1,items:[]};Oe=He?"\\d{1,9}\\"+Oe.slice(-1):"\\"+Oe,this.options.pedantic&&(Oe=He?Oe:"[*+-]");for(var at=new RegExp("^( {0,3}"+Oe+")((?:[	 ][^\\n]*)?(?:\\n|$))");h&&(Pe=!1,!(!(p=at.exec(h))||this.rules.block.hr.test(h)));){if(F=p[0],h=h.substring(F.length),ke=p[2].split(`
`,1)[0].replace(/^\t+/,function(rr){return" ".repeat(3*rr.length)}),ue=h.split(`
`,1)[0],this.options.pedantic?(ie=2,W=ke.trimLeft()):(ie=p[2].search(/[^ ]/),ie=ie>4?1:ie,W=ke.slice(ie),ie+=p[1].length),fe=!1,!ke&&/^ *$/.test(ue)&&(F+=ue+`
`,h=h.substring(ue.length+1),Pe=!0),!Pe)for(var pt=new RegExp("^ {0,"+Math.min(3,ie-1)+"}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))"),Nt=new RegExp("^ {0,"+Math.min(3,ie-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),Ye=new RegExp("^ {0,"+Math.min(3,ie-1)+"}(?:```|~~~)"),Xt=new RegExp("^ {0,"+Math.min(3,ie-1)+"}#");h&&(Ce=h.split(`
`,1)[0],ue=Ce,this.options.pedantic&&(ue=ue.replace(/^ {1,4}(?=( {4})*[^ ])/g,"  ")),!(Ye.test(ue)||Xt.test(ue)||pt.test(ue)||Nt.test(h)));){if(ue.search(/[^ ]/)>=ie||!ue.trim())W+=`
`+ue.slice(ie);else{if(fe||ke.search(/[^ ]/)>=4||Ye.test(ke)||Xt.test(ke)||Nt.test(ke))break;W+=`
`+ue}!fe&&!ue.trim()&&(fe=!0),F+=Ce+`
`,h=h.substring(Ce.length+1),ke=ue.slice(ie)}Le.loose||(ve?Le.loose=!0:/\n *\n *$/.test(F)&&(ve=!0)),this.options.gfm&&(w=/^\[[ xX]\] /.exec(W),w&&(E=w[0]!=="[ ] ",W=W.replace(/^\[[ xX]\] +/,""))),Le.items.push({type:"list_item",raw:F,task:!!w,checked:E,loose:!1,text:W}),Le.raw+=F}Le.items[Le.items.length-1].raw=F.trimRight(),Le.items[Le.items.length-1].text=W.trimRight(),Le.raw=Le.raw.trimRight();var Yt=Le.items.length;for(de=0;de<Yt;de++)if(this.lexer.state.top=!1,Le.items[de].tokens=this.lexer.blockTokens(Le.items[de].text,[]),!Le.loose){var It=Le.items[de].tokens.filter(function(rr){return rr.type==="space"}),en=It.length>0&&It.some(function(rr){return/\n.*\n/.test(rr.raw)});Le.loose=en}if(Le.loose)for(de=0;de<Yt;de++)Le.items[de].loose=!0;return Le}},O.html=function(h){var p=this.rules.block.html.exec(h);if(p){var F={type:"html",raw:p[0],pre:!this.options.sanitizer&&(p[1]==="pre"||p[1]==="script"||p[1]==="style"),text:p[0]};if(this.options.sanitize){var w=this.options.sanitizer?this.options.sanitizer(p[0]):Z(p[0]);F.type="paragraph",F.text=w,F.tokens=this.lexer.inline(w)}return F}},O.def=function(h){var p=this.rules.block.def.exec(h);if(p){var F=p[1].toLowerCase().replace(/\s+/g," "),w=p[2]?p[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",E=p[3]?p[3].substring(1,p[3].length-1).replace(this.rules.inline._escapes,"$1"):p[3];return{type:"def",tag:F,raw:p[0],href:w,title:E}}},O.table=function(h){var p=this.rules.block.table.exec(h);if(p){var F={type:"table",header:T(p[1]).map(function(ve){return{text:ve}}),align:p[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:p[3]&&p[3].trim()?p[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(F.header.length===F.align.length){F.raw=p[0];var w=F.align.length,E,ie,de,fe;for(E=0;E<w;E++)/^ *-+: *$/.test(F.align[E])?F.align[E]="right":/^ *:-+: *$/.test(F.align[E])?F.align[E]="center":/^ *:-+ *$/.test(F.align[E])?F.align[E]="left":F.align[E]=null;for(w=F.rows.length,E=0;E<w;E++)F.rows[E]=T(F.rows[E],F.header.length).map(function(ve){return{text:ve}});for(w=F.header.length,ie=0;ie<w;ie++)F.header[ie].tokens=this.lexer.inline(F.header[ie].text);for(w=F.rows.length,ie=0;ie<w;ie++)for(fe=F.rows[ie],de=0;de<fe.length;de++)fe[de].tokens=this.lexer.inline(fe[de].text);return F}}},O.lheading=function(h){var p=this.rules.block.lheading.exec(h);if(p)return{type:"heading",raw:p[0],depth:p[2].charAt(0)==="="?1:2,text:p[1],tokens:this.lexer.inline(p[1])}},O.paragraph=function(h){var p=this.rules.block.paragraph.exec(h);if(p){var F=p[1].charAt(p[1].length-1)===`
`?p[1].slice(0,-1):p[1];return{type:"paragraph",raw:p[0],text:F,tokens:this.lexer.inline(F)}}},O.text=function(h){var p=this.rules.block.text.exec(h);if(p)return{type:"text",raw:p[0],text:p[0],tokens:this.lexer.inline(p[0])}},O.escape=function(h){var p=this.rules.inline.escape.exec(h);if(p)return{type:"escape",raw:p[0],text:Z(p[1])}},O.tag=function(h){var p=this.rules.inline.tag.exec(h);if(p)return!this.lexer.state.inLink&&/^<a /i.test(p[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(p[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(p[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(p[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:p[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(p[0]):Z(p[0]):p[0]}},O.link=function(h){var p=this.rules.inline.link.exec(h);if(p){var F=p[2].trim();if(!this.options.pedantic&&/^</.test(F)){if(!/>$/.test(F))return;var w=V(F.slice(0,-1),"\\");if((F.length-w.length)%2===0)return}else{var E=$(p[2],"()");if(E>-1){var ie=p[0].indexOf("!")===0?5:4,de=ie+p[1].length+E;p[2]=p[2].substring(0,E),p[0]=p[0].substring(0,de).trim(),p[3]=""}}var fe=p[2],ve="";if(this.options.pedantic){var ke=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(fe);ke&&(fe=ke[1],ve=ke[3])}else ve=p[3]?p[3].slice(1,-1):"";return fe=fe.trim(),/^</.test(fe)&&(this.options.pedantic&&!/>$/.test(F)?fe=fe.slice(1):fe=fe.slice(1,-1)),et(p,{href:fe&&fe.replace(this.rules.inline._escapes,"$1"),title:ve&&ve.replace(this.rules.inline._escapes,"$1")},p[0],this.lexer)}},O.reflink=function(h,p){var F;if((F=this.rules.inline.reflink.exec(h))||(F=this.rules.inline.nolink.exec(h))){var w=(F[2]||F[1]).replace(/\s+/g," ");if(w=p[w.toLowerCase()],!w){var E=F[0].charAt(0);return{type:"text",raw:E,text:E}}return et(F,w,F[0],this.lexer)}},O.emStrong=function(h,p,F){F===void 0&&(F="");var w=this.rules.inline.emStrong.lDelim.exec(h);if(w&&!(w[3]&&F.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 E=w[1]||w[2]||"";if(!E||E&&(F===""||this.rules.inline.punctuation.exec(F))){var ie=w[0].length-1,de,fe,ve=ie,ke=0,ue=w[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(ue.lastIndex=0,p=p.slice(-1*h.length+ie);(w=ue.exec(p))!=null;)if(de=w[1]||w[2]||w[3]||w[4]||w[5]||w[6],!!de){if(fe=de.length,w[3]||w[4]){ve+=fe;continue}else if((w[5]||w[6])&&ie%3&&!((ie+fe)%3)){ke+=fe;continue}if(ve-=fe,!(ve>0)){fe=Math.min(fe,fe+ve+ke);var Ce=h.slice(0,ie+w.index+(w[0].length-de.length)+fe);if(Math.min(ie,fe)%2){var W=Ce.slice(1,-1);return{type:"em",raw:Ce,text:W,tokens:this.lexer.inlineTokens(W)}}var Pe=Ce.slice(2,-2);return{type:"strong",raw:Ce,text:Pe,tokens:this.lexer.inlineTokens(Pe)}}}}}},O.codespan=function(h){var p=this.rules.inline.code.exec(h);if(p){var F=p[2].replace(/\n/g," "),w=/[^ ]/.test(F),E=/^ /.test(F)&&/ $/.test(F);return w&&E&&(F=F.substring(1,F.length-1)),F=Z(F,!0),{type:"codespan",raw:p[0],text:F}}},O.br=function(h){var p=this.rules.inline.br.exec(h);if(p)return{type:"br",raw:p[0]}},O.del=function(h){var p=this.rules.inline.del.exec(h);if(p)return{type:"del",raw:p[0],text:p[2],tokens:this.lexer.inlineTokens(p[2])}},O.autolink=function(h,p){var F=this.rules.inline.autolink.exec(h);if(F){var w,E;return F[2]==="@"?(w=Z(this.options.mangle?p(F[1]):F[1]),E="mailto:"+w):(w=Z(F[1]),E=w),{type:"link",raw:F[0],text:w,href:E,tokens:[{type:"text",raw:w,text:w}]}}},O.url=function(h,p){var F;if(F=this.rules.inline.url.exec(h)){var w,E;if(F[2]==="@")w=Z(this.options.mangle?p(F[0]):F[0]),E="mailto:"+w;else{var ie;do ie=F[0],F[0]=this.rules.inline._backpedal.exec(F[0])[0];while(ie!==F[0]);w=Z(F[0]),F[1]==="www."?E="http://"+F[0]:E=F[0]}return{type:"link",raw:F[0],text:w,href:E,tokens:[{type:"text",raw:w,text:w}]}}},O.inlineText=function(h,p){var F=this.rules.inline.text.exec(h);if(F){var w;return this.lexer.state.inRawBlock?w=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(F[0]):Z(F[0]):F[0]:w=Z(this.options.smartypants?p(F[0]):F[0]),{type:"text",raw:F[0],text:w}}},I}(),d={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]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:De,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};d._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,d._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,d.def=G(d.def).replace("label",d._label).replace("title",d._title).getRegex(),d.bullet=/(?:[*+-]|\d{1,9}[.)])/,d.listItemStart=G(/^( *)(bull) */).replace("bull",d.bullet).getRegex(),d.list=G(d.list).replace(/bull/g,d.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+d.def.source+")").getRegex(),d._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",d._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,d.html=G(d.html,"i").replace("comment",d._comment).replace("tag",d._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),d.paragraph=G(d._paragraph).replace("hr",d.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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",d._tag).getRegex(),d.blockquote=G(d.blockquote).replace("paragraph",d.paragraph).getRegex(),d.normal=m({},d),d.gfm=m({},d.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),d.gfm.table=G(d.gfm.table).replace("hr",d.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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",d._tag).getRegex(),d.gfm.paragraph=G(d._paragraph).replace("hr",d.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",d.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",d._tag).getRegex(),d.pedantic=m({},d.normal,{html:G(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",d._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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:De,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:G(d.normal._paragraph).replace("hr",d.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",d.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:De,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\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:De,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};q._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",q.punctuation=G(q.punctuation).replace(/punctuation/g,q._punctuation).getRegex(),q.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,q.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,q._comment=G(d._comment).replace("(?:-->|$)","-->").getRegex(),q.emStrong.lDelim=G(q.emStrong.lDelim).replace(/punct/g,q._punctuation).getRegex(),q.emStrong.rDelimAst=G(q.emStrong.rDelimAst,"g").replace(/punct/g,q._punctuation).getRegex(),q.emStrong.rDelimUnd=G(q.emStrong.rDelimUnd,"g").replace(/punct/g,q._punctuation).getRegex(),q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,q._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])?)+(?![-_])/,q.autolink=G(q.autolink).replace("scheme",q._scheme).replace("email",q._email).getRegex(),q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,q.tag=G(q.tag).replace("comment",q._comment).replace("attribute",q._attribute).getRegex(),q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,q.link=G(q.link).replace("label",q._label).replace("href",q._href).replace("title",q._title).getRegex(),q.reflink=G(q.reflink).replace("label",q._label).replace("ref",d._label).getRegex(),q.nolink=G(q.nolink).replace("ref",d._label).getRegex(),q.reflinkSearch=G(q.reflinkSearch,"g").replace("reflink",q.reflink).replace("nolink",q.nolink).getRegex(),q.normal=m({},q),q.pedantic=m({},q.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:G(/^!?\[(label)\]\((.*?)\)/).replace("label",q._label).getRegex(),reflink:G(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q._label).getRegex()}),q.gfm=m({},q.normal,{escape:G(q.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]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),q.gfm.url=G(q.gfm.url,"i").replace("email",q.gfm._extended_email).getRegex(),q.breaks=m({},q.gfm,{br:G(q.br).replace("{2,}","*").getRegex(),text:G(q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});function Ne(I){return I.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Fe(I){var O="",B,h,p=I.length;for(B=0;B<p;B++)h=I.charCodeAt(B),Math.random()>.5&&(h="x"+h.toString(16)),O+="&#"+h+";";return O}var Qe=function(){function I(B){this.tokens=[],this.tokens.links=Object.create(null),this.options=B||s.defaults,this.options.tokenizer=this.options.tokenizer||new S,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 h={block:d.normal,inline:q.normal};this.options.pedantic?(h.block=d.pedantic,h.inline=q.pedantic):this.options.gfm&&(h.block=d.gfm,this.options.breaks?h.inline=q.breaks:h.inline=q.gfm),this.tokenizer.rules=h}I.lex=function(h,p){var F=new I(p);return F.lex(h)},I.lexInline=function(h,p){var F=new I(p);return F.inlineTokens(h)};var O=I.prototype;return O.lex=function(h){h=h.replace(/\r\n|\r/g,`
`),this.blockTokens(h,this.tokens);for(var p;p=this.inlineQueue.shift();)this.inlineTokens(p.src,p.tokens);return this.tokens},O.blockTokens=function(h,p){var F=this;p===void 0&&(p=[]),this.options.pedantic?h=h.replace(/\t/g,"    ").replace(/^ +$/gm,""):h=h.replace(/^( *)(\t+)/gm,function(ve,ke,ue){return ke+"    ".repeat(ue.length)});for(var w,E,ie,de;h;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(ve){return(w=ve.call({lexer:F},h,p))?(h=h.substring(w.raw.length),p.push(w),!0):!1}))){if(w=this.tokenizer.space(h)){h=h.substring(w.raw.length),w.raw.length===1&&p.length>0?p[p.length-1].raw+=`
`:p.push(w);continue}if(w=this.tokenizer.code(h)){h=h.substring(w.raw.length),E=p[p.length-1],E&&(E.type==="paragraph"||E.type==="text")?(E.raw+=`
`+w.raw,E.text+=`
`+w.text,this.inlineQueue[this.inlineQueue.length-1].src=E.text):p.push(w);continue}if(w=this.tokenizer.fences(h)){h=h.substring(w.raw.length),p.push(w);continue}if(w=this.tokenizer.heading(h)){h=h.substring(w.raw.length),p.push(w);continue}if(w=this.tokenizer.hr(h)){h=h.substring(w.raw.length),p.push(w);continue}if(w=this.tokenizer.blockquote(h)){h=h.substring(w.raw.length),p.push(w);continue}if(w=this.tokenizer.list(h)){h=h.substring(w.raw.length),p.push(w);continue}if(w=this.tokenizer.html(h)){h=h.substring(w.raw.length),p.push(w);continue}if(w=this.tokenizer.def(h)){h=h.substring(w.raw.length),E=p[p.length-1],E&&(E.type==="paragraph"||E.type==="text")?(E.raw+=`
`+w.raw,E.text+=`
`+w.raw,this.inlineQueue[this.inlineQueue.length-1].src=E.text):this.tokens.links[w.tag]||(this.tokens.links[w.tag]={href:w.href,title:w.title});continue}if(w=this.tokenizer.table(h)){h=h.substring(w.raw.length),p.push(w);continue}if(w=this.tokenizer.lheading(h)){h=h.substring(w.raw.length),p.push(w);continue}if(ie=h,this.options.extensions&&this.options.extensions.startBlock&&function(){var ve=1/0,ke=h.slice(1),ue=void 0;F.options.extensions.startBlock.forEach(function(Ce){ue=Ce.call({lexer:this},ke),typeof ue=="number"&&ue>=0&&(ve=Math.min(ve,ue))}),ve<1/0&&ve>=0&&(ie=h.substring(0,ve+1))}(),this.state.top&&(w=this.tokenizer.paragraph(ie))){E=p[p.length-1],de&&E.type==="paragraph"?(E.raw+=`
`+w.raw,E.text+=`
`+w.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=E.text):p.push(w),de=ie.length!==h.length,h=h.substring(w.raw.length);continue}if(w=this.tokenizer.text(h)){h=h.substring(w.raw.length),E=p[p.length-1],E&&E.type==="text"?(E.raw+=`
`+w.raw,E.text+=`
`+w.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=E.text):p.push(w);continue}if(h){var fe="Infinite loop on byte: "+h.charCodeAt(0);if(this.options.silent){console.error(fe);break}else throw new Error(fe)}}return this.state.top=!0,p},O.inline=function(h,p){return p===void 0&&(p=[]),this.inlineQueue.push({src:h,tokens:p}),p},O.inlineTokens=function(h,p){var F=this;p===void 0&&(p=[]);var w,E,ie,de=h,fe,ve,ke;if(this.tokens.links){var ue=Object.keys(this.tokens.links);if(ue.length>0)for(;(fe=this.tokenizer.rules.inline.reflinkSearch.exec(de))!=null;)ue.includes(fe[0].slice(fe[0].lastIndexOf("[")+1,-1))&&(de=de.slice(0,fe.index)+"["+Me("a",fe[0].length-2)+"]"+de.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(fe=this.tokenizer.rules.inline.blockSkip.exec(de))!=null;)de=de.slice(0,fe.index)+"["+Me("a",fe[0].length-2)+"]"+de.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(fe=this.tokenizer.rules.inline.escapedEmSt.exec(de))!=null;)de=de.slice(0,fe.index+fe[0].length-2)+"++"+de.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;h;)if(ve||(ke=""),ve=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(W){return(w=W.call({lexer:F},h,p))?(h=h.substring(w.raw.length),p.push(w),!0):!1}))){if(w=this.tokenizer.escape(h)){h=h.substring(w.raw.length),p.push(w);continue}if(w=this.tokenizer.tag(h)){h=h.substring(w.raw.length),E=p[p.length-1],E&&w.type==="text"&&E.type==="text"?(E.raw+=w.raw,E.text+=w.text):p.push(w);continue}if(w=this.tokenizer.link(h)){h=h.substring(w.raw.length),p.push(w);continue}if(w=this.tokenizer.reflink(h,this.tokens.links)){h=h.substring(w.raw.length),E=p[p.length-1],E&&w.type==="text"&&E.type==="text"?(E.raw+=w.raw,E.text+=w.text):p.push(w);continue}if(w=this.tokenizer.emStrong(h,de,ke)){h=h.substring(w.raw.length),p.push(w);continue}if(w=this.tokenizer.codespan(h)){h=h.substring(w.raw.length),p.push(w);continue}if(w=this.tokenizer.br(h)){h=h.substring(w.raw.length),p.push(w);continue}if(w=this.tokenizer.del(h)){h=h.substring(w.raw.length),p.push(w);continue}if(w=this.tokenizer.autolink(h,Fe)){h=h.substring(w.raw.length),p.push(w);continue}if(!this.state.inLink&&(w=this.tokenizer.url(h,Fe))){h=h.substring(w.raw.length),p.push(w);continue}if(ie=h,this.options.extensions&&this.options.extensions.startInline&&function(){var W=1/0,Pe=h.slice(1),Oe=void 0;F.options.extensions.startInline.forEach(function(He){Oe=He.call({lexer:this},Pe),typeof Oe=="number"&&Oe>=0&&(W=Math.min(W,Oe))}),W<1/0&&W>=0&&(ie=h.substring(0,W+1))}(),w=this.tokenizer.inlineText(ie,Ne)){h=h.substring(w.raw.length),w.raw.slice(-1)!=="_"&&(ke=w.raw.slice(-1)),ve=!0,E=p[p.length-1],E&&E.type==="text"?(E.raw+=w.raw,E.text+=w.text):p.push(w);continue}if(h){var Ce="Infinite loop on byte: "+h.charCodeAt(0);if(this.options.silent){console.error(Ce);break}else throw new Error(Ce)}}return p},c(I,null,[{key:"rules",get:function(){return{block:d,inline:q}}}]),I}(),ht=function(){function I(B){this.options=B||s.defaults}var O=I.prototype;return O.code=function(h,p,F){var w=(p||"").match(/\S*/)[0];if(this.options.highlight){var E=this.options.highlight(h,w);E!=null&&E!==h&&(F=!0,h=E)}return h=h.replace(/\n$/,"")+`
`,w?'<pre><code class="'+this.options.langPrefix+Z(w)+'">'+(F?h:Z(h,!0))+`</code></pre>
`:"<pre><code>"+(F?h:Z(h,!0))+`</code></pre>
`},O.blockquote=function(h){return`<blockquote>
`+h+`</blockquote>
`},O.html=function(h){return h},O.heading=function(h,p,F,w){if(this.options.headerIds){var E=this.options.headerPrefix+w.slug(F);return"<h"+p+' id="'+E+'">'+h+"</h"+p+`>
`}return"<h"+p+">"+h+"</h"+p+`>
`},O.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},O.list=function(h,p,F){var w=p?"ol":"ul",E=p&&F!==1?' start="'+F+'"':"";return"<"+w+E+`>
`+h+"</"+w+`>
`},O.listitem=function(h){return"<li>"+h+`</li>
`},O.checkbox=function(h){return"<input "+(h?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},O.paragraph=function(h){return"<p>"+h+`</p>
`},O.table=function(h,p){return p&&(p="<tbody>"+p+"</tbody>"),`<table>
<thead>
`+h+`</thead>
`+p+`</table>
`},O.tablerow=function(h){return`<tr>
`+h+`</tr>
`},O.tablecell=function(h,p){var F=p.header?"th":"td",w=p.align?"<"+F+' align="'+p.align+'">':"<"+F+">";return w+h+("</"+F+`>
`)},O.strong=function(h){return"<strong>"+h+"</strong>"},O.em=function(h){return"<em>"+h+"</em>"},O.codespan=function(h){return"<code>"+h+"</code>"},O.br=function(){return this.options.xhtml?"<br/>":"<br>"},O.del=function(h){return"<del>"+h+"</del>"},O.link=function(h,p,F){if(h=oe(this.options.sanitize,this.options.baseUrl,h),h===null)return F;var w='<a href="'+h+'"';return p&&(w+=' title="'+p+'"'),w+=">"+F+"</a>",w},O.image=function(h,p,F){if(h=oe(this.options.sanitize,this.options.baseUrl,h),h===null)return F;var w='<img src="'+h+'" alt="'+F+'"';return p&&(w+=' title="'+p+'"'),w+=this.options.xhtml?"/>":">",w},O.text=function(h){return h},I}(),Xe=function(){function I(){}var O=I.prototype;return O.strong=function(h){return h},O.em=function(h){return h},O.codespan=function(h){return h},O.del=function(h){return h},O.html=function(h){return h},O.text=function(h){return h},O.link=function(h,p,F){return""+F},O.image=function(h,p,F){return""+F},O.br=function(){return""},I}(),it=function(){function I(){this.seen={}}var O=I.prototype;return O.serialize=function(h){return h.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},O.getNextSafeSlug=function(h,p){var F=h,w=0;if(this.seen.hasOwnProperty(F)){w=this.seen[h];do w++,F=h+"-"+w;while(this.seen.hasOwnProperty(F))}return p||(this.seen[h]=w,this.seen[F]=0),F},O.slug=function(h,p){p===void 0&&(p={});var F=this.serialize(h);return this.getNextSafeSlug(F,p.dryrun)},I}(),Ie=function(){function I(B){this.options=B||s.defaults,this.options.renderer=this.options.renderer||new ht,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xe,this.slugger=new it}I.parse=function(h,p){var F=new I(p);return F.parse(h)},I.parseInline=function(h,p){var F=new I(p);return F.parseInline(h)};var O=I.prototype;return O.parse=function(h,p){p===void 0&&(p=!0);var F="",w,E,ie,de,fe,ve,ke,ue,Ce,W,Pe,Oe,He,Le,at,pt,Nt,Ye,Xt,Yt=h.length;for(w=0;w<Yt;w++){if(W=h[w],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[W.type]&&(Xt=this.options.extensions.renderers[W.type].call({parser:this},W),Xt!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(W.type))){F+=Xt||"";continue}switch(W.type){case"space":continue;case"hr":{F+=this.renderer.hr();continue}case"heading":{F+=this.renderer.heading(this.parseInline(W.tokens),W.depth,R(this.parseInline(W.tokens,this.textRenderer)),this.slugger);continue}case"code":{F+=this.renderer.code(W.text,W.lang,W.escaped);continue}case"table":{for(ue="",ke="",de=W.header.length,E=0;E<de;E++)ke+=this.renderer.tablecell(this.parseInline(W.header[E].tokens),{header:!0,align:W.align[E]});for(ue+=this.renderer.tablerow(ke),Ce="",de=W.rows.length,E=0;E<de;E++){for(ve=W.rows[E],ke="",fe=ve.length,ie=0;ie<fe;ie++)ke+=this.renderer.tablecell(this.parseInline(ve[ie].tokens),{header:!1,align:W.align[ie]});Ce+=this.renderer.tablerow(ke)}F+=this.renderer.table(ue,Ce);continue}case"blockquote":{Ce=this.parse(W.tokens),F+=this.renderer.blockquote(Ce);continue}case"list":{for(Pe=W.ordered,Oe=W.start,He=W.loose,de=W.items.length,Ce="",E=0;E<de;E++)at=W.items[E],pt=at.checked,Nt=at.task,Le="",at.task&&(Ye=this.renderer.checkbox(pt),He?at.tokens.length>0&&at.tokens[0].type==="paragraph"?(at.tokens[0].text=Ye+" "+at.tokens[0].text,at.tokens[0].tokens&&at.tokens[0].tokens.length>0&&at.tokens[0].tokens[0].type==="text"&&(at.tokens[0].tokens[0].text=Ye+" "+at.tokens[0].tokens[0].text)):at.tokens.unshift({type:"text",text:Ye}):Le+=Ye),Le+=this.parse(at.tokens,He),Ce+=this.renderer.listitem(Le,Nt,pt);F+=this.renderer.list(Ce,Pe,Oe);continue}case"html":{F+=this.renderer.html(W.text);continue}case"paragraph":{F+=this.renderer.paragraph(this.parseInline(W.tokens));continue}case"text":{for(Ce=W.tokens?this.parseInline(W.tokens):W.text;w+1<Yt&&h[w+1].type==="text";)W=h[++w],Ce+=`
`+(W.tokens?this.parseInline(W.tokens):W.text);F+=p?this.renderer.paragraph(Ce):Ce;continue}default:{var It='Token with "'+W.type+'" type was not found.';if(this.options.silent){console.error(It);return}else throw new Error(It)}}}return F},O.parseInline=function(h,p){p=p||this.renderer;var F="",w,E,ie,de=h.length;for(w=0;w<de;w++){if(E=h[w],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[E.type]&&(ie=this.options.extensions.renderers[E.type].call({parser:this},E),ie!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(E.type))){F+=ie||"";continue}switch(E.type){case"escape":{F+=p.text(E.text);break}case"html":{F+=p.html(E.text);break}case"link":{F+=p.link(E.href,E.title,this.parseInline(E.tokens,p));break}case"image":{F+=p.image(E.href,E.title,E.text);break}case"strong":{F+=p.strong(this.parseInline(E.tokens,p));break}case"em":{F+=p.em(this.parseInline(E.tokens,p));break}case"codespan":{F+=p.codespan(E.text);break}case"br":{F+=p.br();break}case"del":{F+=p.del(this.parseInline(E.tokens,p));break}case"text":{F+=p.text(E.text);break}default:{var fe='Token with "'+E.type+'" type was not found.';if(this.options.silent){console.error(fe);return}else throw new Error(fe)}}}return F},I}(),We=function(){function I(B){this.options=B||s.defaults}var O=I.prototype;return O.preprocess=function(h){return h},O.postprocess=function(h){return h},I}();We.passThroughHooks=new Set(["preprocess","postprocess"]);function Je(I,O,B){return function(h){if(h.message+=`
Please report this to https://github.com/markedjs/marked.`,I){var p="<p>An error occurred:</p><pre>"+Z(h.message+"",!0)+"</pre>";if(O)return Promise.resolve(p);if(B){B(null,p);return}return p}if(O)return Promise.reject(h);if(B){B(h);return}throw h}}function dt(I,O){return function(B,h,p){typeof h=="function"&&(p=h,h=null);var F=m({},h);h=m({},ye.defaults,F);var w=Je(h.silent,h.async,p);if(typeof B>"u"||B===null)return w(new Error("marked(): input parameter is undefined or null"));if(typeof B!="string")return w(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(B)+", string expected"));if(ge(h),h.hooks&&(h.hooks.options=h),p){var E=h.highlight,ie;try{h.hooks&&(B=h.hooks.preprocess(B)),ie=I(B,h)}catch(ue){return w(ue)}var de=function(Ce){var W;if(!Ce)try{h.walkTokens&&ye.walkTokens(ie,h.walkTokens),W=O(ie,h),h.hooks&&(W=h.hooks.postprocess(W))}catch(Pe){Ce=Pe}return h.highlight=E,Ce?w(Ce):p(null,W)};if(!E||E.length<3||(delete h.highlight,!ie.length))return de();var fe=0;ye.walkTokens(ie,function(ue){ue.type==="code"&&(fe++,setTimeout(function(){E(ue.text,ue.lang,function(Ce,W){if(Ce)return de(Ce);W!=null&&W!==ue.text&&(ue.text=W,ue.escaped=!0),fe--,fe===0&&de()})},0))}),fe===0&&de();return}if(h.async)return Promise.resolve(h.hooks?h.hooks.preprocess(B):B).then(function(ue){return I(ue,h)}).then(function(ue){return h.walkTokens?Promise.all(ye.walkTokens(ue,h.walkTokens)).then(function(){return ue}):ue}).then(function(ue){return O(ue,h)}).then(function(ue){return h.hooks?h.hooks.postprocess(ue):ue}).catch(w);try{h.hooks&&(B=h.hooks.preprocess(B));var ve=I(B,h);h.walkTokens&&ye.walkTokens(ve,h.walkTokens);var ke=O(ve,h);return h.hooks&&(ke=h.hooks.postprocess(ke)),ke}catch(ue){return w(ue)}}}function ye(I,O,B){return dt(Qe.lex,Ie.parse)(I,O,B)}ye.options=ye.setOptions=function(I){return ye.defaults=m({},ye.defaults,I),P(ye.defaults),ye},ye.getDefaults=A,ye.defaults=s.defaults,ye.use=function(){for(var I=ye.defaults.extensions||{renderers:{},childTokens:{}},O=arguments.length,B=new Array(O),h=0;h<O;h++)B[h]=arguments[h];B.forEach(function(p){var F=m({},p);if(F.async=ye.defaults.async||F.async||!1,p.extensions&&(p.extensions.forEach(function(E){if(!E.name)throw new Error("extension name required");if(E.renderer){var ie=I.renderers[E.name];ie?I.renderers[E.name]=function(){for(var de=arguments.length,fe=new Array(de),ve=0;ve<de;ve++)fe[ve]=arguments[ve];var ke=E.renderer.apply(this,fe);return ke===!1&&(ke=ie.apply(this,fe)),ke}:I.renderers[E.name]=E.renderer}if(E.tokenizer){if(!E.level||E.level!=="block"&&E.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");I[E.level]?I[E.level].unshift(E.tokenizer):I[E.level]=[E.tokenizer],E.start&&(E.level==="block"?I.startBlock?I.startBlock.push(E.start):I.startBlock=[E.start]:E.level==="inline"&&(I.startInline?I.startInline.push(E.start):I.startInline=[E.start]))}E.childTokens&&(I.childTokens[E.name]=E.childTokens)}),F.extensions=I),p.renderer&&function(){var E=ye.defaults.renderer||new ht,ie=function(ve){var ke=E[ve];E[ve]=function(){for(var ue=arguments.length,Ce=new Array(ue),W=0;W<ue;W++)Ce[W]=arguments[W];var Pe=p.renderer[ve].apply(E,Ce);return Pe===!1&&(Pe=ke.apply(E,Ce)),Pe}};for(var de in p.renderer)ie(de);F.renderer=E}(),p.tokenizer&&function(){var E=ye.defaults.tokenizer||new S,ie=function(ve){var ke=E[ve];E[ve]=function(){for(var ue=arguments.length,Ce=new Array(ue),W=0;W<ue;W++)Ce[W]=arguments[W];var Pe=p.tokenizer[ve].apply(E,Ce);return Pe===!1&&(Pe=ke.apply(E,Ce)),Pe}};for(var de in p.tokenizer)ie(de);F.tokenizer=E}(),p.hooks&&function(){var E=ye.defaults.hooks||new We,ie=function(ve){var ke=E[ve];We.passThroughHooks.has(ve)?E[ve]=function(ue){if(ye.defaults.async)return Promise.resolve(p.hooks[ve].call(E,ue)).then(function(W){return ke.call(E,W)});var Ce=p.hooks[ve].call(E,ue);return ke.call(E,Ce)}:E[ve]=function(){for(var ue=arguments.length,Ce=new Array(ue),W=0;W<ue;W++)Ce[W]=arguments[W];var Pe=p.hooks[ve].apply(E,Ce);return Pe===!1&&(Pe=ke.apply(E,Ce)),Pe}};for(var de in p.hooks)ie(de);F.hooks=E}(),p.walkTokens){var w=ye.defaults.walkTokens;F.walkTokens=function(E){var ie=[];return ie.push(p.walkTokens.call(this,E)),w&&(ie=ie.concat(w.call(this,E))),ie}}ye.setOptions(F)})},ye.walkTokens=function(I,O){for(var B=[],h=function(){var E=F.value;switch(B=B.concat(O.call(ye,E)),E.type){case"table":{for(var ie=v(E.header),de;!(de=ie()).done;){var fe=de.value;B=B.concat(ye.walkTokens(fe.tokens,O))}for(var ve=v(E.rows),ke;!(ke=ve()).done;)for(var ue=ke.value,Ce=v(ue),W;!(W=Ce()).done;){var Pe=W.value;B=B.concat(ye.walkTokens(Pe.tokens,O))}break}case"list":{B=B.concat(ye.walkTokens(E.items,O));break}default:ye.defaults.extensions&&ye.defaults.extensions.childTokens&&ye.defaults.extensions.childTokens[E.type]?ye.defaults.extensions.childTokens[E.type].forEach(function(Oe){B=B.concat(ye.walkTokens(E[Oe],O))}):E.tokens&&(B=B.concat(ye.walkTokens(E.tokens,O)))}},p=v(I),F;!(F=p()).done;)h();return B},ye.parseInline=dt(Qe.lexInline,Ie.parseInline),ye.Parser=Ie,ye.parser=Ie.parse,ye.Renderer=ht,ye.TextRenderer=Xe,ye.Lexer=Qe,ye.lexer=Qe.lex,ye.Tokenizer=S,ye.Slugger=it,ye.Hooks=We,ye.parse=ye;var Bt=ye.options,Mt=ye.setOptions,At=ye.use,_t=ye.walkTokens,Be=ye.parseInline,Et=ye,Wt=Ie.parse,Tr=Qe.lex;s.Hooks=We,s.Lexer=Qe,s.Parser=Ie,s.Renderer=ht,s.Slugger=it,s.TextRenderer=Xe,s.Tokenizer=S,s.getDefaults=A,s.lexer=Tr,s.marked=ye,s.options=Bt,s.parse=Et,s.parseInline=Be,s.parser=Wt,s.setOptions=Mt,s.use=At,s.walkTokens=_t})(nu);var Jr=Tt,Wf=_f,Ra=nu.marked,iu=/Mac/.test(navigator.platform),Uf=new RegExp(/(<a.*?https?:\/\/.*?[^a]>)+?/g),Tn={toggleBold:di,toggleItalic:pi,drawLink:Si,toggleHeadingSmaller:Bn,toggleHeadingBigger:xi,drawImage:Fi,toggleBlockquote:mi,toggleOrderedList:ki,toggleUnorderedList:Ci,toggleCodeBlock:vi,togglePreview:Bi,toggleStrikethrough:gi,toggleHeading1:yi,toggleHeading2:Di,toggleHeading3:bi,toggleHeading4:za,toggleHeading5:_a,toggleHeading6:Wa,cleanBlock:wi,drawTable:Ai,drawHorizontalRule:Ei,undo:Li,redo:Ti,toggleSideBySide:Vr,toggleFullScreen:Er},qf={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",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},Gf=function(s){for(var b in Tn)if(Tn[b]===s)return b;return null},Pa=function(){var s=!1;return function(b){(/(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(b)||/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(b.substr(0,4)))&&(s=!0)}(navigator.userAgent||navigator.vendor||window.opera),s};function jf(s){for(var b;(b=Uf.exec(s))!==null;){var c=b[0];if(c.indexOf("target=")===-1){var m=c.replace(/>$/,' target="_blank">');s=s.replace(c,m)}}return s}function Kf(s){for(var b=new DOMParser,c=b.parseFromString(s,"text/html"),m=c.getElementsByTagName("li"),g=0;g<m.length;g++)for(var C=m[g],v=0;v<C.children.length;v++){var x=C.children[v];x instanceof HTMLInputElement&&x.type==="checkbox"&&(C.style.marginLeft="-1.5em",C.style.listStyleType="none")}return c.documentElement.innerHTML}function au(s){return iu?s=s.replace("Ctrl","Cmd"):s=s.replace("Cmd","Ctrl"),s}function Xf(s,b,c,m){var g=ci(s,!1,b,c,"button",m);g.classList.add("easymde-dropdown"),g.onclick=function(){g.focus()};var C=document.createElement("div");C.className="easymde-dropdown-content";for(var v=0;v<s.children.length;v++){var x=s.children[v],y;typeof x=="string"&&x in Ar?y=ci(Ar[x],!0,b,c,"button",m):y=ci(x,!0,b,c,"button",m),y.addEventListener("click",function(A){A.stopPropagation()},!1),C.appendChild(y)}return g.appendChild(C),g}function ci(s,b,c,m,g,C){s=s||{};var v=document.createElement(g);if(s.attributes)for(var x in s.attributes)Object.prototype.hasOwnProperty.call(s.attributes,x)&&v.setAttribute(x,s.attributes[x]);var y=C.options.toolbarButtonClassPrefix?C.options.toolbarButtonClassPrefix+"-":"";v.className=y+s.name,v.setAttribute("type",g),c=c??!0,s.text&&(v.innerText=s.text),s.name&&s.name in m&&(Tn[s.name]=s.action),s.title&&c&&(v.title=Zf(s.title,s.action,m),iu&&(v.title=v.title.replace("Ctrl","⌘"),v.title=v.title.replace("Alt","⌥"))),s.title&&v.setAttribute("aria-label",s.title),s.noDisable&&v.classList.add("no-disable"),s.noMobile&&v.classList.add("no-mobile");var A=[];typeof s.className<"u"&&(A=s.className.split(" "));for(var P=[],z=0;z<A.length;z++){var N=A[z];N.match(/^fa([srlb]|(-[\w-]*)|$)/)?P.push(N):v.classList.add(N)}if(v.tabIndex=-1,P.length>0){for(var j=document.createElement("i"),K=0;K<P.length;K++){var ne=P[K];j.classList.add(ne)}v.appendChild(j)}return typeof s.icon<"u"&&(v.innerHTML=s.icon),s.action&&b&&(typeof s.action=="function"?v.onclick=function(J){J.preventDefault(),s.action(C)}:typeof s.action=="string"&&(v.onclick=function(J){J.preventDefault(),window.open(s.action,"_blank")})),v}function Yf(){var s=document.createElement("i");return s.className="separator",s.innerHTML="|",s}function Zf(s,b,c){var m,g=s;return b&&(m=Gf(b),c[m]&&(g+=" ("+au(c[m])+")")),g}function hr(s,b){b=b||s.getCursor("start");var c=s.getTokenAt(b);if(!c.type)return{};for(var m=c.type.split(" "),g={},C,v,x=0;x<m.length;x++)C=m[x],C==="strong"?g.bold=!0:C==="variable-2"?(v=s.getLine(b.line),/^\s*\d+\.\s/.test(v)?g["ordered-list"]=!0:g["unordered-list"]=!0):C==="atom"?g.quote=!0:C==="em"?g.italic=!0:C==="quote"?g.quote=!0:C==="strikethrough"?g.strikethrough=!0:C==="comment"?g.code=!0:C==="link"&&!g.image?g.link=!0:C==="image"?g.image=!0:C.match(/^header(-[1-6])?$/)&&(g[C.replace("header","heading")]=!0);return g}var Qo="";function Er(s){var b=s.codemirror;b.setOption("fullScreen",!b.getOption("fullScreen")),b.getOption("fullScreen")?(Qo=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=Qo;var c=b.getWrapperElement(),m=c.nextSibling;if(m.classList.contains("editor-preview-active-side"))if(s.options.sideBySideFullscreen===!1){var g=c.parentNode;b.getOption("fullScreen")?g.classList.remove("sided--no-fullscreen"):g.classList.add("sided--no-fullscreen")}else Vr(s);if(s.options.onToggleFullScreen&&s.options.onToggleFullScreen(b.getOption("fullScreen")||!1),typeof s.options.maxHeight<"u"&&(b.getOption("fullScreen")?(b.getScrollerElement().style.removeProperty("height"),m.style.removeProperty("height")):(b.getScrollerElement().style.height=s.options.maxHeight,s.setPreviewMaxHeight())),s.toolbar_div.classList.toggle("fullscreen"),s.toolbarElements&&s.toolbarElements.fullscreen){var C=s.toolbarElements.fullscreen;C.classList.toggle("active")}}function di(s){Ga(s,"bold",s.options.blockStyles.bold)}function pi(s){Ga(s,"italic",s.options.blockStyles.italic)}function gi(s){Ga(s,"strikethrough","~~")}function vi(s){var b=s.options.blockStyles.code;function c(De){if(typeof De!="object")throw"fencing_line() takes a 'line' object (not a line number, or line text).  Got: "+typeof De+": "+De;return De.styles&&De.styles[2]&&De.styles[2].indexOf("formatting-code-block")!==-1}function m(De){return De.state.base.base||De.state.base}function g(De,T,V,$,ge){V=V||De.getLineHandle(T),$=$||De.getTokenAt({line:T,ch:1}),ge=ge||!!V.text&&De.getTokenAt({line:T,ch:V.text.length-1});var Me=$.type?$.type.split(" "):[];return ge&&m(ge).indentedCode?"indented":Me.indexOf("comment")===-1?!1:m($).fencedChars||m(ge).fencedChars||c(V)?"fenced":"single"}function C(De,T,V,$){var ge=T.line+1,Me=V.line+1,et=T.line!==V.line,zt=$+`
`,S=`
`+$;et&&Me++,et&&V.ch===0&&(S=$+`
`,Me--),Lr(De,!1,[zt,S]),De.setSelection({line:ge,ch:0},{line:Me,ch:0})}var v=s.codemirror,x=v.getCursor("start"),y=v.getCursor("end"),A=v.getTokenAt({line:x.line,ch:x.ch||1}),P=v.getLineHandle(x.line),z=g(v,x.line,P,A),N,j,K;if(z==="single"){var ne=P.text.slice(0,x.ch).replace("`",""),J=P.text.slice(x.ch).replace("`","");v.replaceRange(ne+J,{line:x.line,ch:0},{line:x.line,ch:99999999999999}),x.ch--,x!==y&&y.ch--,v.setSelection(x,y),v.focus()}else if(z==="fenced")if(x.line!==y.line||x.ch!==y.ch){for(N=x.line;N>=0&&(P=v.getLineHandle(N),!c(P));N--);var Z=v.getTokenAt({line:N,ch:1}),H=m(Z).fencedChars,R,U,G,te;c(v.getLineHandle(x.line))?(R="",U=x.line):c(v.getLineHandle(x.line-1))?(R="",U=x.line-1):(R=H+`
`,U=x.line),c(v.getLineHandle(y.line))?(G="",te=y.line,y.ch===0&&(te+=1)):y.ch!==0&&c(v.getLineHandle(y.line+1))?(G="",te=y.line+1):(G=H+`
`,te=y.line+1),y.ch===0&&(te-=1),v.operation(function(){v.replaceRange(G,{line:te,ch:0},{line:te+(G?0:1),ch:0}),v.replaceRange(R,{line:U,ch:0},{line:U+(R?0:1),ch:0})}),v.setSelection({line:U+(R?1:0),ch:0},{line:te+(R?1:-1),ch:0}),v.focus()}else{var Y=x.line;if(c(v.getLineHandle(x.line))&&(g(v,x.line+1)==="fenced"?(N=x.line,Y=x.line+1):(j=x.line,Y=x.line-1)),N===void 0)for(N=Y;N>=0&&(P=v.getLineHandle(N),!c(P));N--);if(j===void 0)for(K=v.lineCount(),j=Y;j<K&&(P=v.getLineHandle(j),!c(P));j++);v.operation(function(){v.replaceRange("",{line:N,ch:0},{line:N+1,ch:0}),v.replaceRange("",{line:j-1,ch:0},{line:j,ch:0})}),v.focus()}else if(z==="indented"){if(x.line!==y.line||x.ch!==y.ch)N=x.line,j=y.line,y.ch===0&&j--;else{for(N=x.line;N>=0;N--)if(P=v.getLineHandle(N),!P.text.match(/^\s*$/)&&g(v,N,P)!=="indented"){N+=1;break}for(K=v.lineCount(),j=x.line;j<K;j++)if(P=v.getLineHandle(j),!P.text.match(/^\s*$/)&&g(v,j,P)!=="indented"){j-=1;break}}var oe=v.getLineHandle(j+1),pe=oe&&v.getTokenAt({line:j+1,ch:oe.text.length-1}),qe=pe&&m(pe).indentedCode;qe&&v.replaceRange(`
`,{line:j+1,ch:0});for(var re=N;re<=j;re++)v.indentLine(re,"subtract");v.focus()}else{var Ae=x.line===y.line&&x.ch===y.ch&&x.ch===0,Ee=x.line!==y.line;Ae||Ee?C(v,x,y,b):Lr(v,!1,["`","`"])}}function mi(s){qa(s.codemirror,"quote")}function Bn(s){dr(s.codemirror,"smaller")}function xi(s){dr(s.codemirror,"bigger")}function yi(s){dr(s.codemirror,void 0,1)}function Di(s){dr(s.codemirror,void 0,2)}function bi(s){dr(s.codemirror,void 0,3)}function za(s){dr(s.codemirror,void 0,4)}function _a(s){dr(s.codemirror,void 0,5)}function Wa(s){dr(s.codemirror,void 0,6)}function Ci(s){var b=s.codemirror,c="*";["-","+","*"].includes(s.options.unorderedListStyle)&&(c=s.options.unorderedListStyle),qa(b,"unordered-list",c)}function ki(s){qa(s.codemirror,"ordered-list")}function wi(s){$f(s.codemirror)}function Si(s){var b=s.options,c="https://";if(b.promptURLs){var m=prompt(b.promptTexts.link,c);if(!m)return!1;c=lu(m)}uu(s,"link",b.insertTexts.link,c)}function Fi(s){var b=s.options,c="https://";if(b.promptURLs){var m=prompt(b.promptTexts.image,c);if(!m)return!1;c=lu(m)}uu(s,"image",b.insertTexts.image,c)}function lu(s){return encodeURI(s).replace(/([\\()])/g,"\\$1")}function Ua(s){s.openBrowseFileWindow()}function ou(s,b){var c=s.codemirror,m=hr(c),g=s.options,C=b.substr(b.lastIndexOf("/")+1),v=C.substring(C.lastIndexOf(".")+1).replace(/\?.*$/,"").toLowerCase();if(["png","jpg","jpeg","gif","svg","apng","avif","webp"].includes(v))Lr(c,m.image,g.insertTexts.uploadedImage,b);else{var x=g.insertTexts.link;x[0]="["+C,Lr(c,m.link,x,b)}s.updateStatusBar("upload-image",s.options.imageTexts.sbOnUploaded.replace("#image_name#",C)),setTimeout(function(){s.updateStatusBar("upload-image",s.options.imageTexts.sbInit)},1e3)}function Ai(s){var b=s.codemirror,c=hr(b),m=s.options;Lr(b,c.table,m.insertTexts.table)}function Ei(s){var b=s.codemirror,c=hr(b),m=s.options;Lr(b,c.image,m.insertTexts.horizontalRule)}function Li(s){var b=s.codemirror;b.undo(),b.focus()}function Ti(s){var b=s.codemirror;b.redo(),b.focus()}function Vr(s){var b=s.codemirror,c=b.getWrapperElement(),m=c.nextSibling,g=s.toolbarElements&&s.toolbarElements["side-by-side"],C=!1,v=c.parentNode;m.classList.contains("editor-preview-active-side")?(s.options.sideBySideFullscreen===!1&&v.classList.remove("sided--no-fullscreen"),m.classList.remove("editor-preview-active-side"),g&&g.classList.remove("active"),c.classList.remove("CodeMirror-sided")):(setTimeout(function(){b.getOption("fullScreen")||(s.options.sideBySideFullscreen===!1?v.classList.add("sided--no-fullscreen"):Er(s)),m.classList.add("editor-preview-active-side")},1),g&&g.classList.add("active"),c.classList.add("CodeMirror-sided"),C=!0);var x=c.lastChild;if(x.classList.contains("editor-preview-active")){x.classList.remove("editor-preview-active");var y=s.toolbarElements.preview,A=s.toolbar_div;y.classList.remove("active"),A.classList.remove("disabled-for-preview")}var P=function(){var N=s.options.previewRender(s.value(),m);N!=null&&(m.innerHTML=N)};if(b.sideBySideRenderingFunction||(b.sideBySideRenderingFunction=P),C){var z=s.options.previewRender(s.value(),m);z!=null&&(m.innerHTML=z),b.on("update",b.sideBySideRenderingFunction)}else b.off("update",b.sideBySideRenderingFunction);b.refresh()}function Bi(s){var b=s.codemirror,c=b.getWrapperElement(),m=s.toolbar_div,g=s.options.toolbar?s.toolbarElements.preview:!1,C=c.lastChild,v=b.getWrapperElement().nextSibling;if(v.classList.contains("editor-preview-active-side")&&Vr(s),!C||!C.classList.contains("editor-preview-full")){if(C=document.createElement("div"),C.className="editor-preview-full",s.options.previewClass)if(Array.isArray(s.options.previewClass))for(var x=0;x<s.options.previewClass.length;x++)C.classList.add(s.options.previewClass[x]);else typeof s.options.previewClass=="string"&&C.classList.add(s.options.previewClass);c.appendChild(C)}C.classList.contains("editor-preview-active")?(C.classList.remove("editor-preview-active"),g&&(g.classList.remove("active"),m.classList.remove("disabled-for-preview"))):(setTimeout(function(){C.classList.add("editor-preview-active")},1),g&&(g.classList.add("active"),m.classList.add("disabled-for-preview")));var y=s.options.previewRender(s.value(),C);y!==null&&(C.innerHTML=y)}function Lr(s,b,c,m){if(!s.getWrapperElement().lastChild.classList.contains("editor-preview-active")){var g,C=c[0],v=c[1],x={},y={};Object.assign(x,s.getCursor("start")),Object.assign(y,s.getCursor("end")),m&&(C=C.replace("#url#",m),v=v.replace("#url#",m)),b?(g=s.getLine(x.line),C=g.slice(0,x.ch),v=g.slice(x.ch),s.replaceRange(C+v,{line:x.line,ch:0})):(g=s.getSelection(),s.replaceSelection(C+g+v),x.ch+=C.length,x!==y&&(y.ch+=C.length)),s.setSelection(x,y),s.focus()}}function dr(s,b,c){if(!s.getWrapperElement().lastChild.classList.contains("editor-preview-active")){for(var m=s.getCursor("start"),g=s.getCursor("end"),C=m.line;C<=g.line;C++)(function(v){var x=s.getLine(v),y=x.search(/[^#]/);b!==void 0?y<=0?b=="bigger"?x="###### "+x:x="# "+x:y==6&&b=="smaller"?x=x.substr(7):y==1&&b=="bigger"?x=x.substr(2):b=="bigger"?x=x.substr(1):x="#"+x:y<=0?x="#".repeat(c)+" "+x:y==c?x=x.substr(y+1):x="#".repeat(c)+" "+x.substr(y+1),s.replaceRange(x,{line:v,ch:0},{line:v,ch:99999999999999})})(C);s.focus()}}function qa(s,b,c){if(!s.getWrapperElement().lastChild.classList.contains("editor-preview-active")){for(var m=/^(\s*)(\*|-|\+|\d*\.)(\s+)/,g=/^\s*/,C=hr(s),v=s.getCursor("start"),x=s.getCursor("end"),y={quote:/^(\s*)>\s+/,"unordered-list":m,"ordered-list":m},A=function(K,ne){var J={quote:">","unordered-list":c,"ordered-list":"%%i."};return J[K].replace("%%i",ne)},P=function(K,ne){var J={quote:">","unordered-list":"\\"+c,"ordered-list":"\\d+."},Z=new RegExp(J[K]);return ne&&Z.test(ne)},z=function(K,ne,J){var Z=m.exec(ne),H=A(K,N);return Z!==null?(P(K,Z[2])&&(H=""),ne=Z[1]+H+Z[3]+ne.replace(g,"").replace(y[K],"$1")):J==!1&&(ne=H+" "+ne),ne},N=1,j=v.line;j<=x.line;j++)(function(K){var ne=s.getLine(K);C[b]?ne=ne.replace(y[b],"$1"):(b=="unordered-list"&&(ne=z("ordered-list",ne,!0)),ne=z(b,ne,!1),N+=1),s.replaceRange(ne,{line:K,ch:0},{line:K,ch:99999999999999})})(j);s.focus()}}function uu(s,b,c,m){if(!(!s.codemirror||s.isPreviewActive())){var g=s.codemirror,C=hr(g),v=C[b];if(!v){Lr(g,v,c,m);return}var x=g.getCursor("start"),y=g.getCursor("end"),A=g.getLine(x.line),P=A.slice(0,x.ch),z=A.slice(x.ch);b=="link"?P=P.replace(/(.*)[^!]\[/,"$1"):b=="image"&&(P=P.replace(/(.*)!\[$/,"$1")),z=z.replace(/]\(.*?\)/,""),g.replaceRange(P+z,{line:x.line,ch:0},{line:x.line,ch:99999999999999}),x.ch-=c[0].length,x!==y&&(y.ch-=c[0].length),g.setSelection(x,y),g.focus()}}function Ga(s,b,c,m){if(!(!s.codemirror||s.isPreviewActive())){m=typeof m>"u"?c:m;var g=s.codemirror,C=hr(g),v,x=c,y=m,A=g.getCursor("start"),P=g.getCursor("end");C[b]?(v=g.getLine(A.line),x=v.slice(0,A.ch),y=v.slice(A.ch),b=="bold"?(x=x.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),y=y.replace(/(\*\*|__)/,"")):b=="italic"?(x=x.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),y=y.replace(/(\*|_)/,"")):b=="strikethrough"&&(x=x.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),y=y.replace(/(\*\*|~~)/,"")),g.replaceRange(x+y,{line:A.line,ch:0},{line:A.line,ch:99999999999999}),b=="bold"||b=="strikethrough"?(A.ch-=2,A!==P&&(P.ch-=2)):b=="italic"&&(A.ch-=1,A!==P&&(P.ch-=1))):(v=g.getSelection(),b=="bold"?(v=v.split("**").join(""),v=v.split("__").join("")):b=="italic"?(v=v.split("*").join(""),v=v.split("_").join("")):b=="strikethrough"&&(v=v.split("~~").join("")),g.replaceSelection(x+v+y),A.ch+=c.length,P.ch=A.ch+v.length),g.setSelection(A,P),g.focus()}}function $f(s){if(!s.getWrapperElement().lastChild.classList.contains("editor-preview-active"))for(var b=s.getCursor("start"),c=s.getCursor("end"),m,g=b.line;g<=c.line;g++)m=s.getLine(g),m=m.replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,""),s.replaceRange(m,{line:g,ch:0},{line:g,ch:99999999999999})}function hi(s,b){if(Math.abs(s)<1024)return""+s+b[0];var c=0;do s/=1024,++c;while(Math.abs(s)>=1024&&c<b.length);return""+s.toFixed(1)+b[c]}function su(s,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(b[c]instanceof Array?s[c]=b[c].concat(s[c]instanceof Array?s[c]:[]):b[c]!==null&&typeof b[c]=="object"&&b[c].constructor===Object?s[c]=su(s[c]||{},b[c]):s[c]=b[c]);return s}function tr(s){for(var b=1;b<arguments.length;b++)s=su(s,arguments[b]);return s}function Jo(s){var b=/[a-zA-Z0-9_\u00A0-\u02AF\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g,c=s.match(b),m=0;if(c===null)return m;for(var g=0;g<c.length;g++)c[g].charCodeAt(0)>=19968?m+=c[g].length:m+=1;return m}var Ge={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","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"},Ar={bold:{name:"bold",action:di,className:Ge.bold,title:"Bold",default:!0},italic:{name:"italic",action:pi,className:Ge.italic,title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:gi,className:Ge.strikethrough,title:"Strikethrough"},heading:{name:"heading",action:Bn,className:Ge.heading,title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:Bn,className:Ge["heading-smaller"],title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:xi,className:Ge["heading-bigger"],title:"Bigger Heading"},"heading-1":{name:"heading-1",action:yi,className:Ge["heading-1"],title:"Big Heading"},"heading-2":{name:"heading-2",action:Di,className:Ge["heading-2"],title:"Medium Heading"},"heading-3":{name:"heading-3",action:bi,className:Ge["heading-3"],title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:vi,className:Ge.code,title:"Code"},quote:{name:"quote",action:mi,className:Ge.quote,title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:Ci,className:Ge["unordered-list"],title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:ki,className:Ge["ordered-list"],title:"Numbered List",default:!0},"clean-block":{name:"clean-block",action:wi,className:Ge["clean-block"],title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:Si,className:Ge.link,title:"Create Link",default:!0},image:{name:"image",action:Fi,className:Ge.image,title:"Insert Image",default:!0},"upload-image":{name:"upload-image",action:Ua,className:Ge["upload-image"],title:"Import an image"},table:{name:"table",action:Ai,className:Ge.table,title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:Ei,className:Ge["horizontal-rule"],title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:Bi,className:Ge.preview,noDisable:!0,title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:Vr,className:Ge["side-by-side"],noDisable:!0,noMobile:!0,title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:Er,className:Ge.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:Ge.guide,noDisable:!0,title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:Li,className:Ge.undo,noDisable:!0,title:"Undo"},redo:{name:"redo",action:Ti,className:Ge.redo,noDisable:!0,title:"Redo"}},Qf={link:["[","](#url#)"],image:["![","](#url#)"],uploadedImage:["![](#url#)",""],table:["",`

| Column 1 | Column 2 | Column 3 |
| -------- | -------- | -------- |
| Text     | Text     | Text     |

`],horizontalRule:["",`

-----

`]},Jf={link:"URL for the link:",image:"URL of the image:"},Vf={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},ec={bold:"**",code:"```",italic:"*"},tc={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"},rc={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 ce(s){s=s||{},s.parent=this;var b=!0;if(s.autoDownloadFontAwesome===!1&&(b=!1),s.autoDownloadFontAwesome!==!0)for(var c=document.styleSheets,m=0;m<c.length;m++)c[m].href&&c[m].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(b=!1);if(b){var g=document.createElement("link");g.rel="stylesheet",g.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(g)}if(s.element)this.element=s.element;else if(s.element===null){console.log("EasyMDE: Error. No element was found.");return}if(s.toolbar===void 0){s.toolbar=[];for(var C in Ar)Object.prototype.hasOwnProperty.call(Ar,C)&&(C.indexOf("separator-")!=-1&&s.toolbar.push("|"),(Ar[C].default===!0||s.showIcons&&s.showIcons.constructor===Array&&s.showIcons.indexOf(C)!=-1)&&s.toolbar.push(C))}if(Object.prototype.hasOwnProperty.call(s,"previewClass")||(s.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(s,"status")||(s.status=["autosave","lines","words","cursor"],s.uploadImage&&s.status.unshift("upload-image")),s.previewRender||(s.previewRender=function(x){return this.parent.markdown(x)}),s.parsingConfig=tr({highlightFormatting:!0},s.parsingConfig||{}),s.insertTexts=tr({},Qf,s.insertTexts||{}),s.promptTexts=tr({},Jf,s.promptTexts||{}),s.blockStyles=tr({},ec,s.blockStyles||{}),s.autosave!=null&&(s.autosave.timeFormat=tr({},Vf,s.autosave.timeFormat||{})),s.iconClassMap=tr({},Ge,s.iconClassMap||{}),s.shortcuts=tr({},qf,s.shortcuts||{}),s.maxHeight=s.maxHeight||void 0,s.direction=s.direction||"ltr",typeof s.maxHeight<"u"?s.minHeight=s.maxHeight:s.minHeight=s.minHeight||"300px",s.errorCallback=s.errorCallback||function(x){alert(x)},s.uploadImage=s.uploadImage||!1,s.imageMaxSize=s.imageMaxSize||2097152,s.imageAccept=s.imageAccept||"image/png, image/jpeg, image/gif, image/avif",s.imageTexts=tr({},tc,s.imageTexts||{}),s.errorMessages=tr({},rc,s.errorMessages||{}),s.imagePathAbsolute=s.imagePathAbsolute||!1,s.imageCSRFName=s.imageCSRFName||"csrfmiddlewaretoken",s.imageCSRFHeader=s.imageCSRFHeader||!1,s.autosave!=null&&s.autosave.unique_id!=null&&s.autosave.unique_id!=""&&(s.autosave.uniqueId=s.autosave.unique_id),s.overlayMode&&s.overlayMode.combine===void 0&&(s.overlayMode.combine=!0),this.options=s,this.render(),s.initialValue&&(!this.options.autosave||this.options.autosave.foundSavedValue!==!0)&&this.value(s.initialValue),s.uploadImage){var v=this;this.codemirror.on("dragenter",function(x,y){v.updateStatusBar("upload-image",v.options.imageTexts.sbOnDragEnter),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragend",function(x,y){v.updateStatusBar("upload-image",v.options.imageTexts.sbInit),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragleave",function(x,y){v.updateStatusBar("upload-image",v.options.imageTexts.sbInit),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragover",function(x,y){v.updateStatusBar("upload-image",v.options.imageTexts.sbOnDragEnter),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("drop",function(x,y){y.stopPropagation(),y.preventDefault(),s.imageUploadFunction?v.uploadImagesUsingCustomFunction(s.imageUploadFunction,y.dataTransfer.files):v.uploadImages(y.dataTransfer.files)}),this.codemirror.on("paste",function(x,y){s.imageUploadFunction?v.uploadImagesUsingCustomFunction(s.imageUploadFunction,y.clipboardData.files):v.uploadImages(y.clipboardData.files)})}}ce.prototype.uploadImages=function(s,b,c){if(s.length!==0){for(var m=[],g=0;g<s.length;g++)m.push(s[g].name),this.uploadImage(s[g],b,c);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",m.join(", ")))}};ce.prototype.uploadImagesUsingCustomFunction=function(s,b){if(b.length!==0){for(var c=[],m=0;m<b.length;m++)c.push(b[m].name),this.uploadImageUsingCustomFunction(s,b[m]);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",c.join(", ")))}};ce.prototype.updateStatusBar=function(s,b){if(this.gui.statusbar){var c=this.gui.statusbar.getElementsByClassName(s);c.length===1?this.gui.statusbar.getElementsByClassName(s)[0].textContent=b:c.length===0?console.log("EasyMDE: status bar item "+s+" was not found."):console.log("EasyMDE: Several status bar items named "+s+" was found.")}};ce.prototype.markdown=function(s){if(Ra){var b;if(this.options&&this.options.renderingConfig&&this.options.renderingConfig.markedOptions?b=this.options.renderingConfig.markedOptions:b={},this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?b.breaks=!1:b.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0){var c=this.options.renderingConfig.hljs||window.hljs;c&&(b.highlight=function(g,C){return C&&c.getLanguage(C)?c.highlight(C,g).value:c.highlightAuto(g).value})}Ra.setOptions(b);var m=Ra.parse(s);return this.options.renderingConfig&&typeof this.options.renderingConfig.sanitizerFunction=="function"&&(m=this.options.renderingConfig.sanitizerFunction.call(this,m)),m=jf(m),m=Kf(m),m}};ce.prototype.render=function(s){if(s||(s=this.element||document.getElementsByTagName("textarea")[0]),this._rendered&&this._rendered===s)return;this.element=s;var b=this.options,c=this,m={};for(var g in b.shortcuts)b.shortcuts[g]!==null&&Tn[g]!==null&&function(J){m[au(b.shortcuts[J])]=function(){var Z=Tn[J];typeof Z=="function"?Z(c):typeof Z=="string"&&window.open(Z,"_blank")}}(g);m.Enter="newlineAndIndentContinueMarkdownList",m.Tab="tabAndIndentMarkdownList",m["Shift-Tab"]="shiftTabAndUnindentMarkdownList",m.Esc=function(J){J.getOption("fullScreen")&&Er(c)},this.documentOnKeyDown=function(J){J=J||window.event,J.keyCode==27&&c.codemirror.getOption("fullScreen")&&Er(c)},document.addEventListener("keydown",this.documentOnKeyDown,!1);var C,v;b.overlayMode?(Jr.defineMode("overlay-mode",function(J){return Jr.overlayMode(Jr.getMode(J,b.spellChecker!==!1?"spell-checker":"gfm"),b.overlayMode.mode,b.overlayMode.combine)}),C="overlay-mode",v=b.parsingConfig,v.gitHubSpice=!1):(C=b.parsingConfig,C.name="gfm",C.gitHubSpice=!1),b.spellChecker!==!1&&(C="spell-checker",v=b.parsingConfig,v.name="gfm",v.gitHubSpice=!1,typeof b.spellChecker=="function"?b.spellChecker({codeMirrorInstance:Jr}):Wf({codeMirrorInstance:Jr}));function x(J,Z,H){return{addNew:!1}}if(this.codemirror=Jr.fromTextArea(s,{mode:C,backdrop:v,theme:b.theme!=null?b.theme:"easymde",tabSize:b.tabSize!=null?b.tabSize:2,indentUnit:b.tabSize!=null?b.tabSize:2,indentWithTabs:b.indentWithTabs!==!1,lineNumbers:b.lineNumbers===!0,autofocus:b.autofocus===!0,extraKeys:m,direction:b.direction,lineWrapping:b.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:b.placeholder||s.getAttribute("placeholder")||"",styleSelectedText:b.styleSelectedText!=null?b.styleSelectedText:!Pa(),scrollbarStyle:b.scrollbarStyle!=null?b.scrollbarStyle:"native",configureMouse:x,inputStyle:b.inputStyle!=null?b.inputStyle:Pa()?"contenteditable":"textarea",spellcheck:b.nativeSpellcheck!=null?b.nativeSpellcheck:!0,autoRefresh:b.autoRefresh!=null?b.autoRefresh:!1}),this.codemirror.getScrollerElement().style.minHeight=b.minHeight,typeof b.maxHeight<"u"&&(this.codemirror.getScrollerElement().style.height=b.maxHeight),b.forceSync===!0){var y=this.codemirror;y.on("change",function(){y.save()})}this.gui={};var A=document.createElement("div");A.classList.add("EasyMDEContainer"),A.setAttribute("role","application");var P=this.codemirror.getWrapperElement();P.parentNode.insertBefore(A,P),A.appendChild(P),b.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),b.status!==!1&&(this.gui.statusbar=this.createStatusbar()),b.autosave!=null&&b.autosave.enabled===!0&&(this.autosave(),this.codemirror.on("change",function(){clearTimeout(c._autosave_timeout),c._autosave_timeout=setTimeout(function(){c.autosave()},c.options.autosave.submit_delay||c.options.autosave.delay||1e3)}));function z(J,Z){var H,R=window.getComputedStyle(document.querySelector(".CodeMirror-sizer")).width.replace("px","");return J<R?H=Z+"px":H=Z/J*100+"%",H}var N=this;function j(J,Z){J.setAttribute("data-img-src",Z.url),J.setAttribute("style","--bg-image:url("+Z.url+");--width:"+Z.naturalWidth+"px;--height:"+z(Z.naturalWidth,Z.naturalHeight)),N.codemirror.setSize()}function K(){b.previewImagesInEditor&&A.querySelectorAll(".cm-image-marker").forEach(function(J){var Z=J.parentElement;if(Z.innerText.match(/^!\[.*?\]\(.*\)/g)&&!Z.hasAttribute("data-img-src")){var H=Z.innerText.match("\\((.*)\\)");if(window.EMDEimagesCache||(window.EMDEimagesCache={}),H&&H.length>=2){var R=H[1];if(b.imagesPreviewHandler){var U=b.imagesPreviewHandler(H[1]);typeof U=="string"&&(R=U)}if(window.EMDEimagesCache[R])j(Z,window.EMDEimagesCache[R]);else{var G=document.createElement("img");G.onload=function(){window.EMDEimagesCache[R]={naturalWidth:G.naturalWidth,naturalHeight:G.naturalHeight,url:R},j(Z,window.EMDEimagesCache[R])},G.src=R}}}})}this.codemirror.on("update",function(){K()}),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element,(b.autofocus===!0||s.autofocus)&&this.codemirror.focus();var ne=this.codemirror;setTimeout((function(){ne.refresh()}).bind(ne),0)};ce.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)};function fu(){if(typeof localStorage=="object")try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch{return!1}else return!1;return!0}ce.prototype.autosave=function(){if(fu()){var s=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&&(s.element.form!=null&&s.element.form!=null&&s.element.form.addEventListener("submit",function(){clearTimeout(s.autosaveTimeoutId),s.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+s.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 b=s.value();b!==""?localStorage.setItem("smde_"+this.options.autosave.uniqueId,b):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var c=document.getElementById("autosaved");if(c!=null&&c!=null&&c!=""){var m=new Date,g=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(m),C=this.options.autosave.text==null?"Autosaved: ":this.options.autosave.text;c.innerHTML=C+g}}else console.log("EasyMDE: localStorage not available, cannot autosave")};ce.prototype.clearAutosavedValue=function(){if(fu()){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")};ce.prototype.openBrowseFileWindow=function(s,b){var c=this,m=this.gui.toolbar.getElementsByClassName("imageInput")[0];m.click();function g(C){c.options.imageUploadFunction?c.uploadImagesUsingCustomFunction(c.options.imageUploadFunction,C.target.files):c.uploadImages(C.target.files,s,b),m.removeEventListener("change",g)}m.addEventListener("change",g)};ce.prototype.uploadImage=function(s,b,c){var m=this;b=b||function(A){ou(m,A)};function g(y){m.updateStatusBar("upload-image",y),setTimeout(function(){m.updateStatusBar("upload-image",m.options.imageTexts.sbInit)},1e4),c&&typeof c=="function"&&c(y),m.options.errorCallback(y)}function C(y){var A=m.options.imageTexts.sizeUnits.split(",");return y.replace("#image_name#",s.name).replace("#image_size#",hi(s.size,A)).replace("#image_max_size#",hi(m.options.imageMaxSize,A))}if(s.size>this.options.imageMaxSize){g(C(this.options.errorMessages.fileTooLarge));return}var v=new FormData;v.append("image",s),m.options.imageCSRFToken&&!m.options.imageCSRFHeader&&v.append(m.options.imageCSRFName,m.options.imageCSRFToken);var x=new XMLHttpRequest;x.upload.onprogress=function(y){if(y.lengthComputable){var A=""+Math.round(y.loaded*100/y.total);m.updateStatusBar("upload-image",m.options.imageTexts.sbProgress.replace("#file_name#",s.name).replace("#progress#",A))}},x.open("POST",this.options.imageUploadEndpoint),m.options.imageCSRFToken&&m.options.imageCSRFHeader&&x.setRequestHeader(m.options.imageCSRFName,m.options.imageCSRFToken),x.onload=function(){try{var y=JSON.parse(this.responseText)}catch{console.error("EasyMDE: The server did not return a valid json."),g(C(m.options.errorMessages.importError));return}this.status===200&&y&&!y.error&&y.data&&y.data.filePath?b((m.options.imagePathAbsolute?"":window.location.origin+"/")+y.data.filePath):y.error&&y.error in m.options.errorMessages?g(C(m.options.errorMessages[y.error])):y.error?g(C(y.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),g(C(m.options.errorMessages.importError)))},x.onerror=function(y){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+y.target.status+" ("+y.target.statusText+")"),g(m.options.errorMessages.importError)},x.send(v)};ce.prototype.uploadImageUsingCustomFunction=function(s,b){var c=this;function m(v){ou(c,v)}function g(v){var x=C(v);c.updateStatusBar("upload-image",x),setTimeout(function(){c.updateStatusBar("upload-image",c.options.imageTexts.sbInit)},1e4),c.options.errorCallback(x)}function C(v){var x=c.options.imageTexts.sizeUnits.split(",");return v.replace("#image_name#",b.name).replace("#image_size#",hi(b.size,x)).replace("#image_max_size#",hi(c.options.imageMaxSize,x))}s.apply(this,[b,m,g])};ce.prototype.setPreviewMaxHeight=function(){var s=this.codemirror,b=s.getWrapperElement(),c=b.nextSibling,m=parseInt(window.getComputedStyle(b).paddingTop),g=parseInt(window.getComputedStyle(b).borderTopWidth),C=parseInt(this.options.maxHeight),v=C+m*2+g*2,x=v.toString()+"px";c.style.height=x};ce.prototype.createSideBySide=function(){var s=this.codemirror,b=s.getWrapperElement(),c=b.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 m=0;m<this.options.previewClass.length;m++)c.classList.add(this.options.previewClass[m]);else typeof this.options.previewClass=="string"&&c.classList.add(this.options.previewClass);b.parentNode.insertBefore(c,b.nextSibling)}if(typeof this.options.maxHeight<"u"&&this.setPreviewMaxHeight(),this.options.syncSideBySidePreviewScroll===!1)return c;var g=!1,C=!1;return s.on("scroll",function(v){if(g){g=!1;return}C=!0;var x=v.getScrollInfo().height-v.getScrollInfo().clientHeight,y=parseFloat(v.getScrollInfo().top)/x,A=(c.scrollHeight-c.clientHeight)*y;c.scrollTop=A}),c.onscroll=function(){if(C){C=!1;return}g=!0;var v=c.scrollHeight-c.clientHeight,x=parseFloat(c.scrollTop)/v,y=(s.getScrollInfo().height-s.getScrollInfo().clientHeight)*x;s.scrollTo(0,y)},c};ce.prototype.createToolbar=function(s){if(s=s||this.options.toolbar,!(!s||s.length===0)){var b;for(b=0;b<s.length;b++)Ar[s[b]]!=null&&(s[b]=Ar[s[b]]);var c=document.createElement("div");c.className="editor-toolbar",c.setAttribute("role","toolbar");var m=this,g={};for(m.toolbar=s,b=0;b<s.length;b++)if(!(s[b].name=="guide"&&m.options.toolbarGuideIcon===!1)&&!(m.options.hideIcons&&m.options.hideIcons.indexOf(s[b].name)!=-1)&&!((s[b].name=="fullscreen"||s[b].name=="side-by-side")&&Pa())){if(s[b]==="|"){for(var C=!1,v=b+1;v<s.length;v++)s[v]!=="|"&&(!m.options.hideIcons||m.options.hideIcons.indexOf(s[v].name)==-1)&&(C=!0);if(!C)continue}(function(A){var P;if(A==="|"?P=Yf():A.children?P=Xf(A,m.options.toolbarTips,m.options.shortcuts,m):P=ci(A,!0,m.options.toolbarTips,m.options.shortcuts,"button",m),g[A.name||A]=P,c.appendChild(P),A.name==="upload-image"){var z=document.createElement("input");z.className="imageInput",z.type="file",z.multiple=!0,z.name="image",z.accept=m.options.imageAccept,z.style.display="none",z.style.opacity=0,c.appendChild(z)}})(s[b])}m.toolbar_div=c,m.toolbarElements=g;var x=this.codemirror;x.on("cursorActivity",function(){var A=hr(x);for(var P in g)(function(z){var N=g[z];A[z]?N.classList.add("active"):z!="fullscreen"&&z!="side-by-side"&&N.classList.remove("active")})(P)});var y=x.getWrapperElement();return y.parentNode.insertBefore(c,y),c}};ce.prototype.createStatusbar=function(s){s=s||this.options.status;var b=this.options,c=this.codemirror;if(!(!s||s.length===0)){var m=[],g,C,v,x;for(g=0;g<s.length;g++)if(C=void 0,v=void 0,x=void 0,typeof s[g]=="object")m.push({className:s[g].className,defaultValue:s[g].defaultValue,onUpdate:s[g].onUpdate,onActivity:s[g].onActivity});else{var y=s[g];y==="words"?(x=function(j){j.innerHTML=Jo(c.getValue())},C=function(j){j.innerHTML=Jo(c.getValue())}):y==="lines"?(x=function(j){j.innerHTML=c.lineCount()},C=function(j){j.innerHTML=c.lineCount()}):y==="cursor"?(x=function(j){j.innerHTML="1:1"},v=function(j){var K=c.getCursor(),ne=K.line+1,J=K.ch+1;j.innerHTML=ne+":"+J}):y==="autosave"?x=function(j){b.autosave!=null&&b.autosave.enabled===!0&&j.setAttribute("id","autosaved")}:y==="upload-image"&&(x=function(j){j.innerHTML=b.imageTexts.sbInit}),m.push({className:y,defaultValue:x,onUpdate:C,onActivity:v})}var A=document.createElement("div");for(A.className="editor-statusbar",g=0;g<m.length;g++){var P=m[g],z=document.createElement("span");z.className=P.className,typeof P.defaultValue=="function"&&P.defaultValue(z),typeof P.onUpdate=="function"&&this.codemirror.on("update",function(j,K){return function(){K.onUpdate(j)}}(z,P)),typeof P.onActivity=="function"&&this.codemirror.on("cursorActivity",function(j,K){return function(){K.onActivity(j)}}(z,P)),A.appendChild(z)}var N=this.codemirror.getWrapperElement();return N.parentNode.insertBefore(A,N.nextSibling),A}};ce.prototype.value=function(s){var b=this.codemirror;if(s===void 0)return b.getValue();if(b.getDoc().setValue(s),this.isPreviewActive()){var c=b.getWrapperElement(),m=c.lastChild,g=this.options.previewRender(s,m);g!==null&&(m.innerHTML=g)}return this};ce.toggleBold=di;ce.toggleItalic=pi;ce.toggleStrikethrough=gi;ce.toggleBlockquote=mi;ce.toggleHeadingSmaller=Bn;ce.toggleHeadingBigger=xi;ce.toggleHeading1=yi;ce.toggleHeading2=Di;ce.toggleHeading3=bi;ce.toggleHeading4=za;ce.toggleHeading5=_a;ce.toggleHeading6=Wa;ce.toggleCodeBlock=vi;ce.toggleUnorderedList=Ci;ce.toggleOrderedList=ki;ce.cleanBlock=wi;ce.drawLink=Si;ce.drawImage=Fi;ce.drawUploadedImage=Ua;ce.drawTable=Ai;ce.drawHorizontalRule=Ei;ce.undo=Li;ce.redo=Ti;ce.togglePreview=Bi;ce.toggleSideBySide=Vr;ce.toggleFullScreen=Er;ce.prototype.toggleBold=function(){di(this)};ce.prototype.toggleItalic=function(){pi(this)};ce.prototype.toggleStrikethrough=function(){gi(this)};ce.prototype.toggleBlockquote=function(){mi(this)};ce.prototype.toggleHeadingSmaller=function(){Bn(this)};ce.prototype.toggleHeadingBigger=function(){xi(this)};ce.prototype.toggleHeading1=function(){yi(this)};ce.prototype.toggleHeading2=function(){Di(this)};ce.prototype.toggleHeading3=function(){bi(this)};ce.prototype.toggleHeading4=function(){za(this)};ce.prototype.toggleHeading5=function(){_a(this)};ce.prototype.toggleHeading6=function(){Wa(this)};ce.prototype.toggleCodeBlock=function(){vi(this)};ce.prototype.toggleUnorderedList=function(){Ci(this)};ce.prototype.toggleOrderedList=function(){ki(this)};ce.prototype.cleanBlock=function(){wi(this)};ce.prototype.drawLink=function(){Si(this)};ce.prototype.drawImage=function(){Fi(this)};ce.prototype.drawUploadedImage=function(){Ua(this)};ce.prototype.drawTable=function(){Ai(this)};ce.prototype.drawHorizontalRule=function(){Ei(this)};ce.prototype.undo=function(){Li(this)};ce.prototype.redo=function(){Ti(this)};ce.prototype.togglePreview=function(){Bi(this)};ce.prototype.toggleSideBySide=function(){Vr(this)};ce.prototype.toggleFullScreen=function(){Er(this)};ce.prototype.isPreviewActive=function(){var s=this.codemirror,b=s.getWrapperElement(),c=b.lastChild;return c.classList.contains("editor-preview-active")};ce.prototype.isSideBySideActive=function(){var s=this.codemirror,b=s.getWrapperElement(),c=b.nextSibling;return c.classList.contains("editor-preview-active-side")};ce.prototype.isFullscreenActive=function(){var s=this.codemirror;return s.getOption("fullScreen")};ce.prototype.getState=function(){var s=this.codemirror;return hr(s)};ce.prototype.toTextArea=function(){var s=this.codemirror,b=s.getWrapperElement(),c=b.parentNode;c&&(this.gui.toolbar&&c.removeChild(this.gui.toolbar),this.gui.statusbar&&c.removeChild(this.gui.statusbar),this.gui.sideBySide&&c.removeChild(this.gui.sideBySide)),c.parentNode.insertBefore(b,c),c.remove(),s.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())};var nc=ce;const ic=Cf(nc),ac={name:"MarkdownInput",props:{value:{type:String,default:""},toolbar:{type:Array,default:()=>["bold","italic","heading","|","ordered-list","unordered-list","code","quote","|","link","image","horizontal-rule","|","preview","guide"]}},data(){return{uploadingFile:!1,uploadPercentage:"0%"}},methods:{init(){const s=new ic({element:this.$refs.target,initialValue:this.value,toolbar:this.toolbar,status:!1,uploadImage:!0,imagePathAbsolute:!0,imageUploadFunction:this.handleImageUpload});s.codemirror.on("change",()=>{this.$emit("input",s.value())}),s.codemirror.on("blur",()=>{this.$emit("blur")})},async handleImageUpload(s,b,c){this.uploadingFile=!0;const m=new FormData;m.append("file",s,s.name);const g=await this.$res.set.imageUpload(m,C=>{this.uploadPercentage=Math.round(C.loaded/C.total*100)+"%"});g&&b(g.location),this.uploadingFile=!1,this.uploadPercentage="0%"}},mounted(){this.init()}},lc={class:"fluency-markdown-editor"},oc={ref:"target"},uc={key:1,class:"d-flex justify-content-end"},sc=Vo("span",{class:"text-muted font-italic"},`
        Drag and drop images right onto the editor to add them to your post.
      `,-1),fc=[sc];function cc(s,b,c,m,g,C){const v=Ko("b-progress-bar"),x=Ko("b-progress");return Ha(),Xo("div",lc,[Vo("textarea",oc,null,512),wf(),g.uploadingFile?(Ha(),Sf(x,{key:0,class:"mt-3",max:"100"},{default:Ff(()=>[Af(v,{label:g.uploadPercentage,value:g.uploadPercentage,animated:"",variant:"success"},null,8,["label","value"])],void 0,!0),_:1})):(Ha(),Xo("div",uc,fc))])}const pc=kf(ac,[["render",cc]]);export{pc as M};
//# sourceMappingURL=C9a6afUy.js.map
