diff --git "a/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BEB2e8M3.js" "b/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BEB2e8M3.js" deleted file mode 100644--- "a/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BEB2e8M3.js" +++ /dev/null @@ -1,32 +0,0 @@ -import{O as e,k as t}from"./defaultSettingsView-D-g2vrvf.js";var n=e(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n||=self,n.CodeMirror=r())})(e,(function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),a=/Edge\/(\d+)/.exec(e),o=r||i||a,s=o&&(r?document.documentMode||6:+(a||i)[1]),c=!a&&/WebKit\//.test(e),l=c&&/Qt\/\d+\.\d+/.test(e),u=!a&&/Chrome\/(\d+)/.exec(e),d=u&&+u[1],f=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),m=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),g=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),_=/Android/.test(e),v=g||_||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),S=f&&e.match(/Version\/(\d*\.\d*)/);S&&=Number(S[1]),S&&S>=15&&(f=!1,c=!0);var C=y&&(l||f&&(S==null||S<12.11)),w=n||o&&s>=9;function T(e){return RegExp(`(^|\\s)`+e+`(?:$|\\s)\\s*`)}var E=function(e,t){var n=e.className,r=T(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 D(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function O(e,t){return D(e).appendChild(t)}function k(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)return o+(t-a);o+=s-a,o+=n-o%n,a=s+1}}var ie=function(){this.id=null,this.f=null,this.time=0,this.handler=L(this.onTimeout,this)};ie.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ie.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return r+Math.min(o,t-i);if(i+=a-r,i+=n-i%n,r=a+1,i>=t)return r}}var de=[``];function fe(e){for(;de.length<=e;)de.push(V(de)+` `);return de[e]}function V(e){return e[e.length-1]}function pe(e,t){for(var n=[],r=0;r`€`&&(e.toUpperCase()!=e.toLowerCase()||_e.test(e))}function ye(e,t){return t?t.source.indexOf(`\\w`)>-1&&ve(e)?!0:t.test(e):ve(e)}function be(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var xe=/[\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 Se(e){return e.charCodeAt(0)>=768&&xe.test(e)}function Ce(e,t,n){for(;(n<0?t>0:tn?-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 Te(e,t,n,r){if(!e)return r(t,n,`ltr`,0);for(var i=!1,a=0;at||t==n&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,n),o.level==1?`rtl`:`ltr`,a),i=!0)}i||r(t,n,`ltr`)}var Ee=null;function De(e,t,n){var r;Ee=null;for(var i=0;it)return i;a.to==t&&(a.from!=a.to&&n==`before`?r=i:Ee=i),a.from==t&&(a.from!=a.to&&n!=`before`?r=i:Ee=i)}return r??Ee}var Oe=(function(){function e(e){return e<=247?`bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN`.charAt(e):1424<=e&&e<=1524?`R`:1536<=e&&e<=1785?`nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111`.charAt(e-1536):1774<=e&&e<=2220?`r`:8192<=e&&e<=8203?`w`:e==8204?`b`:`L`}var t=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,r=/[LRr]/,i=/[Lb1n]/,a=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(s,c){var l=c==`ltr`?`L`:`R`;if(s.length==0||c==`ltr`&&!t.test(s))return!1;for(var u=s.length,d=[],f=0;f-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function W(e,t){var n=Ae(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function Pe(e){e.prototype.on=function(e,t){U(this,e,t)},e.prototype.off=function(e,t){je(this,e,t)}}function Fe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Le(e){return e.defaultPrevented==null?e.returnValue==0:e.defaultPrevented}function Re(e){Fe(e),Ie(e)}function ze(e){return e.target||e.srcElement}function Be(e){var t=e.which;return t??(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),y&&e.ctrlKey&&t==1&&(t=3),t}var Ve=function(){if(o&&s<9)return!1;var e=k(`div`);return`draggable`in e||`dragDrop`in e}(),He;function Ue(e){if(He==null){var t=k(`span`,`​`);O(e,k(`span`,[t,document.createTextNode(`x`)])),e.firstChild.offsetHeight!=0&&(He=t.offsetWidth<=1&&t.offsetHeight>2&&!(o&&s<8))}var n=He?k(`span`,`​`):k(`span`,`\xA0`,null,`display: inline-block; width: 1px; margin-right: -1px`);return n.setAttribute(`cm-text`,``),n}var We;function Ge(e){if(We!=null)return We;var t=O(e,document.createTextNode(`AخA`)),n=j(t,0,1).getBoundingClientRect(),r=j(t,1,2).getBoundingClientRect();return D(e),!n||n.left==n.right?!1:We=r.right-n.right<3}var Ke=` - -b`.split(/\n/).length==3?function(e){return e.split(/\r\n?|\n/)}: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),o=a.indexOf(`\r`);o==-1?(n.push(a),t=i+1):(n.push(a.slice(0,o)),t+=o+1)}return n},qe=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},Je=(function(){var e=k(`div`);return`oncopy`in e?!0:(e.setAttribute(`oncopy`,`return;`),typeof e.oncopy==`function`)})(),Ye=null;function Xe(e){if(Ye!=null)return Ye;var t=O(e,k(`span`,`x`)),n=t.getBoundingClientRect(),r=j(t,0,1).getBoundingClientRect();return Ye=Math.abs(n.left-r.left)>1}var Ze={},Qe={};function $e(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ze[e]=t}function et(e,t){Qe[e]=t}function tt(e){if(typeof e==`string`&&Qe.hasOwnProperty(e))e=Qe[e];else if(e&&typeof e.name==`string`&&Qe.hasOwnProperty(e.name)){var t=Qe[e.name];typeof t==`string`&&(t={name:t}),e=ge(t,e),e.name=t.name}else if(typeof e==`string`&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return tt(`application/xml`);else if(typeof e==`string`&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return tt(`application/json`);return typeof e==`string`?{name:e}:e||{name:`null`}}function nt(e,t){t=tt(t);var n=Ze[t.name];if(!n)return nt(e,`text/plain`);var r=n(e,t);if(rt.hasOwnProperty(t.name)){var i=rt[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 o in t.modeProps)r[o]=t.modeProps[o];return r}var rt={};function it(e,t){R(t,rt.hasOwnProperty(e)?rt[e]:rt[e]={})}function at(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 ot(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 st(e,t,n){return e.startState?e.startState(t,n):!0}var ct=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};ct.prototype.eol=function(){return this.pos>=this.string.length},ct.prototype.sol=function(){return this.pos==this.lineStart},ct.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ct.prototype.next=function(){if(this.post},ct.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ct.prototype.skipToEnd=function(){this.pos=this.string.length},ct.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ct.prototype.backUp=function(e){this.pos-=e},ct.prototype.column=function(){return this.lastColumnPos0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}},ct.prototype.current=function(){return this.string.slice(this.start,this.pos)},ct.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ct.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ct.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function K(e,t){if(t-=e.first,t<0||t>=e.size)throw 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=e.first&&tn?J(n,K(e,n).text.length):bt(t,K(e,t.line).text.length)}function bt(e,t){var n=e.ch;return n==null||n>t?J(e.line,t):n<0?J(e.line,0):e}function xt(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},Ct.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}},Ct.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ct.fromSaved=function(e,t,n){return t instanceof St?new Ct(e,at(e.mode,t.state),n,t.lookAhead):new Ct(e,at(e.mode,t),n)},Ct.prototype.save=function(e){var t=e===!1?this.state:at(this.doc.mode,this.state);return this.maxLookAhead>0?new St(t,this.maxLookAhead):t};function wt(e,t,n,r){var i=[e.state.modeGen],a={};Nt(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},a,r);for(var o=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],c=1,l=0;n.state=!0,Nt(e,t.text,s.mode,n,function(e,t){for(var n=c;le&&i.splice(c,1,e,i[c+1],r),c+=2,l=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,c-n,e,`overlay `+t),c=n+2;else for(;ne.options.maxHighlightLength&&at(e.doc.mode,r.state),a=wt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&=null,n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Et(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Ct(r,!0,t);var a=Pt(e,t,n),o=a>r.first&&K(r,a-1).stateAfter,s=o?Ct.fromSaved(r,o,a):new Ct(r,st(r.mode),a);return r.iter(a,t,function(n){Dt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return a}throw Error(`Mode `+e.name+` failed to advance stream.`)}var At=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function jt(e,t,n,r){var i=e.doc,a=i.mode,o;t=X(i,t);var s=K(i,t.line),c=Et(e,t.line,n),l=new ct(s.text,e.options.tabSize,c),u;for(r&&(u=[]);(r||l.pose.options.maxHighlightLength?(s=!1,o&&Dt(e,t,r,u.pos),u.pos=t.length,d=null):d=Mt(kt(n,u,r.state,f),a),f){var p=f[0].name;p&&(d=`m-`+(d?p+` `+d:p))}if(!s||l!=d){for(;co;--s){if(s<=a.first)return a.first;var c=K(a,s-1),l=c.stateAfter;if(l&&(!n||s+(l instanceof St?l.lookAhead:0)<=a.modeFrontier))return s;var u=z(c.text,null,e.options.tabSize);(i==null||r>u)&&(i=s-1,r=u)}return i}function Ft(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=K(e,r).stateAfter;if(i&&(!(i instanceof St)||r+i.lookAhead=t:a.to>t);(r||=[]).push(new Bt(o,a.from,s?null:a.to))}}return r}function Gt(e,t,n){var r;if(e)for(var i=0;i=t:a.to>t)||a.from==t&&o.type==`bookmark`&&(!n||a.marker.insertLeft)){var s=a.from==null||(o.inclusiveLeft?a.from<=t:a.from0&&s)for(var y=0;y0)){var u=[c,1],d=Y(l.from,s.from),f=Y(l.to,s.to);(d<0||!o.inclusiveLeft&&!d)&&u.push({from:l.from,to:s.from}),(f>0||!o.inclusiveRight&&!f)&&u.push({from:s.to,to:l.to}),i.splice.apply(i,u),c+=u.length-3}}return i}function Yt(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!r||$t(r,a.marker)<0)&&(r=a.marker)}return r}function an(e,t,n,r,i){var a=K(e,t),o=Lt&&a.markedSpans;if(o)for(var s=0;s=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?Y(l.to,n)>=0:Y(l.to,n)>0)||u>=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?Y(l.from,r)<=0:Y(l.from,r)<0)))return!0}}}function on(e){for(var t;t=tn(e);)e=t.find(-1,!0).line;return e}function sn(e){for(var t;t=nn(e);)e=t.find(1,!0).line;return e}function cn(e){for(var t,n;t=nn(e);)e=t.find(1,!0).line,(n||=[]).push(e);return n}function ln(e,t){var n=K(e,t),r=on(n);return n==r?t:q(r)}function un(e,t){if(t>e.lastLine())return t;var n=K(e,t),r;if(!dn(e,n))return t;for(;r=nn(n);)n=r.find(1,!0).line;return q(n)+1}function dn(e,t){var n=Lt&&t.markedSpans;if(n){for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var gn=function(e,t,n){this.text=e,Xt(this,t),this.height=n?n(this):1};gn.prototype.lineNo=function(){return q(this)},Pe(gn);function _n(e,t,n,r){e.text=t,e.stateAfter&&=null,e.styles&&=null,e.order!=null&&(e.order=null),Yt(e),Xt(e,n);var i=r?r(e):1;i!=e.height&&dt(e,i)}function vn(e){e.parent=null,Yt(e)}var yn={},bn={};function xn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?bn:yn;return n[e]||(n[e]=e.replace(/\S+/g,`cm-$&`))}function Sn(e,t){var n=A(`span`,null,null,c?`padding-right: .1px`:null),r={pre:A(`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,o=void 0;r.pos=0,r.addToken=wn,Ge(e.display.measure)&&(o=H(a,e.doc.direction))&&(r.addToken=En(r.addToken,o)),r.map=[],On(a,r,Tt(e,a,t!=e.display.externalMeasured&&q(a))),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=N(a.styleClasses.bgClass,r.bgClass||``)),a.styleClasses.textClass&&(r.textClass=N(a.styleClasses.textClass,r.textClass||``))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Ue(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(c){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(`.cm-tab`))&&(r.content.className=`cm-tab-wrap-hack`)}return W(e,`renderLine`,e,t.line,r.pre),r.pre.className&&(r.textClass=N(r.pre.className,r.textClass||``)),r}function Cn(e){var t=k(`span`,`•`,`cm-invalidchar`);return t.title=`\\u`+e.charCodeAt(0).toString(16),t.setAttribute(`aria-label`,t.title),t}function wn(e,t,n,r,i,a,c){if(t){var l=e.splitSpaces?Tn(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1,f;if(!u.test(t))e.col+=t.length,f=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,f),o&&s<9&&(d=!0),e.pos+=t.length;else{f=document.createDocumentFragment();for(var p=0;;){u.lastIndex=p;var m=u.exec(t),h=m?m.index-p:t.length-p;if(h){var g=document.createTextNode(l.slice(p,p+h));o&&s<9?f.appendChild(k(`span`,[g])):f.appendChild(g),e.map.push(e.pos,e.pos+h,g),e.col+=h,e.pos+=h}if(!m)break;p+=h+1;var _=void 0;if(m[0]==` `){var v=e.cm.options.tabSize,y=v-e.col%v;_=f.appendChild(k(`span`,fe(y),`cm-tab`)),_.setAttribute(`role`,`presentation`),_.setAttribute(`cm-text`,` `),e.col+=y}else m[0]==`\r`||m[0]==` -`?(_=f.appendChild(k(`span`,m[0]==`\r`?`␍`:`␤`,`cm-invalidchar`)),_.setAttribute(`cm-text`,m[0]),e.col+=1):(_=e.cm.options.specialCharPlaceholder(m[0]),_.setAttribute(`cm-text`,m[0]),o&&s<9?f.appendChild(k(`span`,[_])):f.appendChild(_),e.col+=1);e.map.push(e.pos,e.pos+1,_),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||d||a||c){var b=n||``;r&&(b+=r),i&&(b+=i);var x=k(`span`,[f],b,a);if(c)for(var S in c)c.hasOwnProperty(S)&&S!=`style`&&S!=`class`&&x.setAttribute(S,c[S]);return e.content.appendChild(x)}e.content.appendChild(f)}}function Tn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r=``,i=0;il&&d.from<=l));f++);if(d.to>=u)return e(n,r,i,a,o,s,c);e(n,r.slice(0,d.to-l),i,a,null,s,c),a=null,r=r.slice(d.to-l),l=d.to}}}function Dn(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||=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 On(e,t,n){var r=e.markedSpans,i=e.text,a=0;if(!r){for(var o=1;oc||C.collapsed&&S.to==c&&S.from==c)){if(S.to!=null&&S.to!=c&&p>S.to&&(p=S.to,h=``),C.className&&(m+=` `+C.className),C.css&&(f=(f?f+`;`:``)+C.css),C.startStyle&&S.from==c&&(g+=` `+C.startStyle),C.endStyle&&S.to==p&&(b||=[]).push(C.endStyle,S.to),C.title&&((v||={}).title=C.title),C.attributes)for(var w in C.attributes)(v||={})[w]=C.attributes[w];C.collapsed&&(!_||$t(_.marker,C)<0)&&(_=S)}else S.from>c&&p>S.from&&(p=S.from)}if(b)for(var T=0;T=s)break;for(var D=Math.min(s,p);;){if(u){var O=c+u.length;if(!_){var k=O>D?u.slice(0,D-c):u;t.addToken(t,k,d?d+m:m,g,c+k.length==p?h:``,f,v)}if(O>=D){u=u.slice(D-c),c=D;break}c=O,g=``}u=i.slice(a,a=n[l++]),d=xn(n[l++],t.cm.options)}}}function kn(e,t,n){this.line=t,this.rest=cn(t),this.size=this.rest?q(V(this.rest))-n+1:1,this.node=this.text=null,this.hidden=dn(e,t)}function An(e,t,n){for(var r=[],i,a=t;a2&&a.push((c.bottom+l.top)/2-n.top)}}a.push(n.bottom-n.top)}}function ar(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function or(e,t){t=on(t);var n=q(t),r=e.display.externalMeasured=new kn(e.doc,t,n);r.lineN=n;var i=r.built=Sn(e,r);return r.text=i.pre,O(e.display.lineMeasure,i.pre),r}function sr(e,t,n,r){return ur(e,lr(e,t),n,r)}function cr(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(a=c-s,i=a-1,t>=c&&(o=`right`)),i!=null){if(r=e[l+2],s==c&&n==(r.insertLeft?`left`:`right`)&&(o=n),n==`left`&&i==0)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[(l-=3)+2],o=`left`;if(n==`right`&&i==c-s)for(;l=0&&(n=e[i]).left==n.right;i--);return n}function mr(e,t,n,r){var i=fr(t.map,n,r),a=i.node,c=i.start,l=i.end,u=i.collapse,d;if(a.nodeType==3){for(var f=0;f<4;f++){for(;c&&Se(t.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+l0&&(u=r=`right`);var p;d=e.options.lineWrapping&&(p=a.getClientRects()).length>1?p[r==`right`?p.length-1:0]:a.getBoundingClientRect()}if(o&&s<9&&!c&&(!d||!d.left&&!d.right)){var m=a.parentNode.getClientRects()[0];d=m?{left:m.left,right:m.left+Lr(e.display),top:m.top,bottom:m.bottom}:dr}for(var h=d.top-t.rect.top,g=d.bottom-t.rect.top,_=(h+g)/2,v=t.view.measure.heights,y=0;y=r.text.length?(c=r.text.length,l=`before`):c<=0&&(c=0,l=`after`),!s)return o(l==`before`?c-1:c,l==`before`);function u(e,t,n){var r=s[t].level==1;return o(n?e-1:e,r!=n)}var d=De(s,c,l),f=Ee,p=u(c,d,l==`before`);return f!=null&&(p.other=u(c,f,l!=`before`)),p}function Er(e,t){var n=0;t=X(e.doc,t),e.options.lineWrapping||(n=Lr(e.display)*t.ch);var r=K(e.doc,t.line),i=pn(r)+Qn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Dr(e,t,n,r,i){var a=J(e,t,n);return a.xRel=i,r&&(a.outside=r),a}function Or(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Dr(r.first,0,null,-1,-1);var i=ft(r,n),a=r.first+r.size-1;if(i>a)return Dr(r.first+r.size-1,K(r,a).text.length,null,1,1);t<0&&(t=0);for(var o=K(r,i);;){var s=Mr(e,o,i,t,n),c=rn(o,s.ch+ +(s.xRel>0||s.outside>0));if(!c)return s;var l=c.find(1);if(l.line==i)return l;o=K(r,i=l.line)}}function kr(e,t,n,r){r-=xr(t);var i=t.text.length,a=we(function(t){return ur(e,n,t-1).bottom<=r},i,0);return i=we(function(t){return ur(e,n,t).top>r},a,i),{begin:a,end:i}}function Ar(e,t,n,r){n||=lr(e,t);var i=Sr(e,t,ur(e,n,r),`line`).top;return kr(e,t,n,i)}function jr(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Mr(e,t,n,r,i){i-=pn(t);var a=lr(e,t),o=xr(t),s=0,c=t.text.length,l=!0,u=H(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?Pr:Nr)(e,t,n,a,u,r,i);l=d.level!=1,s=l?d.from:d.to-1,c=l?d.to:d.from-1}var f=null,p=null,m=we(function(t){var n=ur(e,a,t);return n.top+=o,n.bottom+=o,jr(n,r,i,!1)?(n.top<=i&&n.left<=r&&(f=t,p=n),!0):!1},s,c),h,g,_=!1;if(p){var v=r-p.left=b.bottom)}return m=Ce(t.text,m,1),Dr(n,m,g,_,r-h)}function Nr(e,t,n,r,i,a,o){var s=we(function(s){var c=i[s],l=c.level!=1;return jr(Tr(e,J(n,l?c.to:c.from,l?`before`:`after`),`line`,t,r),a,o,!0)},0,i.length-1),c=i[s];if(s>0){var l=c.level!=1,u=Tr(e,J(n,l?c.from:c.to,l?`after`:`before`),`line`,t,r);jr(u,a,o,!0)&&u.top>o&&(c=i[s-1])}return c}function Pr(e,t,n,r,i,a,o){var s=kr(e,t,r,o),c=s.begin,l=s.end;/\s/.test(t.text.charAt(l-1))&&l--;for(var u=null,d=null,f=0;f=l||p.to<=c)){var m=ur(e,r,p.level==1?Math.max(c,p.from):Math.min(l,p.to)-1).right,h=mh)&&(u=p,d=h)}}return u||=i[i.length-1],u.froml&&(u={from:u.from,to:l,level:u.level}),u}var Fr;function Ir(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Fr==null){Fr=k(`pre`,null,`CodeMirror-line-like`);for(var t=0;t<49;++t)Fr.appendChild(document.createTextNode(`x`)),Fr.appendChild(k(`br`));Fr.appendChild(document.createTextNode(`x`))}O(e.measure,Fr);var n=Fr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),D(e.measure),n||1}function Lr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=k(`span`,`xxxxxxxxxx`),n=k(`pre`,[t],`CodeMirror-line-like`);O(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Rr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o){var s=e.display.gutterSpecs[o].className;n[s]=a.offsetLeft+a.clientLeft+i,r[s]=a.clientWidth}return{fixedPos:zr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function zr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Br(e){var t=Ir(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Lr(e.display)-3);return function(i){if(dn(e.doc,i))return 0;var a=0;if(i.widgets)for(var o=0;o0&&(l=K(e.doc,c.line).text).length==c.ch){var u=z(l,l.length,e.options.tabSize)-l.length;c=J(c.line,Math.max(0,Math.round((a-er(e.display).left)/Lr(e.display))-u))}return c}function Ur(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Lt&&ln(e.doc,t)i.viewFrom?Kr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Kr(e);else if(t<=i.viewFrom){var a=qr(e,n,n+r,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=r):Kr(e)}else if(n>=i.viewTo){var o=qr(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Kr(e)}else{var s=qr(e,t,t,-1),c=qr(e,n,n+r,1);s&&c?(i.view=i.view.slice(0,s.index).concat(An(e,s.lineN,c.lineN)).concat(i.view.slice(c.index)),i.viewTo+=r):Kr(e)}var l=i.externalMeasured;l&&(n=i.lineN&&t=r.viewTo)){var a=r.view[Ur(e,t)];if(a.node!=null){var o=a.changes||=[];B(o,n)==-1&&o.push(n)}}}function Kr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function qr(e,t,n,r){var i=Ur(e,t),a,o=e.display.view;if(!Lt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var s=e.display.viewFrom,c=0;c0){if(i==o.length-1)return null;a=s+o[i].size-t,i++}else a=s-t;t+=a,n+=a}for(;ln(e.doc,n)!=n;){if(i==(r<0?0:o.length-1))return null;n+=r*o[i-+(r<0)].size,i+=r}return{index:i,lineN:n}}function Jr(e,t,n){var r=e.display;r.view.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=An(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=An(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Ur(e,n)))),r.viewTo=n}function Yr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||c.to().line0?o:e.defaultCharWidth())+`px`}if(r.other){var s=n.appendChild(k(`div`,`\xA0`,`CodeMirror-cursor CodeMirror-secondarycursor`));s.style.display=``,s.style.left=r.other.left+`px`,s.style.top=r.other.top+`px`,s.style.height=(r.other.bottom-r.other.top)*.85+`px`}}function $r(e,t){return e.top-t.top||e.left-t.left}function ei(e,t,n){var r=e.display,i=e.doc,a=document.createDocumentFragment(),o=er(e.display),s=o.left,c=Math.max(r.sizerWidth,nr(e)-r.sizer.offsetLeft)-o.right,l=i.direction==`ltr`;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),a.appendChild(k(`div`,null,`CodeMirror-selected`,`position: absolute; left: `+e+`px; - top: `+t+`px; width: `+(n??c-e)+`px; - height: `+(r-t)+`px`))}function d(t,n,r){var a=K(i,t),o=a.text.length,d,f;function p(n,r){return wr(e,J(t,n),`div`,a,r)}function m(t,n,r){var i=Ar(e,a,null,t),o=n==`ltr`==(r==`after`)?`left`:`right`;return p(r==`after`?i.begin:i.end-(/\s/.test(a.text.charAt(i.end-1))?2:1),o)[o]}var h=H(a,i.direction);return Te(h,n||0,r??o,function(e,t,i,a){var g=i==`ltr`,_=p(e,g?`left`:`right`),v=p(t-1,g?`right`:`left`),y=n==null&&e==0,b=r==null&&t==o,x=a==0,S=!h||a==h.length-1;if(v.top-_.top<=3){var C=(l?y:b)&&x,w=(l?b:y)&&S,T=C?s:(g?_:v).left,E=w?c:(g?v:_).right;u(T,_.top,E-T,_.bottom)}else{var D,O,k,A;g?(D=l&&y&&x?s:_.left,O=l?c:m(e,i,`before`),k=l?s:m(t,i,`after`),A=l&&b&&S?c:v.right):(D=l?m(e,i,`before`):s,O=!l&&y&&x?c:_.right,k=!l&&b&&S?s:v.left,A=l?m(t,i,`after`):c),u(D,_.top,O-D,_.bottom),_.bottom0?t.blinker=setInterval(function(){e.hasFocus()||ai(e),t.cursorDiv.style.visibility=(n=!n)?``:`hidden`},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility=`hidden`)}}function ni(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ii(e))}function ri(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&ai(e))},100)}function ii(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!=`nocursor`&&(e.state.focused||(W(e,`focus`,e,t),e.state.focused=!0,te(e.display.wrapper,`CodeMirror-focused`),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),c&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ti(e))}function ai(e,t){e.state.delayingBlurEvent||(e.state.focused&&(W(e,`blur`,e,t),e.state.focused=!1,E(e.display.wrapper,`CodeMirror-focused`)),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function oi(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,c=0;c.005||h<-.005)&&(ie.display.sizerWidth){var _=Math.ceil(f/Lr(e.display));_>e.display.maxLineLength&&(e.display.maxLineLength=_,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function si(e){if(e.widgets)for(var t=0;t=o&&(a=ft(t,pn(K(t,c))-e.wrapper.clientHeight),o=c)}return{from:a,to:Math.max(o,a+1)}}function li(e,t){if(!G(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&&!h){var o=k(`div`,`​`,null,`position: absolute; - top: `+(t.top-n.viewOffset-Qn(e.display))+`px; - height: `+(t.bottom-t.top+tr(e)+n.barHeight)+`px; - left: `+t.left+`px; width: `+Math.max(2,t.right-t.left)+`px;`);e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ui(e,t,n,r){r??=0;var i;!e.options.lineWrapping&&t==n&&(n=t.sticky==`before`?J(t.line,t.ch+1,`before`):t,t=t.ch?J(t.line,t.sticky==`before`?t.ch-1:t.ch,`after`):t);for(var a=0;a<5;a++){var o=!1,s=Tr(e,t),c=!n||n==t?s:Tr(e,n);i={left:Math.min(s.left,c.left),top:Math.min(s.top,c.top)-r,right:Math.max(s.left,c.left),bottom:Math.max(s.bottom,c.bottom)+r};var l=fi(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(l.scrollTop!=null&&(yi(e,l.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),l.scrollLeft!=null&&(xi(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(o=!0)),!o)break}return i}function di(e,t){var n=fi(e,t);n.scrollTop!=null&&yi(e,n.scrollTop),n.scrollLeft!=null&&xi(e,n.scrollLeft)}function fi(e,t){var n=e.display,r=Ir(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=rr(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+$n(n),c=t.tops-r;if(t.topi+a){var u=Math.min(t.top,(l?s:t.bottom)-a);u!=i&&(o.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=nr(e)-n.gutters.offsetWidth,m=t.right-t.left>p;return m&&(t.right=t.left+p),t.left<10?o.scrollLeft=0:t.leftp+f-3&&(o.scrollLeft=t.right+(m?0:10)-p),o}function pi(e,t){t!=null&&(_i(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function mi(e){_i(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function hi(e,t,n){(t!=null||n!=null)&&_i(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function gi(e,t){_i(e),e.curOp.scrollToPos=t}function _i(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,vi(e,Er(e,t.from),Er(e,t.to),t.margin))}function vi(e,t,n,r){var i=fi(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});hi(e,i.scrollLeft,i.scrollTop)}function yi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Xi(e,{top:t}),bi(e,t,!0),n&&Xi(e),Hi(e,100))}function bi(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 xi(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,ea(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Si(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+$n(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+tr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Ci=function(e,t,n){this.cm=n;var r=this.vert=k(`div`,[k(`div`,null,null,`min-width: 1px`)],`CodeMirror-vscrollbar`),i=this.horiz=k(`div`,[k(`div`,null,null,`height: 100%; min-height: 1px`)],`CodeMirror-hscrollbar`);r.tabIndex=i.tabIndex=-1,e(r),e(i),U(r,`scroll`,function(){r.clientHeight&&t(r.scrollTop,`vertical`)}),U(i,`scroll`,function(){i.clientWidth&&t(i.scrollLeft,`horizontal`)}),this.checkedZeroWidth=!1,o&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth=`18px`)};Ci.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}},Ci.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,`horiz`)},Ci.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,`vert`)},Ci.prototype.zeroWidthHack=function(){var e=y&&!m?`12px`:`18px`;this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility=`hidden`,this.disableHoriz=new ie,this.disableVert=new ie},Ci.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility=``;function r(){var i=e.getBoundingClientRect();(n==`vert`?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))==e?t.set(1e3,r):e.style.visibility=`hidden`}t.set(1e3,r)},Ci.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wi=function(){};wi.prototype.update=function(){return{bottom:0,right:0}},wi.prototype.setScrollLeft=function(){},wi.prototype.setScrollTop=function(){},wi.prototype.clear=function(){};function Ti(e,t){t||=Si(e);var n=e.display.barWidth,r=e.display.barHeight;Ei(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&oi(e),Ei(e,Si(e)),n=e.display.barWidth,r=e.display.barHeight}function Ei(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 Di={native:Ci,null:wi};function Oi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Di[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),U(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`?xi(e,t):yi(e,t)},e),e.display.scrollbars.addClass&&te(e.display.wrapper,e.display.scrollbars.addClass)}var ki=0;function Ai(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:++ki,markArrays:null},Mn(e.curOp)}function ji(e){var t=e.curOp;t&&Pn(t,function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Wi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Pi(e){e.updatedDisplay=e.mustUpdate&&Ji(e.cm,e.update)}function Fi(e){var t=e.cm,n=t.display;e.updatedDisplay&&oi(t),e.barMeasure=Si(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=sr(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+tr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-nr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Ii(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+`px`,e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Et(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 o=a.styles,s=a.text.length>e.options.maxHighlightLength?at(t.mode,r.state):null,c=wt(e,a,r,!0);s&&(r.state=s),a.styles=c.styles;var l=a.styleClasses,u=c.classes;u?a.styleClasses=u:l&&(a.styleClasses=null);for(var d=!o||o.length!=a.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),f=0;!d&&fn)return Hi(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Ri(e,function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Yr(e)==0)return!1;ta(e)&&(Kr(e),t.dims=Rr(e));var i=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFromo&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),Lt&&(a=ln(e.doc,a),o=un(e.doc,o));var s=a!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Jr(e,a,o),n.viewOffset=pn(K(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+`px`;var c=Yr(e);if(!s&&c==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var l=Ki(e);return c>4&&(n.lineDiv.style.display=`none`),Zi(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=``),n.renderedView=n.view,qi(l),D(n.cursorDiv),D(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Hi(e,400)),n.updateLineNumbers=null,!0}function Yi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==nr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+$n(e.display)-rr(e),n.top)}),t.visible=ci(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ci(e.display,e.doc,n));if(!Ji(e,t))break;oi(e);var i=Si(e);Xr(e),Ti(e,i),$i(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 Xi(e,t){var n=new Wi(e,t);if(Ji(e,n)){oi(e),Yi(e,n);var r=Si(e);Xr(e),Ti(e,r),$i(e,r),n.finish()}}function Zi(e,t,n){var r=e.display,i=e.options.lineNumbers,a=r.lineDiv,o=a.firstChild;function s(t){var n=t.nextSibling;return c&&y&&e.display.currentWheelTarget==t?t.style.display=`none`:t.parentNode.removeChild(t),n}for(var l=r.view,u=r.viewFrom,d=0;d-1&&(m=!1),Rn(e,f,u,n)),m&&(D(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(mt(e.options,u)))),o=f.node.nextSibling}u+=f.size}for(;o;)o=s(o)}function Qi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+`px`,In(e,`gutterChanged`,e)}function $i(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+tr(e)+`px`}function ea(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=zr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=r+`px`,o=0;o=105&&(a.wrapper.style.clipPath=`inset(0px)`),a.wrapper.setAttribute(`translate`,`no`),o&&s<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),!c&&!(n&&v)&&(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=na(i.gutters,i.lineNumbers),ra(a),r.init(a)}var oa=0,sa=null;o?sa=-.53:n?sa=15:u?sa=-.7:p&&(sa=-1/3);function ca(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??=e.wheelDelta,{x:t,y:n}}function la(e){var t=ca(e);return t.x*=sa,t.y*=sa,t}function ua(e,t){u&&d==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 r=ca(t),i=r.x,a=r.y,o=sa;t.deltaMode===0&&(i=t.deltaX,a=t.deltaY,o=1);var s=e.display,l=s.scroller,p=l.scrollWidth>l.clientWidth,m=l.scrollHeight>l.clientHeight;if(i&&p||a&&m){if(a&&y&&c){outer:for(var h=t.target,g=s.view;h!=l;h=h.parentNode)for(var _=0;_=0&&Y(e,r.to())<=0)return n}return-1};var Z=function(e,t){this.anchor=e,this.head=t};Z.prototype.from=function(){return vt(this.anchor,this.head)},Z.prototype.to=function(){return _t(this.anchor,this.head)},Z.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function fa(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(e,t){return Y(e.from(),t.from())}),n=B(t,i);for(var a=1;a0:c>=0){var l=vt(s.from(),o.from()),u=_t(s.to(),o.to()),d=s.empty()?o.from()==o.head:s.from()==s.head;a<=n&&--n,t.splice(--a,2,new Z(d?u:l,d?l:u))}}return new da(t,n)}function pa(e,t){return new da([new Z(e,t||e)],0)}function ma(e){return e.text?J(e.from.line+e.text.length-1,V(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ha(e,t){if(Y(e,t.from)<0)return e;if(Y(e,t.to)<=0)return ma(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+=ma(t).ch-t.to.ch),J(n,r)}function ga(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,m-1),e.insert(s.line+1,_)}In(e,`change`,e,t)}function Ca(e,t,n){function r(e,i,a){if(e.linked)for(var o=0;o1&&!e.done[e.done.length-2].ranges)return e.done.pop(),V(e.done)}function ja(e,t,n,r){var i=e.history;i.undone.length=0;var a=+new Date,o,s;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)==`*`))&&(o=Aa(i,i.lastOp==r)))s=V(o.changes),Y(t.from,t.to)==0&&Y(t.from,s.to)==0?s.to=ma(t):o.changes.push(Oa(e,t));else{var c=V(i.done);for((!c||!c.ranges)&&Pa(e.sel,i.done),o={changes:[Oa(e,t)],generation:i.generation},i.done.push(o);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,s||W(e,`historyAdded`)}function Ma(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 Na(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||Ma(e,a,V(i.done),t))?i.done[i.done.length-1]=t:Pa(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=n,r&&r.clearRedo!==!1&&ka(i.undone)}function Pa(e,t){var n=V(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Fa(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(n){n.markedSpans&&((i||=t[`spans_`+e.id]={})[a]=n.markedSpans),++a})}function Ia(e){if(!e)return null;for(var t,n=0;n-1&&(V(s)[d]=l[d],delete l[d])}}return r}function Ba(e,t,n,r){if(r){var i=e.anchor;if(n){var a=Y(t,i)<0;a==Y(n,i)<0?a!=Y(t,n)<0&&(t=n):(i=t,t=n)}return new Z(i,t)}else return new Z(n||t,t)}function Va(e,t,n,r,i){i??=e.cm&&(e.cm.display.shift||e.extend),qa(e,new da([Ba(e.sel.primary(),t,n,i)],0),r)}function Ha(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a=t.ch:s.to>t.ch))){if(i&&(W(c,`beforeCursorEnter`),c.explicitlyCleared))if(a.markedSpans){--o;continue}else break;if(!c.atomic)continue;if(n){var d=c.find(r<0?1:-1),f=void 0;if((r<0?u:l)&&(d=eo(e,d,-r,d&&d.line==t.line?a:null)),d&&d.line==t.line&&(f=Y(d,n))&&(r<0?f<0:f>0))return Qa(e,d,t,r,i)}var p=c.find(r<0?-1:1);return(r<0?l:u)&&(p=eo(e,p,r,p.line==t.line?a:null)),p?Qa(e,p,t,r,i):null}}return t}function $a(e,t,n,r,i){var a=r||1;return Qa(e,t,n,a,i)||!i&&Qa(e,t,n,a,!0)||Qa(e,t,n,-a,i)||!i&&Qa(e,t,n,-a,!0)||(e.cantEdit=!0,J(e.first,0))}function eo(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?X(e,J(t.line-1)):null:n>0&&t.ch==(r||K(e,t.line)).text.length?t.line=0;--i)io(e,{from:r[i].from,to:r[i].to,text:i?[``]:t.text,origin:t.origin});else io(e,t)}}function io(e,t){if(!(t.text.length==1&&t.text[0]==``&&Y(t.from,t.to)==0)){var n=ga(e,t);ja(e,t,n,e.cm?e.cm.curOp.id:NaN),so(e,t,n,Kt(e,t));var r=[];Ca(e,function(e,n){!n&&B(r,e.history)==-1&&(po(e.history,t),r.push(e.history)),so(e,t,null,Kt(e,t))})}}function ao(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,a,o=e.sel,s=t==`undo`?i.done:i.undone,c=t==`undo`?i.undone:i.done,l=0;l=0;--p){var m=f(p);if(m)return m.v}}}}function oo(e,t){if(t!=0&&(e.first+=t,e.sel=new da(pe(e.sel.ranges,function(e){return new Z(J(e.anchor.line+t,e.anchor.ch),J(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Wr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.linea&&(t={from:t.from,to:J(a,K(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=lt(e,t.from,t.to),n||=ga(e,t),e.cm?co(e.cm,t,r):Sa(e,t,r),Ja(e,n,se),e.cantEdit&&$a(e,J(e.firstLine(),0))&&(e.cantEdit=!1)}}function co(e,t,n){var r=e.doc,i=e.display,a=t.from,o=t.to,s=!1,c=a.line;e.options.lineWrapping||(c=q(on(K(r,a.line))),r.iter(c,o.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Me(e),Sa(r,t,n,Br(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=mn(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),Ft(r,a.line),Hi(e,400);var l=t.text.length-(o.line-a.line)-1;t.full?Wr(e):a.line==o.line&&t.text.length==1&&!xa(e.doc,t)?Gr(e,a.line,`text`):Wr(e,a.line,o.line+1,l);var u=Ne(e,`changes`),d=Ne(e,`change`);if(d||u){var f={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};d&&In(e,`change`,e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function lo(e,t,n,r,i){var a;r||=n,Y(r,n)<0&&(a=[r,n],n=a[0],r=a[1]),typeof t==`string`&&(t=e.splitLines(t)),ro(e,{from:n,to:r,text:t,origin:i})}function uo(e,t,n,r){n1||!(this.children[0]instanceof ho))){var s=[];this.collapse(s),this.children=[new ho(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var o=i.lines.length%25+25,s=o;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Wr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xa(e.doc)),e&&In(e,`markerCleared`,e,this,r,i),t&&ji(e),this.parent&&this.parent.clear()}},xo.prototype.find=function(e,t){e==null&&this.type==`bookmark`&&(e=1);for(var n,r,i=0;i0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=A(`span`,[a.replacedWith],`CodeMirror-widget`),r.handleMouseEvents||a.widgetNode.setAttribute(`cm-ignore-events`,`true`),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(an(e,t.line,t,n,a)||t.line!=n.line&&an(e,n.line,t,n,a))throw Error(`Inserting collapsed marker partially overlapping an existing one`);zt()}a.addToHistory&&ja(e,{from:t,to:n,origin:`markText`},e.sel,NaN);var s=t.line,c=e.cm,l;if(e.iter(s,n.line+1,function(r){c&&a.collapsed&&!c.options.lineWrapping&&on(r)==c.display.maxLine&&(l=!0),a.collapsed&&s!=t.line&&dt(r,0),Ut(r,new Bt(a,s==t.line?t.ch:null,s==n.line?n.ch:null),e.cm&&e.cm.curOp),++s}),a.collapsed&&e.iter(t.line,n.line+1,function(t){dn(e,t)&&dt(t,0)}),a.clearOnEnter&&U(a,`beforeCursorEnter`,function(){return a.clear()}),a.readOnly&&(Rt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++bo,a.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),a.collapsed)Wr(c,t.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var u=t.line;u<=n.line;u++)Gr(c,u,`text`);a.atomic&&Xa(c.doc),In(c,`markerAdded`,c,a)}return a}var Co=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;c--)ro(this,r[c]);s?Ka(this,s):this.cm&&mi(this.cm)}),undo:Vi(function(){ao(this,`undo`)}),redo:Vi(function(){ao(this,`redo`)}),undoSelection:Vi(function(){ao(this,`undo`,!0)}),redoSelection:Vi(function(){ao(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.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=X(this,e),t=X(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var o=a.markedSpans;if(o)for(var s=0;s=c.to||c.from==null&&i!=e.line||c.from!=null&&i==t.line&&c.from>=t.ch)&&(!n||n(c.marker))&&r.push(c.marker.parent||c.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=a,++n}),X(this,J(n,t))},indexFromPos:function(e){e=X(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var d=e.dataTransfer.getData(`Text`);if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Ja(t.doc,pa(n,n)),f)for(var p=0;p=0;t--)lo(e.doc,``,r[t].from,r[t].to,`+delete`);mi(e)})}function $o(e,t,n){var r=Ce(e.text,t+n,n);return r<0||r>e.text.length?null:r}function es(e,t,n){var r=$o(e,t.ch,n);return r==null?null:new J(t.line,r,n<0?`after`:`before`)}function ts(e,t,n,r,i){if(e){t.doc.direction==`rtl`&&(i=-i);var a=H(n,t.doc.direction);if(a){var o=i<0?V(a):a[0],s=i<0==(o.level==1)?`after`:`before`,c;if(o.level>0||t.doc.direction==`rtl`){var l=lr(t,n);c=i<0?n.text.length-1:0;var u=ur(t,l,c).top;c=we(function(e){return ur(t,l,e).top==u},i<0==(o.level==1)?o.from:o.to-1,c),s==`before`&&(c=$o(n,c,1))}else c=i<0?o.to:o.from;return new J(r,c,s)}}return new J(r,i<0?n.text.length:0,i<0?`before`:`after`)}function ns(e,t,n,r){var i=H(t,e.doc.direction);if(!i)return es(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=De(i,n.ch,n.sticky),o=i[a];if(e.doc.direction==`ltr`&&o.level%2==0&&(r>0?o.to>n.ch:o.from=o.from&&f>=u.begin)){var p=d?`before`:`after`;return new J(n.line,f,p)}}var m=function(e,t,r){for(var a=function(e,t){return t?new J(n.line,s(e,1),`before`):new J(n.line,e,`after`)};e>=0&&e0==(o.level!=1),l=c?r.begin:s(r.end,-1);if(o.from<=l&&l0?u.end:s(u.begin,-1);return g!=null&&!(r>0&&g==t.text.length)&&(h=m(r>0?0:i.length-1,r,l(g)),h)?h:null}var rs={selectAll:to,singleSelection:function(e){return e.setSelection(e.getCursor(`anchor`),e.getCursor(`head`),se)},killLine:function(e){return Qo(e,function(t){if(t.empty()){var n=K(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new J(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),J(i.line,i.ch-2),i,`+transpose`);else if(i.line>e.doc.first){var o=K(e.doc,i.line-1).text;o&&(i=new J(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),J(i.line-1,o.length-1),i,`+transpose`))}}n.push(new Z(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Ri(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;re&&Y(t,this.pos)==0&&n==this.button};var xs,Ss;function Cs(e,t){var n=+new Date;return Ss&&Ss.compare(n,e,t)?(xs=Ss=null,`triple`):xs&&xs.compare(n,e,t)?(Ss=new bs(n,e,t),xs=null,`double`):(xs=new bs(n,e,t),Ss=null,`single`)}function ws(e){var t=this,n=t.display;if(!(G(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Zn(n,e)){c||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Ns(t,e)){var r=Hr(t,e),i=Be(e),a=r?Cs(r,i):`single`;I(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Ts(t,i,r,a,e))&&(i==1?r?Ds(t,r,a,e):ze(e)==n.scroller&&Fe(e):i==2?(r&&Va(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(w?t.display.input.onContextMenu(e):ri(t)))}}}function Ts(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,us(e,Yo(a,i),i,function(t){if(typeof t==`string`&&(t=rs[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=oe}finally{e.state.suppressEdits=!1}return r})}function Es(e,t,n){var r=e.getOption(`configureMouse`),i=r?r(e,t,n):{};return i.unit??=(b?n.shiftKey&&n.metaKey:n.altKey)?`rectangle`:t==`single`?`char`:t==`double`?`word`:`line`,(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew??=y?n.metaKey:n.ctrlKey,i.moveOnDrag??=!(y?n.altKey:n.ctrlKey),i}function Ds(e,t,n,r){o?setTimeout(L(ni,e),0):e.curOp.focus=ee(re(e));var i=Es(e,n,r),a=e.doc.sel,s;e.options.dragDrop&&Ve&&!e.isReadOnly()&&n==`single`&&(s=a.contains(t))>-1&&(Y((s=a.ranges[s]).from(),t)<0||t.xRel>0)&&(Y(s.to(),t)>0||t.xRel<0)?Os(e,r,t,i):As(e,r,t,i)}function Os(e,t,n,r){var i=e.display,a=!1,l=zi(e,function(t){c&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:ri(e)),je(i.wrapper.ownerDocument,`mouseup`,l),je(i.wrapper.ownerDocument,`mousemove`,u),je(i.scroller,`dragstart`,d),je(i.scroller,`drop`,l),a||(Fe(t),r.addNew||Va(e.doc,n,null,null,r.extend),c&&!p||o&&s==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),u=function(e){a||=Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return a=!0};c&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,U(i.wrapper.ownerDocument,`mouseup`,l),U(i.wrapper.ownerDocument,`mousemove`,u),U(i.scroller,`dragstart`,d),U(i.scroller,`drop`,l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ks(e,t,n){if(n==`char`)return new Z(t,t);if(n==`word`)return e.findWordAt(t);if(n==`line`)return new Z(J(t.line,0),X(e.doc,J(t.line+1,0)));var r=n(e,t);return new Z(r.from,r.to)}function As(e,t,n,r){o&&ri(e);var i=e.display,a=e.doc;Fe(t);var s,c,l=a.sel,u=l.ranges;if(r.addNew&&!r.extend?(c=a.sel.contains(n),s=c>-1?u[c]:new Z(n,n)):(s=a.sel.primary(),c=a.sel.primIndex),r.unit==`rectangle`)r.addNew||(s=new Z(n,n)),n=Hr(e,t,!0,!0),c=-1;else{var d=ks(e,n,r.unit);s=r.extend?Ba(s,d.anchor,d.head,r.extend):d}r.addNew?c==-1?(c=u.length,qa(a,fa(e,u.concat([s]),c),{scroll:!1,origin:`*mouse`})):u.length>1&&u[c].empty()&&r.unit==`char`&&!r.extend?(qa(a,fa(e,u.slice(0,c).concat(u.slice(c+1)),0),{scroll:!1,origin:`*mouse`}),l=a.sel):Ua(a,c,s,ce):(c=0,qa(a,new da([s],0),ce),l=a.sel);var f=n;function p(t){if(Y(f,t)!=0)if(f=t,r.unit==`rectangle`){for(var i=[],o=e.options.tabSize,u=z(K(a,n.line).text,n.ch,o),d=z(K(a,t.line).text,t.ch,o),p=Math.min(u,d),m=Math.max(u,d),h=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));h<=g;h++){var _=K(a,h).text,v=ue(_,p,o);p==m?i.push(new Z(J(h,v),J(h,v))):_.length>v&&i.push(new Z(J(h,v),J(h,ue(_,m,o))))}i.length||i.push(new Z(n,n)),qa(a,fa(e,l.ranges.slice(0,c).concat(i),c),{origin:`*mouse`,scroll:!1}),e.scrollIntoView(t)}else{var y=s,b=ks(e,t,r.unit),x=y.anchor,S;Y(b.anchor,x)>0?(S=b.head,x=vt(y.from(),b.anchor)):(S=b.anchor,x=_t(y.to(),b.head));var C=l.ranges.slice(0);C[c]=js(e,new Z(X(a,x),S)),qa(a,fa(e,C,c),ce)}}var m=i.wrapper.getBoundingClientRect(),h=0;function g(t){var n=++h,o=Hr(e,t,!0,r.unit==`rectangle`);if(o)if(Y(o,f)!=0){e.curOp.focus=ee(re(e)),p(o);var s=ci(i,a);(o.line>=s.to||o.linem.bottom?20:0;c&&setTimeout(zi(e,function(){h==n&&(i.scroller.scrollTop+=c,g(t))}),50)}}function _(t){e.state.selectingText=!1,h=1/0,t&&(Fe(t),i.input.focus()),je(i.wrapper.ownerDocument,`mousemove`,v),je(i.wrapper.ownerDocument,`mouseup`,y),a.history.lastSelOrigin=null}var v=zi(e,function(e){e.buttons===0||!Be(e)?_(e):g(e)}),y=zi(e,_);e.state.selectingText=y,U(i.wrapper.ownerDocument,`mousemove`,v),U(i.wrapper.ownerDocument,`mouseup`,y)}function js(e,t){var n=t.anchor,r=t.head,i=K(e.doc,n.line);if(Y(n,r)==0&&n.sticky==r.sticky)return t;var a=H(i);if(!a)return t;var o=De(a,n.ch,n.sticky),s=a[o];if(s.from!=n.ch&&s.to!=n.ch)return t;var c=o+(s.from==n.ch==(s.level!=1)?0:1);if(c==0||c==a.length)return t;var l;if(r.line!=n.line)l=(r.line-n.line)*(e.doc.direction==`ltr`?1:-1)>0;else{var u=De(a,r.ch,r.sticky),d=u-o||(r.ch-n.ch)*(s.level==1?-1:1);l=u==c-1||u==c?d<0:d>0}var f=a[c+(l?-1:0)],p=l==(f.level==1),m=p?f.from:f.to,h=p?`after`:`before`;return n.ch==m&&n.sticky==h?t:new Z(new J(n.line,m,h),r)}function Ms(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&&Fe(t);var o=e.display,s=o.lineDiv.getBoundingClientRect();if(a>s.bottom||!Ne(e,n))return Le(t);a-=s.top-o.viewOffset;for(var c=0;c=i){var u=ft(e.doc,a),d=e.display.gutterSpecs[c];return W(e,n,e,u,d.className,t),Le(t)}}}function Ns(e,t){return Ms(e,t,`gutterClick`,!0)}function Ps(e,t){Zn(e.display,t)||Fs(e,t)||G(e,t,`contextmenu`)||w||e.display.input.onContextMenu(t)}function Fs(e,t){return Ne(e,`gutterContextMenu`)?Ms(e,t,`gutterContextMenu`,!1):!1}function Is(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,``)+e.options.theme.replace(/(^|\s)\s*/g,` cm-s-`),vr(e)}var Ls={toString:function(){return`CodeMirror.Init`}},Rs={},zs={};function Bs(e){var t=e.optionHandlers;function n(n,r,i,a){e.defaults[n]=r,i&&(t[n]=a?function(e,t,n){n!=Ls&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Ls,n(`value`,``,function(e,t){return e.setValue(t)},!0),n(`mode`,null,function(e,t){e.doc.modeOption=t,ya(e)},!0),n(`indentUnit`,2,ya,!0),n(`indentWithTabs`,!1),n(`smartIndent`,!0),n(`tabSize`,4,function(e){ba(e),vr(e),Wr(e)},!0),n(`lineSeparator`,null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var a=e.text.indexOf(t,i);if(a==-1)break;i=a+t.length,n.push(J(r,a))}r++});for(var i=n.length-1;i>=0;i--)lo(e.doc,t,n[i],J(n[i].line,n[i].ch+t.length))}}),n(`specialChars`,/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(e,t,n){e.state.specialChars=RegExp(t.source+(t.test(` `)?``:`| `),`g`),n!=Ls&&e.refresh()}),n(`specialCharPlaceholder`,Cn,function(e){return e.refresh()},!0),n(`electricChars`,!0),n(`inputStyle`,v?`contenteditable`:`textarea`,function(){throw Error(`inputStyle can not (yet) be changed in a running editor`)},!0),n(`spellcheck`,!1,function(e,t){return e.getInputField().spellcheck=t},!0),n(`autocorrect`,!1,function(e,t){return e.getInputField().autocorrect=t},!0),n(`autocapitalize`,!1,function(e,t){return e.getInputField().autocapitalize=t},!0),n(`rtlMoveVisually`,!x),n(`wholeLineUpdateBefore`,!0),n(`theme`,`default`,function(e){Is(e),ia(e)},!0),n(`keyMap`,`default`,function(e,t,n){var r=Zo(t),i=n!=Ls&&Zo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),n(`extraKeys`,null),n(`configureMouse`,null),n(`lineWrapping`,!1,Hs,!0),n(`gutters`,[],function(e,t){e.display.gutterSpecs=na(t,e.options.lineNumbers),ia(e)},!0),n(`fixedGutter`,!0,function(e,t){e.display.gutters.style.left=t?zr(e.display)+`px`:`0`,e.refresh()},!0),n(`coverGutterNextToScrollbar`,!1,function(e){return Ti(e)},!0),n(`scrollbarStyle`,`native`,function(e){Oi(e),Ti(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n(`lineNumbers`,!1,function(e,t){e.display.gutterSpecs=na(e.options.gutters,t),ia(e)},!0),n(`firstLineNumber`,1,ia,!0),n(`lineNumberFormatter`,function(e){return e},ia,!0),n(`showCursorWhenSelecting`,!1,Xr,!0),n(`resetSelectionOnContextMenu`,!0),n(`lineWiseCopyCut`,!0),n(`pasteLinesPerSelection`,!0),n(`selectionsMayTouch`,!1),n(`readOnly`,!1,function(e,t){t==`nocursor`&&(ai(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),n(`screenReaderLabel`,null,function(e,t){t=t===``?null:t,e.display.input.screenReaderLabelChanged(t)}),n(`disableInput`,!1,function(e,t){t||e.display.input.reset()},!0),n(`dragDrop`,!0,Vs),n(`allowDropFileTypes`,null),n(`cursorBlinkRate`,530),n(`cursorScrollMargin`,0),n(`cursorHeight`,1,Xr,!0),n(`singleCursorHeightPerLine`,!0,Xr,!0),n(`workTime`,100),n(`workDelay`,100),n(`flattenSpans`,!0,ba,!0),n(`addModeClass`,!1,ba,!0),n(`pollInterval`,100),n(`undoDepth`,200,function(e,t){return e.doc.history.undoDepth=t}),n(`historyEventDelay`,1250),n(`viewportMargin`,10,function(e){return e.refresh()},!0),n(`maxHighlightLength`,1e4,ba,!0),n(`moveInputWithCursor`,!0,function(e,t){t||e.display.input.resetPosition()}),n(`tabindex`,null,function(e,t){return e.display.input.getField().tabIndex=t||``}),n(`autofocus`,null),n(`direction`,`ltr`,function(e,t){return e.doc.setDirection(t)},!0),n(`phrases`,null)}function Vs(e,t,n){if(!t!=!(n&&n!=Ls)){var r=e.display.dragFunctions,i=t?U:je;i(e.display.scroller,`dragstart`,r.start),i(e.display.scroller,`dragenter`,r.enter),i(e.display.scroller,`dragover`,r.over),i(e.display.scroller,`dragleave`,r.leave),i(e.display.scroller,`drop`,r.drop)}}function Hs(e){e.options.lineWrapping?(te(e.display.wrapper,`CodeMirror-wrap`),e.display.sizer.style.minWidth=``,e.display.sizerWidth=null):(E(e.display.wrapper,`CodeMirror-wrap`),hn(e)),Vr(e),Wr(e),vr(e),setTimeout(function(){return Ti(e)},100)}function Q(e,t){var n=this;if(!(this instanceof Q))return new Q(e,t);this.options=t=t?R(t):{},R(Rs,t,!1);var r=t.value;typeof r==`string`?r=new ko(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Q.inputStyles[t.inputStyle](this),a=this.display=new aa(e,r,i,t);for(var l in a.wrapper.CodeMirror=this,Is(this),t.lineWrapping&&(this.display.wrapper.className+=` CodeMirror-wrap`),Oi(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 ie,keySeq:null,specialChars:null},t.autofocus&&!v&&a.input.focus(),o&&s<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Us(this),Lo(),Ai(this),this.curOp.forceUpdate=!0,wa(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&ii(n)},20):ai(this),zs)zs.hasOwnProperty(l)&&zs[l](this,t[l],Ls);ta(this),t.finishInit&&t.finishInit(this);for(var u=0;u400}U(t.scroller,`touchstart`,function(i){if(!G(e,i)&&!a(i)&&!Ns(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},i.touches.length==1&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),U(t.scroller,`touchmove`,function(){t.activeTouch&&(t.activeTouch.moved=!0)}),U(t.scroller,`touchend`,function(n){var r=t.activeTouch;if(r&&!Zn(t,n)&&r.left!=null&&!r.moved&&new Date-r.start<300){var a=e.coordsChar(t.activeTouch,`page`),o=!r.prev||c(r,r.prev)?new Z(a,a):!r.prev.prev||c(r,r.prev.prev)?e.findWordAt(a):new Z(J(a.line,0),X(e.doc,J(a.line+1,0)));e.setSelection(o.anchor,o.head),e.focus(),Fe(n)}i()}),U(t.scroller,`touchcancel`,i),U(t.scroller,`scroll`,function(){t.scroller.clientHeight&&(yi(e,t.scroller.scrollTop),xi(e,t.scroller.scrollLeft,!0),W(e,`scroll`,e))}),U(t.scroller,`mousewheel`,function(t){return ua(e,t)}),U(t.scroller,`DOMMouseScroll`,function(t){return ua(e,t)}),U(t.wrapper,`scroll`,function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){G(e,t)||Re(t)},over:function(t){G(e,t)||(No(e,t),Re(t))},start:function(t){return Mo(e,t)},drop:zi(e,jo),leave:function(t){G(e,t)||Po(e)}};var l=t.input.getField();U(l,`keyup`,function(t){return _s.call(e,t)}),U(l,`keydown`,zi(e,hs)),U(l,`keypress`,zi(e,vs)),U(l,`focus`,function(t){return ii(e,t)}),U(l,`blur`,function(t){return ai(e,t)})}var Ws=[];Q.defineInitHook=function(e){return Ws.push(e)};function Gs(e,t,n,r){var i=e.doc,a;n??=`add`,n==`smart`&&(i.mode.indent?a=Et(e,t).state:n=`prev`);var o=e.options.tabSize,s=K(i,t),c=z(s.text,null,o);s.stateAfter&&=null;var l=s.text.match(/^\s*/)[0],u;if(!r&&!/\S/.test(s.text))u=0,n=`not`;else if(n==`smart`&&(u=i.mode.indent(a,s.text.slice(l.length),s.text),u==oe||u>150)){if(!r)return;n=`prev`}n==`prev`?u=t>i.first?z(K(i,t-1).text,null,o):0:n==`add`?u=c+e.options.indentUnit:n==`subtract`?u=c-e.options.indentUnit:typeof n==`number`&&(u=c+n),u=Math.max(0,u);var d=``,f=0;if(e.options.indentWithTabs)for(var p=Math.floor(u/o);p;--p)f+=o,d+=` `;if(fo,c=Ke(t),l=null;if(s&&r.ranges.length>1)if(Ks&&Ks.text.join(` -`)==t){if(r.ranges.length%Ks.text.length==0){l=[];for(var u=0;u=0;f--){var p=r.ranges[f],m=p.from(),h=p.to();p.empty()&&(n&&n>0?m=J(m.line,m.ch-n):e.state.overwrite&&!s?h=J(h.line,Math.min(K(a,h.line).text.length,h.ch+V(c).length)):s&&Ks&&Ks.lineWise&&Ks.text.join(` -`)==c.join(` -`)&&(m=h=J(m.line,0)));var g={from:m,to:h,text:l?l[f%l.length]:c,origin:i||(s?`paste`:e.state.cutIncoming>o?`cut`:`+input`)};ro(e.doc,g),In(e,`inputRead`,e,g)}t&&!s&&Xs(e,t),mi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ys(e,t){var n=e.clipboardData&&e.clipboardData.getData(`Text`);if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Ri(t,function(){return Js(t,n,0,null,`paste`)}),!0}function Xs(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),o=!1;if(a.electricChars){for(var s=0;s-1){o=Gs(e,i.head.line,`smart`);break}}else a.electricInput&&a.electricInput.test(K(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=Gs(e,i.head.line,`smart`));o&&In(e,`electricInput`,e,i.head.line)}}}function Zs(e){for(var t=[],n=[],r=0;rn&&(Gs(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&mi(this));else{var a=i.from(),o=i.to(),s=Math.max(n,a.line);n=Math.min(this.lastLine(),o.line-+!o.ch)+1;for(var c=s;c0&&Ua(this.doc,r,new Z(a,l[r].to()),se)}}}),getTokenAt:function(e,t){return jt(this,e,t)},getLineTokens:function(e,t){return jt(this,J(e),t,!0)},getTokenTypeAt:function(e){e=X(this.doc,e);var t=Tt(this,K(this.doc,e.line)),n=0,r=(t.length-1)/2,i=e.ch,a;if(i==0)a=t[2];else for(;;){var o=n+r>>1;if((o?t[o*2-1]:0)>=i)r=o;else if(t[o*2+1]a&&(e=a,r=!0),i=K(this.doc,e)}else i=e;return Sr(this,i,{top:0,left:0},t||`page`,n||r).top+(r?this.doc.height-pn(i):0)},defaultTextHeight:function(){return Ir(this.display)},defaultCharWidth:function(){return Lr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var a=this.display;e=Tr(this,X(this.doc,e));var o=e.bottom,s=e.left;if(t.style.position=`absolute`,t.setAttribute(`cm-ignore-events`,`true`),this.display.input.setUneditable(t),a.sizer.appendChild(t),r==`over`)o=e.top;else if(r==`above`||r==`near`){var c=Math.max(a.wrapper.clientHeight,this.doc.height),l=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);(r==`above`||e.bottom+t.offsetHeight>c)&&e.top>t.offsetHeight?o=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=c&&(o=e.bottom),s+t.offsetWidth>l&&(s=l-t.offsetWidth)}t.style.top=o+`px`,t.style.left=t.style.right=``,i==`right`?(s=a.sizer.clientWidth-t.offsetWidth,t.style.right=`0px`):(i==`left`?s=0:i==`middle`&&(s=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+`px`),n&&di(this,{left:s,top:o,right:s+t.offsetWidth,bottom:o+t.offsetHeight})},triggerOnKeyDown:Bi(hs),triggerOnKeyPress:Bi(vs),triggerOnKeyUp:_s,triggerOnMouseDown:Bi(ws),execCommand:function(e){if(rs.hasOwnProperty(e))return rs[e].call(null,this)},triggerElectric:Bi(function(e){Xs(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var a=X(this.doc,e),o=0;o0&&s(n.charAt(r-1));)--r;for(;i.5||this.options.lineWrapping)&&Vr(this),W(this,`refresh`,this)}),swapDoc:Bi(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),wa(this,e),vr(this),this.display.input.reset(),hi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,In(this,`swapDoc`,this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},Pe(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,a){e.registerHelper(t,r,a),n[t]._global.push({pred:i,val:a})}}function tc(e,t,n,r,i){var a=t,o=n,s=K(e,t.line),c=i&&e.direction==`rtl`?-n:n;function l(){var n=t.line+c;return n=e.first+e.size?!1:(t=new J(n,t.ch,t.sticky),s=K(e,n))}function u(a){var o;if(r==`codepoint`){var u=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(u))o=null;else{var d=n>0?u>=55296&&u<56320:u>=56320&&u<57343;o=new J(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(d?2:1))),-n)}}else o=i?ns(e.cm,s,t,n):es(s,t,n);if(o==null)if(!a&&l())t=ts(i,e.cm,s,t.line,c);else return!1;else t=o;return!0}if(r==`char`||r==`codepoint`)u();else if(r==`column`)u(!0);else if(r==`word`||r==`group`)for(var d=null,f=r==`group`,p=e.cm&&e.cm.getHelper(t,`wordChars`),m=!0;!(n<0&&!u(!m));m=!1){var h=s.text.charAt(t.ch)||` -`,g=ye(h,p)?`w`:f&&h==` -`?`n`:!f||/\s/.test(h)?null:`p`;if(f&&!m&&!g&&(g=`s`),d&&d!=g){n<0&&(n=1,u(),t.sticky=`after`);break}if(g&&(d=g),n>0&&!u(!m))break}var _=$a(e,t,a,o,!0);return ht(a,_)&&(_.hitSide=!0),_}function nc(e,t,n,r){var i=e.doc,a=t.left,o;if(r==`page`){var s=Math.min(e.display.wrapper.clientHeight,I(e).innerHeight||i(e).documentElement.clientHeight),c=Math.max(s-.5*Ir(e.display),3);o=(n>0?t.bottom:t.top)+n*c}else r==`line`&&(o=n>0?t.bottom+3:t.top-3);for(var l;l=Or(e,a,o),l.outside;){if(n<0?o<=0:o>=i.height){l.hitSide=!0;break}o+=n*5}return l}var $=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ie,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};$.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,Qs(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function a(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}U(i,`paste`,function(e){!a(e)||G(r,e)||Ys(e,r)||s<=11&&setTimeout(zi(r,function(){return t.updateFromDOM()}),20)}),U(i,`compositionstart`,function(e){t.composing={data:e.data,done:!1}}),U(i,`compositionupdate`,function(e){t.composing||={data:e.data,done:!1}}),U(i,`compositionend`,function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),U(i,`touchstart`,function(){return n.forceCompositionEnd()}),U(i,`input`,function(){t.composing||t.readFromDOMSoon()});function o(e){if(!(!a(e)||G(r,e))){if(r.somethingSelected())qs({lineWise:!1,text:r.getSelections()}),e.type==`cut`&&r.replaceSelection(``,null,`cut`);else if(r.options.lineWiseCopyCut){var t=Zs(r);qs({lineWise:!0,text:t.text}),e.type==`cut`&&r.operation(function(){r.setSelections(t.ranges,0,se),r.replaceSelection(``,null,`cut`)})}else return;if(e.clipboardData){e.clipboardData.clearData();var o=Ks.text.join(` -`);if(e.clipboardData.setData(`Text`,o),e.clipboardData.getData(`Text`)==o){e.preventDefault();return}}var s=$s(),c=s.firstChild;Qs(c),r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),c.value=Ks.text.join(` -`);var l=ee(F(i));ne(c),setTimeout(function(){r.display.lineSpace.removeChild(s),l.focus(),l==i&&n.showPrimarySelection()},50)}}U(i,`copy`,o),U(i,`cut`,o)},$.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute(`aria-label`,e):this.div.removeAttribute(`aria-label`)},$.prototype.prepareSelection=function(){var e=Zr(this.cm,!1);return e.focus=ee(F(this.div))==this.div,e},$.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},$.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},$.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),a=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||a.line=t.display.viewFrom&&rc(t,i)||{node:c[0].measure.map[2],offset:0},u=a.linee.firstLine()&&(r=J(r.line-1,K(e.doc,r.line-1).length)),i.ch==K(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var a,o,s;r.line==t.viewFrom||(a=Ur(e,r.line))==0?(o=q(t.view[0].line),s=t.view[0].node):(o=q(t.view[a].line),s=t.view[a-1].node.nextSibling);var c=Ur(e,i.line),l,u;if(c==t.view.length-1?(l=t.viewTo-1,u=t.lineDiv.lastChild):(l=q(t.view[c+1].line)-1,u=t.view[c+1].node.previousSibling),!s)return!1;for(var d=e.doc.splitLines(oc(e,s,u,o,l)),f=lt(e.doc,J(o,0),J(l,K(e.doc,l).text.length));d.length>1&&f.length>1;)if(V(d)==V(f))d.pop(),f.pop(),l--;else if(d[0]==f[0])d.shift(),f.shift(),o++;else break;for(var p=0,m=0,h=d[0],g=f[0],_=Math.min(h.length,g.length);p<_&&h.charCodeAt(p)==g.charCodeAt(p);)++p;for(var v=V(d),y=V(f),b=Math.min(v.length-(d.length==1?p:0),y.length-(f.length==1?p:0));mr.ch&&v.charCodeAt(v.length-m-1)==y.charCodeAt(y.length-m-1);)p--,m++;d[d.length-1]=v.slice(0,v.length-m).replace(/^\u200b+/,``),d[0]=d[0].slice(p).replace(/\u200b+$/,``);var x=J(o,p),S=J(l,f.length?V(f).length-m:0);if(d.length>1||d[0]||Y(x,S))return lo(e.doc,d,x,S,`+input`),!0},$.prototype.ensurePolled=function(){this.forceCompositionEnd()},$.prototype.reset=function(){this.forceCompositionEnd()},$.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},$.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout??=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},$.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ri(this.cm,function(){return Wr(e.cm)})},$.prototype.setUneditable=function(e){e.contentEditable=`false`},$.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||zi(this.cm,Js)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},$.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!=`nocursor`)},$.prototype.onContextMenu=function(){},$.prototype.resetPosition=function(){},$.prototype.needsContentAttribute=!0;function rc(e,t){var n=cr(e,t.line);if(!n||n.hidden)return null;var r=K(e.doc,t.line),i=ar(n,r,t.line),a=H(r,e.doc.direction),o=`left`;a&&(o=De(a,t.ch)%2?`right`:`left`);var s=fr(i.map,t.ch,o);return s.offset=s.collapse==`right`?s.end:s.start,s}function ic(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ac(e,t){return t&&(e.bad=!0),e}function oc(e,t,n,r,i){var a=``,o=!1,s=e.doc.lineSeparator(),c=!1;function l(e){return function(t){return t.id==e}}function u(){o&&=(a+=s,c&&(a+=s),c=!1)}function d(e){e&&(u(),a+=e)}function f(t){if(t.nodeType==1){var n=t.getAttribute(`cm-text`);if(n){d(n);return}var a=t.getAttribute(`cm-marker`),p;if(a){var m=e.findMarks(J(r,0),J(i+1,0),l(+a));m.length&&(p=m[0].find(0))&&d(lt(e.doc,p.from,p.to).join(s));return}if(t.getAttribute(`contenteditable`)==`false`)return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&t.textContent.length==0)return;h&&u();for(var g=0;g=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),U(i,`paste`,function(e){G(r,e)||Ys(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function a(e){if(!G(r,e)){if(r.somethingSelected())qs({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var t=Zs(r);qs({lineWise:!0,text:t.text}),e.type==`cut`?r.setSelections(t.ranges,null,se):(n.prevInput=``,i.value=t.text.join(` -`),ne(i))}else return;e.type==`cut`&&(r.state.cutIncoming=+new Date)}}U(i,`cut`,a),U(i,`copy`,a),U(e.scroller,`paste`,function(t){if(!(Zn(e,t)||G(r,t))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var a=new Event(`paste`);a.clipboardData=t.clipboardData,i.dispatchEvent(a)}}),U(e.lineSpace,`selectstart`,function(t){Zn(e,t)||Fe(t)}),U(i,`compositionstart`,function(){var e=r.getCursor(`from`);n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor(`to`),{className:`CodeMirror-composing`})}}),U(i,`compositionend`,function(){n.composing&&=(n.poll(),n.composing.range.clear(),null)})},lc.prototype.createField=function(e){this.wrapper=$s(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Qs(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},lc.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute(`aria-label`,e):this.textarea.removeAttribute(`aria-label`)},lc.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Zr(e);if(e.options.moveInputWithCursor){var i=Tr(e,n.sel.primary().head,`div`),a=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+o.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+o.left-a.left))}return r},lc.prototype.showSelection=function(e){var t=this.cm.display;O(t.cursorDiv,e.cursors),O(t.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+`px`,this.wrapper.style.left=e.teLeft+`px`)},lc.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&&ne(this.textarea),o&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value=``,o&&s>=9&&(this.hasSelection=null));this.resetting=!1}},lc.prototype.getField=function(){return this.textarea},lc.prototype.supportsTouch=function(){return!1},lc.prototype.focus=function(){if(this.cm.options.readOnly!=`nocursor`&&(!v||ee(F(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},lc.prototype.blur=function(){this.textarea.blur()},lc.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},lc.prototype.receivedFocus=function(){this.slowPoll()},lc.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},lc.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){!t.poll()&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},lc.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||qe(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(o&&s>=9&&this.hasSelection===i||y&&/[\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 c=0,l=Math.min(r.length,i.length);c1e3||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},lc.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},lc.prototype.onKeyPress=function(){o&&s>=9&&(this.hasSelection=null),this.fastPoll()},lc.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Hr(n,e),l=r.scroller.scrollTop;if(!a||f)return;n.options.resetSelectionOnContextMenu&&n.doc.sel.contains(a)==-1&&zi(n,qa)(n.doc,pa(a),se);var u=i.style.cssText,d=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText=`position: static`,i.style.cssText=`position: absolute; width: 30px; height: 30px; - top: `+(e.clientY-p.top-5)+`px; left: `+(e.clientX-p.left-5)+`px; - z-index: 1000; background: `+(o?`rgba(255, 255, 255, .05)`:`transparent`)+`; - outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var m;c&&(m=i.ownerDocument.defaultView.scrollY),r.input.focus(),c&&i.ownerDocument.defaultView.scrollTo(null,m),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=` `),t.contextMenuPending=g,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function h(){if(i.selectionStart!=null){var e=n.somethingSelected(),a=`​`+(e?i.value:``);i.value=`⇚`,i.value=a,t.prevInput=e?``:`​`,i.selectionStart=1,i.selectionEnd=a.length,r.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=u,o&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!o||o&&s<9)&&h();var e=0,a=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput==`​`?zi(n,to)(n):e++<10?r.detectingSelectAll=setTimeout(a,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(a,200)}}if(o&&s>=9&&h(),w){Re(e);var _=function(){je(window,`mouseup`,_),setTimeout(g,20)};U(window,`mouseup`,_)}else setTimeout(g,50)},lc.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e==`nocursor`,this.textarea.readOnly=!!e},lc.prototype.setUneditable=function(){},lc.prototype.needsContentAttribute=!1;function uc(e,t){if(t=t?R(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=ee(F(e));t.autofocus=n==e||e.getAttribute(`autofocus`)!=null&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(U(e.form,`submit`,r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var o=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=o}}catch{}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display=``,e.form&&(je(e.form,`submit`,r),!t.leaveSubmitMethodAlone&&typeof e.form.submit==`function`&&(e.form.submit=i))}},e.style.display=`none`;var s=Q(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s}function dc(e){e.off=je,e.on=U,e.wheelEventPixels=la,e.Doc=ko,e.splitLines=Ke,e.countColumn=z,e.findColumn=ue,e.isWordChar=ve,e.Pass=oe,e.signal=W,e.Line=gn,e.changeEnd=ma,e.scrollbarModel=Di,e.Pos=J,e.cmpPos=Y,e.modes=Ze,e.mimeModes=Qe,e.resolveMode=tt,e.getMode=nt,e.modeExtensions=rt,e.extendMode=it,e.copyState=at,e.startState=st,e.innerMode=ot,e.commands=rs,e.keyMap=Wo,e.keyName=Xo,e.isModifierKey=Jo,e.lookupKey=qo,e.normalizeKeyMap=Ko,e.StringStream=ct,e.SharedTextMarker=Co,e.TextMarker=xo,e.LineWidget=_o,e.e_preventDefault=Fe,e.e_stopPropagation=Ie,e.e_stop=Re,e.addClass=te,e.contains=M,e.rmClass=E,e.keyNames=Bo}Bs(Q),ec(Q);var fc=`iter insert remove copy getEditor constructor`.split(` `);for(var pc in ko.prototype)ko.prototype.hasOwnProperty(pc)&&B(fc,pc)<0&&(Q.prototype[pc]=(function(e){return function(){return e.apply(this.doc,arguments)}})(ko.prototype[pc]));return Pe(ko),Q.inputStyles={textarea:lc,contenteditable:$},Q.defineMode=function(e){!Q.defaults.mode&&e!=`null`&&(Q.defaults.mode=e),$e.apply(this,arguments)},Q.defineMIME=et,Q.defineMode(`null`,function(){return{token:function(e){return e.skipToEnd()}}}),Q.defineMIME(`text/plain`,`null`),Q.defineExtension=function(e,t){Q.prototype[e]=t},Q.defineDocExtension=function(e,t){ko.prototype[e]=t},Q.fromTextArea=uc,dc(Q),Q.version=`5.65.18`,Q}))})),r=t(n()),i=e(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){e.defineMode(`css`,function(t,n){var r=n.inline;n.propertyKeywords||(n=e.resolveMode(`text/css`));var i=t.indentUnit,a=n.tokenHooks,o=n.documentTypes||{},s=n.mediaTypes||{},c=n.mediaFeatures||{},l=n.mediaValueKeywords||{},u=n.propertyKeywords||{},d=n.nonStandardPropertyKeywords||{},f=n.fontProperties||{},p=n.counterDescriptors||{},m=n.colorKeywords||{},h=n.valueKeywords||{},g=n.allowNested,_=n.lineComment,v=n.supportsAtComponent===!0,y=t.highlightNonStandardPropertyKeywords!==!1,b,x;function S(e,t){return b=t,e}function C(e,t){var n=e.next();if(a[n]){var r=a[n](e,t);if(r!==!1)return r}if(n==`@`)return e.eatWhile(/[\w\\\-]/),S(`def`,e.current());if(n==`=`||(n==`~`||n==`|`)&&e.eat(`=`))return S(null,`compare`);if(n==`"`||n==`'`)return t.tokenize=w(n),t.tokenize(e,t);if(n==`#`)return e.eatWhile(/[\w\\\-]/),S(`atom`,`hash`);if(n==`!`)return e.match(/^\s*\w*/),S(`keyword`,`important`);if(/\d/.test(n)||n==`.`&&e.eat(/\d/))return e.eatWhile(/[\w.%]/),S(`number`,`unit`);if(n===`-`){if(/[\d.]/.test(e.peek()))return e.eatWhile(/[\w.%]/),S(`number`,`unit`);if(e.match(/^-[\w\\\-]*/))return e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?S(`variable-2`,`variable-definition`):S(`variable-2`,`variable`);if(e.match(/^\w+-/))return S(`meta`,`meta`)}else if(/[,+>*\/]/.test(n))return S(null,`select-op`);else if(n==`.`&&e.match(/^-?[_a-z][_a-z0-9-]*/i))return S(`qualifier`,`qualifier`);else if(/[:;{}\[\]\(\)]/.test(n))return S(null,n);else if(e.match(/^[\w-.]+(?=\()/))return/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=T),S(`variable callee`,`variable`);else if(/[\w\\\-]/.test(n))return e.eatWhile(/[\w\\\-]/),S(`property`,`word`);else return S(null,null)}function w(e){return function(t,n){for(var r=!1,i;(i=t.next())!=null;){if(i==e&&!r){e==`)`&&t.backUp(1);break}r=!r&&i==`\\`}return(i==e||!r&&e!=`)`)&&(n.tokenize=null),S(`string`,`string`)}}function T(e,t){return e.next(),e.match(/^\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=w(`)`),S(null,`(`)}function E(e,t,n){this.type=e,this.indent=t,this.prev=n}function D(e,t,n,r){return e.context=new E(n,t.indentation()+(r===!1?0:i),e.context),n}function O(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function k(e,t,n){return M[n.context.type](e,t,n)}function A(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return k(e,t,n)}function j(e){var t=e.current().toLowerCase();x=h.hasOwnProperty(t)?`atom`:m.hasOwnProperty(t)?`keyword`:`variable`}var M={};return M.top=function(e,t,n){if(e==`{`)return D(n,t,`block`);if(e==`}`&&n.context.prev)return O(n);if(v&&/@component/i.test(e))return D(n,t,`atComponentBlock`);if(/^@(-moz-)?document$/i.test(e))return D(n,t,`documentTypes`);if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return D(n,t,`atBlock`);if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,`restricted_atBlock_before`;if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return`keyframes`;if(e&&e.charAt(0)==`@`)return D(n,t,`at`);if(e==`hash`)x=`builtin`;else if(e==`word`)x=`tag`;else if(e==`variable-definition`)return`maybeprop`;else if(e==`interpolation`)return D(n,t,`interpolation`);else if(e==`:`)return`pseudo`;else if(g&&e==`(`)return D(n,t,`parens`);return n.context.type},M.block=function(e,t,n){if(e==`word`){var r=t.current().toLowerCase();return u.hasOwnProperty(r)?(x=`property`,`maybeprop`):d.hasOwnProperty(r)?(x=y?`string-2`:`property`,`maybeprop`):g?(x=t.match(/^\s*:(?:\s|$)/,!1)?`property`:`tag`,`block`):(x+=` error`,`maybeprop`)}else if(e==`meta`)return`block`;else if(!g&&(e==`hash`||e==`qualifier`))return x=`error`,`block`;else return M.top(e,t,n)},M.maybeprop=function(e,t,n){return e==`:`?D(n,t,`prop`):k(e,t,n)},M.prop=function(e,t,n){if(e==`;`)return O(n);if(e==`{`&&g)return D(n,t,`propBlock`);if(e==`}`||e==`{`)return A(e,t,n);if(e==`(`)return D(n,t,`parens`);if(e==`hash`&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t.current()))x+=` error`;else if(e==`word`)j(t);else if(e==`interpolation`)return D(n,t,`interpolation`);return`prop`},M.propBlock=function(e,t,n){return e==`}`?O(n):e==`word`?(x=`property`,`maybeprop`):n.context.type},M.parens=function(e,t,n){return e==`{`||e==`}`?A(e,t,n):e==`)`?O(n):e==`(`?D(n,t,`parens`):e==`interpolation`?D(n,t,`interpolation`):(e==`word`&&j(t),`parens`)},M.pseudo=function(e,t,n){return e==`meta`?`pseudo`:e==`word`?(x=`variable-3`,n.context.type):k(e,t,n)},M.documentTypes=function(e,t,n){return e==`word`&&o.hasOwnProperty(t.current())?(x=`tag`,n.context.type):M.atBlock(e,t,n)},M.atBlock=function(e,t,n){if(e==`(`)return D(n,t,`atBlock_parens`);if(e==`}`||e==`;`)return A(e,t,n);if(e==`{`)return O(n)&&D(n,t,g?`block`:`top`);if(e==`interpolation`)return D(n,t,`interpolation`);if(e==`word`){var r=t.current().toLowerCase();x=r==`only`||r==`not`||r==`and`||r==`or`?`keyword`:s.hasOwnProperty(r)?`attribute`:c.hasOwnProperty(r)?`property`:l.hasOwnProperty(r)?`keyword`:u.hasOwnProperty(r)?`property`:d.hasOwnProperty(r)?y?`string-2`:`property`:h.hasOwnProperty(r)?`atom`:m.hasOwnProperty(r)?`keyword`:`error`}return n.context.type},M.atComponentBlock=function(e,t,n){return e==`}`?A(e,t,n):e==`{`?O(n)&&D(n,t,g?`block`:`top`,!1):(e==`word`&&(x=`error`),n.context.type)},M.atBlock_parens=function(e,t,n){return e==`)`?O(n):e==`{`||e==`}`?A(e,t,n,2):M.atBlock(e,t,n)},M.restricted_atBlock_before=function(e,t,n){return e==`{`?D(n,t,`restricted_atBlock`):e==`word`&&n.stateArg==`@counter-style`?(x=`variable`,`restricted_atBlock_before`):k(e,t,n)},M.restricted_atBlock=function(e,t,n){return e==`}`?(n.stateArg=null,O(n)):e==`word`?(x=n.stateArg==`@font-face`&&!f.hasOwnProperty(t.current().toLowerCase())||n.stateArg==`@counter-style`&&!p.hasOwnProperty(t.current().toLowerCase())?`error`:`property`,`maybeprop`):`restricted_atBlock`},M.keyframes=function(e,t,n){return e==`word`?(x=`variable`,`keyframes`):e==`{`?D(n,t,`top`):k(e,t,n)},M.at=function(e,t,n){return e==`;`?O(n):e==`{`||e==`}`?A(e,t,n):(e==`word`?x=`tag`:e==`hash`&&(x=`builtin`),`at`)},M.interpolation=function(e,t,n){return e==`}`?O(n):e==`{`||e==`;`?A(e,t,n):(e==`word`?x=`variable`:e!=`variable`&&e!=`(`&&e!=`)`&&(x=`error`),`interpolation`)},{startState:function(e){return{tokenize:null,state:r?`block`:`top`,stateArg:null,context:new E(r?`block`:`top`,e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||C)(e,t);return n&&typeof n==`object`&&(b=n[1],n=n[0]),x=n,b!=`comment`&&(t.state=M[t.state](b,e,t)),x},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),a=n.indent;return n.type==`prop`&&(r==`}`||r==`)`)&&(n=n.prev),n.prev&&(r==`}`&&(n.type==`block`||n.type==`top`||n.type==`interpolation`||n.type==`restricted_atBlock`)?(n=n.prev,a=n.indent):(r==`)`&&(n.type==`parens`||n.type==`atBlock_parens`)||r==`{`&&(n.type==`at`||n.type==`atBlock`))&&(a=Math.max(0,n.indent-i))),a},electricChars:`}`,blockCommentStart:`/*`,blockCommentEnd:`*/`,blockCommentContinue:` * `,lineComment:_,fold:`brace`}});function t(e){for(var t={},n=0;n{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){var t={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},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode(`xml`,function(r,i){var a=r.indentUnit,o={},s=i.htmlMode?t:n;for(var c in s)o[c]=s[c];for(var c in i)o[c]=i[c];var l,u;function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return r==`<`?e.eat(`!`)?e.eat(`[`)?e.match(`CDATA[`)?n(m(`atom`,`]]>`)):null:e.match(`--`)?n(m(`comment`,`-->`)):e.match(`DOCTYPE`,!0,!0)?(e.eatWhile(/[\w\._\-]/),n(h(1))):null:e.eat(`?`)?(e.eatWhile(/[\w\._\-]/),t.tokenize=m(`meta`,`?>`),`meta`):(l=e.eat(`/`)?`closeTag`:`openTag`,t.tokenize=f,`tag bracket`):r==`&`?(e.eat(`#`)?e.eat(`x`)?e.eatWhile(/[a-fA-F\d]/)&&e.eat(`;`):e.eatWhile(/[\d]/)&&e.eat(`;`):e.eatWhile(/[\w\.\-:]/)&&e.eat(`;`))?`atom`:`error`:(e.eatWhile(/[^&<]/),null)}d.isInText=!0;function f(e,t){var n=e.next();if(n==`>`||n==`/`&&e.eat(`>`))return t.tokenize=d,l=n==`>`?`endTag`:`selfcloseTag`,`tag bracket`;if(n==`=`)return l=`equals`,null;if(n==`<`){t.tokenize=d,t.state=b,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+` tag error`:`tag error`}else if(/[\'\"]/.test(n))return t.tokenize=p(n),t.stringStartCol=e.column(),t.tokenize(e,t);else return e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),`word`}function p(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=f;break}return`string`};return t.isInAttribute=!0,t}function m(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function h(e){return function(t,n){for(var r;(r=t.next())!=null;)if(r==`<`)return n.tokenize=h(e+1),n.tokenize(t,n);else if(r==`>`)if(e==1){n.tokenize=d;break}else return n.tokenize=h(e-1),n.tokenize(t,n);return`meta`}}function g(e){return e&&e.toLowerCase()}function _(e,t,n){this.prev=e.context,this.tagName=t||``,this.indent=e.indented,this.startOfLine=n,(o.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function v(e){e.context&&=e.context.prev}function y(e,t){for(var n;;){if(!e.context||(n=e.context.tagName,!o.contextGrabbers.hasOwnProperty(g(n))||!o.contextGrabbers[g(n)].hasOwnProperty(g(t))))return;v(e)}}function b(e,t,n){return e==`openTag`?(n.tagStart=t.column(),x):e==`closeTag`?S:b}function x(e,t,n){return e==`word`?(n.tagName=t.current(),u=`tag`,T):o.allowMissingTagName&&e==`endTag`?(u=`tag bracket`,T(e,t,n)):(u=`error`,x)}function S(e,t,n){if(e==`word`){var r=t.current();return n.context&&n.context.tagName!=r&&o.implicitlyClosed.hasOwnProperty(g(n.context.tagName))&&v(n),n.context&&n.context.tagName==r||o.matchClosing===!1?(u=`tag`,C):(u=`tag error`,w)}else if(o.allowMissingTagName&&e==`endTag`)return u=`tag bracket`,C(e,t,n);else return u=`error`,w}function C(e,t,n){return e==`endTag`?(v(n),b):(u=`error`,C)}function w(e,t,n){return u=`error`,C(e,t,n)}function T(e,t,n){if(e==`word`)return u=`attribute`,E;if(e==`endTag`||e==`selfcloseTag`){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,e==`selfcloseTag`||o.autoSelfClosers.hasOwnProperty(g(r))?y(n,r):(y(n,r),n.context=new _(n,r,i==n.indented)),b}return u=`error`,T}function E(e,t,n){return e==`equals`?D:(o.allowMissing||(u=`error`),T(e,t,n))}function D(e,t,n){return e==`string`?O:e==`word`&&o.allowUnquoted?(u=`string`,T):(u=`error`,T(e,t,n))}function O(e,t,n){return e==`string`?O:T(e,t,n)}return{startState:function(e){var t={tokenize:d,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return e!=null&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;l=null;var n=t.tokenize(e,t);return(n||l)&&n!=`comment`&&(u=null,t.state=t.state(l||n,e,t),u&&(n=u==`error`?n+` error`:u)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+a;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return o.multilineTagIndentPastTag===!1?t.tagStart+a*(o.multilineTagIndentFactor||1):t.tagStart+t.tagName.length+2;if(o.alignCDATA&&/$/,blockCommentStart:``,configuration:o.htmlMode?`html`:`xml`,helperType:o.htmlMode?`html`:`xml`,skipAttribute:function(e){e.state==D&&(e.state=T)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:e.type==`closeTag`}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}}),e.defineMIME(`text/xml`,`xml`),e.defineMIME(`application/xml`,`xml`),e.mimeModes.hasOwnProperty(`text/html`)||e.defineMIME(`text/html`,{name:`xml`,htmlMode:!0})})})),o=e(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){e.defineMode(`javascript`,function(t,n){var r=t.indentUnit,i=n.statementIndent,a=n.jsonld,o=n.json||a,s=n.trackScope!==!1,c=n.typescript,l=n.wordCharacters||/[\w$\xa1-\uffff]/,u=function(){function e(e){return{type:e,style:`keyword`}}var t=e(`keyword a`),n=e(`keyword b`),r=e(`keyword c`),i=e(`keyword d`),a=e(`operator`),o={type:`atom`,style:`atom`};return{if:e(`if`),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e(`new`),delete:r,void:r,throw:r,debugger:e(`debugger`),var:e(`var`),const:e(`var`),let:e(`var`),function:e(`function`),catch:e(`catch`),for:e(`for`),switch:e(`switch`),case:e(`case`),default:e(`default`),in:a,typeof:a,instanceof:a,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e(`this`),class:e(`class`),super:e(`atom`),yield:r,export:e(`export`),import:e(`import`),extends:r,await:r}}(),d=/[+\-*&%=<>!?|~^@]/,f=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function p(e){for(var t=!1,n,r=!1;(n=e.next())!=null;){if(!t){if(n==`/`&&!r)return;n==`[`?r=!0:r&&n==`]`&&(r=!1)}t=!t&&n==`\\`}}var m,h;function g(e,t,n){return m=e,h=n,t}function _(e,t){var n=e.next();if(n==`"`||n==`'`)return t.tokenize=v(n),t.tokenize(e,t);if(n==`.`&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g(`number`,`number`);if(n==`.`&&e.match(`..`))return g(`spread`,`meta`);if(/[\[\]{}\(\),;\:\.]/.test(n))return g(n);if(n==`=`&&e.eat(`>`))return g(`=>`,`operator`);if(n==`0`&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g(`number`,`number`);if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g(`number`,`number`);if(n==`/`)return e.eat(`*`)?(t.tokenize=y,y(e,t)):e.eat(`/`)?(e.skipToEnd(),g(`comment`,`comment`)):dt(e,t,1)?(p(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g(`regexp`,`string-2`)):(e.eat(`=`),g(`operator`,`operator`,e.current()));if(n=="`")return t.tokenize=b,b(e,t);if(n==`#`&&e.peek()==`!`)return e.skipToEnd(),g(`meta`,`meta`);if(n==`#`&&e.eatWhile(l))return g(`variable`,`property`);if(n==`<`&&e.match(`!--`)||n==`-`&&e.match(`->`)&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),g(`comment`,`comment`);if(d.test(n))return(n!=`>`||!t.lexical||t.lexical.type!=`>`)&&(e.eat(`=`)?(n==`!`||n==`=`)&&e.eat(`=`):/[<>*+\-|&?]/.test(n)&&(e.eat(n),n==`>`&&e.eat(n))),n==`?`&&e.eat(`.`)?g(`.`):g(`operator`,`operator`,e.current());if(l.test(n)){e.eatWhile(l);var r=e.current();if(t.lastType!=`.`){if(u.propertyIsEnumerable(r)){var i=u[r];return g(i.type,i.style,r)}if(r==`async`&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g(`async`,`keyword`,r)}return g(`variable`,`variable`,r)}}function v(e){return function(t,n){var r=!1,i;if(a&&t.peek()==`@`&&t.match(f))return n.tokenize=_,g(`jsonld-keyword`,`meta`);for(;(i=t.next())!=null&&!(i==e&&!r);)r=!r&&i==`\\`;return r||(n.tokenize=_),g(`string`,`string`)}}function y(e,t){for(var n=!1,r;r=e.next();){if(r==`/`&&n){t.tokenize=_;break}n=r==`*`}return g(`comment`,`comment`)}function b(e,t){for(var n=!1,r;(r=e.next())!=null;){if(!n&&(r=="`"||r==`$`&&e.eat(`{`))){t.tokenize=_;break}n=!n&&r==`\\`}return g(`quasi`,`string-2`,e.current())}var x=`([{}])`;function S(e,t){t.fatArrowAt&&=null;var n=e.string.indexOf(`=>`,e.start);if(!(n<0)){if(c){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,a=!1,o=n-1;o>=0;--o){var s=e.string.charAt(o),u=x.indexOf(s);if(u>=0&&u<3){if(!i){++o;break}if(--i==0){s==`(`&&(a=!0);break}}else if(u>=3&&u<6)++i;else if(l.test(s))a=!0;else if(/["'\/`]/.test(s))for(;;--o){if(o==0)return;if(e.string.charAt(o-1)==s&&e.string.charAt(o-2)!=`\\`){o--;break}}else if(a&&!i){++o;break}}a&&!i&&(t.fatArrowAt=o)}}var C={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function w(e,t,n,r,i,a){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=a,r!=null&&(this.align=r)}function T(e,t){if(!s)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function E(e,t,n,r,i){var a=e.cc;for(D.state=e,D.stream=i,D.marked=null,D.cc=a,D.style=t,e.lexical.hasOwnProperty(`align`)||(e.lexical.align=!0);;)if((a.length?a.pop():o?B:z)(n,r)){for(;a.length&&a[a.length-1].lex;)a.pop()();return D.marked?D.marked:n==`variable`&&T(e,r)?`variable-2`:t}}var D={state:null,column:null,marked:null,cc:null};function O(){for(var e=arguments.length-1;e>=0;e--)D.cc.push(arguments[e])}function k(){return O.apply(null,arguments),!0}function A(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function j(e){var t=D.state;if(D.marked=`def`,s){if(t.context){if(t.lexical.info==`var`&&t.context&&t.context.block){var r=M(e,t.context);if(r!=null){t.context=r;return}}else if(!A(e,t.localVars)){t.localVars=new N(e,t.localVars);return}}n.globalVars&&!A(e,t.globalVars)&&(t.globalVars=new N(e,t.globalVars))}}function M(e,t){if(!t)return null;if(t.block){var n=M(e,t.prev);return n?n==t.prev?t:new te(n,t.vars,!0):null}else if(A(e,t.vars))return t;else return new te(t.prev,new N(e,t.vars),!1)}function ee(e){return e==`public`||e==`private`||e==`protected`||e==`abstract`||e==`readonly`}function te(e,t,n){this.prev=e,this.vars=t,this.block=n}function N(e,t){this.name=e,this.next=t}var ne=new N(`this`,new N(`arguments`,null));function P(){D.state.context=new te(D.state.context,D.state.localVars,!1),D.state.localVars=ne}function re(){D.state.context=new te(D.state.context,D.state.localVars,!0),D.state.localVars=null}P.lex=re.lex=!0;function F(){D.state.localVars=D.state.context.vars,D.state.context=D.state.context.prev}F.lex=!0;function I(e,t){var n=function(){var n=D.state,r=n.indented;if(n.lexical.type==`stat`)r=n.lexical.indented;else for(var i=n.lexical;i&&i.type==`)`&&i.align;i=i.prev)r=i.indented;n.lexical=new w(r,D.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function L(){var e=D.state;e.lexical.prev&&(e.lexical.type==`)`&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}L.lex=!0;function R(e){function t(n){return n==e?k():e==`;`||n==`}`||n==`)`||n==`]`?O():k(t)}return t}function z(e,t){return e==`var`?k(I(`vardef`,t),Ie,R(`;`),L):e==`keyword a`?k(I(`form`),oe,z,L):e==`keyword b`?k(I(`form`),z,L):e==`keyword d`?D.stream.match(/^\s*$/,!1)?k():k(I(`stat`),ce,R(`;`),L):e==`debugger`?k(R(`;`)):e==`{`?k(I(`}`),re,we,L,F):e==`;`?k():e==`if`?(D.state.lexical.info==`else`&&D.state.cc[D.state.cc.length-1]==L&&D.state.cc.pop()(),k(I(`form`),oe,z,L,He)):e==`function`?k(Ke):e==`for`?k(I(`form`),re,Ue,z,F,L):e==`class`||c&&t==`interface`?(D.marked=`keyword`,k(I(`form`,e==`class`?e:t),Ze,L)):e==`variable`?c&&t==`declare`?(D.marked=`keyword`,k(z)):c&&(t==`module`||t==`enum`||t==`type`)&&D.stream.match(/^\s*\w/,!1)?(D.marked=`keyword`,t==`enum`?k(K):t==`type`?k(Je,R(`operator`),H,R(`;`)):k(I(`form`),Le,R(`{`),I(`}`),we,L,L)):c&&t==`namespace`?(D.marked=`keyword`,k(I(`form`),B,z,L)):c&&t==`abstract`?(D.marked=`keyword`,k(z)):k(I(`stat`),_e):e==`switch`?k(I(`form`),oe,R(`{`),I(`}`,`switch`),re,we,L,L,F):e==`case`?k(B,R(`:`)):e=="default"?k(R(`:`)):e==`catch`?k(I(`form`),P,ie,z,L,F):e==`export`?k(I(`stat`),tt,L):e==`import`?k(I(`stat`),rt,L):e==`async`?k(z):t==`@`?k(B,z):O(I(`stat`),B,R(`;`),L)}function ie(e){if(e==`(`)return k(Ye,R(`)`))}function B(e,t){return se(e,t,!1)}function ae(e,t){return se(e,t,!0)}function oe(e){return e==`(`?k(I(`)`),ce,R(`)`),L):O()}function se(e,t,n){if(D.state.fatArrowAt==D.stream.start){var r=n?pe:V;if(e==`(`)return k(P,I(`)`),Se(Ye,`)`),L,R(`=>`),r,F);if(e==`variable`)return O(P,Le,R(`=>`),r,F)}var i=n?ue:le;return C.hasOwnProperty(e)?k(i):e==`function`?k(Ke,i):e==`class`||c&&t==`interface`?(D.marked=`keyword`,k(I(`form`),Xe,L)):e==`keyword c`||e==`async`?k(n?ae:B):e==`(`?k(I(`)`),ce,R(`)`),L,i):e==`operator`||e==`spread`?k(n?ae:B):e==`[`?k(I(`]`),ct,L,i):e==`{`?Ce(ye,`}`,null,i):e==`quasi`?O(de,i):e==`new`?k(me(n)):k()}function ce(e){return e.match(/[;\}\)\],]/)?O():O(B)}function le(e,t){return e==`,`?k(ce):ue(e,t,!1)}function ue(e,t,n){var r=n==0?le:ue,i=n==0?B:ae;if(e==`=>`)return k(P,n?pe:V,F);if(e==`operator`)return/\+\+|--/.test(t)||c&&t==`!`?k(r):c&&t==`<`&&D.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?k(I(`>`),Se(H,`>`),L,r):t==`?`?k(B,R(`:`),i):k(i);if(e==`quasi`)return O(de,r);if(e!=`;`){if(e==`(`)return Ce(ae,`)`,`call`,r);if(e==`.`)return k(ve,r);if(e==`[`)return k(I(`]`),ce,R(`]`),L,r);if(c&&t==`as`)return D.marked=`keyword`,k(H,r);if(e==`regexp`)return D.state.lastType=D.marked=`operator`,D.stream.backUp(D.stream.pos-D.stream.start-1),k(i)}}function de(e,t){return e==`quasi`?t.slice(t.length-2)=="${"?k(ce,fe):k(de):O()}function fe(e){if(e==`}`)return D.marked=`string-2`,D.state.tokenize=b,k(de)}function V(e){return S(D.stream,D.state),O(e==`{`?z:B)}function pe(e){return S(D.stream,D.state),O(e==`{`?z:ae)}function me(e){return function(t){return t==`.`?k(e?ge:he):t==`variable`&&c?k(Ne,e?ue:le):O(e?ae:B)}}function he(e,t){if(t==`target`)return D.marked=`keyword`,k(le)}function ge(e,t){if(t==`target`)return D.marked=`keyword`,k(ue)}function _e(e){return e==`:`?k(L,z):O(le,R(`;`),L)}function ve(e){if(e==`variable`)return D.marked=`property`,k()}function ye(e,t){if(e==`async`)return D.marked=`property`,k(ye);if(e==`variable`||D.style==`keyword`){if(D.marked=`property`,t==`get`||t==`set`)return k(be);var n;return c&&D.state.fatArrowAt==D.stream.start&&(n=D.stream.match(/^\s*:\s*/,!1))&&(D.state.fatArrowAt=D.stream.pos+n[0].length),k(xe)}else if(e==`number`||e==`string`)return D.marked=a?`property`:D.style+` property`,k(xe);else if(e==`jsonld-keyword`)return k(xe);else if(c&&ee(t))return D.marked=`keyword`,k(ye);else if(e==`[`)return k(B,Te,R(`]`),xe);else if(e==`spread`)return k(ae,xe);else if(t==`*`)return D.marked=`keyword`,k(ye);else if(e==`:`)return O(xe)}function be(e){return e==`variable`?(D.marked=`property`,k(Ke)):O(xe)}function xe(e){if(e==`:`)return k(ae);if(e==`(`)return O(Ke)}function Se(e,t,n){function r(i,a){if(n?n.indexOf(i)>-1:i==`,`){var o=D.state.lexical;return o.info==`call`&&(o.pos=(o.pos||0)+1),k(function(n,r){return n==t||r==t?O():O(e)},r)}return i==t||a==t?k():n&&n.indexOf(`;`)>-1?O(e):k(R(t))}return function(n,i){return n==t||i==t?k():O(e,r)}}function Ce(e,t,n){for(var r=3;r`),H);if(e==`quasi`)return O(je,Me)}function ke(e){if(e==`=>`)return k(H)}function U(e){return e.match(/[\}\)\]]/)?k():e==`,`||e==`;`?k(U):O(Ae,U)}function Ae(e,t){if(e==`variable`||D.style==`keyword`)return D.marked=`property`,k(Ae);if(t==`?`||e==`number`||e==`string`)return k(Ae);if(e==`:`)return k(H);if(e==`[`)return k(R(`variable`),Ee,R(`]`),Ae);if(e==`(`)return O(qe,Ae);if(!e.match(/[;\}\)\],]/))return k()}function je(e,t){return e==`quasi`?t.slice(t.length-2)=="${"?k(H,W):k(je):O()}function W(e){if(e==`}`)return D.marked=`string-2`,D.state.tokenize=b,k(je)}function G(e,t){return e==`variable`&&D.stream.match(/^\s*[?:]/,!1)||t==`?`?k(G):e==`:`?k(H):e==`spread`?k(G):O(H)}function Me(e,t){if(t==`<`)return k(I(`>`),Se(H,`>`),L,Me);if(t==`|`||e==`.`||t==`&`)return k(H);if(e==`[`)return k(H,R(`]`),Me);if(t==`extends`||t==`implements`)return D.marked=`keyword`,k(H);if(t==`?`)return k(H,R(`:`),H)}function Ne(e,t){if(t==`<`)return k(I(`>`),Se(H,`>`),L,Me)}function Pe(){return O(H,Fe)}function Fe(e,t){if(t==`=`)return k(H)}function Ie(e,t){return t==`enum`?(D.marked=`keyword`,k(K)):O(Le,Te,Be,Ve)}function Le(e,t){if(c&&ee(t))return D.marked=`keyword`,k(Le);if(e==`variable`)return j(t),k();if(e==`spread`)return k(Le);if(e==`[`)return Ce(ze,`]`);if(e==`{`)return Ce(Re,`}`)}function Re(e,t){return e==`variable`&&!D.stream.match(/^\s*:/,!1)?(j(t),k(Be)):(e==`variable`&&(D.marked=`property`),e==`spread`?k(Le):e==`}`?O():e==`[`?k(B,R(`]`),R(`:`),Re):k(R(`:`),Le,Be))}function ze(){return O(Le,Be)}function Be(e,t){if(t==`=`)return k(ae)}function Ve(e){if(e==`,`)return k(Ie)}function He(e,t){if(e==`keyword b`&&t==`else`)return k(I(`form`,`else`),z,L)}function Ue(e,t){if(t==`await`)return k(Ue);if(e==`(`)return k(I(`)`),We,L)}function We(e){return e==`var`?k(Ie,Ge):e==`variable`?k(Ge):O(Ge)}function Ge(e,t){return e==`)`?k():e==`;`?k(Ge):t==`in`||t==`of`?(D.marked=`keyword`,k(B,Ge)):O(B,Ge)}function Ke(e,t){if(t==`*`)return D.marked=`keyword`,k(Ke);if(e==`variable`)return j(t),k(Ke);if(e==`(`)return k(P,I(`)`),Se(Ye,`)`),L,De,z,F);if(c&&t==`<`)return k(I(`>`),Se(Pe,`>`),L,Ke)}function qe(e,t){if(t==`*`)return D.marked=`keyword`,k(qe);if(e==`variable`)return j(t),k(qe);if(e==`(`)return k(P,I(`)`),Se(Ye,`)`),L,De,F);if(c&&t==`<`)return k(I(`>`),Se(Pe,`>`),L,qe)}function Je(e,t){if(e==`keyword`||e==`variable`)return D.marked=`type`,k(Je);if(t==`<`)return k(I(`>`),Se(Pe,`>`),L)}function Ye(e,t){return t==`@`&&k(B,Ye),e==`spread`?k(Ye):c&&ee(t)?(D.marked=`keyword`,k(Ye)):c&&e==`this`?k(Te,Be):O(Le,Te,Be)}function Xe(e,t){return e==`variable`?Ze(e,t):Qe(e,t)}function Ze(e,t){if(e==`variable`)return j(t),k(Qe)}function Qe(e,t){if(t==`<`)return k(I(`>`),Se(Pe,`>`),L,Qe);if(t==`extends`||t==`implements`||c&&e==`,`)return t==`implements`&&(D.marked=`keyword`),k(c?H:B,Qe);if(e==`{`)return k(I(`}`),$e,L)}function $e(e,t){if(e==`async`||e==`variable`&&(t==`static`||t==`get`||t==`set`||c&&ee(t))&&D.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return D.marked=`keyword`,k($e);if(e==`variable`||D.style==`keyword`)return D.marked=`property`,k(et,$e);if(e==`number`||e==`string`)return k(et,$e);if(e==`[`)return k(B,Te,R(`]`),et,$e);if(t==`*`)return D.marked=`keyword`,k($e);if(c&&e==`(`)return O(qe,$e);if(e==`;`||e==`,`)return k($e);if(e==`}`)return k();if(t==`@`)return k(B,$e)}function et(e,t){if(t==`!`||t==`?`)return k(et);if(e==`:`)return k(H,Be);if(t==`=`)return k(ae);var n=D.state.lexical.prev;return O(n&&n.info==`interface`?qe:Ke)}function tt(e,t){return t==`*`?(D.marked=`keyword`,k(st,R(`;`))):t=="default"?(D.marked=`keyword`,k(B,R(`;`))):e==`{`?k(Se(nt,`}`),st,R(`;`)):O(z)}function nt(e,t){if(t==`as`)return D.marked=`keyword`,k(R(`variable`));if(e==`variable`)return O(ae,nt)}function rt(e){return e==`string`?k():e==`(`?O(B):e==`.`?O(le):O(it,at,st)}function it(e,t){return e==`{`?Ce(it,`}`):(e==`variable`&&j(t),t==`*`&&(D.marked=`keyword`),k(ot))}function at(e){if(e==`,`)return k(it,at)}function ot(e,t){if(t==`as`)return D.marked=`keyword`,k(it)}function st(e,t){if(t==`from`)return D.marked=`keyword`,k(B)}function ct(e){return e==`]`?k():O(Se(ae,`]`))}function K(){return O(I(`form`),Le,R(`{`),I(`}`),Se(lt,`}`),L,L)}function lt(){return O(Le,Be)}function ut(e,t){return e.lastType==`operator`||e.lastType==`,`||d.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function dt(e,t,n){return t.tokenize==_&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||t.lastType==`quasi`&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return{startState:function(e){var t={tokenize:_,lastType:`sof`,cc:[],lexical:new w((e||0)-r,0,`block`,!1),localVars:n.localVars,context:n.localVars&&new te(null,null,!1),indented:e||0};return n.globalVars&&typeof n.globalVars==`object`&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty(`align`)||(t.lexical.align=!1),t.indented=e.indentation(),S(e,t)),t.tokenize!=y&&e.eatSpace())return null;var n=t.tokenize(e,t);return m==`comment`?n:(t.lastType=m==`operator`&&(h==`++`||h==`--`)?`incdec`:m,E(t,n,m,h,e))},indent:function(t,a){if(t.tokenize==y||t.tokenize==b)return e.Pass;if(t.tokenize!=_)return 0;var o=a&&a.charAt(0),s=t.lexical,c;if(!/^\s*else\b/.test(a))for(var l=t.cc.length-1;l>=0;--l){var u=t.cc[l];if(u==L)s=s.prev;else if(u!=He&&u!=F)break}for(;(s.type==`stat`||s.type==`form`)&&(o==`}`||(c=t.cc[t.cc.length-1])&&(c==le||c==ue)&&!/^[,\.=+\-*:?[\(]/.test(a));)s=s.prev;i&&s.type==`)`&&s.prev.type==`stat`&&(s=s.prev);var d=s.type,f=o==d;return d==`vardef`?s.indented+(t.lastType==`operator`||t.lastType==`,`?s.info.length+1:0):d==`form`&&o==`{`?s.indented:d==`form`?s.indented+r:d==`stat`?s.indented+(ut(t,a)?i||r:0):s.info==`switch`&&!f&&n.doubleIndentSwitch!=0?s.indented+(/^(?:case|default)\b/.test(a)?r:2*r):s.align?s.column+ +!f:s.indented+(f?0:r)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:o?null:`/*`,blockCommentEnd:o?null:`*/`,blockCommentContinue:o?null:` * `,lineComment:o?null:`//`,fold:`brace`,closeBrackets:`()[]{}''""\`\``,helperType:o?`json`:`javascript`,jsonldMode:a,jsonMode:o,expressionAllowed:dt,skipExpression:function(t){E(t,`atom`,`atom`,`true`,new e.StringStream(``,2,null))}}}),e.registerHelper(`wordChars`,`javascript`,/[\w$]/),e.defineMIME(`text/javascript`,`javascript`),e.defineMIME(`text/ecmascript`,`javascript`),e.defineMIME(`application/javascript`,`javascript`),e.defineMIME(`application/x-javascript`,`javascript`),e.defineMIME(`application/ecmascript`,`javascript`),e.defineMIME(`application/json`,{name:`javascript`,json:!0}),e.defineMIME(`application/x-json`,{name:`javascript`,json:!0}),e.defineMIME(`application/manifest+json`,{name:`javascript`,json:!0}),e.defineMIME(`application/ld+json`,{name:`javascript`,jsonld:!0}),e.defineMIME(`text/typescript`,{name:`javascript`,typescript:!0}),e.defineMIME(`application/typescript`,{name:`javascript`,typescript:!0})})})),s=e(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n(),a(),o(),i()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`,`../xml/xml`,`../javascript/javascript`,`../css/css`],r):r(CodeMirror)})(function(e){var t={script:[[`lang`,/(javascript|babel)/i,`javascript`],[`type`,/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,`javascript`],[`type`,/./,`text/plain`],[null,null,`javascript`]],style:[[`lang`,/^css$/i,`css`],[`type`,/^(text\/)?(x-)?(stylesheet|css)$/i,`css`],[`type`,/./,`text/plain`],[null,null,`css`]]};function n(e,t,n){var r=e.current(),i=r.search(t);return i>-1?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}var r={};function i(e){return r[e]||(r[e]=RegExp(`\\s+`+e+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function a(e,t){var n=e.match(i(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:``}function o(e,t){return RegExp((t?`^`:``)+``,`i`)}function s(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),i=e[n],a=i.length-1;a>=0;a--)r.unshift(i[a])}function c(e,t){for(var n=0;n=0;f--)l.script.unshift([`type`,d[f].matches,d[f].mode]);function p(t,i){var s=a.token(t,i.htmlState),u=/\btag\b/.test(s),d;if(u&&!/[<>\s\/]/.test(t.current())&&(d=i.htmlState.tagName&&i.htmlState.tagName.toLowerCase())&&l.hasOwnProperty(d))i.inTag=d+` `;else if(i.inTag&&u&&/>$/.test(t.current())){var f=/^([\S]+) (.*)/.exec(i.inTag);i.inTag=null;var m=t.current()==`>`&&c(l[f[1]],f[2]),h=e.getMode(r,m),g=o(f[1],!0),_=o(f[1],!1);i.token=function(e,t){return e.match(g,!1)?(t.token=p,t.localState=t.localMode=null,null):n(e,_,t.localMode.token(e,t.localState))},i.localMode=h,i.localState=e.startState(h,a.indent(i.htmlState,``,``))}else i.inTag&&(i.inTag+=t.current(),t.eol()&&(i.inTag+=` `));return s}return{startState:function(){return{token:p,inTag:null,localMode:null,localState:null,htmlState:e.startState(a)}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(a,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n,r){return!t.localMode||/^\s*<\//.test(n)?a.indent(t.htmlState,n,r):t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||a}}}},`xml`,`javascript`,`css`),e.defineMIME(`text/html`,`htmlmixed`)})})),c=e(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){function t(e){return RegExp(`^((`+e.join(`)|(`)+`))\\b`)}var n=t([`and`,`or`,`not`,`is`]),r=`as.assert.break.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.lambda.pass.raise.return.try.while.with.yield.in.False.True`.split(`.`),i=`abs.all.any.bin.bool.bytearray.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip.__import__.NotImplemented.Ellipsis.__debug__`.split(`.`);e.registerHelper(`hintWords`,`python`,r.concat(i).concat([`exec`,`print`]));function a(e){return e.scopes[e.scopes.length-1]}e.defineMode(`python`,function(o,s){for(var c=`error`,l=s.delimiters||s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,u=[s.singleOperators,s.doubleOperators,s.doubleDelimiters,s.tripleDelimiters,s.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],d=0;dr?w(t):i0&&E(e,t)&&(o+=` `+c),o}}return x(e,t)}function x(e,t,r){if(e.eatSpace())return null;if(!r&&e.match(/^#.*/))return`comment`;if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^[\d_]+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),`number`;var a=!1;if(e.match(/^0x[0-9a-f_]+/i)&&(a=!0),e.match(/^0b[01_]+/i)&&(a=!0),e.match(/^0o[0-7_]+/i)&&(a=!0),e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(e.eat(/J/i),a=!0),e.match(/^0(?![\dx])/i)&&(a=!0),a)return e.eat(/L/i),`number`}if(e.match(_))return e.current().toLowerCase().indexOf(`f`)===-1?(t.tokenize=C(e.current(),t.tokenize),t.tokenize(e,t)):(t.tokenize=S(e.current(),t.tokenize),t.tokenize(e,t));for(var o=0;o=0;)e=e.substr(1);var n=e.length==1,r=`string`;function i(e){return function(t,n){var r=x(t,n,!0);return r==`punctuation`&&(t.current()==`{`?n.tokenize=i(e+1):t.current()==`}`&&(e>1?n.tokenize=i(e-1):n.tokenize=a)),r}}function a(a,o){for(;!a.eol();)if(a.eatWhile(/[^'"\{\}\\]/),a.eat(`\\`)){if(a.next(),n&&a.eol())return r}else if(a.match(e))return o.tokenize=t,r;else if(a.match(`{{`))return r;else if(a.match(`{`,!1))return o.tokenize=i(0),a.current()?r:o.tokenize(a,o);else if(a.match(`}}`))return r;else if(a.match(`}`))return c;else a.eat(/['"]/);if(n){if(s.singleLineStringErrors)return c;o.tokenize=t}return r}return a.isString=!0,a}function C(e,t){for(;`rubf`.indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=e.length==1,r=`string`;function i(i,a){for(;!i.eol();)if(i.eatWhile(/[^'"\\]/),i.eat(`\\`)){if(i.next(),n&&i.eol())return r}else if(i.match(e))return a.tokenize=t,r;else i.eat(/['"]/);if(n){if(s.singleLineStringErrors)return c;a.tokenize=t}return r}return i.isString=!0,i}function w(e){for(;a(e).type!=`py`;)e.scopes.pop();e.scopes.push({offset:a(e).offset+o.indentUnit,type:`py`,align:null})}function T(e,t,n){var r=e.match(/^[\s\[\{\(]*(?:#|$)/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+f,type:n,align:r})}function E(e,t){for(var n=e.indentation();t.scopes.length>1&&a(t).offset>n;){if(a(t).type!=`py`)return!0;t.scopes.pop()}return a(t).offset!=n}function D(e,t){e.sol()&&(t.beginningOfLine=!0,t.dedent=!1);var n=t.tokenize(e,t),r=e.current();if(t.beginningOfLine&&r==`@`)return e.match(g,!1)?`meta`:h?`operator`:c;if(/\S/.test(r)&&(t.beginningOfLine=!1),(n==`variable`||n==`builtin`)&&t.lastToken==`meta`&&(n=`meta`),(r==`pass`||r==`return`)&&(t.dedent=!0),r==`lambda`&&(t.lambda=!0),r==`:`&&!t.lambda&&a(t).type==`py`&&e.match(/^\s*(?:#|$)/,!1)&&w(t),r.length==1&&!/string|comment/.test(n)){var i=`[({`.indexOf(r);if(i!=-1&&T(e,t,`])}`.slice(i,i+1)),i=`])}`.indexOf(r),i!=-1)if(a(t).type==r)t.indent=t.scopes.pop().offset-f;else return c}return t.dedent&&e.eol()&&a(t).type==`py`&&t.scopes.length>1&&t.scopes.pop(),n}return{startState:function(e){return{tokenize:b,scopes:[{offset:e||0,type:`py`,align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=D(e,t);return r&&r!=`comment`&&(t.lastToken=r==`keyword`||r==`punctuation`?e.current():r),r==`punctuation`&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+` `+c:r},indent:function(t,n){if(t.tokenize!=b)return t.tokenize.isString?e.Pass:0;var r=a(t),i=r.type==n.charAt(0)||r.type==`py`&&!t.dedent&&/^(else:|elif |except |finally:)/.test(n);return r.align==null?r.offset-(i?f:0):r.align-+!!i},electricInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/,closeBrackets:{triples:`'"`},lineComment:`#`,fold:`indent`}}),e.defineMIME(`text/x-python`,`python`),e.defineMIME(`text/x-cython`,{name:`python`,extra_keywords:function(e){return e.split(` `)}(`by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE`)})})})),l=e(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){function t(e,t,n,r,i,a){this.indented=e,this.column=t,this.type=n,this.info=r,this.align=i,this.prev=a}function n(e,n,r,i){var a=e.indented;return e.context&&e.context.type==`statement`&&r!=`statement`&&(a=e.context.indented),e.context=new t(a,n,r,i,null,e.context)}function r(e){var t=e.context.type;return(t==`)`||t==`]`||t==`}`)&&(e.indented=e.context.indented),e.context=e.context.prev}function i(e,t,n){if(t.prevToken==`variable`||t.prevToken==`type`||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,n))||t.typeAtEndOfLine&&e.column()==e.indentation())return!0}function a(e){for(;;){if(!e||e.type==`top`)return!0;if(e.type==`}`&&e.prev.info!=`namespace`)return!1;e=e.prev}}e.defineMode(`clike`,function(o,c){var l=o.indentUnit,u=c.statementIndentUnit||l,d=c.dontAlignCalls,f=c.keywords||{},p=c.types||{},m=c.builtin||{},h=c.blockKeywords||{},g=c.defKeywords||{},_=c.atoms||{},v=c.hooks||{},y=c.multiLineStrings,b=c.indentStatements!==!1,x=c.indentSwitch!==!1,S=c.namespaceSeparator,C=c.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,w=c.numberStart||/[\d\.]/,T=c.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,E=c.isOperatorChar||/[+\-*&%=<>!?|\/]/,D=c.isIdentifierChar||/[\w\$_\xa1-\uffff]/,O=c.isReservedIdentifier||!1,k,A;function j(e,t){var n=e.next();if(v[n]){var r=v[n](e,t);if(r!==!1)return r}if(n==`"`||n==`'`)return t.tokenize=M(n),t.tokenize(e,t);if(w.test(n)){if(e.backUp(1),e.match(T))return`number`;e.next()}if(C.test(n))return k=n,null;if(n==`/`){if(e.eat(`*`))return t.tokenize=ee,ee(e,t);if(e.eat(`/`))return e.skipToEnd(),`comment`}if(E.test(n)){for(;!e.match(/^\/[\/*]/,!1)&&e.eat(E););return`operator`}if(e.eatWhile(D),S)for(;e.match(S);)e.eatWhile(D);var i=e.current();return s(f,i)?(s(h,i)&&(k=`newstatement`),s(g,i)&&(A=!0),`keyword`):s(p,i)?`type`:s(m,i)||O&&O(i)?(s(h,i)&&(k=`newstatement`),`builtin`):s(_,i)?`atom`:`variable`}function M(e){return function(t,n){for(var r=!1,i,a=!1;(i=t.next())!=null;){if(i==e&&!r){a=!0;break}r=!r&&i==`\\`}return(a||!(r||y))&&(n.tokenize=null),`string`}}function ee(e,t){for(var n=!1,r;r=e.next();){if(r==`/`&&n){t.tokenize=null;break}n=r==`*`}return`comment`}function te(e,t){c.typeFirstDefinitions&&e.eol()&&a(t.context)&&(t.typeAtEndOfLine=i(e,t,e.pos))}return{startState:function(e){return{tokenize:null,context:new t((e||0)-l,0,`top`,null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var o=t.context;if(e.sol()&&(o.align??=!1,t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return te(e,t),null;k=A=null;var s=(t.tokenize||j)(e,t);if(s==`comment`||s==`meta`)return s;if(o.align??=!0,k==`;`||k==`:`||k==`,`&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;t.context.type==`statement`;)r(t);else if(k==`{`)n(t,e.column(),`}`);else if(k==`[`)n(t,e.column(),`]`);else if(k==`(`)n(t,e.column(),`)`);else if(k==`}`){for(;o.type==`statement`;)o=r(t);for(o.type==`}`&&(o=r(t));o.type==`statement`;)o=r(t)}else k==o.type?r(t):b&&((o.type==`}`||o.type==`top`)&&k!=`;`||o.type==`statement`&&k==`newstatement`)&&n(t,e.column(),`statement`,e.current());if(s==`variable`&&(t.prevToken==`def`||c.typeFirstDefinitions&&i(e,t,e.start)&&a(t.context)&&e.match(/^\s*\(/,!1))&&(s=`def`),v.token){var l=v.token(e,t,s);l!==void 0&&(s=l)}return s==`def`&&c.styleDefs===!1&&(s=`variable`),t.startOfLine=!1,t.prevToken=A?`def`:s||k,te(e,t),s},indent:function(t,n){if(t.tokenize!=j&&t.tokenize!=null||t.typeAtEndOfLine&&a(t.context))return e.Pass;var r=t.context,i=n&&n.charAt(0),o=i==r.type;if(r.type==`statement`&&i==`}`&&(r=r.prev),c.dontIndentStatements)for(;r.type==`statement`&&c.dontIndentStatements.test(r.info);)r=r.prev;if(v.indent){var s=v.indent(t,r,n,l);if(typeof s==`number`)return s}var f=r.prev&&r.prev.info==`switch`;if(c.allmanIndentation&&/[{(]/.test(i)){for(;r.type!=`top`&&r.type!=`}`;)r=r.prev;return r.indented}return r.type==`statement`?r.indented+(i==`{`?0:u):r.align&&(!d||r.type!=`)`)?r.column+ +!o:r.type==`)`&&!o?r.indented+u:r.indented+(o?0:l)+(!o&&f&&!/^(?:case|default)\b/.test(n)?l:0)},electricInput:x?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:`/*`,blockCommentEnd:`*/`,blockCommentContinue:` * `,lineComment:`//`,fold:`brace`}});function o(e){for(var t={},n=e.split(` `),r=0;r!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),`meta`},'"':function(e,t){return e.match(`""`)?(t.tokenize=D,t.tokenize(e,t)):!1},"'":function(e){return e.match(/^(\\[^'\s]+|[^\\'])'/)?`string-2`:(e.eatWhile(/[\w\$_\xa1-\uffff]/),`atom`)},"=":function(e,n){var r=n.context;return r.type==`}`&&r.align&&e.eat(`>`)?(n.context=new t(r.indented,r.column,r.type,r.info,null,r.prev),`operator`):!1},"/":function(e,t){return e.eat(`*`)?(t.tokenize=O(1),t.tokenize(e,t)):!1}},modeProps:{closeBrackets:{pairs:`()[]{}""`,triples:`"`}}});function k(e){return function(t,n){for(var r=!1,i,a=!1;!t.eol();){if(!e&&!r&&t.match(`"`)){a=!0;break}if(e&&t.match(`"""`)){a=!0;break}i=t.next(),!r&&i==`$`&&t.match(`{`)&&t.skipTo(`}`),r=!r&&i==`\\`&&!e}return(a||!e)&&(n.tokenize=null),`string`}}E(`text/x-kotlin`,{name:`clike`,keywords:o(`package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value`),types:o(`Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit`),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:o(`catch class do else finally for if where try while enum`),defKeywords:o(`class val var object interface fun`),atoms:o(`true false null this`),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),`meta`},"*":function(e,t){return t.prevToken==`.`?`variable`:`operator`},'"':function(e,t){return t.tokenize=k(e.match(`""`)),t.tokenize(e,t)},"/":function(e,t){return e.eat(`*`)?(t.tokenize=O(1),t.tokenize(e,t)):!1},indent:function(e,t,n,r){var i=n&&n.charAt(0);if((e.prevToken==`}`||e.prevToken==`)`)&&n==``)return e.indented;if(e.prevToken==`operator`&&n!=`}`&&e.context.type!=`}`||e.prevToken==`variable`&&i==`.`||(e.prevToken==`}`||e.prevToken==`)`)&&i==`.`)return r*2+t.indented;if(t.align&&t.type==`}`)return t.indented+(e.context.type==(n||``).charAt(0)?0:r)}},modeProps:{closeBrackets:{triples:`"`}}}),E([`x-shader/x-vertex`,`x-shader/x-fragment`],{name:`clike`,keywords:o(`sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout`),types:o(`float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4`),blockKeywords:o(`for while do if else struct`),builtin:o(`radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4`),atoms:o(`true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers`),indentSwitch:!1,hooks:{"#":v},modeProps:{fold:[`brace`,`include`]}}),E(`text/x-nesc`,{name:`clike`,keywords:o(c+` as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends`),types:m,blockKeywords:o(g),atoms:o(`null true false`),hooks:{"#":v},modeProps:{fold:[`brace`,`include`]}}),E(`text/x-objectivec`,{name:`clike`,keywords:o(c+` `+u),types:h,builtin:o(d),blockKeywords:o(g+` @synthesize @try @catch @finally @autoreleasepool @synchronized`),defKeywords:o(_+` @interface @implementation @protocol @class`),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:o(`YES NO NULL Nil nil true false nullptr`),isReservedIdentifier:b,hooks:{"#":v,"*":y},modeProps:{fold:[`brace`,`include`]}}),E(`text/x-objectivec++`,{name:`clike`,keywords:o(c+` `+u+` `+l),types:h,builtin:o(d),blockKeywords:o(g+` @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch`),defKeywords:o(_+` @interface @implementation @protocol @class class namespace`),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:o(`YES NO NULL Nil nil true false nullptr`),isReservedIdentifier:b,hooks:{"#":v,"*":y,u:S,U:S,L:S,R:S,0:x,1:x,2:x,3:x,4:x,5:x,6:x,7:x,8:x,9:x,token:function(e,t,n){if(n==`variable`&&e.peek()==`(`&&(t.prevToken==`;`||t.prevToken==null||t.prevToken==`}`)&&C(e.current()))return`def`}},namespaceSeparator:`::`,modeProps:{fold:[`brace`,`include`]}}),E(`text/x-squirrel`,{name:`clike`,keywords:o(`base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static`),types:m,blockKeywords:o(`case catch class else for foreach if switch try while`),defKeywords:o(`function local class`),typeFirstDefinitions:!0,atoms:o(`true false null`),hooks:{"#":v},modeProps:{fold:[`brace`,`include`]}});var A=null;function j(e){return function(t,n){for(var r=!1,i,a=!1;!t.eol();){if(!r&&t.match(`"`)&&(e==`single`||t.match(`""`))){a=!0;break}if(!r&&t.match("``")){A=j(e),a=!0;break}i=t.next(),r=e==`single`&&!r&&i==`\\`}return a&&(n.tokenize=null),`string`}}E(`text/x-ceylon`,{name:`clike`,keywords:o(`abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while`),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:o(`case catch class dynamic else finally for function if interface module new object switch try while`),defKeywords:o(`class dynamic function interface module object package value`),builtin:o(`abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable`),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:o(`true false null larger smaller equal empty finished`),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),`meta`},'"':function(e,t){return t.tokenize=j(e.match(`""`)?`triple`:`single`),t.tokenize(e,t)},"`":function(e,t){return!A||!e.match("`")?!1:(t.tokenize=A,A=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),`atom`},token:function(e,t,n){if((n==`variable`||n==`type`)&&t.prevToken==`.`)return`variable-2`}},modeProps:{fold:[`brace`,`import`],closeBrackets:{triples:`"`}}})})})),u=e(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../lib/codemirror`],r):r(CodeMirror)})(function(e){e.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 t=0;t-1&&t.substring(i+1,t.length);if(a)return e.findModeByExtension(a)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n{(function(r){typeof e==`object`&&typeof t==`object`?r(n(),a(),u()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`,`../xml/xml`,`../meta`],r):r(CodeMirror)})(function(e){e.defineMode(`markdown`,function(t,n){var r=e.getMode(t,`text/html`),i=r.name==`null`;function a(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return i.name==`null`?null:i}n.highlightFormatting===void 0&&(n.highlightFormatting=!1),n.maxBlockquoteDepth===void 0&&(n.maxBlockquoteDepth=0),n.taskLists===void 0&&(n.taskLists=!1),n.strikethrough===void 0&&(n.strikethrough=!1),n.emoji===void 0&&(n.emoji=!1),n.fencedCodeBlockHighlighting===void 0&&(n.fencedCodeBlockHighlighting=!0),n.fencedCodeBlockDefaultMode===void 0&&(n.fencedCodeBlockDefaultMode=`text/plain`),n.xml===void 0&&(n.xml=!0),n.tokenTypeOverrides===void 0&&(n.tokenTypeOverrides={});var o={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 s in o)o.hasOwnProperty(s)&&n.tokenTypeOverrides[s]&&(o[s]=n.tokenTypeOverrides[s]);var c=/^([*\-_])(?:\s*\1){2,}\s*$/,l=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,u=/^\[(x| )\](?=\s)/i,d=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,f=/^ {0,3}(?:\={1,}|-{2,})\s*$/,p=/^[^#!\[\]*_\\<>` "'(~:]+/,m=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,h=/^\s*\[[^\]]+?\]:.*$/,g=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,_=` `;function v(e,t,n){return t.f=t.inline=n,n(e,t)}function y(e,t,n){return t.f=t.block=n,n(e,t)}function b(e){return!e||!/\S/.test(e.string)}function x(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==C){var n=i;if(!n){var a=e.innerMode(r,t.htmlState);n=a.mode.name==`xml`&&a.state.tagStart===null&&!a.state.context&&a.state.tokenize.isInText}n&&(t.f=D,t.block=S,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function S(t,r){var i=t.column()===r.indentation,s=b(r.prevLine.stream),p=r.indentedCode,g=r.prevLine.hr,_=r.list!==!1,y=(r.listStack[r.listStack.length-1]||0)+3;r.indentedCode=!1;var x=r.indentation;if(r.indentationDiff===null&&(r.indentationDiff=r.indentation,_)){for(r.list=null;x=4&&(p||r.prevLine.fencedCodeEnd||r.prevLine.header||s))return t.skipToEnd(),r.indentedCode=!0,o.code;if(t.eatSpace())return null;if(i&&r.indentation<=y&&(E=t.match(d))&&E[1].length<=6)return r.quote=0,r.header=E[1].length,r.thisLine.header=!0,n.highlightFormatting&&(r.formatting=`header`),r.f=r.inline,T(r);if(r.indentation<=y&&t.eat(`>`))return r.quote=i?1:r.quote+1,n.highlightFormatting&&(r.formatting=`quote`),t.eatSpace(),T(r);if(!C&&!r.setext&&i&&r.indentation<=y&&(E=t.match(l))){var D=E[1]?`ol`:`ul`;return r.indentation=x+t.current().length,r.list=!0,r.quote=0,r.listStack.push(r.indentation),r.em=!1,r.strong=!1,r.code=!1,r.strikethrough=!1,n.taskLists&&t.match(u,!1)&&(r.taskList=!0),r.f=r.inline,n.highlightFormatting&&(r.formatting=[`list`,`list-`+D]),T(r)}else if(i&&r.indentation<=y&&(E=t.match(m,!0)))return r.quote=0,r.fencedEndRE=RegExp(E[1]+`+ *$`),r.localMode=n.fencedCodeBlockHighlighting&&a(E[2]||n.fencedCodeBlockDefaultMode),r.localMode&&(r.localState=e.startState(r.localMode)),r.f=r.block=w,n.highlightFormatting&&(r.formatting=`code-block`),r.code=-1,T(r);else if(r.setext||(!S||!_)&&!r.quote&&r.list===!1&&!r.code&&!C&&!h.test(t.string)&&(E=t.lookAhead(1))&&(E=E.match(f)))return r.setext?(r.header=r.setext,r.setext=0,t.skipToEnd(),n.highlightFormatting&&(r.formatting=`header`)):(r.header=E[0].charAt(0)==`=`?1:2,r.setext=r.header),r.thisLine.header=!0,r.f=r.inline,T(r);else if(C)return t.skipToEnd(),r.hr=!0,r.thisLine.hr=!0,o.hr;else if(t.peek()===`[`)return v(t,r,M);return v(t,r,r.inline)}function C(t,n){var a=r.token(t,n.htmlState);if(!i){var o=e.innerMode(r,n.htmlState);(o.mode.name==`xml`&&o.state.tagStart===null&&!o.state.context&&o.state.tokenize.isInText||n.md_inside&&t.current().indexOf(`>`)>-1)&&(n.f=D,n.block=S,n.htmlState=null)}return a}function w(e,t){var r=t.listStack[t.listStack.length-1]||0,i=t.indentation=e.quote?t.push(o.formatting+`-`+e.formatting[r]+`-`+e.quote):t.push(`error`))}if(e.taskOpen)return t.push(`meta`),t.length?t.join(` `):null;if(e.taskClosed)return t.push(`property`),t.length?t.join(` `):null;if(e.linkHref?t.push(o.linkHref,`url`):(e.strong&&t.push(o.strong),e.em&&t.push(o.em),e.strikethrough&&t.push(o.strikethrough),e.emoji&&t.push(o.emoji),e.linkText&&t.push(o.linkText),e.code&&t.push(o.code),e.image&&t.push(o.image),e.imageAltText&&t.push(o.imageAltText,`link`),e.imageMarker&&t.push(o.imageMarker)),e.header&&t.push(o.header,o.header+`-`+e.header),e.quote&&(t.push(o.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.quote+`-`+e.quote):t.push(o.quote+`-`+n.maxBlockquoteDepth)),e.list!==!1){var i=(e.listStack.length-1)%3;i?i===1?t.push(o.list2):t.push(o.list3):t.push(o.list1)}return e.trailingSpaceNewLine?t.push(`trailing-space-new-line`):e.trailingSpace&&t.push(`trailing-space-`+(e.trailingSpace%2?`a`:`b`)),t.length?t.join(` `):null}function E(e,t){if(e.match(p,!0))return T(t)}function D(t,i){var a=i.text(t,i);if(a!==void 0)return a;if(i.list)return i.list=null,T(i);if(i.taskList)return t.match(u,!0)[1]===` `?i.taskOpen=!0:i.taskClosed=!0,n.highlightFormatting&&(i.formatting=`task`),i.taskList=!1,T(i);if(i.taskOpen=!1,i.taskClosed=!1,i.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(i.formatting=`header`),T(i);var s=t.next();if(i.linkTitle){i.linkTitle=!1;var c=s;s===`(`&&(c=`)`),c=(c+``).replace(/([.?*+^\[\]\\(){}|-])/g,`\\$1`);var l=`^\\s*(?:[^`+c+`\\\\]+|\\\\\\\\|\\\\.)`+c;if(t.match(new RegExp(l),!0))return o.linkHref}if(s==="`"){var d=i.formatting;n.highlightFormatting&&(i.formatting=`code`),t.eatWhile("`");var f=t.current().length;if(i.code==0&&(!i.quote||f==1))return i.code=f,T(i);if(f==i.code){var p=T(i);return i.code=0,p}else return i.formatting=d,T(i)}else if(i.code)return T(i);if(s===`\\`&&(t.next(),n.highlightFormatting)){var m=T(i),h=o.formatting+`-escape`;return m?m+` `+h:h}if(s===`!`&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return i.imageMarker=!0,i.image=!0,n.highlightFormatting&&(i.formatting=`image`),T(i);if(s===`[`&&i.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return i.imageMarker=!1,i.imageAltText=!0,n.highlightFormatting&&(i.formatting=`image`),T(i);if(s===`]`&&i.imageAltText){n.highlightFormatting&&(i.formatting=`image`);var m=T(i);return i.imageAltText=!1,i.image=!1,i.inline=i.f=k,m}if(s===`[`&&!i.image)return i.linkText&&t.match(/^.*?\]/)?T(i):(i.linkText=!0,n.highlightFormatting&&(i.formatting=`link`),T(i));if(s===`]`&&i.linkText){n.highlightFormatting&&(i.formatting=`link`);var m=T(i);return i.linkText=!1,i.inline=i.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?k:D,m}if(s===`<`&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){i.f=i.inline=O,n.highlightFormatting&&(i.formatting=`link`);var m=T(i);return m?m+=` `:m=``,m+o.linkInline}if(s===`<`&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){i.f=i.inline=O,n.highlightFormatting&&(i.formatting=`link`);var m=T(i);return m?m+=` `:m=``,m+o.linkEmail}if(n.xml&&s===`<`&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var _=t.string.indexOf(`>`,t.pos);if(_!=-1){var v=t.string.substring(t.start,_);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(v)&&(i.md_inside=!0)}return t.backUp(1),i.htmlState=e.startState(r),y(t,i,C)}if(n.xml&&s===`<`&&t.match(/^\/\w*?>/))return i.md_inside=!1,`tag`;if(s===`*`||s===`_`){for(var b=1,x=t.pos==1?` `:t.string.charAt(t.pos-2);b<3&&t.eat(s);)b++;var S=t.peek()||` `,w=!/\s/.test(S)&&(!g.test(S)||/\s/.test(x)||g.test(x)),E=!/\s/.test(x)&&(!g.test(x)||/\s/.test(S)||g.test(S)),A=null,j=null;if(b%2&&(!i.em&&w&&(s===`*`||!E||g.test(x))?A=!0:i.em==s&&E&&(s===`*`||!w||g.test(S))&&(A=!1)),b>1&&(!i.strong&&w&&(s===`*`||!E||g.test(x))?j=!0:i.strong==s&&E&&(s===`*`||!w||g.test(S))&&(j=!1)),j!=null||A!=null){n.highlightFormatting&&(i.formatting=A==null?`strong`:j==null?`em`:`strong em`),A===!0&&(i.em=s),j===!0&&(i.strong=s);var p=T(i);return A===!1&&(i.em=!1),j===!1&&(i.strong=!1),p}}else if(s===` `&&(t.eat(`*`)||t.eat(`_`))){if(t.peek()===` `)return T(i);t.backUp(1)}if(n.strikethrough){if(s===`~`&&t.eatWhile(s)){if(i.strikethrough){n.highlightFormatting&&(i.formatting=`strikethrough`);var p=T(i);return i.strikethrough=!1,p}else if(t.match(/^[^\s]/,!1))return i.strikethrough=!0,n.highlightFormatting&&(i.formatting=`strikethrough`),T(i)}else if(s===` `&&t.match(`~~`,!0)){if(t.peek()===` `)return T(i);t.backUp(2)}}if(n.emoji&&s===`:`&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){i.emoji=!0,n.highlightFormatting&&(i.formatting=`emoji`);var M=T(i);return i.emoji=!1,M}return s===` `&&(t.match(/^ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),T(i)}function O(e,t){if(e.next()===`>`){t.f=t.inline=D,n.highlightFormatting&&(t.formatting=`link`);var r=T(t);return r?r+=` `:r=``,r+o.linkInline}return e.match(/^[^>]+/,!0),o.linkInline}function k(e,t){if(e.eatSpace())return null;var r=e.next();return r===`(`||r===`[`?(t.f=t.inline=j(r===`(`?`)`:`]`),n.highlightFormatting&&(t.formatting=`link-string`),t.linkHref=!0,T(t)):`error`}var A={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function j(e){return function(t,r){if(t.next()===e){r.f=r.inline=D,n.highlightFormatting&&(r.formatting=`link-string`);var i=T(r);return r.linkHref=!1,i}return t.match(A[e]),r.linkHref=!0,T(r)}}function M(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=ee,e.next(),n.highlightFormatting&&(t.formatting=`link`),t.linkText=!0,T(t)):v(e,t,D)}function ee(e,t){if(e.match(`]:`,!0)){t.f=t.inline=te,n.highlightFormatting&&(t.formatting=`link`);var r=T(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),o.linkText}function te(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),e.peek()===void 0?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),t.f=t.inline=D,o.linkHref+` url`)}var N={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:D,text:E,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(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(r,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return x(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=C)){var n=e.match(/^\s*/,!0)[0].replace(/\t/g,_).length;if(t.indentation=n,t.indentationDiff=null,n>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==C?{state:e.htmlState,mode:r}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:N}},indent:function(t,n,i){return t.block==C&&r.indent?r.indent(t.htmlState,n,i):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,n,i):e.Pass},blankLine:x,getType:T,blockCommentStart:``,closeBrackets:`()[]{}''""\`\``,fold:`markdown`};return N},`xml`),e.defineMIME(`text/markdown`,`markdown`),e.defineMIME(`text/x-markdown`,`markdown`)})})),f=e(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){e.defineOption(`placeholder`,``,function(n,o,s){var c=s&&s!=e.Init;if(o&&!c)n.on(`blur`,i),n.on(`change`,a),n.on(`swapDoc`,a),e.on(n.getInputField(),`compositionupdate`,n.state.placeholderCompose=function(){r(n)}),a(n);else if(!o&&c){n.off(`blur`,i),n.off(`change`,a),n.off(`swapDoc`,a),e.off(n.getInputField(),`compositionupdate`,n.state.placeholderCompose),t(n);var l=n.getWrapperElement();l.className=l.className.replace(` CodeMirror-empty`,``)}o&&!n.hasFocus()&&i(n)});function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement(`pre`);n.style.cssText=`height: 0; overflow: visible`,n.style.direction=e.getOption(`direction`),n.className=`CodeMirror-placeholder CodeMirror-line-like`;var r=e.getOption(`placeholder`);typeof r==`string`&&(r=document.createTextNode(r)),n.appendChild(r),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){setTimeout(function(){var r=!1;if(e.lineCount()==1){var i=e.getInputField();r=i.nodeName==`TEXTAREA`?!e.getLine(0).length:!/[^\u200b]/.test(i.querySelector(`.CodeMirror-line`).textContent)}r?n(e):t(e)},20)}function i(e){o(e)&&n(e)}function a(e){var r=e.getWrapperElement(),i=o(e);r.className=r.className.replace(` CodeMirror-empty`,``)+(i?` CodeMirror-empty`:``),i?n(e):t(e)}function o(e){return e.lineCount()===1&&e.getLine(0)===``}})})),p=e(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){e.defineSimpleMode=function(t,n){e.defineMode(t,function(t){return e.simpleMode(t,n)})},e.simpleMode=function(n,r){t(r,`start`);var o={},s=r.meta||{},c=!1;for(var u in r)if(u!=s&&r.hasOwnProperty(u))for(var d=o[u]=[],f=r[u],p=0;p2&&u.token&&typeof u.token!=`string`){for(var p=2;p-1)return e.Pass;var o=r.indent.length-1,s=t[r.state];scan:for(;;){for(var l=0;l{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),n=e.Pos,r={"(":`)>`,")":`(<`,"[":`]>`,"]":`[<`,"{":`}>`,"}":`{<`,"<":`>>`,">":`<<`};function i(e){return e&&e.bracketRegex||/[(){}[\]]/}function a(e,t,a){var s=e.getLineHandle(t.line),c=t.ch-1,l=a&&a.afterCursor;l??=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className);var u=i(a),d=!l&&c>=0&&u.test(s.text.charAt(c))&&r[s.text.charAt(c)]||u.test(s.text.charAt(c+1))&&r[s.text.charAt(++c)];if(!d)return null;var f=d.charAt(1)==`>`?1:-1;if(a&&a.strict&&f>0!=(c==t.ch))return null;var p=e.getTokenTypeAt(n(t.line,c+1)),m=o(e,n(t.line,c+ +(f>0)),f,p,a);return m==null?null:{from:n(t.line,c),to:m&&m.pos,match:m&&m.ch==d.charAt(0),forward:f>0}}function o(e,t,a,o,s){for(var c=s&&s.maxScanLineLength||1e4,l=s&&s.maxScanLines||1e3,u=[],d=i(s),f=a>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),p=t.line;p!=f;p+=a){var m=e.getLine(p);if(m){var h=a>0?0:m.length-1,g=a>0?m.length:-1;if(!(m.length>c))for(p==t.line&&(h=t.ch-+(a<0));h!=g;h+=a){var _=m.charAt(h);if(d.test(_)&&(o===void 0||(e.getTokenTypeAt(n(p,h+1))||``)==(o||``))){var v=r[_];if(v&&v.charAt(1)==`>`==a>0)u.push(_);else if(u.length)u.pop();else return{pos:n(p,h),ch:_}}}}}return p-a==(a>0?e.lastLine():e.firstLine())?!1:null}function s(e,r,i){for(var o=e.state.matchBrackets.maxHighlightLineLength||1e3,s=i&&i.highlightNonMatching,c=[],l=e.listSelections(),u=0;u{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){var t={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:``,explode:`[]{}`},n=e.Pos;e.defineOption(`autoCloseBrackets`,!1,function(t,n,o){o&&o!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),n&&(a(r(n,`pairs`)),t.state.closeBrackets=n,t.addKeyMap(i))});function r(e,n){return n==`pairs`&&typeof e==`string`?e:typeof e==`object`&&e[n]!=null?e[n]:t[n]}var i={Backspace:c,Enter:l};function a(e){for(var t=0;t=0;c--){var u=o[c].head;t.replaceRange(``,n(u.line,u.ch-1),n(u.line,u.ch+1),`+delete`)}}function l(t){var n=s(t),i=n&&r(n,`explode`);if(!i||t.getOption(`disableInput`))return e.Pass;for(var a=t.listSelections(),o=0;o0?{line:o.head.line,ch:o.head.ch+t}:{line:o.head.line-1};n.push({anchor:s,head:s})}e.setSelections(n,i)}function d(t){var r=e.cmpPos(t.anchor,t.head)>0;return{anchor:new n(t.anchor.line,t.anchor.ch+(r?-1:1)),head:new n(t.head.line,t.head.ch+(r?1:-1))}}function f(t,i){var a=s(t);if(!a||t.getOption(`disableInput`))return e.Pass;var o=r(a,`pairs`),c=o.indexOf(i);if(c==-1)return e.Pass;for(var l=r(a,`closeBefore`),f=r(a,`triples`),p=o.charAt(c+1)==i,h=t.listSelections(),g=c%2==0,_,v=0;v=0&&t.getRange(b,n(b.line,b.ch+3))==i+i+i?`skipThree`:`skip`;else if(p&&b.ch>1&&f.indexOf(i)>=0&&t.getRange(n(b.line,b.ch-2),b)==i+i){if(b.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(b.line,b.ch-2))))return e.Pass;x=`addFour`}else if(p){var C=b.ch==0?` `:t.getRange(n(b.line,b.ch-1),b);if(!e.isWordChar(S)&&C!=i&&!e.isWordChar(C))x=`both`;else return e.Pass}else if(g&&(S.length===0||/\s/.test(S)||l.indexOf(S)>-1))x=`both`;else return e.Pass;if(!_)_=x;else if(_!=x)return e.Pass}var w=c%2?o.charAt(c-1):i,T=c%2?i:o.charAt(c+1);t.operation(function(){if(_==`skip`)u(t,1);else if(_==`skipThree`)u(t,3);else if(_==`surround`){for(var e=t.getSelections(),n=0;n{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){var t=e.Pos;function n(e){return e.flags??(e.ignoreCase?`i`:``)+(e.global?`g`:``)+(e.multiline?`m`:``)}function r(e,t){for(var r=n(e),i=r,a=0;au);d++){var f=e.getLine(l++);s=s==null?f:s+` -`+f}c*=2,n.lastIndex=o.ch;var p=n.exec(s);if(p){var m=s.slice(0,p.index).split(` -`),h=p[0].split(` -`),g=o.line+m.length-1,_=m[m.length-1].length;return{from:t(g,_),to:t(g+h.length-1,h.length==1?_+h[0].length:h[h.length-1].length),match:p}}}}function s(e,t,n){for(var r,i=0;i<=e.length;){t.lastIndex=i;var a=t.exec(e);if(!a)break;var o=a.index+a[0].length;if(o>e.length-n)break;(!r||o>r.index+r[0].length)&&(r=a),i=a.index+1}return r}function c(e,n,i){n=r(n,`g`);for(var a=i.line,o=i.ch,c=e.firstLine();a>=c;a--,o=-1){var l=e.getLine(a),u=s(l,n,o<0?0:l.length-o);if(u)return{from:t(a,u.index),to:t(a,u.index+u[0].length),match:u}}}function l(e,n,a){if(!i(n))return c(e,n,a);n=r(n,`gm`);for(var o,l=1,u=e.getLine(a.line).length-a.ch,d=a.line,f=e.firstLine();d>=f;){for(var p=0;p=f;p++){var m=e.getLine(d--);o=o==null?m:m+` -`+o}l*=2;var h=s(o,n,u);if(h){var g=o.slice(0,h.index).split(` -`),_=h[0].split(` -`),v=d+g.length,y=g[g.length-1].length;return{from:t(v,y),to:t(v+_.length-1,_.length==1?y+_[0].length:_[_.length-1].length),match:h}}}}var u,d;String.prototype.normalize?(u=function(e){return e.normalize(`NFD`).toLowerCase()},d=function(e){return e.normalize(`NFD`)}):(u=function(e){return e.toLowerCase()},d=function(e){return e});function f(e,t,n,r){if(e.length==t.length)return n;for(var i=0,a=n+Math.max(0,e.length-t.length);;){if(i==a)return i;var o=i+a>>1,s=r(e.slice(0,o)).length;if(s==n)return o;s>n?a=o:i=o+1}}function p(e,n,r,i){if(!n.length)return null;var a=i?u:d,o=a(n).split(/\r|\n\r?/);search:for(var s=r.line,c=r.ch,l=e.lastLine()+1-o.length;s<=l;s++,c=0){var p=e.getLine(s).slice(c),m=a(p);if(o.length==1){var h=m.indexOf(o[0]);if(h==-1)continue search;var r=f(p,m,h,a)+c;return{from:t(s,f(p,m,h,a)+c),to:t(s,f(p,m,h+o[0].length,a)+c)}}else{var g=m.length-o[0].length;if(m.slice(g)!=o[0])continue search;for(var _=1;_=l;s--,c=-1){var p=e.getLine(s);c>-1&&(p=p.slice(0,c));var m=a(p);if(o.length==1){var h=m.lastIndexOf(o[0]);if(h==-1)continue search;return{from:t(s,f(p,m,h,a)),to:t(s,f(p,m,h+o[0].length,a))}}else{var g=o[o.length-1];if(m.slice(0,g.length)!=g)continue search;for(var _=1,r=s-o.length+1;_(this.doc.getLine(r.line)||``).length&&(r.ch=0,r.line++)),e.cmpPos(r,this.doc.clipPos(r))!=0))return this.atOccurrence=!1;var i=this.matches(n,r);if(this.afterEmptyMatch=i&&e.cmpPos(i.from,i.to)==0,i)return this.pos=i,this.atOccurrence=!0,this.pos.match||!0;var a=t(n?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:a,to:a},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(n,r){if(this.atOccurrence){var i=e.splitLines(n);this.doc.replaceRange(i,this.pos.from,this.pos.to,r),this.pos.to=t(this.pos.from.line+i.length-1,i[i.length-1].length+(i.length==1?this.pos.from.ch:0))}}},e.defineExtension(`getSearchCursor`,function(e,t,n){return new h(this.doc,e,t,n)}),e.defineDocExtension(`getSearchCursor`,function(e,t,n){return new h(this,e,t,n)}),e.defineExtension(`selectMatches`,function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor(`from`),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor(`to`))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)})})})),_=e(((e,t)=>{(function(r){typeof e==`object`&&typeof t==`object`?r(n()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],r):r(CodeMirror)})(function(e){function t(t,n,r){var i=t.getWrapperElement(),a=i.appendChild(document.createElement(`div`));return r?a.className=`CodeMirror-dialog CodeMirror-dialog-bottom`:a.className=`CodeMirror-dialog CodeMirror-dialog-top`,typeof n==`string`?a.innerHTML=n:a.appendChild(n),e.addClass(i,`dialog-opened`),a}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension(`openDialog`,function(r,i,a){a||={},n(this,null);var o=t(this,r,a.bottom),s=!1,c=this;function l(t){if(typeof t==`string`)u.value=t;else{if(s)return;s=!0,e.rmClass(o.parentNode,`dialog-opened`),o.parentNode.removeChild(o),c.focus(),a.onClose&&a.onClose(o)}}var u=o.getElementsByTagName(`input`)[0],d;return u?(u.focus(),a.value&&(u.value=a.value,a.selectValueOnOpen!==!1&&u.select()),a.onInput&&e.on(u,`input`,function(e){a.onInput(e,u.value,l)}),a.onKeyUp&&e.on(u,`keyup`,function(e){a.onKeyUp(e,u.value,l)}),e.on(u,`keydown`,function(t){a&&a.onKeyDown&&a.onKeyDown(t,u.value,l)||((t.keyCode==27||a.closeOnEnter!==!1&&t.keyCode==13)&&(u.blur(),e.e_stop(t),l()),t.keyCode==13&&i(u.value,t))}),a.closeOnBlur!==!1&&e.on(o,`focusout`,function(e){e.relatedTarget!==null&&l()})):(d=o.getElementsByTagName(`button`)[0])&&(e.on(d,`click`,function(){l(),c.focus()}),a.closeOnBlur!==!1&&e.on(d,`blur`,l),d.focus()),l}),e.defineExtension(`openConfirm`,function(r,i,a){n(this,null);var o=t(this,r,a&&a.bottom),s=o.getElementsByTagName(`button`),c=!1,l=this,u=1;function d(){c||(c=!0,e.rmClass(o.parentNode,`dialog-opened`),o.parentNode.removeChild(o),l.focus())}s[0].focus();for(var f=0;f{(function(r){typeof e==`object`&&typeof t==`object`?r(n(),g(),_()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`,`./searchcursor`,`../dialog/dialog`],r):r(CodeMirror)})(function(e){e.defineOption(`search`,{bottom:!1});function t(e,t){return typeof e==`string`?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),t?`gi`:`g`):e.global||(e=new RegExp(e.source,e.ignoreCase?`gi`:`g`)),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);if(n&&n.index==t.pos)return t.pos+=n[0].length||1,`searching`;n?t.pos=n.index:t.skipToEnd()}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function r(e){return e.state.search||(e.state.search=new n)}function i(e){return typeof e==`string`&&e==e.toLowerCase()}function a(e,t,n){return e.getSearchCursor(t,n,{caseFold:i(t),multiline:!0})}function o(e,t,n,r,i){e.openDialog(t,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){m(e)},onKeyDown:i,bottom:e.options.search.bottom})}function s(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(n,r))}function c(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}function l(e){return e.replace(/\\([nrt\\])/g,function(e,t){return t==`n`?` -`:t==`r`?`\r`:t==`t`?` `:t==`\\`?`\\`:e})}function u(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],t[2].indexOf(`i`)==-1?``:`i`)}catch{}else e=l(e);return(typeof e==`string`?e==``:e.test(``))&&(e=/x^/),e}function d(e,n,r){n.queryText=r,n.query=u(r),e.removeOverlay(n.overlay,i(n.query)),n.overlay=t(n.query,i(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&=(n.annotate.clear(),null),n.annotate=e.showMatchesOnScrollbar(n.query,i(n.query)))}function f(t,n,i,a){var c=r(t);if(c.query)return p(t,n);var l=t.getSelection()||c.lastQuery;if(l instanceof RegExp&&l.source==`x^`&&(l=null),i&&t.openDialog){var u=null,f=function(n,r){e.e_stop(r),n&&(n!=c.queryText&&(d(t,c,n),c.posFrom=c.posTo=t.getCursor()),u&&(u.style.opacity=1),p(t,r.shiftKey,function(e,n){var r;n.line<3&&document.querySelector&&(r=t.display.wrapper.querySelector(`.CodeMirror-dialog`))&&r.getBoundingClientRect().bottom-4>t.cursorCoords(n,`window`).top&&((u=r).style.opacity=.4)}))};o(t,g(t),l,f,function(n,i){var a=e.keyName(n),o=t.getOption(`extraKeys`),s=o&&o[a]||e.keyMap[t.getOption(`keyMap`)][a];s==`findNext`||s==`findPrev`||s==`findPersistentNext`||s==`findPersistentPrev`?(e.e_stop(n),d(t,r(t),i),t.execCommand(s)):(s==`find`||s==`findPersistent`)&&(e.e_stop(n),f(i,n))}),a&&l&&(d(t,c,l),p(t,n))}else s(t,g(t),`Search for:`,l,function(e){e&&!c.query&&t.operation(function(){d(t,c,e),c.posFrom=c.posTo=t.getCursor(),p(t,n)})})}function p(t,n,i){t.operation(function(){var o=r(t),s=a(t,o.query,n?o.posFrom:o.posTo);!s.find(n)&&(s=a(t,o.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),!s.find(n))||(t.setSelection(s.from(),s.to()),t.scrollIntoView({from:s.from(),to:s.to()},20),o.posFrom=s.from(),o.posTo=s.to(),i&&i(s.from(),s.to()))})}function m(e){e.operation(function(){var t=r(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&=(t.annotate.clear(),null))})}function h(e,t){var n=e?document.createElement(e):document.createDocumentFragment();for(var r in t)n[r]=t[r];for(var i=2;i{(function(r){typeof e==`object`&&typeof t==`object`?r(n(),_()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`,`../dialog/dialog`],r):r(CodeMirror)})(function(e){e.defineOption(`search`,{bottom:!1});function t(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(n,r))}function n(e){return e.phrase(`Jump to line:`)+` `+e.phrase(`(Use line:column or scroll% syntax)`)+``}function r(e,t){var n=Number(t);return/^[-+]/.test(t)?e.getCursor().line+n:n-1}e.commands.jumpToLine=function(e){var i=e.getCursor();t(e,n(e),e.phrase(`Jump to line:`),i.line+1+`:`+i.ch,function(t){if(t){var n;if(n=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(r(e,n[1]),Number(n[2]));else if(n=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var a=Math.round(e.lineCount()*Number(n[1])/100);/^[-+]/.test(n[1])&&(a=i.line+a+1),e.setCursor(a-1,i.ch)}else(n=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(r(e,n[1]),i.ch)}})},e.keyMap.default[`Alt-G`]=`jumpToLine`})}));i(),o(),s(),c(),l(),d(),f(),p(),m(),h(),g(),_(),v(),y();var b=r.default;export{b as default}; \ No newline at end of file