HTML Editor Syntax Highlighter - Version 1.4.0

Version Description

  • New fullscreen mode
  • Remembers tab state
  • Editor resize handler
  • Code refactoring and minification for better loading performance
Download this release

Release Info

Developer nixdns
Plugin Icon 128x128 HTML Editor Syntax Highlighter
Version 1.4.0
Comparing to
See all releases

Code changes from version 1.3.2 to 1.4.0

html-editor-syntax-highlighter.php CHANGED
@@ -5,10 +5,10 @@
5
  * Description: Syntax Highlighting in WordPress HTML Editor
6
  * Author: Peter Mukhortov
7
  * Author URI: http://mukhortov.com/
8
- * Version: 1.3.2
9
  * Requires at least: 3.3
10
- * Tested up to: 3.6.1
11
- * Stable tag: 1.3.2
12
  **/
13
 
14
  if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
@@ -17,170 +17,16 @@ define('HESH_LIBS',plugins_url('/lib/',__FILE__));
17
 
18
  class wp_html_editor_syntax {
19
  public function __construct(){
20
- //add_action('admin_init',array(&$this,'admin_init'));
21
  add_action('admin_head',array(&$this,'admin_head'));
22
- add_action('admin_footer',array(&$this,'admin_footer'));
23
  }
24
- public function admin_footer(){
25
- if (!$this->is_editor())
26
- return;
27
- ?>
28
-
29
- <script type="text/javascript">
30
-
31
- function runEditorHighlighter(el) {
32
- fullscreen.switchmode('html');
33
- //switchEditors.switchto(document.getElementById("content-html"));
34
-
35
- //
36
- var visualEditorEnabled;
37
-
38
- if (document.getElementById("content-tmce") != null) {
39
- visualEditorEnabled = true;
40
- } else {
41
- visualEditorEnabled = false;
42
- }
43
-
44
- if (visualEditorEnabled) {
45
- switchEditors.switchto(document.getElementById("content-html"));
46
- }
47
- // end
48
-
49
- var editor = CodeMirror.fromTextArea(document.getElementById(el), {
50
- mode: "text/html",
51
- tabMode: "indent",
52
- lineNumbers: true,
53
- matchBrackets: true,
54
- indentUnit: 4,
55
- indentWithTabs: true,
56
- enterMode: "keep",
57
- lineWrapping: true,
58
- autofocus: true,
59
- styleActiveLine: true
60
- });
61
-
62
- editor.on("change", function(){
63
- editor.save();
64
- });
65
-
66
- //Saving cursor state
67
- var cmPostID = document.getElementById("post_ID").value;
68
- editor.on("cursorActivity", function(){
69
- var curPos = editor.getCursor();
70
- window.name = cmPostID + ',' + curPos.line + ',' + curPos.ch;
71
- });
72
- //Restoring cursor state
73
- var curPos = window.name.split(',');
74
- if (cmPostID == curPos[0]) {
75
- editor.setCursor(parseFloat(curPos[1]),parseFloat(curPos[2]));
76
- }
77
-
78
- if (visualEditorEnabled) {
79
- document.getElementById("content-tmce").onclick = function(e){
80
- editor.toTextArea();
81
- switchEditors.switchto(document.getElementById("content-tmce"));
82
- document.getElementById("content-html").onclick = function(e){
83
- runEditorHighlighter("content");
84
- }
85
- }
86
- }
87
-
88
- document.getElementById("qt_content_fullscreen").onclick = function(e){
89
- editor.toTextArea();
90
- fullscreen.switchmode('html');
91
- setTimeout('runEditorHighlighter("wp_mce_fullscreen")', 2000);
92
- document.getElementById("wp-fullscreen-close").onclick = function(e){
93
- fullscreen.off();
94
- runEditorHighlighter("content");
95
- return false;
96
- }
97
- }
98
-
99
- /* buttons */
100
-
101
- var cmToolbar = document.getElementById("ed_toolbar");
102
-
103
- if (!cmToolbar.getAttribute('data-updated')) {
104
- cmToolbarVars = [
105
- //['search','','','Search:'],
106
- ['more','<!--more-->',''],
107
- ['comment','<!-- ',' -->'],
108
- ['code','<code>','</code>'],
109
- ['li','<li>','</li>'],
110
- ['ol','<ol>','</ol>'],
111
- ['ul','<ul>','</ul>'],
112
- ['img','<img src="$" alt="','">','Enter the URL of the image'], //Enter the URL of the image | http://
113
- ['ins','<ins>','</ins>'],
114
- ['del','<del>','</del>'],
115
- ['link','<a href="$">','</a>','Enter the destination URL'],
116
- ['blockquote','\r<blockquote>','</blockquote>\r'],
117
- ['h3','<h3>','</h3>'],
118
- ['h2','<h2>','</h2>'],
119
- ['h1','<h1>','</h1>'],
120
- ['i','<em>','</em>'],
121
- ['b','<strong>','</strong>'],
122
-
123
- ];
124
-
125
- function cmToolbarClick() {
126
- var selStart = editor.getCursor("start"), //var range = { from: editor.getCursor(true), to: editor.getCursor(false) },
127
- start = this.getAttribute('data-start'),
128
- end = this.getAttribute('data-end'),
129
- cmPrompt = this.getAttribute('data-prompt'),
130
- selText = editor.getSelection();
131
-
132
- if (cmPrompt) start = start.replace('$',prompt(cmPrompt, ''));
133
-
134
- editor.replaceSelection(start+selText+end);
135
- editor.setSelection(selStart, editor.getCursor("end"));
136
- editor.setCursor(selStart.line, selStart.ch + start.length);
137
- editor.focus();
138
- }
139
-
140
- for (var i=0; i<cmToolbarVars.length; i++) {
141
- var t = cmToolbarVars[i];
142
- var t3 = t[3] ? ('data-prompt="'+t[3]+'"') : '';
143
- cmToolbar.insertAdjacentHTML('afterbegin', '<input type="button" id="cm_content_'+t[0]+'" data-start=\''+t[1]+'\' data-end=\''+t[2]+'\' '+t3+' class="ed_button cm_ed_button" value="'+t[0]+'">');
144
- document.getElementById('cm_content_'+t[0]).onclick = cmToolbarClick;
145
- }
146
- cmToolbar.setAttribute("data-updated", "1");
147
- }
148
- /* end buttons */
149
- }
150
-
151
- window.onload = function() {
152
- runEditorHighlighter("content");
153
- }
154
- </script>
155
- <?php
156
- }
157
-
158
  public function admin_head(){
159
  if (!$this->is_editor())
160
  return;
161
  ?>
162
- <link rel="stylesheet" href="<?php echo HESH_LIBS; ?>codemirror.min.css">
163
- <script src="<?php echo HESH_LIBS; ?>codemirror-compressed.js"></script>
164
- <style>
165
- .CodeMirror-scroll {resize:vertical;}
166
- .wp-editor-area,
167
- .wp-fullscreen-both,
168
- #content-resize-handle,
169
- .quicktags-toolbar input.ed_button {display: none !important;}
170
- .quicktags-toolbar input#qt_content_fullscreen, #ed_toolbar input.cm_ed_button {display: inline-block !important;}
171
-
172
- .CodeMirror-matchingbracket {background-color: #fff490; color: inherit !important;}
173
- .CodeMirror {font-family: Menlo Regular,Consolas,Monaco,monospace;line-height: 150%;font-size: 12px; height: 600px;}
174
-
175
- #wp-fullscreen-container .CodeMirror {height: auto; min-height: 600px;}
176
- #wp-fullscreen-container .CodeMirror-scroll {overflow-y: hidden; overflow-x: auto;}
177
- #wp-fullscreen-wrap {width: 80% !important;}
178
- #wp-fullscreen-container {padding-bottom: 4px !important;}
179
- </style>
180
  <?php
181
-
182
  }
183
-
184
  private function is_editor(){
185
  if (!strstr($_SERVER['SCRIPT_NAME'],'post.php') && !strstr($_SERVER['SCRIPT_NAME'],'post-new.php')) {
186
  return false;
5
  * Description: Syntax Highlighting in WordPress HTML Editor
6
  * Author: Peter Mukhortov
7
  * Author URI: http://mukhortov.com/
8
+ * Version: 1.4.0
9
  * Requires at least: 3.3
10
+ * Tested up to: 3.7
11
+ * Stable tag: 1.4.0
12
  **/
13
 
14
  if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); }
17
 
18
  class wp_html_editor_syntax {
19
  public function __construct(){
 
20
  add_action('admin_head',array(&$this,'admin_head'));
 
21
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  public function admin_head(){
23
  if (!$this->is_editor())
24
  return;
25
  ?>
26
+ <link rel="stylesheet" href="<?php echo HESH_LIBS; ?>hesh.min.css">
27
+ <script src="<?php echo HESH_LIBS; ?>hesh.min.js"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  <?php
 
29
  }
 
30
  private function is_editor(){
31
  if (!strstr($_SERVER['SCRIPT_NAME'],'post.php') && !strstr($_SERVER['SCRIPT_NAME'],'post-new.php')) {
32
  return false;
lib/codemirror-compressed.js DELETED
@@ -1,6 +0,0 @@
1
- /* v3.18: codemirror.js, css.js, htmlmixed.js, javascript.js, xml.js, active-line.js, matchbrackets.js */
2
- window.CodeMirror=function(){"use strict";function w(a,c){if(!(this instanceof w))return new w(a,c);this.options=c=c||{};for(var d in $c)!c.hasOwnProperty(d)&&$c.hasOwnProperty(d)&&(c[d]=$c[d]);I(c);var e="string"==typeof c.value?0:c.value.first,f=this.display=x(a,e);f.wrapper.CodeMirror=this,F(this),c.autofocus&&!o&&Mb(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,draggingText:!1,highlight:new We},D(this),c.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");var g=c.value;"string"==typeof g&&(g=new fe(c.value,c.mode)),Eb(this,je)(this,g),b&&setTimeout(ef(Lb,this,!0),20),Ob(this);var h;try{h=document.activeElement==f.input}catch(i){}h||c.autofocus&&!o?setTimeout(ef(lc,this),20):mc(this),Eb(this,function(){for(var a in Zc)Zc.propertyIsEnumerable(a)&&Zc[a](this,c[a],ad);for(var b=0;b<ed.length;++b)ed[b](this)})()}function x(a,b){var d={},f=d.input=kf("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;");return e?f.style.width="1000px":f.setAttribute("wrap","off"),n&&(f.style.border="1px solid black"),f.setAttribute("autocorrect","off"),f.setAttribute("autocapitalize","off"),f.setAttribute("spellcheck","false"),d.inputDiv=kf("div",[f],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),d.scrollbarH=kf("div",[kf("div",null,null,"height: 1px")],"CodeMirror-hscrollbar"),d.scrollbarV=kf("div",[kf("div",null,null,"width: 1px")],"CodeMirror-vscrollbar"),d.scrollbarFiller=kf("div",null,"CodeMirror-scrollbar-filler"),d.gutterFiller=kf("div",null,"CodeMirror-gutter-filler"),d.lineDiv=kf("div",null,"CodeMirror-code"),d.selectionDiv=kf("div",null,null,"position: relative; z-index: 1"),d.cursor=kf("div","\xa0","CodeMirror-cursor"),d.otherCursor=kf("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"),d.measure=kf("div",null,"CodeMirror-measure"),d.lineSpace=kf("div",[d.measure,d.selectionDiv,d.lineDiv,d.cursor,d.otherCursor],null,"position: relative; outline: none"),d.mover=kf("div",[kf("div",[d.lineSpace],"CodeMirror-lines")],null,"position: relative"),d.sizer=kf("div",[d.mover],"CodeMirror-sizer"),d.heightForcer=kf("div",null,null,"position: absolute; height: "+Ue+"px; width: 1px;"),d.gutters=kf("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=kf("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=kf("div",[d.inputDiv,d.scrollbarH,d.scrollbarV,d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),c&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),a.appendChild?a.appendChild(d.wrapper):a(d.wrapper),n&&(f.style.width="0px"),e||(d.scroller.draggable=!0),j?(d.inputDiv.style.height="1px",d.inputDiv.style.position="absolute"):c&&(d.scrollbarH.style.minWidth=d.scrollbarV.style.minWidth="18px"),d.viewOffset=d.lastSizeC=0,d.showingFrom=d.showingTo=b,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.prevInput="",d.alignWidgets=!1,d.pollingFast=!1,d.poll=new We,d.cachedCharWidth=d.cachedTextHeight=null,d.measureLineCache=[],d.measureLineCachePos=0,d.inaccurateSelection=!1,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d}function y(a){a.doc.mode=w.getMode(a.options,a.doc.modeOption),a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,ab(a,100),a.state.modeGen++,a.curOp&&Hb(a)}function z(a){a.options.lineWrapping?(a.display.wrapper.className+=" CodeMirror-wrap",a.display.sizer.style.minWidth=""):(a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-wrap",""),H(a)),B(a),Hb(a),ob(a),setTimeout(function(){J(a)},100)}function A(a){var b=zb(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/Ab(a.display)-3);return function(e){return Fd(a.doc,e)?0:c?(Math.ceil(e.text.length/d)||1)*b:b}}function B(a){var b=a.doc,c=A(a);b.iter(function(a){var b=c(a);b!=a.height&&ne(a,b)})}function C(a){var b=jd[a.options.keyMap],c=b.style;a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(c?" cm-keymap-"+c:""),a.state.disableInput=b.disableInput}function D(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ob(a)}function E(a){F(a),Hb(a),setTimeout(function(){L(a)},20)}function F(a){var b=a.display.gutters,c=a.options.gutters;lf(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(kf("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none"}function G(a,b){if(0==b.height)return 0;for(var d,c=b.text.length,e=b;d=Cd(e);){var f=d.find();e=ke(a,f.from.line),c+=f.from.ch-f.to.ch}for(e=b;d=Dd(e);){var f=d.find();c-=e.text.length-f.from.ch,e=ke(a,f.to.line),c+=e.text.length-f.to.ch}return c}function H(a){var b=a.display,c=a.doc;b.maxLine=ke(c,c.first),b.maxLineLength=G(c,b.maxLine),b.maxLineChanged=!0,c.iter(function(a){var d=G(c,a);d>b.maxLineLength&&(b.maxLineLength=d,b.maxLine=a)})}function I(a){var b=af(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function J(a){var b=a.display,c=a.doc.height,d=c+fb(b);b.sizer.style.minHeight=b.heightForcer.style.top=d+"px",b.gutters.style.height=Math.max(d,b.scroller.clientHeight-Ue)+"px";var e=Math.max(d,b.scroller.scrollHeight),f=b.scroller.scrollWidth>b.scroller.clientWidth+1,g=e>b.scroller.clientHeight+1;g?(b.scrollbarV.style.display="block",b.scrollbarV.style.bottom=f?sf(b.measure)+"px":"0",b.scrollbarV.firstChild.style.height=e-b.scroller.clientHeight+b.scrollbarV.clientHeight+"px"):(b.scrollbarV.style.display="",b.scrollbarV.firstChild.style.height="0"),f?(b.scrollbarH.style.display="block",b.scrollbarH.style.right=g?sf(b.measure)+"px":"0",b.scrollbarH.firstChild.style.width=b.scroller.scrollWidth-b.scroller.clientWidth+b.scrollbarH.clientWidth+"px"):(b.scrollbarH.style.display="",b.scrollbarH.firstChild.style.width="0"),f&&g?(b.scrollbarFiller.style.display="block",b.scrollbarFiller.style.height=b.scrollbarFiller.style.width=sf(b.measure)+"px"):b.scrollbarFiller.style.display="",f&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(b.gutterFiller.style.display="block",b.gutterFiller.style.height=sf(b.measure)+"px",b.gutterFiller.style.width=b.gutters.offsetWidth+"px"):b.gutterFiller.style.display="",k&&0===sf(b.measure)&&(b.scrollbarV.style.minWidth=b.scrollbarH.style.minHeight=l?"18px":"12px")}function K(a,b,c){var d=a.scroller.scrollTop,e=a.wrapper.clientHeight;"number"==typeof c?d=c:c&&(d=c.top,e=c.bottom-c.top),d=Math.floor(d-eb(a));var f=Math.ceil(d+e);return{from:pe(b,d),to:pe(b,f)}}function L(a){var b=a.display;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var c=O(b)-b.scroller.scrollLeft+a.doc.scrollLeft,d=b.gutters.offsetWidth,e=c+"px",f=b.lineDiv.firstChild;f;f=f.nextSibling)if(f.alignable)for(var g=0,h=f.alignable;g<h.length;++g)h[g].style.left=e;a.options.fixedGutter&&(b.gutters.style.left=c+d+"px")}}function M(a){if(!a.options.lineNumbers)return!1;var b=a.doc,c=N(a.options,b.first+b.size-1),d=a.display;if(c.length!=d.lineNumChars){var e=d.measure.appendChild(kf("div",[kf("div",c)],"CodeMirror-linenumber CodeMirror-gutter-elt")),f=e.firstChild.offsetWidth,g=e.offsetWidth-f;return d.lineGutter.style.width="",d.lineNumInnerWidth=Math.max(f,d.lineGutter.offsetWidth-g),d.lineNumWidth=d.lineNumInnerWidth+g,d.lineNumChars=d.lineNumInnerWidth?c.length:-1,d.lineGutter.style.width=d.lineNumWidth+"px",!0}return!1}function N(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function O(a){return of(a.scroller).left-of(a.sizer).left}function P(a,b,c,d){for(var g,e=a.display.showingFrom,f=a.display.showingTo,h=K(a.display,a.doc,c),i=!0;;i=!1){var j=a.display.scroller.clientWidth;if(!Q(a,b,h,d))break;if(g=!0,b=[],Y(a),J(a),i&&a.options.lineWrapping&&j!=a.display.scroller.clientWidth)d=!0;else if(d=!1,c&&(c=Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,"number"==typeof c?c:c.top)),h=K(a.display,a.doc,c),h.from>=a.display.showingFrom&&h.to<=a.display.showingTo)break}return g&&(Pe(a,"update",a),(a.display.showingFrom!=e||a.display.showingTo!=f)&&Pe(a,"viewportChange",a,a.display.showingFrom,a.display.showingTo)),g}function Q(a,b,c,d){var e=a.display,f=a.doc;if(!e.wrapper.clientWidth)return e.showingFrom=e.showingTo=f.first,e.viewOffset=0,void 0;if(!(!d&&0==b.length&&c.from>e.showingFrom&&c.to<e.showingTo)){M(a)&&(b=[{from:f.first,to:f.first+f.size}]);var g=e.sizer.style.marginLeft=e.gutters.offsetWidth+"px";e.scrollbarH.style.left=a.options.fixedGutter?g:"0";var h=1/0;if(a.options.lineNumbers)for(var i=0;i<b.length;++i)b[i].diff&&b[i].from<h&&(h=b[i].from);var j=f.first+f.size,k=Math.max(c.from-a.options.viewportMargin,f.first),l=Math.min(j,c.to+a.options.viewportMargin);if(e.showingFrom<k&&k-e.showingFrom<20&&(k=Math.max(f.first,e.showingFrom)),e.showingTo>l&&e.showingTo-l<20&&(l=Math.min(j,e.showingTo)),v)for(k=oe(Ed(f,ke(f,k)));j>l&&Fd(f,ke(f,l));)++l;var m=[{from:Math.max(e.showingFrom,f.first),to:Math.min(e.showingTo,j)}];if(m=m[0].from>=m[0].to?[]:T(m,b),v)for(var i=0;i<m.length;++i)for(var o,n=m[i];o=Dd(ke(f,n.to-1));){var p=o.find().from.line;if(!(p>n.from)){m.splice(i--,1);break}n.to=p}for(var q=0,i=0;i<m.length;++i){var n=m[i];n.from<k&&(n.from=k),n.to>l&&(n.to=l),n.from>=n.to?m.splice(i--,1):q+=n.to-n.from}if(!d&&q==l-k&&k==e.showingFrom&&l==e.showingTo)return S(a),void 0;m.sort(function(a,b){return a.from-b.from});try{var r=document.activeElement}catch(s){}.7*(l-k)>q&&(e.lineDiv.style.display="none"),V(a,k,l,m,h),e.lineDiv.style.display="",r&&document.activeElement!=r&&r.offsetHeight&&r.focus();var t=k!=e.showingFrom||l!=e.showingTo||e.lastSizeC!=e.wrapper.clientHeight;return t&&(e.lastSizeC=e.wrapper.clientHeight,ab(a,400)),e.showingFrom=k,e.showingTo=l,R(a),S(a),!0}}function R(a){for(var f,b=a.display,d=b.lineDiv.offsetTop,e=b.lineDiv.firstChild;e;e=e.nextSibling)if(e.lineObj){if(c){var g=e.offsetTop+e.offsetHeight;f=g-d,d=g}else{var h=of(e);f=h.bottom-h.top}var i=e.lineObj.height-f;if(2>f&&(f=zb(b)),i>.001||-.001>i){ne(e.lineObj,f);var j=e.lineObj.widgets;if(j)for(var k=0;k<j.length;++k)j[k].height=j[k].node.offsetHeight}}}function S(a){var b=a.display.viewOffset=qe(a,ke(a.doc,a.display.showingFrom));a.display.mover.style.top=b+"px"}function T(a,b){for(var c=0,d=b.length||0;d>c;++c){for(var e=b[c],f=[],g=e.diff||0,h=0,i=a.length;i>h;++h){var j=a[h];e.to<=j.from&&e.diff?f.push({from:j.from+g,to:j.to+g}):e.to<=j.from||e.from>=j.to?f.push(j):(e.from>j.from&&f.push({from:j.from,to:e.from}),e.to<j.to&&f.push({from:e.to+g,to:j.to+g}))}a=f}return a}function U(a){for(var b=a.display,c={},d={},e=b.gutters.firstChild,f=0;e;e=e.nextSibling,++f)c[a.options.gutters[f]]=e.offsetLeft,d[a.options.gutters[f]]=e.offsetWidth;return{fixedPos:O(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function V(a,b,c,d,f){function l(b){var c=b.nextSibling;return e&&p&&a.display.currentWheelTarget==b?(b.style.display="none",b.lineObj=null):b.parentNode.removeChild(b),c}var g=U(a),h=a.display,i=a.options.lineNumbers;d.length||e&&a.display.currentWheelTarget||lf(h.lineDiv);var j=h.lineDiv,k=j.firstChild,m=d.shift(),n=b;for(a.doc.iter(b,c,function(b){if(m&&m.to==n&&(m=d.shift()),Fd(a.doc,b)){if(0!=b.height&&ne(b,0),b.widgets&&k&&k.previousSibling)for(var c=0;c<b.widgets.length;++c){var e=b.widgets[c];if(e.showIfHidden){var h=k.previousSibling;if(/pre/i.test(h.nodeName)){var o=kf("div",null,null,"position: relative");h.parentNode.replaceChild(o,h),o.appendChild(h),h=o}var p=h.appendChild(kf("div",[e.node],"CodeMirror-linewidget"));e.handleMouseEvents||(p.ignoreEvents=!0),X(e,p,h,g)}}}else if(m&&m.from<=n&&m.to>n){for(;k.lineObj!=b;)k=l(k);i&&n>=f&&k.lineNumber&&nf(k.lineNumber,N(a.options,n)),k=k.nextSibling}else{if(b.widgets)for(var s,q=0,r=k;r&&20>q;++q,r=r.nextSibling)if(r.lineObj==b&&/div/i.test(r.nodeName)){s=r;break}var t=W(a,b,n,g,s);if(t!=s)j.insertBefore(t,k);else{for(;k!=s;)k=l(k);k=k.nextSibling}t.lineObj=b}++n});k;)k=l(k)}function W(a,b,d,e,f){var k,g=Wd(a,b),h=g.pre,i=b.gutterMarkers,j=a.display,l=g.bgClass?g.bgClass+" "+(b.bgClass||""):b.bgClass;if(!(a.options.lineNumbers||i||l||b.wrapClass||b.widgets))return h;if(f){f.alignable=null;for(var q,m=!0,n=0,o=null,p=f.firstChild;p;p=q)if(q=p.nextSibling,/\bCodeMirror-linewidget\b/.test(p.className)){for(var r=0;r<b.widgets.length;++r){var s=b.widgets[r];if(s.node==p.firstChild){s.above||o||(o=p),X(s,p,f,e),++n;break}}if(r==b.widgets.length){m=!1;break}}else f.removeChild(p);f.insertBefore(h,o),m&&n==b.widgets.length&&(k=f,f.className=b.wrapClass||"")}if(k||(k=kf("div",null,b.wrapClass,"position: relative"),k.appendChild(h)),l&&k.insertBefore(kf("div",null,l+" CodeMirror-linebackground"),k.firstChild),a.options.lineNumbers||i){var t=k.insertBefore(kf("div",null,null,"position: absolute; left: "+(a.options.fixedGutter?e.fixedPos:-e.gutterTotalWidth)+"px"),k.firstChild);if(a.options.fixedGutter&&(k.alignable||(k.alignable=[])).push(t),!a.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(k.lineNumber=t.appendChild(kf("div",N(a.options,d),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+e.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+j.lineNumInnerWidth+"px"))),i)for(var u=0;u<a.options.gutters.length;++u){var v=a.options.gutters[u],w=i.hasOwnProperty(v)&&i[v];w&&t.appendChild(kf("div",[w],"CodeMirror-gutter-elt","left: "+e.gutterLeft[v]+"px; width: "+e.gutterWidth[v]+"px"))}}if(c&&(k.style.zIndex=2),b.widgets&&k!=f)for(var r=0,x=b.widgets;r<x.length;++r){var s=x[r],y=kf("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||(y.ignoreEvents=!0),X(s,y,k,e),s.above?k.insertBefore(y,a.options.lineNumbers&&0!=b.height?t:h):k.appendChild(y),Pe(s,"redraw")}return k}function X(a,b,c,d){if(a.noHScroll){(c.alignable||(c.alignable=[])).push(b);var e=d.wrapperWidth;b.style.left=d.fixedPos+"px",a.coverGutter||(e-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=e+"px"}a.coverGutter&&(b.style.zIndex=5,b.style.position="relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function Y(a){var b=a.display,c=Bc(a.doc.sel.from,a.doc.sel.to);if(c||a.options.showCursorWhenSelecting?Z(a):b.cursor.style.display=b.otherCursor.style.display="none",c?b.selectionDiv.style.display="none":$(a),a.options.moveInputWithCursor){var d=ub(a,a.doc.sel.head,"div"),e=of(b.wrapper),f=of(b.lineDiv);b.inputDiv.style.top=Math.max(0,Math.min(b.wrapper.clientHeight-10,d.top+f.top-e.top))+"px",b.inputDiv.style.left=Math.max(0,Math.min(b.wrapper.clientWidth-10,d.left+f.left-e.left))+"px"}}function Z(a){var b=a.display,c=ub(a,a.doc.sel.head,"div");b.cursor.style.left=c.left+"px",b.cursor.style.top=c.top+"px",b.cursor.style.height=Math.max(0,c.bottom-c.top)*a.options.cursorHeight+"px",b.cursor.style.display="",c.other?(b.otherCursor.style.display="",b.otherCursor.style.left=c.other.left+"px",b.otherCursor.style.top=c.other.top+"px",b.otherCursor.style.height=.85*(c.other.bottom-c.other.top)+"px"):b.otherCursor.style.display="none"}function $(a){function h(a,b,c,d){0>b&&(b=0),e.appendChild(kf("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?f-a:c)+"px; height: "+(d-b)+"px"))}function i(b,d,e){function m(c,d){return tb(a,Ac(b,c),"div",i,d)}var k,l,i=ke(c,b),j=i.text.length;return zf(re(i),d||0,null==e?j:e,function(a,b,c){var n,o,p,i=m(a,"left");if(a==b)n=i,o=p=i.left;else{if(n=m(b-1,"right"),"rtl"==c){var q=i;i=n,n=q}o=i.left,p=n.right}null==d&&0==a&&(o=g),n.top-i.top>3&&(h(o,i.top,null,i.bottom),o=g,i.bottom<n.top&&h(o,i.bottom,null,n.top)),null==e&&b==j&&(p=f),(!k||i.top<k.top||i.top==k.top&&i.left<k.left)&&(k=i),(!l||n.bottom>l.bottom||n.bottom==l.bottom&&n.right>l.right)&&(l=n),g+1>o&&(o=g),h(o,n.top,p-o,n.bottom)}),{start:k,end:l}}var b=a.display,c=a.doc,d=a.doc.sel,e=document.createDocumentFragment(),f=b.lineSpace.offsetWidth,g=gb(a.display);if(d.from.line==d.to.line)i(d.from.line,d.from.ch,d.to.ch);else{var j=ke(c,d.from.line),k=ke(c,d.to.line),l=Ed(c,j)==Ed(c,k),m=i(d.from.line,d.from.ch,l?j.text.length:null).end,n=i(d.to.line,l?0:null,d.to.ch).start;l&&(m.top<n.top-2?(h(m.right,m.top,null,m.bottom),h(g,n.top,n.left,n.bottom)):h(m.right,m.top,n.left-m.right,m.bottom)),m.bottom<n.top&&h(g,m.bottom,null,n.top)}mf(b.selectionDiv,e),b.selectionDiv.style.display=""}function _(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursor.style.visibility=b.otherCursor.style.visibility="",a.options.cursorBlinkRate>0&&(b.blinker=setInterval(function(){b.cursor.style.visibility=b.otherCursor.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate))}}function ab(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.showingTo&&a.state.highlight.set(b,ef(bb,a))}function bb(a){var b=a.doc;if(b.frontier<b.first&&(b.frontier=b.first),!(b.frontier>=a.display.showingTo)){var f,c=+new Date+a.options.workTime,d=gd(b.mode,db(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.showingTo+500),function(g){if(b.frontier>=a.display.showingFrom){var h=g.styles;g.styles=Rd(a,g,d);for(var i=!h||h.length!=g.styles.length,j=0;!i&&j<h.length;++j)i=h[j]!=g.styles[j];i&&(f&&f.end==b.frontier?f.end++:e.push(f={start:b.frontier,end:b.frontier+1})),g.stateAfter=gd(b.mode,d)}else Td(a,g,d),g.stateAfter=0==b.frontier%5?gd(b.mode,d):null;return++b.frontier,+new Date>c?(ab(a,a.options.workDelay),!0):void 0}),e.length&&Eb(a,function(){for(var a=0;a<e.length;++a)Hb(this,e[a].start,e[a].end)})()}}function cb(a,b,c){for(var d,e,f=a.doc,g=a.doc.mode.innerMode?1e3:100,h=b,i=b-g;h>i;--h){if(h<=f.first)return f.first;var j=ke(f,h-1);if(j.stateAfter&&(!c||h<=f.frontier))return h;var k=Xe(j.text,null,a.options.tabSize);(null==e||d>k)&&(e=h-1,d=k)}return e}function db(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=cb(a,b,c),g=f>d.first&&ke(d,f-1).stateAfter;return g=g?gd(d.mode,g):hd(d.mode),d.iter(f,b,function(c){Td(a,c,g);var h=f==b-1||0==f%5||f>=e.showingFrom&&f<e.showingTo;c.stateAfter=h?gd(d.mode,g):null,++f}),g}function eb(a){return a.lineSpace.offsetTop}function fb(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function gb(a){var b=mf(a.measure,kf("pre",null,null,"text-align: left")).appendChild(kf("span","x"));return b.offsetLeft}function hb(a,b,c,d,e){var f=-1;if(d=d||kb(a,b),d.crude){var g=d.left+c*d.width;return{left:g,right:g+d.width,top:d.top,bottom:d.bottom}}for(var h=c;;h+=f){var i=d[h];if(i)break;0>f&&0==h&&(f=1)}return e=h>c?"left":c>h?"right":e,"left"==e&&i.leftSide?i=i.leftSide:"right"==e&&i.rightSide&&(i=i.rightSide),{left:c>h?i.right:i.left,right:h>c?i.left:i.right,top:i.top,bottom:i.bottom}}function ib(a,b){for(var c=a.display.measureLineCache,d=0;d<c.length;++d){var e=c[d];if(e.text==b.text&&e.markedSpans==b.markedSpans&&a.display.scroller.clientWidth==e.width&&e.classes==b.textClass+"|"+b.wrapClass)return e}}function jb(a,b){var c=ib(a,b);c&&(c.text=c.measure=c.markedSpans=null)}function kb(a,b){var c=ib(a,b);if(c)return c.measure;var d=lb(a,b),e=a.display.measureLineCache,f={text:b.text,width:a.display.scroller.clientWidth,markedSpans:b.markedSpans,measure:d,classes:b.textClass+"|"+b.wrapClass};return 16==e.length?e[++a.display.measureLineCachePos%16]=f:e.push(f),d}function lb(a,e){function t(a){var b=a.top-p.top,c=a.bottom-p.top;c>s&&(c=s),0>b&&(b=0);for(var d=q.length-2;d>=0;d-=2){var e=q[d],f=q[d+1];if(!(e>c||b>f)&&(b>=e&&f>=c||e>=b&&c>=f||Math.min(c,f)-Math.max(b,e)>=c-b>>1)){q[d]=Math.min(b,e),q[d+1]=Math.max(c,f);break}}return 0>d&&(d=q.length,q.push(b,c)),{left:a.left-p.left,right:a.right-p.left,top:d,bottom:null}}function u(a){a.bottom=q[a.top+1],a.top=q[a.top]}if(!a.options.lineWrapping&&e.text.length>=a.options.crudeMeasuringFrom)return mb(a,e);var f=a.display,g=df(e.text.length),h=Wd(a,e,g,!0).pre;if(b&&!c&&!a.options.lineWrapping&&h.childNodes.length>100){for(var i=document.createDocumentFragment(),j=10,k=h.childNodes.length,l=0,m=Math.ceil(k/j);m>l;++l){for(var n=kf("div",null,null,"display: inline-block"),o=0;j>o&&k;++o)n.appendChild(h.firstChild),--k;i.appendChild(n)}h.appendChild(i)}mf(f.measure,h);var p=of(f.lineDiv),q=[],r=df(e.text.length),s=h.offsetHeight;d&&f.measure.first!=h&&mf(f.measure,h);for(var v,l=0;l<g.length;++l)if(v=g[l]){var w=v,x=null;if(/\bCodeMirror-widget\b/.test(v.className)&&v.getClientRects){1==v.firstChild.nodeType&&(w=v.firstChild);var y=w.getClientRects();y.length>1&&(x=r[l]=t(y[0]),x.rightSide=t(y[y.length-1]))}x||(x=r[l]=t(of(w))),v.measureRight&&(x.right=of(v.measureRight).left),v.leftSide&&(x.leftSide=t(of(v.leftSide)))}lf(a.display.measure);for(var v,l=0;l<r.length;++l)(v=r[l])&&(u(v),v.leftSide&&u(v.leftSide),v.rightSide&&u(v.rightSide));return r}function mb(a,b){var c=new Nd(b.text.slice(0,100),null);b.textClass&&(c.textClass=b.textClass);var d=lb(a,c),e=hb(a,c,0,d,"left"),f=hb(a,c,99,d,"right");return{crude:!0,top:e.top,left:e.left,bottom:e.bottom,width:(f.right-e.left)/100}}function nb(a,b){var c=!1;if(b.markedSpans)for(var d=0;d<b.markedSpans;++d){var e=b.markedSpans[d];!e.collapsed||null!=e.to&&e.to!=b.text.length||(c=!0)}var f=!c&&ib(a,b);if(f||b.text.length>=a.options.crudeMeasuringFrom)return hb(a,b,b.text.length,f&&f.measure,"right").right;var g=Wd(a,b,null,!0).pre,h=g.appendChild(uf(a.display.measure));return mf(a.display.measure,g),of(h).right-of(a.display.lineDiv).left}function ob(a){a.display.measureLineCache.length=a.display.measureLineCachePos=0,a.display.cachedCharWidth=a.display.cachedTextHeight=null,a.options.lineWrapping||(a.display.maxLineChanged=!0),a.display.lineNumChars=null}function pb(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function qb(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function rb(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=Ld(b.widgets[e]);c.top+=f,c.bottom+=f}if("line"==d)return c;d||(d="local");var g=qe(a,b);if("local"==d?g+=eb(a.display):g-=a.display.viewOffset,"page"==d||"window"==d){var h=of(a.display.lineSpace);g+=h.top+("window"==d?0:qb());var i=h.left+("window"==d?0:pb());c.left+=i,c.right+=i}return c.top+=g,c.bottom+=g,c}function sb(a,b,c){if("div"==c)return b;var d=b.left,e=b.top;if("page"==c)d-=pb(),e-=qb();else if("local"==c||!c){var f=of(a.display.sizer);d+=f.left,e+=f.top}var g=of(a.display.lineSpace);return{left:d-g.left,top:e-g.top}}function tb(a,b,c,d,e){return d||(d=ke(a.doc,b.line)),rb(a,d,hb(a,d,b.ch,null,e),c)}function ub(a,b,c,d,e){function f(b,f){var g=hb(a,d,b,e,f?"right":"left");return f?g.left=g.right:g.right=g.left,rb(a,d,g,c)}function g(a,b){var c=h[b],d=c.level%2;return a==Af(c)&&b&&c.level<h[b-1].level?(c=h[--b],a=Bf(c)-(c.level%2?0:1),d=!0):a==Bf(c)&&b<h.length-1&&c.level<h[b+1].level&&(c=h[++b],a=Af(c)-c.level%2,d=!1),d&&a==c.to&&a>c.from?f(a-1):f(a,d)}d=d||ke(a.doc,b.line),e||(e=kb(a,d));var h=re(d),i=b.ch;if(!h)return f(i);var j=If(h,i),k=g(i,j);return null!=Hf&&(k.other=g(i,Hf)),k}function vb(a,b,c,d){var e=new Ac(a,b);return e.xRel=d,c&&(e.outside=!0),e}function wb(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return vb(d.first,0,!0,-1);var e=pe(d,c),f=d.first+d.size-1;if(e>f)return vb(d.first+d.size-1,ke(d,f).text.length,!0,1);for(0>b&&(b=0);;){var g=ke(d,e),h=xb(a,g,e,b,c),i=Dd(g),j=i&&i.find();if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=j.to.line}}function xb(a,b,c,d,e){function j(d){var e=ub(a,Ac(c,d),"line",b,i);return g=!0,f>e.bottom?e.left-h:f<e.top?e.left+h:(g=!1,e.left)}var f=e-qe(a,b),g=!1,h=2*a.display.wrapper.clientWidth,i=kb(a,b),k=re(b),l=b.text.length,m=Cf(b),n=Df(b),o=j(m),p=g,q=j(n),r=g;if(d>q)return vb(c,n,r,1);for(;;){if(k?n==m||n==Kf(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);jf.test(b.text.charAt(s));)++s;var u=vb(c,s,s==m?p:r,0>t?-1:t?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=Kf(b,w,1)}var y=j(w);y>d?(n=w,q=y,(r=g)&&(q+=1e3),l=v):(m=w,o=y,p=g,l-=v)}}function zb(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==yb){yb=kf("pre");for(var b=0;49>b;++b)yb.appendChild(document.createTextNode("x")),yb.appendChild(kf("br"));yb.appendChild(document.createTextNode("x"))}mf(a.measure,yb);var c=yb.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),lf(a.measure),c||1}function Ab(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=kf("span","x"),c=kf("pre",[b]);mf(a.measure,c);var d=b.offsetWidth;return d>2&&(a.cachedCharWidth=d),d||10}function Cb(a){a.curOp={changes:[],forceUpdate:!1,updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,cursorActivity:!1,updateMaxLine:!1,updateScrollPos:!1,id:++Bb},Oe++||(Ne=[])}function Db(a){var b=a.curOp,c=a.doc,d=a.display;if(a.curOp=null,b.updateMaxLine&&H(a),d.maxLineChanged&&!a.options.lineWrapping&&d.maxLine){var e=nb(a,d.maxLine);d.sizer.style.minWidth=Math.max(0,e+3+Ue)+"px",d.maxLineChanged=!1;var f=Math.max(0,d.sizer.offsetLeft+d.sizer.offsetWidth-d.scroller.clientWidth);f<c.scrollLeft&&!b.updateScrollPos&&_b(a,Math.min(d.scroller.scrollLeft,f),!0)}var g,h;if(b.updateScrollPos)g=b.updateScrollPos;else if(b.selectionChanged&&d.scroller.clientHeight){var i=ub(a,c.sel.head);g=Qc(a,i.left,i.top,i.left,i.bottom)}(b.changes.length||b.forceUpdate||g&&null!=g.scrollTop)&&(h=P(a,b.changes,g&&g.scrollTop,b.forceUpdate),a.display.scroller.offsetHeight&&(a.doc.scrollTop=a.display.scroller.scrollTop)),!h&&b.selectionChanged&&Y(a),b.updateScrollPos?(d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=g.scrollTop,d.scroller.scrollLeft=d.scrollbarH.scrollLeft=c.scrollLeft=g.scrollLeft,L(a),b.scrollToPos&&Oc(a,Fc(a.doc,b.scrollToPos),b.scrollToPosMargin)):g&&Nc(a),b.selectionChanged&&_(a),a.state.focused&&b.updateInput&&Lb(a,b.userSelChange);var j=b.maybeHiddenMarkers,k=b.maybeUnhiddenMarkers;if(j)for(var l=0;l<j.length;++l)j[l].lines.length||Me(j[l],"hide");if(k)for(var l=0;l<k.length;++l)k[l].lines.length&&Me(k[l],"unhide");var m;if(--Oe||(m=Ne,Ne=null),b.textChanged&&Me(a,"change",a,b.textChanged),b.cursorActivity&&Me(a,"cursorActivity",a),m)for(var l=0;l<m.length;++l)m[l]()}function Eb(a,b){return function(){var c=a||this,d=!c.curOp;d&&Cb(c);try{var e=b.apply(c,arguments)}finally{d&&Db(c)}return e}}function Fb(a){return function(){var c,b=this.cm&&!this.cm.curOp;b&&Cb(this.cm);try{c=a.apply(this,arguments)}finally{b&&Db(this.cm)}return c}}function Gb(a,b){var d,c=!a.curOp;c&&Cb(a);try{d=b()}finally{c&&Db(a)}return d}function Hb(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),a.curOp.changes.push({from:b,to:c,diff:d})}function Ib(a){a.display.pollingFast||a.display.poll.set(a.options.pollInterval,function(){Kb(a),a.state.focused&&Ib(a)})}function Jb(a){function c(){var d=Kb(a);d||b?(a.display.pollingFast=!1,Ib(a)):(b=!0,a.display.poll.set(60,c))}var b=!1;a.display.pollingFast=!0,a.display.poll.set(20,c)}function Kb(a){var c=a.display.input,e=a.display.prevInput,f=a.doc,g=f.sel;if(!a.state.focused||wf(c)||Nb(a)||a.state.disableInput)return!1;a.state.pasteIncoming&&a.state.fakedLastChar&&(c.value=c.value.substring(0,c.value.length-1),a.state.fakedLastChar=!1);var h=c.value;if(h==e&&Bc(g.from,g.to))return!1;if(b&&!d&&a.display.inputHasSelection===h)return Lb(a,!0),!1;var i=!a.curOp;i&&Cb(a),g.shift=!1;for(var j=0,k=Math.min(e.length,h.length);k>j&&e.charCodeAt(j)==h.charCodeAt(j);)++j;var l=g.from,m=g.to;j<e.length?l=Ac(l.line,l.ch-(e.length-j)):a.state.overwrite&&Bc(l,m)&&!a.state.pasteIncoming&&(m=Ac(m.line,Math.min(ke(f,m.line).text.length,m.ch+(h.length-j))));var n=a.curOp.updateInput,o={from:l,to:m,text:vf(h.slice(j)),origin:a.state.pasteIncoming?"paste":"+input"};return tc(a.doc,o,"end"),a.curOp.updateInput=n,Pe(a,"inputRead",a,o),h.length>1e3||h.indexOf("\n")>-1?c.value=a.display.prevInput="":a.display.prevInput=h,i&&Db(a),a.state.pasteIncoming=!1,!0}function Lb(a,c){var e,f,g=a.doc;if(Bc(g.sel.from,g.sel.to))c&&(a.display.prevInput=a.display.input.value="",b&&!d&&(a.display.inputHasSelection=null));else{a.display.prevInput="",e=xf&&(g.sel.to.line-g.sel.from.line>100||(f=a.getSelection()).length>1e3);var h=e?"-":f||a.getSelection();a.display.input.value=h,a.state.focused&&_e(a.display.input),b&&!d&&(a.display.inputHasSelection=h)}a.display.inaccurateSelection=e}function Mb(a){"nocursor"==a.options.readOnly||o&&document.activeElement==a.display.input||a.display.input.focus()}function Nb(a){return a.options.readOnly||a.doc.cantEdit}function Ob(a){function f(){a.state.focused&&setTimeout(ef(Mb,a),0)}function h(){null==g&&(g=setTimeout(function(){g=null,c.cachedCharWidth=c.cachedTextHeight=rf=null,ob(a),Gb(a,ef(Hb,a))},100))}function i(){for(var a=c.wrapper.parentNode;a&&a!=document.body;a=a.parentNode);a?setTimeout(i,5e3):Le(window,"resize",h)}function k(b){Qe(a,b)||a.options.onDragEvent&&a.options.onDragEvent(a,De(b))||He(b)}function l(){c.inaccurateSelection&&(c.prevInput="",c.inaccurateSelection=!1,c.input.value=a.getSelection(),_e(c.input))}var c=a.display;Ke(c.scroller,"mousedown",Eb(a,Tb)),b?Ke(c.scroller,"dblclick",Eb(a,function(b){if(!Qe(a,b)){var c=Qb(a,b);if(c&&!Wb(a,b)&&!Pb(a.display,b)){Ee(b);var d=Xc(ke(a.doc,c.line).text,c);Ic(a.doc,d.from,d.to)}}})):Ke(c.scroller,"dblclick",function(b){Qe(a,b)||Ee(b)}),Ke(c.lineSpace,"selectstart",function(a){Pb(c,a)||Ee(a)}),t||Ke(c.scroller,"contextmenu",function(b){oc(a,b)}),Ke(c.scroller,"scroll",function(){c.scroller.clientHeight&&($b(a,c.scroller.scrollTop),_b(a,c.scroller.scrollLeft,!0),Me(a,"scroll",a))}),Ke(c.scrollbarV,"scroll",function(){c.scroller.clientHeight&&$b(a,c.scrollbarV.scrollTop)}),Ke(c.scrollbarH,"scroll",function(){c.scroller.clientHeight&&_b(a,c.scrollbarH.scrollLeft)}),Ke(c.scroller,"mousewheel",function(b){cc(a,b)}),Ke(c.scroller,"DOMMouseScroll",function(b){cc(a,b)}),Ke(c.scrollbarH,"mousedown",f),Ke(c.scrollbarV,"mousedown",f),Ke(c.wrapper,"scroll",function(){c.wrapper.scrollTop=c.wrapper.scrollLeft=0});var g;Ke(window,"resize",h),setTimeout(i,5e3),Ke(c.input,"keyup",Eb(a,function(b){Qe(a,b)||a.options.onKeyEvent&&a.options.onKeyEvent(a,De(b))||16==b.keyCode&&(a.doc.sel.shift=!1)})),Ke(c.input,"input",function(){b&&!d&&a.display.inputHasSelection&&(a.display.inputHasSelection=null),Jb(a)}),Ke(c.input,"keydown",Eb(a,jc)),Ke(c.input,"keypress",Eb(a,kc)),Ke(c.input,"focus",ef(lc,a)),Ke(c.input,"blur",ef(mc,a)),a.options.dragDrop&&(Ke(c.scroller,"dragstart",function(b){Zb(a,b)}),Ke(c.scroller,"dragenter",k),Ke(c.scroller,"dragover",k),Ke(c.scroller,"drop",Eb(a,Yb))),Ke(c.scroller,"paste",function(b){Pb(c,b)||(Mb(a),Jb(a))}),Ke(c.input,"paste",function(){if(e&&!a.state.fakedLastChar&&!(new Date-a.state.lastMiddleDown<200)){var b=c.input.selectionStart,d=c.input.selectionEnd;c.input.value+="$",c.input.selectionStart=b,c.input.selectionEnd=d,a.state.fakedLastChar=!0}a.state.pasteIncoming=!0,Jb(a)}),Ke(c.input,"cut",l),Ke(c.input,"copy",l),j&&Ke(c.sizer,"mouseup",function(){document.activeElement==c.input&&c.input.blur(),Mb(a)})}function Pb(a,b){for(var c=Ie(b);c!=a.wrapper;c=c.parentNode)if(!c||c.ignoreEvents||c.parentNode==a.sizer&&c!=a.mover)return!0}function Qb(a,b,c){var d=a.display;if(!c){var e=Ie(b);if(e==d.scrollbarH||e==d.scrollbarH.firstChild||e==d.scrollbarV||e==d.scrollbarV.firstChild||e==d.scrollbarFiller||e==d.gutterFiller)return null}var f,g,h=of(d.lineSpace);try{f=b.clientX,g=b.clientY}catch(b){return null}return wb(a,f-h.left,g-h.top)}function Tb(a){function q(a){if(!Bc(p,a)){if(p=a,"single"==j)return Ic(c.doc,Fc(f,h),a),void 0;if(n=Fc(f,n),o=Fc(f,o),"double"==j){var b=Xc(ke(f,a.line).text,a);Cc(a,n)?Ic(c.doc,b.from,o):Ic(c.doc,n,b.to)}else"triple"==j&&(Cc(a,n)?Ic(c.doc,o,Fc(f,Ac(a.line,0))):Ic(c.doc,n,Fc(f,Ac(a.line+1,0))))
3
- }}function u(a){var b=++s,e=Qb(c,a,!0);if(e)if(Bc(e,l)){var h=a.clientY<r.top?-20:a.clientY>r.bottom?20:0;h&&setTimeout(Eb(c,function(){s==b&&(d.scroller.scrollTop+=h,u(a))}),50)}else{c.state.focused||lc(c),l=e,q(e);var g=K(d,f);(e.line>=g.to||e.line<g.from)&&setTimeout(Eb(c,function(){s==b&&u(a)}),150)}}function v(a){s=1/0,Ee(a),Mb(c),Le(document,"mousemove",w),Le(document,"mouseup",x)}if(!Qe(this,a)){var c=this,d=c.display,f=c.doc,g=f.sel;if(g.shift=a.shiftKey,Pb(d,a))return e||(d.scroller.draggable=!1,setTimeout(function(){d.scroller.draggable=!0},100)),void 0;if(!Wb(c,a)){var h=Qb(c,a);switch(Je(a)){case 3:return t&&oc.call(c,c,a),void 0;case 2:return e&&(c.state.lastMiddleDown=+new Date),h&&Ic(c.doc,h),setTimeout(ef(Mb,c),20),Ee(a),void 0}if(!h)return Ie(a)==d.scroller&&Ee(a),void 0;c.state.focused||lc(c);var i=+new Date,j="single";if(Sb&&Sb.time>i-400&&Bc(Sb.pos,h))j="triple",Ee(a),setTimeout(ef(Mb,c),20),Yc(c,h.line);else if(Rb&&Rb.time>i-400&&Bc(Rb.pos,h)){j="double",Sb={time:i,pos:h},Ee(a);var k=Xc(ke(f,h.line).text,h);Ic(c.doc,k.from,k.to)}else Rb={time:i,pos:h};var l=h;if(c.options.dragDrop&&pf&&!Nb(c)&&!Bc(g.from,g.to)&&!Cc(h,g.from)&&!Cc(g.to,h)&&"single"==j){var m=Eb(c,function(b){e&&(d.scroller.draggable=!1),c.state.draggingText=!1,Le(document,"mouseup",m),Le(d.scroller,"drop",m),Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-b.clientY)<10&&(Ee(b),Ic(c.doc,h),Mb(c))});return e&&(d.scroller.draggable=!0),c.state.draggingText=m,d.scroller.dragDrop&&d.scroller.dragDrop(),Ke(document,"mouseup",m),Ke(d.scroller,"drop",m),void 0}Ee(a),"single"==j&&Ic(c.doc,Fc(f,h));var n=g.from,o=g.to,p=h,r=of(d.wrapper),s=0,w=Eb(c,function(a){b||Je(a)?u(a):v(a)}),x=Eb(c,v);Ke(document,"mousemove",w),Ke(document,"mouseup",x)}}}function Ub(a,b,c,d,e){try{var f=b.clientX,g=b.clientY}catch(b){return!1}if(f>=Math.floor(of(a.display.gutters).right))return!1;d&&Ee(b);var h=a.display,i=of(h.lineDiv);if(g>i.bottom||!Se(a,c))return Ge(b);g-=i.top-h.viewOffset;for(var j=0;j<a.options.gutters.length;++j){var k=h.gutters.childNodes[j];if(k&&of(k).right>=f){var l=pe(a.doc,g),m=a.options.gutters[j];return e(a,c,a,l,m,b),Ge(b)}}}function Vb(a,b){return Se(a,"gutterContextMenu")?Ub(a,b,"gutterContextMenu",!1,Me):!1}function Wb(a,b){return Ub(a,b,"gutterClick",!0,Pe)}function Yb(a){var c=this;if(!(Qe(c,a)||Pb(c.display,a)||c.options.onDragEvent&&c.options.onDragEvent(c,De(a)))){Ee(a),b&&(Xb=+new Date);var d=Qb(c,a,!0),e=a.dataTransfer.files;if(d&&!Nb(c))if(e&&e.length&&window.FileReader&&window.File)for(var f=e.length,g=Array(f),h=0,i=function(a,b){var e=new FileReader;e.onload=function(){g[b]=e.result,++h==f&&(d=Fc(c.doc,d),tc(c.doc,{from:d,to:d,text:vf(g.join("\n")),origin:"paste"},"around"))},e.readAsText(a)},j=0;f>j;++j)i(e[j],j);else{if(c.state.draggingText&&!Cc(d,c.doc.sel.from)&&!Cc(c.doc.sel.to,d))return c.state.draggingText(a),setTimeout(ef(Mb,c),20),void 0;try{var g=a.dataTransfer.getData("Text");if(g){var k=c.doc.sel.from,l=c.doc.sel.to;Kc(c.doc,d,d),c.state.draggingText&&zc(c.doc,"",k,l,"paste"),c.replaceSelection(g,null,"paste"),Mb(c),lc(c)}}catch(a){}}}}function Zb(a,c){if(b&&(!a.state.draggingText||+new Date-Xb<100))return He(c),void 0;if(!Qe(a,c)&&!Pb(a.display,c)){var d=a.getSelection();if(c.dataTransfer.setData("Text",d),c.dataTransfer.setDragImage&&!i){var e=kf("img",null,null,"position: fixed; left: 0; top: 0;");e.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(e.width=e.height=1,a.display.wrapper.appendChild(e),e._top=e.offsetTop),c.dataTransfer.setDragImage(e,0,0),h&&e.parentNode.removeChild(e)}}}function $b(b,c){Math.abs(b.doc.scrollTop-c)<2||(b.doc.scrollTop=c,a||P(b,[],c),b.display.scroller.scrollTop!=c&&(b.display.scroller.scrollTop=c),b.display.scrollbarV.scrollTop!=c&&(b.display.scrollbarV.scrollTop=c),a&&P(b,[]),ab(b,100))}function _b(a,b,c){(c?b==a.doc.scrollLeft:Math.abs(a.doc.scrollLeft-b)<2)||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,L(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbarH.scrollLeft!=b&&(a.display.scrollbarH.scrollLeft=b))}function cc(b,c){var d=c.wheelDeltaX,f=c.wheelDeltaY;null==d&&c.detail&&c.axis==c.HORIZONTAL_AXIS&&(d=c.detail),null==f&&c.detail&&c.axis==c.VERTICAL_AXIS?f=c.detail:null==f&&(f=c.wheelDelta);var g=b.display,i=g.scroller;if(d&&i.scrollWidth>i.clientWidth||f&&i.scrollHeight>i.clientHeight){if(f&&p&&e)for(var j=c.target;j!=i;j=j.parentNode)if(j.lineObj){b.display.currentWheelTarget=j;break}if(d&&!a&&!h&&null!=bc)return f&&$b(b,Math.max(0,Math.min(i.scrollTop+f*bc,i.scrollHeight-i.clientHeight))),_b(b,Math.max(0,Math.min(i.scrollLeft+d*bc,i.scrollWidth-i.clientWidth))),Ee(c),g.wheelStartX=null,void 0;if(f&&null!=bc){var k=f*bc,l=b.doc.scrollTop,m=l+g.wrapper.clientHeight;0>k?l=Math.max(0,l+k-50):m=Math.min(b.doc.height,m+k+50),P(b,[],{top:l,bottom:m})}20>ac&&(null==g.wheelStartX?(g.wheelStartX=i.scrollLeft,g.wheelStartY=i.scrollTop,g.wheelDX=d,g.wheelDY=f,setTimeout(function(){if(null!=g.wheelStartX){var a=i.scrollLeft-g.wheelStartX,b=i.scrollTop-g.wheelStartY,c=b&&g.wheelDY&&b/g.wheelDY||a&&g.wheelDX&&a/g.wheelDX;g.wheelStartX=g.wheelStartY=null,c&&(bc=(bc*ac+c)/(ac+1),++ac)}},200)):(g.wheelDX+=d,g.wheelDY+=f))}}function dc(a,b,c){if("string"==typeof b&&(b=id[b],!b))return!1;a.display.pollingFast&&Kb(a)&&(a.display.pollingFast=!1);var d=a.doc,e=d.sel.shift,f=!1;try{Nb(a)&&(a.state.suppressEdits=!0),c&&(d.sel.shift=!1),f=b(a)!=Ve}finally{d.sel.shift=e,a.state.suppressEdits=!1}return f}function ec(a){var b=a.state.keyMaps.slice(0);return a.options.extraKeys&&b.push(a.options.extraKeys),b.push(a.options.keyMap),b}function gc(a,b){var c=kd(a.options.keyMap),e=c.auto;clearTimeout(fc),e&&!md(b)&&(fc=setTimeout(function(){kd(a.options.keyMap)==c&&(a.options.keyMap=e.call?e.call(null,a):e,C(a))},50));var f=nd(b,!0),g=!1;if(!f)return!1;var h=ec(a);return g=b.shiftKey?ld("Shift-"+f,h,function(b){return dc(a,b,!0)})||ld(f,h,function(b){return("string"==typeof b?/^go[A-Z]/.test(b):b.motion)?dc(a,b):void 0}):ld(f,h,function(b){return dc(a,b)}),g&&(Ee(b),_(a),d&&(b.oldKeyCode=b.keyCode,b.keyCode=0),Pe(a,"keyHandled",a,f,b)),g}function hc(a,b,c){var d=ld("'"+c+"'",ec(a),function(b){return dc(a,b,!0)});return d&&(Ee(b),_(a),Pe(a,"keyHandled",a,"'"+c+"'",b)),d}function jc(a){var c=this;if(c.state.focused||lc(c),!(Qe(c,a)||c.options.onKeyEvent&&c.options.onKeyEvent(c,De(a)))){b&&27==a.keyCode&&(a.returnValue=!1);var d=a.keyCode;c.doc.sel.shift=16==d||a.shiftKey;var e=gc(c,a);h&&(ic=e?d:null,!e&&88==d&&!xf&&(p?a.metaKey:a.ctrlKey)&&c.replaceSelection(""))}}function kc(a){var c=this;if(!(Qe(c,a)||c.options.onKeyEvent&&c.options.onKeyEvent(c,De(a)))){var e=a.keyCode,f=a.charCode;if(h&&e==ic)return ic=null,Ee(a),void 0;if(!(h&&(!a.which||a.which<10)||j)||!gc(c,a)){var g=String.fromCharCode(null==f?e:f);this.options.electricChars&&this.doc.mode.electricChars&&this.options.smartIndent&&!Nb(this)&&this.doc.mode.electricChars.indexOf(g)>-1&&setTimeout(Eb(c,function(){Tc(c,c.doc.sel.to.line,"smart")}),75),hc(c,a,g)||(b&&!d&&(c.display.inputHasSelection=null),Jb(c))}}}function lc(a){"nocursor"!=a.options.readOnly&&(a.state.focused||(Me(a,"focus",a),a.state.focused=!0,-1==a.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(a.display.wrapper.className+=" CodeMirror-focused"),a.curOp||(Lb(a,!0),e&&setTimeout(ef(Lb,a,!0),0))),Ib(a),_(a))}function mc(a){a.state.focused&&(Me(a,"blur",a),a.state.focused=!1,a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-focused","")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.doc.sel.shift=!1)},150)}function oc(a,c){function k(){if(null!=e.input.selectionStart){var a=e.input.value="\u200b"+(Bc(f.from,f.to)?"":e.input.value);e.prevInput="\u200b",e.input.selectionStart=1,e.input.selectionEnd=a.length}}function l(){if(e.inputDiv.style.position="relative",e.input.style.cssText=j,d&&(e.scrollbarV.scrollTop=e.scroller.scrollTop=i),Ib(a),null!=e.input.selectionStart){(!b||d)&&k(),clearTimeout(nc);var c=0,f=function(){" "==e.prevInput&&0==e.input.selectionStart?Eb(a,id.selectAll)(a):c++<10?nc=setTimeout(f,500):Lb(a)};nc=setTimeout(f,200)}}if(!Qe(a,c,"contextmenu")){var e=a.display,f=a.doc.sel;if(!Pb(e,c)&&!Vb(a,c)){var g=Qb(a,c),i=e.scroller.scrollTop;if(g&&!h){(Bc(f.from,f.to)||Cc(g,f.from)||!Cc(g,f.to))&&Eb(a,Kc)(a.doc,g,g);var j=e.input.style.cssText;if(e.inputDiv.style.position="absolute",e.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(c.clientY-5)+"px; left: "+(c.clientX-5)+"px; z-index: 1000; background: white; outline: none;"+"border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);",Mb(a),Lb(a,!0),Bc(f.from,f.to)&&(e.input.value=e.prevInput=" "),b&&!d&&k(),t){He(c);var m=function(){Le(window,"mouseup",m),setTimeout(l,20)};Ke(window,"mouseup",m)}else setTimeout(l,50)}}}}function qc(a,b,c){if(!Cc(b.from,c))return Fc(a,c);var d=b.text.length-1-(b.to.line-b.from.line);if(c.line>b.to.line+d){var e=c.line-d,f=a.first+a.size-1;return e>f?Ac(f,ke(a,f).text.length):Gc(c,ke(a,e).text.length)}if(c.line==b.to.line+d)return Gc(c,$e(b.text).length+(1==b.text.length?b.from.ch:0)+ke(a,b.to.line).text.length-b.to.ch);var g=c.line-b.from.line;return Gc(c,b.text[g].length+(g?0:b.from.ch))}function rc(a,b,c){if(c&&"object"==typeof c)return{anchor:qc(a,b,c.anchor),head:qc(a,b,c.head)};if("start"==c)return{anchor:b.from,head:b.from};var d=pc(b);if("around"==c)return{anchor:b.from,head:d};if("end"==c)return{anchor:d,head:d};var e=function(a){if(Cc(a,b.from))return a;if(!Cc(b.to,a))return d;var c=a.line+b.text.length-(b.to.line-b.from.line)-1,e=a.ch;return a.line==b.to.line&&(e+=d.ch-b.to.ch),Ac(c,e)};return{anchor:e(a.sel.anchor),head:e(a.sel.head)}}function sc(a,b,c){var d={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};return c&&(d.update=function(b,c,d,e){b&&(this.from=Fc(a,b)),c&&(this.to=Fc(a,c)),d&&(this.text=d),void 0!==e&&(this.origin=e)}),Me(a,"beforeChange",a,d),a.cm&&Me(a.cm,"beforeChange",a.cm,d),d.canceled?null:{from:d.from,to:d.to,text:d.text,origin:d.origin}}function tc(a,b,c,d){if(a.cm){if(!a.cm.curOp)return Eb(a.cm,tc)(a,b,c,d);if(a.cm.state.suppressEdits)return}if(!(Se(a,"beforeChange")||a.cm&&Se(a.cm,"beforeChange"))||(b=sc(a,b,!0))){var e=u&&!d&&Ad(a,b.from,b.to);if(e){for(var f=e.length-1;f>=1;--f)uc(a,{from:e[f].from,to:e[f].to,text:[""]});e.length&&uc(a,{from:e[0].from,to:e[0].to,text:b.text},c)}else uc(a,b,c)}}function uc(a,b,c){if(1!=b.text.length||""!=b.text[0]||!Bc(b.from,b.to)){var d=rc(a,b,c);ve(a,b,d,a.cm?a.cm.curOp.id:0/0),xc(a,b,d,yd(a,b));var e=[];ie(a,function(a,c){c||-1!=af(e,a.history)||(Be(a.history,b),e.push(a.history)),xc(a,b,null,yd(a,b))})}}function vc(a,b){if(!a.cm||!a.cm.state.suppressEdits){var c=a.history,d=("undo"==b?c.done:c.undone).pop();if(d){var e={changes:[],anchorBefore:d.anchorAfter,headBefore:d.headAfter,anchorAfter:d.anchorBefore,headAfter:d.headBefore,generation:c.generation};("undo"==b?c.undone:c.done).push(e),c.generation=d.generation||++c.maxGeneration;for(var f=Se(a,"beforeChange")||a.cm&&Se(a.cm,"beforeChange"),g=d.changes.length-1;g>=0;--g){var h=d.changes[g];if(h.origin=b,f&&!sc(a,h,!1))return("undo"==b?c.done:c.undone).length=0,void 0;e.changes.push(ue(a,h));var i=g?rc(a,h,null):{anchor:d.anchorBefore,head:d.headBefore};xc(a,h,i,zd(a,h));var j=[];ie(a,function(a,b){b||-1!=af(j,a.history)||(Be(a.history,h),j.push(a.history)),xc(a,h,null,zd(a,h))})}}}}function wc(a,b){function c(a){return Ac(a.line+b,a.ch)}a.first+=b,a.cm&&Hb(a.cm,a.first,a.first,b),a.sel.head=c(a.sel.head),a.sel.anchor=c(a.sel.anchor),a.sel.from=c(a.sel.from),a.sel.to=c(a.sel.to)}function xc(a,b,c,d){if(a.cm&&!a.cm.curOp)return Eb(a.cm,xc)(a,b,c,d);if(b.to.line<a.first)return wc(a,b.text.length-1-(b.to.line-b.from.line)),void 0;if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);wc(a,e),b={from:Ac(a.first,0),to:Ac(b.to.line+e,b.to.ch),text:[$e(b.text)],origin:b.origin}}var f=a.lastLine();b.to.line>f&&(b={from:b.from,to:Ac(f,ke(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=le(a,b.from,b.to),c||(c=rc(a,b,null)),a.cm?yc(a.cm,b,d,c):be(a,b,d,c)}}function yc(a,b,c,d){var e=a.doc,f=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=oe(Ed(e,ke(e,g.line))),e.iter(j,h.line+1,function(a){return a==f.maxLine?(i=!0,!0):void 0})),Cc(e.sel.head,b.from)||Cc(b.to,e.sel.head)||(a.curOp.cursorActivity=!0),be(e,b,c,d,A(a)),a.options.lineWrapping||(e.iter(j,g.line+b.text.length,function(a){var b=G(e,a);b>f.maxLineLength&&(f.maxLine=a,f.maxLineLength=b,f.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),e.frontier=Math.min(e.frontier,g.line),ab(a,400);var k=b.text.length-(h.line-g.line)-1;if(Hb(a,g.line,h.line+1,k),Se(a,"change")){var l={from:g,to:h,text:b.text,removed:b.removed,origin:b.origin};if(a.curOp.textChanged){for(var m=a.curOp.textChanged;m.next;m=m.next);m.next=l}else a.curOp.textChanged=l}}function zc(a,b,c,d,e){if(d||(d=c),Cc(d,c)){var f=d;d=c,c=f}"string"==typeof b&&(b=vf(b)),tc(a,{from:c,to:d,text:b,origin:e},null)}function Ac(a,b){return this instanceof Ac?(this.line=a,this.ch=b,void 0):new Ac(a,b)}function Bc(a,b){return a.line==b.line&&a.ch==b.ch}function Cc(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function Dc(a){return Ac(a.line,a.ch)}function Ec(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function Fc(a,b){if(b.line<a.first)return Ac(a.first,0);var c=a.first+a.size-1;return b.line>c?Ac(c,ke(a,c).text.length):Gc(b,ke(a,b.line).text.length)}function Gc(a,b){var c=a.ch;return null==c||c>b?Ac(a.line,b):0>c?Ac(a.line,0):a}function Hc(a,b){return b>=a.first&&b<a.first+a.size}function Ic(a,b,c,d){if(a.sel.shift||a.sel.extend){var e=a.sel.anchor;if(c){var f=Cc(b,e);f!=Cc(c,e)?(e=b,b=c):f!=Cc(b,c)&&(b=c)}Kc(a,e,b,d)}else Kc(a,b,c||b,d);a.cm&&(a.cm.curOp.userSelChange=!0)}function Jc(a,b,c){var d={anchor:b,head:c};return Me(a,"beforeSelectionChange",a,d),a.cm&&Me(a.cm,"beforeSelectionChange",a.cm,d),d.anchor=Fc(a,d.anchor),d.head=Fc(a,d.head),d}function Kc(a,b,c,d,e){if(!e&&Se(a,"beforeSelectionChange")||a.cm&&Se(a.cm,"beforeSelectionChange")){var f=Jc(a,b,c);c=f.head,b=f.anchor}var g=a.sel;if(g.goalColumn=null,null==d&&(d=Cc(c,g.head)?-1:1),(e||!Bc(b,g.anchor))&&(b=Mc(a,b,d,"push"!=e)),(e||!Bc(c,g.head))&&(c=Mc(a,c,d,"push"!=e)),!Bc(g.anchor,b)||!Bc(g.head,c)){g.anchor=b,g.head=c;var h=Cc(c,b);g.from=h?c:b,g.to=h?b:c,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=a.cm.curOp.cursorActivity=!0),Pe(a,"cursorActivity",a)}}function Lc(a){Kc(a.doc,a.doc.sel.from,a.doc.sel.to,null,"push")}function Mc(a,b,c,d){var e=!1,f=b,g=c||1;a.cantEdit=!1;a:for(;;){var h=ke(a,f.line);if(h.markedSpans)for(var i=0;i<h.markedSpans.length;++i){var j=h.markedSpans[i],k=j.marker;if((null==j.from||(k.inclusiveLeft?j.from<=f.ch:j.from<f.ch))&&(null==j.to||(k.inclusiveRight?j.to>=f.ch:j.to>f.ch))){if(d&&(Me(k,"beforeCursorEnter"),k.explicitlyCleared)){if(h.markedSpans){--i;continue}break}if(!k.atomic)continue;var l=k.find()[0>g?"from":"to"];if(Bc(l,f)&&(l.ch+=g,l.ch<0?l=l.line>a.first?Fc(a,Ac(l.line-1)):null:l.ch>h.text.length&&(l=l.line<a.first+a.size-1?Ac(l.line+1,0):null),!l)){if(e)return d?(a.cantEdit=!0,Ac(a.first,0)):Mc(a,b,c,!0);e=!0,l=b,g=-g}f=l;continue a}}return f}}function Nc(a){var b=Oc(a,a.doc.sel.head,a.options.cursorScrollMargin);if(a.state.focused){var c=a.display,d=of(c.sizer),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!m){var f="none"==c.cursor.style.display;f&&(c.cursor.style.display="",c.cursor.style.left=b.left+"px",c.cursor.style.top=b.top-c.viewOffset+"px"),c.cursor.scrollIntoView(e),f&&(c.cursor.style.display="none")}}}function Oc(a,b,c){for(null==c&&(c=0);;){var d=!1,e=ub(a,b),f=Qc(a,e.left,e.top-c,e.left,e.bottom+c),g=a.doc.scrollTop,h=a.doc.scrollLeft;if(null!=f.scrollTop&&($b(a,f.scrollTop),Math.abs(a.doc.scrollTop-g)>1&&(d=!0)),null!=f.scrollLeft&&(_b(a,f.scrollLeft),Math.abs(a.doc.scrollLeft-h)>1&&(d=!0)),!d)return e}}function Pc(a,b,c,d,e){var f=Qc(a,b,c,d,e);null!=f.scrollTop&&$b(a,f.scrollTop),null!=f.scrollLeft&&_b(a,f.scrollLeft)}function Qc(a,b,c,d,e){var f=a.display,g=zb(a.display);0>c&&(c=0);var h=f.scroller.clientHeight-Ue,i=f.scroller.scrollTop,j={},k=a.doc.height+fb(f),l=g>c,m=e>k-g;if(i>c)j.scrollTop=l?0:c;else if(e>i+h){var n=Math.min(c,(m?k:e)-h);n!=i&&(j.scrollTop=n)}var o=f.scroller.clientWidth-Ue,p=f.scroller.scrollLeft;b+=f.gutters.offsetWidth,d+=f.gutters.offsetWidth;var q=f.gutters.offsetWidth,r=q+10>b;return p+q>b||r?(r&&(b=0),j.scrollLeft=Math.max(0,b-10-q)):d>o+p-3&&(j.scrollLeft=d+10-o),j}function Rc(a,b,c){a.curOp.updateScrollPos={scrollLeft:null==b?a.doc.scrollLeft:b,scrollTop:null==c?a.doc.scrollTop:c}}function Sc(a,b,c){var d=a.curOp.updateScrollPos||(a.curOp.updateScrollPos={scrollLeft:a.doc.scrollLeft,scrollTop:a.doc.scrollTop}),e=a.display.scroller;d.scrollTop=Math.max(0,Math.min(e.scrollHeight-e.clientHeight,d.scrollTop+c)),d.scrollLeft=Math.max(0,Math.min(e.scrollWidth-e.clientWidth,d.scrollLeft+b))}function Tc(a,b,c,d){var e=a.doc;if(null==c&&(c="add"),"smart"==c)if(a.doc.mode.indent)var f=db(a,b);else c="prev";var k,g=a.options.tabSize,h=ke(e,b),i=Xe(h.text,null,g),j=h.text.match(/^\s*/)[0];if("smart"==c&&(k=a.doc.mode.indent(f,h.text.slice(j.length),h.text),k==Ve)){if(!d)return;c="prev"}"prev"==c?k=b>e.first?Xe(ke(e,b-1).text,null,g):0:"add"==c?k=i+a.options.indentUnit:"subtract"==c?k=i-a.options.indentUnit:"number"==typeof c&&(k=i+c),k=Math.max(0,k);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(k/g);n;--n)m+=g,l+=" ";k>m&&(l+=Ze(k-m)),l!=j&&zc(a.doc,l,Ac(b,0),Ac(b,j.length),"+input"),h.stateAfter=null}function Uc(a,b,c){var d=b,e=b,f=a.doc;return"number"==typeof b?e=ke(f,Ec(f,b)):d=oe(b),null==d?null:c(e,d)?(Hb(a,d,d+1),e):null}function Vc(a,b,c,d,e){function k(){var b=f+c;return b<a.first||b>=a.first+a.size?j=!1:(f=b,i=ke(a,b))}function l(a){var b=(e?Kf:Lf)(i,g,c,!0);if(null==b){if(a||!k())return j=!1;g=e?(0>c?Df:Cf)(i):0>c?i.text.length:0}else g=b;return!0}var f=b.line,g=b.ch,h=c,i=ke(a,f),j=!0;if("char"==d)l();else if("column"==d)l(!0);else if("word"==d||"group"==d)for(var m=null,n="group"==d,o=!0;!(0>c)||l(!o);o=!1){var p=i.text.charAt(g)||"\n",q=gf(p)?"w":n?/\s/.test(p)?null:"p":null;if(m&&m!=q){0>c&&(c=1,l());break}if(q&&(m=q),c>0&&!l(!o))break}var r=Mc(a,Ac(f,g),h,!0);return j||(r.hitSide=!0),r}function Wc(a,b,c,d){var g,e=a.doc,f=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);g=b.top+c*(h-(0>c?1.5:.5)*zb(a.display))}else"line"==d&&(g=c>0?b.bottom+3:b.top-3);for(;;){var i=wb(a,f,g);if(!i.outside)break;if(0>c?0>=g:g>=e.height){i.hitSide=!0;break}g+=5*c}return i}function Xc(a,b){var c=b.ch,d=b.ch;if(a){(b.xRel<0||d==a.length)&&c?--c:++d;for(var e=a.charAt(c),f=gf(e)?gf:/\s/.test(e)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!gf(a)};c>0&&f(a.charAt(c-1));)--c;for(;d<a.length&&f(a.charAt(d));)++d}return{from:Ac(b.line,c),to:Ac(b.line,d)}}function Yc(a,b){Ic(a.doc,Ac(b,0),Fc(a.doc,Ac(b+1,0)))}function _c(a,b,c,d){w.defaults[a]=b,c&&(Zc[a]=d?function(a,b,d){d!=ad&&c(a,b,d)}:c)}function gd(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c}function hd(a,b,c){return a.startState?a.startState(b,c):!0}function kd(a){return"string"==typeof a?jd[a]:a}function ld(a,b,c){function d(b){b=kd(b);var e=b[a];if(e===!1)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";var f=b.fallthrough;if(null==f)return!1;if("[object Array]"!=Object.prototype.toString.call(f))return d(f);for(var g=0,h=f.length;h>g;++g){var i=d(f[g]);if(i)return i}return!1}for(var e=0;e<b.length;++e){var f=d(b[e]);if(f)return"stop"!=f}}function md(a){var b=yf[a.keyCode];return"Ctrl"==b||"Alt"==b||"Shift"==b||"Mod"==b}function nd(a,b){if(h&&34==a.keyCode&&a["char"])return!1;var c=yf[a.keyCode];return null==c||a.altGraphKey?!1:(a.altKey&&(c="Alt-"+c),(s?a.metaKey:a.ctrlKey)&&(c="Ctrl-"+c),(s?a.ctrlKey:a.metaKey)&&(c="Cmd-"+c),!b&&a.shiftKey&&(c="Shift-"+c),c)}function od(a,b){this.pos=this.start=0,this.string=a,this.tabSize=b||8,this.lastColumnPos=this.lastColumnValue=0}function pd(a,b){this.lines=[],this.type=b,this.doc=a}function qd(a,b,c,d,e){if(d&&d.shared)return sd(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return Eb(a.cm,qd)(a,b,c,d,e);var f=new pd(a,e);if("range"==e&&!Cc(b,c))return f;d&&cf(d,f),f.replacedWith&&(f.collapsed=!0,f.replacedWith=kf("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||(f.replacedWith.ignoreEvents=!0)),f.collapsed&&(v=!0),f.addToHistory&&ve(a,{from:b,to:c,origin:"markText"},{head:a.sel.head,anchor:a.sel.anchor},0/0);var i,j,l,g=b.line,h=0,k=a.cm;if(a.iter(g,c.line+1,function(d){k&&f.collapsed&&!k.options.lineWrapping&&Ed(a,d)==k.display.maxLine&&(l=!0);var e={from:null,to:null,marker:f};h+=d.text.length,g==b.line&&(e.from=b.ch,h-=b.ch),g==c.line&&(e.to=c.ch,h-=d.text.length-c.ch),f.collapsed&&(g==c.line&&(j=Bd(d,c.ch)),g==b.line?i=Bd(d,b.ch):ne(d,0)),vd(d,e),++g}),f.collapsed&&a.iter(b.line,c.line+1,function(b){Fd(a,b)&&ne(b,0)}),f.clearOnEnter&&Ke(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(u=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed){if(i!=j)throw new Error("Inserting collapsed marker overlapping an existing one");f.size=h,f.atomic=!0}return k&&(l&&(k.curOp.updateMaxLine=!0),(f.className||f.title||f.startStyle||f.endStyle||f.collapsed)&&Hb(k,b.line,c.line+1),f.atomic&&Lc(k)),f}function rd(a,b){this.markers=a,this.primary=b;for(var c=0,d=this;c<a.length;++c)a[c].parent=this,Ke(a[c],"clear",function(){d.clear()})}function sd(a,b,c,d,e){d=cf(d),d.shared=!1;var f=[qd(a,b,c,d,e)],g=f[0],h=d.replacedWith;return ie(a,function(a){h&&(d.replacedWith=h.cloneNode(!0)),f.push(qd(a,Fc(a,b),Fc(a,c),d,e));for(var i=0;i<a.linked.length;++i)if(a.linked[i].isParent)return;g=$e(f)}),new rd(f,g)}function td(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function ud(a,b){for(var c,d=0;d<a.length;++d)a[d]!=b&&(c||(c=[])).push(a[d]);return c}function vd(a,b){a.markedSpans=a.markedSpans?a.markedSpans.concat([b]):[b],b.marker.attachLine(a)}function wd(a,b,c){if(a)for(var e,d=0;d<a.length;++d){var f=a[d],g=f.marker,h=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);if(h||"bookmark"==g.type&&f.from==b&&(!c||!f.marker.insertLeft)){var i=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);(e||(e=[])).push({from:f.from,to:i?null:f.to,marker:g})}}return e}function xd(a,b,c){if(a)for(var e,d=0;d<a.length;++d){var f=a[d],g=f.marker,h=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);if(h||"bookmark"==g.type&&f.from==b&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);(e||(e=[])).push({from:i?null:f.from-b,to:null==f.to?null:f.to-b,marker:g})}}return e}function yd(a,b){var c=Hc(a,b.from.line)&&ke(a,b.from.line).markedSpans,d=Hc(a,b.to.line)&&ke(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=Bc(b.from,b.to),h=wd(c,e,g),i=xd(d,f,g),j=1==b.text.length,k=$e(b.text).length+(j?e:0);if(h)for(var l=0;l<h.length;++l){var m=h[l];if(null==m.to){var n=td(i,m.marker);n?j&&(m.to=null==n.to?null:n.to+k):m.to=e}}if(i)for(var l=0;l<i.length;++l){var m=i[l];if(null!=m.to&&(m.to+=k),null==m.from){var n=td(h,m.marker);n||(m.from=k,j&&(h||(h=[])).push(m))}else m.from+=k,j&&(h||(h=[])).push(m)}if(j&&h){for(var l=0;l<h.length;++l)null!=h[l].from&&h[l].from==h[l].to&&"bookmark"!=h[l].marker.type&&h.splice(l--,1);h.length||(h=null)}var o=[h];if(!j){var q,p=b.text.length-2;if(p>0&&h)for(var l=0;l<h.length;++l)null==h[l].to&&(q||(q=[])).push({from:null,to:null,marker:h[l].marker});for(var l=0;p>l;++l)o.push(q);o.push(i)}return o}function zd(a,b){var c=xe(a,b),d=yd(a,b);if(!c)return d;if(!d)return c;for(var e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g)a:for(var h=0;h<g.length;++h){for(var i=g[h],j=0;j<f.length;++j)if(f[j].marker==i.marker)continue a;f.push(i)}else g&&(c[e]=g)}return c}function Ad(a,b,c){var d=null;if(a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=af(d,c)||(d||(d=[])).push(c)}}),!d)return null;for(var e=[{from:b,to:c}],f=0;f<d.length;++f)for(var g=d[f],h=g.find(),i=0;i<e.length;++i){var j=e[i];if(!Cc(j.to,h.from)&&!Cc(h.to,j.from)){var k=[i,1];(Cc(j.from,h.from)||!g.inclusiveLeft&&Bc(j.from,h.from))&&k.push({from:j.from,to:h.from}),(Cc(h.to,j.to)||!g.inclusiveRight&&Bc(j.to,h.to))&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function Bd(a,b){var d,c=v&&a.markedSpans;if(c)for(var e,f=0;f<c.length;++f)e=c[f],e.marker.collapsed&&(null==e.from||e.from<b)&&(null==e.to||e.to>b)&&(!d||d.width<e.marker.width)&&(d=e.marker);return d}function Cd(a){return Bd(a,-1)}function Dd(a){return Bd(a,a.text.length+1)}function Ed(a,b){for(var c;c=Cd(b);)b=ke(a,c.find().from.line);return b}function Fd(a,b){var c=v&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed){if(null==d.from)return!0;if(!d.marker.replacedWith&&0==d.from&&d.marker.inclusiveLeft&&Gd(a,b,d))return!0}}function Gd(a,b,c){if(null==c.to){var d=c.marker.find().to,e=ke(a,d.line);return Gd(a,e,td(e.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var f,g=0;g<b.markedSpans.length;++g)if(f=b.markedSpans[g],f.marker.collapsed&&!f.marker.replacedWith&&f.from==c.to&&(f.marker.inclusiveLeft||c.marker.inclusiveRight)&&Gd(a,b,f))return!0}function Hd(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function Id(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function Kd(a){return function(){var b=!this.cm.curOp;b&&Cb(this.cm);try{var c=a.apply(this,arguments)}finally{b&&Db(this.cm)}return c}}function Ld(a){return null!=a.height?a.height:(a.node.parentNode&&1==a.node.parentNode.nodeType||mf(a.cm.display.measure,kf("div",[a.node],null,"position: relative")),a.height=a.node.offsetHeight)}function Md(a,b,c,d){var e=new Jd(a,c,d);return e.noHScroll&&(a.display.alignWidgets=!0),Uc(a,b,function(b){var c=b.widgets||(b.widgets=[]);if(null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e),e.line=b,!Fd(a.doc,b)||e.showIfHidden){var d=qe(a,b)<a.doc.scrollTop;ne(b,b.height+Ld(e)),d&&Sc(a,0,e.height)}return!0}),e}function Od(a,b,c,d){a.text=b,a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null),null!=a.order&&(a.order=null),Hd(a),Id(a,c);var e=d?d(a):1;e!=a.height&&ne(a,e)}function Pd(a){a.parent=null,Hd(a)}function Qd(a,b,c,d,e){var f=c.flattenSpans;null==f&&(f=a.options.flattenSpans);var j,g=0,h=null,i=new od(b,a.options.tabSize);for(""==b&&c.blankLine&&c.blankLine(d);!i.eol();)i.pos>a.options.maxHighlightLength?(f=!1,i.pos=b.length,j=null):j=c.token(i,d),f&&h==j||(g<i.start&&e(i.start,h),g=i.start,h=j),i.start=i.pos;for(;g<i.pos;){var k=Math.min(i.pos,g+5e4);e(k,h),g=k}}function Rd(a,b,c){var d=[a.state.modeGen];Qd(a,b.text,a.doc.mode,c,function(a,b){d.push(a,b)});for(var e=0;e<a.state.overlays.length;++e){var f=a.state.overlays[e],g=1,h=0;Qd(a,b.text,f.mode,!0,function(a,b){for(var c=g;a>h;){var e=d[g];e>a&&d.splice(g,1,a,d[g+1],e),g+=2,h=Math.min(a,e)}if(b)if(f.opaque)d.splice(c,g-c,a,b),g=c+2;else for(;g>c;c+=2){var i=d[c+1];d[c+1]=i?i+" "+b:b}})}return d}function Sd(a,b){return b.styles&&b.styles[0]==a.state.modeGen||(b.styles=Rd(a,b,b.stateAfter=db(a,oe(b)))),b.styles}function Td(a,b,c){var d=a.doc.mode,e=new od(b.text,a.options.tabSize);for(""==b.text&&d.blankLine&&d.blankLine(c);!e.eol()&&e.pos<=a.options.maxHighlightLength;)d.token(e,c),e.start=e.pos}function Vd(a,b){if(!a)return null;for(;;){var c=a.match(/(?:^|\s)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:new RegExp("(?:^|s)"+c[2]+"(?:$|s)").test(b[d])||(b[d]+=" "+c[2])}return Ud[a]||(Ud[a]="cm-"+a.replace(/ +/g," cm-"))}function Wd(a,c,d,f){for(var g,h=c,i=!0;g=Cd(h);)h=ke(a.doc,g.find().from.line);var j={pre:kf("pre"),col:0,pos:0,measure:null,measuredSomething:!1,cm:a,copyWidgets:f};do{h.text&&(i=!1),j.measure=h==c&&d,j.pos=0,j.addToken=j.measure?Zd:Yd,(b||e)&&a.getOption("lineWrapping")&&(j.addToken=$d(j.addToken));var k=ae(h,j,Sd(a,h));d&&h==c&&!j.measuredSomething&&(d[0]=j.pre.appendChild(uf(a.display.measure)),j.measuredSomething=!0),k&&(h=ke(a.doc,k.to.line))}while(k);!d||j.measuredSomething||d[0]||(d[0]=j.pre.appendChild(i?kf("span","\xa0"):uf(a.display.measure))),j.pre.firstChild||Fd(a.doc,c)||j.pre.appendChild(document.createTextNode("\xa0"));var l;if(d&&b&&(l=re(h))){var m=l.length-1;l[m].from==l[m].to&&--m;var n=l[m],o=l[m-1];if(n.from+1==n.to&&o&&n.level<o.level){var p=d[j.pos-1];p&&p.parentNode.insertBefore(p.measureRight=uf(a.display.measure),p.nextSibling)}}var q=j.textClass?j.textClass+" "+(c.textClass||""):c.textClass;return q&&(j.pre.className=q),Me(a,"renderLine",a,c,j.pre),j}function Yd(a,b,c,d,e,f){if(b){if(Xd.test(b))for(var g=document.createDocumentFragment(),h=0;;){Xd.lastIndex=h;var i=Xd.exec(b),j=i?i.index-h:b.length-h;if(j&&(g.appendChild(document.createTextNode(b.slice(h,h+j))),a.col+=j),!i)break;if(h+=j+1," "==i[0]){var k=a.cm.options.tabSize,l=k-a.col%k;g.appendChild(kf("span",Ze(l),"cm-tab")),a.col+=l}else{var m=kf("span","\u2022","cm-invalidchar");m.title="\\u"+i[0].charCodeAt(0).toString(16),g.appendChild(m),a.col+=1}}else{a.col+=b.length;var g=document.createTextNode(b)}if(c||d||e||a.measure){var n=c||"";d&&(n+=d),e&&(n+=e);var m=kf("span",[g],n);return f&&(m.title=f),a.pre.appendChild(m)}a.pre.appendChild(g)}}function Zd(a,c,d,e,f){for(var g=a.cm.options.lineWrapping,h=0;h<c.length;++h){var i=c.charAt(h),j=0==h;i>="\ud800"&&"\udbff">i&&h<c.length-1?(i=c.slice(h,h+2),++h):h&&g&&qf(c,h)&&a.pre.appendChild(kf("wbr"));var k=a.measure[a.pos],l=a.measure[a.pos]=Yd(a,i,d,j&&e,h==c.length-1&&f);k&&(l.leftSide=k.leftSide||k),b&&g&&" "==i&&h&&!/\s/.test(c.charAt(h-1))&&h<c.length-1&&!/\s/.test(c.charAt(h+1))&&(l.style.whiteSpace="normal"),a.pos+=i.length}c.length&&(a.measuredSomething=!0)}function $d(a){function b(a){for(var b=" ",c=0;c<a.length-2;++c)b+=c%2?" ":"\xa0";return b+=" "}return function(c,d,e,f,g,h){return a(c,d.replace(/ {3,}/,b),e,f,g,h)}}function _d(a,b,c,d){var e=!d&&c.replacedWith;if(e&&(a.copyWidgets&&(e=e.cloneNode(!0)),a.pre.appendChild(e),a.measure)){if(b)a.measure[a.pos]=e;else{var f=uf(a.cm.display.measure);if("bookmark"!=c.type||c.insertLeft){if(a.measure[a.pos])return;a.measure[a.pos]=a.pre.insertBefore(f,e)}else a.measure[a.pos]=a.pre.appendChild(f)}a.measuredSomething=!0}a.pos+=b}function ae(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var k,m,n,o,p,q,h=e.length,i=0,g=1,j="",l=0;;){if(l==i){m=n=o=p="",q=null,l=1/0;for(var r=[],s=0;s<d.length;++s){var t=d[s],u=t.marker;t.from<=i&&(null==t.to||t.to>i)?(null!=t.to&&l>t.to&&(l=t.to,n=""),u.className&&(m+=" "+u.className),u.startStyle&&t.from==i&&(o+=" "+u.startStyle),u.endStyle&&t.to==l&&(n+=" "+u.endStyle),u.title&&!p&&(p=u.title),u.collapsed&&(!q||q.marker.size<u.size)&&(q=t)):t.from>i&&l>t.from&&(l=t.from),"bookmark"==u.type&&t.from==i&&u.replacedWith&&r.push(u)}if(q&&(q.from||0)==i&&(_d(b,(null==q.to?h:q.to)-i,q.marker,null==q.from),null==q.to))return q.marker.find();if(!q&&r.length)for(var s=0;s<r.length;++s)_d(b,0,r[s])}if(i>=h)break;for(var v=Math.min(h,l);;){if(j){var w=i+j.length;if(!q){var x=w>v?j.slice(0,v-i):j;b.addToken(b,x,k?k+m:m,o,i+x.length==l?n:"",p)}if(w>=v){j=j.slice(v-i),i=v;break}i=w,o=""}j=e.slice(f,f=c[g++]),k=Vd(c[g++],b)}}else for(var g=1;g<c.length;g+=2)b.addToken(b,e.slice(f,f=c[g]),Vd(c[g+1],b))}function be(a,b,c,d,e){function f(a){return c?c[a]:null}function g(a,c,d){Od(a,c,d,e),Pe(a,"change",a,b)
4
- }var h=b.from,i=b.to,j=b.text,k=ke(a,h.line),l=ke(a,i.line),m=$e(j),n=f(j.length-1),o=i.line-h.line;if(0==h.ch&&0==i.ch&&""==m){for(var p=0,q=j.length-1,r=[];q>p;++p)r.push(new Nd(j[p],f(p),e));g(l,l.text,n),o&&a.remove(h.line,o),r.length&&a.insert(h.line,r)}else if(k==l)if(1==j.length)g(k,k.text.slice(0,h.ch)+m+k.text.slice(i.ch),n);else{for(var r=[],p=1,q=j.length-1;q>p;++p)r.push(new Nd(j[p],f(p),e));r.push(new Nd(m+k.text.slice(i.ch),n,e)),g(k,k.text.slice(0,h.ch)+j[0],f(0)),a.insert(h.line+1,r)}else if(1==j.length)g(k,k.text.slice(0,h.ch)+j[0]+l.text.slice(i.ch),f(0)),a.remove(h.line+1,o);else{g(k,k.text.slice(0,h.ch)+j[0],f(0)),g(l,m+l.text.slice(i.ch),n);for(var p=1,q=j.length-1,r=[];q>p;++p)r.push(new Nd(j[p],f(p),e));o>1&&a.remove(h.line+1,o-1),a.insert(h.line+1,r)}Pe(a,"change",a,b),Kc(a,d.anchor,d.head,null,!0)}function ce(a){this.lines=a,this.parent=null;for(var b=0,c=a.length,d=0;c>b;++b)a[b].parent=this,d+=a[b].height;this.height=d}function de(a){this.children=a;for(var b=0,c=0,d=0,e=a.length;e>d;++d){var f=a[d];b+=f.chunkSize(),c+=f.height,f.parent=this}this.size=b,this.height=c,this.parent=null}function ie(a,b,c){function d(a,e,f){if(a.linked)for(var g=0;g<a.linked.length;++g){var h=a.linked[g];if(h.doc!=e){var i=f&&h.sharedHist;(!c||i)&&(b(h.doc,i),d(h.doc,a,i))}}}d(a,null,!0)}function je(a,b){if(b.cm)throw new Error("This document is already in use.");a.doc=b,b.cm=a,B(a),y(a),a.options.lineWrapping||H(a),a.options.mode=b.modeOption,Hb(a)}function ke(a,b){for(b-=a.first;!a.lines;)for(var c=0;;++c){var d=a.children[c],e=d.chunkSize();if(e>b){a=d;break}b-=e}return a.lines[b]}function le(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function me(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function ne(a,b){for(var c=b-a.height,d=a;d;d=d.parent)d.height+=c}function oe(a){if(null==a.parent)return null;for(var b=a.parent,c=af(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function pe(a,b){var c=a.first;a:do{for(var d=0,e=a.children.length;e>d;++d){var f=a.children[d],g=f.height;if(g>b){a=f;continue a}b-=g,c+=f.chunkSize()}return c}while(!a.lines);for(var d=0,e=a.lines.length;e>d;++d){var h=a.lines[d],i=h.height;if(i>b)break;b-=i}return c+d}function qe(a,b){b=Ed(a.doc,b);for(var c=0,d=b.parent,e=0;e<d.lines.length;++e){var f=d.lines[e];if(f==b)break;c+=f.height}for(var g=d.parent;g;d=g,g=d.parent)for(var e=0;e<g.children.length;++e){var h=g.children[e];if(h==d)break;c+=h.height}return c}function re(a){var b=a.order;return null==b&&(b=a.order=Mf(a.text)),b}function se(a){return{done:[],undone:[],undoDepth:1/0,lastTime:0,lastOp:null,lastOrigin:null,generation:a||1,maxGeneration:a||1}}function te(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function ue(a,b){var c={line:b.from.line,ch:b.from.ch},d={from:c,to:pc(b),text:le(a,b.from,b.to)};return te(a,d,b.from.line,b.to.line+1),ie(a,function(a){te(a,d,b.from.line,b.to.line+1)},!0),d}function ve(a,b,c,d){var e=a.history;e.undone.length=0;var f=+new Date,g=$e(e.done);if(g&&(e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastTime>f-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))){var h=$e(g.changes);Bc(b.from,b.to)&&Bc(b.from,h.to)?h.to=pc(b):g.changes.push(ue(a,b)),g.anchorAfter=c.anchor,g.headAfter=c.head}else for(g={changes:[ue(a,b)],generation:e.generation,anchorBefore:a.sel.anchor,headBefore:a.sel.head,anchorAfter:c.anchor,headAfter:c.head},e.done.push(g),e.generation=++e.maxGeneration;e.done.length>e.undoDepth;)e.done.shift();e.lastTime=f,e.lastOp=d,e.lastOrigin=b.origin}function we(a){if(!a)return null;for(var c,b=0;b<a.length;++b)a[b].marker.explicitlyCleared?c||(c=a.slice(0,b)):c&&c.push(a[b]);return c?c.length?c:null:a}function xe(a,b){var c=b["spans_"+a.id];if(!c)return null;for(var d=0,e=[];d<b.text.length;++d)e.push(we(c[d]));return e}function ye(a,b){for(var c=0,d=[];c<a.length;++c){var e=a[c],f=e.changes,g=[];d.push({changes:g,anchorBefore:e.anchorBefore,headBefore:e.headBefore,anchorAfter:e.anchorAfter,headAfter:e.headAfter});for(var h=0;h<f.length;++h){var j,i=f[h];if(g.push({from:i.from,to:i.to,text:i.text}),b)for(var k in i)(j=k.match(/^spans_(\d+)$/))&&af(b,Number(j[1]))>-1&&($e(g)[k]=i[k],delete i[k])}}return d}function ze(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function Ae(a,b,c,d){for(var e=0;e<a.length;++e){for(var f=a[e],g=!0,h=0;h<f.changes.length;++h){var i=f.changes[h];if(f.copied||(i.from=Dc(i.from),i.to=Dc(i.to)),c<i.from.line)i.from.line+=d,i.to.line+=d;else if(b<=i.to.line){g=!1;break}}f.copied||(f.anchorBefore=Dc(f.anchorBefore),f.headBefore=Dc(f.headBefore),f.anchorAfter=Dc(f.anchorAfter),f.readAfter=Dc(f.headAfter),f.copied=!0),g?(ze(f.anchorBefore),ze(f.headBefore),ze(f.anchorAfter),ze(f.headAfter)):(a.splice(0,e+1),e=0)}}function Be(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;Ae(a.done,c,d,e),Ae(a.undone,c,d,e)}function Ce(){He(this)}function De(a){return a.stop||(a.stop=Ce),a}function Ee(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Fe(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function Ge(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function He(a){Ee(a),Fe(a)}function Ie(a){return a.target||a.srcElement}function Je(a){var b=a.which;return null==b&&(1&a.button?b=1:2&a.button?b=3:4&a.button&&(b=2)),p&&a.ctrlKey&&1==b&&(b=3),b}function Ke(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var d=a._handlers||(a._handlers={}),e=d[b]||(d[b]=[]);e.push(c)}}function Le(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else{var d=a._handlers&&a._handlers[b];if(!d)return;for(var e=0;e<d.length;++e)if(d[e]==c){d.splice(e,1);break}}}function Me(a,b){var c=a._handlers&&a._handlers[b];if(c)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)}function Pe(a,b){function e(a){return function(){a.apply(null,d)}}var c=a._handlers&&a._handlers[b];if(c){var d=Array.prototype.slice.call(arguments,2);Ne||(++Oe,Ne=[],setTimeout(Re,0));for(var f=0;f<c.length;++f)Ne.push(e(c[f]))}}function Qe(a,b,c){return Me(a,c||b.type,a,b),Ge(b)||b.codemirrorIgnore}function Re(){--Oe;var a=Ne;Ne=null;for(var b=0;b<a.length;++b)a[b]()}function Se(a,b){var c=a._handlers&&a._handlers[b];return c&&c.length>0}function Te(a){a.prototype.on=function(a,b){Ke(this,a,b)},a.prototype.off=function(a,b){Le(this,a,b)}}function We(){this.id=null}function Xe(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));for(var f=d||0,g=e||0;b>f;++f)" "==a.charAt(f)?g+=c-g%c:++g;return g}function Ze(a){for(;Ye.length<=a;)Ye.push($e(Ye)+" ");return Ye[a]}function $e(a){return a[a.length-1]}function _e(a){if(n)a.selectionStart=0,a.selectionEnd=a.value.length;else try{a.select()}catch(b){}}function af(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;d>c;++c)if(a[c]==b)return c;return-1}function bf(a,b){function c(){}c.prototype=a;var d=new c;return b&&cf(b,d),d}function cf(a,b){b||(b={});for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function df(a){for(var b=[],c=0;a>c;++c)b.push(void 0);return b}function ef(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function gf(a){return/\w/.test(a)||a>"\x80"&&(a.toUpperCase()!=a.toLowerCase()||ff.test(a))}function hf(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function kf(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)nf(e,b);else if(b)for(var f=0;f<b.length;++f)e.appendChild(b[f]);return e}function lf(a){for(var b=a.childNodes.length;b>0;--b)a.removeChild(a.firstChild);return a}function mf(a,b){return lf(a).appendChild(b)}function nf(a,b){d?(a.innerHTML="",a.appendChild(document.createTextNode(b))):a.textContent=b}function of(a){return a.getBoundingClientRect()}function qf(){return!1}function sf(a){if(null!=rf)return rf;var b=kf("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return mf(a,b),b.offsetWidth&&(rf=b.offsetHeight-b.clientHeight),rf||0}function uf(a){if(null==tf){var b=kf("span","\u200b");mf(a,kf("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(tf=b.offsetWidth<=1&&b.offsetHeight>2&&!c)}return tf?kf("span","\u200b"):kf("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px")}function zf(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];(g.from<c&&g.to>b||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function Af(a){return a.level%2?a.to:a.from}function Bf(a){return a.level%2?a.from:a.to}function Cf(a){var b=re(a);return b?Af(b[0]):0}function Df(a){var b=re(a);return b?Bf($e(b)):a.text.length}function Ef(a,b){var c=ke(a.doc,b),d=Ed(a.doc,c);d!=c&&(b=oe(d));var e=re(d),f=e?e[0].level%2?Df(d):Cf(d):0;return Ac(b,f)}function Ff(a,b){for(var c,d;c=Dd(d=ke(a.doc,b));)b=c.find().to.line;var e=re(d),f=e?e[0].level%2?Cf(d):Df(d):d.text.length;return Ac(b,f)}function Gf(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function If(a,b){for(var d,c=0;c<a.length;++c){var e=a[c];if(e.from<b&&e.to>b)return Hf=null,c;if(e.from==b||e.to==b){if(null!=d)return Gf(a,e.level,a[d].level)?(Hf=d,c):(Hf=c,d);d=c}}return Hf=null,d}function Jf(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&jf.test(a.text.charAt(b)));return b}function Kf(a,b,c,d){var e=re(a);if(!e)return Lf(a,b,c,d);for(var f=If(e,b),g=e[f],h=Jf(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h<g.to)return h;if(h==g.from||h==g.to)return If(e,h)==f?h:(g=e[f+=c],c>0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?Jf(a,g.to,-1,d):Jf(a,g.from,1,d)}}function Lf(a,b,c,d){var e=b+c;if(d)for(;e>0&&jf.test(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var a=/gecko\/\d/i.test(navigator.userAgent),b=/MSIE \d/.test(navigator.userAgent),c=b&&(null==document.documentMode||document.documentMode<8),d=b&&(null==document.documentMode||document.documentMode<9),e=/WebKit\//.test(navigator.userAgent),f=e&&/Qt\/\d+\.\d+/.test(navigator.userAgent),g=/Chrome\//.test(navigator.userAgent),h=/Opera\//.test(navigator.userAgent),i=/Apple Computer/.test(navigator.vendor),j=/KHTML\//.test(navigator.userAgent),k=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),m=/PhantomJS/.test(navigator.userAgent),n=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),o=n||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),p=n||/Mac/.test(navigator.platform),q=/win/i.test(navigator.platform),r=h&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);r&&(r=Number(r[1])),r&&r>=15&&(h=!1,e=!0);var yb,Rb,Sb,s=p&&(f||h&&(null==r||12.11>r)),t=a||b&&!d,u=!1,v=!1,Bb=0,Xb=0,ac=0,bc=null;b?bc=-.53:a?bc=15:g?bc=-.7:i&&(bc=-1/3);var fc,nc,ic=null,pc=w.changeEnd=function(a){return a.text?Ac(a.from.line+a.text.length-1,$e(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};w.Pos=Ac,w.prototype={constructor:w,focus:function(){window.focus(),Mb(this),lc(this),Jb(this)},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,Zc.hasOwnProperty(a)&&Eb(this,Zc[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](a)},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(b[c]==a||"string"!=typeof b[c]&&b[c].name==a)return b.splice(c,1),!0},addOverlay:Eb(null,function(a,b){var c=a.token?a:w.getMode(this.options,a);if(c.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:c,modeSpec:a,opaque:b&&b.opaque}),this.state.modeGen++,Hb(this)}),removeOverlay:Eb(null,function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||"string"==typeof a&&d.name==a)return b.splice(c,1),this.state.modeGen++,Hb(this),void 0}}),indentLine:Eb(null,function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract"),Hc(this.doc,a)&&Tc(this,a,b,c)}),indentSelection:Eb(null,function(a){var b=this.doc.sel;if(Bc(b.from,b.to))return Tc(this,b.from.line,a);for(var c=b.to.line-(b.to.ch?0:1),d=b.from.line;c>=d;++d)Tc(this,d,a)}),getTokenAt:function(a,b){var c=this.doc;a=Fc(c,a);for(var d=db(this,a.line,b),e=this.doc.mode,f=ke(c,a.line),g=new od(f.text,this.options.tabSize);g.pos<a.ch&&!g.eol();){g.start=g.pos;var h=e.token(g,d)}return{start:g.start,end:g.pos,string:g.current(),className:h||null,type:h||null,state:d}},getTokenTypeAt:function(a){a=Fc(this.doc,a);var b=Sd(this,ke(this.doc,a.line)),c=0,d=(b.length-1)/2,e=a.ch;if(0==e)return b[2];for(;;){var f=c+d>>1;if((f?b[2*f-1]:0)>=e)d=f;else{if(!(b[2*f+1]<e))return b[2*f+2];c=f+1}}},getModeAt:function(a){var b=this.doc.mode;return b.innerMode?w.innerMode(b,this.getTokenAt(a).state).mode:b},getHelper:function(a,b){if(fd.hasOwnProperty(b)){var c=fd[b],d=this.getModeAt(a);return d[b]&&c[d[b]]||d.helperType&&c[d.helperType]||c[d.name]}},getStateAfter:function(a,b){var c=this.doc;return a=Ec(c,null==a?c.first+c.size-1:a),db(this,a+1,b)},cursorCoords:function(a,b){var c,d=this.doc.sel;return c=null==a?d.head:"object"==typeof a?Fc(this.doc,a):a?d.from:d.to,ub(this,c,b||"page")},charCoords:function(a,b){return tb(this,Fc(this.doc,a),b||"page")},coordsChar:function(a,b){return a=sb(this,a,b||"page"),wb(this,a.left,a.top)},lineAtHeight:function(a,b){return a=sb(this,{top:a,left:0},b||"page").top,pe(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b){var c=!1,d=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>d&&(a=d,c=!0);var e=ke(this.doc,a);return rb(this,ke(this.doc,a),{top:0,left:0},b||"page").top+(c?e.height:0)},defaultTextHeight:function(){return zb(this.display)},defaultCharWidth:function(){return Ab(this.display)},setGutterMarker:Eb(null,function(a,b,c){return Uc(this,a,function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&hf(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Eb(null,function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Hb(b,d,d+1),hf(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),addLineClass:Eb(null,function(a,b,c){return Uc(this,a,function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[d]){if(new RegExp("(?:^|\\s)"+c+"(?:$|\\s)").test(a[d]))return!1;a[d]+=" "+c}else a[d]=c;return!0})}),removeLineClass:Eb(null,function(a,b,c){return Uc(this,a,function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",e=a[d];if(!e)return!1;if(null==c)a[d]=null;else{var f=e.match(new RegExp("(?:^|\\s+)"+c+"(?:$|\\s+)"));if(!f)return!1;var g=f.index+f[0].length;a[d]=e.slice(0,f.index)+(f.index&&g!=e.length?" ":"")+e.slice(g)||null}return!0})}),addLineWidget:Eb(null,function(a,b,c){return Md(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!Hc(this.doc,a))return null;var b=a;if(a=ke(this.doc,a),!a)return null}else{var b=oe(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=ub(this,Fc(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Pc(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Eb(null,jc),execCommand:function(a){return id[a](this)},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=Fc(this.doc,a);b>f&&(g=Vc(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Eb(null,function(a,b){var d,c=this.doc.sel;d=c.shift||c.extend||Bc(c.from,c.to)?Vc(this.doc,c.head,a,b,this.options.rtlMoveVisually):0>a?c.from:c.to,Ic(this.doc,d,d,a)}),deleteH:Eb(null,function(a,b){var c=this.doc.sel;Bc(c.from,c.to)?zc(this.doc,"",c.from,Vc(this.doc,c.head,a,b,!1),"+delete"):zc(this.doc,"",c.from,c.to,"+delete"),this.curOp.userSelChange=!0}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=Fc(this.doc,a);b>g;++g){var i=ub(this,h,"div");if(null==f?f=i.left:i.left=f,h=Wc(this,i,e,c),h.hitSide)break}return h},moveV:Eb(null,function(a,b){var c=this.doc.sel,d=ub(this,c.head,"div");null!=c.goalColumn&&(d.left=c.goalColumn);var e=Wc(this,d,a,b);"page"==b&&Sc(this,0,tb(this,e,"div").top-d.top),Ic(this.doc,e,e,a),c.goalColumn=d.left}),toggleOverwrite:function(a){(null==a||a!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+=" CodeMirror-overwrite":this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite",""))},hasFocus:function(){return this.state.focused},scrollTo:Eb(null,function(a,b){Rc(this,a,b)}),getScrollInfo:function(){var a=this.display.scroller,b=Ue;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-b,width:a.scrollWidth-b,clientHeight:a.clientHeight-b,clientWidth:a.clientWidth-b}},scrollIntoView:Eb(null,function(a,b){"number"==typeof a&&(a=Ac(a,0)),b||(b=0);var c=a;a&&null==a.line||(this.curOp.scrollToPos=a?Fc(this.doc,a):this.doc.sel.head,this.curOp.scrollToPosMargin=b,c=ub(this,this.curOp.scrollToPos));var d=Qc(this,c.left,c.top-b,c.right,c.bottom+b);Rc(this,d.scrollLeft,d.scrollTop)}),setSize:Eb(null,function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(String(a))?a+"px":a}null!=a&&(this.display.wrapper.style.width=c(a)),null!=b&&(this.display.wrapper.style.height=c(b)),this.options.lineWrapping&&(this.display.measureLineCache.length=this.display.measureLineCachePos=0),this.curOp.forceUpdate=!0}),operation:function(a){return Gb(this,a)},refresh:Eb(null,function(){var a=null==this.display.cachedTextHeight;ob(this),Rc(this,this.doc.scrollLeft,this.doc.scrollTop),Hb(this),a&&B(this)}),swapDoc:Eb(null,function(a){var b=this.doc;return b.cm=null,je(this,a),ob(this),Lb(this,!0),Rc(this,a.scrollLeft,a.scrollTop),b}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Te(w);var Zc=w.optionHandlers={},$c=w.defaults={},ad=w.Init={toString:function(){return"CodeMirror.Init"}};_c("value","",function(a,b){a.setValue(b)},!0),_c("mode",null,function(a,b){a.doc.modeOption=b,y(a)},!0),_c("indentUnit",2,y,!0),_c("indentWithTabs",!1),_c("smartIndent",!0),_c("tabSize",4,function(a){y(a),ob(a),Hb(a)},!0),_c("electricChars",!0),_c("rtlMoveVisually",!q),_c("theme","default",function(a){D(a),E(a)},!0),_c("keyMap","default",C),_c("extraKeys",null),_c("onKeyEvent",null),_c("onDragEvent",null),_c("lineWrapping",!1,z,!0),_c("gutters",[],function(a){I(a.options),E(a)},!0),_c("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?O(a.display)+"px":"0",a.refresh()},!0),_c("coverGutterNextToScrollbar",!1,J,!0),_c("lineNumbers",!1,function(a){I(a.options),E(a)},!0),_c("firstLineNumber",1,E,!0),_c("lineNumberFormatter",function(a){return a},E,!0),_c("showCursorWhenSelecting",!1,Y,!0),_c("readOnly",!1,function(a,b){"nocursor"==b?(mc(a),a.display.input.blur()):b||Lb(a,!0)}),_c("dragDrop",!0),_c("cursorBlinkRate",530),_c("cursorScrollMargin",0),_c("cursorHeight",1),_c("workTime",100),_c("workDelay",100),_c("flattenSpans",!0),_c("pollInterval",100),_c("undoDepth",40,function(a,b){a.doc.history.undoDepth=b}),_c("historyEventDelay",500),_c("viewportMargin",10,function(a){a.refresh()},!0),_c("maxHighlightLength",1e4,function(a){y(a),a.refresh()},!0),_c("crudeMeasuringFrom",1e4),_c("moveInputWithCursor",!0,function(a,b){b||(a.display.inputDiv.style.top=a.display.inputDiv.style.left=0)}),_c("tabindex",null,function(a,b){a.display.input.tabIndex=b||""}),_c("autofocus",null);var bd=w.modes={},cd=w.mimeModes={};w.defineMode=function(a,b){if(w.defaults.mode||"null"==a||(w.defaults.mode=a),arguments.length>2){b.dependencies=[];for(var c=2;c<arguments.length;++c)b.dependencies.push(arguments[c])}bd[a]=b},w.defineMIME=function(a,b){cd[a]=b},w.resolveMode=function(a){if("string"==typeof a&&cd.hasOwnProperty(a))a=cd[a];else if(a&&"string"==typeof a.name&&cd.hasOwnProperty(a.name)){var b=cd[a.name];a=bf(b,a),a.name=b.name}else if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return w.resolveMode("application/xml");return"string"==typeof a?{name:a}:a||{name:"null"}},w.getMode=function(a,b){var b=w.resolveMode(b),c=bd[b.name];if(!c)return w.getMode(a,"text/plain");var d=c(a,b);if(dd.hasOwnProperty(b.name)){var e=dd[b.name];for(var f in e)e.hasOwnProperty(f)&&(d.hasOwnProperty(f)&&(d["_"+f]=d[f]),d[f]=e[f])}return d.name=b.name,d},w.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),w.defineMIME("text/plain","null");var dd=w.modeExtensions={};w.extendMode=function(a,b){var c=dd.hasOwnProperty(a)?dd[a]:dd[a]={};cf(b,c)},w.defineExtension=function(a,b){w.prototype[a]=b},w.defineDocExtension=function(a,b){fe.prototype[a]=b},w.defineOption=_c;var ed=[];w.defineInitHook=function(a){ed.push(a)};var fd=w.helpers={};w.registerHelper=function(a,b,c){fd.hasOwnProperty(a)||(fd[a]=w[a]={}),fd[a][b]=c},w.isWordChar=gf,w.copyState=gd,w.startState=hd,w.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state,a=c.mode}return c||{mode:a,state:b}};var id=w.commands={selectAll:function(a){a.setSelection(Ac(a.firstLine(),0),Ac(a.lastLine()))},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),d=!Bc(b,c);d||a.getLine(b.line).length!=b.ch?a.replaceRange("",b,d?c:Ac(b.line),"+delete"):a.replaceRange("",b,Ac(b.line+1,0),"+delete")},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",Ac(b,0),Ac(b),"+delete")},delLineLeft:function(a){var b=a.getCursor();a.replaceRange("",Ac(b.line,0),b,"+delete")},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.extendSelection(Ac(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(Ac(a.lastLine()))},goLineStart:function(a){a.extendSelection(Ef(a,a.getCursor().line))},goLineStartSmart:function(a){var b=a.getCursor(),c=Ef(a,b.line),d=a.getLineHandle(c.line),e=re(d);if(e&&0!=e[0].level)a.extendSelection(c);else{var f=Math.max(0,d.text.search(/\S/)),g=b.line==c.line&&b.ch<=f&&b.ch;a.extendSelection(Ac(c.line,g?0:f))}},goLineEnd:function(a){a.extendSelection(Ff(a,a.getCursor().line))},goLineRight:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:b},"div"))},goLineLeft:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:0,top:b},"div"))},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goGroupRight:function(a){a.moveH(1,"group")},goGroupLeft:function(a){a.moveH(-1,"group")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},delWordAfter:function(a){a.deleteH(1,"word")},delGroupBefore:function(a){a.deleteH(-1,"group")},delGroupAfter:function(a){a.deleteH(1,"group")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection(" ","end","+input")},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.replaceSelection(" ","end","+input")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line);b.ch>0&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),Ac(b.line,b.ch-1),Ac(b.line,b.ch+1))},newlineAndIndent:function(a){Eb(a,function(){a.replaceSelection("\n","end","+input"),a.indentLine(a.getCursor().line,null,!0)})()},toggleOverwrite:function(a){a.toggleOverwrite()}},jd=w.keyMap={};jd.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},jd.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","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",fallthrough:"basic"},jd.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","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":"delLineLeft",fallthrough:["basic","emacsy"]},jd["default"]=p?jd.macDefault:jd.pcDefault,jd.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"},w.lookupKey=ld,w.isModifierKey=md,w.keyName=nd,w.fromTextArea=function(a,b){function e(){a.value=i.getValue()}if(b||(b={}),b.value=a.value,!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex),!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder),null==b.autofocus){var c=document.body;try{c=document.activeElement}catch(d){}b.autofocus=c==a||null!=a.getAttribute("autofocus")&&c==document.body}if(a.form&&(Ke(a.form,"submit",e),!b.leaveSubmitMethodAlone)){var f=a.form,g=f.submit;try{var h=f.submit=function(){e(),f.submit=g,f.submit(),f.submit=h}}catch(d){}}a.style.display="none";var i=w(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);return i.save=e,i.getTextArea=function(){return a},i.toTextArea=function(){e(),a.parentNode.removeChild(i.getWrapperElement()),a.style.display="",a.form&&(Le(a.form,"submit",e),"function"==typeof a.form.submit&&(a.form.submit=g))},i},od.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a)var c=b==a;else var c=b&&(a.test?a.test(b):a(b));return c?(++this.pos,b):void 0},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Xe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue},indentation:function(){return Xe(this.string,null,this.tabSize)},match:function(a,b,c){if("string"!=typeof a){var f=this.string.slice(this.pos).match(a);return f&&f.index>0?null:(f&&b!==!1&&(this.pos+=f[0].length),f)}var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);return d(e)==d(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)}},w.StringStream=od,w.TextMarker=pd,Te(pd),pd.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&Cb(a),Se(this,"clear")){var c=this.find();c&&Pe(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;f<this.lines.length;++f){var g=this.lines[f],h=td(g.markedSpans,this);null!=h.to&&(e=oe(g)),g.markedSpans=ud(g.markedSpans,h),null!=h.from?d=oe(g):this.collapsed&&!Fd(this.doc,g)&&a&&ne(g,zb(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(var f=0;f<this.lines.length;++f){var i=Ed(a.doc,this.lines[f]),j=G(a.doc,i);j>a.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&Hb(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Lc(a)),b&&Db(a)}},pd.prototype.find=function(){for(var a,b,c=0;c<this.lines.length;++c){var d=this.lines[c],e=td(d.markedSpans,this);if(null!=e.from||null!=e.to){var f=oe(d);null!=e.from&&(a=Ac(f,e.from)),null!=e.to&&(b=Ac(f,e.to))}}return"bookmark"==this.type?a:a&&{from:a,to:b}},pd.prototype.changed=function(){var a=this.find(),b=this.doc.cm;if(a&&b){"bookmark"!=this.type&&(a=a.from);var c=ke(this.doc,a.line);if(jb(b,c),a.line>=b.display.showingFrom&&a.line<b.display.showingTo){for(var d=b.display.lineDiv.firstChild;d;d=d.nextSibling)if(d.lineObj==c){d.offsetHeight!=c.height&&ne(c,d.offsetHeight);break}Gb(b,function(){b.curOp.selectionChanged=b.curOp.forceUpdate=b.curOp.updateMaxLine=!0})}}},pd.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&-1!=af(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)},pd.prototype.detachLine=function(a){if(this.lines.splice(af(this.lines,a),1),!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;(b.maybeHiddenMarkers||(b.maybeHiddenMarkers=[])).push(this)}},w.SharedTextMarker=rd,Te(rd),rd.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();Pe(this,"clear")}},rd.prototype.find=function(){return this.primary.find()};var Jd=w.LineWidget=function(a,b,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.cm=a,this.node=b};Te(Jd),Jd.prototype.clear=Kd(function(){var a=this.line.widgets,b=oe(this.line);if(null!=b&&a){for(var c=0;c<a.length;++c)a[c]==this&&a.splice(c--,1);a.length||(this.line.widgets=null);var d=qe(this.cm,this.line)<this.cm.doc.scrollTop;ne(this.line,Math.max(0,this.line.height-Ld(this))),d&&Sc(this.cm,0,-this.height),Hb(this.cm,b,b+1)
5
- }}),Jd.prototype.changed=Kd(function(){var a=this.height;this.height=null;var b=Ld(this)-a;if(b){ne(this.line,this.line.height+b);var c=oe(this.line);Hb(this.cm,c,c+1)}});var Nd=w.Line=function(a,b,c){this.text=a,Id(this,b),this.height=c?c(this):1};Te(Nd);var Ud={},Xd=/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\uFEFF]/g;ce.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=a,d=a+b;d>c;++c){var e=this.lines[c];this.height-=e.height,Pd(e),Pe(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.splice.apply(a,[a.length,0].concat(this.lines))},insertInner:function(a,b,c){this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var d=0,e=b.length;e>d;++d)b[d].parent=this},iterN:function(a,b,c){for(var d=a+b;d>a;++a)if(c(this.lines[a]))return!0}},de.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize();if(e>a){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(this.size-b<25){var h=[];this.collapse(h),this.children=[new ce(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0,c=this.children.length;c>b;++b)this.children[b].collapse(a)},insertInner:function(a,b,c){this.size+=b.length,this.height+=c;for(var d=0,e=this.children.length;e>d;++d){var f=this.children[d],g=f.chunkSize();if(g>=a){if(f.insertInner(a,b,c),f.lines&&f.lines.length>50){for(;f.lines.length>50;){var h=f.lines.splice(f.lines.length-25,25),i=new ce(h);f.height-=i.height,this.children.splice(d+1,0,i),i.parent=this}this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new de(b);if(a.parent){a.size-=c.size,a.height-=c.height;var e=af(a.parent.children,a);a.parent.children.splice(e+1,0,c)}else{var d=new de(a.children);d.parent=a,a.children=[d,c],a=d}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0,e=this.children.length;e>d;++d){var f=this.children[d],g=f.chunkSize();if(g>a){var h=Math.min(b,g-a);if(f.iterN(a,h,c))return!0;if(0==(b-=h))break;a=0}else a-=g}}};var ee=0,fe=w.Doc=function(a,b,c){if(!(this instanceof fe))return new fe(a,b,c);null==c&&(c=0),de.call(this,[new ce([new Nd("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.history=se(),this.cleanGeneration=1,this.frontier=c;var d=Ac(c,0);this.sel={from:d,to:d,head:d,anchor:d,shift:!1,extend:!1,goalColumn:null},this.id=++ee,this.modeOption=b,"string"==typeof a&&(a=vf(a)),be(this,{from:d,to:d,text:a},null,{head:d,anchor:d})};fe.prototype=bf(de.prototype,{constructor:fe,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0,e=b.length;e>d;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=me(this,this.first,this.first+this.size);return a===!1?b:b.join(a||"\n")},setValue:function(a){var b=Ac(this.first,0),c=this.first+this.size-1;tc(this,{from:b,to:Ac(c,ke(this,c).text.length),text:vf(a),origin:"setValue"},{head:b,anchor:b},!0)},replaceRange:function(a,b,c,d){b=Fc(this,b),c=c?Fc(this,c):b,zc(this,a,b,c,d)},getRange:function(a,b,c){var d=le(this,Fc(this,a),Fc(this,b));return c===!1?d:d.join(c||"\n")},getLine:function(a){var b=this.getLineHandle(a);return b&&b.text},setLine:function(a,b){Hc(this,a)&&zc(this,b,Ac(a,0),Fc(this,Ac(a)))},removeLine:function(a){a?zc(this,"",Fc(this,Ac(a-1)),Fc(this,Ac(a))):zc(this,"",Ac(0,0),Fc(this,Ac(1,0)))},getLineHandle:function(a){return Hc(this,a)?ke(this,a):void 0},getLineNumber:function(a){return oe(a)},getLineHandleVisualStart:function(a){return"number"==typeof a&&(a=ke(this,a)),Ed(this,a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return Fc(this,a)},getCursor:function(a){var c,b=this.sel;return c=null==a||"head"==a?b.head:"anchor"==a?b.anchor:"end"==a||a===!1?b.to:b.from,Dc(c)},somethingSelected:function(){return!Bc(this.sel.head,this.sel.anchor)},setCursor:Fb(function(a,b,c){var d=Fc(this,"number"==typeof a?Ac(a,b||0):a);c?Ic(this,d):Kc(this,d,d)}),setSelection:Fb(function(a,b,c){Kc(this,Fc(this,a),Fc(this,b||a),c)}),extendSelection:Fb(function(a,b,c){Ic(this,Fc(this,a),b&&Fc(this,b),c)}),getSelection:function(a){return this.getRange(this.sel.from,this.sel.to,a)},replaceSelection:function(a,b,c){tc(this,{from:this.sel.from,to:this.sel.to,text:vf(a),origin:c},b||"around")},undo:Fb(function(){vc(this,"undo")}),redo:Fb(function(){vc(this,"redo")}),setExtending:function(a){this.sel.extend=a},historySize:function(){var a=this.history;return{undo:a.done.length,redo:a.undone.length}},clearHistory:function(){this.history=se(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration()},changeGeneration:function(){return this.history.lastOp=this.history.lastOrigin=null,this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:ye(this.history.done),undone:ye(this.history.undone)}},setHistory:function(a){var b=this.history=se(this.history.maxGeneration);b.done=a.done.slice(0),b.undone=a.undone.slice(0)},markText:function(a,b,c){return qd(this,Fc(this,a),Fc(this,b),c,"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft};return a=Fc(this,a),qd(this,a,a,c,"bookmark")},findMarksAt:function(a){a=Fc(this,a);var b=[],c=ke(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;d<c.length;++d)null!=c[d].from&&a.push(c[d].marker)}),a},posFromIndex:function(a){var b,c=this.first;return this.iter(function(d){var e=d.text.length+1;return e>a?(b=a,!0):(a-=e,++c,void 0)}),Fc(this,Ac(c,b))},indexFromPos:function(a){a=Fc(this,a);var b=a.ch;return a.line<this.first||a.ch<0?0:(this.iter(this.first,a.line,function(a){b+=a.text.length+1}),b)},copy:function(a){var b=new fe(me(this,this.first,this.first+this.size),this.modeOption,this.first);return b.scrollTop=this.scrollTop,b.scrollLeft=this.scrollLeft,b.sel={from:this.sel.from,to:this.sel.to,head:this.sel.head,anchor:this.sel.anchor,shift:this.sel.shift,extend:!1,goalColumn:this.sel.goalColumn},a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory())),b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from),null!=a.to&&a.to<c&&(c=a.to);var d=new fe(me(this,b,c),a.mode||this.modeOption,b);return a.sharedHist&&(d.history=this.history),(this.linked||(this.linked=[])).push({doc:d,sharedHist:a.sharedHist}),d.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}],d},unlinkDoc:function(a){if(a instanceof w&&(a=a.doc),this.linked)for(var b=0;b<this.linked.length;++b){var c=this.linked[b];if(c.doc==a){this.linked.splice(b,1),a.unlinkDoc(this);break}}if(a.history==this.history){var d=[a.id];ie(a,function(a){d.push(a.id)},!0),a.history=se(),a.history.done=ye(this.history.done,d),a.history.undone=ye(this.history.undone,d)}},iterLinkedDocs:function(a){ie(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),fe.prototype.eachLine=fe.prototype.iter;var ge="iter insert remove copy getEditor".split(" ");for(var he in fe.prototype)fe.prototype.hasOwnProperty(he)&&af(ge,he)<0&&(w.prototype[he]=function(a){return function(){return a.apply(this.doc,arguments)}}(fe.prototype[he]));Te(fe),w.e_stop=He,w.e_preventDefault=Ee,w.e_stopPropagation=Fe;var Ne,Oe=0;w.on=Ke,w.off=Le,w.signal=Me;var Ue=30,Ve=w.Pass={toString:function(){return"CodeMirror.Pass"}};We.prototype={set:function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)}},w.countColumn=Xe;var Ye=[""],ff=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,jf=/[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/;w.replaceGetRect=function(a){of=a};var pf=function(){if(d)return!1;var a=kf("div");return"draggable"in a||"dragDrop"in a}();a?qf=function(a,b){return 36==a.charCodeAt(b-1)&&39==a.charCodeAt(b)}:i&&!/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)?qf=function(a,b){return/\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(a.slice(b-1,b+1))}:e&&/Chrome\/(?:29|[3-9]\d|\d\d\d)\./.test(navigator.userAgent)?qf=function(a,b){var c=a.charCodeAt(b-1);return c>=8208&&8212>=c}:e&&(qf=function(a,b){if(b>1&&45==a.charCodeAt(b-1)){if(/\w/.test(a.charAt(b-2))&&/[^\-?\.]/.test(a.charAt(b)))return!0;if(b>2&&/[\d\.,]/.test(a.charAt(b-2))&&/[\d\.,]/.test(a.charAt(b)))return!1}return/[~!#%&*)=+}\]\\|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|\u2026[\w~`@#$%\^&*(_=+{[><]/.test(a.slice(b-1,b+1))});var rf,tf,vf=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)};w.splitLines=vf;var wf=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},xf=function(){var a=kf("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),yf={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};w.keyNames=yf,function(){for(var a=0;10>a;a++)yf[a+48]=String(a);for(var a=65;90>=a;a++)yf[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)yf[a+111]=yf[a+63235]="F"+a}();var Hf,Mf=function(){function c(c){return 255>=c?a.charAt(c):c>=1424&&1524>=c?"R":c>=1536&&1791>=c?b.charAt(c-1536):c>=1792&&2220>=c?"r":"L"}var a="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",b="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,f=/[LRr]/,g=/[Lb1n]/,h=/[1n]/,i="L";return function(a){if(!d.test(a))return!1;for(var l,b=a.length,j=[],k=0;b>k;++k)j.push(l=c(a.charCodeAt(k)));for(var k=0,m=i;b>k;++k){var l=j[k];"m"==l?j[k]=m:m=l}for(var k=0,n=i;b>k;++k){var l=j[k];"1"==l&&"r"==n?j[k]="n":f.test(l)&&(n=l,"r"==l&&(j[k]="R"))}for(var k=1,m=j[0];b-1>k;++k){var l=j[k];"+"==l&&"1"==m&&"1"==j[k+1]?j[k]="1":","!=l||m!=j[k+1]||"1"!=m&&"n"!=m||(j[k]=m),m=l}for(var k=0;b>k;++k){var l=j[k];if(","==l)j[k]="N";else if("%"==l){for(var o=k+1;b>o&&"%"==j[o];++o);for(var p=k&&"!"==j[k-1]||b-1>o&&"1"==j[o]?"1":"N",q=k;o>q;++q)j[q]=p;k=o-1}}for(var k=0,n=i;b>k;++k){var l=j[k];"L"==n&&"1"==l?j[k]="L":f.test(l)&&(n=l)}for(var k=0;b>k;++k)if(e.test(j[k])){for(var o=k+1;b>o&&e.test(j[o]);++o);for(var r="L"==(k?j[k-1]:i),s="L"==(b-1>o?j[o]:i),p=r||s?"L":"R",q=k;o>q;++q)j[q]=p;k=o-1}for(var u,t=[],k=0;b>k;)if(g.test(j[k])){var v=k;for(++k;b>k&&g.test(j[k]);++k);t.push({from:v,to:k,level:0})}else{var w=k,x=t.length;for(++k;b>k&&"L"!=j[k];++k);for(var q=w;k>q;)if(h.test(j[q])){q>w&&t.splice(x,0,{from:w,to:q,level:1});var y=q;for(++q;k>q&&h.test(j[q]);++q);t.splice(x,0,{from:y,to:q,level:2}),w=q}else++q;k>w&&t.splice(x,0,{from:w,to:k,level:1})}return 1==t[0].level&&(u=a.match(/^\s+/))&&(t[0].from=u[0].length,t.unshift({from:0,to:u[0].length,level:0})),1==$e(t).level&&(u=a.match(/\s+$/))&&($e(t).to-=u[0].length,t.push({from:b-u[0].length,to:b,level:0})),t[0].level!=$e(t).level&&t.push({from:b,to:b,level:t[0].level}),t}}();return w.version="3.18.0",w}(),CodeMirror.defineMode("css",function(a,b){"use strict";function l(a,b){return k=b,a}function m(a,b){var c=a.next();if(d[c]){var e=d[c](a,b);if(e!==!1)return e}if("@"==c)return a.eatWhile(/[\w\\\-]/),l("def",a.current());if("="==c)l(null,"compare");else{if(("~"==c||"|"==c)&&a.eat("="))return l(null,"compare");if('"'==c||"'"==c)return b.tokenize=n(c),b.tokenize(a,b);if("#"==c)return a.eatWhile(/[\w\\\-]/),l("atom","hash");if("!"==c)return a.match(/^\s*\w*/),l("keyword","important");if(/\d/.test(c)||"."==c&&a.eat(/\d/))return a.eatWhile(/[\w.%]/),l("number","unit");if("-"!==c)return/[,+>*\/]/.test(c)?l(null,"select-op"):"."==c&&a.match(/^-?[_a-z][_a-z0-9-]*/i)?l("qualifier","qualifier"):":"==c?l("operator",c):/[;{}\[\]\(\)]/.test(c)?l(null,c):"u"==c&&a.match("rl(")?(a.backUp(1),b.tokenize=o,l("property","variable")):(a.eatWhile(/[\w\\\-]/),l("property","variable"));if(/\d/.test(a.peek()))return a.eatWhile(/[\w.%]/),l("number","unit");if(a.match(/^[^-]+-/))return l("meta","meta")}}function n(a,b){return function(c,d){for(var f,e=!1;null!=(f=c.next())&&(f!=a||e);)e=!e&&"\\"==f;return e||(b&&c.backUp(1),d.tokenize=m),l("string","string")}}function o(a,b){return a.next(),b.tokenize=a.match(/\s*[\"\']/,!1)?m:n(")",!0),l(null,"(")}b.propertyKeywords||(b=CodeMirror.resolveMode("text/css"));var c=a.indentUnit,d=b.hooks||{},e=b.atMediaTypes||{},f=b.atMediaFeatures||{},g=b.propertyKeywords||{},h=b.colorKeywords||{},i=b.valueKeywords||{},j=!!b.allowNested,k=null;return{startState:function(a){return{tokenize:m,baseIndent:a||0,stack:[],lastToken:null}},token:function(a,b){if(b.tokenize=b.tokenize||m,b.tokenize==m&&a.eatSpace())return null;var c=b.tokenize(a,b);c&&"string"!=typeof c&&(c=l(c[0],c[1]));var d=b.stack[b.stack.length-1];if("variable"==c)return"variable-definition"==k&&b.stack.push("propertyValue"),b.lastToken="variable-2";if("property"==c){var n=a.current().toLowerCase();"propertyValue"==d?c=i.hasOwnProperty(n)?"string-2":h.hasOwnProperty(n)?"keyword":"variable-2":"rule"==d?g.hasOwnProperty(n)||(c+=" error"):"block"==d?c=g.hasOwnProperty(n)?"property":h.hasOwnProperty(n)?"keyword":i.hasOwnProperty(n)?"string-2":"tag":d&&"@media{"!=d?"@media"==d?c=e[a.current()]?"attribute":/^(only|not)$/.test(n)?"keyword":"and"==n?"error":f.hasOwnProperty(n)?"error":"attribute error":"@mediaType"==d?c=e.hasOwnProperty(n)?"attribute":"and"==n?"operator":/^(only|not)$/.test(n)?"error":"error":"@mediaType("==d?g.hasOwnProperty(n)||(e.hasOwnProperty(n)?c="error":"and"==n?c="operator":/^(only|not)$/.test(n)?c="error":c+=" error"):c="@import"==d?"tag":"error":c="tag"}else"atom"==c?d&&"@media{"!=d&&"block"!=d?"propertyValue"==d?/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(a.current())||(c+=" error"):c="error":c="builtin":"@media"==d&&"{"==k&&(c="error");if("{"==k)if("@media"==d||"@mediaType"==d)b.stack[b.stack.length-1]="@media{";else{var o=j?"block":"rule";b.stack.push(o)}else"}"==k?("interpolation"==d&&(c="operator"),b.stack.pop(),"propertyValue"==d&&b.stack.pop()):"interpolation"==k?b.stack.push("interpolation"):"@media"==k?b.stack.push("@media"):"@import"==k?b.stack.push("@import"):"@media"==d&&/\b(keyword|attribute)\b/.test(c)?b.stack[b.stack.length-1]="@mediaType":"@mediaType"==d&&","==a.current()?b.stack[b.stack.length-1]="@media":"("==k?"@media"==d||"@mediaType"==d?(b.stack[b.stack.length-1]="@mediaType",b.stack.push("@mediaType(")):b.stack.push("("):")"==k?("propertyValue"==d&&b.stack.pop(),b.stack.pop()):":"==k&&"property"==b.lastToken?b.stack.push("propertyValue"):"propertyValue"==d&&";"==k?b.stack.pop():"@import"==d&&";"==k&&b.stack.pop();return b.lastToken=c},indent:function(a,b){var d=a.stack.length;return/^\}/.test(b)&&(d-="propertyValue"==a.stack[d-1]?2:1),a.baseIndent+d*c},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}}),function(){function a(a){for(var b={},c=0;c<a.length;++c)b[a[c]]=!0;return b}function g(a,b){for(var d,c=!1;null!=(d=a.next());){if(c&&"/"==d){b.tokenize=null;break}c="*"==d}return["comment","comment"]}var b=a(["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]),c=a(["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"]),d=a(["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","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","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","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-feature-settings","font-family","font-kerning","font-language-override","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-weight","grid-cell","grid-column","grid-column-align","grid-column-sizing","grid-column-span","grid-columns","grid-flow","grid-row","grid-row-align","grid-row-sizing","grid-row-span","grid-rows","grid-template","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","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","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","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","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","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-inside","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-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","zoom","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-profile","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","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","kerning","text-anchor","writing-mode"]),e=a(["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","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"]),f=a(["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","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","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","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","malayalam","match","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","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","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","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","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"]);CodeMirror.defineMIME("text/css",{atMediaTypes:b,atMediaFeatures:c,propertyKeywords:d,colorKeywords:e,valueKeywords:f,hooks:{"<":function(a,b){function c(a,b){for(var d,c=0;null!=(d=a.next());){if(c>=2&&">"==d){b.tokenize=null;break}c="-"==d?c+1:0}return["comment","comment"]}return a.eat("!")?(b.tokenize=c,c(a,b)):void 0},"/":function(a,b){return a.eat("*")?(b.tokenize=g,g(a,b)):!1}},name:"css"}),CodeMirror.defineMIME("text/x-scss",{atMediaTypes:b,atMediaFeatures:c,propertyKeywords:d,colorKeywords:e,valueKeywords:f,allowNested:!0,hooks:{":":function(a){return a.match(/\s*{/)?[null,"{"]:!1},$:function(a){return a.match(/^[\w-]+/),":"==a.peek()?["variable","variable-definition"]:["variable","variable"]},"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=g,g(a,b)):["operator","operator"]},"#":function(a){return a.eat("{")?["operator","interpolation"]:(a.eatWhile(/[\w\\\-]/),["atom","hash"])}},name:"css"})}(),CodeMirror.defineMode("htmlmixed",function(a,b){function i(a,b){var f=b.htmlState.tagName,g=c.token(a,b.htmlState);if("script"==f&&/\btag\b/.test(g)&&">"==a.current()){var h=a.string.slice(Math.max(0,a.pos-100),a.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);h=h?h[1]:"",h&&/[\"\']/.test(h.charAt(0))&&(h=h.slice(1,h.length-1));for(var i=0;i<e.length;++i){var j=e[i];if("string"==typeof j.matches?h==j.matches:j.matches.test(h)){j.mode&&(b.token=k,b.localMode=j.mode,b.localState=j.mode.startState&&j.mode.startState(c.indent(b.htmlState,"")));break}}}else"style"==f&&/\btag\b/.test(g)&&">"==a.current()&&(b.token=l,b.localMode=d,b.localState=d.startState(c.indent(b.htmlState,"")));return g}function j(a,b,c){var f,d=a.current(),e=d.search(b);return e>-1?a.backUp(d.length-e):(f=d.match(/<\/?$/))&&(a.backUp(d.length),a.match(b,!1)||a.match(d[0])),c
6
- }function k(a,b){return a.match(/^<\/\s*script\s*>/i,!1)?(b.token=i,b.localState=b.localMode=null,i(a,b)):j(a,/<\/\s*script\s*>/,b.localMode.token(a,b.localState))}function l(a,b){return a.match(/^<\/\s*style\s*>/i,!1)?(b.token=i,b.localState=b.localMode=null,i(a,b)):j(a,/<\/\s*style\s*>/,d.token(a,b.localState))}var c=CodeMirror.getMode(a,{name:"xml",htmlMode:!0}),d=CodeMirror.getMode(a,"css"),e=[],f=b&&b.scriptTypes;if(e.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:CodeMirror.getMode(a,"javascript")}),f)for(var g=0;g<f.length;++g){var h=f[g];e.push({matches:h.matches,mode:h.mode&&CodeMirror.getMode(a,h.mode)})}return e.push({matches:/./,mode:CodeMirror.getMode(a,"text/plain")}),{startState:function(){var a=c.startState();return{token:i,localMode:null,localState:null,htmlState:a}},copyState:function(a){if(a.localState)var b=CodeMirror.copyState(a.localMode,a.localState);return{token:a.token,localMode:a.localMode,localState:b,htmlState:CodeMirror.copyState(c,a.htmlState)}},token:function(a,b){return b.token(a,b)},indent:function(a,b){return!a.localMode||/^\s*<\//.test(b)?c.indent(a.htmlState,b):a.localMode.indent?a.localMode.indent(a.localState,b):CodeMirror.Pass},electricChars:"/{}:",innerMode:function(a){return{state:a.localState||a.htmlState,mode:a.localMode||c}}}},"xml","javascript","css"),CodeMirror.defineMIME("text/html","htmlmixed"),CodeMirror.defineMode("javascript",function(a,b){function i(a,b,c){return b.tokenize=c,c(a,b)}function j(a,b){for(var d,c=!1;null!=(d=a.next());){if(d==b&&!c)return!1;c=!c&&"\\"==d}return c}function m(a,b,c){return k=a,l=c,b}function n(a,b){var c=a.next();if('"'==c||"'"==c)return i(a,b,o(c));if("."==c&&a.match(/^\d+(?:[eE][+\-]?\d+)?/))return m("number","number");if(/[\[\]{}\(\),;\:\.]/.test(c))return m(c);if("0"==c&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),m("number","number");if(/\d/.test(c))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),m("number","number");if("/"==c)return a.eat("*")?i(a,b,p):a.eat("/")?(a.skipToEnd(),m("comment","comment")):"operator"==b.lastType||"keyword c"==b.lastType||/^[\[{}\(,;:]$/.test(b.lastType)?(j(a,"/"),a.eatWhile(/[gimy]/),m("regexp","string-2")):(a.eatWhile(h),m("operator",null,a.current()));if("#"==c)return a.skipToEnd(),m("error","error");if(h.test(c))return a.eatWhile(h),m("operator",null,a.current());a.eatWhile(/[\w\$_]/);var d=a.current(),e=g.propertyIsEnumerable(d)&&g[d];return e&&"."!=b.lastType?m(e.type,e.style,d):m("variable","variable",d)}function o(a){return function(b,c){return j(b,a)||(c.tokenize=n),m("string","string")}}function p(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=n;break}c="*"==d}return m("comment","comment")}function r(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,null!=d&&(this.align=d)}function s(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0}function t(a,b,c,d,f){var g=a.cc;for(u.state=a,u.stream=f,u.marked=null,u.cc=g,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var h=g.length?g.pop():e?F:E;if(h(c,d)){for(;g.length&&g[g.length-1].lex;)g.pop()();return u.marked?u.marked:"variable"==c&&s(a,d)?"variable-2":b}}}function v(){for(var a=arguments.length-1;a>=0;a--)u.cc.push(arguments[a])}function w(){return v.apply(null,arguments),!0}function x(a){function b(b){for(var c=b;c;c=c.next)if(c.name==a)return!0;return!1}var c=u.state;if(c.context){if(u.marked="def",b(c.localVars))return;c.localVars={name:a,next:c.localVars}}else{if(b(c.globalVars))return;c.globalVars={name:a,next:c.globalVars}}}function z(){u.state.context={prev:u.state.context,vars:u.state.localVars},u.state.localVars=y}function A(){u.state.localVars=u.state.context.vars,u.state.context=u.state.context.prev}function B(a,b){var c=function(){var c=u.state,d=c.indented;"stat"==c.lexical.type&&(d=c.lexical.indented),c.lexical=new r(d,u.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function C(){var a=u.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function D(a){return function(b){return b==a?w():";"==a?v():w(arguments.callee)}}function E(a){return"var"==a?w(B("vardef"),U,D(";"),C):"keyword a"==a?w(B("form"),F,E,C):"keyword b"==a?w(B("form"),E,C):"{"==a?w(B("}"),R,C):";"==a?w():"if"==a?w(B("form"),F,E,C,W):"function"==a?w(_):"for"==a?w(B("form"),D("("),B(")"),X,D(")"),C,E,C):"variable"==a?w(B("stat"),M):"switch"==a?w(B("form"),F,B("}","switch"),D("{"),R,C,C):"case"==a?w(F,D(":")):"default"==a?w(D(":")):"catch"==a?w(B("form"),z,D("("),ab,D(")"),E,C,A):v(B("stat"),F,D(";"),C)}function F(a){return H(a,!1)}function G(a){return H(a,!0)}function H(a,b){var c=b?L:K;return q.hasOwnProperty(a)?w(c):"function"==a?w(_):"keyword c"==a?w(b?J:I):"("==a?w(B(")"),I,D(")"),C,c):"operator"==a?w(b?G:F):"["==a?w(B("]"),Q(G,"]"),C,c):"{"==a?w(B("}"),Q(O,"}"),C,c):w()}function I(a){return a.match(/[;\}\)\],]/)?v():v(F)}function J(a){return a.match(/[;\}\)\],]/)?v():v(G)}function K(a,b){return","==a?w(F):L(a,b,!1)}function L(a,b,c){var d=0==c?K:L,e=0==c?F:G;return"operator"==a?/\+\+|--/.test(b)?w(d):"?"==b?w(F,D(":"),e):w(e):";"!=a?"("==a?w(B(")","call"),Q(G,")"),C,d):"."==a?w(N,d):"["==a?w(B("]"),I,D("]"),C,d):void 0:void 0}function M(a){return":"==a?w(C,E):v(K,D(";"),C)}function N(a){return"variable"==a?(u.marked="property",w()):void 0}function O(a,b){if("variable"==a){if(u.marked="property","get"==b||"set"==b)return w(P)}else("number"==a||"string"==a)&&(u.marked=a+" property");return q.hasOwnProperty(a)?w(D(":"),G):void 0}function P(a){return":"==a?w(F):"variable"!=a?w(D(":"),F):(u.marked="property",w(_))}function Q(a,b){function c(d){if(","==d){var e=u.state.lexical;return"call"==e.info&&(e.pos=(e.pos||0)+1),w(a,c)}return d==b?w():w(D(b))}return function(d){return d==b?w():v(a,c)}}function R(a){return"}"==a?w():v(E,R)}function S(a){return":"==a?w(T):v()}function T(a){return"variable"==a?(u.marked="variable-3",w()):v()}function U(a,b){return"variable"==a?(x(b),f?w(S,V):w(V)):v()}function V(a,b){return"="==b?w(G,V):","==a?w(U):void 0}function W(a,b){return"keyword b"==a&&"else"==b?w(B("form"),E,C):void 0}function X(a){return"var"==a?w(U,D(";"),Z):";"==a?w(Z):"variable"==a?w(Y):v(F,D(";"),Z)}function Y(a,b){return"in"==b?w(F):w(K,Z)}function Z(a,b){return";"==a?w($):"in"==b?w(F):v(F,D(";"),$)}function $(a){")"!=a&&w(F)}function _(a,b){return"variable"==a?(x(b),w(_)):"("==a?w(B(")"),z,Q(ab,")"),C,E,A):void 0}function ab(a,b){return"variable"==a?(x(b),f?w(S):w()):void 0}var k,l,c=a.indentUnit,d=b.statementIndent,e=b.json,f=b.typescript,g=function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("operator"),g={type:"atom",style:"atom"},h={"if":a("if"),"while":b,"with":b,"else":c,"do":c,"try":c,"finally":c,"return":d,"break":d,"continue":d,"new":d,"delete":d,"throw":d,"var":a("var"),"const":a("var"),let:a("var"),"function":a("function"),"catch":a("catch"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":e,"typeof":e,"instanceof":e,"true":g,"false":g,"null":g,undefined:g,NaN:g,Infinity:g,"this":a("this")};if(f){var i={type:"variable",style:"variable-3"},j={"interface":a("interface"),"class":a("class"),"extends":a("extends"),constructor:a("constructor"),"public":a("public"),"private":a("private"),"protected":a("protected"),"static":a("static"),"super":a("super"),string:i,number:i,bool:i,any:i};for(var k in j)h[k]=j[k]}return h}(),h=/[+\-*&%=<>!?|~^]/,q={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0},u={state:null,column:null,marked:null,cc:null},y={name:"this",next:{name:"arguments"}};return C.lex=!0,{startState:function(a){return{tokenize:n,lastType:null,cc:[],lexical:new r((a||0)-c,0,"block",!1),localVars:b.localVars,globalVars:b.globalVars,context:b.localVars&&{vars:b.localVars},indented:0}},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation()),b.tokenize!=p&&a.eatSpace())return null;var c=b.tokenize(a,b);return"comment"==k?c:(b.lastType="operator"!=k||"++"!=l&&"--"!=l?k:"incdec",t(b,c,k,l,a))},indent:function(a,e){if(a.tokenize==p)return CodeMirror.Pass;if(a.tokenize!=n)return 0;for(var f=e&&e.charAt(0),g=a.lexical,h=a.cc.length-1;h>=0;--h){var i=a.cc[h];if(i==C)g=g.prev;else if(i!=W||/^else\b/.test(e))break}"stat"==g.type&&"}"==f&&(g=g.prev),d&&")"==g.type&&"stat"==g.prev.type&&(g=g.prev);var j=g.type,k=f==j;return"vardef"==j?g.indented+("operator"==a.lastType||","==a.lastType?4:0):"form"==j&&"{"==f?g.indented:"form"==j?g.indented+c:"stat"==j?g.indented+("operator"==a.lastType||","==a.lastType?d||c:0):"switch"!=g.info||k||0==b.doubleIndentSwitch?g.align?g.column+(k?0:1):g.indented+(k?0:c):g.indented+(/^(?:case|default)\b/.test(e)?c:2*c)},electricChars:":{}",blockCommentStart:e?null:"/*",blockCommentEnd:e?null:"*/",lineComment:e?null:"//",fold:"brace",helperType:e?"json":"javascript",jsonMode:e}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("text/ecmascript","javascript"),CodeMirror.defineMIME("application/javascript","javascript"),CodeMirror.defineMIME("application/ecmascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMIME("application/x-json",{name:"javascript",json:!0}),CodeMirror.defineMIME("text/typescript",{name:"javascript",typescript:!0}),CodeMirror.defineMIME("application/typescript",{name:"javascript",typescript:!0}),CodeMirror.defineMode("xml",function(a,b){function j(a,b){function c(c){return b.tokenize=c,c(a,b)}var d=a.next();if("<"==d){if(a.eat("!"))return a.eat("[")?a.match("CDATA[")?c(m("atom","]]>")):null:a.match("--")?c(m("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),c(n(1))):null;if(a.eat("?"))return a.eatWhile(/[\w\._\-]/),b.tokenize=m("meta","?>"),"meta";var e=a.eat("/");h="";for(var f;f=a.eat(/[^\s\u00a0=<>\"\'\/?]/);)h+=f;return h?(i=e?"closeTag":"openTag",b.tokenize=k,"tag"):"error"}if("&"==d){var g;return g=a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),g?"atom":"error"}return a.eatWhile(/[^&<]/),null}function k(a,b){var c=a.next();return">"==c||"/"==c&&a.eat(">")?(b.tokenize=j,i=">"==c?"endTag":"selfcloseTag","tag"):"="==c?(i="equals",null):"<"==c?"error":/[\'\"]/.test(c)?(b.tokenize=l(c),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=<>\"\']/),"word")}function l(a){var b=function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=k;break}return"string"};return b.isInAttribute=!0,b}function m(a,b){return function(c,d){for(;!c.eol();){if(c.match(b)){d.tokenize=j;break}c.next()}return a}}function n(a){return function(b,c){for(var d;null!=(d=b.next());){if("<"==d)return c.tokenize=n(a+1),c.tokenize(b,c);if(">"==d){if(1==a){c.tokenize=j;break}return c.tokenize=n(a-1),c.tokenize(b,c)}}return"meta"}}function r(){for(var a=arguments.length-1;a>=0;a--)o.cc.push(arguments[a])}function s(){return r.apply(null,arguments),!0}function t(a,b){var c=f.doNotIndent.hasOwnProperty(a)||o.context&&o.context.noIndent;o.context={prev:o.context,tagName:a,indent:o.indented,startOfLine:b,noIndent:c}}function u(){o.context&&(o.context=o.context.prev)}function v(a){if("openTag"==a)return o.tagName=h,o.tagStart=p.column(),s(z,w(o.startOfLine));if("closeTag"==a){var b=!1;return o.context?o.context.tagName!=h&&(f.implicitlyClosed.hasOwnProperty(o.context.tagName.toLowerCase())&&u(),b=!o.context||o.context.tagName!=h):b=!0,b&&(q="error"),s(x(b))}return s()}function w(a){return function(b){var c=o.tagName;return o.tagName=o.tagStart=null,"selfcloseTag"==b||"endTag"==b&&f.autoSelfClosers.hasOwnProperty(c.toLowerCase())?(y(c.toLowerCase()),s()):"endTag"==b?(y(c.toLowerCase()),t(c,a),s()):s()}}function x(a){return function(b){return a&&(q="error"),"endTag"==b?(u(),s()):(q="error",s(arguments.callee))}}function y(a){for(var b;;){if(!o.context)return;if(b=o.context.tagName.toLowerCase(),!f.contextGrabbers.hasOwnProperty(b)||!f.contextGrabbers[b].hasOwnProperty(a))return;u()}}function z(a){return"word"==a?(q="attribute",s(A,z)):"endTag"==a||"selfcloseTag"==a?r():(q="error",s(z))}function A(a){if("equals"==a)return s(B,z);if(f.allowMissing){if("word"==a)return q="attribute",s(A,z)}else q="error";return"endTag"==a||"selfcloseTag"==a?r():s()}function B(a){return"string"==a?s(C):"word"==a&&f.allowUnquoted?(q="string",s()):(q="error","endTag"==a||"selfCloseTag"==a?r():s())}function C(a){return"string"==a?s(C):r()}var h,i,o,p,q,c=a.indentUnit,d=b.multilineTagIndentFactor||1,e=b.multilineTagIndentPastTag||!0,f=b.htmlMode?{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},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}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},g=b.alignCDATA;return{startState:function(){return{tokenize:j,cc:[],indented:0,startOfLine:!0,tagName:null,tagStart:null,context:null}},token:function(a,b){if(!b.tagName&&a.sol()&&(b.startOfLine=!0,b.indented=a.indentation()),a.eatSpace())return null;q=i=h=null;var c=b.tokenize(a,b);if(b.type=i,(c||i)&&"comment"!=c)for(o=b,p=a;;){var d=b.cc.pop()||v;if(d(i||c))break}return b.startOfLine=!1,q||c},indent:function(a,b,f){var h=a.context;if(a.tokenize.isInAttribute)return a.stringStartCol+1;if(a.tokenize!=k&&a.tokenize!=j||h&&h.noIndent)return f?f.match(/^(\s*)/)[0].length:0;if(a.tagName)return e?a.tagStart+a.tagName.length+2:a.tagStart+c*d;if(g&&/<!\[CDATA\[/.test(b))return 0;for(h&&/^<\//.test(b)&&(h=h.prev);h&&!h.startOfLine;)h=h.prev;return h?h.indent+c:0},electricChars:"/",blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:b.htmlMode?"html":"xml",helperType:b.htmlMode?"html":"xml"}}),CodeMirror.defineMIME("text/xml","xml"),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.mimeModes.hasOwnProperty("text/html")||CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0}),function(){"use strict";function c(c){"activeLine"in c.state&&(c.removeLineClass(c.state.activeLine,"wrap",a),c.removeLineClass(c.state.activeLine,"background",b))}function d(d){var e=d.getLineHandleVisualStart(d.getCursor().line);d.state.activeLine!=e&&(c(d),d.addLineClass(e,"wrap",a),d.addLineClass(e,"background",b),d.state.activeLine=e)}var a="CodeMirror-activeline",b="CodeMirror-activeline-background";CodeMirror.defineOption("styleActiveLine",!1,function(a,b,e){var f=e&&e!=CodeMirror.Init;b&&!f?(d(a),a.on("cursorActivity",d)):!b&&f&&(a.off("cursorActivity",d),c(a),delete a.state.activeLine)})}(),function(){function d(a,d,e){function q(d,e,f){if(d.text){var h=l?0:d.text.length-1,i=l?d.text.length:-1;if(d.text.length>g)return null;for(null!=f&&(h=f+m);h!=i;h+=m){var j=d.text.charAt(h);if(p.test(j)&&a.getTokenTypeAt(b(e,h+1))==n){var k=c[j];if(">"==k.charAt(1)==l)o.push(j);else{if(o.pop()!=k.charAt(0))return{pos:h,match:!1};if(!o.length)return{pos:h,match:!0}}}}}}var f=a.state.matchBrackets,g=f&&f.maxScanLineLength||1e4,h=d||a.getCursor(),i=a.getLineHandle(h.line),j=h.ch-1,k=j>=0&&c[i.text.charAt(j)]||c[i.text.charAt(++j)];if(!k)return null;var l=">"==k.charAt(1),m=l?1:-1;if(e&&l!=(j==h.ch))return null;for(var s,n=a.getTokenTypeAt(b(h.line,j+1)),o=[i.text.charAt(j)],p=/[(){}[\]]/,r=h.line,t=l?Math.min(r+100,a.lineCount()):Math.max(-1,r-100);r!=t&&!(s=r==h.line?q(i,r,j):q(a.getLineHandle(r),r));r+=m);return{from:b(h.line,j),to:s&&b(r,s.pos),match:s&&s.match,forward:l}}function e(c,e){var f=c.state.matchBrackets.maxHighlightLineLength||1e3,g=d(c);if(!(!g||c.getLine(g.from.line).length>f||g.to&&c.getLine(g.to.line).length>f)){var h=g.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",i=c.markText(g.from,b(g.from.line,g.from.ch+1),{className:h}),j=g.to&&c.markText(g.to,b(g.to.line,g.to.ch+1),{className:h});a&&c.state.focused&&c.display.input.focus();var k=function(){c.operation(function(){i.clear(),j&&j.clear()})};return e?(setTimeout(k,800),void 0):k}}function g(a){a.operation(function(){f&&(f(),f=null),a.somethingSelected()||(f=e(a,!1))})}var a=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),b=CodeMirror.Pos,c={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},f=null;CodeMirror.defineOption("matchBrackets",!1,function(a,b,c){c&&c!=CodeMirror.Init&&a.off("cursorActivity",g),b&&(a.state.matchBrackets="object"==typeof b?b:{},a.on("cursorActivity",g))}),CodeMirror.defineExtension("matchBrackets",function(){e(this,!0)}),CodeMirror.defineExtension("findMatchingBracket",function(a,b){return d(this,a,b)})}();
 
 
 
 
 
 
lib/codemirror.min.css DELETED
@@ -1 +0,0 @@
1
- .CodeMirror{font-family:monospace;height:300px}.CodeMirror-scroll{overflow:auto}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999}.CodeMirror div.CodeMirror-cursor{border-left:1px solid black;z-index:3}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7;z-index:1}.cm-tab{display:inline-block}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable{color:black}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-property{color:black}.cm-s-default .cm-operator{color:black}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-error{color:red}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-invalidchar{color:red}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{line-height:1;position:relative;overflow:hidden;background:white;color:black}.CodeMirror-scroll{margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;padding-right:30px;height:100%;outline:0;position:relative;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-sizer{position:relative}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;padding-bottom:30px;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;-moz-box-sizing:content-box;box-sizing:content-box;padding-bottom:30px;margin-bottom:-32px;display:inline-block;*zoom:1;*display:inline}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-code pre{border-right:30px solid transparent;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.CodeMirror-wrap .CodeMirror-code pre{border-right:0;width:auto}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;visibility:hidden;border-right:0;width:0}.CodeMirror-focused div.CodeMirror-cursor{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.CodeMirror span{*vertical-align:text-bottom}@media print{.CodeMirror div.CodeMirror-cursor{visibility:hidden}}
 
lib/hesh.min.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ .CodeMirror-scroll{overflow:auto}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999}.CodeMirror div.CodeMirror-cursor{border-left:1px solid black;z-index:3}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7;z-index:1}.cm-tab{display:inline-block}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable{color:black}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-property{color:black}.cm-s-default .cm-operator{color:black}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-error{color:red}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-invalidchar{color:red}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{line-height:1;position:relative;overflow:hidden;background:white;color:black}.CodeMirror-scroll{margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;padding-right:30px;height:100%;outline:0;position:relative;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-sizer{position:relative}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;padding-bottom:30px;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;-moz-box-sizing:content-box;box-sizing:content-box;padding-bottom:30px;margin-bottom:-32px;display:inline-block;*zoom:1;*display:inline}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-code pre{border-right:30px solid transparent;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.CodeMirror-wrap .CodeMirror-code pre{border-right:0;width:auto}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;visibility:hidden;border-right:0;width:0}.CodeMirror-focused div.CodeMirror-cursor{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.CodeMirror span{*vertical-align:text-bottom}@media print{.CodeMirror div.CodeMirror-cursor{visibility:hidden}}
2
+
3
+ .CodeMirror{font-family:Menlo Regular,Consolas,Monaco,monospace;line-height:150%;font-size:12px;height:500px}.wp-editor-area,.wp-fullscreen-both,#content-resize-handle,#wp-fullscreen-modes,.heshFullscreen #content_wp_fullscreen,.quicktags-toolbar input.ed_button{display:none !important}.quicktags-toolbar input#cm_content_fullscreen,#ed_toolbar input.cm_ed_button{display:inline-block !important}.CodeMirror-matchingbracket{background-color:#fff490;color:inherit !important}.content-resize-handle{width:12px;height:19px;cursor:ns-resize;position:absolute;right:2px;background:transparent url('../../../../wp-admin/images/resize-2x.gif') no-repeat scroll right bottom;background-size:11px 11px}.heshFullscreen{z-index:99999;position:fixed;top:0;left:0;right:0;bottom:0;height:100%;background:#fff;padding:2% 2% 0}.heshFullscreen .CodeMirror,.heshFullscreen #ed_toolbar{border:1px solid #ccc}.heshFullscreen #ed_toolbar{border-bottom:0;border-radius:4px 4px 0 0}.heshFullscreen .CodeMirror{border-radius:0 0 4px 4px;height:85% !important}@media only screen and (max-height:550px),only screen and (max-device-height:550px){.heshFullscreen .CodeMirror{height:75% !important}}#cm_content_fullscreen{float:right}
lib/hesh.min.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ function heshPlugin(){var a=null,b=0,c=0,d=document.getElementById("content"),e=null!=document.getElementById("post_ID")?document.getElementById("post_ID").value:0,f=document.getElementById("content-html"),g=document.getElementById("content-tmce"),h=-1!=document.cookie.indexOf("editor%3Dtinymce")?!0:!1,i=null!=document.getElementById("content-tmce")?!0:!1,j=document.getElementById("wp-content-editor-container"),k="heshFullscreen",l={mode:"text/html",tabMode:"indent",lineNumbers:!0,matchBrackets:!0,indentUnit:4,indentWithTabs:!0,enterMode:"keep",lineWrapping:!0,autofocus:!0,styleActiveLine:!0},m=function(){var a=document.getElementById("ed_toolbar");if(!c){var b={more:["<!--more-->",""],comment:["<!-- "," -->"],code:["<code>","</code>"],li:["<li>","</li>"],ol:["<ol>","</ol>"],ul:["<ul>","</ul>"],img:['<img src="$" alt="','">',"Enter the URL of the image"],ins:["<ins>","</ins>"],del:["<del>","</del>"],link:['<a href="$">',"</a>","Enter the destination URL"],blockquote:["\r<blockquote>","</blockquote>\r"],h3:["<h3>","</h3>"],h2:["<h2>","</h2>"],h1:["<h1>","</h1>"],i:["<em>","</em>"],b:["<strong>","</strong>"]};for(key in b){var d=b[key],e=d[2]?'data-prompt="'+d[2]+'"':"";a.insertAdjacentHTML("afterbegin",'<input type="button" id="cm_content_'+key+"\" data-start='"+d[0]+"' data-end='"+d[1]+"' "+e+' class="ed_button cm_ed_button" value="'+key+'">'),document.getElementById("cm_content_"+key).onclick=n}fullscreen(),c=1}},n=function(){var b=a.getCursor("start"),c=this.getAttribute("data-start"),d=this.getAttribute("data-end"),e=this.getAttribute("data-prompt"),f=a.getSelection();e&&(c=c.replace("$",prompt(e,""))),a.replaceSelection(c+f+d),a.setSelection(b,a.getCursor("end")),a.setCursor(b.line,b.ch+c.length),a.focus()},o=function(c){a=CodeMirror.fromTextArea(c,l),a.on("change",function(){a.save()}),a.on("cursorActivity",function(){var b=a.getCursor();window.name=e+","+b.line+","+b.ch});var d=window.name.split(",");e==d[0]&&a.setCursor(parseFloat(d[1]),parseFloat(d[2])),m(),resizeEditor(),b=1},p=function(){b&&(a.toTextArea(),f.onclick=toHTML,switchEditors.switchto(this),b=0)};toHTML=function(){b||(switchEditors.switchto(this),o(d),g.onclick=p)},resizeEditor=function(){var b=document.querySelector(".CodeMirror"),c=document.createElement("div"),d=document.getElementById("wp-content-wrap"),e=b.getBoundingClientRect(),f=function(a){b.style.height=a.pageY-e.top-c.offsetHeight+"px",window.getSelection().removeAllRanges()};c.className="content-resize-handle",d.appendChild(c),c.onmousedown=function(){window.onmousemove=f},window.onmouseup=function(){window.onmousemove=null,a.focus()}},toggleFullscreen=function(){j.className=-1==j.className.indexOf(k)?j.className+" "+k:j.className.replace(k,""),this.value="fullscreen"==this.value?"exit fullscreen":"fullscreen",a.focus()},fullscreen=function(){document.getElementById("ed_toolbar").insertAdjacentHTML("afterbegin",'<input type="button" id="cm_content_fullscreen" class="ed_button" title="Toggle fullscreen mode" value="fullscreen">'),document.getElementById("cm_content_fullscreen").onclick=toggleFullscreen},h&&i?f.onclick=toHTML:(o(d),i&&(g.onclick=p))}window.CodeMirror=function(){"use strict";function w(a,c){if(!(this instanceof w))return new w(a,c);this.options=c=c||{};for(var d in $c)!c.hasOwnProperty(d)&&$c.hasOwnProperty(d)&&(c[d]=$c[d]);I(c);var e="string"==typeof c.value?0:c.value.first,f=this.display=x(a,e);f.wrapper.CodeMirror=this,F(this),c.autofocus&&!o&&Mb(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,draggingText:!1,highlight:new We},D(this),c.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");var g=c.value;"string"==typeof g&&(g=new fe(c.value,c.mode)),Eb(this,je)(this,g),b&&setTimeout(ef(Lb,this,!0),20),Ob(this);var h;try{h=document.activeElement==f.input}catch(i){}h||c.autofocus&&!o?setTimeout(ef(lc,this),20):mc(this),Eb(this,function(){for(var a in Zc)Zc.propertyIsEnumerable(a)&&Zc[a](this,c[a],ad);for(var b=0;b<ed.length;++b)ed[b](this)})()}function x(a,b){var d={},f=d.input=kf("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;");return e?f.style.width="1000px":f.setAttribute("wrap","off"),n&&(f.style.border="1px solid black"),f.setAttribute("autocorrect","off"),f.setAttribute("autocapitalize","off"),f.setAttribute("spellcheck","false"),d.inputDiv=kf("div",[f],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),d.scrollbarH=kf("div",[kf("div",null,null,"height: 1px")],"CodeMirror-hscrollbar"),d.scrollbarV=kf("div",[kf("div",null,null,"width: 1px")],"CodeMirror-vscrollbar"),d.scrollbarFiller=kf("div",null,"CodeMirror-scrollbar-filler"),d.gutterFiller=kf("div",null,"CodeMirror-gutter-filler"),d.lineDiv=kf("div",null,"CodeMirror-code"),d.selectionDiv=kf("div",null,null,"position: relative; z-index: 1"),d.cursor=kf("div","\xa0","CodeMirror-cursor"),d.otherCursor=kf("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"),d.measure=kf("div",null,"CodeMirror-measure"),d.lineSpace=kf("div",[d.measure,d.selectionDiv,d.lineDiv,d.cursor,d.otherCursor],null,"position: relative; outline: none"),d.mover=kf("div",[kf("div",[d.lineSpace],"CodeMirror-lines")],null,"position: relative"),d.sizer=kf("div",[d.mover],"CodeMirror-sizer"),d.heightForcer=kf("div",null,null,"position: absolute; height: "+Ue+"px; width: 1px;"),d.gutters=kf("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=kf("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=kf("div",[d.inputDiv,d.scrollbarH,d.scrollbarV,d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),c&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),a.appendChild?a.appendChild(d.wrapper):a(d.wrapper),n&&(f.style.width="0px"),e||(d.scroller.draggable=!0),j?(d.inputDiv.style.height="1px",d.inputDiv.style.position="absolute"):c&&(d.scrollbarH.style.minWidth=d.scrollbarV.style.minWidth="18px"),d.viewOffset=d.lastSizeC=0,d.showingFrom=d.showingTo=b,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.prevInput="",d.alignWidgets=!1,d.pollingFast=!1,d.poll=new We,d.cachedCharWidth=d.cachedTextHeight=null,d.measureLineCache=[],d.measureLineCachePos=0,d.inaccurateSelection=!1,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d}function y(a){a.doc.mode=w.getMode(a.options,a.doc.modeOption),a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,ab(a,100),a.state.modeGen++,a.curOp&&Hb(a)}function z(a){a.options.lineWrapping?(a.display.wrapper.className+=" CodeMirror-wrap",a.display.sizer.style.minWidth=""):(a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-wrap",""),H(a)),B(a),Hb(a),ob(a),setTimeout(function(){J(a)},100)}function A(a){var b=zb(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/Ab(a.display)-3);return function(e){return Fd(a.doc,e)?0:c?(Math.ceil(e.text.length/d)||1)*b:b}}function B(a){var b=a.doc,c=A(a);b.iter(function(a){var b=c(a);b!=a.height&&ne(a,b)})}function C(a){var b=jd[a.options.keyMap],c=b.style;a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(c?" cm-keymap-"+c:""),a.state.disableInput=b.disableInput}function D(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ob(a)}function E(a){F(a),Hb(a),setTimeout(function(){L(a)},20)}function F(a){var b=a.display.gutters,c=a.options.gutters;lf(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(kf("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none"}function G(a,b){if(0==b.height)return 0;for(var d,c=b.text.length,e=b;d=Cd(e);){var f=d.find();e=ke(a,f.from.line),c+=f.from.ch-f.to.ch}for(e=b;d=Dd(e);){var f=d.find();c-=e.text.length-f.from.ch,e=ke(a,f.to.line),c+=e.text.length-f.to.ch}return c}function H(a){var b=a.display,c=a.doc;b.maxLine=ke(c,c.first),b.maxLineLength=G(c,b.maxLine),b.maxLineChanged=!0,c.iter(function(a){var d=G(c,a);d>b.maxLineLength&&(b.maxLineLength=d,b.maxLine=a)})}function I(a){var b=af(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function J(a){var b=a.display,c=a.doc.height,d=c+fb(b);b.sizer.style.minHeight=b.heightForcer.style.top=d+"px",b.gutters.style.height=Math.max(d,b.scroller.clientHeight-Ue)+"px";var e=Math.max(d,b.scroller.scrollHeight),f=b.scroller.scrollWidth>b.scroller.clientWidth+1,g=e>b.scroller.clientHeight+1;g?(b.scrollbarV.style.display="block",b.scrollbarV.style.bottom=f?sf(b.measure)+"px":"0",b.scrollbarV.firstChild.style.height=e-b.scroller.clientHeight+b.scrollbarV.clientHeight+"px"):(b.scrollbarV.style.display="",b.scrollbarV.firstChild.style.height="0"),f?(b.scrollbarH.style.display="block",b.scrollbarH.style.right=g?sf(b.measure)+"px":"0",b.scrollbarH.firstChild.style.width=b.scroller.scrollWidth-b.scroller.clientWidth+b.scrollbarH.clientWidth+"px"):(b.scrollbarH.style.display="",b.scrollbarH.firstChild.style.width="0"),f&&g?(b.scrollbarFiller.style.display="block",b.scrollbarFiller.style.height=b.scrollbarFiller.style.width=sf(b.measure)+"px"):b.scrollbarFiller.style.display="",f&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(b.gutterFiller.style.display="block",b.gutterFiller.style.height=sf(b.measure)+"px",b.gutterFiller.style.width=b.gutters.offsetWidth+"px"):b.gutterFiller.style.display="",k&&0===sf(b.measure)&&(b.scrollbarV.style.minWidth=b.scrollbarH.style.minHeight=l?"18px":"12px",b.scrollbarV.style.pointerEvents=b.scrollbarH.style.pointerEvents="none")}function K(a,b,c){var d=a.scroller.scrollTop,e=a.wrapper.clientHeight;"number"==typeof c?d=c:c&&(d=c.top,e=c.bottom-c.top),d=Math.floor(d-eb(a));var f=Math.ceil(d+e);return{from:pe(b,d),to:pe(b,f)}}function L(a){var b=a.display;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var c=O(b)-b.scroller.scrollLeft+a.doc.scrollLeft,d=b.gutters.offsetWidth,e=c+"px",f=b.lineDiv.firstChild;f;f=f.nextSibling)if(f.alignable)for(var g=0,h=f.alignable;g<h.length;++g)h[g].style.left=e;a.options.fixedGutter&&(b.gutters.style.left=c+d+"px")}}function M(a){if(!a.options.lineNumbers)return!1;var b=a.doc,c=N(a.options,b.first+b.size-1),d=a.display;if(c.length!=d.lineNumChars){var e=d.measure.appendChild(kf("div",[kf("div",c)],"CodeMirror-linenumber CodeMirror-gutter-elt")),f=e.firstChild.offsetWidth,g=e.offsetWidth-f;return d.lineGutter.style.width="",d.lineNumInnerWidth=Math.max(f,d.lineGutter.offsetWidth-g),d.lineNumWidth=d.lineNumInnerWidth+g,d.lineNumChars=d.lineNumInnerWidth?c.length:-1,d.lineGutter.style.width=d.lineNumWidth+"px",!0}return!1}function N(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function O(a){return of(a.scroller).left-of(a.sizer).left}function P(a,b,c,d){for(var g,e=a.display.showingFrom,f=a.display.showingTo,h=K(a.display,a.doc,c),i=!0;;i=!1){var j=a.display.scroller.clientWidth;if(!Q(a,b,h,d))break;if(g=!0,b=[],Y(a),J(a),i&&a.options.lineWrapping&&j!=a.display.scroller.clientWidth)d=!0;else if(d=!1,c&&(c=Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,"number"==typeof c?c:c.top)),h=K(a.display,a.doc,c),h.from>=a.display.showingFrom&&h.to<=a.display.showingTo)break}return g&&(Pe(a,"update",a),(a.display.showingFrom!=e||a.display.showingTo!=f)&&Pe(a,"viewportChange",a,a.display.showingFrom,a.display.showingTo)),g}function Q(a,b,c,d){var e=a.display,f=a.doc;if(!e.wrapper.clientWidth)return e.showingFrom=e.showingTo=f.first,e.viewOffset=0,void 0;if(!(!d&&0==b.length&&c.from>e.showingFrom&&c.to<e.showingTo)){M(a)&&(b=[{from:f.first,to:f.first+f.size}]);var g=e.sizer.style.marginLeft=e.gutters.offsetWidth+"px";e.scrollbarH.style.left=a.options.fixedGutter?g:"0";var h=1/0;if(a.options.lineNumbers)for(var i=0;i<b.length;++i)b[i].diff&&b[i].from<h&&(h=b[i].from);var j=f.first+f.size,k=Math.max(c.from-a.options.viewportMargin,f.first),l=Math.min(j,c.to+a.options.viewportMargin);if(e.showingFrom<k&&k-e.showingFrom<20&&(k=Math.max(f.first,e.showingFrom)),e.showingTo>l&&e.showingTo-l<20&&(l=Math.min(j,e.showingTo)),v)for(k=oe(Ed(f,ke(f,k)));j>l&&Fd(f,ke(f,l));)++l;var m=[{from:Math.max(e.showingFrom,f.first),to:Math.min(e.showingTo,j)}];if(m=m[0].from>=m[0].to?[]:T(m,b),v)for(var i=0;i<m.length;++i)for(var o,n=m[i];o=Dd(ke(f,n.to-1));){var p=o.find().from.line;if(!(p>n.from)){m.splice(i--,1);break}n.to=p}for(var q=0,i=0;i<m.length;++i){var n=m[i];n.from<k&&(n.from=k),n.to>l&&(n.to=l),n.from>=n.to?m.splice(i--,1):q+=n.to-n.from}if(!d&&q==l-k&&k==e.showingFrom&&l==e.showingTo)return S(a),void 0;m.sort(function(a,b){return a.from-b.from});try{var r=document.activeElement}catch(s){}.7*(l-k)>q&&(e.lineDiv.style.display="none"),V(a,k,l,m,h),e.lineDiv.style.display="",r&&document.activeElement!=r&&r.offsetHeight&&r.focus();var t=k!=e.showingFrom||l!=e.showingTo||e.lastSizeC!=e.wrapper.clientHeight;return t&&(e.lastSizeC=e.wrapper.clientHeight,ab(a,400)),e.showingFrom=k,e.showingTo=l,R(a),S(a),!0}}function R(a){for(var f,b=a.display,d=b.lineDiv.offsetTop,e=b.lineDiv.firstChild;e;e=e.nextSibling)if(e.lineObj){if(c){var g=e.offsetTop+e.offsetHeight;f=g-d,d=g}else{var h=of(e);f=h.bottom-h.top}var i=e.lineObj.height-f;if(2>f&&(f=zb(b)),i>.001||-.001>i){ne(e.lineObj,f);var j=e.lineObj.widgets;if(j)for(var k=0;k<j.length;++k)j[k].height=j[k].node.offsetHeight}}}function S(a){var b=a.display.viewOffset=qe(a,ke(a.doc,a.display.showingFrom));a.display.mover.style.top=b+"px"}function T(a,b){for(var c=0,d=b.length||0;d>c;++c){for(var e=b[c],f=[],g=e.diff||0,h=0,i=a.length;i>h;++h){var j=a[h];e.to<=j.from&&e.diff?f.push({from:j.from+g,to:j.to+g}):e.to<=j.from||e.from>=j.to?f.push(j):(e.from>j.from&&f.push({from:j.from,to:e.from}),e.to<j.to&&f.push({from:e.to+g,to:j.to+g}))}a=f}return a}function U(a){for(var b=a.display,c={},d={},e=b.gutters.firstChild,f=0;e;e=e.nextSibling,++f)c[a.options.gutters[f]]=e.offsetLeft,d[a.options.gutters[f]]=e.offsetWidth;return{fixedPos:O(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function V(a,b,c,d,f){function l(b){var c=b.nextSibling;return e&&p&&a.display.currentWheelTarget==b?(b.style.display="none",b.lineObj=null):b.parentNode.removeChild(b),c}var g=U(a),h=a.display,i=a.options.lineNumbers;d.length||e&&a.display.currentWheelTarget||lf(h.lineDiv);var j=h.lineDiv,k=j.firstChild,m=d.shift(),n=b;for(a.doc.iter(b,c,function(b){if(m&&m.to==n&&(m=d.shift()),Fd(a.doc,b)){if(0!=b.height&&ne(b,0),b.widgets&&k&&k.previousSibling)for(var c=0;c<b.widgets.length;++c){var e=b.widgets[c];if(e.showIfHidden){var h=k.previousSibling;if(/pre/i.test(h.nodeName)){var o=kf("div",null,null,"position: relative");h.parentNode.replaceChild(o,h),o.appendChild(h),h=o}var p=h.appendChild(kf("div",[e.node],"CodeMirror-linewidget"));e.handleMouseEvents||(p.ignoreEvents=!0),X(e,p,h,g)}}}else if(m&&m.from<=n&&m.to>n){for(;k.lineObj!=b;)k=l(k);i&&n>=f&&k.lineNumber&&nf(k.lineNumber,N(a.options,n)),k=k.nextSibling}else{if(b.widgets)for(var s,q=0,r=k;r&&20>q;++q,r=r.nextSibling)if(r.lineObj==b&&/div/i.test(r.nodeName)){s=r;break}var t=W(a,b,n,g,s);if(t!=s)j.insertBefore(t,k);else{for(;k!=s;)k=l(k);k=k.nextSibling}t.lineObj=b}++n});k;)k=l(k)}function W(a,b,d,e,f){var k,g=Wd(a,b),h=g.pre,i=b.gutterMarkers,j=a.display,l=g.bgClass?g.bgClass+" "+(b.bgClass||""):b.bgClass;if(!(a.options.lineNumbers||i||l||b.wrapClass||b.widgets))return h;if(f){f.alignable=null;for(var q,m=!0,n=0,o=null,p=f.firstChild;p;p=q)if(q=p.nextSibling,/\bCodeMirror-linewidget\b/.test(p.className)){for(var r=0;r<b.widgets.length;++r){var s=b.widgets[r];if(s.node==p.firstChild){s.above||o||(o=p),X(s,p,f,e),++n;break}}if(r==b.widgets.length){m=!1;break}}else f.removeChild(p);f.insertBefore(h,o),m&&n==b.widgets.length&&(k=f,f.className=b.wrapClass||"")}if(k||(k=kf("div",null,b.wrapClass,"position: relative"),k.appendChild(h)),l&&k.insertBefore(kf("div",null,l+" CodeMirror-linebackground"),k.firstChild),a.options.lineNumbers||i){var t=k.insertBefore(kf("div",null,null,"position: absolute; left: "+(a.options.fixedGutter?e.fixedPos:-e.gutterTotalWidth)+"px"),k.firstChild);if(a.options.fixedGutter&&(k.alignable||(k.alignable=[])).push(t),!a.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(k.lineNumber=t.appendChild(kf("div",N(a.options,d),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+e.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+j.lineNumInnerWidth+"px"))),i)for(var u=0;u<a.options.gutters.length;++u){var v=a.options.gutters[u],w=i.hasOwnProperty(v)&&i[v];w&&t.appendChild(kf("div",[w],"CodeMirror-gutter-elt","left: "+e.gutterLeft[v]+"px; width: "+e.gutterWidth[v]+"px"))}}if(c&&(k.style.zIndex=2),b.widgets&&k!=f)for(var r=0,x=b.widgets;r<x.length;++r){var s=x[r],y=kf("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||(y.ignoreEvents=!0),X(s,y,k,e),s.above?k.insertBefore(y,a.options.lineNumbers&&0!=b.height?t:h):k.appendChild(y),Pe(s,"redraw")}return k}function X(a,b,c,d){if(a.noHScroll){(c.alignable||(c.alignable=[])).push(b);var e=d.wrapperWidth;b.style.left=d.fixedPos+"px",a.coverGutter||(e-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=e+"px"}a.coverGutter&&(b.style.zIndex=5,b.style.position="relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function Y(a){var b=a.display,c=Bc(a.doc.sel.from,a.doc.sel.to);if(c||a.options.showCursorWhenSelecting?Z(a):b.cursor.style.display=b.otherCursor.style.display="none",c?b.selectionDiv.style.display="none":$(a),a.options.moveInputWithCursor){var d=ub(a,a.doc.sel.head,"div"),e=of(b.wrapper),f=of(b.lineDiv);b.inputDiv.style.top=Math.max(0,Math.min(b.wrapper.clientHeight-10,d.top+f.top-e.top))+"px",b.inputDiv.style.left=Math.max(0,Math.min(b.wrapper.clientWidth-10,d.left+f.left-e.left))+"px"}}function Z(a){var b=a.display,c=ub(a,a.doc.sel.head,"div");b.cursor.style.left=c.left+"px",b.cursor.style.top=c.top+"px",b.cursor.style.height=Math.max(0,c.bottom-c.top)*a.options.cursorHeight+"px",b.cursor.style.display="",c.other?(b.otherCursor.style.display="",b.otherCursor.style.left=c.other.left+"px",b.otherCursor.style.top=c.other.top+"px",b.otherCursor.style.height=.85*(c.other.bottom-c.other.top)+"px"):b.otherCursor.style.display="none"}function $(a){function h(a,b,c,d){0>b&&(b=0),e.appendChild(kf("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?f-a:c)+"px; height: "+(d-b)+"px"))}function i(b,d,e){function m(c,d){return tb(a,Ac(b,c),"div",i,d)}var k,l,i=ke(c,b),j=i.text.length;return zf(re(i),d||0,null==e?j:e,function(a,b,c){var n,o,p,i=m(a,"left");if(a==b)n=i,o=p=i.left;else{if(n=m(b-1,"right"),"rtl"==c){var q=i;i=n,n=q}o=i.left,p=n.right}null==d&&0==a&&(o=g),n.top-i.top>3&&(h(o,i.top,null,i.bottom),o=g,i.bottom<n.top&&h(o,i.bottom,null,n.top)),null==e&&b==j&&(p=f),(!k||i.top<k.top||i.top==k.top&&i.left<k.left)&&(k=i),(!l||n.bottom>l.bottom||n.bottom==l.bottom&&n.right>l.right)&&(l=n),g+1>o&&(o=g),h(o,n.top,p-o,n.bottom)}),{start:k,end:l}}var b=a.display,c=a.doc,d=a.doc.sel,e=document.createDocumentFragment(),f=b.lineSpace.offsetWidth,g=gb(a.display);if(d.from.line==d.to.line)i(d.from.line,d.from.ch,d.to.ch);else{var j=ke(c,d.from.line),k=ke(c,d.to.line),l=Ed(c,j)==Ed(c,k),m=i(d.from.line,d.from.ch,l?j.text.length:null).end,n=i(d.to.line,l?0:null,d.to.ch).start;l&&(m.top<n.top-2?(h(m.right,m.top,null,m.bottom),h(g,n.top,n.left,n.bottom)):h(m.right,m.top,n.left-m.right,m.bottom)),m.bottom<n.top&&h(g,m.bottom,null,n.top)}mf(b.selectionDiv,e),b.selectionDiv.style.display=""}function _(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursor.style.visibility=b.otherCursor.style.visibility="",a.options.cursorBlinkRate>0&&(b.blinker=setInterval(function(){b.cursor.style.visibility=b.otherCursor.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate))}}function ab(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.showingTo&&a.state.highlight.set(b,ef(bb,a))}function bb(a){var b=a.doc;if(b.frontier<b.first&&(b.frontier=b.first),!(b.frontier>=a.display.showingTo)){var f,c=+new Date+a.options.workTime,d=gd(b.mode,db(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.showingTo+500),function(g){if(b.frontier>=a.display.showingFrom){var h=g.styles;g.styles=Rd(a,g,d);for(var i=!h||h.length!=g.styles.length,j=0;!i&&j<h.length;++j)i=h[j]!=g.styles[j];i&&(f&&f.end==b.frontier?f.end++:e.push(f={start:b.frontier,end:b.frontier+1})),g.stateAfter=gd(b.mode,d)}else Td(a,g,d),g.stateAfter=0==b.frontier%5?gd(b.mode,d):null;return++b.frontier,+new Date>c?(ab(a,a.options.workDelay),!0):void 0}),e.length&&Eb(a,function(){for(var a=0;a<e.length;++a)Hb(this,e[a].start,e[a].end)})()}}function cb(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1e3:100),h=b;h>g;--h){if(h<=f.first)return f.first;var i=ke(f,h-1);if(i.stateAfter&&(!c||h<=f.frontier))return h;var j=Xe(i.text,null,a.options.tabSize);(null==e||d>j)&&(e=h-1,d=j)}return e}function db(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=cb(a,b,c),g=f>d.first&&ke(d,f-1).stateAfter;return g=g?gd(d.mode,g):hd(d.mode),d.iter(f,b,function(c){Td(a,c,g);var h=f==b-1||0==f%5||f>=e.showingFrom&&f<e.showingTo;c.stateAfter=h?gd(d.mode,g):null,++f}),c&&(d.frontier=f),g}function eb(a){return a.lineSpace.offsetTop}function fb(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function gb(a){var b=mf(a.measure,kf("pre",null,null,"text-align: left")).appendChild(kf("span","x"));return b.offsetLeft}function hb(a,b,c,d,e){var f=-1;if(d=d||kb(a,b),d.crude){var g=d.left+c*d.width;return{left:g,right:g+d.width,top:d.top,bottom:d.bottom}}for(var h=c;;h+=f){var i=d[h];if(i)break;0>f&&0==h&&(f=1)}return e=h>c?"left":c>h?"right":e,"left"==e&&i.leftSide?i=i.leftSide:"right"==e&&i.rightSide&&(i=i.rightSide),{left:c>h?i.right:i.left,right:h>c?i.left:i.right,top:i.top,bottom:i.bottom}}function ib(a,b){for(var c=a.display.measureLineCache,d=0;d<c.length;++d){var e=c[d];if(e.text==b.text&&e.markedSpans==b.markedSpans&&a.display.scroller.clientWidth==e.width&&e.classes==b.textClass+"|"+b.wrapClass)return e}}function jb(a,b){var c=ib(a,b);c&&(c.text=c.measure=c.markedSpans=null)}function kb(a,b){var c=ib(a,b);if(c)return c.measure;var d=lb(a,b),e=a.display.measureLineCache,f={text:b.text,width:a.display.scroller.clientWidth,markedSpans:b.markedSpans,measure:d,classes:b.textClass+"|"+b.wrapClass};return 16==e.length?e[++a.display.measureLineCachePos%16]=f:e.push(f),d}function lb(a,e){function t(a){var b=a.top-p.top,c=a.bottom-p.top;c>s&&(c=s),0>b&&(b=0);for(var d=q.length-2;d>=0;d-=2){var e=q[d],f=q[d+1];if(!(e>c||b>f)&&(b>=e&&f>=c||e>=b&&c>=f||Math.min(c,f)-Math.max(b,e)>=c-b>>1)){q[d]=Math.min(b,e),q[d+1]=Math.max(c,f);break}}return 0>d&&(d=q.length,q.push(b,c)),{left:a.left-p.left,right:a.right-p.left,top:d,bottom:null}}function u(a){a.bottom=q[a.top+1],a.top=q[a.top]}if(!a.options.lineWrapping&&e.text.length>=a.options.crudeMeasuringFrom)return mb(a,e);var f=a.display,g=df(e.text.length),h=Wd(a,e,g,!0).pre;if(b&&!c&&!a.options.lineWrapping&&h.childNodes.length>100){for(var i=document.createDocumentFragment(),j=10,k=h.childNodes.length,l=0,m=Math.ceil(k/j);m>l;++l){for(var n=kf("div",null,null,"display: inline-block"),o=0;j>o&&k;++o)n.appendChild(h.firstChild),--k;i.appendChild(n)}h.appendChild(i)}mf(f.measure,h);var p=of(f.lineDiv),q=[],r=df(e.text.length),s=h.offsetHeight;d&&f.measure.first!=h&&mf(f.measure,h);for(var v,l=0;l<g.length;++l)if(v=g[l]){var w=v,x=null;if(/\bCodeMirror-widget\b/.test(v.className)&&v.getClientRects){1==v.firstChild.nodeType&&(w=v.firstChild);var y=w.getClientRects();y.length>1&&(x=r[l]=t(y[0]),x.rightSide=t(y[y.length-1]))}x||(x=r[l]=t(of(w))),v.measureRight&&(x.right=of(v.measureRight).left),v.leftSide&&(x.leftSide=t(of(v.leftSide)))}lf(a.display.measure);for(var v,l=0;l<r.length;++l)(v=r[l])&&(u(v),v.leftSide&&u(v.leftSide),v.rightSide&&u(v.rightSide));return r}function mb(a,b){var c=new Nd(b.text.slice(0,100),null);b.textClass&&(c.textClass=b.textClass);var d=lb(a,c),e=hb(a,c,0,d,"left"),f=hb(a,c,99,d,"right");return{crude:!0,top:e.top,left:e.left,bottom:e.bottom,width:(f.right-e.left)/100}}function nb(a,b){var c=!1;if(b.markedSpans)for(var d=0;d<b.markedSpans;++d){var e=b.markedSpans[d];!e.collapsed||null!=e.to&&e.to!=b.text.length||(c=!0)}var f=!c&&ib(a,b);if(f||b.text.length>=a.options.crudeMeasuringFrom)return hb(a,b,b.text.length,f&&f.measure,"right").right;var g=Wd(a,b,null,!0).pre,h=g.appendChild(uf(a.display.measure));return mf(a.display.measure,g),of(h).right-of(a.display.lineDiv).left}function ob(a){a.display.measureLineCache.length=a.display.measureLineCachePos=0,a.display.cachedCharWidth=a.display.cachedTextHeight=null,a.options.lineWrapping||(a.display.maxLineChanged=!0),a.display.lineNumChars=null}function pb(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function qb(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function rb(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=Ld(b.widgets[e]);c.top+=f,c.bottom+=f}if("line"==d)return c;d||(d="local");var g=qe(a,b);if("local"==d?g+=eb(a.display):g-=a.display.viewOffset,"page"==d||"window"==d){var h=of(a.display.lineSpace);g+=h.top+("window"==d?0:qb());var i=h.left+("window"==d?0:pb());c.left+=i,c.right+=i}return c.top+=g,c.bottom+=g,c}function sb(a,b,c){if("div"==c)return b;var d=b.left,e=b.top;if("page"==c)d-=pb(),e-=qb();else if("local"==c||!c){var f=of(a.display.sizer);d+=f.left,e+=f.top}var g=of(a.display.lineSpace);return{left:d-g.left,top:e-g.top}}function tb(a,b,c,d,e){return d||(d=ke(a.doc,b.line)),rb(a,d,hb(a,d,b.ch,null,e),c)}function ub(a,b,c,d,e){function f(b,f){var g=hb(a,d,b,e,f?"right":"left");return f?g.left=g.right:g.right=g.left,rb(a,d,g,c)}function g(a,b){var c=h[b],d=c.level%2;return a==Af(c)&&b&&c.level<h[b-1].level?(c=h[--b],a=Bf(c)-(c.level%2?0:1),d=!0):a==Bf(c)&&b<h.length-1&&c.level<h[b+1].level&&(c=h[++b],a=Af(c)-c.level%2,d=!1),d&&a==c.to&&a>c.from?f(a-1):f(a,d)}d=d||ke(a.doc,b.line),e||(e=kb(a,d));var h=re(d),i=b.ch;if(!h)return f(i);var j=If(h,i),k=g(i,j);return null!=Hf&&(k.other=g(i,Hf)),k}function vb(a,b,c,d){var e=new Ac(a,b);return e.xRel=d,c&&(e.outside=!0),e}function wb(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return vb(d.first,0,!0,-1);var e=pe(d,c),f=d.first+d.size-1;if(e>f)return vb(d.first+d.size-1,ke(d,f).text.length,!0,1);for(0>b&&(b=0);;){var g=ke(d,e),h=xb(a,g,e,b,c),i=Dd(g),j=i&&i.find();if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=j.to.line}}function xb(a,b,c,d,e){function j(d){var e=ub(a,Ac(c,d),"line",b,i);return g=!0,f>e.bottom?e.left-h:f<e.top?e.left+h:(g=!1,e.left)}var f=e-qe(a,b),g=!1,h=2*a.display.wrapper.clientWidth,i=kb(a,b),k=re(b),l=b.text.length,m=Cf(b),n=Df(b),o=j(m),p=g,q=j(n),r=g;if(d>q)return vb(c,n,r,1);for(;;){if(k?n==m||n==Kf(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);jf.test(b.text.charAt(s));)++s;var u=vb(c,s,s==m?p:r,0>t?-1:t?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=Kf(b,w,1)}var y=j(w);y>d?(n=w,q=y,(r=g)&&(q+=1e3),l=v):(m=w,o=y,p=g,l-=v)}}function zb(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==yb){yb=kf("pre");for(var b=0;49>b;++b)yb.appendChild(document.createTextNode("x")),yb.appendChild(kf("br"));yb.appendChild(document.createTextNode("x"))}mf(a.measure,yb);var c=yb.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),lf(a.measure),c||1}function Ab(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=kf("span","x"),c=kf("pre",[b]);mf(a.measure,c);var d=b.offsetWidth;return d>2&&(a.cachedCharWidth=d),d||10}function Cb(a){a.curOp={changes:[],forceUpdate:!1,updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,cursorActivity:!1,updateMaxLine:!1,updateScrollPos:!1,id:++Bb},Oe++||(Ne=[])}function Db(a){var b=a.curOp,c=a.doc,d=a.display;if(a.curOp=null,b.updateMaxLine&&H(a),d.maxLineChanged&&!a.options.lineWrapping&&d.maxLine){var e=nb(a,d.maxLine);d.sizer.style.minWidth=Math.max(0,e+3+Ue)+"px",d.maxLineChanged=!1;var f=Math.max(0,d.sizer.offsetLeft+d.sizer.offsetWidth-d.scroller.clientWidth);f<c.scrollLeft&&!b.updateScrollPos&&_b(a,Math.min(d.scroller.scrollLeft,f),!0)}var g,h;if(b.updateScrollPos)g=b.updateScrollPos;else if(b.selectionChanged&&d.scroller.clientHeight){var i=ub(a,c.sel.head);g=Qc(a,i.left,i.top,i.left,i.bottom)}(b.changes.length||b.forceUpdate||g&&null!=g.scrollTop)&&(h=P(a,b.changes,g&&g.scrollTop,b.forceUpdate),a.display.scroller.offsetHeight&&(a.doc.scrollTop=a.display.scroller.scrollTop)),!h&&b.selectionChanged&&Y(a),b.updateScrollPos?(d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=g.scrollTop,d.scroller.scrollLeft=d.scrollbarH.scrollLeft=c.scrollLeft=g.scrollLeft,L(a),b.scrollToPos&&Oc(a,Fc(a.doc,b.scrollToPos.from),Fc(a.doc,b.scrollToPos.to),b.scrollToPos.margin)):g&&Nc(a),b.selectionChanged&&_(a),a.state.focused&&b.updateInput&&Lb(a,b.userSelChange);var j=b.maybeHiddenMarkers,k=b.maybeUnhiddenMarkers;if(j)for(var l=0;l<j.length;++l)j[l].lines.length||Me(j[l],"hide");if(k)for(var l=0;l<k.length;++l)k[l].lines.length&&Me(k[l],"unhide");var m;if(--Oe||(m=Ne,Ne=null),b.textChanged&&Me(a,"change",a,b.textChanged),b.cursorActivity&&Me(a,"cursorActivity",a),m)for(var l=0;l<m.length;++l)m[l]()}function Eb(a,b){return function(){var c=a||this,d=!c.curOp;d&&Cb(c);try{var e=b.apply(c,arguments)}finally{d&&Db(c)}return e}}function Fb(a){return function(){var c,b=this.cm&&!this.cm.curOp;b&&Cb(this.cm);try{c=a.apply(this,arguments)}finally{b&&Db(this.cm)}return c}}function Gb(a,b){var d,c=!a.curOp;c&&Cb(a);try{d=b()}finally{c&&Db(a)}return d}function Hb(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),a.curOp.changes.push({from:b,to:c,diff:d})}function Ib(a){a.display.pollingFast||a.display.poll.set(a.options.pollInterval,function(){Kb(a),a.state.focused&&Ib(a)})}function Jb(a){function c(){var d=Kb(a);d||b?(a.display.pollingFast=!1,Ib(a)):(b=!0,a.display.poll.set(60,c))}var b=!1;a.display.pollingFast=!0,a.display.poll.set(20,c)}function Kb(a){var c=a.display.input,e=a.display.prevInput,f=a.doc,g=f.sel;if(!a.state.focused||wf(c)||Nb(a)||a.state.disableInput)return!1;a.state.pasteIncoming&&a.state.fakedLastChar&&(c.value=c.value.substring(0,c.value.length-1),a.state.fakedLastChar=!1);var h=c.value;if(h==e&&Bc(g.from,g.to))return!1;if(b&&!d&&a.display.inputHasSelection===h)return Lb(a,!0),!1;var i=!a.curOp;i&&Cb(a),g.shift=!1;for(var j=0,k=Math.min(e.length,h.length);k>j&&e.charCodeAt(j)==h.charCodeAt(j);)++j;var l=g.from,m=g.to;j<e.length?l=Ac(l.line,l.ch-(e.length-j)):a.state.overwrite&&Bc(l,m)&&!a.state.pasteIncoming&&(m=Ac(m.line,Math.min(ke(f,m.line).text.length,m.ch+(h.length-j))));var n=a.curOp.updateInput,o={from:l,to:m,text:vf(h.slice(j)),origin:a.state.pasteIncoming?"paste":"+input"};return tc(a.doc,o,"end"),a.curOp.updateInput=n,Pe(a,"inputRead",a,o),h.length>1e3||h.indexOf("\n")>-1?c.value=a.display.prevInput="":a.display.prevInput=h,i&&Db(a),a.state.pasteIncoming=!1,!0}function Lb(a,c){var e,f,g=a.doc;if(Bc(g.sel.from,g.sel.to))c&&(a.display.prevInput=a.display.input.value="",b&&!d&&(a.display.inputHasSelection=null));else{a.display.prevInput="",e=xf&&(g.sel.to.line-g.sel.from.line>100||(f=a.getSelection()).length>1e3);var h=e?"-":f||a.getSelection();a.display.input.value=h,a.state.focused&&_e(a.display.input),b&&!d&&(a.display.inputHasSelection=h)}a.display.inaccurateSelection=e}function Mb(a){"nocursor"==a.options.readOnly||o&&document.activeElement==a.display.input||a.display.input.focus()}function Nb(a){return a.options.readOnly||a.doc.cantEdit
2
+ }function Ob(a){function f(){a.state.focused&&setTimeout(ef(Mb,a),0)}function h(){null==g&&(g=setTimeout(function(){g=null,c.cachedCharWidth=c.cachedTextHeight=rf=null,ob(a),Gb(a,ef(Hb,a))},100))}function i(){for(var a=c.wrapper.parentNode;a&&a!=document.body;a=a.parentNode);a?setTimeout(i,5e3):Le(window,"resize",h)}function k(b){Qe(a,b)||a.options.onDragEvent&&a.options.onDragEvent(a,De(b))||He(b)}function l(){c.inaccurateSelection&&(c.prevInput="",c.inaccurateSelection=!1,c.input.value=a.getSelection(),_e(c.input))}var c=a.display;Ke(c.scroller,"mousedown",Eb(a,Tb)),b?Ke(c.scroller,"dblclick",Eb(a,function(b){if(!Qe(a,b)){var c=Qb(a,b);if(c&&!Wb(a,b)&&!Pb(a.display,b)){Ee(b);var d=Xc(ke(a.doc,c.line).text,c);Ic(a.doc,d.from,d.to)}}})):Ke(c.scroller,"dblclick",function(b){Qe(a,b)||Ee(b)}),Ke(c.lineSpace,"selectstart",function(a){Pb(c,a)||Ee(a)}),t||Ke(c.scroller,"contextmenu",function(b){oc(a,b)}),Ke(c.scroller,"scroll",function(){c.scroller.clientHeight&&($b(a,c.scroller.scrollTop),_b(a,c.scroller.scrollLeft,!0),Me(a,"scroll",a))}),Ke(c.scrollbarV,"scroll",function(){c.scroller.clientHeight&&$b(a,c.scrollbarV.scrollTop)}),Ke(c.scrollbarH,"scroll",function(){c.scroller.clientHeight&&_b(a,c.scrollbarH.scrollLeft)}),Ke(c.scroller,"mousewheel",function(b){cc(a,b)}),Ke(c.scroller,"DOMMouseScroll",function(b){cc(a,b)}),Ke(c.scrollbarH,"mousedown",f),Ke(c.scrollbarV,"mousedown",f),Ke(c.wrapper,"scroll",function(){c.wrapper.scrollTop=c.wrapper.scrollLeft=0});var g;Ke(window,"resize",h),setTimeout(i,5e3),Ke(c.input,"keyup",Eb(a,function(b){Qe(a,b)||a.options.onKeyEvent&&a.options.onKeyEvent(a,De(b))||16==b.keyCode&&(a.doc.sel.shift=!1)})),Ke(c.input,"input",function(){b&&!d&&a.display.inputHasSelection&&(a.display.inputHasSelection=null),Jb(a)}),Ke(c.input,"keydown",Eb(a,jc)),Ke(c.input,"keypress",Eb(a,kc)),Ke(c.input,"focus",ef(lc,a)),Ke(c.input,"blur",ef(mc,a)),a.options.dragDrop&&(Ke(c.scroller,"dragstart",function(b){Zb(a,b)}),Ke(c.scroller,"dragenter",k),Ke(c.scroller,"dragover",k),Ke(c.scroller,"drop",Eb(a,Yb))),Ke(c.scroller,"paste",function(b){Pb(c,b)||(Mb(a),Jb(a))}),Ke(c.input,"paste",function(){if(e&&!a.state.fakedLastChar&&!(new Date-a.state.lastMiddleDown<200)){var b=c.input.selectionStart,d=c.input.selectionEnd;c.input.value+="$",c.input.selectionStart=b,c.input.selectionEnd=d,a.state.fakedLastChar=!0}a.state.pasteIncoming=!0,Jb(a)}),Ke(c.input,"cut",l),Ke(c.input,"copy",l),j&&Ke(c.sizer,"mouseup",function(){document.activeElement==c.input&&c.input.blur(),Mb(a)})}function Pb(a,b){for(var c=Ie(b);c!=a.wrapper;c=c.parentNode)if(!c||c.ignoreEvents||c.parentNode==a.sizer&&c!=a.mover)return!0}function Qb(a,b,c){var d=a.display;if(!c){var e=Ie(b);if(e==d.scrollbarH||e==d.scrollbarH.firstChild||e==d.scrollbarV||e==d.scrollbarV.firstChild||e==d.scrollbarFiller||e==d.gutterFiller)return null}var f,g,h=of(d.lineSpace);try{f=b.clientX,g=b.clientY}catch(b){return null}return wb(a,f-h.left,g-h.top)}function Tb(a){function q(a){if(!Bc(p,a)){if(p=a,"single"==j)return Ic(c.doc,Fc(f,h),a),void 0;if(n=Fc(f,n),o=Fc(f,o),"double"==j){var b=Xc(ke(f,a.line).text,a);Cc(a,n)?Ic(c.doc,b.from,o):Ic(c.doc,n,b.to)}else"triple"==j&&(Cc(a,n)?Ic(c.doc,o,Fc(f,Ac(a.line,0))):Ic(c.doc,n,Fc(f,Ac(a.line+1,0))))}}function u(a){var b=++s,e=Qb(c,a,!0);if(e)if(Bc(e,l)){var h=a.clientY<r.top?-20:a.clientY>r.bottom?20:0;h&&setTimeout(Eb(c,function(){s==b&&(d.scroller.scrollTop+=h,u(a))}),50)}else{c.state.focused||lc(c),l=e,q(e);var g=K(d,f);(e.line>=g.to||e.line<g.from)&&setTimeout(Eb(c,function(){s==b&&u(a)}),150)}}function v(a){s=1/0,Ee(a),Mb(c),Le(document,"mousemove",w),Le(document,"mouseup",x)}if(!Qe(this,a)){var c=this,d=c.display,f=c.doc,g=f.sel;if(g.shift=a.shiftKey,Pb(d,a))return e||(d.scroller.draggable=!1,setTimeout(function(){d.scroller.draggable=!0},100)),void 0;if(!Wb(c,a)){var h=Qb(c,a);switch(Je(a)){case 3:return t&&oc.call(c,c,a),void 0;case 2:return e&&(c.state.lastMiddleDown=+new Date),h&&Ic(c.doc,h),setTimeout(ef(Mb,c),20),Ee(a),void 0}if(!h)return Ie(a)==d.scroller&&Ee(a),void 0;c.state.focused||lc(c);var i=+new Date,j="single";if(Sb&&Sb.time>i-400&&Bc(Sb.pos,h))j="triple",Ee(a),setTimeout(ef(Mb,c),20),Yc(c,h.line);else if(Rb&&Rb.time>i-400&&Bc(Rb.pos,h)){j="double",Sb={time:i,pos:h},Ee(a);var k=Xc(ke(f,h.line).text,h);Ic(c.doc,k.from,k.to)}else Rb={time:i,pos:h};var l=h;if(c.options.dragDrop&&pf&&!Nb(c)&&!Bc(g.from,g.to)&&!Cc(h,g.from)&&!Cc(g.to,h)&&"single"==j){var m=Eb(c,function(b){e&&(d.scroller.draggable=!1),c.state.draggingText=!1,Le(document,"mouseup",m),Le(d.scroller,"drop",m),Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-b.clientY)<10&&(Ee(b),Ic(c.doc,h),Mb(c))});return e&&(d.scroller.draggable=!0),c.state.draggingText=m,d.scroller.dragDrop&&d.scroller.dragDrop(),Ke(document,"mouseup",m),Ke(d.scroller,"drop",m),void 0}Ee(a),"single"==j&&Ic(c.doc,Fc(f,h));var n=g.from,o=g.to,p=h,r=of(d.wrapper),s=0,w=Eb(c,function(a){b||Je(a)?u(a):v(a)}),x=Eb(c,v);Ke(document,"mousemove",w),Ke(document,"mouseup",x)}}}function Ub(a,b,c,d,e){try{var f=b.clientX,g=b.clientY}catch(b){return!1}if(f>=Math.floor(of(a.display.gutters).right))return!1;d&&Ee(b);var h=a.display,i=of(h.lineDiv);if(g>i.bottom||!Se(a,c))return Ge(b);g-=i.top-h.viewOffset;for(var j=0;j<a.options.gutters.length;++j){var k=h.gutters.childNodes[j];if(k&&of(k).right>=f){var l=pe(a.doc,g),m=a.options.gutters[j];return e(a,c,a,l,m,b),Ge(b)}}}function Vb(a,b){return Se(a,"gutterContextMenu")?Ub(a,b,"gutterContextMenu",!1,Me):!1}function Wb(a,b){return Ub(a,b,"gutterClick",!0,Pe)}function Yb(a){var c=this;if(!(Qe(c,a)||Pb(c.display,a)||c.options.onDragEvent&&c.options.onDragEvent(c,De(a)))){Ee(a),b&&(Xb=+new Date);var d=Qb(c,a,!0),e=a.dataTransfer.files;if(d&&!Nb(c))if(e&&e.length&&window.FileReader&&window.File)for(var f=e.length,g=Array(f),h=0,i=function(a,b){var e=new FileReader;e.onload=function(){g[b]=e.result,++h==f&&(d=Fc(c.doc,d),tc(c.doc,{from:d,to:d,text:vf(g.join("\n")),origin:"paste"},"around"))},e.readAsText(a)},j=0;f>j;++j)i(e[j],j);else{if(c.state.draggingText&&!Cc(d,c.doc.sel.from)&&!Cc(c.doc.sel.to,d))return c.state.draggingText(a),setTimeout(ef(Mb,c),20),void 0;try{var g=a.dataTransfer.getData("Text");if(g){var k=c.doc.sel.from,l=c.doc.sel.to;Kc(c.doc,d,d),c.state.draggingText&&zc(c.doc,"",k,l,"paste"),c.replaceSelection(g,null,"paste"),Mb(c),lc(c)}}catch(a){}}}}function Zb(a,c){if(b&&(!a.state.draggingText||+new Date-Xb<100))return He(c),void 0;if(!Qe(a,c)&&!Pb(a.display,c)){var d=a.getSelection();if(c.dataTransfer.setData("Text",d),c.dataTransfer.setDragImage&&!i){var e=kf("img",null,null,"position: fixed; left: 0; top: 0;");e.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(e.width=e.height=1,a.display.wrapper.appendChild(e),e._top=e.offsetTop),c.dataTransfer.setDragImage(e,0,0),h&&e.parentNode.removeChild(e)}}}function $b(b,c){Math.abs(b.doc.scrollTop-c)<2||(b.doc.scrollTop=c,a||P(b,[],c),b.display.scroller.scrollTop!=c&&(b.display.scroller.scrollTop=c),b.display.scrollbarV.scrollTop!=c&&(b.display.scrollbarV.scrollTop=c),a&&P(b,[]),ab(b,100))}function _b(a,b,c){(c?b==a.doc.scrollLeft:Math.abs(a.doc.scrollLeft-b)<2)||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,L(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbarH.scrollLeft!=b&&(a.display.scrollbarH.scrollLeft=b))}function cc(b,c){var d=c.wheelDeltaX,f=c.wheelDeltaY;null==d&&c.detail&&c.axis==c.HORIZONTAL_AXIS&&(d=c.detail),null==f&&c.detail&&c.axis==c.VERTICAL_AXIS?f=c.detail:null==f&&(f=c.wheelDelta);var g=b.display,i=g.scroller;if(d&&i.scrollWidth>i.clientWidth||f&&i.scrollHeight>i.clientHeight){if(f&&p&&e)for(var j=c.target;j!=i;j=j.parentNode)if(j.lineObj){b.display.currentWheelTarget=j;break}if(d&&!a&&!h&&null!=bc)return f&&$b(b,Math.max(0,Math.min(i.scrollTop+f*bc,i.scrollHeight-i.clientHeight))),_b(b,Math.max(0,Math.min(i.scrollLeft+d*bc,i.scrollWidth-i.clientWidth))),Ee(c),g.wheelStartX=null,void 0;if(f&&null!=bc){var k=f*bc,l=b.doc.scrollTop,m=l+g.wrapper.clientHeight;0>k?l=Math.max(0,l+k-50):m=Math.min(b.doc.height,m+k+50),P(b,[],{top:l,bottom:m})}20>ac&&(null==g.wheelStartX?(g.wheelStartX=i.scrollLeft,g.wheelStartY=i.scrollTop,g.wheelDX=d,g.wheelDY=f,setTimeout(function(){if(null!=g.wheelStartX){var a=i.scrollLeft-g.wheelStartX,b=i.scrollTop-g.wheelStartY,c=b&&g.wheelDY&&b/g.wheelDY||a&&g.wheelDX&&a/g.wheelDX;g.wheelStartX=g.wheelStartY=null,c&&(bc=(bc*ac+c)/(ac+1),++ac)}},200)):(g.wheelDX+=d,g.wheelDY+=f))}}function dc(a,b,c){if("string"==typeof b&&(b=id[b],!b))return!1;a.display.pollingFast&&Kb(a)&&(a.display.pollingFast=!1);var d=a.doc,e=d.sel.shift,f=!1;try{Nb(a)&&(a.state.suppressEdits=!0),c&&(d.sel.shift=!1),f=b(a)!=Ve}finally{d.sel.shift=e,a.state.suppressEdits=!1}return f}function ec(a){var b=a.state.keyMaps.slice(0);return a.options.extraKeys&&b.push(a.options.extraKeys),b.push(a.options.keyMap),b}function gc(a,b){var c=kd(a.options.keyMap),e=c.auto;clearTimeout(fc),e&&!md(b)&&(fc=setTimeout(function(){kd(a.options.keyMap)==c&&(a.options.keyMap=e.call?e.call(null,a):e,C(a))},50));var f=nd(b,!0),g=!1;if(!f)return!1;var h=ec(a);return g=b.shiftKey?ld("Shift-"+f,h,function(b){return dc(a,b,!0)})||ld(f,h,function(b){return("string"==typeof b?/^go[A-Z]/.test(b):b.motion)?dc(a,b):void 0}):ld(f,h,function(b){return dc(a,b)}),g&&(Ee(b),_(a),d&&(b.oldKeyCode=b.keyCode,b.keyCode=0),Pe(a,"keyHandled",a,f,b)),g}function hc(a,b,c){var d=ld("'"+c+"'",ec(a),function(b){return dc(a,b,!0)});return d&&(Ee(b),_(a),Pe(a,"keyHandled",a,"'"+c+"'",b)),d}function jc(a){var c=this;if(c.state.focused||lc(c),!(Qe(c,a)||c.options.onKeyEvent&&c.options.onKeyEvent(c,De(a)))){b&&27==a.keyCode&&(a.returnValue=!1);var d=a.keyCode;c.doc.sel.shift=16==d||a.shiftKey;var e=gc(c,a);h&&(ic=e?d:null,!e&&88==d&&!xf&&(p?a.metaKey:a.ctrlKey)&&c.replaceSelection(""))}}function kc(a){var c=this;if(!(Qe(c,a)||c.options.onKeyEvent&&c.options.onKeyEvent(c,De(a)))){var e=a.keyCode,f=a.charCode;if(h&&e==ic)return ic=null,Ee(a),void 0;if(!(h&&(!a.which||a.which<10)||j)||!gc(c,a)){var g=String.fromCharCode(null==f?e:f);this.options.electricChars&&this.doc.mode.electricChars&&this.options.smartIndent&&!Nb(this)&&this.doc.mode.electricChars.indexOf(g)>-1&&setTimeout(Eb(c,function(){Tc(c,c.doc.sel.to.line,"smart")}),75),hc(c,a,g)||(b&&!d&&(c.display.inputHasSelection=null),Jb(c))}}}function lc(a){"nocursor"!=a.options.readOnly&&(a.state.focused||(Me(a,"focus",a),a.state.focused=!0,-1==a.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(a.display.wrapper.className+=" CodeMirror-focused"),a.curOp||(Lb(a,!0),e&&setTimeout(ef(Lb,a,!0),0))),Ib(a),_(a))}function mc(a){a.state.focused&&(Me(a,"blur",a),a.state.focused=!1,a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-focused","")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.doc.sel.shift=!1)},150)}function oc(a,c){function l(){if(null!=e.input.selectionStart){var a=e.input.value="\u200b"+(Bc(f.from,f.to)?"":e.input.value);e.prevInput="\u200b",e.input.selectionStart=1,e.input.selectionEnd=a.length}}function m(){if(e.inputDiv.style.position="relative",e.input.style.cssText=k,d&&(e.scrollbarV.scrollTop=e.scroller.scrollTop=i),Ib(a),null!=e.input.selectionStart){(!b||d)&&l(),clearTimeout(nc);var c=0,f=function(){" "==e.prevInput&&0==e.input.selectionStart?Eb(a,id.selectAll)(a):c++<10?nc=setTimeout(f,500):Lb(a)};nc=setTimeout(f,200)}}if(!Qe(a,c,"contextmenu")){var e=a.display,f=a.doc.sel;if(!Pb(e,c)&&!Vb(a,c)){var g=Qb(a,c),i=e.scroller.scrollTop;if(g&&!h){var j=a.options.resetSelectionOnContextMenu;j&&(Bc(f.from,f.to)||Cc(g,f.from)||!Cc(g,f.to))&&Eb(a,Kc)(a.doc,g,g);var k=e.input.style.cssText;if(e.inputDiv.style.position="absolute",e.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(c.clientY-5)+"px; left: "+(c.clientX-5)+"px; z-index: 1000; background: white; outline: none;"+"border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);",Mb(a),Lb(a,!0),Bc(f.from,f.to)&&(e.input.value=e.prevInput=" "),b&&!d&&l(),t){He(c);var n=function(){Le(window,"mouseup",n),setTimeout(m,20)};Ke(window,"mouseup",n)}else setTimeout(m,50)}}}}function qc(a,b,c){if(!Cc(b.from,c))return Fc(a,c);var d=b.text.length-1-(b.to.line-b.from.line);if(c.line>b.to.line+d){var e=c.line-d,f=a.first+a.size-1;return e>f?Ac(f,ke(a,f).text.length):Gc(c,ke(a,e).text.length)}if(c.line==b.to.line+d)return Gc(c,$e(b.text).length+(1==b.text.length?b.from.ch:0)+ke(a,b.to.line).text.length-b.to.ch);var g=c.line-b.from.line;return Gc(c,b.text[g].length+(g?0:b.from.ch))}function rc(a,b,c){if(c&&"object"==typeof c)return{anchor:qc(a,b,c.anchor),head:qc(a,b,c.head)};if("start"==c)return{anchor:b.from,head:b.from};var d=pc(b);if("around"==c)return{anchor:b.from,head:d};if("end"==c)return{anchor:d,head:d};var e=function(a){if(Cc(a,b.from))return a;if(!Cc(b.to,a))return d;var c=a.line+b.text.length-(b.to.line-b.from.line)-1,e=a.ch;return a.line==b.to.line&&(e+=d.ch-b.to.ch),Ac(c,e)};return{anchor:e(a.sel.anchor),head:e(a.sel.head)}}function sc(a,b,c){var d={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};return c&&(d.update=function(b,c,d,e){b&&(this.from=Fc(a,b)),c&&(this.to=Fc(a,c)),d&&(this.text=d),void 0!==e&&(this.origin=e)}),Me(a,"beforeChange",a,d),a.cm&&Me(a.cm,"beforeChange",a.cm,d),d.canceled?null:{from:d.from,to:d.to,text:d.text,origin:d.origin}}function tc(a,b,c,d){if(a.cm){if(!a.cm.curOp)return Eb(a.cm,tc)(a,b,c,d);if(a.cm.state.suppressEdits)return}if(!(Se(a,"beforeChange")||a.cm&&Se(a.cm,"beforeChange"))||(b=sc(a,b,!0))){var e=u&&!d&&Ad(a,b.from,b.to);if(e){for(var f=e.length-1;f>=1;--f)uc(a,{from:e[f].from,to:e[f].to,text:[""]});e.length&&uc(a,{from:e[0].from,to:e[0].to,text:b.text},c)}else uc(a,b,c)}}function uc(a,b,c){if(1!=b.text.length||""!=b.text[0]||!Bc(b.from,b.to)){var d=rc(a,b,c);ve(a,b,d,a.cm?a.cm.curOp.id:0/0),xc(a,b,d,yd(a,b));var e=[];ie(a,function(a,c){c||-1!=af(e,a.history)||(Be(a.history,b),e.push(a.history)),xc(a,b,null,yd(a,b))})}}function vc(a,b){if(!a.cm||!a.cm.state.suppressEdits){var c=a.history,d=("undo"==b?c.done:c.undone).pop();if(d){var e={changes:[],anchorBefore:d.anchorAfter,headBefore:d.headAfter,anchorAfter:d.anchorBefore,headAfter:d.headBefore,generation:c.generation};("undo"==b?c.undone:c.done).push(e),c.generation=d.generation||++c.maxGeneration;for(var f=Se(a,"beforeChange")||a.cm&&Se(a.cm,"beforeChange"),g=d.changes.length-1;g>=0;--g){var h=d.changes[g];if(h.origin=b,f&&!sc(a,h,!1))return("undo"==b?c.done:c.undone).length=0,void 0;e.changes.push(ue(a,h));var i=g?rc(a,h,null):{anchor:d.anchorBefore,head:d.headBefore};xc(a,h,i,zd(a,h));var j=[];ie(a,function(a,b){b||-1!=af(j,a.history)||(Be(a.history,h),j.push(a.history)),xc(a,h,null,zd(a,h))})}}}}function wc(a,b){function c(a){return Ac(a.line+b,a.ch)}a.first+=b,a.cm&&Hb(a.cm,a.first,a.first,b),a.sel.head=c(a.sel.head),a.sel.anchor=c(a.sel.anchor),a.sel.from=c(a.sel.from),a.sel.to=c(a.sel.to)}function xc(a,b,c,d){if(a.cm&&!a.cm.curOp)return Eb(a.cm,xc)(a,b,c,d);if(b.to.line<a.first)return wc(a,b.text.length-1-(b.to.line-b.from.line)),void 0;if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);wc(a,e),b={from:Ac(a.first,0),to:Ac(b.to.line+e,b.to.ch),text:[$e(b.text)],origin:b.origin}}var f=a.lastLine();b.to.line>f&&(b={from:b.from,to:Ac(f,ke(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=le(a,b.from,b.to),c||(c=rc(a,b,null)),a.cm?yc(a.cm,b,d,c):be(a,b,d,c)}}function yc(a,b,c,d){var e=a.doc,f=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=oe(Ed(e,ke(e,g.line))),e.iter(j,h.line+1,function(a){return a==f.maxLine?(i=!0,!0):void 0})),Cc(e.sel.head,b.from)||Cc(b.to,e.sel.head)||(a.curOp.cursorActivity=!0),be(e,b,c,d,A(a)),a.options.lineWrapping||(e.iter(j,g.line+b.text.length,function(a){var b=G(e,a);b>f.maxLineLength&&(f.maxLine=a,f.maxLineLength=b,f.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),e.frontier=Math.min(e.frontier,g.line),ab(a,400);var k=b.text.length-(h.line-g.line)-1;if(Hb(a,g.line,h.line+1,k),Se(a,"change")){var l={from:g,to:h,text:b.text,removed:b.removed,origin:b.origin};if(a.curOp.textChanged){for(var m=a.curOp.textChanged;m.next;m=m.next);m.next=l}else a.curOp.textChanged=l}}function zc(a,b,c,d,e){if(d||(d=c),Cc(d,c)){var f=d;d=c,c=f}"string"==typeof b&&(b=vf(b)),tc(a,{from:c,to:d,text:b,origin:e},null)}function Ac(a,b){return this instanceof Ac?(this.line=a,this.ch=b,void 0):new Ac(a,b)}function Bc(a,b){return a.line==b.line&&a.ch==b.ch}function Cc(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function Dc(a){return Ac(a.line,a.ch)}function Ec(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function Fc(a,b){if(b.line<a.first)return Ac(a.first,0);var c=a.first+a.size-1;return b.line>c?Ac(c,ke(a,c).text.length):Gc(b,ke(a,b.line).text.length)}function Gc(a,b){var c=a.ch;return null==c||c>b?Ac(a.line,b):0>c?Ac(a.line,0):a}function Hc(a,b){return b>=a.first&&b<a.first+a.size}function Ic(a,b,c,d){if(a.sel.shift||a.sel.extend){var e=a.sel.anchor;if(c){var f=Cc(b,e);f!=Cc(c,e)?(e=b,b=c):f!=Cc(b,c)&&(b=c)}Kc(a,e,b,d)}else Kc(a,b,c||b,d);a.cm&&(a.cm.curOp.userSelChange=!0)}function Jc(a,b,c){var d={anchor:b,head:c};return Me(a,"beforeSelectionChange",a,d),a.cm&&Me(a.cm,"beforeSelectionChange",a.cm,d),d.anchor=Fc(a,d.anchor),d.head=Fc(a,d.head),d}function Kc(a,b,c,d,e){if(!e&&Se(a,"beforeSelectionChange")||a.cm&&Se(a.cm,"beforeSelectionChange")){var f=Jc(a,b,c);c=f.head,b=f.anchor}var g=a.sel;if(g.goalColumn=null,null==d&&(d=Cc(c,g.head)?-1:1),(e||!Bc(b,g.anchor))&&(b=Mc(a,b,d,"push"!=e)),(e||!Bc(c,g.head))&&(c=Mc(a,c,d,"push"!=e)),!Bc(g.anchor,b)||!Bc(g.head,c)){g.anchor=b,g.head=c;var h=Cc(c,b);g.from=h?c:b,g.to=h?b:c,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=a.cm.curOp.cursorActivity=!0),Pe(a,"cursorActivity",a)}}function Lc(a){Kc(a.doc,a.doc.sel.from,a.doc.sel.to,null,"push")}function Mc(a,b,c,d){var e=!1,f=b,g=c||1;a.cantEdit=!1;a:for(;;){var h=ke(a,f.line);if(h.markedSpans)for(var i=0;i<h.markedSpans.length;++i){var j=h.markedSpans[i],k=j.marker;if((null==j.from||(k.inclusiveLeft?j.from<=f.ch:j.from<f.ch))&&(null==j.to||(k.inclusiveRight?j.to>=f.ch:j.to>f.ch))){if(d&&(Me(k,"beforeCursorEnter"),k.explicitlyCleared)){if(h.markedSpans){--i;continue}break}if(!k.atomic)continue;var l=k.find()[0>g?"from":"to"];if(Bc(l,f)&&(l.ch+=g,l.ch<0?l=l.line>a.first?Fc(a,Ac(l.line-1)):null:l.ch>h.text.length&&(l=l.line<a.first+a.size-1?Ac(l.line+1,0):null),!l)){if(e)return d?(a.cantEdit=!0,Ac(a.first,0)):Mc(a,b,c,!0);e=!0,l=b,g=-g}f=l;continue a}}return f}}function Nc(a){var b=Oc(a,a.doc.sel.head,null,a.options.cursorScrollMargin);if(a.state.focused){var c=a.display,d=of(c.sizer),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!m){var f="none"==c.cursor.style.display;f&&(c.cursor.style.display="",c.cursor.style.left=b.left+"px",c.cursor.style.top=b.top-c.viewOffset+"px"),c.cursor.scrollIntoView(e),f&&(c.cursor.style.display="none")}}}function Oc(a,b,c,d){for(null==d&&(d=0);;){var e=!1,f=ub(a,b),g=c&&c!=b?ub(a,c):f,h=Qc(a,Math.min(f.left,g.left),Math.min(f.top,g.top)-d,Math.max(f.left,g.left),Math.max(f.bottom,g.bottom)+d),i=a.doc.scrollTop,j=a.doc.scrollLeft;if(null!=h.scrollTop&&($b(a,h.scrollTop),Math.abs(a.doc.scrollTop-i)>1&&(e=!0)),null!=h.scrollLeft&&(_b(a,h.scrollLeft),Math.abs(a.doc.scrollLeft-j)>1&&(e=!0)),!e)return f}}function Pc(a,b,c,d,e){var f=Qc(a,b,c,d,e);null!=f.scrollTop&&$b(a,f.scrollTop),null!=f.scrollLeft&&_b(a,f.scrollLeft)}function Qc(a,b,c,d,e){var f=a.display,g=zb(a.display);0>c&&(c=0);var h=f.scroller.clientHeight-Ue,i=f.scroller.scrollTop,j={},k=a.doc.height+fb(f),l=g>c,m=e>k-g;if(i>c)j.scrollTop=l?0:c;else if(e>i+h){var n=Math.min(c,(m?k:e)-h);n!=i&&(j.scrollTop=n)}var o=f.scroller.clientWidth-Ue,p=f.scroller.scrollLeft;b+=f.gutters.offsetWidth,d+=f.gutters.offsetWidth;var q=f.gutters.offsetWidth,r=q+10>b;return p+q>b||r?(r&&(b=0),j.scrollLeft=Math.max(0,b-10-q)):d>o+p-3&&(j.scrollLeft=d+10-o),j}function Rc(a,b,c){a.curOp.updateScrollPos={scrollLeft:null==b?a.doc.scrollLeft:b,scrollTop:null==c?a.doc.scrollTop:c}}function Sc(a,b,c){var d=a.curOp.updateScrollPos||(a.curOp.updateScrollPos={scrollLeft:a.doc.scrollLeft,scrollTop:a.doc.scrollTop}),e=a.display.scroller;d.scrollTop=Math.max(0,Math.min(e.scrollHeight-e.clientHeight,d.scrollTop+c)),d.scrollLeft=Math.max(0,Math.min(e.scrollWidth-e.clientWidth,d.scrollLeft+b))}function Tc(a,b,c,d){var e=a.doc;if(null==c&&(c="add"),"smart"==c)if(a.doc.mode.indent)var f=db(a,b);else c="prev";var k,g=a.options.tabSize,h=ke(e,b),i=Xe(h.text,null,g),j=h.text.match(/^\s*/)[0];if("smart"==c&&(k=a.doc.mode.indent(f,h.text.slice(j.length),h.text),k==Ve)){if(!d)return;c="prev"}"prev"==c?k=b>e.first?Xe(ke(e,b-1).text,null,g):0:"add"==c?k=i+a.options.indentUnit:"subtract"==c?k=i-a.options.indentUnit:"number"==typeof c&&(k=i+c),k=Math.max(0,k);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(k/g);n;--n)m+=g,l+=" ";k>m&&(l+=Ze(k-m)),l==j?Kc(a.doc,Ac(b,j.length),Ac(b,j.length)):zc(a.doc,l,Ac(b,0),Ac(b,j.length),"+input"),h.stateAfter=null}function Uc(a,b,c){var d=b,e=b,f=a.doc;return"number"==typeof b?e=ke(f,Ec(f,b)):d=oe(b),null==d?null:c(e,d)?(Hb(a,d,d+1),e):null}function Vc(a,b,c,d,e){function k(){var b=f+c;return b<a.first||b>=a.first+a.size?j=!1:(f=b,i=ke(a,b))}function l(a){var b=(e?Kf:Lf)(i,g,c,!0);if(null==b){if(a||!k())return j=!1;g=e?(0>c?Df:Cf)(i):0>c?i.text.length:0}else g=b;return!0}var f=b.line,g=b.ch,h=c,i=ke(a,f),j=!0;if("char"==d)l();else if("column"==d)l(!0);else if("word"==d||"group"==d)for(var m=null,n="group"==d,o=!0;!(0>c)||l(!o);o=!1){var p=i.text.charAt(g)||"\n",q=gf(p)?"w":n?/\s/.test(p)?null:"p":null;if(m&&m!=q){0>c&&(c=1,l());break}if(q&&(m=q),c>0&&!l(!o))break}var r=Mc(a,Ac(f,g),h,!0);return j||(r.hitSide=!0),r}function Wc(a,b,c,d){var g,e=a.doc,f=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);g=b.top+c*(h-(0>c?1.5:.5)*zb(a.display))}else"line"==d&&(g=c>0?b.bottom+3:b.top-3);for(;;){var i=wb(a,f,g);if(!i.outside)break;if(0>c?0>=g:g>=e.height){i.hitSide=!0;break}g+=5*c}return i}function Xc(a,b){var c=b.ch,d=b.ch;if(a){(b.xRel<0||d==a.length)&&c?--c:++d;for(var e=a.charAt(c),f=gf(e)?gf:/\s/.test(e)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!gf(a)};c>0&&f(a.charAt(c-1));)--c;for(;d<a.length&&f(a.charAt(d));)++d}return{from:Ac(b.line,c),to:Ac(b.line,d)}}function Yc(a,b){Ic(a.doc,Ac(b,0),Fc(a.doc,Ac(b+1,0)))}function _c(a,b,c,d){w.defaults[a]=b,c&&(Zc[a]=d?function(a,b,d){d!=ad&&c(a,b,d)}:c)}function gd(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c}function hd(a,b,c){return a.startState?a.startState(b,c):!0}function kd(a){return"string"==typeof a?jd[a]:a}function ld(a,b,c){function d(b){b=kd(b);var e=b[a];if(e===!1)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";var f=b.fallthrough;if(null==f)return!1;if("[object Array]"!=Object.prototype.toString.call(f))return d(f);for(var g=0,h=f.length;h>g;++g){var i=d(f[g]);if(i)return i}return!1}for(var e=0;e<b.length;++e){var f=d(b[e]);if(f)return"stop"!=f}}function md(a){var b=yf[a.keyCode];return"Ctrl"==b||"Alt"==b||"Shift"==b||"Mod"==b}function nd(a,b){if(h&&34==a.keyCode&&a["char"])return!1;var c=yf[a.keyCode];return null==c||a.altGraphKey?!1:(a.altKey&&(c="Alt-"+c),(s?a.metaKey:a.ctrlKey)&&(c="Ctrl-"+c),(s?a.ctrlKey:a.metaKey)&&(c="Cmd-"+c),!b&&a.shiftKey&&(c="Shift-"+c),c)}function od(a,b){this.pos=this.start=0,this.string=a,this.tabSize=b||8,this.lastColumnPos=this.lastColumnValue=0}function pd(a,b){this.lines=[],this.type=b,this.doc=a}function qd(a,b,c,d,e){if(d&&d.shared)return sd(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return Eb(a.cm,qd)(a,b,c,d,e);var f=new pd(a,e);if(Cc(c,b)||Bc(b,c)&&"range"==e&&(!d.inclusiveLeft||!d.inclusiveRight))return f;d&&cf(d,f),f.replacedWith&&(f.collapsed=!0,f.replacedWith=kf("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||(f.replacedWith.ignoreEvents=!0)),f.collapsed&&(v=!0),f.addToHistory&&ve(a,{from:b,to:c,origin:"markText"},{head:a.sel.head,anchor:a.sel.anchor},0/0);var i,j,l,g=b.line,h=0,k=a.cm;if(a.iter(g,c.line+1,function(d){k&&f.collapsed&&!k.options.lineWrapping&&Ed(a,d)==k.display.maxLine&&(l=!0);var e={from:null,to:null,marker:f};h+=d.text.length,g==b.line&&(e.from=b.ch,h-=b.ch),g==c.line&&(e.to=c.ch,h-=d.text.length-c.ch),f.collapsed&&(g==c.line&&(j=Bd(d,c.ch)),g==b.line?i=Bd(d,b.ch):ne(d,0)),vd(d,e),++g}),f.collapsed&&a.iter(b.line,c.line+1,function(b){Fd(a,b)&&ne(b,0)}),f.clearOnEnter&&Ke(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(u=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed){if(i!=j)throw new Error("Inserting collapsed marker overlapping an existing one");f.size=h,f.atomic=!0}return k&&(l&&(k.curOp.updateMaxLine=!0),(f.className||f.title||f.startStyle||f.endStyle||f.collapsed)&&Hb(k,b.line,c.line+1),f.atomic&&Lc(k)),f}function rd(a,b){this.markers=a,this.primary=b;for(var c=0,d=this;c<a.length;++c)a[c].parent=this,Ke(a[c],"clear",function(){d.clear()})}function sd(a,b,c,d,e){d=cf(d),d.shared=!1;var f=[qd(a,b,c,d,e)],g=f[0],h=d.replacedWith;return ie(a,function(a){h&&(d.replacedWith=h.cloneNode(!0)),f.push(qd(a,Fc(a,b),Fc(a,c),d,e));for(var i=0;i<a.linked.length;++i)if(a.linked[i].isParent)return;g=$e(f)}),new rd(f,g)}function td(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function ud(a,b){for(var c,d=0;d<a.length;++d)a[d]!=b&&(c||(c=[])).push(a[d]);return c}function vd(a,b){a.markedSpans=a.markedSpans?a.markedSpans.concat([b]):[b],b.marker.attachLine(a)}function wd(a,b,c){if(a)for(var e,d=0;d<a.length;++d){var f=a[d],g=f.marker,h=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);if(h||(g.inclusiveLeft&&g.inclusiveRight||"bookmark"==g.type)&&f.from==b&&(!c||!f.marker.insertLeft)){var i=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);(e||(e=[])).push({from:f.from,to:i?null:f.to,marker:g})}}return e}function xd(a,b,c){if(a)for(var e,d=0;d<a.length;++d){var f=a[d],g=f.marker,h=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);if(h||"bookmark"==g.type&&f.from==b&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);(e||(e=[])).push({from:i?null:f.from-b,to:null==f.to?null:f.to-b,marker:g})}}return e}function yd(a,b){var c=Hc(a,b.from.line)&&ke(a,b.from.line).markedSpans,d=Hc(a,b.to.line)&&ke(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=Bc(b.from,b.to),h=wd(c,e,g),i=xd(d,f,g),j=1==b.text.length,k=$e(b.text).length+(j?e:0);if(h)for(var l=0;l<h.length;++l){var m=h[l];if(null==m.to){var n=td(i,m.marker);n?j&&(m.to=null==n.to?null:n.to+k):m.to=e}}if(i)for(var l=0;l<i.length;++l){var m=i[l];if(null!=m.to&&(m.to+=k),null==m.from){var n=td(h,m.marker);n||(m.from=k,j&&(h||(h=[])).push(m))}else m.from+=k,j&&(h||(h=[])).push(m)}if(j&&h){for(var l=0;l<h.length;++l)null!=h[l].from&&h[l].from==h[l].to&&"bookmark"!=h[l].marker.type&&h.splice(l--,1);h.length||(h=null)}var o=[h];if(!j){var q,p=b.text.length-2;if(p>0&&h)for(var l=0;l<h.length;++l)null==h[l].to&&(q||(q=[])).push({from:null,to:null,marker:h[l].marker});for(var l=0;p>l;++l)o.push(q);o.push(i)}return o}function zd(a,b){var c=xe(a,b),d=yd(a,b);if(!c)return d;if(!d)return c;for(var e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g)a:for(var h=0;h<g.length;++h){for(var i=g[h],j=0;j<f.length;++j)if(f[j].marker==i.marker)continue a;f.push(i)}else g&&(c[e]=g)}return c}function Ad(a,b,c){var d=null;if(a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=af(d,c)||(d||(d=[])).push(c)}}),!d)return null;for(var e=[{from:b,to:c}],f=0;f<d.length;++f)for(var g=d[f],h=g.find(),i=0;i<e.length;++i){var j=e[i];if(!Cc(j.to,h.from)&&!Cc(h.to,j.from)){var k=[i,1];(Cc(j.from,h.from)||!g.inclusiveLeft&&Bc(j.from,h.from))&&k.push({from:j.from,to:h.from}),(Cc(h.to,j.to)||!g.inclusiveRight&&Bc(j.to,h.to))&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function Bd(a,b){var d,c=v&&a.markedSpans;if(c)for(var e,f=0;f<c.length;++f)e=c[f],e.marker.collapsed&&(null==e.from||e.from<b)&&(null==e.to||e.to>b)&&(!d||d.width<e.marker.width)&&(d=e.marker);return d}function Cd(a){return Bd(a,-1)}function Dd(a){return Bd(a,a.text.length+1)}function Ed(a,b){for(var c;c=Cd(b);)b=ke(a,c.find().from.line);return b}function Fd(a,b){var c=v&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed){if(null==d.from)return!0;if(!d.marker.replacedWith&&0==d.from&&d.marker.inclusiveLeft&&Gd(a,b,d))return!0}}function Gd(a,b,c){if(null==c.to){var d=c.marker.find().to,e=ke(a,d.line);return Gd(a,e,td(e.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var f,g=0;g<b.markedSpans.length;++g)if(f=b.markedSpans[g],f.marker.collapsed&&!f.marker.replacedWith&&f.from==c.to&&(f.marker.inclusiveLeft||c.marker.inclusiveRight)&&Gd(a,b,f))return!0}function Hd(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function Id(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function Kd(a){return function(){var b=!this.cm.curOp;b&&Cb(this.cm);try{var c=a.apply(this,arguments)}finally{b&&Db(this.cm)}return c}}function Ld(a){return null!=a.height?a.height:(a.node.parentNode&&1==a.node.parentNode.nodeType||mf(a.cm.display.measure,kf("div",[a.node],null,"position: relative")),a.height=a.node.offsetHeight)}function Md(a,b,c,d){var e=new Jd(a,c,d);return e.noHScroll&&(a.display.alignWidgets=!0),Uc(a,b,function(b){var c=b.widgets||(b.widgets=[]);if(null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e),e.line=b,!Fd(a.doc,b)||e.showIfHidden){var d=qe(a,b)<a.doc.scrollTop;ne(b,b.height+Ld(e)),d&&Sc(a,0,e.height)}return!0}),e}function Od(a,b,c,d){a.text=b,a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null),null!=a.order&&(a.order=null),Hd(a),Id(a,c);var e=d?d(a):1;e!=a.height&&ne(a,e)}function Pd(a){a.parent=null,Hd(a)}function Qd(a,b,c,d,e){var f=c.flattenSpans;null==f&&(f=a.options.flattenSpans);var j,g=0,h=null,i=new od(b,a.options.tabSize);for(""==b&&c.blankLine&&c.blankLine(d);!i.eol();)i.pos>a.options.maxHighlightLength?(f=!1,i.pos=b.length,j=null):j=c.token(i,d),f&&h==j||(g<i.start&&e(i.start,h),g=i.start,h=j),i.start=i.pos;for(;g<i.pos;){var k=Math.min(i.pos,g+5e4);e(k,h),g=k}}function Rd(a,b,c){var d=[a.state.modeGen];Qd(a,b.text,a.doc.mode,c,function(a,b){d.push(a,b)});for(var e=0;e<a.state.overlays.length;++e){var f=a.state.overlays[e],g=1,h=0;Qd(a,b.text,f.mode,!0,function(a,b){for(var c=g;a>h;){var e=d[g];e>a&&d.splice(g,1,a,d[g+1],e),g+=2,h=Math.min(a,e)}if(b)if(f.opaque)d.splice(c,g-c,a,b),g=c+2;else for(;g>c;c+=2){var i=d[c+1];d[c+1]=i?i+" "+b:b}})}return d}function Sd(a,b){return b.styles&&b.styles[0]==a.state.modeGen||(b.styles=Rd(a,b,b.stateAfter=db(a,oe(b)))),b.styles}function Td(a,b,c){var d=a.doc.mode,e=new od(b.text,a.options.tabSize);for(""==b.text&&d.blankLine&&d.blankLine(c);!e.eol()&&e.pos<=a.options.maxHighlightLength;)d.token(e,c),e.start=e.pos}function Vd(a,b){if(!a)return null;for(;;){var c=a.match(/(?:^|\s)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:new RegExp("(?:^|s)"+c[2]+"(?:$|s)").test(b[d])||(b[d]+=" "+c[2])}return Ud[a]||(Ud[a]="cm-"+a.replace(/ +/g," cm-"))}function Wd(a,c,d,f){for(var g,h=c,i=!0;g=Cd(h);)h=ke(a.doc,g.find().from.line);var j={pre:kf("pre"),col:0,pos:0,measure:null,measuredSomething:!1,cm:a,copyWidgets:f};do{h.text&&(i=!1),j.measure=h==c&&d,j.pos=0,j.addToken=j.measure?Zd:Yd,(b||e)&&a.getOption("lineWrapping")&&(j.addToken=$d(j.addToken));
3
+ var k=ae(h,j,Sd(a,h));d&&h==c&&!j.measuredSomething&&(d[0]=j.pre.appendChild(uf(a.display.measure)),j.measuredSomething=!0),k&&(h=ke(a.doc,k.to.line))}while(k);!d||j.measuredSomething||d[0]||(d[0]=j.pre.appendChild(i?kf("span","\xa0"):uf(a.display.measure))),j.pre.firstChild||Fd(a.doc,c)||j.pre.appendChild(document.createTextNode("\xa0"));var l;if(d&&b&&(l=re(h))){var m=l.length-1;l[m].from==l[m].to&&--m;var n=l[m],o=l[m-1];if(n.from+1==n.to&&o&&n.level<o.level){var p=d[j.pos-1];p&&p.parentNode.insertBefore(p.measureRight=uf(a.display.measure),p.nextSibling)}}var q=j.textClass?j.textClass+" "+(c.textClass||""):c.textClass;return q&&(j.pre.className=q),Me(a,"renderLine",a,c,j.pre),j}function Yd(a,b,c,d,e,f){if(b){if(Xd.test(b))for(var g=document.createDocumentFragment(),h=0;;){Xd.lastIndex=h;var i=Xd.exec(b),j=i?i.index-h:b.length-h;if(j&&(g.appendChild(document.createTextNode(b.slice(h,h+j))),a.col+=j),!i)break;if(h+=j+1," "==i[0]){var k=a.cm.options.tabSize,l=k-a.col%k;g.appendChild(kf("span",Ze(l),"cm-tab")),a.col+=l}else{var m=kf("span","\u2022","cm-invalidchar");m.title="\\u"+i[0].charCodeAt(0).toString(16),g.appendChild(m),a.col+=1}}else{a.col+=b.length;var g=document.createTextNode(b)}if(c||d||e||a.measure){var n=c||"";d&&(n+=d),e&&(n+=e);var m=kf("span",[g],n);return f&&(m.title=f),a.pre.appendChild(m)}a.pre.appendChild(g)}}function Zd(a,c,d,e,f){for(var g=a.cm.options.lineWrapping,h=0;h<c.length;++h){var i=c.charAt(h),j=0==h;i>="\ud800"&&"\udbff">i&&h<c.length-1?(i=c.slice(h,h+2),++h):h&&g&&qf(c,h)&&a.pre.appendChild(kf("wbr"));var k=a.measure[a.pos],l=a.measure[a.pos]=Yd(a,i,d,j&&e,h==c.length-1&&f);k&&(l.leftSide=k.leftSide||k),b&&g&&" "==i&&h&&!/\s/.test(c.charAt(h-1))&&h<c.length-1&&!/\s/.test(c.charAt(h+1))&&(l.style.whiteSpace="normal"),a.pos+=i.length}c.length&&(a.measuredSomething=!0)}function $d(a){function b(a){for(var b=" ",c=0;c<a.length-2;++c)b+=c%2?" ":"\xa0";return b+=" "}return function(c,d,e,f,g,h){return a(c,d.replace(/ {3,}/g,b),e,f,g,h)}}function _d(a,b,c,d){var e=!d&&c.replacedWith;if(e&&(a.copyWidgets&&(e=e.cloneNode(!0)),a.pre.appendChild(e),a.measure)){if(b)a.measure[a.pos]=e;else{var f=uf(a.cm.display.measure);if("bookmark"!=c.type||c.insertLeft){if(a.measure[a.pos])return;a.measure[a.pos]=a.pre.insertBefore(f,e)}else a.measure[a.pos]=a.pre.appendChild(f)}a.measuredSomething=!0}a.pos+=b}function ae(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var k,m,n,o,p,q,h=e.length,i=0,g=1,j="",l=0;;){if(l==i){m=n=o=p="",q=null,l=1/0;for(var r=[],s=0;s<d.length;++s){var t=d[s],u=t.marker;t.from<=i&&(null==t.to||t.to>i)?(null!=t.to&&l>t.to&&(l=t.to,n=""),u.className&&(m+=" "+u.className),u.startStyle&&t.from==i&&(o+=" "+u.startStyle),u.endStyle&&t.to==l&&(n+=" "+u.endStyle),u.title&&!p&&(p=u.title),u.collapsed&&(!q||q.marker.size<u.size)&&(q=t)):t.from>i&&l>t.from&&(l=t.from),"bookmark"==u.type&&t.from==i&&u.replacedWith&&r.push(u)}if(q&&(q.from||0)==i&&(_d(b,(null==q.to?h:q.to)-i,q.marker,null==q.from),null==q.to))return q.marker.find();if(!q&&r.length)for(var s=0;s<r.length;++s)_d(b,0,r[s])}if(i>=h)break;for(var v=Math.min(h,l);;){if(j){var w=i+j.length;if(!q){var x=w>v?j.slice(0,v-i):j;b.addToken(b,x,k?k+m:m,o,i+x.length==l?n:"",p)}if(w>=v){j=j.slice(v-i),i=v;break}i=w,o=""}j=e.slice(f,f=c[g++]),k=Vd(c[g++],b)}}else for(var g=1;g<c.length;g+=2)b.addToken(b,e.slice(f,f=c[g]),Vd(c[g+1],b))}function be(a,b,c,d,e){function f(a){return c?c[a]:null}function g(a,c,d){Od(a,c,d,e),Pe(a,"change",a,b)}var h=b.from,i=b.to,j=b.text,k=ke(a,h.line),l=ke(a,i.line),m=$e(j),n=f(j.length-1),o=i.line-h.line;if(0==h.ch&&0==i.ch&&""==m){for(var p=0,q=j.length-1,r=[];q>p;++p)r.push(new Nd(j[p],f(p),e));g(l,l.text,n),o&&a.remove(h.line,o),r.length&&a.insert(h.line,r)}else if(k==l)if(1==j.length)g(k,k.text.slice(0,h.ch)+m+k.text.slice(i.ch),n);else{for(var r=[],p=1,q=j.length-1;q>p;++p)r.push(new Nd(j[p],f(p),e));r.push(new Nd(m+k.text.slice(i.ch),n,e)),g(k,k.text.slice(0,h.ch)+j[0],f(0)),a.insert(h.line+1,r)}else if(1==j.length)g(k,k.text.slice(0,h.ch)+j[0]+l.text.slice(i.ch),f(0)),a.remove(h.line+1,o);else{g(k,k.text.slice(0,h.ch)+j[0],f(0)),g(l,m+l.text.slice(i.ch),n);for(var p=1,q=j.length-1,r=[];q>p;++p)r.push(new Nd(j[p],f(p),e));o>1&&a.remove(h.line+1,o-1),a.insert(h.line+1,r)}Pe(a,"change",a,b),Kc(a,d.anchor,d.head,null,!0)}function ce(a){this.lines=a,this.parent=null;for(var b=0,c=a.length,d=0;c>b;++b)a[b].parent=this,d+=a[b].height;this.height=d}function de(a){this.children=a;for(var b=0,c=0,d=0,e=a.length;e>d;++d){var f=a[d];b+=f.chunkSize(),c+=f.height,f.parent=this}this.size=b,this.height=c,this.parent=null}function ie(a,b,c){function d(a,e,f){if(a.linked)for(var g=0;g<a.linked.length;++g){var h=a.linked[g];if(h.doc!=e){var i=f&&h.sharedHist;(!c||i)&&(b(h.doc,i),d(h.doc,a,i))}}}d(a,null,!0)}function je(a,b){if(b.cm)throw new Error("This document is already in use.");a.doc=b,b.cm=a,B(a),y(a),a.options.lineWrapping||H(a),a.options.mode=b.modeOption,Hb(a)}function ke(a,b){for(b-=a.first;!a.lines;)for(var c=0;;++c){var d=a.children[c],e=d.chunkSize();if(e>b){a=d;break}b-=e}return a.lines[b]}function le(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function me(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function ne(a,b){for(var c=b-a.height,d=a;d;d=d.parent)d.height+=c}function oe(a){if(null==a.parent)return null;for(var b=a.parent,c=af(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function pe(a,b){var c=a.first;a:do{for(var d=0,e=a.children.length;e>d;++d){var f=a.children[d],g=f.height;if(g>b){a=f;continue a}b-=g,c+=f.chunkSize()}return c}while(!a.lines);for(var d=0,e=a.lines.length;e>d;++d){var h=a.lines[d],i=h.height;if(i>b)break;b-=i}return c+d}function qe(a,b){b=Ed(a.doc,b);for(var c=0,d=b.parent,e=0;e<d.lines.length;++e){var f=d.lines[e];if(f==b)break;c+=f.height}for(var g=d.parent;g;d=g,g=d.parent)for(var e=0;e<g.children.length;++e){var h=g.children[e];if(h==d)break;c+=h.height}return c}function re(a){var b=a.order;return null==b&&(b=a.order=Mf(a.text)),b}function se(a){return{done:[],undone:[],undoDepth:1/0,lastTime:0,lastOp:null,lastOrigin:null,generation:a||1,maxGeneration:a||1}}function te(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function ue(a,b){var c={line:b.from.line,ch:b.from.ch},d={from:c,to:pc(b),text:le(a,b.from,b.to)};return te(a,d,b.from.line,b.to.line+1),ie(a,function(a){te(a,d,b.from.line,b.to.line+1)},!0),d}function ve(a,b,c,d){var e=a.history;e.undone.length=0;var f=+new Date,g=$e(e.done);if(g&&(e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastTime>f-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))){var h=$e(g.changes);Bc(b.from,b.to)&&Bc(b.from,h.to)?h.to=pc(b):g.changes.push(ue(a,b)),g.anchorAfter=c.anchor,g.headAfter=c.head}else for(g={changes:[ue(a,b)],generation:e.generation,anchorBefore:a.sel.anchor,headBefore:a.sel.head,anchorAfter:c.anchor,headAfter:c.head},e.done.push(g),e.generation=++e.maxGeneration;e.done.length>e.undoDepth;)e.done.shift();e.lastTime=f,e.lastOp=d,e.lastOrigin=b.origin}function we(a){if(!a)return null;for(var c,b=0;b<a.length;++b)a[b].marker.explicitlyCleared?c||(c=a.slice(0,b)):c&&c.push(a[b]);return c?c.length?c:null:a}function xe(a,b){var c=b["spans_"+a.id];if(!c)return null;for(var d=0,e=[];d<b.text.length;++d)e.push(we(c[d]));return e}function ye(a,b){for(var c=0,d=[];c<a.length;++c){var e=a[c],f=e.changes,g=[];d.push({changes:g,anchorBefore:e.anchorBefore,headBefore:e.headBefore,anchorAfter:e.anchorAfter,headAfter:e.headAfter});for(var h=0;h<f.length;++h){var j,i=f[h];if(g.push({from:i.from,to:i.to,text:i.text}),b)for(var k in i)(j=k.match(/^spans_(\d+)$/))&&af(b,Number(j[1]))>-1&&($e(g)[k]=i[k],delete i[k])}}return d}function ze(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function Ae(a,b,c,d){for(var e=0;e<a.length;++e){for(var f=a[e],g=!0,h=0;h<f.changes.length;++h){var i=f.changes[h];if(f.copied||(i.from=Dc(i.from),i.to=Dc(i.to)),c<i.from.line)i.from.line+=d,i.to.line+=d;else if(b<=i.to.line){g=!1;break}}f.copied||(f.anchorBefore=Dc(f.anchorBefore),f.headBefore=Dc(f.headBefore),f.anchorAfter=Dc(f.anchorAfter),f.readAfter=Dc(f.headAfter),f.copied=!0),g?(ze(f.anchorBefore),ze(f.headBefore),ze(f.anchorAfter),ze(f.headAfter)):(a.splice(0,e+1),e=0)}}function Be(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;Ae(a.done,c,d,e),Ae(a.undone,c,d,e)}function Ce(){He(this)}function De(a){return a.stop||(a.stop=Ce),a}function Ee(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Fe(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function Ge(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function He(a){Ee(a),Fe(a)}function Ie(a){return a.target||a.srcElement}function Je(a){var b=a.which;return null==b&&(1&a.button?b=1:2&a.button?b=3:4&a.button&&(b=2)),p&&a.ctrlKey&&1==b&&(b=3),b}function Ke(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var d=a._handlers||(a._handlers={}),e=d[b]||(d[b]=[]);e.push(c)}}function Le(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else{var d=a._handlers&&a._handlers[b];if(!d)return;for(var e=0;e<d.length;++e)if(d[e]==c){d.splice(e,1);break}}}function Me(a,b){var c=a._handlers&&a._handlers[b];if(c)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)}function Pe(a,b){function e(a){return function(){a.apply(null,d)}}var c=a._handlers&&a._handlers[b];if(c){var d=Array.prototype.slice.call(arguments,2);Ne||(++Oe,Ne=[],setTimeout(Re,0));for(var f=0;f<c.length;++f)Ne.push(e(c[f]))}}function Qe(a,b,c){return Me(a,c||b.type,a,b),Ge(b)||b.codemirrorIgnore}function Re(){--Oe;var a=Ne;Ne=null;for(var b=0;b<a.length;++b)a[b]()}function Se(a,b){var c=a._handlers&&a._handlers[b];return c&&c.length>0}function Te(a){a.prototype.on=function(a,b){Ke(this,a,b)},a.prototype.off=function(a,b){Le(this,a,b)}}function We(){this.id=null}function Xe(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));for(var f=d||0,g=e||0;b>f;++f)" "==a.charAt(f)?g+=c-g%c:++g;return g}function Ze(a){for(;Ye.length<=a;)Ye.push($e(Ye)+" ");return Ye[a]}function $e(a){return a[a.length-1]}function _e(a){if(n)a.selectionStart=0,a.selectionEnd=a.value.length;else try{a.select()}catch(b){}}function af(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;d>c;++c)if(a[c]==b)return c;return-1}function bf(a,b){function c(){}c.prototype=a;var d=new c;return b&&cf(b,d),d}function cf(a,b){b||(b={});for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function df(a){for(var b=[],c=0;a>c;++c)b.push(void 0);return b}function ef(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function gf(a){return/\w/.test(a)||a>"\x80"&&(a.toUpperCase()!=a.toLowerCase()||ff.test(a))}function hf(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function kf(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)nf(e,b);else if(b)for(var f=0;f<b.length;++f)e.appendChild(b[f]);return e}function lf(a){for(var b=a.childNodes.length;b>0;--b)a.removeChild(a.firstChild);return a}function mf(a,b){return lf(a).appendChild(b)}function nf(a,b){d?(a.innerHTML="",a.appendChild(document.createTextNode(b))):a.textContent=b}function of(a){return a.getBoundingClientRect()}function qf(){return!1}function sf(a){if(null!=rf)return rf;var b=kf("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return mf(a,b),b.offsetWidth&&(rf=b.offsetHeight-b.clientHeight),rf||0}function uf(a){if(null==tf){var b=kf("span","\u200b");mf(a,kf("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(tf=b.offsetWidth<=1&&b.offsetHeight>2&&!c)}return tf?kf("span","\u200b"):kf("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px")}function zf(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];(g.from<c&&g.to>b||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function Af(a){return a.level%2?a.to:a.from}function Bf(a){return a.level%2?a.from:a.to}function Cf(a){var b=re(a);return b?Af(b[0]):0}function Df(a){var b=re(a);return b?Bf($e(b)):a.text.length}function Ef(a,b){var c=ke(a.doc,b),d=Ed(a.doc,c);d!=c&&(b=oe(d));var e=re(d),f=e?e[0].level%2?Df(d):Cf(d):0;return Ac(b,f)}function Ff(a,b){for(var c,d;c=Dd(d=ke(a.doc,b));)b=c.find().to.line;var e=re(d),f=e?e[0].level%2?Cf(d):Df(d):d.text.length;return Ac(b,f)}function Gf(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function If(a,b){for(var d,c=0;c<a.length;++c){var e=a[c];if(e.from<b&&e.to>b)return Hf=null,c;if(e.from==b||e.to==b){if(null!=d)return Gf(a,e.level,a[d].level)?(Hf=d,c):(Hf=c,d);d=c}}return Hf=null,d}function Jf(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&jf.test(a.text.charAt(b)));return b}function Kf(a,b,c,d){var e=re(a);if(!e)return Lf(a,b,c,d);for(var f=If(e,b),g=e[f],h=Jf(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h<g.to)return h;if(h==g.from||h==g.to)return If(e,h)==f?h:(g=e[f+=c],c>0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?Jf(a,g.to,-1,d):Jf(a,g.from,1,d)}}function Lf(a,b,c,d){var e=b+c;if(d)for(;e>0&&jf.test(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var a=/gecko\/\d/i.test(navigator.userAgent),b=/MSIE \d/.test(navigator.userAgent),c=b&&(null==document.documentMode||document.documentMode<8),d=b&&(null==document.documentMode||document.documentMode<9),e=/WebKit\//.test(navigator.userAgent),f=e&&/Qt\/\d+\.\d+/.test(navigator.userAgent),g=/Chrome\//.test(navigator.userAgent),h=/Opera\//.test(navigator.userAgent),i=/Apple Computer/.test(navigator.vendor),j=/KHTML\//.test(navigator.userAgent),k=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),m=/PhantomJS/.test(navigator.userAgent),n=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),o=n||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),p=n||/Mac/.test(navigator.platform),q=/win/i.test(navigator.platform),r=h&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);r&&(r=Number(r[1])),r&&r>=15&&(h=!1,e=!0);var yb,Rb,Sb,s=p&&(f||h&&(null==r||12.11>r)),t=a||b&&!d,u=!1,v=!1,Bb=0,Xb=0,ac=0,bc=null;b?bc=-.53:a?bc=15:g?bc=-.7:i&&(bc=-1/3);var fc,nc,ic=null,pc=w.changeEnd=function(a){return a.text?Ac(a.from.line+a.text.length-1,$e(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};w.Pos=Ac,w.prototype={constructor:w,focus:function(){window.focus(),Mb(this),lc(this),Jb(this)},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,Zc.hasOwnProperty(a)&&Eb(this,Zc[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](a)},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(b[c]==a||"string"!=typeof b[c]&&b[c].name==a)return b.splice(c,1),!0},addOverlay:Eb(null,function(a,b){var c=a.token?a:w.getMode(this.options,a);if(c.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:c,modeSpec:a,opaque:b&&b.opaque}),this.state.modeGen++,Hb(this)}),removeOverlay:Eb(null,function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||"string"==typeof a&&d.name==a)return b.splice(c,1),this.state.modeGen++,Hb(this),void 0}}),indentLine:Eb(null,function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract"),Hc(this.doc,a)&&Tc(this,a,b,c)}),indentSelection:Eb(null,function(a){var b=this.doc.sel;if(Bc(b.from,b.to))return Tc(this,b.from.line,a);for(var c=b.to.line-(b.to.ch?0:1),d=b.from.line;c>=d;++d)Tc(this,d,a)}),getTokenAt:function(a,b){var c=this.doc;a=Fc(c,a);for(var d=db(this,a.line,b),e=this.doc.mode,f=ke(c,a.line),g=new od(f.text,this.options.tabSize);g.pos<a.ch&&!g.eol();){g.start=g.pos;var h=e.token(g,d)}return{start:g.start,end:g.pos,string:g.current(),className:h||null,type:h||null,state:d}},getTokenTypeAt:function(a){a=Fc(this.doc,a);var b=Sd(this,ke(this.doc,a.line)),c=0,d=(b.length-1)/2,e=a.ch;if(0==e)return b[2];for(;;){var f=c+d>>1;if((f?b[2*f-1]:0)>=e)d=f;else{if(!(b[2*f+1]<e))return b[2*f+2];c=f+1}}},getModeAt:function(a){var b=this.doc.mode;return b.innerMode?w.innerMode(b,this.getTokenAt(a).state).mode:b},getHelper:function(a,b){if(fd.hasOwnProperty(b)){var c=fd[b],d=this.getModeAt(a);return d[b]&&c[d[b]]||d.helperType&&c[d.helperType]||c[d.name]}},getStateAfter:function(a,b){var c=this.doc;return a=Ec(c,null==a?c.first+c.size-1:a),db(this,a+1,b)},cursorCoords:function(a,b){var c,d=this.doc.sel;return c=null==a?d.head:"object"==typeof a?Fc(this.doc,a):a?d.from:d.to,ub(this,c,b||"page")},charCoords:function(a,b){return tb(this,Fc(this.doc,a),b||"page")},coordsChar:function(a,b){return a=sb(this,a,b||"page"),wb(this,a.left,a.top)},lineAtHeight:function(a,b){return a=sb(this,{top:a,left:0},b||"page").top,pe(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b){var c=!1,d=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>d&&(a=d,c=!0);var e=ke(this.doc,a);return rb(this,ke(this.doc,a),{top:0,left:0},b||"page").top+(c?e.height:0)},defaultTextHeight:function(){return zb(this.display)},defaultCharWidth:function(){return Ab(this.display)},setGutterMarker:Eb(null,function(a,b,c){return Uc(this,a,function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&hf(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Eb(null,function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Hb(b,d,d+1),hf(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),addLineClass:Eb(null,function(a,b,c){return Uc(this,a,function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[d]){if(new RegExp("(?:^|\\s)"+c+"(?:$|\\s)").test(a[d]))return!1;a[d]+=" "+c}else a[d]=c;return!0})}),removeLineClass:Eb(null,function(a,b,c){return Uc(this,a,function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",e=a[d];if(!e)return!1;if(null==c)a[d]=null;else{var f=e.match(new RegExp("(?:^|\\s+)"+c+"(?:$|\\s+)"));if(!f)return!1;var g=f.index+f[0].length;a[d]=e.slice(0,f.index)+(f.index&&g!=e.length?" ":"")+e.slice(g)||null}return!0})}),addLineWidget:Eb(null,function(a,b,c){return Md(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!Hc(this.doc,a))return null;var b=a;if(a=ke(this.doc,a),!a)return null}else{var b=oe(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=ub(this,Fc(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Pc(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Eb(null,jc),execCommand:function(a){return id[a](this)},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=Fc(this.doc,a);b>f&&(g=Vc(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Eb(null,function(a,b){var d,c=this.doc.sel;d=c.shift||c.extend||Bc(c.from,c.to)?Vc(this.doc,c.head,a,b,this.options.rtlMoveVisually):0>a?c.from:c.to,Ic(this.doc,d,d,a)}),deleteH:Eb(null,function(a,b){var c=this.doc.sel;Bc(c.from,c.to)?zc(this.doc,"",c.from,Vc(this.doc,c.head,a,b,!1),"+delete"):zc(this.doc,"",c.from,c.to,"+delete"),this.curOp.userSelChange=!0}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=Fc(this.doc,a);b>g;++g){var i=ub(this,h,"div");if(null==f?f=i.left:i.left=f,h=Wc(this,i,e,c),h.hitSide)break}return h},moveV:Eb(null,function(a,b){var c=this.doc.sel,d=ub(this,c.head,"div");null!=c.goalColumn&&(d.left=c.goalColumn);var e=Wc(this,d,a,b);"page"==b&&Sc(this,0,tb(this,e,"div").top-d.top),Ic(this.doc,e,e,a),c.goalColumn=d.left}),toggleOverwrite:function(a){(null==a||a!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+=" CodeMirror-overwrite":this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite",""))},hasFocus:function(){return this.state.focused},scrollTo:Eb(null,function(a,b){Rc(this,a,b)}),getScrollInfo:function(){var a=this.display.scroller,b=Ue;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-b,width:a.scrollWidth-b,clientHeight:a.clientHeight-b,clientWidth:a.clientWidth-b}},scrollIntoView:Eb(null,function(a,b){null==a?a={from:this.doc.sel.head,to:null}:"number"==typeof a?a={from:Ac(a,0),to:null}:null==a.from&&(a={from:a,to:null}),a.to||(a.to=a.from),b||(b=0);var c=a;null!=a.from.line&&(this.curOp.scrollToPos={from:a.from,to:a.to,margin:b},c={from:ub(this,a.from),to:ub(this,a.to)});var d=Qc(this,Math.min(c.from.left,c.to.left),Math.min(c.from.top,c.to.top)-b,Math.max(c.from.right,c.to.right),Math.max(c.from.bottom,c.to.bottom)+b);Rc(this,d.scrollLeft,d.scrollTop)}),setSize:Eb(null,function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(String(a))?a+"px":a}null!=a&&(this.display.wrapper.style.width=c(a)),null!=b&&(this.display.wrapper.style.height=c(b)),this.options.lineWrapping&&(this.display.measureLineCache.length=this.display.measureLineCachePos=0),this.curOp.forceUpdate=!0}),operation:function(a){return Gb(this,a)},refresh:Eb(null,function(){var a=null==this.display.cachedTextHeight;ob(this),Rc(this,this.doc.scrollLeft,this.doc.scrollTop),Hb(this),a&&B(this)}),swapDoc:Eb(null,function(a){var b=this.doc;return b.cm=null,je(this,a),ob(this),Lb(this,!0),Rc(this,a.scrollLeft,a.scrollTop),Pe(this,"swapDoc",this,b),b}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Te(w);var Zc=w.optionHandlers={},$c=w.defaults={},ad=w.Init={toString:function(){return"CodeMirror.Init"}};_c("value","",function(a,b){a.setValue(b)},!0),_c("mode",null,function(a,b){a.doc.modeOption=b,y(a)},!0),_c("indentUnit",2,y,!0),_c("indentWithTabs",!1),_c("smartIndent",!0),_c("tabSize",4,function(a){y(a),ob(a),Hb(a)},!0),_c("electricChars",!0),_c("rtlMoveVisually",!q),_c("theme","default",function(a){D(a),E(a)},!0),_c("keyMap","default",C),_c("extraKeys",null),_c("onKeyEvent",null),_c("onDragEvent",null),_c("lineWrapping",!1,z,!0),_c("gutters",[],function(a){I(a.options),E(a)},!0),_c("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?O(a.display)+"px":"0",a.refresh()},!0),_c("coverGutterNextToScrollbar",!1,J,!0),_c("lineNumbers",!1,function(a){I(a.options),E(a)},!0),_c("firstLineNumber",1,E,!0),_c("lineNumberFormatter",function(a){return a},E,!0),_c("showCursorWhenSelecting",!1,Y,!0),_c("resetSelectionOnContextMenu",!0),_c("readOnly",!1,function(a,b){"nocursor"==b?(mc(a),a.display.input.blur()):b||Lb(a,!0)}),_c("dragDrop",!0),_c("cursorBlinkRate",530),_c("cursorScrollMargin",0),_c("cursorHeight",1),_c("workTime",100),_c("workDelay",100),_c("flattenSpans",!0),_c("pollInterval",100),_c("undoDepth",40,function(a,b){a.doc.history.undoDepth=b}),_c("historyEventDelay",500),_c("viewportMargin",10,function(a){a.refresh()},!0),_c("maxHighlightLength",1e4,function(a){y(a),a.refresh()},!0),_c("crudeMeasuringFrom",1e4),_c("moveInputWithCursor",!0,function(a,b){b||(a.display.inputDiv.style.top=a.display.inputDiv.style.left=0)}),_c("tabindex",null,function(a,b){a.display.input.tabIndex=b||""}),_c("autofocus",null);var bd=w.modes={},cd=w.mimeModes={};w.defineMode=function(a,b){if(w.defaults.mode||"null"==a||(w.defaults.mode=a),arguments.length>2){b.dependencies=[];for(var c=2;c<arguments.length;++c)b.dependencies.push(arguments[c])}bd[a]=b},w.defineMIME=function(a,b){cd[a]=b},w.resolveMode=function(a){if("string"==typeof a&&cd.hasOwnProperty(a))a=cd[a];else if(a&&"string"==typeof a.name&&cd.hasOwnProperty(a.name)){var b=cd[a.name];a=bf(b,a),a.name=b.name}else if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return w.resolveMode("application/xml");return"string"==typeof a?{name:a}:a||{name:"null"}},w.getMode=function(a,b){var b=w.resolveMode(b),c=bd[b.name];if(!c)return w.getMode(a,"text/plain");var d=c(a,b);if(dd.hasOwnProperty(b.name)){var e=dd[b.name];for(var f in e)e.hasOwnProperty(f)&&(d.hasOwnProperty(f)&&(d["_"+f]=d[f]),d[f]=e[f])}return d.name=b.name,d},w.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),w.defineMIME("text/plain","null");var dd=w.modeExtensions={};w.extendMode=function(a,b){var c=dd.hasOwnProperty(a)?dd[a]:dd[a]={};cf(b,c)},w.defineExtension=function(a,b){w.prototype[a]=b},w.defineDocExtension=function(a,b){fe.prototype[a]=b},w.defineOption=_c;var ed=[];w.defineInitHook=function(a){ed.push(a)};var fd=w.helpers={};w.registerHelper=function(a,b,c){fd.hasOwnProperty(a)||(fd[a]=w[a]={}),fd[a][b]=c},w.isWordChar=gf,w.copyState=gd,w.startState=hd,w.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state,a=c.mode}return c||{mode:a,state:b}};var id=w.commands={selectAll:function(a){a.setSelection(Ac(a.firstLine(),0),Ac(a.lastLine()))},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),d=!Bc(b,c);d||a.getLine(b.line).length!=b.ch?a.replaceRange("",b,d?c:Ac(b.line),"+delete"):a.replaceRange("",b,Ac(b.line+1,0),"+delete")},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",Ac(b,0),Ac(b),"+delete")},delLineLeft:function(a){var b=a.getCursor();a.replaceRange("",Ac(b.line,0),b,"+delete")},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.extendSelection(Ac(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(Ac(a.lastLine()))},goLineStart:function(a){a.extendSelection(Ef(a,a.getCursor().line))},goLineStartSmart:function(a){var b=a.getCursor(),c=Ef(a,b.line),d=a.getLineHandle(c.line),e=re(d);if(e&&0!=e[0].level)a.extendSelection(c);else{var f=Math.max(0,d.text.search(/\S/)),g=b.line==c.line&&b.ch<=f&&b.ch;a.extendSelection(Ac(c.line,g?0:f))}},goLineEnd:function(a){a.extendSelection(Ff(a,a.getCursor().line))},goLineRight:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:b},"div"))},goLineLeft:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:0,top:b},"div"))},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goGroupRight:function(a){a.moveH(1,"group")},goGroupLeft:function(a){a.moveH(-1,"group")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},delWordAfter:function(a){a.deleteH(1,"word")},delGroupBefore:function(a){a.deleteH(-1,"group")},delGroupAfter:function(a){a.deleteH(1,"group")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection(" ","end","+input")},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.replaceSelection(" ","end","+input")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line);b.ch>0&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),Ac(b.line,b.ch-1),Ac(b.line,b.ch+1))},newlineAndIndent:function(a){Eb(a,function(){a.replaceSelection("\n","end","+input"),a.indentLine(a.getCursor().line,null,!0)})()},toggleOverwrite:function(a){a.toggleOverwrite()}},jd=w.keyMap={};jd.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"},jd.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","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",fallthrough:"basic"},jd.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","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":"delLineLeft",fallthrough:["basic","emacsy"]},jd["default"]=p?jd.macDefault:jd.pcDefault,jd.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"},w.lookupKey=ld,w.isModifierKey=md,w.keyName=nd,w.fromTextArea=function(a,b){function e(){a.value=i.getValue()}if(b||(b={}),b.value=a.value,!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex),!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder),null==b.autofocus){var c=document.body;try{c=document.activeElement}catch(d){}b.autofocus=c==a||null!=a.getAttribute("autofocus")&&c==document.body}if(a.form&&(Ke(a.form,"submit",e),!b.leaveSubmitMethodAlone)){var f=a.form,g=f.submit;try{var h=f.submit=function(){e(),f.submit=g,f.submit(),f.submit=h}}catch(d){}}a.style.display="none";var i=w(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);return i.save=e,i.getTextArea=function(){return a},i.toTextArea=function(){e(),a.parentNode.removeChild(i.getWrapperElement()),a.style.display="",a.form&&(Le(a.form,"submit",e),"function"==typeof a.form.submit&&(a.form.submit=g))},i},od.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0
4
+ },eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a)var c=b==a;else var c=b&&(a.test?a.test(b):a(b));return c?(++this.pos,b):void 0},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Xe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue},indentation:function(){return Xe(this.string,null,this.tabSize)},match:function(a,b,c){if("string"!=typeof a){var f=this.string.slice(this.pos).match(a);return f&&f.index>0?null:(f&&b!==!1&&(this.pos+=f[0].length),f)}var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);return d(e)==d(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)}},w.StringStream=od,w.TextMarker=pd,Te(pd),pd.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&Cb(a),Se(this,"clear")){var c=this.find();c&&Pe(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;f<this.lines.length;++f){var g=this.lines[f],h=td(g.markedSpans,this);null!=h.to&&(e=oe(g)),g.markedSpans=ud(g.markedSpans,h),null!=h.from?d=oe(g):this.collapsed&&!Fd(this.doc,g)&&a&&ne(g,zb(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(var f=0;f<this.lines.length;++f){var i=Ed(a.doc,this.lines[f]),j=G(a.doc,i);j>a.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&Hb(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Lc(a)),b&&Db(a)}},pd.prototype.find=function(){for(var a,b,c=0;c<this.lines.length;++c){var d=this.lines[c],e=td(d.markedSpans,this);if(null!=e.from||null!=e.to){var f=oe(d);null!=e.from&&(a=Ac(f,e.from)),null!=e.to&&(b=Ac(f,e.to))}}return"bookmark"==this.type?a:a&&{from:a,to:b}},pd.prototype.changed=function(){var a=this.find(),b=this.doc.cm;if(a&&b){"bookmark"!=this.type&&(a=a.from);var c=ke(this.doc,a.line);if(jb(b,c),a.line>=b.display.showingFrom&&a.line<b.display.showingTo){for(var d=b.display.lineDiv.firstChild;d;d=d.nextSibling)if(d.lineObj==c){d.offsetHeight!=c.height&&ne(c,d.offsetHeight);break}Gb(b,function(){b.curOp.selectionChanged=b.curOp.forceUpdate=b.curOp.updateMaxLine=!0})}}},pd.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&-1!=af(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)},pd.prototype.detachLine=function(a){if(this.lines.splice(af(this.lines,a),1),!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;(b.maybeHiddenMarkers||(b.maybeHiddenMarkers=[])).push(this)}},w.SharedTextMarker=rd,Te(rd),rd.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();Pe(this,"clear")}},rd.prototype.find=function(){return this.primary.find()};var Jd=w.LineWidget=function(a,b,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.cm=a,this.node=b};Te(Jd),Jd.prototype.clear=Kd(function(){var a=this.line.widgets,b=oe(this.line);if(null!=b&&a){for(var c=0;c<a.length;++c)a[c]==this&&a.splice(c--,1);a.length||(this.line.widgets=null);var d=qe(this.cm,this.line)<this.cm.doc.scrollTop;ne(this.line,Math.max(0,this.line.height-Ld(this))),d&&Sc(this.cm,0,-this.height),Hb(this.cm,b,b+1)}}),Jd.prototype.changed=Kd(function(){var a=this.height;this.height=null;var b=Ld(this)-a;if(b){ne(this.line,this.line.height+b);var c=oe(this.line);Hb(this.cm,c,c+1)}});var Nd=w.Line=function(a,b,c){this.text=a,Id(this,b),this.height=c?c(this):1};Te(Nd);var Ud={},Xd=/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\uFEFF]/g;ce.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=a,d=a+b;d>c;++c){var e=this.lines[c];this.height-=e.height,Pd(e),Pe(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.splice.apply(a,[a.length,0].concat(this.lines))},insertInner:function(a,b,c){this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var d=0,e=b.length;e>d;++d)b[d].parent=this},iterN:function(a,b,c){for(var d=a+b;d>a;++a)if(c(this.lines[a]))return!0}},de.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize();if(e>a){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(this.size-b<25){var h=[];this.collapse(h),this.children=[new ce(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0,c=this.children.length;c>b;++b)this.children[b].collapse(a)},insertInner:function(a,b,c){this.size+=b.length,this.height+=c;for(var d=0,e=this.children.length;e>d;++d){var f=this.children[d],g=f.chunkSize();if(g>=a){if(f.insertInner(a,b,c),f.lines&&f.lines.length>50){for(;f.lines.length>50;){var h=f.lines.splice(f.lines.length-25,25),i=new ce(h);f.height-=i.height,this.children.splice(d+1,0,i),i.parent=this}this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new de(b);if(a.parent){a.size-=c.size,a.height-=c.height;var e=af(a.parent.children,a);a.parent.children.splice(e+1,0,c)}else{var d=new de(a.children);d.parent=a,a.children=[d,c],a=d}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0,e=this.children.length;e>d;++d){var f=this.children[d],g=f.chunkSize();if(g>a){var h=Math.min(b,g-a);if(f.iterN(a,h,c))return!0;if(0==(b-=h))break;a=0}else a-=g}}};var ee=0,fe=w.Doc=function(a,b,c){if(!(this instanceof fe))return new fe(a,b,c);null==c&&(c=0),de.call(this,[new ce([new Nd("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.history=se(),this.cleanGeneration=1,this.frontier=c;var d=Ac(c,0);this.sel={from:d,to:d,head:d,anchor:d,shift:!1,extend:!1,goalColumn:null},this.id=++ee,this.modeOption=b,"string"==typeof a&&(a=vf(a)),be(this,{from:d,to:d,text:a},null,{head:d,anchor:d})};fe.prototype=bf(de.prototype,{constructor:fe,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0,e=b.length;e>d;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=me(this,this.first,this.first+this.size);return a===!1?b:b.join(a||"\n")},setValue:function(a){var b=Ac(this.first,0),c=this.first+this.size-1;tc(this,{from:b,to:Ac(c,ke(this,c).text.length),text:vf(a),origin:"setValue"},{head:b,anchor:b},!0)},replaceRange:function(a,b,c,d){b=Fc(this,b),c=c?Fc(this,c):b,zc(this,a,b,c,d)},getRange:function(a,b,c){var d=le(this,Fc(this,a),Fc(this,b));return c===!1?d:d.join(c||"\n")},getLine:function(a){var b=this.getLineHandle(a);return b&&b.text},setLine:function(a,b){Hc(this,a)&&zc(this,b,Ac(a,0),Fc(this,Ac(a)))},removeLine:function(a){a?zc(this,"",Fc(this,Ac(a-1)),Fc(this,Ac(a))):zc(this,"",Ac(0,0),Fc(this,Ac(1,0)))},getLineHandle:function(a){return Hc(this,a)?ke(this,a):void 0},getLineNumber:function(a){return oe(a)},getLineHandleVisualStart:function(a){return"number"==typeof a&&(a=ke(this,a)),Ed(this,a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return Fc(this,a)},getCursor:function(a){var c,b=this.sel;return c=null==a||"head"==a?b.head:"anchor"==a?b.anchor:"end"==a||a===!1?b.to:b.from,Dc(c)},somethingSelected:function(){return!Bc(this.sel.head,this.sel.anchor)},setCursor:Fb(function(a,b,c){var d=Fc(this,"number"==typeof a?Ac(a,b||0):a);c?Ic(this,d):Kc(this,d,d)}),setSelection:Fb(function(a,b,c){Kc(this,Fc(this,a),Fc(this,b||a),c)}),extendSelection:Fb(function(a,b,c){Ic(this,Fc(this,a),b&&Fc(this,b),c)}),getSelection:function(a){return this.getRange(this.sel.from,this.sel.to,a)},replaceSelection:function(a,b,c){tc(this,{from:this.sel.from,to:this.sel.to,text:vf(a),origin:c},b||"around")},undo:Fb(function(){vc(this,"undo")}),redo:Fb(function(){vc(this,"redo")}),setExtending:function(a){this.sel.extend=a},historySize:function(){var a=this.history;return{undo:a.done.length,redo:a.undone.length}},clearHistory:function(){this.history=se(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration()},changeGeneration:function(){return this.history.lastOp=this.history.lastOrigin=null,this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:ye(this.history.done),undone:ye(this.history.undone)}},setHistory:function(a){var b=this.history=se(this.history.maxGeneration);b.done=a.done.slice(0),b.undone=a.undone.slice(0)},markText:function(a,b,c){return qd(this,Fc(this,a),Fc(this,b),c,"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft};return a=Fc(this,a),qd(this,a,a,c,"bookmark")},findMarksAt:function(a){a=Fc(this,a);var b=[],c=ke(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;d<c.length;++d)null!=c[d].from&&a.push(c[d].marker)}),a},posFromIndex:function(a){var b,c=this.first;return this.iter(function(d){var e=d.text.length+1;return e>a?(b=a,!0):(a-=e,++c,void 0)}),Fc(this,Ac(c,b))},indexFromPos:function(a){a=Fc(this,a);var b=a.ch;return a.line<this.first||a.ch<0?0:(this.iter(this.first,a.line,function(a){b+=a.text.length+1}),b)},copy:function(a){var b=new fe(me(this,this.first,this.first+this.size),this.modeOption,this.first);return b.scrollTop=this.scrollTop,b.scrollLeft=this.scrollLeft,b.sel={from:this.sel.from,to:this.sel.to,head:this.sel.head,anchor:this.sel.anchor,shift:this.sel.shift,extend:!1,goalColumn:this.sel.goalColumn},a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory())),b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from),null!=a.to&&a.to<c&&(c=a.to);var d=new fe(me(this,b,c),a.mode||this.modeOption,b);return a.sharedHist&&(d.history=this.history),(this.linked||(this.linked=[])).push({doc:d,sharedHist:a.sharedHist}),d.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}],d},unlinkDoc:function(a){if(a instanceof w&&(a=a.doc),this.linked)for(var b=0;b<this.linked.length;++b){var c=this.linked[b];if(c.doc==a){this.linked.splice(b,1),a.unlinkDoc(this);break}}if(a.history==this.history){var d=[a.id];ie(a,function(a){d.push(a.id)},!0),a.history=se(),a.history.done=ye(this.history.done,d),a.history.undone=ye(this.history.undone,d)}},iterLinkedDocs:function(a){ie(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),fe.prototype.eachLine=fe.prototype.iter;var ge="iter insert remove copy getEditor".split(" ");for(var he in fe.prototype)fe.prototype.hasOwnProperty(he)&&af(ge,he)<0&&(w.prototype[he]=function(a){return function(){return a.apply(this.doc,arguments)}}(fe.prototype[he]));Te(fe),w.e_stop=He,w.e_preventDefault=Ee,w.e_stopPropagation=Fe;var Ne,Oe=0;w.on=Ke,w.off=Le,w.signal=Me;var Ue=30,Ve=w.Pass={toString:function(){return"CodeMirror.Pass"}};We.prototype={set:function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)}},w.countColumn=Xe;var Ye=[""],ff=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,jf=/[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/;w.replaceGetRect=function(a){of=a};var pf=function(){if(d)return!1;var a=kf("div");return"draggable"in a||"dragDrop"in a}();a?qf=function(a,b){return 36==a.charCodeAt(b-1)&&39==a.charCodeAt(b)}:i&&!/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)?qf=function(a,b){return/\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(a.slice(b-1,b+1))}:e&&/Chrome\/(?:29|[3-9]\d|\d\d\d)\./.test(navigator.userAgent)?qf=function(a,b){var c=a.charCodeAt(b-1);return c>=8208&&8212>=c}:e&&(qf=function(a,b){if(b>1&&45==a.charCodeAt(b-1)){if(/\w/.test(a.charAt(b-2))&&/[^\-?\.]/.test(a.charAt(b)))return!0;if(b>2&&/[\d\.,]/.test(a.charAt(b-2))&&/[\d\.,]/.test(a.charAt(b)))return!1}return/[~!#%&*)=+}\]\\|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|\u2026[\w~`@#$%\^&*(_=+{[><]/.test(a.slice(b-1,b+1))});var rf,tf,vf=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)};w.splitLines=vf;var wf=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},xf=function(){var a=kf("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),yf={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};w.keyNames=yf,function(){for(var a=0;10>a;a++)yf[a+48]=String(a);for(var a=65;90>=a;a++)yf[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)yf[a+111]=yf[a+63235]="F"+a}();var Hf,Mf=function(){function c(c){return 255>=c?a.charAt(c):c>=1424&&1524>=c?"R":c>=1536&&1791>=c?b.charAt(c-1536):c>=1792&&2220>=c?"r":"L"}var a="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",b="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,f=/[LRr]/,g=/[Lb1n]/,h=/[1n]/,i="L";return function(a){if(!d.test(a))return!1;for(var l,b=a.length,j=[],k=0;b>k;++k)j.push(l=c(a.charCodeAt(k)));for(var k=0,m=i;b>k;++k){var l=j[k];"m"==l?j[k]=m:m=l}for(var k=0,n=i;b>k;++k){var l=j[k];"1"==l&&"r"==n?j[k]="n":f.test(l)&&(n=l,"r"==l&&(j[k]="R"))}for(var k=1,m=j[0];b-1>k;++k){var l=j[k];"+"==l&&"1"==m&&"1"==j[k+1]?j[k]="1":","!=l||m!=j[k+1]||"1"!=m&&"n"!=m||(j[k]=m),m=l}for(var k=0;b>k;++k){var l=j[k];if(","==l)j[k]="N";else if("%"==l){for(var o=k+1;b>o&&"%"==j[o];++o);for(var p=k&&"!"==j[k-1]||b-1>o&&"1"==j[o]?"1":"N",q=k;o>q;++q)j[q]=p;k=o-1}}for(var k=0,n=i;b>k;++k){var l=j[k];"L"==n&&"1"==l?j[k]="L":f.test(l)&&(n=l)}for(var k=0;b>k;++k)if(e.test(j[k])){for(var o=k+1;b>o&&e.test(j[o]);++o);for(var r="L"==(k?j[k-1]:i),s="L"==(b-1>o?j[o]:i),p=r||s?"L":"R",q=k;o>q;++q)j[q]=p;k=o-1}for(var u,t=[],k=0;b>k;)if(g.test(j[k])){var v=k;for(++k;b>k&&g.test(j[k]);++k);t.push({from:v,to:k,level:0})}else{var w=k,x=t.length;for(++k;b>k&&"L"!=j[k];++k);for(var q=w;k>q;)if(h.test(j[q])){q>w&&t.splice(x,0,{from:w,to:q,level:1});var y=q;for(++q;k>q&&h.test(j[q]);++q);t.splice(x,0,{from:y,to:q,level:2}),w=q}else++q;k>w&&t.splice(x,0,{from:w,to:k,level:1})}return 1==t[0].level&&(u=a.match(/^\s+/))&&(t[0].from=u[0].length,t.unshift({from:0,to:u[0].length,level:0})),1==$e(t).level&&(u=a.match(/\s+$/))&&($e(t).to-=u[0].length,t.push({from:b-u[0].length,to:b,level:0})),t[0].level!=$e(t).level&&t.push({from:b,to:b,level:t[0].level}),t}}();return w.version="3.19.1",w}(),CodeMirror.defineMode("css",function(a,b){"use strict";function l(a,b){return k=b,a}function m(a,b){var c=a.next();if(d[c]){var e=d[c](a,b);if(e!==!1)return e}if("@"==c)return a.eatWhile(/[\w\\\-]/),l("def",a.current());if("="==c)l(null,"compare");else{if(("~"==c||"|"==c)&&a.eat("="))return l(null,"compare");if('"'==c||"'"==c)return b.tokenize=n(c),b.tokenize(a,b);if("#"==c)return a.eatWhile(/[\w\\\-]/),l("atom","hash");if("!"==c)return a.match(/^\s*\w*/),l("keyword","important");if(/\d/.test(c)||"."==c&&a.eat(/\d/))return a.eatWhile(/[\w.%]/),l("number","unit");if("-"!==c)return/[,+>*\/]/.test(c)?l(null,"select-op"):"."==c&&a.match(/^-?[_a-z][_a-z0-9-]*/i)?l("qualifier","qualifier"):":"==c?l("operator",c):/[;{}\[\]\(\)]/.test(c)?l(null,c):"u"==c&&a.match("rl(")?(a.backUp(1),b.tokenize=o,l("property","variable")):(a.eatWhile(/[\w\\\-]/),l("property","variable"));if(/\d/.test(a.peek()))return a.eatWhile(/[\w.%]/),l("number","unit");if(a.match(/^[^-]+-/))return l("meta","meta")}}function n(a,b){return function(c,d){for(var f,e=!1;null!=(f=c.next())&&(f!=a||e);)e=!e&&"\\"==f;return e||(b&&c.backUp(1),d.tokenize=m),l("string","string")}}function o(a,b){return a.next(),b.tokenize=a.match(/\s*[\"\']/,!1)?m:n(")",!0),l(null,"(")}b.propertyKeywords||(b=CodeMirror.resolveMode("text/css"));var c=a.indentUnit||a.tabSize||2,d=b.hooks||{},e=b.atMediaTypes||{},f=b.atMediaFeatures||{},g=b.propertyKeywords||{},h=b.colorKeywords||{},i=b.valueKeywords||{},j=!!b.allowNested,k=null;return{startState:function(a){return{tokenize:m,baseIndent:a||0,stack:[],lastToken:null}},token:function(a,b){if(b.tokenize=b.tokenize||m,b.tokenize==m&&a.eatSpace())return null;var c=b.tokenize(a,b);c&&"string"!=typeof c&&(c=l(c[0],c[1]));var d=b.stack[b.stack.length-1];if("variable"==c)return"variable-definition"==k&&b.stack.push("propertyValue"),b.lastToken="variable-2";if("property"==c){var n=a.current().toLowerCase();"propertyValue"==d?c=i.hasOwnProperty(n)?"string-2":h.hasOwnProperty(n)?"keyword":"variable-2":"rule"==d?g.hasOwnProperty(n)||(c+=" error"):"block"==d?c=g.hasOwnProperty(n)?"property":h.hasOwnProperty(n)?"keyword":i.hasOwnProperty(n)?"string-2":"tag":d&&"@media{"!=d?"@media"==d?c=e[a.current()]?"attribute":/^(only|not)$/.test(n)?"keyword":"and"==n?"error":f.hasOwnProperty(n)?"error":"attribute error":"@mediaType"==d?c=e.hasOwnProperty(n)?"attribute":"and"==n?"operator":/^(only|not)$/.test(n)?"error":"error":"@mediaType("==d?g.hasOwnProperty(n)||(e.hasOwnProperty(n)?c="error":"and"==n?c="operator":/^(only|not)$/.test(n)?c="error":c+=" error"):c="@import"==d?"tag":"error":c="tag"}else"atom"==c?d&&"@media{"!=d&&"block"!=d?"propertyValue"==d?/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(a.current())||(c+=" error"):c="error":c="builtin":"@media"==d&&"{"==k&&(c="error");if("{"==k)if("@media"==d||"@mediaType"==d)b.stack[b.stack.length-1]="@media{";else{var o=j?"block":"rule";b.stack.push(o)}else if("}"==k)for("interpolation"==d&&(c="operator");b.stack.length;){var p=b.stack.pop();if(p.indexOf("{")>-1)break}else if("interpolation"==k)b.stack.push("interpolation");else if("@media"==k)b.stack.push("@media");else if("@import"==k)b.stack.push("@import");else if("@media"==d&&/\b(keyword|attribute)\b/.test(c))b.stack[b.stack.length-1]="@mediaType";else if("@mediaType"==d&&","==a.current())b.stack[b.stack.length-1]="@media";else if("("==k)"@media"==d||"@mediaType"==d?(b.stack[b.stack.length-1]="@mediaType",b.stack.push("@mediaType(")):b.stack.push("(");else if(")"==k)for(;b.stack.length;){var p=b.stack.pop();if(p.indexOf("(")>-1)break}else":"==k&&"property"==b.lastToken?b.stack.push("propertyValue"):"propertyValue"==d&&";"==k?b.stack.pop():"@import"==d&&";"==k&&b.stack.pop();return b.lastToken=c},indent:function(a,b){var d=a.stack.length;return/^\}/.test(b)&&(d-="propertyValue"==a.stack[d-1]?2:1),a.baseIndent+d*c},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}}),function(){function a(a){for(var b={},c=0;c<a.length;++c)b[a[c]]=!0;return b}function g(a,b){for(var d,c=!1;null!=(d=a.next());){if(c&&"/"==d){b.tokenize=null;break}c="*"==d}return["comment","comment"]}var b=a(["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]),c=a(["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"]),d=a(["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","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","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","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-feature-settings","font-family","font-kerning","font-language-override","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-weight","grid-cell","grid-column","grid-column-align","grid-column-sizing","grid-column-span","grid-columns","grid-flow","grid-row","grid-row-align","grid-row-sizing","grid-row-span","grid-rows","grid-template","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","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","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","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","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","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-inside","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-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","zoom","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-profile","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","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","kerning","text-anchor","writing-mode"]),e=a(["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","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"]),f=a(["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","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","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","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","malayalam","match","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","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","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","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","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"]);
5
+ CodeMirror.defineMIME("text/css",{atMediaTypes:b,atMediaFeatures:c,propertyKeywords:d,colorKeywords:e,valueKeywords:f,hooks:{"<":function(a,b){function c(a,b){for(var d,c=0;null!=(d=a.next());){if(c>=2&&">"==d){b.tokenize=null;break}c="-"==d?c+1:0}return["comment","comment"]}return a.eat("!")?(b.tokenize=c,c(a,b)):void 0},"/":function(a,b){return a.eat("*")?(b.tokenize=g,g(a,b)):!1}},name:"css"}),CodeMirror.defineMIME("text/x-scss",{atMediaTypes:b,atMediaFeatures:c,propertyKeywords:d,colorKeywords:e,valueKeywords:f,allowNested:!0,hooks:{":":function(a){return a.match(/\s*{/)?[null,"{"]:!1},$:function(a){return a.match(/^[\w-]+/),":"==a.peek()?["variable","variable-definition"]:["variable","variable"]},",":function(a,b){return"propertyValue"==b.stack[b.stack.length-1]?["operator",";"]:void 0},"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=g,g(a,b)):["operator","operator"]},"#":function(a){return a.eat("{")?["operator","interpolation"]:(a.eatWhile(/[\w\\\-]/),["atom","hash"])}},name:"css"})}(),CodeMirror.defineMode("htmlmixed",function(a,b){function i(a,b){var f=b.htmlState.tagName,g=c.token(a,b.htmlState);if("script"==f&&/\btag\b/.test(g)&&">"==a.current()){var h=a.string.slice(Math.max(0,a.pos-100),a.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);h=h?h[1]:"",h&&/[\"\']/.test(h.charAt(0))&&(h=h.slice(1,h.length-1));for(var i=0;i<e.length;++i){var j=e[i];if("string"==typeof j.matches?h==j.matches:j.matches.test(h)){j.mode&&(b.token=k,b.localMode=j.mode,b.localState=j.mode.startState&&j.mode.startState(c.indent(b.htmlState,"")));break}}}else"style"==f&&/\btag\b/.test(g)&&">"==a.current()&&(b.token=l,b.localMode=d,b.localState=d.startState(c.indent(b.htmlState,"")));return g}function j(a,b,c){var f,d=a.current(),e=d.search(b);return e>-1?a.backUp(d.length-e):(f=d.match(/<\/?$/))&&(a.backUp(d.length),a.match(b,!1)||a.match(d[0])),c}function k(a,b){return a.match(/^<\/\s*script\s*>/i,!1)?(b.token=i,b.localState=b.localMode=null,i(a,b)):j(a,/<\/\s*script\s*>/,b.localMode.token(a,b.localState))}function l(a,b){return a.match(/^<\/\s*style\s*>/i,!1)?(b.token=i,b.localState=b.localMode=null,i(a,b)):j(a,/<\/\s*style\s*>/,d.token(a,b.localState))}var c=CodeMirror.getMode(a,{name:"xml",htmlMode:!0}),d=CodeMirror.getMode(a,"css"),e=[],f=b&&b.scriptTypes;if(e.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:CodeMirror.getMode(a,"javascript")}),f)for(var g=0;g<f.length;++g){var h=f[g];e.push({matches:h.matches,mode:h.mode&&CodeMirror.getMode(a,h.mode)})}return e.push({matches:/./,mode:CodeMirror.getMode(a,"text/plain")}),{startState:function(){var a=c.startState();return{token:i,localMode:null,localState:null,htmlState:a}},copyState:function(a){if(a.localState)var b=CodeMirror.copyState(a.localMode,a.localState);return{token:a.token,localMode:a.localMode,localState:b,htmlState:CodeMirror.copyState(c,a.htmlState)}},token:function(a,b){return b.token(a,b)},indent:function(a,b){return!a.localMode||/^\s*<\//.test(b)?c.indent(a.htmlState,b):a.localMode.indent?a.localMode.indent(a.localState,b):CodeMirror.Pass},electricChars:"/{}:",innerMode:function(a){return{state:a.localState||a.htmlState,mode:a.localMode||c}}}},"xml","javascript","css"),CodeMirror.defineMIME("text/html","htmlmixed"),CodeMirror.defineMode("javascript",function(a,b){function i(a,b,c){return b.tokenize=c,c(a,b)}function j(a,b){for(var d,c=!1;null!=(d=a.next());){if(d==b&&!c)return!1;c=!c&&"\\"==d}return c}function m(a,b,c){return k=a,l=c,b}function n(a,b){var c=a.next();if('"'==c||"'"==c)return i(a,b,o(c));if("."==c&&a.match(/^\d+(?:[eE][+\-]?\d+)?/))return m("number","number");if(/[\[\]{}\(\),;\:\.]/.test(c))return m(c);if("0"==c&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),m("number","number");if(/\d/.test(c))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),m("number","number");if("/"==c)return a.eat("*")?i(a,b,p):a.eat("/")?(a.skipToEnd(),m("comment","comment")):"operator"==b.lastType||"keyword c"==b.lastType||"sof"==b.lastType||/^[\[{}\(,;:]$/.test(b.lastType)?(j(a,"/"),a.eatWhile(/[gimy]/),m("regexp","string-2")):(a.eatWhile(h),m("operator",null,a.current()));if("#"==c)return a.skipToEnd(),m("error","error");if(h.test(c))return a.eatWhile(h),m("operator",null,a.current());a.eatWhile(/[\w\$_]/);var d=a.current(),e=g.propertyIsEnumerable(d)&&g[d];return e&&"."!=b.lastType?m(e.type,e.style,d):m("variable","variable",d)}function o(a){return function(b,c){return j(b,a)||(c.tokenize=n),m("string","string")}}function p(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=n;break}c="*"==d}return m("comment","comment")}function r(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,null!=d&&(this.align=d)}function s(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0}function t(a,b,c,d,f){var g=a.cc;for(u.state=a,u.stream=f,u.marked=null,u.cc=g,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var h=g.length?g.pop():e?F:E;if(h(c,d)){for(;g.length&&g[g.length-1].lex;)g.pop()();return u.marked?u.marked:"variable"==c&&s(a,d)?"variable-2":b}}}function v(){for(var a=arguments.length-1;a>=0;a--)u.cc.push(arguments[a])}function w(){return v.apply(null,arguments),!0}function x(a){function b(b){for(var c=b;c;c=c.next)if(c.name==a)return!0;return!1}var c=u.state;if(c.context){if(u.marked="def",b(c.localVars))return;c.localVars={name:a,next:c.localVars}}else{if(b(c.globalVars))return;c.globalVars={name:a,next:c.globalVars}}}function z(){u.state.context={prev:u.state.context,vars:u.state.localVars},u.state.localVars=y}function A(){u.state.localVars=u.state.context.vars,u.state.context=u.state.context.prev}function B(a,b){var c=function(){var c=u.state,d=c.indented;"stat"==c.lexical.type&&(d=c.lexical.indented),c.lexical=new r(d,u.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function C(){var a=u.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function D(a){return function(b){return b==a?w():";"==a?v():w(arguments.callee)}}function E(a){return"var"==a?w(B("vardef"),U,D(";"),C):"keyword a"==a?w(B("form"),F,E,C):"keyword b"==a?w(B("form"),E,C):"{"==a?w(B("}"),R,C):";"==a?w():"if"==a?w(B("form"),F,E,C,W):"function"==a?w(_):"for"==a?w(B("form"),D("("),B(")"),X,D(")"),C,E,C):"variable"==a?w(B("stat"),M):"switch"==a?w(B("form"),F,B("}","switch"),D("{"),R,C,C):"case"==a?w(F,D(":")):"default"==a?w(D(":")):"catch"==a?w(B("form"),z,D("("),ab,D(")"),E,C,A):v(B("stat"),F,D(";"),C)}function F(a){return H(a,!1)}function G(a){return H(a,!0)}function H(a,b){var c=b?L:K;return q.hasOwnProperty(a)?w(c):"function"==a?w(_):"keyword c"==a?w(b?J:I):"("==a?w(B(")"),I,D(")"),C,c):"operator"==a?w(b?G:F):"["==a?w(B("]"),Q(G,"]"),C,c):"{"==a?w(B("}"),Q(O,"}"),C,c):w()}function I(a){return a.match(/[;\}\)\],]/)?v():v(F)}function J(a){return a.match(/[;\}\)\],]/)?v():v(G)}function K(a,b){return","==a?w(F):L(a,b,!1)}function L(a,b,c){var d=0==c?K:L,e=0==c?F:G;return"operator"==a?/\+\+|--/.test(b)?w(d):"?"==b?w(F,D(":"),e):w(e):";"!=a?"("==a?w(B(")","call"),Q(G,")"),C,d):"."==a?w(N,d):"["==a?w(B("]"),I,D("]"),C,d):void 0:void 0}function M(a){return":"==a?w(C,E):v(K,D(";"),C)}function N(a){return"variable"==a?(u.marked="property",w()):void 0}function O(a,b){if("variable"==a){if(u.marked="property","get"==b||"set"==b)return w(P)}else("number"==a||"string"==a)&&(u.marked=a+" property");return q.hasOwnProperty(a)?w(D(":"),G):void 0}function P(a){return":"==a?w(F):"variable"!=a?w(D(":"),F):(u.marked="property",w(_))}function Q(a,b){function c(d){if(","==d){var e=u.state.lexical;return"call"==e.info&&(e.pos=(e.pos||0)+1),w(a,c)}return d==b?w():w(D(b))}return function(d){return d==b?w():v(a,c)}}function R(a){return"}"==a?w():v(E,R)}function S(a){return":"==a?w(T):v()}function T(a){return"variable"==a?(u.marked="variable-3",w()):v()}function U(a,b){return"variable"==a?(x(b),f?w(S,V):w(V)):v()}function V(a,b){return"="==b?w(G,V):","==a?w(U):void 0}function W(a,b){return"keyword b"==a&&"else"==b?w(B("form"),E,C):void 0}function X(a){return"var"==a?w(U,D(";"),Z):";"==a?w(Z):"variable"==a?w(Y):v(F,D(";"),Z)}function Y(a,b){return"in"==b?w(F):w(K,Z)}function Z(a,b){return";"==a?w($):"in"==b?w(F):v(F,D(";"),$)}function $(a){")"!=a&&w(F)}function _(a,b){return"variable"==a?(x(b),w(_)):"("==a?w(B(")"),z,Q(ab,")"),C,E,A):void 0}function ab(a,b){return"variable"==a?(x(b),f?w(S):w()):void 0}var k,l,c=a.indentUnit,d=b.statementIndent,e=b.json,f=b.typescript,g=function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("operator"),g={type:"atom",style:"atom"},h={"if":a("if"),"while":b,"with":b,"else":c,"do":c,"try":c,"finally":c,"return":d,"break":d,"continue":d,"new":d,"delete":d,"throw":d,"var":a("var"),"const":a("var"),let:a("var"),"function":a("function"),"catch":a("catch"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":e,"typeof":e,"instanceof":e,"true":g,"false":g,"null":g,undefined:g,NaN:g,Infinity:g,"this":a("this")};if(f){var i={type:"variable",style:"variable-3"},j={"interface":a("interface"),"class":a("class"),"extends":a("extends"),constructor:a("constructor"),"public":a("public"),"private":a("private"),"protected":a("protected"),"static":a("static"),"super":a("super"),string:i,number:i,bool:i,any:i};for(var k in j)h[k]=j[k]}return h}(),h=/[+\-*&%=<>!?|~^]/,q={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0},u={state:null,column:null,marked:null,cc:null},y={name:"this",next:{name:"arguments"}};return C.lex=!0,{startState:function(a){return{tokenize:n,lastType:"sof",cc:[],lexical:new r((a||0)-c,0,"block",!1),localVars:b.localVars,globalVars:b.globalVars,context:b.localVars&&{vars:b.localVars},indented:0}},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation()),b.tokenize!=p&&a.eatSpace())return null;var c=b.tokenize(a,b);return"comment"==k?c:(b.lastType="operator"!=k||"++"!=l&&"--"!=l?k:"incdec",t(b,c,k,l,a))},indent:function(a,e){if(a.tokenize==p)return CodeMirror.Pass;if(a.tokenize!=n)return 0;for(var f=e&&e.charAt(0),g=a.lexical,h=a.cc.length-1;h>=0;--h){var i=a.cc[h];if(i==C)g=g.prev;else if(i!=W||/^else\b/.test(e))break}"stat"==g.type&&"}"==f&&(g=g.prev),d&&")"==g.type&&"stat"==g.prev.type&&(g=g.prev);var j=g.type,k=f==j;return"vardef"==j?g.indented+("operator"==a.lastType||","==a.lastType?4:0):"form"==j&&"{"==f?g.indented:"form"==j?g.indented+c:"stat"==j?g.indented+("operator"==a.lastType||","==a.lastType?d||c:0):"switch"!=g.info||k||0==b.doubleIndentSwitch?g.align?g.column+(k?0:1):g.indented+(k?0:c):g.indented+(/^(?:case|default)\b/.test(e)?c:2*c)},electricChars:":{}",blockCommentStart:e?null:"/*",blockCommentEnd:e?null:"*/",lineComment:e?null:"//",fold:"brace",helperType:e?"json":"javascript",jsonMode:e}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("text/ecmascript","javascript"),CodeMirror.defineMIME("application/javascript","javascript"),CodeMirror.defineMIME("application/ecmascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMIME("application/x-json",{name:"javascript",json:!0}),CodeMirror.defineMIME("text/typescript",{name:"javascript",typescript:!0}),CodeMirror.defineMIME("application/typescript",{name:"javascript",typescript:!0}),CodeMirror.defineMode("xml",function(a,b){function j(a,b){function c(c){return b.tokenize=c,c(a,b)}var d=a.next();if("<"==d){if(a.eat("!"))return a.eat("[")?a.match("CDATA[")?c(m("atom","]]>")):null:a.match("--")?c(m("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),c(n(1))):null;if(a.eat("?"))return a.eatWhile(/[\w\._\-]/),b.tokenize=m("meta","?>"),"meta";var e=a.eat("/");h="";for(var f;f=a.eat(/[^\s\u00a0=<>\"\'\/?]/);)h+=f;return h?(i=e?"closeTag":"openTag",b.tokenize=k,"tag"):"tag error"}if("&"==d){var g;return g=a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),g?"atom":"error"}return a.eatWhile(/[^&<]/),null}function k(a,b){var c=a.next();if(">"==c||"/"==c&&a.eat(">"))return b.tokenize=j,i=">"==c?"endTag":"selfcloseTag","tag";if("="==c)return i="equals",null;if("<"==c){b.tokenize=j;var d=b.tokenize(a,b);return d?d+" error":"error"}return/[\'\"]/.test(c)?(b.tokenize=l(c),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=<>\"\']/),"word")}function l(a){var b=function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=k;break}return"string"};return b.isInAttribute=!0,b}function m(a,b){return function(c,d){for(;!c.eol();){if(c.match(b)){d.tokenize=j;break}c.next()}return a}}function n(a){return function(b,c){for(var d;null!=(d=b.next());){if("<"==d)return c.tokenize=n(a+1),c.tokenize(b,c);if(">"==d){if(1==a){c.tokenize=j;break}return c.tokenize=n(a-1),c.tokenize(b,c)}}return"meta"}}function r(){for(var a=arguments.length-1;a>=0;a--)o.cc.push(arguments[a])}function s(){return r.apply(null,arguments),!0}function t(a,b){var c=f.doNotIndent.hasOwnProperty(a)||o.context&&o.context.noIndent;o.context={prev:o.context,tagName:a,indent:o.indented,startOfLine:b,noIndent:c}}function u(){o.context&&(o.context=o.context.prev)}function v(a){if("openTag"==a)return o.tagName=h,o.tagStart=p.column(),s(z,w(o.startOfLine));if("closeTag"==a){var b=!1;return o.context?o.context.tagName!=h&&(f.implicitlyClosed.hasOwnProperty(o.context.tagName.toLowerCase())&&u(),b=!o.context||o.context.tagName!=h):b=!0,b&&(q="error"),s(x(b))}return s()}function w(a){return function(b){var c=o.tagName;return o.tagName=o.tagStart=null,"selfcloseTag"==b||"endTag"==b&&f.autoSelfClosers.hasOwnProperty(c.toLowerCase())?(y(c.toLowerCase()),s()):"endTag"==b?(y(c.toLowerCase()),t(c,a),s()):s()}}function x(a){return function(b){return a&&(q="error"),"endTag"==b?(u(),s()):(q="error",s(arguments.callee))}}function y(a){for(var b;;){if(!o.context)return;if(b=o.context.tagName.toLowerCase(),!f.contextGrabbers.hasOwnProperty(b)||!f.contextGrabbers[b].hasOwnProperty(a))return;u()}}function z(a){return"word"==a?(q="attribute",s(A,z)):"endTag"==a||"selfcloseTag"==a?r():(q="error",s(z))}function A(a){if("equals"==a)return s(B,z);if(f.allowMissing){if("word"==a)return q="attribute",s(A,z)}else q="error";return"endTag"==a||"selfcloseTag"==a?r():s()}function B(a){return"string"==a?s(C):"word"==a&&f.allowUnquoted?(q="string",s()):(q="error","endTag"==a||"selfCloseTag"==a?r():s())}function C(a){return"string"==a?s(C):r()}var h,i,o,p,q,c=a.indentUnit,d=b.multilineTagIndentFactor||1,e=b.multilineTagIndentPastTag||!0,f=b.htmlMode?{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},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}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},g=b.alignCDATA;return{startState:function(){return{tokenize:j,cc:[],indented:0,startOfLine:!0,tagName:null,tagStart:null,context:null}},token:function(a,b){if(!b.tagName&&a.sol()&&(b.startOfLine=!0,b.indented=a.indentation()),a.eatSpace())return null;q=i=h=null;var c=b.tokenize(a,b);if(b.type=i,(c||i)&&"comment"!=c)for(o=b,p=a;;){var d=b.cc.pop()||v;if(d(i||c))break}return b.startOfLine=!1,q&&(c="error"==q?c+" error":q),c},indent:function(a,b,f){var h=a.context;if(a.tokenize.isInAttribute)return a.stringStartCol+1;if(a.tokenize!=k&&a.tokenize!=j||h&&h.noIndent)return f?f.match(/^(\s*)/)[0].length:0;if(a.tagName)return e?a.tagStart+a.tagName.length+2:a.tagStart+c*d;if(g&&/<!\[CDATA\[/.test(b))return 0;for(h&&/^<\//.test(b)&&(h=h.prev);h&&!h.startOfLine;)h=h.prev;return h?h.indent+c:0},electricChars:"/",blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:b.htmlMode?"html":"xml",helperType:b.htmlMode?"html":"xml"}}),CodeMirror.defineMIME("text/xml","xml"),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.mimeModes.hasOwnProperty("text/html")||CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0}),function(){"use strict";function c(c){"activeLine"in c.state&&(c.removeLineClass(c.state.activeLine,"wrap",a),c.removeLineClass(c.state.activeLine,"background",b))}function d(d){var e=d.getLineHandleVisualStart(d.getCursor().line);d.state.activeLine!=e&&(c(d),d.addLineClass(e,"wrap",a),d.addLineClass(e,"background",b),d.state.activeLine=e)}var a="CodeMirror-activeline",b="CodeMirror-activeline-background";CodeMirror.defineOption("styleActiveLine",!1,function(a,b,e){var f=e&&e!=CodeMirror.Init;b&&!f?(d(a),a.on("cursorActivity",d)):!b&&f&&(a.off("cursorActivity",d),c(a),delete a.state.activeLine)})}(),function(){function d(a,d,e){function r(d,e,f){if(d.text){var h=m?0:d.text.length-1,i=m?d.text.length:-1;if(d.text.length>g)return null;for(null!=f&&(h=f+n);h!=i;h+=n){var j=d.text.charAt(h);if(q.test(j)&&a.getTokenTypeAt(b(e,h+1))==o){var k=c[j];if(">"==k.charAt(1)==m)p.push(j);else{if(p.pop()!=k.charAt(0))return{pos:h,match:!1};if(!p.length)return{pos:h,match:!0}}}}}}var f=a.state.matchBrackets,g=f&&f.maxScanLineLength||1e4,h=f&&f.maxScanLines||100,i=d||a.getCursor(),j=a.getLineHandle(i.line),k=i.ch-1,l=k>=0&&c[j.text.charAt(k)]||c[j.text.charAt(++k)];if(!l)return null;var m=">"==l.charAt(1),n=m?1:-1;if(e&&m!=(k==i.ch))return null;for(var t,o=a.getTokenTypeAt(b(i.line,k+1)),p=[j.text.charAt(k)],q=/[(){}[\]]/,s=i.line,u=m?Math.min(s+h,a.lineCount()):Math.max(-1,s-h);s!=u&&!(t=s==i.line?r(j,s,k):r(a.getLineHandle(s),s));s+=n);return{from:b(i.line,k),to:t&&b(s,t.pos),match:t&&t.match,forward:m}}function e(c,e){var f=c.state.matchBrackets.maxHighlightLineLength||1e3,g=d(c);if(!(!g||c.getLine(g.from.line).length>f||g.to&&c.getLine(g.to.line).length>f)){var h=g.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",i=c.markText(g.from,b(g.from.line,g.from.ch+1),{className:h}),j=g.to&&c.markText(g.to,b(g.to.line,g.to.ch+1),{className:h});a&&c.state.focused&&c.display.input.focus();var k=function(){c.operation(function(){i.clear(),j&&j.clear()})};return e?(setTimeout(k,800),void 0):k}}function g(a){a.operation(function(){f&&(f(),f=null),a.somethingSelected()||(f=e(a,!1))})}var a=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),b=CodeMirror.Pos,c={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},f=null;CodeMirror.defineOption("matchBrackets",!1,function(a,b,c){c&&c!=CodeMirror.Init&&a.off("cursorActivity",g),b&&(a.state.matchBrackets="object"==typeof b?b:{},a.on("cursorActivity",g))}),CodeMirror.defineExtension("matchBrackets",function(){e(this,!0)}),CodeMirror.defineExtension("findMatchingBracket",function(a,b){return d(this,a,b)})}(),window.onload=heshPlugin;
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
  === HTML Editor Syntax Highlighter ===
2
  Contributors: nixdns
3
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TM7JTJY6HDTAQ
4
  Tags: html editor, syntax highlighter, plugin editor, syntax, highlighting, syntax hilighting
5
  Requires at least: 3.3
6
- Tested up to: 3.6.1
7
- Stable tag: 1.3.2
8
 
9
- Add syntax highlighting to the Post/Page HTML editor.
10
 
11
  == Description ==
12
 
@@ -19,13 +19,19 @@ Add syntax highlighting to the Post/Page HTML editor.
19
 
20
  == Changelog ==
21
 
 
 
 
 
 
 
22
  = 1.3.2 =
23
  * Updated CodeMirror library
24
  * Increased loading performance
25
  * Match brackets
26
 
27
  = 1.3.0 =
28
- * CodeMirror library updated to the version 3.02
29
  * Added quick-tags toolbar buttons
30
  * Preserve the scroll position after update or page reload
31
 
1
  === HTML Editor Syntax Highlighter ===
2
  Contributors: nixdns
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BR5C4F42WXX6J
4
  Tags: html editor, syntax highlighter, plugin editor, syntax, highlighting, syntax hilighting
5
  Requires at least: 3.3
6
+ Tested up to: 3.7
7
+ Stable tag: 1.4.0
8
 
9
+ Add syntax highlighting to the HTML editor.
10
 
11
  == Description ==
12
 
19
 
20
  == Changelog ==
21
 
22
+ = 1.4.0 =
23
+ * New fullscreen mode
24
+ * Remembers tab state
25
+ * Editor resize handler
26
+ * Code refactoring and minification for better loading performance
27
+
28
  = 1.3.2 =
29
  * Updated CodeMirror library
30
  * Increased loading performance
31
  * Match brackets
32
 
33
  = 1.3.0 =
34
+ * CodeMirror library updated to version 3.02
35
  * Added quick-tags toolbar buttons
36
  * Preserve the scroll position after update or page reload
37