kuztuscms 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. data/.gitignore +9 -0
  2. data/.rvmrc +55 -0
  3. data/Gemfile +18 -0
  4. data/Gemfile.lock +156 -0
  5. data/MIT-LICENSE +20 -0
  6. data/README.rdoc +12 -0
  7. data/Rakefile +29 -0
  8. data/app/assets/images/kuztuscms/.gitkeep +0 -0
  9. data/app/assets/images/kuztuscms/glyphicons-halflings-white.png +0 -0
  10. data/app/assets/images/kuztuscms/glyphicons-halflings.png +0 -0
  11. data/app/assets/javascripts/kuztuscms/.DS_Store +0 -0
  12. data/app/assets/javascripts/kuztuscms/application.js +15 -0
  13. data/app/assets/javascripts/kuztuscms/bootstrap.js +1720 -0
  14. data/app/assets/javascripts/kuztuscms/codemirror-compressed.js +1 -0
  15. data/app/assets/stylesheets/kuztuscms/.DS_Store +0 -0
  16. data/app/assets/stylesheets/kuztuscms/application.css.scss +16 -0
  17. data/app/assets/stylesheets/kuztuscms/bootstrap-responsive.css +581 -0
  18. data/app/assets/stylesheets/kuztuscms/bootstrap.css +3496 -0
  19. data/app/assets/stylesheets/kuztuscms/codemirror.css +115 -0
  20. data/app/controllers/kuztuscms/articles_controller.rb +53 -0
  21. data/app/controllers/kuztuscms/home_controller.rb +6 -0
  22. data/app/controllers/kuztuscms/layouts_controller.rb +75 -0
  23. data/app/controllers/kuztuscms/pages_controller.rb +73 -0
  24. data/app/controllers/kuztuscms/settings_controller.rb +48 -0
  25. data/app/controllers/kuztuscms/templates_controller.rb +72 -0
  26. data/app/controllers/kuztuscms/users_controller.rb +74 -0
  27. data/app/controllers/kuztuscms_controller.rb +23 -0
  28. data/app/helpers/kuztuscms/application_helper.rb +4 -0
  29. data/app/models/kuztuscms/article.rb +4 -0
  30. data/app/models/kuztuscms/layout.rb +14 -0
  31. data/app/models/kuztuscms/page.rb +8 -0
  32. data/app/models/kuztuscms/setting.rb +11 -0
  33. data/app/models/kuztuscms/template.rb +14 -0
  34. data/app/models/kuztuscms/user.rb +20 -0
  35. data/app/views/devise/_links.erb +27 -0
  36. data/app/views/devise/confirmations/new.html.erb +12 -0
  37. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  38. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  39. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  40. data/app/views/devise/passwords/edit.html.erb +16 -0
  41. data/app/views/devise/passwords/new.html.erb +18 -0
  42. data/app/views/devise/registrations/edit.html.erb +25 -0
  43. data/app/views/devise/registrations/new.html.erb +21 -0
  44. data/app/views/devise/sessions/new.html.erb +31 -0
  45. data/app/views/devise/unlocks/new.html.erb +19 -0
  46. data/app/views/kuztuscms/articles/_form.html.erb +35 -0
  47. data/app/views/kuztuscms/articles/edit.html.erb +1 -0
  48. data/app/views/kuztuscms/articles/index.html.erb +22 -0
  49. data/app/views/kuztuscms/articles/new.html.erb +1 -0
  50. data/app/views/kuztuscms/articles/show.html.erb +4 -0
  51. data/app/views/kuztuscms/home/index.html.erb +1 -0
  52. data/app/views/kuztuscms/layouts/_form.html.erb +58 -0
  53. data/app/views/kuztuscms/layouts/edit.html.erb +2 -0
  54. data/app/views/kuztuscms/layouts/index.html.erb +32 -0
  55. data/app/views/kuztuscms/layouts/new.html.erb +2 -0
  56. data/app/views/kuztuscms/pages/_form.html.erb +72 -0
  57. data/app/views/kuztuscms/pages/edit.html.erb +1 -0
  58. data/app/views/kuztuscms/pages/index.html.erb +28 -0
  59. data/app/views/kuztuscms/pages/new.html.erb +1 -0
  60. data/app/views/kuztuscms/pages/show.html.erb +1 -0
  61. data/app/views/kuztuscms/settings/_form.html.erb +35 -0
  62. data/app/views/kuztuscms/settings/edit.html.erb +1 -0
  63. data/app/views/kuztuscms/settings/index.html.erb +24 -0
  64. data/app/views/kuztuscms/settings/new.html.erb +1 -0
  65. data/app/views/kuztuscms/shared/_codemirror.html.erb +20 -0
  66. data/app/views/kuztuscms/templates/_form.html.erb +58 -0
  67. data/app/views/kuztuscms/templates/edit.html.erb +3 -0
  68. data/app/views/kuztuscms/templates/index.html.erb +28 -0
  69. data/app/views/kuztuscms/templates/new.html.erb +2 -0
  70. data/app/views/kuztuscms/users/_form.html.erb +56 -0
  71. data/app/views/kuztuscms/users/edit.html.erb +1 -0
  72. data/app/views/kuztuscms/users/index.html.erb +28 -0
  73. data/app/views/kuztuscms/users/new.html.erb +1 -0
  74. data/app/views/kuztuscms/users/show.html.erb +15 -0
  75. data/app/views/layouts/kuztuscms/application.html.erb +57 -0
  76. data/config/initializers/devise.rb +225 -0
  77. data/config/initializers/resolver.rb +65 -0
  78. data/config/locales/devise.en.yml +57 -0
  79. data/config/locales/en.yml +5 -0
  80. data/config/routes.rb +18 -0
  81. data/db/migrate/20120218074040_devise_create_kuztuscms_users.rb +52 -0
  82. data/db/migrate/20120218075211_create_kuztuscms_pages.rb +15 -0
  83. data/db/migrate/20120311080242_create_kuztuscms_templates.rb +38 -0
  84. data/db/migrate/20120311141419_create_kuztuscms_articles.rb +10 -0
  85. data/db/migrate/20120311173954_create_kuztuscms_layouts.rb +43 -0
  86. data/db/migrate/20120316081613_create_kuztuscms_settings.rb +10 -0
  87. data/kuztuscms.gemspec +33 -0
  88. data/lib/kuztuscms/engine.rb +13 -0
  89. data/lib/kuztuscms/settings.rb +26 -0
  90. data/lib/kuztuscms/version.rb +3 -0
  91. data/lib/kuztuscms.rb +7 -0
  92. data/lib/tasks/kuztuscms_tasks.rake +4 -0
  93. data/script/rails +8 -0
  94. data/spec/controllers/kuztuscms/articles_controller_spec.rb +164 -0
  95. data/spec/controllers/kuztuscms/languages_controller_spec.rb +164 -0
  96. data/spec/controllers/kuztuscms/layouts_controller_spec.rb +164 -0
  97. data/spec/controllers/kuztuscms/pages_controller_spec.rb +164 -0
  98. data/spec/controllers/kuztuscms/settings_controller_spec.rb +164 -0
  99. data/spec/controllers/kuztuscms/templates_controller_spec.rb +164 -0
  100. data/spec/controllers/kuztuscms/translations_controller_spec.rb +164 -0
  101. data/spec/dummy/README.rdoc +261 -0
  102. data/spec/dummy/Rakefile +7 -0
  103. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  104. data/spec/dummy/app/assets/javascripts/home.js +2 -0
  105. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  106. data/spec/dummy/app/assets/stylesheets/home.css +4 -0
  107. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  108. data/spec/dummy/app/controllers/home_controller.rb +4 -0
  109. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  110. data/spec/dummy/app/helpers/home_helper.rb +2 -0
  111. data/spec/dummy/app/mailers/.gitkeep +0 -0
  112. data/spec/dummy/app/models/.gitkeep +0 -0
  113. data/spec/dummy/app/views/home/index.html.erb +3 -0
  114. data/spec/dummy/app/views/layouts/application.html.erb +16 -0
  115. data/spec/dummy/config/application.rb +62 -0
  116. data/spec/dummy/config/boot.rb +10 -0
  117. data/spec/dummy/config/database.yml +25 -0
  118. data/spec/dummy/config/environment.rb +5 -0
  119. data/spec/dummy/config/environments/development.rb +38 -0
  120. data/spec/dummy/config/environments/production.rb +67 -0
  121. data/spec/dummy/config/environments/test.rb +37 -0
  122. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  123. data/spec/dummy/config/initializers/inflections.rb +15 -0
  124. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  125. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  126. data/spec/dummy/config/initializers/session_store.rb +8 -0
  127. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  128. data/spec/dummy/config/locales/en.yml +9 -0
  129. data/spec/dummy/config/locales/ru.yml +5 -0
  130. data/spec/dummy/config/routes.rb +8 -0
  131. data/spec/dummy/config.ru +4 -0
  132. data/spec/dummy/db/migrate/20120313083011_devise_create_kuztuscms_users.kuztuscms.rb +59 -0
  133. data/spec/dummy/db/migrate/20120313083012_create_kuztuscms_pages.kuztuscms.rb +16 -0
  134. data/spec/dummy/db/migrate/20120313083013_create_kuztuscms_templates.kuztuscms.rb +15 -0
  135. data/spec/dummy/db/migrate/20120313083014_create_kuztuscms_articles.kuztuscms.rb +11 -0
  136. data/spec/dummy/db/migrate/20120313083015_create_kuztuscms_layouts.kuztuscms.rb +41 -0
  137. data/spec/dummy/db/migrate/20120316084434_create_kuztuscms_settings.kuztuscms.rb +11 -0
  138. data/spec/dummy/db/schema.rb +90 -0
  139. data/spec/dummy/lib/assets/.gitkeep +0 -0
  140. data/spec/dummy/log/.gitkeep +0 -0
  141. data/spec/dummy/public/404.html +26 -0
  142. data/spec/dummy/public/422.html +26 -0
  143. data/spec/dummy/public/500.html +25 -0
  144. data/spec/dummy/public/favicon.ico +0 -0
  145. data/spec/dummy/script/rails +6 -0
  146. data/spec/helpers/kuztuscms/articles_helper_spec.rb +15 -0
  147. data/spec/helpers/kuztuscms/languages_helper_spec.rb +15 -0
  148. data/spec/helpers/kuztuscms/layouts_helper_spec.rb +15 -0
  149. data/spec/helpers/kuztuscms/pages_helper_spec.rb +15 -0
  150. data/spec/helpers/kuztuscms/settings_helper_spec.rb +15 -0
  151. data/spec/helpers/kuztuscms/templates_helper_spec.rb +15 -0
  152. data/spec/helpers/kuztuscms/translations_helper_spec.rb +15 -0
  153. data/spec/models/kuztuscms/article_spec.rb +5 -0
  154. data/spec/models/kuztuscms/language_spec.rb +5 -0
  155. data/spec/models/kuztuscms/layout_spec.rb +5 -0
  156. data/spec/models/kuztuscms/page_spec.rb +5 -0
  157. data/spec/models/kuztuscms/setting_spec.rb +5 -0
  158. data/spec/models/kuztuscms/template_spec.rb +5 -0
  159. data/spec/models/kuztuscms/translation_spec.rb +5 -0
  160. data/spec/models/kuztuscms/user_spec.rb +5 -0
  161. data/spec/routing/kuztuscms/articles_routing_spec.rb +35 -0
  162. data/spec/routing/kuztuscms/languages_routing_spec.rb +35 -0
  163. data/spec/routing/kuztuscms/layouts_routing_spec.rb +35 -0
  164. data/spec/routing/kuztuscms/pages_routing_spec.rb +35 -0
  165. data/spec/routing/kuztuscms/settings_routing_spec.rb +35 -0
  166. data/spec/routing/kuztuscms/templates_routing_spec.rb +35 -0
  167. data/spec/routing/kuztuscms/translations_routing_spec.rb +35 -0
  168. data/spec/views/kuztuscms/articles/edit.html.erb_spec.rb +20 -0
  169. data/spec/views/kuztuscms/articles/index.html.erb_spec.rb +24 -0
  170. data/spec/views/kuztuscms/articles/new.html.erb_spec.rb +20 -0
  171. data/spec/views/kuztuscms/articles/show.html.erb_spec.rb +18 -0
  172. data/spec/views/kuztuscms/languages/edit.html.erb_spec.rb +22 -0
  173. data/spec/views/kuztuscms/languages/index.html.erb_spec.rb +28 -0
  174. data/spec/views/kuztuscms/languages/new.html.erb_spec.rb +22 -0
  175. data/spec/views/kuztuscms/languages/show.html.erb_spec.rb +21 -0
  176. data/spec/views/kuztuscms/layouts/edit.html.erb_spec.rb +20 -0
  177. data/spec/views/kuztuscms/layouts/index.html.erb_spec.rb +24 -0
  178. data/spec/views/kuztuscms/layouts/new.html.erb_spec.rb +20 -0
  179. data/spec/views/kuztuscms/layouts/show.html.erb_spec.rb +18 -0
  180. data/spec/views/kuztuscms/pages/edit.html.erb_spec.rb +15 -0
  181. data/spec/views/kuztuscms/pages/index.html.erb_spec.rb +14 -0
  182. data/spec/views/kuztuscms/pages/new.html.erb_spec.rb +15 -0
  183. data/spec/views/kuztuscms/pages/show.html.erb_spec.rb +11 -0
  184. data/spec/views/kuztuscms/settings/edit.html.erb_spec.rb +20 -0
  185. data/spec/views/kuztuscms/settings/index.html.erb_spec.rb +24 -0
  186. data/spec/views/kuztuscms/settings/new.html.erb_spec.rb +20 -0
  187. data/spec/views/kuztuscms/settings/show.html.erb_spec.rb +18 -0
  188. data/spec/views/kuztuscms/templates/edit.html.erb_spec.rb +28 -0
  189. data/spec/views/kuztuscms/templates/index.html.erb_spec.rb +40 -0
  190. data/spec/views/kuztuscms/templates/new.html.erb_spec.rb +28 -0
  191. data/spec/views/kuztuscms/templates/show.html.erb_spec.rb +30 -0
  192. data/spec/views/kuztuscms/translations/edit.html.erb_spec.rb +28 -0
  193. data/spec/views/kuztuscms/translations/index.html.erb_spec.rb +40 -0
  194. data/spec/views/kuztuscms/translations/new.html.erb_spec.rb +28 -0
  195. data/spec/views/kuztuscms/translations/show.html.erb_spec.rb +30 -0
  196. data/test/integration/kuztuscms/setting_test.rb +7 -0
  197. metadata +351 -0
@@ -0,0 +1 @@
1
+ var CodeMirror=function(){function a(d,e){function Ub(a){return a>=0&&a<rb.size}function Wb(a){return v(rb,a)}function Xb(a,b){Ib=!0;var c=b-a.height;for(var d=a;d;d=d.parent)d.height+=c}function Yb(a){var b={line:0,ch:0};mc(b,{line:rb.size-1,ch:Wb(rb.size-1).text.length},db(a),b,b),Cb=!0}function Zb(a){var b=[];return rb.iter(0,rb.size,function(a){b.push(a.text)}),b.join("\n")}function $b(a){function j(a){var b=Ed(a,!0);if(b&&!X(b,g)){tb||kc(),g=b,Nc(d,b),Cb=!1;var c=Gc();if(b.line>=c.to||b.line<c.from)h=setTimeout(Rd(function(){j(a)}),150)}}function k(a){clearTimeout(h);var b=Ed(a);b&&Nc(d,b),C(a),Cc(),Cb=!0,l(),i()}Mc(H(a,"shiftKey"));for(var b=F(a);b!=s;b=b.parentNode)if(b.parentNode==S&&b!=T)return;for(var b=F(a);b!=s;b=b.parentNode)if(b.parentNode==gb)return f.onGutterClick&&f.onGutterClick(Vb,bb(gb.childNodes,b)+Lb,a),C(a);var d=Ed(a);switch(G(a)){case 3:L&&!c&&Fd(a);return;case 2:d&&Qc(d.line,d.ch,!0);return}if(!d){F(a)==R&&C(a);return}tb||kc();var e=+(new Date);if(xb&&xb.time>e-400&&X(xb.pos,d))return C(a),setTimeout(Cc,20),Zc(d.line);if(wb&&wb.time>e-400&&X(wb.pos,d))return xb={time:e,pos:d},C(a),Yc(d);wb={time:e,pos:d};var g=d,h;if(Q&&!f.readOnly&&!X(ub.from,ub.to)&&!Y(d,ub.from)&&!Y(ub.to,d)){O&&(hb.draggable=!0);var i=I(document,"mouseup",Rd(function(b){O&&(hb.draggable=!1),zb=!1,i(),Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-b.clientY)<10&&(C(b),Qc(d.line,d.ch,!0),Cc())}),!0);zb=!0,hb.dragDrop&&hb.dragDrop();return}C(a),Qc(d.line,d.ch,!0);var l=I(document,"mousemove",Rd(function(a){clearTimeout(h),C(a),G(a)?j(a):k(a)}),!0),i=I(document,"mouseup",Rd(k),!0)}function _b(a){for(var b=F(a);b!=s;b=b.parentNode)if(b.parentNode==gb)return C(a);var c=Ed(a);if(!c)return;xb={time:+(new Date),pos:c},C(a),Yc(c)}function ac(a){a.preventDefault();var b=Ed(a,!0),c=a.dataTransfer.files;if(!b||f.readOnly)return;if(c&&c.length&&window.FileReader&&window.File){function d(a,c){var d=new FileReader;d.onload=function(){g[c]=d.result,++h==e&&(b=Sc(b),Rd(function(){var a=rc(g.join(""),b,b);Nc(b,a)})())},d.readAsText(a)}var e=c.length,g=Array(e),h=0;for(var i=0;i<e;++i)d(c[i],i)}else try{var g=a.dataTransfer.getData("Text");if(g){var j=ub.from,k=ub.to;Nc(b,b),zb&&rc("",j,k),sc(g),Cc()}}catch(a){}}function bc(a){var b=vc();a.dataTransfer.setData("Text",b);if(L||P){var c=document.createElement("img");c.scr="data:image/gif;base64,R0lGODdhAgACAIAAAAAAAP///ywAAAAAAgACAAACAoRRADs=",a.dataTransfer.setDragImage(c,0,0)}}function cc(a,b){if(typeof a=="string"){a=h[a];if(!a)return!1}var c=vb;try{f.readOnly&&(Bb=!0),b&&(vb=null),a(Vb)}catch(d){if(d!=K)throw d;return!1}finally{vb=c,Bb=!1}return!0}function dc(a){var b=j(f.keyMap),c=b.auto;clearTimeout(gc),c&&!l(a)&&(gc=setTimeout(function(){j(f.keyMap)==b&&(f.keyMap=c.call?c.call(null,Vb):c)},50));var d=fb[H(a,"keyCode")],e=!1;return d==null||a.altGraphKey?!1:(H(a,"altKey")&&(d="Alt-"+d),H(a,"ctrlKey")&&(d="Ctrl-"+d),H(a,"metaKey")&&(d="Cmd-"+d),H(a,"shiftKey")?e=k("Shift-"+d,f.extraKeys,f.keyMap,function(a){return cc(a,!0)})||k(d,f.extraKeys,f.keyMap,function(a){if(typeof a=="string"&&/^go/.test(a))return cc(a)}):e=k(d,f.extraKeys,f.keyMap,cc),e&&(C(a),M&&(a.oldKeyCode=a.keyCode,a.keyCode=0)),e)}function ec(a,b){var c=k("'"+b+"'",f.extraKeys,f.keyMap,cc);return c&&C(a),c}function hc(a){tb||kc(),M&&a.keyCode==27&&(a.returnValue=!1),wc&&Ac()&&(wc=!1);if(f.onKeyEvent&&f.onKeyEvent(Vb,B(a)))return;var b=H(a,"keyCode");Mc(b==16||H(a,"shiftKey"));var d=dc(a);window.opera&&(fc=d?b:null,!d&&b==88&&H(a,c?"metaKey":"ctrlKey")&&sc(""))}function ic(a){wc&&Ac();if(f.onKeyEvent&&f.onKeyEvent(Vb,B(a)))return;var b=H(a,"keyCode"),c=H(a,"charCode");if(window.opera&&b==fc){fc=null,C(a);return}if(window.opera&&!a.which&&dc(a))return;var d=String.fromCharCode(c==null?b:c);f.electricChars&&qb.electricChars&&f.smartIndent&&!f.readOnly&&qb.electricChars.indexOf(d)>-1&&setTimeout(Rd(function(){_c(ub.to.line,"smart")}),75);if(ec(a,d))return;yc()}function jc(a){if(f.onKeyEvent&&f.onKeyEvent(Vb,B(a)))return;H(a,"keyCode")==16&&(vb=null)}function kc(){if(f.readOnly=="nocursor")return;tb||(f.onFocus&&f.onFocus(Vb),tb=!0,s.className.search(/\bCodeMirror-focused\b/)==-1&&(s.className+=" CodeMirror-focused"),Hb||Bc(!0)),xc(),Gd()}function lc(){tb&&(f.onBlur&&f.onBlur(Vb),tb=!1,Ob&&Rd(function(){Ob&&(Ob(),Ob=null)})(),s.className=s.className.replace(" CodeMirror-focused","")),clearInterval(pb),setTimeout(function(){tb||(vb=null)},150)}function mc(a,b,c,d,e){if(Bb)return;if(Sb){var g=[];rb.iter(a.line,b.line+1,function(a){g.push(a.text)}),Sb.addChange(a.line,c.length,g);while(Sb.done.length>f.undoDepth)Sb.done.shift()}qc(a,b,c,d,e)}function nc(a,b){if(!a.length)return;var c=a.pop(),d=[];for(var e=c.length-1;e>=0;e-=1){var f=c[e],g=[],h=f.start+f.added;rb.iter(f.start,h,function(a){g.push(a.text)}),d.push({start:f.start,added:f.old.length,old:g});var i=Sc({line:f.start+f.old.length-1,ch:ab(g[g.length-1],f.old[f.old.length-1])});qc({line:f.start,ch:0},{line:h-1,ch:Wb(h-1).text.length},f.old,i,i)}Cb=!0,b.push(d)}function oc(){nc(Sb.done,Sb.undone)}function pc(){nc(Sb.undone,Sb.done)}function qc(a,b,c,d,e){function y(a){return a<=Math.min(b.line,b.line+s)?a:a+s}if(Bb)return;var g=!1,h=Pb.length;f.lineWrapping||rb.iter(a.line,b.line,function(a){if(a.text.length==h)return g=!0,!0});if(a.line!=b.line||c.length>1)Ib=!0;var i=b.line-a.line,j=Wb(a.line),k=Wb(b.line);if(a.ch==0&&b.ch==0&&c[c.length-1]==""){var l=[],m=null;a.line?(m=Wb(a.line-1),m.fixMarkEnds(k)):k.fixMarkStarts();for(var n=0,o=c.length-1;n<o;++n)l.push(r.inheritMarks(c[n],m));i&&rb.remove(a.line,i,Jb),l.length&&rb.insert(a.line,l)}else if(j==k)if(c.length==1)j.replace(a.ch,b.ch,c[0]);else{k=j.split(b.ch,c[c.length-1]),j.replace(a.ch,null,c[0]),j.fixMarkEnds(k);var l=[];for(var n=1,o=c.length-1;n<o;++n)l.push(r.inheritMarks(c[n],j));l.push(k),rb.insert(a.line+1,l)}else if(c.length==1)j.replace(a.ch,null,c[0]),k.replace(null,b.ch,""),j.append(k),rb.remove(a.line+1,i,Jb);else{var l=[];j.replace(a.ch,null,c[0]),k.replace(null,b.ch,c[c.length-1]),j.fixMarkEnds(k);for(var n=1,o=c.length-1;n<o;++n)l.push(r.inheritMarks(c[n],j));i>1&&rb.remove(a.line+1,i-1,Jb),rb.insert(a.line+1,l)}if(f.lineWrapping){var p=R.clientWidth/Bd()-3;rb.iter(a.line,a.line+c.length,function(a){if(a.hidden)return;var b=Math.ceil(a.text.length/p)||1;b!=a.height&&Xb(a,b)})}else rb.iter(a.line,n+c.length,function(a){var b=a.text;b.length>h&&(Pb=b,h=b.length,Qb=null,g=!1)}),g&&(h=0,Pb="",Qb=null,rb.iter(0,rb.size,function(a){var b=a.text;b.length>h&&(h=b.length,Pb=b)}));var q=[],s=c.length-i-1;for(var n=0,t=sb.length;n<t;++n){var u=sb[n];u<a.line?q.push(u):u>b.line&&q.push(u+s)}var v=a.line+Math.min(c.length,500);Ld(a.line,v),q.push(v),sb=q,Nd(100),Eb.push({from:a.line,to:b.line+1,diff:s});var w={from:a,to:b,text:c};if(Fb){for(var x=Fb;x.next;x=x.next);x.next=w}else Fb=w;Oc(d,e,y(ub.from.line),y(ub.to.line)),R.clientHeight&&(S.style.height=rb.height*yd()+2*Cd()+"px")}function rc(a,b,c){function d(d){if(Y(d,b))return d;if(!Y(c,d))return e;var f=d.line+a.length-(c.line-b.line)-1,g=d.ch;return d.line==c.line&&(g+=a[a.length-1].length-(c.ch-(c.line==b.line?b.ch:0))),{line:f,ch:g}}b=Sc(b),c?c=Sc(c):c=b,a=db(a);var e;return tc(a,b,c,function(a){return e=a,{from:d(ub.from),to:d(ub.to)}}),e}function sc(a,b){tc(db(a),ub.from,ub.to,function(a){return b=="end"?{from:a,to:a}:b=="start"?{from:ub.from,to:ub.from}:{from:ub.from,to:a}})}function tc(a,b,c,d){var e=a.length==1?a[0].length+b.ch:a[a.length-1].length,f=d({line:b.line+a.length-1,ch:e});mc(b,c,a,f.from,f.to)}function uc(a,b){var c=a.line,d=b.line;if(c==d)return Wb(c).text.slice(a.ch,b.ch);var e=[Wb(c).text.slice(a.ch)];return rb.iter(c+1,d,function(a){e.push(a.text)}),e.push(Wb(d).text.slice(0,b.ch)),e.join("\n")}function vc(){return uc(ub.from,ub.to)}function xc(){if(wc)return;nb.set(f.pollInterval,function(){Od(),Ac(),tb&&xc(),Pd()})}function yc(){function b(){Od();var c=Ac();!c&&!a?(a=!0,nb.set(60,b)):(wc=!1,xc()),Pd()}var a=!1;wc=!0,nb.set(20,b)}function Ac(){if(Hb||!tb||eb(D)||f.readOnly)return!1;var a=D.value;if(a==zc)return!1;vb=null;var b=0,c=Math.min(zc.length,a.length);while(b<c&&zc[b]==a[b])++b;return b<zc.length?ub.from={line:ub.from.line,ch:ub.from.ch-(zc.length-b)}:Ab&&X(ub.from,ub.to)&&(ub.to={line:ub.to.line,ch:Math.min(Wb(ub.to.line).text.length,ub.to.ch+(a.length-b))}),sc(a.slice(b),"end"),zc=a,!0}function Bc(a){X(ub.from,ub.to)?a&&(zc=D.value=""):(zc="",D.value=vc(),W(D))}function Cc(){f.readOnly!="nocursor"&&D.focus()}function Dc(){if(!jb.getBoundingClientRect)return;var a=jb.getBoundingClientRect();if(M&&a.top==a.bottom)return;var b=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(a.top<0||a.bottom>b)&&jb.scrollIntoView()}function Ec(){var a=sd(ub.inverted?ub.from:ub.to),b=f.lineWrapping?Math.min(a.x,hb.offsetWidth):a.x;return Fc(b,a.y,b,a.yBot)}function Fc(a,b,c,d){var e=Dd(),g=Cd(),h=yd();b+=g,d+=g,a+=e,c+=e;var i=R.clientHeight,j=R.scrollTop,k=!1,l=!0;b<j?(R.scrollTop=Math.max(0,b-2*h),k=!0):d>j+i&&(R.scrollTop=d+h-i,k=!0);var m=R.clientWidth,n=R.scrollLeft,o=f.fixedGutter?$.clientWidth:0;return a<n+o?(a<50&&(a=0),R.scrollLeft=Math.max(0,a-10-o),k=!0):c>m+n-3&&(R.scrollLeft=c+10-m,k=!0,c>S.clientWidth&&(l=!1)),k&&f.onScroll&&f.onScroll(Vb),l}function Gc(){var a=yd(),b=R.scrollTop-Cd(),c=Math.max(0,Math.floor(b/a)),d=Math.ceil((b+R.clientHeight)/a);return{from:x(rb,c),to:x(rb,d)}}function Hc(a,b){if(!R.clientWidth){Lb=Mb=Kb=0;return}var c=Gc();if(a!==!0&&a.length==0&&c.from>Lb&&c.to<Mb)return;var d=Math.max(c.from-100,0),e=Math.min(rb.size,c.to+100);Lb<d&&d-Lb<20&&(d=Lb),Mb>e&&Mb-e<20&&(e=Math.min(rb.size,Mb));var g=a===!0?[]:Ic([{from:Lb,to:Mb,domStart:0}],a),h=0;for(var i=0;i<g.length;++i){var j=g[i];j.from<d&&(j.domStart+=d-j.from,j.from=d),j.to>e&&(j.to=e),j.from>=j.to?g.splice(i--,1):h+=j.to-j.from}if(h==e-d)return;g.sort(function(a,b){return a.domStart-b.domStart});var k=yd(),l=$.style.display;lb.style.display="none",Jc(d,e,g),lb.style.display=$.style.display="";var m=d!=Lb||e!=Mb||Nb!=R.clientHeight+k;m&&(Nb=R.clientHeight+k),Lb=d,Mb=e,Kb=y(rb,d),T.style.top=Kb*k+"px",R.clientHeight&&(S.style.height=rb.height*k+2*Cd()+"px");if(lb.childNodes.length!=Mb-Lb)throw new Error("BAD PATCH! "+JSON.stringify(g)+" size="+(Mb-Lb)+" nodes="+lb.childNodes.length);if(f.lineWrapping){Qb=R.clientWidth;var n=lb.firstChild,o=!1;rb.iter(Lb,Mb,function(a){if(!a.hidden){var b=Math.round(n.offsetHeight/k)||1;a.height!=b&&(Xb(a,b),Ib=o=!0)}n=n.nextSibling}),o&&(S.style.height=rb.height*k+2*Cd()+"px")}else Qb==null&&(Qb=od(Pb)),Qb>R.clientWidth?(hb.style.width=Qb+"px",S.style.width="",S.style.width=R.scrollWidth+"px"):hb.style.width=S.style.width="";return $.style.display=l,(m||Ib)&&Kc(),Lc(),!b&&f.onUpdate&&f.onUpdate(Vb),!0}function Ic(a,b){for(var c=0,d=b.length||0;c<d;++c){var e=b[c],f=[],g=e.diff||0;for(var h=0,i=a.length;h<i;++h){var j=a[h];e.to<=j.from&&e.diff?f.push({from:j.from+g,to:j.to+g,domStart:j.domStart}):e.to<=j.from||e.from>=j.to?f.push(j):(e.from>j.from&&f.push({from:j.from,to:e.from,domStart:j.domStart}),e.to<j.to&&f.push({from:e.to+g,to:j.to+g,domStart:j.domStart+(e.to-j.from)}))}a=f}return a}function Jc(a,b,c){if(!c.length)lb.innerHTML="";else{function d(a){var b=a.nextSibling;return a.parentNode.removeChild(a),b}var e=0,f=lb.firstChild,g;for(var h=0;h<c.length;++h){var i=c[h];while(i.domStart>e)f=d(f),e++;for(var j=0,k=i.to-i.from;j<k;++j)f=f.nextSibling,e++}while(f)f=d(f)}var l=c.shift(),f=lb.firstChild,j=a,m=document.createElement("div"),n;rb.iter(a,b,function(a){l&&l.to==j&&(l=c.shift());if(!l||l.from>j){if(a.hidden)var b=m.innerHTML="<pre></pre>";else{var b="<pre"+(a.className?' class="'+a.className+'"':"")+">"+a.getHTML(dd)+"</pre>";a.bgClassName&&(b='<div style="position: relative"><pre class="'+a.bgClassName+'" style="position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: -2">&#160;</pre>'+b+"</div>")}m.innerHTML=b,lb.insertBefore(m.firstChild,f)}else f=f.nextSibling;++j})}function Kc(){if(!f.gutter&&!f.lineNumbers)return;var a=T.offsetHeight,b=R.clientHeight;$.style.height=(a-b<2?b:a)+"px";var c=[],d=Lb;rb.iter(Lb,Math.max(Mb,Lb+1),function(a){if(a.hidden)c.push("<pre></pre>");else{var b=a.gutterMarker,e=f.lineNumbers?d+f.firstLineNumber:null;b&&b.text?e=b.text.replace("%N%",e!=null?e:""):e==null&&(e="\u00a0"),c.push(b&&b.style?'<pre class="'+b.style+'">':"<pre>",e);for(var g=1;g<a.height;++g)c.push("<br/>&#160;");c.push("</pre>")}++d}),$.style.display="none",gb.innerHTML=c.join("");var e=String(rb.size).length,g=gb.firstChild,h=V(g),i="";while(h.length+i.length<e)i+="\u00a0";i&&g.insertBefore(document.createTextNode(i),g.firstChild),$.style.display="",hb.style.marginLeft=$.offsetWidth+"px",Ib=!1}function Lc(){var a=X(ub.from,ub.to),b=sd(ub.from,!0),c=a?b:sd(ub.to,!0),d=ub.inverted?b:c,e=yd(),g=U(s),h=U(lb);A.style.top=Math.max(0,Math.min(R.offsetHeight,d.y+h.top-g.top))+"px",A.style.left=Math.max(0,Math.min(R.offsetWidth,d.x+h.left-g.left))+"px";if(a)jb.style.top=d.y+"px",jb.style.left=(f.lineWrapping?Math.min(d.x,hb.offsetWidth):d.x)+"px",jb.style.display="",kb.style.display="none";else{var i=b.y==c.y,j="";function k(a,b,c,d){j+='<div class="CodeMirror-selected" style="position: absolute; left: '+a+"px; top: "+b+"px; right: "+c+"px; height: "+d+'px"></div>'}if(ub.from.ch&&b.y>=0){var l=i?hb.clientWidth-c.x:0;k(b.x,b.y,l,e)}var m=Math.max(0,b.y+(ub.from.ch?e:0)),n=Math.min(c.y,hb.clientHeight)-m;n>.2*e&&k(0,m,0,n),(!i||!ub.from.ch)&&c.y<hb.clientHeight-.5*e&&k(0,c.y,hb.clientWidth-c.x,e),kb.innerHTML=j,jb.style.display="none",kb.style.display=""}}function Mc(a){a?vb=vb||(ub.inverted?ub.to:ub.from):vb=null}function Nc(a,b){var c=vb&&Sc(vb);c&&(Y(c,a)?a=c:Y(b,c)&&(b=c)),Oc(a,b),Db=!0}function Oc(a,b,c,d){Wc=null,c==null&&(c=ub.from.line,d=ub.to.line);if(X(ub.from,a)&&X(ub.to,b))return;if(Y(b,a)){var e=b;b=a,a=e}a.line!=c&&(a=Pc(a,c,ub.from.ch)),b.line!=d&&(b=Pc(b,d,ub.to.ch)),X(a,b)?ub.inverted=!1:X(a,ub.to)?ub.inverted=!1:X(b,ub.from)&&(ub.inverted=!0);if(f.autoClearEmptyLines&&X(ub.from,ub.to)){var g=ub.inverted?a:b;if(g.line!=ub.from.line){var h=Wb(ub.from.line);/^\s+$/.test(h.text)&&setTimeout(Rd(function(){if(h.parent&&/^\s+$/.test(h.text)){var a=w(h);rc("",{line:a,ch:0},{line:a,ch:h.text.length})}},10))}}ub.from=a,ub.to=b,Gb=!0}function Pc(a,b,c){function d(b){var d=a.line+b,e=b==1?rb.size:-1;while(d!=e){var f=Wb(d);if(!f.hidden){var g=a.ch;if(g>c||g>f.text.length)g=f.text.length;return{line:d,ch:g}}d+=b}}var e=Wb(a.line);return e.hidden?a.line>=b?d(1)||d(-1):d(-1)||d(1):a}function Qc(a,b,c){var d=Sc({line:a,ch:b||0});(c?Nc:Oc)(d,d)}function Rc(a){return Math.max(0,Math.min(a,rb.size-1))}function Sc(a){if(a.line<0)return{line:0,ch:0};if(a.line>=rb.size)return{line:rb.size-1,ch:Wb(rb.size-1).text.length};var b=a.ch,c=Wb(a.line).text.length;return b==null||b>c?{line:a.line,ch:c}:b<0?{line:a.line,ch:0}:a}function Tc(a,b){function g(){for(var b=d+a,c=a<0?-1:rb.size;b!=c;b+=a){var e=Wb(b);if(!e.hidden)return d=b,f=e,!0}}function h(b){if(e==(a<0?0:f.text.length)){if(!!b||!g())return!1;e=a<0?f.text.length:0}else e+=a;return!0}var c=ub.inverted?ub.from:ub.to,d=c.line,e=c.ch,f=Wb(d);if(b=="char")h();else if(b=="column")h(!0);else if(b=="word"){var i=!1;for(;;){if(a<0&&!h())break;if(cb(f.text.charAt(e)))i=!0;else if(i){a<0&&(a=1,h());break}if(a>0&&!h())break}}return{line:d,ch:e}}function Uc(a,b){var c=a<0?ub.from:ub.to;if(vb||X(ub.from,ub.to))c=Tc(a,b);Qc(c.line,c.ch,!0)}function Vc(a,b){X(ub.from,ub.to)?a<0?rc("",Tc(a,b),ub.to):rc("",ub.from,Tc(a,b)):rc("",ub.from,ub.to),Db=!0}function Xc(a,b){var c=0,d=sd(ub.inverted?ub.from:ub.to,!0);Wc!=null&&(d.x=Wc),b=="page"?c=Math.min(R.clientHeight,window.innerHeight||document.documentElement.clientHeight):b=="line"&&(c=yd());var e=td(d.x,d.y+c*a+2);Qc(e.line,e.ch,!0),Wc=d.x}function Yc(a){var b=Wb(a.line).text,c=a.ch,d=a.ch;while(c>0&&cb(b.charAt(c-1)))--c;while(d<b.length&&cb(b.charAt(d)))++d;Nc({line:a.line,ch:c},{line:a.line,ch:d})}function Zc(a){Nc({line:a,ch:0},Sc({line:a+1,ch:0}))}function $c(a){if(X(ub.from,ub.to))return _c(ub.from.line,a);var b=ub.to.line-(ub.to.ch?0:1);for(var c=ub.from.line;c<=b;++c)_c(c,a)}function _c(a,b){b||(b="add");if(b=="smart")if(!qb.indent)b="prev";else var c=Kd(a);var d=Wb(a),e=d.indentation(f.tabSize),g=d.text.match(/^\s*/)[0],h;b=="prev"?a?h=Wb(a-1).indentation(f.tabSize):h=0:b=="smart"?h=qb.indent(c,d.text.slice(g.length),d.text):b=="add"?h=e+f.indentUnit:b=="subtract"&&(h=e-f.indentUnit),h=Math.max(0,h);var i=h-e;if(!i){if(ub.from.line!=a&&ub.to.line!=a)return;var j=g}else{var j="",k=0;if(f.indentWithTabs)for(var l=Math.floor(h/f.tabSize);l;--l)k+=f.tabSize,j+=" ";while(k<h)++k,j+=" "}rc(j,{line:a,ch:0},{line:a,ch:g.length})}function ad(){qb=a.getMode(f,f.mode),rb.iter(0,rb.size,function(a){a.stateAfter=null}),sb=[0],Nd()}function bd(){var a=f.gutter||f.lineNumbers;$.style.display=a?"":"none",a?Ib=!0:lb.parentNode.style.marginLeft=0}function cd(a,b){if(f.lineWrapping){s.className+=" CodeMirror-wrap";var c=R.clientWidth/Bd()-3;rb.iter(0,rb.size,function(a){if(a.hidden)return;var b=Math.ceil(a.text.length/c)||1;b!=1&&Xb(a,b)}),hb.style.width=S.style.width=""}else s.className=s.className.replace(" CodeMirror-wrap",""),Qb=null,Pb="",rb.iter(0,rb.size,function(a){a.height!=1&&!a.hidden&&Xb(a,1),a.text.length>Pb.length&&(Pb=a.text)});Eb.push({from:0,to:rb.size})}function dd(a){var b=f.tabSize-a%f.tabSize,c=Rb[b];if(c)return c;for(var d='<span class="cm-tab">',e=0;e<b;++e)d+=" ";return Rb[b]={html:d+"</span>",width:b}}function ed(){R.className=R.className.replace(/\s*cm-s-\w+/g,"")+f.theme.replace(/(^|\s)\s*/g," cm-s-")}function fd(){this.set=[]}function gd(a,b,c){function e(a,b,c,e){Wb(a).addMark(new p(b,c,e,d.set))}a=Sc(a),b=Sc(b);var d=new fd;if(!Y(a,b))return d;if(a.line==b.line)e(a.line,a.ch,b.ch,c);else{e(a.line,a.ch,null,c);for(var f=a.line+1,g=b.line;f<g;++f)e(f,null,null,c);e(b.line,null,b.ch,c)}return Eb.push({from:a.line,to:b.line+1}),d}function hd(a){a=Sc(a);var b=new q(a.ch);return Wb(a.line).addMark(b),b}function id(a,b,c){return typeof a=="number"&&(a=Wb(Rc(a))),a.gutterMarker={text:b,style:c},Ib=!0,a}function jd(a){typeof a=="number"&&(a=Wb(Rc(a))),a.gutterMarker=null,Ib=!0}function kd(a,b){var c=a,d=a;return typeof a=="number"?d=Wb(Rc(a)):c=w(a),c==null?null:b(d,c)?(Eb.push({from:c,to:c+1}),d):null}function ld(a,b,c){return kd(a,function(a){if(a.className!=b||a.bgClassName!=c)return a.className=b,a.bgClassName=c,!0})}function md(a,b){return kd(a,function(a,c){if(a.hidden!=b){a.hidden=b,Xb(a,b?0:1);var d=ub.from.line,e=ub.to.line;if(b&&(d==c||e==c)){var f=d==c?Pc({line:d,ch:0},d,0):ub.from,g=e==c?Pc({line:e,ch:0},e,0):ub.to;Oc(f,g)}return Ib=!0}})}function nd(a){if(typeof a=="number"){if(!Ub(a))return null;var b=a;a=Wb(a);if(!a)return null}else{var b=w(a);if(b==null)return null}var c=a.gutterMarker;return{line:b,handle:a,text:a.text,markerText:c&&c.text,markerClass:c&&c.style,lineClass:a.className,bgClass:a.bgClassName}}function od(a){return ib.innerHTML="<pre><span>x</span></pre>",ib.firstChild.firstChild.firstChild.nodeValue=a,ib.firstChild.firstChild.offsetWidth||10}function pd(a,b){function e(a){return ib.innerHTML="<pre><span>"+c.getHTML(dd,a)+"</span></pre>",ib.firstChild.firstChild.offsetWidth}if(b<=0)return 0;var c=Wb(a),d=c.text,f=0,g=0,h=d.length,i,j=Math.min(h,Math.ceil(b/Bd()));for(;;){var k=e(j);if(!(k<=b&&j<h)){i=k,h=j;break}j=Math.min(h,Math.ceil(j*1.2))}if(b>i)return h;j=Math.floor(h*.8),k=e(j),k<b&&(f=j,g=k);for(;;){if(h-f<=1)return i-b>b-g?f:h;var l=Math.ceil((f+h)/2),m=e(l);m>b?(h=l,i=m):(f=l,g=m)}}function rd(a,b){if(b==0)return{top:0,left:0};var c="";if(f.lineWrapping){var d=a.text.indexOf(" ",b+6);c=_(a.text.slice(b+1,d<0?a.text.length:d+(M?5:0)))}ib.innerHTML="<pre>"+a.getHTML(dd,b)+'<span id="CodeMirror-temp-'+qd+'">'+_(a.text.charAt(b)||" ")+"</span>"+c+"</pre>";var e=document.getElementById("CodeMirror-temp-"+qd),g=e.offsetTop,h=e.offsetLeft;if(M&&g==0&&h==0){var i=document.createElement("span");i.innerHTML="x",e.parentNode.insertBefore(i,e.nextSibling),g=i.offsetTop}return{top:g,left:h}}function sd(a,b){var c,d=yd(),e=d*(y(rb,a.line)-(b?Kb:0));if(a.ch==0)c=0;else{var g=rd(Wb(a.line),a.ch);c=g.left,f.lineWrapping&&(e+=Math.max(0,g.top))}return{x:c,y:e,yBot:e+d}}function td(a,b){function l(a){var b=rd(h,a);if(j){var d=Math.round(b.top/c);return Math.max(0,b.left+(d-k)*R.clientWidth)}return b.left}b<0&&(b=0);var c=yd(),d=Bd(),e=Kb+Math.floor(b/c),g=x(rb,e);if(g>=rb.size)return{line:rb.size-1,ch:Wb(rb.size-1).text.length};var h=Wb(g),i=h.text,j=f.lineWrapping,k=j?e-y(rb,g):0;if(a<=0&&k==0)return{line:g,ch:0};var m=0,n=0,o=i.length,p,q=Math.min(o,Math.ceil((a+k*R.clientWidth*.9)/d));for(;;){var r=l(q);if(!(r<=a&&q<o)){p=r,o=q;break}q=Math.min(o,Math.ceil(q*1.2))}if(a>p)return{line:g,ch:o};q=Math.floor(o*.8),r=l(q),r<a&&(m=q,n=r);for(;;){if(o-m<=1)return{line:g,ch:p-a>a-n?m:o};var s=Math.ceil((m+o)/2),t=l(s);t>a?(o=s,p=t):(m=s,n=t)}}function ud(a){var b=sd(a,!0),c=U(hb);return{x:c.left+b.x,y:c.top+b.y,yBot:c.top+b.yBot}}function yd(){if(xd==null){xd="<pre>";for(var a=0;a<49;++a)xd+="x<br/>";xd+="x</pre>"}var b=lb.clientHeight;return b==wd?vd:(wd=b,ib.innerHTML=xd,vd=ib.firstChild.offsetHeight/50||1,ib.innerHTML="",vd)}function Bd(){return R.clientWidth==Ad?zd:(Ad=R.clientWidth,zd=od("x"))}function Cd(){return hb.offsetTop}function Dd(){return hb.offsetLeft}function Ed(a,b){var c=U(R,!0),d,e;try{d=a.clientX,e=a.clientY}catch(a){return null}if(!b&&(d-c.left>R.clientWidth||e-c.top>R.clientHeight))return null;var f=U(hb,!0);return td(d-f.left,e-f.top)}function Fd(a){function f(){var a=db(D.value).join("\n");a!=e&&Rd(sc)(a,"end"),A.style.position="relative",D.style.cssText=d,N&&(R.scrollTop=c),Hb=!1,Bc(!0),xc()}var b=Ed(a),c=R.scrollTop;if(!b||window.opera)return;(X(ub.from,ub.to)||Y(b,ub.from)||!Y(b,ub.to))&&Rd(Qc)(b.line,b.ch);var d=D.style.cssText;A.style.position="absolute",D.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(a.clientY-5)+"px; left: "+(a.clientX-5)+"px; z-index: 1000; background: white; "+"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Hb=!0;var e=D.value=vc();Cc(),W(D);if(L){E(a);var g=I(window,"mouseup",function(){g(),setTimeout(f,20)},!0)}else setTimeout(f,50)}function Gd(){clearInterval(pb);var a=!0;jb.style.visibility="",pb=setInterval(function(){jb.style.visibility=(a=!a)?"":"hidden"},650)}function Id(a){function p(a,b,c){if(!a.text)return;var d=a.styles,e=g?0:a.text.length-1,f;for(var i=g?0:d.length-2,j=g?d.length:-2;i!=j;i+=2*h){var k=d[i];if(d[i+1]!=null&&d[i+1]!=m){e+=h*k.length;continue}for(var l=g?0:k.length-1,p=g?k.length:-1;l!=p;l+=h,e+=h)if(e>=b&&e<c&&o.test(f=k.charAt(l))){var q=Hd[f];if(q.charAt(1)==">"==g)n.push(f);else{if(n.pop()!=q.charAt(0))return{pos:e,match:!1};if(!n.length)return{pos:e,match:!0}}}}}var b=ub.inverted?ub.from:ub.to,c=Wb(b.line),d=b.ch-1,e=d>=0&&Hd[c.text.charAt(d)]||Hd[c.text.charAt(++d)];if(!e)return;var f=e.charAt(0),g=e.charAt(1)==">",h=g?1:-1,i=c.styles;for(var j=d+1,k=0,l=i.length;k<l;k+=2)if((j-=i[k].length)<=0){var m=i[k+1];break}var n=[c.text.charAt(d)],o=/[(){}[\]]/;for(var k=b.line,l=g?Math.min(k+100,rb.size):Math.max(-1,k-100);k!=l;k+=h){var c=Wb(k),q=k==b.line,r=p(c,q&&g?d+1:0,q&&!g?d:c.text.length);if(r)break}r||(r={pos:null,match:!1});var m=r.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",s=gd({line:b.line,ch:d},{line:b.line,ch:d+1},m),t=r.pos!=null&&gd({line:k,ch:r.pos},{line:k,ch:r.pos+1},m),u=Rd(function(){s.clear(),t&&t.clear()});a?setTimeout(u,800):Ob=u}function Jd(a){var b,c;for(var d=a,e=a-40;d>e;--d){if(d==0)return 0;var g=Wb(d-1);if(g.stateAfter)return d;var h=g.indentation(f.tabSize);if(c==null||b>h)c=d-1,b=h}return c}function Kd(a){var b=Jd(a),c=b&&Wb(b-1).stateAfter;return c?c=m(qb,c):c=n(qb),rb.iter(b,a,function(a){a.highlight(qb,c,f.tabSize),a.stateAfter=m(qb,c)}),b<a&&Eb.push({from:b,to:a}),a<rb.size&&!Wb(a).stateAfter&&sb.push(a),c}function Ld(a,b){var c=Kd(a);rb.iter(a,b,function(a){a.highlight(qb,c,f.tabSize),a.stateAfter=m(qb,c)})}function Md(){var a=+(new Date)+f.workTime,b=sb.length;while(sb.length){if(!Wb(Lb).stateAfter)var c=Lb;else var c=sb.pop();if(c>=rb.size)continue;var d=Jd(c),e=d&&Wb(d-1).stateAfter;e?e=m(qb,e):e=n(qb);var g=0,h=qb.compareStates,i=!1,j=d,k=!1;rb.iter(j,rb.size,function(b){var d=b.stateAfter;if(+(new Date)>a)return sb.push(j),Nd(f.workDelay),i&&Eb.push({from:c,to:j+1}),k=!0;var l=b.highlight(qb,e,f.tabSize);l&&(i=!0),b.stateAfter=m(qb,e);if(h){if(d&&h(d,e))return!0}else if(l!==!1||!d)g=0;else if(++g>3&&(!qb.indent||qb.indent(d,"")==qb.indent(e,"")))return!0;++j});if(k)return;i&&Eb.push({from:c,to:j+1})}b&&f.onHighlightComplete&&f.onHighlightComplete(Vb)}function Nd(a){if(!sb.length)return;ob.set(a,Rd(Md))}function Od(){Cb=Db=Fb=null,Eb=[],Gb=!1,Jb=[]}function Pd(){var a=!1,b;Gb&&(a=!Ec()),Eb.length?b=Hc(Eb,!0):(Gb&&Lc(),Ib&&Kc()),a&&Ec(),Gb&&(Dc(),Gd()),tb&&!Hb&&(Cb===!0||Cb!==!1&&Gb)&&Bc(Db),Gb&&f.matchBrackets&&setTimeout(Rd(function(){Ob&&(Ob(),Ob=null),X(ub.from,ub.to)&&Id(!1)}),20);var c=Fb,d=Jb;Gb&&f.onCursorActivity&&f.onCursorActivity(Vb),c&&f.onChange&&Vb&&f.onChange(Vb,c);for(var e=0;e<d.length;++e)d[e](Vb);b&&f.onUpdate&&f.onUpdate(Vb)}function Rd(a){return function(){Qd++||Od();try{var b=a.apply(this,arguments)}finally{--Qd||Pd()}return b}}var f={},i=a.defaults;for(var o in i)i.hasOwnProperty(o)&&(f[o]=(e&&e.hasOwnProperty(o)?e:i)[o]);var s=document.createElement("div");s.className="CodeMirror"+(f.lineWrapping?" CodeMirror-wrap":""),s.innerHTML='<div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea style="position: absolute; padding: 0; width: 1px; height: 1em" wrap="off" autocorrect="off" autocapitalize="off"></textarea></div><div class="CodeMirror-scroll" tabindex="-1"><div style="position: relative"><div style="position: relative"><div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div><div class="CodeMirror-lines"><div style="position: relative; z-index: 0"><div style="position: absolute; width: 100%; height: 0; overflow: hidden; visibility: hidden;"></div><pre class="CodeMirror-cursor">&#160;</pre><div style="position: relative; z-index: -1"></div><div></div></div></div></div></div></div>',d.appendChild?d.appendChild(s):d(s);var A=s.firstChild,D=A.firstChild,R=s.lastChild,S=R.firstChild,T=S.firstChild,$=T.firstChild,gb=$.firstChild,hb=$.nextSibling.firstChild,ib=hb.firstChild,jb=ib.nextSibling,kb=jb.nextSibling,lb=kb.nextSibling;ed(),b&&(D.style.width="0px"),O||(hb.draggable=!0),hb.style.outline="none",f.tabindex!=null&&(D.tabIndex=f.tabindex),!f.gutter&&!f.lineNumbers&&($.style.display="none");try{od("x")}catch(mb){throw mb.message.match(/runtime/i)&&(mb=new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)")),mb}var nb=new J,ob=new J,pb,qb,rb=new u([new t([new r("")])]),sb,tb;ad();var ub={from:{line:0,ch:0},to:{line:0,ch:0},inverted:!1},vb,wb,xb,yb=0,zb,Ab=!1,Bb=!1,Cb,Db,Eb,Fb,Gb,Hb,Ib,Jb,Kb=0,Lb=0,Mb=0,Nb=0,Ob,Pb="",Qb,Rb={};Rd(function(){Yb(f.value||""),Cb=!1})();var Sb=new z;I(R,"mousedown",Rd($b)),I(R,"dblclick",Rd(_b)),I(hb,"dragstart",bc),I(hb,"selectstart",C),L||I(R,"contextmenu",Fd),I(R,"scroll",function(){yb=R.scrollTop,Hc([]),f.fixedGutter&&($.style.left=R.scrollLeft+"px"),f.onScroll&&f.onScroll(Vb)}),I(window,"resize",function(){Hc(!0)}),I(D,"keyup",Rd(jc)),I(D,"input",yc),I(D,"keydown",Rd(hc)),I(D,"keypress",Rd(ic)),I(D,"focus",kc),I(D,"blur",lc),I(R,"dragenter",E),I(R,"dragover",E),I(R,"drop",Rd(ac)),I(R,"paste",function(){Cc(),yc()}),I(D,"paste",yc),I(D,"cut",Rd(function(){f.readOnly||sc("")}));var Tb;try{Tb=document.activeElement==D}catch(mb){}Tb?setTimeout(kc,20):lc();var Vb=s.CodeMirror={getValue:Zb,setValue:Rd(Yb),getSelection:vc,replaceSelection:Rd(sc),focus:function(){window.focus(),Cc(),kc(),yc()},setOption:function(a,b){var c=f[a];f[a]=b,a=="mode"||a=="indentUnit"?ad():a=="readOnly"&&b=="nocursor"?(lc(),D.blur()):a=="readOnly"&&!b?Bc(!0):a=="theme"?ed():a=="lineWrapping"&&c!=b?Rd(cd)():a=="tabSize"&&Hc(!0);if(a=="lineNumbers"||a=="gutter"||a=="firstLineNumber"||a=="theme")bd(),Hc(!0)},getOption:function(a){return f[a]},undo:Rd(oc),redo:Rd(pc),indentLine:Rd(function(a,b){typeof b!="string"&&(b==null?b=f.smartIndent?"smart":"prev":b=b?"add":"subtract"),Ub(a)&&_c(a,b)}),indentSelection:Rd($c),historySize:function(){return{undo:Sb.done.length,redo:Sb.undone.length}},clearHistory:function(){Sb=new z},matchBrackets:Rd(function(){Id(!0)}),getTokenAt:Rd(function(a){return a=Sc(a),Wb(a.line).getTokenAt(qb,Kd(a.line),a.ch)}),getStateAfter:function(a){return a=Rc(a==null?rb.size-1:a),Kd(a+1)},cursorCoords:function(a){return a==null&&(a=ub.inverted),ud(a?ub.from:ub.to)},charCoords:function(a){return ud(Sc(a))},coordsChar:function(a){var b=U(hb);return td(a.x-b.left,a.y-b.top)},markText:Rd(gd),setBookmark:hd,setMarker:Rd(id),clearMarker:Rd(jd),setLineClass:Rd(ld),hideLine:Rd(function(a){return md(a,!0)}),showLine:Rd(function(a){return md(a,!1)}),onDeleteLine:function(a,b){if(typeof a=="number"){if(!Ub(a))return null;a=Wb(a)}return(a.handlers||(a.handlers=[])).push(b),a},lineInfo:nd,addWidget:function(a,b,c,d,e){a=sd(Sc(a));var f=a.yBot,g=a.x;b.style.position="absolute",S.appendChild(b);if(d=="over")f=a.y;else if(d=="near"){var h=Math.max(R.offsetHeight,rb.height*yd()),i=Math.max(S.clientWidth,hb.clientWidth)-Dd();a.yBot+b.offsetHeight>h&&a.y>b.offsetHeight&&(f=a.y-b.offsetHeight),g+b.offsetWidth>i&&(g=i-b.offsetWidth)}b.style.top=f+Cd()+"px",b.style.left=b.style.right="",e=="right"?(g=S.clientWidth-b.offsetWidth,b.style.right="0px"):(e=="left"?g=0:e=="middle"&&(g=(S.clientWidth-b.offsetWidth)/2),b.style.left=g+Dd()+"px"),c&&Fc(g,f,g+b.offsetWidth,f+b.offsetHeight)},lineCount:function(){return rb.size},clipPos:Sc,getCursor:function(a){return a==null&&(a=ub.inverted),Z(a?ub.from:ub.to)},somethingSelected:function(){return!X(ub.from,ub.to)},setCursor:Rd(function(a,b,c){b==null&&typeof a.line=="number"?Qc(a.line,a.ch,c):Qc(a,b,c)}),setSelection:Rd(function(a,b,c){(c?Nc:Oc)(Sc(a),Sc(b||a))}),getLine:function(a){if(Ub(a))return Wb(a).text},getLineHandle:function(a){if(Ub(a))return Wb(a)},setLine:Rd(function(a,b){Ub(a)&&rc(b,{line:a,ch:0},{line:a,ch:Wb(a).text.length})}),removeLine:Rd(function(a){Ub(a)&&rc("",{line:a,ch:0},Sc({line:a+1,ch:0}))}),replaceRange:Rd(rc),getRange:function(a,b){return uc(Sc(a),Sc(b))},triggerOnKeyDown:Rd(hc),execCommand:function(a){return h[a](Vb)},moveH:Rd(Uc),deleteH:Rd(Vc),moveV:Rd(Xc),toggleOverwrite:function(){Ab?(Ab=!1,jb.className=jb.className.replace(" CodeMirror-overwrite","")):(Ab=!0,jb.className+=" CodeMirror-overwrite")},posFromIndex:function(a){var b=0,c;return rb.iter(0,rb.size,function(d){var e=d.text.length+1;if(e>a)return c=a,!0;a-=e,++b}),Sc({line:b,ch:c})},indexFromPos:function(a){if(a.line<0||a.ch<0)return 0;var b=a.ch;return rb.iter(0,a.line,function(a){b+=a.text.length+1}),b},scrollTo:function(a,b){a!=null&&(R.scrollLeft=a),b!=null&&(R.scrollTop=b),Hc([])},operation:function(a){return Rd(a)()},refresh:function(){Hc(!0),R.scrollHeight>yb&&(R.scrollTop=yb)},getInputField:function(){return D},getWrapperElement:function(){return s},getScrollerElement:function(){return R},getGutterElement:function(){return $}},fc=null,gc,wc=!1,zc="",Wc=null;fd.prototype.clear=Rd(function(){var a=Infinity,b=-Infinity;for(var c=0,d=this.set.length;c<d;++c){var e=this.set[c],f=e.marked;if(!f||!e.parent)continue;var g=w(e);a=Math.min(a,g),b=Math.max(b,g);for(var h=0;h<f.length;++h)f[h].set==this.set&&f.splice(h--,1)}a!=Infinity&&Eb.push({from:a,to:b+1})}),fd.prototype.find=function(){var a,b;for(var c=0,d=this.set.length;c<d;++c){var e=this.set[c],f=e.marked;for(var g=0;g<f.length;++g){var h=f[g];if(h.set==this.set)if(h.from!=null||h.to!=null){var i=w(e);i!=null&&(h.from!=null&&(a={line:i,ch:h.from}),h.to!=null&&(b={line:i,ch:h.to}))}}}return{from:a,to:b}};var qd=Math.floor(Math.random()*16777215).toString(16),vd,wd,xd,zd,Ad=0,Hd={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},Qd=0;for(var Sd in g)g.propertyIsEnumerable(Sd)&&!Vb.propertyIsEnumerable(Sd)&&(Vb[Sd]=g[Sd]);return Vb}function j(a){return typeof a=="string"?i[a]:a}function k(a,b,c,d){function e(b){b=j(b);var c=b[a];if(c!=null&&d(c))return!0;if(b.catchall)return d(b.catchall);var f=b.fallthrough;if(f==null)return!1;if(Object.prototype.toString.call(f)!="[object Array]")return e(f);for(var g=0,h=f.length;g<h;++g)if(e(f[g]))return!0;return!1}return b&&e(b)?!0:e(c)}function l(a){var b=fb[H(a,"keyCode")];return b=="Ctrl"||b=="Alt"||b=="Shift"||b=="Mod"}function m(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c}function n(a,b,c){return a.startState?a.startState(b,c):!0}function o(a,b){this.pos=this.start=0,this.string=a,this.tabSize=b||8}function p(a,b,c,d){this.from=a,this.to=b,this.style=c,this.set=d}function q(a){this.from=a,this.to=a,this.line=null}function r(a,b){this.styles=b||[a,null],this.text=a,this.height=1,this.marked=this.gutterMarker=this.className=this.bgClassName=this.handlers=null,this.stateAfter=this.parent=this.hidden=null}function s(a,b,c,d){for(var e=0,f=0,g=0;f<b;e+=2){var h=c[e],i=f+h.length;g==0?(i>a&&d.push(h.slice(a-f,Math.min(h.length,b-f)),c[e+1]),i>=a&&(g=1)):g==1&&(i>b?d.push(h.slice(0,b-f),c[e+1]):d.push(h,c[e+1])),f=i}}function t(a){this.lines=a,this.parent=null;for(var b=0,c=a.length,d=0;b<c;++b)a[b].parent=this,d+=a[b].height;this.height=d}function u(a){this.children=a;var b=0,c=0;for(var d=0,e=a.length;d<e;++d){var f=a[d];b+=f.chunkSize(),c+=f.height,f.parent=this}this.size=b,this.height=c,this.parent=null}function v(a,b){while(!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 w(a){if(a.parent==null)return null;var b=a.parent,c=bb(b.lines,a);for(var d=b.parent;d;b=d,d=d.parent)for(var e=0,f=d.children.length;;++e){if(d.children[e]==b)break;c+=d.children[e].chunkSize()}return c}function x(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);for(var d=0,e=a.lines.length;d<e;++d){var h=a.lines[d],i=h.height;if(b<i)break;b-=i}return c+d}function y(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.chunkSize();if(b<g){a=f;continue a}b-=g,c+=f.height}return c}while(!a.lines);for(var d=0;d<b;++d)c+=a.lines[d].height;return c}function z(){this.time=0,this.done=[],this.undone=[]}function A(){E(this)}function B(a){return a.stop||(a.stop=A),a}function C(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function D(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function E(a){C(a),D(a)}function F(a){return a.target||a.srcElement}function G(a){if(a.which)return a.which;if(a.button&1)return 1;if(a.button&2)return 3;if(a.button&4)return 2}function H(a,b){var c=a.override&&a.override.hasOwnProperty(b);return c?a.override[b]:a[b]}function I(a,b,c,d){if(typeof a.addEventListener=="function"){a.addEventListener(b,c,!1);if(d)return function(){a.removeEventListener(b,c,!1)}}else{var e=function(a){c(a||window.event)};a.attachEvent("on"+b,e);if(d)return function(){a.detachEvent("on"+b,e)}}}function J(){this.id=null}function S(a,b,c){b==null&&(b=a.search(/[^\s\u00a0]/),b==-1&&(b=a.length));for(var d=0,e=0;d<b;++d)a.charAt(d)==" "?e+=c-e%c:++e;return e}function T(a){return a.currentStyle?a.currentStyle:window.getComputedStyle(a,null)}function U(a,b){var c=a.ownerDocument.body,d=0,e=0,f=!1;for(var g=a;g;g=g.offsetParent){var h=g.offsetLeft,i=g.offsetTop;g==c?(d+=Math.abs(h),e+=Math.abs(i)):(d+=h,e+=i),b&&T(g).position=="fixed"&&(f=!0)}var j=b&&!f?null:c;for(var g=a.parentNode;g!=j;g=g.parentNode)g.scrollLeft!=null&&(d-=g.scrollLeft,e-=g.scrollTop);return{left:d,top:e}}function V(a){return a.textContent||a.innerText||a.nodeValue||""}function W(a){b?(a.selectionStart=0,a.selectionEnd=a.value.length):a.select()}function X(a,b){return a.line==b.line&&a.ch==b.ch}function Y(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function Z(a){return{line:a.line,ch:a.ch}}function _(a){return $.textContent=a,$.innerHTML}function ab(a,b){if(!b)return 0;if(!a)return b.length;for(var c=a.length,d=b.length;c>=0&&d>=0;--c,--d)if(a.charAt(c)!=b.charAt(d))break;return d+1}function bb(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 cb(a){return/\w/.test(a)||a.toUpperCase()!=a.toLowerCase()}a.defaults={value:"",mode:null,theme:"default",indentUnit:2,indentWithTabs:!1,smartIndent:!0,tabSize:4,keyMap:"default",extraKeys:null,electricChars:!0,autoClearEmptyLines:!1,onKeyEvent:null,lineWrapping:!1,lineNumbers:!1,gutter:!1,fixedGutter:!1,firstLineNumber:1,readOnly:!1,onChange:null,onCursorActivity:null,onGutterClick:null,onHighlightComplete:null,onUpdate:null,onFocus:null,onBlur:null,onScroll:null,matchBrackets:!1,workTime:100,workDelay:200,pollInterval:100,undoDepth:40,tabindex:null};var b=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),c=b||/Mac/.test(navigator.platform),d=/Win/.test(navigator.platform),e={},f={};a.defineMode=function(b,c){!a.defaults.mode&&b!="null"&&(a.defaults.mode=b),e[b]=c},a.defineMIME=function(a,b){f[a]=b},a.resolveMode=function(b){if(typeof b=="string"&&f.hasOwnProperty(b))b=f[b];else if(typeof b=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(b))return a.resolveMode("application/xml");return typeof b=="string"?{name:b}:b||{name:"null"}},a.getMode=function(b,c){var c=a.resolveMode(c),d=e[c.name];return d?d(b,c):(window.console&&console.warn("No mode "+c.name+" found, falling back to plain text."),a.getMode(b,"text/plain"))},a.listModes=function(){var a=[];for(var b in e)e.propertyIsEnumerable(b)&&a.push(b);return a},a.listMIMEs=function(){var a=[];for(var b in f)f.propertyIsEnumerable(b)&&a.push({mime:b,mode:f[b]});return a};var g=a.extensions={};a.defineExtension=function(a,b){g[a]=b};var h=a.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=!X(b,c);!d&&a.getLine(b.line).length==b.ch?a.replaceRange("",b,{line:b.line+1,ch:0}):a.replaceRange("",b,d?c:{line:b.line})},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",{line:b,ch:0},{line:b})},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.setCursor(0,0,!0)},goDocEnd:function(a){a.setSelection({line:a.lineCount()-1},null,!0)},goLineStart:function(a){a.setCursor(a.getCursor().line,0,!0)},goLineStartSmart:function(a){var b=a.getCursor(),c=a.getLine(b.line),d=Math.max(0,c.search(/\S/));a.setCursor(b.line,b.ch<=d&&b.ch?0:d,!0)},goLineEnd:function(a){a.setSelection({line:a.getCursor().line},null,!0)},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goWordRight:function(a){a.moveH(1,"word")},delCharLeft:function(a){a.deleteH(-1,"char")},delCharRight:function(a){a.deleteH(1,"char")},delWordLeft:function(a){a.deleteH(-1,"word")},delWordRight: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(" ","end")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line);b.ch>0&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),{line:b.line,ch:b.ch-1},{line:b.line,ch:b.ch+1})},newlineAndIndent:function(a){a.replaceSelection("\n","end"),a.indentLine(a.getCursor().line)},toggleOverwrite:function(a){a.toggleOverwrite()}},i=a.keyMap={};i.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharRight",Backspace:"delCharLeft",Tab:"indentMore","Shift-Tab":"indentLess",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},i.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","Alt-Right":"goLineEnd","Ctrl-Backspace":"delWordLeft","Ctrl-Delete":"delWordRight","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll",fallthrough:"basic"},i.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","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delWordLeft","Ctrl-Alt-Backspace":"delWordRight","Alt-Delete":"delWordRight","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll",fallthrough:["basic","emacsy"]},i["default"]=c?i.macDefault:i.pcDefault,i.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageUp","Shift-Ctrl-V":"goPageDown","Ctrl-D":"delCharRight","Ctrl-H":"delCharLeft","Alt-D":"delWordRight","Alt-Backspace":"delWordLeft","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},a.fromTextArea=function(b,c){function d(){b.value=h.getValue()}c||(c={}),c.value=b.value,!c.tabindex&&b.tabindex&&(c.tabindex=b.tabindex);if(b.form){var e=I(b.form,"submit",d,!0);if(typeof b.form.submit=="function"){var f=b.form.submit;function g(){d(),b.form.submit=f,b.form.submit(),b.form.submit=g}b.form.submit=g}}b.style.display="none";var h=a(function(a){b.parentNode.insertBefore(a,b.nextSibling)},c);return h.save=d,h.getTextArea=function(){return b},h.toTextArea=function(){d(),b.parentNode.removeChild(h.getWrapperElement()),b.style.display="",b.form&&(e(),typeof b.form.submit=="function"&&(b.form.submit=f))},h},a.copyState=m,a.startState=n,o.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},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(typeof a=="string")var c=b==a;else var c=b&&(a.test?a.test(b):a(b));if(c)return++this.pos,b},eatWhile:function(a){var b=this.pos;while(this.eat(a));return this.pos>b},eatSpace:function(){var a=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);if(b>-1)return this.pos=b,!0},backUp:function(a){this.pos-=a},column:function(){return S(this.string,this.start,this.tabSize)},indentation:function(){return S(this.string,null,this.tabSize)},match:function(a,b,c){if(typeof a!="string"){var e=this.string.slice(this.pos).match(a);return e&&b!==!1&&(this.pos+=e[0].length),e}function d(a){return c?a.toLowerCase():a}if(d(this.string).indexOf(d(a),this.pos)==this.pos)return b!==!1&&(this.pos+=a.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},a.StringStream=o,p.prototype={attach:function(a){this.set.push(a)},detach:function(a){var b=bb(this.set,a);b>-1&&this.set.splice(b,1)},split:function(a,b){if(this.to<=a&&this.to!=null)return null;var c=this.from<a||this.from==null?null:this.from-a+b,d=this.to==null?null:this.to-a+b;return new p(c,d,this.style,this.set)},dup:function(){return new p(null,null,this.style,this.set)},clipTo:function(a,b,c,d,e){a&&d>this.from&&(d<this.to||this.to==null)?this.from=null:this.from!=null&&this.from>=b&&(this.from=Math.max(d,this.from)+e),c&&(b<this.to||this.to==null)&&(b>this.from||this.from==null)?this.to=null:this.to!=null&&this.to>b&&(this.to=d<this.to?this.to+e:b)},isDead:function(){return this.from!=null&&this.to!=null&&this.from>=this.to},sameSet:function(a){return this.set==a.set}},q.prototype={attach:function(a){this.line=a},detach:function(a){this.line==a&&(this.line=null)},split:function(a,b){if(a<this.from)return this.from=this.to=this.from-a+b,this},isDead:function(){return this.from>this.to},clipTo:function(a,b,c,d,e){(a||b<this.from)&&(c||d>this.to)?(this.from=0,this.to=-1):this.from>b&&(this.from=this.to=Math.max(d,this.from)+e)},sameSet:function(a){return!1},find:function(){return!this.line||!this.line.parent?null:{line:w(this.line),ch:this.from}},clear:function(){if(this.line){var a=bb(this.line.marked,this);a!=-1&&this.line.marked.splice(a,1),this.line=null}}},r.inheritMarks=function(a,b){var c=new r(a),d=b&&b.marked;if(d)for(var e=0;e<d.length;++e)if(d[e].to==null&&d[e].style){var f=c.marked||(c.marked=[]),g=d[e],h=g.dup();f.push(h),h.attach(c)}return c},r.prototype={replace:function(a,b,c){var d=[],e=this.marked,f=b==null?this.text.length:b;s(0,a,this.styles,d),c&&d.push(c,null),s(f,this.text.length,this.styles,d),this.styles=d,this.text=this.text.slice(0,a)+c+this.text.slice(f),this.stateAfter=null;if(e){var g=c.length-(f-a);for(var h=0;h<e.length;++h){var i=e[h];i.clipTo(a==null,a||0,b==null,f,g),i.isDead()&&(i.detach(this),e.splice(h--,1))}}},split:function(a,b){var c=[b,null],d=this.marked;s(a,this.text.length,this.styles,c);var e=new r(b+this.text.slice(a),c);if(d)for(var f=0;f<d.length;++f){var g=d[f],h=g.split(a,b.length);h&&(e.marked||(e.marked=[]),e.marked.push(h),h.attach(e))}return e},append:function(a){var b=this.text.length,c=a.marked,d=this.marked;this.text+=a.text,s(0,a.text.length,a.styles,this.styles);if(d)for(var e=0;e<d.length;++e)d[e].to==null&&(d[e].to=b);if(c&&c.length){d||(this.marked=d=[]);a:for(var e=0;e<c.length;++e){var f=c[e];if(!f.from)for(var g=0;g<d.length;++g){var h=d[g];if(h.to==b&&h.sameSet(f)){h.to=f.to==null?null:f.to+b,h.isDead()&&(h.detach(this),c.splice(e--,1));continue a}}d.push(f),f.attach(this),f.from+=b,f.to!=null&&(f.to+=b)}}},fixMarkEnds:function(a){var b=this.marked,c=a.marked;if(!b)return;for(var d=0;d<b.length;++d){var e=b[d],f=e.to==null;if(f&&c)for(var g=0;g<c.length;++g)if(c[g].sameSet(e)){f=!1;break}f&&(e.to=this.text.length)}},fixMarkStarts:function(){var a=this.marked;if(!a)return;for(var b=0;b<a.length;++b)a[b].from==null&&(a[b].from=0)},addMark:function(a){a.attach(this),this.marked==null&&(this.marked=[]),this.marked.push(a),this.marked.sort(function(a,b){return(a.from||0)-(b.from||0)})},highlight:function(a,b,c){var d=new o(this.text,c),e=this.styles,f=0,g=!1,h=e[0],i;this.text==""&&a.blankLine&&a.blankLine(b);while(!d.eol()){var j=a.token(d,b),k=this.text.slice(d.start,d.pos);d.start=d.pos,f&&e[f-1]==j?e[f-2]+=k:k&&(!g&&(e[f+1]!=j||f&&e[f-2]!=i)&&(g=!0),e[f++]=k,e[f++]=j,i=h,h=e[f]);if(d.pos>5e3){e[f++]=this.text.slice(d.pos),e[f++]=null;break}}return e.length!=f&&(e.length=f,g=!0),f&&e[f-2]!=i&&(g=!0),g||(e.length<5&&this.text.length<10?null:!1)},getTokenAt:function(a,b,c){var d=this.text,e=new o(d);while(e.pos<c&&!e.eol()){e.start=e.pos;var f=a.token(e,b)}return{start:e.start,end:e.pos,string:e.current(),className:f||null,state:b}},indentation:function(a){return S(this.text,null,a)},getHTML:function(a,b){function f(b,f){if(!b)return;d&&M&&b.charAt(0)==" "&&(b="\u00a0"+b.slice(1)),d=!1;if(b.indexOf(" ")==-1){e+=b.length;var g=_(b)}else{var g="";for(var h=0;;){var i=b.indexOf(" ",h);if(i==-1){g+=_(b.slice(h)),e+=b.length-h;break}e+=i-h;var j=a(e);g+=_(b.slice(h,i))+j.html,e+=j.width,h=i+1}}f?c.push('<span class="',f,'">',g,"</span>"):c.push(g)}function k(a){return a?"cm-"+a.replace(/ +/g," cm-"):null}var c=[],d=!0,e=0,g=this.styles,h=this.text,i=this.marked,j=h.length;b!=null&&(j=Math.min(b,j));if(!h&&b==null)f(" ");else if(!i||!i.length)for(var l=0,m=0;m<j;l+=2){var n=g[l],o=g[l+1],p=n.length;m+p>j&&(n=n.slice(0,j-m)),m+=p,f(n,k(o))}else{var q=0,l=0,r="",o,s=0,t=i[0].from||0,u=[],v=0;function w(){var a;while(v<i.length&&((a=i[v]).from==q||a.from==null))a.style!=null&&u.push(a),++v;t=v<i.length?i[v].from:Infinity;for(var b=0;b<u.length;++b){var c=u[b].to||Infinity;c==q?u.splice(b--,1):t=Math.min(c,t)}}var x=0;while(q<j){t==q&&w();var y=Math.min(j,t);for(;;){if(r){var z=q+r.length,A=o;for(var B=0;B<u.length;++B)A=(A?A+" ":"")+u[B].style;f(z>y?r.slice(0,y-q):r,A);if(z>=y){r=r.slice(y-q),q=y;break}q=z}r=g[l++],o=k(g[l++])}}}return c.join("")},cleanUp:function(){this.parent=null;if(this.marked)for(var a=0,b=this.marked.length;a<b;++a)this.marked[a].detach(this)}},t.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,f.cleanUp();if(f.handlers)for(var g=0;g<f.handlers.length;++g)c.push(f.handlers[g])}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.splice.apply(this.lines,[a,0].concat(b));for(var d=0,e=b.length;d<e;++d)b[d].parent=this},iterN:function(a,b,c){for(var d=a+b;a<d;++a)if(c(this.lines[a]))return!0}},u.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((b-=g)==0)break;a=0}else a-=f}if(this.size-b<25){var i=[];this.collapse(i),this.children=[new t(i)],this.children[0].parent=this}},collapse:function(a){for(var b=0,c=this.children.length;b<c;++b)this.children[b].collapse(a)},insert:function(a,b){var c=0;for(var 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&&f.lines.length>50){while(f.lines.length>50){var h=f.lines.splice(f.lines.length-25,25),i=new t(h);f.height-=i.height,this.children.splice(d+1,0,i),i.parent=this}this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(this.children.length<=10)return;var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new u(b);if(!a.parent){var d=new u(a.children);d.parent=a,a.children=[d,c],a=d}else{a.size-=c.size,a.height-=c.height;var e=bb(a.parent.children,a);a.parent.children.splice(e+1,0,c)}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()},iter:function(a,b,c){this.iterN(a,b-a,c)},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){var h=Math.min(b,g-a);if(f.iterN(a,h,c))return!0;if((b-=h)==0)break;a=0}else a-=g}}},z.prototype={addChange:function(a,b,c){this.undone.length=0;var d=+(new Date),e=this.done[this.done.length-1],f=e&&e[e.length-1],g=d-this.time;if(g>400||!f)this.done.push([{start:a,added:b,old:c}]);else if(f.start>a+c.length||f.start+f.added<a-f.added+f.old.length)e.push({start:a,added:b,old:c});else{var h=0;if(a<f.start){for(var i=f.start-a-1;i>=0;--i)f.old.unshift(c[i]);f.added+=f.start-a,f.start=a}else f.start<a&&(h=a-f.start,b+=h);for(var i=f.added-h,j=c.length;i<j;++i)f.old.push(c[i]);f.added<b&&(f.added=b)}this.time=d}},a.e_stop=E,a.e_preventDefault=C,a.e_stopPropagation=D,a.connect=I,J.prototype={set:function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)}};var K=a.Pass={toString:function(){return"CodeMirror.Pass"}},L=/gecko\/\d{7}/i.test(navigator.userAgent),M=/MSIE \d/.test(navigator.userAgent),N=/MSIE [1-8]\b/.test(navigator.userAgent),O=/WebKit\//.test(navigator.userAgent),P=/Chrome\//.test(navigator.userAgent),Q=function(){if(N)return!1;var a=document.createElement("div");return"draggable"in a||"dragDrop"in a}(),R="\n";(function(){var a=document.createElement("textarea");a.value="foo\nbar",a.value.indexOf("\r")>-1&&(R="\r\n")})(),document.documentElement.getBoundingClientRect!=null&&(U=function(a,b){try{var c=a.getBoundingClientRect();c={top:c.top,left:c.left}}catch(d){c={top:0,left:0}}if(!b)if(window.pageYOffset==null){var e=document.documentElement||document.body.parentNode;e.scrollTop==null&&(e=document.body),c.top+=e.scrollTop,c.left+=e.scrollLeft}else c.top+=window.pageYOffset,c.left+=window.pageXOffset;return c});var $=document.createElement("pre");_("a")=="\na"?_=function(a){return $.textContent=a,$.innerHTML.slice(1)}:_(" ")!=" "&&(_=function(a){return $.innerHTML="",$.appendChild(document.createTextNode(a)),$.innerHTML}),a.htmlEscape=_;var db="\n\nb".split(/\n/).length!=3?function(a){var b=0,c,d=[];while((c=a.indexOf("\n",b))>-1)d.push(a.slice(b,a.charAt(c-1)=="\r"?c-1:c)),b=c+1;return d.push(a.slice(b)),d}:function(a){return a.split(/\r?\n/)};a.splitLines=db;var eb=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:b.compareEndPoints("StartToEnd",b)!=0};a.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),a.defineMIME("text/plain","null");var fb={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",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"};return a.keyNames=fb,function(){for(var a=0;a<10;a++)fb[a+48]=String(a);for(var a=65;a<=90;a++)fb[a]=String.fromCharCode(a);for(var a=1;a<=12;a++)fb[a+111]=fb[a+63235]="F"+a}(),a}();CodeMirror.defineMode("coffeescript",function(a){function c(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function r(a,c){if(a.sol()){var k=c.scopes[0].offset;if(a.eatSpace()){var l=a.indentation();return l>k?"indent":l<k?"dedent":null}k>0&&v(a,c)}if(a.eatSpace())return null;var p=a.peek();if(a.match("###"))return c.tokenize=t,c.tokenize(a,c);if(p==="#")return a.skipToEnd(),"comment";if(a.match(/^-?[0-9\.]/,!1)){var r=!1;a.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(r=!0),a.match(/^-?\d+\.\d*/)&&(r=!0),a.match(/^-?\.\d+/)&&(r=!0);if(r)return a.peek()=="."&&a.backUp(1),"number";var u=!1;a.match(/^-?0x[0-9a-f]+/i)&&(u=!0),a.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(u=!0),a.match(/^-?0(?![\dx])/i)&&(u=!0);if(u)return"number"}if(a.match(n))return c.tokenize=s(a.current(),"string"),c.tokenize(a,c);if(a.match(o)){if(a.current()!="/"||a.match(/^.*\//,!1))return c.tokenize=s(a.current(),"string-2"),c.tokenize(a,c);a.backUp(1)}return a.match(h)||a.match(g)?"punctuation":a.match(f)||a.match(d)||a.match(j)?"operator":a.match(e)?"punctuation":a.match(q)?"atom":a.match(m)?"keyword":a.match(i)?"variable":(a.next(),b)}function s(c,d){var e=c.length==1;return function(g,h){while(!g.eol()){g.eatWhile(/[^'"\/\\]/);if(g.eat("\\")){g.next();if(e&&g.eol())return d}else{if(g.match(c))return h.tokenize=r,d;g.eat(/['"\/]/)}}return e&&(a.mode.singleLineStringErrors?d=b:h.tokenize=r),d}}function t(a,b){while(!a.eol()){a.eatWhile(/[^#]/);if(a.match("###")){b.tokenize=r;break}a.eatWhile("#")}return"comment"}function u(b,c,d){d=d||"coffee";var e=0;if(d==="coffee"){for(var f=0;f<c.scopes.length;f++)if(c.scopes[f].type==="coffee"){e=c.scopes[f].offset+a.indentUnit;break}}else e=b.column()+b.current().length;c.scopes.unshift({offset:e,type:d})}function v(a,b){if(b.scopes.length==1)return;if(b.scopes[0].type==="coffee"){var c=a.indentation(),d=-1;for(var e=0;e<b.scopes.length;++e)if(c===b.scopes[e].offset){d=e;break}if(d===-1)return!0;while(b.scopes[0].offset!==c)b.scopes.shift();return!1}return b.scopes.shift(),!1}function w(a,c){var d=c.tokenize(a,c),e=a.current();if(e===".")return d=c.tokenize(a,c),e=a.current(),d==="variable"?"variable":b;if(e==="@")return a.eat("@"),"keyword";e==="return"&&(c.dedent+=1),((e==="->"||e==="=>")&&!c.lambda&&c.scopes[0].type=="coffee"&&a.peek()===""||d==="indent")&&u(a,c);var f="[({".indexOf(e);return f!==-1&&u(a,c,"])}".slice(f,f+1)),k.exec(e)&&u(a,c),e=="then"&&v(a,c),d==="dedent"&&v(a,c)?b:(f="])}".indexOf(e),f!==-1&&v(a,c)?b:(c.dedent>0&&a.eol()&&c.scopes[0].type=="coffee"&&(c.scopes.length>1&&c.scopes.shift(),c.dedent-=1),d))}var b="error",d=new RegExp("^[\\+\\-\\*/%&|\\^~<>!?]"),e=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),f=new RegExp("^((->)|(=>)|(\\+\\+)|(\\+\\=)|(\\-\\-)|(\\-\\=)|(\\*\\*)|(\\*\\=)|(\\/\\/)|(\\/\\=)|(==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//))"),g=new RegExp("^((\\.\\.)|(\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),h=new RegExp("^((\\.\\.\\.)|(//=)|(>>=)|(<<=)|(\\*\\*=))"),i=new RegExp("^[_A-Za-z$][_A-Za-z$0-9]*"),j=c(["and","or","not","is","isnt","in","instanceof","typeof"]),k=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],l=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","throw","when","until"],m=c(k.concat(l));k=c(k);var n=new RegExp("^('{3}|\"{3}|['\"])"),o=new RegExp("^(/{3}|/)"),p=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],q=c(p),x={startState:function(a){return{tokenize:r,scopes:[{offset:a||0,type:"coffee"}],lastToken:null,lambda:!1,dedent:0}},token:function(a,b){var c=w(a,b);return b.lastToken={style:c,content:a.current()},a.eol()&&a.lambda&&(b.lambda=!1),c},indent:function(a,b){return a.tokenize!=r?0:a.scopes[0].offset}};return x}),CodeMirror.defineMIME("text/x-coffeescript","coffeescript"),CodeMirror.defineMode("css",function(a){function d(a,b){return c=b,a}function e(a,b){var c=a.next();if(c=="@")return a.eatWhile(/[\w\\\-]/),d("meta",a.current());if(c=="/"&&a.eat("*"))return b.tokenize=f,f(a,b);if(c=="<"&&a.eat("!"))return b.tokenize=g,g(a,b);if(c!="=")return c!="~"&&c!="|"||!a.eat("=")?c=='"'||c=="'"?(b.tokenize=h(c),b.tokenize(a,b)):c=="#"?(a.eatWhile(/[\w\\\-]/),d("atom","hash")):c=="!"?(a.match(/^\s*\w*/),d("keyword","important")):/\d/.test(c)?(a.eatWhile(/[\w.%]/),d("number","unit")):/[,.+>*\/]/.test(c)?d(null,"select-op"):/[;{}:\[\]]/.test(c)?d(null,c):(a.eatWhile(/[\w\\\-]/),d("variable","variable")):d(null,"compare");d(null,"compare")}function f(a,b){var c=!1,f;while((f=a.next())!=null){if(c&&f=="/"){b.tokenize=e;break}c=f=="*"}return d("comment","comment")}function g(a,b){var c=0,f;while((f=a.next())!=null){if(c>=2&&f==">"){b.tokenize=e;break}c=f=="-"?c+1:0}return d("comment","comment")}function h(a){return function(b,c){var f=!1,g;while((g=b.next())!=null){if(g==a&&!f)break;f=!f&&g=="\\"}return f||(c.tokenize=e),d("string","string")}}var b=a.indentUnit,c;return{startState:function(a){return{tokenize:e,baseIndent:a||0,stack:[]}},token:function(a,b){if(a.eatSpace())return null;var d=b.tokenize(a,b),e=b.stack[b.stack.length-1];if(c=="hash"&&e!="rule")d="string-2";else if(d=="variable")if(e=="rule")d="number";else if(!e||e=="@media{")d="tag";return e=="rule"&&/^[\{\};]$/.test(c)&&b.stack.pop(),c=="{"?e=="@media"?b.stack[b.stack.length-1]="@media{":b.stack.push("{"):c=="}"?b.stack.pop():c=="@media"?b.stack.push("@media"):e=="{"&&c!="comment"&&b.stack.push("rule"),d},indent:function(a,c){var d=a.stack.length;return/^\}/.test(c)&&(d-=a.stack[a.stack.length-1]=="rule"?2:1),a.baseIndent+d*b},electricChars:"}"}}),CodeMirror.defineMIME("text/css","css"),CodeMirror.defineMode("htmlembedded",function(a,b){function g(a,b){return a.match(c,!1)?(b.token=h,e.token(a,b.scriptState)):f.token(a,b.htmlState)}function h(a,b){return a.match(d,!1)?(b.token=g,f.token(a,b.htmlState)):e.token(a,b.scriptState)}var c=b.scriptStartRegex||/^<%/i,d=b.scriptEndRegex||/^%>/i,e,f;return{startState:function(){return e=e||CodeMirror.getMode(a,b.scriptingModeSpec),f=f||CodeMirror.getMode(a,"htmlmixed"),{token:b.startOpen?h:g,htmlState:f.startState(),scriptState:e.startState()}},token:function(a,b){return b.token(a,b)},indent:function(a,b){return a.token==g?f.indent(a.htmlState,b):e.indent(a.scriptState,b)},copyState:function(a){return{token:a.token,htmlState:CodeMirror.copyState(f,a.htmlState),scriptState:CodeMirror.copyState(e,a.scriptState)}},electricChars:"/{}:"}}),CodeMirror.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),CodeMirror.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),CodeMirror.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),CodeMirror.defineMode("htmlmixed",function(a,b){function f(a,b){var f=c.token(a,b.htmlState);return f=="tag"&&a.current()==">"&&b.htmlState.context&&(/^script$/i.test(b.htmlState.context.tagName)?(b.token=h,b.localState=d.startState(c.indent(b.htmlState,"")),b.mode="javascript"):/^style$/i.test(b.htmlState.context.tagName)&&(b.token=i,b.localState=e.startState(c.indent(b.htmlState,"")),b.mode="css")),f}function g(a,b,c){var d=a.current(),e=d.search(b);return e>-1&&a.backUp(d.length-e),c}function h(a,b){return a.match(/^<\/\s*script\s*>/i,!1)?(b.token=f,b.curState=null,b.mode="html",f(a,b)):g(a,/<\/\s*script\s*>/,d.token(a,b.localState))}function i(a,b){return a.match(/^<\/\s*style\s*>/i,!1)?(b.token=f,b.localState=null,b.mode="html",f(a,b)):g(a,/<\/\s*style\s*>/,e.token(a,b.localState))}var c=CodeMirror.getMode(a,{name:"xml",htmlMode:!0}),d=CodeMirror.getMode(a,"javascript"),e=CodeMirror.getMode(a,"css");return{startState:function(){var a=c.startState();return{token:f,localState:null,mode:"html",htmlState:a}},copyState:function(a){if(a.localState)var b=CodeMirror.copyState(a.token==i?e:d,a.localState);return{token:a.token,localState:b,mode:a.mode,htmlState:CodeMirror.copyState(c,a.htmlState)}},token:function(a,b){return b.token(a,b)},indent:function(a,b){return a.token==f||/^\s*<\//.test(b)?c.indent(a.htmlState,b):a.token==h?d.indent(a.localState,b):e.indent(a.localState,b)},compareStates:function(a,b){return c.compareStates(a.htmlState,b.htmlState)},electricChars:"/{}:"}}),CodeMirror.defineMIME("text/html","htmlmixed"),CodeMirror.defineMode("javascript",function(a,b){function g(a,b,c){return b.tokenize=c,c(a,b)}function h(a,b){var c=!1,d;while((d=a.next())!=null){if(d==b&&!c)return!1;c=!c&&d=="\\"}return c}function k(a,b,c){return i=a,j=c,b}function l(a,b){var c=a.next();if(c=='"'||c=="'")return g(a,b,m(c));if(/[\[\]{}\(\),;\:\.]/.test(c))return k(c);if(c=="0"&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),k("number","number");if(/\d/.test(c))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),k("number","number");if(c=="/")return a.eat("*")?g(a,b,n):a.eat("/")?(a.skipToEnd(),k("comment","comment")):b.reAllowed?(h(a,"/"),a.eatWhile(/[gimy]/),k("regexp","string-2")):(a.eatWhile(f),k("operator",null,a.current()));if(c=="#")return a.skipToEnd(),k("error","error");if(f.test(c))return a.eatWhile(f),k("operator",null,a.current());a.eatWhile(/[\w\$_]/);var d=a.current(),i=e.propertyIsEnumerable(d)&&e[d];return i&&b.kwAllowed?k(i.type,i.style,d):k("variable","variable",d)}function m(a){return function(b,c){return h(b,a)||(c.tokenize=l),k("string","string")}}function n(a,b){var c=!1,d;while(d=a.next()){if(d=="/"&&c){b.tokenize=l;break}c=d=="*"}return k("comment","comment")}function p(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,d!=null&&(this.align=d)}function q(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0}function r(a,b,c,e,f){var g=a.cc;s.state=a,s.stream=f,s.marked=null,s.cc=g,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);for(;;){var h=g.length?g.pop():d?D:C;if(h(c,e)){while(g.length&&g[g.length-1].lex)g.pop()();return s.marked?s.marked:c=="variable"&&q(a,e)?"variable-2":b}}}function t(){for(var a=arguments.length-1;a>=0;a--)s.cc.push(arguments[a])}function u(){return t.apply(null,arguments),!0}function v(a){var b=s.state;if(b.context){s.marked="def";for(var c=b.localVars;c;c=c.next)if(c.name==a)return;b.localVars={name:a,next:b.localVars}}}function x(){s.state.context||(s.state.localVars=w),s.state.context={prev:s.state.context,vars:s.state.localVars}}function y(){s.state.localVars=s.state.context.vars,s.state.context=s.state.context.prev}function z(a,b){var c=function(){var c=s.state;c.lexical=new p(c.indented,s.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function A(){var a=s.state;a.lexical.prev&&(a.lexical.type==")"&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function B(a){return function(c){return c==a?u():a==";"?t():u(arguments.callee)}}function C(a){return a=="var"?u(z("vardef"),L,B(";"),A):a=="keyword a"?u(z("form"),D,C,A):a=="keyword b"?u(z("form"),C,A):a=="{"?u(z("}"),K,A):a==";"?u():a=="function"?u(R):a=="for"?u(z("form"),B("("),z(")"),N,B(")"),A,C,A):a=="variable"?u(z("stat"),G):a=="switch"?u(z("form"),D,z("}","switch"),B("{"),K,A,A):a=="case"?u(D,B(":")):a=="default"?u(B(":")):a=="catch"?u(z("form"),x,B("("),S,B(")"),C,A,y):t(z("stat"),D,B(";"),A)}function D(a){return o.hasOwnProperty(a)?u(F):a=="function"?u(R):a=="keyword c"?u(E):a=="("?u(z(")"),E,B(")"),A,F):a=="operator"?u(D):a=="["?u(z("]"),J(D,"]"),A,F):a=="{"?u(z("}"),J(I,"}"),A,F):u()}function E(a){return a.match(/[;\}\)\],]/)?t():t(D)}function F(a,b){if(a=="operator"&&/\+\+|--/.test(b))return u(F);if(a=="operator")return u(D);if(a==";")return;if(a=="(")return u(z(")"),J(D,")"),A,F);if(a==".")return u(H,F);if(a=="[")return u(z("]"),D,B("]"),A,F)}function G(a){return a==":"?u(A,C):t(F,B(";"),A)}function H(a){if(a=="variable")return s.marked="property",u()}function I(a){a=="variable"&&(s.marked="property");if(o.hasOwnProperty(a))return u(B(":"),D)}function J(a,b){function c(d){return d==","?u(a,c):d==b?u():u(B(b))}return function(e){return e==b?u():t(a,c)}}function K(a){return a=="}"?u():t(C,K)}function L(a,b){return a=="variable"?(v(b),u(M)):u()}function M(a,b){if(b=="=")return u(D,M);if(a==",")return u(L)}function N(a){return a=="var"?u(L,P):a==";"?t(P):a=="variable"?u(O):t(P)}function O(a,b){return b=="in"?u(D):u(F,P)}function P(a,b){return a==";"?u(Q):b=="in"?u(D):u(D,B(";"),Q)}function Q(a){a!=")"&&u(D)}function R(a,b){if(a=="variable")return v(b),u(R);if(a=="(")return u(z(")"),x,J(S,")"),A,C,y)}function S(a,b){if(a=="variable")return v(b),u()}var c=a.indentUnit,d=b.json,e=function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("operator"),f={type:"atom",style:"atom"};return{"if":b,"while":b,"with":b,"else":c,"do":c,"try":c,"finally":c,"return":d,"break":d,"continue":d,"new":d,"delete":d,"throw":d,"var":a("var"),"const":a("var"),let:a("var"),"function":a("function"),"catch":a("catch"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":e,"typeof":e,"instanceof":e,"true":f,"false":f,"null":f,"undefined":f,NaN:f,Infinity:f}}(),f=/[+\-*&%=<>!?|]/,i,j,o={atom:!0,number:!0,variable:!0,string:!0,regexp:!0},s={state:null,column:null,marked:null,cc:null},w={name:"this",next:{name:"arguments"}};return A.lex=!0,{startState:function(a){return{tokenize:l,reAllowed:!0,kwAllowed:!0,cc:[],lexical:new p((a||0)-c,0,"block",!1),localVars:null,context:null,indented:0}},token:function(a,b){a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation());if(a.eatSpace())return null;var c=b.tokenize(a,b);return i=="comment"?c:(b.reAllowed=i=="operator"||i=="keyword c"||!!i.match(/^[\[{}\(,;:]$/),b.kwAllowed=i!=".",r(b,c,i,j,a))},indent:function(a,b){if(a.tokenize!=l)return 0;var d=b&&b.charAt(0),e=a.lexical,f=e.type,g=d==f;return f=="vardef"?e.indented+4:f=="form"&&d=="{"?e.indented:f=="stat"||f=="form"?e.indented+c:e.info=="switch"&&!g?e.indented+(/^(?:case|default)\b/.test(b)?c:2*c):e.align?e.column+(g?0:1):e.indented+(g?0:c)},electricChars:":{}"}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMode("ruby",function(a,b){function c(a){var b={};for(var c=0,d=a.length;c<d;++c)b[a[c]]=!0;return b}function i(a,b,c){return c.tokenize.push(a),a(b,c)}function j(a,b){h=null;if(a.sol()&&a.match("=begin")&&a.eol())return b.tokenize.push(n),"comment";if(a.eatSpace())return null;var c=a.next();if(c=="`"||c=="'"||c=='"'||c=="/"&&!a.eol()&&a.peek()!=" ")return i(l(c,"string",c=='"'||c=="`"),a,b);if(c=="%"){var d,e=!1;a.eat("s")?d="atom":a.eat(/[WQ]/)?(d="string",e=!0):a.eat(/[wxqr]/)&&(d="string");var f=a.eat(/[^\w\s]/);return f?(g.propertyIsEnumerable(f)&&(f=g[f]),i(l(f,d,e,!0),a,b)):"operator"}if(c=="#")return a.skipToEnd(),"comment";if(c=="<"&&a.eat("<")){a.eat("-"),a.eat(/[\'\"\`]/);var j=a.match(/^\w+/);return a.eat(/[\'\"\`]/),j?i(m(j[0]),a,b):null}if(c=="0")return a.eat("x")?a.eatWhile(/[\da-fA-F]/):a.eat("b")?a.eatWhile(/[01]/):a.eatWhile(/[0-7]/),"number";if(/\d/.test(c))return a.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if(c=="?"){while(a.match(/^\\[CM]-/));return a.eat("\\")?a.eatWhile(/\w/):a.next(),"string"}return c==":"?a.eat("'")?i(l("'","atom",!1),a,b):a.eat('"')?i(l('"',"atom",!0),a,b):(a.eatWhile(/[\w\?]/),"atom"):c=="@"?(a.eat("@"),a.eatWhile(/[\w\?]/),"variable-2"):c=="$"?(a.next(),a.eatWhile(/[\w\?]/),"variable-3"):/\w/.test(c)?(a.eatWhile(/[\w\?]/),a.eat(":")?"atom":"ident"):c!="|"||!b.varList&&b.lastTok!="{"&&b.lastTok!="do"?/[\(\)\[\]{}\\;]/.test(c)?(h=c,null):c=="-"&&a.eat(">")?"arrow":/[=+\-\/*:\.^%<>~|]/.test(c)?(a.eatWhile(/[=+\-\/*:\.^%<>~|]/),"operator"):null:(h="|",null)}function k(){var a=1;return function(b,c){if(b.peek()=="}"){a--;if(a==0)return c.tokenize.pop(),c.tokenize[c.tokenize.length-1](b,c)}else b.peek()=="{"&&a++;return j(b,c)}}function l(a,b,c,d){return function(e,f){var g=!1,h;while((h=e.next())!=null){if(h==a&&(d||!g)){f.tokenize.pop();break}if(c&&h=="#"&&!g&&e.eat("{")){f.tokenize.push(k(arguments.callee));break}g=!g&&h=="\\"}return b}}function m(a){return function(b,c){return b.match(a)?c.tokenize.pop():b.skipToEnd(),"string"}}function n(a,b){return a.sol()&&a.match("=end")&&a.eol()&&b.tokenize.pop(),a.skipToEnd(),"comment"}var d=c(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload"]),e=c(["def","class","case","for","while","do","module","then","catch","loop","proc","begin"]),f=c(["end","until"]),g={"[":"]","{":"}","(":")"},h;return{startState:function(){return{tokenize:[j],indented:0,context:{type:"top",indented:-a.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(a,b){a.sol()&&(b.indented=a.indentation());var c=b.tokenize[b.tokenize.length-1](a,b),g;if(c=="ident"){var i=a.current();c=d.propertyIsEnumerable(a.current())?"keyword":/^[A-Z]/.test(i)?"tag":b.lastTok=="def"||b.lastTok=="class"||b.varList?"def":"variable",e.propertyIsEnumerable(i)?g="indent":f.propertyIsEnumerable(i)?g="dedent":(i=="if"||i=="unless")&&a.column()==a.indentation()&&(g="indent")}if(h||c&&c!="comment")b.lastTok=i||h||c;return h=="|"&&(b.varList=!b.varList),g=="indent"||/[\(\[\{]/.test(h)?b.context={prev:b.context,type:h||c,indented:b.indented}:(g=="dedent"||/[\)\]\}]/.test(h))&&b.context.prev&&(b.context=b.context.prev),a.eol()&&(b.continuedLine=h=="\\"||c=="operator"),c},indent:function(b,c){if(b.tokenize[b.tokenize.length-1]!=j)return 0;var d=c&&c.charAt(0),e=b.context,f=e.type==g[d]||e.type=="keyword"&&/^(?:end|until|else|elsif|when|rescue)\b/.test(c);return e.indented+(f?0:a.indentUnit)+(b.continuedLine?a.indentUnit:0)},electricChars:"}de"}}),CodeMirror.defineMIME("text/x-ruby","ruby"),CodeMirror.defineMode("xml",function(a,b){function h(a,b){function c(c){return b.tokenize=c,c(a,b)}var d=a.next();if(d=="<"){if(a.eat("!"))return a.eat("[")?a.match("CDATA[")?c(k("atom","]]>")):null:a.match("--")?c(k("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),c(l(1))):null;if(a.eat("?"))return a.eatWhile(/[\w\._\-]/),b.tokenize=k("meta","?>"),"meta";g=a.eat("/")?"closeTag":"openTag",a.eatSpace(),f="";var e;while(e=a.eat(/[^\s\u00a0=<>\"\'\/?]/))f+=e;return b.tokenize=i,"tag"}if(d=="&"){var h;return a.eat("#")?a.eat("x")?h=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):h=a.eatWhile(/[\d]/)&&a.eat(";"):h=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),h?"atom":"error"}return a.eatWhile(/[^&<]/),null}function i(a,b){var c=a.next();return c==">"||c=="/"&&a.eat(">")?(b.tokenize=h,g=c==">"?"endTag":"selfcloseTag","tag"):c=="="?(g="equals",null):/[\'\"]/.test(c)?(b.tokenize=j(c),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function j(a){return function(b,c){while(!b.eol())if(b.next()==a){c.tokenize=i;break}return"string"}}function k(a,b){return function(c,d){while(!c.eol()){if(c.match(b)){d.tokenize=h;break}c.next()}return a}}function l(a){return function(b,c){var d;while((d=b.next())!=null){if(d=="<")return c.tokenize=l(a+1),c.tokenize(b,c);if(d==">"){if(a==1){c.tokenize=h;break}return c.tokenize=l(a-1),c.tokenize(b,c)}}return"meta"}}function o(){for(var a=arguments.length-1;a>=0;a--)m.cc.push(arguments[a])}function p(){return o.apply(null,arguments),!0}function q(a,b){var c=d.doNotIndent.hasOwnProperty(a)||m.context&&m.context.noIndent;m.context={prev:m.context,tagName:a,indent:m.indented,startOfLine:b,noIndent:c}}function r(){m.context&&(m.context=m.context.prev)}function s(a){if(a=="openTag")return m.tagName=f,p(v,t(m.startOfLine));if(a=="closeTag"){var b=!1;return m.context?b=m.context.tagName!=f:b=!0,b&&(n="error"),p(u(b))}return p()}function t(a){return function(b){return b=="selfcloseTag"||b=="endTag"&&d.autoSelfClosers.hasOwnProperty(m.tagName.toLowerCase())?p():b=="endTag"?(q(m.tagName,a),p()):p()}}function u(a){return function(b){return a&&(n="error"),b=="endTag"?(r(),p()):(n="error",p(arguments.callee))}}function v(a){return a=="word"?(n="attribute",p(w,v)):a=="endTag"||a=="selfcloseTag"?o():(n="error",p(v))}function w(a){return a=="equals"?p(x,v):(d.allowMissing||(n="error"),a=="endTag"||a=="selfcloseTag"?o():p())}function x(a){return a=="string"?p(y):a=="word"&&d.allowUnquoted?(n="string",p()):(n="error",a=="endTag"||a=="selfCloseTag"?o():p())}function y(a){return a=="string"?p(y):o()}var c=a.indentUnit,d=b.htmlMode?{autoSelfClosers:{br:!0,img:!0,hr:!0,link:!0,input:!0,meta:!0,col:!0,frame:!0,base:!0,area:!0},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!1}:{autoSelfClosers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},e=b.alignCDATA,f,g,m,n;return{startState:function(){return{tokenize:h,cc:[],indented:0,startOfLine:!0,tagName:null,context:null}},token:function(a,b){a.sol()&&(b.startOfLine=!0,b.indented=a.indentation());if(a.eatSpace())return null;n=g=f=null;var c=b.tokenize(a,b);b.type=g;if((c||g)&&c!="comment"){m=b;for(;;){var d=b.cc.pop()||s;if(d(g||c))break}}return b.startOfLine=!1,n||c},indent:function(a,b,d){var f=a.context;if(a.tokenize!=i&&a.tokenize!=h||f&&f.noIndent)return d?d.match(/^(\s*)/)[0].length:0;if(e&&/<!\[CDATA\[/.test(b))return 0;f&&/^<\//.test(b)&&(f=f.prev);while(f&&!f.startOfLine)f=f.prev;return f?f.indent+c:0},compareStates:function(a,b){if(a.indented!=b.indented||a.tokenize!=b.tokenize)return!1;for(var c=a.context,d=b.context;;c=c.prev,d=d.prev){if(!c||!d)return c==d;if(c.tagName!=d.tagName)return!1}},electricChars:"/"}}),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0}),CodeMirror.defineMode("yaml",function(){var a=["true","false","on","off","yes","no"],b=new RegExp("\\b(("+a.join(")|(")+"))$","i");return{token:function(a,c){var d=a.peek(),e=c.escaped;c.escaped=!1;if(d=="#")return a.skipToEnd(),"comment";if(c.literal&&a.indentation()>c.keyCol)return a.skipToEnd(),"string";c.literal&&(c.literal=!1);if(a.sol()){c.keyCol=0,c.pair=!1,c.pairStart=!1;if(a.match(/---/))return"def";if(a.match(/\.\.\./))return"def";if(a.match(/\s*-\s+/))return"meta"}if(!c.pair&&a.match(/^\s*([a-z0-9\._-])+(?=\s*:)/i))return c.pair=!0,c.keyCol=a.indentation(),"atom";if(c.pair&&a.match(/^:\s*/))return c.pairStart=!0,"meta";if(a.match(/^(\{|\}|\[|\])/))return d=="{"?c.inlinePairs++:d=="}"?c.inlinePairs--:d=="["?c.inlineList++:c.inlineList--,"meta";if(c.inlineList>0&&!e&&d==",")return a.next(),"meta";if(c.inlinePairs>0&&!e&&d==",")return c.keyCol=0,c.pair=!1,c.pairStart=!1,a.next(),"meta";if(c.pairStart){if(a.match(/^\s*(\||\>)\s*/))return c.literal=!0,"meta";if(a.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(c.inlinePairs==0&&a.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(c.inlinePairs>0&&a.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(a.match(b))return"keyword"}return c.pairStart=!1,c.escaped=d=="\\",a.next(),null},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),CodeMirror.defineMIME("text/x-yaml","yaml"),CodeMirror.overlayParser=function(a,b,c){return{startState:function(){return{base:CodeMirror.startState(a),overlay:CodeMirror.startState(b),basePos:0,baseCur:null,overlayPos:0,overlayCur:null}},copyState:function(c){return{base:CodeMirror.copyState(a,c.base),overlay:CodeMirror.copyState(b,c.overlay),basePos:c.basePos,baseCur:null,overlayPos:c.overlayPos,overlayCur:null}},token:function(d,e){return d.start==e.basePos&&(e.baseCur=a.token(d,e.base),e.basePos=d.pos),d.start==e.overlayPos&&(d.pos=d.start,e.overlayCur=b.token(d,e.overlay),e.overlayPos=d.pos),d.pos=Math.min(e.basePos,e.overlayPos),d.eol()&&(e.basePos=e.overlayPos=0),e.overlayCur==null?e.baseCur:e.baseCur!=null&&c?e.baseCur+" "+e.overlayCur:e.overlayCur},indent:function(b,c){return a.indent(b.base,c)},electricChars:a.electricChars}},function(){CodeMirror.simpleHint=function(a,b){function e(b){a.replaceRange(b,c.from,c.to)}function l(){if(k)return;k=!0,f.parentNode.removeChild(f)}function m(){e(d[g.selectedIndex]),l(),setTimeout(function(){a.focus()},50)}if(a.somethingSelected())return;var c=b(a);if(!c||!c.list.length)return;var d=c.list;if(d.length==1)return e(d[0]),!0;var f=document.createElement("div");f.className="CodeMirror-completions";var g=f.appendChild(document.createElement("select"));window.opera||(g.multiple=!0);for(var h=0;h<d.length;++h){var i=g.appendChild(document.createElement("option"));i.appendChild(document.createTextNode(d[h]))}g.firstChild.selected=!0,g.size=Math.min(10,d.length);var j=a.cursorCoords();f.style.left=j.x+"px",f.style.top=j.yBot+"px",document.body.appendChild(f),d.length<=10&&(f.style.width=g.clientWidth-1+"px");var k=!1;return CodeMirror.connect(g,"blur",l),CodeMirror.connect(g,"keydown",function(c){var d=c.keyCode;d==13?(CodeMirror.e_stop(c),m()):d==27?(CodeMirror.e_stop(c),l(),a.focus()):d!=38&&d!=40&&(l(),a.focus(),a.triggerOnKeyDown(c),setTimeout(function(){CodeMirror.simpleHint(a,b)},50))}),CodeMirror.connect(g,"dblclick",m),g.focus(),window.opera&&setTimeout(function(){k||g.focus()},100),!0}}(),function(){function b(b){a.push(b),a.length>50&&a.shift()}function c(){return a[a.length-1]||""}function d(){return a.length>1&&a.pop(),c()}var a=[];CodeMirror.keyMap.emacs={"Ctrl-X":function(a){a.setOption("keyMap","emacs-Ctrl-X")},"Ctrl-W":function(a){b(a.getSelection()),a.replaceSelection("")},"Ctrl-Alt-W":function(a){b(a.getSelection()),a.replaceSelection("")},"Alt-W":function(a){b(a.getSelection())},"Ctrl-Y":function(a){a.replaceSelection(c())},"Alt-Y":function(a){a.replaceSelection(d())},"Ctrl-/":"undo","Shift-Ctrl--":"undo","Shift-Alt-,":"goDocStart","Shift-Alt-.":"goDocEnd","Ctrl-S":"findNext","Ctrl-R":"findPrev","Ctrl-G":"clearSearch","Shift-Alt-5":"replace","Ctrl-Z":"undo","Cmd-Z":"undo",fallthrough:["basic","emacsy"]},CodeMirror.keyMap["emacs-Ctrl-X"]={"Ctrl-S":"save","Ctrl-W":"save",S:"saveAll",F:"open",U:"undo",K:"close",auto:"emacs",catchall:function(a){}}}(),function(){function f(){c=""}function g(a){c+=a}function h(b){return function(c){a+=b}}function i(){var b=parseInt(a);return a="",b||1}function j(a){return typeof a=="string"&&(a=CodeMirror.commands[a]),function(b){for(var c=0,d=i();c<d;++c)a(b)}}function k(a,b){for(var c in a)a.hasOwnProperty(c)&&b(c,a[c])}function n(a,b,c,d){var e=0,f=-1;c>0&&(e=a.length,f=0);var g=e,h=e;a:for(;b!=e;b+=c)for(var i=0;i<d.length;++i)if(d[i].test(a.charAt(b+f))){g=b;for(;b!=e;b+=c)if(!d[i].test(a.charAt(b+f)))break;h=b;break a}return{from:Math.min(g,h),to:Math.max(g,h)}}function o(a,b,c,d){var e=a.getCursor(),f=e.ch,g=a.getLine(e.line),h;for(;;){h=n(g,f,c,b),f=h[d=="end"?"to":"from"];if(f!=e.ch||h.from==h.to)break;f=h[c<0?"from":"to"]}a.setCursor(e.line,h[d=="end"?"to":"from"],!0)}function p(a){var b=a.getCursor(),c=b.ch,d=a.getLine(b.line);CodeMirror.commands.goLineEnd(a),b.line!=a.lineCount()&&(CodeMirror.commands.goLineEnd(a),a.replaceSelection(" ","end"),CodeMirror.commands.delCharRight(a))}function q(a){a!="vim-insert"&&a!="vim"}function r(a,b){var c=e[b],d=a.getCursor().line,f=c>d?d:c,h=c>d?c:d;a.setCursor(f);for(var i=f;i<=h;i++)g("\n"+a.getLine(f)),a.removeLine(f)}function s(a,b){var c=e[b],d=a.getCursor().line,f=c>d?d:c,h=c>d?c:d;for(var i=f;i<=h;i++)g("\n"+a.getLine(i));a.setCursor(f)}var a="",b="f",c="",d=0,e=[],l=[/\w/,/[^\w\s]/],m=[/\S/],t=CodeMirror.keyMap.vim={0:function(b){a.length>0?h("0")(b):CodeMirror.commands.goLineStart(b)},A:function(a){i(),a.setCursor(a.getCursor().line,a.getCursor().ch+1,!0),a.setOption("keyMap","vim-insert"),q("vim-insert")},"Shift-A":function(a){i(),CodeMirror.commands.goLineEnd(a),a.setOption("keyMap","vim-insert"),q("vim-insert")},I:function(a){i(),a.setOption("keyMap","vim-insert"),q("vim-insert")},"Shift-I":function(a){i(),CodeMirror.commands.goLineStartSmart(a),a.setOption("keyMap","vim-insert"),q("vim-insert")},O:function(a){i(),CodeMirror.commands.goLineEnd(a),a.replaceSelection("\n","end"),a.setOption("keyMap","vim-insert"),q("vim-insert")},"Shift-O":function(a){i(),CodeMirror.commands.goLineStart(a),a.replaceSelection("\n","start"),a.setOption("keyMap","vim-insert"),q("vim-insert")},G:function(a){a.setOption("keyMap","vim-prefix-g")},D:function(a){a.setOption("keyMap","vim-prefix-d"),f()},M:function(a){a.setOption("keyMap","vim-prefix-m"),e=[]},Y:function(a){a.setOption("keyMap","vim-prefix-y"),f(),d=0},"/":function(a){var c=CodeMirror.commands.find;c&&c(a),b="f"},"Shift-/":function(a){var c=CodeMirror.commands.find;c&&(c(a),CodeMirror.commands.findPrev(a),b="r")},N:function(a){var c=CodeMirror.commands.findNext;c&&(b!="r"?c(a):CodeMirror.commands.findPrev(a))},"Shift-N":function(a){var c=CodeMirror.commands.findNext;c&&(b!="r"?CodeMirror.commands.findPrev(a):c.findNext(a))},"Shift-G":function(b){a==""?b.setCursor(b.lineCount()):b.setCursor(parseInt(a)-1),i(),CodeMirror.commands.goLineStart(b)},catchall:function(a){}};for(var u=1;u<10;++u)t[u]=h(u);k({H:"goColumnLeft",L:"goColumnRight",J:"goLineDown",K:"goLineUp",Left:"goColumnLeft",Right:"goColumnRight",Down:"goLineDown",Up:"goLineUp",Backspace:"goCharLeft",Space:"goCharRight",B:function(a){o(a,l,-1,"end")},E:function(a){o(a,l,1,"end")},W:function(a){o(a,l,1,"start")},"Shift-B":function(a){o(a,m,-1,"end")},"Shift-E":function(a){o(a,m,1,"end")},"Shift-W":function(a){o(a,m,1,"start")},X:function(a){CodeMirror.commands.delCharRight(a)},P:function(a){var b=a.getCursor().line;c!=""&&(CodeMirror.commands.goLineEnd(a),a.replaceSelection(c,"end")),a.setCursor(b+1)},"Shift-X":function(a){CodeMirror.commands.delCharLeft(a)},"Shift-J":function(a){p(a)},"Shift-`":function(a){var b=a.getCursor(),c=a.getRange({line:b.line,ch:b.ch},{line:b.line,ch:b.ch+1});c=c!=c.toLowerCase()?c.toLowerCase():c.toUpperCase(),a.replaceRange(c,{line:b.line,ch:b.ch},{line:b.line,ch:b.ch+1}),a.setCursor(b.line,b.ch+1)},"Ctrl-B":function(a){CodeMirror.commands.goPageUp(a)},"Ctrl-F":function(a){CodeMirror.commands.goPageDown(a)},"Ctrl-P":"goLineUp","Ctrl-N":"goLineDown",U:"undo","Ctrl-R":"redo","Shift-4":"goLineEnd"},function(a,b){t[a]=j(b)}),CodeMirror.keyMap["vim-prefix-g"]={E:j(function(a){o(a,l,-1,"start")}),"Shift-E":j(function(a){o(a,m,-1,"start")}),auto:"vim",catchall:function(a){}},CodeMirror.keyMap["vim-prefix-m"]={A:function(a){e.A=a.getCursor().line},"Shift-A":function(a){e["Shift-A"]=a.getCursor().line},B:function(a){e.B=a.getCursor().line},"Shift-B":function(a){e["Shift-B"]=a.getCursor().line},C:function(a){e.C=a.getCursor().line},"Shift-C":function(a){e["Shift-C"]=a.getCursor().line},D:function(a){e.D=a.getCursor().line},"Shift-D":function(a){e["Shift-D"]=a.getCursor().line},E:function(a){e.E=a.getCursor().line},"Shift-E":function(a){e["Shift-E"]=a.getCursor().line},F:function(a){e.F=a.getCursor().line},"Shift-F":function(a){e["Shift-F"]=a.getCursor().line},G:function(a){e.G=a.getCursor().line},"Shift-G":function(a){e["Shift-G"]=a.getCursor().line},H:function(a){e.H=a.getCursor().line},"Shift-H":function(a){e["Shift-H"]=a.getCursor().line},I:function(a){e.I=a.getCursor().line},"Shift-I":function(a){e["Shift-I"]=a.getCursor().line},J:function(a){e.J=a.getCursor().line},"Shift-J":function(a){e["Shift-J"]=a.getCursor().line},K:function(a){e.K=a.getCursor().line},"Shift-K":function(a){e["Shift-K"]=a.getCursor().line},L:function(a){e.L=a.getCursor().line},"Shift-L":function(a){e["Shift-L"]=a.getCursor().line},M:function(a){e.M=a.getCursor().line},"Shift-M":function(a){e["Shift-M"]=a.getCursor().line},N:function(a){e.N=a.getCursor().line},"Shift-N":function(a){e["Shift-N"]=a.getCursor().line},O:function(a){e.O=a.getCursor().line},"Shift-O":function(a){e["Shift-O"]=a.getCursor().line},P:function(a){e.P=a.getCursor().line},"Shift-P":function(a){e["Shift-P"]=a.getCursor().line},Q:function(a){e.Q=a.getCursor().line},"Shift-Q":function(a){e["Shift-Q"]=a.getCursor().line},R:function(a){e.R=a.getCursor().line},"Shift-R":function(a){e["Shift-R"]=a.getCursor().line},S:function(a){e.S=a.getCursor().line},"Shift-S":function(a){e["Shift-S"]=a.getCursor().line},T:function(a){e.T=a.getCursor().line},"Shift-T":function(a){e["Shift-T"]=a.getCursor().line},U:function(a){e.U=a.getCursor().line},"Shift-U":function(a){e["Shift-U"]=a.getCursor().line},V:function(a){e.V=a.getCursor().line},"Shift-V":function(a){e["Shift-V"]=a.getCursor().line},W:function(a){e.W=a.getCursor().line},"Shift-W":function(a){e["Shift-W"]=a.getCursor().line},X:function(a){e.X=a.getCursor().line},"Shift-X":function(a){e["Shift-X"]=a.getCursor().line},Y:function(a){e.Y=a.getCursor().line},"Shift-Y":function(a){e["Shift-Y"]=a.getCursor().line},Z:function(a){e.Z=a.getCursor().line},"Shift-Z":function(a){e["Shift-Z"]=a.getCursor().line},auto:"vim",catchall:function(a){}},CodeMirror.keyMap["vim-prefix-d"]={D:j(function(a){g("\n"+a.getLine(a.getCursor().line)),a.removeLine(a.getCursor().line)}),"'":function(a){a.setOption("keyMap","vim-prefix-d'"),f()},auto:"vim",catchall:function(a){}},CodeMirror.keyMap["vim-prefix-d'"]={A:function(a){r(a,"A")},"Shift-A":function(a){r(a,"Shift-A")},B:function(a){r(a,"B")},"Shift-B":function(a){r(a,"Shift-B")},C:function(a){r(a,"C")},"Shift-C":function(a){r(a,"Shift-C")},D:function(a){r(a,"D")},"Shift-D":function(a){r(a,"Shift-D")},E:function(a){r(a,"E")},"Shift-E":function(a){r(a,"Shift-E")},F:function(a){r(a,"F")},"Shift-F":function(a){r(a,"Shift-F")},G:function(a){r(a,"G")},"Shift-G":function(a){r(a,"Shift-G")},H:function(a){r(a,"H")},"Shift-H":function(a){r(a,"Shift-H")},I:function(a){r(a,"I")},"Shift-I":function(a){r(a,"Shift-I")},J:function(a){r(a,"J")},"Shift-J":function(a){r(a,"Shift-J")},K:function(a){r(a,"K")},"Shift-K":function(a){r(a,"Shift-K")},L:function(a){r(a,"L")},"Shift-L":function(a){r(a,"Shift-L")},M:function(a){r(a,"M")},"Shift-M":function(a){r(a,"Shift-M")},N:function(a){r(a,"N")},"Shift-N":function(a){r(a,"Shift-N")},O:function(a){r(a,"O")},"Shift-O":function(a){r(a,"Shift-O")},P:function(a){r(a,"P")},"Shift-P":function(a){r(a,"Shift-P")},Q:function(a){r(a,"Q")},"Shift-Q":function(a){r(a,"Shift-Q")},R:function(a){r(a,"R")},"Shift-R":function(a){r(a,"Shift-R")},S:function(a){r(a,"S")},"Shift-S":function(a){r(a,"Shift-S")},T:function(a){r(a,"T")},"Shift-T":function(a){r(a,"Shift-T")},U:function(a){r(a,"U")},"Shift-U":function(a){r(a,"Shift-U")},V:function(a){r(a,"V")},"Shift-V":function(a){r(a,"Shift-V")},W:function(a){r(a,"W")},"Shift-W":function(a){r(a,"Shift-W")},X:function(a){r(a,"X")},"Shift-X":function(a){r(a,"Shift-X")},Y:function(a){r(a,"Y")},"Shift-Y":function(a){r(a,"Shift-Y")},Z:function(a){r(a,"Z")},"Shift-Z":function(a){r(a,"Shift-Z")},auto:"vim",catchall:function(a){}},CodeMirror.keyMap["vim-prefix-y'"]={A:function(a){s(a,"A")},"Shift-A":function(a){s(a,"Shift-A")},B:function(a){s(a,"B")},"Shift-B":function(a){s(a,"Shift-B")},C:function(a){s(a,"C")},"Shift-C":function(a){s(a,"Shift-C")},D:function(a){s(a,"D")},"Shift-D":function(a){s(a,"Shift-D")},E:function(a){s(a,"E")},"Shift-E":function(a){s(a,"Shift-E")},F:function(a){s(a,"F")},"Shift-F":function(a){s(a,"Shift-F")},G:function(a){s(a,"G")},"Shift-G":function(a){s(a,"Shift-G")},H:function(a){s(a,"H")},"Shift-H":function(a){s(a,"Shift-H")},I:function(a){s(a,"I")},"Shift-I":function(a){s(a,"Shift-I")},J:function(a){s(a,"J")},"Shift-J":function(a){s(a,"Shift-J")},K:function(a){s(a,"K")},"Shift-K":function(a){s(a,"Shift-K")},L:function(a){s(a,"L")},"Shift-L":function(a){s(a,"Shift-L")},M:function(a){s(a,"M")},"Shift-M":function(a){s(a,"Shift-M")},N:function(a){s(a,"N")},"Shift-N":function(a){s(a,"Shift-N")},O:function(a){s(a,"O")},"Shift-O":function(a){s(a,"Shift-O")},P:function(a){s(a,"P")},"Shift-P":function(a){s(a,"Shift-P")},Q:function(a){s(a,"Q")},"Shift-Q":function(a){s(a,"Shift-Q")},R:function(a){s(a,"R")},"Shift-R":function(a){s(a,"Shift-R")},S:function(a){s(a,"S")},"Shift-S":function(a){s(a,"Shift-S")},T:function(a){s(a,"T")},"Shift-T":function(a){s(a,"Shift-T")},U:function(a){s(a,"U")},"Shift-U":function(a){s(a,"Shift-U")},V:function(a){s(a,"V")},"Shift-V":function(a){s(a,"Shift-V")},W:function(a){s(a,"W")},"Shift-W":function(a){s(a,"Shift-W")},X:function(a){s(a,"X")},"Shift-X":function(a){s(a,"Shift-X")},Y:function(a){s(a,"Y")},"Shift-Y":function(a){s(a,"Shift-Y")},Z:function(a){s(a,"Z")},"Shift-Z":function(a){s(a,"Shift-Z")},auto:"vim",catchall:function(a){}},CodeMirror.keyMap["vim-prefix-y"]={Y:j(function(a){g("\n"+a.getLine(a.getCursor().line+d)),d++}),"'":function(a){a.setOption("keyMap","vim-prefix-y'"),f()},auto:"vim",catchall:function(a){}},CodeMirror.keyMap["vim-insert"]={Esc:function(a){a.setCursor(a.getCursor().line,a.getCursor().ch-1,!0),a.setOption("keyMap","vim"),q("vim")},"Ctrl-N":function(a){},"Ctrl-P":function(a){},fallthrough:["default"]}}()
@@ -0,0 +1,16 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require ./bootstrap
12
+ *= require_self
13
+ *= require ./bootstrap-responsive
14
+ */
15
+
16
+ body { padding-top: 60px; }