-right: -1px");return r.setAttribute("cm-text",""),r}function hasBadBidiRects(e){if(null!=r)return r;var n=removeChildrenAndAdd(e,document.createTextNode("A\u062EA")),i=t(n,0,1).getBoundingClientRect(),o=t(n,1,2).getBoundingClientRect();return removeChildren(e),!!i&&i.left!=i.right&&(r=o.right-i.right<3)}var _=3!=` b`.split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(` `,t);-1==i&&(i=e.length);var o=e.slice(t,`\r`==e.charAt(i-1)?i-1:i),a=o.indexOf(`\r`);-1!=a?(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/)},U=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&&0!=t.compareEndPoints("StartToEnd",t)},K="oncopy"in(e=elt("div"))||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy),G=null;function hasBadZoomedRects(e){if(null!=G)return G;var n=removeChildrenAndAdd(e,elt("span","x")),r=n.getBoundingClientRect(),i=t(n,0,1).getBoundingClientRect();return G=Math.abs(r.left-i.left)>1}var q={},$={};function defineMode(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),q[e]=t}function defineMIME(e,t){$[e]=t}function resolveMode(e){if("string"==typeof e&&$.hasOwnProperty(e))e=$[e];else if(e&&"string"==typeof e.name&&$.hasOwnProperty(e.name)){var t=$[e.name];"string"==typeof t&&(t={name:t}),(e=createObj(t,e)).name=t.name}else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return resolveMode("application/xml");else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return resolveMode("application/json");return"string"==typeof e?{name:e}:e||{name:"null"}}function getMode(e,t){var n=q[(t=resolveMode(t)).name];if(!n)return getMode(e,"text/plain");var r=n(e,t);if(X.hasOwnProperty(t.name)){var i=X[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 X={};function extendMode(e,t){copyObj(t,X.hasOwnProperty(e)?X[e]:X[e]={})}function copyState(e,t){if(!0===t)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 innerMode(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function startState(e,t,n){return!e.startState||e.startState(t,n)}var StringStream=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};function getLine(e,t){if((t-=e.first)<0||t>=e.size)throw Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tcmp(e,t)?t:e}function minPos(e,t){return 0>cmp(e,t)?e:t}function clipLine(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function clipPos(e,t){if(t.linen?Pos(n,getLine(e,n).text.length):clipToLen(t,getLine(e,t.line).text.length)}function clipToLen(e,t){var n=e.ch;return null==n||n>t?Pos(e.line,t):n<0?Pos(e.line,0):e}function clipPosArray(e,t){for(var n=[],r=0;r=this.string.length},StringStream.prototype.sol=function(){return this.pos==this.lineStart},StringStream.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},StringStream.prototype.next=function(){if(this.post},StringStream.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},StringStream.prototype.skipToEnd=function(){this.pos=this.string.length},StringStream.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},StringStream.prototype.backUp=function(e){this.pos-=e},StringStream.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}},StringStream.prototype.current=function(){return this.string.slice(this.start,this.pos)},StringStream.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},StringStream.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},StringStream.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var SavedContext=function(e,t){this.state=e,this.lookAhead=t},Context=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function highlightLine(e,t,n,r){var i=[e.state.modeGen],o={};runMode(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},o,r);for(var a=n.state,s=0;se&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&©State(e.doc.mode,r.state),o=highlightLine(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 getContextBefore(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Context(r,!0,t);var o=findStartLine(e,t,n),a=o>r.first&&getLine(r,o-1).stateAfter,s=a?Context.fromSaved(r,a,o):new Context(r,startState(r.mode),o);return r.iter(o,t,function(n){processLine(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw Error("Mode "+e.name+" failed to advance stream.")}Context.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Context.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}},Context.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Context.fromSaved=function(e,t,n){return t instanceof SavedContext?new Context(e,copyState(e.mode,t.state),n,t.lookAhead):new Context(e,copyState(e.mode,t),n)},Context.prototype.save=function(e){var t=!1!==e?copyState(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new SavedContext(t,this.maxLookAhead):t};var Token=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function takeToken(e,t,n,r){var i,o=e.doc,a=o.mode;t=clipPos(o,t);var s,l=getLine(o,t.line),c=getContextBefore(e,t.line,n),u=new StringStream(l.text,e.options.tabSize,c);for(r&&(s=[]);(r||u.pose.options.maxHighlightLength?(s=!1,a&&processLine(e,t,r,d.pos),d.pos=t.length,l=null):l=extractLineClasses(readToken(n,d,r.state,h),o),h){var f=h[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||u!=l){for(;ca;--s){if(s<=o.first)return o.first;var l=getLine(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof SavedContext?c.lookAhead:0)<=o.modeFrontier))return s;var u=countColumn(l.text,null,e.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}function retreatFrontier(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=getLine(e,r).stateAfter;if(i&&(!(i instanceof SavedContext)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new MarkedSpan(a,o.from,s?null:o.to))}}return r}function markedSpansAfter(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var x=0;xcmp(c.to,s.from)||cmp(c.from,s.to)>0)){var u=[l,1],d=cmp(c.from,s.from),h=cmp(c.to,s.to);!(d<0)&&(a.inclusiveLeft||d)||u.push({from:c.from,to:s.from}),!(h>0)&&(a.inclusiveRight||h)||u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}function detachMarkedSpans(e){var t=e.markedSpans;if(t){for(var n=0;ncompareCollapsedMarkers(n,i.marker))&&(n=i.marker);return n}function collapsedSpanAround(e,t){var n,r=Z&&e.markedSpans;if(r)for(var i=0;it)&&(!n||0>compareCollapsedMarkers(n,o.marker))&&(n=o.marker)}return n}function conflictingCollapsedRange(e,t,n,r,i){var o=getLine(e,t),a=Z&&o.markedSpans;if(a)for(var s=0;s=0)||!(d<=0))&&(!(u<=0)||!(d>=0))&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?cmp(c.to,n)>=0:cmp(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?0>=cmp(c.from,r):0>cmp(c.from,r))))return!0}}}function visualLine(e){for(var t;t=collapsedSpanAtSide(e,!0);)e=t.find(-1,!0).line;return e}function visualLineEnd(e){for(var t;t=collapsedSpanAtSide(e,!1);)e=t.find(1,!0).line;return e}function visualLineContinued(e){for(var t,n;t=collapsedSpanAtSide(e,!1);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function visualLineNo(e,t){var n=getLine(e,t),r=visualLine(n);return n==r?t:lineNo(r)}function visualLineEndNo(e,t){if(t>e.lastLine())return t;var n,r=getLine(e,t);if(!lineIsHidden(e,r))return t;for(;n=collapsedSpanAtSide(r,!1);)r=n.find(1,!0).line;return lineNo(r)+1}function lineIsHidden(e,t){var n=Z&&t.markedSpans;if(n){for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var Line=function(e,t,n){this.text=e,attachMarkedSpans(this,t),this.height=n?n(this):1};function updateLine(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),detachMarkedSpans(e),attachMarkedSpans(e,n);var i=r?r(e):1;i!=e.height&&updateLineHeight(e,i)}function cleanUpLine(e){e.parent=null,detachMarkedSpans(e)}Line.prototype.lineNo=function(){return lineNo(this)},eventMixin(Line);var Q={},J={};function interpretTokenStyle(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?J:Q;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function buildLineContent(e,t){var n=eltP("span",null,null,m?"padding-right: .1px":null),r={pre:eltP("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=buildToken,hasBadBidiRects(e.display.measure)&&(a=getOrder(o,e.doc.direction))&&(r.addToken=buildTokenBadBidi(r.addToken,a)),r.map=[];var s=t!=e.display.externalMeasured&&lineNo(o);insertLineContent(o,r,getLineStyles(e,o,s)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=joinClasses(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=joinClasses(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(zeroWidthElement(e.display.measure))),0==i?(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(m){var l=r.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return signal(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=joinClasses(r.pre.className,r.textClass||"")),r}function defaultSpecialCharPlaceholder(e){var t=elt("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function buildToken(e,t,n,r,i,o,a){if(t){var s,l=e.splitSpaces?splitSpaces(t,e.trailingSpace):t,c=e.cm.state.specialChars,u=!1;if(c.test(t)){s=document.createDocumentFragment();for(var d=0;;){c.lastIndex=d;var h=c.exec(t),m=h?h.index-d:t.length-d;if(m){var v=document.createTextNode(l.slice(d,d+m));f&&g<9?s.appendChild(elt("span",[v])):s.appendChild(v),e.map.push(e.pos,e.pos+m,v),e.col+=m,e.pos+=m}if(!h)break;d+=m+1;var y=void 0;if(" "==h[0]){var b=e.cm.options.tabSize,x=b-e.col%b;(y=s.appendChild(elt("span",spaceStr(x),"cm-tab"))).setAttribute("role","presentation"),y.setAttribute("cm-text"," "),e.col+=x}else`\r`==h[0]||` `==h[0]?(y=s.appendChild(elt("span",`\r`==h[0]?"\u240D":"\u2424","cm-invalidchar"))).setAttribute("cm-text",h[0]):((y=e.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),f&&g<9?s.appendChild(elt("span",[y])):s.appendChild(y)),e.col+=1;e.map.push(e.pos,e.pos+1,y),e.pos++}}else e.col+=t.length,s=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,s),f&&g<9&&(u=!0),e.pos+=t.length;if(e.trailingSpace=32==l.charCodeAt(t.length-1),n||r||i||u||o||a){var C=n||"";r&&(C+=r),i&&(C+=i);var w=elt("span",[s],C,o);if(a)for(var k in a)a.hasOwnProperty(k)&&"style"!=k&&"class"!=k&&w.setAttribute(k,a[k]);return e.content.appendChild(w)}e.content.appendChild(s)}}function splitSpaces(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;ic)||!(d.from<=c));h++);if(d.to>=u)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-c),i,o,null,s,l),o=null,r=r.slice(d.to-c),c=d.to}}}function buildCollapsedSpan(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 insertLineContent(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var a=1;am||S.collapsed&&k.to==m&&k.from==m)){if(null!=k.to&&k.to!=m&&b>k.to&&(b=k.to,u=""),S.className&&(c+=" "+S.className),S.css&&(l=(l?l+";":"")+S.css),S.startStyle&&k.from==m&&(d+=" "+S.startStyle),S.endStyle&&k.to==b&&(C||(C=[])).push(S.endStyle,k.to),S.title&&((f||(f={})).title=S.title),S.attributes)for(var L in S.attributes)(f||(f={}))[L]=S.attributes[L];S.collapsed&&(!h||0>compareCollapsedMarkers(h.marker,S))&&(h=k)}else k.from>m&&b>k.from&&(b=k.from)}if(C)for(var M=0;M=g)break;for(var P=Math.min(g,b);;){if(y){var O=m+y.length;if(!h){var A=O>P?y.slice(0,P-m):y;t.addToken(t,A,s?s+c:c,d,m+A.length==b?u:"",l,f)}if(O>=P){y=y.slice(P-m),m=P;break}m=O,d=""}y=i.slice(o,o=n[v++]),s=interpretTokenStyle(n[v++],t.cm.options)}}}function LineView(e,t,n){this.line=t,this.rest=visualLineContinued(t),this.size=this.rest?lineNo(lst(this.rest))-n+1:1,this.node=this.text=null,this.hidden=lineIsHidden(e,t)}function buildViewArray(e,t,n){for(var r,i=[],o=t;o2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function mapFromLineView(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function updateExternalMeasurement(e,t){var n=lineNo(t=visualLine(t)),r=e.display.externalMeasured=new LineView(e.doc,t,n);r.lineN=n;var i=r.built=buildLineContent(e,r);return r.text=i.pre,removeChildrenAndAdd(e.display.lineMeasure,i.pre),r}function findViewForLine(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[(c-=3)+2],a="left";if("right"==n&&i==l-s)for(;c=0&&(n=e[i]).left==n.right;i--);return n}function measureCharInner(e,n,r,i){var o,a,s=nodeAndOffsetInLineMap(n.map,r,i),l=s.node,c=s.start,u=s.end,d=s.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){for(;c&&isExtendingChar(n.line.text.charAt(s.coverStart+c));)--c;for(;s.coverStart+u0&&(d=i="right"),o=e.options.lineWrapping&&(a=l.getClientRects()).length>1?a["right"==i?a.length-1:0]:l.getBoundingClientRect();if(f&&g<9&&!c&&(!o||!o.left&&!o.right)){var m=l.parentNode.getClientRects()[0];o=m?{left:m.left,right:m.left+charWidth(e.display),top:m.top,bottom:m.bottom}:en}for(var v=o.top-n.rect.top,y=o.bottom-n.rect.top,b=(v+y)/2,x=n.view.measure.heights,C=0;C=r.text.length?(s=r.text.length,l="before"):s<=0&&(s=0,l="after"),!a)return get("before"==l?s-1:s,"before"==l);function getBidi(e,t,n){return get(n?e-1:e,1==a[t].level!=n)}var c=getBidiPartAt(a,s,l),u=z,d=getBidi(s,c,"before"==l);return null!=u&&(d.other=getBidi(s,u,"before"!=l)),d}function estimateCoords(e,t){var n=0;t=clipPos(e.doc,t),e.options.lineWrapping||(n=charWidth(e.display)*t.ch);var r=getLine(e.doc,t.line),i=heightAtLine(r)+paddingTop(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function PosWithInfo(e,t,n,r,i){var o=Pos(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function coordsChar(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return PosWithInfo(r.first,0,null,-1,-1);var i=lineAtHeight(r,n),o=r.first+r.size-1;if(i>o)return PosWithInfo(r.first+r.size-1,getLine(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=getLine(r,i);;){var s=coordsCharInner(e,a,i,t,n),l=collapsedSpanAround(a,s.ch+ +(s.xRel>0||s.outside>0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=getLine(r,i=c.line)}}function wrappedLineExtent(e,t,n,r){r-=widgetTopHeight(t);var i=t.text.length,o=findFirst(function(t){return measureCharPrepared(e,n,t-1).bottom<=r},i,0);return i=findFirst(function(t){return measureCharPrepared(e,n,t).top>r},o,i),{begin:o,end:i}}function wrappedLineExtentChar(e,t,n,r){n||(n=prepareMeasureForLine(e,t));var i=intoCoordSystem(e,t,measureCharPrepared(e,n,r),"line").top;return wrappedLineExtent(e,t,n,i)}function boxIsAfter(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function coordsCharInner(e,t,n,r,i){i-=heightAtLine(t);var o=prepareMeasureForLine(e,t),a=widgetTopHeight(t),s=0,l=t.text.length,c=!0,u=getOrder(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?coordsBidiPartWrapped:coordsBidiPart)(e,t,n,o,u,r,i);s=(c=1!=d.level)?d.from:d.to-1,l=c?d.to:d.from-1}var h,f,g=null,m=null,v=findFirst(function(t){var n=measureCharPrepared(e,o,t);return n.top+=a,n.bottom+=a,!!boxIsAfter(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(g=t,m=n),!0)},s,l),y=!1;if(m){var b=r-m.left=C.bottom)}return PosWithInfo(n,v=skipExtendingChars(t.text,v,1),f,y,r-h)}function coordsBidiPart(e,t,n,r,i,o,a){var s=findFirst(function(s){var l=i[s],c=1!=l.level;return boxIsAfter(cursorCoords(e,Pos(n,c?l.to:l.from,c?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=cursorCoords(e,Pos(n,c?l.from:l.to,c?"after":"before"),"line",t,r);boxIsAfter(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l}function coordsBidiPartWrapped(e,t,n,r,i,o,a){var s=wrappedLineExtent(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,h=0;h=c)&&!(f.to<=l)){var g=measureCharPrepared(e,r,1!=f.level?Math.min(c,f.to)-1:Math.max(l,f.from)).right,m=gm)&&(u=f,d=m)}}return u||(u=i[i.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function textHeight(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==i){i=elt("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)i.appendChild(document.createTextNode("x")),i.appendChild(elt("br"));i.appendChild(document.createTextNode("x"))}removeChildrenAndAdd(e.measure,i);var n=i.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),removeChildren(e.measure),n||1}function charWidth(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=elt("span","xxxxxxxxxx"),n=elt("pre",[t],"CodeMirror-line-like");removeChildrenAndAdd(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function getDimensions(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:compensateForHScroll(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function compensateForHScroll(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function estimateHeight(e){var t=textHeight(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/charWidth(e.display)-3);return function(i){if(lineIsHidden(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=getLine(e.doc,c.line).text).length==c.ch){var u=countColumn(l,l.length,e.options.tabSize)-l.length;c=Pos(c.line,Math.max(0,Math.round((o-paddingH(e.display).left)/charWidth(e.display))-u))}return c}function findViewIndex(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Z&&visualLineNo(e.doc,t)i.viewFrom?resetView(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)resetView(e);else if(t<=i.viewFrom){var o=viewCuttingPoint(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):resetView(e)}else if(n>=i.viewTo){var a=viewCuttingPoint(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):resetView(e)}else{var s=viewCuttingPoint(e,t,t,-1),l=viewCuttingPoint(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(buildViewArray(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):resetView(e)}var c=i.externalMeasured;c&&(n=i.lineN&&t=r.viewTo)){var o=r.view[findViewIndex(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==indexOf(a,n)&&a.push(n)}}}function resetView(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function viewCuttingPoint(e,t,n,r){var i,o=findViewIndex(e,t),a=e.display.view;if(!Z||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;visualLineNo(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0)].size,o+=r}return{index:o,lineN:n}}function adjustView(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=buildViewArray(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=buildViewArray(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,findViewIndex(e,n)))),r.viewTo=n}function countDirtyView(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo)&&!(s.to().linecmpCoords(b,o))&&(o=b),0>cmpCoords(x,o)&&(o=x),(!a||0>cmpCoords(b,a))&&(a=b),0>cmpCoords(x,a)&&(a=x)}),{start:o,end:a}}var u=t.from(),d=t.to();if(u.line==d.line)drawForLine(u.line,u.ch,d.ch);else{var h=getLine(i,u.line),f=getLine(i,d.line),g=visualLine(h)==visualLine(f),m=drawForLine(u.line,u.ch,g?h.text.length+1:null).end,v=drawForLine(d.line,g?0:null,d.ch).start;g&&(m.top0?t.blinker=setInterval(function(){e.hasFocus()||onBlur(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function ensureFocus(e){!e.hasFocus()&&(e.display.input.focus(),e.state.focused||onFocus(e))}function delayBlurEvent(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&onBlur(e))},100)}function onFocus(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(signal(e,"focus",e,t),e.state.focused=!0,addClass(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),m&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),restartBlink(e))}function onBlur(e,t){e.state.delayingBlurEvent||(e.state.focused&&(signal(e,"blur",e,t),e.state.focused=!1,rmClass(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function updateHeightsInViewport(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||u<-.005)&&(updateLineHeight(i.line,a),updateWidgetHeight(i.line),i.rest))for(var d=0;de.display.sizerWidth){var h=Math.ceil(s/charWidth(e.display));h>e.display.maxLineLength&&(e.display.maxLineLength=h,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function updateWidgetHeight(e){if(e.widgets)for(var t=0;t=a&&(o=lineAtHeight(t,heightAtLine(getLine(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function maybeScrollWindow(e,t){if(!signalDOMEvent(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!w){var o=elt("div","\u200B",null,`position: absolute; top: `+(t.top-n.viewOffset-paddingTop(e.display))+`px; height: `+(t.bottom-t.top+scrollGap(e)+n.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function scrollPosIntoView(e,t,n,r){null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?Pos(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?Pos(t.line,t.ch+1,"before"):t);for(var i,o=0;o<5;o++){var a=!1,s=cursorCoords(e,t),l=n&&n!=t?cursorCoords(e,n):s,c=calculateScrollPos(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(updateScrollTop(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(setScrollLeft(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function scrollIntoView(e,t){var n=calculateScrollPos(e,t);null!=n.scrollTop&&updateScrollTop(e,n.scrollTop),null!=n.scrollLeft&&setScrollLeft(e,n.scrollLeft)}function calculateScrollPos(e,t){var n=e.display,r=textHeight(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=displayHeight(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+paddingVert(n),l=t.tops-r;if(t.topi+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,f=displayWidth(e)-n.gutters.offsetWidth,g=t.right-t.left>f;return g&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.leftf+h-3&&(a.scrollLeft=t.right+10*!g-f),a}function addToScrollTop(e,t){null!=t&&(resolveScrollToPos(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function ensureCursorVisible(e){resolveScrollToPos(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function scrollToCoords(e,t,n){(null!=t||null!=n)&&resolveScrollToPos(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function scrollToRange(e,t){resolveScrollToPos(e),e.curOp.scrollToPos=t}function resolveScrollToPos(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=estimateCoords(e,t.from),r=estimateCoords(e,t.to);scrollToCoordsRange(e,n,r,t.margin)}}function scrollToCoordsRange(e,t,n,r){var i=calculateScrollPos(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});scrollToCoords(e,i.scrollLeft,i.scrollTop)}function updateScrollTop(e,t){2>Math.abs(e.doc.scrollTop-t)||(c||updateDisplaySimple(e,{top:t}),setScrollTop(e,t,!0),c&&updateDisplaySimple(e),startWorker(e,100))}function setScrollTop(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 setScrollLeft(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),((n?t!=e.doc.scrollLeft:!(2>Math.abs(e.doc.scrollLeft-t)))||r)&&(e.doc.scrollLeft=t,alignHorizontally(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function measureForScrollbars(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+paddingVert(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+scrollGap(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var NativeScrollbars=function(e,t,n){this.cm=n;var r=this.vert=elt("div",[elt("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=elt("div",[elt("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),on(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),on(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,f&&g<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};NativeScrollbars.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.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&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},NativeScrollbars.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},NativeScrollbars.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},NativeScrollbars.prototype.zeroWidthHack=function(){this.horiz.style.height=this.vert.style.width=M&&!C?"12px":"18px",this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Delayed,this.disableVert=new Delayed},NativeScrollbars.prototype.enableZeroWidthBar=function(e,t,n){function maybeDisable(){var r=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,maybeDisable)}e.style.pointerEvents="auto",t.set(1e3,maybeDisable)},NativeScrollbars.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var NullScrollbars=function(){};function updateScrollbars(e,t){t||(t=measureForScrollbars(e));var n=e.display.barWidth,r=e.display.barHeight;updateScrollbarsInner(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&updateHeightsInViewport(e),updateScrollbarsInner(e,measureForScrollbars(e)),n=e.display.barWidth,r=e.display.barHeight}function updateScrollbarsInner(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=""}NullScrollbars.prototype.update=function(){return{bottom:0,right:0}},NullScrollbars.prototype.setScrollLeft=function(){},NullScrollbars.prototype.setScrollTop=function(){},NullScrollbars.prototype.clear=function(){};var er={native:NativeScrollbars,null:NullScrollbars};function initScrollbars(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&rmClass(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new er[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),on(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){"horizontal"==n?setScrollLeft(e,t):updateScrollTop(e,t)},e),e.display.scrollbars.addClass&&addClass(e.display.wrapper,e.display.scrollbars.addClass)}var ei=0;function startOperation(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:++ei},pushOperation(e.curOp)}function endOperation(e){var t=e.curOp;t&&finishOperation(t,function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new DisplayUpdate(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function endOperation_W1(e){e.updatedDisplay=e.mustUpdate&&updateDisplayIfNeeded(e.cm,e.update)}function endOperation_R2(e){var t,n,r=e.cm,i=r.display;e.updatedDisplay&&updateHeightsInViewport(r),e.barMeasure=measureForScrollbars(r),i.maxLineChanged&&!r.options.lineWrapping&&(e.adjustWidthTo=(t=i.maxLine,n=i.maxLine.text.length,measureCharPrepared(r,prepareMeasureForLine(r,t),n,void 0)).left+3,r.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+scrollGap(r)+r.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-displayWidth(r))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function endOperation_W2(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=getContextBefore(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,s=o.text.length>e.options.maxHighlightLength?copyState(t.mode,r.state):null,l=highlightLine(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!d&&hn)return startWorker(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&runInOp(e,function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==countDirtyView(e))return!1;maybeUpdateLineNumberWidth(e)&&(resetView(e),t.dims=getDimensions(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)),Z&&(o=visualLineNo(e.doc,o),a=visualLineEndNo(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;adjustView(e,o,a),n.viewOffset=heightAtLine(getLine(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=countDirtyView(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=selectionSnapshot(e);return l>4&&(n.lineDiv.style.display="none"),patchDisplay(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,restoreSelection(c),removeChildren(n.cursorDiv),removeChildren(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,startWorker(e,400)),n.updateLineNumbers=null,!0}function postUpdateDisplay(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=displayWidth(e))r&&(t.visible=visibleLines(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+paddingVert(e.display)-displayHeight(e),n.top)}),t.visible=visibleLines(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!updateDisplayIfNeeded(e,t))break;updateHeightsInViewport(e);var i=measureForScrollbars(e);updateSelection(e),updateScrollbars(e,i),setDocumentHeight(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 updateDisplaySimple(e,t){var n=new DisplayUpdate(e,t);if(updateDisplayIfNeeded(e,n)){updateHeightsInViewport(e),postUpdateDisplay(e,n);var r=measureForScrollbars(e);updateSelection(e),updateScrollbars(e,r),setDocumentHeight(e,r),n.finish()}}function patchDisplay(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function rm(t){var n=t.nextSibling;return m&&M&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var s=r.view,l=r.viewFrom,c=0;c-1&&(d=!1),updateLineForChanges(e,u,l,n)),d&&(removeChildren(u.lineNumber),u.lineNumber.appendChild(document.createTextNode(lineNumberFor(e.options,l)))),a=u.node.nextSibling}else{var h=buildLineElement(e,u,l,n);o.insertBefore(h,a)}l+=u.size}for(;a;)a=rm(a)}function updateGutterSpace(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function setDocumentHeight(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+scrollGap(e)+"px"}function alignHorizontally(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=compensateForHScroll(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;aa.clientWidth,l=a.scrollHeight>a.clientHeight;if(r&&s||i&&l){if(i&&M&&m){e:for(var u=t.target,d=o.view;u!=a;u=u.parentNode)for(var h=0;h=0&&0>=cmp(e,r.to()))return n}return -1};var Range=function(e,t){this.anchor=e,this.head=t};function normalizeSelection(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(e,t){return cmp(e.from(),t.from())}),n=indexOf(t,i);for(var o=1;o0:l>=0){var c=minPos(s.from(),a.from()),u=maxPos(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new Range(d?u:c,d?c:u))}}return new Selection(t,n)}function simpleSelection(e,t){return new Selection([new Range(e,t||e)],0)}function changeEnd(e){return e.text?Pos(e.from.line+e.text.length-1,lst(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function adjustForChange(e,t){if(0>cmp(e,t.from))return e;if(0>=cmp(e,t.to))return changeEnd(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+=changeEnd(t).ch-t.to.ch),Pos(n,r)}function computeSelAfterChange(e,t){for(var n=[],r=0;rcmp(u.head,u.anchor);r[a]=new Range(d?c:l,d?l:c)}else r[a]=new Range(l,l)}return new Selection(r,e.sel.primIndex)}function loadMode(e){e.doc.mode=getMode(e.options,e.doc.modeOption),resetModeState(e)}function resetModeState(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,startWorker(e,100),e.state.modeGen++,e.curOp&®Change(e)}function isWholeLineUpdate(e,t){return 0==t.from.ch&&0==t.to.ch&&""==lst(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function updateDoc(e,t,n,r){function spansFor(e){return n?n[e]:null}function update(e,n,i){updateLine(e,n,i,r),signalLater(e,"change",e,t)}function linesFor(e,t){for(var n=[],i=e;i1&&e.remove(i.line+1,d-1),e.insert(i.line+1,g)}signalLater(e,"change",e,t)}function linkedDocs(e,t,n){function propagate(e,r,i){if(e.linked)for(var o=0;o1&&!e.done[e.done.length-2].ranges?(e.done.pop(),lst(e.done)):void 0}function addChangeToHistory(e,t,n,r){var i,o=e.history;o.undone.length=0;var a,s=+new Date;if((o.lastOp==r||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&o.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(a=lastChangeEvent(o,o.lastOp==r)))i=lst(a.changes),0==cmp(t.from,t.to)&&0==cmp(t.from,i.to)?i.to=changeEnd(t):a.changes.push(historyChangeFromChange(e,t));else{var l=lst(o.done);for(l&&l.ranges||pushSelectionToHistory(e.sel,o.done),a={changes:[historyChangeFromChange(e,t)],generation:o.generation},o.done.push(a);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=s,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=t.origin,i||signal(e,"historyAdded")}function selectionEventCanBeMerged(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 addSelectionToHistory(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||selectionEventCanBeMerged(e,o,lst(i.done),t))?i.done[i.done.length-1]=t:pushSelectionToHistory(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&clearSelectionEvents(i.undone)}function pushSelectionToHistory(e,t){var n=lst(t);n&&n.ranges&&n.equals(e)||t.push(e)}function attachLocalSpans(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(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function removeClearedSpans(e){if(!e)return null;for(var t,n=0;n-1&&(lst(s)[d]=c[d],delete c[d])}}return r}function extendRange(e,t,n,r){if(!r)return new Range(n||t,t);var i=e.anchor;if(n){var o=0>cmp(t,i);o!=0>cmp(n,i)?(i=t,t=n):o!=0>cmp(t,n)&&(t=n)}return new Range(i,t)}function extendSelection(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),setSelection(e,new Selection([extendRange(e.sel.primary(),t,n,i)],0),r)}function extendSelections(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;ocmp(t.primary().head,e.sel.primary().head)?-1:1);setSelectionInner(e,skipAtomicInSelection(e,t,r,!0)),!(n&&!1===n.scroll)&&e.cm&&"nocursor"!=e.cm.getOption("readOnly")&&ensureCursorVisible(e.cm)}function setSelectionInner(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,signalCursorActivity(e.cm)),signalLater(e,"cursorActivity",e))}function reCheckSelection(e){setSelectionInner(e,skipAtomicInSelection(e,e.sel,null,!1))}function skipAtomicInSelection(e,t,n,r){for(var i,o=0;o=t.ch:s.to>t.ch))){if(i&&(signal(l,"beforeCursorEnter"),l.explicitlyCleared))if(o.markedSpans){--a;continue}else break;if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),h=void 0;if((r<0?u:c)&&(d=movePos(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(h=cmp(d,n))&&(r<0?h<0:h>0))return skipAtomicInner(e,d,t,r,i)}var f=l.find(r<0?-1:1);return(r<0?c:u)&&(f=movePos(e,f,r,f.line==t.line?o:null)),f?skipAtomicInner(e,f,t,r,i):null}}return t}function skipAtomic(e,t,n,r,i){var o=r||1,a=skipAtomicInner(e,t,n,o,i)||!i&&skipAtomicInner(e,t,n,o,!0)||skipAtomicInner(e,t,n,-o,i)||!i&&skipAtomicInner(e,t,n,-o,!0);return a||(e.cantEdit=!0,Pos(e.first,0))}function movePos(e,t,n,r){if(n<0&&0==t.ch)if(t.line>e.first)return clipPos(e,Pos(t.line-1));else return null;return n>0&&t.ch==(r||getLine(e,t.line)).text.length?t.line=0;--i)makeChangeInner(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else makeChangeInner(e,t)}}function makeChangeInner(e,t){if(1!=t.text.length||""!=t.text[0]||0!=cmp(t.from,t.to)){var n=computeSelAfterChange(e,t);addChangeToHistory(e,t,n,e.cm?e.cm.curOp.id:NaN),makeChangeSingleDoc(e,t,n,stretchSpansOverChange(e,t));var r=[];linkedDocs(e,function(e,n){n||-1!=indexOf(r,e.history)||(rebaseHist(e.history,t),r.push(e.history)),makeChangeSingleDoc(e,t,null,stretchSpansOverChange(e,t))})}}function makeChangeFromHistory(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c=0;--h){var f=function(n){var r=i.changes[n];if(r.origin=t,d&&!filterChange(e,r,!1))return s.length=0,{};u.push(historyChangeFromChange(e,r));var o=n?computeSelAfterChange(e,r):lst(s);makeChangeSingleDoc(e,r,o,mergeOldSpans(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:changeEnd(r)});var a=[];linkedDocs(e,function(e,t){t||-1!=indexOf(a,e.history)||(rebaseHist(e.history,r),a.push(e.history)),makeChangeSingleDoc(e,r,null,mergeOldSpans(e,r))})}(h);if(f)return f.v}}}}function shiftDoc(e,t){if(0!=t&&(e.first+=t,e.sel=new Selection(map(e.sel.ranges,function(e){return new Range(Pos(e.anchor.line+t,e.anchor.ch),Pos(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){regChange(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:Pos(o,getLine(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=getBetween(e,t.from,t.to),n||(n=computeSelAfterChange(e,t)),e.cm?makeChangeSingleDocInEditor(e.cm,t,r):updateDoc(e,t,r),setSelectionNoUndo(e,n,I),e.cantEdit&&skipAtomic(e,Pos(e.firstLine(),0))&&(e.cantEdit=!1)}}function makeChangeSingleDocInEditor(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=lineNo(visualLine(getLine(r,o.line))),r.iter(l,a.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&signalCursorActivity(e),updateDoc(r,t,n,estimateHeight(e)),!e.options.lineWrapping&&(r.iter(l,o.line+t.text.length,function(e){var t=lineLength(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),retreatFrontier(r,o.line),startWorker(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?regChange(e):o.line!=a.line||1!=t.text.length||isWholeLineUpdate(e.doc,t)?regChange(e,o.line,a.line+1,c):regLineChange(e,o.line,"text");var u=hasHandler(e,"changes"),d=hasHandler(e,"change");if(d||u){var h={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&signalLater(e,"change",e,h),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function replaceRange(e,t,n,r,i){var o;r||(r=n),0>cmp(r,n)&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),makeChange(e,{from:n,to:r,text:t,origin:i})}function rebaseHistSelSingle(e,t,n,r){n1||!(this.children[0]instanceof LeafChunk))){var s=[];this.collapse(s),this.children=[new LeafChunk(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10)e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=eltP("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(conflictingCollapsedRange(e,t.line,t,n,o)||t.line!=n.line&&conflictingCollapsedRange(e,n.line,t,n,o))throw Error("Inserting collapsed marker partially overlapping an existing one");seeCollapsedSpans()}o.addToHistory&&addChangeToHistory(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&visualLine(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&updateLineHeight(e,0),addMarkedSpan(e,new MarkedSpan(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(t){lineIsHidden(e,t)&&updateLineHeight(t,0)}),o.clearOnEnter&&on(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(seeReadOnlySpans(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++es,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)regChange(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)regLineChange(c,u,"text");o.atomic&&reCheckSelection(c.doc),signalLater(c,"markerAdded",c,o)}return o}TextMarker.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&startOperation(e),hasHandler(this,"clear")){var n=this.find();n&&signalLater(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&®Change(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&reCheckSelection(e.doc)),e&&signalLater(e,"markerCleared",e,this,r,i),t&&endOperation(e),this.parent&&this.parent.clear()}},TextMarker.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i=0;l--)makeChange(this,r[l]);s?setSelectionReplaceHistory(this,s):this.cm&&ensureCursorVisible(this.cm)}),undo:docMethodOp(function(){makeChangeFromHistory(this,"undo")}),redo:docMethodOp(function(){makeChangeFromHistory(this,"redo")}),undoSelection:docMethodOp(function(){makeChangeFromHistory(this,"undo",!0)}),redoSelection:docMethodOp(function(){makeChangeFromHistory(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=clipPos(this,e),t=clipPos(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 s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch)&&(!n||n(l.marker))&&r.push(l.marker.parent||l.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}),clipPos(this,Pos(n,t))},indexFromPos:function(e){var t=(e=clipPos(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var l,c=e.dataTransfer.getData("Text");if(c){if(t.state.draggingText&&!t.state.draggingText.copy&&(l=t.listSelections()),setSelectionNoUndo(t.doc,simpleSelection(n,n)),l)for(var u=0;u=cmp(o.from,lst(r).to);){var a=r.pop();if(0>cmp(a.from,o.from)){o.from=a.from;break}}r.push(o)}runInOp(e,function(){for(var t=r.length-1;t>=0;t--)replaceRange(e.doc,"",r[t].from,r[t].to,"+delete");ensureCursorVisible(e)})}function moveCharLogically(e,t,n){var r=skipExtendingChars(e.text,t+n,n);return r<0||r>e.text.length?null:r}function moveLogically(e,t,n){var r=moveCharLogically(e,t.ch,n);return null==r?null:new Pos(t.line,r,n<0?"after":"before")}function endOfLine(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=getOrder(n,t.doc.direction);if(o){var a,s=i<0?lst(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=prepareMeasureForLine(t,n),u=measureCharPrepared(t,c,a=i<0?n.text.length-1:0).top;a=findFirst(function(e){return measureCharPrepared(t,c,e).top==u},i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=moveCharLogically(n,a,1))}else a=i<0?s.to:s.from;return new Pos(r,a,l)}}return new Pos(r,i<0?n.text.length:0,i<0?"before":"after")}function moveVisually(e,t,n,r){var i,o=getOrder(t,e.doc.direction);if(!o)return moveLogically(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var a=getBidiPartAt(o,n.ch,n.sticky),s=o[a];if("ltr"==e.doc.direction&&s.level%2==0&&(r>0?s.to>n.ch:s.from=s.from&&u>=l.begin))return new Pos(n.line,u,c?"before":"after")}var searchInVisualLine=function(e,t,r){for(var getRes=function(e,t){return t?new Pos(n.line,mv(e,1),"before"):new Pos(n.line,e,"after")};e>=0&&e0==(1!=i.level),s=a?r.begin:mv(r.end,-1);if(i.from<=s&&s0?l.end:mv(l.begin,-1);return null!=h&&!(r>0&&h==t.text.length)&&(d=searchInVisualLine(r>0?0:o.length-1,r,getWrappedLineExtent(h)))?d:null}eg.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},eg.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},eg.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},eg.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},eg.default=M?eg.macDefault:eg.pcDefault;var em={selectAll:selectAll,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),I)},killLine:function(e){return deleteNearSelection(e,function(t){if(!t.empty())return{from:t.from(),to:t.to()};var n=getLine(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new Pos(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Pos(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=getLine(e.doc,i.line-1).text;a&&(i=new Pos(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),Pos(i.line-1,a.length-1),i,"+transpose"))}}n.push(new Range(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return runInOp(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(0>cmp((i=a.ranges[i]).from(),t)||t.xRel>0)&&(cmp(i.to(),t)>0||t.xRel<0)?leftButtonStartDrag(e,r,t,o):leftButtonSelect(e,r,t,o)}function leftButtonStartDrag(e,t,n,r){var i=e.display,o=!1,a=operation(e,function(t){m&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:delayBlurEvent(e)),off(i.wrapper.ownerDocument,"mouseup",a),off(i.wrapper.ownerDocument,"mousemove",mouseMove),off(i.scroller,"dragstart",dragStart),off(i.scroller,"drop",a),o||(e_preventDefault(t),r.addNew||extendSelection(e.doc,n,null,null,r.extend),m&&!x||f&&9==g?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),mouseMove=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},dragStart=function(){return o=!0};m&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,on(i.wrapper.ownerDocument,"mouseup",a),on(i.wrapper.ownerDocument,"mousemove",mouseMove),on(i.scroller,"dragstart",dragStart),on(i.scroller,"drop",a),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function rangeForUnit(e,t,n){if("char"==n)return new Range(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Range(Pos(t.line,0),clipPos(e.doc,Pos(t.line+1,0)));var r=n(e,t);return new Range(r.from,r.to)}function leftButtonSelect(e,t,n,r){f&&delayBlurEvent(e);var i=e.display,o=e.doc;e_preventDefault(t);var a,s,l=o.sel,c=l.ranges;if(r.addNew&&!r.extend?a=(s=o.sel.contains(n))>-1?c[s]:new Range(n,n):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(a=new Range(n,n)),n=posFromMouse(e,t,!0,!0),s=-1;else{var u=rangeForUnit(e,n,r.unit);a=r.extend?extendRange(a,u.anchor,u.head,r.extend):u}r.addNew?-1==s?(s=c.length,setSelection(o,normalizeSelection(e,c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==r.unit&&!r.extend?(setSelection(o,normalizeSelection(e,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):replaceOneSelection(o,s,a,H):(s=0,setSelection(o,new Selection([a],0),H),l=o.sel);var d=n;function extendTo(t){if(0!=cmp(d,t))if(d=t,"rectangle"==r.unit){for(var i=[],c=e.options.tabSize,u=countColumn(getLine(o,n.line).text,n.ch,c),h=countColumn(getLine(o,t.line).text,t.ch,c),f=Math.min(u,h),g=Math.max(u,h),m=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=v;m++){var y=getLine(o,m).text,b=findColumn(y,f,c);f==g?i.push(new Range(Pos(m,b),Pos(m,b))):y.length>b&&i.push(new Range(Pos(m,b),Pos(m,findColumn(y,g,c))))}i.length||i.push(new Range(n,n)),setSelection(o,normalizeSelection(e,l.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x,C=a,w=rangeForUnit(e,t,r.unit),k=C.anchor;cmp(w.anchor,k)>0?(x=w.head,k=minPos(C.from(),w.anchor)):(x=w.anchor,k=maxPos(C.to(),w.head));var S=l.ranges.slice(0);S[s]=bidiSimplify(e,new Range(clipPos(o,k),x)),setSelection(o,normalizeSelection(e,S,s),H)}}var h=i.wrapper.getBoundingClientRect(),g=0;function extend(t){var n=++g,a=posFromMouse(e,t,!0,"rectangle"==r.unit);if(a)if(0!=cmp(a,d)){e.curOp.focus=activeElt(),extendTo(a);var s=visibleLines(i,o);(a.line>=s.to||a.lineh.bottom);l&&setTimeout(operation(e,function(){g==n&&(i.scroller.scrollTop+=l,extend(t))}),50)}}function done(t){e.state.selectingText=!1,g=1/0,t&&(e_preventDefault(t),i.input.focus()),off(i.wrapper.ownerDocument,"mousemove",m),off(i.wrapper.ownerDocument,"mouseup",v),o.history.lastSelOrigin=null}var m=operation(e,function(e){0!==e.buttons&&e_button(e)?extend(e):done(e)}),v=operation(e,done);e.state.selectingText=v,on(i.wrapper.ownerDocument,"mousemove",m),on(i.wrapper.ownerDocument,"mouseup",v)}function bidiSimplify(e,t){var n,r=t.anchor,i=t.head,o=getLine(e.doc,r.line);if(0==cmp(r,i)&&r.sticky==i.sticky)return t;var a=getOrder(o);if(!a)return t;var s=getBidiPartAt(a,r.ch,r.sticky),l=a[s];if(l.from!=r.ch&&l.to!=r.ch)return t;var c=s+ +(l.from==r.ch!=(1!=l.level));if(0==c||c==a.length)return t;if(i.line!=r.line)n=(i.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=getBidiPartAt(a,i.ch,i.sticky),d=u-s||(i.ch-r.ch)*(1==l.level?-1:1);n=u==c-1||u==c?d<0:d>0}var h=a[c+(n?-1:0)],f=n==(1==h.level),g=f?h.from:h.to,m=f?"after":"before";return r.ch==g&&r.sticky==m?t:new Range(new Pos(r.line,g,m),i)}function gutterEvent(e,t,n,r){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&&e_preventDefault(t);var i,o,a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!hasHandler(e,n))return e_defaultPrevented(t);o-=s.top-a.viewOffset;for(var l=0;l=i){var u=lineAtHeight(e.doc,o),d=e.display.gutterSpecs[l];return signal(e,n,e,u,d.className,t),e_defaultPrevented(t)}}}function clickInGutter(e,t){return gutterEvent(e,t,"gutterClick",!0)}function onContextMenu(e,t){eventInWidget(e.display,t)||contextMenuInGutter(e,t)||!signalDOMEvent(e,t,"contextmenu")&&(N||e.display.input.onContextMenu(t))}function contextMenuInGutter(e,t){return!!hasHandler(e,"gutterContextMenu")&&gutterEvent(e,t,"gutterContextMenu",!1)}function themeChanged(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),clearCaches(e)}PastClick.prototype.compare=function(e,t,n){return this.time+400>e&&0==cmp(t,this.pos)&&n==this.button};var eb={toString:function(){return"CodeMirror.Init"}},ex={},eC={};function defineOptions(e){var t=e.optionHandlers;function option(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=eb&&i(e,t,n)}:i)}e.defineOption=option,e.Init=eb,option("value","",function(e,t){return e.setValue(t)},!0),option("mode",null,function(e,t){e.doc.modeOption=t,loadMode(e)},!0),option("indentUnit",2,loadMode,!0),option("indentWithTabs",!1),option("smartIndent",!0),option("tabSize",4,function(e){resetModeState(e),clearCaches(e),regChange(e)},!0),option("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(Pos(r,o))}r++});for(var i=n.length-1;i>=0;i--)replaceRange(e.doc,t,n[i],Pos(n[i].line,n[i].ch+t.length))}}),option("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(e,t,n){e.state.specialChars=RegExp(t.source+(t.test(" ")?"":"| "),"g"),n!=eb&&e.refresh()}),option("specialCharPlaceholder",defaultSpecialCharPlaceholder,function(e){return e.refresh()},!0),option("electricChars",!0),option("inputStyle",L?"contenteditable":"textarea",function(){throw Error("inputStyle can not (yet) be changed in a running editor")},!0),option("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),option("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),option("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),option("rtlMoveVisually",!P),option("wholeLineUpdateBefore",!0),option("theme","default",function(e){themeChanged(e),updateGutters(e)},!0),option("keyMap","default",function(e,t,n){var r=getKeyMap(t),i=n!=eb&&getKeyMap(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),option("extraKeys",null),option("configureMouse",null),option("lineWrapping",!1,wrappingChanged,!0),option("gutters",[],function(e,t){e.display.gutterSpecs=getGutters(t,e.options.lineNumbers),updateGutters(e)},!0),option("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?compensateForHScroll(e.display)+"px":"0",e.refresh()},!0),option("coverGutterNextToScrollbar",!1,function(e){return updateScrollbars(e)},!0),option("scrollbarStyle","native",function(e){initScrollbars(e),updateScrollbars(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),option("lineNumbers",!1,function(e,t){e.display.gutterSpecs=getGutters(e.options.gutters,t),updateGutters(e)},!0),option("firstLineNumber",1,updateGutters,!0),option("lineNumberFormatter",function(e){return e},updateGutters,!0),option("showCursorWhenSelecting",!1,updateSelection,!0),option("resetSelectionOnContextMenu",!0),option("lineWiseCopyCut",!0),option("pasteLinesPerSelection",!0),option("selectionsMayTouch",!1),option("readOnly",!1,function(e,t){"nocursor"==t&&(onBlur(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),option("screenReaderLabel",null,function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)}),option("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),option("dragDrop",!0,dragDropChanged),option("allowDropFileTypes",null),option("cursorBlinkRate",530),option("cursorScrollMargin",0),option("cursorHeight",1,updateSelection,!0),option("singleCursorHeightPerLine",!0,updateSelection,!0),option("workTime",100),option("workDelay",100),option("flattenSpans",!0,resetModeState,!0),option("addModeClass",!1,resetModeState,!0),option("pollInterval",100),option("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),option("historyEventDelay",1250),option("viewportMargin",10,function(e){return e.refresh()},!0),option("maxHighlightLength",1e4,resetModeState,!0),option("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),option("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),option("autofocus",null),option("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),option("phrases",null)}function dragDropChanged(e,t,n){if(!t!=!(n&&n!=eb)){var r=e.display.dragFunctions,i=t?on:off;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function wrappingChanged(e){e.options.lineWrapping?(addClass(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(rmClass(e.display.wrapper,"CodeMirror-wrap"),findMaxLine(e)),estimateLineHeights(e),regChange(e),clearCaches(e),setTimeout(function(){return updateScrollbars(e)},100)}function CodeMirror(e,t){var n=this;if(!(this instanceof CodeMirror))return new CodeMirror(e,t);this.options=t=t?copyObj(t):{},copyObj(ex,t,!1);var r=t.value;"string"==typeof r?r=new Doc(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new CodeMirror.inputStyles[t.inputStyle](this),o=this.display=new Display(e,r,i,t);for(var a in o.wrapper.CodeMirror=this,themeChanged(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),initScrollbars(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 Delayed,keySeq:null,specialChars:null},t.autofocus&&!L&&o.input.focus(),f&&g<11&&setTimeout(function(){return n.display.input.reset(!0)},20),registerEventHandlers(this),ensureGlobalHandlers(),startOperation(this),this.curOp.forceUpdate=!0,attachDoc(this,r),t.autofocus&&!L||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&onFocus(n)},20):onBlur(this),eC)eC.hasOwnProperty(a)&&eC[a](this,t[a],eb);maybeUpdateLineNumberWidth(this),t.finishInit&&t.finishInit(this);for(var s=0;s400}on(t.scroller,"touchstart",function(i){if(!signalDOMEvent(e,i)&&!isMouseLikeTouchEvent(i)&&!clickInGutter(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),on(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),on(t.scroller,"touchend",function(n){var r=t.activeTouch;if(r&&!eventInWidget(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var i,o=e.coordsChar(t.activeTouch,"page");i=!r.prev||farAway(r,r.prev)?new Range(o,o):!r.prev.prev||farAway(r,r.prev.prev)?e.findWordAt(o):new Range(Pos(o.line,0),clipPos(e.doc,Pos(o.line+1,0))),e.setSelection(i.anchor,i.head),e.focus(),e_preventDefault(n)}finishTouch()}),on(t.scroller,"touchcancel",finishTouch),on(t.scroller,"scroll",function(){t.scroller.clientHeight&&(updateScrollTop(e,t.scroller.scrollTop),setScrollLeft(e,t.scroller.scrollLeft,!0),signal(e,"scroll",e))}),on(t.scroller,"mousewheel",function(t){return onScrollWheel(e,t)}),on(t.scroller,"DOMMouseScroll",function(t){return onScrollWheel(e,t)}),on(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){signalDOMEvent(e,t)||e_stop(t)},over:function(t){signalDOMEvent(e,t)||(onDragOver(e,t),e_stop(t))},start:function(t){return onDragStart(e,t)},drop:operation(e,onDrop),leave:function(t){signalDOMEvent(e,t)||clearDragCursor(e)}};var i=t.input.getField();on(i,"keyup",function(t){return onKeyUp.call(e,t)}),on(i,"keydown",operation(e,onKeyDown)),on(i,"keypress",operation(e,onKeyPress)),on(i,"focus",function(t){return onFocus(e,t)}),on(i,"blur",function(t){return onBlur(e,t)})}CodeMirror.defaults=ex,CodeMirror.optionHandlers=eC;var ew=[];function indentLine(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=getContextBefore(e,t).state:n="prev");var a=e.options.tabSize,s=getLine(o,t),l=countColumn(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==D||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?countColumn(getLine(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",h=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/a);f;--f)h+=a,d+=" ";if(ha,l=_(t),c=null;if(s&&r.ranges.length>1)if(ek&&ek.text.join(` `)==t){if(r.ranges.length%ek.text.length==0){c=[];for(var u=0;u=0;h--){var f=r.ranges[h],g=f.from(),m=f.to();f.empty()&&(n&&n>0?g=Pos(g.line,g.ch-n):e.state.overwrite&&!s?m=Pos(m.line,Math.min(getLine(o,m.line).text.length,m.ch+lst(l).length)):s&&ek&&ek.lineWise&&ek.text.join(` `)==l.join(` `)&&(g=m=Pos(g.line,0)));var v={from:g,to:m,text:c?c[h%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};makeChange(e.doc,v),signalLater(e,"inputRead",e,v)}t&&!s&&triggerElectric(e,t),ensureCursorVisible(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function handlePaste(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||runInOp(t,function(){return applyTextInput(t,n,0,null,"paste")}),!0}function triggerElectric(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 s=0;s-1){a=indentLine(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(getLine(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=indentLine(e,i.head.line,"smart"));a&&signalLater(e,"electricInput",e,i.head.line)}}}function copyableRanges(e){for(var t=[],n=[],r=0;rn&&(indentLine(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&ensureCursorVisible(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-!a.ch)+1;for(var l=s;l0&&replaceOneSelection(this.doc,r,new Range(o,c[r].to()),I)}}}),getTokenAt:function(e,t){return takeToken(this,e,t)},getLineTokens:function(e,t){return takeToken(this,Pos(e),t,!0)},getTokenTypeAt:function(e){e=clipPos(this.doc,e);var t,n=getLineStyles(this,getLine(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else if(n[2*a+1]o&&(e=o,i=!0),r=getLine(this.doc,e)}else r=e;return intoCoordSystem(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-heightAtLine(r):0)},defaultTextHeight:function(){return textHeight(this.display)},defaultCharWidth:function(){return charWidth(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,a=(e=cursorCoords(this,clipPos(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&scrollIntoView(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:methodOp(onKeyDown),triggerOnKeyPress:methodOp(onKeyPress),triggerOnKeyUp:onKeyUp,triggerOnMouseDown:methodOp(onMouseDown),execCommand:function(e){if(em.hasOwnProperty(e))return em[e].call(null,this)},triggerElectric:methodOp(function(e){triggerElectric(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=clipPos(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&estimateLineHeights(this),signal(this,"refresh",this)}),swapDoc:methodOp(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),attachDoc(this,e),clearCaches(this),this.display.input.reset(),scrollToCoords(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,signalLater(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},eventMixin(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function findPosH(e,t,n,r,i){var o=t,a=n,s=getLine(e,t.line),l=i&&"rtl"==e.direction?-n:n;function findNextLine(){var n=t.line+l;return!(n=e.first+e.size)&&(t=new Pos(n,t.ch,t.sticky),s=getLine(e,n))}function moveOnce(o){var a;if("codepoint"==r){var c=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(c))a=null;else{var u=n>0?c>=55296&&c<56320:c>=56320&&c<57343;a=new Pos(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(u?2:1))),-n)}}else a=i?moveVisually(e.cm,s,t,n):moveLogically(s,t,n);if(null==a)if(!(!o&&findNextLine()))return!1;else t=endOfLine(i,e.cm,s,t.line,l);else t=a;return!0}if("char"==r||"codepoint"==r)moveOnce();else if("column"==r)moveOnce(!0);else if("word"==r||"group"==r)for(var c=null,u="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(n<0)||moveOnce(!h);h=!1){var f=s.text.charAt(t.ch)||` `,g=isWordChar(f,d)?"w":u&&` `==f?"n":!u||/\s/.test(f)?null:"p";if(!u||h||g||(g="s"),c&&c!=g){n<0&&(n=1,moveOnce(),t.sticky="after");break}if(g&&(c=g),n>0&&!moveOnce(!h))break}var m=skipAtomic(e,t,o,a,!0);return equalCursorPos(o,m)&&(m.hitSide=!0),m}function findPosV(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.max(Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight)-.5*textHeight(e.display),3);o=(n>0?t.bottom:t.top)+n*l}else"line"==r&&(o=n>0?t.bottom+3:t.top-3);for(;(i=coordsChar(e,s,o)).outside;){if(n<0?o<=0:o>=a.height){i.hitSide=!0;break}o+=5*n}return i}var ContentEditableInput=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Delayed,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function posToDOM(e,t){var n=findViewForLine(e,t.line);if(!n||n.hidden)return null;var r=getLine(e.doc,t.line),i=mapFromLineView(n,r,t.line),o=getOrder(r,e.doc.direction),a="left";o&&(a=getBidiPartAt(o,t.ch)%2?"right":"left");var s=nodeAndOffsetInLineMap(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function isInGutter(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function badPos(e,t){return t&&(e.bad=!0),e}function domTextBetween(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function recognizeMarker(e){return function(t){return t.id==e}}function close(){a&&(o+=s,l&&(o+=s),a=l=!1)}function addText(e){e&&(close(),o+=e)}function walk(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void addText(n);var o,c=t.getAttribute("cm-marker");if(c){var u=e.findMarks(Pos(r,0),Pos(i+1,0),recognizeMarker(+c));u.length&&(o=u[0].find(0))&&addText(getBetween(e.doc,o.from,o.to).join(s));return}if("false"!=t.getAttribute("contenteditable")){var d=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(/^br$/i.test(t.nodeName)||0!=t.textContent.length){d&&close();for(var h=0;h=n.display.viewTo||o.line=n.display.viewFrom&&posToDOM(n,i)||{node:l[0].measure.map[2],offset:0},d=o.lineo.firstLine()&&(l=Pos(l.line-1,getLine(o.doc,l.line-1).length)),c.ch==getLine(o.doc,c.line).text.length&&c.linea.viewTo-1)return!1;l.line==a.viewFrom||0==(e=findViewIndex(o,l.line))?(t=lineNo(a.view[0].line),n=a.view[0].node):(t=lineNo(a.view[e].line),n=a.view[e-1].node.nextSibling);var u=findViewIndex(o,c.line);if(u==a.view.length-1?(r=a.viewTo-1,i=a.lineDiv.lastChild):(r=lineNo(a.view[u+1].line)-1,i=a.view[u+1].node.previousSibling),!n)return!1;for(var d=o.doc.splitLines(domTextBetween(o,n,i,t,r)),h=getBetween(o.doc,Pos(t,0),Pos(r,getLine(o.doc,r).text.length));d.length>1&&h.length>1;)if(lst(d)==lst(h))d.pop(),h.pop(),r--;else if(d[0]==h[0])d.shift(),h.shift(),t++;else break;for(var f=0,g=0,m=d[0],v=h[0],y=Math.min(m.length,v.length);fl.ch&&b.charCodeAt(b.length-g-1)==x.charCodeAt(x.length-g-1);)f--,g++;d[d.length-1]=b.slice(0,b.length-g).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var w=Pos(t,f),k=Pos(r,h.length?lst(h).length-g:0);if(d.length>1||d[0]||cmp(w,k))return replaceRange(o.doc,d,w,k,"+input"),!0},ContentEditableInput.prototype.ensurePolled=function(){this.forceCompositionEnd()},ContentEditableInput.prototype.reset=function(){this.forceCompositionEnd()},ContentEditableInput.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ContentEditableInput.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(!e.composing.done)return;else e.composing=null;e.updateFromDOM()},80))},ContentEditableInput.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&runInOp(this.cm,function(){return regChange(e.cm)})},ContentEditableInput.prototype.setUneditable=function(e){e.contentEditable="false"},ContentEditableInput.prototype.onKeyPress=function(e){0!=e.charCode&&!this.composing&&(e.preventDefault(),this.cm.isReadOnly()||operation(this.cm,applyTextInput)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},ContentEditableInput.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},ContentEditableInput.prototype.onContextMenu=function(){},ContentEditableInput.prototype.resetPosition=function(){},ContentEditableInput.prototype.needsContentAttribute=!0;var TextareaInput=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Delayed,this.hasSelection=!1,this.composing=null};function fromTextArea(e,t){if((t=t?copyObj(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n,r=activeElt();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function save(){e.value=a.getValue()}if(e.form&&(on(e.form,"submit",save),!t.leaveSubmitMethodAlone)){var i=e.form;n=i.submit;try{var o=i.submit=function(){save(),i.submit=n,i.submit(),i.submit=o}}catch{}}t.finishInit=function(r){r.save=save,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,save(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(off(e.form,"submit",save),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=n))}},e.style.display="none";var a=CodeMirror(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return a}function addLegacyProps(e){e.off=off,e.on=on,e.wheelEventPixels=wheelEventPixels,e.Doc=Doc,e.splitLines=_,e.countColumn=countColumn,e.findColumn=findColumn,e.isWordChar=isWordCharBasic,e.Pass=D,e.signal=signal,e.Line=Line,e.changeEnd=changeEnd,e.scrollbarModel=er,e.Pos=Pos,e.cmpPos=cmp,e.modes=q,e.mimeModes=$,e.resolveMode=resolveMode,e.getMode=getMode,e.modeExtensions=X,e.extendMode=extendMode,e.copyState=copyState,e.startState=startState,e.innerMode=innerMode,e.commands=em,e.keyMap=eg,e.keyName=keyName,e.isModifierKey=isModifierKey,e.lookupKey=lookupKey,e.normalizeKeyMap=normalizeKeyMap,e.StringStream=StringStream,e.SharedTextMarker=SharedTextMarker,e.TextMarker=TextMarker,e.LineWidget=LineWidget,e.e_preventDefault=e_preventDefault,e.e_stopPropagation=e_stopPropagation,e.e_stop=e_stop,e.addClass=addClass,e.contains=contains,e.rmClass=rmClass,e.keyNames=ed}TextareaInput.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function prepareCopyCut(e){if(!signalDOMEvent(r,e)){if(r.somethingSelected())ek={lineWise:!1,text:r.getSelections()};else{if(!r.options.lineWiseCopyCut)return;var t=copyableRanges(r);ek={lineWise:!0,text:t.text},"cut"==e.type?r.setSelections(t.ranges,null,I):(n.prevInput="",i.value=t.text.join(` `),selectInput(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),k&&(i.style.width="0px"),on(i,"input",function(){f&&g>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),on(i,"paste",function(e){signalDOMEvent(r,e)||handlePaste(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())}),on(i,"cut",prepareCopyCut),on(i,"copy",prepareCopyCut),on(e.scroller,"paste",function(t){if(!(eventInWidget(e,t)||signalDOMEvent(r,t))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}}),on(e.lineSpace,"selectstart",function(t){eventInWidget(e,t)||e_preventDefault(t)}),on(i,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),on(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},TextareaInput.prototype.createField=function(e){this.wrapper=hiddenTextarea(),this.textarea=this.wrapper.firstChild},TextareaInput.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},TextareaInput.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=prepareSelection(e);if(e.options.moveInputWithCursor){var i=cursorCoords(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},TextareaInput.prototype.showSelection=function(e){var t=this.cm.display;removeChildrenAndAdd(t.cursorDiv,e.cursors),removeChildrenAndAdd(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},TextareaInput.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&selectInput(this.textarea),f&&g>=9&&(this.hasSelection=n)}else!e&&(this.prevInput=this.textarea.value="",f&&g>=9&&(this.hasSelection=null))}},TextareaInput.prototype.getField=function(){return this.textarea},TextareaInput.prototype.supportsTouch=function(){return!1},TextareaInput.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!L||activeElt()!=this.textarea))try{this.textarea.focus()}catch{}},TextareaInput.prototype.blur=function(){this.textarea.blur()},TextareaInput.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},TextareaInput.prototype.receivedFocus=function(){this.slowPoll()},TextareaInput.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},TextareaInput.prototype.fastPoll=function(){var e=!1,t=this;function p(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,p))}t.pollingFast=!0,t.polling.set(20,p)},TextareaInput.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||U(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(f&&g>=9&&this.hasSelection===i||M&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="\u200B"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,s=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},TextareaInput.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},TextareaInput.prototype.onKeyPress=function(){f&&g>=9&&(this.hasSelection=null),this.fastPoll()},TextareaInput.prototype.onContextMenu=function(e){var t,n=this,r=n.cm,i=r.display,o=n.textarea;n.contextMenuPending&&n.contextMenuPending();var a=posFromMouse(r,e),s=i.scroller.scrollTop;if(a&&!b){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(a)&&operation(r,setSelection)(r.doc,simpleSelection(a),I);var l=o.style.cssText,c=n.wrapper.style.cssText,u=n.wrapper.offsetParent.getBoundingClientRect();if(n.wrapper.style.cssText="position: static",o.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-u.top-5)+"px; left: "+(e.clientX-u.left-5)+`px; z-index: 1000; background: `+(f?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`,m&&(t=window.scrollY),i.input.focus(),m&&window.scrollTo(null,t),i.input.reset(),r.somethingSelected()||(o.value=n.prevInput=" "),n.contextMenuPending=rehide,i.selForContextMenu=r.doc.sel,clearTimeout(i.detectingSelectAll),f&&g>=9&&prepareSelectAllHack(),N){e_stop(e);var mouseup=function(){off(window,"mouseup",mouseup),setTimeout(rehide,20)};on(window,"mouseup",mouseup)}else setTimeout(rehide,50)}function prepareSelectAllHack(){if(null!=o.selectionStart){var e=r.somethingSelected(),t="\u200B"+(e?o.value:"");o.value="\u21DA",o.value=t,n.prevInput=e?"":"\u200B",o.selectionStart=1,o.selectionEnd=t.length,i.selForContextMenu=r.doc.sel}}function rehide(){if(n.contextMenuPending==rehide&&(n.contextMenuPending=!1,n.wrapper.style.cssText=c,o.style.cssText=l,f&&g<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=s),null!=o.selectionStart)){(!f||f&&g<9)&&prepareSelectAllHack();var e=0,poll=function(){i.selForContextMenu==r.doc.sel&&0==o.selectionStart&&o.selectionEnd>0&&"\u200B"==n.prevInput?operation(r,selectAll)(r):e++<10?i.detectingSelectAll=setTimeout(poll,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(poll,200)}}},TextareaInput.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},TextareaInput.prototype.setUneditable=function(){},TextareaInput.prototype.needsContentAttribute=!1,defineOptions(CodeMirror),addEditorMethods(CodeMirror);var eS="iter insert remove copy getEditor constructor".split(" ");for(var eL in Doc.prototype)Doc.prototype.hasOwnProperty(eL)&&0>indexOf(eS,eL)&&(CodeMirror.prototype[eL]=function(e){return function(){return e.apply(this.doc,arguments)}}(Doc.prototype[eL]));return eventMixin(Doc),CodeMirror.inputStyles={textarea:TextareaInput,contenteditable:ContentEditableInput},CodeMirror.defineMode=function(e){CodeMirror.defaults.mode||"null"==e||(CodeMirror.defaults.mode=e),defineMode.apply(this,arguments)},CodeMirror.defineMIME=defineMIME,CodeMirror.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),CodeMirror.defineMIME("text/plain","null"),CodeMirror.defineExtension=function(e,t){CodeMirror.prototype[e]=t},CodeMirror.defineDocExtension=function(e,t){Doc.prototype[e]=t},CodeMirror.fromTextArea=fromTextArea,addLegacyProps(CodeMirror),CodeMirror.version="5.60.0",CodeMirror}()},0x250452a69:(e,t,n)=>{!function(e){"use strict";function keySet(e){for(var t={},n=0;n*\/]/.test(n))return r="select-op",null;else if("."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i))return r="qualifier","qualifier";else if(/[:;{}\[\]\(\)]/.test(n))return r=n,null;else if(e.match(/^[\w-.]+(?=\()/))return/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=tokenParenthesized),r="variable","variable callee";else if(/[\w\\\-]/.test(n))return e.eatWhile(/[\w\\\-]/),r="word","property";else return r=null,null}function tokenString(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return i!=e&&(o||")"==e)||(n.tokenize=null),r="string","string"}}function tokenParenthesized(e,t){return e.next(),e.match(/^\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=tokenString(")"),r="(",null}function Context(e,t,n){this.type=e,this.indent=t,this.prev=n}function pushContext(e,t,n,r){return e.context=new Context(n,t.indentation()+(!1===r?0:a),e.context),n}function popContext(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function pass(e,t,n){return k[n.context.type](e,t,n)}function popAndPass(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return pass(e,t,n)}function wordAsValue(e){var t=e.current().toLowerCase();i=y.hasOwnProperty(t)?"atom":v.hasOwnProperty(t)?"keyword":"variable"}var k={};return k.top=function(e,t,n){if("{"==e)return pushContext(n,t,"block");if("}"==e&&n.context.prev)return popContext(n);if(C&&/@component/i.test(e))return pushContext(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return pushContext(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return pushContext(n,t,"atBlock");else if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";else if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";else if(e&&"@"==e.charAt(0))return pushContext(n,t,"at");else if("hash"==e)i="builtin";else if("word"==e)i="tag";else if("variable-definition"==e)return"maybeprop";else if("interpolation"==e)return pushContext(n,t,"interpolation");else if(":"==e)return"pseudo";else if(b&&"("==e)return pushContext(n,t,"parens");return n.context.type},k.block=function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return h.hasOwnProperty(r)?(i="property","maybeprop"):f.hasOwnProperty(r)?(i=w?"string-2":"property","maybeprop"):b?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")}return"meta"==e?"block":b||"hash"!=e&&"qualifier"!=e?k.top(e,t,n):(i="error","block")},k.maybeprop=function(e,t,n){return":"==e?pushContext(n,t,"prop"):pass(e,t,n)},k.prop=function(e,t,n){if(";"==e)return popContext(n);if("{"==e&&b)return pushContext(n,t,"propBlock");if("}"==e||"{"==e)return popAndPass(e,t,n);if("("==e)return pushContext(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)wordAsValue(t);else if("interpolation"==e)return pushContext(n,t,"interpolation")}else i+=" error";return"prop"},k.propBlock=function(e,t,n){return"}"==e?popContext(n):"word"==e?(i="property","maybeprop"):n.context.type},k.parens=function(e,t,n){return"{"==e||"}"==e?popAndPass(e,t,n):")"==e?popContext(n):"("==e?pushContext(n,t,"parens"):"interpolation"==e?pushContext(n,t,"interpolation"):("word"==e&&wordAsValue(t),"parens")},k.pseudo=function(e,t,n){return"meta"==e?"pseudo":"word"==e?(i="variable-3",n.context.type):pass(e,t,n)},k.documentTypes=function(e,t,n){return"word"==e&&l.hasOwnProperty(t.current())?(i="tag",n.context.type):k.atBlock(e,t,n)},k.atBlock=function(e,t,n){if("("==e)return pushContext(n,t,"atBlock_parens");if("}"==e||";"==e)return popAndPass(e,t,n);if("{"==e)return popContext(n)&&pushContext(n,t,b?"block":"top");if("interpolation"==e)return pushContext(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();i="only"==r||"not"==r||"and"==r||"or"==r?"keyword":c.hasOwnProperty(r)?"attribute":u.hasOwnProperty(r)?"property":d.hasOwnProperty(r)?"keyword":h.hasOwnProperty(r)?"property":f.hasOwnProperty(r)?w?"string-2":"property":y.hasOwnProperty(r)?"atom":v.hasOwnProperty(r)?"keyword":"error"}return n.context.type},k.atComponentBlock=function(e,t,n){return"}"==e?popAndPass(e,t,n):"{"==e?popContext(n)&&pushContext(n,t,b?"block":"top",!1):("word"==e&&(i="error"),n.context.type)},k.atBlock_parens=function(e,t,n){return")"==e?popContext(n):"{"==e||"}"==e?popAndPass(e,t,n,2):k.atBlock(e,t,n)},k.restricted_atBlock_before=function(e,t,n){return"{"==e?pushContext(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(i="variable","restricted_atBlock_before"):pass(e,t,n)},k.restricted_atBlock=function(e,t,n){return"}"==e?(n.stateArg=null,popContext(n)):"word"==e?(i=("@font-face"!=n.stateArg||g.hasOwnProperty(t.current().toLowerCase()))&&("@counter-style"!=n.stateArg||m.hasOwnProperty(t.current().toLowerCase()))?"property":"error","maybeprop"):"restricted_atBlock"},k.keyframes=function(e,t,n){return"word"==e?(i="variable","keyframes"):"{"==e?pushContext(n,t,"top"):pass(e,t,n)},k.at=function(e,t,n){return";"==e?popContext(n):"{"==e||"}"==e?popAndPass(e,t,n):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},k.interpolation=function(e,t,n){return"}"==e?popContext(n):"{"==e||";"==e?popAndPass(e,t,n):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:o?"block":"top",stateArg:null,context:new Context(o?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||tokenBase)(e,t);return n&&"object"==typeof n&&(r=n[1],n=n[0]),i=n,"comment"!=r&&(t.state=k[t.state](r,e,t)),i},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"==n.type&&("}"==r||")"==r)&&(n=n.prev),n.prev&&("}"==r&&("block"==n.type||"top"==n.type||"interpolation"==n.type||"restricted_atBlock"==n.type)?i=(n=n.prev).indent:(")"==r&&("parens"==n.type||"atBlock_parens"==n.type)||"{"==r&&("at"==n.type||"atBlock"==n.type))&&(i=Math.max(0,n.indent-a))),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:x,fold:"brace"}});var t=["domain","regexp","url","url-prefix"],n=keySet(t),r=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=keySet(r),o=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme"],a=keySet(o),s=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light"],l=keySet(s),c=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],u=keySet(c),d=["border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],h=keySet(d),f=keySet(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=keySet(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),m=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],v=keySet(m),y=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],b=keySet(y),x=t.concat(r).concat(o).concat(s).concat(c).concat(d).concat(m).concat(y);function tokenCComment(e,t){for(var n,r=!1;null!=(n=e.next());){if(r&&"/"==n){t.tokenize=null;break}r="*"==n}return["comment","comment"]}e.registerHelper("hintWords","css",x),e.defineMIME("text/css",{documentTypes:n,mediaTypes:i,mediaFeatures:a,mediaValueKeywords:l,propertyKeywords:u,nonStandardPropertyKeywords:h,fontProperties:f,counterDescriptors:g,colorKeywords:v,valueKeywords:b,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=tokenCComment,tokenCComment(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:l,propertyKeywords:u,nonStandardPropertyKeywords:h,colorKeywords:v,valueKeywords:b,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=tokenCComment,tokenCComment(e,t)):["operator","operator"]},":":function(e){return!!e.match(/^\s*\{/,!1)&&[null,null]},$:function(e){return(e.match(/^[\w-]+/),e.match(/^\s*:/,!1))?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:a,mediaValueKeywords:l,propertyKeywords:u,nonStandardPropertyKeywords:h,colorKeywords:v,valueKeywords:b,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=tokenCComment,tokenCComment(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&((e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1))?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:n,mediaTypes:i,mediaFeatures:a,propertyKeywords:u,nonStandardPropertyKeywords:h,fontProperties:f,counterDescriptors:g,colorKeywords:v,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=tokenCComment,tokenCComment(e,t))}},name:"css",helperType:"gss"})}(n(0x2a32d92c))},0x240ea8221:(e,t,n)=>{!function(e){"use strict";var t={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function maybeBackup(e,t,n){var r=e.current(),i=r.search(t);return i>-1?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}var n={};function getAttrRegexp(e){var t=n[e];return t||(n[e]=RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function getAttrValue(e,t){var n=e.match(getAttrRegexp(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function getTagRegexp(e,t){return RegExp((t?"^":"")+"","i")}function addTags(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),i=e[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}function findMatchingMode(e,t){for(var n=0;n=0;l--)o.script.unshift(["type",s[l].matches,s[l].mode]);function html(t,r){var a,s=i.token(t,r.htmlState),l=/\btag\b/.test(s);if(l&&!/[<>\s\/]/.test(t.current())&&(a=r.htmlState.tagName&&r.htmlState.tagName.toLowerCase())&&o.hasOwnProperty(a))r.inTag=a+" ";else if(r.inTag&&l&&/>$/.test(t.current())){var c=/^([\S]+) (.*)/.exec(r.inTag);r.inTag=null;var u=">"==t.current()&&findMatchingMode(o[c[1]],c[2]),d=e.getMode(n,u),h=getTagRegexp(c[1],!0),f=getTagRegexp(c[1],!1);r.token=function(e,t){return e.match(h,!1)?(t.token=html,t.localState=t.localMode=null,null):maybeBackup(e,f,t.localMode.token(e,t.localState))},r.localMode=d,r.localState=e.startState(d,i.indent(r.htmlState,"",""))}else r.inTag&&(r.inTag+=t.current(),t.eol()&&(r.inTag+=" "));return s}return{startState:function(){return{token:html,inTag:null,localMode:null,localState:null,htmlState:e.startState(i)}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(i,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n,r){return!t.localMode||/^\s*<\//.test(n)?i.indent(t.htmlState,n,r):t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||i}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}(n(0x2a32d92c),n(0x1f5edeb9),n(0xe2d31e91),n(0x250452a69))},0xe2d31e91:(e,t,n)=>{!function(e){"use strict";e.defineMode("javascript",function(t,n){var r,i,o=t.indentUnit,a=n.statementIndent,s=n.jsonld,l=n.json||s,c=n.typescript,u=n.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function kw(e){return{type:e,style:"keyword"}}var e=kw("keyword a"),t=kw("keyword b"),n=kw("keyword c"),r=kw("keyword d"),i=kw("operator"),o={type:"atom",style:"atom"};return{if:kw("if"),while:e,with:e,else:t,do:t,try:t,finally:t,return:r,break:r,continue:r,new:kw("new"),delete:n,void:n,throw:n,debugger:kw("debugger"),var:kw("var"),const:kw("var"),let:kw("var"),function:kw("function"),catch:kw("catch"),for:kw("for"),switch:kw("switch"),case:kw("case"),default:kw("default"),in:i,typeof:i,instanceof:i,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:kw("this"),class:kw("class"),super:kw("atom"),yield:n,export:kw("export"),import:kw("import"),extends:n,await:n}}(),h=/[+\-*&%=<>!?|~^@]/,f=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function readRegexp(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function ret(e,t,n){return r=e,i=n,t}function tokenBase(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=tokenString(n),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return ret("number","number");if("."==n&&e.match(".."))return ret("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return ret(n);if("="==n&&e.eat(">"))return ret("=>","operator");else if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return ret("number","number");else if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),ret("number","number");else if("/"==n)if(e.eat("*"))return t.tokenize=tokenComment,tokenComment(e,t);else if(e.eat("/"))return e.skipToEnd(),ret("comment","comment");else if(expressionAllowed(e,t,1))return readRegexp(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),ret("regexp","string-2");else return e.eat("="),ret("operator","operator",e.current());else if("`"==n)return t.tokenize=tokenQuasi,tokenQuasi(e,t);else if("#"==n&&"!"==e.peek())return e.skipToEnd(),ret("meta","meta");else if("#"==n&&e.eatWhile(u))return ret("variable","property");else if("<"==n&&e.match("!--")||"-"==n&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),ret("comment","comment");else if(h.test(n))return((">"!=n||!t.lexical||">"!=t.lexical.type)&&(e.eat("=")?("!"==n||"="==n)&&e.eat("="):/[<>*+\-|&?]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),"?"==n&&e.eat("."))?ret("."):ret("operator","operator",e.current());else if(u.test(n)){e.eatWhile(u);var r=e.current();if("."!=t.lastType){if(d.propertyIsEnumerable(r)){var i=d[r];return ret(i.type,i.style,r)}if("async"==r&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return ret("async","keyword",r)}return ret("variable","variable",r)}}function tokenString(e){return function(t,n){var r,i=!1;if(s&&"@"==t.peek()&&t.match(f))return n.tokenize=tokenBase,ret("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.tokenize=tokenBase),ret("string","string")}}function tokenComment(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=tokenBase;break}r="*"==n}return ret("comment","comment")}function tokenQuasi(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=tokenBase;break}r=!r&&"\\"==n}return ret("quasi","string-2",e.current())}function findFatArrow(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(c){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),l="([{}])".indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(u.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var g={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function JSLexical(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function inScope(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function parseJS(e,t,n,r,i){var o=e.cc;for(m.state=e,m.stream=i,m.marked=null,m.cc=o,m.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():l?expression:statement)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();if(m.marked)return m.marked;if("variable"==n&&inScope(e,r))return"variable-2";return t}}var m={state:null,column:null,marked:null,cc:null};function pass(){for(var e=arguments.length-1;e>=0;e--)m.cc.push(arguments[e])}function cont(){return pass.apply(null,arguments),!0}function inList(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function register(e){var t=m.state;if(m.marked="def",t.context){if("var"==t.lexical.info&&t.context&&t.context.block){var r=registerVarScoped(e,t.context);if(null!=r){t.context=r;return}}else if(!inList(e,t.localVars)){t.localVars=new Var(e,t.localVars);return}}n.globalVars&&!inList(e,t.globalVars)&&(t.globalVars=new Var(e,t.globalVars))}function registerVarScoped(e,t){if(!t)return null;if(t.block){var n=registerVarScoped(e,t.prev);return n?n==t.prev?t:new Context(n,t.vars,!0):null}return inList(e,t.vars)?t:new Context(t.prev,new Var(e,t.vars),!1)}function isModifier(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function Context(e,t,n){this.prev=e,this.vars=t,this.block=n}function Var(e,t){this.name=e,this.next=t}var v=new Var("this",new Var("arguments",null));function pushcontext(){m.state.context=new Context(m.state.context,m.state.localVars,!1),m.state.localVars=v}function pushblockcontext(){m.state.context=new Context(m.state.context,m.state.localVars,!0),m.state.localVars=null}function popcontext(){m.state.localVars=m.state.context.vars,m.state.context=m.state.context.prev}function pushlex(e,t){var result=function(){var n=m.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new JSLexical(r,m.stream.column(),e,null,n.lexical,t)};return result.lex=!0,result}function poplex(){var e=m.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function expect(e){function exp(t){return t==e?cont():";"==e||"}"==t||")"==t||"]"==t?pass():cont(exp)}return exp}function statement(e,t){if("var"==e)return cont(pushlex("vardef",t),vardef,expect(";"),poplex);if("keyword a"==e)return cont(pushlex("form"),parenExpr,statement,poplex);if("keyword b"==e)return cont(pushlex("form"),statement,poplex);if("keyword d"==e)return m.stream.match(/^\s*$/,!1)?cont():cont(pushlex("stat"),maybeexpression,expect(";"),poplex);if("debugger"==e)return cont(expect(";"));if("{"==e)return cont(pushlex("}"),pushblockcontext,block,poplex,popcontext);if(";"==e)return cont();if("if"==e)return"else"==m.state.lexical.info&&m.state.cc[m.state.cc.length-1]==poplex&&m.state.cc.pop()(),cont(pushlex("form"),parenExpr,statement,poplex,maybeelse);if("function"==e)return cont(functiondef);if("for"==e)return cont(pushlex("form"),forspec,statement,poplex);if("class"==e||c&&"interface"==t)return m.marked="keyword",cont(pushlex("form","class"==e?e:t),className,poplex);if("variable"==e)if(c&&"declare"==t)return m.marked="keyword",cont(statement);else if(c&&("module"==t||"enum"==t||"type"==t)&&m.stream.match(/^\s*\w/,!1))return(m.marked="keyword","enum"==t)?cont(enumdef):"type"==t?cont(typename,expect("operator"),typeexpr,expect(";")):cont(pushlex("form"),pattern,expect("{"),pushlex("}"),block,poplex,poplex);else if(c&&"namespace"==t)return m.marked="keyword",cont(pushlex("form"),expression,statement,poplex);else if(c&&"abstract"==t)return m.marked="keyword",cont(statement);else return cont(pushlex("stat"),maybelabel);return"switch"==e?cont(pushlex("form"),parenExpr,expect("{"),pushlex("}","switch"),pushblockcontext,block,poplex,poplex,popcontext):"case"==e?cont(expression,expect(":")):"default"==e?cont(expect(":")):"catch"==e?cont(pushlex("form"),pushcontext,maybeCatchBinding,statement,poplex,popcontext):"export"==e?cont(pushlex("stat"),afterExport,poplex):"import"==e?cont(pushlex("stat"),afterImport,poplex):"async"==e?cont(statement):"@"==t?cont(expression,statement):pass(pushlex("stat"),expression,expect(";"),poplex)}function maybeCatchBinding(e){if("("==e)return cont(funarg,expect(")"))}function expression(e,t){return expressionInner(e,t,!1)}function expressionNoComma(e,t){return expressionInner(e,t,!0)}function parenExpr(e){return"("!=e?pass():cont(pushlex(")"),maybeexpression,expect(")"),poplex)}function expressionInner(e,t,n){if(m.state.fatArrowAt==m.stream.start){var r=n?arrowBodyNoComma:arrowBody;if("("==e)return cont(pushcontext,pushlex(")"),commasep(funarg,")"),poplex,expect("=>"),r,popcontext);if("variable"==e)return pass(pushcontext,pattern,expect("=>"),r,popcontext)}var i=n?maybeoperatorNoComma:maybeoperatorComma;return g.hasOwnProperty(e)?cont(i):"function"==e?cont(functiondef,i):"class"==e||c&&"interface"==t?(m.marked="keyword",cont(pushlex("form"),classExpression,poplex)):"keyword c"==e||"async"==e?cont(n?expressionNoComma:expression):"("==e?cont(pushlex(")"),maybeexpression,expect(")"),poplex,i):"operator"==e||"spread"==e?cont(n?expressionNoComma:expression):"["==e?cont(pushlex("]"),arrayLiteral,poplex,i):"{"==e?contCommasep(objprop,"}",null,i):"quasi"==e?pass(quasi,i):"new"==e?cont(maybeTarget(n)):cont()}function maybeexpression(e){return e.match(/[;\}\)\],]/)?pass():pass(expression)}function maybeoperatorComma(e,t){return","==e?cont(maybeexpression):maybeoperatorNoComma(e,t,!1)}function maybeoperatorNoComma(e,t,n){var r=!1==n?maybeoperatorComma:maybeoperatorNoComma,i=!1==n?expression:expressionNoComma;if("=>"==e)return cont(pushcontext,n?arrowBodyNoComma:arrowBody,popcontext);if("operator"==e)return/\+\+|--/.test(t)||c&&"!"==t?cont(r):c&&"<"==t&&m.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?cont(pushlex(">"),commasep(typeexpr,">"),poplex,r):"?"==t?cont(expression,expect(":"),i):cont(i);if("quasi"==e)return pass(quasi,r);if(";"!=e){if("("==e)return contCommasep(expressionNoComma,")","call",r);if("."==e)return cont(property,r);if("["==e)return cont(pushlex("]"),maybeexpression,expect("]"),poplex,r);if(c&&"as"==t)return m.marked="keyword",cont(typeexpr,r);if("regexp"==e)return m.state.lastType=m.marked="operator",m.stream.backUp(m.stream.pos-m.stream.start-1),cont(i)}}function quasi(e,t){return"quasi"!=e?pass():"${"!=t.slice(t.length-2)?cont(quasi):cont(expression,continueQuasi)}function continueQuasi(e){if("}"==e)return m.marked="string-2",m.state.tokenize=tokenQuasi,cont(quasi)}function arrowBody(e){return findFatArrow(m.stream,m.state),pass("{"==e?statement:expression)}function arrowBodyNoComma(e){return findFatArrow(m.stream,m.state),pass("{"==e?statement:expressionNoComma)}function maybeTarget(e){return function(t){return"."==t?cont(e?targetNoComma:target):"variable"==t&&c?cont(maybeTypeArgs,e?maybeoperatorNoComma:maybeoperatorComma):pass(e?expressionNoComma:expression)}}function target(e,t){if("target"==t)return m.marked="keyword",cont(maybeoperatorComma)}function targetNoComma(e,t){if("target"==t)return m.marked="keyword",cont(maybeoperatorNoComma)}function maybelabel(e){return":"==e?cont(poplex,statement):pass(maybeoperatorComma,expect(";"),poplex)}function property(e){if("variable"==e)return m.marked="property",cont()}function objprop(e,t){if("async"==e)return m.marked="property",cont(objprop);if("variable"==e||"keyword"==m.style){var n;return(m.marked="property","get"==t||"set"==t)?cont(getterSetter):(c&&m.state.fatArrowAt==m.stream.start&&(n=m.stream.match(/^\s*:\s*/,!1))&&(m.state.fatArrowAt=m.stream.pos+n[0].length),cont(afterprop))}if("number"==e||"string"==e)return m.marked=s?"property":m.style+" property",cont(afterprop);if("jsonld-keyword"==e)return cont(afterprop);if(c&&isModifier(t))return m.marked="keyword",cont(objprop);else if("["==e)return cont(expression,maybetype,expect("]"),afterprop);else if("spread"==e)return cont(expressionNoComma,afterprop);else if("*"==t)return m.marked="keyword",cont(objprop);else if(":"==e)return pass(afterprop)}function getterSetter(e){return"variable"!=e?pass(afterprop):(m.marked="property",cont(functiondef))}function afterprop(e){return":"==e?cont(expressionNoComma):"("==e?pass(functiondef):void 0}function commasep(e,t,n){function proceed(r,i){if(n?n.indexOf(r)>-1:","==r){var o=m.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),cont(function(n,r){return n==t||r==t?pass():pass(e)},proceed)}return r==t||i==t?cont():n&&n.indexOf(";")>-1?pass(e):cont(expect(t))}return function(n,r){return n==t||r==t?cont():pass(e,proceed)}}function contCommasep(e,t,n){for(var r=3;r"),typeexpr):void 0}function maybeReturnType(e){if("=>"==e)return cont(typeexpr)}function typeprops(e){return e.match(/[\}\)\]]/)?cont():","==e||";"==e?cont(typeprops):pass(typeprop,typeprops)}function typeprop(e,t){if("variable"==e||"keyword"==m.style)return m.marked="property",cont(typeprop);if("?"==t||"number"==e||"string"==e)return cont(typeprop);if(":"==e)return cont(typeexpr);if("["==e)return cont(expect("variable"),maybetypeOrIn,expect("]"),typeprop);if("("==e)return pass(functiondecl,typeprop);else if(!e.match(/[;\}\)\],]/))return cont()}function typearg(e,t){return"variable"==e&&m.stream.match(/^\s*[?:]/,!1)||"?"==t?cont(typearg):":"==e?cont(typeexpr):"spread"==e?cont(typearg):pass(typeexpr)}function afterType(e,t){return"<"==t?cont(pushlex(">"),commasep(typeexpr,">"),poplex,afterType):"|"==t||"."==e||"&"==t?cont(typeexpr):"["==e?cont(typeexpr,expect("]"),afterType):"extends"==t||"implements"==t?(m.marked="keyword",cont(typeexpr)):"?"==t?cont(typeexpr,expect(":"),typeexpr):void 0}function maybeTypeArgs(e,t){if("<"==t)return cont(pushlex(">"),commasep(typeexpr,">"),poplex,afterType)}function typeparam(){return pass(typeexpr,maybeTypeDefault)}function maybeTypeDefault(e,t){if("="==t)return cont(typeexpr)}function vardef(e,t){return"enum"==t?(m.marked="keyword",cont(enumdef)):pass(pattern,maybetype,maybeAssign,vardefCont)}function pattern(e,t){return c&&isModifier(t)?(m.marked="keyword",cont(pattern)):"variable"==e?(register(t),cont()):"spread"==e?cont(pattern):"["==e?contCommasep(eltpattern,"]"):"{"==e?contCommasep(proppattern,"}"):void 0}function proppattern(e,t){return"variable"!=e||m.stream.match(/^\s*:/,!1)?("variable"==e&&(m.marked="property"),"spread"==e)?cont(pattern):"}"==e?pass():"["==e?cont(expression,expect("]"),expect(":"),proppattern):cont(expect(":"),pattern,maybeAssign):(register(t),cont(maybeAssign))}function eltpattern(){return pass(pattern,maybeAssign)}function maybeAssign(e,t){if("="==t)return cont(expressionNoComma)}function vardefCont(e){if(","==e)return cont(vardef)}function maybeelse(e,t){if("keyword b"==e&&"else"==t)return cont(pushlex("form","else"),statement,poplex)}function forspec(e,t){return"await"==t?cont(forspec):"("==e?cont(pushlex(")"),forspec1,poplex):void 0}function forspec1(e){return"var"==e?cont(vardef,forspec2):"variable"==e?cont(forspec2):pass(forspec2)}function forspec2(e,t){return")"==e?cont():";"==e?cont(forspec2):"in"==t||"of"==t?(m.marked="keyword",cont(expression,forspec2)):pass(expression,forspec2)}function functiondef(e,t){return"*"==t?(m.marked="keyword",cont(functiondef)):"variable"==e?(register(t),cont(functiondef)):"("==e?cont(pushcontext,pushlex(")"),commasep(funarg,")"),poplex,mayberettype,statement,popcontext):c&&"<"==t?cont(pushlex(">"),commasep(typeparam,">"),poplex,functiondef):void 0}function functiondecl(e,t){return"*"==t?(m.marked="keyword",cont(functiondecl)):"variable"==e?(register(t),cont(functiondecl)):"("==e?cont(pushcontext,pushlex(")"),commasep(funarg,")"),poplex,mayberettype,popcontext):c&&"<"==t?cont(pushlex(">"),commasep(typeparam,">"),poplex,functiondecl):void 0}function typename(e,t){return"keyword"==e||"variable"==e?(m.marked="type",cont(typename)):"<"==t?cont(pushlex(">"),commasep(typeparam,">"),poplex):void 0}function funarg(e,t){return("@"==t&&cont(expression,funarg),"spread"==e)?cont(funarg):c&&isModifier(t)?(m.marked="keyword",cont(funarg)):c&&"this"==e?cont(maybetype,maybeAssign):pass(pattern,maybetype,maybeAssign)}function classExpression(e,t){return"variable"==e?className(e,t):classNameAfter(e,t)}function className(e,t){if("variable"==e)return register(t),cont(classNameAfter)}function classNameAfter(e,t){return"<"==t?cont(pushlex(">"),commasep(typeparam,">"),poplex,classNameAfter):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(m.marked="keyword"),cont(c?typeexpr:expression,classNameAfter)):"{"==e?cont(pushlex("}"),classBody,poplex):void 0}function classBody(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&isModifier(t))&&m.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(m.marked="keyword",cont(classBody)):"variable"==e||"keyword"==m.style?(m.marked="property",cont(classfield,classBody)):"number"==e||"string"==e?cont(classfield,classBody):"["==e?cont(expression,maybetype,expect("]"),classfield,classBody):"*"==t?(m.marked="keyword",cont(classBody)):c&&"("==e?pass(functiondecl,classBody):";"==e||","==e?cont(classBody):"}"==e?cont():"@"==t?cont(expression,classBody):void 0}function classfield(e,t){if("?"==t)return cont(classfield);if(":"==e)return cont(typeexpr,maybeAssign);if("="==t)return cont(expressionNoComma);var n=m.state.lexical.prev;return pass(n&&"interface"==n.info?functiondecl:functiondef)}function afterExport(e,t){return"*"==t?(m.marked="keyword",cont(maybeFrom,expect(";"))):"default"==t?(m.marked="keyword",cont(expression,expect(";"))):"{"==e?cont(commasep(exportField,"}"),maybeFrom,expect(";")):pass(statement)}function exportField(e,t){return"as"==t?(m.marked="keyword",cont(expect("variable"))):"variable"==e?pass(expressionNoComma,exportField):void 0}function afterImport(e){return"string"==e?cont():"("==e?pass(expression):"."==e?pass(maybeoperatorComma):pass(importSpec,maybeMoreImports,maybeFrom)}function importSpec(e,t){return"{"==e?contCommasep(importSpec,"}"):("variable"==e&®ister(t),"*"==t&&(m.marked="keyword"),cont(maybeAs))}function maybeMoreImports(e){if(","==e)return cont(importSpec,maybeMoreImports)}function maybeAs(e,t){if("as"==t)return m.marked="keyword",cont(importSpec)}function maybeFrom(e,t){if("from"==t)return m.marked="keyword",cont(expression)}function arrayLiteral(e){return"]"==e?cont():pass(commasep(expressionNoComma,"]"))}function enumdef(){return pass(pushlex("form"),pattern,expect("{"),pushlex("}"),commasep(enummember,"}"),poplex,poplex)}function enummember(){return pass(pattern,maybeAssign)}function isContinuedStatement(e,t){return"operator"==e.lastType||","==e.lastType||h.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function expressionAllowed(e,t,n){return t.tokenize==tokenBase&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return popcontext.lex=!0,poplex.lex=!0,{startState:function(e){var t={tokenize:tokenBase,lastType:"sof",cc:[],lexical:new JSLexical((e||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new Context(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),findFatArrow(e,t)),t.tokenize!=tokenComment&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"==r&&("++"==i||"--"==i)?"incdec":r,parseJS(t,n,r,i,e))},indent:function(t,r){if(t.tokenize==tokenComment||t.tokenize==tokenQuasi)return e.Pass;if(t.tokenize!=tokenBase)return 0;var i,s=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==poplex)l=l.prev;else if(u!=maybeelse)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(i=t.cc[t.cc.length-1])&&(i==maybeoperatorComma||i==maybeoperatorNoComma)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,h=s==d;if("vardef"==d)return l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0);if("form"==d&&"{"==s)return l.indented;if("form"==d)return l.indented+o;if("stat"==d)return l.indented+(isContinuedStatement(t,r)?a||o:0);if("switch"==l.info&&!h&&!1!=n.doubleIndentSwitch)return l.indented+(/^(?:case|default)\b/.test(r)?o:2*o);else if(l.align)return l.column+ +!h;else return l.indented+(h?0:o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:expressionAllowed,skipExpression:function(e){var t=e.cc[e.cc.length-1];(t==expression||t==expressionNoComma)&&e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(0x2a32d92c))},0x1f5edeb9:(e,t,n)=>{!function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",function(r,i){var o,a,s=r.indentUnit,l={},c=i.htmlMode?t:n;for(var u in c)l[u]=c[u];for(var u in i)l[u]=i[u];function inText(e,t){function chain(n){return t.tokenize=n,n(e,t)}var n=e.next();if("<"==n)if(e.eat("!"))if(e.eat("["))if(e.match("CDATA["))return chain(inBlock("atom","]]>"));else return null;else if(e.match("--"))return chain(inBlock("comment","--\x3e"));else if(e.match("DOCTYPE",!0,!0))return e.eatWhile(/[\w\._\-]/),chain(doctype(1));else return null;else if(e.eat("?"))return e.eatWhile(/[\w\._\-]/),t.tokenize=inBlock("meta","?>"),"meta";else return o=e.eat("/")?"closeTag":"openTag",t.tokenize=inTag,"tag bracket";return"&"==n?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function inTag(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=inText,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){t.tokenize=inText,t.state=baseState,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}if(/[\'\"]/.test(n))return t.tokenize=inAttribute(n),t.stringStartCol=e.column(),t.tokenize(e,t);return e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word"}function inAttribute(e){var closure=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=inTag;break}return"string"};return closure.isInAttribute=!0,closure}function inBlock(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=inText;break}n.next()}return e}}function doctype(e){return function(t,n){for(var r;null!=(r=t.next());)if("<"==r)return n.tokenize=doctype(e+1),n.tokenize(t,n);else if(">"==r)if(1!=e)return n.tokenize=doctype(e-1),n.tokenize(t,n);else{n.tokenize=inText;break}return"meta"}}function Context(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function popContext(e){e.context&&(e.context=e.context.prev)}function maybePopContext(e,t){for(var n;;){if(!e.context||(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t)))return;popContext(e)}}function baseState(e,t,n){return"openTag"==e?(n.tagStart=t.column(),tagNameState):"closeTag"==e?closeTagNameState:baseState}function tagNameState(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",attrState):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",attrState(e,t,n)):(a="error",tagNameState)}function closeTagNameState(e,t,n){if("word"==e){var r=t.current();return(n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&popContext(n),n.context&&n.context.tagName==r||!1===l.matchClosing)?(a="tag",closeState):(a="tag error",closeStateErr)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",closeState(e,t,n)):(a="error",closeStateErr)}function closeState(e,t,n){return"endTag"!=e?(a="error",closeState):(popContext(n),baseState)}function closeStateErr(e,t,n){return a="error",closeState(e,t,n)}function attrState(e,t,n){if("word"==e)return a="attribute",attrEqState;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?maybePopContext(n,r):(maybePopContext(n,r),n.context=new Context(n,r,i==n.indented)),baseState}return a="error",attrState}function attrEqState(e,t,n){return"equals"==e?attrValueState:(l.allowMissing||(a="error"),attrState(e,t,n))}function attrValueState(e,t,n){return"string"==e?attrContinuedState:"word"==e&&l.allowUnquoted?(a="string",attrState):(a="error",attrState(e,t,n))}function attrContinuedState(e,t,n){return"string"==e?attrContinuedState:attrState(e,t,n)}return inText.isInText=!0,{startState:function(e){var t={tokenize:inText,state:baseState,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)if(t.tagStart==t.indented)return t.stringStartCol+1;else return t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=inTag&&t.tokenize!=inText)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)if(!1!==l.multilineTagIndentPastTag)return t.tagStart+t.tagName.length+2;else return t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==attrValueState&&(e.state=attrState)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(0x2a32d92c))},0x148a6d2b4:(e,t,n)=>{"use strict";function _extends(){return(_extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t