import{Q as ku,_ as wl,g as Sl,a2 as Lu,i as Tu,O as pl,x as Ou,P as Nu,o as Cl,c as kl,r as Au,a as Nn,b as vl,w as Mu,p as Du,f as Hu}from"./index.8ab1f836.js";var co={exports:{}},gl;function tt(){return gl||(gl=1,function(Oe,Be){(function(m,U){Oe.exports=U()})(ku,function(){var m=navigator.userAgent,U=navigator.platform,I=/gecko\/\d/i.test(m),G=/MSIE \d/.test(m),M=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(m),w=/Edge\/(\d+)/.exec(m),S=G||M||w,x=S&&(G?document.documentMode||6:+(w||M)[1]),C=!w&&/WebKit\//.test(m),W=C&&/Qt\/\d+\.\d+/.test(m),P=!w&&/Chrome\/(\d+)/.exec(m),j=P&&+P[1],O=/Opera\//.test(m),R=/Apple Computer/.test(navigator.vendor),D=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(m),H=/PhantomJS/.test(m),k=R&&(/Mobile\/\w+/.test(m)||navigator.maxTouchPoints>2),L=/Android/.test(m),B=k||L||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(m),z=k||/Mac/.test(U),q=/\bCrOS\b/.test(m),Q=/win/i.test(U),g=O&&m.match(/Version\/(\d*\.\d*)/);g&&(g=Number(g[1])),g&&g>=15&&(O=!1,C=!0);var F=z&&(W||O&&(g==null||g<12.11)),ne=I||S&&x>=9;function V(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ee=function(e,t){var n=e.className,r=V(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 T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function K(e,t){return T(e).appendChild(t)}function d(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 o=0;o=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}var ue=function(){this.id=null,this.f=null,this.time=0,this.handler=rt(this.onTimeout,this)};ue.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ue.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var pt=[""];function Lt(e){for(;pt.length<=e;)pt.push(pe(pt)+" ");return pt[e]}function pe(e){return e[e.length-1]}function wr(e,t){for(var n=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||vi.test(e))}function Sr(e,t){return t?t.source.indexOf("\\w")>-1&&qr(e)?!0:t.test(e):qr(e)}function Hn(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Cr=/[\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 Zr(e){return e.charCodeAt(0)>=768&&Cr.test(e)}function Tt(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function ur(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),a.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var Ot=null;function vt(e,t,n){var r;Ot=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&n=="before"?r=i:Ot=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:Ot=i)}return r!=null?r:Ot}var gi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(u,h,c){this.level=u,this.from=h,this.to=c}return function(u,h){var c=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!r.test(u))return!1;for(var b=u.length,y=[],A=0;A-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ke(e,t){var n=Qr(e,t);if(!!n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function Ve(e){e.prototype.on=function(t,n){Z(this,t,n)},e.prototype.off=function(t,n){qe(this,t,n)}}function Ze(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function fr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Jr(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function It(e){Ze(e),fr(e)}function nt(e){return e.target||e.srcElement}function jr(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),z&&e.ctrlKey&&t==1&&(t=3),t}var yi=function(){if(S&&x<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),yt;function mi(e){if(yt==null){var t=d("span","\u200B");K(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(yt=t.offsetWidth<=1&&t.offsetHeight>2&&!(S&&x<8))}var n=yt?d("span","\u200B"):d("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var kr;function Fn(e){if(kr!=null)return kr;var t=K(e,document.createTextNode("A\u062EA")),n=be(t,0,1).getBoundingClientRect(),r=be(t,1,2).getBoundingClientRect();return T(e),!n||n.left==n.right?!1:kr=r.right-n.right<3}var Vr=` b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(` `,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),a=o.indexOf("\r");a!=-1?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Zt=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},Nt=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),At=null;function Pn(e){if(At!=null)return At;var t=K(e,d("span","x")),n=t.getBoundingClientRect(),r=be(t,0,1).getBoundingClientRect();return At=Math.abs(n.left-r.left)>1}var bt={},Qt={};function In(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),bt[e]=t}function Lr(e,t){Qt[e]=t}function ut(e){if(typeof e=="string"&&Qt.hasOwnProperty(e))e=Qt[e];else if(e&&typeof e.name=="string"&&Qt.hasOwnProperty(e.name)){var t=Qt[e.name];typeof t=="string"&&(t={name:t}),e=Dn(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ut("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ut("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Rt(e,t){t=ut(t);var n=bt[t.name];if(!n)return Rt(e,"text/plain");var r=n(e,t);if(Jt.hasOwnProperty(t.name)){var i=Jt[t.name];for(var o in i)!i.hasOwnProperty(o)||(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Jt={};function Rn(e,t){var n=Jt.hasOwnProperty(e)?Jt[e]:Jt[e]={};ae(t,n)}function Bt(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 jt(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 $r(e,t,n){return e.startState?e.startState(t,n):!0}var He=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};He.prototype.eol=function(){return this.pos>=this.string.length},He.prototype.sol=function(){return this.pos==this.lineStart},He.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},He.prototype.next=function(){if(this.post},He.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},He.prototype.skipToEnd=function(){this.pos=this.string.length},He.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},He.prototype.backUp=function(e){this.pos-=e},He.prototype.column=function(){return this.lastColumnPos0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},He.prototype.current=function(){return this.string.slice(this.start,this.pos)},He.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},He.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},He.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function te(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?v(n,te(e,n).text.length):Ll(t,te(e,t.line).text.length)}function Ll(e,t){var n=e.ch;return n==null||n>t?v(e.line,t):n<0?v(e.line,0):e}function go(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},Dt.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}},Dt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Dt.fromSaved=function(e,t,n){return t instanceof Bn?new Dt(e,Bt(e.mode,t.state),n,t.lookAhead):new Dt(e,Bt(e.mode,t),n)},Dt.prototype.save=function(e){var t=e!==!1?Bt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Bn(t,this.maxLookAhead):t};function yo(e,t,n,r){var i=[e.state.modeGen],o={};Co(e,t.text,e.doc.mode,n,function(u,h){return i.push(u,h)},o,r);for(var a=n.state,l=function(u){n.baseTokens=i;var h=e.state.overlays[u],c=1,b=0;n.state=!0,Co(e,t.text,h.mode,n,function(y,A){for(var E=c;by&&i.splice(c,1,y,i[c+1],_),c+=2,b=Math.min(y,_)}if(!!A)if(h.opaque)i.splice(E,c-E,y,"overlay "+A),c=E+2;else for(;Ee.options.maxHighlightLength&&Bt(e.doc.mode,r.state),o=yo(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function en(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Dt(r,!0,t);var o=Tl(e,t,n),a=o>r.first&&te(r,o-1).stateAfter,l=a?Dt.fromSaved(r,a,o):new Dt(r,$r(r.mode),o);return r.iter(o,t,function(s){bi(e,s.text,l);var u=l.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&ut.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var xo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function wo(e,t,n,r){var i=e.doc,o=i.mode,a;t=se(i,t);var l=te(i,t.line),s=en(e,t.line,n),u=new He(l.text,e.options.tabSize,s),h;for(r&&(h=[]);(r||u.pose.options.maxHighlightLength?(l=!1,a&&bi(e,t,r,h.pos),h.pos=t.length,c=null):c=So(xi(n,h,r.state,b),o),b){var y=b[0].name;y&&(c="m-"+(c?y+" "+c:y))}if(!l||u!=c){for(;sa;--l){if(l<=o.first)return o.first;var s=te(o,l-1),u=s.stateAfter;if(u&&(!n||l+(u instanceof Bn?u.lookAhead:0)<=o.modeFrontier))return l;var h=ie(s.text,null,e.options.tabSize);(i==null||r>h)&&(i=l-1,r=h)}return i}function Ol(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=te(e,r).stateAfter;if(i&&(!(i instanceof Bn)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new zn(a,o.from,s?null:o.to))}}return r}function El(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t);if(l||o.from==t&&a.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(a.inclusiveLeft?o.from<=t:o.from0&&l)for(var $=0;$0)){var h=[s,1],c=N(u.from,l.from),b=N(u.to,l.to);(c<0||!a.inclusiveLeft&&!c)&&h.push({from:u.from,to:l.from}),(b>0||!a.inclusiveRight&&!b)&&h.push({from:l.to,to:u.to}),i.splice.apply(i,h),s+=h.length-3}}return i}function To(e){var t=e.markedSpans;if(!!t){for(var n=0;nt)&&(!r||Si(r,o.marker)<0)&&(r=o.marker)}return r}function Mo(e,t,n,r,i){var o=te(e,t),a=_t&&o.markedSpans;if(a)for(var l=0;l=0&&c<=0||h<=0&&c>=0)&&(h<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?N(u.to,n)>=0:N(u.to,n)>0)||h>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?N(u.from,r)<=0:N(u.from,r)<0)))return!0}}}function xt(e){for(var t;t=Ao(e);)e=t.find(-1,!0).line;return e}function Pl(e){for(var t;t=Un(e);)e=t.find(1,!0).line;return e}function Il(e){for(var t,n;t=Un(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Ci(e,t){var n=te(e,t),r=xt(n);return n==r?t:ge(r)}function Do(e,t){if(t>e.lastLine())return t;var n=te(e,t),r;if(!Vt(e,n))return t;for(;r=Un(n);)n=r.find(1,!0).line;return ge(n)+1}function Vt(e,t){var n=_t&&t.markedSpans;if(n){for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Or=function(e,t,n){this.text=e,Oo(this,t),this.height=n?n(this):1};Or.prototype.lineNo=function(){return ge(this)},Ve(Or);function Rl(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),To(e),Oo(e,n);var i=r?r(e):1;i!=e.height&&mt(e,i)}function Bl(e){e.parent=null,To(e)}var zl={},_l={};function Ho(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?_l:zl;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Eo(e,t){var n=ce("span",null,null,C?"padding-right: .1px":null),r={pre:ce("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 o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=Ul,Fn(e.display.measure)&&(a=gt(o,e.doc.direction))&&(r.addToken=Xl(r.addToken,a)),r.map=[];var l=t!=e.display.externalMeasured&&ge(o);Yl(o,r,mo(e,o,l)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Ft(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Ft(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(mi(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 ke(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Ft(r.pre.className,r.textClass||"")),r}function Gl(e){var t=d("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ul(e,t,n,r,i,o,a){if(!!t){var l=e.splitSpaces?Kl(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,h;if(!s.test(t))e.col+=t.length,h=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,h),S&&x<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var c=0;;){s.lastIndex=c;var b=s.exec(t),y=b?b.index-c:t.length-c;if(y){var A=document.createTextNode(l.slice(c,c+y));S&&x<9?h.appendChild(d("span",[A])):h.appendChild(A),e.map.push(e.pos,e.pos+y,A),e.col+=y,e.pos+=y}if(!b)break;c+=y+1;var E=void 0;if(b[0]==" "){var _=e.cm.options.tabSize,X=_-e.col%_;E=h.appendChild(d("span",Lt(X),"cm-tab")),E.setAttribute("role","presentation"),E.setAttribute("cm-text"," "),e.col+=X}else b[0]=="\r"||b[0]==` `?(E=h.appendChild(d("span",b[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),E.setAttribute("cm-text",b[0]),e.col+=1):(E=e.cm.options.specialCharPlaceholder(b[0]),E.setAttribute("cm-text",b[0]),S&&x<9?h.appendChild(d("span",[E])):h.appendChild(E),e.col+=1);e.map.push(e.pos,e.pos+1,E),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||u||o||a){var J=n||"";r&&(J+=r),i&&(J+=i);var Y=d("span",[h],J,o);if(a)for(var $ in a)a.hasOwnProperty($)&&$!="style"&&$!="class"&&Y.setAttribute($,a[$]);return e.content.appendChild(Y)}e.content.appendChild(h)}}function Kl(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;iu&&c.from<=u));b++);if(c.to>=h)return e(n,r,i,o,a,l,s);e(n,r.slice(0,c.to-u),i,o,null,l,s),o=null,r=r.slice(c.to-u),u=c.to}}}function Wo(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Yl(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var a=1;as||fe.collapsed&&re.to==s&&re.from==s)){if(re.to!=null&&re.to!=s&&y>re.to&&(y=re.to,E=""),fe.className&&(A+=" "+fe.className),fe.css&&(b=(b?b+";":"")+fe.css),fe.startStyle&&re.from==s&&(_+=" "+fe.startStyle),fe.endStyle&&re.to==y&&($||($=[])).push(fe.endStyle,re.to),fe.title&&((J||(J={})).title=fe.title),fe.attributes)for(var Se in fe.attributes)(J||(J={}))[Se]=fe.attributes[Se];fe.collapsed&&(!X||Si(X.marker,fe)<0)&&(X=re)}else re.from>s&&y>re.from&&(y=re.from)}if($)for(var Ke=0;Ke<$.length;Ke+=2)$[Ke+1]==y&&(E+=" "+$[Ke]);if(!X||X.from==s)for(var Ae=0;Ae=l)break;for(var ht=Math.min(l,y);;){if(h){var at=s+h.length;if(!X){var Fe=at>ht?h.slice(0,ht-s):h;t.addToken(t,Fe,c?c+A:A,_,s+Fe.length==y?E:"",b,J)}if(at>=ht){h=h.slice(ht-s),s=ht;break}s=at,_=""}h=i.slice(o,o=n[u++]),c=Ho(n[u++],t.cm.options)}}}function Fo(e,t,n){this.line=t,this.rest=Il(t),this.size=this.rest?ge(pe(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Vt(e,t)}function Xn(e,t,n){for(var r=[],i,o=t;o2&&o.push((s.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Go(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 ns(e,t){t=xt(t);var n=ge(t),r=e.display.externalMeasured=new Fo(e.doc,t,n);r.lineN=n;var i=r.built=Eo(e,r);return r.text=i.pre,K(e.display.lineMeasure,i.pre),r}function Uo(e,t,n,r){return Et(e,Ar(e,t),n,r)}function Ai(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(o=s-l,i=o-1,t>=s&&(a="right")),i!=null){if(r=e[u+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],a="left";if(n=="right"&&i==s-l)for(;u=0&&(n=e[i]).left==n.right;i--);return n}function os(e,t,n,r){var i=Xo(t.map,n,r),o=i.node,a=i.start,l=i.end,s=i.collapse,u;if(o.nodeType==3){for(var h=0;h<4;h++){for(;a&&Zr(t.line.text.charAt(i.coverStart+a));)--a;for(;i.coverStart+l0&&(s=r="right");var c;e.options.lineWrapping&&(c=o.getClientRects()).length>1?u=c[r=="right"?c.length-1:0]:u=o.getBoundingClientRect()}if(S&&x<9&&!a&&(!u||!u.left&&!u.right)){var b=o.parentNode.getClientRects()[0];b?u={left:b.left,right:b.left+Dr(e.display),top:b.top,bottom:b.bottom}:u=Ko}for(var y=u.top-t.rect.top,A=u.bottom-t.rect.top,E=(y+A)/2,_=t.view.measure.heights,X=0;X<_.length-1&&!(E<_[X]);X++);var J=X?_[X-1]:0,Y=_[X],$={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:J,bottom:Y};return!u.left&&!u.right&&($.bogus=!0),e.options.singleCursorHeightPerLine||($.rtop=y,$.rbottom=A),$}function as(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Pn(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function Yo(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return a(u=="before"?s-1:s,u=="before");function h(A,E,_){var X=l[E],J=X.level==1;return a(_?A-1:A,J!=_)}var c=vt(l,s,u),b=Ot,y=h(s,c,u=="before");return b!=null&&(y.other=h(s,b,u!="before")),y}function jo(e,t){var n=0;t=se(e.doc,t),e.options.lineWrapping||(n=Dr(e.display)*t.ch);var r=te(e.doc,t.line),i=Gt(r)+Yn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Di(e,t,n,r,i){var o=v(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Hi(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Di(r.first,0,null,-1,-1);var i=Mt(r,n),o=r.first+r.size-1;if(i>o)return Di(r.first+r.size-1,te(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=te(r,i);;){var l=ls(e,a,i,t,n),s=Fl(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var u=s.find(1);if(u.line==i)return u;a=te(r,i=u.line)}}function Vo(e,t,n,r){r-=Mi(t);var i=t.text.length,o=Me(function(a){return Et(e,n,a-1).bottom<=r},i,0);return i=Me(function(a){return Et(e,n,a).top>r},o,i),{begin:o,end:i}}function $o(e,t,n,r){n||(n=Ar(e,t));var i=qn(e,t,Et(e,n,r),"line").top;return Vo(e,t,n,i)}function Ei(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function ls(e,t,n,r,i){i-=Gt(t);var o=Ar(e,t),a=Mi(t),l=0,s=t.text.length,u=!0,h=gt(t,e.doc.direction);if(h){var c=(e.options.lineWrapping?us:ss)(e,t,n,o,h,r,i);u=c.level!=1,l=u?c.from:c.to-1,s=u?c.to:c.from-1}var b=null,y=null,A=Me(function(oe){var re=Et(e,o,oe);return re.top+=a,re.bottom+=a,Ei(re,r,i,!1)?(re.top<=i&&re.left<=r&&(b=oe,y=re),!0):!1},l,s),E,_,X=!1;if(y){var J=r-y.left=$.bottom?1:0}return A=Tt(t.text,A,1),Di(n,A,_,X,r-E)}function ss(e,t,n,r,i,o,a){var l=Me(function(c){var b=i[c],y=b.level!=1;return Ei(wt(e,v(n,y?b.to:b.from,y?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),s=i[l];if(l>0){var u=s.level!=1,h=wt(e,v(n,u?s.from:s.to,u?"after":"before"),"line",t,r);Ei(h,o,a,!0)&&h.top>a&&(s=i[l-1])}return s}function us(e,t,n,r,i,o,a){var l=Vo(e,t,r,a),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var h=null,c=null,b=0;b=u||y.to<=s)){var A=y.level!=1,E=Et(e,r,A?Math.min(u,y.to)-1:Math.max(s,y.from)).right,_=E_)&&(h=y,c=_)}}return h||(h=i[i.length-1]),h.fromu&&(h={from:h.from,to:u,level:h.level}),h}var cr;function Mr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(cr==null){cr=d("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)cr.appendChild(document.createTextNode("x")),cr.appendChild(d("br"));cr.appendChild(document.createTextNode("x"))}K(e.measure,cr);var n=cr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function Dr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=d("span","xxxxxxxxxx"),n=d("pre",[t],"CodeMirror-line-like");K(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Wi(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;n[l]=o.offsetLeft+o.clientLeft+i,r[l]=o.clientWidth}return{fixedPos:Fi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Fi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ea(e){var t=Mr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Dr(e.display)-3);return function(i){if(Vt(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(u=te(e.doc,s.line).text).length==s.ch){var h=ie(u,u.length,e.options.tabSize)-u.length;s=v(s.line,Math.max(0,Math.round((o-_o(e.display).left)/Dr(e.display))-h))}return s}function pr(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)_t&&Ci(e.doc,t)i.viewFrom?er(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)er(e);else if(t<=i.viewFrom){var o=Qn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):er(e)}else if(n>=i.viewTo){var a=Qn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):er(e)}else{var l=Qn(e,t,t,-1),s=Qn(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Xn(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):er(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[pr(e,t)];if(o.node!=null){var a=o.changes||(o.changes=[]);de(a,n)==-1&&a.push(n)}}}function er(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Qn(e,t,n,r){var i=pr(e,t),o,a=e.display.view;if(!_t||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var l=e.display.viewFrom,s=0;s0){if(i==a.length-1)return null;o=l+a[i].size-t,i++}else o=l-t;t+=o,n+=o}for(;Ci(e.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function fs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Xn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Xn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,pr(e,n)))),r.viewTo=n}function ta(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().line0?a:e.defaultCharWidth())+"px"}if(r.other){var l=n.appendChild(d("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=r.other.left+"px",l.style.top=r.other.top+"px",l.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Jn(e,t){return e.top-t.top||e.left-t.left}function hs(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=_o(e.display),l=a.left,s=Math.max(r.sizerWidth,hr(e)-r.sizer.offsetLeft)-a.right,u=i.direction=="ltr";function h(Y,$,oe,re){$<0&&($=0),$=Math.round($),re=Math.round(re),o.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+Y+`px; top: `+$+"px; width: "+(oe==null?s-Y:oe)+`px; height: `+(re-$)+"px"))}function c(Y,$,oe){var re=te(i,Y),fe=re.text.length,Se,Ke;function Ae(Fe,lt){return Zn(e,v(Y,Fe),"div",re,lt)}function ht(Fe,lt,Ye){var Re=$o(e,re,null,Fe),Pe=lt=="ltr"==(Ye=="after")?"left":"right",Ee=Ye=="after"?Re.begin:Re.end-(/\s/.test(re.text.charAt(Re.end-1))?2:1);return Ae(Ee,Pe)[Pe]}var at=gt(re,i.direction);return ur(at,$||0,oe==null?fe:oe,function(Fe,lt,Ye,Re){var Pe=Ye=="ltr",Ee=Ae(Fe,Pe?"left":"right"),st=Ae(lt-1,Pe?"right":"left"),Kr=$==null&&Fe==0,ar=oe==null&<==fe,Je=Re==0,Wt=!at||Re==at.length-1;if(st.top-Ee.top<=3){var Xe=(u?Kr:ar)&&Je,fo=(u?ar:Kr)&&Wt,Yt=Xe?l:(Pe?Ee:st).left,br=fo?s:(Pe?st:Ee).right;h(Yt,Ee.top,br-Yt,Ee.bottom)}else{var xr,et,Xr,ho;Pe?(xr=u&&Kr&&Je?l:Ee.left,et=u?s:ht(Fe,Ye,"before"),Xr=u?l:ht(lt,Ye,"after"),ho=u&&ar&&Wt?s:st.right):(xr=u?ht(Fe,Ye,"before"):l,et=!u&&Kr&&Je?s:Ee.right,Xr=!u&&ar&&Wt?l:st.left,ho=u?ht(lt,Ye,"after"):s),h(xr,Ee.top,et-xr,Ee.bottom),Ee.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Hr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function na(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||zi(e))}function Bi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Hr(e))},100)}function zi(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(ke(e,"focus",e,t),e.state.focused=!0,Ce(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()),Ri(e))}function Hr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ke(e,"blur",e,t),e.state.focused=!1,ee(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function jn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,a=0;a.005||y<-.005)&&(ie.display.sizerWidth){var E=Math.ceil(h/Dr(e.display));E>e.display.maxLineLength&&(e.display.maxLineLength=E,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function ia(e){if(e.widgets)for(var t=0;t=a&&(o=Mt(t,Gt(te(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function cs(e,t){if(!De(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),i!=null&&!H){var a=d("div","\u200B",null,`position: absolute; top: `+(t.top-n.viewOffset-Yn(e.display))+`px; height: `+(t.bottom-t.top+Ht(e)+n.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}function ds(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?v(t.line,t.ch+1,"before"):t,t=t.ch?v(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,l=wt(e,t),s=!n||n==t?l:wt(e,n);i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r};var u=_i(e,i),h=e.doc.scrollTop,c=e.doc.scrollLeft;if(u.scrollTop!=null&&(un(e,u.scrollTop),Math.abs(e.doc.scrollTop-h)>1&&(a=!0)),u.scrollLeft!=null&&(vr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(a=!0)),!a)break}return i}function ps(e,t){var n=_i(e,t);n.scrollTop!=null&&un(e,n.scrollTop),n.scrollLeft!=null&&vr(e,n.scrollLeft)}function _i(e,t){var n=e.display,r=Mr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Ni(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Oi(n),s=t.topl-r;if(t.topi+o){var h=Math.min(t.top,(u?l:t.bottom)-o);h!=i&&(a.scrollTop=h)}var c=e.options.fixedGutter?0:n.gutters.offsetWidth,b=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-c,y=hr(e)-n.gutters.offsetWidth,A=t.right-t.left>y;return A&&(t.right=t.left+y),t.left<10?a.scrollLeft=0:t.lefty+b-3&&(a.scrollLeft=t.right+(A?0:10)-y),a}function Gi(e,t){t!=null&&($n(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Er(e){$n(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function sn(e,t,n){(t!=null||n!=null)&&$n(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function vs(e,t){$n(e),e.curOp.scrollToPos=t}function $n(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=jo(e,t.from),r=jo(e,t.to);oa(e,n,r,t.margin)}}function oa(e,t,n,r){var i=_i(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});sn(e,i.scrollLeft,i.scrollTop)}function un(e,t){Math.abs(e.doc.scrollTop-t)<2||(I||Ki(e,{top:t}),aa(e,t,!0),I&&Ki(e),cn(e,100))}function aa(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 vr(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,ha(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function fn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Oi(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+Ht(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var gr=function(e,t,n){this.cm=n;var r=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),Z(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Z(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,S&&x<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};gr.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 o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},gr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},gr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},gr.prototype.zeroWidthHack=function(){var e=z&&!D?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new ue,this.disableVert=new ue},gr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},gr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var hn=function(){};hn.prototype.update=function(){return{bottom:0,right:0}},hn.prototype.setScrollLeft=function(){},hn.prototype.setScrollTop=function(){},hn.prototype.clear=function(){};function Wr(e,t){t||(t=fn(e));var n=e.display.barWidth,r=e.display.barHeight;la(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&jn(e),la(e,fn(e)),n=e.display.barWidth,r=e.display.barHeight}function la(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 sa={native:gr,null:hn};function ua(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ee(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new sa[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Z(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"?vr(e,t):un(e,t)},e),e.display.scrollbars.addClass&&Ce(e.display.wrapper,e.display.scrollbars.addClass)}var gs=0;function yr(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:++gs,markArrays:null},ql(e.curOp)}function mr(e){var t=e.curOp;t&&Ql(t,function(n){for(var r=0;r=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ei(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function bs(e){e.updatedDisplay=e.mustUpdate&&Ui(e.cm,e.update)}function xs(e){var t=e.cm,n=t.display;e.updatedDisplay&&jn(t),e.barMeasure=fn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Uo(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+Ht(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-hr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function ws(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=en(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?Bt(t.mode,r.state):null,s=yo(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var u=o.styleClasses,h=s.classes;h?o.styleClasses=h:u&&(o.styleClasses=null);for(var c=!a||a.length!=o.styles.length||u!=h&&(!u||!h||u.bgClass!=h.bgClass||u.textClass!=h.textClass),b=0;!c&&bn)return cn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&ft(e,function(){for(var o=0;o=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&ta(e)==0)return!1;ca(e)&&(er(e),t.dims=Wi(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),_t&&(o=Ci(e.doc,o),a=Do(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;fs(e,o,a),n.viewOffset=Gt(te(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=ta(e);if(!l&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=Ls(e);return s>4&&(n.lineDiv.style.display="none"),Os(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Ts(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,cn(e,400)),n.updateLineNumbers=null,!0}function fa(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==hr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Oi(e.display)-Ni(e),n.top)}),t.visible=Vn(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Vn(e.display,e.doc,n));if(!Ui(e,t))break;jn(e);var i=fn(e);ln(e),Wr(e,i),Yi(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 Ki(e,t){var n=new ei(e,t);if(Ui(e,n)){jn(e),fa(e,n);var r=fn(e);ln(e),Wr(e,r),Yi(e,r),n.finish()}}function Os(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(A){var E=A.nextSibling;return C&&z&&e.display.currentWheelTarget==A?A.style.display="none":A.parentNode.removeChild(A),E}for(var s=r.view,u=r.viewFrom,h=0;h-1&&(y=!1),Po(e,c,u,n)),y&&(T(c.lineNumber),c.lineNumber.appendChild(document.createTextNode(p(e.options,u)))),a=c.node.nextSibling}u+=c.size}for(;a;)a=l(a)}function Xi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",_e(e,"gutterChanged",e)}function Yi(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+Ht(e)+"px"}function ha(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Fi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),S&&x<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!C&&!(I&&B)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=qi(r.gutters,r.lineNumbers),da(i),n.init(i)}var ti=0,Kt=null;S?Kt=-.53:I?Kt=15:P?Kt=-.7:R&&(Kt=-1/3);function pa(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function As(e){var t=pa(e);return t.x*=Kt,t.y*=Kt,t}function va(e,t){P&&j==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=pa(t),r=n.x,i=n.y,o=Kt;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var a=e.display,l=a.scroller,s=l.scrollWidth>l.clientWidth,u=l.scrollHeight>l.clientHeight;if(!!(r&&s||i&&u)){if(i&&z&&C){e:for(var h=t.target,c=a.view;h!=l;h=h.parentNode)for(var b=0;b=0&&N(e,r.to())<=0)return n}return-1};var ye=function(e,t){this.anchor=e,this.head=t};ye.prototype.from=function(){return Ie(this.anchor,this.head)},ye.prototype.to=function(){return ve(this.anchor,this.head)},ye.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function St(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(b,y){return N(b.from(),y.from())}),n=de(t,i);for(var o=1;o0:s>=0){var u=Ie(l.from(),a.from()),h=ve(l.to(),a.to()),c=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new ye(c?h:u,c?u:h))}}return new dt(t,n)}function tr(e,t){return new dt([new ye(e,t||e)],0)}function rr(e){return e.text?v(e.from.line+e.text.length-1,pe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ga(e,t){if(N(e,t.from)<0)return e;if(N(e,t.to)<=0)return rr(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+=rr(t).ch-t.to.ch),v(n,r)}function Zi(e,t){for(var n=[],r=0;r1&&e.remove(l.line+1,A-1),e.insert(l.line+1,X)}_e(e,"change",e,t)}function nr(e,t,n){function r(i,o,a){if(i.linked)for(var l=0;l1&&!e.done[e.done.length-2].ranges)return e.done.pop(),pe(e.done)}function Sa(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,a,l;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(a=Hs(i,i.lastOp==r)))l=pe(a.changes),N(t.from,t.to)==0&&N(t.from,l.to)==0?l.to=rr(t):a.changes.push(ji(e,t));else{var s=pe(i.done);for((!s||!s.ranges)&&ni(e.sel,i.done),a={changes:[ji(e,t)],generation:i.generation},i.done.push(a);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=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||ke(e,"historyAdded")}function Es(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Ws(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Es(e,o,pe(i.done),t))?i.done[i.done.length-1]=t:ni(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&wa(i.undone)}function ni(e,t){var n=pe(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ca(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(a){a.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=a.markedSpans),++o})}function Fs(e){if(!e)return null;for(var t,n=0;n-1&&(pe(l)[c]=u[c],delete u[c])}}return r}function Vi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=N(t,i)<0;o!=N(n,i)<0?(i=t,t=n):o!=N(t,n)<0&&(t=n)}return new ye(i,t)}else return new ye(n||t,t)}function ii(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Qe(e,new dt([Vi(e.sel.primary(),t,n,i)],0),r)}function La(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:l.to>t.ch))){if(i&&(ke(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--a;continue}else break;if(!s.atomic)continue;if(n){var c=s.find(r<0?1:-1),b=void 0;if((r<0?h:u)&&(c=Da(e,c,-r,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(b=N(c,n))&&(r<0?b<0:b>0))return Pr(e,c,t,r,i)}var y=s.find(r<0?-1:1);return(r<0?u:h)&&(y=Da(e,y,r,y.line==t.line?o:null)),y?Pr(e,y,t,r,i):null}}return t}function ai(e,t,n,r,i){var o=r||1,a=Pr(e,t,n,o,i)||!i&&Pr(e,t,n,o,!0)||Pr(e,t,n,-o,i)||!i&&Pr(e,t,n,-o,!0);return a||(e.cantEdit=!0,v(e.first,0))}function Da(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?se(e,v(t.line-1)):null:n>0&&t.ch==(r||te(e,t.line)).text.length?t.line=0;--i)Wa(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Wa(e,t)}}function Wa(e,t){if(!(t.text.length==1&&t.text[0]==""&&N(t.from,t.to)==0)){var n=Zi(e,t);Sa(e,t,n,e.cm?e.cm.curOp.id:NaN),vn(e,t,n,wi(e,t));var r=[];nr(e,function(i,o){!o&&de(r,i.history)==-1&&(Ra(i.history,t),r.push(i.history)),vn(i,t,null,wi(i,t))})}}function li(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,a=e.sel,l=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u=0;--y){var A=b(y);if(A)return A.v}}}}function Fa(e,t){if(t!=0&&(e.first+=t,e.sel=new dt(wr(e.sel.ranges,function(i){return new ye(v(i.anchor.line+t,i.anchor.ch),v(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){it(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:v(o,te(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=zt(e,t.from,t.to),n||(n=Zi(e,t)),e.cm?Rs(e.cm,t,r):Ji(e,t,r),oi(e,n,Ne),e.cantEdit&&ai(e,v(e.firstLine(),0))&&(e.cantEdit=!1)}}function Rs(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=ge(xt(te(r,o.line))),r.iter(s,a.line+1,function(y){if(y==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Wn(e),Ji(r,t,n,ea(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(y){var A=Kn(y);A>i.maxLineLength&&(i.maxLine=y,i.maxLineLength=A,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),Ol(r,o.line),cn(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?it(e):o.line==a.line&&t.text.length==1&&!ma(e.doc,t)?$t(e,o.line,"text"):it(e,o.line,a.line+1,u);var h=je(e,"changes"),c=je(e,"change");if(c||h){var b={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};c&&_e(e,"change",e,b),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(b)}e.display.selForContextMenu=null}function Rr(e,t,n,r,i){var o;r||(r=n),N(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Ir(e,{from:n,to:r,text:t,origin:i})}function Pa(e,t,n,r){n1||!(this.children[0]instanceof yn))){var l=[];this.collapse(l),this.children=[new yn(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,l=a;l10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=h,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&it(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Aa(e.doc)),e&&_e(e,"markerCleared",e,this,r,i),t&&mr(e),this.parent&&this.parent.clear()}},ir.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i0||a==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=ce("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Mo(e,t.line,t,n,o)||t.line!=n.line&&Mo(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Al()}o.addToHistory&&Sa(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,u;if(e.iter(l,n.line+1,function(c){s&&o.collapsed&&!s.options.lineWrapping&&xt(c)==s.display.maxLine&&(u=!0),o.collapsed&&l!=t.line&&mt(c,0),Dl(c,new zn(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(c){Vt(e,c)&&mt(c,0)}),o.clearOnEnter&&Z(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Nl(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++za,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)it(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var h=t.line;h<=n.line;h++)$t(s,h,"text");o.atomic&&Aa(s.doc),_e(s,"markerAdded",s,o)}return o}var xn=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;s--)Ir(this,r[s]);l?Oa(this,l):this.cm&&Er(this.cm)}),undo:Ue(function(){li(this,"undo")}),redo:Ue(function(){li(this,"redo")}),undoSelection:Ue(function(){li(this,"undo",!0)}),redoSelection:Ue(function(){li(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=se(this,e),t=se(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.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-=o,++n}),se(this,v(n,t))},indexFromPos:function(e){e=se(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 h=e.dataTransfer.getData("Text");if(h){var c;if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),oi(t.doc,tr(n,n)),c)for(var b=0;b=0;l--)Rr(e.doc,"",r[l].from,r[l].to,"+delete");Er(e)})}function eo(e,t,n){var r=Tt(e.text,t+n,n);return r<0||r>e.text.length?null:r}function to(e,t,n){var r=eo(e,t.ch,n);return r==null?null:new v(t.line,r,n<0?"after":"before")}function ro(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=gt(n,t.doc.direction);if(o){var a=i<0?pe(o):o[0],l=i<0==(a.level==1),s=l?"after":"before",u;if(a.level>0||t.doc.direction=="rtl"){var h=Ar(t,n);u=i<0?n.text.length-1:0;var c=Et(t,h,u).top;u=Me(function(b){return Et(t,h,b).top==c},i<0==(a.level==1)?a.from:a.to-1,u),s=="before"&&(u=eo(n,u,1))}else u=i<0?a.to:a.from;return new v(r,u,s)}}return new v(r,i<0?n.text.length:0,i<0?"before":"after")}function Vs(e,t,n,r){var i=gt(t,e.doc.direction);if(!i)return to(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 o=vt(i,n.ch,n.sticky),a=i[o];if(e.doc.direction=="ltr"&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&b>=h.begin)){var y=c?"before":"after";return new v(n.line,b,y)}}var A=function(X,J,Y){for(var $=function(Se,Ke){return Ke?new v(n.line,l(Se,1),"before"):new v(n.line,Se,"after")};X>=0&&X0==(oe.level!=1),fe=re?Y.begin:l(Y.end,-1);if(oe.from<=fe&&fe0?h.end:l(h.begin,-1);return _!=null&&!(r>0&&_==t.text.length)&&(E=A(r>0?0:i.length-1,r,u(_)),E)?E:null}var Cn={selectAll:Ha,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ne)},killLine:function(e){return _r(e,function(t){if(t.empty()){var n=te(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new v(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),v(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=te(e.doc,i.line-1).text;a&&(i=new v(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),v(i.line-1,a.length-1),i,"+transpose"))}}n.push(new ye(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return ft(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&&N(t,this.pos)==0&&n==this.button};var Ln,Tn;function ou(e,t){var n=+new Date;return Tn&&Tn.compare(n,e,t)?(Ln=Tn=null,"triple"):Ln&&Ln.compare(n,e,t)?(Tn=new io(n,e,t),Ln=null,"double"):(Ln=new io(n,e,t),Tn=null,"single")}function rl(e){var t=this,n=t.display;if(!(De(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Ut(n,e)){C||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!oo(t,e)){var r=dr(t,e),i=jr(e),o=r?ou(r,i):"single";Pt(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&au(t,i,r,o,e))&&(i==1?r?su(t,r,o,e):nt(e)==n.scroller&&Ze(e):i==2?(r&&ii(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(ne?t.display.input.onContextMenu(e):Bi(t)))}}}function au(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,kn(e,qa(o,i),i,function(a){if(typeof a=="string"&&(a=Cn[a]),!a)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=a(e,n)!=xe}finally{e.state.suppressEdits=!1}return l})}function lu(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=q?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=z?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(z?n.altKey:n.ctrlKey)),i}function su(e,t,n,r){S?setTimeout(rt(na,e),0):e.curOp.focus=we(ze(e));var i=lu(e,n,r),o=e.doc.sel,a;e.options.dragDrop&&yi&&!e.isReadOnly()&&n=="single"&&(a=o.contains(t))>-1&&(N((a=o.ranges[a]).from(),t)<0||t.xRel>0)&&(N(a.to(),t)>0||t.xRel<0)?uu(e,r,t,i):fu(e,r,t,i)}function uu(e,t,n,r){var i=e.display,o=!1,a=Ge(e,function(u){C&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Bi(e)),qe(i.wrapper.ownerDocument,"mouseup",a),qe(i.wrapper.ownerDocument,"mousemove",l),qe(i.scroller,"dragstart",s),qe(i.scroller,"drop",a),o||(Ze(u),r.addNew||ii(e.doc,n,null,null,r.extend),C&&!R||S&&x==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),l=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};C&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,Z(i.wrapper.ownerDocument,"mouseup",a),Z(i.wrapper.ownerDocument,"mousemove",l),Z(i.scroller,"dragstart",s),Z(i.scroller,"drop",a),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function nl(e,t,n){if(n=="char")return new ye(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new ye(v(t.line,0),se(e.doc,v(t.line+1,0)));var r=n(e,t);return new ye(r.from,r.to)}function fu(e,t,n,r){S&&Bi(e);var i=e.display,o=e.doc;Ze(t);var a,l,s=o.sel,u=s.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),l>-1?a=u[l]:a=new ye(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),r.unit=="rectangle")r.addNew||(a=new ye(n,n)),n=dr(e,t,!0,!0),l=-1;else{var h=nl(e,n,r.unit);r.extend?a=Vi(a,h.anchor,h.head,r.extend):a=h}r.addNew?l==-1?(l=u.length,Qe(o,St(e,u.concat([a]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&r.unit=="char"&&!r.extend?(Qe(o,St(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):$i(o,l,a,sr):(l=0,Qe(o,new dt([a],0),sr),s=o.sel);var c=n;function b(Y){if(N(c,Y)!=0)if(c=Y,r.unit=="rectangle"){for(var $=[],oe=e.options.tabSize,re=ie(te(o,n.line).text,n.ch,oe),fe=ie(te(o,Y.line).text,Y.ch,oe),Se=Math.min(re,fe),Ke=Math.max(re,fe),Ae=Math.min(n.line,Y.line),ht=Math.min(e.lastLine(),Math.max(n.line,Y.line));Ae<=ht;Ae++){var at=te(o,Ae).text,Fe=kt(at,Se,oe);Se==Ke?$.push(new ye(v(Ae,Fe),v(Ae,Fe))):at.length>Fe&&$.push(new ye(v(Ae,Fe),v(Ae,kt(at,Ke,oe))))}$.length||$.push(new ye(n,n)),Qe(o,St(e,s.ranges.slice(0,l).concat($),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Y)}else{var lt=a,Ye=nl(e,Y,r.unit),Re=lt.anchor,Pe;N(Ye.anchor,Re)>0?(Pe=Ye.head,Re=Ie(lt.from(),Ye.anchor)):(Pe=Ye.anchor,Re=ve(lt.to(),Ye.head));var Ee=s.ranges.slice(0);Ee[l]=hu(e,new ye(se(o,Re),Pe)),Qe(o,St(e,Ee,l),sr)}}var y=i.wrapper.getBoundingClientRect(),A=0;function E(Y){var $=++A,oe=dr(e,Y,!0,r.unit=="rectangle");if(!!oe)if(N(oe,c)!=0){e.curOp.focus=we(ze(e)),b(oe);var re=Vn(i,o);(oe.line>=re.to||oe.liney.bottom?20:0;fe&&setTimeout(Ge(e,function(){A==$&&(i.scroller.scrollTop+=fe,E(Y))}),50)}}function _(Y){e.state.selectingText=!1,A=1/0,Y&&(Ze(Y),i.input.focus()),qe(i.wrapper.ownerDocument,"mousemove",X),qe(i.wrapper.ownerDocument,"mouseup",J),o.history.lastSelOrigin=null}var X=Ge(e,function(Y){Y.buttons===0||!jr(Y)?_(Y):E(Y)}),J=Ge(e,_);e.state.selectingText=J,Z(i.wrapper.ownerDocument,"mousemove",X),Z(i.wrapper.ownerDocument,"mouseup",J)}function hu(e,t){var n=t.anchor,r=t.head,i=te(e.doc,n.line);if(N(n,r)==0&&n.sticky==r.sticky)return t;var o=gt(i);if(!o)return t;var a=vt(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s=a+(l.from==n.ch==(l.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var h=vt(o,r.ch,r.sticky),c=h-a||(r.ch-n.ch)*(l.level==1?-1:1);h==s-1||h==s?u=c<0:u=c>0}var b=o[s+(u?-1:0)],y=u==(b.level==1),A=y?b.from:b.to,E=y?"after":"before";return n.ch==A&&n.sticky==E?t:new ye(new v(n.line,A,E),r)}function il(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ze(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!je(e,n))return Jr(t);o-=l.top-a.viewOffset;for(var s=0;s=i){var h=Mt(e.doc,o),c=e.display.gutterSpecs[s];return ke(e,n,e,h,c.className,t),Jr(t)}}}function oo(e,t){return il(e,t,"gutterClick",!0)}function ol(e,t){Ut(e.display,t)||cu(e,t)||De(e,t,"contextmenu")||ne||e.display.input.onContextMenu(t)}function cu(e,t){return je(e,"gutterContextMenu")?il(e,t,"gutterContextMenu",!1):!1}function al(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),an(e)}var Gr={toString:function(){return"CodeMirror.Init"}},ll={},hi={};function du(e){var t=e.optionHandlers;function n(r,i,o,a){e.defaults[r]=i,o&&(t[r]=a?function(l,s,u){u!=Gr&&o(l,s,u)}:o)}e.defineOption=n,e.Init=Gr,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Qi(r)},!0),n("indentUnit",2,Qi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){pn(r),an(r),it(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],a=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var h=s.text.indexOf(i,u);if(h==-1)break;u=h+i.length,o.push(v(a,h))}a++});for(var l=o.length-1;l>=0;l--)Rr(r.doc,i,o[l],v(o[l].line,o[l].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=Gr&&r.refresh()}),n("specialCharPlaceholder",Gl,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",B?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!Q),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){al(r),dn(r)},!0),n("keyMap","default",function(r,i,o){var a=ui(i),l=o!=Gr&&ui(o);l&&l.detach&&l.detach(r,a),a.attach&&a.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,vu,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=qi(i,r.options.lineNumbers),dn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Fi(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Wr(r)},!0),n("scrollbarStyle","native",function(r){ua(r),Wr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=qi(r.options.gutters,i),dn(r)},!0),n("firstLineNumber",1,dn,!0),n("lineNumberFormatter",function(r){return r},dn,!0),n("showCursorWhenSelecting",!1,ln,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Hr(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,pu),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,ln,!0),n("singleCursorHeightPerLine",!0,ln,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,pn,!0),n("addModeClass",!1,pn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,pn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function pu(e,t,n){var r=n&&n!=Gr;if(!t!=!r){var i=e.display.dragFunctions,o=t?Z:qe;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function vu(e){e.options.lineWrapping?(Ce(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ee(e.display.wrapper,"CodeMirror-wrap"),Li(e)),Pi(e),it(e),an(e),setTimeout(function(){return Wr(e)},100)}function Te(e,t){var n=this;if(!(this instanceof Te))return new Te(e,t);this.options=t=t?ae(t):{},ae(ll,t,!1);var r=t.value;typeof r=="string"?r=new ot(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Te.inputStyles[t.inputStyle](this),o=this.display=new Ns(e,r,i,t);o.wrapper.CodeMirror=this,al(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ua(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 ue,keySeq:null,specialChars:null},t.autofocus&&!B&&o.input.focus(),S&&x<11&&setTimeout(function(){return n.display.input.reset(!0)},20),gu(this),qs(),yr(this),this.curOp.forceUpdate=!0,ba(this,r),t.autofocus&&!B||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&zi(n)},20):Hr(this);for(var a in hi)hi.hasOwnProperty(a)&&hi[a](this,t[a],Gr);ca(this),t.finishInit&&t.finishInit(this);for(var l=0;l20*20}Z(t.scroller,"touchstart",function(s){if(!De(e,s)&&!o(s)&&!oo(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),Z(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Z(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Ut(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var h=e.coordsChar(t.activeTouch,"page"),c;!u.prev||a(u,u.prev)?c=new ye(h,h):!u.prev.prev||a(u,u.prev.prev)?c=e.findWordAt(h):c=new ye(v(h.line,0),se(e.doc,v(h.line+1,0))),e.setSelection(c.anchor,c.head),e.focus(),Ze(s)}i()}),Z(t.scroller,"touchcancel",i),Z(t.scroller,"scroll",function(){t.scroller.clientHeight&&(un(e,t.scroller.scrollTop),vr(e,t.scroller.scrollLeft,!0),ke(e,"scroll",e))}),Z(t.scroller,"mousewheel",function(s){return va(e,s)}),Z(t.scroller,"DOMMouseScroll",function(s){return va(e,s)}),Z(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){De(e,s)||It(s)},over:function(s){De(e,s)||(Ys(e,s),It(s))},start:function(s){return Xs(e,s)},drop:Ge(e,Ks),leave:function(s){De(e,s)||Ua(e)}};var l=t.input.getField();Z(l,"keyup",function(s){return el.call(e,s)}),Z(l,"keydown",Ge(e,$a)),Z(l,"keypress",Ge(e,tl)),Z(l,"focus",function(s){return zi(e,s)}),Z(l,"blur",function(s){return Hr(e,s)})}var ao=[];Te.defineInitHook=function(e){return ao.push(e)};function On(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=en(e,t).state:n="prev");var a=e.options.tabSize,l=te(i,t),s=ie(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var u=l.text.match(/^\s*/)[0],h;if(!r&&!/\S/.test(l.text))h=0,n="not";else if(n=="smart"&&(h=i.mode.indent(o,l.text.slice(u.length),l.text),h==xe||h>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?h=ie(te(i,t-1).text,null,a):h=0:n=="add"?h=s+e.options.indentUnit:n=="subtract"?h=s-e.options.indentUnit:typeof n=="number"&&(h=s+n),h=Math.max(0,h);var c="",b=0;if(e.options.indentWithTabs)for(var y=Math.floor(h/a);y;--y)b+=a,c+=" ";if(ba,s=Vr(t),u=null;if(l&&r.ranges.length>1)if(Ct&&Ct.text.join(` `)==t){if(r.ranges.length%Ct.text.length==0){u=[];for(var h=0;h=0;b--){var y=r.ranges[b],A=y.from(),E=y.to();y.empty()&&(n&&n>0?A=v(A.line,A.ch-n):e.state.overwrite&&!l?E=v(E.line,Math.min(te(o,E.line).text.length,E.ch+pe(s).length)):l&&Ct&&Ct.lineWise&&Ct.text.join(` `)==s.join(` `)&&(A=E=v(A.line,0)));var _={from:A,to:E,text:u?u[b%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};Ir(e.doc,_),_e(e,"inputRead",e,_)}t&&!l&&ul(e,t),Er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=c),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&ft(t,function(){return lo(t,n,0,null,"paste")}),!0}function ul(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 o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l-1){a=On(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(te(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=On(e,i.head.line,"smart"));a&&_e(e,"electricInput",e,i.head.line)}}}function fl(e){for(var t=[],n=[],r=0;ro&&(On(this,l.head.line,r,!0),o=l.head.line,a==this.doc.sel.primIndex&&Er(this));else{var s=l.from(),u=l.to(),h=Math.max(o,s.line);o=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var c=h;c0&&$i(this.doc,a,new ye(s,b[a].to()),Ne)}}}),getTokenAt:function(r,i){return wo(this,r,i)},getLineTokens:function(r,i){return wo(this,v(r),i,!0)},getTokenTypeAt:function(r){r=se(this.doc,r);var i=mo(this,te(this.doc,r.line)),o=0,a=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var u=o+a>>1;if((u?i[u*2-1]:0)>=l)a=u;else if(i[u*2+1]s&&(r=s,a=!0),l=te(this.doc,r)}else l=r;return qn(this,l,{top:0,left:0},i||"page",o||a).top+(a?this.doc.height-Gt(l):0)},defaultTextHeight:function(){return Mr(this.display)},defaultCharWidth:function(){return Dr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,a,l){var s=this.display;r=wt(this,se(this.doc,r));var u=r.bottom,h=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),a=="over")u=r.top;else if(a=="above"||a=="near"){var c=Math.max(s.wrapper.clientHeight,this.doc.height),b=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(a=="above"||r.bottom+i.offsetHeight>c)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=c&&(u=r.bottom),h+i.offsetWidth>b&&(h=b-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",l=="right"?(h=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(l=="left"?h=0:l=="middle"&&(h=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=h+"px"),o&&ps(this,{left:h,top:u,right:h+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:$e($a),triggerOnKeyPress:$e(tl),triggerOnKeyUp:el,triggerOnMouseDown:$e(rl),execCommand:function(r){if(Cn.hasOwnProperty(r))return Cn[r].call(null,this)},triggerElectric:$e(function(r){ul(this,r)}),findPosH:function(r,i,o,a){var l=1;i<0&&(l=-1,i=-i);for(var s=se(this.doc,r),u=0;u0&&h(o.charAt(a-1));)--a;for(;l.5||this.options.lineWrapping)&&Pi(this),ke(this,"refresh",this)}),swapDoc:$e(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),ba(this,r),an(this),this.display.input.reset(),sn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,_e(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ve(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,a){e.registerHelper(r,i,a),n[r]._global.push({pred:o,val:a})}}function uo(e,t,n,r,i){var o=t,a=n,l=te(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var J=t.line+s;return J=e.first+e.size?!1:(t=new v(J,t.ch,t.sticky),l=te(e,J))}function h(J){var Y;if(r=="codepoint"){var $=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN($))Y=null;else{var oe=n>0?$>=55296&&$<56320:$>=56320&&$<57343;Y=new v(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(oe?2:1))),-n)}}else i?Y=Vs(e.cm,l,t,n):Y=to(l,t,n);if(Y==null)if(!J&&u())t=ro(i,e.cm,l,t.line,s);else return!1;else t=Y;return!0}if(r=="char"||r=="codepoint")h();else if(r=="column")h(!0);else if(r=="word"||r=="group")for(var c=null,b=r=="group",y=e.cm&&e.cm.getHelper(t,"wordChars"),A=!0;!(n<0&&!h(!A));A=!1){var E=l.text.charAt(t.ch)||` `,_=Sr(E,y)?"w":b&&E==` `?"n":!b||/\s/.test(E)?null:"p";if(b&&!A&&!_&&(_="s"),c&&c!=_){n<0&&(n=1,h(),t.sticky="after");break}if(_&&(c=_),n>0&&!h(!A))break}var X=ai(e,t,o,a,!0);return le(o,X)&&(X.hitSide=!0),X}function cl(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,Pt(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(l-.5*Mr(e.display),3);a=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(a=n>0?t.bottom+3:t.top-3);for(var u;u=Hi(e,o,a),!!u.outside;){if(n<0?a<=0:a>=i.height){u.hitSide=!0;break}a+=n*5}return u}var me=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ue,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};me.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,so(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(l){for(var s=l.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}Z(i,"paste",function(l){!o(l)||De(r,l)||sl(l,r)||x<=11&&setTimeout(Ge(r,function(){return t.updateFromDOM()}),20)}),Z(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),Z(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),Z(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Z(i,"touchstart",function(){return n.forceCompositionEnd()}),Z(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(l){if(!(!o(l)||De(r,l))){if(r.somethingSelected())ci({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=fl(r);ci({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Ne),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var u=Ct.text.join(` `);if(l.clipboardData.setData("Text",u),l.clipboardData.getData("Text")==u){l.preventDefault();return}}var h=hl(),c=h.firstChild;so(c),r.display.lineSpace.insertBefore(h,r.display.lineSpace.firstChild),c.value=Ct.text.join(` `);var b=we(i.ownerDocument);lr(c),setTimeout(function(){r.display.lineSpace.removeChild(h),b.focus(),b==i&&n.showPrimarySelection()},50)}}Z(i,"copy",a),Z(i,"cut",a)},me.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},me.prototype.prepareSelection=function(){var e=ra(this.cm,!1);return e.focus=we(this.div.ownerDocument)==this.div,e},me.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},me.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},me.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line=t.display.viewFrom&&dl(t,r)||{node:l[0].measure.map[2],offset:0},u=i.linee.firstLine()&&(r=v(r.line-1,te(e.doc,r.line-1).length)),i.ch==te(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,a,l;r.line==t.viewFrom||(o=pr(e,r.line))==0?(a=ge(t.view[0].line),l=t.view[0].node):(a=ge(t.view[o].line),l=t.view[o-1].node.nextSibling);var s=pr(e,i.line),u,h;if(s==t.view.length-1?(u=t.viewTo-1,h=t.lineDiv.lastChild):(u=ge(t.view[s+1].line)-1,h=t.view[s+1].node.previousSibling),!l)return!1;for(var c=e.doc.splitLines(bu(e,l,h,a,u)),b=zt(e.doc,v(a,0),v(u,te(e.doc,u).text.length));c.length>1&&b.length>1;)if(pe(c)==pe(b))c.pop(),b.pop(),u--;else if(c[0]==b[0])c.shift(),b.shift(),a++;else break;for(var y=0,A=0,E=c[0],_=b[0],X=Math.min(E.length,_.length);yr.ch&&J.charCodeAt(J.length-A-1)==Y.charCodeAt(Y.length-A-1);)y--,A++;c[c.length-1]=J.slice(0,J.length-A).replace(/^\u200b+/,""),c[0]=c[0].slice(y).replace(/\u200b+$/,"");var oe=v(a,y),re=v(u,b.length?pe(b).length-A:0);if(c.length>1||c[0]||N(oe,re))return Rr(e.doc,c,oe,re,"+input"),!0},me.prototype.ensurePolled=function(){this.forceCompositionEnd()},me.prototype.reset=function(){this.forceCompositionEnd()},me.prototype.forceCompositionEnd=function(){!this.composing||(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},me.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},me.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ft(this.cm,function(){return it(e.cm)})},me.prototype.setUneditable=function(e){e.contentEditable="false"},me.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ge(this.cm,lo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},me.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},me.prototype.onContextMenu=function(){},me.prototype.resetPosition=function(){},me.prototype.needsContentAttribute=!0;function dl(e,t){var n=Ai(e,t.line);if(!n||n.hidden)return null;var r=te(e.doc,t.line),i=Go(n,r,t.line),o=gt(r,e.doc.direction),a="left";if(o){var l=vt(o,t.ch);a=l%2?"right":"left"}var s=Xo(i.map,t.ch,a);return s.offset=s.collapse=="right"?s.end:s.start,s}function mu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Ur(e,t){return t&&(e.bad=!0),e}function bu(e,t,n,r,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function u(y){return function(A){return A.id==y}}function h(){a&&(o+=l,s&&(o+=l),a=s=!1)}function c(y){y&&(h(),o+=y)}function b(y){if(y.nodeType==1){var A=y.getAttribute("cm-text");if(A){c(A);return}var E=y.getAttribute("cm-marker"),_;if(E){var X=e.findMarks(v(r,0),v(i+1,0),u(+E));X.length&&(_=X[0].find(0))&&c(zt(e.doc,_.from,_.to).join(l));return}if(y.getAttribute("contenteditable")=="false")return;var J=/^(pre|div|p|li|table|br)$/i.test(y.nodeName);if(!/^br$/i.test(y.nodeName)&&y.textContent.length==0)return;J&&h();for(var Y=0;Y=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),Z(i,"paste",function(a){De(r,a)||sl(a,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(a){if(!De(r,a)){if(r.somethingSelected())ci({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var l=fl(r);ci({lineWise:!0,text:l.text}),a.type=="cut"?r.setSelections(l.ranges,null,Ne):(n.prevInput="",i.value=l.text.join(` `),lr(i))}else return;a.type=="cut"&&(r.state.cutIncoming=+new Date)}}Z(i,"cut",o),Z(i,"copy",o),Z(e.scroller,"paste",function(a){if(!(Ut(e,a)||De(r,a))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var l=new Event("paste");l.clipboardData=a.clipboardData,i.dispatchEvent(l)}}),Z(e.lineSpace,"selectstart",function(a){Ut(e,a)||Ze(a)}),Z(i,"compositionstart",function(){var a=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:a,range:r.markText(a,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Z(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},We.prototype.createField=function(e){this.wrapper=hl(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;so(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},We.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},We.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ra(e);if(e.options.moveInputWithCursor){var i=wt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},We.prototype.showSelection=function(e){var t=this.cm,n=t.display;K(n.cursorDiv,e.cursors),K(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},We.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&&lr(this.textarea),S&&x>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",S&&x>=9&&(this.hasSelection=null));this.resetting=!1}},We.prototype.getField=function(){return this.textarea},We.prototype.supportsTouch=function(){return!1},We.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!B||we(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch{}},We.prototype.blur=function(){this.textarea.blur()},We.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},We.prototype.receivedFocus=function(){this.slowPoll()},We.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},We.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},We.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Zt(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(S&&x>=9&&this.hasSelection===i||z&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!r&&(r="\u200B"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(r.length,i.length);a1e3||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},We.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},We.prototype.onKeyPress=function(){S&&x>=9&&(this.hasSelection=null),this.fastPoll()},We.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=dr(n,e),a=r.scroller.scrollTop;if(!o||O)return;var l=n.options.resetSelectionOnContextMenu;l&&n.doc.sel.contains(o)==-1&&Ge(n,Qe)(n.doc,tr(o),Ne);var s=i.style.cssText,u=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+`px; z-index: 1000; background: `+(S?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var c;C&&(c=i.ownerDocument.defaultView.scrollY),r.input.focus(),C&&i.ownerDocument.defaultView.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function b(){if(i.selectionStart!=null){var E=n.somethingSelected(),_="\u200B"+(E?i.value:"");i.value="\u21DA",i.value=_,t.prevInput=E?"":"\u200B",i.selectionStart=1,i.selectionEnd=_.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,S&&x<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),i.selectionStart!=null)){(!S||S&&x<9)&&b();var E=0,_=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?Ge(n,Ha)(n):E++<10?r.detectingSelectAll=setTimeout(_,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(_,200)}}if(S&&x>=9&&b(),ne){It(e);var A=function(){qe(window,"mouseup",A),setTimeout(y,20)};Z(window,"mouseup",A)}else setTimeout(y,50)},We.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},We.prototype.setUneditable=function(){},We.prototype.needsContentAttribute=!1;function wu(e,t){if(t=t?ae(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=we(e.ownerDocument);t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(Z(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch{}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(qe(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var l=Te(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return l}function Su(e){e.off=qe,e.on=Z,e.wheelEventPixels=As,e.Doc=ot,e.splitLines=Vr,e.countColumn=ie,e.findColumn=kt,e.isWordChar=qr,e.Pass=xe,e.signal=ke,e.Line=Or,e.changeEnd=rr,e.scrollbarModel=sa,e.Pos=v,e.cmpPos=N,e.modes=bt,e.mimeModes=Qt,e.resolveMode=ut,e.getMode=Rt,e.modeExtensions=Jt,e.extendMode=Rn,e.copyState=Bt,e.startState=$r,e.innerMode=jt,e.commands=Cn,e.keyMap=Xt,e.keyName=Za,e.isModifierKey=Ya,e.lookupKey=zr,e.normalizeKeyMap=js,e.StringStream=He,e.SharedTextMarker=xn,e.TextMarker=ir,e.LineWidget=bn,e.e_preventDefault=Ze,e.e_stopPropagation=fr,e.e_stop=It,e.addClass=Ce,e.contains=Le,e.rmClass=ee,e.keyNames=or}du(Te),yu(Te);var Cu="iter insert remove copy getEditor constructor".split(" ");for(var pi in ot.prototype)ot.prototype.hasOwnProperty(pi)&&de(Cu,pi)<0&&(Te.prototype[pi]=function(e){return function(){return e.apply(this.doc,arguments)}}(ot.prototype[pi]));return Ve(ot),Te.inputStyles={textarea:We,contenteditable:me},Te.defineMode=function(e){!Te.defaults.mode&&e!="null"&&(Te.defaults.mode=e),In.apply(this,arguments)},Te.defineMIME=Lr,Te.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Te.defineMIME("text/plain","null"),Te.defineExtension=function(e,t){Te.prototype[e]=t},Te.defineDocExtension=function(e,t){ot.prototype[e]=t},Te.fromTextArea=wu,Su(Te),Te.version="5.65.11",Te})}(co)),co.exports}var Eu=tt();(function(Oe,Be){(function(m){m(tt())})(function(m){m.defineMode("javascript",function(U,I){var G=U.indentUnit,M=I.statementIndent,w=I.jsonld,S=I.json||w,x=I.trackScope!==!1,C=I.typescript,W=I.wordCharacters||/[\w$\xa1-\uffff]/,P=function(){function f(Ie){return{type:Ie,style:"keyword"}}var p=f("keyword a"),v=f("keyword b"),N=f("keyword c"),le=f("keyword d"),he=f("operator"),ve={type:"atom",style:"atom"};return{if:f("if"),while:p,with:p,else:v,do:v,try:v,finally:v,return:le,break:le,continue:le,new:f("new"),delete:N,void:N,throw:N,debugger:f("debugger"),var:f("var"),const:f("var"),let:f("var"),function:f("function"),catch:f("catch"),for:f("for"),switch:f("switch"),case:f("case"),default:f("default"),in:he,typeof:he,instanceof:he,true:ve,false:ve,null:ve,undefined:ve,NaN:ve,Infinity:ve,this:f("this"),class:f("class"),super:f("atom"),yield:N,export:f("export"),import:f("import"),extends:N,await:N}}(),j=/[+\-*&%=<>!?|~^@]/,O=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function R(f){for(var p=!1,v,N=!1;(v=f.next())!=null;){if(!p){if(v=="/"&&!N)return;v=="["?N=!0:N&&v=="]"&&(N=!1)}p=!p&&v=="\\"}}var D,H;function k(f,p,v){return D=f,H=v,p}function L(f,p){var v=f.next();if(v=='"'||v=="'")return p.tokenize=B(v),p.tokenize(f,p);if(v=="."&&f.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return k("number","number");if(v=="."&&f.match(".."))return k("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(v))return k(v);if(v=="="&&f.eat(">"))return k("=>","operator");if(v=="0"&&f.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return k("number","number");if(/\d/.test(v))return f.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),k("number","number");if(v=="/")return f.eat("*")?(p.tokenize=z,z(f,p)):f.eat("/")?(f.skipToEnd(),k("comment","comment")):Mt(f,p,1)?(R(f),f.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),k("regexp","string-2")):(f.eat("="),k("operator","operator",f.current()));if(v=="`")return p.tokenize=q,q(f,p);if(v=="#"&&f.peek()=="!")return f.skipToEnd(),k("meta","meta");if(v=="#"&&f.eatWhile(W))return k("variable","property");if(v=="<"&&f.match("!--")||v=="-"&&f.match("->")&&!/\S/.test(f.string.slice(0,f.start)))return f.skipToEnd(),k("comment","comment");if(j.test(v))return(v!=">"||!p.lexical||p.lexical.type!=">")&&(f.eat("=")?(v=="!"||v=="=")&&f.eat("="):/[<>*+\-|&?]/.test(v)&&(f.eat(v),v==">"&&f.eat(v))),v=="?"&&f.eat(".")?k("."):k("operator","operator",f.current());if(W.test(v)){f.eatWhile(W);var N=f.current();if(p.lastType!="."){if(P.propertyIsEnumerable(N)){var le=P[N];return k(le.type,le.style,N)}if(N=="async"&&f.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return k("async","keyword",N)}return k("variable","variable",N)}}function B(f){return function(p,v){var N=!1,le;if(w&&p.peek()=="@"&&p.match(O))return v.tokenize=L,k("jsonld-keyword","meta");for(;(le=p.next())!=null&&!(le==f&&!N);)N=!N&&le=="\\";return N||(v.tokenize=L),k("string","string")}}function z(f,p){for(var v=!1,N;N=f.next();){if(N=="/"&&v){p.tokenize=L;break}v=N=="*"}return k("comment","comment")}function q(f,p){for(var v=!1,N;(N=f.next())!=null;){if(!v&&(N=="`"||N=="$"&&f.eat("{"))){p.tokenize=L;break}v=!v&&N=="\\"}return k("quasi","string-2",f.current())}var Q="([{}])";function g(f,p){p.fatArrowAt&&(p.fatArrowAt=null);var v=f.string.indexOf("=>",f.start);if(!(v<0)){if(C){var N=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(f.string.slice(f.start,v));N&&(v=N.index)}for(var le=0,he=!1,ve=v-1;ve>=0;--ve){var Ie=f.string.charAt(ve),ct=Q.indexOf(Ie);if(ct>=0&&ct<3){if(!le){++ve;break}if(--le==0){Ie=="("&&(he=!0);break}}else if(ct>=3&&ct<6)++le;else if(W.test(Ie))he=!0;else if(/["'\/`]/.test(Ie))for(;;--ve){if(ve==0)return;var se=f.string.charAt(ve-1);if(se==Ie&&f.string.charAt(ve-2)!="\\"){ve--;break}}else if(he&&!le){++ve;break}}he&&!le&&(p.fatArrowAt=ve)}}var F={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ne(f,p,v,N,le,he){this.indented=f,this.column=p,this.type=v,this.prev=le,this.info=he,N!=null&&(this.align=N)}function V(f,p){if(!x)return!1;for(var v=f.localVars;v;v=v.next)if(v.name==p)return!0;for(var N=f.context;N;N=N.prev)for(var v=N.vars;v;v=v.next)if(v.name==p)return!0}function ee(f,p,v,N,le){var he=f.cc;for(T.state=f,T.stream=le,T.marked=null,T.cc=he,T.style=p,f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;){var ve=he.length?he.pop():S?xe:de;if(ve(v,N)){for(;he.length&&he[he.length-1].lex;)he.pop()();return T.marked?T.marked:v=="variable"&&V(f,N)?"variable-2":p}}}var T={state:null,column:null,marked:null,cc:null};function K(){for(var f=arguments.length-1;f>=0;f--)T.cc.push(arguments[f])}function d(){return K.apply(null,arguments),!0}function ce(f,p){for(var v=p;v;v=v.next)if(v.name==f)return!0;return!1}function be(f){var p=T.state;if(T.marked="def",!!x){if(p.context){if(p.lexical.info=="var"&&p.context&&p.context.block){var v=Le(f,p.context);if(v!=null){p.context=v;return}}else if(!ce(f,p.localVars)){p.localVars=new Ft(f,p.localVars);return}}I.globalVars&&!ce(f,p.globalVars)&&(p.globalVars=new Ft(f,p.globalVars))}}function Le(f,p){if(p)if(p.block){var v=Le(f,p.prev);return v?v==p.prev?p:new Ce(v,p.vars,!0):null}else return ce(f,p.vars)?p:new Ce(p.prev,new Ft(f,p.vars),!1);else return null}function we(f){return f=="public"||f=="private"||f=="protected"||f=="abstract"||f=="readonly"}function Ce(f,p,v){this.prev=f,this.vars=p,this.block=v}function Ft(f,p){this.name=f,this.next=p}var lr=new Ft("this",new Ft("arguments",null));function ze(){T.state.context=new Ce(T.state.context,T.state.localVars,!1),T.state.localVars=lr}function Pt(){T.state.context=new Ce(T.state.context,T.state.localVars,!0),T.state.localVars=null}ze.lex=Pt.lex=!0;function rt(){T.state.localVars=T.state.context.vars,T.state.context=T.state.context.prev}rt.lex=!0;function ae(f,p){var v=function(){var N=T.state,le=N.indented;if(N.lexical.type=="stat")le=N.lexical.indented;else for(var he=N.lexical;he&&he.type==")"&&he.align;he=he.prev)le=he.indented;N.lexical=new ne(le,T.stream.column(),f,null,N.lexical,p)};return v.lex=!0,v}function ie(){var f=T.state;f.lexical.prev&&(f.lexical.type==")"&&(f.indented=f.lexical.indented),f.lexical=f.lexical.prev)}ie.lex=!0;function ue(f){function p(v){return v==f?d():f==";"||v=="}"||v==")"||v=="]"?K():d(p)}return p}function de(f,p){return f=="var"?d(ae("vardef",p),It,ue(";"),ie):f=="keyword a"?d(ae("form"),sr,de,ie):f=="keyword b"?d(ae("form"),de,ie):f=="keyword d"?T.stream.match(/^\s*$/,!1)?d():d(ae("stat"),kt,ue(";"),ie):f=="debugger"?d(ue(";")):f=="{"?d(ae("}"),Pt,Ot,ie,rt):f==";"?d():f=="if"?(T.state.lexical.info=="else"&&T.state.cc[T.state.cc.length-1]==ie&&T.state.cc.pop()(),d(ae("form"),sr,de,ie,kr)):f=="function"?d(Nt):f=="for"?d(ae("form"),Pt,Fn,de,rt,ie):f=="class"||C&&p=="interface"?(T.marked="keyword",d(ae("form",f=="class"?f:p),In,ie)):f=="variable"?C&&p=="declare"?(T.marked="keyword",d(de)):C&&(p=="module"||p=="enum"||p=="type")&&T.stream.match(/^\s*\w/,!1)?(T.marked="keyword",p=="enum"?d(Tr):p=="type"?d(Pn,ue("operator"),Z,ue(";")):d(ae("form"),nt,ue("{"),ae("}"),Ot,ie,ie)):C&&p=="namespace"?(T.marked="keyword",d(ae("form"),xe,de,ie)):C&&p=="abstract"?(T.marked="keyword",d(de)):d(ae("stat"),Sr):f=="switch"?d(ae("form"),sr,ue("{"),ae("}","switch"),Pt,Ot,ie,ie,rt):f=="case"?d(xe,ue(":")):f=="default"?d(ue(":")):f=="catch"?d(ae("form"),ze,An,de,ie,rt):f=="export"?d(ae("stat"),Jt,ie):f=="import"?d(ae("stat"),Bt,ie):f=="async"?d(de):p=="@"?d(xe,de):K(ae("stat"),xe,ue(";"),ie)}function An(f){if(f=="(")return d(bt,ue(")"))}function xe(f,p){return qt(f,p,!1)}function Ne(f,p){return qt(f,p,!0)}function sr(f){return f!="("?K():d(ae(")"),kt,ue(")"),ie)}function qt(f,p,v){if(T.state.fatArrowAt==T.stream.start){var N=v?Yr:Mn;if(f=="(")return d(ze,ae(")"),Me(bt,")"),ie,ue("=>"),N,rt);if(f=="variable")return K(ze,nt,ue("=>"),N,rt)}var le=v?Lt:pt;return F.hasOwnProperty(f)?d(le):f=="function"?d(Nt,le):f=="class"||C&&p=="interface"?(T.marked="keyword",d(ae("form"),Qt,ie)):f=="keyword c"||f=="async"?d(v?Ne:xe):f=="("?d(ae(")"),kt,ue(")"),ie,le):f=="operator"||f=="spread"?d(v?Ne:xe):f=="["?d(ae("]"),zt,ie,le):f=="{"?ur(Cr,"}",null,le):f=="quasi"?K(pe,le):f=="new"?d(Dn(v)):d()}function kt(f){return f.match(/[;\}\)\],]/)?K():K(xe)}function pt(f,p){return f==","?d(kt):Lt(f,p,!1)}function Lt(f,p,v){var N=v==!1?pt:Lt,le=v==!1?xe:Ne;if(f=="=>")return d(ze,v?Yr:Mn,rt);if(f=="operator")return/\+\+|--/.test(p)||C&&p=="!"?d(N):C&&p=="<"&&T.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?d(ae(">"),Me(Z,">"),ie,N):p=="?"?d(xe,ue(":"),le):d(le);if(f=="quasi")return K(pe,N);if(f!=";"){if(f=="(")return ur(Ne,")","call",N);if(f==".")return d(Hn,N);if(f=="[")return d(ae("]"),kt,ue("]"),ie,N);if(C&&p=="as")return T.marked="keyword",d(Z,N);if(f=="regexp")return T.state.lastType=T.marked="operator",T.stream.backUp(T.stream.pos-T.stream.start-1),d(le)}}function pe(f,p){return f!="quasi"?K():p.slice(p.length-2)!="${"?d(pe):d(kt,wr)}function wr(f){if(f=="}")return T.marked="string-2",T.state.tokenize=q,d(pe)}function Mn(f){return g(T.stream,T.state),K(f=="{"?de:xe)}function Yr(f){return g(T.stream,T.state),K(f=="{"?de:Ne)}function Dn(f){return function(p){return p=="."?d(f?qr:vi):p=="variable"&&C?d(Ze,f?Lt:pt):K(f?Ne:xe)}}function vi(f,p){if(p=="target")return T.marked="keyword",d(pt)}function qr(f,p){if(p=="target")return T.marked="keyword",d(Lt)}function Sr(f){return f==":"?d(ie,de):K(pt,ue(";"),ie)}function Hn(f){if(f=="variable")return T.marked="property",d()}function Cr(f,p){if(f=="async")return T.marked="property",d(Cr);if(f=="variable"||T.style=="keyword"){if(T.marked="property",p=="get"||p=="set")return d(Zr);var v;return C&&T.state.fatArrowAt==T.stream.start&&(v=T.stream.match(/^\s*:\s*/,!1))&&(T.state.fatArrowAt=T.stream.pos+v[0].length),d(Tt)}else{if(f=="number"||f=="string")return T.marked=w?"property":T.style+" property",d(Tt);if(f=="jsonld-keyword")return d(Tt);if(C&&we(p))return T.marked="keyword",d(Cr);if(f=="[")return d(xe,vt,ue("]"),Tt);if(f=="spread")return d(Ne,Tt);if(p=="*")return T.marked="keyword",d(Cr);if(f==":")return K(Tt)}}function Zr(f){return f!="variable"?K(Tt):(T.marked="property",d(Nt))}function Tt(f){if(f==":")return d(Ne);if(f=="(")return K(Nt)}function Me(f,p,v){function N(le,he){if(v?v.indexOf(le)>-1:le==","){var ve=T.state.lexical;return ve.info=="call"&&(ve.pos=(ve.pos||0)+1),d(function(Ie,ct){return Ie==p||ct==p?K():K(f)},N)}return le==p||he==p?d():v&&v.indexOf(";")>-1?K(f):d(ue(p))}return function(le,he){return le==p||he==p?d():K(f,N)}}function ur(f,p,v){for(var N=3;N"),Z);if(f=="quasi")return K(De,Ve)}function Qr(f){if(f=="=>")return d(Z)}function qe(f){return f.match(/[\}\)\]]/)?d():f==","||f==";"?d(qe):K(ke,qe)}function ke(f,p){if(f=="variable"||T.style=="keyword")return T.marked="property",d(ke);if(p=="?"||f=="number"||f=="string")return d(ke);if(f==":")return d(Z);if(f=="[")return d(ue("variable"),gi,ue("]"),ke);if(f=="(")return K(At,ke);if(!f.match(/[;\}\)\],]/))return d()}function De(f,p){return f!="quasi"?K():p.slice(p.length-2)!="${"?d(De):d(Z,Wn)}function Wn(f){if(f=="}")return T.marked="string-2",T.state.tokenize=q,d(De)}function je(f,p){return f=="variable"&&T.stream.match(/^\s*[?:]/,!1)||p=="?"?d(je):f==":"?d(Z):f=="spread"?d(je):K(Z)}function Ve(f,p){if(p=="<")return d(ae(">"),Me(Z,">"),ie,Ve);if(p=="|"||f=="."||p=="&")return d(Z);if(f=="[")return d(Z,ue("]"),Ve);if(p=="extends"||p=="implements")return T.marked="keyword",d(Z);if(p=="?")return d(Z,ue(":"),Z)}function Ze(f,p){if(p=="<")return d(ae(">"),Me(Z,">"),ie,Ve)}function fr(){return K(Z,Jr)}function Jr(f,p){if(p=="=")return d(Z)}function It(f,p){return p=="enum"?(T.marked="keyword",d(Tr)):K(nt,vt,yt,mi)}function nt(f,p){if(C&&we(p))return T.marked="keyword",d(nt);if(f=="variable")return be(p),d();if(f=="spread")return d(nt);if(f=="[")return ur(yi,"]");if(f=="{")return ur(jr,"}")}function jr(f,p){return f=="variable"&&!T.stream.match(/^\s*:/,!1)?(be(p),d(yt)):(f=="variable"&&(T.marked="property"),f=="spread"?d(nt):f=="}"?K():f=="["?d(xe,ue("]"),ue(":"),jr):d(ue(":"),nt,yt))}function yi(){return K(nt,yt)}function yt(f,p){if(p=="=")return d(Ne)}function mi(f){if(f==",")return d(It)}function kr(f,p){if(f=="keyword b"&&p=="else")return d(ae("form","else"),de,ie)}function Fn(f,p){if(p=="await")return d(Fn);if(f=="(")return d(ae(")"),Vr,ie)}function Vr(f){return f=="var"?d(It,Zt):f=="variable"?d(Zt):K(Zt)}function Zt(f,p){return f==")"?d():f==";"?d(Zt):p=="in"||p=="of"?(T.marked="keyword",d(xe,Zt)):K(xe,Zt)}function Nt(f,p){if(p=="*")return T.marked="keyword",d(Nt);if(f=="variable")return be(p),d(Nt);if(f=="(")return d(ze,ae(")"),Me(bt,")"),ie,gt,de,rt);if(C&&p=="<")return d(ae(">"),Me(fr,">"),ie,Nt)}function At(f,p){if(p=="*")return T.marked="keyword",d(At);if(f=="variable")return be(p),d(At);if(f=="(")return d(ze,ae(")"),Me(bt,")"),ie,gt,rt);if(C&&p=="<")return d(ae(">"),Me(fr,">"),ie,At)}function Pn(f,p){if(f=="keyword"||f=="variable")return T.marked="type",d(Pn);if(p=="<")return d(ae(">"),Me(fr,">"),ie)}function bt(f,p){return p=="@"&&d(xe,bt),f=="spread"?d(bt):C&&we(p)?(T.marked="keyword",d(bt)):C&&f=="this"?d(vt,yt):K(nt,vt,yt)}function Qt(f,p){return f=="variable"?In(f,p):Lr(f,p)}function In(f,p){if(f=="variable")return be(p),d(Lr)}function Lr(f,p){if(p=="<")return d(ae(">"),Me(fr,">"),ie,Lr);if(p=="extends"||p=="implements"||C&&f==",")return p=="implements"&&(T.marked="keyword"),d(C?Z:xe,Lr);if(f=="{")return d(ae("}"),ut,ie)}function ut(f,p){if(f=="async"||f=="variable"&&(p=="static"||p=="get"||p=="set"||C&&we(p))&&T.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return T.marked="keyword",d(ut);if(f=="variable"||T.style=="keyword")return T.marked="property",d(Rt,ut);if(f=="number"||f=="string")return d(Rt,ut);if(f=="[")return d(xe,vt,ue("]"),Rt,ut);if(p=="*")return T.marked="keyword",d(ut);if(C&&f=="(")return K(At,ut);if(f==";"||f==",")return d(ut);if(f=="}")return d();if(p=="@")return d(xe,ut)}function Rt(f,p){if(p=="!"||p=="?")return d(Rt);if(f==":")return d(Z,yt);if(p=="=")return d(Ne);var v=T.state.lexical.prev,N=v&&v.info=="interface";return K(N?At:Nt)}function Jt(f,p){return p=="*"?(T.marked="keyword",d(te,ue(";"))):p=="default"?(T.marked="keyword",d(xe,ue(";"))):f=="{"?d(Me(Rn,"}"),te,ue(";")):K(de)}function Rn(f,p){if(p=="as")return T.marked="keyword",d(ue("variable"));if(f=="variable")return K(Ne,Rn)}function Bt(f){return f=="string"?d():f=="("?K(xe):f=="."?K(pt):K(jt,$r,te)}function jt(f,p){return f=="{"?ur(jt,"}"):(f=="variable"&&be(p),p=="*"&&(T.marked="keyword"),d(He))}function $r(f){if(f==",")return d(jt,$r)}function He(f,p){if(p=="as")return T.marked="keyword",d(jt)}function te(f,p){if(p=="from")return T.marked="keyword",d(xe)}function zt(f){return f=="]"?d():K(Me(Ne,"]"))}function Tr(){return K(ae("form"),nt,ue("{"),ae("}"),Me(mt,"}"),ie,ie)}function mt(){return K(nt,yt)}function ge(f,p){return f.lastType=="operator"||f.lastType==","||j.test(p.charAt(0))||/[,.]/.test(p.charAt(0))}function Mt(f,p,v){return p.tokenize==L&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(p.lastType)||p.lastType=="quasi"&&/\{\s*$/.test(f.string.slice(0,f.pos-(v||0)))}return{startState:function(f){var p={tokenize:L,lastType:"sof",cc:[],lexical:new ne((f||0)-G,0,"block",!1),localVars:I.localVars,context:I.localVars&&new Ce(null,null,!1),indented:f||0};return I.globalVars&&typeof I.globalVars=="object"&&(p.globalVars=I.globalVars),p},token:function(f,p){if(f.sol()&&(p.lexical.hasOwnProperty("align")||(p.lexical.align=!1),p.indented=f.indentation(),g(f,p)),p.tokenize!=z&&f.eatSpace())return null;var v=p.tokenize(f,p);return D=="comment"?v:(p.lastType=D=="operator"&&(H=="++"||H=="--")?"incdec":D,ee(p,v,D,H,f))},indent:function(f,p){if(f.tokenize==z||f.tokenize==q)return m.Pass;if(f.tokenize!=L)return 0;var v=p&&p.charAt(0),N=f.lexical,le;if(!/^\s*else\b/.test(p))for(var he=f.cc.length-1;he>=0;--he){var ve=f.cc[he];if(ve==ie)N=N.prev;else if(ve!=kr&&ve!=rt)break}for(;(N.type=="stat"||N.type=="form")&&(v=="}"||(le=f.cc[f.cc.length-1])&&(le==pt||le==Lt)&&!/^[,\.=+\-*:?[\(]/.test(p));)N=N.prev;M&&N.type==")"&&N.prev.type=="stat"&&(N=N.prev);var Ie=N.type,ct=v==Ie;return Ie=="vardef"?N.indented+(f.lastType=="operator"||f.lastType==","?N.info.length+1:0):Ie=="form"&&v=="{"?N.indented:Ie=="form"?N.indented+G:Ie=="stat"?N.indented+(ge(f,p)?M||G:0):N.info=="switch"&&!ct&&I.doubleIndentSwitch!=!1?N.indented+(/^(?:case|default)\b/.test(p)?G:2*G):N.align?N.column+(ct?0:1):N.indented+(ct?0:G)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:S?null:"/*",blockCommentEnd:S?null:"*/",blockCommentContinue:S?null:" * ",lineComment:S?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:S?"json":"javascript",jsonldMode:w,jsonMode:S,expressionAllowed:Mt,skipExpression:function(f){ee(f,"atom","atom","true",new m.StringStream("",2,null))}}}),m.registerHelper("wordChars","javascript",/[\w$]/),m.defineMIME("text/javascript","javascript"),m.defineMIME("text/ecmascript","javascript"),m.defineMIME("application/javascript","javascript"),m.defineMIME("application/x-javascript","javascript"),m.defineMIME("application/ecmascript","javascript"),m.defineMIME("application/json",{name:"javascript",json:!0}),m.defineMIME("application/x-json",{name:"javascript",json:!0}),m.defineMIME("application/manifest+json",{name:"javascript",json:!0}),m.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),m.defineMIME("text/typescript",{name:"javascript",typescript:!0}),m.defineMIME("application/typescript",{name:"javascript",typescript:!0})})})();var Wu={exports:{}};(function(Oe,Be){(function(m){m(tt())})(function(m){function U(w,S,x,C){if(x&&x.call){var W=x;x=null}else var W=M(w,x,"rangeFinder");typeof S=="number"&&(S=m.Pos(S,0));var P=M(w,x,"minFoldSize");function j(H){var k=W(w,S);if(!k||k.to.line-k.from.linew.firstLine();)S=m.Pos(S.line-1,0),O=j(!1);if(!(!O||O.cleared||C==="unfold")){var R=I(w,x,O);m.on(R,"mousedown",function(H){D.clear(),m.e_preventDefault(H)});var D=w.markText(O.from,O.to,{replacedWith:R,clearOnEnter:M(w,x,"clearOnEnter"),__isFold:!0});D.on("clear",function(H,k){m.signal(w,"unfold",w,H,k)}),m.signal(w,"fold",w,O.from,O.to)}}function I(w,S,x){var C=M(w,S,"widget");if(typeof C=="function"&&(C=C(x.from,x.to)),typeof C=="string"){var W=document.createTextNode(C);C=document.createElement("span"),C.appendChild(W),C.className="CodeMirror-foldmarker"}else C&&(C=C.cloneNode(!0));return C}m.newFoldFunction=function(w,S){return function(x,C){U(x,C,{rangeFinder:w,widget:S})}},m.defineExtension("foldCode",function(w,S,x){U(this,w,S,x)}),m.defineExtension("isFolded",function(w){for(var S=this.findMarksAt(w),x=0;xI.lastLine())return null;var j=I.getTokenAt(m.Pos(P,1));if(/\S/.test(j.string)||(j=I.getTokenAt(m.Pos(P,j.end+1))),j.type!="keyword"||j.string!="import")return null;for(var O=P,R=Math.min(I.lastLine(),P+10);O<=R;++O){var D=I.getLine(O),H=D.indexOf(";");if(H!=-1)return{startCh:j.end,end:m.Pos(O,H)}}}var w=G.line,S=M(w),x;if(!S||M(w-1)||(x=M(w-2))&&x.end.line==w-1)return null;for(var C=S.end;;){var W=M(C.line+1);if(W==null)break;C=W.end}return{from:I.clipPos(m.Pos(w,S.startCh+1)),to:C}}),m.registerHelper("fold","include",function(I,G){function M(W){if(WI.lastLine())return null;var P=I.getTokenAt(m.Pos(W,1));if(/\S/.test(P.string)||(P=I.getTokenAt(m.Pos(W,P.end+1))),P.type=="meta"&&P.string.slice(0,8)=="#include")return P.start+8}var w=G.line,S=M(w);if(S==null||M(w-1)!=null)return null;for(var x=w;;){var C=M(x+1);if(C==null)break;++x}return{from:m.Pos(w,S+1),to:I.clipPos(m.Pos(x))}})})})();(function(Oe,Be){(function(m){m(tt())})(function(m){m.registerGlobalHelper("fold","comment",function(U){return U.blockCommentStart&&U.blockCommentEnd},function(U,I){var G=U.getModeAt(I),M=G.blockCommentStart,w=G.blockCommentEnd;if(!M||!w)return;for(var S=I.line,x=U.getLine(S),C,W=I.ch,P=0;;){var j=W<=0?-1:x.lastIndexOf(M,W-1);if(j==-1){if(P==1)return;P=1,W=x.length;continue}if(P==1&&jM)w=S;else break}if(w)return{from:m.Pos(G.line,I.getLine(G.line).length),to:m.Pos(w,I.getLine(w).length)}}})})})();(function(Oe,Be){(function(m){m(tt(),Wu.exports)})(function(m){m.defineOption("foldGutter",!1,function(D,H,k){k&&k!=m.Init&&(D.clearGutter(D.state.foldGutter.options.gutter),D.state.foldGutter=null,D.off("gutterClick",W),D.off("changes",j),D.off("viewportChange",O),D.off("fold",R),D.off("unfold",R),D.off("swapDoc",j),D.off("optionChange",P)),H&&(D.state.foldGutter=new I(G(H)),C(D),D.on("gutterClick",W),D.on("changes",j),D.on("viewportChange",O),D.on("fold",R),D.on("unfold",R),D.on("swapDoc",j),D.on("optionChange",P))});var U=m.Pos;function I(D){this.options=D,this.from=this.to=0}function G(D){return D===!0&&(D={}),D.gutter==null&&(D.gutter="CodeMirror-foldgutter"),D.indicatorOpen==null&&(D.indicatorOpen="CodeMirror-foldgutter-open"),D.indicatorFolded==null&&(D.indicatorFolded="CodeMirror-foldgutter-folded"),D}function M(D,H){for(var k=D.findMarks(U(H,0),U(H+1,0)),L=0;L=z){if(g&&V&&g.test(V.className))return;ne=w(L.indicatorOpen)}}!ne&&!V||D.setGutterMarker(F,L.gutter,ne)})}function x(D){return new RegExp("(^|\\s)"+D+"(?:$|\\s)\\s*")}function C(D){var H=D.getViewport(),k=D.state.foldGutter;!k||(D.operation(function(){S(D,H.from,H.to)}),k.from=H.from,k.to=H.to)}function W(D,H,k){var L=D.state.foldGutter;if(!!L){var B=L.options;if(k==B.gutter){var z=M(D,H);z?z.clear():D.foldCode(U(H,0),B)}}}function P(D,H){H=="mode"&&j(D)}function j(D){var H=D.state.foldGutter;if(!!H){var k=H.options;H.from=H.to=0,clearTimeout(H.changeUpdate),H.changeUpdate=setTimeout(function(){C(D)},k.foldOnChangeTimeSpan||600)}}function O(D){var H=D.state.foldGutter;if(!!H){var k=H.options;clearTimeout(H.changeUpdate),H.changeUpdate=setTimeout(function(){var L=D.getViewport();H.from==H.to||L.from-H.to>20||H.from-L.to>20?C(D):D.operation(function(){L.fromH.to&&(S(D,H.to,L.to),H.to=L.to)})},k.updateViewportTimeSpan||400)}}function R(D,H){var k=D.state.foldGutter;if(!!k){var L=H.line;L>=k.from&&LC)return G.charCoords(q,"local")[Q?"top":"bottom"];var F=G.heightAtLine(P,"local");return F+(Q?0:P.height)}var O=G.lastLine();if(G.display.barWidth)for(var R=0,D;RO)){for(var k=D||j(H.from,!0)*M,L=j(H.to,!1)*M;RO||(D=j(S[R+1].from,!0)*M,D>L+.9));)H=S[++R],L=j(H.to,!1)*M;if(L!=k){var B=Math.max(L-k,3),z=w.appendChild(document.createElement("div"));z.style.cssText="position: absolute; right: 0px; width: "+Math.max(G.display.barWidth-1,2)+"px; top: "+(k+this.buttonHeight)+"px; height: "+B+"px",z.className=this.options.className,H.id&&z.setAttribute("annotation-id",H.id)}}}this.div.textContent="",this.div.appendChild(w)},U.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("changes",this.changeHandler),this.div.parentNode.removeChild(this.div)}})})();var Pu={exports:{}},yl={exports:{}},ml;function po(){return ml||(ml=1,function(Oe,Be){(function(m){m(tt())})(function(m){var U=m.Pos;function I(k){var L=k.flags;return L!=null?L:(k.ignoreCase?"i":"")+(k.global?"g":"")+(k.multiline?"m":"")}function G(k,L){for(var B=I(k),z=B,q=0;qg);F++){var ne=k.getLine(Q++);z=z==null?ne:z+` `+ne}q=q*2,L.lastIndex=B.ch;var V=L.exec(z);if(V){var ee=z.slice(0,V.index).split(` `),T=V[0].split(` `),K=B.line+ee.length-1,d=ee[ee.length-1].length;return{from:U(K,d),to:U(K+T.length-1,T.length==1?d+T[0].length:T[T.length-1].length),match:V}}}}function x(k,L,B){for(var z,q=0;q<=k.length;){L.lastIndex=q;var Q=L.exec(k);if(!Q)break;var g=Q.index+Q[0].length;if(g>k.length-B)break;(!z||g>z.index+z[0].length)&&(z=Q),q=Q.index+1}return z}function C(k,L,B){L=G(L,"g");for(var z=B.line,q=B.ch,Q=k.firstLine();z>=Q;z--,q=-1){var g=k.getLine(z),F=x(g,L,q<0?0:g.length-q);if(F)return{from:U(z,F.index),to:U(z,F.index+F[0].length),match:F}}}function W(k,L,B){if(!M(L))return C(k,L,B);L=G(L,"gm");for(var z,q=1,Q=k.getLine(B.line).length-B.ch,g=B.line,F=k.firstLine();g>=F;){for(var ne=0;ne=F;ne++){var V=k.getLine(g--);z=z==null?V:V+` `+z}q*=2;var ee=x(z,L,Q);if(ee){var T=z.slice(0,ee.index).split(` `),K=ee[0].split(` `),d=g+T.length,ce=T[T.length-1].length;return{from:U(d,ce),to:U(d+K.length-1,K.length==1?ce+K[0].length:K[K.length-1].length),match:ee}}}}var P,j;String.prototype.normalize?(P=function(k){return k.normalize("NFD").toLowerCase()},j=function(k){return k.normalize("NFD")}):(P=function(k){return k.toLowerCase()},j=function(k){return k});function O(k,L,B,z){if(k.length==L.length)return B;for(var q=0,Q=B+Math.max(0,k.length-L.length);;){if(q==Q)return q;var g=q+Q>>1,F=z(k.slice(0,g)).length;if(F==B)return g;F>B?Q=g:q=g+1}}function R(k,L,B,z){if(!L.length)return null;var q=z?P:j,Q=q(L).split(/\r|\n\r?/);e:for(var g=B.line,F=B.ch,ne=k.lastLine()+1-Q.length;g<=ne;g++,F=0){var V=k.getLine(g).slice(F),ee=q(V);if(Q.length==1){var T=ee.indexOf(Q[0]);if(T==-1)continue e;var B=O(V,ee,T,q)+F;return{from:U(g,O(V,ee,T,q)+F),to:U(g,O(V,ee,T+Q[0].length,q)+F)}}else{var K=ee.length-Q[0].length;if(ee.slice(K)!=Q[0])continue e;for(var d=1;d=ne;g--,F=-1){var V=k.getLine(g);F>-1&&(V=V.slice(0,F));var ee=q(V);if(Q.length==1){var T=ee.lastIndexOf(Q[0]);if(T==-1)continue e;return{from:U(g,O(V,ee,T,q)),to:U(g,O(V,ee,T+Q[0].length,q))}}else{var K=Q[Q.length-1];if(ee.slice(0,K.length)!=K)continue e;for(var d=1,B=g-Q.length+1;d(this.doc.getLine(L.line)||"").length&&(L.ch=0,L.line++)),m.cmpPos(L,this.doc.clipPos(L))!=0))return this.atOccurrence=!1;var B=this.matches(k,L);if(this.afterEmptyMatch=B&&m.cmpPos(B.from,B.to)==0,B)return this.pos=B,this.atOccurrence=!0,this.pos.match||!0;var z=U(k?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:z,to:z},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(k,L){if(!!this.atOccurrence){var B=m.splitLines(k);this.doc.replaceRange(B,this.pos.from,this.pos.to,L),this.pos.to=U(this.pos.from.line+B.length-1,B[B.length-1].length+(B.length==1?this.pos.from.ch:0))}}},m.defineExtension("getSearchCursor",function(k,L,B){return new H(this.doc,k,L,B)}),m.defineDocExtension("getSearchCursor",function(k,L,B){return new H(this,k,L,B)}),m.defineExtension("selectMatches",function(k,L){for(var B=[],z=this.getSearchCursor(k,this.getCursor("from"),L);z.findNext()&&!(m.cmpPos(z.to(),this.getCursor("to"))>0);)B.push({anchor:z.from(),head:z.to()});B.length&&this.setSelections(B,0)})})}()),yl.exports}(function(Oe,Be){(function(m){m(tt(),po(),Fu.exports)})(function(m){m.defineExtension("showMatchesOnScrollbar",function(M,w,S){return typeof S=="string"&&(S={className:S}),S||(S={}),new U(this,M,w,S)});function U(M,w,S,x){this.cm=M,this.options=x;var C={listenForChanges:!1};for(var W in x)C[W]=x[W];C.className||(C.className="CodeMirror-search-match"),this.annotation=M.annotateScrollbar(C),this.query=w,this.caseFold=S,this.gap={from:M.firstLine(),to:M.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var P=this;M.on("change",this.changeHandler=function(j,O){P.onChange(O)})}var I=1e3;U.prototype.findMatches=function(){if(!!this.gap){for(var M=0;M=this.gap.to)break;w.to.line>=this.gap.from&&this.matches.splice(M--,1)}for(var S=this.cm.getSearchCursor(this.query,m.Pos(this.gap.from,0),{caseFold:this.caseFold,multiline:this.options.multiline}),x=this.options&&this.options.maxMatches||I;S.findNext();){var w={from:S.from(),to:S.to()};if(w.from.line>=this.gap.to||(this.matches.splice(M++,0,w),this.matches.length>x))break}this.gap=null}};function G(M,w,S){return M<=w?M:Math.max(w,M+S)}U.prototype.onChange=function(M){var w=M.from.line,S=m.changeEnd(M).line,x=S-M.to.line;if(this.gap?(this.gap.from=Math.min(G(this.gap.from,w,x),M.from.line),this.gap.to=Math.max(G(this.gap.to,w,x),M.from.line)):this.gap={from:M.from.line,to:S+1},x)for(var C=0;C=R.options.minChars&&S(O,Q,!1,R.options.style)}})}function W(O,R,D){var H=O.getRange(R,D);if(H.match(/^\w+$/)!==null){if(R.ch>0){var k={line:R.line,ch:R.ch-1},L=O.getRange(k,R);if(L.match(/\W/)===null)return!1}if(D.ch '+M.phrase("(Use line:column or scroll% syntax)")+""}function G(M,w){var S=Number(w);return/^[-+]/.test(w)?M.getCursor().line+S:S-1}m.commands.jumpToLine=function(M){var w=M.getCursor();U(M,I(M),M.phrase("Jump to line:"),w.line+1+":"+w.ch,function(S){if(!!S){var x;if(x=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(S))M.setCursor(G(M,x[1]),Number(x[2]));else if(x=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(S)){var C=Math.round(M.lineCount()*Number(x[1])/100);/^[-+]/.test(x[1])&&(C=w.line+C+1),M.setCursor(C-1,w.ch)}else(x=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(S))&&M.setCursor(G(M,x[1]),w.ch)}})},m.keyMap.default["Alt-G"]="jumpToLine"})})();vo();po();(function(Oe,Be){(function(m){m(tt(),po(),vo())})(function(m){m.defineOption("search",{bottom:!1});function U(g,F){return typeof g=="string"?g=new RegExp(g.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),F?"gi":"g"):g.global||(g=new RegExp(g.source,g.ignoreCase?"gi":"g")),{token:function(ne){g.lastIndex=ne.pos;var V=g.exec(ne.string);if(V&&V.index==ne.pos)return ne.pos+=V[0].length||1,"searching";V?ne.pos=V.index:ne.skipToEnd()}}}function I(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function G(g){return g.state.search||(g.state.search=new I)}function M(g){return typeof g=="string"&&g==g.toLowerCase()}function w(g,F,ne){return g.getSearchCursor(F,ne,{caseFold:M(F),multiline:!0})}function S(g,F,ne,V,ee){g.openDialog(F,V,{value:ne,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){D(g)},onKeyDown:ee,bottom:g.options.search.bottom})}function x(g,F,ne,V,ee){g.openDialog?g.openDialog(F,ee,{value:V,selectValueOnOpen:!0,bottom:g.options.search.bottom}):ee(prompt(ne,V))}function C(g,F,ne,V){g.openConfirm?g.openConfirm(F,V):confirm(ne)&&V[0]()}function W(g){return g.replace(/\\([nrt\\])/g,function(F,ne){return ne=="n"?` `:ne=="r"?"\r":ne=="t"?" ":ne=="\\"?"\\":F})}function P(g){var F=g.match(/^\/(.*)\/([a-z]*)$/);if(F)try{g=new RegExp(F[1],F[2].indexOf("i")==-1?"":"i")}catch{}else g=W(g);return(typeof g=="string"?g=="":g.test(""))&&(g=/x^/),g}function j(g,F,ne){F.queryText=ne,F.query=P(ne),g.removeOverlay(F.overlay,M(F.query)),F.overlay=U(F.query,M(F.query)),g.addOverlay(F.overlay),g.showMatchesOnScrollbar&&(F.annotate&&(F.annotate.clear(),F.annotate=null),F.annotate=g.showMatchesOnScrollbar(F.query,M(F.query)))}function O(g,F,ne,V){var ee=G(g);if(ee.query)return R(g,F);var T=g.getSelection()||ee.lastQuery;if(T instanceof RegExp&&T.source=="x^"&&(T=null),ne&&g.openDialog){var K=null,d=function(ce,be){m.e_stop(be),ce&&(ce!=ee.queryText&&(j(g,ee,ce),ee.posFrom=ee.posTo=g.getCursor()),K&&(K.style.opacity=1),R(g,be.shiftKey,function(Le,we){var Ce;we.line<3&&document.querySelector&&(Ce=g.display.wrapper.querySelector(".CodeMirror-dialog"))&&Ce.getBoundingClientRect().bottom-4>g.cursorCoords(we,"window").top&&((K=Ce).style.opacity=.4)}))};S(g,k(g),T,d,function(ce,be){var Le=m.keyName(ce),we=g.getOption("extraKeys"),Ce=we&&we[Le]||m.keyMap[g.getOption("keyMap")][Le];Ce=="findNext"||Ce=="findPrev"||Ce=="findPersistentNext"||Ce=="findPersistentPrev"?(m.e_stop(ce),j(g,G(g),be),g.execCommand(Ce)):(Ce=="find"||Ce=="findPersistent")&&(m.e_stop(ce),d(be,ce))}),V&&T&&(j(g,ee,T),R(g,F))}else x(g,k(g),"Search for:",T,function(ce){ce&&!ee.query&&g.operation(function(){j(g,ee,ce),ee.posFrom=ee.posTo=g.getCursor(),R(g,F)})})}function R(g,F,ne){g.operation(function(){var V=G(g),ee=w(g,V.query,F?V.posFrom:V.posTo);!ee.find(F)&&(ee=w(g,V.query,F?m.Pos(g.lastLine()):m.Pos(g.firstLine(),0)),!ee.find(F))||(g.setSelection(ee.from(),ee.to()),g.scrollIntoView({from:ee.from(),to:ee.to()},20),V.posFrom=ee.from(),V.posTo=ee.to(),ne&&ne(ee.from(),ee.to()))})}function D(g){g.operation(function(){var F=G(g);F.lastQuery=F.query,F.query&&(F.query=F.queryText=null,g.removeOverlay(F.overlay),F.annotate&&(F.annotate.clear(),F.annotate=null))})}function H(g,F){var ne=g?document.createElement(g):document.createDocumentFragment();for(var V in F)ne[V]=F[V];for(var ee=2;ee{M!=null&&m.value&&m.value!==M.getValue()&&M.setValue(m.value)}),pl(I,()=>{M!=null&&M.setOption("readOnly",I.value)}),Ou(()=>{M=Iu.fromTextArea(G.value,{value:m.value,mode:"application/json",indentWithTabs:!1,smartIndent:!0,lineNumbers:!0,matchBrackets:!0,readOnly:I.value,foldGutter:!0,lineWrapping:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter","CodeMirror-lint-markers"],styleActiveLine:!1}),M.on("change",()=>{Be.emit("update:modelValue",M.getValue())}),U.value&&M.setValue(U.value)}),Nu(()=>{M!==null&&(M.toTextArea(),M=null)}),{codeEditor:G}}}),Bu={ref:"codeEditor",placeholder:"\u8BF7\u8F93\u5165..."};function zu(Oe,Be,m,U,I,G){return Cl(),kl("textarea",Bu,null,512)}const _u=wl(Ru,[["render",zu]]),Gu=Oe=>(Du("data-v-666accbb"),Oe=Oe(),Hu(),Oe),Uu={class:"m-code-mirror"},Ku={class:"header"},Xu=Gu(()=>Nn("div",null,[Nn("span",null,"\u4EE3\u7801\u7F16\u8F91\u5668\u7EC4\u4EF6\u793A\u4F8B")],-1)),Yu={class:"footer"},qu={class:"footer-inner"},Zu=Sl({__name:"index",setup(Oe){return(Be,m)=>{const U=Au("el-card");return Cl(),kl("div",Uu,[Nn("div",Ku,[vl(U,null,{default:Mu(()=>[Xu]),_:1})]),Nn("div",Yu,[Nn("div",qu,[vl(_u)])])])}}});const Ju=wl(Zu,[["__scopeId","data-v-666accbb"]]);export{Ju as default};