rich 1.4.5 → 1.4.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. data/lib/rich/version.rb +1 -1
  2. data/vendor/assets/ckeditor/ckeditor-contrib/plugins/MediaEmbed/icons/mediaembed.png +0 -0
  3. data/vendor/assets/ckeditor/ckeditor/build-config.js +1 -3
  4. data/vendor/assets/ckeditor/ckeditor/ckeditor.js +16 -12
  5. data/vendor/assets/ckeditor/ckeditor/lang/en.js +1 -1
  6. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/css/codemirror.ckeditor.css +74 -0
  7. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/css/codemirror.css +6 -1
  8. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -0
  9. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/dialog/dialog.js +3 -0
  10. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +2 -0
  11. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/edit/closetag.js +3 -3
  12. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js +4 -4
  13. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/{util → addon/foldcode}/foldcode.js +4 -4
  14. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/format/autoFormatAll.js +2 -0
  15. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/format/formatting.js +5 -5
  16. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/search/match-highlighter.js +2 -0
  17. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/search/search.js +5 -0
  18. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/search/searchcursor.js +5 -0
  19. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +25 -0
  20. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/codemirror.js +188 -168
  21. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/codemirror.min.js +187 -0
  22. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/codemirror.modes.min.js +25 -0
  23. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/codemirror.search-addons.min.js +13 -0
  24. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/{css.js → mode/css.js} +0 -0
  25. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/mode/htmlmixed.js +5 -0
  26. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/{javascript.js → mode/javascript.js} +7 -7
  27. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/{xml.js → mode/xml.js} +0 -0
  28. data/vendor/assets/ckeditor/ckeditor/plugins/icons.png +0 -0
  29. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/af.js +11 -0
  30. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ar.js +11 -0
  31. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/bg.js +11 -0
  32. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/bn.js +11 -0
  33. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/bs.js +11 -0
  34. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ca.js +11 -0
  35. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/cs.js +11 -0
  36. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/cy.js +11 -0
  37. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/da.js +11 -0
  38. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/de.js +11 -0
  39. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/el.js +11 -0
  40. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/en-au.js +11 -0
  41. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/en-ca.js +11 -0
  42. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/en-gb.js +11 -0
  43. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/en.js +11 -0
  44. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/eo.js +11 -0
  45. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/es.js +11 -0
  46. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/et.js +11 -0
  47. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/eu.js +11 -0
  48. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/fa.js +11 -0
  49. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/fi.js +11 -0
  50. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/fo.js +11 -0
  51. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/fr-ca.js +11 -0
  52. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/fr.js +11 -0
  53. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/gl.js +11 -0
  54. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/gu.js +11 -0
  55. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/he.js +11 -0
  56. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/hi.js +11 -0
  57. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/hr.js +11 -0
  58. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/hu.js +11 -0
  59. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/is.js +11 -0
  60. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/it.js +11 -0
  61. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ja.js +11 -0
  62. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ka.js +11 -0
  63. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/km.js +11 -0
  64. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ko.js +11 -0
  65. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ku.js +11 -0
  66. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/lt.js +11 -0
  67. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/lv.js +11 -0
  68. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/mk.js +11 -0
  69. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/mn.js +11 -0
  70. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ms.js +11 -0
  71. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/nb.js +11 -0
  72. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/nl.js +11 -0
  73. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/no.js +11 -0
  74. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/pl.js +11 -0
  75. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/pt-br.js +11 -0
  76. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/pt.js +11 -0
  77. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ro.js +11 -0
  78. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ru.js +11 -0
  79. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/sk.js +11 -0
  80. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/sl.js +11 -0
  81. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/sr-latn.js +11 -0
  82. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/sr.js +11 -0
  83. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/sv.js +11 -0
  84. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/th.js +11 -0
  85. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/tr.js +11 -0
  86. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/ug.js +11 -0
  87. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/uk.js +11 -0
  88. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/vi.js +11 -0
  89. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/zh-cn.js +11 -0
  90. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/lang/zh.js +11 -0
  91. data/vendor/assets/ckeditor/ckeditor/plugins/stylescombo/plugin.js +186 -0
  92. data/vendor/assets/ckeditor/ckeditor/samples/index.html +0 -6
  93. data/vendor/assets/ckeditor/ckeditor/skins/moono/editor.css +1 -1
  94. data/vendor/assets/ckeditor/ckeditor/skins/moono/editor_gecko.css +1 -1
  95. data/vendor/assets/ckeditor/ckeditor/skins/moono/editor_ie.css +1 -1
  96. data/vendor/assets/ckeditor/ckeditor/skins/moono/editor_ie7.css +1 -1
  97. data/vendor/assets/ckeditor/ckeditor/skins/moono/editor_ie8.css +1 -1
  98. data/vendor/assets/ckeditor/ckeditor/skins/moono/editor_iequirks.css +1 -1
  99. data/vendor/assets/ckeditor/ckeditor/skins/moono/icons.png +0 -0
  100. metadata +83 -31
  101. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/edit/continuecomment.js +0 -2
  102. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/htmlmixed.js +0 -4
  103. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/closetag.js +0 -3
  104. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/colorize.js +0 -1
  105. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/continuecomment.js +0 -2
  106. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/continuelist.js +0 -1
  107. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/dialog.css +0 -32
  108. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/dialog.js +0 -3
  109. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/formatting.js +0 -4
  110. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/javascript-hint.js +0 -5
  111. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/loadmode.js +0 -3
  112. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/match-highlighter.js +0 -2
  113. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/matchbrackets.js +0 -4
  114. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/multiplex.js +0 -4
  115. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/overlay.js +0 -2
  116. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/pig-hint.js +0 -6
  117. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/runmode-standalone.js +0 -5
  118. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/runmode.js +0 -2
  119. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/search.js +0 -5
  120. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/searchcursor.js +0 -5
  121. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/simple-hint.css +0 -16
  122. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/simple-hint.js +0 -4
  123. data/vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/xml-hint.js +0 -3
  124. data/vendor/assets/ckeditor/ckeditor/samples/plugins/autogrow/autogrow.html +0 -99
  125. data/vendor/assets/ckeditor/ckeditor/samples/plugins/divarea/divarea.html +0 -62
@@ -1,3 +1,3 @@
1
1
  module Rich
2
- VERSION = "1.4.5"
2
+ VERSION = "1.4.6"
3
3
  end
@@ -95,9 +95,7 @@ var CKBUILDER_CONFIG = {
95
95
  'menubutton' : 1,
96
96
  'codemirror' : 1,
97
97
  'iframedialog' : 1,
98
- 'stylesheetparser' : 1,
99
- 'autogrow' : 1,
100
- 'divarea' : 1
98
+ 'stylesheetparser' : 1
101
99
  },
102
100
  languages : {
103
101
  'en' : 1,
@@ -871,19 +871,23 @@ this.typesCount=0},fireChange:function(){this.hasUndo=!!this.getNextImage(!0);th
871
871
  this.editor,b;a.bookmarks&&(c.focus(),b=c.getSelection());this.locked=1;this.editor.loadSnapshot(a.contents);a.bookmarks?b.selectBookmarks(a.bookmarks):CKEDITOR.env.ie&&(c=this.editor.document.getBody().$.createTextRange(),c.collapse(!0),c.select());this.locked=0;this.index=a.index;this.update();this.fireChange()},getNextImage:function(a){var c=this.snapshots,b=this.currentImage,d;if(b)if(a)for(d=this.index-1;0<=d;d--){if(a=c[d],!b.equals(a,!0))return a.index=d,a}else for(d=this.index+1;d<c.length;d++)if(a=
872
872
  c[d],!b.equals(a,!0))return a.index=d,a;return null},redoable:function(){return this.enabled&&this.hasRedo},undoable:function(){return this.enabled&&this.hasUndo},undo:function(){if(this.undoable()){this.save(!0);var a=this.getNextImage(!0);if(a)return this.restoreImage(a),!0}return!1},redo:function(){if(this.redoable()&&(this.save(!0),this.redoable())){var a=this.getNextImage(!1);if(a)return this.restoreImage(a),!0}return!1},update:function(){this.locked||this.snapshots.splice(this.index,1,this.currentImage=
873
873
  new i(this.editor))},lock:function(){if(!this.locked){var a=this.editor.getSnapshot();this.locked={update:this.currentImage&&a==this.currentImage.contents?a:null}}},unlock:function(){if(this.locked){var a=this.locked.update,c=this.editor.getSnapshot();this.locked=null;"string"==typeof a&&c!=a&&this.update()}}}})();CKEDITOR.plugins.add("wsc",{requires:"dialog",init:function(a){a.addCommand("checkspell",new CKEDITOR.dialogCommand("checkspell")).modes={wysiwyg:!CKEDITOR.env.opera&&!CKEDITOR.env.air&&document.domain==window.location.hostname};"undefined"==typeof a.plugins.scayt&&a.ui.addButton&&a.ui.addButton("SpellChecker",{label:a.lang.wsc.toolbar,command:"checkspell",toolbar:"spellchecker,10"});CKEDITOR.dialog.add("checkspell",this.path+"dialogs/wsc.js")}});
874
- CKEDITOR.config.wsc_customerId=CKEDITOR.config.wsc_customerId||"1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk";CKEDITOR.config.wsc_customLoaderScript=CKEDITOR.config.wsc_customLoaderScript||null;(function(){CKEDITOR.plugins.add("codemirror",{lang:"af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en-au,en-ca,en-gb,en,eo,es,et,eu,fa,fi,fo,fr-ca,fr,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt-br,pt,ro,ru,sk,sl,sr-latn,sr,sv,th,tr,ug,uk,vi,zh-cn,zh",init:function(c){function f(b){function c(){return{from:window["codemirror_"+b.id].getCursor(!0),to:window["codemirror_"+b.id].getCursor(!1)}}var a=b.ui.space("contents").getDocument().createElement("textarea");a.setStyles(CKEDITOR.tools.extend({width:CKEDITOR.env.ie7Compat?
875
- "99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",b.config.sourceAreaTabSize||4)));var d=[b.lang.editor,b.name].join();a.setAttributes({dir:"ltr",tabIndex:CKEDITOR.env.webkit?-1:b.tabIndex,role:"textbox","aria-label":d});a.addClass("cke_source cke_reset cke_enable_context_menu");b.ui.space("contents").append(a);window["editable_"+b.id]=b.editable(new e(b,a));window["editable_"+b.id].setData(b.getData(1));window["editable_"+b.id].editorID=
876
- b.id;b.fire("ariaWidget",this);var f,a=window["editable_"+b.id],g=a.getParent(),d=g.$.clientHeight+"px",g=g.$.clientWidth+"px";codemirror=b.id;window["codemirror_"+b.id]=CodeMirror.fromTextArea(a.$,{mode:"text/html",matchBrackets:!0,workDelay:300,workTime:35,lineNumbers:!0,lineWrapping:!0,theme:h,onKeyEvent:function(b,a){if("keydown"==a.type&&a.ctrlKey&&75==a.keyCode&&!a.shiftKey){var d=c();b.commentRange(!0,d.from,d.to)}else"keydown"==a.type&&a.ctrlKey&&75==a.keyCode&&a.shiftKey?(d=c(),b.commentRange(!1,
877
- d.from,d.to)):"keydown"==a.type&&(a.ctrlKey&&70==a.keyCode&&a.shiftKey)&&(d=c(),b.autoFormatRange(d.from,d.to,!1))}});i&&window["codemirror_"+b.id].autoFormatRange({line:0,ch:0},{line:window["codemirror_"+b.id].lineCount(),ch:0},!0);window["codemirror_"+b.id].on("change",function(){clearTimeout(f);f=setTimeout(function(){window["codemirror_"+b.id].save()},300)});window["codemirror_"+b.id].setSize(g,d)}var a=this.path,d=c.config,h=null!=d.codemirror_theme?d.codemirror_theme:"default",i=null!=d.codemirror_autoFormatOnStart?
878
- d.codemirror_autoFormatOnStart:!0;CKEDITOR.document.appendStyleSheet(a+"css/codemirror.css");h.length&&"default"!=h&&CKEDITOR.document.appendStyleSheet(a+"theme/"+h+".css");CKEDITOR.scriptLoader.load(a+"js/codemirror.js",function(){CKEDITOR.scriptLoader.load([a+"js/xml.js",a+"js/javascript.js",a+"js/css.js",a+"js/htmlmixed.js",a+"js/addon/format/formatting.js"])});c.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&(d=CKEDITOR.plugins.sourcearea,c.addMode("source",function(b){"undefined"==typeof CodeMirror?
879
- CKEDITOR.scriptLoader.load([a+"js/codemirror.js",a+"js/xml.js",a+"js/javascript.js",a+"js/css.js",a+"js/htmlmixed.js",a+"js/addon/format/formatting.js"],function(){f(c);b()}):(f(c),b())}),c.addCommand("source",d.commands.source),c.ui.addButton&&c.ui.addButton("Source",{label:c.lang.codemirror.toolbar,command:"source",toolbar:"mode,10"}),c.on("mode",function(){c.getCommand("source").setState("source"==c.mode?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)}),c.on("resize",function(){if(window["editable_"+
880
- c.id]&&"source"==c.mode){var a=window["editable_"+c.id].getParent();window["codemirror_"+c.id].setSize(a.$.clientWidth+"px",a.$.clientHeight+"px")}}))}});var e=CKEDITOR.tools.createClass({base:CKEDITOR.editable,proto:{setData:function(c){this.setValue(c);this.editor.fire("dataReady")},getData:function(){return this.getValue()},insertHtml:function(){},insertElement:function(){},insertText:function(){},setReadOnly:function(c){this[(c?"set":"remove")+"Attribute"]("readOnly","readonly")},editorID:null,
881
- detach:function(){window["codemirror_"+this.editorID].toTextArea();e.baseProto.detach.call(this);this.clearCustomData();this.remove()}}})})();CKEDITOR.plugins.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:!1,readOnly:1,exec:function(e){"wysiwyg"==e.mode&&e.fire("saveSnapshot");e.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);e.setMode("source"==e.mode?"wysiwyg":"source")},canUndo:!1}}};CKEDITOR.plugins.add("iframedialog",{requires:"dialog",onLoad:function(){CKEDITOR.dialog.addIframe=function(e,d,a,j,f,l,g){a={type:"iframe",src:a,width:"100%",height:"100%"};a.onContentLoad="function"==typeof l?l:function(){var a=this.getElement().$.contentWindow;if(a.onDialogEvent){var b=this.getDialog(),c=function(b){return a.onDialogEvent(b)};b.on("ok",c);b.on("cancel",c);b.on("resize",c);b.on("hide",function(a){b.removeListener("ok",c);b.removeListener("cancel",c);b.removeListener("resize",c);
874
+ CKEDITOR.config.wsc_customerId=CKEDITOR.config.wsc_customerId||"1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk";CKEDITOR.config.wsc_customLoaderScript=CKEDITOR.config.wsc_customLoaderScript||null;(function(){CKEDITOR.plugins.add("codemirror",{icons:"AutoFormat,CommentSelectedRange,UncommentSelectedRange",lang:"af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en-au,en-ca,en-gb,en,eo,es,et,eu,fa,fi,fo,fr-ca,fr,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt-br,pt,ro,ru,sk,sl,sr-latn,sr,sv,th,tr,ug,uk,vi,zh-cn,zh",init:function(b){function c(){var a=[f+"js/codemirror.modes.min.js",f+"js/codemirror.addons.min.js"];d.enableSearchTools&&a.push(f+"js/codemirror.search-addons.min.js");return a}
875
+ function j(a){function b(){return{from:window["codemirror_"+a.id].getCursor(!0),to:window["codemirror_"+a.id].getCursor(!1)}}var g=a.ui.space("contents").getDocument().createElement("textarea");g.setStyles(CKEDITOR.tools.extend({width:CKEDITOR.env.ie7Compat?"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",a.config.sourceAreaTabSize||4)));var c=[a.lang.editor,a.name].join();g.setAttributes({dir:"ltr",tabIndex:CKEDITOR.env.webkit?
876
+ -1:a.tabIndex,role:"textbox","aria-label":c});g.addClass("cke_source cke_reset cke_enable_context_menu");a.ui.space("contents").append(g);window["editable_"+a.id]=a.editable(new e(a,g));window["editable_"+a.id].setData(a.getData(1));window["editable_"+a.id].editorID=a.id;a.fire("ariaWidget",this);var f,c=window["editable_"+a.id],g=c.getParent();codemirror=a.id;window["codemirror_"+a.id]=CodeMirror.fromTextArea(c.$,{mode:"text/html",matchBrackets:d.matchBrackets,workDelay:300,workTime:35,lineNumbers:d.lineNumbers,
877
+ lineWrapping:d.lineWrapping,autoCloseTags:d.autoCloseTags,autoCloseBrackets:d.autoCloseBrackets,highlightSelectionMatches:d.highlightMatches,theme:d.theme,onKeyEvent:function(e,c){if(d.enableCodeFormatting)if("keydown"==c.type&&c.ctrlKey&&75==c.keyCode&&!c.shiftKey&&!c.altKey){var f=b();window["codemirror_"+a.id].commentRange(!0,f.from,f.to)}else"keydown"==c.type&&c.ctrlKey&&75==c.keyCode&&c.shiftKey&&!c.altKey?(f=b(),window["codemirror_"+a.id].commentRange(!1,f.from,f.to),d.autoFormatOnUncomment&&
878
+ window["codemirror_"+a.id].autoFormatRange(f.from,f.to)):"keydown"==c.type&&(c.ctrlKey&&75==c.keyCode&&!c.shiftKey&&c.altKey)&&window["codemirror_"+a.id].autoFormatRange(f.from,f.to)}});c=g.$.clientHeight+"px";g=g.$.clientWidth+"px";window["codemirror_"+a.id].config=d;d.autoFormatOnStart&&window["codemirror_"+a.id].autoFormatAll({line:0,ch:0},{line:window["codemirror_"+a.id].lineCount(),ch:0});window["codemirror_"+a.id].on("change",function(){clearTimeout(f);f=setTimeout(function(){window["codemirror_"+
879
+ a.id].save()},300)});window["codemirror_"+a.id].setSize(g,c);if(d.lineNumbers&&d.enableCodeFolding)window["codemirror_"+a.id].on("gutterClick",CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder));d.highlightActiveLine&&(window["codemirror_"+a.id].hlLine=window["codemirror_"+a.id].addLineClass(0,"background","activeline"),window["codemirror_"+a.id].on("cursorActivity",function(){var b=window["codemirror_"+a.id].getLineHandle(window["codemirror_"+a.id].getCursor().line);b!=window["codemirror_"+a.id].hlLine&&
880
+ (window["codemirror_"+a.id].removeLineClass(window["codemirror_"+a.id].hlLine,"background","activeline"),window["codemirror_"+a.id].hlLine=window["codemirror_"+a.id].addLineClass(b,"background","activeline"))}))}var f=this.path,d=CKEDITOR.tools.extend({theme:"default",matchBrackets:!0,lineNumbers:!0,lineWrapping:!0,autoCloseTags:!0,autoCloseBrackets:!0,enableSearchTools:!0,enableCodeFolding:!0,enableCodeFormatting:!0,autoFormatOnStart:!1,autoFormatOnModeChange:!0,autoFormatOnUncomment:!0,highlightActiveLine:!0,
881
+ highlightMatches:!0,showFormatButton:!0,showCommentButton:!0,showUncommentButton:!0},b.config.codemirror||{},!0),i=b.lang.codemirror;b.config.codemirror_theme&&(d.theme=b.config.codemirror_theme);b.config.codemirror_autoFormatOnStart&&(d.autoFormatOnStart=b.config.codemirror_autoFormatOnStart);CKEDITOR.document.appendStyleSheet(f+"css/codemirror.min.css");d.theme.length&&"default"!=d.theme&&CKEDITOR.document.appendStyleSheet(f+"theme/"+d.theme+".css");CKEDITOR.scriptLoader.load(f+"js/codemirror.min.js",
882
+ function(){CKEDITOR.scriptLoader.load(c())});if(b.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var h=CKEDITOR.plugins.sourcearea;b.addMode("source",function(a){if(typeof CodeMirror=="undefined")CKEDITOR.scriptLoader.load([f+"js/codemirror.min.js"].concat(c()),function(){j(b);a()});else{j(b);a()}});b.addCommand("source",h.commands.source);b.ui.addButton&&b.ui.addButton("Source",{label:b.lang.codemirror.toolbar,command:"source",toolbar:"mode,10"});d.enableCodeFormatting&&(b.addCommand("autoFormat",h.commands.autoFormat),
883
+ b.addCommand("commentSelectedRange",h.commands.commentSelectedRange),b.addCommand("uncommentSelectedRange",h.commands.uncommentSelectedRange),b.ui.addButton&&(d.showFormatButton&&b.ui.addButton("autoFormat",{label:i.autoFormat,command:"autoFormat",toolbar:"mode,20"}),d.showCommentButton&&b.ui.addButton("CommentSelectedRange",{label:i.commentSelectedRange,command:"commentSelectedRange",toolbar:"mode,30"}),d.showUncommentButton&&b.ui.addButton("UncommentSelectedRange",{label:i.uncommentSelectedRange,
884
+ command:"uncommentSelectedRange",toolbar:"mode,40"})));b.on("mode",function(){b.getCommand("source").setState(b.mode=="source"?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)});b.on("resize",function(){if(window["editable_"+b.id]&&b.mode=="source"){var a=window["editable_"+b.id].getParent();window["codemirror_"+b.id].setSize(a.$.clientWidth+"px",a.$.clientHeight+"px")}})}}});var e=CKEDITOR.tools.createClass({base:CKEDITOR.editable,proto:{setData:function(b){this.setValue(b);this.editor.fire("dataReady")},
885
+ getData:function(){return this.getValue()},insertHtml:function(){},insertElement:function(){},insertText:function(){},setReadOnly:function(b){this[(b?"set":"remove")+"Attribute"]("readOnly","readonly")},editorID:null,detach:function(){window["codemirror_"+this.editorID].toTextArea();e.baseProto.detach.call(this);this.clearCustomData();this.remove()}}})})();
886
+ CKEDITOR.plugins.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:!1,readOnly:1,exec:function(e){"wysiwyg"==e.mode&&e.fire("saveSnapshot");e.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);e.setMode("source"==e.mode?"wysiwyg":"source")},canUndo:!1},autoFormat:{modes:{wysiwyg:0,source:1},editorFocus:!1,readOnly:1,exec:function(e){var b=window["codemirror_"+e.id].getCursor(!0),c=window["codemirror_"+e.id].getCursor(!1);window["codemirror_"+e.id].autoFormatRange(b,c)},canUndo:!0},
887
+ commentSelectedRange:{modes:{wysiwyg:0,source:1},editorFocus:!1,readOnly:1,exec:function(e){var b=window["codemirror_"+e.id].getCursor(!0),c=window["codemirror_"+e.id].getCursor(!1);window["codemirror_"+e.id].commentRange(!0,b,c)},canUndo:!0},uncommentSelectedRange:{modes:{wysiwyg:0,source:1},editorFocus:!1,readOnly:1,exec:function(e){var b=window["codemirror_"+e.id].getCursor(!0),c=window["codemirror_"+e.id].getCursor(!1);window["codemirror_"+e.id].commentRange(!1,b,c);window["codemirror_"+e.id].config.autoFormatOnUncomment&&
888
+ window["codemirror_"+e.id].autoFormatRange(b,c)},canUndo:!0}}};CKEDITOR.plugins.add("iframedialog",{requires:"dialog",onLoad:function(){CKEDITOR.dialog.addIframe=function(e,d,a,j,f,l,g){a={type:"iframe",src:a,width:"100%",height:"100%"};a.onContentLoad="function"==typeof l?l:function(){var a=this.getElement().$.contentWindow;if(a.onDialogEvent){var b=this.getDialog(),c=function(b){return a.onDialogEvent(b)};b.on("ok",c);b.on("cancel",c);b.on("resize",c);b.on("hide",function(a){b.removeListener("ok",c);b.removeListener("cancel",c);b.removeListener("resize",c);
882
889
  a.removeListener()});a.onDialogEvent({name:"load",sender:this,editor:b._.editor})}};var h={title:d,minWidth:j,minHeight:f,contents:[{id:"iframe",label:d,expand:!0,elements:[a]}]},i;for(i in g)h[i]=g[i];this.add(e,function(){return h})};(function(){var e=function(d,a,j){if(!(3>arguments.length)){var f=this._||(this._={}),e=a.onContentLoad&&CKEDITOR.tools.bind(a.onContentLoad,this),g=CKEDITOR.tools.cssLength(a.width),h=CKEDITOR.tools.cssLength(a.height);f.frameId=CKEDITOR.tools.getNextId()+"_iframe";
883
890
  d.on("load",function(){CKEDITOR.document.getById(f.frameId).getParent().setStyles({width:g,height:h})});var i={src:"%2",id:f.frameId,frameborder:0,allowtransparency:!0},k=[];"function"==typeof a.onContentLoad&&(i.onload="CKEDITOR.tools.callFunction(%1);");CKEDITOR.ui.dialog.uiElement.call(this,d,a,k,"iframe",{width:g,height:h},i,"");j.push('<div style="width:'+g+";height:"+h+';" id="'+this.domId+'"></div>');k=k.join("");d.on("show",function(){var b=CKEDITOR.document.getById(f.frameId).getParent(),
884
891
  c=CKEDITOR.tools.addFunction(e),c=k.replace("%1",c).replace("%2",CKEDITOR.tools.htmlEncode(a.src));b.setHtml(c)})}};e.prototype=new CKEDITOR.ui.dialog.uiElement;CKEDITOR.dialog.addUIElement("iframe",{build:function(d,a,j){return new e(d,a,j)}})})()}});(function(){function i(b,h,d){var e=[],g=[],a;for(a=0;a<b.styleSheets.length;a++){var c=b.styleSheets[a];if(!(c.ownerNode||c.owningElement).getAttribute("data-cke-temp")&&!(c.href&&"chrome://"==c.href.substr(0,9)))try{for(var f=c.cssRules||c.rules,c=0;c<f.length;c++)g.push(f[c].selectorText)}catch(i){}}a=g.join(" ");a=a.replace(/(,|>|\+|~)/g," ");a=a.replace(/\[[^\]]*/g,"");a=a.replace(/#[^\s]*/g,"");a=a.replace(/\:{1,2}[^\s]*/g,"");a=a.replace(/\s+/g," ");a=a.split(" ");b=[];for(g=0;g<a.length;g++)f=
885
892
  a[g],d.test(f)&&!h.test(f)&&-1==CKEDITOR.tools.indexOf(b,f)&&b.push(f);for(a=0;a<b.length;a++)d=b[a].split("."),h=d[0].toLowerCase(),d=d[1],e.push({name:h+"."+d,element:h,attributes:{"class":d}});return e}CKEDITOR.plugins.add("stylesheetparser",{onLoad:function(){var b=CKEDITOR.editor.prototype;b.getStylesSet=CKEDITOR.tools.override(b.getStylesSet,function(b){return function(d){var e=this;b.call(this,function(b){d(e._.stylesDefinitions=b.concat(i(e.document.$,e.config.stylesheetParser_skipSelectors||
886
- /(^body\.|^\.)/i,e.config.stylesheetParser_validSelectors||/\w+\.\w+/)))})}})}})})();(function(){function h(a){var a=a.document,c=a.getBody(),d=a.getDocumentElement();return"BackCompat"==a.$.compatMode?c:d}var g=function(a){if(a.window){var c=a.getCommand("maximize");if(!(c&&c.state==CKEDITOR.TRISTATE_ON)){var c=h(a),d=a.window.getViewPaneSize().height,b;b=c.getStyle("overflow-y");var f=c.getDocument(),e=CKEDITOR.dom.element.createFromHtml('<span style="margin:0;padding:0;border:0;clear:both;width:1px;height:1px;display:block;">'+(CKEDITOR.env.webkit?"&nbsp;":"")+"</span>",f);f[CKEDITOR.env.ie?
887
- "getBody":"getDocumentElement"]().append(e);f=e.getDocumentPosition(f).y+e.$.offsetHeight;e.remove();c.setStyle("overflow-y",b);b=f+(a.config.autoGrow_bottomSpace||0);e=a.config.autoGrow_maxHeight||Infinity;b=Math.max(b,void 0!=a.config.autoGrow_minHeight?a.config.autoGrow_minHeight:200);b=Math.min(b,e);b!=d&&(b=a.fire("autoGrow",{currentHeight:d,newHeight:b}).newHeight,a.resize(a.container.getStyle("width"),b,!0));c.$.scrollHeight>c.$.clientHeight&&b<e?c.setStyle("overflow-y","hidden"):c.removeStyle("overflow-y")}}};
888
- CKEDITOR.plugins.add("autogrow",{init:function(a){if(a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE)a.on("instanceReady",function(){if(a.editable().isInline())a.ui.space("contents").setStyle("height","auto");else{a.addCommand("autogrow",{exec:g,modes:{wysiwyg:1},readOnly:1,canUndo:!1,editorFocus:!1});var c={contentDom:1,key:1,selectionChange:1,insertElement:1,mode:1},d;for(d in c)a.on(d,function(a){"wysiwyg"==a.editor.mode&&setTimeout(function(){g(a.editor);g(a.editor)},100)});a.on("afterCommandExec",
889
- function(b){"maximize"==b.data.name&&"wysiwyg"==b.editor.mode&&(b.data.command.state==CKEDITOR.TRISTATE_ON?h(a).removeStyle("overflow"):g(a))});a.config.autoGrow_onStartup&&a.execCommand("autogrow")}})}})})();CKEDITOR.plugins.add("divarea",{afterInit:function(a){a.addMode("wysiwyg",function(c){var b=CKEDITOR.dom.element.createFromHtml('<div class="cke_wysiwyg_div cke_reset" hidefocus="true"></div>');a.ui.space("contents").append(b);b=a.editable(b);b.detach=CKEDITOR.tools.override(b.detach,function(a){return function(){a.apply(this,arguments);this.remove()}});a.setData(a.getData(1),c);a.fire("contentDom")})}});CKEDITOR.config.plugins='dialogui,dialog,about,a11yhelp,dialogadvtab,basicstyles,bidi,blockquote,clipboard,button,panelbutton,panel,floatpanel,colorbutton,colordialog,templates,menu,contextmenu,div,resize,toolbar,elementspath,list,indent,enterkey,entities,popup,filebrowser,find,fakeobjects,flash,floatingspace,listblock,richcombo,font,forms,format,htmlwriter,horizontalrule,iframe,wysiwygarea,image,smiley,justify,link,liststyle,magicline,maximize,newpage,pagebreak,pastetext,pastefromword,preview,print,removeformat,save,selectall,showblocks,showborders,sourcearea,specialchar,menubutton,scayt,stylescombo,tab,table,tabletools,undo,wsc,codemirror,iframedialog,stylesheetparser,autogrow,divarea';CKEDITOR.config.skin='moono';(function() {var icons = ( 'about,0,bold,32,italic,64,strike,96,subscript,128,superscript,160,underline,192,bidiltr,224,bidirtl,256,blockquote,288,copy-rtl,320,copy,352,cut-rtl,384,cut,416,paste-rtl,448,paste,480,bgcolor,512,textcolor,544,templates-rtl,576,templates,608,creatediv,640,bulletedlist-rtl,672,bulletedlist,704,numberedlist-rtl,736,numberedlist,768,indent-rtl,800,indent,832,outdent-rtl,864,outdent,896,find-rtl,928,find,960,replace,992,flash,1024,button,1056,checkbox,1088,form,1120,hiddenfield,1152,imagebutton,1184,radio,1216,select-rtl,1248,select,1280,textarea-rtl,1312,textarea,1344,textfield-rtl,1376,textfield,1408,horizontalrule,1440,iframe,1472,image,1504,smiley,1536,justifyblock,1568,justifycenter,1600,justifyleft,1632,justifyright,1664,anchor-rtl,1696,anchor,1728,link,1760,unlink,1792,maximize,1824,newpage-rtl,1856,newpage,1888,pagebreak-rtl,1920,pagebreak,1952,pastetext-rtl,1984,pastetext,2016,pastefromword-rtl,2048,pastefromword,2080,preview-rtl,2112,preview,2144,print,2176,removeformat,2208,save,2240,selectall,2272,showblocks-rtl,2304,showblocks,2336,source-rtl,2368,source,2400,specialchar,2432,scayt,2464,table,2496,redo-rtl,2528,redo,2560,undo-rtl,2592,undo,2624,spellchecker,2656' ),path = CKEDITOR.getUrl( 'plugins/icons.png' ),icons = icons.split( ',' );for ( var i = 0; i < icons.length; i++ )CKEDITOR.skin.icons[ icons[ i ] ] = { path: path, offset: -icons[ ++i ] };})();CKEDITOR.lang.languages={"en":1};}());
893
+ /(^body\.|^\.)/i,e.config.stylesheetParser_validSelectors||/\w+\.\w+/)))})}})}})})();CKEDITOR.config.plugins='dialogui,dialog,about,a11yhelp,dialogadvtab,basicstyles,bidi,blockquote,clipboard,button,panelbutton,panel,floatpanel,colorbutton,colordialog,templates,menu,contextmenu,div,resize,toolbar,elementspath,list,indent,enterkey,entities,popup,filebrowser,find,fakeobjects,flash,floatingspace,listblock,richcombo,font,forms,format,htmlwriter,horizontalrule,iframe,wysiwygarea,image,smiley,justify,link,liststyle,magicline,maximize,newpage,pagebreak,pastetext,pastefromword,preview,print,removeformat,save,selectall,showblocks,showborders,sourcearea,specialchar,menubutton,scayt,stylescombo,tab,table,tabletools,undo,wsc,codemirror,iframedialog,stylesheetparser';CKEDITOR.config.skin='moono';(function() {var icons = ( 'about,0,bold,32,italic,64,strike,96,subscript,128,superscript,160,underline,192,bidiltr,224,bidirtl,256,blockquote,288,copy-rtl,320,copy,352,cut-rtl,384,cut,416,paste-rtl,448,paste,480,bgcolor,512,textcolor,544,templates-rtl,576,templates,608,creatediv,640,bulletedlist-rtl,672,bulletedlist,704,numberedlist-rtl,736,numberedlist,768,indent-rtl,800,indent,832,outdent-rtl,864,outdent,896,find-rtl,928,find,960,replace,992,flash,1024,button,1056,checkbox,1088,form,1120,hiddenfield,1152,imagebutton,1184,radio,1216,select-rtl,1248,select,1280,textarea-rtl,1312,textarea,1344,textfield-rtl,1376,textfield,1408,horizontalrule,1440,iframe,1472,image,1504,smiley,1536,justifyblock,1568,justifycenter,1600,justifyleft,1632,justifyright,1664,anchor-rtl,1696,anchor,1728,link,1760,unlink,1792,maximize,1824,newpage-rtl,1856,newpage,1888,pagebreak-rtl,1920,pagebreak,1952,pastetext-rtl,1984,pastetext,2016,pastefromword-rtl,2048,pastefromword,2080,preview-rtl,2112,preview,2144,print,2176,removeformat,2208,save,2240,selectall,2272,showblocks-rtl,2304,showblocks,2336,source-rtl,2368,source,2400,specialchar,2432,scayt,2464,table,2496,redo-rtl,2528,redo,2560,undo-rtl,2592,undo,2624,spellchecker,2656,AutoFormat,2688,CommentSelectedRange,2720,UncommentSelectedRange,2752' ),path = CKEDITOR.getUrl( 'plugins/icons.png' ),icons = icons.split( ',' );for ( var i = 0; i < icons.length; i++ )CKEDITOR.skin.icons[ icons[ i ] ] = { path: path, offset: -icons[ ++i ] };})();CKEDITOR.lang.languages={"en":1};}());
@@ -2,4 +2,4 @@
2
2
  Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
3
3
  For licensing, see LICENSE.html or http://ckeditor.com/license
4
4
  */
5
- CKEDITOR.lang['en']={"dir":"ltr","editor":"Rich Text Editor","common":{"editorHelp":"Press ALT 0 for help","browseServer":"Browse Server","url":"URL","protocol":"Protocol","upload":"Upload","uploadSubmit":"Send it to the Server","image":"Image","flash":"Flash","form":"Form","checkbox":"Checkbox","radio":"Radio Button","textField":"Text Field","textarea":"Textarea","hiddenField":"Hidden Field","button":"Button","select":"Selection Field","imageButton":"Image Button","notSet":"<not set>","id":"Id","name":"Name","langDir":"Language Direction","langDirLtr":"Left to Right (LTR)","langDirRtl":"Right to Left (RTL)","langCode":"Language Code","longDescr":"Long Description URL","cssClass":"Stylesheet Classes","advisoryTitle":"Advisory Title","cssStyle":"Style","ok":"OK","cancel":"Cancel","close":"Close","preview":"Preview","resize":"Resize","generalTab":"General","advancedTab":"Advanced","validateNumberFailed":"This value is not a number.","confirmNewPage":"Any unsaved changes to this content will be lost. Are you sure you want to load new page?","confirmCancel":"Some of the options have been changed. Are you sure to close the dialog?","options":"Options","target":"Target","targetNew":"New Window (_blank)","targetTop":"Topmost Window (_top)","targetSelf":"Same Window (_self)","targetParent":"Parent Window (_parent)","langDirLTR":"Left to Right (LTR)","langDirRTL":"Right to Left (RTL)","styles":"Style","cssClasses":"Stylesheet Classes","width":"Width","height":"Height","align":"Alignment","alignLeft":"Left","alignRight":"Right","alignCenter":"Center","alignTop":"Top","alignMiddle":"Middle","alignBottom":"Bottom","invalidValue":"Invalid value.","invalidHeight":"Height must be a number.","invalidWidth":"Width must be a number.","invalidCssLength":"Value specified for the \"%1\" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).","invalidHtmlLength":"Value specified for the \"%1\" field must be a positive number with or without a valid HTML measurement unit (px or %).","invalidInlineStyle":"Value specified for the inline style must consist of one or more tuples with the format of \"name : value\", separated by semi-colons.","cssLengthTooltip":"Enter a number for a value in pixels or a number with a valid CSS unit (px, %, in, cm, mm, em, ex, pt, or pc).","unavailable":"%1<span class=\"cke_accessibility\">, unavailable</span>"},"about":{"copy":"Copyright &copy; $1. All rights reserved.","dlgTitle":"About CKEditor","help":"Check $1 for help.","moreInfo":"For licensing information please visit our web site:","title":"About CKEditor","userGuide":"CKEditor User's Guide"},"basicstyles":{"bold":"Bold","italic":"Italic","strike":"Strike Through","subscript":"Subscript","superscript":"Superscript","underline":"Underline"},"bidi":{"ltr":"Text direction from left to right","rtl":"Text direction from right to left"},"blockquote":{"toolbar":"Block Quote"},"clipboard":{"copy":"Copy","copyError":"Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl/Cmd+C).","cut":"Cut","cutError":"Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl/Cmd+X).","paste":"Paste","pasteArea":"Paste Area","pasteMsg":"Please paste inside the following box using the keyboard (<strong>Ctrl/Cmd+V</strong>) and hit OK","securityMsg":"Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.","title":"Paste"},"colorbutton":{"auto":"Automatic","bgColorTitle":"Background Color","colors":{"000":"Black","800000":"Maroon","8B4513":"Saddle Brown","2F4F4F":"Dark Slate Gray","008080":"Teal","000080":"Navy","4B0082":"Indigo","696969":"Dark Gray","B22222":"Fire Brick","A52A2A":"Brown","DAA520":"Golden Rod","006400":"Dark Green","40E0D0":"Turquoise","0000CD":"Medium Blue","800080":"Purple","808080":"Gray","F00":"Red","FF8C00":"Dark Orange","FFD700":"Gold","008000":"Green","0FF":"Cyan","00F":"Blue","EE82EE":"Violet","A9A9A9":"Dim Gray","FFA07A":"Light Salmon","FFA500":"Orange","FFFF00":"Yellow","00FF00":"Lime","AFEEEE":"Pale Turquoise","ADD8E6":"Light Blue","DDA0DD":"Plum","D3D3D3":"Light Grey","FFF0F5":"Lavender Blush","FAEBD7":"Antique White","FFFFE0":"Light Yellow","F0FFF0":"Honeydew","F0FFFF":"Azure","F0F8FF":"Alice Blue","E6E6FA":"Lavender","FFF":"White"},"more":"More Colors...","panelTitle":"Colors","textColorTitle":"Text Color"},"colordialog":{"clear":"Clear","highlight":"Highlight","options":"Color Options","selected":"Selected Color","title":"Select color"},"templates":{"button":"Templates","emptyListMsg":"(No templates defined)","insertOption":"Replace actual contents","options":"Template Options","selectPromptMsg":"Please select the template to open in the editor","title":"Content Templates"},"contextmenu":{"options":"Context Menu Options"},"div":{"IdInputLabel":"Id","advisoryTitleInputLabel":"Advisory Title","cssClassInputLabel":"Stylesheet Classes","edit":"Edit Div","inlineStyleInputLabel":"Inline Style","langDirLTRLabel":"Left to Right (LTR)","langDirLabel":"Language Direction","langDirRTLLabel":"Right to Left (RTL)","languageCodeInputLabel":" Language Code","remove":"Remove Div","styleSelectLabel":"Style","title":"Create Div Container","toolbar":"Create Div Container"},"toolbar":{"toolbarCollapse":"Collapse Toolbar","toolbarExpand":"Expand Toolbar","toolbarGroups":{"document":"Document","clipboard":"Clipboard/Undo","editing":"Editing","forms":"Forms","basicstyles":"Basic Styles","paragraph":"Paragraph","links":"Links","insert":"Insert","styles":"Styles","colors":"Colors","tools":"Tools"},"toolbars":"Editor toolbars"},"elementspath":{"eleLabel":"Elements path","eleTitle":"%1 element"},"list":{"bulletedlist":"Insert/Remove Bulleted List","numberedlist":"Insert/Remove Numbered List"},"indent":{"indent":"Increase Indent","outdent":"Decrease Indent"},"find":{"find":"Find","findOptions":"Find Options","findWhat":"Find what:","matchCase":"Match case","matchCyclic":"Match cyclic","matchWord":"Match whole word","notFoundMsg":"The specified text was not found.","replace":"Replace","replaceAll":"Replace All","replaceSuccessMsg":"%1 occurrence(s) replaced.","replaceWith":"Replace with:","title":"Find and Replace"},"fakeobjects":{"anchor":"Anchor","flash":"Flash Animation","hiddenfield":"Hidden Field","iframe":"IFrame","unknown":"Unknown Object"},"flash":{"access":"Script Access","accessAlways":"Always","accessNever":"Never","accessSameDomain":"Same domain","alignAbsBottom":"Abs Bottom","alignAbsMiddle":"Abs Middle","alignBaseline":"Baseline","alignTextTop":"Text Top","bgcolor":"Background color","chkFull":"Allow Fullscreen","chkLoop":"Loop","chkMenu":"Enable Flash Menu","chkPlay":"Auto Play","flashvars":"Variables for Flash","hSpace":"HSpace","properties":"Flash Properties","propertiesTab":"Properties","quality":"Quality","qualityAutoHigh":"Auto High","qualityAutoLow":"Auto Low","qualityBest":"Best","qualityHigh":"High","qualityLow":"Low","qualityMedium":"Medium","scale":"Scale","scaleAll":"Show all","scaleFit":"Exact Fit","scaleNoBorder":"No Border","title":"Flash Properties","vSpace":"VSpace","validateHSpace":"HSpace must be a number.","validateSrc":"URL must not be empty.","validateVSpace":"VSpace must be a number.","windowMode":"Window mode","windowModeOpaque":"Opaque","windowModeTransparent":"Transparent","windowModeWindow":"Window"},"font":{"fontSize":{"label":"Size","voiceLabel":"Font Size","panelTitle":"Font Size"},"label":"Font","panelTitle":"Font Name","voiceLabel":"Font"},"forms":{"button":{"title":"Button Properties","text":"Text (Value)","type":"Type","typeBtn":"Button","typeSbm":"Submit","typeRst":"Reset"},"checkboxAndRadio":{"checkboxTitle":"Checkbox Properties","radioTitle":"Radio Button Properties","value":"Value","selected":"Selected"},"form":{"title":"Form Properties","menu":"Form Properties","action":"Action","method":"Method","encoding":"Encoding"},"hidden":{"title":"Hidden Field Properties","name":"Name","value":"Value"},"select":{"title":"Selection Field Properties","selectInfo":"Select Info","opAvail":"Available Options","value":"Value","size":"Size","lines":"lines","chkMulti":"Allow multiple selections","opText":"Text","opValue":"Value","btnAdd":"Add","btnModify":"Modify","btnUp":"Up","btnDown":"Down","btnSetValue":"Set as selected value","btnDelete":"Delete"},"textarea":{"title":"Textarea Properties","cols":"Columns","rows":"Rows"},"textfield":{"title":"Text Field Properties","name":"Name","value":"Value","charWidth":"Character Width","maxChars":"Maximum Characters","type":"Type","typeText":"Text","typePass":"Password","typeEmail":"Email","typeSearch":"Search","typeTel":"Telephone Number","typeUrl":"URL"}},"format":{"label":"Format","panelTitle":"Paragraph Format","tag_address":"Address","tag_div":"Normal (DIV)","tag_h1":"Heading 1","tag_h2":"Heading 2","tag_h3":"Heading 3","tag_h4":"Heading 4","tag_h5":"Heading 5","tag_h6":"Heading 6","tag_p":"Normal","tag_pre":"Formatted"},"horizontalrule":{"toolbar":"Insert Horizontal Line"},"iframe":{"border":"Show frame border","noUrl":"Please type the iframe URL","scrolling":"Enable scrollbars","title":"IFrame Properties","toolbar":"IFrame"},"image":{"alertUrl":"Please type the image URL","alt":"Alternative Text","border":"Border","btnUpload":"Send it to the Server","button2Img":"Do you want to transform the selected image button on a simple image?","hSpace":"HSpace","img2Button":"Do you want to transform the selected image on a image button?","infoTab":"Image Info","linkTab":"Link","lockRatio":"Lock Ratio","menu":"Image Properties","resetSize":"Reset Size","title":"Image Properties","titleButton":"Image Button Properties","upload":"Upload","urlMissing":"Image source URL is missing.","vSpace":"VSpace","validateBorder":"Border must be a whole number.","validateHSpace":"HSpace must be a whole number.","validateVSpace":"VSpace must be a whole number."},"smiley":{"options":"Smiley Options","title":"Insert a Smiley","toolbar":"Smiley"},"justify":{"block":"Justify","center":"Center","left":"Align Left","right":"Align Right"},"link":{"acccessKey":"Access Key","advanced":"Advanced","advisoryContentType":"Advisory Content Type","advisoryTitle":"Advisory Title","anchor":{"toolbar":"Anchor","menu":"Edit Anchor","title":"Anchor Properties","name":"Anchor Name","errorName":"Please type the anchor name","remove":"Remove Anchor"},"anchorId":"By Element Id","anchorName":"By Anchor Name","charset":"Linked Resource Charset","cssClasses":"Stylesheet Classes","emailAddress":"E-Mail Address","emailBody":"Message Body","emailSubject":"Message Subject","id":"Id","info":"Link Info","langCode":"Language Code","langDir":"Language Direction","langDirLTR":"Left to Right (LTR)","langDirRTL":"Right to Left (RTL)","menu":"Edit Link","name":"Name","noAnchors":"(No anchors available in the document)","noEmail":"Please type the e-mail address","noUrl":"Please type the link URL","other":"<other>","popupDependent":"Dependent (Netscape)","popupFeatures":"Popup Window Features","popupFullScreen":"Full Screen (IE)","popupLeft":"Left Position","popupLocationBar":"Location Bar","popupMenuBar":"Menu Bar","popupResizable":"Resizable","popupScrollBars":"Scroll Bars","popupStatusBar":"Status Bar","popupToolbar":"Toolbar","popupTop":"Top Position","rel":"Relationship","selectAnchor":"Select an Anchor","styles":"Style","tabIndex":"Tab Index","target":"Target","targetFrame":"<frame>","targetFrameName":"Target Frame Name","targetPopup":"<popup window>","targetPopupName":"Popup Window Name","title":"Link","toAnchor":"Link to anchor in the text","toEmail":"E-mail","toUrl":"URL","toolbar":"Link","type":"Link Type","unlink":"Unlink","upload":"Upload"},"liststyle":{"armenian":"Armenian numbering","bulletedTitle":"Bulleted List Properties","circle":"Circle","decimal":"Decimal (1, 2, 3, etc.)","decimalLeadingZero":"Decimal leading zero (01, 02, 03, etc.)","disc":"Disc","georgian":"Georgian numbering (an, ban, gan, etc.)","lowerAlpha":"Lower Alpha (a, b, c, d, e, etc.)","lowerGreek":"Lower Greek (alpha, beta, gamma, etc.)","lowerRoman":"Lower Roman (i, ii, iii, iv, v, etc.)","none":"None","notset":"<not set>","numberedTitle":"Numbered List Properties","square":"Square","start":"Start","type":"Type","upperAlpha":"Upper Alpha (A, B, C, D, E, etc.)","upperRoman":"Upper Roman (I, II, III, IV, V, etc.)","validateStartNumber":"List start number must be a whole number."},"magicline":{"title":"Insert paragraph here"},"maximize":{"maximize":"Maximize","minimize":"Minimize"},"newpage":{"toolbar":"New Page"},"pagebreak":{"alt":"Page Break","toolbar":"Insert Page Break for Printing"},"pastetext":{"button":"Paste as plain text","title":"Paste as Plain Text"},"pastefromword":{"confirmCleanup":"The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?","error":"It was not possible to clean up the pasted data due to an internal error","title":"Paste from Word","toolbar":"Paste from Word"},"preview":{"preview":"Preview"},"print":{"toolbar":"Print"},"removeformat":{"toolbar":"Remove Format"},"save":{"toolbar":"Save"},"selectall":{"toolbar":"Select All"},"showblocks":{"toolbar":"Show Blocks"},"sourcearea":{"toolbar":"Source"},"specialchar":{"options":"Special Character Options","title":"Select Special Character","toolbar":"Insert Special Character"},"scayt":{"about":"About SCAYT","aboutTab":"About","addWord":"Add Word","allCaps":"Ignore All-Caps Words","dic_create":"Create","dic_delete":"Delete","dic_field_name":"Dictionary name","dic_info":"Initially the User Dictionary is stored in a Cookie. However, Cookies are limited in size. When the User Dictionary grows to a point where it cannot be stored in a Cookie, then the dictionary may be stored on our server. To store your personal dictionary on our server you should specify a name for your dictionary. If you already have a stored dictionary, please type its name and click the Restore button.","dic_rename":"Rename","dic_restore":"Restore","dictionariesTab":"Dictionaries","disable":"Disable SCAYT","emptyDic":"Dictionary name should not be empty.","enable":"Enable SCAYT","ignore":"Ignore","ignoreAll":"Ignore All","ignoreDomainNames":"Ignore Domain Names","langs":"Languages","languagesTab":"Languages","mixedCase":"Ignore Words with Mixed Case","mixedWithDigits":"Ignore Words with Numbers","moreSuggestions":"More suggestions","opera_title":"Not supported by Opera","options":"Options","optionsTab":"Options","title":"Spell Check As You Type","toggle":"Toggle SCAYT","noSuggestions":"No suggestion"},"stylescombo":{"label":"Styles","panelTitle":"Formatting Styles","panelTitle1":"Block Styles","panelTitle2":"Inline Styles","panelTitle3":"Object Styles"},"table":{"border":"Border size","caption":"Caption","cell":{"menu":"Cell","insertBefore":"Insert Cell Before","insertAfter":"Insert Cell After","deleteCell":"Delete Cells","merge":"Merge Cells","mergeRight":"Merge Right","mergeDown":"Merge Down","splitHorizontal":"Split Cell Horizontally","splitVertical":"Split Cell Vertically","title":"Cell Properties","cellType":"Cell Type","rowSpan":"Rows Span","colSpan":"Columns Span","wordWrap":"Word Wrap","hAlign":"Horizontal Alignment","vAlign":"Vertical Alignment","alignBaseline":"Baseline","bgColor":"Background Color","borderColor":"Border Color","data":"Data","header":"Header","yes":"Yes","no":"No","invalidWidth":"Cell width must be a number.","invalidHeight":"Cell height must be a number.","invalidRowSpan":"Rows span must be a whole number.","invalidColSpan":"Columns span must be a whole number.","chooseColor":"Choose"},"cellPad":"Cell padding","cellSpace":"Cell spacing","column":{"menu":"Column","insertBefore":"Insert Column Before","insertAfter":"Insert Column After","deleteColumn":"Delete Columns"},"columns":"Columns","deleteTable":"Delete Table","headers":"Headers","headersBoth":"Both","headersColumn":"First column","headersNone":"None","headersRow":"First Row","invalidBorder":"Border size must be a number.","invalidCellPadding":"Cell padding must be a positive number.","invalidCellSpacing":"Cell spacing must be a positive number.","invalidCols":"Number of columns must be a number greater than 0.","invalidHeight":"Table height must be a number.","invalidRows":"Number of rows must be a number greater than 0.","invalidWidth":"Table width must be a number.","menu":"Table Properties","row":{"menu":"Row","insertBefore":"Insert Row Before","insertAfter":"Insert Row After","deleteRow":"Delete Rows"},"rows":"Rows","summary":"Summary","title":"Table Properties","toolbar":"Table","widthPc":"percent","widthPx":"pixels","widthUnit":"width unit"},"undo":{"redo":"Redo","undo":"Undo"},"wsc":{"btnIgnore":"Ignore","btnIgnoreAll":"Ignore All","btnReplace":"Replace","btnReplaceAll":"Replace All","btnUndo":"Undo","changeTo":"Change to","errorLoading":"Error loading application service host: %s.","ieSpellDownload":"Spell checker not installed. Do you want to download it now?","manyChanges":"Spell check complete: %1 words changed","noChanges":"Spell check complete: No words changed","noMispell":"Spell check complete: No misspellings found","noSuggestions":"- No suggestions -","notAvailable":"Sorry, but service is unavailable now.","notInDic":"Not in dictionary","oneChange":"Spell check complete: One word changed","progress":"Spell check in progress...","title":"Spell Check","toolbar":"Check Spelling"},"codemirror":{"toolbar":"Source"}};
5
+ CKEDITOR.lang['en']={"dir":"ltr","editor":"Rich Text Editor","common":{"editorHelp":"Press ALT 0 for help","browseServer":"Browse Server","url":"URL","protocol":"Protocol","upload":"Upload","uploadSubmit":"Send it to the Server","image":"Image","flash":"Flash","form":"Form","checkbox":"Checkbox","radio":"Radio Button","textField":"Text Field","textarea":"Textarea","hiddenField":"Hidden Field","button":"Button","select":"Selection Field","imageButton":"Image Button","notSet":"<not set>","id":"Id","name":"Name","langDir":"Language Direction","langDirLtr":"Left to Right (LTR)","langDirRtl":"Right to Left (RTL)","langCode":"Language Code","longDescr":"Long Description URL","cssClass":"Stylesheet Classes","advisoryTitle":"Advisory Title","cssStyle":"Style","ok":"OK","cancel":"Cancel","close":"Close","preview":"Preview","resize":"Resize","generalTab":"General","advancedTab":"Advanced","validateNumberFailed":"This value is not a number.","confirmNewPage":"Any unsaved changes to this content will be lost. Are you sure you want to load new page?","confirmCancel":"Some of the options have been changed. Are you sure to close the dialog?","options":"Options","target":"Target","targetNew":"New Window (_blank)","targetTop":"Topmost Window (_top)","targetSelf":"Same Window (_self)","targetParent":"Parent Window (_parent)","langDirLTR":"Left to Right (LTR)","langDirRTL":"Right to Left (RTL)","styles":"Style","cssClasses":"Stylesheet Classes","width":"Width","height":"Height","align":"Alignment","alignLeft":"Left","alignRight":"Right","alignCenter":"Center","alignTop":"Top","alignMiddle":"Middle","alignBottom":"Bottom","invalidValue":"Invalid value.","invalidHeight":"Height must be a number.","invalidWidth":"Width must be a number.","invalidCssLength":"Value specified for the \"%1\" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).","invalidHtmlLength":"Value specified for the \"%1\" field must be a positive number with or without a valid HTML measurement unit (px or %).","invalidInlineStyle":"Value specified for the inline style must consist of one or more tuples with the format of \"name : value\", separated by semi-colons.","cssLengthTooltip":"Enter a number for a value in pixels or a number with a valid CSS unit (px, %, in, cm, mm, em, ex, pt, or pc).","unavailable":"%1<span class=\"cke_accessibility\">, unavailable</span>"},"about":{"copy":"Copyright &copy; $1. All rights reserved.","dlgTitle":"About CKEditor","help":"Check $1 for help.","moreInfo":"For licensing information please visit our web site:","title":"About CKEditor","userGuide":"CKEditor User's Guide"},"basicstyles":{"bold":"Bold","italic":"Italic","strike":"Strike Through","subscript":"Subscript","superscript":"Superscript","underline":"Underline"},"bidi":{"ltr":"Text direction from left to right","rtl":"Text direction from right to left"},"blockquote":{"toolbar":"Block Quote"},"clipboard":{"copy":"Copy","copyError":"Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl/Cmd+C).","cut":"Cut","cutError":"Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl/Cmd+X).","paste":"Paste","pasteArea":"Paste Area","pasteMsg":"Please paste inside the following box using the keyboard (<strong>Ctrl/Cmd+V</strong>) and hit OK","securityMsg":"Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.","title":"Paste"},"colorbutton":{"auto":"Automatic","bgColorTitle":"Background Color","colors":{"000":"Black","800000":"Maroon","8B4513":"Saddle Brown","2F4F4F":"Dark Slate Gray","008080":"Teal","000080":"Navy","4B0082":"Indigo","696969":"Dark Gray","B22222":"Fire Brick","A52A2A":"Brown","DAA520":"Golden Rod","006400":"Dark Green","40E0D0":"Turquoise","0000CD":"Medium Blue","800080":"Purple","808080":"Gray","F00":"Red","FF8C00":"Dark Orange","FFD700":"Gold","008000":"Green","0FF":"Cyan","00F":"Blue","EE82EE":"Violet","A9A9A9":"Dim Gray","FFA07A":"Light Salmon","FFA500":"Orange","FFFF00":"Yellow","00FF00":"Lime","AFEEEE":"Pale Turquoise","ADD8E6":"Light Blue","DDA0DD":"Plum","D3D3D3":"Light Grey","FFF0F5":"Lavender Blush","FAEBD7":"Antique White","FFFFE0":"Light Yellow","F0FFF0":"Honeydew","F0FFFF":"Azure","F0F8FF":"Alice Blue","E6E6FA":"Lavender","FFF":"White"},"more":"More Colors...","panelTitle":"Colors","textColorTitle":"Text Color"},"colordialog":{"clear":"Clear","highlight":"Highlight","options":"Color Options","selected":"Selected Color","title":"Select color"},"templates":{"button":"Templates","emptyListMsg":"(No templates defined)","insertOption":"Replace actual contents","options":"Template Options","selectPromptMsg":"Please select the template to open in the editor","title":"Content Templates"},"contextmenu":{"options":"Context Menu Options"},"div":{"IdInputLabel":"Id","advisoryTitleInputLabel":"Advisory Title","cssClassInputLabel":"Stylesheet Classes","edit":"Edit Div","inlineStyleInputLabel":"Inline Style","langDirLTRLabel":"Left to Right (LTR)","langDirLabel":"Language Direction","langDirRTLLabel":"Right to Left (RTL)","languageCodeInputLabel":" Language Code","remove":"Remove Div","styleSelectLabel":"Style","title":"Create Div Container","toolbar":"Create Div Container"},"toolbar":{"toolbarCollapse":"Collapse Toolbar","toolbarExpand":"Expand Toolbar","toolbarGroups":{"document":"Document","clipboard":"Clipboard/Undo","editing":"Editing","forms":"Forms","basicstyles":"Basic Styles","paragraph":"Paragraph","links":"Links","insert":"Insert","styles":"Styles","colors":"Colors","tools":"Tools"},"toolbars":"Editor toolbars"},"elementspath":{"eleLabel":"Elements path","eleTitle":"%1 element"},"list":{"bulletedlist":"Insert/Remove Bulleted List","numberedlist":"Insert/Remove Numbered List"},"indent":{"indent":"Increase Indent","outdent":"Decrease Indent"},"find":{"find":"Find","findOptions":"Find Options","findWhat":"Find what:","matchCase":"Match case","matchCyclic":"Match cyclic","matchWord":"Match whole word","notFoundMsg":"The specified text was not found.","replace":"Replace","replaceAll":"Replace All","replaceSuccessMsg":"%1 occurrence(s) replaced.","replaceWith":"Replace with:","title":"Find and Replace"},"fakeobjects":{"anchor":"Anchor","flash":"Flash Animation","hiddenfield":"Hidden Field","iframe":"IFrame","unknown":"Unknown Object"},"flash":{"access":"Script Access","accessAlways":"Always","accessNever":"Never","accessSameDomain":"Same domain","alignAbsBottom":"Abs Bottom","alignAbsMiddle":"Abs Middle","alignBaseline":"Baseline","alignTextTop":"Text Top","bgcolor":"Background color","chkFull":"Allow Fullscreen","chkLoop":"Loop","chkMenu":"Enable Flash Menu","chkPlay":"Auto Play","flashvars":"Variables for Flash","hSpace":"HSpace","properties":"Flash Properties","propertiesTab":"Properties","quality":"Quality","qualityAutoHigh":"Auto High","qualityAutoLow":"Auto Low","qualityBest":"Best","qualityHigh":"High","qualityLow":"Low","qualityMedium":"Medium","scale":"Scale","scaleAll":"Show all","scaleFit":"Exact Fit","scaleNoBorder":"No Border","title":"Flash Properties","vSpace":"VSpace","validateHSpace":"HSpace must be a number.","validateSrc":"URL must not be empty.","validateVSpace":"VSpace must be a number.","windowMode":"Window mode","windowModeOpaque":"Opaque","windowModeTransparent":"Transparent","windowModeWindow":"Window"},"font":{"fontSize":{"label":"Size","voiceLabel":"Font Size","panelTitle":"Font Size"},"label":"Font","panelTitle":"Font Name","voiceLabel":"Font"},"forms":{"button":{"title":"Button Properties","text":"Text (Value)","type":"Type","typeBtn":"Button","typeSbm":"Submit","typeRst":"Reset"},"checkboxAndRadio":{"checkboxTitle":"Checkbox Properties","radioTitle":"Radio Button Properties","value":"Value","selected":"Selected"},"form":{"title":"Form Properties","menu":"Form Properties","action":"Action","method":"Method","encoding":"Encoding"},"hidden":{"title":"Hidden Field Properties","name":"Name","value":"Value"},"select":{"title":"Selection Field Properties","selectInfo":"Select Info","opAvail":"Available Options","value":"Value","size":"Size","lines":"lines","chkMulti":"Allow multiple selections","opText":"Text","opValue":"Value","btnAdd":"Add","btnModify":"Modify","btnUp":"Up","btnDown":"Down","btnSetValue":"Set as selected value","btnDelete":"Delete"},"textarea":{"title":"Textarea Properties","cols":"Columns","rows":"Rows"},"textfield":{"title":"Text Field Properties","name":"Name","value":"Value","charWidth":"Character Width","maxChars":"Maximum Characters","type":"Type","typeText":"Text","typePass":"Password","typeEmail":"Email","typeSearch":"Search","typeTel":"Telephone Number","typeUrl":"URL"}},"format":{"label":"Format","panelTitle":"Paragraph Format","tag_address":"Address","tag_div":"Normal (DIV)","tag_h1":"Heading 1","tag_h2":"Heading 2","tag_h3":"Heading 3","tag_h4":"Heading 4","tag_h5":"Heading 5","tag_h6":"Heading 6","tag_p":"Normal","tag_pre":"Formatted"},"horizontalrule":{"toolbar":"Insert Horizontal Line"},"iframe":{"border":"Show frame border","noUrl":"Please type the iframe URL","scrolling":"Enable scrollbars","title":"IFrame Properties","toolbar":"IFrame"},"image":{"alertUrl":"Please type the image URL","alt":"Alternative Text","border":"Border","btnUpload":"Send it to the Server","button2Img":"Do you want to transform the selected image button on a simple image?","hSpace":"HSpace","img2Button":"Do you want to transform the selected image on a image button?","infoTab":"Image Info","linkTab":"Link","lockRatio":"Lock Ratio","menu":"Image Properties","resetSize":"Reset Size","title":"Image Properties","titleButton":"Image Button Properties","upload":"Upload","urlMissing":"Image source URL is missing.","vSpace":"VSpace","validateBorder":"Border must be a whole number.","validateHSpace":"HSpace must be a whole number.","validateVSpace":"VSpace must be a whole number."},"smiley":{"options":"Smiley Options","title":"Insert a Smiley","toolbar":"Smiley"},"justify":{"block":"Justify","center":"Center","left":"Align Left","right":"Align Right"},"link":{"acccessKey":"Access Key","advanced":"Advanced","advisoryContentType":"Advisory Content Type","advisoryTitle":"Advisory Title","anchor":{"toolbar":"Anchor","menu":"Edit Anchor","title":"Anchor Properties","name":"Anchor Name","errorName":"Please type the anchor name","remove":"Remove Anchor"},"anchorId":"By Element Id","anchorName":"By Anchor Name","charset":"Linked Resource Charset","cssClasses":"Stylesheet Classes","emailAddress":"E-Mail Address","emailBody":"Message Body","emailSubject":"Message Subject","id":"Id","info":"Link Info","langCode":"Language Code","langDir":"Language Direction","langDirLTR":"Left to Right (LTR)","langDirRTL":"Right to Left (RTL)","menu":"Edit Link","name":"Name","noAnchors":"(No anchors available in the document)","noEmail":"Please type the e-mail address","noUrl":"Please type the link URL","other":"<other>","popupDependent":"Dependent (Netscape)","popupFeatures":"Popup Window Features","popupFullScreen":"Full Screen (IE)","popupLeft":"Left Position","popupLocationBar":"Location Bar","popupMenuBar":"Menu Bar","popupResizable":"Resizable","popupScrollBars":"Scroll Bars","popupStatusBar":"Status Bar","popupToolbar":"Toolbar","popupTop":"Top Position","rel":"Relationship","selectAnchor":"Select an Anchor","styles":"Style","tabIndex":"Tab Index","target":"Target","targetFrame":"<frame>","targetFrameName":"Target Frame Name","targetPopup":"<popup window>","targetPopupName":"Popup Window Name","title":"Link","toAnchor":"Link to anchor in the text","toEmail":"E-mail","toUrl":"URL","toolbar":"Link","type":"Link Type","unlink":"Unlink","upload":"Upload"},"liststyle":{"armenian":"Armenian numbering","bulletedTitle":"Bulleted List Properties","circle":"Circle","decimal":"Decimal (1, 2, 3, etc.)","decimalLeadingZero":"Decimal leading zero (01, 02, 03, etc.)","disc":"Disc","georgian":"Georgian numbering (an, ban, gan, etc.)","lowerAlpha":"Lower Alpha (a, b, c, d, e, etc.)","lowerGreek":"Lower Greek (alpha, beta, gamma, etc.)","lowerRoman":"Lower Roman (i, ii, iii, iv, v, etc.)","none":"None","notset":"<not set>","numberedTitle":"Numbered List Properties","square":"Square","start":"Start","type":"Type","upperAlpha":"Upper Alpha (A, B, C, D, E, etc.)","upperRoman":"Upper Roman (I, II, III, IV, V, etc.)","validateStartNumber":"List start number must be a whole number."},"magicline":{"title":"Insert paragraph here"},"maximize":{"maximize":"Maximize","minimize":"Minimize"},"newpage":{"toolbar":"New Page"},"pagebreak":{"alt":"Page Break","toolbar":"Insert Page Break for Printing"},"pastetext":{"button":"Paste as plain text","title":"Paste as Plain Text"},"pastefromword":{"confirmCleanup":"The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?","error":"It was not possible to clean up the pasted data due to an internal error","title":"Paste from Word","toolbar":"Paste from Word"},"preview":{"preview":"Preview"},"print":{"toolbar":"Print"},"removeformat":{"toolbar":"Remove Format"},"save":{"toolbar":"Save"},"selectall":{"toolbar":"Select All"},"showblocks":{"toolbar":"Show Blocks"},"sourcearea":{"toolbar":"Source"},"specialchar":{"options":"Special Character Options","title":"Select Special Character","toolbar":"Insert Special Character"},"scayt":{"about":"About SCAYT","aboutTab":"About","addWord":"Add Word","allCaps":"Ignore All-Caps Words","dic_create":"Create","dic_delete":"Delete","dic_field_name":"Dictionary name","dic_info":"Initially the User Dictionary is stored in a Cookie. However, Cookies are limited in size. When the User Dictionary grows to a point where it cannot be stored in a Cookie, then the dictionary may be stored on our server. To store your personal dictionary on our server you should specify a name for your dictionary. If you already have a stored dictionary, please type its name and click the Restore button.","dic_rename":"Rename","dic_restore":"Restore","dictionariesTab":"Dictionaries","disable":"Disable SCAYT","emptyDic":"Dictionary name should not be empty.","enable":"Enable SCAYT","ignore":"Ignore","ignoreAll":"Ignore All","ignoreDomainNames":"Ignore Domain Names","langs":"Languages","languagesTab":"Languages","mixedCase":"Ignore Words with Mixed Case","mixedWithDigits":"Ignore Words with Numbers","moreSuggestions":"More suggestions","opera_title":"Not supported by Opera","options":"Options","optionsTab":"Options","title":"Spell Check As You Type","toggle":"Toggle SCAYT","noSuggestions":"No suggestion"},"stylescombo":{"label":"Styles","panelTitle":"Formatting Styles","panelTitle1":"Block Styles","panelTitle2":"Inline Styles","panelTitle3":"Object Styles"},"table":{"border":"Border size","caption":"Caption","cell":{"menu":"Cell","insertBefore":"Insert Cell Before","insertAfter":"Insert Cell After","deleteCell":"Delete Cells","merge":"Merge Cells","mergeRight":"Merge Right","mergeDown":"Merge Down","splitHorizontal":"Split Cell Horizontally","splitVertical":"Split Cell Vertically","title":"Cell Properties","cellType":"Cell Type","rowSpan":"Rows Span","colSpan":"Columns Span","wordWrap":"Word Wrap","hAlign":"Horizontal Alignment","vAlign":"Vertical Alignment","alignBaseline":"Baseline","bgColor":"Background Color","borderColor":"Border Color","data":"Data","header":"Header","yes":"Yes","no":"No","invalidWidth":"Cell width must be a number.","invalidHeight":"Cell height must be a number.","invalidRowSpan":"Rows span must be a whole number.","invalidColSpan":"Columns span must be a whole number.","chooseColor":"Choose"},"cellPad":"Cell padding","cellSpace":"Cell spacing","column":{"menu":"Column","insertBefore":"Insert Column Before","insertAfter":"Insert Column After","deleteColumn":"Delete Columns"},"columns":"Columns","deleteTable":"Delete Table","headers":"Headers","headersBoth":"Both","headersColumn":"First column","headersNone":"None","headersRow":"First Row","invalidBorder":"Border size must be a number.","invalidCellPadding":"Cell padding must be a positive number.","invalidCellSpacing":"Cell spacing must be a positive number.","invalidCols":"Number of columns must be a number greater than 0.","invalidHeight":"Table height must be a number.","invalidRows":"Number of rows must be a number greater than 0.","invalidWidth":"Table width must be a number.","menu":"Table Properties","row":{"menu":"Row","insertBefore":"Insert Row Before","insertAfter":"Insert Row After","deleteRow":"Delete Rows"},"rows":"Rows","summary":"Summary","title":"Table Properties","toolbar":"Table","widthPc":"percent","widthPx":"pixels","widthUnit":"width unit"},"undo":{"redo":"Redo","undo":"Undo"},"wsc":{"btnIgnore":"Ignore","btnIgnoreAll":"Ignore All","btnReplace":"Replace","btnReplaceAll":"Replace All","btnUndo":"Undo","changeTo":"Change to","errorLoading":"Error loading application service host: %s.","ieSpellDownload":"Spell checker not installed. Do you want to download it now?","manyChanges":"Spell check complete: %1 words changed","noChanges":"Spell check complete: No words changed","noMispell":"Spell check complete: No misspellings found","noSuggestions":"- No suggestions -","notAvailable":"Sorry, but service is unavailable now.","notInDic":"Not in dictionary","oneChange":"Spell check complete: One word changed","progress":"Spell check in progress...","title":"Spell Check","toolbar":"Check Spelling"},"codemirror":{"toolbar":"Source","autoFormat":"Format Selection","commentSelectedRange":"Comment Selection","uncommentSelectedRange":"Uncomment Selection"}};
@@ -0,0 +1,74 @@
1
+ /* Extra for the CKEditor CodeMirror Plugin */
2
+
3
+ .CodeMirror {font:13px/1.4em monospace;}
4
+
5
+ .CodeMirror .activeline { background: #e8f2ff; }
6
+
7
+ .CodeMirror .CodeMirror-foldmarker {
8
+ color: blue;
9
+ text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;
10
+ font-family: arial;
11
+ line-height: .3;
12
+ cursor: pointer;
13
+ }
14
+
15
+ /* Fixes for themes */
16
+ .cm-s-cobalt .CodeMirror-selected { background: #b36539 !important; }
17
+ .cm-s-erlang-dark .CodeMirror-selected { background: #b36539 !important; }
18
+ .cm-s-lesser-dark .CodeMirror-selected {background: #45443B !important;}
19
+ .cm-s-monokai .CodeMirror-selected {background: #49483E !important;}
20
+ .cm-s-night .CodeMirror-selected { background: #447 !important; }
21
+ .cm-s-rubyblue .CodeMirror-selected { background: #38566F !important; }
22
+ .cm-s-twilight .CodeMirror-selected { background: #323232 !important; }
23
+ .cm-s-xq-dark .CodeMirror-selected { background: #a8f !important; }
24
+
25
+ .cm-s-blackboard .activeline,
26
+ .cm-s-cobalt .activeline,
27
+ .cm-s-erlang-dark .activeline,
28
+ .cm-s-lesser-dark .activeline,
29
+ .cm-s-monokai .activeline,
30
+ .cm-s-night .activeline,
31
+ .cm-s-rubyblue .activeline,
32
+ .cm-s-vibrant-ink .activeline,
33
+ .cm-s-xq-dark .activeline { background: #757575; }
34
+ .cm-s-twilight .activeline { background:#494949; }
35
+
36
+ .CodeMirror-focused .cm-matchhighlight {
37
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFklEQVQI12NgYGBgkKzc8x9CMDAwAAAmhwSbidEoSQAAAABJRU5ErkJggg==);
38
+ background-position: bottom;
39
+ background-repeat: repeat-x;
40
+ }
41
+
42
+ /* Dialog Addon */
43
+ .CodeMirror-dialog {
44
+ position: absolute;
45
+ left: 0; right: 0;
46
+ background: white;
47
+ z-index: 15;
48
+ padding: .1em .8em;
49
+ overflow: hidden;
50
+ color: #333;
51
+ }
52
+
53
+ .CodeMirror-dialog-top {
54
+ border-bottom: 1px solid #eee;
55
+ top: 0;
56
+ }
57
+
58
+ .CodeMirror-dialog-bottom {
59
+ border-top: 1px solid #eee;
60
+ bottom: 0;
61
+ }
62
+
63
+ .CodeMirror-dialog input {
64
+ border: none;
65
+ outline: none;
66
+ background: transparent;
67
+ width: 20em;
68
+ color: inherit;
69
+ font-family: monospace;
70
+ }
71
+
72
+ .CodeMirror-dialog button {
73
+ font-size: 70%;
74
+ }
@@ -61,7 +61,7 @@
61
61
  .CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
62
62
 
63
63
  /* DEFAULT THEME */
64
- .cm-s-default { font:13px/1.4em monospace; }
64
+
65
65
  .cm-s-default .cm-keyword {color: #708;}
66
66
  .cm-s-default .cm-atom {color: #219;}
67
67
  .cm-s-default .cm-number {color: #164;}
@@ -148,6 +148,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
148
148
  .CodeMirror-gutters {
149
149
  position: absolute; left: 0; top: 0;
150
150
  height: 100%;
151
+ padding-bottom: 30px;
151
152
  z-index: 3;
152
153
  }
153
154
  .CodeMirror-gutter {
@@ -199,6 +200,10 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
199
200
  overflow: auto;
200
201
  }
201
202
 
203
+ .CodeMirror-widget {
204
+ display: inline-block;
205
+ }
206
+
202
207
  .CodeMirror-wrap .CodeMirror-scroll {
203
208
  overflow-x: hidden;
204
209
  }
@@ -0,0 +1 @@
1
+ .CodeMirror{font-family:monospace;height:300px}.CodeMirror-scroll{overflow:auto}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7}.CodeMirror-linenumbers{}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999}.CodeMirror div.CodeMirror-cursor{border-left:1px solid #000}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:transparent;background:rgba(0,200,0,.4);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800,endColorstr=#4c00c800)}.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor:not(#nonsense_id){filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite{}.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:#000}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-property{color:#000}.cm-s-default .cm-operator{color:#000}.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-emstrong{font-style:italic;font-weight:bold}.cm-link{text-decoration:underline}.cm-invalidchar{color:red}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror{line-height:1;position:relative;overflow:hidden}.CodeMirror-scroll{margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;padding-right:30px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-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;z-index:6}.CodeMirror-gutters{position:absolute;left:0;top:0;height:100%;padding-bottom:30px;z-index:3}.CodeMirror-gutter{height:100%;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;-o-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-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-widget{display:inline-block}.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:none;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}}.CodeMirror{font:13px/1.4em monospace}.CodeMirror .activeline{background:#e8f2ff}.CodeMirror .CodeMirror-foldmarker{color:blue;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.cm-s-cobalt .CodeMirror-selected{background:#b36539!important}.cm-s-erlang-dark .CodeMirror-selected{background:#b36539!important}.cm-s-lesser-dark .CodeMirror-selected{background:#45443b!important}.cm-s-monokai .CodeMirror-selected{background:#49483e!important}.cm-s-night .CodeMirror-selected{background:#447!important}.cm-s-rubyblue .CodeMirror-selected{background:#38566f!important}.cm-s-twilight .CodeMirror-selected{background:#323232!important}.cm-s-xq-dark .CodeMirror-selected{background:#a8f!important}.cm-s-blackboard .activeline,.cm-s-cobalt .activeline,.cm-s-erlang-dark .activeline,.cm-s-lesser-dark .activeline,.cm-s-monokai .activeline,.cm-s-night .activeline,.cm-s-rubyblue .activeline,.cm-s-vibrant-ink .activeline,.cm-s-xq-dark .activeline{background:#757575}.cm-s-twilight .activeline{background:#494949}.CodeMirror-focused .cm-matchhighlight{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFklEQVQI12NgYGBgkKzc8x9CMDAwAAAmhwSbidEoSQAAAABJRU5ErkJggg==);background-position:bottom;background-repeat:repeat-x}.CodeMirror-dialog{position:absolute;left:0;right:0;background:#fff;z-index:15;padding:.1em .8em;overflow:hidden;color:#333}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{border:none;outline:none;background:transparent;width:20em;color:inherit;font-family:monospace}.CodeMirror-dialog button{font-size:70%}
@@ -0,0 +1,3 @@
1
+ (function(){function j(a,f,b){a=a.getWrapperElement().appendChild(document.createElement("div"));a.className=b?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top";a.innerHTML=f;return a}CodeMirror.defineExtension("openDialog",function(a,f,b){function d(){g||(g=!0,e.parentNode.removeChild(e))}var e=j(this,a,b&&b.bottom),g=!1,h=this,c=e.getElementsByTagName("input")[0];if(c)CodeMirror.on(c,"keydown",function(a){if(13==a.keyCode||27==a.keyCode)CodeMirror.e_stop(a),
2
+ d(),h.focus(),13==a.keyCode&&f(c.value)}),b&&b.value&&(c.value=b.value),c.focus(),CodeMirror.on(c,"blur",d);else if(a=e.getElementsByTagName("button")[0])CodeMirror.on(a,"click",function(){d();h.focus()}),a.focus(),CodeMirror.on(a,"blur",d);return d});CodeMirror.defineExtension("openConfirm",function(a,f,b){function d(){g||(g=!0,e.parentNode.removeChild(e),h.focus())}var e=j(this,a,b&&b.bottom),a=e.getElementsByTagName("button"),g=!1,h=this,c=1;a[0].focus();for(b=0;b<a.length;++b){var i=a[b];(function(a){CodeMirror.on(i,
3
+ "click",function(b){CodeMirror.e_preventDefault(b);d();a&&a(h)})})(f[b]);CodeMirror.on(i,"blur",function(){--c;setTimeout(function(){0>=c&&d()},200)});CodeMirror.on(i,"focus",function(){++c})}})})();
@@ -0,0 +1,2 @@
1
+ (function(){function f(b){for(var c={name:"autoCloseBrackets"},a=0;a<b.length;a+=2)(function(a,b){function e(a){var d=a.getCursor();if(a.getRange(d,CodeMirror.Pos(d.line,d.ch+1))!=b)return CodeMirror.Pass;a.execCommand("goCharRight")}c["'"+a+"'"]=function(c){if(!(a==b&&e(c)!=CodeMirror.Pass)){var d=c.getCursor("start"),d=CodeMirror.Pos(d.line,d.ch+1);c.replaceSelection(a+b,{head:d,anchor:d})}};a!=b&&(c["'"+b+"'"]=e)})(b.charAt(a),b.charAt(a+1));return c}CodeMirror.defineOption("autoCloseBrackets",
2
+ !1,function(b,c,a){a=a&&a!=CodeMirror.Init;c&&!a?b.addKeyMap(f(typeof c=="string"?c:"()[]{}''\"\"")):!c&&a&&b.removeKeyMap("autoCloseBrackets")})})();
@@ -1,3 +1,3 @@
1
- (function(){function g(b,d){var a=b.getCursor(),c=b.getTokenAt(a),f=CodeMirror.innerMode(b.getMode(),c.state),h=f.state;if("xml"!=f.mode.name)throw CodeMirror.Pass;var e=b.getOption("autoCloseTags"),i="html"==f.mode.configuration,f="object"==typeof e&&e.dontCloseTags||i&&k,i="object"==typeof e&&e.indentTags||i&&l;if(">"==d&&h.tagName){e=h.tagName;c.end>a.ch&&(e=e.slice(0,e.length-c.end+a.ch));var g=e.toLowerCase();if("tag"==c.type&&"closeTag"==h.type||/\/\s*$/.test(c.string)||f&&-1<j(f,g))throw CodeMirror.Pass;
2
- c=i&&-1<j(i,g);b.replaceSelection(">"+(c?"\n\n":"")+"</"+e+">",c?{line:a.line+1,ch:0}:{line:a.line,ch:a.ch+1});c&&(b.indentLine(a.line+1),b.indentLine(a.line+2))}else if("/"==d&&"tag"==c.type&&"<"==c.string)(e=h.context&&h.context.tagName)&&b.replaceSelection("/"+e+">","end");else throw CodeMirror.Pass;}function j(b,d){if(b.indexOf)return b.indexOf(d);for(var a=0,c=b.length;a<c;++a)if(b[a]==d)return a;return-1}CodeMirror.defineOption("autoCloseTags",!1,function(b,d,a){if(d&&(a==CodeMirror.Init||!a)){a=
3
- {name:"autoCloseTags"};if(typeof d!="object"||d.whenClosing)a["'/'"]=function(a){g(a,"/")};if(typeof d!="object"||d.whenOpening)a["'>'"]=function(a){g(a,">")};b.addKeyMap(a)}else!d&&(a!=CodeMirror.Init&&a)&&b.removeKeyMap("autoCloseTags")});var k="area base br col command embed hr img input keygen link meta param source track wbr".split(" "),l="applet blockquote body button div dl fieldset form frameset h1 h2 h3 h4 h5 h6 head html iframe layer legend object ol p select table ul".split(" ")})();
1
+ (function(){function h(b,c){var a=b.getCursor(),e=b.getTokenAt(a),g=CodeMirror.innerMode(b.getMode(),e.state),f=g.state;if("xml"!=g.mode.name)return CodeMirror.Pass;var d=b.getOption("autoCloseTags"),i="html"==g.mode.configuration,g="object"==typeof d&&d.dontCloseTags||i&&k,i="object"==typeof d&&d.indentTags||i&&l;if(">"==c&&f.tagName){d=f.tagName;e.end>a.ch&&(d=d.slice(0,d.length-e.end+a.ch));var h=d.toLowerCase();if("tag"==e.type&&"closeTag"==f.type||/\/\s*$/.test(e.string)||g&&-1<j(g,h))return CodeMirror.Pass;
2
+ f=(e=i&&-1<j(i,h))?CodeMirror.Pos(a.line+1,0):CodeMirror.Pos(a.line,a.ch+1);b.replaceSelection(">"+(e?"\n\n":"")+"</"+d+">",{head:f,anchor:f});e&&(b.indentLine(a.line+1),b.indentLine(a.line+2))}else if("/"==c&&"<"==e.string)(d=f.context&&f.context.tagName)&&b.replaceSelection("/"+d+">","end");else return CodeMirror.Pass}function j(b,c){if(b.indexOf)return b.indexOf(c);for(var a=0,e=b.length;a<e;++a)if(b[a]==c)return a;return-1}CodeMirror.defineOption("autoCloseTags",!1,function(b,c,a){if(c&&(a==CodeMirror.Init||
3
+ !a)){a={name:"autoCloseTags"};if(typeof c!="object"||c.whenClosing)a["'/'"]=function(a){return h(a,"/")};if(typeof c!="object"||c.whenOpening)a["'>'"]=function(a){return h(a,">")};b.addKeyMap(a)}else!c&&(a!=CodeMirror.Init&&a)&&b.removeKeyMap("autoCloseTags")});var k="area base br col command embed hr img input keygen link meta param source track wbr".split(" "),l="applet blockquote body button div dl fieldset form frameset h1 h2 h3 h4 h5 h6 head html iframe layer legend object ol p select table ul".split(" ")})();
@@ -1,4 +1,4 @@
1
- (function(){function k(b){function e(a,c,d){if(a.text){var g=i?0:a.text.length-1,f=i?a.text.length:-1;for(null!=d&&(g=d+h);g!=f;g+=h)if(d=a.text.charAt(g),l.test(d)&&b.getTokenAt({line:c,ch:g+1}).type==k){var e=n[d];if(">"==e.charAt(1)==i)o.push(d);else{if(o.pop()!=e.charAt(0))return{pos:g,match:!1};if(!o.length)return{pos:g,match:!0}}}}}var a=b.getCursor(),f=b.getLineHandle(a.line),d=a.ch-1,c=0<=d&&n[f.text.charAt(d)]||n[f.text.charAt(++d)];if(!c)return null;for(var i=">"==c.charAt(1),h=i?1:-1,k=
2
- b.getTokenAt({line:a.line,ch:d+1}).type,o=[f.text.charAt(d)],l=/[(){}[\]]/,c=a.line,j,m=i?Math.min(c+100,b.lineCount()):Math.max(-1,c-100);c!=m&&!(j=c==a.line?e(f,c,d):e(b.getLineHandle(c),c));c+=h);return{from:{line:a.line,ch:d},to:j&&{line:c,ch:j.pos},match:j&&j.match}}function l(b,e){var a=k(b);if(a){var f=a.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",d=b.markText(a.from,{line:a.from.line,ch:a.from.ch+1},{className:f}),c=a.to&&b.markText(a.to,{line:a.to.line,ch:a.to.ch+1},
3
- {className:f}),a=function(){b.operation(function(){d.clear();c&&c.clear()})};if(e)setTimeout(a,800);else return a}}function m(b){b.operation(function(){h&&(h(),h=null);b.somethingSelected()||(h=l(b,!1))})}var n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},h=null;CodeMirror.defineOption("matchBrackets",!1,function(b,e){if(e)b.on("cursorActivity",m);else b.off("cursorActivity",m)});CodeMirror.defineExtension("matchBrackets",function(){l(this,!0)});CodeMirror.defineExtension("findMatchingBracket",
4
- function(){return k(this)})})();
1
+ (function(){function l(b){function e(a,c,d){if(a.text){var g=j?0:a.text.length-1,f=j?a.text.length:-1;for(null!=d&&(g=d+h);g!=f;g+=h)if(d=a.text.charAt(g),m.test(d)&&b.getTokenAt(i(c,g+1)).type==l){var e=o[d];if(">"==e.charAt(1)==j)p.push(d);else{if(p.pop()!=e.charAt(0))return{pos:g,match:!1};if(!p.length)return{pos:g,match:!0}}}}}var a=b.getCursor(),f=b.getLineHandle(a.line),d=a.ch-1,c=0<=d&&o[f.text.charAt(d)]||o[f.text.charAt(++d)];if(!c)return null;for(var j=">"==c.charAt(1),h=j?1:-1,l=b.getTokenAt(i(a.line,
2
+ d+1)).type,p=[f.text.charAt(d)],m=/[(){}[\]]/,c=a.line,k,n=j?Math.min(c+100,b.lineCount()):Math.max(-1,c-100);c!=n&&!(k=c==a.line?e(f,c,d):e(b.getLineHandle(c),c));c+=h);return{from:i(a.line,d),to:k&&i(c,k.pos),match:k&&k.match}}function m(b,e){var a=l(b);if(a&&!(b.getLine(a.from.line).length>n||a.to&&b.getLine(a.to.line).length>n)){var f=a.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",d=b.markText(a.from,i(a.from.line,a.from.ch+1),{className:f}),c=a.to&&b.markText(a.to,i(a.to.line,
3
+ a.to.ch+1),{className:f});r&&b.state.focused&&b.display.input.focus();a=function(){b.operation(function(){d.clear();c&&c.clear()})};if(e)setTimeout(a,800);else return a}}function q(b){b.operation(function(){h&&(h(),h=null);b.somethingSelected()||(h=m(b,!1))})}var r=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||8>document.documentMode),i=CodeMirror.Pos,n=1E3,o={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},h=null;CodeMirror.defineOption("matchBrackets",!1,function(b,e){if(e)b.on("cursorActivity",
4
+ q);else b.off("cursorActivity",q)});CodeMirror.defineExtension("matchBrackets",function(){m(this,!0)});CodeMirror.defineExtension("findMatchingBracket",function(){return l(this)})})();
@@ -1,7 +1,7 @@
1
1
  CodeMirror.tagRangeFinder=function(h,e){for(var f=RegExp("^[A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*"),b=h.getLine(e.line),a=!1,d=null,c=e.ch;!a;){c=b.indexOf("<",
2
2
  c);if(-1==c)return;if(c+1<b.length&&"/"==b[c+1])c++;else if(b.substr(c+1).match(f)){var g=b.indexOf(">",c+1);if(-1==g){for(var a=e.line+1,l=!1,j=h.lineCount();a<j&&!l;){var i=h.getLine(a),g=i.indexOf(">");if(-1!=g&&(l=!0,i=i.lastIndexOf("/",g),-1!=i&&i<g&&(i=b.substr(i,g-i+1),!i.match(/\/\s*\>/))))return;a++}a=!0}else j=b.lastIndexOf("/",g),-1==j?a=!0:(i=b.substr(j,g-j+1),i.match(/\/\s*\>/)||(a=!0));a&&((d=b.substr(c+1).match(f))?(d=d[0],-1!=b.indexOf("</"+d+">",c)&&(a=!1)):a=!1);a||c++}else c++}if(a){f=
3
- RegExp("(\\<\\/"+d+"\\>)|(\\<"+d+"\\>)|(\\<"+d+"\\s)|(\\<"+d+"$)");d="</"+d+">";c=1;a=e.line+1;for(j=h.lineCount();a<j;){b=h.getLine(a);if(b=b.match(f))for(l=0;l<b.length;l++)if(b[l]==d?c--:c++,!c)return{from:{line:e.line,ch:g+1},to:{line:a,ch:b.index}};a++}}};
4
- CodeMirror.braceRangeFinder=function(h,e){for(var f=e.line,b=h.getLine(f),a=b.length,d,c;;){a=b.lastIndexOf("{",a);if(a<e.ch)break;c=h.getTokenAt({line:f,ch:a}).type;if(!/^(comment|string)/.test(c)){d=a;break}a-=1}if(!(null==d||b.lastIndexOf("}")>d)){var b=1,a=h.lineCount(),g,l,j=f+1;a:for(;j<a;++j)for(var i=h.getLine(j),k=0;;){var m=i.indexOf("{",k),k=i.indexOf("}",k);0>m&&(m=i.length);0>k&&(k=i.length);k=Math.min(m,k);if(k==i.length)break;if(h.getTokenAt({line:j,ch:k+1}).type==c)if(k==m)++b;else if(!--b){g=
5
- j;l=k;break a}++k}if(!(null==g||g==f+1))return{from:{line:f,ch:d+1},to:{line:g,ch:l}}}};CodeMirror.indentRangeFinder=function(h,e){for(var f=h.getOption("tabSize"),b=h.getLine(e.line),a=CodeMirror.countColumn(b,null,f),d=e.line+1,c=h.lineCount();d<c;++d){var g=h.getLine(d);if(CodeMirror.countColumn(g,null,f)<a)return{from:{line:e.line,ch:b.length},to:{line:d,ch:g.length}}}};
6
- CodeMirror.newFoldFunction=function(h,e){null==e&&(e="↔");if("string"==typeof e){var f=document.createTextNode(e),e=document.createElement("span");e.appendChild(f);e.className="CodeMirror-foldmarker"}return function(b,a){"number"==typeof a&&(a={line:a,ch:0});var d=h(b,a);if(d){for(var c=b.findMarksAt(d.from),g=0,f=0;f<c.length;++f)c[f].__isFold&&(++g,c[f].clear());if(!g){c=e.cloneNode(!0);CodeMirror.on(c,"mousedown",function(){j.clear()});var j=b.markText(d.from,d.to,{replacedWith:c,clearOnEnter:!0,
3
+ RegExp("(\\<\\/"+d+"\\>)|(\\<"+d+"\\>)|(\\<"+d+"\\s)|(\\<"+d+"$)");d="</"+d+">";c=1;a=e.line+1;for(j=h.lineCount();a<j;){b=h.getLine(a);if(b=b.match(f))for(l=0;l<b.length;l++)if(b[l]==d?c--:c++,!c)return{from:CodeMirror.Pos(e.line,g+1),to:CodeMirror.Pos(a,b.index)};a++}}};
4
+ CodeMirror.braceRangeFinder=function(h,e){for(var f=e.line,b=h.getLine(f),a=b.length,d,c;;){a=b.lastIndexOf("{",a);if(a<e.ch)break;c=h.getTokenAt(CodeMirror.Pos(f,a+1)).type;if(!/^(comment|string)/.test(c)){d=a;break}a-=1}if(!(null==d||b.lastIndexOf("}")>d)){var b=1,a=h.lineCount(),g,l,j=f+1;a:for(;j<a;++j)for(var i=h.getLine(j),k=0;;){var m=i.indexOf("{",k),k=i.indexOf("}",k);0>m&&(m=i.length);0>k&&(k=i.length);k=Math.min(m,k);if(k==i.length)break;if(h.getTokenAt(CodeMirror.Pos(j,k+1)).type==c)if(k==
5
+ m)++b;else if(!--b){g=j;l=k;break a}++k}if(!(null==g||g==f+1))return{from:CodeMirror.Pos(f,d+1),to:CodeMirror.Pos(g,l)}}};CodeMirror.indentRangeFinder=function(h,e){for(var f=h.getOption("tabSize"),b=h.getLine(e.line),a=CodeMirror.countColumn(b,null,f),d=e.line+1,c=h.lineCount();d<c;++d){var g=h.getLine(d);if(CodeMirror.countColumn(g,null,f)<a&&CodeMirror.countColumn(h.getLine(d-1),null,f)>a)return{from:CodeMirror.Pos(e.line,b.length),to:CodeMirror.Pos(d,g.length)}}};
6
+ CodeMirror.newFoldFunction=function(h,e){null==e&&(e="↔");if("string"==typeof e){var f=document.createTextNode(e),e=document.createElement("span");e.appendChild(f);e.className="CodeMirror-foldmarker"}return function(b,a){"number"==typeof a&&(a=CodeMirror.Pos(a,0));var d=h(b,a);if(d){for(var c=b.findMarksAt(d.from),g=0,f=0;f<c.length;++f)c[f].__isFold&&(++g,c[f].clear());if(!g){c=e.cloneNode(!0);CodeMirror.on(c,"mousedown",function(){j.clear()});var j=b.markText(d.from,d.to,{replacedWith:c,clearOnEnter:!0,
7
7
  __isFold:!0})}}}};
@@ -0,0 +1,2 @@
1
+ (function(){CodeMirror.defineExtension("autoFormatAll",function(e,m){for(var b=this,f=b.getMode(),h=b.getRange(e,m).split("\n"),i=CodeMirror.copyState(f,b.getTokenAt(e).state),n=b.getOption("tabSize"),d="",j=0,c=0==e.ch,g=0;g<h.length;++g){for(var a=new CodeMirror.StringStream(h[g],n);!a.eol();){var k=CodeMirror.innerMode(f,i),o=f.token(a,i),l=a.current();a.start=a.pos;if(!c||/\S/.test(l))d+=l,c=!1;if(!c&&k.mode.newlineAfterToken&&k.mode.newlineAfterToken(o,l,a.string.slice(a.pos)||h[g+1]||"",k.state))d+=
2
+ "\n",c=!0,++j}!a.pos&&f.blankLine&&f.blankLine(i);!c&&g<h.length-1&&(d+="\n",c=!0,++j)}b.operation(function(){b.replaceRange(d,e,m);for(var a=e.line+1,c=e.line+j;a<=c;++a)b.indentLine(a,"smart");b.setCursor({line:0,ch:0})})})})();
@@ -1,5 +1,5 @@
1
- (function(){CodeMirror.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(d,b){return/^[;{}]$/.test(b)}});CodeMirror.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(d,b,e,a){return this.jsonMode?/^[\[,{]$/.test(b)||/^}/.test(e):";"==b&&a.lexical&&")"==a.lexical.type?!1:/^[;{}]$/.test(b)&&!/^;/.test(e)}});var m=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;
2
- CodeMirror.extendMode("xml",{commentStart:"<\!--",commentEnd:"--\>",newlineAfterToken:function(d,b,e,a){var c=!1;"html"==this.configuration&&(c=a.context?m.test(a.context.tagName):!1);return!c&&("tag"==d&&/>$/.test(b)&&a.context||/^</.test(e))}});CodeMirror.defineExtension("commentRange",function(d,b,e){var a=this,c=CodeMirror.innerMode(a.getMode(),a.getTokenAt(b).state).mode;a.operation(function(){if(d)a.replaceRange(c.commentEnd,e),a.replaceRange(c.commentStart,b),b.line==e.line&&b.ch==e.ch&&a.setCursor(b.line,
3
- b.ch+c.commentStart.length);else{var f=a.getRange(b,e),g=f.indexOf(c.commentStart),j=f.lastIndexOf(c.commentEnd);-1<g&&(-1<j&&j>g)&&(f=f.substr(0,g)+f.substring(g+c.commentStart.length,j)+f.substr(j+c.commentEnd.length));a.replaceRange(f,b,e)}})});CodeMirror.defineExtension("autoIndentRange",function(d,b){var e=this;this.operation(function(){for(var a=d.line;a<=b.line;a++)e.indentLine(a,"smart")})});CodeMirror.defineExtension("autoFormatRange",function(d,b,e){for(var a=this,c=a.getMode(),f=a.getRange(d,
4
- b).split("\n"),g=CodeMirror.copyState(c,a.getTokenAt(d).state),j=a.getOption("tabSize"),i="",n=0,k=0==d.ch,l=0;l<f.length;++l){for(var h=new CodeMirror.StringStream(f[l],j);!h.eol();){var o=CodeMirror.innerMode(c,g),m=c.token(h,g),p=h.current();h.start=h.pos;if(!k||/\S/.test(p))i+=p,k=!1;if(!k&&o.mode.newlineAfterToken&&o.mode.newlineAfterToken(m,p,h.string.slice(h.pos)||f[l+1]||"",o.state))i+="\n",k=!0,++n}!h.pos&&c.blankLine&&c.blankLine(g);!k&&l<f.length-1&&(i+="\n",k=!0,++n)}a.operation(function(){a.replaceRange(i,
5
- d,b);for(var c=d.line+1,f=d.line+n;c<=f;++c)a.indentLine(c,"smart");e?a.setCursor({line:0,ch:0}):a.setSelection(d,a.getCursor(!1))})})})();
1
+ (function(){CodeMirror.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(e,c){return/^[;{}]$/.test(c)}});CodeMirror.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(e,c,b,a){return this.jsonMode?/^[\[,{]$/.test(c)||/^}/.test(b):";"==c&&a.lexical&&")"==a.lexical.type?!1:/^[;{}]$/.test(c)&&!/^;/.test(b)}});var l=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;
2
+ CodeMirror.extendMode("xml",{commentStart:"<\!--",commentEnd:"--\>",newlineAfterToken:function(e,c,b,a){var d=!1;"html"==this.configuration&&(d=a.context?l.test(a.context.tagName):!1);return!d&&("tag"==e&&/>$/.test(c)&&a.context||/^</.test(b))}});CodeMirror.defineExtension("commentRange",function(e,c,b){var a=this,d=CodeMirror.innerMode(a.getMode(),a.getTokenAt(c).state).mode;a.operation(function(){if(e)a.replaceRange(d.commentEnd,b),a.replaceRange(d.commentStart,c),c.line==b.line&&c.ch==b.ch&&a.setCursor(c.line,
3
+ c.ch+d.commentStart.length);else{var g=a.getRange(c,b),i=g.indexOf(d.commentStart),f=g.lastIndexOf(d.commentEnd);-1<i&&(-1<f&&f>i)&&(g=g.substr(0,i)+g.substring(i+d.commentStart.length,f)+g.substr(f+d.commentEnd.length));a.replaceRange(g,c,b)}})});CodeMirror.defineExtension("autoIndentRange",function(e,c){var b=this;this.operation(function(){for(var a=e.line;a<=c.line;a++)b.indentLine(a,"smart")})});CodeMirror.defineExtension("autoFormatRange",function(e,c){for(var b=this,a=b.getMode(),d=b.getRange(e,
4
+ c).split("\n"),g=CodeMirror.copyState(a,b.getTokenAt(e).state),i=b.getOption("tabSize"),f="",m=0,j=0==e.ch,k=0;k<d.length;++k){for(var h=new CodeMirror.StringStream(d[k],i);!h.eol();){var n=CodeMirror.innerMode(a,g),l=a.token(h,g),o=h.current();h.start=h.pos;if(!j||/\S/.test(o))f+=o,j=!1;if(!j&&n.mode.newlineAfterToken&&n.mode.newlineAfterToken(l,o,h.string.slice(h.pos)||d[k+1]||"",n.state))f+="\n",j=!0,++m}!h.pos&&a.blankLine&&a.blankLine(g);!j&&k<d.length-1&&(f+="\n",j=!0,++m)}b.operation(function(){b.replaceRange(f,
5
+ e,c);for(var a=e.line+1,d=e.line+m;a<=d;++a)b.indentLine(a,"smart");b.setSelection(e,b.getCursor(!1))})})})();
@@ -0,0 +1,2 @@
1
+ (function(){function e(a){this.minChars="object"==typeof a&&a.minChars||f;this.style="object"==typeof a&&a.style||g;this.overlay=null}function d(a){a.operation(function(){var b=a._matchHighlightState;b.overlay&&(a.removeOverlay(b.overlay),b.overlay=null);if(a.somethingSelected()){var c=a.getSelection().replace(/^\s+|\s+$/g,"");c.length<b.minChars||a.addOverlay(b.overlay=h(c,b.style))}})}function h(a,b){return{token:function(c){if(c.match(a))return b;c.next();c.skipTo(a.charAt(0))||c.skipToEnd()}}}
2
+ var f=2,g="matchhighlight";CodeMirror.defineOption("highlightSelectionMatches",!1,function(a,b,c){c=c&&c!=CodeMirror.Init;if(b&&!c){a._matchHighlightState=new e(b);a.on("cursorActivity",d)}else if(!b&&c){(b=a._matchHighlightState.overlay)&&a.removeOverlay(b);a._matchHighlightState=null;a.off("cursorActivity",d)}})})();
@@ -0,0 +1,5 @@
1
+ (function(){function n(a){return"string"==typeof a?{token:function(b){if(b.match(a))return"searching";b.next();b.skipTo(a.charAt(0))||b.skipToEnd()}}:{token:function(b){if(b.match(a))return"searching";for(;!b.eol()&&!(b.next(),b.match(a,!1)););}}}function f(){this.overlay=this.posFrom=this.posTo=this.query=null}function g(a,b,c){return a.getSearchCursor(b,c,"string"==typeof b&&b==b.toLowerCase())}function h(a,b,c,d){a.openDialog?a.openDialog(b,d):d(prompt(c,""))}function o(a,b,c,d){if(a.openConfirm)a.openConfirm(b,
2
+ d);else if(confirm(c))d[0]()}function k(a){var b=a.match(/^\/(.*)\/([a-z]*)$/);return b?RegExp(b[1],-1==b[2].indexOf("i")?"":"i"):a}function i(a,b){var c=a._searchState||(a._searchState=new f);if(c.query)return l(a,b);h(a,p,"Search for:",function(d){a.operation(function(){d&&!c.query&&(c.query=k(d),a.removeOverlay(c.overlay),c.overlay=n(d),a.addOverlay(c.overlay),c.posFrom=c.posTo=a.getCursor(),l(a,b))})})}function l(a,b){a.operation(function(){var c=a._searchState||(a._searchState=new f),d=g(a,c.query,
3
+ b?c.posFrom:c.posTo);if(!d.find(b)&&(d=g(a,c.query,b?CodeMirror.Pos(a.lastLine()):CodeMirror.Pos(a.firstLine(),0)),!d.find(b)))return;a.setSelection(d.from(),d.to());c.posFrom=d.from();c.posTo=d.to()})}function j(a){a.operation(function(){var b=a._searchState||(a._searchState=new f);b.query&&(b.query=null,a.removeOverlay(b.overlay))})}function m(a,b){h(a,q,"Replace:",function(c){c&&(c=k(c),h(a,r,"Replace with:",function(d){if(b)a.operation(function(){for(var b=g(a,c);b.findNext();)if("string"!=typeof c){var e=
4
+ a.getRange(b.from(),b.to()).match(c);b.replace(d.replace(/\$(\d)/,function(a,b){return e[b]}))}else b.replace(d)});else{j(a);var e=g(a,c,a.getCursor()),f=function(){var b=e.from(),d;if(!(d=e.findNext()))if(e=g(a,c),!(d=e.findNext())||b&&e.from().line==b.line&&e.from().ch==b.ch)return;a.setSelection(e.from(),e.to());o(a,s,"Replace?",[function(){h(d)},f])},h=function(a){e.replace("string"==typeof c?d:d.replace(/\$(\d)/,function(b,c){return a[c]}));f()};f()}}))})}var p='Search: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)</span>',
5
+ q='Replace: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)</span>',r='With: <input type="text" style="width: 10em"/>',s="Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";CodeMirror.commands.find=function(a){j(a);i(a)};CodeMirror.commands.findNext=i;CodeMirror.commands.findPrev=function(a){i(a,!0)};CodeMirror.commands.clearSearch=j;CodeMirror.commands.replace=m;CodeMirror.commands.replaceAll=function(a){m(a,!0)}})();
@@ -0,0 +1,5 @@
1
+ (function(){function m(e,a,f,c){this.atOccurrence=!1;this.cm=e;null==c&&"string"==typeof a&&(c=!1);f=f?e.clipPos(f):i(0,0);this.pos={from:f,to:f};if("string"!=typeof a)a.global||(a=RegExp(a.source,a.ignoreCase?"ig":"g")),this.matches=function(n,h){if(n){a.lastIndex=0;for(var g=e.getLine(h.line).slice(0,h.ch),d=a.exec(g),b=0;d;){b+=d.index+1;g=g.slice(b);a.lastIndex=0;var c=a.exec(g);if(c)d=c;else break}b--}else a.lastIndex=h.ch,g=e.getLine(h.line),b=(d=a.exec(g))&&d.index;if(d&&d[0])return{from:i(h.line,
2
+ b),to:i(h.line,b+d[0].length),match:d}};else{c&&(a=a.toLowerCase());var j=c?function(a){return a.toLowerCase()}:function(a){return a},k=a.split("\n");this.matches=1==k.length?a.length?function(c,h){var g=j(e.getLine(h.line)),d=a.length,b;if(c?h.ch>=d&&-1!=(b=g.lastIndexOf(a,h.ch-d)):-1!=(b=g.indexOf(a,h.ch)))return{from:i(h.line,b),to:i(h.line,b+d)}}:function(){}:function(a,c){var g=c.line,d=a?k.length-1:0,b=k[d],f=j(e.getLine(g)),l=a?f.indexOf(b)+b.length:f.lastIndexOf(b);if(!(a?l>=c.ch||l!=b.length:
3
+ l<=c.ch||l!=f.length-b.length))for(;!(a?!g:g==e.lineCount()-1);){f=j(e.getLine(g+=a?-1:1));b=k[a?--d:++d];if(0<d&&d<k.length-1)if(f!=b)break;else continue;d=a?f.lastIndexOf(b):f.indexOf(b)+b.length;if(a?d!=f.length-b.length:d!=b.length)break;b=i(c.line,l);g=i(g,d);return{from:a?g:b,to:a?b:g}}}}}var i=CodeMirror.Pos;m.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function a(a){a=i(a,0);f.pos={from:a,to:a};return f.atOccurrence=!1}
4
+ for(var f=this,c=this.cm.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,c))return(!this.pos.from||!this.pos.to)&&console.log(this.matches,this.pos),this.atOccurrence=!0,this.pos.match||!0;if(e){if(!c.line)return a(0);c=i(c.line-1,this.cm.getLine(c.line-1).length)}else{var j=this.cm.lineCount();if(c.line==j-1)return a(j);c=i(c.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(e){this.atOccurrence&&
5
+ (e=CodeMirror.splitLines(e),this.cm.replaceRange(e,this.pos.from,this.pos.to),this.pos.to=i(this.pos.from.line+e.length-1,e[e.length-1].length+(1==e.length?this.pos.from.ch:0)))}};CodeMirror.defineExtension("getSearchCursor",function(e,a,f){return new m(this,e,a,f)})})();
@@ -0,0 +1,25 @@
1
+ (function(){function d(h){for(var c={name:"autoCloseBrackets"},e=0;e<h.length;e+=2)(function(a,f){function b(a){var b=a.getCursor();if(a.getRange(b,CodeMirror.Pos(b.line,b.ch+1))!=f)return CodeMirror.Pass;a.execCommand("goCharRight")}c["'"+a+"'"]=function(g){if(a!=f||b(g)==CodeMirror.Pass){var i=g.getCursor("start"),i=CodeMirror.Pos(i.line,i.ch+1);g.replaceSelection(a+f,{head:i,anchor:i})}};a!=f&&(c["'"+f+"'"]=b)})(h.charAt(e),h.charAt(e+1));return c}CodeMirror.defineOption("autoCloseBrackets",!1,
2
+ function(h,c,e){e=e&&e!=CodeMirror.Init;c&&!e?h.addKeyMap(d(typeof c=="string"?c:"()[]{}''\"\"")):!c&&e&&h.removeKeyMap("autoCloseBrackets")})})();
3
+ (function(){function d(a,f){var b=a.getCursor(),g=a.getTokenAt(b),i=CodeMirror.innerMode(a.getMode(),g.state),d=i.state,k,j;if("xml"!=i.mode.name)return CodeMirror.Pass;var l=a.getOption("autoCloseTags"),n="html"==i.mode.configuration,i="object"==typeof l&&l.dontCloseTags||n&&c,l="object"==typeof l&&l.indentTags||n&&e;if(">"==f&&d.tagName){if(j=d.tagName,g.end>b.ch&&(j=j.slice(0,j.length-g.end+b.ch)),k=j.toLowerCase(),"tag"==g.type&&"closeTag"==d.type||/\/\s*$/.test(g.string)||i&&-1<h(i,k))return CodeMirror.Pass;
4
+ d=(g=l&&-1<h(l,k))?CodeMirror.Pos(b.line+1,0):CodeMirror.Pos(b.line,b.ch+1);a.replaceSelection(">"+(g?"\n\n":"")+"</"+j+">",{head:d,anchor:d});g&&(a.indentLine(b.line+1),a.indentLine(b.line+2))}else if("/"==f&&"<"==g.string)(j=d.context&&d.context.tagName)&&a.replaceSelection("/"+j+">","end");else return CodeMirror.Pass}function h(a,f){if(a.indexOf)return a.indexOf(f);for(var b=0,g=a.length;b<g;++b)if(a[b]==f)return b;return-1}CodeMirror.defineOption("autoCloseTags",!1,function(a,f,b){if(f&&(b==CodeMirror.Init||
5
+ !b)){b={name:"autoCloseTags"};(typeof f!="object"||f.whenClosing)&&(b["'/'"]=function(a){return d(a,"/")});(typeof f!="object"||f.whenOpening)&&(b["'>'"]=function(a){return d(a,">")});a.addKeyMap(b)}else!f&&b!=CodeMirror.Init&&b&&a.removeKeyMap("autoCloseTags")});var c="area base br col command embed hr img input keygen link meta param source track wbr".split(" "),e="applet blockquote body button div dl fieldset form frameset h1 h2 h3 h4 h5 h6 head html iframe layer legend object ol p select table ul".split(" ")})();
6
+ (function(){function d(f){function g(e,c,h){var d,k,j,l;if(e.text){d=q?0:e.text.length-1;k=q?e.text.length:-1;for(null!=h&&(d=h+r);d!=k;d+=r)if(j=e.text.charAt(d),t.test(j)&&f.getTokenAt(a(c,d+1)).type==u)if(l=b[j],">"==l.charAt(1)==q)s.push(j);else{if(s.pop()!=l.charAt(0))return{pos:d,match:!1};if(!s.length)return{pos:d,match:!0}}}}var e=f.getCursor(),c=f.getLineHandle(e.line),h=e.ch-1,d=0<=h&&b[c.text.charAt(h)]||b[c.text.charAt(++h)],o,p;if(!d)return null;var q=">"==d.charAt(1),r=q?1:-1,u=f.getTokenAt(a(e.line,
7
+ h+1)).type,s=[c.text.charAt(h)],t=/[(){}[\]]/,d=e.line;for(p=q?Math.min(d+100,f.lineCount()):Math.max(-1,d-100);d!=p&&!(o=d==e.line?g(c,d,h):g(f.getLineHandle(d),d),o);d+=r);return{from:a(e.line,h),to:o&&a(d,o.pos),match:o&&o.match}}function h(b,g){var c=d(b);if(c&&!(b.getLine(c.from.line).length>f)&&(!c.to||!(b.getLine(c.to.line).length>f))){var h=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",l=b.markText(c.from,a(c.from.line,c.from.ch+1),{className:h}),n=c.to&&b.markText(c.to,
8
+ a(c.to.line,c.to.ch+1),{className:h});if(e&&b.state.focused&&b.display.input.focus(),c=function(){b.operation(function(){l.clear();n&&n.clear()})},g)setTimeout(c,800);else return c}}function c(b){b.operation(function(){g&&(g(),g=null);b.somethingSelected()||(g=h(b,!1))})}var e=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||8>document.documentMode),a=CodeMirror.Pos,f=1E3,b={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},g=null;CodeMirror.defineOption("matchBrackets",!1,
9
+ function(b,a){if(a)b.on("cursorActivity",c);else b.off("cursorActivity",c)});CodeMirror.defineExtension("matchBrackets",function(){h(this,!0)});CodeMirror.defineExtension("findMatchingBracket",function(){return d(this)})})();
10
+ CodeMirror.tagRangeFinder=function(d,h){for(var c=RegExp("^[A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*"),e=d.getLine(h.line),a=!1,f=null,b=h.ch,g,i,m,k,
11
+ j,l,n;!a;){if(b=e.indexOf("<",b),-1==b)return;if(b+1<e.length&&"/"==e[b+1])b++;else if(e.substr(b+1).match(c)){if(g=e.indexOf(">",b+1),-1==g){var a=h.line+1,o=!1;for(k=d.lineCount();a<k&&!o;){if(i=d.getLine(a),g=i.indexOf(">"),-1!=g&&(o=!0,m=i.lastIndexOf("/",g),-1!=m&&m<g&&(j=e.substr(m,g-m+1),!j.match(/\/\s*\>/))))return;a++}a=!0}else k=e.lastIndexOf("/",g),-1==k?a=!0:(j=e.substr(k,g-k+1),j.match(/\/\s*\>/)||(a=!0));a&&(l=e.substr(b+1),f=l.match(c),f?(f=f[0],-1!=e.indexOf("</"+f+">",b)&&(a=!1)):
12
+ a=!1);a||b++}else b++}if(a){c=RegExp("(\\<\\/"+f+"\\>)|(\\<"+f+"\\>)|(\\<"+f+"\\s)|(\\<"+f+"$)");b="</"+f+">";i=1;a=h.line+1;for(k=d.lineCount();a<k;){if(e=d.getLine(a),n=e.match(c),n)for(f=0;f<n.length;f++)if(n[f]==b?i--:i++,!i)return{from:CodeMirror.Pos(h.line,g+1),to:CodeMirror.Pos(a,n.index)};a++}}};
13
+ CodeMirror.braceRangeFinder=function(d,h){for(var c=h.line,e=d.getLine(c),a=e.length,f,b,g,i,m,k,j,l,n;!(g=e.lastIndexOf("{",a),g<h.ch);){if(b=d.getTokenAt(CodeMirror.Pos(c,g+1)).type,!/^(comment|string)/.test(b)){f=g;break}a=g-1}if(null!=f&&!(e.lastIndexOf("}")>f)){e=1;a=d.lineCount();g=c+1;a:for(;g<a;++g){k=d.getLine(g);for(j=0;!(l=k.indexOf("{",j),n=k.indexOf("}",j),0>l&&(l=k.length),0>n&&(n=k.length),j=Math.min(l,n),j==k.length);){if(d.getTokenAt(CodeMirror.Pos(g,j+1)).type==b)if(j==l)++e;else if(!--e){i=
14
+ g;m=j;break a}++j}}if(null!=i&&i!=c+1)return{from:CodeMirror.Pos(c,f+1),to:CodeMirror.Pos(i,m)}}};CodeMirror.indentRangeFinder=function(d,h){for(var c=d.getOption("tabSize"),e=d.getLine(h.line),a=CodeMirror.countColumn(e,null,c),f,b=h.line+1,g=d.lineCount();b<g;++b)if(f=d.getLine(b),CodeMirror.countColumn(f,null,c)<a&&CodeMirror.countColumn(d.getLine(b-1),null,c)>a)return{from:CodeMirror.Pos(h.line,e.length),to:CodeMirror.Pos(b,f.length)}};
15
+ CodeMirror.newFoldFunction=function(d,h){if(null==h&&(h="↔"),"string"==typeof h){var c=document.createTextNode(h),h=document.createElement("span");h.appendChild(c);h.className="CodeMirror-foldmarker"}return function(c,a){var f,b,g,i,m;if("number"==typeof a&&(a=CodeMirror.Pos(a,0)),f=d(c,a),f){b=c.findMarksAt(f.from);for(i=g=0;i<b.length;++i)b[i].__isFold&&(++g,b[i].clear());g||(b=h.cloneNode(!0),CodeMirror.on(b,"mousedown",function(){m.clear()}),m=c.markText(f.from,f.to,{replacedWith:b,clearOnEnter:!0,
16
+ __isFold:!0}))}}};
17
+ (function(){CodeMirror.defineExtension("autoFormatAll",function(d,h){for(var c=this,e=c.getMode(),a=c.getRange(d,h).split("\n"),f=CodeMirror.copyState(e,c.getTokenAt(d).state),b=c.getOption("tabSize"),g="",i=0,m=0==d.ch,k,j=0;j<a.length;++j){for(k=new CodeMirror.StringStream(a[j],b);!k.eol();){var l=CodeMirror.innerMode(e,f),n=e.token(k,f),o=k.current();k.start=k.pos;(!m||/\S/.test(o))&&(g+=o,m=!1);if(!m&&l.mode.newlineAfterToken&&l.mode.newlineAfterToken(n,o,k.string.slice(k.pos)||a[j+1]||"",l.state))g+=
18
+ "\n",m=!0,++i}!k.pos&&e.blankLine&&e.blankLine(f);!m&&j<a.length-1&&(g+="\n",m=!0,++i)}c.operation(function(){c.replaceRange(g,d,h);for(var b=d.line+1,a=d.line+i;b<=a;++b)c.indentLine(b,"smart");c.setCursor({line:0,ch:0})})})})();
19
+ (function(){CodeMirror.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(d,c){return/^[;{}]$/.test(c)}});CodeMirror.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(d,c,e,a){return this.jsonMode?/^[\[,{]$/.test(c)||/^}/.test(e):";"==c&&a.lexical&&")"==a.lexical.type?!1:/^[;{}]$/.test(c)&&!/^;/.test(e)}});var d=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;
20
+ CodeMirror.extendMode("xml",{commentStart:"<\!--",commentEnd:"--\>",newlineAfterToken:function(h,c,e,a){var f=!1;return"html"==this.configuration&&(f=a.context?d.test(a.context.tagName):!1),!f&&("tag"==h&&/>$/.test(c)&&a.context||/^</.test(e))}});CodeMirror.defineExtension("commentRange",function(d,c,e){var a=this,f=CodeMirror.innerMode(a.getMode(),a.getTokenAt(c).state).mode;a.operation(function(){if(d)a.replaceRange(f.commentEnd,e),a.replaceRange(f.commentStart,c),c.line==e.line&&c.ch==e.ch&&a.setCursor(c.line,
21
+ c.ch+f.commentStart.length);else{var b=a.getRange(c,e),g=b.indexOf(f.commentStart),i=b.lastIndexOf(f.commentEnd);-1<g&&-1<i&&i>g&&(b=b.substr(0,g)+b.substring(g+f.commentStart.length,i)+b.substr(i+f.commentEnd.length));a.replaceRange(b,c,e)}})});CodeMirror.defineExtension("autoIndentRange",function(d,c){var e=this;this.operation(function(){for(var a=d.line;a<=c.line;a++)e.indentLine(a,"smart")})});CodeMirror.defineExtension("autoFormatRange",function(d,c){for(var e=this,a=e.getMode(),f=e.getRange(d,
22
+ c).split("\n"),b=CodeMirror.copyState(a,e.getTokenAt(d).state),g=e.getOption("tabSize"),i="",m=0,k=0==d.ch,j,l=0;l<f.length;++l){for(j=new CodeMirror.StringStream(f[l],g);!j.eol();){var n=CodeMirror.innerMode(a,b),o=a.token(j,b),p=j.current();j.start=j.pos;(!k||/\S/.test(p))&&(i+=p,k=!1);if(!k&&n.mode.newlineAfterToken&&n.mode.newlineAfterToken(o,p,j.string.slice(j.pos)||f[l+1]||"",n.state))i+="\n",k=!0,++m}!j.pos&&a.blankLine&&a.blankLine(b);!k&&l<f.length-1&&(i+="\n",k=!0,++m)}e.operation(function(){e.replaceRange(i,
23
+ d,c);for(var b=d.line+1,a=d.line+m;b<=a;++b)e.indentLine(b,"smart");e.setSelection(d,e.getCursor(!1))})})})();
24
+ (function(){function d(f){this.minChars="object"==typeof f&&f.minChars||e;this.style="object"==typeof f&&f.style||a;this.overlay=null}function h(a){a.operation(function(){var b=a._matchHighlightState,d;(b.overlay&&(a.removeOverlay(b.overlay),b.overlay=null),a.somethingSelected())&&((d=a.getSelection().replace(/^\s+|\s+$/g,""),d.length<b.minChars)||a.addOverlay(b.overlay=c(d,b.style)))})}function c(a,b){return{token:function(c){if(c.match(a))return b;c.next();c.skipTo(a.charAt(0))||c.skipToEnd()}}}
25
+ var e=2,a="matchhighlight";CodeMirror.defineOption("highlightSelectionMatches",!1,function(a,b,c){var c=c&&c!=CodeMirror.Init,e;if(b&&!c){a._matchHighlightState=new d(b);a.on("cursorActivity",h)}else!b&&c&&(e=a._matchHighlightState.overlay,e&&a.removeOverlay(e),a._matchHighlightState=null,a.off("cursorActivity",h))})})();
@@ -1,168 +1,188 @@
1
- window.CodeMirror=function(){function l(a,b){if(!(this instanceof l))return new l(a,b);this.options=b=b||{};for(var c in rb)!b.hasOwnProperty(c)&&rb.hasOwnProperty(c)&&(b[c]=rb[c]);sb(b);c=this.display=Xc(a);c.wrapper.CodeMirror=this;Ub(this);b.autofocus&&!Vb&&E(this);this.view=Yc(new Ia([new Ja([pa("",null,Z(c))])]));this.nextOpId=0;Ka(this);Wb(this);b.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");this.setValue(b.value||"");M&&setTimeout(L(ca,this,!0),20);this.view.history=tb();
2
- Zc(this);var d;try{d=document.activeElement==c.input}catch(e){}d||b.autofocus&&!Vb?setTimeout(L($,this),20):ub(this);q(this,function(){for(var a in da)if(da.propertyIsEnumerable(a))da[a](this,b[a],Xb);for(a=0;a<vb.length;++a)vb[a](this)})()}function Xc(a){var b={},c=b.input=n("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none;");N?c.style.width="1000px":c.setAttribute("wrap","off");c.setAttribute("autocorrect","off");c.setAttribute("autocapitalize","off");
3
- b.inputDiv=n("div",[c],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");b.scrollbarH=n("div",[n("div",null,null,"height: 1px")],"CodeMirror-hscrollbar");b.scrollbarV=n("div",[n("div",null,null,"width: 1px")],"CodeMirror-vscrollbar");b.scrollbarFiller=n("div",null,"CodeMirror-scrollbar-filler");b.lineDiv=n("div");b.selectionDiv=n("div",null,null,"position: relative; z-index: 1");b.cursor=n("div"," ","CodeMirror-cursor");b.otherCursor=n("div"," ","CodeMirror-cursor CodeMirror-secondarycursor");
4
- b.measure=n("div",null,"CodeMirror-measure");b.lineSpace=n("div",[b.measure,b.selectionDiv,b.lineDiv,b.cursor,b.otherCursor],null,"position: relative; outline: none");b.mover=n("div",[n("div",[b.lineSpace],"CodeMirror-lines")],null,"position: relative");b.sizer=n("div",[b.mover],"CodeMirror-sizer");b.heightForcer=n("div"," ",null,"position: absolute; height: "+qa+"px");b.gutters=n("div",null,"CodeMirror-gutters");b.lineGutter=null;var d=n("div",[b.sizer,b.heightForcer,b.gutters],null,"position: relative; min-height: 100%");
5
- b.scroller=n("div",[d],"CodeMirror-scroll");b.scroller.setAttribute("tabIndex","-1");b.wrapper=n("div",[b.inputDiv,b.scrollbarH,b.scrollbarV,b.scrollbarFiller,b.scroller],"CodeMirror");ea&&(b.gutters.style.zIndex=-1,b.scroller.style.paddingRight=0);a.appendChild?a.appendChild(b.wrapper):a(b.wrapper);La&&(c.style.width="0px");N||(b.scroller.draggable=!0);wb?(b.inputDiv.style.height="1px",b.inputDiv.style.position="absolute"):ea&&(b.scrollbarH.style.minWidth=b.scrollbarV.style.minWidth="18px");b.viewOffset=
6
- b.showingFrom=b.showingTo=b.lastSizeC=0;b.lineNumWidth=b.lineNumInnerWidth=b.lineNumChars=null;b.prevInput="";b.alignWidgets=!1;b.pollingFast=!1;b.poll=new xb;b.draggingText=!1;b.cachedCharWidth=b.cachedTextHeight=null;b.measureLineCache=[];b.measureLineCachePos=0;b.inaccurateSelection=!1;b.pasteIncoming=!1;b.wheelDX=b.wheelDY=b.wheelStartX=b.wheelStartY=null;return b}function Yc(a){var b={line:0,ch:0};return{doc:a,frontier:0,highlight:new xb,sel:{from:b,to:b,head:b,anchor:b,shift:!1,extend:!1},scrollTop:0,
7
- scrollLeft:0,overwrite:!1,focused:!1,maxLine:o(a,0),maxLineLength:0,maxLineChanged:!1,suppressEdits:!1,goalColumn:null,cantEdit:!1,keyMaps:[],overlays:[],modeGen:0}}function Ka(a){var b=a.view.doc;a.view.mode=l.getMode(a.options,a.options.mode);b.iter(0,b.size,function(a){a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null)});a.view.frontier=0;Ma(a,100);a.view.modeGen++;a.curOp&&F(a,0,b.size)}function Wb(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+
8
- a.options.theme.replace(/(^|\s)\s*/g," cm-s-");ra(a)}function sa(a){Ub(a);O(a,!0)}function Ub(a){var b=a.display.gutters,c=a.options.gutters;Na(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(n("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 Oa(a,b){if(0==b.height)return 0;for(var c=b.text.length,d,e=b;d=ta(e);)d=d.find(),e=o(a,d.from.line),c+=d.from.ch-d.to.ch;for(e=
9
- b;d=Pa(e);)d=d.find(),c-=e.text.length-d.from.ch,e=o(a,d.to.line),c+=e.text.length-d.to.ch;return c}function Yb(a){a.maxLine=o(a.doc,0);a.maxLineLength=Oa(a.doc,a.maxLine);a.maxLineChanged=!0;a.doc.iter(1,a.doc.size,function(b){var c=Oa(a.doc,b);c>a.maxLineLength&&(a.maxLineLength=c,a.maxLine=b)})}function sb(a){for(var b=!1,c=0;c<a.gutters.length;++c)"CodeMirror-linenumbers"==a.gutters[c]&&(a.lineNumbers?b=!0:a.gutters.splice(c--,1));!b&&a.lineNumbers&&a.gutters.push("CodeMirror-linenumbers")}function Zb(a,
10
- b){var c=b+2*a.lineSpace.offsetTop;a.sizer.style.minHeight=a.heightForcer.style.top=c+"px";var c=Math.max(c,a.scroller.scrollHeight),d=a.scroller.scrollWidth>a.scroller.clientWidth,e=c>a.scroller.clientHeight;e?(a.scrollbarV.style.display="block",a.scrollbarV.style.bottom=d?Qa(a.measure)+"px":"0",a.scrollbarV.firstChild.style.height=c-a.scroller.clientHeight+a.scrollbarV.clientHeight+"px"):a.scrollbarV.style.display="";d?(a.scrollbarH.style.display="block",a.scrollbarH.style.right=e?Qa(a.measure)+
11
- "px":"0",a.scrollbarH.firstChild.style.width=a.scroller.scrollWidth-a.scroller.clientWidth+a.scrollbarH.clientWidth+"px"):a.scrollbarH.style.display="";d&&e?(a.scrollbarFiller.style.display="block",a.scrollbarFiller.style.height=a.scrollbarFiller.style.width=Qa(a.measure)+"px"):a.scrollbarFiller.style.display="";$c&&0===Qa(a.measure)&&(a.scrollbarV.style.minWidth=a.scrollbarH.style.minHeight=ad?"18px":"12px")}function yb(a,b,c){var d=a.scroller.scrollTop,e=a.wrapper.clientHeight;"number"==typeof c?
12
- d=c:c&&(d=c.top,e=c.bottom-c.top);d=Math.floor(d-a.lineSpace.offsetTop);a=Math.ceil(d+e);return{from:Ra(b,d),to:Ra(b,a)}}function bd(a){if(!a.options.lineNumbers)return!1;var b=""+a.options.lineNumberFormatter(a.view.doc.size-1+a.options.firstLineNumber),a=a.display;if(b.length!=a.lineNumChars){var c=a.measure.appendChild(n("div",[n("div",b)],"CodeMirror-linenumber CodeMirror-gutter-elt")),d=c.firstChild.offsetWidth,c=c.offsetWidth-d;a.lineGutter.style.width="";a.lineNumInnerWidth=Math.max(d,a.lineGutter.offsetWidth-
13
- c);a.lineNumWidth=a.lineNumInnerWidth+c;a.lineNumChars=a.lineNumInnerWidth?b.length:-1;a.lineGutter.style.width=a.lineNumWidth+"px";return!0}return!1}function zb(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function O(a,b,c){var d=a.display.showingFrom,e=a.display.showingTo;if(b=$b(a,b,c))fa(a,a,"update",a),(a.display.showingFrom!=d||a.display.showingTo!=e)&&fa(a,a,"viewportChange",a,a.display.showingFrom,a.display.showingTo);Ab(a);Zb(a.display,a.view.doc.height);
14
- return b}function $b(a,b,c){var d=a.display,e=a.view.doc;if(d.wrapper.clientWidth){var f=yb(d,e,c);if(!(!0!==b&&0==b.length&&f.from>d.showingFrom&&f.to<d.showingTo)){b&&bd(a)&&(b=!0);var g=d.sizer.style.marginLeft=d.gutters.offsetWidth+"px";d.scrollbarH.style.left=a.options.fixedGutter?g:"0";if(!0!==b&&ua)for(var h=0;h<b.length;++h)for(var m=b[h];g=ta(o(e,m.from));)g=g.find().from.line,m.diff&&(m.diff-=m.from-g),m.from=g;m=!0===b?0:Infinity;if(a.options.lineNumbers&&b&&!0!==b)for(h=0;h<b.length;++h)if(b[h].diff){m=
15
- b[h].from;break}g=Math.max(f.from-a.options.viewportMargin,0);f=Math.min(e.size,f.to+a.options.viewportMargin);d.showingFrom<g&&20>g-d.showingFrom&&(g=d.showingFrom);d.showingTo>f&&20>d.showingTo-f&&(f=Math.min(e.size,d.showingTo));if(ua)for(g=G(ga(e,o(e,g)));f<e.size&&U(o(e,f));)++f;for(var b=!0===b?[]:cd([{from:d.showingFrom,to:d.showingTo}],b),j=0,h=0;h<b.length;++h){var i=b[h];i.from<g&&(i.from=g);i.to>f&&(i.to=f);i.from>=i.to?b.splice(h--,1):j+=i.to-i.from}if(!(j==f-g&&g==d.showingFrom&&f==d.showingTo)){b.sort(function(a,
16
- b){return a.from-b.from});h=document.activeElement;j<0.7*(f-g)&&(d.lineDiv.style.display="none");dd(a,g,f,b,m);d.lineDiv.style.display="";document.activeElement!=h&&h.offsetHeight&&h.focus();if(g!=d.showingFrom||f!=d.showingTo||d.lastSizeC!=d.wrapper.clientHeight)d.lastSizeC=d.wrapper.clientHeight;d.showingFrom=g;d.showingTo=f;Ma(a,100);m=d.lineDiv.offsetTop;for(b=d.lineDiv.firstChild;b;b=b.nextSibling)if(b.lineObj&&(ea?(j=b.offsetTop+b.offsetHeight,h=j-m,m=j):(h=b.getBoundingClientRect(),h=h.bottom-
17
- h.top),j=b.lineObj.height-h,2>h&&(h=Z(d)),0.001<j||-0.001>j))if(I(b.lineObj,h),j=b.lineObj.widgets)for(h=0;h<j.length;++h)j[h].height=j[h].node.offsetHeight;d.viewOffset=ha(a,o(e,g));d.mover.style.top=d.viewOffset+"px";yb(d,e,c).to>=f&&$b(a,[],c);return!0}}}else d.showingFrom=d.showingTo=d.viewOffset=0}function cd(a,b){for(var c=0,d=b.length||0;c<d;++c){for(var e=b[c],f=[],g=e.diff||0,h=0,m=a.length;h<m;++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?
18
- 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 ed(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:zb(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function dd(a,b,c,d,e){function f(b){var c=b.nextSibling;N&&ia&&a.display.currentWheelTarget==
19
- b?(b.style.display="none",b.lineObj=null):b.parentNode.removeChild(b);return c}var g=ed(a),h=a.display,m=a.options.lineNumbers;!d.length&&(!N||!a.display.currentWheelTarget)&&Na(h.lineDiv);var j=h.lineDiv,i=j.firstChild,k=d.shift(),r=b;for(a.view.doc.iter(b,c,function(b){k&&k.to==r&&(k=d.shift());if(U(b)){if(0!=b.height&&I(b,0),b.widgets&&i.previousSibling)for(var c=0;c<b.widgets.length;++c)if(b.widgets[c].showIfHidden){var h=i.previousSibling;if("pre"==h.nodeType){var A=n("div",null,null,"position: relative");
20
- h.parentNode.replaceChild(A,h);A.appendChild(h);h=A}h.appendChild(ac(b.widgets[c],h,g))}}else if(k&&k.from<=r&&k.to>r){for(;i.lineObj!=b;)i=f(i);m&&(e<=r&&i.lineNumber)&&bc(i.lineNumber,""+a.options.lineNumberFormatter(r+a.options.firstLineNumber));i=i.nextSibling}else{var c=a,v=r,h=cc(c,b),l=b.gutterMarkers,o=c.display;if(!c.options.lineNumbers&&!l&&!b.bgClass&&!b.wrapClass&&(!b.widgets||!b.widgets.length))c=h;else{A=n("div",null,b.wrapClass,"position: relative");if(c.options.lineNumbers||l){var Sa=
21
- A.appendChild(n("div",null,null,"position: absolute; left: "+(c.options.fixedGutter?g.fixedPos:-g.gutterTotalWidth)+"px"));c.options.fixedGutter&&(A.alignable=[Sa]);if(c.options.lineNumbers&&(!l||!l["CodeMirror-linenumbers"]))A.lineNumber=Sa.appendChild(n("div",""+c.options.lineNumberFormatter(v+c.options.firstLineNumber),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+g.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+o.lineNumInnerWidth+"px"));if(l)for(v=0;v<c.options.gutters.length;++v){var o=
22
- c.options.gutters[v],q=l.hasOwnProperty(o)&&l[o];q&&Sa.appendChild(n("div",[q],"CodeMirror-gutter-elt","left: "+g.gutterLeft[o]+"px; width: "+g.gutterWidth[o]+"px"))}}b.bgClass&&A.appendChild(n("div"," ",b.bgClass+" CodeMirror-linebackground"));A.appendChild(h);if(b.widgets){l=0;for(v=b.widgets;l<v.length;++l)o=v[l],q=ac(o,A,g),o.above?A.insertBefore(q,c.options.lineNumbers&&0!=b.height?Sa:h):A.appendChild(q)}ea&&(A.style.zIndex=2);c=A}j.insertBefore(c,i);c.lineObj=b}++r});i;)i=f(i)}function ac(a,
23
- b,c){var d=n("div",[a.node],"CodeMirror-linewidget");d.widget=a;a.noHScroll&&((b.alignable||(b.alignable=[])).push(d),b=c.wrapperWidth,d.style.left=c.fixedPos+"px",a.coverGutter||(b-=c.gutterTotalWidth,d.style.paddingLeft=c.gutterTotalWidth+"px"),d.style.width=b+"px");a.coverGutter&&(d.style.zIndex=5,d.style.position="relative",a.noHScroll||(d.style.marginLeft=-c.gutterTotalWidth+"px"));return d}function Ab(a){var b=a.display,c=u(a.view.sel.from,a.view.sel.to);if(c||a.options.showCursorWhenSelecting){var d=
24
- a.display,e=V(a,a.view.sel.head,"div");d.cursor.style.left=e.left+"px";d.cursor.style.top=e.top+"px";d.cursor.style.height=Math.max(0,e.bottom-e.top)*a.options.cursorHeight+"px";d.cursor.style.display="";e.other?(d.otherCursor.style.display="",d.otherCursor.style.left=e.other.left+"px",d.otherCursor.style.top=e.other.top+"px",d.otherCursor.style.height=0.85*(e.other.bottom-e.other.top)+"px"):d.otherCursor.style.display="none"}else b.cursor.style.display=b.otherCursor.style.display="none";c?b.selectionDiv.style.display=
25
- "none":fd(a);a=V(a,a.view.sel.head,"div");c=b.wrapper.getBoundingClientRect();d=b.lineDiv.getBoundingClientRect();b.inputDiv.style.top=Math.max(0,Math.min(b.wrapper.clientHeight-10,a.top+d.top-c.top))+"px";b.inputDiv.style.left=Math.max(0,Math.min(b.wrapper.clientWidth-10,a.left+d.left-c.left))+"px"}function fd(a){function b(a,b,c,d){0>b&&(b=0);g.appendChild(n("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?h-a:c)+"px; height: "+(d-b)+"px"))}function c(c,
26
- d,f,g){var j=o(e,c),i=j.text.length,k=g?Infinity:-Infinity;gd(P(j),d||0,null==f?i:f,function(e,r,l){var o=Ta(a,{line:c,ch:"rtl"==l?r-1:e},"div",j),l=Ta(a,{line:c,ch:"rtl"==l?e:r-1},"div",j),n=o.left,q=l.right;3<l.top-o.top&&(b(n,o.top,null,o.bottom),n=m,o.bottom<l.top&&b(n,o.bottom,null,l.top));null==f&&r==i&&(q=h);null==d&&0==e&&(n=m);k=g?Math.min(l.top,k):Math.max(l.bottom,k);n<m+1&&(n=m);b(n,l.top,q-n,l.bottom)});return k}var d=a.display,e=a.view.doc,f=a.view.sel,g=document.createDocumentFragment(),
27
- h=d.lineSpace.offsetWidth,m=ec(a.display);if(f.from.line==f.to.line)c(f.from.line,f.from.ch,f.to.ch);else{for(var j=o(e,f.from.line),i=j,k=[f.from.line,f.from.ch],r;i=Pa(i);){i=i.find();k.push(i.from.ch,i.to.line,i.to.ch);if(i.to.line==f.to.line){k.push(f.to.ch);r=!0;break}i=o(e,i.to.line)}if(r)for(f=0;f<k.length;f+=3)c(k[f],k[f+1],k[f+2]);else k=o(e,f.to.line),j=f.from.ch?c(f.from.line,f.from.ch,null,!1):ha(a,j)-d.viewOffset,f=f.to.ch?c(f.to.line,ta(k)?null:0,f.to.ch,!0):ha(a,k)-d.viewOffset,j<f&&
28
- b(m,j,null,f)}W(d.selectionDiv,g);d.selectionDiv.style.display=""}function Ua(a){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursor.style.visibility=b.otherCursor.style.visibility="";b.blinker=setInterval(function(){b.cursor.offsetHeight&&(b.cursor.style.visibility=b.otherCursor.style.visibility=(c=!c)?"":"hidden")},a.options.cursorBlinkRate)}function Ma(a,b){a.view.mode.startState&&a.view.frontier<a.display.showingTo&&a.view.highlight.set(b,L(hd,a))}function hd(a){var b=a.view,c=b.doc;if(!(b.frontier>=
29
- a.display.showingTo)){var d=+new Date+a.options.workTime,e=ja(b.mode,va(a,b.frontier)),f=[],g;c.iter(b.frontier,Math.min(c.size,a.display.showingTo+500),function(c){if(b.frontier>=a.display.showingFrom){var m=c.styles;c.styles=fc(a,c,e);for(var j=!m||m.length!=c.styles.length,i=0;!j&&i<m.length;++i)j=m[i]!=c.styles[i];j&&(g&&g.end==b.frontier?g.end++:f.push(g={start:b.frontier,end:b.frontier+1}));c.stateAfter=ja(b.mode,e)}else gc(a,c,e),c.stateAfter=0==b.frontier%5?ja(b.mode,e):null;++b.frontier;
30
- if(+new Date>d)return Ma(a,a.options.workDelay),!0});f.length&&q(a,function(){for(var a=0;a<f.length;++a)F(this,f[a].start,f[a].end)})()}}function id(a,b){for(var c,d,e=a.view.doc,f=b,g=b-100;f>g;--f){if(0==f)return 0;var h=o(e,f-1);if(h.stateAfter)return f;h=ka(h.text,null,a.options.tabSize);if(null==d||c>h)d=f-1,c=h}return d}function va(a,b){var c=a.view;if(!c.mode.startState)return!0;var d=id(a,b),e=d&&o(c.doc,d-1).stateAfter,e=e?ja(c.mode,e):hc(c.mode);c.doc.iter(d,b,function(f){gc(a,f,e);f.stateAfter=
31
- d==b-1||0==d%5||d>=c.showingFrom&&d<c.showingTo?ja(c.mode,e):null;++d});return e}function ec(a){return W(a.measure,n("pre")).appendChild(n("span","x")).offsetLeft}function Bb(a,b,c,d){for(var e=-1,d=d||Cb(a,b),a=c;;a+=e){var f=d[a];if(f)break;0>e&&0==a&&(e=1)}return{left:a<c?f.right:f.left,right:a>c?f.left:f.right,top:f.top,bottom:f.bottom}}function Cb(a,b){for(var c=a.display,d=a.display.measureLineCache,e=0;e<d.length;++e){var f=d[e];if(f.text==b.text&&f.markedSpans==b.markedSpans&&c.scroller.clientWidth==
32
- f.width)return f.measure}var g=a.display,e=ic(b.text.length),h=cc(a,b,e);if(M&&!ea&&!a.options.lineWrapping&&100<h.childNodes.length){for(var m=document.createDocumentFragment(),j=h.childNodes.length,f=0,i=Math.ceil(j/10);f<i;++f){for(var k=n("div",null,null,"display: inline-block"),r=0;10>r&&j;++r)k.appendChild(h.firstChild),--j;m.appendChild(k)}h.appendChild(m)}W(g.measure,h);j=g.lineDiv.getBoundingClientRect();m=[];g=ic(b.text.length);h=h.offsetHeight;for(f=0;f<e.length;++f)if(r=e[f]){for(var i=
33
- r.getBoundingClientRect(),k=Math.max(0,i.top-j.top),p=Math.min(i.bottom-j.top,h),r=0;r<m.length;r+=2){var l=m[r],o=m[r+1];if(!(l>p||o<k))if(l<=k&&o>=p||k<=l&&p>=o||Math.min(p,o)-Math.max(k,l)>=p-k>>1){m[r]=Math.min(k,l);m[r+1]=Math.max(p,o);break}}r==m.length&&m.push(k,p);g[f]={left:i.left-j.left,right:i.right-j.left,top:r}}for(f=0;f<g.length;++f)if(r=g[f])e=r.top,r.top=m[e],r.bottom=m[e+1];f={text:b.text,width:c.scroller.clientWidth,markedSpans:b.markedSpans,measure:g};16==d.length?d[++c.measureLineCachePos%
34
- 16]=f:d.push(f);return g}function ra(a){a.display.measureLineCache.length=a.display.measureLineCachePos=0;a.display.cachedCharWidth=a.display.cachedTextHeight=null;a.view.maxLineChanged=!0}function jc(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=Va(b.widgets[e]);c.top+=f;c.bottom+=f}if("line"==d)return c;d||(d="local");b=ha(a,b);"local"!=d&&(b-=a.display.viewOffset);"page"==d&&(a=a.display.lineSpace.getBoundingClientRect(),b+=a.top+(window.pageYOffset||(document.documentElement||
35
- document.body).scrollTop),a=a.left+(window.pageXOffset||(document.documentElement||document.body).scrollLeft),c.left+=a,c.right+=a);c.top+=b;c.bottom+=b;return c}function Ta(a,b,c,d){d||(d=o(a.view.doc,b.line));return jc(a,d,Bb(a,d,b.ch),c)}function V(a,b,c,d,e){function f(b,f){var g=Bb(a,d,b,e);f?g.left=g.right:g.right=g.left;return jc(a,d,g,c)}d=d||o(a.view.doc,b.line);e||(e=Cb(a,d));var g=P(d),b=b.ch;if(!g)return f(b);for(var h,m,j=g[0].level,i=0;i<g.length;++i){var k=g[i],r=k.level%2,p;if(k.from<
36
- b&&k.to>b)return f(b,r);var l=r?k.from:k.to;if((r?k.to:k.from)==b)k=i&&k.level<(p=g[i-1]).level?f(p.level%2?p.from:p.to-1,!0):f(r&&k.from!=k.to?b-1:b),r==j?h=k:m=k;else if(l==b&&(p=i<g.length-1&&g[i+1],r||!(p&&p.from==p.to)))k=p&&k.level<p.level?f(p.level%2?p.to-1:p.from):f(r?b:b-1,!0),r==j?h=k:m=k}j&&!b&&(m=f(g[0].to-1));if(!h)return m;m&&(h.other=m);return h}function Db(a,b,c){var d=a.view.doc,c=c+a.display.viewOffset;if(0>c)return{line:0,ch:0,outside:!0};var e=Ra(d,c);if(e>=d.size)return{line:d.size-
37
- 1,ch:o(d,d.size-1).text.length};for(0>b&&(b=0);;){var f=o(d,e),e=jd(a,f,e,b,c),g=(f=Pa(f))&&f.find();if(f&&e.ch>=g.from.ch)e=g.to.line;else return e}}function jd(a,b,c,d,e){function f(d){d=V(a,{line:c,ch:d},"line",b,j);h=!0;if(g>d.bottom)return Math.max(0,d.left-m);if(g<d.top)return d.left+m;h=!1;return d.left}var g=e-ha(a,b),h=!1,m=a.display.wrapper.clientWidth,j=Cb(a,b),i=P(b),k=b.text.length,e=Wa(b),r=Xa(b),p=ec(a.display),l=f(r);if(d>l)return{line:c,ch:r,outside:h};for(;;){if(i?r==e||r==Eb(b,
38
- e,1):1>=r-e){for(e=(d=d-p<l-d)?e:r;Fb.test(b.text.charAt(e));)++e;return{line:c,ch:e,after:d,outside:h}}var o=Math.ceil(k/2),n=e+o;if(i)for(var n=e,q=0;q<o;++q)n=Eb(b,n,1);q=f(n);q>d?(r=n,l=q,h&&(l+=1E3),k-=o):(e=n,p=q,k=o)}}function Z(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==aa){aa=n("pre");for(var b=0;49>b;++b)aa.appendChild(document.createTextNode("x")),aa.appendChild(n("br"));aa.appendChild(document.createTextNode("x"))}W(a.measure,aa);b=aa.offsetHeight/50;3<b&&(a.cachedTextHeight=
39
- b);Na(a.measure);return b||1}function kc(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=n("span","x"),c=n("pre",[b]);W(a.measure,c);b=b.offsetWidth;2<b&&(a.cachedCharWidth=b);return b||10}function Ya(a){a.curOp?++a.curOp.depth:a.curOp={depth:1,changes:[],delayedCallbacks:[],updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,updateMaxLine:!1,id:++a.nextOpId}}function Za(a){var b=a.curOp;if(!--b.depth){a.curOp=null;var c=a.view,d=a.display;b.updateMaxLine&&Yb(c);
40
- if(c.maxLineChanged&&!a.options.lineWrapping){var e=Bb(a,c.maxLine,c.maxLine.text.length).right;d.sizer.style.minWidth=e+3+qa+"px";c.maxLineChanged=!1;e=Math.max(0,d.sizer.offsetLeft+d.sizer.offsetWidth-d.scroller.clientWidth);e<c.scrollLeft&&la(a,Math.min(d.scroller.scrollLeft,e),!0)}var f,g;b.selectionChanged&&(d=V(a,c.sel.head),f=Gb(a,d.left,d.top,d.left,d.bottom));if(b.changes.length||f&&null!=f.scrollTop)g=O(a,b.changes,f&&f.scrollTop);!g&&b.selectionChanged&&Ab(a);if(f&&(d=a.view,g=lc(a,d.sel.head),
41
- d.focused)){d=a.display;e=d.sizer.getBoundingClientRect();f=null;if(0>g.top+e.top)f=!0;else if(g.bottom+e.top>(window.innerHeight||document.documentElement.clientHeight))f=!1;if(null!=f&&!kd){if(e="none"==d.cursor.style.display)d.cursor.style.display="",d.cursor.style.left=g.left+"px",d.cursor.style.top=g.top-d.viewOffset+"px";d.cursor.scrollIntoView(f);e&&(d.cursor.style.display="none")}}b.selectionChanged&&Ua(a);c.focused&&b.updateInput&&ca(a,b.userSelChange);b.textChanged&&ma(a,"change",a,b.textChanged);
42
- b.selectionChanged&&ma(a,"cursorActivity",a);for(c=0;c<b.delayedCallbacks.length;++c)b.delayedCallbacks[c](a)}}function q(a,b){return function(){var c=a||this;Ya(c);try{var d=b.apply(c,arguments)}finally{Za(c)}return d}}function F(a,b,c,d){a.curOp.changes.push({from:b,to:c,diff:d})}function $a(a){a.view.pollingFast||a.display.poll.set(a.options.pollInterval,function(){Hb(a);a.view.focused&&$a(a)})}function wa(a){function b(){!Hb(a)&&!c?(c=!0,a.display.poll.set(60,b)):(a.display.pollingFast=!1,$a(a))}
43
- var c=!1;a.display.pollingFast=!0;a.display.poll.set(20,b)}function Hb(a){var b=a.display.input,c=a.display.prevInput,d=a.view,e=d.sel;if(!d.focused||ld(b)||xa(a))return!1;var f=b.value;if(f==c&&u(e.from,e.to))return!1;Ya(a);d.sel.shift=!1;for(var g=0,h=Math.min(c.length,f.length);g<h&&c[g]==f[g];)++g;h=e.from;e=e.to;g<c.length?h={line:h.line,ch:h.ch-(c.length-g)}:d.overwrite&&(u(h,e)&&!a.display.pasteIncoming)&&(e={line:e.line,ch:Math.min(o(a.view.doc,e.line).text.length,e.ch+(f.length-g))});c=a.curOp.updateInput;
44
- Ib(a,h,e,ya(f.slice(g)),"end",a.display.pasteIncoming?"paste":"input",{from:h,to:e});a.curOp.updateInput=c;1E3<f.length?b.value=a.display.prevInput="":a.display.prevInput=f;Za(a);a.display.pasteIncoming=!1;return!0}function ca(a,b){var c=a.view,d,e;u(c.sel.from,c.sel.to)?b&&(a.display.prevInput=a.display.input.value=""):(a.display.prevInput="",d=mc&&(100<c.sel.to.line-c.sel.from.line||1E3<(e=a.getSelection()).length),a.display.input.value=d?"-":e||a.getSelection(),c.focused&&nc(a.display.input));
45
- a.display.inaccurateSelection=d}function E(a){"nocursor"!=a.options.readOnly&&(M||document.activeElement!=a.display.input)&&a.display.input.focus()}function xa(a){return a.options.readOnly||a.view.cantEdit}function Zc(a){function b(){a.view.focused&&setTimeout(L(E,a),0)}function c(){f.cachedCharWidth=f.cachedTextHeight=null;ra(a);O(a,!0)}function d(b){(!a.options.onDragEvent||!a.options.onDragEvent(a,za(b)))&&ab(b)}function e(){f.inaccurateSelection&&(f.prevInput="",f.inaccurateSelection=!1,f.input.value=
46
- a.getSelection(),nc(f.input))}var f=a.display;s(f.scroller,"mousedown",q(a,md));s(f.scroller,"dblclick",q(a,z));s(f.lineSpace,"selectstart",function(a){na(f,a)||z(a)});X||s(f.scroller,"contextmenu",function(b){oc(a,b)});s(f.scroller,"scroll",function(){Aa(a,f.scroller.scrollTop);la(a,f.scroller.scrollLeft,!0);ma(a,"scroll",a)});s(f.scrollbarV,"scroll",function(){Aa(a,f.scrollbarV.scrollTop)});s(f.scrollbarH,"scroll",function(){la(a,f.scrollbarH.scrollLeft)});s(f.scroller,"mousewheel",function(b){pc(a,
47
- b)});s(f.scroller,"DOMMouseScroll",function(b){pc(a,b)});s(f.scrollbarH,"mousedown",b);s(f.scrollbarV,"mousedown",b);s(f.wrapper,"scroll",function(){f.wrapper.scrollTop=f.wrapper.scrollLeft=0});window.registered||(window.registered=0);++window.registered;s(window,"resize",c);setTimeout(function h(){for(var a=f.wrapper.parentNode;a&&a!=document.body;a=a.parentNode);if(a)setTimeout(h,5E3);else{--window.registered;Q(window,"resize",c)}},5E3);s(f.input,"keyup",q(a,function(b){if((!a.options.onKeyEvent||
48
- !a.options.onKeyEvent(a,za(b)))&&C(b,"keyCode")==16)a.view.sel.shift=false}));s(f.input,"input",L(wa,a));s(f.input,"keydown",q(a,qc));s(f.input,"keypress",q(a,nd));s(f.input,"focus",L($,a));s(f.input,"blur",L(ub,a));a.options.dragDrop&&(s(f.scroller,"dragstart",function(b){var c=a;if(!na(c.display,b)){var d=c.getSelection();b.dataTransfer.setData("Text",d);if(b.dataTransfer.setDragImage&&!Jb){d=n("img",null,null,"position: fixed; left: 0; top: 0;");if(R){d.width=d.height=1;c.display.wrapper.appendChild(d);
49
- d._top=d.offsetTop}b.dataTransfer.setDragImage(d,0,0);R&&d.parentNode.removeChild(d)}}}),s(f.scroller,"dragenter",d),s(f.scroller,"dragover",d),s(f.scroller,"drop",q(a,od)));s(f.scroller,"paste",function(b){if(!na(f,b)){E(a);wa(a)}});s(f.input,"paste",function(){f.pasteIncoming=true;wa(a)});s(f.input,"cut",e);s(f.input,"copy",e);wb&&s(f.sizer,"mouseup",function(){document.activeElement==f.input&&f.input.blur();E(a)})}function na(a,b){for(var c=b.target||b.srcElement;c!=a.wrapper;c=c.parentNode)if(!c||
50
- /\bCodeMirror-(?:line)?widget\b/.test(c.className)||c.parentNode==a.sizer&&c!=a.mover)return!0}function Ba(a,b,c){var d=a.display;if(!c&&(c=b.target||b.srcElement,c==d.scrollbarH||c==d.scrollbarH.firstChild||c==d.scrollbarV||c==d.scrollbarV.firstChild||c==d.scrollbarFiller))return null;var e,f,d=d.lineSpace.getBoundingClientRect();try{e=b.clientX,f=b.clientY}catch(g){return null}return Db(a,e-d.left,f-d.top)}function md(a){function b(a){if("single"==k)y(e,w(m,j),a);else if(l=w(m,l),n=w(m,n),"double"==
51
- k){var b=rc(o(m,a.line).text,a);x(a,l)?y(e,b.from,n):y(e,l,b.to)}else"triple"==k&&(x(a,l)?y(e,n,w(m,{line:a.line,ch:0})):y(e,l,w(m,{line:a.line+1,ch:0})))}function c(a){var d=++v,h=Ba(e,a,!0);if(h)if(u(h,r)){var i=a.clientY<A.top?-20:a.clientY>A.bottom?20:0;i&&setTimeout(q(e,function(){v==d&&(f.scroller.scrollTop+=i,c(a))}),50)}else{g.focused||$(e);r=h;b(h);var j=yb(f,m);(h.line>=j.to||h.line<j.from)&&setTimeout(q(e,function(){v==d&&c(a)}),150)}}function d(a){v=Infinity;var c=Ba(e,a);c&&b(c);z(a);
52
- E(e);Q(document,"mousemove",t);Q(document,"mouseup",dc)}var e=this,f=e.display,g=e.view,h=g.sel,m=g.doc;h.shift=C(a,"shiftKey");if(na(f,a))N||(f.scroller.draggable=!1,setTimeout(function(){f.scroller.draggable=!0},100));else if(!pd(e,a)){var j=Ba(e,a);switch(sc(a)){case 3:X&&oc.call(e,e,a);return;case 2:j&&y(e,j);setTimeout(L(E,e),20);z(a);return}if(j){g.focused||$(e);var i=+new Date,k="single";bb&&bb.time>i-400&&u(bb.pos,j)?(k="triple",z(a),setTimeout(L(E,e),20),qd(e,j.line)):cb&&cb.time>i-400&&
53
- u(cb.pos,j)?(k="double",bb={time:i,pos:j},z(a),i=rc(o(m,j.line).text,j),y(e,i.from,i.to)):cb={time:i,pos:j};var r=j;if(e.options.dragDrop&&rd&&!xa(e)&&!u(h.from,h.to)&&!x(j,h.from)&&!x(h.to,j)&&"single"==k){var p=q(e,function(b){if(N)f.scroller.draggable=false;g.draggingText=false;Q(document,"mouseup",p);Q(f.scroller,"drop",p);if(Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-b.clientY)<10){z(b);y(e,j);E(e)}});N&&(f.scroller.draggable=!0);g.draggingText=p;f.scroller.dragDrop&&f.scroller.dragDrop();
54
- s(document,"mouseup",p);s(f.scroller,"drop",p)}else{z(a);"single"==k&&y(e,w(m,j));var l=h.from,n=h.to,A=f.wrapper.getBoundingClientRect(),v=0,t=q(e,function(a){!M&&!sc(a)?d(a):c(a)}),dc=q(e,d);s(document,"mousemove",t);s(document,"mouseup",dc)}}else(a.target||a.srcElement)==f.scroller&&z(a)}}function od(a){var b=this;if(!(na(b.display,a)||b.options.onDragEvent&&b.options.onDragEvent(b,za(a)))){z(a);var c=Ba(b,a,!0),d=a.dataTransfer.files;if(c&&!xa(b))if(d&&d.length&&window.FileReader&&window.File)for(var e=
55
- d.length,f=Array(e),g=0,a=function(a,d){var h=new FileReader;h.onload=function(){f[d]=h.result;++g==e&&(c=w(b.view.doc,c),q(b,function(){var a=Y(b,f.join(""),c,c,"paste");S(b,c,a)})())};h.readAsText(a)},h=0;h<e;++h)a(d[h],h);else if(b.view.draggingText&&!x(c,b.view.sel.from)&&!x(b.view.sel.to,c))b.view.draggingText(a),setTimeout(L(E,b),20);else try{if(f=a.dataTransfer.getData("Text")){var h=b.view.sel.from,m=b.view.sel.to;S(b,c,c);b.view.draggingText&&Y(b,"",h,m,"paste");b.replaceSelection(f,null,
56
- "paste");E(b);$(b)}}catch(j){}}}function pd(a,b){var c=a.display;try{var d=b.clientX,e=b.clientY}catch(f){return!1}if(d>=Math.floor(c.gutters.getBoundingClientRect().right))return!1;z(b);if(!tc(a,"gutterClick"))return!0;var g=c.lineDiv.getBoundingClientRect();if(e>g.bottom)return!0;e-=g.top-c.viewOffset;for(g=0;g<a.options.gutters.length;++g){var h=c.gutters.childNodes[g];if(h&&h.getBoundingClientRect().right>=d){c=Ra(a.view.doc,e);fa(a,a,"gutterClick",a,c,a.options.gutters[g],b);break}}return!0}
57
- function Aa(a,b){2>Math.abs(a.view.scrollTop-b)||(a.view.scrollTop=b,X||O(a,[],b),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbarV.scrollTop!=b&&(a.display.scrollbarV.scrollTop=b),X&&O(a,[]))}function la(a,b,c){if(!(c?b==a.view.scrollLeft:2>Math.abs(a.view.scrollLeft-b))){b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth);a.view.scrollLeft=b;c=a.display;if(c.alignWidgets||c.gutters.firstChild&&a.options.fixedGutter){for(var d=zb(c)-c.scroller.scrollLeft+
58
- a.view.scrollLeft,e=c.gutters.offsetWidth,f=d+"px",g=c.lineDiv.firstChild;g;g=g.nextSibling)if(g.alignable)for(var h=0,m=g.alignable;h<m.length;++h)m[h].style.left=f;a.options.fixedGutter&&(c.gutters.style.left=d+e+"px")}a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b);a.display.scrollbarH.scrollLeft!=b&&(a.display.scrollbarH.scrollLeft=b)}}function pc(a,b){var c=b.wheelDeltaX,d=b.wheelDeltaY;null==c&&(b.detail&&b.axis==b.HORIZONTAL_AXIS)&&(c=b.detail);null==d&&b.detail&&b.axis==
59
- b.VERTICAL_AXIS?d=b.detail:null==d&&(d=b.wheelDelta);if(d&&ia&&N)for(var e=b.target;e!=g;e=e.parentNode)if(e.lineObj){a.display.currentWheelTarget=e;break}var f=a.display,g=f.scroller;if(c&&!X&&!R&&null!=J)d&&Aa(a,Math.max(0,Math.min(g.scrollTop+d*J,g.scrollHeight-g.clientHeight))),la(a,Math.max(0,Math.min(g.scrollLeft+c*J,g.scrollWidth-g.clientWidth))),z(b),f.wheelStartX=null;else{if(d&&null!=J){var e=d*J,h=a.view.scrollTop,m=h+f.wrapper.clientHeight;0>e?h=Math.max(0,h+e-50):m=Math.min(a.view.doc.height,
60
- m+e+50);O(a,[],{top:h,bottom:m})}20>db&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=c,f.wheelDY=d,setTimeout(function(){if(f.wheelStartX!=null){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,a=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;f.wheelStartX=f.wheelStartY=null;if(a){J=(J*db+a)/(db+1);++db}}},200)):(f.wheelDX+=c,f.wheelDY+=d))}}function eb(a,b,c){if("string"==typeof b&&(b=Kb[b],!b))return!1;a.display.pollingFast&&Hb(a)&&(a.display.pollingFast=
61
- !1);var d=a.view,e=d.sel.shift;try{xa(a)&&(d.suppressEdits=!0),c&&(d.sel.shift=!1),b(a)}catch(f){if(f!=uc)throw f;return!1}finally{d.sel.shift=e,d.suppressEdits=!1}return!0}function vc(a){var b=a.view.keyMaps.slice(0);b.push(a.options.keyMap);a.options.extraKeys&&b.unshift(a.options.extraKeys);return b}function wc(a,b){function c(){h=!0}var d=Lb(a.options.keyMap),e=d.auto;clearTimeout(xc);e&&!yc(b)&&(xc=setTimeout(function(){Lb(a.options.keyMap)==d&&(a.options.keyMap=e.call?e.call(null,a):e)},50));
62
- var f=ba[C(b,"keyCode")],g=!1;if(null==f||b.altGraphKey)return!1;C(b,"altKey")&&(f="Alt-"+f);if(C(b,zc?"metaKey":"ctrlKey"))f="Ctrl-"+f;if(C(b,zc?"ctrlKey":"metaKey"))f="Cmd-"+f;var h=!1,g=vc(a),g=C(b,"shiftKey")?fb("Shift-"+f,g,function(b){return eb(a,b,!0)},c)||fb(f,g,function(b){if("string"==typeof b&&/^go[A-Z]/.test(b))return eb(a,b)},c):fb(f,g,function(b){return eb(a,b)},c);h&&(g=!1);g&&(z(b),Ua(a),gb&&(b.oldKeyCode=b.keyCode,b.keyCode=0));return g}function sd(a,b,c){if(c=fb("'"+c+"'",vc(a),
63
- function(b){return eb(a,b,!0)}))z(b),Ua(a);return c}function qc(a){this.view.focused||$(this);M&&27==a.keyCode&&(a.returnValue=!1);if(!this.options.onKeyEvent||!this.options.onKeyEvent(this,za(a))){var b=C(a,"keyCode");this.view.sel.shift=16==b||C(a,"shiftKey");var c=wc(this,a);R&&(Mb=c?b:null,!c&&(88==b&&!mc&&C(a,ia?"metaKey":"ctrlKey"))&&this.replaceSelection(""))}}function nd(a){var b=this;if(!b.options.onKeyEvent||!b.options.onKeyEvent(b,za(a))){var c=C(a,"keyCode"),d=C(a,"charCode");if(R&&c==
64
- Mb)Mb=null,z(a);else if(!(R&&(!a.which||10>a.which)||wb)||!wc(b,a))c=String.fromCharCode(null==d?c:d),this.options.electricChars&&(this.view.mode.electricChars&&this.options.smartIndent&&!xa(this)&&-1<this.view.mode.electricChars.indexOf(c))&&setTimeout(q(b,function(){hb(b,b.view.sel.to.line,"smart")}),75),sd(b,a,c)||wa(b)}}function $(a){"nocursor"!=a.options.readOnly&&(a.view.focused||(ma(a,"focus",a),a.view.focused=!0,-1==a.display.scroller.className.search(/\bCodeMirror-focused\b/)&&(a.display.scroller.className+=
65
- " CodeMirror-focused"),ca(a,!0)),$a(a),Ua(a))}function ub(a){a.view.focused&&(ma(a,"blur",a),a.view.focused=!1,a.display.scroller.className=a.display.scroller.className.replace(" CodeMirror-focused",""));clearInterval(a.display.blinker);setTimeout(function(){if(!a.view.focused)a.view.sel.shift=false},150)}function oc(a,b){function c(){d.inputDiv.style.position="relative";d.input.style.cssText=h;gb&&(d.scrollbarV.scrollTop=d.scroller.scrollTop=g);$a(a);if(null!=d.input.selectionStart){clearTimeout(Nb);
66
- var b=d.input.value=" "+(u(e.from,e.to)?"":d.input.value),c=0;d.prevInput=" ";d.input.selectionStart=1;d.input.selectionEnd=b.length;Nb=setTimeout(function k(){d.prevInput==" "&&d.input.selectionStart==0?q(a,Kb.selectAll)(a):c++<10?Nb=setTimeout(k,500):ca(a)},200)}}var d=a.display;if(!na(d,b)){var e=a.view.sel,f=Ba(a,b),g=d.scroller.scrollTop;if(f&&!R){(u(e.from,e.to)||x(f,e.from)||!x(f,e.to))&&q(a,S)(a,f,f);var h=d.input.style.cssText;d.inputDiv.style.position="absolute";d.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+
67
- (b.clientY-5)+"px; left: "+(b.clientX-5)+"px; z-index: 1000; background: white; outline: none;border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";E(a);ca(a,!0);u(e.from,e.to)&&(d.input.value=d.prevInput=" ");X?(ab(b),s(window,"mouseup",function j(){Q(window,"mouseup",j);setTimeout(c,20)})):setTimeout(c,50)}}}function Ib(a,b,c,d,e,f){var g=Ac&&td(a.view.doc,b,c);if(g){for(b=g.length-1;1<=b;--b)ib(a,g[b].from,g[b].to,[""],f);if(g.length)return ib(a,g[0].from,g[0].to,
68
- d,e,f)}else return ib(a,b,c,d,e,f)}function ib(a,b,c,d,e,f){if(!a.view.suppressEdits){var g=a.view,h=[];g.doc.iter(b.line,c.line+1,function(a){h.push(Ca(a.text,a.markedSpans))});var m=g.sel.from,j=g.sel.to,i=ud(H(h[0]),H(K(h)),b.ch,c.ch,d),c=Bc(a,b,c,i,e,f);g.history&&vd(a,b.line,d.length,h,f,m,j,g.sel.from,g.sel.to);return c}}function Cc(a,b){var c=a.view.doc,d=a.view.history,e=("undo"==b?d.done:d.undone).pop();if(e){for(var f={events:[],fromBefore:e.fromAfter,toBefore:e.toAfter,fromAfter:e.fromBefore,
69
- toAfter:e.toBefore},g=e.events.length-1;0<=g;g-=1){d.dirtyCounter+="undo"==b?-1:1;var h=e.events[g],m=[],j=h.start+h.added;c.iter(h.start,j,function(a){m.push(Ca(a.text,a.markedSpans))});f.events.push({start:h.start,added:h.old.length,old:m});var i=g?null:{from:e.fromBefore,to:e.toBefore};Bc(a,{line:h.start,ch:0},{line:j-1,ch:o(c,j-1).text.length},h.old,i,b)}("undo"==b?d.undone:d.done).push(f)}}function Bc(a,b,c,d,e,f){var g=a.view,h=g.doc,m=a.display;if(!g.suppressEdits){var j=c.line-b.line,i=o(h,
70
- b.line),k=o(h,c.line),r=!1,p=b.line;a.options.lineWrapping||(p=G(ga(h,i)),h.iter(p,c.line+1,function(a){if(a==g.maxLine)return r=!0}));var l=K(d),n=Z(m);if(0==b.ch&&0==c.ch&&""==D(l)){for(var q=[],v=0,s=d.length-1;v<s;++v)q.push(pa(D(d[v]),H(d[v]),n));oa(a,k,k.text,H(l));j&&h.remove(b.line,j,a);q.length&&h.insert(b.line,q)}else if(i==k)if(1==d.length)oa(a,i,i.text.slice(0,b.ch)+D(d[0])+i.text.slice(c.ch),H(d[0]));else{q=[];v=1;for(s=d.length-1;v<s;++v)q.push(pa(D(d[v]),H(d[v]),n));q.push(pa(D(l)+
71
- i.text.slice(c.ch),H(l),n));oa(a,i,i.text.slice(0,b.ch)+D(d[0]),H(d[0]));h.insert(b.line+1,q)}else if(1==d.length)oa(a,i,i.text.slice(0,b.ch)+D(d[0])+k.text.slice(c.ch),H(d[0])),h.remove(b.line+1,j,a);else{q=[];oa(a,i,i.text.slice(0,b.ch)+D(d[0]),H(d[0]));oa(a,k,D(l)+k.text.slice(c.ch),H(l));v=1;for(s=d.length-1;v<s;++v)q.push(pa(D(d[v]),H(d[v]),n));1<j&&h.remove(b.line+1,j-1,a);h.insert(b.line+1,q)}if(a.options.lineWrapping){var t=Math.max(5,m.scroller.clientWidth/kc(m)-3);h.iter(b.line,b.line+d.length,
72
- function(a){if(a.height!=0){var b=(Math.ceil(a.text.length/t)||1)*n;b!=a.height&&I(a,b)}})}else h.iter(p,b.line+d.length,function(a){var b=Oa(h,a);if(b>g.maxLineLength){g.maxLine=a;g.maxLineLength=b;g.maxLineChanged=true;r=false}}),r&&(a.curOp.updateMaxLine=!0);g.frontier=Math.min(g.frontier,b.line);Ma(a,400);var w=d.length-j-1;F(a,b.line,c.line+1,w);if(tc(a,"change")){for(v=0;v<d.length;++v)"string"!=typeof d[v]&&(d[v]=d[v].text);f={from:b,to:c,text:d,origin:f};if(a.curOp.textChanged){for(m=a.curOp.textChanged;m.next;m=
73
- m.next);m.next=f}else a.curOp.textChanged=f}var u={line:b.line+d.length-1,ch:D(l).length+(1==d.length?b.ch:0)};e&&"string"!=typeof e?e.from?(d=e.from,e=e.to):d=e:"end"==e?d=e=u:"start"==e?d=e=b:"around"==e?(d=b,e=u):(e=function(a){if(x(a,b))return a;if(!x(c,a))return u;var d=a.line+w,e=a.ch;a.line==c.line&&(e=e+(D(l).length-(c.ch-(c.line==b.line?b.ch:0))));return{line:d,ch:e}},d=e(g.sel.from),e=e(g.sel.to));S(a,d,e,null,!0);return u}}function Y(a,b,c,d,e){d||(d=c);if(x(d,c))var f=d,d=c,c=f;return Ib(a,
74
- c,d,ya(b),null,e)}function u(a,b){return a.line==b.line&&a.ch==b.ch}function x(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function w(a,b){if(0>b.line)return{line:0,ch:0};if(b.line>=a.size)return{line:a.size-1,ch:o(a,a.size-1).text.length};var c=b.ch,d=o(a,b.line).text.length;return null==c||c>d?{line:b.line,ch:d}:0>c?{line:b.line,ch:0}:b}function y(a,b,c,d){var e=a.view.sel;if(e.shift||e.extend){e=e.anchor;if(c){var f=x(b,e);f!=x(c,e)?(e=b,b=c):f!=x(b,c)&&(b=c)}S(a,e,b,d)}else S(a,b,c||
75
- b,d);a.curOp.userSelChange=!0}function S(a,b,c,d,e){a.view.goalColumn=null;var f=a.view.sel;if(e||!u(b,f.anchor))b=jb(a,b,d,"push"!=e);if(e||!u(c,f.head))c=jb(a,c,d,"push"!=e);if(!u(f.anchor,b)||!u(f.head,c))f.anchor=b,f.head=c,d=x(c,b),f.from=d?c:b,f.to=d?b:c,a.curOp.updateInput=!0,a.curOp.selectionChanged=!0}function Dc(a){S(a,a.view.sel.from,a.view.sel.to,null,"push")}function jb(a,b,c,d){var e=a.view.doc,f=!1,g=b,h=c||1;a.view.cantEdit=!1;a:for(;;){var m=o(e,g.line),j;if(m.markedSpans){for(var i=
76
- 0;i<m.markedSpans.length;++i){var k=m.markedSpans[i],r=k.marker;if((null==k.from||(r.inclusiveLeft?k.from<=g.ch:k.from<g.ch))&&(null==k.to||(r.inclusiveRight?k.to>=g.ch:k.to>g.ch)))if(d&&r.clearOnEnter)(j||(j=[])).push(r);else if(r.atomic){i=r.find()[0>h?"from":"to"];if(u(i,g)&&(i.ch+=h,0>i.ch?i=i.line?w(e,{line:i.line-1}):null:i.ch>m.text.length&&(i=i.line<e.size-1?{line:i.line+1,ch:0}:null),!i)){if(f){if(!d)return jb(a,b,c,!0);a.view.cantEdit=!0;return{line:0,ch:0}}f=!0;i=b;h=-h}g=i;continue a}}if(j)for(i=
77
- 0;i<j.length;++i)j[i].clear()}return g}}function lc(a,b){for(;;){var c=!1,d=V(a,b),e=Gb(a,d.left,d.top,d.left,d.bottom),f=a.view.scrollTop,g=a.view.scrollLeft;null!=e.scrollTop&&(Aa(a,e.scrollTop),1<Math.abs(a.view.scrollTop-f)&&(c=!0));null!=e.scrollLeft&&(la(a,e.scrollLeft),1<Math.abs(a.view.scrollLeft-g)&&(c=!0));if(!c)return d}}function Ec(a,b,c,d,e){b=Gb(a,b,c,d,e);null!=b.scrollTop&&Aa(a,b.scrollTop);null!=b.scrollLeft&&la(a,b.scrollLeft)}function Gb(a,b,c,d,e){var f=a.display,g=f.lineSpace.offsetTop,
78
- c=c+g,e=e+g,h=f.scroller.clientHeight-qa,m=f.scroller.scrollTop,j={},a=a.view.doc.height+2*g,i=c<g+10,g=e+g>a-10;c<m?j.scrollTop=i?0:Math.max(0,c):e>m+h&&(j.scrollTop=(g?a:e)-h);c=f.scroller.clientWidth-qa;e=f.scroller.scrollLeft;b+=f.gutters.offsetWidth;d+=f.gutters.offsetWidth;f=f.gutters.offsetWidth;h=b<f+10;b<e+f||h?(h&&(b=0),j.scrollLeft=Math.max(0,b-10-f)):d>c+e-3&&(j.scrollLeft=d+10-c);return j}function hb(a,b,c,d){var e=a.view.doc;c||(c="add");if("smart"==c)if(a.view.mode.indent)var f=va(a,
79
- b);else c="prev";var g=a.options.tabSize,h=o(e,b),m=ka(h.text,null,g),j=h.text.match(/^\s*/)[0],i;if("smart"==c&&(i=a.view.mode.indent(f,h.text.slice(j.length),h.text),i==uc)){if(!d)return;c="prev"}"prev"==c?i=b?ka(o(e,b-1).text,null,g):0:"add"==c?i=m+a.options.indentUnit:"subtract"==c&&(i=m-a.options.indentUnit);i=Math.max(0,i);c="";d=0;if(a.options.indentWithTabs)for(e=Math.floor(i/g);e;--e)d+=g,c+="\t";d<i&&(c+=Fc(i-d));c!=j&&Y(a,c,{line:b,ch:0},{line:b,ch:j.length},"input");h.stateAfter=null}
80
- function kb(a,b,c){var d=b,e=b,f=a.view.doc;"number"==typeof b?e=o(f,Math.max(0,Math.min(b,f.size-1))):d=G(b);if(null!=d&&c(e,d))F(a,d,d+1);else return null;return e}function Gc(a,b,c,d){function e(a){var c=(d?Eb:Hc)(j,m,b,!0);if(null==c){if(a=!a)a=h+b,0>a||a==f.size?a=!1:(h=a,a=j=o(f,a));if(a)m=d?(0>b?Xa:Wa)(j):0>b?j.text.length:0;else return!1}else m=c;return!0}var f=a.view.doc,g=a.view.sel.head,h=g.line,m=g.ch,j=o(f,h);if("char"==c)e();else if("column"==c)e(!0);else if("word"==c)for(c=!1;!(0>b)||
81
- e();){if(lb(j.text.charAt(m)))c=!0;else if(c){0>b&&(b=1,e());break}if(0<b&&!e())break}return jb(a,{line:h,ch:m},b,!0)}function rc(a,b){var c=b.ch,d=b.ch;if(a){!1===b.after||d==a.length?--c:++d;for(var e=a.charAt(c),e=lb(e)?lb:/\s/.test(e)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!lb(a)};0<c&&e(a.charAt(c-1));)--c;for(;d<a.length&&e(a.charAt(d));)++d}return{from:{line:b.line,ch:c},to:{line:b.line,ch:d}}}function qd(a,b){y(a,{line:b,ch:0},w(a.view.doc,{line:b+1,ch:0}))}function t(a,
82
- b,c,d){l.defaults[a]=b;c&&(da[a]=d?function(a,b,d){d!=Xb&&c(a,b,d)}:c)}function ja(a,b){if(!0===b)return b;if(a.copyState)return a.copyState(b);var c={},d;for(d in b){var e=b[d];e instanceof Array&&(e=e.concat([]));c[d]=e}return c}function hc(a,b,c){return a.startState?a.startState(b,c):!0}function Lb(a){return"string"==typeof a?T[a]:a}function fb(a,b,c,d){function e(b){var b=Lb(b),f=b[a];if(!1===f)return d&&d(),!0;if(null!=f&&c(f))return!0;if(b.nofallthrough)return d&&d(),!0;b=b.fallthrough;if(null==
83
- b)return!1;if("[object Array]"!=Object.prototype.toString.call(b))return e(b);for(var f=0,m=b.length;f<m;++f)if(e(b[f]))return!0;return!1}for(var f=0;f<b.length;++f)if(e(b[f]))return!0}function yc(a){a=ba[C(a,"keyCode")];return"Ctrl"==a||"Alt"==a||"Shift"==a||"Mod"==a}function Da(a,b){this.pos=this.start=0;this.string=a;this.tabSize=b||8}function Ea(a,b){this.lines=[];this.type=b;this.cm=a}function Ic(a,b,c,d,e){var f=a.view.doc,g=new Ea(a,e);if("range"==e&&!x(b,c))return g;if(d)for(var h in d)d.hasOwnProperty(h)&&
84
- (g[h]=d[h]);g.replacedWith&&(g.collapsed=!0,g.replacedWith=n("span",[g.replacedWith],"CodeMirror-widget"));g.collapsed&&(ua=!0);var m=b.line,j=0,i,k;f.iter(m,c.line+1,function(d){if(g.collapsed&&!a.options.lineWrapping&&ga(f,d)==a.view.maxLine)a.curOp.updateMaxLine=true;var e={from:null,to:null,marker:g};j=j+d.text.length;if(m==b.line){e.from=b.ch;j=j-b.ch}if(m==c.line){e.to=c.ch;j=j-(d.text.length-c.ch)}if(g.collapsed){m==c.line&&(k=mb(d,c.ch));m==b.line?i=mb(d,b.ch):I(d,0)}d.markedSpans=d.markedSpans?
85
- d.markedSpans.concat([e]):[e];e.marker.lines.push(d);++m});g.collapsed&&f.iter(b.line,c.line+1,function(a){U(a)&&I(a,0)});g.readOnly&&(Ac=!0,(a.view.history.done.length||a.view.history.undone.length)&&a.clearHistory());if(g.collapsed){if(i!=k)throw Error("Inserting collapsed marker overlapping an existing one");g.size=j;g.atomic=!0}(g.className||g.startStyle||g.endStyle||g.collapsed)&&F(a,b.line,c.line+1);g.atomic&&Dc(a);return g}function Fa(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==
86
- b)return d}}function ud(a,b,c,d,e){if(!a&&!b)return e;if(a)for(var f=0,g;f<a.length;++f){var h=a[f],m=h.marker;if(null==h.from||(m.inclusiveLeft?h.from<=c:h.from<c)||"bookmark"==m.type&&h.from==c){var j=null==h.to||(m.inclusiveRight?h.to>=c:h.to>c);(g||(g=[])).push({from:h.from,to:j?null:h.to,marker:m})}}a=g;if(b)for(var f=0,i;f<b.length;++f)if(g=b[f],h=g.marker,null==g.to||(h.inclusiveRight?g.to>=d:g.to>d)||"bookmark"==h.type&&g.from==d&&g.from!=c)m=null==g.from||(h.inclusiveLeft?g.from<=d:g.from<
87
- d),(i||(i=[])).push({from:m?null:g.from-d,to:null==g.to?null:g.to-d,marker:h});b=i;i=1==e.length;f=K(e).length+(i?c:0);if(a)for(d=0;d<a.length;++d)g=a[d],null==g.to&&((h=Fa(b,g.marker))?i&&(g.to=null==h.to?null:h.to+f):g.to=c);if(b)for(d=0;d<b.length;++d)(g=b[d],null!=g.to&&(g.to+=f),null==g.from)?(h=Fa(a,g.marker),h||(g.from=f,i&&(a||(a=[])).push(g))):(g.from+=f,i&&(a||(a=[])).push(g));c=[Ca(e[0],a)];if(!i){i=e.length-2;var k;if(0<i&&a)for(d=0;d<a.length;++d)null==a[d].to&&(k||(k=[])).push({from:null,
88
- to:null,marker:a[d].marker});for(d=0;d<i;++d)c.push(Ca(e[d+1],k));c.push(Ca(K(e),b))}return c}function td(a,b,c){var d=null;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;if(c.readOnly&&(!d||-1==nb(d,c)))(d||(d=[])).push(c)}});if(!d)return null;a=[{from:b,to:c}];for(b=0;b<d.length;++b)for(var c=d[b].find(),e=0;e<a.length;++e){var f=a[e];if(x(c.from,f.to)&&!x(c.to,f.from)){var g=[e,1];x(f.from,c.from)&&g.push({from:f.from,to:c.from});
89
- x(c.to,f.to)&&g.push({from:c.to,to:f.to});a.splice.apply(a,g);e+=g.length-1}}return a}function mb(a,b){var c=ua&&a.markedSpans,d;if(c)for(var e,f=0;f<c.length;++f)if(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 ta(a){return mb(a,-1)}function Pa(a){return mb(a,a.text.length+1)}function ga(a,b){for(var c;c=ta(b);)b=o(a,c.find().from.line);return b}function U(a){var b=ua&&a.markedSpans;if(b)for(var c,d=0;d<b.length;++d)if(c=
90
- b[d],c.marker.collapsed&&(null==c.from||0==c.from&&c.marker.inclusiveLeft&&Ob(a,c)))return!0}function Ob(a,b){if(null==b.to){for(var c=b.marker.find().to,d=a.parent;d.parent;d=d.parent);c=o(d,c.line);return Ob(c,Fa(c.markedSpans,b.marker))}if(b.marker.inclusiveRight&&b.to==a.text.length)return!0;for(d=0;d<a.markedSpans.length;++d)if(c=a.markedSpans[d],c.marker.collapsed&&c.from==b.to&&(c.marker.inclusiveLeft||b.marker.inclusiveRight)&&Ob(a,c))return!0}function D(a){return"string"==typeof a?a:a.text}
91
- function H(a){if("string"==typeof a)return null;for(var a=a.markedSpans,b=null,c=0;c<a.length;++c)a[c].marker.explicitlyCleared?b||(b=a.slice(0,c)):b&&b.push(a[c]);return!b?a:b.length?b:null}function Ca(a,b){return b?{text:a,markedSpans:b}:a}function Jc(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c){var d=b[c].marker.lines,e=nb(d,a);d.splice(e,1)}a.markedSpans=null}}function Kc(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.lines.push(a);a.markedSpans=b}}function Lc(a){return function(){Ya(this.cm);
92
- try{var b=a.apply(this,arguments)}finally{Za(this.cm)}return b}}function Va(a){if(null!=a.height)return a.height;(!a.node.parentNode||1!=a.node.parentNode.nodeType)&&W(a.cm.display.measure,n("div",[a.node],null,"position: relative"));return a.height=a.node.offsetHeight}function wd(a,b,c,d){var e=new Pb(a,c,d);e.noHScroll&&(a.display.alignWidgets=!0);kb(a,b,function(b){(b.widgets||(b.widgets=[])).push(e);e.line=b;if(!U(b)||e.showIfHidden){var c=ha(a,b)<a.display.scroller.scrollTop;I(b,b.height+Va(e));
93
- c&&setTimeout(function(){a.display.scroller.scrollTop=a.display.scroller.scrollTop+e.height})}return true});return e}function pa(a,b,c){a={text:a,height:c};Kc(a,b);U(a)&&(a.height=0);return a}function oa(a,b,c,d){b.text=c;b.stateAfter&&(b.stateAfter=null);b.styles&&(b.styles=null);null!=b.order&&(b.order=null);Jc(b);Kc(b,d);U(b)?b.height=0:b.height||(b.height=Z(a.display));fa(a,b,"change")}function Mc(a,b,c,d,e){var f=a.options.flattenSpans,g="",h=null,a=new Da(b,a.options.tabSize);for(""==b&&c.blankLine&&
94
- c.blankLine(d);!a.eol();){var m=c.token(a,d);5E3<a.pos&&(f=!1,a.pos=Math.min(b.length,a.start+5E4),m=null);var j=a.current();a.start=a.pos;!f||h!=m?(g&&e(g,h),g=j,h=m):g+=j}g&&e(g,h)}function fc(a,b,c){var d=[a.view.modeGen];Mc(a,b.text,a.view.mode,c,function(a,b){d.push(a,b)});for(c=0;c<a.view.overlays.length;++c){var e=a.view.overlays[c],f=1;Mc(a,b.text,e.mode,!0,function(a,b){for(var c=f,j=a.length;j;){var i=d[f],k=i.length;if(k<=j)j=j-k;else{d.splice(f,1,i.slice(0,j),d[f+1],i.slice(j));j=0}f=
95
- f+2}if(b)if(e.opaque){d.splice(c,f-c,a,b);f=c+2}else for(;c<f;c=c+2){i=d[c+1];d[c+1]=i?i+" "+b:b}})}return d}function gc(a,b,c){var d=a.view.mode,a=new Da(b.text,a.options.tabSize);for(""==b.text&&d.blankLine&&d.blankLine(c);!a.eol()&&5E3>=a.pos;)d.token(a,c),a.start=a.pos}function Nc(a){return!a?null:Oc[a]||(Oc[a]="cm-"+a.replace(/ +/g," cm-"))}function cc(a,b,c){for(var d,e=b,f,g,h=!0;d=ta(e);)h=!1,e=o(a.view.doc,d.find().from.line),f||(f=e);d={pre:n("pre"),col:0,pos:0,display:!c,measure:null,addedOne:!1,
96
- cm:a};e.textClass&&(d.pre.className=e.textClass);do{d.measure=e==b&&c;d.pos=0;d.addToken=d.measure?xd:Pc;c&&(g&&e!=b&&!d.addedOne)&&(c[0]=d.pre.appendChild(Qc(a.display.measure)),d.addedOne=!0);var m=e;g=d;var j=e;if(!j.styles||j.styles[0]!=a.view.modeGen)j.styles=fc(a,j,j.stateAfter=va(a,G(j)));a:{var i=m,j=j.styles;if(m=i.markedSpans)for(var i=i.text.length,k=0,r=1,l="",q=void 0,s=0,t=void 0,v=void 0,w=void 0,u=void 0;;){if(s==k){for(var t=v=w="",u=null,s=Infinity,x=null,z=0;z<m.length;++z){var B=
97
- m[z],y=B.marker;if(B.from<=k&&(null==B.to||B.to>k)){if(null!=B.to&&s>B.to&&(s=B.to,v=""),y.className&&(t+=" "+y.className),y.startStyle&&B.from==k&&(w+=" "+y.startStyle),y.endStyle&&B.to==s&&(v+=" "+y.endStyle),y.collapsed&&(!u||u.marker.width<y.width))u=B}else B.from>k&&s>B.from&&(s=B.from);"bookmark"==y.type&&(B.from==k&&y.replacedWith)&&(x=y.replacedWith)}if(u&&(u.from||0)==k)if(Rc(g,(null==u.to?i:u.to)-k,null!=u.from&&u.marker.replacedWith),null==u.to){j=u.marker.find();break a}x&&!u&&Rc(g,0,
98
- x)}if(k>=i)break;for(x=Math.min(i,s);;){if(l){z=k+l.length;u||(B=z>x?l.slice(0,x-k):l,g.addToken(g,B,q+t,w,k+B.length==s?v:""));if(z>=x){l=l.slice(x-k);k=x;break}k=z;w=""}l=j[r++];q=Nc(j[r++])}}else for(var r=1;r<j.length;r+=2)g.addToken(g,j[r],Nc(j[r+1]));j=void 0}g=e==f;j&&(e=o(a.view.doc,j.to.line),h=!1)}while(j);c&&!d.addedOne&&(c[0]=d.pre.appendChild(h?n("span"," "):Qc(a.display.measure)));!d.pre.firstChild&&!U(b)&&d.pre.appendChild(document.createTextNode(" "));return d.pre}function Pc(a,b,
99
- c,d,e){if(b){if(Qb.test(b))for(var f=document.createDocumentFragment(),g=0;;){Qb.lastIndex=g;var h=Qb.exec(b),m=h?h.index-g:b.length-g;m&&(f.appendChild(document.createTextNode(b.slice(g,g+m))),a.col+=m);if(!h)break;g+=m+1;"\t"==h[0]?(h=a.cm.options.tabSize,h-=a.col%h,f.appendChild(n("span",Fc(h),"cm-tab")),a.col+=h):(m=n("span","•","cm-invalidchar"),m.title="\\u"+h[0].charCodeAt(0).toString(16),f.appendChild(m),a.col+=1)}else{a.col+=b.length;var f=document.createTextNode(b)}if(c||d||e||a.measure)return b=
100
- c||"",d&&(b+=d),e&&(b+=e),a.pre.appendChild(n("span",[f],b));a.pre.appendChild(f)}}function xd(a,b,c,d,e){for(var f=0;f<b.length;++f)f&&(f<b.length&&a.cm.options.lineWrapping&&ob.test(b.slice(f-1,f+1)))&&a.pre.appendChild(n("wbr")),a.measure[a.pos++]=Pc(a,b.charAt(f),c,0==f&&d,f==b.length-1&&e);b.length&&(a.addedOne=!0)}function Rc(a,b,c){c&&(a.display||(c=c.cloneNode(!0)),a.pre.appendChild(c),a.measure&&b&&(a.measure[a.pos]=c,a.addedOne=!0));a.pos+=b}function Ja(a){this.lines=a;this.parent=null;
101
- for(var b=0,c=a.length,d=0;b<c;++b)a[b].parent=this,d+=a[b].height;this.height=d}function Ia(a){this.children=a;for(var b=0,c=0,d=0,e=a.length;d<e;++d){var f=a[d],b=b+f.chunkSize(),c=c+f.height;f.parent=this}this.size=b;this.height=c;this.parent=null}function o(a,b){for(;!a.lines;)for(var c=0;;++c){var d=a.children[c],e=d.chunkSize();if(b<e){a=d;break}b-=e}return a.lines[b]}function I(a,b){for(var c=b-a.height,d=a;d;d=d.parent)d.height+=c}function G(a){if(null==a.parent)return null;for(var b=a.parent,
102
- a=nb(b.lines,a),c=b.parent;c;b=c,c=c.parent)for(var d=0;c.children[d]!=b;++d)a+=c.children[d].chunkSize();return a}function Ra(a,b){var c=0;a:do{for(var d=0,e=a.children.length;d<e;++d){var f=a.children[d],g=f.height;if(b<g){a=f;continue a}b-=g;c+=f.chunkSize()}return c}while(!a.lines);d=0;for(e=a.lines.length;d<e;++d){f=a.lines[d].height;if(b<f)break;b-=f}return c+d}function ha(a,b){for(var b=ga(a.view.doc,b),c=0,d=b.parent,e=0;e<d.lines.length;++e){var f=d.lines[e];if(f==b)break;else c+=f.height}for(f=
103
- d.parent;f;d=f,f=d.parent)for(e=0;e<f.children.length;++e){var g=f.children[e];if(g==d)break;else c+=g.height}return c}function P(a){var b=a.order;null==b&&(b=a.order=yd(a.text));return b}function tb(){return{done:[],undone:[],lastTime:0,lastOp:null,lastOrigin:null,dirtyCounter:0}}function vd(a,b,c,d,e,f,g,h,m){var j=a.view.history;j.undone.length=0;var i=+new Date,k=K(j.done);if(k&&(j.lastOp==a.curOp.id||j.lastOrigin==e&&("input"==e||"delete"==e)&&j.lastTime>i-600)){f=K(k.events);if(f.start>b+d.length||
104
- f.start+f.added<b)k.events.push({start:b,added:c,old:d});else{for(var g=Math.max(0,f.start-b),r=Math.max(0,b+d.length-(f.start+f.added)),l=g;0<l;--l)f.old.unshift(d[l-1]);for(l=r;0<l;--l)f.old.push(d[d.length-l]);g&&(f.start=b);f.added+=c-(d.length-g-r)}k.fromAfter=h;k.toAfter=m}else{k={events:[{start:b,added:c,old:d}],fromBefore:f,toBefore:g,fromAfter:h,toAfter:m};for(j.done.push(k);j.done.length>a.options.undoDepth;)j.done.shift();0>j.dirtyCounter?j.dirtyCounter=NaN:j.dirtyCounter++}j.lastTime=
105
- i;j.lastOp=a.curOp.id;j.lastOrigin=e}function zd(){ab(this)}function za(a){a.stop||(a.stop=zd);return a}function z(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Sc(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function ab(a){z(a);Sc(a)}function sc(a){var b=a.which;null==b&&(a.button&1?b=1:a.button&2?b=3:a.button&4&&(b=2));ia&&(a.ctrlKey&&1==b)&&(b=3);return b}function C(a,b){return a.override&&a.override.hasOwnProperty(b)?a.override[b]:a[b]}function s(a,b,c){a.addEventListener?
106
- a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):(a=a._handlers||(a._handlers={}),(a[b]||(a[b]=[])).push(c))}function Q(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else if(a=a._handlers&&a._handlers[b])for(b=0;b<a.length;++b)if(a[b]==c){a.splice(b,1);break}}function ma(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 fa(a,b,c){function d(a){return function(){a.apply(null,
107
- f)}}var e=b._handlers&&b._handlers[c];if(e)for(var f=Array.prototype.slice.call(arguments,3),g=a.curOp&&a.curOp.delayedCallbacks,h=0;h<e.length;++h)g?g.push(d(e[h])):e[h].apply(null,f)}function tc(a,b){var c=a._handlers&&a._handlers[b];return c&&0<c.length}function xb(){this.id=null}function ka(a,b,c){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));for(var d=0,e=0;d<b;++d)"\t"==a.charAt(d)?e+=c-e%c:++e;return e}function Fc(a){for(;pb.length<=a;)pb.push(K(pb)+" ");return pb[a]}function K(a){return a[a.length-
108
- 1]}function nc(a){La?(a.selectionStart=0,a.selectionEnd=a.value.length):a.select()}function nb(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;++c)if(a[c]==b)return c;return-1}function ic(a){for(var b=[],c=0;c<a;++c)b.push(void 0);return b}function L(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function lb(a){return/\w/.test(a)||"€"<a&&(a.toUpperCase()!=a.toLowerCase()||Ad.test(a))}function Tc(a){var b=0,c;for(c in a)a.hasOwnProperty(c)&&
109
- a[c]&&++b;return!b}function n(a,b,c,d){a=document.createElement(a);c&&(a.className=c);d&&(a.style.cssText=d);if("string"==typeof b)bc(a,b);else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a}function Na(a){if(M)for(;a.firstChild;)a.removeChild(a.firstChild);else a.innerHTML="";return a}function W(a,b){return Na(a).appendChild(b)}function bc(a,b){gb?(a.innerHTML="",a.appendChild(document.createTextNode(b))):a.textContent=b}function Qa(a){if(null!=qb)return qb;var b=n("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");
110
- W(a,b);b.offsetWidth&&(qb=b.offsetHeight-b.clientHeight);return qb||0}function Qc(a){if(null==Rb){var b=n("span","​");W(a,n("span",[b,document.createTextNode("x")]));0!=a.firstChild.offsetHeight&&(Rb=1>=b.offsetWidth&&2<b.offsetHeight&&!ea)}return Rb?n("span","​"):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function gd(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=0;e<a.length;++e){var f=a[e];if(f.from<c&&f.to>b||b==c&&f.to==b)d(Math.max(f.from,b),Math.min(f.to,c),1==
111
- f.level?"rtl":"ltr")}}function Sb(a){return a.level%2?a.from:a.to}function Wa(a){return(a=P(a))?a[0].level%2?a[0].to:a[0].from:0}function Xa(a){var b=P(a);return!b?a.text.length:Sb(K(b))}function Uc(a,b){var c=o(a.view.doc,b),d=ga(a.view.doc,c);d!=c&&(b=G(d));c=P(d);d=!c?0:c[0].level%2?Xa(d):Wa(d);return{line:b,ch:d}}function Bd(a,b){for(var c,d;c=Pa(d=o(a.view.doc,b));)b=c.find().to.line;c=P(d);d=!c?d.text.length:c[0].level%2?Wa(d):Xa(d);return{line:b,ch:d}}function Eb(a,b,c,d){var e=P(a);if(!e)return Hc(a,
112
- b,c,d);for(var d=d?function(b,c){do b+=c;while(0<b&&Fb.test(a.text.charAt(b)));return b}:function(a,b){return a+b},f=e[0].level,g=0;g<e.length;++g){var h=e[g],m=h.level%2==f;if(h.from<b&&h.to>b||m&&(h.from==b||h.to==b))break}for(b=d(b,h.level%2?-c:c);null!=b;)if(h.level%2==f)if(b<h.from||b>h.to)b=(h=e[g+=c])&&(0<c==h.level%2?d(h.to,-1):d(h.from,1));else break;else if(b==(h.level%2?h.to:h.from))b=(h=e[--g])&&Sb(h);else if(b==Sb(h))b=(h=e[++g])&&(h.level%2?h.to:h.from);else break;return 0>b||b>a.text.length?
113
- null:b}function Hc(a,b,c,d){b+=c;if(d)for(;0<b&&Fb.test(a.text.charAt(b));)b+=c;return 0>b||b>a.text.length?null:b}var X=/gecko\/\d/i.test(navigator.userAgent),M=/MSIE \d/.test(navigator.userAgent),ea=M&&(null==document.documentMode||8>document.documentMode),gb=M&&(null==document.documentMode||9>document.documentMode),N=/WebKit\//.test(navigator.userAgent),Cd=N&&/Qt\/\d+\.\d+/.test(navigator.userAgent),Vc=/Chrome\//.test(navigator.userAgent),R=/Opera\//.test(navigator.userAgent),Jb=/Apple Computer/.test(navigator.vendor),
114
- wb=/KHTML\//.test(navigator.userAgent),$c=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),ad=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),kd=/PhantomJS/.test(navigator.userAgent),La=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),Vb=La||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),ia=La||/Mac/.test(navigator.platform),Dd=/windows/i.test(navigator.platform),Ga=R&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);
115
- Ga&&(Ga=Number(Ga[1]));var zc=ia&&(Cd||R&&(null==Ga||12.11>Ga)),Ac=!1,ua=!1,aa,cb,bb,db=0,J=null;M?J=-0.53:X?J=15:Vc?J=-0.7:Jb&&(J=-1/3);var xc,Mb=null,Nb;l.prototype={getValue:function(a){var b=[],c=this.view.doc;c.iter(0,c.size,function(a){b.push(a.text)});return b.join(a||"\n")},setValue:q(null,function(a){var b=this.view.doc,c={line:0,ch:0},d=o(b,b.size-1).text.length;ib(this,c,{line:b.size-1,ch:d},ya(a),c,c,"setValue")}),getSelection:function(a){return this.getRange(this.view.sel.from,this.view.sel.to,
116
- a)},replaceSelection:q(null,function(a,b,c){var d=this.view.sel;Ib(this,d.from,d.to,ya(a),b||"around",c)}),focus:function(){window.focus();E(this);$(this);wa(this)},setOption:function(a,b){var c=this.options,d=c[a];c[a]==b&&"mode"!=a||(c[a]=b,da.hasOwnProperty(a)&&q(this,da[a])(this,b,d))},getOption:function(a){return this.options[a]},getMode:function(){return this.view.mode},addKeyMap:function(a){this.view.keyMaps.push(a)},removeKeyMap:function(a){for(var b=this.view.keyMaps,c=0;c<b.length;++c)if(("string"==
117
- typeof a?b[c].name:b[c])==a)return b.splice(c,1),!0},addOverlay:q(null,function(a,b){var c=a.token?a:l.getMode(this.options,a);if(c.startState)throw Error("Overlays may not be stateful.");this.view.overlays.push({mode:c,modeSpec:a,opaque:b&&b.opaque});this.view.modeGen++;F(this,0,this.view.doc.size)}),removeOverlay:q(null,function(a){for(var b=this.view.overlays,c=0;c<b.length;++c)if(b[c].modeSpec==a){b.splice(c,1);this.view.modeGen++;F(this,0,this.view.doc.size);break}}),undo:q(null,function(){Cc(this,
118
- "undo")}),redo:q(null,function(){Cc(this,"redo")}),indentLine:q(null,function(a,b,c){"string"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract");0<=a&&a<this.view.doc.size&&hb(this,a,b,c)}),indentSelection:q(null,function(a){var b=this.view.sel;if(u(b.from,b.to))return hb(this,b.from.line,a);for(var c=b.to.line-(b.to.ch?0:1),b=b.from.line;b<=c;++b)hb(this,b,a)}),historySize:function(){var a=this.view.history;return{undo:a.done.length,redo:a.undone.length}},clearHistory:function(){this.view.history=
119
- tb()},markClean:function(){this.view.history.dirtyCounter=0;this.view.history.lastOp=this.view.history.lastOrigin=null},isClean:function(){return 0==this.view.history.dirtyCounter},getHistory:function(){function a(a){for(var b=0,e=[],f;b<a.length;++b){var g=a[b];e.push({events:f=[],fromBefore:g.fromBefore,toBefore:g.toBefore,fromAfter:g.fromAfter,toAfter:g.toAfter});for(var h=0,g=g.events;h<g.length;++h){var m=[],j=g[h];f.push({start:j.start,added:j.added,old:m});for(var i=0;i<j.old.length;++i)m.push(D(j.old[i]))}}return e}
120
- var b=this.view.history;return{done:a(b.done),undone:a(b.undone)}},setHistory:function(a){var b=this.view.history=tb();b.done=a.done;b.undone=a.undone},getTokenAt:function(a){for(var b=this.view.doc,a=w(b,a),c=va(this,a.line),d=this.view.mode,b=o(b,a.line),b=new Da(b.text,this.options.tabSize);b.pos<a.ch&&!b.eol();){b.start=b.pos;var e=d.token(b,c)}return{start:b.start,end:b.pos,string:b.current(),className:e||null,type:e||null,state:c}},getStateAfter:function(a){var b=this.view.doc,a=Math.max(0,
121
- Math.min(null==a?b.size-1:a,b.size-1));return va(this,a+1)},cursorCoords:function(a,b){var c;c=this.view.sel;c=null==a?c.head:"object"==typeof a?w(this.view.doc,a):a?c.from:c.to;return V(this,c,b||"page")},charCoords:function(a,b){return Ta(this,w(this.view.doc,a),b||"page")},coordsChar:function(a){var b=this.display.lineSpace.getBoundingClientRect();return Db(this,a.left-b.left,a.top-b.top)},defaultTextHeight:function(){return Z(this.display)},markText:q(null,function(a,b,c){return Ic(this,w(this.view.doc,
122
- a),w(this.view.doc,b),c,"range")}),setBookmark:q(null,function(a,b){a=w(this.view.doc,a);return Ic(this,a,a,b?{replacedWith:b}:{},"bookmark")}),findMarksAt:function(a){var b=this.view.doc,a=w(b,a),c=[];if(b=o(b,a.line).markedSpans)for(var d=0;d<b.length;++d){var e=b[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&c.push(e.marker)}return c},setGutterMarker:q(null,function(a,b,c){return kb(this,a,function(a){var e=a.gutterMarkers||(a.gutterMarkers={});e[b]=c;!c&&Tc(e)&&(a.gutterMarkers=null);
123
- return!0})}),clearGutter:q(null,function(a){var b=0,c=this,d=c.view.doc;d.iter(0,d.size,function(d){d.gutterMarkers&&d.gutterMarkers[a]&&(d.gutterMarkers[a]=null,F(c,b,b+1),Tc(d.gutterMarkers)&&(d.gutterMarkers=null));++b})}),addLineClass:q(null,function(a,b,c){return kb(this,a,function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[e]){if(RegExp("\\b"+c+"\\b").test(a[e]))return!1;a[e]+=" "+c}else a[e]=c;return!0})}),removeLineClass:q(null,function(a,b,c){return kb(this,
124
- a,function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",f=a[e];if(f)if(null==c)a[e]=null;else{var g=f.replace(RegExp("^"+c+"\\b\\s*|\\s*\\b"+c+"\\b"),"");if(g==f)return!1;a[e]=g||null}else return!1;return!0})}),addLineWidget:q(null,function(a,b,c){return wd(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!(0<=a&&a<this.view.doc.size))return null;var b=a,a=o(this.view.doc,a);if(!a)return null}else if(b=G(a),null==b)return null;
125
- 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=V(this,w(this.view.doc,a)),g=a.top,h=a.left;b.style.position="absolute";f.sizer.appendChild(b);if("over"==d)g=a.top;else if("near"==d){var d=Math.max(f.wrapper.clientHeight,this.view.doc.height),m=Math.max(f.sizer.clientWidth,
126
- f.lineSpace.clientWidth);a.bottom+b.offsetHeight>d&&a.top>b.offsetHeight&&(g=a.top-b.offsetHeight);h+b.offsetWidth>m&&(h=m-b.offsetWidth)}b.style.top=g+f.lineSpace.offsetTop+"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&&Ec(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},lineCount:function(){return this.view.doc.size},clipPos:function(a){return w(this.view.doc,
127
- a)},getCursor:function(a){var b=this.view.sel,a=null==a||"head"==a?b.head:"anchor"==a?b.anchor:"end"==a||!1===a?b.to:b.from;return{line:a.line,ch:a.ch}},somethingSelected:function(){return!u(this.view.sel.from,this.view.sel.to)},setCursor:q(null,function(a,b,c){a=w(this.view.doc,"number"==typeof a?{line:a,ch:b||0}:a);c?y(this,a):S(this,a,a)}),setSelection:q(null,function(a,b){var c=this.view.doc;S(this,w(c,a),w(c,b||a))}),extendSelection:q(null,function(a,b){var c=this.view.doc;y(this,w(c,a),b&&w(c,
128
- b))}),setExtending:function(a){this.view.sel.extend=a},getLine:function(a){return(a=this.getLineHandle(a))&&a.text},getLineHandle:function(a){var b=this.view.doc;if(0<=a&&a<b.size)return o(b,a)},getLineNumber:function(a){return G(a)},setLine:q(null,function(a,b){0<=a&&a<this.view.doc.size&&Y(this,b,{line:a,ch:0},{line:a,ch:o(this.view.doc,a).text.length})}),removeLine:q(null,function(a){0<=a&&a<this.view.doc.size&&Y(this,"",{line:a,ch:0},w(this.view.doc,{line:a+1,ch:0}))}),replaceRange:q(null,function(a,
129
- b,c){var d=this.view.doc,b=w(d,b),c=c?w(d,c):b;return Y(this,a,b,c)}),getRange:function(a,b,c){var d=this.view.doc,a=w(d,a),b=w(d,b),e=a.line,f=b.line;if(e==f)return o(d,e).text.slice(a.ch,b.ch);var g=[o(d,e).text.slice(a.ch)];d.iter(e+1,f,function(a){g.push(a.text)});g.push(o(d,f).text.slice(0,b.ch));return g.join(c||"\n")},triggerOnKeyDown:q(null,qc),execCommand:function(a){return Kb[a](this)},moveH:q(null,function(a,b){var c=this.view.sel,d=0>a?c.from:c.to;if(c.shift||c.extend||u(c.from,c.to))d=
130
- Gc(this,a,b,this.options.rtlMoveVisually);y(this,d,d,a)}),deleteH:q(null,function(a,b){var c=this.view.sel;u(c.from,c.to)?Y(this,"",c.from,Gc(this,a,b,!1),"delete"):Y(this,"",c.from,c.to,"delete");this.curOp.userSelChange=!0}),moveV:q(null,function(a,b){var c=this.view,d=c.doc,e=this.display,f=V(this,c.sel.head,"div"),g=f.left,h;null!=c.goalColumn&&(g=c.goalColumn);"page"==b?(h=Math.min(e.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),h=f.top+a*h):"line"==b&&(h=0<
131
- a?f.bottom+3:f.top-3);do{var m=Db(this,g,h);h+=5*a}while(m.outside&&(0>a?0<h:h<d.height));"page"==b&&(e.scrollbarV.scrollTop+=Ta(this,m,"div").top-f.top);y(this,m,m,a);c.goalColumn=g}),toggleOverwrite:function(){this.display.cursor.className=(this.view.overwrite=!this.view.overwrite)?this.display.cursor.className+" CodeMirror-overwrite":this.display.cursor.className.replace(" CodeMirror-overwrite","")},posFromIndex:function(a){var b=0,c,d=this.view.doc;d.iter(0,d.size,function(d){d=d.text.length+
132
- 1;if(d>a)return c=a,!0;a-=d;++b});return w(d,{line:b,ch:c})},indexFromPos:function(a){var a=w(this.view.doc,a),b=a.ch;this.view.doc.iter(0,a.line,function(a){b+=a.text.length+1});return b},scrollTo:function(a,b){null!=a&&(this.display.scrollbarH.scrollLeft=this.display.scroller.scrollLeft=a);null!=b&&(this.display.scrollbarV.scrollTop=this.display.scroller.scrollTop=b);O(this,[])},getScrollInfo:function(){var a=this.display.scroller,b=qa;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-
133
- b,width:a.scrollWidth-b,clientHeight:a.clientHeight-b,clientWidth:a.clientWidth-b}},scrollIntoView:function(a){"number"==typeof a&&(a={line:a,ch:0});!a||null!=a.line?(a=a?w(this.view.doc,a):this.view.sel.head,lc(this,a)):Ec(this,a.left,a.top,a.right,a.bottom)},setSize:function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(""+a)?a+"px":a}null!=a&&(this.display.wrapper.style.width=c(a));null!=b&&(this.display.wrapper.style.height=c(b));this.refresh()},on:function(a,b){s(this,a,b)},off:function(a,
134
- b){Q(this,a,b)},operation:function(a){return q(this,a)()},refresh:function(){ra(this);var a=this.view.scrollTop,b=this.view.scrollLeft;this.display.scroller.scrollHeight>a&&(this.display.scrollbarV.scrollTop=this.display.scroller.scrollTop=a);this.display.scroller.scrollWidth>b&&(this.display.scrollbarH.scrollLeft=this.display.scroller.scrollLeft=b);O(this,!0)},getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},
135
- getGutterElement:function(){return this.display.gutters}};var da=l.optionHandlers={},rb=l.defaults={},Xb=l.Init={toString:function(){return"CodeMirror.Init"}};t("value","",function(a,b){a.setValue(b)},!0);t("mode",null,Ka,!0);t("indentUnit",2,Ka,!0);t("indentWithTabs",!1);t("smartIndent",!0);t("tabSize",4,function(a){Ka(a);ra(a);O(a,!0)},!0);t("electricChars",!0);t("rtlMoveVisually",!Dd);t("theme","default",function(a){Wb(a);sa(a)},!0);t("keyMap","default",function(a){var b=T[a.options.keyMap].style;
136
- a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(b?" cm-keymap-"+b:"")});t("extraKeys",null);t("onKeyEvent",null);t("onDragEvent",null);t("lineWrapping",!1,function(a){var b=a.view.doc,c=Z(a.display);if(a.options.lineWrapping){a.display.wrapper.className=a.display.wrapper.className+" CodeMirror-wrap";var d=a.display.scroller.clientWidth/kc(a.display)-3;b.iter(0,b.size,function(a){if(a.height!=0){var b=Math.ceil(a.text.length/d)||1;b!=1&&I(a,b*c)}});a.display.sizer.style.minWidth=
137
- ""}else{a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-wrap","");Yb(a.view);b.iter(0,b.size,function(a){a.height!=0&&I(a,c)})}F(a,0,b.size);ra(a);setTimeout(function(){Zb(a.display,a.view.doc.height)},100)},!0);t("gutters",[],function(a){sb(a.options);sa(a)},!0);t("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?zb(a.display)+"px":"0";a.refresh()},!0);t("lineNumbers",!1,function(a){sb(a.options);sa(a)},!0);t("firstLineNumber",1,sa,!0);t("lineNumberFormatter",
138
- function(a){return a},sa,!0);t("showCursorWhenSelecting",!1,Ab,!0);t("readOnly",!1,function(a,b){if(b=="nocursor"){ub(a);a.display.input.blur()}else b||ca(a,true)});t("dragDrop",!0);t("cursorBlinkRate",530);t("cursorHeight",1);t("workTime",100);t("workDelay",100);t("flattenSpans",!0);t("pollInterval",100);t("undoDepth",40);t("viewportMargin",10,function(a){a.refresh()},!0);t("tabindex",null,function(a,b){a.display.input.tabIndex=b||""});t("autofocus",null);var Wc=l.modes={},Tb=l.mimeModes={};l.defineMode=
139
- function(a,b){!l.defaults.mode&&"null"!=a&&(l.defaults.mode=a);if(2<arguments.length){b.dependencies=[];for(var c=2;c<arguments.length;++c)b.dependencies.push(arguments[c])}Wc[a]=b};l.defineMIME=function(a,b){Tb[a]=b};l.resolveMode=function(a){if("string"==typeof a&&Tb.hasOwnProperty(a))a=Tb[a];else if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return l.resolveMode("application/xml");return"string"==typeof a?{name:a}:a||{name:"null"}};l.getMode=function(a,b){var b=l.resolveMode(b),c=Wc[b.name];
140
- if(!c)return l.getMode(a,"text/plain");c=c(a,b);if(Ha.hasOwnProperty(b.name)){var d=Ha[b.name],e;for(e in d)d.hasOwnProperty(e)&&(c.hasOwnProperty(e)&&(c["_"+e]=c[e]),c[e]=d[e])}c.name=b.name;return c};l.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}});l.defineMIME("text/plain","null");var Ha=l.modeExtensions={};l.extendMode=function(a,b){var c=Ha.hasOwnProperty(a)?Ha[a]:Ha[a]={},d;for(d in b)b.hasOwnProperty(d)&&(c[d]=b[d])};l.defineExtension=function(a,b){l.prototype[a]=b};
141
- l.defineOption=t;var vb=[];l.defineInitHook=function(a){vb.push(a)};l.copyState=ja;l.startState=hc;l.innerMode=function(a,b){for(;a.innerMode;)var c=a.innerMode(b),b=c.state,a=c.mode;return c||{mode:a,state:b}};var Kb=l.commands={selectAll:function(a){a.setSelection({line:0,ch:0},{line:a.lineCount()-1})},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),d=!u(b,c);!d&&a.getLine(b.line).length==b.ch?a.replaceRange("",b,{line:b.line+1,ch:0},"delete"):a.replaceRange("",b,d?c:{line:b.line},
142
- "delete")},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",{line:b,ch:0},{line:b},"delete")},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.extendSelection({line:0,ch:0})},goDocEnd:function(a){a.extendSelection({line:a.lineCount()-1})},goLineStart:function(a){a.extendSelection(Uc(a,a.getCursor().line))},goLineStartSmart:function(a){var b=a.getCursor(),c=Uc(a,b.line),d=a.getLineHandle(c.line),e=P(d);!e||0==e[0].level?(d=Math.max(0,d.text.search(/\S/)),
143
- a.extendSelection({line:c.line,ch:b.line==c.line&&b.ch<=d&&b.ch?0:d})):a.extendSelection(c)},goLineEnd:function(a){a.extendSelection(Bd(a,a.getCursor().line))},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")},
144
- goWordLeft:function(a){a.moveH(-1,"word")},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")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("\t","end","input")},defaultTab:function(a){a.somethingSelected()?
145
- a.indentSelection("add"):a.replaceSelection("\t","end","input")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line);0<b.ch&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),{line:b.line,ch:b.ch-1},{line:b.line,ch:b.ch+1})},newlineAndIndent:function(a){q(a,function(){a.replaceSelection("\n","end","input");a.indentLine(a.getCursor().line,null,!0)})()},toggleOverwrite:function(a){a.toggleOverwrite()}},T=l.keyMap={};T.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",
146
- Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"};T.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":"goWordLeft","Ctrl-Right":"goWordRight","Alt-Left":"goLineStart",
147
- "Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordBefore","Ctrl-Delete":"delWordAfter","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"};T.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":"goWordLeft","Alt-Right":"goWordRight",
148
- "Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordBefore","Ctrl-Alt-Backspace":"delWordAfter","Alt-Delete":"delWordAfter","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",fallthrough:["basic","emacsy"]};T["default"]=ia?T.macDefault:T.pcDefault;T.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight",
149
- "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"};l.isModifierKey=yc;l.fromTextArea=function(a,b){function c(){a.value=m.getValue()}b||(b={});b.value=a.value;!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex);if(null==b.autofocus){var d=document.body;try{d=document.activeElement}catch(e){}b.autofocus=
150
- d==a||null!=a.getAttribute("autofocus")&&d==document.body}if(a.form){s(a.form,"submit",c);var f=a.form,g=f.submit;try{f.submit=function i(){c();f.submit=g;f.submit();f.submit=i}}catch(h){}}a.style.display="none";var m=l(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);m.save=c;m.getTextArea=function(){return a};m.toTextArea=function(){c();a.parentNode.removeChild(m.getWrapperElement());a.style.display="";if(a.form){Q(a.form,"submit",c);if(typeof a.form.submit=="function")a.form.submit=g}};
151
- return m};Da.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(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a?b==a:b&&(a.test?a.test(b):a(b)))return++this.pos,b},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;
152
- return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){a=this.string.indexOf(a,this.pos);if(-1<a)return this.pos=a,!0},backUp:function(a){this.pos-=a},column:function(){return ka(this.string,this.start,this.tabSize)},indentation:function(){return ka(this.string,null,this.tabSize)},match:function(a,b,c){if("string"==typeof a){if((c?this.string.toLowerCase():this.string).indexOf(c?a.toLowerCase():a,this.pos)==this.pos)return!1!==b&&(this.pos+=a.length),!0}else{if((a=
153
- this.string.slice(this.pos).match(a))&&0<a.index)return null;a&&!1!==b&&(this.pos+=a[0].length);return a}},current:function(){return this.string.slice(this.start,this.pos)}};l.StringStream=Da;l.TextMarker=Ea;Ea.prototype.clear=function(){if(!this.explicitlyCleared){Ya(this.cm);for(var a=this.cm.view,b=null,c=null,d=0;d<this.lines.length;++d){var e=this.lines[d],f=Fa(e.markedSpans,this);null!=f.to&&(c=G(e));for(var g=e,h=e.markedSpans,m=f,j=void 0,i=0;i<h.length;++i)h[i]!=m&&(j||(j=[])).push(h[i]);
154
- g.markedSpans=j;null!=f.from?b=G(e):this.collapsed&&!U(e)&&I(e,Z(this.cm.display))}if(this.collapsed&&!this.cm.options.lineWrapping)for(d=0;d<this.lines.length;++d)e=ga(a.doc,this.lines[d]),f=Oa(a.doc,e),f>a.maxLineLength&&(a.maxLine=e,a.maxLineLength=f,a.maxLineChanged=!0);null!=b&&F(this.cm,b,c+1);this.lines.length=0;this.explicitlyCleared=!0;this.collapsed&&this.cm.view.cantEdit&&(this.cm.view.cantEdit=!1,Dc(this.cm));Za(this.cm);fa(this.cm,this,"clear")}};Ea.prototype.find=function(){for(var a,
155
- b,c=0;c<this.lines.length;++c){var d=this.lines[c],e=Fa(d.markedSpans,this);if(null!=e.from||null!=e.to)d=G(d),null!=e.from&&(a={line:d,ch:e.from}),null!=e.to&&(b={line:d,ch:e.to})}return"bookmark"==this.type?a:a&&{from:a,to:b}};Ea.prototype.getOptions=function(a){var b=this.replacedWith;return{className:this.className,inclusiveLeft:this.inclusiveLeft,inclusiveRight:this.inclusiveRight,atomic:this.atomic,collapsed:this.collapsed,clearOnEnter:this.clearOnEnter,replacedWith:a?b&&b.cloneNode(!0):b,readOnly:this.readOnly,
156
- startStyle:this.startStyle,endStyle:this.endStyle}};var Pb=l.LineWidget=function(a,b,c){for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.cm=a;this.node=b};Pb.prototype.clear=Lc(function(){var a=this.line.widgets,b=G(this.line);if(null!=b&&a){for(var c=0;c<a.length;++c)a[c]==this&&a.splice(c--,1);I(this.line,Math.max(0,this.line.height-Va(this)));F(this.cm,b,b+1)}});Pb.prototype.changed=Lc(function(){var a=this.height;this.height=null;if(a=Va(this)-a)I(this.line,this.line.height+a),a=G(this.line),
157
- F(this.cm,a,a+1)});var Oc={},Qb=/[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g;Ja.prototype={chunkSize:function(){return this.lines.length},remove:function(a,b,c){for(var d=a,e=a+b;d<e;++d){var f=this.lines[d];this.height-=f.height;var g=f;g.parent=null;Jc(g);fa(c,f,"delete")}this.lines.splice(a,b)},collapse:function(a){a.splice.apply(a,[a.length,0].concat(this.lines))},insertHeight:function(a,b,c){this.height+=c;this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));a=0;for(c=b.length;a<
158
- c;++a)b[a].parent=this},iterN:function(a,b,c){for(b=a+b;a<b;++a)if(c(this.lines[a]))return!0}};Ia.prototype={chunkSize:function(){return this.size},remove:function(a,b,c){this.size-=b;for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(a<f){var g=Math.min(b,f-a),h=e.height;e.remove(a,g,c);this.height-=h-e.height;f==g&&(this.children.splice(d--,1),e.parent=null);if(0==(b-=g))break;a=0}else a-=f}25>this.size-b&&(a=[],this.collapse(a),this.children=[new Ja(a)],this.children[0].parent=
159
- this)},collapse:function(a){for(var b=0,c=this.children.length;b<c;++b)this.children[b].collapse(a)},insert:function(a,b){for(var c=0,d=0,e=b.length;d<e;++d)c+=b[d].height;this.insertHeight(a,b,c)},insertHeight:function(a,b,c){this.size+=b.length;this.height+=c;for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<=g){f.insertHeight(a,b,c);if(f.lines&&50<f.lines.length){for(;50<f.lines.length;)a=f.lines.splice(f.lines.length-25,25),a=new Ja(a),f.height-=a.height,
160
- this.children.splice(d+1,0,a),a.parent=this;this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),b=new Ia(b);if(a.parent){a.size-=b.size;a.height-=b.height;var c=nb(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new Ia(a.children),c.parent=a,a.children=[c,b],a=c;b.parent=a.parent}while(10<a.children.length);a.parent.maybeSpill()}},iter:function(a,b,c){this.iterN(a,b-a,c)},iterN:function(a,b,
161
- c){for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<g){g=Math.min(b,g-a);if(f.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=g}}};l.e_stop=ab;l.e_preventDefault=z;l.e_stopPropagation=Sc;l.on=s;l.off=Q;l.signal=ma;var qa=30,uc=l.Pass={toString:function(){return"CodeMirror.Pass"}};xb.prototype={set:function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)}};l.countColumn=ka;var pb=[""],Ad=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc]/,Fb=/[\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]/,
162
- rd=function(){if(gb)return!1;var a=n("div");return"draggable"in a||"dragDrop"in a}(),ob=/^$/;X?ob=/$'/:Jb?ob=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:Vc&&(ob=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/);var qb,Rb,ya=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){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/)};
163
- l.splitLines=ya;var ld=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?!1:0!=b.compareEndPoints("StartToEnd",b)},mc=function(){var a=n("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(),ba={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",
164
- 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"};l.keyNames=ba;(function(){for(var a=0;10>a;a++)ba[a+48]=""+a;for(a=65;90>=a;a++)ba[a]=
165
- String.fromCharCode(a);for(a=1;12>=a;a++)ba[a+111]=ba[a+63235]="F"+a})();var yd=function(){function a(a){return 255>=a?b.charAt(a):1424<=a&&1524>=a?"R":1536<=a&&1791>=a?c.charAt(a-1536):1792<=a&&2220>=a?"r":"L"}var b="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",c="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",
166
- d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,f=/[LRr]/,g=/[Lb1n]/,h=/[1n]/;return function(b){if(!d.test(b))return!1;for(var c=b.length,i=[],k=0,l;k<c;++k)i.push(a(b.charCodeAt(k)));for(var k=0,p="L";k<c;++k)l=i[k],"m"==l?i[k]=p:p=l;k=0;for(p="L";k<c;++k)l=i[k],"1"==l&&"r"==p?i[k]="n":f.test(l)&&(p=l,"r"==l&&(i[k]="R"));k=1;for(p=i[0];k<c-1;++k){l=i[k];if("+"==l&&"1"==p&&"1"==i[k+1])i[k]="1";else if(","==l&&p==i[k+1]&&("1"==p||"n"==p))i[k]=p;p=l}for(k=0;k<c;++k)if(l=i[k],","==l)i[k]="N";
167
- else if("%"==l){for(p=k+1;p<c&&"%"==i[p];++p);var n=k&&"!"==i[k-1]||p<c-1&&"1"==i[p]?"1":"N";for(l=k;l<p;++l)i[l]=n;k=p-1}k=0;for(p="L";k<c;++k)l=i[k],"L"==p&&"1"==l?i[k]="L":f.test(l)&&(p=l);for(k=0;k<c;++k)if(e.test(i[k])){for(p=k+1;p<c&&e.test(i[p]);++p);l="L"==(p<c-1?i[p]:"L");n="L"==(k?i[k-1]:"L")||l?"L":"R";for(l=k;l<p;++l)i[l]=n;k=p-1}for(var p=[],q,k=0;k<c;)if(g.test(i[k])){l=k;for(++k;k<c&&g.test(i[k]);++k);p.push({from:l,to:k,level:0})}else{var o=k,n=p.length;for(++k;k<c&&"L"!=i[k];++k);
168
- for(l=o;l<k;)if(h.test(i[l])){o<l&&p.splice(n,0,{from:o,to:l,level:1});o=l;for(++l;l<k&&h.test(i[l]);++l);p.splice(n,0,{from:o,to:l,level:2});o=l}else++l;o<k&&p.splice(n,0,{from:o,to:k,level:1})}if(1==p[0].level&&(q=b.match(/^\s+/)))p[0].from=q[0].length,p.unshift({from:0,to:q[0].length,level:0});if(1==K(p).level&&(q=b.match(/\s+$/)))K(p).to-=q[0].length,p.push({from:c-q[0].length,to:c,level:0});p[0].level!=K(p).level&&p.push({from:c,to:c,level:p[0].level});return p}}();l.version="3.02";return l}();
1
+ window.CodeMirror=function(){function k(a,b){if(!(this instanceof k))return new k(a,b);this.options=b=b||{};for(var c in Fb)!b.hasOwnProperty(c)&&Fb.hasOwnProperty(c)&&(b[c]=Fb[c]);Gb(b);c=this.display=yd(a,"string"==typeof b.value?0:b.value.first);c.wrapper.CodeMirror=this;qc(this);b.autofocus&&!Hb&&D(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,draggingText:!1,highlight:new Ib};rc(this);b.lineWrapping&&(this.display.wrapper.className+=
2
+ " CodeMirror-wrap");var d=b.value;"string"==typeof d&&(d=new I(b.value,b.mode));s(this,sc)(this,d);E&&setTimeout(J(Z,this,!0),20);zd(this);var e;try{e=document.activeElement==c.input}catch(f){}e||b.autofocus&&!Hb?setTimeout(J($,this),20):Jb(this);s(this,function(){for(var a in ia)if(ia.propertyIsEnumerable(a))ia[a](this,b[a],tc);for(a=0;a<Kb.length;++a)Kb[a](this)})()}function yd(a,b){var c={},d=c.input=q("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none;");
3
+ P?d.style.width="1000px":d.setAttribute("wrap","off");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");c.inputDiv=q("div",[d],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");c.scrollbarH=q("div",[q("div",null,null,"height: 1px")],"CodeMirror-hscrollbar");c.scrollbarV=q("div",[q("div",null,null,"width: 1px")],"CodeMirror-vscrollbar");c.scrollbarFiller=q("div",null,"CodeMirror-scrollbar-filler");c.lineDiv=q("div");c.selectionDiv=q("div",null,null,"position: relative; z-index: 1");
4
+ c.cursor=q("div"," ","CodeMirror-cursor");c.otherCursor=q("div"," ","CodeMirror-cursor CodeMirror-secondarycursor");c.measure=q("div",null,"CodeMirror-measure");c.lineSpace=q("div",[c.measure,c.selectionDiv,c.lineDiv,c.cursor,c.otherCursor],null,"position: relative; outline: none");c.mover=q("div",[q("div",[c.lineSpace],"CodeMirror-lines")],null,"position: relative");c.sizer=q("div",[c.mover],"CodeMirror-sizer");c.heightForcer=q("div"," ",null,"position: absolute; height: "+za+"px");c.gutters=q("div",
5
+ null,"CodeMirror-gutters");c.lineGutter=null;var e=q("div",[c.sizer,c.heightForcer,c.gutters],null,"position: relative; min-height: 100%");c.scroller=q("div",[e],"CodeMirror-scroll");c.scroller.setAttribute("tabIndex","-1");c.wrapper=q("div",[c.inputDiv,c.scrollbarH,c.scrollbarV,c.scrollbarFiller,c.scroller],"CodeMirror");ja&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight=0);a.appendChild?a.appendChild(c.wrapper):a(c.wrapper);Wa&&(d.style.width="0px");P||(c.scroller.draggable=!0);Lb?(c.inputDiv.style.height=
6
+ "1px",c.inputDiv.style.position="absolute"):ja&&(c.scrollbarH.style.minWidth=c.scrollbarV.style.minWidth="18px");c.viewOffset=c.lastSizeC=0;c.showingFrom=c.showingTo=b;c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null;c.prevInput="";c.alignWidgets=!1;c.pollingFast=!1;c.poll=new Ib;c.draggingText=!1;c.cachedCharWidth=c.cachedTextHeight=null;c.measureLineCache=[];c.measureLineCachePos=0;c.inaccurateSelection=!1;c.maxLine=null;c.maxLineLength=0;c.maxLineChanged=!1;c.wheelDX=c.wheelDY=c.wheelStartX=
7
+ c.wheelStartY=null;return c}function Xa(a){a.doc.mode=k.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;Ya(a,100);a.state.modeGen++;a.curOp&&w(a)}function uc(a){var b=Za(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/Ad(a.display)-3);return function(e){return aa(a.doc,e)?0:c?(Math.ceil(e.text.length/d)||1)*b:b}}function vc(a){var b=a.doc,c=uc(a);b.iter(function(a){var b=
8
+ c(a);b!=a.height&&L(a,b)})}function rc(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-");ka(a)}function Aa(a){qc(a);w(a)}function qc(a){var b=a.display.gutters,c=a.options.gutters;$a(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(q("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 ab(a,
9
+ b){if(0==b.height)return 0;for(var c=b.text.length,d,e=b;d=ba(e,-1);)d=d.find(),e=r(a,d.from.line),c+=d.from.ch-d.to.ch;for(e=b;d=Ba(e);)d=d.find(),c-=e.text.length-d.from.ch,e=r(a,d.to.line),c+=e.text.length-d.to.ch;return c}function Mb(a){var b=a.display,c=a.doc;b.maxLine=r(c,c.first);b.maxLineLength=ab(c,b.maxLine);b.maxLineChanged=!0;c.iter(function(a){var e=ab(c,a);e>b.maxLineLength&&(b.maxLineLength=e,b.maxLine=a)})}function Gb(a){for(var b=!1,c=0;c<a.gutters.length;++c)"CodeMirror-linenumbers"==
10
+ a.gutters[c]&&(a.lineNumbers?b=!0:a.gutters.splice(c--,1));!b&&a.lineNumbers&&a.gutters.push("CodeMirror-linenumbers")}function wc(a,b){var c=b+2*a.lineSpace.offsetTop;a.sizer.style.minHeight=a.heightForcer.style.top=c+"px";var c=Math.max(c,a.scroller.scrollHeight),d=a.scroller.scrollWidth>a.scroller.clientWidth,e=c>a.scroller.clientHeight;e?(a.scrollbarV.style.display="block",a.scrollbarV.style.bottom=d?bb(a.measure)+"px":"0",a.scrollbarV.firstChild.style.height=c-a.scroller.clientHeight+a.scrollbarV.clientHeight+
11
+ "px"):a.scrollbarV.style.display="";d?(a.scrollbarH.style.display="block",a.scrollbarH.style.right=e?bb(a.measure)+"px":"0",a.scrollbarH.firstChild.style.width=a.scroller.scrollWidth-a.scroller.clientWidth+a.scrollbarH.clientWidth+"px"):a.scrollbarH.style.display="";d&&e?(a.scrollbarFiller.style.display="block",a.scrollbarFiller.style.height=a.scrollbarFiller.style.width=bb(a.measure)+"px"):a.scrollbarFiller.style.display="";Bd&&0===bb(a.measure)&&(a.scrollbarV.style.minWidth=a.scrollbarH.style.minHeight=
12
+ Cd?"18px":"12px")}function Nb(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-a.lineSpace.offsetTop);a=Math.ceil(d+e);return{from:cb(b,d),to:cb(b,a)}}function xc(a){var b=a.display;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var c=Ob(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=
13
+ e;a.options.fixedGutter&&(b.gutters.style.left=c+d+"px")}}function Dd(a){if(!a.options.lineNumbers)return!1;var b=a.doc,b=""+a.options.lineNumberFormatter(b.first+b.size-1+a.options.firstLineNumber),a=a.display;if(b.length!=a.lineNumChars){var c=a.measure.appendChild(q("div",[q("div",b)],"CodeMirror-linenumber CodeMirror-gutter-elt")),d=c.firstChild.offsetWidth,c=c.offsetWidth-d;a.lineGutter.style.width="";a.lineNumInnerWidth=Math.max(d,a.lineGutter.offsetWidth-c);a.lineNumWidth=a.lineNumInnerWidth+
14
+ c;a.lineNumChars=a.lineNumInnerWidth?b.length:-1;a.lineGutter.style.width=a.lineNumWidth+"px";return!0}return!1}function Ob(a){return z(a.scroller).left-z(a.sizer).left}function db(a,b,c){var d=a.display.showingFrom,e=a.display.showingTo;if(b=yc(a,b,c))M(a,"update",a),(a.display.showingFrom!=d||a.display.showingTo!=e)&&M(a,"viewportChange",a,a.display.showingFrom,a.display.showingTo);Pb(a);wc(a.display,a.doc.height);return b}function yc(a,b,c){var d=a.display,e=a.doc;if(d.wrapper.clientWidth){var f=
15
+ Nb(d,e,c);if(!(0==b.length&&f.from>d.showingFrom&&f.to<d.showingTo)){Dd(a)&&(b=[{from:e.first,to:e.first+e.size}]);var g=d.sizer.style.marginLeft=d.gutters.offsetWidth+"px";d.scrollbarH.style.left=a.options.fixedGutter?g:"0";var h=Infinity;if(a.options.lineNumbers)for(g=0;g<b.length;++g)if(b[g].diff){h=b[g].from;break}var g=e.first+e.size,j=Math.max(f.from-a.options.viewportMargin,e.first),f=Math.min(g,f.to+a.options.viewportMargin);d.showingFrom<j&&20>j-d.showingFrom&&(j=Math.max(e.first,d.showingFrom));
16
+ d.showingTo>f&&20>d.showingTo-f&&(f=Math.min(g,d.showingTo));if(Ca)for(j=F(la(e,r(e,j)));f<g&&aa(e,r(e,f));)++f;var i=[{from:Math.max(d.showingFrom,e.first),to:Math.min(d.showingTo,g)}],i=i[0].from>=i[0].to?[]:Ed(i,b);if(Ca)for(g=0;g<i.length;++g)for(var b=i[g],l;l=Ba(r(e,b.to-1));)if(l=l.find().from.line,l>b.from)b.to=l;else{i.splice(g--,1);break}for(g=l=0;g<i.length;++g)b=i[g],b.from<j&&(b.from=j),b.to>f&&(b.to=f),b.from>=b.to?i.splice(g--,1):l+=b.to-b.from;if(l==f-j&&j==d.showingFrom&&f==d.showingTo)zc(a);
17
+ else{i.sort(function(a,b){return a.from-b.from});g=document.activeElement;l<0.7*(f-j)&&(d.lineDiv.style.display="none");Fd(a,j,f,i,h);d.lineDiv.style.display="";document.activeElement!=g&&g.offsetHeight&&g.focus();if(j!=d.showingFrom||f!=d.showingTo||d.lastSizeC!=d.wrapper.clientHeight)d.lastSizeC=d.wrapper.clientHeight;d.showingFrom=j;d.showingTo=f;Ya(a,100);h=d.lineDiv.offsetTop;for(j=d.lineDiv.firstChild;j;j=j.nextSibling)if(j.lineObj&&(ja?(i=j.offsetTop+j.offsetHeight,g=i-h,h=i):(g=z(j),g=g.bottom-
18
+ g.top),i=j.lineObj.height-g,2>g&&(g=Za(d)),0.001<i||-0.001>i))if(L(j.lineObj,g),i=j.lineObj.widgets)for(g=0;g<i.length;++g)i[g].height=i[g].node.offsetHeight;zc(a);Nb(d,e,c).to>f&&yc(a,[],c);return!0}}}else d.showingFrom=d.showingTo=e.first,d.viewOffset=0}function zc(a){var b=a.display.viewOffset=ma(a,r(a.doc,a.display.showingFrom));a.display.mover.style.top=b+"px"}function Ed(a,b){for(var c=0,d=b.length||0;c<d;++c){for(var e=b[c],f=[],g=e.diff||0,h=0,j=a.length;h<j;++h){var i=a[h];e.to<=i.from&&
19
+ e.diff?f.push({from:i.from+g,to:i.to+g}):e.to<=i.from||e.from>=i.to?f.push(i):(e.from>i.from&&f.push({from:i.from,to:e.from}),e.to<i.to&&f.push({from:e.to+g,to:i.to+g}))}a=f}return a}function Gd(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:Ob(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function Fd(a,b,c,d,e){function f(b){var c=
20
+ b.nextSibling;P&&na&&a.display.currentWheelTarget==b?(b.style.display="none",b.lineObj=null):b.parentNode.removeChild(b);return c}var g=Gd(a),h=a.display,j=a.options.lineNumbers;!d.length&&(!P||!a.display.currentWheelTarget)&&$a(h.lineDiv);var i=h.lineDiv,l=i.firstChild,m=d.shift(),n=b;for(a.doc.iter(b,c,function(b){m&&m.to==n&&(m=d.shift());if(aa(a.doc,b)){if(0!=b.height&&L(b,0),b.widgets&&l.previousSibling)for(var c=0;c<b.widgets.length;++c)if(b.widgets[c].showIfHidden){var h=l.previousSibling;
21
+ if(/pre/i.test(h.nodeName)){var k=q("div",null,null,"position: relative");h.parentNode.replaceChild(k,h);k.appendChild(h);h=k}k=h.appendChild(q("div",[b.widgets[c].node],"CodeMirror-linewidget"));Qb(b.widgets[c],k,h,g)}}else if(m&&m.from<=n&&m.to>n){for(;l.lineObj!=b;)l=f(l);j&&(e<=n&&l.lineNumber)&&Ac(l.lineNumber,""+a.options.lineNumberFormatter(n+a.options.firstLineNumber));l=l.nextSibling}else{if(b.widgets)for(var o=0,r=l;r&&20>o;++o,r=r.nextSibling)if(r.lineObj==b&&/div/i.test(r.nodeName)){c=
22
+ r;break}var o=a,N=n,G=c,r=Bc(o,b),p=b.gutterMarkers,s=o.display;if(!o.options.lineNumbers&&!p&&!b.bgClass&&!b.wrapClass&&!b.widgets)h=r;else{if(G){G.alignable=null;for(var v=!0,u=0,t=G.firstChild,x;t;t=x)if(x=t.nextSibling,/\bCodeMirror-linewidget\b/.test(t.className)){for(var w=0,z=!0;w<b.widgets.length;++w){var y=b.widgets[w],B=!1;y.above||(B=z,z=!1);if(y.node==t.firstChild){Qb(y,t,G,g);++u;B&&G.insertBefore(r,t);break}}if(w==b.widgets.length){v=!1;break}}else G.removeChild(t);v&&u==b.widgets.length&&
23
+ (h=G,G.className=b.wrapClass||"")}h||(h=q("div",null,b.wrapClass,"position: relative"),h.appendChild(r));b.bgClass&&h.insertBefore(q("div"," ",b.bgClass+" CodeMirror-linebackground"),h.firstChild);if(o.options.lineNumbers||p){k=h.insertBefore(q("div",null,null,"position: absolute; left: "+(o.options.fixedGutter?g.fixedPos:-g.gutterTotalWidth)+"px"),h.firstChild);o.options.fixedGutter&&(h.alignable||(h.alignable=[])).push(k);if(o.options.lineNumbers&&(!p||!p["CodeMirror-linenumbers"]))h.lineNumber=
24
+ k.appendChild(q("div",""+o.options.lineNumberFormatter(N+o.options.firstLineNumber),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+g.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+s.lineNumInnerWidth+"px"));if(p)for(w=0;w<o.options.gutters.length;++w)y=o.options.gutters[w],(N=p.hasOwnProperty(y)&&p[y])&&k.appendChild(q("div",[N],"CodeMirror-gutter-elt","left: "+g.gutterLeft[y]+"px; width: "+g.gutterWidth[y]+"px"))}ja&&(h.style.zIndex=2);if(b.widgets&&h!=G){w=0;for(G=b.widgets;w<G.length;++w)y=
25
+ G[w],p=q("div",[y.node],"CodeMirror-linewidget"),Qb(y,p,h,g),y.above?h.insertBefore(p,o.options.lineNumbers&&0!=b.height?k:r):h.appendChild(p),M(y,"redraw")}}if(h!=c)i.insertBefore(h,l);else{for(;l!=c;)l=f(l);l=l.nextSibling}h.lineObj=b}++n});l;)l=f(l)}function Qb(a,b,c,d){a.noHScroll&&((c.alignable||(c.alignable=[])).push(b),c=d.wrapperWidth,b.style.left=d.fixedPos+"px",a.coverGutter||(c-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=c+"px");a.coverGutter&&(b.style.zIndex=
26
+ 5,b.style.position="relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function Pb(a){var b=a.display,c=t(a.doc.sel.from,a.doc.sel.to);if(c||a.options.showCursorWhenSelecting){var d=a.display,e=Q(a,a.doc.sel.head,"div");d.cursor.style.left=e.left+"px";d.cursor.style.top=e.top+"px";d.cursor.style.height=Math.max(0,e.bottom-e.top)*a.options.cursorHeight+"px";d.cursor.style.display="";e.other?(d.otherCursor.style.display="",d.otherCursor.style.left=e.other.left+"px",d.otherCursor.style.top=
27
+ e.other.top+"px",d.otherCursor.style.height=0.85*(e.other.bottom-e.other.top)+"px"):d.otherCursor.style.display="none"}else b.cursor.style.display=b.otherCursor.style.display="none";c?b.selectionDiv.style.display="none":Hd(a);a=Q(a,a.doc.sel.head,"div");c=z(b.wrapper);d=z(b.lineDiv);b.inputDiv.style.top=Math.max(0,Math.min(b.wrapper.clientHeight-10,a.top+d.top-c.top))+"px";b.inputDiv.style.left=Math.max(0,Math.min(b.wrapper.clientWidth-10,a.left+d.left-c.left))+"px"}function Hd(a){function b(a,b,
28
+ c,d){0>b&&(b=0);g.appendChild(q("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?h-a:c)+"px; height: "+(d-b)+"px"))}function c(c,d,f,g){var i=r(e,c),l=i.text.length,m=g?Infinity:-Infinity;Id(O(i),d||0,null==f?l:f,function(e,n,k){var r=eb(a,o(c,"rtl"==k?n-1:e),"div",i),k=eb(a,o(c,"rtl"==k?e:n-1),"div",i),q=r.left,p=k.right;3<k.top-r.top&&(b(q,r.top,null,r.bottom),q=j,r.bottom<k.top&&b(q,r.bottom,null,k.top));null==f&&n==l&&(p=h);null==d&&0==e&&(q=
29
+ j);m=g?Math.min(k.top,m):Math.max(k.bottom,m);q<j+1&&(q=j);b(q,k.top,p-q,k.bottom)});return m}var d=a.display,e=a.doc,f=a.doc.sel,g=document.createDocumentFragment(),h=d.lineSpace.offsetWidth,j=R(a.display.measure,q("pre",null,null,"text-align: left")).appendChild(q("span","x")).offsetLeft;if(f.from.line==f.to.line)c(f.from.line,f.from.ch,f.to.ch);else{for(var i=r(e,f.from.line),l=i,m=[f.from.line,f.from.ch],n;l=Ba(l);){l=l.find();m.push(l.from.ch,l.to.line,l.to.ch);if(l.to.line==f.to.line){m.push(f.to.ch);
30
+ n=!0;break}l=r(e,l.to.line)}if(n)for(f=0;f<m.length;f+=3)c(m[f],m[f+1],m[f+2]);else m=r(e,f.to.line),i=f.from.ch?c(f.from.line,f.from.ch,null,!1):ma(a,i)-d.viewOffset,f=f.to.ch?c(f.to.line,ba(m,-1)?null:0,f.to.ch,!0):ma(a,m)-d.viewOffset,i<f&&b(j,i,null,f)}R(d.selectionDiv,g);d.selectionDiv.style.display=""}function fb(a){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursor.style.visibility=b.otherCursor.style.visibility="";b.blinker=setInterval(function(){b.cursor.offsetHeight&&(b.cursor.style.visibility=
31
+ b.otherCursor.style.visibility=(c=!c)?"":"hidden")},a.options.cursorBlinkRate)}function Ya(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.showingTo&&a.state.highlight.set(b,J(Jd,a))}function Jd(a){var b=a.doc;b.frontier<b.first&&(b.frontier=b.first);if(!(b.frontier>=a.display.showingTo)){var c=+new Date+a.options.workTime,d=oa(b.mode,Da(a,b.frontier)),e=[],f;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=
32
+ Cc(a,g,d);for(var j=!h||h.length!=g.styles.length,i=0;!j&&i<h.length;++i)j=h[i]!=g.styles[i];j&&(f&&f.end==b.frontier?f.end++:e.push(f={start:b.frontier,end:b.frontier+1}));g.stateAfter=oa(b.mode,d)}else{Dc(a,g,d);g.stateAfter=b.frontier%5==0?oa(b.mode,d):null}++b.frontier;if(+new Date>c){Ya(a,a.options.workDelay);return true}});e.length&&s(a,function(){for(var a=0;a<e.length;++a)w(this,e[a].start,e[a].end)})()}}function Kd(a,b){for(var c,d,e=a.doc,f=b,g=b-100;f>g;--f){if(f<=e.first)return e.first;
33
+ var h=r(e,f-1);if(h.stateAfter)return f;h=pa(h.text,null,a.options.tabSize);if(null==d||c>h)d=f-1,c=h}return d}function Da(a,b){var c=a.doc,d=a.display;if(!c.mode.startState)return!0;var e=Kd(a,b),f=e>c.first&&r(c,e-1).stateAfter,f=f?oa(c.mode,f):Ec(c.mode);c.iter(e,b,function(g){Dc(a,g,f);g.stateAfter=e==b-1||0==e%5||e>=d.showingFrom&&e<d.showingTo?oa(c.mode,f):null;++e});return f}function Fc(a,b,c,d){for(var e=-1,d=d||gb(a,b),a=c;;a+=e){var f=d[a];if(f)break;0>e&&0==a&&(e=1)}return{left:a<c?f.right:
34
+ f.left,right:a>c?f.left:f.right,top:f.top,bottom:f.bottom}}function gb(a,b){for(var c=a.display,d=a.display.measureLineCache,e=0;e<d.length;++e){var f=d[e];if(f.text==b.text&&f.markedSpans==b.markedSpans&&c.scroller.clientWidth==f.width&&f.classes==b.textClass+"|"+b.bgClass+"|"+b.wrapClass)return f.measure}var g=a.display,h=Gc(b.text.length),f=Bc(a,b,h);if(E&&!ja&&!a.options.lineWrapping&&100<f.childNodes.length){for(var j=document.createDocumentFragment(),i=f.childNodes.length,e=0,l=Math.ceil(i/
35
+ 10);e<l;++e){for(var m=q("div",null,null,"display: inline-block"),n=0;10>n&&i;++n)m.appendChild(f.firstChild),--i;j.appendChild(m)}f.appendChild(j)}R(g.measure,f);i=z(g.lineDiv);l=[];j=Gc(b.text.length);m=f.offsetHeight;ca&&g.measure.first!=f&&R(g.measure,f);for(e=0;e<h.length;++e)if(g=h[e]){for(var A=z(g),k=Math.max(0,A.top-i.top),o=Math.min(A.bottom-i.top,m),n=0;n<l.length;n+=2){var r=l[n],p=l[n+1];if(!(r>o||p<k))if(r<=k&&p>=o||k<=r&&o>=p||Math.min(o,p)-Math.max(k,r)>=o-k>>1){l[n]=Math.min(k,r);
36
+ l[n+1]=Math.max(o,p);break}}n==l.length&&l.push(k,o);k=A.right;g.measureRight&&(k=z(g.measureRight).left);j[e]={left:A.left-i.left,right:k-i.left,top:n}}for(e=0;e<j.length;++e)if(g=j[e])h=g.top,g.top=l[h],g.bottom=l[h+1];a.options.lineWrapping||(e=f.lastChild,3==e.nodeType&&(e=f.appendChild(q("span","​"))),j.width=z(e).right-i.left);f={text:b.text,width:c.scroller.clientWidth,markedSpans:b.markedSpans,measure:j,classes:b.textClass+"|"+b.bgClass+"|"+b.wrapClass};16==d.length?d[++c.measureLineCachePos%
37
+ 16]=f:d.push(f);return j}function ka(a){a.display.measureLineCache.length=a.display.measureLineCachePos=0;a.display.cachedCharWidth=a.display.cachedTextHeight=null;a.display.maxLineChanged=!0;a.display.lineNumChars=null}function Hc(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=hb(b.widgets[e]);c.top+=f;c.bottom+=f}if("line"==d)return c;d||(d="local");b=ma(a,b);"local"!=d&&(b-=a.display.viewOffset);"page"==d&&(a=z(a.display.lineSpace),b+=a.top+(window.pageYOffset||
38
+ (document.documentElement||document.body).scrollTop),a=a.left+(window.pageXOffset||(document.documentElement||document.body).scrollLeft),c.left+=a,c.right+=a);c.top+=b;c.bottom+=b;return c}function eb(a,b,c,d){d||(d=r(a.doc,b.line));return Hc(a,d,Fc(a,d,b.ch),c)}function Q(a,b,c,d,e){function f(b,f){var g=Fc(a,d,b,e);f?g.left=g.right:g.right=g.left;return Hc(a,d,g,c)}d=d||r(a.doc,b.line);e||(e=gb(a,d));var g=O(d),b=b.ch;if(!g)return f(b);for(var h,j,i=g[0].level,l=0;l<g.length;++l){var m=g[l],n=m.level%
39
+ 2,A;if(m.from<b&&m.to>b)return f(b,n);var k=n?m.from:m.to;if((n?m.to:m.from)==b)m=l&&m.level<(A=g[l-1]).level?f(A.level%2?A.from:A.to-1,!0):f(n&&m.from!=m.to?b-1:b),n==i?h=m:j=m;else if(k==b&&(A=l<g.length-1&&g[l+1],n||!(A&&A.from==A.to)))m=A&&m.level<A.level?f(A.level%2?A.to-1:A.from):f(n?b:b-1,!0),n==i?h=m:j=m}i&&!b&&(j=f(g[0].to-1));if(!h)return j;j&&(h.other=j);return h}function ib(a,b,c){a=new o(a,b);c&&(a.outside=!0);return a}function Rb(a,b,c){var d=a.doc,c=c+a.display.viewOffset;if(0>c)return ib(d.first,
40
+ 0,!0);var e=cb(d,c),f=d.first+d.size-1;if(e>f)return ib(d.first+d.size-1,r(d,f).text.length,!0);for(0>b&&(b=0);;){var f=r(d,e),e=Ld(a,f,e,b,c),g=(f=Ba(f))&&f.find();if(f&&e.ch>=g.from.ch)e=g.to.line;else return e}}function Ld(a,b,c,d,e){function f(d){d=Q(a,o(c,d),"line",b,i);h=!0;if(g>d.bottom)return Math.max(0,d.left-j);if(g<d.top)return d.left+j;h=!1;return d.left}var g=e-ma(a,b),h=!1,j=a.display.wrapper.clientWidth,i=gb(a,b),l=O(b),m=b.text.length,n=jb(b),A=kb(b),k=f(n),e=h,r=f(A),q=h;if(d>r)return ib(c,
41
+ A,q);for(;;){if(l?A==n||A==Sb(b,n,1):1>=A-n){for(n=(d=d-k<r-d)?n:A;Tb.test(b.text.charAt(n));)++n;e=ib(c,n,d?e:q);e.after=d;return e}var p=Math.ceil(m/2),s=n+p;if(l)for(var s=n,N=0;N<p;++N)s=Sb(b,s,1);N=f(s);if(N>d){A=s;r=N;if(q=h)r+=1E3;m-=p}else n=s,k=N,e=h,m=p}}function Za(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==da){da=q("pre");for(var b=0;49>b;++b)da.appendChild(document.createTextNode("x")),da.appendChild(q("br"));da.appendChild(document.createTextNode("x"))}R(a.measure,
42
+ da);b=da.offsetHeight/50;3<b&&(a.cachedTextHeight=b);$a(a.measure);return b||1}function Ad(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=q("span","x"),c=q("pre",[b]);R(a.measure,c);b=b.offsetWidth;2<b&&(a.cachedCharWidth=b);return b||10}function qa(a){a.curOp={changes:[],updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,updateMaxLine:!1,updateScrollPos:!1,id:++Md};lb++||(W=[])}function ra(a){var b=a.curOp,c=a.doc,d=a.display;a.curOp=null;b.updateMaxLine&&Mb(a);
43
+ if(d.maxLineChanged&&!a.options.lineWrapping){var e=gb(a,d.maxLine).width;d.sizer.style.minWidth=Math.max(0,e+3+za)+"px";d.maxLineChanged=!1;e=Math.max(0,d.sizer.offsetLeft+d.sizer.offsetWidth-d.scroller.clientWidth);e<c.scrollLeft&&!b.updateScrollPos&&sa(a,Math.min(d.scroller.scrollLeft,e),!0)}var f,g;b.updateScrollPos?f=b.updateScrollPos:b.selectionChanged&&d.scroller.clientHeight&&(f=Q(a,c.sel.head),f=Ub(a,f.left,f.top,f.left,f.bottom));if(b.changes.length||f&&null!=f.scrollTop)g=db(a,b.changes,
44
+ f&&f.scrollTop);!g&&b.selectionChanged&&Pb(a);if(b.updateScrollPos)d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=f.scrollTop,d.scroller.scrollLeft=d.scrollbarH.scrollLeft=c.scrollLeft=f.scrollLeft,xc(a);else if(f&&(c=Ic(a,a.doc.sel.head),a.state.focused)){d=a.display;f=z(d.sizer);g=null;if(0>c.top+f.top)g=!0;else if(c.bottom+f.top>(window.innerHeight||document.documentElement.clientHeight))g=!1;if(null!=g&&!Nd){if(f="none"==d.cursor.style.display)d.cursor.style.display="",d.cursor.style.left=
45
+ c.left+"px",d.cursor.style.top=c.top-d.viewOffset+"px";d.cursor.scrollIntoView(g);f&&(d.cursor.style.display="none")}}b.selectionChanged&&fb(a);a.state.focused&&b.updateInput&&Z(a,b.userSelChange);c=b.maybeHiddenMarkers;d=b.maybeUnhiddenMarkers;if(c)for(g=0;g<c.length;++g)c[g].lines.length||H(c[g],"hide");if(d)for(g=0;g<d.length;++g)d[g].lines.length&&H(d[g],"unhide");var h;--lb||(h=W,W=null);b.textChanged&&H(a,"change",a,b.textChanged);b.selectionChanged&&H(a,"cursorActivity",a);if(h)for(g=0;g<h.length;++g)h[g]()}
46
+ function s(a,b){return function(){var c=a||this,d=!c.curOp;d&&qa(c);try{var e=b.apply(c,arguments)}finally{d&&ra(c)}return e}}function Ea(a){return function(){var b=this.cm&&!this.cm.curOp,c;b&&qa(this.cm);try{c=a.apply(this,arguments)}finally{b&&ra(this.cm)}return c}}function Jc(a,b){var c=!a.curOp,d;c&&qa(a);try{d=b()}finally{c&&ra(a)}return d}function w(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 mb(a){a.display.pollingFast||
47
+ a.display.poll.set(a.options.pollInterval,function(){Vb(a);a.state.focused&&mb(a)})}function Fa(a){function b(){!Vb(a)&&!c?(c=!0,a.display.poll.set(60,b)):(a.display.pollingFast=!1,mb(a))}var c=!1;a.display.pollingFast=!0;a.display.poll.set(20,b)}function Vb(a){var b=a.display.input,c=a.display.prevInput,d=a.doc,e=d.sel;if(!a.state.focused||Od(b)||Ga(a))return!1;var f=b.value;if(f==c&&t(e.from,e.to))return!1;if(E&&f&&0===b.selectionStart)return Z(a,!0),!1;var g=!a.curOp;g&&qa(a);e.shift=!1;for(var h=
48
+ 0,j=Math.min(c.length,f.length);h<j&&c[h]==f[h];)++h;j=e.from;e=e.to;h<c.length?j=o(j.line,j.ch-(c.length-h)):a.state.overwrite&&(t(j,e)&&!a.state.pasteIncoming)&&(e=o(e.line,Math.min(r(d,e.line).text.length,e.ch+(f.length-h))));c=a.curOp.updateInput;Ha(a.doc,{from:j,to:e,text:ta(f.slice(h)),origin:a.state.pasteIncoming?"paste":"+input"},"end");a.curOp.updateInput=c;1E3<f.length?b.value=a.display.prevInput="":a.display.prevInput=f;g&&ra(a);a.state.pasteIncoming=!1;return!0}function Z(a,b){var c,d,
49
+ e=a.doc;t(e.sel.from,e.sel.to)?b&&(a.display.prevInput=a.display.input.value=""):(a.display.prevInput="",c=Kc&&(100<e.sel.to.line-e.sel.from.line||1E3<(d=a.getSelection()).length),a.display.input.value=c?"-":d||a.getSelection(),a.state.focused&&Lc(a.display.input));a.display.inaccurateSelection=c}function D(a){"nocursor"!=a.options.readOnly&&(!Hb||document.activeElement!=a.display.input)&&a.display.input.focus()}function Ga(a){return a.options.readOnly||a.doc.cantEdit}function zd(a){function b(){a.state.focused&&
50
+ setTimeout(J(D,a),0)}function c(){g.cachedCharWidth=g.cachedTextHeight=null;ka(a);Jc(a,J(w,a))}function d(){for(var a=g.wrapper.parentNode;a&&a!=document.body;a=a.parentNode);a?setTimeout(d,5E3):S(window,"resize",c)}function e(b){(!a.options.onDragEvent||!a.options.onDragEvent(a,Ia(b)))&&nb(b)}function f(){g.inaccurateSelection&&(g.prevInput="",g.inaccurateSelection=!1,g.input.value=a.getSelection(),Lc(g.input))}var g=a.display;v(g.scroller,"mousedown",s(a,Pd));v(g.scroller,"dblclick",s(a,y));v(g.lineSpace,
51
+ "selectstart",function(a){ua(g,a)||y(a)});Wb||v(g.scroller,"contextmenu",function(b){Mc(a,b)});v(g.scroller,"scroll",function(){Ja(a,g.scroller.scrollTop);sa(a,g.scroller.scrollLeft,!0);H(a,"scroll",a)});v(g.scrollbarV,"scroll",function(){Ja(a,g.scrollbarV.scrollTop)});v(g.scrollbarH,"scroll",function(){sa(a,g.scrollbarH.scrollLeft)});v(g.scroller,"mousewheel",function(b){Nc(a,b)});v(g.scroller,"DOMMouseScroll",function(b){Nc(a,b)});v(g.scrollbarH,"mousedown",b);v(g.scrollbarV,"mousedown",b);v(g.wrapper,
52
+ "scroll",function(){g.wrapper.scrollTop=g.wrapper.scrollLeft=0});v(window,"resize",c);setTimeout(d,5E3);v(g.input,"keyup",s(a,function(b){if((!a.options.onKeyEvent||!a.options.onKeyEvent(a,Ia(b)))&&16==b.keyCode)a.doc.sel.shift=!1}));v(g.input,"input",J(Fa,a));v(g.input,"keydown",s(a,Oc));v(g.input,"keypress",s(a,Qd));v(g.input,"focus",J($,a));v(g.input,"blur",J(Jb,a));a.options.dragDrop&&(v(g.scroller,"dragstart",function(b){var c=a;if(!ua(c.display,b)){var d=c.getSelection();b.dataTransfer.setData("Text",
53
+ d);b.dataTransfer.setDragImage&&!Xb&&(d=q("img",null,null,"position: fixed; left: 0; top: 0;"),T&&(d.width=d.height=1,c.display.wrapper.appendChild(d),d._top=d.offsetTop),b.dataTransfer.setDragImage(d,0,0),T&&d.parentNode.removeChild(d))}}),v(g.scroller,"dragenter",e),v(g.scroller,"dragover",e),v(g.scroller,"drop",s(a,Rd)));v(g.scroller,"paste",function(b){if(!ua(g,b)){D(a);Fa(a)}});v(g.input,"paste",function(){a.state.pasteIncoming=true;Fa(a)});v(g.input,"cut",f);v(g.input,"copy",f);Lb&&v(g.sizer,
54
+ "mouseup",function(){document.activeElement==g.input&&g.input.blur();D(a)})}function ua(a,b){for(var c=b.target||b.srcElement;c!=a.wrapper;c=c.parentNode)if(!c||/\bCodeMirror-(?:line)?widget\b/.test(c.className)||c.parentNode==a.sizer&&c!=a.mover)return!0}function Ka(a,b,c){var d=a.display;if(!c&&(c=b.target||b.srcElement,c==d.scrollbarH||c==d.scrollbarH.firstChild||c==d.scrollbarV||c==d.scrollbarV.firstChild||c==d.scrollbarFiller))return null;var e,f,d=z(d.lineSpace);try{e=b.clientX,f=b.clientY}catch(g){return null}return Rb(a,
55
+ e-d.left,f-d.top)}function Pd(a){function b(a){if("single"==l)B(e.doc,p(g,j),a);else if(A=p(g,A),k=p(g,k),"double"==l){var b=Pc(r(g,a.line).text,a);x(a,A)?B(e.doc,b.from,k):B(e.doc,A,b.to)}else"triple"==l&&(x(a,A)?B(e.doc,k,p(g,o(a.line,0))):B(e.doc,A,p(g,o(a.line+1,0))))}function c(a){var d=++u,h=Ka(e,a,!0);if(h)if(t(h,m)){var i=a.clientY<q.top?-20:a.clientY>q.bottom?20:0;i&&setTimeout(s(e,function(){u==d&&(f.scroller.scrollTop+=i,c(a))}),50)}else{e.state.focused||$(e);m=h;b(h);var j=Nb(f,g);(h.line>=
56
+ j.to||h.line<j.from)&&setTimeout(s(e,function(){u==d&&c(a)}),150)}}function d(a){u=Infinity;var c=Ka(e,a);c&&b(c);y(a);D(e);S(document,"mousemove",w);S(document,"mouseup",C)}var e=this,f=e.display,g=e.doc,h=g.sel;h.shift=a.shiftKey;if(ua(f,a))P||(f.scroller.draggable=!1,setTimeout(function(){f.scroller.draggable=!0},100));else if(!Sd(e,a)){var j=Ka(e,a);switch(Qc(a)){case 3:Wb&&Mc.call(e,e,a);return;case 2:j&&B(e.doc,j);setTimeout(J(D,e),20);y(a);return}if(j){e.state.focused||$(e);var i=+new Date,
57
+ l="single";ob&&ob.time>i-400&&t(ob.pos,j)?(l="triple",y(a),setTimeout(J(D,e),20),Td(e,j.line)):pb&&pb.time>i-400&&t(pb.pos,j)?(l="double",ob={time:i,pos:j},y(a),i=Pc(r(g,j.line).text,j),B(e.doc,i.from,i.to)):pb={time:i,pos:j};var m=j;if(e.options.dragDrop&&Ud&&!Ga(e)&&!t(h.from,h.to)&&!x(j,h.from)&&!x(h.to,j)&&"single"==l){var n=s(e,function(b){if(P)f.scroller.draggable=false;e.state.draggingText=false;S(document,"mouseup",n);S(f.scroller,"drop",n);if(Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-
58
+ b.clientY)<10){y(b);B(e.doc,j);D(e)}});P&&(f.scroller.draggable=!0);e.state.draggingText=n;f.scroller.dragDrop&&f.scroller.dragDrop();v(document,"mouseup",n);v(f.scroller,"drop",n)}else{y(a);"single"==l&&B(e.doc,p(g,j));var A=h.from,k=h.to,q=z(f.wrapper),u=0,w=s(e,function(a){!E&&!Qc(a)?d(a):c(a)}),C=s(e,d);v(document,"mousemove",w);v(document,"mouseup",C)}}else(a.target||a.srcElement)==f.scroller&&y(a)}}function Rd(a){var b=this;if(!(ua(b.display,a)||b.options.onDragEvent&&b.options.onDragEvent(b,
59
+ Ia(a)))){y(a);var c=Ka(b,a,!0),d=a.dataTransfer.files;if(c&&!Ga(b))if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,a=function(a,d){var h=new FileReader;h.onload=function(){f[d]=h.result;++g==e&&(c=p(b.doc,c),X(b.doc,f.join(""),c,"around","paste"))};h.readAsText(a)},h=0;h<e;++h)a(d[h],h);else if(b.state.draggingText&&!x(c,b.doc.sel.from)&&!x(b.doc.sel.to,c))b.state.draggingText(a),setTimeout(J(D,b),20);else try{if(f=a.dataTransfer.getData("Text")){var h=b.doc.sel.from,
60
+ j=b.doc.sel.to;Y(b.doc,c,c);b.state.draggingText&&X(b.doc,"",h,j,"paste");b.replaceSelection(f,null,"paste");D(b);$(b)}}catch(i){}}}function Sd(a,b){var c=a.display;try{var d=b.clientX,e=b.clientY}catch(f){return!1}if(d>=Math.floor(z(c.gutters).right))return!1;y(b);if(!va(a,"gutterClick"))return!0;var g=z(c.lineDiv);if(e>g.bottom)return!0;e-=g.top-c.viewOffset;for(g=0;g<a.options.gutters.length;++g){var h=c.gutters.childNodes[g];if(h&&z(h).right>=d){c=cb(a.doc,e);M(a,"gutterClick",a,c,a.options.gutters[g],
61
+ b);break}}return!0}function Ja(a,b){2>Math.abs(a.doc.scrollTop-b)||(a.doc.scrollTop=b,wa||db(a,[],b),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbarV.scrollTop!=b&&(a.display.scrollbarV.scrollTop=b),wa&&db(a,[]))}function sa(a,b,c){if(!(c?b==a.doc.scrollLeft:2>Math.abs(a.doc.scrollLeft-b)))if(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,xc(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),
62
+ a.display.scrollbarH.scrollLeft!=b)a.display.scrollbarH.scrollLeft=b}function Nc(a,b){var c=b.wheelDeltaX,d=b.wheelDeltaY;null==c&&(b.detail&&b.axis==b.HORIZONTAL_AXIS)&&(c=b.detail);null==d&&b.detail&&b.axis==b.VERTICAL_AXIS?d=b.detail:null==d&&(d=b.wheelDelta);if(d&&na&&P)for(var e=b.target;e!=g;e=e.parentNode)if(e.lineObj){a.display.currentWheelTarget=e;break}var f=a.display,g=f.scroller;if(c&&!wa&&!T&&null!=K)d&&Ja(a,Math.max(0,Math.min(g.scrollTop+d*K,g.scrollHeight-g.clientHeight))),sa(a,Math.max(0,
63
+ Math.min(g.scrollLeft+c*K,g.scrollWidth-g.clientWidth))),y(b),f.wheelStartX=null;else{if(d&&null!=K){var e=d*K,h=a.doc.scrollTop,j=h+f.wrapper.clientHeight;0>e?h=Math.max(0,h+e-50):j=Math.min(a.doc.height,j+e+50);db(a,[],{top:h,bottom:j})}20>qb&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=c,f.wheelDY=d,setTimeout(function(){if(f.wheelStartX!=null){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,a=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;
64
+ f.wheelStartX=f.wheelStartY=null;if(a){K=(K*qb+a)/(qb+1);++qb}}},200)):(f.wheelDX+=c,f.wheelDY+=d))}}function rb(a,b,c){if("string"==typeof b&&(b=Yb[b],!b))return!1;a.display.pollingFast&&Vb(a)&&(a.display.pollingFast=!1);var d=a.doc,e=d.sel.shift,f=!1;try{Ga(a)&&(a.state.suppressEdits=!0),c&&(d.sel.shift=!1),f=b(a)!=Rc}finally{d.sel.shift=e,a.state.suppressEdits=!1}return f}function Sc(a){var b=a.state.keyMaps.slice(0);b.push(a.options.keyMap);a.options.extraKeys&&b.unshift(a.options.extraKeys);
65
+ return b}function Tc(a,b){var c=Zb(a.options.keyMap),d=c.auto;clearTimeout(Uc);d&&!Vc(b)&&(Uc=setTimeout(function(){Zb(a.options.keyMap)==c&&(a.options.keyMap=d.call?d.call(null,a):d)},50));var e=Wc(b,!0),f=!1;if(!e)return!1;f=Sc(a);f=b.shiftKey?La("Shift-"+e,f,function(b){return rb(a,b,!0)})||La(e,f,function(b){if("string"==typeof b&&/^go[A-Z]/.test(b))return rb(a,b)}):La(e,f,function(b){return rb(a,b)});"stop"==f&&(f=!1);f&&(y(b),fb(a),ca&&(b.oldKeyCode=b.keyCode,b.keyCode=0));return f}function Vd(a,
66
+ b,c){if(c=La("'"+c+"'",Sc(a),function(b){return rb(a,b,!0)}))y(b),fb(a);return c}function Oc(a){this.state.focused||$(this);E&&27==a.keyCode&&(a.returnValue=!1);if(!this.options.onKeyEvent||!this.options.onKeyEvent(this,Ia(a))){var b=a.keyCode;this.doc.sel.shift=16==b||a.shiftKey;var c=Tc(this,a);T&&($b=c?b:null,!c&&(88==b&&!Kc&&(na?a.metaKey:a.ctrlKey))&&this.replaceSelection(""))}}function Qd(a){var b=this;if(!b.options.onKeyEvent||!b.options.onKeyEvent(b,Ia(a))){var c=a.keyCode,d=a.charCode;if(T&&
67
+ c==$b)$b=null,y(a);else if(!(T&&(!a.which||10>a.which)||Lb)||!Tc(b,a))c=String.fromCharCode(null==d?c:d),this.options.electricChars&&(this.doc.mode.electricChars&&this.options.smartIndent&&!Ga(this)&&-1<this.doc.mode.electricChars.indexOf(c))&&setTimeout(s(b,function(){sb(b,b.doc.sel.to.line,"smart")}),75),Vd(b,a,c)||Fa(b)}}function $(a){"nocursor"!=a.options.readOnly&&(a.state.focused||(H(a,"focus",a),a.state.focused=!0,-1==a.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(a.display.wrapper.className+=
68
+ " CodeMirror-focused"),Z(a,!0)),mb(a),fb(a))}function Jb(a){a.state.focused&&(H(a,"blur",a),a.state.focused=!1,a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-focused",""));clearInterval(a.display.blinker);setTimeout(function(){if(!a.state.focused)a.doc.sel.shift=false},150)}function Mc(a,b){function c(){d.inputDiv.style.position="relative";d.input.style.cssText=h;ca&&(d.scrollbarV.scrollTop=d.scroller.scrollTop=g);mb(a);if(null!=d.input.selectionStart&&(!E||ca)){clearTimeout(ac);
69
+ var b=d.input.value=" "+(t(e.from,e.to)?"":d.input.value),c=0;d.prevInput=" ";d.input.selectionStart=1;d.input.selectionEnd=b.length;var f=function(){d.prevInput==" "&&d.input.selectionStart==0?s(a,Yb.selectAll)(a):c++<10?ac=setTimeout(f,500):Z(a)};ac=setTimeout(f,200)}}var d=a.display,e=a.doc.sel;if(!ua(d,b)){var f=Ka(a,b),g=d.scroller.scrollTop;if(f&&!T){(t(e.from,e.to)||x(f,e.from)||!x(f,e.to))&&s(a,Y)(a.doc,f,f);var h=d.input.style.cssText;d.inputDiv.style.position="absolute";d.input.style.cssText=
70
+ "position: fixed; width: 30px; height: 30px; top: "+(b.clientY-5)+"px; left: "+(b.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);";D(a);Z(a,!0);t(e.from,e.to)&&(d.input.value=d.prevInput=" ");if(Wb){nb(b);var j=function(){S(window,"mouseup",j);setTimeout(c,20)};v(window,"mouseup",j)}else setTimeout(c,50)}}}function bc(a){return o(a.from.line+a.text.length-1,C(a.text).length+
71
+ (1==a.text.length?a.from.ch:0))}function Xc(a,b,c){if(!x(b.from,c))return p(a,c);var d=b.text.length-1-(b.to.line-b.from.line);if(c.line>b.to.line+d)return b=c.line-d,d=a.first+a.size-1,b>d?o(d,r(a,d).text.length):tb(c,r(a,b).text.length);if(c.line==b.to.line+d)return tb(c,C(b.text).length+(1==b.text.length?b.from.ch:0)+r(a,b.to.line).text.length-b.to.ch);a=c.line-b.from.line;return tb(c,b.text[a].length+(a?0:b.from.ch))}function cc(a,b,c){if(c&&"object"==typeof c)return{anchor:Xc(a,b,c.anchor),head:Xc(a,
72
+ b,c.head)};if("start"==c)return{anchor:b.from,head:b.from};var d=bc(b);if("around"==c)return{anchor:b.from,head:d};if("end"==c)return{anchor:d,head:d};c=function(a){if(x(a,b.from))return a;if(!x(b.to,a))return d;var c=a.line+b.text.length-(b.to.line-b.from.line)-1,g=a.ch;a.line==b.to.line&&(g+=d.ch-b.to.ch);return o(c,g)};return{anchor:c(a.sel.anchor),head:c(a.sel.head)}}function Wd(a,b){var c={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,update:function(b,c,f,g){b&&(this.from=p(a,
73
+ b));c&&(this.to=p(a,c));f&&(this.text=f);void 0!==g&&(this.origin=g)},cancel:function(){this.canceled=!0}};H(a,"beforeChange",a,c);a.cm&&H(a.cm,"beforeChange",a.cm,c);return c.canceled?null:{from:c.from,to:c.to,text:c.text,origin:c.origin}}function Ha(a,b,c,d){if(a.cm){if(!a.cm.curOp)return s(a.cm,Ha)(a,b,c,d);if(a.cm.state.suppressEdits)return}if(va(a,"beforeChange")||a.cm&&va(a.cm,"beforeChange"))if(b=Wd(a,b),!b)return;if(d=Yc&&!d&&Xd(a,b.from,b.to)){for(var e=d.length-1;1<=e;--e)dc(a,{from:d[e].from,
74
+ to:d[e].to,text:[""]});d.length&&dc(a,{from:d[0].from,to:d[0].to,text:b.text},c)}else dc(a,b,c)}function dc(a,b,c){c=cc(a,b,c);Yd(a,b,c,a.cm?a.cm.curOp.id:NaN);Ma(a,b,c,ec(a,b));var d=[];xa(a,function(a,c){!c&&-1==U(d,a.history)&&(Zc(a.history,b),d.push(a.history));Ma(a,b,null,ec(a,b))})}function $c(a,b){var c=a.history,d=("undo"==b?c.done:c.undone).pop();if(d){c.dirtyCounter+="undo"==b?-1:1;var e={changes:[],anchorBefore:d.anchorAfter,headBefore:d.headAfter,anchorAfter:d.anchorBefore,headAfter:d.headBefore};
75
+ ("undo"==b?c.undone:c.done).push(e);for(c=d.changes.length-1;0<=c;--c){var f=d.changes[c];f.origin=b;e.changes.push(fc(a,f));var g=c?cc(a,f,null):{anchor:d.anchorBefore,head:d.headBefore};Ma(a,f,g,ad(a,f));var h=[];xa(a,function(a,b){!b&&-1==U(h,a.history)&&(Zc(a.history,f),h.push(a.history));Ma(a,f,null,ad(a,f))})}}}function bd(a,b){function c(a){return o(a.line+b,a.ch)}a.first+=b;a.cm&&w(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=
76
+ c(a.sel.to)}function Ma(a,b,c,d){if(a.cm&&!a.cm.curOp)return s(a.cm,Ma)(a,b,c,d);if(b.to.line<a.first)bd(a,b.text.length-1-(b.to.line-b.from.line));else if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);bd(a,e);b={from:o(a.first,0),to:o(b.to.line+e,b.to.ch),text:[C(b.text)],origin:b.origin}}e=a.lastLine();b.to.line>e&&(b={from:b.from,to:o(e,r(a,e).text.length),text:[b.text[0]],origin:b.origin});c||(c=cc(a,b,null));a.cm?Zd(a.cm,b,d,c):gc(a,b,d,c)}}
77
+ function Zd(a,b,c,d){var e=a.doc,f=a.display,g=b.from,h=b.to,j=!1,i=g.line;a.options.lineWrapping||(i=F(la(e,r(e,g.line))),e.iter(i,h.line+1,function(a){if(a==f.maxLine)return j=!0}));gc(e,b,c,d,uc(a));a.options.lineWrapping||(e.iter(i,g.line+b.text.length,function(a){var b=ab(e,a);if(b>f.maxLineLength){f.maxLine=a;f.maxLineLength=b;f.maxLineChanged=true;j=false}}),j&&(a.curOp.updateMaxLine=!0));e.frontier=Math.min(e.frontier,g.line);Ya(a,400);w(a,g.line,h.line+1,b.text.length-(h.line-g.line)-1);
78
+ if(va(a,"change"))if(b={from:g,to:h,text:b.text,origin:b.origin},a.curOp.textChanged){for(a=a.curOp.textChanged;a.next;a=a.next);a.next=b}else a.curOp.textChanged=b}function X(a,b,c,d,e){d||(d=c);if(x(d,c))var f=d,d=c,c=f;"string"==typeof b&&(b=ta(b));Ha(a,{from:c,to:d,text:b,origin:e},null)}function o(a,b){if(!(this instanceof o))return new o(a,b);this.line=a;this.ch=b}function t(a,b){return a.line==b.line&&a.ch==b.ch}function x(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function ea(a){return o(a.line,
79
+ a.ch)}function p(a,b){if(b.line<a.first)return o(a.first,0);var c=a.first+a.size-1;return b.line>c?o(c,r(a,c).text.length):tb(b,r(a,b.line).text.length)}function tb(a,b){var c=a.ch;return null==c||c>b?o(a.line,b):0>c?o(a.line,0):a}function fa(a,b){return b>=a.first&&b<a.first+a.size}function B(a,b,c,d){if(a.sel.shift||a.sel.extend){var e=a.sel.anchor;if(c){var f=x(b,e);f!=x(c,e)?(e=b,b=c):f!=x(b,c)&&(b=c)}Y(a,e,b,d)}else Y(a,b,c||b,d);a.cm&&(a.cm.curOp.userSelChange=!0)}function Y(a,b,c,d,e){if(!e&&
80
+ va(a,"beforeSelectionChange")||a.cm&&va(a.cm,"beforeSelectionChange"))b={anchor:b,head:c},H(a,"beforeSelectionChange",a,b),a.cm&&H(a.cm,"beforeSelectionChange",a.cm,b),b.anchor=p(a,b.anchor),b.head=p(a,b.head),c=b.head,b=b.anchor;var f=a.sel;f.goalColumn=null;if(e||!t(b,f.anchor))b=ub(a,b,d,"push"!=e);if(e||!t(c,f.head))c=ub(a,c,d,"push"!=e);if(!t(f.anchor,b)||!t(f.head,c))f.anchor=b,f.head=c,d=x(c,b),f.from=d?c:b,f.to=d?b:c,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0),M(a,"cursorActivity",
81
+ a)}function cd(a){Y(a.doc,a.doc.sel.from,a.doc.sel.to,null,"push")}function ub(a,b,c,d){var e=!1,f=b,g=c||1;a.cantEdit=!1;a:for(;;){var h=r(a,f.line),j;if(h.markedSpans){for(var i=0;i<h.markedSpans.length;++i){var l=h.markedSpans[i],m=l.marker;if((null==l.from||(m.inclusiveLeft?l.from<=f.ch:l.from<f.ch))&&(null==l.to||(m.inclusiveRight?l.to>=f.ch:l.to>f.ch)))if(d&&m.clearOnEnter)(j||(j=[])).push(m);else if(m.atomic){i=m.find()[0>g?"from":"to"];if(t(i,f)&&(i.ch+=g,0>i.ch?i=i.line>a.first?p(a,o(i.line-
82
+ 1)):null:i.ch>h.text.length&&(i=i.line<a.first+a.size-1?o(i.line+1,0):null),!i)){if(e){if(!d)return ub(a,b,c,!0);a.cantEdit=!0;return o(a.first,0)}e=!0;i=b;g=-g}f=i;continue a}}if(j)for(i=0;i<j.length;++i)j[i].clear()}return f}}function Ic(a,b){for(;;){var c=!1,d=Q(a,b),e=Ub(a,d.left,d.top,d.left,d.bottom),f=a.doc.scrollTop,g=a.doc.scrollLeft;null!=e.scrollTop&&(Ja(a,e.scrollTop),1<Math.abs(a.doc.scrollTop-f)&&(c=!0));null!=e.scrollLeft&&(sa(a,e.scrollLeft),1<Math.abs(a.doc.scrollLeft-g)&&(c=!0));
83
+ if(!c)return d}}function dd(a,b,c,d,e){b=Ub(a,b,c,d,e);null!=b.scrollTop&&Ja(a,b.scrollTop);null!=b.scrollLeft&&sa(a,b.scrollLeft)}function Ub(a,b,c,d,e){var f=a.display,g=f.lineSpace.offsetTop,c=c+g,e=e+g,h=f.scroller.clientHeight-za,j=f.scroller.scrollTop,i={},a=a.doc.height+2*g,l=c<g+10,g=e+g>a-10;c<j?i.scrollTop=l?0:Math.max(0,c):e>j+h&&(i.scrollTop=(g?a:e)-h);c=f.scroller.clientWidth-za;e=f.scroller.scrollLeft;b+=f.gutters.offsetWidth;d+=f.gutters.offsetWidth;f=f.gutters.offsetWidth;h=b<f+10;
84
+ b<e+f||h?(h&&(b=0),i.scrollLeft=Math.max(0,b-10-f)):d>c+e-3&&(i.scrollLeft=d+10-c);return i}function sb(a,b,c,d){var e=a.doc;c||(c="add");if("smart"==c)if(a.doc.mode.indent)var f=Da(a,b);else c="prev";var g=a.options.tabSize,h=r(e,b),j=pa(h.text,null,g),i=h.text.match(/^\s*/)[0],l;if("smart"==c&&(l=a.doc.mode.indent(f,h.text.slice(i.length),h.text),l==Rc)){if(!d)return;c="prev"}"prev"==c?l=b>e.first?pa(r(e,b-1).text,null,g):0:"add"==c?l=j+a.options.indentUnit:"subtract"==c&&(l=j-a.options.indentUnit);
85
+ l=Math.max(0,l);c="";d=0;if(a.options.indentWithTabs)for(e=Math.floor(l/g);e;--e)d+=g,c+="\t";d<l&&(c+=ed(l-d));c!=i&&X(a.doc,c,o(b,0),o(b,i.length),"+input");h.stateAfter=null}function vb(a,b,c){var d=b,e=b,f=a.doc;"number"==typeof b?e=r(f,Math.max(f.first,Math.min(b,f.first+f.size-1))):d=F(b);if(null!=d&&c(e,d))w(a,d,d+1);else return null;return e}function hc(a,b,c,d,e){function f(b){var d=(e?Sb:fd)(j,h,c,!0);if(null==d){if(b=!b)b=g+c,b<a.first||b>=a.first+a.size?b=i=!1:(g=b,b=j=r(a,b));if(b)h=
86
+ e?(0>c?kb:jb)(j):0>c?j.text.length:0;else return i=!1}else h=d;return!0}var g=b.line,h=b.ch,j=r(a,g),i=!0;if("char"==d)f();else if("column"==d)f(!0);else if("word"==d)for(b=!1;!(0>c)||f();){if(wb(j.text.charAt(h)))b=!0;else if(b){0>c&&(c=1,f());break}if(0<c&&!f())break}b=ub(a,o(g,h),c,!0);i||(b.hitSide=!0);return b}function gd(a,b,c,d){var e=a.doc,f=b.left,g;"page"==d?(d=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),g=b.top+c*d):"line"==d&&(g=0<
87
+ c?b.bottom+3:b.top-3);for(;;){var h=Rb(a,f,g);if(!h.outside)break;if(0>c?0>=g:g>=e.height){h.hitSide=!0;break}g+=5*c}return h}function Pc(a,b){var c=b.ch,d=b.ch;if(a){!1===b.after||d==a.length?--c:++d;for(var e=a.charAt(c),e=wb(e)?wb:/\s/.test(e)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!wb(a)};0<c&&e(a.charAt(c-1));)--c;for(;d<a.length&&e(a.charAt(d));)++d}return{from:o(b.line,c),to:o(b.line,d)}}function Td(a,b){B(a.doc,o(b,0),p(a.doc,o(b+1,0)))}function u(a,b,c,d){k.defaults[a]=
88
+ b;c&&(ia[a]=d?function(a,b,d){d!=tc&&c(a,b,d)}:c)}function oa(a,b){if(!0===b)return b;if(a.copyState)return a.copyState(b);var c={},d;for(d in b){var e=b[d];e instanceof Array&&(e=e.concat([]));c[d]=e}return c}function Ec(a,b,c){return a.startState?a.startState(b,c):!0}function Zb(a){return"string"==typeof a?V[a]:a}function La(a,b,c){function d(b){var b=Zb(b),e=b[a];if(!1===e)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";b=b.fallthrough;if(null==b)return!1;if("[object Array]"!=
89
+ Object.prototype.toString.call(b))return d(b);for(var e=0,f=b.length;e<f;++e){var i=d(b[e]);if(i)return i}return!1}for(var e=0;e<b.length;++e){var f=d(b[e]);if(f)return f}}function Vc(a){a=ga[a.keyCode];return"Ctrl"==a||"Alt"==a||"Shift"==a||"Mod"==a}function Wc(a,b){var c=ga[a.keyCode];if(null==c||a.altGraphKey)return!1;a.altKey&&(c="Alt-"+c);if(hd?a.metaKey:a.ctrlKey)c="Ctrl-"+c;if(hd?a.ctrlKey:a.metaKey)c="Cmd-"+c;!b&&a.shiftKey&&(c="Shift-"+c);return c}function Na(a,b){this.pos=this.start=0;this.string=
90
+ a;this.tabSize=b||8}function ha(a,b){this.lines=[];this.type=b;this.doc=a}function Oa(a,b,c,d,e){if(d&&d.shared)return $d(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return s(a.cm,Oa)(a,b,c,d,e);var f=new ha(a,e);if("range"==e&&!x(b,c))return f;d&&xb(d,f);f.replacedWith&&(f.collapsed=!0,f.replacedWith=q("span",[f.replacedWith],"CodeMirror-widget"));f.collapsed&&(Ca=!0);var g=b.line,h=0,j,i,l=a.cm,m;a.iter(g,c.line+1,function(d){l&&(f.collapsed&&!l.options.lineWrapping&&la(a,d)==l.display.maxLine)&&(m=true);var e=
91
+ {from:null,to:null,marker:f};h=h+d.text.length;if(g==b.line){e.from=b.ch;h=h-b.ch}if(g==c.line){e.to=c.ch;h=h-(d.text.length-c.ch)}if(f.collapsed){g==c.line&&(i=ba(d,c.ch));g==b.line?j=ba(d,b.ch):L(d,0)}d.markedSpans=d.markedSpans?d.markedSpans.concat([e]):[e];e.marker.attachLine(d);++g});f.collapsed&&a.iter(b.line,c.line+1,function(b){aa(a,b)&&L(b,0)});f.readOnly&&(Yc=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory());if(f.collapsed){if(j!=i)throw Error("Inserting collapsed marker overlapping an existing one");
92
+ f.size=h;f.atomic=!0}l&&(m&&(l.curOp.updateMaxLine=!0),(f.className||f.startStyle||f.endStyle||f.collapsed)&&w(l,b.line,c.line+1),f.atomic&&cd(l));return f}function Pa(a,b){this.markers=a;this.primary=b;for(var c=0,d=this;c<a.length;++c)a[c].parent=this,v(a[c],"clear",function(){d.clear()})}function $d(a,b,c,d,e){d=xb(d);d.shared=!1;var f=[Oa(a,b,c,d,e)],g=f[0];xa(a,function(a){f.push(Oa(a,p(a,b),p(a,c),d,e));for(var j=0;j<a.linked.length;++j)if(a.linked[j].isParent)return;g=C(f)});return new Pa(f,
93
+ g)}function Qa(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function ec(a,b){var c=fa(a,b.from.line)&&r(a,b.from.line).markedSpans,d=fa(a,b.to.line)&&r(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=t(b.from,b.to);if(c)for(var h=0,j;h<c.length;++h){var i=c[h],l=i.marker;if(null==i.from||(l.inclusiveLeft?i.from<=e:i.from<e)||"bookmark"==l.type&&i.from==e&&(!g||!i.marker.insertLeft)){var m=null==i.to||(l.inclusiveRight?i.to>=e:i.to>e);(j||(j=
94
+ [])).push({from:i.from,to:m?null:i.to,marker:l})}}c=j;if(d)for(var h=0,n;h<d.length;++h)if(j=d[h],i=j.marker,null==j.to||(i.inclusiveRight?j.to>=f:j.to>f)||"bookmark"==i.type&&j.from==f&&(!g||j.marker.insertLeft))l=null==j.from||(i.inclusiveLeft?j.from<=f:j.from<f),(n||(n=[])).push({from:l?null:j.from-f,to:null==j.to?null:j.to-f,marker:i});d=n;g=1==b.text.length;n=C(b.text).length+(g?e:0);if(c)for(f=0;f<c.length;++f)h=c[f],null==h.to&&((j=Qa(d,h.marker))?g&&(h.to=null==j.to?null:j.to+n):h.to=e);if(d)for(f=
95
+ 0;f<d.length;++f)(h=d[f],null!=h.to&&(h.to+=n),null==h.from)?(j=Qa(c,h.marker),j||(h.from=n,g&&(c||(c=[])).push(h))):(h.from+=n,g&&(c||(c=[])).push(h));e=[c];if(!g){var g=b.text.length-2,k;if(0<g&&c)for(f=0;f<c.length;++f)null==c[f].to&&(k||(k=[])).push({from:null,to:null,marker:c[f].marker});for(f=0;f<g;++f)e.push(k);e.push(d)}return e}function ad(a,b){var c;if(c=b["spans_"+a.id]){for(var d=0,e=[];d<b.text.length;++d)e.push(ae(c[d]));c=e}else c=null;d=ec(a,b);if(!c)return d;if(!d)return c;for(e=
96
+ 0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g){var h=0;a:for(;h<g.length;++h){for(var j=g[h],i=0;i<f.length;++i)if(f[i].marker==j.marker)continue a;f.push(j)}}else g&&(c[e]=g)}return c}function Xd(a,b,c){var d=null;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;if(c.readOnly&&(!d||-1==U(d,c)))(d||(d=[])).push(c)}});if(!d)return null;a=[{from:b,to:c}];for(b=0;b<d.length;++b)for(var c=d[b],e=c.find(),f=0;f<a.length;++f){var g=
97
+ a[f];if(!x(g.to,e.from)&&!x(e.to,g.from)){var h=[f,1];(x(g.from,e.from)||!c.inclusiveLeft&&t(g.from,e.from))&&h.push({from:g.from,to:e.from});(x(e.to,g.to)||!c.inclusiveRight&&t(g.to,e.to))&&h.push({from:e.to,to:g.to});a.splice.apply(a,h);f+=h.length-1}}return a}function ba(a,b){var c=Ca&&a.markedSpans,d;if(c)for(var e,f=0;f<c.length;++f)if(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 Ba(a){return ba(a,a.text.length+
98
+ 1)}function la(a,b){for(var c;c=ba(b,-1);)b=r(a,c.find().from.line);return b}function aa(a,b){var c=Ca&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed&&(null==d.from||0==d.from&&d.marker.inclusiveLeft&&ic(a,b,d)))return!0}function ic(a,b,c){if(null==c.to)return b=c.marker.find().to,b=r(a,b.line),ic(a,b,Qa(b.markedSpans,c.marker));if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var d,e=0;e<b.markedSpans.length;++e)if(d=b.markedSpans[e],d.marker.collapsed&&
99
+ d.from==c.to&&(d.marker.inclusiveLeft||c.marker.inclusiveRight)&&ic(a,b,d))return!0}function id(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function jd(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&&qa(this.cm);try{var c=a.apply(this,arguments)}finally{b&&ra(this.cm)}return c}}function hb(a){if(null!=a.height)return a.height;(!a.node.parentNode||1!=a.node.parentNode.nodeType)&&
100
+ R(a.cm.display.measure,q("div",[a.node],null,"position: relative"));return a.height=a.node.offsetHeight}function be(a,b,c,d){var e=new jc(a,c,d);e.noHScroll&&(a.display.alignWidgets=!0);vb(a,b,function(b){(b.widgets||(b.widgets=[])).push(e);e.line=b;if(!aa(a.doc,b)||e.showIfHidden){var c=ma(a,b)<a.display.scroller.scrollTop;L(b,b.height+hb(e));if(c)a.curOp.updateScrollPos={scrollTop:a.doc.scrollTop+e.height,scrollLeft:a.doc.scrollLeft}}return true});return e}function Ra(a,b,c){a={text:a};jd(a,b);
101
+ a.height=c?c(a):1;return a}function ya(a,b,c,d){a.text=b;a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null);null!=a.order&&(a.order=null);id(a);jd(a,c);b=d?d(a):1;b!=a.height&&L(a,b);M(a,"change")}function ld(a,b,c,d,e){var f=a.options.flattenSpans,g="",h=null,a=new Na(b,a.options.tabSize);for(""==b&&c.blankLine&&c.blankLine(d);!a.eol();){var j=c.token(a,d);5E3<a.pos&&(f=!1,a.pos=Math.min(b.length,a.start+5E4),j=null);var i=a.current();a.start=a.pos;!f||h!=j?(g&&e(g,h),g=i,h=j):g+=i}g&&e(g,
102
+ h)}function Cc(a,b,c){var d=[a.state.modeGen];ld(a,b.text,a.doc.mode,c,function(a,b){d.push(a,b)});for(c=0;c<a.state.overlays.length;++c){var e=a.state.overlays[c],f=1;ld(a,b.text,e.mode,!0,function(a,b){for(var c=f,i=a.length;i;){var l=d[f],m=l.length;if(m<=i)i=i-m;else{d.splice(f,1,l.slice(0,i),d[f+1],l.slice(i));i=0}f=f+2}if(b)if(e.opaque){d.splice(c,f-c,a,b);f=c+2}else for(;c<f;c=c+2){l=d[c+1];d[c+1]=l?l+" "+b:b}})}return d}function Dc(a,b,c){var d=a.doc.mode,a=new Na(b.text,a.options.tabSize);
103
+ for(""==b.text&&d.blankLine&&d.blankLine(c);!a.eol()&&5E3>=a.pos;)d.token(a,c),a.start=a.pos}function md(a){return!a?null:nd[a]||(nd[a]="cm-"+a.replace(/ +/g," cm-"))}function Bc(a,b,c){for(var d,e=b,f,g,h=!0;d=ba(e,-1);)h=!1,e=r(a.doc,d.find().from.line),f||(f=e);d={pre:q("pre"),col:0,pos:0,display:!c,measure:null,addedOne:!1,cm:a};e.textClass&&(d.pre.className=e.textClass);do{d.measure=e==b&&c;d.pos=0;d.addToken=d.measure?ce:od;c&&(g&&e!=b&&!d.addedOne)&&(c[0]=d.pre.appendChild(kc(a.display.measure)),
104
+ d.addedOne=!0);var j=e;g=d;var i=e;if(!i.styles||i.styles[0]!=a.state.modeGen)i.styles=Cc(a,i,i.stateAfter=Da(a,F(i)));a:{var l=j,i=i.styles;if(j=l.markedSpans)for(var l=l.text.length,m=0,n=1,k="",o=void 0,p=0,s=void 0,u=void 0,v=void 0,t=void 0;;){if(p==m){for(var s=u=v="",t=null,p=Infinity,w=null,y=0;y<j.length;++y){var x=j[y],z=x.marker;if(x.from<=m&&(null==x.to||x.to>m)){if(null!=x.to&&p>x.to&&(p=x.to,u=""),z.className&&(s+=" "+z.className),z.startStyle&&x.from==m&&(v+=" "+z.startStyle),z.endStyle&&
105
+ x.to==p&&(u+=" "+z.endStyle),z.collapsed&&(!t||t.marker.width<z.width))t=x}else x.from>m&&p>x.from&&(p=x.from);"bookmark"==z.type&&(x.from==m&&z.replacedWith)&&(w=z.replacedWith)}if(t&&(t.from||0)==m)if(pd(g,(null==t.to?l:t.to)-m,null!=t.from&&t.marker.replacedWith),null==t.to){i=t.marker.find();break a}w&&!t&&pd(g,0,w)}if(m>=l)break;for(w=Math.min(l,p);;){if(k){y=m+k.length;t||(x=y>w?k.slice(0,w-m):k,g.addToken(g,x,o?o+s:s,v,m+x.length==p?u:""));if(y>=w){k=k.slice(w-m);m=w;break}m=y;v=""}k=i[n++];
106
+ o=md(i[n++])}}else for(var n=1;n<i.length;n+=2)g.addToken(g,i[n],md(i[n+1]));i=void 0}g=e==f;i&&(e=r(a.doc,i.to.line),h=!1)}while(i);c&&!d.addedOne&&(c[0]=d.pre.appendChild(h?q("span"," "):kc(a.display.measure)));!d.pre.firstChild&&!aa(a.doc,b)&&d.pre.appendChild(document.createTextNode(" "));var B;if(c&&E&&(B=O(e)))if(e=B.length-1,B[e].from==B[e].to&&--e,b=B[e],B=B[e-1],b.from+1==b.to&&(B&&b.level<B.level)&&(c=c[d.pos-1]))c.parentNode.insertBefore(c.measureRight=kc(a.display.measure),c.nextSibling);
107
+ return d.pre}function od(a,b,c,d,e){if(b){if(lc.test(b))for(var f=document.createDocumentFragment(),g=0;;){lc.lastIndex=g;var h=lc.exec(b),j=h?h.index-g:b.length-g;j&&(f.appendChild(document.createTextNode(b.slice(g,g+j))),a.col+=j);if(!h)break;g+=j+1;"\t"==h[0]?(h=a.cm.options.tabSize,h-=a.col%h,f.appendChild(q("span",ed(h),"cm-tab")),a.col+=h):(j=q("span","•","cm-invalidchar"),j.title="\\u"+h[0].charCodeAt(0).toString(16),f.appendChild(j),a.col+=1)}else{a.col+=b.length;var f=document.createTextNode(b)}if(c||
108
+ d||e||a.measure)return b=c||"",d&&(b+=d),e&&(b+=e),a.pre.appendChild(q("span",[f],b));a.pre.appendChild(f)}}function ce(a,b,c,d,e){for(var f=0;f<b.length;++f){var g=b.charAt(f),h=0==f;"\ud800"<=g&&"\udbff">g&&f<b.length-1?(g=b.slice(f,f+2),++f):f&&(a.cm.options.lineWrapping&&yb.test(b.slice(f-1,f+1)))&&a.pre.appendChild(q("wbr"));a.measure[a.pos]=od(a,g,c,h&&d,f==b.length-1&&e);a.pos+=g.length}b.length&&(a.addedOne=!0)}function pd(a,b,c){c&&(a.display||(c=c.cloneNode(!0)),a.pre.appendChild(c),a.measure&&
109
+ b&&(a.measure[a.pos]=c,a.addedOne=!0));a.pos+=b}function gc(a,b,c,d,e){function f(a){return c?c[a]:null}var g=b.from,h=b.to,j=b.text,i=r(a,g.line),l=r(a,h.line),m=C(j),n=f(j.length-1),k=h.line-g.line;if(0==g.ch&&0==h.ch&&""==m){for(var o=0,p=j.length-1,q=[];o<p;++o)q.push(Ra(j[o],f(o),e));ya(l,l.text,n,e);k&&a.remove(g.line,k);q.length&&a.insert(g.line,q)}else if(i==l)if(1==j.length)ya(i,i.text.slice(0,g.ch)+m+i.text.slice(h.ch),n,e);else{q=[];o=1;for(p=j.length-1;o<p;++o)q.push(Ra(j[o],f(o),e));
110
+ q.push(Ra(m+i.text.slice(h.ch),n,e));ya(i,i.text.slice(0,g.ch)+j[0],f(0),e);a.insert(g.line+1,q)}else if(1==j.length)ya(i,i.text.slice(0,g.ch)+j[0]+l.text.slice(h.ch),f(0),e),a.remove(g.line+1,k);else{ya(i,i.text.slice(0,g.ch)+j[0],f(0),e);ya(l,m+l.text.slice(h.ch),n,e);o=1;p=j.length-1;for(q=[];o<p;++o)q.push(Ra(j[o],f(o),e));1<k&&a.remove(g.line+1,k-1);a.insert(g.line+1,q)}M(a,"change",a,b);Y(a,d.anchor,d.head,null,!0)}function zb(a){this.lines=a;this.parent=null;for(var b=0,c=a.length,d=0;b<c;++b)a[b].parent=
111
+ this,d+=a[b].height;this.height=d}function Sa(a){this.children=a;for(var b=0,c=0,d=0,e=a.length;d<e;++d){var f=a[d],b=b+f.chunkSize(),c=c+f.height;f.parent=this}this.size=b;this.height=c;this.parent=null}function xa(a,b,c){function d(a,f,g){if(a.linked)for(var h=0;h<a.linked.length;++h){var j=a.linked[h];if(j.doc!=f){var i=g&&j.sharedHist;if(!c||i)b(j.doc,i),d(j.doc,a,i)}}}d(a,null,!0)}function sc(a,b){if(b.cm)throw Error("This document is already in use.");a.doc=b;b.cm=a;vc(a);Xa(a);a.options.lineWrapping||
112
+ Mb(a);a.options.mode=b.modeOption;w(a)}function r(a,b){for(b-=a.first;!a.lines;)for(var c=0;;++c){var d=a.children[c],e=d.chunkSize();if(b<e){a=d;break}b-=e}return a.lines[b]}function qd(a,b,c){var d=[],e=b.line;a.iter(b.line,c.line+1,function(a){a=a.text;e==c.line&&(a=a.slice(0,c.ch));e==b.line&&(a=a.slice(b.ch));d.push(a);++e});return d}function mc(a,b,c){var d=[];a.iter(b,c,function(a){d.push(a.text)});return d}function L(a,b){for(var c=b-a.height,d=a;d;d=d.parent)d.height+=c}function F(a){if(null==
113
+ a.parent)return null;for(var b=a.parent,a=U(b.lines,a),c=b.parent;c;b=c,c=c.parent)for(var d=0;c.children[d]!=b;++d)a+=c.children[d].chunkSize();return a+b.first}function cb(a,b){var c=a.first;a:do{for(var d=0,e=a.children.length;d<e;++d){var f=a.children[d],g=f.height;if(b<g){a=f;continue a}b-=g;c+=f.chunkSize()}return c}while(!a.lines);d=0;for(e=a.lines.length;d<e;++d){f=a.lines[d].height;if(b<f)break;b-=f}return c+d}function ma(a,b){for(var b=la(a.doc,b),c=0,d=b.parent,e=0;e<d.lines.length;++e){var f=
114
+ d.lines[e];if(f==b)break;else c+=f.height}for(f=d.parent;f;d=f,f=d.parent)for(e=0;e<f.children.length;++e){var g=f.children[e];if(g==d)break;else c+=g.height}return c}function O(a){var b=a.order;null==b&&(b=a.order=de(a.text));return b}function Ab(){return{done:[],undone:[],undoDepth:Infinity,lastTime:0,lastOp:null,lastOrigin:null,dirtyCounter:0}}function rd(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]=
115
+ {}))[f]=c.markedSpans);++f})}function fc(a,b){var c={from:b.from,to:bc(b),text:qd(a,b.from,b.to)};rd(a,c,b.from.line,b.to.line+1);xa(a,function(a){rd(a,c,b.from.line,b.to.line+1)},!0);return c}function Yd(a,b,c,d){var e=a.history;e.undone.length=0;var f=+new Date,g=C(e.done);if(g&&(e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&e.lastTime>f-600||"*"==b.origin.charAt(0)))){var h=C(g.changes);t(b.from,b.to)&&t(b.from,h.to)?h.to=bc(b):g.changes.push(fc(a,b));g.anchorAfter=c.anchor;
116
+ g.headAfter=c.head}else{g={changes:[fc(a,b)],anchorBefore:a.sel.anchor,headBefore:a.sel.head,anchorAfter:c.anchor,headAfter:c.head};for(e.done.push(g);e.done.length>e.undoDepth;)e.done.shift();0>e.dirtyCounter?e.dirtyCounter=NaN:e.dirtyCounter++}e.lastTime=f;e.lastOp=d;e.lastOrigin=b.origin}function ae(a){if(!a)return null;for(var b=0,c;b<a.length;++b)a[b].marker.explicitlyCleared?c||(c=a.slice(0,b)):c&&c.push(a[b]);return!c?a:c.length?c:null}function Bb(a,b){for(var c=0,d=[];c<a.length;++c){var e=
117
+ a[c],f=e.changes,g=[];d.push({changes:g,anchorBefore:e.anchorBefore,headBefore:e.headBefore,anchorAfter:e.anchorAfter,headAfter:e.headAfter});for(e=0;e<f.length;++e){var h=f[e],j;g.push({from:h.from,to:h.to,text:h.text});if(b)for(var i in h)if((j=i.match(/^spans_(\d+)$/))&&-1<U(b,Number(j[1])))C(g)[i]=h[i],delete h[i]}}return d}function Cb(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function sd(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 j=
118
+ f.changes[h];f.copied||(j.from=ea(j.from),j.to=ea(j.to));if(c<j.from.line)j.from.line+=d,j.to.line+=d;else if(b<=j.to.line){g=!1;break}}f.copied||(f.anchorBefore=ea(f.anchorBefore),f.headBefore=ea(f.headBefore),f.anchorAfter=ea(f.anchorAfter),f.readAfter=ea(f.headAfter),f.copied=!0);g?(Cb(f.anchorBefore),Cb(f.headBefore),Cb(f.anchorAfter),Cb(f.headAfter)):(a.splice(0,e+1),e=0)}}function Zc(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;sd(a.done,c,d,e);sd(a.undone,c,d,e)}function ee(){nb(this)}
119
+ function Ia(a){a.stop||(a.stop=ee);return a}function y(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function td(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function nb(a){y(a);td(a)}function Qc(a){var b=a.which;null==b&&(a.button&1?b=1:a.button&2?b=3:a.button&4&&(b=2));na&&(a.ctrlKey&&1==b)&&(b=3);return b}function v(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):(a=a._handlers||(a._handlers={}),(a[b]||(a[b]=[])).push(c))}function S(a,
120
+ b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else if(a=a._handlers&&a._handlers[b])for(b=0;b<a.length;++b)if(a[b]==c){a.splice(b,1);break}}function H(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 M(a,b){function c(a){return function(){a.apply(null,e)}}var d=a._handlers&&a._handlers[b];if(d){var e=Array.prototype.slice.call(arguments,2);W||(++lb,
121
+ W=[],setTimeout(fe,0));for(var f=0;f<d.length;++f)W.push(c(d[f]))}}function fe(){--lb;var a=W;W=null;for(var b=0;b<a.length;++b)a[b]()}function va(a,b){var c=a._handlers&&a._handlers[b];return c&&0<c.length}function Ib(){this.id=null}function pa(a,b,c){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));for(var d=0,e=0;d<b;++d)"\t"==a.charAt(d)?e+=c-e%c:++e;return e}function ed(a){for(;Db.length<=a;)Db.push(C(Db)+" ");return Db[a]}function C(a){return a[a.length-1]}function Lc(a){Wa?(a.selectionStart=
122
+ 0,a.selectionEnd=a.value.length):a.select()}function U(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;++c)if(a[c]==b)return c;return-1}function xb(a,b){b||(b={});for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function Gc(a){for(var b=[],c=0;c<a;++c)b.push(void 0);return b}function J(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function wb(a){return/\w/.test(a)||"€"<a&&(a.toUpperCase()!=a.toLowerCase()||ge.test(a))}function ud(a){for(var b in a)if(a.hasOwnProperty(b)&&
123
+ a[b])return!1;return!0}function q(a,b,c,d){a=document.createElement(a);c&&(a.className=c);d&&(a.style.cssText=d);if("string"==typeof b)Ac(a,b);else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a}function $a(a){if(E)for(;a.firstChild;)a.removeChild(a.firstChild);else a.innerHTML="";return a}function R(a,b){return $a(a).appendChild(b)}function Ac(a,b){ca?(a.innerHTML="",a.appendChild(document.createTextNode(b))):a.textContent=b}function z(a){return a.getBoundingClientRect()}function bb(a){if(null!=
124
+ Eb)return Eb;var b=q("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");R(a,b);b.offsetWidth&&(Eb=b.offsetHeight-b.clientHeight);return Eb||0}function kc(a){if(null==nc){var b=q("span","");R(a,q("span",[b,document.createTextNode("x")]));0!=a.firstChild.offsetHeight&&(nc=1>=b.offsetWidth&&2<b.offsetHeight&&!ja)}return nc?q("span","​"):q("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function Id(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=0;e<a.length;++e){var f=
125
+ a[e];if(f.from<c&&f.to>b||b==c&&f.to==b)d(Math.max(f.from,b),Math.min(f.to,c),1==f.level?"rtl":"ltr")}}function oc(a){return a.level%2?a.from:a.to}function jb(a){return(a=O(a))?a[0].level%2?a[0].to:a[0].from:0}function kb(a){var b=O(a);return!b?a.text.length:oc(C(b))}function vd(a,b){var c=r(a.doc,b),d=la(a.doc,c);d!=c&&(b=F(d));c=O(d);d=!c?0:c[0].level%2?kb(d):jb(d);return o(b,d)}function he(a,b){for(var c,d;c=Ba(d=r(a.doc,b));)b=c.find().to.line;c=O(d);d=!c?d.text.length:c[0].level%2?jb(d):kb(d);
126
+ return o(b,d)}function Sb(a,b,c,d){var e=O(a);if(!e)return fd(a,b,c,d);for(var d=d?function(b,c){do b+=c;while(0<b&&Tb.test(a.text.charAt(b)));return b}:function(a,b){return a+b},f=e[0].level,g=0;g<e.length;++g){var h=e[g],j=h.level%2==f;if(h.from<b&&h.to>b||j&&(h.from==b||h.to==b))break}for(b=d(b,h.level%2?-c:c);null!=b;)if(h.level%2==f)if(b<h.from||b>h.to)b=(h=e[g+=c])&&(0<c==h.level%2?d(h.to,-1):d(h.from,1));else break;else if(b==(h.level%2?h.to:h.from))b=(h=e[--g])&&oc(h);else if(b==oc(h))b=(h=
127
+ e[++g])&&(h.level%2?h.to:h.from);else break;return 0>b||b>a.text.length?null:b}function fd(a,b,c,d){b+=c;if(d)for(;0<b&&Tb.test(a.text.charAt(b));)b+=c;return 0>b||b>a.text.length?null:b}var wa=/gecko\/\d/i.test(navigator.userAgent),E=/MSIE \d/.test(navigator.userAgent),ja=E&&(null==document.documentMode||8>document.documentMode),ca=E&&(null==document.documentMode||9>document.documentMode),P=/WebKit\//.test(navigator.userAgent),ie=P&&/Qt\/\d+\.\d+/.test(navigator.userAgent),wd=/Chrome\//.test(navigator.userAgent),
128
+ T=/Opera\//.test(navigator.userAgent),Xb=/Apple Computer/.test(navigator.vendor),Lb=/KHTML\//.test(navigator.userAgent),Bd=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),Cd=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),Nd=/PhantomJS/.test(navigator.userAgent),Wa=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),Hb=Wa||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),na=Wa||/Mac/.test(navigator.platform),je=/windows/i.test(navigator.platform),
129
+ Ta=T&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);Ta&&(Ta=Number(Ta[1]));var hd=na&&(ie||T&&(null==Ta||12.11>Ta)),Wb=wa||E&&!ca,Yc=!1,Ca=!1,da,Md=0,pb,ob,qb=0,K=null;E?K=-0.53:wa?K=15:wd?K=-0.7:Xb&&(K=-1/3);var Uc,$b=null,ac;k.Pos=o;k.prototype={focus:function(){window.focus();D(this);$(this);Fa(this)},setOption:function(a,b){var c=this.options,d=c[a];c[a]==b&&"mode"!=a||(c[a]=b,ia.hasOwnProperty(a)&&s(this,ia[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},
130
+ addKeyMap:function(a){this.state.keyMaps.push(a)},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(("string"==typeof a?b[c].name:b[c])==a)return b.splice(c,1),!0},addOverlay:s(null,function(a,b){var c=a.token?a:k.getMode(this.options,a);if(c.startState)throw Error("Overlays may not be stateful.");this.state.overlays.push({mode:c,modeSpec:a,opaque:b&&b.opaque});this.state.modeGen++;w(this)}),removeOverlay:s(null,function(a){for(var b=this.state.overlays,c=0;c<b.length;++c)if(b[c].modeSpec==
131
+ a){b.splice(c,1);this.state.modeGen++;w(this);break}}),indentLine:s(null,function(a,b,c){"string"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract");fa(this.doc,a)&&sb(this,a,b,c)}),indentSelection:s(null,function(a){var b=this.doc.sel;if(t(b.from,b.to))return sb(this,b.from.line,a);for(var c=b.to.line-(b.to.ch?0:1),b=b.from.line;b<=c;++b)sb(this,b,a)}),getTokenAt:function(a){for(var b=this.doc,a=p(b,a),c=Da(this,a.line),d=this.doc.mode,b=r(b,a.line),b=new Na(b.text,
132
+ this.options.tabSize);b.pos<a.ch&&!b.eol();){b.start=b.pos;var e=d.token(b,c)}return{start:b.start,end:b.pos,string:b.current(),className:e||null,type:e||null,state:c}},getStateAfter:function(a){var b=this.doc,a=Math.max(b.first,Math.min(null==a?b.first+b.size-1:a,b.first+b.size-1));return Da(this,a+1)},cursorCoords:function(a,b){var c;c=this.doc.sel;c=null==a?c.head:"object"==typeof a?p(this.doc,a):a?c.from:c.to;return Q(this,c,b||"page")},charCoords:function(a,b){return eb(this,p(this.doc,a),b||
133
+ "page")},coordsChar:function(a){var b=z(this.display.lineSpace);return Rb(this,a.left-b.left-(window.pageXOffset||(document.documentElement||document.body).scrollLeft),a.top-b.top-(window.pageYOffset||(document.documentElement||document.body).scrollTop))},defaultTextHeight:function(){return Za(this.display)},setGutterMarker:s(null,function(a,b,c){return vb(this,a,function(a){var e=a.gutterMarkers||(a.gutterMarkers={});e[b]=c;!c&&ud(e)&&(a.gutterMarkers=null);return!0})}),clearGutter:s(null,function(a){var b=
134
+ this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,w(b,d,d+1),ud(c.gutterMarkers)&&(c.gutterMarkers=null));++d})}),addLineClass:s(null,function(a,b,c){return vb(this,a,function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[e]){if(RegExp("\\b"+c+"\\b").test(a[e]))return!1;a[e]+=" "+c}else a[e]=c;return!0})}),removeLineClass:s(null,function(a,b,c){return vb(this,a,function(a){var e="text"==b?"textClass":"background"==b?
135
+ "bgClass":"wrapClass",f=a[e];if(f)if(null==c)a[e]=null;else{var g=f.replace(RegExp("^"+c+"\\b\\s*|\\s*\\b"+c+"\\b"),"");if(g==f)return!1;a[e]=g||null}else return!1;return!0})}),addLineWidget:s(null,function(a,b,c){return be(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!fa(this.doc,a))return null;var b=a,a=r(this.doc,a);if(!a)return null}else if(b=F(a),null==b)return null;return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,
136
+ 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=Q(this,p(this.doc,a)),g=a.bottom,h=a.left;b.style.position="absolute";f.sizer.appendChild(b);if("over"==d)g=a.top;else if("above"==d||"near"==d){var j=Math.max(f.wrapper.clientHeight,this.doc.height),i=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>j)&&a.top>
137
+ b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=j&&(g=a.bottom);h+b.offsetWidth>i&&(h=i-b.offsetWidth)}b.style.top=g+f.lineSpace.offsetTop+"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&&dd(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:s(null,Oc),execCommand:function(a){return Yb[a](this)},findPosH:function(a,b,c,d){var e=
138
+ 1;0>b&&(e=-1,b=-b);for(var f=0,a=p(this.doc,a);f<b&&!(a=hc(this.doc,a,e,c,d),a.hitSide);++f);return a},moveH:s(null,function(a,b){var c=this.doc.sel,c=c.shift||c.extend||t(c.from,c.to)?hc(this.doc,c.head,a,b,this.options.rtlMoveVisually):0>a?c.from:c.to;B(this.doc,c,c,a)}),deleteH:s(null,function(a,b){var c=this.doc.sel;t(c.from,c.to)?X(this.doc,"",c.from,hc(this.doc,c.head,a,b,!1),"+delete"):X(this.doc,"",c.from,c.to,"+delete");this.curOp.userSelChange=!0}),findPosV:function(a,b,c,d){var e=1;0>b&&
139
+ (e=-1,b=-b);for(var f=0,a=p(this.doc,a);f<b&&!(a=Q(this,a,"div"),null==d?d=a.left:a.left=d,a=gd(this,a,e,c),a.hitSide);++f);return a},moveV:s(null,function(a,b){var c=this.doc.sel,d=Q(this,c.head,"div");null!=c.goalColumn&&(d.left=c.goalColumn);var e=gd(this,d,a,b);"page"==b&&(this.display.scrollbarV.scrollTop+=eb(this,e,"div").top-d.top);B(this.doc,e,e,a);c.goalColumn=d.left}),toggleOverwrite:function(){this.display.cursor.className=(this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+
140
+ " CodeMirror-overwrite":this.display.cursor.className.replace(" CodeMirror-overwrite","")},scrollTo:s(null,function(a,b){this.curOp.updateScrollPos={scrollLeft:a,scrollTop:b}}),getScrollInfo:function(){var a=this.display.scroller,b=za;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-b,width:a.scrollWidth-b,clientHeight:a.clientHeight-b,clientWidth:a.clientWidth-b}},scrollIntoView:function(a){"number"==typeof a&&(a=o(a,0));!a||null!=a.line?(a=a?p(this.doc,a):this.doc.sel.head,Ic(this,
141
+ a)):dd(this,a.left,a.top,a.right,a.bottom)},setSize:function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(""+a)?a+"px":a}null!=a&&(this.display.wrapper.style.width=c(a));null!=b&&(this.display.wrapper.style.height=c(b));this.refresh()},on:function(a,b){v(this,a,b)},off:function(a,b){S(this,a,b)},operation:function(a){return Jc(this,a)},refresh:s(null,function(){ka(this);this.curOp.updateScrollPos={scrollTop:this.doc.scrollTop,scrollLeft:this.doc.scrollLeft};w(this)}),swapDoc:s(null,function(a){var b=
142
+ this.doc;b.cm=null;sc(this,a);ka(this);this.curOp.updateScrollPos={scrollTop:a.scrollTop,scrollLeft:a.scrollLeft};return 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}};var ia=k.optionHandlers={},Fb=k.defaults={},tc=k.Init={toString:function(){return"CodeMirror.Init"}};u("value","",function(a,b){a.setValue(b)},!0);u("mode",
143
+ null,function(a,b){a.doc.modeOption=b;Xa(a)},!0);u("indentUnit",2,Xa,!0);u("indentWithTabs",!1);u("smartIndent",!0);u("tabSize",4,function(a){Xa(a);ka(a);w(a)},!0);u("electricChars",!0);u("rtlMoveVisually",!je);u("theme","default",function(a){rc(a);Aa(a)},!0);u("keyMap","default",function(a){var b=V[a.options.keyMap].style;a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(b?" cm-keymap-"+b:"")});u("extraKeys",null);u("onKeyEvent",null);u("onDragEvent",null);
144
+ u("lineWrapping",!1,function(a){if(a.options.lineWrapping){a.display.wrapper.className=a.display.wrapper.className+" CodeMirror-wrap";a.display.sizer.style.minWidth=""}else{a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-wrap","");Mb(a)}vc(a);w(a);ka(a);setTimeout(function(){wc(a.display,a.doc.height)},100)},!0);u("gutters",[],function(a){Gb(a.options);Aa(a)},!0);u("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?Ob(a.display)+"px":"0";a.refresh()},!0);u("lineNumbers",
145
+ !1,function(a){Gb(a.options);Aa(a)},!0);u("firstLineNumber",1,Aa,!0);u("lineNumberFormatter",function(a){return a},Aa,!0);u("showCursorWhenSelecting",!1,Pb,!0);u("readOnly",!1,function(a,b){if(b=="nocursor"){Jb(a);a.display.input.blur()}else b||Z(a,true)});u("dragDrop",!0);u("cursorBlinkRate",530);u("cursorHeight",1);u("workTime",100);u("workDelay",100);u("flattenSpans",!0);u("pollInterval",100);u("undoDepth",40,function(a,b){a.doc.history.undoDepth=b});u("viewportMargin",10,function(a){a.refresh()},
146
+ !0);u("tabindex",null,function(a,b){a.display.input.tabIndex=b||""});u("autofocus",null);var xd=k.modes={},pc=k.mimeModes={};k.defineMode=function(a,b){!k.defaults.mode&&"null"!=a&&(k.defaults.mode=a);if(2<arguments.length){b.dependencies=[];for(var c=2;c<arguments.length;++c)b.dependencies.push(arguments[c])}xd[a]=b};k.defineMIME=function(a,b){pc[a]=b};k.resolveMode=function(a){if("string"==typeof a&&pc.hasOwnProperty(a))a=pc[a];else if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return k.resolveMode("application/xml");
147
+ return"string"==typeof a?{name:a}:a||{name:"null"}};k.getMode=function(a,b){var b=k.resolveMode(b),c=xd[b.name];if(!c)return k.getMode(a,"text/plain");c=c(a,b);if(Ua.hasOwnProperty(b.name)){var d=Ua[b.name],e;for(e in d)d.hasOwnProperty(e)&&(c.hasOwnProperty(e)&&(c["_"+e]=c[e]),c[e]=d[e])}c.name=b.name;return c};k.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}});k.defineMIME("text/plain","null");var Ua=k.modeExtensions={};k.extendMode=function(a,b){var c=Ua.hasOwnProperty(a)?
148
+ Ua[a]:Ua[a]={};xb(b,c)};k.defineExtension=function(a,b){k.prototype[a]=b};k.defineOption=u;var Kb=[];k.defineInitHook=function(a){Kb.push(a)};k.copyState=oa;k.startState=Ec;k.innerMode=function(a,b){for(;a.innerMode;)var c=a.innerMode(b),b=c.state,a=c.mode;return c||{mode:a,state:b}};var Yb=k.commands={selectAll:function(a){a.setSelection(o(a.firstLine(),0),o(a.lastLine()))},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),d=!t(b,c);!d&&a.getLine(b.line).length==b.ch?a.replaceRange("",
149
+ b,o(b.line+1,0),"+delete"):a.replaceRange("",b,d?c:o(b.line),"+delete")},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",o(b,0),o(b),"+delete")},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.extendSelection(o(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(o(a.lastLine()))},goLineStart:function(a){a.extendSelection(vd(a,a.getCursor().line))},goLineStartSmart:function(a){var b=a.getCursor(),c=vd(a,b.line),d=a.getLineHandle(c.line),e=O(d);
150
+ !e||0==e[0].level?(d=Math.max(0,d.text.search(/\S/)),a.extendSelection(o(c.line,b.line==c.line&&b.ch<=d&&b.ch?0:d))):a.extendSelection(c)},goLineEnd:function(a){a.extendSelection(he(a,a.getCursor().line))},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")},
151
+ goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},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")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("\t",
152
+ "end","+input")},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.replaceSelection("\t","end","+input")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line);0<b.ch&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),o(b.line,b.ch-1),o(b.line,b.ch+1))},newlineAndIndent:function(a){s(a,function(){a.replaceSelection("\n","end","+input");a.indentLine(a.getCursor().line,null,!0)})()},toggleOverwrite:function(a){a.toggleOverwrite()}},V=k.keyMap={};V.basic=
153
+ {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"};V.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":"goWordLeft",
154
+ "Ctrl-Right":"goWordRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordBefore","Ctrl-Delete":"delWordAfter","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"};V.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",
155
+ "Alt-Left":"goWordLeft","Alt-Right":"goWordRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordBefore","Ctrl-Alt-Backspace":"delWordAfter","Alt-Delete":"delWordAfter","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",fallthrough:["basic","emacsy"]};V["default"]=na?V.macDefault:V.pcDefault;V.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp",
156
+ "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"};k.lookupKey=La;k.isModifierKey=Vc;k.keyName=Wc;k.fromTextArea=function(a,b){function c(){a.value=i.getValue()}b||(b={});b.value=a.value;!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex);if(null==
157
+ b.autofocus){var d=document.body;try{d=document.activeElement}catch(e){}b.autofocus=d==a||null!=a.getAttribute("autofocus")&&d==document.body}if(a.form){v(a.form,"submit",c);var f=a.form,g=f.submit;try{var h=f.submit=function(){c();f.submit=g;f.submit();f.submit=h}}catch(j){}}a.style.display="none";var i=k(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);i.save=c;i.getTextArea=function(){return a};i.toTextArea=function(){c();a.parentNode.removeChild(i.getWrapperElement());a.style.display=
158
+ "";if(a.form){S(a.form,"submit",c);if(typeof a.form.submit=="function")a.form.submit=g}};return i};Na.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(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a?b==a:b&&(a.test?a.test(b):a(b)))return++this.pos,b},eatWhile:function(a){for(var b=
159
+ 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){a=this.string.indexOf(a,this.pos);if(-1<a)return this.pos=a,!0},backUp:function(a){this.pos-=a},column:function(){return pa(this.string,this.start,this.tabSize)},indentation:function(){return pa(this.string,null,this.tabSize)},match:function(a,b,c){if("string"==typeof a){if((c?
160
+ this.string.toLowerCase():this.string).indexOf(c?a.toLowerCase():a,this.pos)==this.pos)return!1!==b&&(this.pos+=a.length),!0}else{if((a=this.string.slice(this.pos).match(a))&&0<a.index)return null;a&&!1!==b&&(this.pos+=a[0].length);return a}},current:function(){return this.string.slice(this.start,this.pos)}};k.StringStream=Na;k.TextMarker=ha;ha.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;b&&qa(a);for(var c=null,d=null,e=0;e<this.lines.length;++e){var f=this.lines[e],
161
+ g=Qa(f.markedSpans,this);null!=g.to&&(d=F(f));for(var h=f,j=f.markedSpans,i=g,l=void 0,m=0;m<j.length;++m)j[m]!=i&&(l||(l=[])).push(j[m]);h.markedSpans=l;null!=g.from?c=F(f):this.collapsed&&(!aa(this.doc,f)&&a)&&L(f,Za(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(e=0;e<this.lines.length;++e)f=la(a.doc,this.lines[e]),g=ab(a.doc,f),g>a.display.maxLineLength&&(a.display.maxLine=f,a.display.maxLineLength=g,a.display.maxLineChanged=!0);null!=c&&a&&w(a,c,d+1);this.lines.length=0;this.explicitlyCleared=
162
+ !0;this.collapsed&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&cd(a));b&&ra(a);M(this,"clear")}};ha.prototype.find=function(){for(var a,b,c=0;c<this.lines.length;++c){var d=this.lines[c],e=Qa(d.markedSpans,this);if(null!=e.from||null!=e.to)d=F(d),null!=e.from&&(a=o(d,e.from)),null!=e.to&&(b=o(d,e.to))}return"bookmark"==this.type?a:a&&{from:a,to:b}};ha.prototype.getOptions=function(a){var b=this.replacedWith;return{className:this.className,inclusiveLeft:this.inclusiveLeft,inclusiveRight:this.inclusiveRight,
163
+ atomic:this.atomic,collapsed:this.collapsed,clearOnEnter:this.clearOnEnter,replacedWith:a?b&&b.cloneNode(!0):b,readOnly:this.readOnly,startStyle:this.startStyle,endStyle:this.endStyle}};ha.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;if(!b.maybeHiddenMarkers||-1==U(b.maybeHiddenMarkers,this))(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)};ha.prototype.detachLine=function(a){this.lines.splice(U(this.lines,a),1);!this.lines.length&&
164
+ this.doc.cm&&(a=this.doc.cm.curOp,(a.maybeHiddenMarkers||(a.maybeHiddenMarkers=[])).push(this))};k.SharedTextMarker=Pa;Pa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();M(this,"clear")}};Pa.prototype.find=function(){return this.primary.find()};Pa.prototype.getOptions=function(a){a=this.primary.getOptions(a);a.shared=!0;return a};var jc=k.LineWidget=function(a,b,c){for(var d in c)c.hasOwnProperty(d)&&(this[d]=
165
+ c[d]);this.cm=a;this.node=b};jc.prototype.clear=kd(function(){var a=this.line.widgets,b=F(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);L(this.line,Math.max(0,this.line.height-hb(this)));w(this.cm,b,b+1)}});jc.prototype.changed=kd(function(){var a=this.height;this.height=null;if(a=hb(this)-a)L(this.line,this.line.height+a),a=F(this.line),w(this.cm,a,a+1)});var nd={},lc=/[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g;zb.prototype={chunkSize:function(){return this.lines.length},
166
+ removeInner:function(a,b){for(var c=a,d=a+b;c<d;++c){var e=this.lines[c];this.height-=e.height;var f=e;f.parent=null;id(f);M(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));a=0;for(c=b.length;a<c;++a)b[a].parent=this},iterN:function(a,b,c){for(b=a+b;a<b;++a)if(c(this.lines[a]))return!0}};Sa.prototype={chunkSize:function(){return this.size},
167
+ 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(a<e){var f=Math.min(b,e-a),g=d.height;d.removeInner(a,f);this.height-=g-d.height;e==f&&(this.children.splice(c--,1),d.parent=null);if(0==(b-=f))break;a=0}else a-=e}25>this.size-b&&(c=[],this.collapse(c),this.children=[new zb(c)],this.children[0].parent=this)},collapse:function(a){for(var b=0,c=this.children.length;b<c;++b)this.children[b].collapse(a)},insertInner:function(a,b,c){this.size+=
168
+ b.length;this.height+=c;for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<=g){f.insertInner(a,b,c);if(f.lines&&50<f.lines.length){for(;50<f.lines.length;)a=f.lines.splice(f.lines.length-25,25),a=new zb(a),f.height-=a.height,this.children.splice(d+1,0,a),a.parent=this;this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),b=new Sa(b);if(a.parent){a.size-=b.size;a.height-=
169
+ b.height;var c=U(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new Sa(a.children),c.parent=a,a.children=[c,b],a=c;b.parent=a.parent}while(10<a.children.length);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<g){g=Math.min(b,g-a);if(f.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=g}}};var ke=0,I=k.Doc=function(a,b,c){if(!(this instanceof I))return new I(a,b,c);null==c&&(c=0);Sa.call(this,[new zb([Ra("",
170
+ null)])]);this.first=c;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.history=Ab();this.frontier=c;c=o(c,0);this.sel={from:c,to:c,head:c,anchor:c,shift:!1,extend:!1,goalColumn:null};this.id=++ke;this.modeOption=b;"string"==typeof a&&(a=ta(a));gc(this,{from:c,to:c,text:a},null,{head:c,anchor:c})};I.prototype=function(a,b){function c(){}c.prototype=a;var d=new c;b&&xb(b,d);return d}(Sa.prototype,{iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,
171
+ a)},insert:function(a,b){for(var c=0,d=0,e=b.length;d<e;++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=mc(this,this.first,this.first+this.size);return!1===a?b:b.join(a||"\n")},setValue:function(a){var b=o(this.first,0),c=this.first+this.size-1;Ha(this,{from:b,to:o(c,r(this,c).text.length),text:ta(a),origin:"setValue"},{head:b,anchor:b},!0)},replaceRange:function(a,b,c,d){b=p(this,b);c=c?p(this,c):b;X(this,a,
172
+ b,c,d)},getRange:function(a,b,c){a=qd(this,p(this,a),p(this,b));return!1===c?a:a.join(c||"\n")},getLine:function(a){return(a=this.getLineHandle(a))&&a.text},setLine:function(a,b){fa(this,a)&&X(this,b,o(a,0),p(this,o(a)))},removeLine:function(a){fa(this,a)&&X(this,"",o(a,0),p(this,o(a+1,0)))},getLineHandle:function(a){if(fa(this,a))return r(this,a)},getLineNumber:function(a){return F(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+
173
+ this.size-1},clipPos:function(a){return p(this,a)},getCursor:function(a){var b=this.sel;return ea(null==a||"head"==a?b.head:"anchor"==a?b.anchor:"end"==a||!1===a?b.to:b.from)},somethingSelected:function(){return!t(this.sel.head,this.sel.anchor)},setCursor:Ea(function(a,b,c){a=p(this,"number"==typeof a?o(a,b||0):a);c?B(this,a):Y(this,a,a)}),setSelection:Ea(function(a,b){Y(this,p(this,a),p(this,b||a))}),extendSelection:Ea(function(a,b){B(this,p(this,a),b&&p(this,b))}),getSelection:function(a){return this.getRange(this.sel.from,
174
+ this.sel.to,a)},replaceSelection:function(a,b,c){Ha(this,{from:this.sel.from,to:this.sel.to,text:ta(a),origin:c},b||"around")},undo:Ea(function(){$c(this,"undo")}),redo:Ea(function(){$c(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=Ab()},markClean:function(){this.history.dirtyCounter=0;this.history.lastOp=this.history.lastOrigin=null},isClean:function(){return 0==
175
+ this.history.dirtyCounter},getHistory:function(){return{done:Bb(this.history.done),undone:Bb(this.history.undone)}},setHistory:function(a){var b=this.history=Ab();b.done=a.done.slice(0);b.undone=a.undone.slice(0)},markText:function(a,b,c){return Oa(this,p(this,a),p(this,b),c,"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft},a=p(this,a);return Oa(this,a,a,c,"bookmark")},findMarksAt:function(a){var a=p(this,a),b=[],c=r(this,a.line).markedSpans;
176
+ if(c)for(var d=0;d<c.length;++d){var e=c[d];if((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=[];this.iter(function(b){if(b=b.markedSpans)for(var c=0;c<b.length;++c)null!=b[c].from&&a.push(b[c].marker)});return a},posFromIndex:function(a){var b,c=this.first;this.iter(function(d){d=d.text.length+1;if(d>a)return b=a,!0;a-=d;++c});return p(this,o(c,b))},indexFromPos:function(a){var a=p(this,a),b=a.ch;if(a.line<this.first||
177
+ 0>a.ch)return 0;this.iter(this.first,a.line,function(a){b+=a.text.length+1});return b},copy:function(a){var b=new I(mc(this,this.first,this.first+this.size),this.modeOption,this.first);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()));return b},linkedDoc:function(a){a||
178
+ (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);b=new I(mc(this,b,c),a.mode||this.modeOption,b);a.sharedHist&&(b.history=this.history);(this.linked||(this.linked=[])).push({doc:b,sharedHist:a.sharedHist});b.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}];return b},unlinkDoc:function(a){a instanceof k&&(a=a.doc);if(this.linked)for(var b=0;b<this.linked.length;++b)if(this.linked[b].doc==a){this.linked.splice(b,1);a.unlinkDoc(this);
179
+ break}if(a.history==this.history){var c=[a.id];xa(a,function(a){c.push(a.id)},!0);a.history=Ab();a.history.done=Bb(this.history.done,c);a.history.undone=Bb(this.history.undone,c)}},iterLinkedDocs:function(a){xa(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});I.prototype.eachLine=I.prototype.iter;var le=["iter","insert","remove","copy","getEditor"],Va;for(Va in I.prototype)I.prototype.hasOwnProperty(Va)&&0>U(le,Va)&&(k.prototype[Va]=function(a){return function(){return a.apply(this.doc,
180
+ arguments)}}(I.prototype[Va]));k.e_stop=nb;k.e_preventDefault=y;k.e_stopPropagation=td;var W,lb=0;k.on=v;k.off=S;k.signal=H;var za=30,Rc=k.Pass={toString:function(){return"CodeMirror.Pass"}};Ib.prototype={set:function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)}};k.countColumn=pa;var Db=[""],ge=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc]/,Tb=/[\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]/;
181
+ k.replaceGetRect=function(a){z=a};var Ud=function(){if(ca)return!1;var a=q("div");return"draggable"in a||"dragDrop"in a}(),yb=/^$/;wa?yb=/$'/:Xb?yb=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:wd&&(yb=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/);var Eb,nc,ta=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){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+=
182
+ g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)};k.splitLines=ta;var Od=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?!1:0!=b.compareEndPoints("StartToEnd",b)},Kc=function(){var a=q("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(),ga={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",
183
+ 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"};k.keyNames=ga;
184
+ (function(){for(var a=0;10>a;a++)ga[a+48]=""+a;for(a=65;90>=a;a++)ga[a]=String.fromCharCode(a);for(a=1;12>=a;a++)ga[a+111]=ga[a+63235]="F"+a})();var de=function(){function a(a){return 255>=a?b.charAt(a):1424<=a&&1524>=a?"R":1536<=a&&1791>=a?c.charAt(a-1536):1792<=a&&2220>=a?"r":"L"}var b="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",
185
+ c="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,f=/[LRr]/,g=/[Lb1n]/,h=/[1n]/;return function(b){if(!d.test(b))return!1;for(var c=b.length,l=[],m=0,n;m<c;++m)l.push(a(b.charCodeAt(m)));for(var m=0,k="L";m<c;++m)n=l[m],"m"==n?l[m]=k:
186
+ k=n;m=0;for(k="L";m<c;++m)n=l[m],"1"==n&&"r"==k?l[m]="n":f.test(n)&&(k=n,"r"==n&&(l[m]="R"));m=1;for(k=l[0];m<c-1;++m){n=l[m];if("+"==n&&"1"==k&&"1"==l[m+1])l[m]="1";else if(","==n&&k==l[m+1]&&("1"==k||"n"==k))l[m]=k;k=n}for(m=0;m<c;++m)if(n=l[m],","==n)l[m]="N";else if("%"==n){for(k=m+1;k<c&&"%"==l[k];++k);var o=m&&"!"==l[m-1]||k<c-1&&"1"==l[k]?"1":"N";for(n=m;n<k;++n)l[n]=o;m=k-1}m=0;for(k="L";m<c;++m)n=l[m],"L"==k&&"1"==n?l[m]="L":f.test(n)&&(k=n);for(m=0;m<c;++m)if(e.test(l[m])){for(k=m+1;k<c&&
187
+ e.test(l[k]);++k);n="L"==(k<c-1?l[k]:"L");o="L"==(m?l[m-1]:"L")||n?"L":"R";for(n=m;n<k;++n)l[n]=o;m=k-1}for(var k=[],q,m=0;m<c;)if(g.test(l[m])){n=m;for(++m;m<c&&g.test(l[m]);++m);k.push({from:n,to:m,level:0})}else{var p=m,o=k.length;for(++m;m<c&&"L"!=l[m];++m);for(n=p;n<m;)if(h.test(l[n])){p<n&&k.splice(o,0,{from:p,to:n,level:1});p=n;for(++n;n<m&&h.test(l[n]);++n);k.splice(o,0,{from:p,to:n,level:2});p=n}else++n;p<m&&k.splice(o,0,{from:p,to:m,level:1})}if(1==k[0].level&&(q=b.match(/^\s+/)))k[0].from=
188
+ q[0].length,k.unshift({from:0,to:q[0].length,level:0});if(1==C(k).level&&(q=b.match(/\s+$/)))C(k).to-=q[0].length,k.push({from:c-q[0].length,to:c,level:0});k[0].level!=C(k).level&&k.push({from:c,to:c,level:k[0].level});return k}}();k.version="3.1";return k}();