glebtv-ckeditor 4.0.1 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +63 -62
- data/app/assets/stylesheets/ckcontent.css +0 -0
- data/lib/ckeditor.rb +4 -3
- data/lib/ckeditor/engine.rb +1 -1
- data/lib/ckeditor/version.rb +2 -2
- data/vendor/assets/javascripts/ckeditor/CHANGES.md +27 -1
- data/vendor/assets/javascripts/ckeditor/README.md +1 -1
- data/vendor/assets/javascripts/ckeditor/build-config.js +10 -89
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +286 -329
- data/vendor/assets/javascripts/ckeditor/config.js.erb +3 -8
- data/vendor/assets/javascripts/ckeditor/lang/en.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/ru.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/CKCss/ckcss.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cs.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cy.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fa.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/km.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ku.js +6 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/nl.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pl.js +6 -5
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/pt-br.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/sv.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/th.js +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/vi.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.ckeditor.css +74 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.css +16 -10
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/AutoFormat.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/CommentSelectedRange.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/icons/UncommentSelectedRange.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/{util → addon/dialog}/dialog.js +76 -75
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +29 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/{util → addon/edit}/closetag.js +86 -85
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/{util → addon/edit}/continuelist.js +28 -28
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/{util → addon/edit}/matchbrackets.js +74 -63
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/{util → addon/foldcode}/foldcode.js +183 -182
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/autoFormatAll.js +43 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/{util → addon/format}/formatting.js +114 -108
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/match-highlighter.js +60 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/{util → addon/search}/search.js +131 -119
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/{util → addon/search}/searchcursor.js +131 -119
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.js +5384 -4553
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.modes.min.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.search-addons.min.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/css.js +465 -465
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/htmlmixed.js +104 -84
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/javascript.js +426 -411
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/xml.js +324 -324
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/af.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ar.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/bg.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/bn.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/bs.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ca.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/cs.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/cy.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/da.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/de.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/el.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/en-au.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/en-ca.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/en-gb.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/en.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/eo.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/es.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/et.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/eu.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fa.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fi.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fo.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fr-ca.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fr.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/gl.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/gu.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/he.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/hi.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/hr.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/hu.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/is.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/it.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ja.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ka.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/km.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ko.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ku.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/lt.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/lv.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/mk.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/mn.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ms.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/nb.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/nl.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/no.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/pl.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/pt-br.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/pt.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ro.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ru.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sk.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sl.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sr-latn.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sr.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sv.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/th.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/tr.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ug.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/uk.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/vi.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/zh-cn.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/zh.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +249 -103
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance-mobile.css +6 -6
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +76 -76
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/blackboard.css +25 -25
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +18 -18
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +25 -25
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/elegant.css +10 -10
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +21 -21
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +44 -44
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +28 -28
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/neat.css +9 -9
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +21 -21
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +21 -21
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +207 -207
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +26 -25
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +27 -27
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +46 -46
- data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +173 -173
- data/vendor/assets/javascripts/ckeditor/plugins/{MediaEmbed → mediaembed}/images/icon.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/{MediaEmbed → mediaembed}/plugin.js +16 -13
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/images/icon.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/de.js +5 -2
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/en.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/fr.js +9 -6
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/nl.js +4 -1
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/lang/ru.js +11 -8
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.js +161 -30
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.min.js +1 -4
- data/vendor/assets/javascripts/ckeditor/plugins/oembed/plugin.js +55 -59
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +11 -10
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fa.js +8 -9
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/fr.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ku.js +9 -10
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/pl.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/th.js +13 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +5 -3
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_opera.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +52 -196
- data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
- metadata +29 -203
- data/vendor/assets/javascripts/ckeditor/contents.css +0 -99
- data/vendor/assets/javascripts/ckeditor/lang/af.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/ar.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/bg.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/bn.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/bs.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/ca.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/cs.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/cy.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/da.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/de.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/el.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/en-au.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/eo.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/es.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/et.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/eu.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/fa.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/fi.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/fo.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/fr-ca.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/fr.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/gl.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/gu.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/he.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/hi.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/hr.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/hu.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/is.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/it.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/ja.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/ka.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/km.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/ko.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/ku.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/lt.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/lv.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/mk.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/mn.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/ms.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/nb.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/nl.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/no.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/pl.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/pt.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/ro.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/sk.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/sl.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/sr-latn.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/sr.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/sv.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/th.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/tr.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/ug.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/uk.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/vi.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +0 -5
- data/vendor/assets/javascripts/ckeditor/lang/zh.js +0 -5
- data/vendor/assets/javascripts/ckeditor/plugins/CKCss/CKCss.xml +0 -26
- data/vendor/assets/javascripts/ckeditor/plugins/CKCss/ckcss1.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/MediaEmbed/icons/mediaembed.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/sourcecodepro-regular.eot +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/sourcecodepro-regular.otf +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/sourcecodepro-regular.svg +0 -242
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/sourcecodepro-regular.ttf +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/sourcecodepro-regular.woff +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/util/colorize.js +0 -29
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/util/continuecomment.js +0 -36
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/util/dialog.css +0 -32
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/util/javascript-hint.js +0 -137
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/util/loadmode.js +0 -51
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/util/match-highlighter.js +0 -46
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/util/multiplex.js +0 -95
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/util/overlay.js +0 -59
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/util/pig-hint.js +0 -117
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/util/runmode-standalone.js +0 -90
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/util/runmode.js +0 -52
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/util/simple-hint.css +0 -16
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/util/simple-hint.js +0 -102
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/util/xml-hint.js +0 -131
- data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +0 -13
- data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +0 -9
- data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +0 -24
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +0 -8
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +0 -8
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +0 -8
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +0 -8
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +0 -8
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +0 -20
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +0 -8
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +0 -10
- data/vendor/assets/javascripts/ckeditor/plugins/forms/images/hiddenfield.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/htmlbuttons/docs/install.html +0 -93
- data/vendor/assets/javascripts/ckeditor/plugins/htmlbuttons/docs/styles.css +0 -59
- data/vendor/assets/javascripts/ckeditor/plugins/htmlbuttons/icon1.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/htmlbuttons/icon2.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/htmlbuttons/icon3.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/htmlbuttons/plugin.js +0 -71
- data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +0 -10
- data/vendor/assets/javascripts/ckeditor/plugins/iframe/images/placeholder.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +0 -10
- data/vendor/assets/javascripts/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/preview/preview.html +0 -10
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +0 -10
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embarrassed_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/envelope.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/heart.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/kiss.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tongue_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +0 -84
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +0 -10
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +0 -9
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +0 -9
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +0 -95
- data/vendor/assets/javascripts/ckeditor/samples/ajax.html +0 -82
- data/vendor/assets/javascripts/ckeditor/samples/api.html +0 -207
- data/vendor/assets/javascripts/ckeditor/samples/appendto.html +0 -57
- data/vendor/assets/javascripts/ckeditor/samples/assets/inlineall/logo.png +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/assets/outputxhtml/outputxhtml.css +0 -204
- data/vendor/assets/javascripts/ckeditor/samples/assets/posteddata.php +0 -59
- data/vendor/assets/javascripts/ckeditor/samples/assets/sample.css +0 -3
- data/vendor/assets/javascripts/ckeditor/samples/assets/sample.jpg +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/assets/uilanguages/languages.js +0 -7
- data/vendor/assets/javascripts/ckeditor/samples/divreplace.html +0 -141
- data/vendor/assets/javascripts/ckeditor/samples/index.html +0 -119
- data/vendor/assets/javascripts/ckeditor/samples/inlineall.html +0 -311
- data/vendor/assets/javascripts/ckeditor/samples/inlinebycode.html +0 -122
- data/vendor/assets/javascripts/ckeditor/samples/plugins/dialog/assets/my_dialog.js +0 -48
- data/vendor/assets/javascripts/ckeditor/samples/plugins/dialog/dialog.html +0 -187
- data/vendor/assets/javascripts/ckeditor/samples/plugins/enterkey/enterkey.html +0 -103
- data/vendor/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.fla +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.swf +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/swfobject.js +0 -18
- data/vendor/assets/javascripts/ckeditor/samples/plugins/htmlwriter/outputforflash.html +0 -280
- data/vendor/assets/javascripts/ckeditor/samples/plugins/htmlwriter/outputhtml.html +0 -237
- data/vendor/assets/javascripts/ckeditor/samples/plugins/magicline/magicline.html +0 -203
- data/vendor/assets/javascripts/ckeditor/samples/plugins/toolbar/toolbar.html +0 -200
- data/vendor/assets/javascripts/ckeditor/samples/plugins/wysiwygarea/fullpage.html +0 -71
- data/vendor/assets/javascripts/ckeditor/samples/readonly.html +0 -73
- data/vendor/assets/javascripts/ckeditor/samples/replacebyclass.html +0 -57
- data/vendor/assets/javascripts/ckeditor/samples/replacebycode.html +0 -56
- data/vendor/assets/javascripts/ckeditor/samples/sample.css +0 -333
- data/vendor/assets/javascripts/ckeditor/samples/sample.js +0 -5
- data/vendor/assets/javascripts/ckeditor/samples/sample_posteddata.php +0 -16
- data/vendor/assets/javascripts/ckeditor/samples/tabindex.html +0 -75
- data/vendor/assets/javascripts/ckeditor/samples/uicolor.html +0 -69
- data/vendor/assets/javascripts/ckeditor/samples/uilanguages.html +0 -119
- data/vendor/assets/javascripts/ckeditor/samples/xhtmlstyle.html +0 -219
@@ -0,0 +1 @@
|
|
1
|
+
window.CodeMirror=function(){"use strict";function n(t,i){var r,o,e,u,s;if(!(this instanceof n))return new n(t,i);this.options=i=i||{};for(r in rf)!i.hasOwnProperty(r)&&rf.hasOwnProperty(r)&&(i[r]=rf[r]);ce(i),o=typeof i.value=="string"?0:i.value.first,e=this.display=sl(t,o),e.wrapper.CodeMirror=this,ss(this),i.autofocus&&!oe&&w(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,draggingText:!1,highlight:new wo},os(this),i.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),u=i.value,typeof u=="string"&&(u=new k(i.value,i.mode)),f(this,ec)(this,u),p&&setTimeout(nt(wt,this,!0),20),ra(this);try{s=document.activeElement==e.input}catch(h){}s||i.autofocus&&!oe?setTimeout(nt(bt,this),20):de(this),f(this,function(){var n,t;for(n in gt)gt.propertyIsEnumerable(n)&>[n](this,i[n],fo);for(t=0;t<ff.length;++t)ff[t](this)})()}function sl(n,t){var r={},u=r.input=i("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none;"),f;return ft?u.style.width="1000px":u.setAttribute("wrap","off"),u.setAttribute("autocorrect","off"),u.setAttribute("autocapitalize","off"),r.inputDiv=i("div",[u],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),r.scrollbarH=i("div",[i("div",null,null,"height: 1px")],"CodeMirror-hscrollbar"),r.scrollbarV=i("div",[i("div",null,null,"width: 1px")],"CodeMirror-vscrollbar"),r.scrollbarFiller=i("div",null,"CodeMirror-scrollbar-filler"),r.lineDiv=i("div"),r.selectionDiv=i("div",null,null,"position: relative; z-index: 1"),r.cursor=i("div"," ","CodeMirror-cursor"),r.otherCursor=i("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"),r.measure=i("div",null,"CodeMirror-measure"),r.lineSpace=i("div",[r.measure,r.selectionDiv,r.lineDiv,r.cursor,r.otherCursor],null,"position: relative; outline: none"),r.mover=i("div",[i("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=i("div",[r.mover],"CodeMirror-sizer"),r.heightForcer=i("div"," ",null,"position: absolute; height: "+di+"px"),r.gutters=i("div",null,"CodeMirror-gutters"),r.lineGutter=null,f=i("div",[r.sizer,r.heightForcer,r.gutters],null,"position: relative; min-height: 100%"),r.scroller=i("div",[f],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=i("div",[r.inputDiv,r.scrollbarH,r.scrollbarV,r.scrollbarFiller,r.scroller],"CodeMirror"),fi&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),n.appendChild?n.appendChild(r.wrapper):n(r.wrapper),uu&&(u.style.width="0px"),ft||(r.scroller.draggable=!0),ee?(r.inputDiv.style.height="1px",r.inputDiv.style.position="absolute"):fi&&(r.scrollbarH.style.minWidth=r.scrollbarV.style.minWidth="18px"),r.viewOffset=r.lastSizeC=0,r.showingFrom=r.showingTo=t,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.prevInput="",r.alignWidgets=!1,r.pollingFast=!1,r.poll=new wo,r.draggingText=!1,r.cachedCharWidth=r.cachedTextHeight=null,r.measureLineCache=[],r.measureLineCachePos=0,r.inaccurateSelection=!1,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r}function fu(t){t.doc.mode=n.getMode(t.options,t.doc.modeOption),t.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),t.doc.frontier=t.doc.first,hu(t,100),t.state.modeGen++,t.curOp&&c(t)}function hl(n){n.options.lineWrapping?(n.display.wrapper.className+=" CodeMirror-wrap",n.display.sizer.style.minWidth=""):(n.display.wrapper.className=n.display.wrapper.className.replace(" CodeMirror-wrap",""),he(n)),es(n),c(n),oi(n),setTimeout(function(){hs(n.display,n.doc.height)},100)}function fs(n){var t=vu(n.display),i=n.options.lineWrapping,r=i&&Math.max(5,n.display.scroller.clientWidth/ia(n.display)-3);return function(u){return ti(n.doc,u)?0:i?(Math.ceil(u.text.length/r)||1)*t:t}}function es(n){var t=n.doc,i=fs(n);t.iter(function(n){var t=i(n);t!=n.height&&it(n,t)})}function cl(n){var t=tt[n.options.keyMap].style;n.display.wrapper.className=n.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(t?" cm-keymap-"+t:"")}function os(n){n.display.wrapper.className=n.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+n.options.theme.replace(/(^|\s)\s*/g," cm-s-"),oi(n)}function ir(n){ss(n),c(n)}function ss(n){var r=n.display.gutters,e=n.options.gutters,t,u,f;for(ne(r),t=0;t<e.length;++t)u=e[t],f=r.appendChild(i("div",null,"CodeMirror-gutter "+u)),u=="CodeMirror-linenumbers"&&(n.display.lineGutter=f,f.style.width=(n.display.lineNumWidth||1)+"px");r.style.display=t?"":"none"}function eu(n,t){var f,e,u,i;if(t.height==0)return 0;for(f=t.text.length,u=t;e=sf(u);)i=e.find(),u=r(n,i.from.line),f+=i.from.ch-i.to.ch;for(u=t;e=br(u);)i=e.find(),f-=u.text.length-i.from.ch,u=r(n,i.to.line),f+=u.text.length-i.to.ch;return f}function he(n){var t=n.display,i=n.doc;t.maxLine=r(i,i.first),t.maxLineLength=eu(i,t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=eu(i,n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}function ce(n){for(var i=!1,t=0;t<n.gutters.length;++t)n.gutters[t]=="CodeMirror-linenumbers"&&(n.lineNumbers?i=!0:n.gutters.splice(t--,1));!i&&n.lineNumbers&&n.gutters.push("CodeMirror-linenumbers")}function hs(n,t){var u=t+2*cu(n);n.sizer.style.minHeight=n.heightForcer.style.top=u+"px";var f=Math.max(u,n.scroller.scrollHeight),i=n.scroller.scrollWidth>n.scroller.clientWidth,r=f>n.scroller.clientHeight;r?(n.scrollbarV.style.display="block",n.scrollbarV.style.bottom=i?ie(n.measure)+"px":"0",n.scrollbarV.firstChild.style.height=f-n.scroller.clientHeight+n.scrollbarV.clientHeight+"px"):n.scrollbarV.style.display="",i?(n.scrollbarH.style.display="block",n.scrollbarH.style.right=r?ie(n.measure)+"px":"0",n.scrollbarH.firstChild.style.width=n.scroller.scrollWidth-n.scroller.clientWidth+n.scrollbarH.clientWidth+"px"):n.scrollbarH.style.display="",i&&r?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=n.scrollbarFiller.style.width=ie(n.measure)+"px"):n.scrollbarFiller.style.display="",ul&&ie(n.measure)===0&&(n.scrollbarV.style.minWidth=n.scrollbarH.style.minHeight=fl?"18px":"12px")}function le(n,t,i){var r=n.scroller.scrollTop,u=n.wrapper.clientHeight,f;return typeof i=="number"?r=i:i&&(r=i.top,u=i.bottom-i.top),r=Math.floor(r-cu(n)),f=Math.ceil(r+u),{from:vf(t,r),to:vf(t,f)}}function cs(n){var t=n.display,i,r,u;if(t.alignWidgets||t.gutters.firstChild&&n.options.fixedGutter){var f=ve(t)-t.scroller.scrollLeft+n.doc.scrollLeft,e=t.gutters.offsetWidth,o=f+"px";for(i=t.lineDiv.firstChild;i;i=i.nextSibling)if(i.alignable)for(r=0,u=i.alignable;r<u.length;++r)u[r].style.left=o;n.options.fixedGutter&&(t.gutters.style.left=f+e+"px")}}function ll(n){if(!n.options.lineNumbers)return!1;var u=n.doc,r=ae(n.options,u.first+u.size-1),t=n.display;if(r.length!=t.lineNumChars){var f=t.measure.appendChild(i("div",[i("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),e=f.firstChild.offsetWidth,o=f.offsetWidth-e;return t.lineGutter.style.width="",t.lineNumInnerWidth=Math.max(e,t.lineGutter.offsetWidth-o),t.lineNumWidth=t.lineNumInnerWidth+o,t.lineNumChars=t.lineNumInnerWidth?r.length:-1,t.lineGutter.style.width=t.lineNumWidth+"px",!0}return!1}function ae(n,t){return String(n.lineNumberFormatter(t+n.firstLineNumber))}function ve(n){return l(n.scroller).left-l(n.sizer).left}function ou(n,t,i){var u=n.display.showingFrom,f=n.display.showingTo,r=ls(n,t,i);return r&&(ut(n,"update",n),(n.display.showingFrom!=u||n.display.showingTo!=f)&&ut(n,"viewportChange",n,n.display.showingFrom,n.display.showingTo)),pe(n),hs(n.display,n.doc.height),r}function ls(n,t,i){var u=n.display,e=n.doc,y,et,g,c,ot,nt,b,s,k,st,tt,a,v,rt,ut,ft,p,f;if(!u.wrapper.clientWidth){u.showingFrom=u.showingTo=e.first,u.viewOffset=0;return}if(y=le(u,e,i),t.length!=0||!(y.from>u.showingFrom)||!(y.to<u.showingTo)){if(ll(n)&&(t=[{from:e.first,to:e.first+e.size}]),et=u.sizer.style.marginLeft=u.gutters.offsetWidth+"px",u.scrollbarH.style.left=n.options.fixedGutter?et:"0",g=Infinity,n.options.lineNumbers)for(f=0;f<t.length;++f)if(t[f].diff){g=t[f].from;break}var w=e.first+e.size,h=Math.max(y.from-n.options.viewportMargin,e.first),o=Math.min(w,y.to+n.options.viewportMargin);if(u.showingFrom<h&&h-u.showingFrom<20&&(h=Math.max(e.first,u.showingFrom)),u.showingTo>o&&u.showingTo-o<20&&(o=Math.min(w,u.showingTo)),tr)for(h=d(yi(e,r(e,h)));o<w&&ti(e,r(e,o));)++o;if(c=[{from:Math.max(u.showingFrom,e.first),to:Math.min(u.showingTo,w)}],c=c[0].from>=c[0].to?[]:al(c,t),tr)for(f=0;f<c.length;++f)for(s=c[f];ot=br(r(e,s.to-1));)if(nt=ot.find().from.line,nt>s.from)s.to=nt;else{c.splice(f--,1);break}for(b=0,f=0;f<c.length;++f)s=c[f],s.from<h&&(s.from=h),s.to>o&&(s.to=o),s.from>=s.to?c.splice(f--,1):b+=s.to-s.from;if(b==o-h&&h==u.showingFrom&&o==u.showingTo){as(n);return}for(c.sort(function(n,t){return n.from-t.from}),k=document.activeElement,b<(o-h)*.7&&(u.lineDiv.style.display="none"),yl(n,h,o,c,g),u.lineDiv.style.display="",document.activeElement!=k&&k.offsetHeight&&k.focus(),st=h!=u.showingFrom||o!=u.showingTo||u.lastSizeC!=u.wrapper.clientHeight,st&&(u.lastSizeC=u.wrapper.clientHeight),u.showingFrom=h,u.showingTo=o,hu(n,100),tt=u.lineDiv.offsetTop,a=u.lineDiv.firstChild;a;a=a.nextSibling)if(a.lineObj&&(fi?(rt=a.offsetTop+a.offsetHeight,v=rt-tt,tt=rt):(ut=l(a),v=ut.bottom-ut.top),ft=a.lineObj.height-v,v<2&&(v=vu(u)),(ft>.001||ft<-.001)&&(it(a.lineObj,v),p=a.lineObj.widgets,p)))for(f=0;f<p.length;++f)p[f].height=p[f].node.offsetHeight;return as(n),le(u,e,i).to>o&&ls(n,[],i),!0}}function as(n){var t=n.display.viewOffset=bi(n,r(n.doc,n.display.showingFrom));n.display.mover.style.top=t+"px"}function al(n,t){for(var o,h,i,f=0,s=t.length||0;f<s;++f){var r=t[f],u=[],e=r.diff||0;for(o=0,h=n.length;o<h;++o)i=n[o],r.to<=i.from&&r.diff?u.push({from:i.from+e,to:i.to+e}):r.to<=i.from||r.from>=i.to?u.push(i):(r.from>i.from&&u.push({from:i.from,to:r.from}),r.to<i.to&&u.push({from:r.to+e,to:i.to+e}));n=u}return n}function vl(n){for(var i=n.display,u={},f={},t=i.gutters.firstChild,r=0;t;t=t.nextSibling,++r)u[n.options.gutters[r]]=t.offsetLeft,f[n.options.gutters[r]]=t.offsetWidth;return{fixedPos:ve(i),gutterTotalWidth:i.gutters.offsetWidth,gutterLeft:u,gutterWidth:f,wrapperWidth:i.wrapper.clientWidth}}function yl(n,t,r,u,f){function c(t){var i=t.nextSibling;return ft&&ei&&n.display.currentWheelTarget==t?(t.style.display="none",t.lineObj=null):t.parentNode.removeChild(t),i}var l=vl(n),a=n.display,v=n.options.lineNumbers,h,e,s,o;for(u.length||ft&&n.display.currentWheelTarget||ne(a.lineDiv),h=a.lineDiv,e=h.firstChild,s=u.shift(),o=t,n.doc.iter(t,r,function(t){var y,r,p,d,k,a,w,b;if(s&&s.to==o&&(s=u.shift()),ti(n.doc,t)){if(t.height!=0&&it(t,0),t.widgets&&e.previousSibling)for(y=0;y<t.widgets.length;++y)t.widgets[y].showIfHidden&&(r=e.previousSibling,/pre/i.test(r.nodeName)&&(p=i("div",null,null,"position: relative"),r.parentNode.replaceChild(p,r),p.appendChild(r),r=p),d=r.appendChild(i("div",[t.widgets[y].node],"CodeMirror-linewidget")),ye(t.widgets[y],d,r,l))}else if(s&&s.from<=o&&s.to>o){while(e.lineObj!=t)e=c(e);v&&f<=o&&e.lineNumber&&kc(e.lineNumber,ae(n.options,o)),e=e.nextSibling}else{if(t.widgets)for(k=0,a=e;a&&k<20;++k,a=a.nextSibling)if(a.lineObj==t&&/div/i.test(a.nodeName)){w=a;break}if(b=pl(n,t,o,l,w),b!=w)h.insertBefore(b,e);else{while(e!=w)e=c(e);e=e.nextSibling}b.lineObj=t}++o});e;)e=c(e)}function pl(n,t,r,u,f){var v=tc(n,t),c=t.gutterMarkers,it=n.display,e,w,b,h,tt,k,d,l,y,a,g,o,nt,s,p;if(!n.options.lineNumbers&&!c&&!t.bgClass&&!t.wrapClass&&!t.widgets)return v;if(f){for(f.alignable=null,w=!0,b=0,h=f.firstChild;h;h=tt)if(tt=h.nextSibling,/\bCodeMirror-linewidget\b/.test(h.className)){for(o=0,k=!0;o<t.widgets.length;++o)if(s=t.widgets[o],d=!1,s.above||(d=k,k=!1),s.node==h.firstChild){ye(s,h,f,u),++b,d&&f.insertBefore(v,h);break}if(o==t.widgets.length){w=!1;break}}else f.removeChild(h);w&&b==t.widgets.length&&(e=f,f.className=t.wrapClass||"")}if(e||(e=i("div",null,t.wrapClass,"position: relative"),e.appendChild(v)),t.bgClass&&e.insertBefore(i("div"," ",t.bgClass+" CodeMirror-linebackground"),e.firstChild),(n.options.lineNumbers||c)&&(l=e.insertBefore(i("div",null,null,"position: absolute; left: "+(n.options.fixedGutter?u.fixedPos:-u.gutterTotalWidth)+"px"),e.firstChild),n.options.fixedGutter&&(e.alignable||(e.alignable=[])).push(l),!n.options.lineNumbers||c&&c["CodeMirror-linenumbers"]||(e.lineNumber=l.appendChild(i("div",ae(n.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+u.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+it.lineNumInnerWidth+"px"))),c))for(y=0;y<n.options.gutters.length;++y)a=n.options.gutters[y],g=c.hasOwnProperty(a)&&c[a],g&&l.appendChild(i("div",[g],"CodeMirror-gutter-elt","left: "+u.gutterLeft[a]+"px; width: "+u.gutterWidth[a]+"px"));if(fi&&(e.style.zIndex=2),t.widgets&&e!=f)for(o=0,nt=t.widgets;o<nt.length;++o)s=nt[o],p=i("div",[s.node],"CodeMirror-linewidget"),ye(s,p,e,u),s.above?e.insertBefore(p,n.options.lineNumbers&&t.height!=0?l:v):e.appendChild(p),ut(s,"redraw");return e}function ye(n,t,i,r){if(n.noHScroll){(i.alignable||(i.alignable=[])).push(t);var u=r.wrapperWidth;t.style.left=r.fixedPos+"px",n.coverGutter||(u-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=u+"px"}n.coverGutter&&(t.style.zIndex=5,t.style.position="relative",n.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function pe(n){var t=n.display,i=s(n.doc.sel.from,n.doc.sel.to);i||n.options.showCursorWhenSelecting?wl(n):t.cursor.style.display=t.otherCursor.style.display="none",i?t.selectionDiv.style.display="none":bl(n);var r=ot(n,n.doc.sel.head,"div"),u=l(t.wrapper),f=l(t.lineDiv);t.inputDiv.style.top=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+f.top-u.top))+"px",t.inputDiv.style.left=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+f.left-u.left))+"px"}function wl(n){var t=n.display,i=ot(n,n.doc.sel.head,"div");t.cursor.style.left=i.left+"px",t.cursor.style.top=i.top+"px",t.cursor.style.height=Math.max(0,i.bottom-i.top)*n.options.cursorHeight+"px",t.cursor.style.display="",i.other?(t.otherCursor.style.display="",t.otherCursor.style.left=i.other.left+"px",t.otherCursor.style.top=i.other.top+"px",t.otherCursor.style.height=(i.other.bottom-i.other.top)*.85+"px"):t.otherCursor.style.display="none"}function bl(n){function l(n,t,r,u){t<0&&(t=0),w.appendChild(i("div",null,"CodeMirror-selected","position: absolute; left: "+n+"px; top: "+t+"px; width: "+(r==null?b-n:r)+"px; height: "+(u-t)+"px"))}function a(i,u,f,e){function v(r){return we(n,t(i,r),"div",s)}var s=r(c,i),a=s.text.length,o=e?Infinity:-Infinity;return av(rt(s),u||0,f==null?a:f,function(n,t,i){var c=v(i=="rtl"?t-1:n),r=v(i=="rtl"?n:t-1),s=c.left,y=r.right;r.top-c.top>3&&(l(s,c.top,null,c.bottom),s=h,c.bottom<r.top&&l(s,c.bottom,null,r.top)),f==null&&t==a&&(y=b),u==null&&n==0&&(s=h),o=e?Math.min(r.top,o):Math.max(r.bottom,o),s<h+1&&(s=h),l(s,r.top,y-s,r.bottom)}),o}var s=n.display,c=n.doc,u=n.doc.sel,w=document.createDocumentFragment(),b=s.lineSpace.offsetWidth,h=gl(n.display),e,o,v,y,p;if(u.from.line==u.to.line)a(u.from.line,u.from.ch,u.to.ch);else{for(var k=r(c,u.from.line),d=k,g,f=[u.from.line,u.from.ch],nt;g=br(d);){if(e=g.find(),f.push(e.from.ch,e.to.line,e.to.ch),e.to.line==u.to.line){f.push(u.to.ch),nt=!0;break}d=r(c,e.to.line)}if(nt)for(o=0;o<f.length;o+=3)a(f[o],f[o+1],f[o+2]);else p=r(c,u.to.line),v=u.from.ch?a(u.from.line,u.from.ch,null,!1):bi(n,k)-s.viewOffset,y=u.to.ch?a(u.to.line,sf(p)?null:0,u.to.ch,!0):bi(n,p)-s.viewOffset,v<y&&l(h,v,null,y)}ct(s.selectionDiv,w),s.selectionDiv.style.display=""}function su(n){var t=n.display,i;clearInterval(t.blinker),i=!0,t.cursor.style.visibility=t.otherCursor.style.visibility="",t.blinker=setInterval(function(){t.cursor.offsetHeight&&(t.cursor.style.visibility=t.otherCursor.style.visibility=(i=!i)?"":"hidden")},n.options.cursorBlinkRate)}function hu(n,t){n.doc.mode.startState&&n.doc.frontier<n.display.showingTo&&n.state.highlight.set(t,nt(kl,n))}function kl(n){var t=n.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=n.display.showingTo)){var e=+new Date+n.options.workTime,r=vi(t.mode,rr(n,t.frontier)),i=[],u;t.iter(t.frontier,Math.min(t.first+t.size,n.display.showingTo+500),function(f){var o,h,s;if(t.frontier>=n.display.showingFrom){for(o=f.styles,f.styles=dh(n,f,r),h=!o||o.length!=f.styles.length,s=0;!h&&s<o.length;++s)h=o[s]!=f.styles[s];h&&(u&&u.end==t.frontier?u.end++:i.push(u={start:t.frontier,end:t.frontier+1})),f.stateAfter=vi(t.mode,r)}else gh(n,f,r),f.stateAfter=t.frontier%5==0?vi(t.mode,r):null;return++t.frontier,+new Date>e?(hu(n,n.options.workDelay),!0):void 0}),i.length&&f(n,function(){for(var n=0;n<i.length;++n)c(this,i[n].start,i[n].end)})()}}function dl(n,t){for(var s,u,f=n.doc,e,o,i=t,h=t-100;i>h;--i){if(i<=f.first)return f.first;if(e=r(f,i-1),e.stateAfter)return i;o=gi(e.text,null,n.options.tabSize),(u==null||s>o)&&(u=i-1,s=o)}return u}function rr(n,t){var u=n.doc,e=n.display,i,f;return u.mode.startState?(i=dl(n,t),f=i>u.first&&r(u,i-1).stateAfter,f=f?vi(u.mode,f):lh(u.mode),u.iter(i,t,function(r){gh(n,r,f);var o=i==t-1||i%5==0||i>=e.showingFrom&&i<e.showingTo;r.stateAfter=o?vi(u.mode,f):null,++i}),f):!0}function cu(n){return n.lineSpace.offsetTop}function gl(n){var t=ct(n.measure,i("pre",null,null,"text-align: left")).appendChild(i("span","x"));return t.offsetLeft}function vs(n,t,i,r){var e=-1,f,u;for(r=r||lu(n,t),f=i;;f+=e){if(u=r[f],u)break;e<0&&f==0&&(e=1)}return{left:f<i?u.right:u.left,right:f>i?u.left:u.right,top:u.top,bottom:u.bottom}}function lu(n,t){for(var f=n.display,r=n.display.measureLineCache,e,i,u=0;u<r.length;++u)if(i=r[u],i.text==t.text&&i.markedSpans==t.markedSpans&&f.scroller.clientWidth==i.width&&i.classes==t.textClass+"|"+t.bgClass+"|"+t.wrapClass)return i.measure;return e=na(n,t),i={text:t.text,width:f.scroller.clientWidth,markedSpans:t.markedSpans,measure:e,classes:t.textClass+"|"+t.bgClass+"|"+t.wrapClass},r.length==16?r[++f.measureLineCachePos%16]=i:r.push(i),e}function na(n,t){var w=n.display,d=pc(t.text.length),f=tc(n,t,d),ft,nt,u,c,a,tt,r,o,it,k;if(p&&!fi&&!n.options.lineWrapping&&f.childNodes.length>100){var rt=document.createDocumentFragment(),ut=10,g=f.childNodes.length;for(r=0,ft=Math.ceil(g/ut);r<ft;++r){for(nt=i("div",null,null,"display: inline-block"),u=0;u<ut&&g;++u)nt.appendChild(f.firstChild),--g;rt.appendChild(nt)}f.appendChild(rt)}ct(w.measure,f);var v=l(w.lineDiv),e=[],y=pc(t.text.length),et=f.offsetHeight;for(yt&&w.measure.first!=f&&ct(w.measure,f),r=0;r<d.length;++r)if(o=d[r]){var b=l(o),s=Math.max(0,b.top-v.top),h=Math.min(b.bottom-v.top,et);for(u=0;u<e.length;u+=2)if((c=e[u],a=e[u+1],!(c>h)&&!(a<s))&&(c<=s&&a>=h||s<=c&&h>=a||Math.min(h,a)-Math.max(s,c)>=h-s>>1)){e[u]=Math.min(s,c),e[u+1]=Math.max(h,a);break}u==e.length&&e.push(s,h),tt=b.right,o.measureRight&&(tt=l(o.measureRight).left),y[r]={left:b.left-v.left,right:tt-v.left,top:u}}for(r=0;r<y.length;++r)(o=y[r])&&(it=o.top,o.top=e[it],o.bottom=e[it+1]);return n.options.lineWrapping||(k=f.lastChild,k.nodeType==3&&(k=f.appendChild(i("span",""))),y.width=l(k).right-v.left),y}function oi(n){n.display.measureLineCache.length=n.display.measureLineCachePos=0,n.display.cachedCharWidth=n.display.cachedTextHeight=null,n.display.maxLineChanged=!0,n.display.lineNumChars=null}function ys(n,t,i,r){var u,e,f,o,s;if(t.widgets)for(u=0;u<t.widgets.length;++u)t.widgets[u].above&&(e=cf(t.widgets[u]),i.top+=e,i.bottom+=e);return r=="line"?i:(r||(r="local"),f=bi(n,t),r!="local"&&(f-=n.display.viewOffset),r=="page"&&(o=l(n.display.lineSpace),f+=o.top+(window.pageYOffset||(document.documentElement||document.body).scrollTop),s=o.left+(window.pageXOffset||(document.documentElement||document.body).scrollLeft),i.left+=s,i.right+=s),i.top+=f,i.bottom+=f,i)}function we(n,t,i,u){return u||(u=r(n.doc,t.line)),ys(n,u,vs(n,u,t.ch),i)}function ot(n,t,i,u,f){function a(t,r){var e=vs(n,u,t,f);return r?e.left=e.right:e.right=e.left,ys(n,u,e,i)}var h,o,p,v,w,l,s,c,y,b,k,e;if(u=u||r(n.doc,t.line),f||(f=lu(n,u)),h=rt(u),o=t.ch,!h)return a(o);for(w=h[0].level,l=0;l<h.length;++l){if(s=h[l],c=s.level%2,s.from<o&&s.to>o)return a(o,c);if(b=c?s.to:s.from,k=c?s.from:s.to,b==o)y=l&&s.level<(e=h[l-1]).level?a(e.level%2?e.from:e.to-1,!0):a(c&&s.from!=s.to?o-1:o),c==w?p=y:v=y;else if(k==o){if(e=l<h.length-1&&h[l+1],!c&&e&&e.from==e.to)continue;y=e&&s.level<e.level?a(e.level%2?e.to-1:e.from):a(c?o:o-1,!0),c==w?p=y:v=y}}return(w&&!o&&(v=a(h[0].to-1)),!p)?v:(v&&(p.other=v),p)}function au(n,i,r){var u=new t(n,i);return r&&(u.outside=!0),u}function be(n,t,i){var u=n.doc,f,e;if(i+=n.display.viewOffset,i<0)return au(u.first,0,!0);if(f=vf(u,i),e=u.first+u.size-1,f>e)return au(u.first+u.size-1,r(u,e).text.length,!0);for(t<0&&(t=0);;){var s=r(u,f),h=ta(n,s,f,t,i),o=br(s),c=o&&o.find();if(o&&h.ch>=c.from.ch)f=c.to.line;else return h}}function ta(n,i,r,u,f){function p(u){var f=ot(n,t(r,u),"line",i,ft);return(h=!0,g>f.bottom)?Math.max(0,f.left-nt):g<f.top?f.left+nt:(h=!1,f.left)}var g=f-bi(n,i),h=!1,nt=n.display.wrapper.clientWidth,ft=lu(n,i),tt=rt(i),w=i.text.length,e=re(i),o=ue(i),it=p(e),ut=h,l=p(o),b=h,a,v,k,c,s,d,y;if(u>l)return au(r,o,b);for(;;){if(tt?o==e||o==ts(i,e,1):o-e<=1){for(a=u-it<l-u,v=a?e:o;gf.test(i.text.charAt(v));)++v;return k=au(r,v,a?ut:b),k.after=a,k}if(c=Math.ceil(w/2),s=e+c,tt)for(s=e,d=0;d<c;++d)s=ts(i,s,1);y=p(s),y>u?(o=s,l=y,(b=h)&&(l+=1e3),w-=c):(e=s,it=y,ut=h,w=c)}}function vu(n){var r,t;if(n.cachedTextHeight!=null)return n.cachedTextHeight;if(pt==null){for(pt=i("pre"),r=0;r<49;++r)pt.appendChild(document.createTextNode("x")),pt.appendChild(i("br"));pt.appendChild(document.createTextNode("x"))}return ct(n.measure,pt),t=pt.offsetHeight/50,t>3&&(n.cachedTextHeight=t),ne(n.measure),t||1}function ia(n){var r,u,t;return n.cachedCharWidth!=null?n.cachedCharWidth:(r=i("span","x"),u=i("pre",[r]),ct(n.measure,u),t=r.offsetWidth,t>2&&(n.cachedCharWidth=t),t||10)}function si(n){n.curOp={changes:[],updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,updateMaxLine:!1,updateScrollPos:!1,id:++ps},tu++||(vt=[])}function hi(n){var t=n.curOp,s=n.doc,r=n.display,l,c,u,a,f,e,o,h,i;if(n.curOp=null,t.updateMaxLine&&he(n),r.maxLineChanged&&!n.options.lineWrapping&&(l=lu(n,r.maxLine).width,r.sizer.style.minWidth=Math.max(0,l+3+di)+"px",r.maxLineChanged=!1,c=Math.max(0,r.sizer.offsetLeft+r.sizer.offsetWidth-r.scroller.clientWidth),c<s.scrollLeft&&!t.updateScrollPos&&li(n,Math.min(r.scroller.scrollLeft,c),!0)),t.updateScrollPos?u=t.updateScrollPos:t.selectionChanged&&r.scroller.clientHeight&&(f=ot(n,s.sel.head),u=ro(n,f.left,f.top,f.left,f.bottom)),(t.changes.length||u&&u.scrollTop!=null)&&(a=ou(n,t.changes,u&&u.scrollTop)),!a&&t.selectionChanged&&pe(n),t.updateScrollPos?(r.scroller.scrollTop=r.scrollbarV.scrollTop=s.scrollTop=u.scrollTop,r.scroller.scrollLeft=r.scrollbarH.scrollLeft=s.scrollLeft=u.scrollLeft,cs(n)):u&&va(n),t.selectionChanged&&su(n),n.state.focused&&t.updateInput&&wt(n,t.userSelChange),e=t.maybeHiddenMarkers,o=t.maybeUnhiddenMarkers,e)for(i=0;i<e.length;++i)e[i].lines.length||g(e[i],"hide");if(o)for(i=0;i<o.length;++i)o[i].lines.length&&g(o[i],"unhide");if(--tu||(h=vt,vt=null),t.textChanged&&g(n,"change",n,t.textChanged),t.selectionChanged&&g(n,"cursorActivity",n),h)for(i=0;i<h.length;++i)h[i]()}function f(n,t){return function(){var i=n||this,r=!i.curOp,u;r&&si(i);try{u=t.apply(i,arguments)}finally{r&&hi(i)}return u}}function ur(n){return function(){var t=this.cm&&!this.cm.curOp,i;t&&si(this.cm);try{i=n.apply(this,arguments)}finally{t&&hi(this.cm)}return i}}function ws(n,t){var i=!n.curOp,r;i&&si(n);try{r=t()}finally{i&&hi(n)}return r}function c(n,t,i,r){t==null&&(t=n.doc.first),i==null&&(i=n.doc.first+n.doc.size),n.curOp.changes.push({from:t,to:i,diff:r})}function yu(n){n.display.pollingFast||n.display.poll.set(n.options.pollInterval,function(){ke(n),n.state.focused&&yu(n)})}function fr(n){function i(){var r=ke(n);r||t?(n.display.pollingFast=!1,yu(n)):(t=!0,n.display.poll.set(60,i))}var t=!1;n.display.pollingFast=!0,n.display.poll.set(20,i)}function ke(n){var c=n.display.input,o=n.display.prevInput,a=n.doc,h=a.sel,i,l,u,v,e,f,y;if(!n.state.focused||lv(c)||er(n)||(i=c.value,i==o&&s(h.from,h.to)))return!1;if(p&&i&&c.selectionStart===0)return wt(n,!0),!1;for(l=!n.curOp,l&&si(n),h.shift=!1,u=0,v=Math.min(o.length,i.length);u<v&&o[u]==i[u];)++u;return e=h.from,f=h.to,u<o.length?e=t(e.line,e.ch-(o.length-u)):n.state.overwrite&&s(e,f)&&!n.state.pasteIncoming&&(f=t(f.line,Math.min(r(a,f.line).text.length,f.ch+(i.length-u)))),y=n.curOp.updateInput,cr(n.doc,{from:e,to:f,text:ii(i.slice(u)),origin:n.state.pasteIncoming?"paste":"+input"},"end"),n.curOp.updateInput=y,i.length>1e3?c.value=n.display.prevInput="":n.display.prevInput=i,l&&hi(n),n.state.pasteIncoming=!1,!0}function wt(n,t){var r,u,i=n.doc;s(i.sel.from,i.sel.to)?t&&(n.display.prevInput=n.display.input.value=""):(n.display.prevInput="",r=gc&&(i.sel.to.line-i.sel.from.line>100||(u=n.getSelection()).length>1e3),n.display.input.value=r?"-":u||n.getSelection(),n.state.focused&&yc(n.display.input)),n.display.inaccurateSelection=r}function w(n){n.options.readOnly=="nocursor"||oe&&document.activeElement==n.display.input||n.display.input.focus()}function er(n){return n.options.readOnly||n.doc.cantEdit}function ra(n){function i(){n.state.focused&&setTimeout(nt(w,n),0)}function r(){t.cachedCharWidth=t.cachedTextHeight=null,oi(n),ws(n,nt(c,n))}function u(){for(var n=t.wrapper.parentNode;n&&n!=document.body;n=n.parentNode);n?setTimeout(u,5e3):st(window,"resize",r)}function o(t){n.options.onDragEvent&&n.options.onDragEvent(n,nu(t))||bf(t)}function s(){t.inaccurateSelection&&(t.prevInput="",t.inaccurateSelection=!1,t.input.value=n.getSelection(),yc(t.input))}var t=n.display;e(t.scroller,"mousedown",f(n,ua)),e(t.scroller,"dblclick",f(n,a)),e(t.lineSpace,"selectstart",function(n){ci(t,n)||a(n)}),se||e(t.scroller,"contextmenu",function(t){th(n,t)}),e(t.scroller,"scroll",function(){sr(n,t.scroller.scrollTop),li(n,t.scroller.scrollLeft,!0),g(n,"scroll",n)}),e(t.scrollbarV,"scroll",function(){sr(n,t.scrollbarV.scrollTop)}),e(t.scrollbarH,"scroll",function(){li(n,t.scrollbarH.scrollLeft)}),e(t.scroller,"mousewheel",function(t){bs(n,t)}),e(t.scroller,"DOMMouseScroll",function(t){bs(n,t)}),e(t.scrollbarH,"mousedown",i),e(t.scrollbarV,"mousedown",i),e(t.wrapper,"scroll",function(){t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),e(window,"resize",r),setTimeout(u,5e3),e(t.input,"keyup",f(n,function(t){n.options.onKeyEvent&&n.options.onKeyEvent(n,nu(t))||t.keyCode==16&&(n.doc.sel.shift=!1)})),e(t.input,"input",nt(fr,n)),e(t.input,"keydown",f(n,nh)),e(t.input,"keypress",f(n,ha)),e(t.input,"focus",nt(bt,n)),e(t.input,"blur",nt(de,n)),n.options.dragDrop&&(e(t.scroller,"dragstart",function(t){oa(n,t)}),e(t.scroller,"dragenter",o),e(t.scroller,"dragover",o),e(t.scroller,"drop",f(n,fa))),e(t.scroller,"paste",function(i){ci(t,i)||(w(n),fr(n))}),e(t.input,"paste",function(){n.state.pasteIncoming=!0,fr(n)}),e(t.input,"cut",s),e(t.input,"copy",s),ee&&e(t.sizer,"mouseup",function(){document.activeElement==t.input&&t.input.blur(),w(n)})}function ci(n,t){for(var i=yo(t);i!=n.wrapper;i=i.parentNode)if(!i||/\bCodeMirror-(?:line)?widget\b/.test(i.className)||i.parentNode==n.sizer&&i!=n.mover)return!0}function or(n,t,i){var r=n.display,u,e,o,f;if(!i&&(u=yo(t),u==r.scrollbarH||u==r.scrollbarH.firstChild||u==r.scrollbarV||u==r.scrollbarV.firstChild||u==r.scrollbarFiller))return null;f=l(r.lineSpace);try{e=t.clientX,o=t.clientY}catch(t){return null}return be(n,e-f.left,o-f.top)}function ua(n){function at(n){if(b=="single"){v(i.doc,u(y,o),n);return}if(d=u(y,d),it=u(y,it),b=="double"){var f=ch(r(y,n.line).text,n);h(n,d)?v(i.doc,f.from,it):v(i.doc,d,f.to)}else b=="triple"&&(h(n,d)?v(i.doc,it,u(y,t(n.line,0))):v(i.doc,d,u(y,t(n.line+1,0))))}function ht(n){var e=++rt,t=or(i,n,!0),r,u;t&&(s(t,et)?(u=n.clientY<ot.top?-20:n.clientY>ot.bottom?20:0,u&&setTimeout(f(i,function(){rt==e&&(c.scroller.scrollTop+=u,ht(n))}),50)):(i.state.focused||bt(i),et=t,at(t),r=le(c,y),(t.line>=r.to||t.line<r.from)&&setTimeout(f(i,function(){rt==e&&ht(n)}),150)))}function vt(n){rt=Infinity;var t=or(i,n);t&&at(t),a(n),w(i),st(document,"mousemove",ct),st(document,"mouseup",lt)}var i=this,c=i.display,y=i.doc,k=y.sel,o,tt,b,ut,et,g,d,it,ot,rt,ct,lt;if(k.shift=n.shiftKey,ci(c,n)){ft||(c.scroller.draggable=!1,setTimeout(function(){c.scroller.draggable=!0},100));return}if(!ea(i,n)){o=or(i,n);switch(ac(n)){case 3:se&&th.call(i,i,n);return;case 2:o&&v(i.doc,o),setTimeout(nt(w,i),20),a(n);return}if(!o){yo(n)==c.scroller&&a(n);return}if(i.state.focused||bt(i),tt=+new Date,b="single",wu&&wu.time>tt-400&&s(wu.pos,o)?(b="triple",a(n),setTimeout(nt(w,i),20),ya(i,o.line)):pu&&pu.time>tt-400&&s(pu.pos,o)?(b="double",wu={time:tt,pos:o},a(n),ut=ch(r(y,o.line).text,o),v(i.doc,ut.from,ut.to)):pu={time:tt,pos:o},et=o,i.options.dragDrop&&dc&&!er(i)&&!s(k.from,k.to)&&!h(o,k.from)&&!h(k.to,o)&&b=="single"){g=f(i,function(t){ft&&(c.scroller.draggable=!1),i.state.draggingText=!1,st(document,"mouseup",g),st(c.scroller,"drop",g),Math.abs(n.clientX-t.clientX)+Math.abs(n.clientY-t.clientY)<10&&(a(t),v(i.doc,o),w(i))}),ft&&(c.scroller.draggable=!0),i.state.draggingText=g,c.scroller.dragDrop&&c.scroller.dragDrop(),e(document,"mouseup",g),e(c.scroller,"drop",g);return}a(n),b=="single"&&v(i.doc,u(y,o)),d=k.from,it=k.to,ot=l(c.wrapper),rt=0,ct=f(i,function(n){p||ac(n)?ht(n):vt(n)}),lt=f(i,vt),e(document,"mousemove",ct),e(document,"mouseup",lt)}}function fa(n){var t=this,i,f,e,r,s,c;if(!ci(t.display,n)&&(!t.options.onDragEvent||!t.options.onDragEvent(t,nu(n)))&&(a(n),i=or(t,n,!0),f=n.dataTransfer.files,i&&!er(t)))if(f&&f.length&&window.FileReader&&window.File){var o=f.length,r=Array(o),l=0,v=function(n,f){var e=new FileReader;e.onload=function(){r[f]=e.result,++l==o&&(i=u(t.doc,i),lt(t.doc,r.join(""),i,"around","paste"))},e.readAsText(n)};for(e=0;e<o;++e)v(f[e],e)}else{if(t.state.draggingText&&!(h(i,t.doc.sel.from)||h(t.doc.sel.to,i))){t.state.draggingText(n),setTimeout(nt(w,t),20);return}try{r=n.dataTransfer.getData("Text"),r&&(s=t.doc.sel.from,c=t.doc.sel.to,at(t.doc,i,i),t.state.draggingText&<(t.doc,"",s,c,"paste"),t.replaceSelection(r,null,"paste"),w(t),bt(t))}catch(n){}}}function ea(n,t){var r=n.display,f,u,e,i,o,s,h;try{f=t.clientX,u=t.clientY}catch(t){return!1}if(f>=Math.floor(l(r.gutters).right))return!1;if((a(t),!ki(n,"gutterClick"))||(e=l(r.lineDiv),u>e.bottom))return!0;for(u-=e.top-r.viewOffset,i=0;i<n.options.gutters.length;++i)if(o=r.gutters.childNodes[i],o&&l(o).right>=f){s=vf(n.doc,u),h=n.options.gutters[i],ut(n,"gutterClick",n,s,h,t);break}return!0}function oa(n,t){var u,r;ci(n.display,t)||(u=n.getSelection(),t.dataTransfer.setData("Text",u),t.dataTransfer.setDragImage&&!fe&&(r=i("img",null,null,"position: fixed; left: 0; top: 0;"),et&&(r.width=r.height=1,n.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),et&&r.parentNode.removeChild(r)))}function sr(n,t){Math.abs(n.doc.scrollTop-t)<2||(n.doc.scrollTop=t,ui||ou(n,[],t),n.display.scroller.scrollTop!=t&&(n.display.scroller.scrollTop=t),n.display.scrollbarV.scrollTop!=t&&(n.display.scrollbarV.scrollTop=t),ui&&ou(n,[]))}function li(n,t,i){(i?t==n.doc.scrollLeft:Math.abs(n.doc.scrollLeft-t)<2)||(t=Math.min(t,n.display.scroller.scrollWidth-n.display.scroller.clientWidth),n.doc.scrollLeft=t,cs(n),n.display.scroller.scrollLeft!=t&&(n.display.scroller.scrollLeft=t),n.display.scrollbarH.scrollLeft!=t&&(n.display.scrollbarH.scrollLeft=t))}function bs(n,t){var f=t.wheelDeltaX,u=t.wheelDeltaY,e,i,r;if(f==null&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(f=t.detail),u==null&&t.detail&&t.axis==t.VERTICAL_AXIS?u=t.detail:u==null&&(u=t.wheelDelta),u&&ei&&ft)for(e=t.target;e!=r;e=e.parentNode)if(e.lineObj){n.display.currentWheelTarget=e;break}if(i=n.display,r=i.scroller,f&&!ui&&!et&&b!=null){u&&sr(n,Math.max(0,Math.min(r.scrollTop+u*b,r.scrollHeight-r.clientHeight))),li(n,Math.max(0,Math.min(r.scrollLeft+f*b,r.scrollWidth-r.clientWidth))),a(t),i.wheelStartX=null;return}if(u&&b!=null){var s=u*b,o=n.doc.scrollTop,h=o+i.wrapper.clientHeight;s<0?o=Math.max(0,o+s-50):h=Math.min(n.doc.height,h+s+50),ou(n,[],{top:o,bottom:h})}hr<20&&(i.wheelStartX==null?(i.wheelStartX=r.scrollLeft,i.wheelStartY=r.scrollTop,i.wheelDX=f,i.wheelDY=u,setTimeout(function(){if(i.wheelStartX!=null){var n=r.scrollLeft-i.wheelStartX,t=r.scrollTop-i.wheelStartY,u=t&&i.wheelDY&&t/i.wheelDY||n&&i.wheelDX&&n/i.wheelDX;(i.wheelStartX=i.wheelStartY=null,u)&&(b=(b*hr+u)/(hr+1),++hr)}},200)):(i.wheelDX+=f,i.wheelDY+=u))}function bu(n,t,i){if(typeof t=="string"&&(t=ef[t],!t))return!1;n.display.pollingFast&&ke(n)&&(n.display.pollingFast=!1);var r=n.doc,f=r.sel.shift,u=!1;try{er(n)&&(n.state.suppressEdits=!0),i&&(r.sel.shift=!1),u=t(n)!=po}finally{r.sel.shift=f,n.state.suppressEdits=!1}return u}function ks(n){var t=n.state.keyMaps.slice(0);return t.push(n.options.keyMap),n.options.extraKeys&&t.unshift(n.options.extraKeys),t}function gs(n,t){var e=oo(n.options.keyMap),u=e.auto,r,i,f;return(clearTimeout(ds),u&&!ah(t)&&(ds=setTimeout(function(){oo(n.options.keyMap)==e&&(n.options.keyMap=u.call?u.call(null,n):u)},50)),r=vh(t,!0),i=!1,!r)?!1:(f=ks(n),i=t.shiftKey?ar("Shift-"+r,f,function(t){return bu(n,t,!0)})||ar(r,f,function(t){if(typeof t=="string"&&/^go[A-Z]/.test(t))return bu(n,t)}):ar(r,f,function(t){return bu(n,t)}),i=="stop"&&(i=!1),i&&(a(t),su(n),yt&&(t.oldKeyCode=t.keyCode,t.keyCode=0)),i)}function sa(n,t,i){var r=ar("'"+i+"'",ks(n),function(t){return bu(n,t,!0)});return r&&(a(t),su(n)),r}function nh(n){var t=this,i,r;(t.state.focused||bt(t),p&&n.keyCode==27&&(n.returnValue=!1),t.options.onKeyEvent&&t.options.onKeyEvent(t,nu(n)))||(i=n.keyCode,t.doc.sel.shift=i==16||n.shiftKey,r=gs(t,n),et&&(ku=r?i:null,r||i!=88||gc||!(ei?n.metaKey:n.ctrlKey)||t.replaceSelection("")))}function ha(n){var t=this,i,r,u;if(!t.options.onKeyEvent||!t.options.onKeyEvent(t,nu(n))){if(i=n.keyCode,r=n.charCode,et&&i==ku){ku=null,a(n);return}(et&&(!n.which||n.which<10)||ee)&&gs(t,n)||(u=String.fromCharCode(r==null?i:r),this.options.electricChars&&this.doc.mode.electricChars&&this.options.smartIndent&&!er(this)&&this.doc.mode.electricChars.indexOf(u)>-1&&setTimeout(f(t,function(){nf(t,t.doc.sel.to.line,"smart")}),75),sa(t,n,u))||fr(t)}}function bt(n){n.options.readOnly!="nocursor"&&(n.state.focused||(g(n,"focus",n),n.state.focused=!0,n.display.wrapper.className.search(/\bCodeMirror-focused\b/)==-1&&(n.display.wrapper.className+=" CodeMirror-focused"),wt(n,!0)),yu(n),su(n))}function de(n){n.state.focused&&(g(n,"blur",n),n.state.focused=!1,n.display.wrapper.className=n.display.wrapper.className.replace(" CodeMirror-focused","")),clearInterval(n.display.blinker),setTimeout(function(){n.state.focused||(n.doc.sel.shift=!1)},150)}function th(n,t){function a(){var u,e,t;i.inputDiv.style.position="relative",i.input.style.cssText=l,yt&&(i.scrollbarV.scrollTop=i.scroller.scrollTop=c),yu(n),i.input.selectionStart!=null&&(!p||yt)&&(clearTimeout(ge),u=i.input.value=" "+(s(r.from,r.to)?"":i.input.value),e=0,i.prevInput=" ",i.input.selectionStart=1,i.input.selectionEnd=u.length,t=function(){i.prevInput==" "&&i.input.selectionStart==0?f(n,ef.selectAll)(n):e++<10?ge=setTimeout(t,500):wt(n)},ge=setTimeout(t,200))}var i=n.display,r=n.doc.sel,u,c,l,o;ci(i,t)||(u=or(n,t),c=i.scroller.scrollTop,u&&!et)&&((s(r.from,r.to)||h(u,r.from)||!h(u,r.to))&&f(n,at)(n.doc,u,u),l=i.input.style.cssText,i.inputDiv.style.position="absolute",i.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(t.clientY-5)+"px; left: "+(t.clientX-5)+"px; z-index: 1000; background: white; outline: none;border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);",w(n),wt(n,!0),s(r.from,r.to)&&(i.input.value=i.prevInput=" "),se?(bf(t),o=function(){st(window,"mouseup",o),setTimeout(a,20)},e(window,"mouseup",o)):setTimeout(a,50))}function no(n){return t(n.from.line+n.text.length-1,y(n.text).length+(n.text.length==1?n.from.ch:0))}function ih(n,i,f){var e,s,o,c;return h(i.from,f)?(e=i.text.length-1-(i.to.line-i.from.line),f.line>i.to.line+e)?(s=f.line-e,o=n.first+n.size-1,s>o)?t(o,r(n,o).text.length):du(f,r(n,s).text.length):f.line==i.to.line+e?du(f,y(i.text).length+(i.text.length==1?i.from.ch:0)+r(n,i.to.line).text.length-i.to.ch):(c=f.line-i.from.line,du(f,i.text[c].length+(c?0:i.from.ch))):u(n,f)}function to(n,i,r){var u,f;return r&&typeof r=="object"?{anchor:ih(n,i,r.anchor),head:ih(n,i,r.head)}:r=="start"?{anchor:i.from,head:i.from}:(u=no(i),r=="around")?{anchor:i.from,head:u}:r=="end"?{anchor:u,head:u}:(f=function(n){if(h(n,i.from))return n;if(!h(i.to,n))return u;var f=n.line+i.text.length-(i.to.line-i.from.line)-1,r=n.ch;return n.line==i.to.line&&(r+=u.ch-i.to.ch),t(f,r)},{anchor:f(n.sel.anchor),head:f(n.sel.head)})}function ca(n,t){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,update:function(t,i,r,f){t&&(this.from=u(n,t)),i&&(this.to=u(n,i)),r&&(this.text=r),f!==undefined&&(this.origin=f)},cancel:function(){this.canceled=!0}};return(g(n,"beforeChange",n,i),n.cm&&g(n.cm,"beforeChange",n.cm,i),i.canceled)?null:{from:i.from,to:i.to,text:i.text,origin:i.origin}}function cr(n,t,i,r){var u,e;if(n.cm){if(!n.cm.curOp)return f(n.cm,cr)(n,t,i,r);if(n.cm.state.suppressEdits)return}if(!ki(n,"beforeChange")&&(!n.cm||!ki(n.cm,"beforeChange"))||(t=ca(n,t),t))if(u=us&&!r&&ga(n,t.from,t.to),u){for(e=u.length-1;e>=1;--e)io(n,{from:u[e].from,to:u[e].to,text:[""]});u.length&&io(n,{from:u[0].from,to:u[0].to,text:t.text},i)}else io(n,t,i)}function io(n,t,i){var u=to(n,t,i),r;fv(n,t,u,n.cm?n.cm.curOp.id:NaN),lr(n,t,u,so(n,t)),r=[],wi(n,function(n,i){i||ht(r,n.history)!=-1||(cc(n.history,t),r.push(n.history)),lr(n,t,null,so(n,t))})}function rh(n,t){var u=n.history,i=(t=="undo"?u.done:u.undone).pop(),e,f,r,s,o;if(i)for(u.dirtyCounter+=t=="undo"?-1:1,e={changes:[],anchorBefore:i.anchorAfter,headBefore:i.headAfter,anchorAfter:i.anchorBefore,headAfter:i.headBefore},(t=="undo"?u.undone:u.done).push(e),f=i.changes.length-1;f>=0;--f)r=i.changes[f],r.origin=t,e.changes.push(vo(n,r)),s=f?to(n,r,null):{anchor:i.anchorBefore,head:i.headBefore},lr(n,r,s,yh(n,r)),o=[],wi(n,function(n,t){t||ht(o,n.history)!=-1||(cc(n.history,r),o.push(n.history)),lr(n,r,null,yh(n,r))})}function uh(n,i){function r(n){return t(n.line+i,n.ch)}n.first+=i,n.cm&&c(n.cm,n.first,n.first,i),n.sel.head=r(n.sel.head),n.sel.anchor=r(n.sel.anchor),n.sel.from=r(n.sel.from),n.sel.to=r(n.sel.to)}function lr(n,i,u,e){var s,o;if(n.cm&&!n.cm.curOp)return f(n.cm,lr)(n,i,u,e);if(i.to.line<n.first){uh(n,i.text.length-1-(i.to.line-i.from.line));return}i.from.line>n.lastLine()||(i.from.line<n.first&&(s=i.text.length-1-(n.first-i.from.line),uh(n,s),i={from:t(n.first,0),to:t(i.to.line+s,i.to.ch),text:[y(i.text)],origin:i.origin}),o=n.lastLine(),i.to.line>o&&(i={from:i.from,to:t(o,r(n,o).text.length),text:[i.text[0]],origin:i.origin}),u||(u=to(n,i,null)),n.cm?la(n.cm,i,e,u):lo(n,i,e,u))}function la(n,t,i,u){var f=n.doc,o=n.display,e=t.from,h=t.to,l=!1,a=e.line,y,v,s;if(n.options.lineWrapping||(a=d(yi(f,r(f,e.line))),f.iter(a,h.line+1,function(n){if(n==o.maxLine)return l=!0,!0})),lo(f,t,i,u,fs(n)),n.options.lineWrapping||(f.iter(a,e.line+t.text.length,function(n){var t=eu(f,n);t>o.maxLineLength&&(o.maxLine=n,o.maxLineLength=t,o.maxLineChanged=!0,l=!1)}),l&&(n.curOp.updateMaxLine=!0)),f.frontier=Math.min(f.frontier,e.line),hu(n,400),y=t.text.length-(h.line-e.line)-1,c(n,e.line,h.line+1,y),ki(n,"change"))if(v={from:e,to:h,text:t.text,origin:t.origin},n.curOp.textChanged){for(s=n.curOp.textChanged;s.next;s=s.next);s.next=v}else n.curOp.textChanged=v}function lt(n,t,i,r,u){if(r||(r=i),h(r,i)){var f=r;r=i,i=f}typeof t=="string"&&(t=ii(t)),cr(n,{from:i,to:r,text:t,origin:u},null)}function t(n,i){if(!(this instanceof t))return new t(n,i);this.line=n,this.ch=i}function s(n,t){return n.line==t.line&&n.ch==t.ch}function h(n,t){return n.line<t.line||n.line==t.line&&n.ch<t.ch}function kt(n){return t(n.line,n.ch)}function fh(n,t){return Math.max(n.first,Math.min(t,n.first+n.size-1))}function u(n,i){if(i.line<n.first)return t(n.first,0);var u=n.first+n.size-1;return i.line>u?t(u,r(n,u).text.length):du(i,r(n,i.line).text.length)}function du(n,i){var r=n.ch;return r==null||r>i?t(n.line,i):r<0?t(n.line,0):n}function dt(n,t){return t>=n.first&&t<n.first+n.size}function v(n,t,i,r){var u,f;n.sel.shift||n.sel.extend?(u=n.sel.anchor,i&&(f=h(t,u),f!=h(i,u)?(u=t,t=i):f!=h(t,i)&&(t=i)),at(n,u,t,r)):at(n,t,i||t,r),n.cm&&(n.cm.curOp.userSelChange=!0)}function aa(n,t,i){var r={anchor:t,head:i};return g(n,"beforeSelectionChange",n,r),n.cm&&g(n.cm,"beforeSelectionChange",n.cm,r),r.anchor=u(n,r.anchor),r.head=u(n,r.head),r}function at(n,t,i,r,u){var e,f,o;((!u&&ki(n,"beforeSelectionChange")||n.cm&&ki(n.cm,"beforeSelectionChange"))&&(e=aa(n,t,i),i=e.head,t=e.anchor),f=n.sel,f.goalColumn=null,(u||!s(t,f.anchor))&&(t=gu(n,t,r,u!="push")),(u||!s(i,f.head))&&(i=gu(n,i,r,u!="push")),s(f.anchor,t)&&s(f.head,i))||(f.anchor=t,f.head=i,o=h(i,t),f.from=o?i:t,f.to=o?t:i,n.cm&&(n.cm.curOp.updateInput=n.cm.curOp.selectionChanged=!0),ut(n,"cursorActivity",n))}function eh(n){at(n.doc,n.doc.sel.from,n.doc.sel.to,null,"push")}function gu(n,i,f,e){var w=!1,c=i,p=f||1,v,y,l,a,o,h;n.cantEdit=!1;n:for(;;){if(v=r(n,c.line),v.markedSpans){for(h=0;h<v.markedSpans.length;++h)if(l=v.markedSpans[h],a=l.marker,(l.from==null||(a.inclusiveLeft?l.from<=c.ch:l.from<c.ch))&&(l.to==null||(a.inclusiveRight?l.to>=c.ch:l.to>c.ch))){if(e&&a.clearOnEnter){(y||(y=[])).push(a);continue}else if(!a.atomic)continue;if(o=a.find()[p<0?"from":"to"],s(o,c)&&(o.ch+=p,o.ch<0?o=o.line>n.first?u(n,t(o.line-1)):null:o.ch>v.text.length&&(o=o.line<n.first+n.size-1?t(o.line+1,0):null),!o)){if(w)return e?(n.cantEdit=!0,t(n.first,0)):gu(n,i,f,!0);w=!0,o=i,p=-p}c=o;continue n}if(y)for(h=0;h<y.length;++h)y[h].clear()}return c}}function va(n){var i=oh(n,n.doc.sel.head),u;if(n.state.focused){var t=n.display,f=l(t.sizer),r=null;i.top+f.top<0?r=!0:i.bottom+f.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),r==null||el||(u=t.cursor.style.display=="none",u&&(t.cursor.style.display="",t.cursor.style.left=i.left+"px",t.cursor.style.top=i.top-t.viewOffset+"px"),t.cursor.scrollIntoView(r),u&&(t.cursor.style.display="none"))}}function oh(n,t){for(;;){var u=!1,i=ot(n,t),r=ro(n,i.left,i.top,i.left,i.bottom),f=n.doc.scrollTop,e=n.doc.scrollLeft;if(r.scrollTop!=null&&(sr(n,r.scrollTop),Math.abs(n.doc.scrollTop-f)>1&&(u=!0)),r.scrollLeft!=null&&(li(n,r.scrollLeft),Math.abs(n.doc.scrollLeft-e)>1&&(u=!0)),!u)return i}}function sh(n,t,i,r,u){var f=ro(n,t,i,r,u);f.scrollTop!=null&&sr(n,f.scrollTop),f.scrollLeft!=null&&li(n,f.scrollLeft)}function ro(n,t,i,r,u){var f=n.display,e=cu(f),h,c,s,l;i+=e,u+=e;var a=f.scroller.clientHeight-di,v=f.scroller.scrollTop,o={},y=n.doc.height+2*e,p=i<e+10,w=u+e>y-10;return i<v?o.scrollTop=p?0:Math.max(0,i):u>v+a&&(o.scrollTop=(w?y:u)-a),h=f.scroller.clientWidth-di,c=f.scroller.scrollLeft,t+=f.gutters.offsetWidth,r+=f.gutters.offsetWidth,s=f.gutters.offsetWidth,l=t<s+10,t<c+s||l?(l&&(t=0),o.scrollLeft=Math.max(0,t-10-s)):r>h+c-3&&(o.scrollLeft=r+10-h),o}function nf(n,i,u,f){var l=n.doc,y,s,c,v;u||(u="add"),u=="smart"&&(n.doc.mode.indent?y=rr(n,i):u="prev");var h=n.options.tabSize,o=r(l,i),p=gi(o.text,null,h),a=o.text.match(/^\s*/)[0],e;if(u=="smart"&&(e=n.doc.mode.indent(y,o.text.slice(a.length),o.text),e==po)){if(!f)return;u="prev"}if(u=="prev"?e=i>l.first?gi(r(l,i-1).text,null,h):0:u=="add"?e=p+n.options.indentUnit:u=="subtract"&&(e=p-n.options.indentUnit),e=Math.max(0,e),s="",c=0,n.options.indentWithTabs)for(v=Math.floor(e/h);v;--v)c+=h,s+="\t";c<e&&(s+=vc(e-c)),s!=a&<(n.doc,s,t(i,0),t(i,a.length),"+input"),o.stateAfter=null}function tf(n,t,i){var u=t,f=t,e=n.doc;if(typeof t=="number"?f=r(e,fh(e,t)):u=d(t),u==null)return null;if(i(f,u))c(n,u,u+1);else return null;return f}function uo(n,i,u,f,e){function y(){var t=c+u;return t<n.first||t>=n.first+n.size?l=!1:(c=t,s=r(n,t))}function h(n){var t=(e?ts:tl)(s,o,u,!0);if(t==null)if(!n&&y())o=e?(u<0?ue:re)(s):u<0?s.text.length:0;else return l=!1;else o=t;return!0}var c=i.line,o=i.ch,s=r(n,c),l=!0,a,v;if(f=="char")h();else if(f=="column")h(!0);else if(f=="word")for(a=!1;;){if(u<0&&!h())break;if(df(s.text.charAt(o)))a=!0;else if(a){u<0&&(u=1,h());break}if(u>0&&!h())break}return v=gu(n,t(c,o),u,!0),l||(v.hitSide=!0),v}function hh(n,t,i,r){var o=n.doc,s=t.left,u,e,f;for(r=="page"?(e=Math.min(n.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=t.top+i*e):r=="line"&&(u=i>0?t.bottom+3:t.top-3);;){if(f=be(n,s,u),!f.outside)break;if(i<0?u<=0:u>=o.height){f.hitSide=!0;break}u+=i*5}return f}function ch(n,i){var r=i.ch,u=i.ch,f,e;if(n){for(i.after===!1||u==n.length?--r:++u,f=n.charAt(r),e=df(f)?df:/\s/.test(f)?function(n){return/\s/.test(n)}:function(n){return!/\s/.test(n)&&!df(n)};r>0&&e(n.charAt(r-1));)--r;while(u<n.length&&e(n.charAt(u)))++u}return{from:t(i.line,r),to:t(i.line,u)}}function ya(n,i){v(n.doc,t(i,0),u(n.doc,t(i+1,0)))}function o(t,i,r,u){n.defaults[t]=i,r&&(gt[t]=u?function(n,t,i){i!=fo&&r(n,t,i)}:r)}function vi(n,t){var r,u,i;if(t===!0)return t;if(n.copyState)return n.copyState(t);r={};for(u in t)i=t[u],i instanceof Array&&(i=i.concat([])),r[u]=i;return r}function lh(n,t,i){return n.startState?n.startState(t,i):!0}function oo(n){return typeof n=="string"?tt[n]:n}function ar(n,t,i){function u(t){var f,r,e,s,o;if(t=oo(t),f=t[n],f===!1)return"stop";if(f!=null&&i(f))return!0;if(t.nofallthrough)return"stop";if(r=t.fallthrough,r==null)return!1;if(Object.prototype.toString.call(r)!="[object Array]")return u(r);for(e=0,s=r.length;e<s;++e)if(o=u(r[e]),o)return o;return!1}for(var f,r=0;r<t.length;++r)if(f=u(t[r]),f)return f}function ah(n){var t=ri[n.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function vh(n,t){var i=ri[n.keyCode];return i==null||n.altGraphKey?!1:(n.altKey&&(i="Alt-"+i),(rs?n.metaKey:n.ctrlKey)&&(i="Ctrl-"+i),(rs?n.ctrlKey:n.metaKey)&&(i="Cmd-"+i),!t&&n.shiftKey&&(i="Shift-"+i),i)}function vr(n,t){this.pos=this.start=0,this.string=n,this.tabSize=t||8}function ni(n,t){this.lines=[],this.type=t,this.doc=n}function yr(n,t,r,u,e){var o;if(u&&u.shared)return pa(n,t,r,u,e);if(n.cm&&!n.cm.curOp)return f(n.cm,yr)(n,t,r,u,e);if(o=new ni(n,e),e=="range"&&!h(t,r))return o;u&&kf(u,o),o.replacedWith&&(o.collapsed=!0,o.replacedWith=i("span",[o.replacedWith],"CodeMirror-widget")),o.collapsed&&(tr=!0);var l=t.line,a=0,v,y,s=n.cm,p;if(n.iter(l,r.line+1,function(i){s&&o.collapsed&&!s.options.lineWrapping&&yi(n,i)==s.display.maxLine&&(p=!0);var u={from:null,to:null,marker:o};a+=i.text.length,l==t.line&&(u.from=t.ch,a-=t.ch),l==r.line&&(u.to=r.ch,a-=i.text.length-r.ch),o.collapsed&&(l==r.line&&(y=of(i,r.ch)),l==t.line?v=of(i,t.ch):it(i,0)),ba(i,u),++l}),o.collapsed&&n.iter(t.line,r.line+1,function(t){ti(n,t)&&it(t,0)}),o.readOnly&&(us=!0,(n.history.done.length||n.history.undone.length)&&n.clearHistory()),o.collapsed){if(v!=y)throw new Error("Inserting collapsed marker overlapping an existing one");o.size=a,o.atomic=!0}return s&&(p&&(s.curOp.updateMaxLine=!0),(o.className||o.startStyle||o.endStyle||o.collapsed)&&c(s,t.line,r.line+1),o.atomic&&eh(s)),o}function pr(n,t){this.markers=n,this.primary=t;for(var i=0,r=this;i<n.length;++i)n[i].parent=this,e(n[i],"clear",function(){r.clear()})}function pa(n,t,i,r,f){r=kf(r),r.shared=!1;var e=[yr(n,t,i,r,f)],o=e[0];return wi(n,function(n){e.push(yr(n,u(n,t),u(n,i),r,f));for(var s=0;s<n.linked.length;++s)if(n.linked[s].isParent)return;o=y(e)}),new pr(e,o)}function wr(n,t){var i,r;if(n)for(i=0;i<n.length;++i)if(r=n[i],r.marker==t)return r}function wa(n,t){for(var r,i=0;i<n.length;++i)n[i]!=t&&(r||(r=[])).push(n[i]);return r}function ba(n,t){n.markedSpans=n.markedSpans?n.markedSpans.concat([t]):[t],t.marker.attachLine(n)}function ka(n,t,i){var u,e,o;if(n)for(u=0;u<n.length;++u){var r=n[u],f=r.marker,s=r.from==null||(f.inclusiveLeft?r.from<=t:r.from<t);!s&&(f.type!="bookmark"||r.from!=t||i&&r.marker.insertLeft)||(o=r.to==null||(f.inclusiveRight?r.to>=t:r.to>t),(e||(e=[])).push({from:r.from,to:o?null:r.to,marker:f}))}return e}function da(n,t,i){var u,e,o;if(n)for(u=0;u<n.length;++u){var r=n[u],f=r.marker,s=r.to==null||(f.inclusiveRight?r.to>=t:r.to>t);(s||f.type=="bookmark"&&r.from==t&&(!i||r.marker.insertLeft))&&(o=r.from==null||(f.inclusiveLeft?r.from<=t:r.from<t),(e||(e=[])).push({from:o?null:r.from-t,to:r.to==null?null:r.to-t,marker:f}))}return e}function so(n,t){var w=dt(n,t.from.line)&&r(n,t.from.line).markedSpans,b=dt(n,t.to.line)&&r(n,t.to.line).markedSpans,u,e,l,v,p,i;if(!w&&!b)return null;var a=t.from.ch,d=t.to.ch,k=s(t.from,t.to),f=ka(w,a,k),o=da(b,d,k),h=t.text.length==1,c=y(t.text).length+(h?a:0);if(f)for(i=0;i<f.length;++i)u=f[i],u.to==null&&(e=wr(o,u.marker),e?h&&(u.to=e.to==null?null:e.to+c):u.to=a);if(o)for(i=0;i<o.length;++i)u=o[i],u.to!=null&&(u.to+=c),u.from==null?(e=wr(f,u.marker),e||(u.from=c,h&&(f||(f=[])).push(u))):(u.from+=c,h&&(f||(f=[])).push(u));if(l=[f],!h){if(v=t.text.length-2,v>0&&f)for(i=0;i<f.length;++i)f[i].to==null&&(p||(p=[])).push({from:null,to:null,marker:f[i].marker});for(i=0;i<v;++i)l.push(p);l.push(o)}return l}function yh(n,t){var i=ov(n,t),s=so(n,t),r,f,u,e,h,o;if(!i)return s;if(!s)return i;for(r=0;r<i.length;++r)if(f=i[r],u=s[r],f&&u)n:for(e=0;e<u.length;++e){for(h=u[e],o=0;o<f.length;++o)if(f[o].marker==h.marker)continue n;f.push(h)}else u&&(i[r]=u);return i}function ga(n,t,i){var f=null,e,l,a,r,o,u,c;if(n.iter(t.line,i.line+1,function(n){var t,i;if(n.markedSpans)for(t=0;t<n.markedSpans.length;++t)i=n.markedSpans[t].marker,i.readOnly&&(!f||ht(f,i)==-1)&&(f||(f=[])).push(i)}),!f)return null;for(e=[{from:t,to:i}],l=0;l<f.length;++l)for(a=f[l],r=a.find(),o=0;o<e.length;++o)(u=e[o],h(u.to,r.from)||h(r.to,u.from))||(c=[o,1],(h(u.from,r.from)||!a.inclusiveLeft&&s(u.from,r.from))&&c.push({from:u.from,to:r.from}),(h(r.to,u.to)||!a.inclusiveRight&&s(u.to,r.to))&&c.push({from:r.to,to:u.to}),e.splice.apply(e,c),o+=c.length-1);return e}function of(n,t){var f=tr&&n.markedSpans,r,i,u;if(f)for(u=0;u<f.length;++u)(i=f[u],i.marker.collapsed)&&(i.from==null||i.from<t)&&(i.to==null||i.to>t)&&(!r||r.width<i.marker.width)&&(r=i.marker);return r}function sf(n){return of(n,-1)}function br(n){return of(n,n.text.length+1)}function yi(n,t){for(var i;i=sf(t);)t=r(n,i.find().from.line);return t}function ti(n,t){var u=tr&&t.markedSpans,i,r;if(u)for(r=0;r<u.length;++r)if((i=u[r],i.marker.collapsed)&&(i.from==null||i.from==0&&i.marker.inclusiveLeft&&ho(n,t,i)))return!0}function ho(n,t,i){var o,e,u,f;if(i.to==null)return o=i.marker.find().to,e=r(n,o.line),ho(n,e,wr(e.markedSpans,i.marker));if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(f=0;f<t.markedSpans.length;++f)if(u=t.markedSpans[f],u.marker.collapsed&&u.from==i.to&&(u.marker.inclusiveLeft||i.marker.inclusiveRight)&&ho(n,t,u))return!0}function ph(n){var i=n.markedSpans,t;if(i){for(t=0;t<i.length;++t)i[t].marker.detachLine(n);n.markedSpans=null}}function wh(n,t){if(t){for(var i=0;i<t.length;++i)t[i].marker.attachLine(n);n.markedSpans=t}}function bh(n){return function(){var t=!this.cm.curOp,i;t&&si(this.cm);try{i=n.apply(this,arguments)}finally{t&&hi(this.cm)}return i}}function cf(n){return n.height!=null?n.height:(n.node.parentNode&&n.node.parentNode.nodeType==1||ct(n.cm.display.measure,i("div",[n.node],null,"position: relative")),n.height=n.node.offsetHeight)}function nv(n,t,i,r){var u=new hf(n,i,r);return u.noHScroll&&(n.display.alignWidgets=!0),tf(n,t,function(t){if((t.widgets||(t.widgets=[])).push(u),u.line=t,!ti(n.doc,t)||u.showIfHidden){var i=bi(n,t)<n.display.scroller.scrollTop;it(t,t.height+cf(u)),i&&(n.curOp.updateScrollPos={scrollTop:n.doc.scrollTop+u.height,scrollLeft:n.doc.scrollLeft})}return!0}),u}function kr(n,t,i){var r={text:n};return wh(r,t),r.height=i?i(r):1,r}function pi(n,t,i,r){n.text=t,n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null),n.order!=null&&(n.order=null),ph(n),wh(n,i);var u=r?r(n):1;u!=n.height&&it(n,u),ut(n,"change")}function tv(n){n.parent=null,ph(n)}function kh(n,t,i,r,u){var c=n.options.flattenSpans,e="",o=null,f=new vr(t,n.options.tabSize),s,h;for(t==""&&i.blankLine&&i.blankLine(r);!f.eol();)s=i.token(f,r),f.pos>5e3&&(c=!1,f.pos=Math.min(t.length,f.start+5e4),s=null),h=f.current(),f.start=f.pos,c&&o==s?e=e+h:(e&&u(e,o),e=h,o=s);e&&u(e,o)}function dh(n,t,i){var u=[n.state.modeGen],f,e,r;for(kh(n,t.text,n.doc.mode,i,function(n,t){u.push(n,t)}),f=0;f<n.state.overlays.length;++f)e=n.state.overlays[f],r=1,kh(n,t.text,e.mode,!0,function(n,t){for(var f=r,o=n.length,s,i;o;)i=u[r],s=i.length,s<=o?o-=s:(u.splice(r,1,i.slice(0,o),u[r+1],i.slice(o)),o=0),r+=2;if(t)if(e.opaque)u.splice(f,r-f,n,t),r=f+2;else for(;f<r;f+=2)i=u[f+1],u[f+1]=i?i+" "+t:t});return u}function iv(n,t){return t.styles&&t.styles[0]==n.state.modeGen||(t.styles=dh(n,t,t.stateAfter=rr(n,d(t)))),t.styles}function gh(n,t,i){var u=n.doc.mode,r=new vr(t.text,n.options.tabSize);for(t.text==""&&u.blankLine&&u.blankLine(i);!r.eol()&&r.pos<=5e3;)u.token(r,i),r.start=r.pos}function nc(n){return n?co[n]||(co[n]="cm-"+n.replace(/ +/g," cm-")):null}function tc(n,t,u){for(var w,e=t,a,b,v=!0,f,c,o,s,l,y,h;w=sf(e);)v=!1,e=r(n.doc,w.find().from.line),a||(a=e);f={pre:i("pre"),col:0,pos:0,display:!u,measure:null,addedOne:!1,cm:n},e.textClass&&(f.pre.className=e.textClass);do f.measure=e==t&&u,f.pos=0,f.addToken=f.measure?rv:ic,u&&b&&e!=t&&!f.addedOne&&(u[0]=f.pre.appendChild(ko(n.display.measure)),f.addedOne=!0),c=uv(e,f,iv(n,e)),b=e==a,c&&(e=r(n.doc,c.to.line),v=!1);while(c);return u&&!f.addedOne&&(u[0]=f.pre.appendChild(v?i("span"," "):ko(n.display.measure))),f.pre.firstChild||ti(n.doc,t)||f.pre.appendChild(document.createTextNode(" ")),u&&p&&(o=rt(e))&&(s=o.length-1,o[s].from==o[s].to&&--s,l=o[s],y=o[s-1],l.from+1==l.to&&y&&l.level<y.level&&(h=u[f.pos-1],h&&h.parentNode.insertBefore(h.measureRight=ko(n.display.measure),h.nextSibling))),f.pre}function ic(n,t,r,u,f){var e,o,s,h,l,a,v,c;if(t){if(lf.test(t))for(e=document.createDocumentFragment(),o=0;;){if(lf.lastIndex=o,s=lf.exec(t),h=s?s.index-o:t.length-o,h&&(e.appendChild(document.createTextNode(t.slice(o,o+h))),n.col+=h),!s)break;o+=h+1,s[0]=="\t"?(l=n.cm.options.tabSize,a=l-n.col%l,e.appendChild(i("span",vc(a),"cm-tab")),n.col+=a):(v=i("span","•","cm-invalidchar"),v.title="\\u"+s[0].charCodeAt(0).toString(16),e.appendChild(v),n.col+=1)}else n.col+=t.length,e=document.createTextNode(t);if(r||u||f||n.measure)return c=r||"",u&&(c+=u),f&&(c+=f),n.pre.appendChild(i("span",[e],c));n.pre.appendChild(e)}}function rv(n,t,r,u,f){for(var o,s,e=0;e<t.length;++e)o=t.charAt(e),s=e==0,o>="�"&&o<"�"&&e<t.length-1?(o=t.slice(e,e+2),++e):e&&n.cm.options.lineWrapping&&ru.test(t.slice(e-1,e+1))&&n.pre.appendChild(i("wbr")),n.measure[n.pos]=ic(n,o,r,s&&u,e==t.length-1&&f),n.pos+=o.length;t.length&&(n.addedOne=!0)}function rc(n,t,i){i&&(n.display||(i=i.cloneNode(!0)),n.pre.appendChild(i),n.measure&&t&&(n.measure[n.pos]=i,n.addedOne=!0)),n.pos+=t}function uv(n,t,i){var b=n.markedSpans,s,y,p,u,e,c,w,g;if(!b){for(s=1;s<i.length;s+=2)t.addToken(t,i[s],nc(i[s+1]));return}for(var nt=n.text,k=nt.length,r=0,s=1,h="",d,o=0,l,a,v,f;;){if(o==r){for(l=a=v="",f=null,o=Infinity,y=null,p=0;p<b.length;++p)u=b[p],e=u.marker,u.from<=r&&(u.to==null||u.to>r)?(u.to!=null&&o>u.to&&(o=u.to,a=""),e.className&&(l+=" "+e.className),e.startStyle&&u.from==r&&(v+=" "+e.startStyle),e.endStyle&&u.to==o&&(a+=" "+e.endStyle),e.collapsed&&(!f||f.marker.width<e.width)&&(f=u)):u.from>r&&o>u.from&&(o=u.from),e.type=="bookmark"&&u.from==r&&e.replacedWith&&(y=e.replacedWith);if(f&&(f.from||0)==r&&(rc(t,(f.to==null?k:f.to)-r,f.from!=null&&f.marker.replacedWith),f.to==null))return f.marker.find();y&&!f&&rc(t,0,y)}if(r>=k)break;for(c=Math.min(k,o);;){if(h){if(w=r+h.length,f||(g=w>c?h.slice(0,c-r):h,t.addToken(t,g,d?d+l:l,v,r+g.length==o?a:"")),w>=c){h=h.slice(c-r),r=c;break}r=w,v=""}h=i[s++],d=nc(i[s++])}}}function lo(n,t,i,u,f){function l(n){return i?i[n]:null}var o=t.from,a=t.to,s=t.text,h=r(n,o.line),v=r(n,a.line),b=y(s),k=l(s.length-1),p=a.line-o.line;if(o.ch==0&&a.ch==0&&b==""){for(var e=0,w=s.length-1,c=[];e<w;++e)c.push(kr(s[e],l(e),f));pi(v,v.text,k,f),p&&n.remove(o.line,p),c.length&&n.insert(o.line,c)}else if(h==v)if(s.length==1)pi(h,h.text.slice(0,o.ch)+b+h.text.slice(a.ch),k,f);else{for(var c=[],e=1,w=s.length-1;e<w;++e)c.push(kr(s[e],l(e),f));c.push(kr(b+h.text.slice(a.ch),k,f)),pi(h,h.text.slice(0,o.ch)+s[0],l(0),f),n.insert(o.line+1,c)}else if(s.length==1)pi(h,h.text.slice(0,o.ch)+s[0]+v.text.slice(a.ch),l(0),f),n.remove(o.line+1,p);else{pi(h,h.text.slice(0,o.ch)+s[0],l(0),f),pi(v,b+v.text.slice(a.ch),k,f);for(var e=1,w=s.length-1,c=[];e<w;++e)c.push(kr(s[e],l(e),f));p>1&&n.remove(o.line+1,p-1),n.insert(o.line+1,c)}ut(n,"change",n,t),at(n,u.anchor,u.head,null,!0)}function af(n){this.lines=n,this.parent=null;for(var t=0,r=n.length,i=0;t<r;++t)n[t].parent=this,i+=n[t].height;this.height=i}function dr(n){var r,u,t,f,i;for(this.children=n,r=0,u=0,t=0,f=n.length;t<f;++t)i=n[t],r+=i.chunkSize(),u+=i.height,i.parent=this;this.size=r,this.height=u,this.parent=null}function wi(n,t,i){function r(n,u,f){var o,e,s;if(n.linked)for(o=0;o<n.linked.length;++o)(e=n.linked[o],e.doc!=u)&&(s=f&&e.sharedHist,!i||s)&&(t(e.doc,s),r(e.doc,n,s))}r(n,null,!0)}function ec(n,t){if(t.cm)throw new Error("This document is already in use.");n.doc=t,t.cm=n,es(n),fu(n),n.options.lineWrapping||he(n),n.options.mode=t.modeOption,c(n)}function r(n,t){var i,r,u;for(t-=n.first;!n.lines;)for(i=0;;++i){if(r=n.children[i],u=r.chunkSize(),t<u){n=r;break}t-=u}return n.lines[t]}function oc(n,t,i){var u=[],r=t.line;return n.iter(t.line,i.line+1,function(n){var f=n.text;r==i.line&&(f=f.slice(0,i.ch)),r==t.line&&(f=f.slice(t.ch)),u.push(f),++r}),u}function ao(n,t,i){var r=[];return n.iter(t,i,function(n){r.push(n.text)}),r}function it(n,t){for(var r=t-n.height,i=n;i;i=i.parent)i.height+=r}function d(n){var i,u,t,r;if(n.parent==null)return null;for(i=n.parent,u=ht(i.lines,n),t=i.parent;t;i=t,t=t.parent)for(r=0;;++r){if(t.children[r]==i)break;u+=t.children[r].chunkSize()}return u+i.first}function vf(n,t){var f=n.first,u,e,i,r,s,o;n:do{for(i=0,r=n.children.length;i<r;++i){if(u=n.children[i],e=u.height,t<e){n=u;continue n}t-=e,f+=u.chunkSize()}return f}while(!n.lines);for(i=0,r=n.lines.length;i<r;++i){if(s=n.lines[i],o=s.height,t<o)break;t-=o}return f+i}function bi(n,t){var f,r,e,u,i,o;for(t=yi(n.doc,t),f=0,r=t.parent,i=0;i<r.lines.length;++i)if(e=r.lines[i],e==t)break;else f+=e.height;for(u=r.parent;u;r=u,u=r.parent)for(i=0;i<u.children.length;++i)if(o=u.children[i],o==r)break;else f+=o.height;return f}function rt(n){var t=n.order;return t==null&&(t=n.order=il(n.text)),t}function yf(){return{done:[],undone:[],undoDepth:Infinity,lastTime:0,lastOp:null,lastOrigin:null,dirtyCounter:0}}function sc(n,t,i,r){var u=t["spans_"+n.id],f=0;n.iter(Math.max(n.first,i),Math.min(n.first+n.size,r),function(i){i.markedSpans&&((u||(u=t["spans_"+n.id]={}))[f]=i.markedSpans),++f})}function vo(n,t){var i={from:t.from,to:no(t),text:oc(n,t.from,t.to)};return sc(n,i,t.from.line,t.to.line+1),wi(n,function(n){sc(n,i,t.from.line,t.to.line+1)},!0),i}function fv(n,t,i,r){var u=n.history,e,f,o;if(u.undone.length=0,e=+new Date,f=y(u.done),f&&(u.lastOp==r||u.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&u.lastTime>e-600||t.origin.charAt(0)=="*")))o=y(f.changes),s(t.from,t.to)&&s(t.from,o.to)?o.to=no(t):f.changes.push(vo(n,t)),f.anchorAfter=i.anchor,f.headAfter=i.head;else{for(f={changes:[vo(n,t)],anchorBefore:n.sel.anchor,headBefore:n.sel.head,anchorAfter:i.anchor,headAfter:i.head},u.done.push(f);u.done.length>u.undoDepth;)u.done.shift();u.dirtyCounter<0?u.dirtyCounter=NaN:u.dirtyCounter++}u.lastTime=e,u.lastOp=r,u.lastOrigin=t.origin}function ev(n){if(!n)return null;for(var i=0,t;i<n.length;++i)n[i].marker.explicitlyCleared?t||(t=n.slice(0,i)):t&&t.push(n[i]);return t?t.length?t:null:n}function ov(n,t){var u=t["spans_"+n.id],i,r;if(!u)return null;for(i=0,r=[];i<t.text.length;++i)r.push(ev(u[i]));return r}function pf(n,t){for(var e,i,c,u,f=0,o=[];f<n.length;++f){var r=n[f],h=r.changes,s=[];for(o.push({changes:s,anchorBefore:r.anchorBefore,headBefore:r.headBefore,anchorAfter:r.anchorAfter,headAfter:r.headAfter}),e=0;e<h.length;++e)if(i=h[e],s.push({from:i.from,to:i.to,text:i.text}),t)for(u in i)(c=u.match(/^spans_(\d+)$/))&&ht(t,Number(c[1]))>-1&&(y(s)[u]=i[u],delete i[u])}return o}function wf(n,t,i,r){i<n.line?n.line+=r:t<n.line&&(n.line=t,n.ch=0)}function hc(n,t,i,r){for(var u,s,o,f,e=0;e<n.length;++e){for(u=n[e],s=!0,o=0;o<u.changes.length;++o)if(f=u.changes[o],u.copied||(f.from=kt(f.from),f.to=kt(f.to)),i<f.from.line)f.from.line+=r,f.to.line+=r;else if(t<=f.to.line){s=!1;break}u.copied||(u.anchorBefore=kt(u.anchorBefore),u.headBefore=kt(u.headBefore),u.anchorAfter=kt(u.anchorAfter),u.readAfter=kt(u.headAfter),u.copied=!0),s?(wf(u.anchorBefore),wf(u.headBefore),wf(u.anchorAfter),wf(u.headAfter)):(n.splice(0,e+1),e=0)}}function cc(n,t){var i=t.from.line,r=t.to.line,u=t.text.length-(r-i)-1;hc(n.done,i,r,u),hc(n.undone,i,r,u)}function sv(){bf(this)}function nu(n){return n.stop||(n.stop=sv),n}function a(n){n.preventDefault?n.preventDefault():n.returnValue=!1}function lc(n){n.stopPropagation?n.stopPropagation():n.cancelBubble=!0}function bf(n){a(n),lc(n)}function yo(n){return n.target||n.srcElement}function ac(n){var t=n.which;return t==null&&(n.button&1?t=1:n.button&2?t=3:n.button&4&&(t=2)),ei&&n.ctrlKey&&t==1&&(t=3),t}function e(n,t,i){if(n.addEventListener)n.addEventListener(t,i,!1);else if(n.attachEvent)n.attachEvent("on"+t,i);else{var r=n._handlers||(n._handlers={}),u=r[t]||(r[t]=[]);u.push(i)}}function st(n,t,i){var r,u;if(n.removeEventListener)n.removeEventListener(t,i,!1);else if(n.detachEvent)n.detachEvent("on"+t,i);else{if(r=n._handlers&&n._handlers[t],!r)return;for(u=0;u<r.length;++u)if(r[u]==i){r.splice(u,1);break}}}function g(n,t){var r=n._handlers&&n._handlers[t],u,i;if(r)for(u=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,u)}function ut(n,t){function f(n){return function(){n.apply(null,u)}}var r=n._handlers&&n._handlers[t],u,i;if(r)for(u=Array.prototype.slice.call(arguments,2),vt||(++tu,vt=[],setTimeout(hv,0)),i=0;i<r.length;++i)vt.push(f(r[i]))}function hv(){var t,n;for(--tu,t=vt,vt=null,n=0;n<t.length;++n)t[n]()}function ki(n,t){var i=n._handlers&&n._handlers[t];return i&&i.length>0}function wo(){this.id=null}function gi(n,t,i){t==null&&(t=n.search(/[^\s\u00a0]/),t==-1&&(t=n.length));for(var u=0,r=0;u<t;++u)n.charAt(u)=="\t"?r+=i-r%i:++r;return r}function vc(n){while(iu.length<=n)iu.push(y(iu)+" ");return iu[n]}function y(n){return n[n.length-1]}function yc(n){uu?(n.selectionStart=0,n.selectionEnd=n.value.length):n.select()}function ht(n,t){if(n.indexOf)return n.indexOf(t);for(var i=0,r=n.length;i<r;++i)if(n[i]==t)return i;return-1}function cv(n,t){function i(){}i.prototype=n;var r=new i;return t&&kf(t,r),r}function kf(n,t){t||(t={});for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i]);return t}function pc(n){for(var t=[],i=0;i<n;++i)t.push(undefined);return t}function nt(n){var t=Array.prototype.slice.call(arguments,1);return function(){return n.apply(null,t)}}function df(n){return/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||wc.test(n))}function bc(n){for(var t in n)if(n.hasOwnProperty(t)&&n[t])return!1;return!0}function i(n,t,i,r){var u=document.createElement(n),f;if(i&&(u.className=i),r&&(u.style.cssText=r),typeof t=="string")kc(u,t);else if(t)for(f=0;f<t.length;++f)u.appendChild(t[f]);return u}function ne(n){if(p)while(n.firstChild)n.removeChild(n.firstChild);else n.innerHTML="";return n}function ct(n,t){return ne(n).appendChild(t)}function kc(n,t){yt?(n.innerHTML="",n.appendChild(document.createTextNode(t))):n.textContent=t}function l(n){return n.getBoundingClientRect()}function ie(n){if(te!=null)return te;var t=i("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return ct(n,t),t.offsetWidth&&(te=t.offsetHeight-t.clientHeight),te||0}function ko(n){if(bo==null){var t=i("span","");ct(n,i("span",[t,document.createTextNode("x")])),n.firstChild.offsetHeight!=0&&(bo=t.offsetWidth<=1&&t.offsetHeight>2&&!fi)}return bo?i("span",""):i("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function av(n,t,i,r){var f,u;if(!n)return r(t,i,"ltr");for(f=0;f<n.length;++f)u=n[f],(u.from<i&&u.to>t||t==i&&u.to==t)&&r(Math.max(u.from,t),Math.min(u.to,i),u.level==1?"rtl":"ltr")}function go(n){return n.level%2?n.to:n.from}function ns(n){return n.level%2?n.from:n.to}function re(n){var t=rt(n);return t?go(t[0]):0}function ue(n){var t=rt(n);return t?ns(y(t)):n.text.length}function nl(n,i){var e=r(n.doc,i),u=yi(n.doc,e),f,o;return u!=e&&(i=d(u)),f=rt(u),o=f?f[0].level%2?ue(u):re(u):0,t(i,o)}function vv(n,i){for(var e,u,f,o;e=br(u=r(n.doc,i));)i=e.find().to.line;return f=rt(u),o=f?f[0].level%2?re(u):ue(u):u.text.length,t(i,o)}function ts(n,t,i,r){var e=rt(n),s,h,o,u,c,f;if(!e)return tl(n,t,i,r);for(s=r?function(t,i){do t+=i;while(t>0&&gf.test(n.text.charAt(t)));return t}:function(n,t){return n+t},h=e[0].level,o=0;o<e.length;++o)if(u=e[o],c=u.level%2==h,u.from<t&&u.to>t||c&&(u.from==t||u.to==t))break;for(f=s(t,u.level%2?-i:i);f!=null;)if(u.level%2==h)if(f<u.from||f>u.to)u=e[o+=i],f=u&&(i>0==u.level%2?s(u.to,-1):s(u.from,1));else break;else if(f==go(u))u=e[--o],f=u&&ns(u);else if(f==ns(u))u=e[++o],f=u&&go(u);else break;return f<0||f>n.text.length?null:f}function tl(n,t,i,r){var u=t+i;if(r)while(u>0&&gf.test(n.text.charAt(u)))u+=i;return u<0||u>n.text.length?null:u}var ui=/gecko\/\d/i.test(navigator.userAgent),p=/MSIE \d/.test(navigator.userAgent),fi=p&&(document.documentMode==null||document.documentMode<8),yt=p&&(document.documentMode==null||document.documentMode<9),ft=/WebKit\//.test(navigator.userAgent),rl=ft&&/Qt\/\d+\.\d+/.test(navigator.userAgent),is=/Chrome\//.test(navigator.userAgent),et=/Opera\//.test(navigator.userAgent),fe=/Apple Computer/.test(navigator.vendor),ee=/KHTML\//.test(navigator.userAgent),ul=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),fl=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),el=/PhantomJS/.test(navigator.userAgent),uu=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),oe=uu||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),ei=uu||/Mac/.test(navigator.platform),ol=/windows/i.test(navigator.platform),nr=et&&navigator.userAgent.match(/Version\/(\d*\.\d*)/),pt,ps,pu,wu,hr,b,ds,ku,ge,gt,rf,fo,eo,uf,ai,ff,ef,tt,hf,co,lf,uc,k,fc,gr,vt,tu,di,po,iu,wc,gf,dc,ru,te,bo,ii,il;nr&&(nr=Number(nr[1]));var rs=ei&&(rl||et&&(nr==null||nr<12.11)),se=ui||p&&!yt,us=!1,tr=!1;ps=0,hr=0,b=null,p?b=-.53:ui?b=15:is?b=-.7:fe&&(b=-1/3),ku=null,n.Pos=t,n.prototype={focus:function(){window.focus(),w(this),bt(this),fr(this)},setOption:function(n,t){var i=this.options,r=i[n];(i[n]!=t||n=="mode")&&(i[n]=t,gt.hasOwnProperty(n)&&f(this,gt[n])(this,t,r))},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n){this.state.keyMaps.push(n)},removeKeyMap:function(n){for(var i=this.state.keyMaps,t=0;t<i.length;++t)if((typeof n=="string"?i[t].name:i[t])==n)return i.splice(t,1),!0},addOverlay:f(null,function(t,i){var r=t.token?t:n.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:t,opaque:i&&i.opaque}),this.state.modeGen++,c(this)}),removeOverlay:f(null,function(n){for(var i=this.state.overlays,t=0;t<i.length;++t)if(i[t].modeSpec==n){i.splice(t,1),this.state.modeGen++,c(this);return}}),indentLine:f(null,function(n,t,i){typeof t!="string"&&(t=t==null?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),dt(this.doc,n)&&nf(this,n,t,i)}),indentSelection:f(null,function(n){var t=this.doc.sel,r,i;if(s(t.from,t.to))return nf(this,t.from.line,n);for(r=t.to.line-(t.to.ch?0:1),i=t.from.line;i<=r;++i)nf(this,i,n)}),getTokenAt:function(n){var f=this.doc,i;n=u(f,n);for(var e=rr(this,n.line),o=this.doc.mode,s=r(f,n.line),t=new vr(s.text,this.options.tabSize);t.pos<n.ch&&!t.eol();)t.start=t.pos,i=o.token(t,e);return{start:t.start,end:t.pos,string:t.current(),className:i||null,type:i||null,state:e}},getStateAfter:function(n){var t=this.doc;return n=fh(t,n==null?t.first+t.size-1:n),rr(this,n+1)},cursorCoords:function(n,t){var r,i=this.doc.sel;return r=n==null?i.head:typeof n=="object"?u(this.doc,n):n?i.from:i.to,ot(this,r,t||"page")},charCoords:function(n,t){return we(this,u(this.doc,n),t||"page")},coordsChar:function(n){var t=l(this.display.lineSpace),i=window.pageYOffset||(document.documentElement||document.body).scrollTop,r=window.pageXOffset||(document.documentElement||document.body).scrollLeft;return be(this,n.left-t.left-r,n.top-t.top-i)},defaultTextHeight:function(){return vu(this.display)},setGutterMarker:f(null,function(n,t,i){return tf(this,n,function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&bc(r)&&(n.gutterMarkers=null),!0})}),clearGutter:f(null,function(n){var i=this,r=i.doc,t=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[n]&&(r.gutterMarkers[n]=null,c(i,t,t+1),bc(r.gutterMarkers)&&(r.gutterMarkers=null)),++t})}),addLineClass:f(null,function(n,t,i){return tf(this,n,function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":"wrapClass";if(n[r]){if(new RegExp("\\b"+i+"\\b").test(n[r]))return!1;n[r]+=" "+i}else n[r]=i;return!0})}),removeLineClass:f(null,function(n,t,i){return tf(this,n,function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":"wrapClass",u=n[r],f;if(u)if(i==null)n[r]=null;else{if(f=u.replace(new RegExp("^"+i+"\\b\\s*|\\s*\\b"+i+"\\b"),""),f==u)return!1;n[r]=f||null}else return!1;return!0})}),addLineWidget:f(null,function(n,t,i){return nv(this,n,t,i)}),removeLineWidget:function(n){n.clear()},lineInfo:function(n){var t;if(typeof n=="number"){if(!dt(this.doc,n)||(t=n,n=r(this.doc,n),!n))return null}else if(t=d(n),t==null)return null;return{line:t,handle:n,text:n.text,gutterMarkers:n.gutterMarkers,textClass:n.textClass,bgClass:n.bgClass,wrapClass:n.wrapClass,widgets:n.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(n,t,i,r,f){var o=this.display,s,e,h,c;n=ot(this,u(this.doc,n)),s=n.bottom,e=n.left,t.style.position="absolute",o.sizer.appendChild(t),r=="over"?s=n.top:(r=="above"||r=="near")&&(h=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth),(r=="above"||n.bottom+t.offsetHeight>h)&&n.top>t.offsetHeight?s=n.top-t.offsetHeight:n.bottom+t.offsetHeight<=h&&(s=n.bottom),e+t.offsetWidth>c&&(e=c-t.offsetWidth)),t.style.top=s+cu(o)+"px",t.style.left=t.style.right="",f=="right"?(e=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):(f=="left"?e=0:f=="middle"&&(e=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=e+"px"),i&&sh(this,e,s,e+t.offsetWidth,s+t.offsetHeight)},triggerOnKeyDown:f(null,nh),execCommand:function(n){return ef[n](this)},findPosH:function(n,t,i,r){var o=1,e,f;for(t<0&&(o=-1,t=-t),e=0,f=u(this.doc,n);e<t;++e)if(f=uo(this.doc,f,o,i,r),f.hitSide)break;return f},moveH:f(null,function(n,t){var i=this.doc.sel,r;r=i.shift||i.extend||s(i.from,i.to)?uo(this.doc,i.head,n,t,this.options.rtlMoveVisually):n<0?i.from:i.to,v(this.doc,r,r,n)}),deleteH:f(null,function(n,t){var i=this.doc.sel;s(i.from,i.to)?lt(this.doc,"",i.from,uo(this.doc,i.head,n,t,!1),"+delete"):lt(this.doc,"",i.from,i.to,"+delete"),this.curOp.userSelChange=!0}),findPosV:function(n,t,i,r){var h=1,o=r,s,f,e;for(t<0&&(h=-1,t=-t),s=0,f=u(this.doc,n);s<t;++s)if(e=ot(this,f,"div"),o==null?o=e.left:e.left=o,f=hh(this,e,h,i),f.hitSide)break;return f},moveV:f(null,function(n,t){var i=this.doc.sel,r=ot(this,i.head,"div"),u;i.goalColumn!=null&&(r.left=i.goalColumn),u=hh(this,r,n,t),t=="page"&&(this.display.scrollbarV.scrollTop+=we(this,u,"div").top-r.top),v(this.doc,u,u,n),i.goalColumn=r.left}),toggleOverwrite:function(){(this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+=" CodeMirror-overwrite":this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite","")},scrollTo:f(null,function(n,t){this.curOp.updateScrollPos={scrollLeft:n,scrollTop:t}}),getScrollInfo:function(){var n=this.display.scroller,t=di;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-t,width:n.scrollWidth-t,clientHeight:n.clientHeight-t,clientWidth:n.clientWidth-t}},scrollIntoView:function(n){typeof n=="number"&&(n=t(n,0)),n&&n.line==null?sh(this,n.left,n.top,n.right,n.bottom):(n=n?u(this.doc,n):this.doc.sel.head,oh(this,n))},setSize:function(n,t){function i(n){return typeof n=="number"||/^\d+$/.test(String(n))?n+"px":n}n!=null&&(this.display.wrapper.style.width=i(n)),t!=null&&(this.display.wrapper.style.height=i(t)),this.refresh()},on:function(n,t){e(this,n,t)},off:function(n,t){st(this,n,t)},operation:function(n){return ws(this,n)},refresh:f(null,function(){oi(this),this.curOp.updateScrollPos={scrollTop:this.doc.scrollTop,scrollLeft:this.doc.scrollLeft},c(this)}),swapDoc:f(null,function(n){var t=this.doc;return t.cm=null,ec(this,n),oi(this),this.curOp.updateScrollPos={scrollTop:n.scrollTop,scrollLeft:n.scrollLeft},t}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},gt=n.optionHandlers={},rf=n.defaults={},fo=n.Init={toString:function(){return"CodeMirror.Init"}},o("value","",function(n,t){n.setValue(t)},!0),o("mode",null,function(n,t){n.doc.modeOption=t,fu(n)},!0),o("indentUnit",2,fu,!0),o("indentWithTabs",!1),o("smartIndent",!0),o("tabSize",4,function(n){fu(n),oi(n),c(n)},!0),o("electricChars",!0),o("rtlMoveVisually",!ol),o("theme","default",function(n){os(n),ir(n)},!0),o("keyMap","default",cl),o("extraKeys",null),o("onKeyEvent",null),o("onDragEvent",null),o("lineWrapping",!1,hl,!0),o("gutters",[],function(n){ce(n.options),ir(n)},!0),o("fixedGutter",!0,function(n,t){n.display.gutters.style.left=t?ve(n.display)+"px":"0",n.refresh()},!0),o("lineNumbers",!1,function(n){ce(n.options),ir(n)},!0),o("firstLineNumber",1,ir,!0),o("lineNumberFormatter",function(n){return n},ir,!0),o("showCursorWhenSelecting",!1,pe,!0),o("readOnly",!1,function(n,t){t=="nocursor"?(de(n),n.display.input.blur()):t||wt(n,!0)}),o("dragDrop",!0),o("cursorBlinkRate",530),o("cursorHeight",1),o("workTime",100),o("workDelay",100),o("flattenSpans",!0),o("pollInterval",100),o("undoDepth",40,function(n,t){n.doc.history.undoDepth=t}),o("viewportMargin",10,function(n){n.refresh()},!0),o("tabindex",null,function(n,t){n.display.input.tabIndex=t||""}),o("autofocus",null),eo=n.modes={},uf=n.mimeModes={},n.defineMode=function(t,i){if(n.defaults.mode||t=="null"||(n.defaults.mode=t),arguments.length>2){i.dependencies=[];for(var r=2;r<arguments.length;++r)i.dependencies.push(arguments[r])}eo[t]=i},n.defineMIME=function(n,t){uf[n]=t},n.resolveMode=function(t){if(typeof t=="string"&&uf.hasOwnProperty(t))t=uf[t];else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return n.resolveMode("application/xml");return typeof t=="string"?{name:t}:t||{name:"null"}},n.getMode=function(t,i){var e,r,f,u;if(i=n.resolveMode(i),e=eo[i.name],!e)return n.getMode(t,"text/plain");if(r=e(t,i),ai.hasOwnProperty(i.name)){f=ai[i.name];for(u in f)f.hasOwnProperty(u)&&(r.hasOwnProperty(u)&&(r["_"+u]=r[u]),r[u]=f[u])}return r.name=i.name,r},n.defineMode("null",function(){return{token:function(n){n.skipToEnd()}}}),n.defineMIME("text/plain","null"),ai=n.modeExtensions={},n.extendMode=function(n,t){var i=ai.hasOwnProperty(n)?ai[n]:ai[n]={};kf(t,i)},n.defineExtension=function(t,i){n.prototype[t]=i},n.defineOption=o,ff=[],n.defineInitHook=function(n){ff.push(n)},n.copyState=vi,n.startState=lh,n.innerMode=function(n,t){while(n.innerMode){var i=n.innerMode(t);t=i.state,n=i.mode}return i||{mode:n,state:t}},ef=n.commands={selectAll:function(n){n.setSelection(t(n.firstLine(),0),t(n.lastLine()))},killLine:function(n){var i=n.getCursor(!0),r=n.getCursor(!1),u=!s(i,r);u||n.getLine(i.line).length!=i.ch?n.replaceRange("",i,u?r:t(i.line),"+delete"):n.replaceRange("",i,t(i.line+1,0),"+delete")},deleteLine:function(n){var i=n.getCursor().line;n.replaceRange("",t(i,0),t(i),"+delete")},undo:function(n){n.undo()},redo:function(n){n.redo()},goDocStart:function(n){n.extendSelection(t(n.firstLine(),0))},goDocEnd:function(n){n.extendSelection(t(n.lastLine()))},goLineStart:function(n){n.extendSelection(nl(n,n.getCursor().line))},goLineStartSmart:function(n){var i=n.getCursor(),r=nl(n,i.line),f=n.getLineHandle(r.line),e=rt(f),u,o;e&&e[0].level!=0?n.extendSelection(r):(u=Math.max(0,f.text.search(/\S/)),o=i.line==r.line&&i.ch<=u&&i.ch,n.extendSelection(t(r.line,o?0:u)))},goLineEnd:function(n){n.extendSelection(vv(n,n.getCursor().line))},goLineUp:function(n){n.moveV(-1,"line")},goLineDown:function(n){n.moveV(1,"line")},goPageUp:function(n){n.moveV(-1,"page")},goPageDown:function(n){n.moveV(1,"page")},goCharLeft:function(n){n.moveH(-1,"char")},goCharRight:function(n){n.moveH(1,"char")},goColumnLeft:function(n){n.moveH(-1,"column")},goColumnRight:function(n){n.moveH(1,"column")},goWordLeft:function(n){n.moveH(-1,"word")},goWordRight:function(n){n.moveH(1,"word")},delCharBefore:function(n){n.deleteH(-1,"char")},delCharAfter:function(n){n.deleteH(1,"char")},delWordBefore:function(n){n.deleteH(-1,"word")},delWordAfter:function(n){n.deleteH(1,"word")},indentAuto:function(n){n.indentSelection("smart")},indentMore:function(n){n.indentSelection("add")},indentLess:function(n){n.indentSelection("subtract")},insertTab:function(n){n.replaceSelection("\t","end","+input")},defaultTab:function(n){n.somethingSelected()?n.indentSelection("add"):n.replaceSelection("\t","end","+input")},transposeChars:function(n){var i=n.getCursor(),r=n.getLine(i.line);i.ch>0&&i.ch<r.length-1&&n.replaceRange(r.charAt(i.ch)+r.charAt(i.ch-1),t(i.line,i.ch-1),t(i.line,i.ch+1))},newlineAndIndent:function(n){f(n,function(){n.replaceSelection("\n","end","+input"),n.indentLine(n.getCursor().line,null,!0)})()},toggleOverwrite:function(n){n.toggleOverwrite()}},tt=n.keyMap={},tt.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},tt.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":"delWordBefore","Ctrl-Delete":"delWordAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"},tt.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":"delWordBefore","Ctrl-Alt-Backspace":"delWordAfter","Alt-Delete":"delWordAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore",fallthrough:["basic","emacsy"]},tt["default"]=ei?tt.macDefault:tt.pcDefault,tt.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},n.lookupKey=ar,n.isModifierKey=ah,n.keyName=vh,n.fromTextArea=function(t,i){function f(){t.value=r.getValue()}var o,u,s,h,r;if(i||(i={}),i.value=t.value,!i.tabindex&&t.tabindex&&(i.tabindex=t.tabindex),i.autofocus==null){o=document.body;try{o=document.activeElement}catch(c){}i.autofocus=o==t||t.getAttribute("autofocus")!=null&&o==document.body}if(t.form){e(t.form,"submit",f),u=t.form,s=u.submit;try{h=u.submit=function(){f(),u.submit=s,u.submit(),u.submit=h}}catch(c){}}return t.style.display="none",r=n(function(n){t.parentNode.insertBefore(n,t.nextSibling)},i),r.save=f,r.getTextArea=function(){return t},r.toTextArea=function(){f(),t.parentNode.removeChild(r.getWrapperElement()),t.style.display="",t.form&&(st(t.form,"submit",f),typeof t.form.submit=="function"&&(t.form.submit=s))},r},vr.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(n){var t=this.string.charAt(this.pos),i;return i=typeof n=="string"?t==n:t&&(n.test?n.test(t):n(t)),i?(++this.pos,t):void 0},eatWhile:function(n){for(var t=this.pos;this.eat(n););return this.pos>t},eatSpace:function(){for(var n=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>n},skipToEnd:function(){this.pos=this.string.length},skipTo:function(n){var t=this.string.indexOf(n,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(n){this.pos-=n},column:function(){return gi(this.string,this.start,this.tabSize)},indentation:function(){return gi(this.string,null,this.tabSize)},match:function(n,t,i){var u,r;if(typeof n=="string"){if(u=function(n){return i?n.toLowerCase():n},u(this.string).indexOf(u(n),this.pos)==this.pos)return t!==!1&&(this.pos+=n.length),!0}else return(r=this.string.slice(this.pos).match(n),r&&r.index>0)?null:(r&&t!==!1&&(this.pos+=r[0].length),r)},current:function(){return this.string.slice(this.start,this.pos)}},n.StringStream=vr,n.TextMarker=ni,ni.prototype.clear=function(){var n,f,r,e,i,u,t,o,s;if(!this.explicitlyCleared){for(n=this.doc.cm,f=n&&!n.curOp,f&&si(n),r=null,e=null,t=0;t<this.lines.length;++t)i=this.lines[t],u=wr(i.markedSpans,this),u.to!=null&&(e=d(i)),i.markedSpans=wa(i.markedSpans,u),u.from!=null?r=d(i):this.collapsed&&!ti(this.doc,i)&&n&&it(i,vu(n.display));if(n&&this.collapsed&&!n.options.lineWrapping)for(t=0;t<this.lines.length;++t)o=yi(n.doc,this.lines[t]),s=eu(n.doc,o),s>n.display.maxLineLength&&(n.display.maxLine=o,n.display.maxLineLength=s,n.display.maxLineChanged=!0);r!=null&&n&&c(n,r,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.collapsed&&this.doc.cantEdit&&(this.doc.cantEdit=!1,n&&eh(n)),f&&hi(n),ut(this,"clear")}},ni.prototype.find=function(){for(var i,e,u,n,f,r=0;r<this.lines.length;++r)u=this.lines[r],n=wr(u.markedSpans,this),(n.from!=null||n.to!=null)&&(f=d(u),n.from!=null&&(i=t(f,n.from)),n.to!=null&&(e=t(f,n.to)));return this.type=="bookmark"?i:i&&{from:i,to:e}},ni.prototype.getOptions=function(n){var t=this.replacedWith;return{className:this.className,inclusiveLeft:this.inclusiveLeft,inclusiveRight:this.inclusiveRight,atomic:this.atomic,collapsed:this.collapsed,clearOnEnter:this.clearOnEnter,replacedWith:n?t&&t.cloneNode(!0):t,readOnly:this.readOnly,startStyle:this.startStyle,endStyle:this.endStyle}},ni.prototype.attachLine=function(n){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&ht(t.maybeHiddenMarkers,this)!=-1||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(n)},ni.prototype.detachLine=function(n){if(this.lines.splice(ht(this.lines,n),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},n.SharedTextMarker=pr,pr.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var n=0;n<this.markers.length;++n)this.markers[n].clear();ut(this,"clear")}},pr.prototype.find=function(){return this.primary.find()},pr.prototype.getOptions=function(n){var t=this.primary.getOptions(n);return t.shared=!0,t},hf=n.LineWidget=function(n,t,i){for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.cm=n,this.node=t},hf.prototype.clear=bh(function(){var n=this.line.widgets,i=d(this.line),t;if(i!=null&&n){for(t=0;t<n.length;++t)n[t]==this&&n.splice(t--,1);n.length||(this.line.widgets=null),it(this.line,Math.max(0,this.line.height-cf(this))),c(this.cm,i,i+1)}}),hf.prototype.changed=bh(function(){var i=this.height,n,t;(this.height=null,n=cf(this)-i,n)&&(it(this.line,this.line.height+n),t=d(this.line),c(this.cm,t,t+1))}),co={},lf=/[\t\u0000-\u0019\u200b\u2028\u2029\uFEFF]/g,af.prototype={chunkSize:function(){return this.lines.length},removeInner:function(n,t){for(var r,i=n,u=n+t;i<u;++i)r=this.lines[i],this.height-=r.height,tv(r),ut(r,"delete");this.lines.splice(n,t)},collapse:function(n){n.splice.apply(n,[n.length,0].concat(this.lines))},insertInner:function(n,t,i){this.height+=i,this.lines=this.lines.slice(0,n).concat(t).concat(this.lines.slice(n));for(var r=0,u=t.length;r<u;++r)t[r].parent=this},iterN:function(n,t,i){for(var r=n+t;n<r;++n)if(i(this.lines[n]))return!0}},dr.prototype={chunkSize:function(){return this.size},removeInner:function(n,t){var r,i,u,f,o,e;for(this.size-=t,r=0;r<this.children.length;++r)if(i=this.children[r],u=i.chunkSize(),n<u){if(f=Math.min(t,u-n),o=i.height,i.removeInner(n,f),this.height-=o-i.height,u==f&&(this.children.splice(r--,1),i.parent=null),(t-=f)==0)break;n=0}else n-=u;this.size-t<25&&(e=[],this.collapse(e),this.children=[new af(e)],this.children[0].parent=this)},collapse:function(n){for(var t=0,i=this.children.length;t<i;++t)this.children[t].collapse(n)},insertInner:function(n,t,i){var u,o,r,e,s,f;for(this.size+=t.length,this.height+=i,u=0,o=this.children.length;u<o;++u){if(r=this.children[u],e=r.chunkSize(),n<=e){if(r.insertInner(n,t,i),r.lines&&r.lines.length>50){while(r.lines.length>50)s=r.lines.splice(r.lines.length-25,25),f=new af(s),r.height-=f.height,this.children.splice(u+1,0,f),f.parent=this;this.maybeSpill()}break}n-=e}},maybeSpill:function(){var n,r,t,i,u;if(!(this.children.length<=10)){n=this;do r=n.children.splice(n.children.length-5,5),t=new dr(r),n.parent?(n.size-=t.size,n.height-=t.height,u=ht(n.parent.children,n),n.parent.children.splice(u+1,0,t)):(i=new dr(n.children),i.parent=n,n.children=[i,t],n=i),t.parent=n.parent;while(n.children.length>10);n.parent.maybeSpill()}},iterN:function(n,t,i){for(var f,u,e,r=0,o=this.children.length;r<o;++r)if(f=this.children[r],u=f.chunkSize(),n<u){if(e=Math.min(t,u-n),f.iterN(n,e,i))return!0;if((t-=e)==0)break;n=0}else n-=u}},uc=0,k=n.Doc=function(n,i,r){if(!(this instanceof k))return new k(n,i,r);r==null&&(r=0),dr.call(this,[new af([kr("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.history=yf(),this.frontier=r;var u=t(r,0);this.sel={from:u,to:u,head:u,anchor:u,shift:!1,extend:!1,goalColumn:null},this.id=++uc,this.modeOption=i,typeof n=="string"&&(n=ii(n)),lo(this,{from:u,to:u,text:n},null,{head:u,anchor:u})},k.prototype=cv(dr.prototype,{iter:function(n,t,i){i?this.iterN(n-this.first,t-n,i):this.iterN(this.first,this.first+this.size,n)},insert:function(n,t){for(var r=0,i=0,u=t.length;i<u;++i)r+=t[i].height;this.insertInner(n-this.first,t,r)},remove:function(n,t){this.removeInner(n-this.first,t)},getValue:function(n){var t=ao(this,this.first,this.first+this.size);return n===!1?t:t.join(n||"\n")},setValue:function(n){var i=t(this.first,0),u=this.first+this.size-1;cr(this,{from:i,to:t(u,r(this,u).text.length),text:ii(n),origin:"setValue"},{head:i,anchor:i},!0)},replaceRange:function(n,t,i,r){t=u(this,t),i=i?u(this,i):t,lt(this,n,t,i,r)},getRange:function(n,t,i){var r=oc(this,u(this,n),u(this,t));return i===!1?r:r.join(i||"\n")},getLine:function(n){var t=this.getLineHandle(n);return t&&t.text},setLine:function(n,i){dt(this,n)&<(this,i,t(n,0),u(this,t(n)))},removeLine:function(n){dt(this,n)&<(this,"",t(n,0),u(this,t(n+1,0)))},getLineHandle:function(n){if(dt(this,n))return r(this,n)},getLineNumber:function(n){return d(n)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(n){return u(this,n)},getCursor:function(n){var t=this.sel,i;return i=n==null||n=="head"?t.head:n=="anchor"?t.anchor:n=="end"||n===!1?t.to:t.from,kt(i)},somethingSelected:function(){return!s(this.sel.head,this.sel.anchor)},setCursor:ur(function(n,i,r){var f=u(this,typeof n=="number"?t(n,i||0):n);r?v(this,f):at(this,f,f)}),setSelection:ur(function(n,t){at(this,u(this,n),u(this,t||n))}),extendSelection:ur(function(n,t){v(this,u(this,n),t&&u(this,t))}),getSelection:function(n){return this.getRange(this.sel.from,this.sel.to,n)},replaceSelection:function(n,t,i){cr(this,{from:this.sel.from,to:this.sel.to,text:ii(n),origin:i},t||"around")},undo:ur(function(){rh(this,"undo")}),redo:ur(function(){rh(this,"redo")}),setExtending:function(n){this.sel.extend=n},historySize:function(){var n=this.history;return{undo:n.done.length,redo:n.undone.length}},clearHistory:function(){this.history=yf()},markClean:function(){this.history.dirtyCounter=0,this.history.lastOp=this.history.lastOrigin=null},isClean:function(){return this.history.dirtyCounter==0},getHistory:function(){return{done:pf(this.history.done),undone:pf(this.history.undone)}},setHistory:function(n){var t=this.history=yf();t.done=n.done.slice(0),t.undone=n.undone.slice(0)},markText:function(n,t,i){return yr(this,u(this,n),u(this,t),i,"range")},setBookmark:function(n,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft};return n=u(this,n),yr(this,n,n,i,"bookmark")},findMarksAt:function(n){var e,i,f,t;if(n=u(this,n),e=[],i=r(this,n.line).markedSpans,i)for(f=0;f<i.length;++f)t=i[f],(t.from==null||t.from<=n.ch)&&(t.to==null||t.to>=n.ch)&&e.push(t.marker.parent||t.marker);return e},getAllMarks:function(){var n=[];return this.iter(function(t){var r=t.markedSpans,i;if(r)for(i=0;i<r.length;++i)r[i].from!=null&&n.push(r[i].marker)}),n},posFromIndex:function(n){var i,r=this.first;return this.iter(function(t){var u=t.text.length+1;if(u>n)return i=n,!0;n-=u,++r}),u(this,t(r,i))},indexFromPos:function(n){n=u(this,n);var t=n.ch;return n.line<this.first||n.ch<0?0:(this.iter(this.first,n.line,function(n){t+=n.text.length+1}),t)},copy:function(n){var t=new k(ao(this,this.first,this.first+this.size),this.modeOption,this.first);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel={from:this.sel.from,to:this.sel.to,head:this.sel.head,anchor:this.sel.anchor,shift:this.sel.shift,extend:!1,goalColumn:this.sel.goalColumn},n&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(n){var t,r,i;return n||(n={}),t=this.first,r=this.first+this.size,n.from!=null&&n.from>t&&(t=n.from),n.to!=null&&n.to<r&&(r=n.to),i=new k(ao(this,t,r),n.mode||this.modeOption,t),n.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:n.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:n.sharedHist}],i},unlinkDoc:function(t){var i,u,r;if(t instanceof n&&(t=t.doc),this.linked)for(i=0;i<this.linked.length;++i)if(u=this.linked[i],u.doc==t){this.linked.splice(i,1),t.unlinkDoc(this);break}t.history==this.history&&(r=[t.id],wi(t,function(n){r.push(n.id)},!0),t.history=yf(),t.history.done=pf(this.history.done,r),t.history.undone=pf(this.history.undone,r))},iterLinkedDocs:function(n){wi(this,n)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),k.prototype.eachLine=k.prototype.iter,fc="iter insert remove copy getEditor".split(" ");for(gr in k.prototype)k.prototype.hasOwnProperty(gr)&&ht(fc,gr)<0&&(n.prototype[gr]=function(n){return function(){return n.apply(this.doc,arguments)}}(k.prototype[gr]));n.e_stop=bf,n.e_preventDefault=a,n.e_stopPropagation=lc,tu=0,n.on=e,n.off=st,n.signal=g,di=30,po=n.Pass={toString:function(){return"CodeMirror.Pass"}},wo.prototype={set:function(n,t){clearTimeout(this.id),this.id=setTimeout(t,n)}},n.countColumn=gi,iu=[""],wc=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc]/,gf=/[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/,n.replaceGetRect=function(n){l=n},dc=function(){if(yt)return!1;var n=i("div");return"draggable"in n||"dragDrop"in n}(),ru=/^$/,ui?ru=/$'/:fe?ru=/\-[^ \-?]|\?[^ !'\"\),.\-\/:;\?\]\}]/:is&&(ru=/\-[^ \-\.?]|\?[^ \-\.?\]\}:;!'\"\),\/]|[\.!\"#&%\)*+,:;=>\]|\}~][\(\{\[<]|\$'/),ii="\n\nb".split(/\n/).length!=3?function(n){for(var i=0,f=[],e=n.length,t,r,u;i<=e;)t=n.indexOf("\n",i),t==-1&&(t=n.length),r=n.slice(i,n.charAt(t-1)=="\r"?t-1:t),u=r.indexOf("\r"),u!=-1?(f.push(r.slice(0,u)),i+=u+1):(f.push(r),i=t+1);return f}:function(n){return n.split(/\r\n?|\n/)},n.splitLines=ii;var lv=window.getSelection?function(n){try{return n.selectionStart!=n.selectionEnd}catch(t){return!1}}:function(n){try{var t=n.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=n?!1:t.compareEndPoints("StartToEnd",t)!=0},gc=function(){var n=i("div");return"oncopy"in n?!0:(n.setAttribute("oncopy","return;"),typeof n.oncopy=="function")}(),ri={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return n.keyNames=ri,function(){for(var n=0;n<10;n++)ri[n+48]=String(n);for(n=65;n<=90;n++)ri[n]=String.fromCharCode(n);for(n=1;n<=12;n++)ri[n+111]=ri[n+63235]="F"+n}(),il=function(){function o(n){return n<=255?f.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1791?e.charAt(n-1536):1792<=n&&n<=2220?"r":"L"}var f="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",e="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",s=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,i=/[LRr]/,r=/[Lb1n]/,u=/[1n]/,n="L";return function(f){var a,h,w,g,b,c,v,p,d,e,tt,k,nt,l,it;if(!s.test(f))return!1;for(a=f.length,h=[],e=0;e<a;++e)h.push(c=o(f.charCodeAt(e)));for(e=0,w=n;e<a;++e)c=h[e],c=="m"?h[e]=w:w=c;for(e=0,b=n;e<a;++e)c=h[e],c=="1"&&b=="r"?h[e]="n":i.test(c)&&(b=c,c=="r"&&(h[e]="R"));for(e=1,w=h[0];e<a-1;++e)c=h[e],c=="+"&&w=="1"&&h[e+1]=="1"?h[e]="1":c==","&&w==h[e+1]&&(w=="1"||w=="n")&&(h[e]=w),w=c;for(e=0;e<a;++e)if(c=h[e],c==",")h[e]="N";else if(c=="%"){for(v=e+1;v<a&&h[v]=="%";++v);for(g=e&&h[e-1]=="!"||v<a-1&&h[v]=="1"?"1":"N",l=e;l<v;++l)h[l]=g;e=v-1}for(e=0,b=n;e<a;++e)c=h[e],b=="L"&&c=="1"?h[e]="L":i.test(c)&&(b=c);for(e=0;e<a;++e)if(t.test(h[e])){for(v=e+1;v<a&&t.test(h[v]);++v);var rt=(e?h[e-1]:n)=="L",ut=(v<a-1?h[v]:n)=="L",g=rt||ut?"L":"R";for(l=e;l<v;++l)h[l]=g;e=v-1}for(p=[],e=0;e<a;)if(r.test(h[e])){for(tt=e,++e;e<a&&r.test(h[e]);++e);p.push({from:tt,to:e,level:0})}else{for(k=e,nt=p.length,++e;e<a&&h[e]!="L";++e);for(l=k;l<e;)if(u.test(h[l])){for(k<l&&p.splice(nt,0,{from:k,to:l,level:1}),it=l,++l;l<e&&u.test(h[l]);++l);p.splice(nt,0,{from:it,to:l,level:2}),k=l}else++l;k<e&&p.splice(nt,0,{from:k,to:e,level:1})}return p[0].level==1&&(d=f.match(/^\s+/))&&(p[0].from=d[0].length,p.unshift({from:0,to:d[0].length,level:0})),y(p).level==1&&(d=f.match(/\s+$/))&&(y(p).to-=d[0].length,p.push({from:a-d[0].length,to:a,level:0})),p[0].level!=y(p).level&&p.push({from:a,to:a,level:p[0].level}),p}}(),n.version="3.1",n}()
|
@@ -0,0 +1 @@
|
|
1
|
+
CodeMirror.defineMode("xml",function(config,parserConfig){function inText(stream,state){function chain(parser){return state.tokenize=parser,parser(stream,state)}var ch=stream.next(),isClose,c,ok;if(ch=="<"){if(stream.eat("!"))return stream.eat("[")?stream.match("CDATA[")?chain(inBlock("atom","]\]>")):null:stream.match("--")?chain(inBlock("comment","-->")):stream.match("DOCTYPE",!0,!0)?(stream.eatWhile(/[\w\._\-]/),chain(doctype(1))):null;if(stream.eat("?"))return stream.eatWhile(/[\w\._\-]/),state.tokenize=inBlock("meta","?>"),"meta";for(isClose=stream.eat("/"),tagName="";c=stream.eat(/[^\s\u00a0=<>\"\'\/?]/);)tagName+=c;return tagName?(type=isClose?"closeTag":"openTag",state.tokenize=inTag,"tag"):"error"}return ch=="&"?(ok=stream.eat("#")?stream.eat("x")?stream.eatWhile(/[a-fA-F\d]/)&&stream.eat(";"):stream.eatWhile(/[\d]/)&&stream.eat(";"):stream.eatWhile(/[\w\.\-:]/)&&stream.eat(";"),ok?"atom":"error"):(stream.eatWhile(/[^&<]/),null)}function inTag(stream,state){var ch=stream.next();return ch==">"||ch=="/"&&stream.eat(">")?(state.tokenize=inText,type=ch==">"?"endTag":"selfcloseTag","tag"):ch=="="?(type="equals",null):/[\'\"]/.test(ch)?(state.tokenize=inAttribute(ch),state.tokenize(stream,state)):(stream.eatWhile(/[^\s\u00a0=<>\"\']/),"word")}function inAttribute(quote){return function(stream,state){while(!stream.eol())if(stream.next()==quote){state.tokenize=inTag;break}return"string"}}function inBlock(style,terminator){return function(stream,state){while(!stream.eol()){if(stream.match(terminator)){state.tokenize=inText;break}stream.next()}return style}}function doctype(depth){return function(stream,state){for(var ch;(ch=stream.next())!=null;){if(ch=="<")return state.tokenize=doctype(depth+1),state.tokenize(stream,state);if(ch==">")if(depth==1){state.tokenize=inText;break}else return state.tokenize=doctype(depth-1),state.tokenize(stream,state)}return"meta"}}function pass(){for(var i=arguments.length-1;i>=0;i--)curState.cc.push(arguments[i])}function cont(){return pass.apply(null,arguments),!0}function pushContext(tagName,startOfLine){var noIndent=Kludges.doNotIndent.hasOwnProperty(tagName)||curState.context&&curState.context.noIndent;curState.context={prev:curState.context,tagName:tagName,indent:curState.indented,startOfLine:startOfLine,noIndent:noIndent}}function popContext(){curState.context&&(curState.context=curState.context.prev)}function element(type){if(type=="openTag")return curState.tagName=tagName,cont(attributes,endtag(curState.startOfLine));if(type=="closeTag"){var err=!1;return curState.context?curState.context.tagName!=tagName&&(Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())&&popContext(),err=!curState.context||curState.context.tagName!=tagName):err=!0,err&&(setStyle="error"),cont(endclosetag(err))}return cont()}function endtag(startOfLine){return function(type){var tagName=curState.tagName;return(curState.tagName=null,type=="selfcloseTag"||type=="endTag"&&Kludges.autoSelfClosers.hasOwnProperty(tagName.toLowerCase()))?(maybePopContext(tagName.toLowerCase()),cont()):type=="endTag"?(maybePopContext(tagName.toLowerCase()),pushContext(tagName,startOfLine),cont()):cont()}}function endclosetag(err){return function(type){return(err&&(setStyle="error"),type=="endTag")?(popContext(),cont()):(setStyle="error",cont(arguments.callee))}}function maybePopContext(nextTagName){for(var parentTagName;;){if(!curState.context)return;if(parentTagName=curState.context.tagName.toLowerCase(),!Kludges.contextGrabbers.hasOwnProperty(parentTagName)||!Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName))return;popContext()}}function attributes(type){return type=="word"?(setStyle="attribute",cont(attribute,attributes)):type=="endTag"||type=="selfcloseTag"?pass():(setStyle="error",cont(attributes))}function attribute(type){return type=="equals"?cont(attvalue,attributes):(Kludges.allowMissing?type=="word"&&(setStyle="attribute"):setStyle="error",type=="endTag"||type=="selfcloseTag"?pass():cont())}function attvalue(type){return type=="string"?cont(attvaluemaybe):type=="word"&&Kludges.allowUnquoted?(setStyle="string",cont()):(setStyle="error",type=="endTag"||type=="selfCloseTag"?pass():cont())}function attvaluemaybe(type){return type=="string"?cont(attvaluemaybe):pass()}var indentUnit=config.indentUnit,Kludges=parserConfig.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},alignCDATA=parserConfig.alignCDATA,tagName,type,curState,setStyle;return{startState:function(){return{tokenize:inText,cc:[],indented:0,startOfLine:!0,tagName:null,context:null}},token:function(stream,state){var style,comb;if(stream.sol()&&(state.startOfLine=!0,state.indented=stream.indentation()),stream.eatSpace())return null;if(setStyle=type=tagName=null,style=state.tokenize(stream,state),state.type=type,(style||type)&&style!="comment")for(curState=state;;)if(comb=state.cc.pop()||element,comb(type||style))break;return state.startOfLine=!1,setStyle||style},indent:function(state,textAfter,fullLine){var context=state.context;if(state.tokenize!=inTag&&state.tokenize!=inText||context&&context.noIndent)return fullLine?fullLine.match(/^(\s*)/)[0].length:0;if(alignCDATA&&/<!\[CDATA\[/.test(textAfter))return 0;for(context&&/^<\//.test(textAfter)&&(context=context.prev);context&&!context.startOfLine;)context=context.prev;return context?context.indent+indentUnit:0},electricChars:"/",configuration:parserConfig.htmlMode?"html":"xml"}}),CodeMirror.defineMIME("text/xml","xml"),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.mimeModes.hasOwnProperty("text/html")||CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0}),CodeMirror.defineMode("css",function(config){function keySet(array){for(var keys={},i=0;i<array.length;++i)keys[array[i]]=!0;return keys}function ret(style,tp){return type=tp,style}function tokenBase(stream,state){var ch=stream.next();if(ch=="@")return stream.eatWhile(/[\w\\\-]/),ret("def",stream.current());if(ch=="/"&&stream.eat("*"))return state.tokenize=tokenCComment,tokenCComment(stream,state);if(ch=="<"&&stream.eat("!"))return state.tokenize=tokenSGMLComment,tokenSGMLComment(stream,state);if(ch=="=")ret(null,"compare");else{if((ch=="~"||ch=="|")&&stream.eat("="))return ret(null,"compare");if(ch=='"'||ch=="'")return state.tokenize=tokenString(ch),state.tokenize(stream,state);if(ch=="#")return stream.eatWhile(/[\w\\\-]/),ret("atom","hash");if(ch=="!")return stream.match(/^\s*\w*/),ret("keyword","important");if(/\d/.test(ch))return stream.eatWhile(/[\w.%]/),ret("number","unit");if(ch==="-"){if(/\d/.test(stream.peek()))return stream.eatWhile(/[\w.%]/),ret("number","unit");if(stream.match(/^[^-]+-/))return ret("meta","meta")}else return/[,+>*\/]/.test(ch)?ret(null,"select-op"):ch=="."&&stream.match(/^-?[_a-z][_a-z0-9-]*/i)?ret("qualifier","qualifier"):ch==":"?ret("operator",ch):/[;{}\[\]\(\)]/.test(ch)?ret(null,ch):ch=="u"&&stream.match("rl(")?(stream.backUp(1),state.tokenize=tokenParenthesized,ret("property","variable")):(stream.eatWhile(/[\w\\\-]/),ret("property","variable"))}}function tokenCComment(stream,state){for(var maybeEnd=!1,ch;(ch=stream.next())!=null;){if(maybeEnd&&ch=="/"){state.tokenize=tokenBase;break}maybeEnd=ch=="*"}return ret("comment","comment")}function tokenSGMLComment(stream,state){for(var dashes=0,ch;(ch=stream.next())!=null;){if(dashes>=2&&ch==">"){state.tokenize=tokenBase;break}dashes=ch=="-"?dashes+1:0}return ret("comment","comment")}function tokenString(quote,nonInclusive){return function(stream,state){for(var escaped=!1,ch;(ch=stream.next())!=null;){if(ch==quote&&!escaped)break;escaped=!escaped&&ch=="\\"}return escaped||(nonInclusive&&stream.backUp(1),state.tokenize=tokenBase),ret("string","string")}}function tokenParenthesized(stream,state){return stream.next(),state.tokenize=stream.match(/\s*[\"\']/,!1)?tokenBase:tokenString(")",!0),ret(null,"(")}var indentUnit=config.indentUnit,type,atMediaTypes=keySet(["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]),atMediaFeatures=keySet(["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"]),propertyKeywords=keySet(["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid-cell","grid-column","grid-column-align","grid-column-sizing","grid-column-span","grid-columns","grid-flow","grid-row","grid-row-align","grid-row-sizing","grid-row-span","grid-rows","grid-template","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-shadow","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"]),colorKeywords=keySet(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua"]),valueKeywords=keySet(["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","navy","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","overlay","overline","padding","padding-box","painted","paused","persian","plus-darker","plus-lighter","pointer","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","white","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small","yellow"]);return{startState:function(base){return{tokenize:tokenBase,baseIndent:base||0,stack:[]}},token:function(stream,state){if(state.tokenize==tokenBase&&stream.eatSpace())return null;var style=state.tokenize(stream,state),context=state.stack[state.stack.length-1];return style=="property"?context=="propertyValue"?style=valueKeywords[stream.current()]?"string-2":colorKeywords[stream.current()]?"keyword":"variable-2":context=="rule"?propertyKeywords[stream.current()]||(style+=" error"):context&&context!="@media{"?context=="@media"?style=atMediaTypes[stream.current()]?"attribute":/^(only|not)$/i.test(stream.current())?"keyword":stream.current().toLowerCase()=="and"?"error":atMediaFeatures[stream.current()]?"error":"attribute error":context=="@mediaType"?style=atMediaTypes[stream.current()]?"attribute":stream.current().toLowerCase()=="and"?"operator":/^(only|not)$/i.test(stream.current())?"error":atMediaFeatures[stream.current()]?"error":"error":context=="@mediaType("?propertyKeywords[stream.current()]||(atMediaTypes[stream.current()]?style="error":stream.current().toLowerCase()=="and"?style="operator":/^(only|not)$/i.test(stream.current())?style="error":style+=" error"):style="error":style="tag":style=="atom"?context&&context!="@media{"?context=="propertyValue"?/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())||(style+=" error"):style="error":style="builtin":context=="@media"&&type=="{"&&(style="error"),type=="{"?context=="@media"||context=="@mediaType"?(state.stack.pop(),state.stack[state.stack.length-1]="@media{"):state.stack.push("rule"):type=="}"?(state.stack.pop(),context=="propertyValue"&&state.stack.pop()):type=="@media"?state.stack.push("@media"):context=="@media"&&/\b(keyword|attribute)\b/.test(style)?state.stack.push("@mediaType"):context=="@mediaType"&&stream.current()==","?state.stack.pop():context=="@mediaType"&&type=="("?state.stack.push("@mediaType("):context=="@mediaType("&&type==")"?state.stack.pop():context=="rule"&&type==":"?state.stack.push("propertyValue"):context=="propertyValue"&&type==";"&&state.stack.pop(),style},indent:function(state,textAfter){var n=state.stack.length;return/^\}/.test(textAfter)&&(n-=state.stack[state.stack.length-1]=="propertyValue"?2:1),state.baseIndent+n*indentUnit},electricChars:"}"}}),CodeMirror.defineMIME("text/css","css"),CodeMirror.defineMode("htmlmixed",function(config,parserConfig){function html(stream,state){var tagName=state.htmlState.tagName,style=htmlMode.token(stream,state.htmlState),scriptType,i,tp;if(tagName=="script"&&/\btag\b/.test(style)&&stream.current()==">"){for(scriptType=stream.string.slice(Math.max(0,stream.pos-100),stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i),scriptType=scriptType?scriptType[1]:"",scriptType&&/[\"\']/.test(scriptType.charAt(0))&&(scriptType=scriptType.slice(1,scriptType.length-1)),i=0;i<scriptTypes.length;++i)if(tp=scriptTypes[i],typeof tp.matches=="string"?scriptType==tp.matches:tp.matches.test(scriptType)){tp.mode&&(state.token=script,state.localMode=tp.mode,state.localState=tp.mode.startState&&tp.mode.startState(htmlMode.indent(state.htmlState,"")));break}}else tagName=="style"&&/\btag\b/.test(style)&&stream.current()==">"&&(state.token=css,state.localMode=cssMode,state.localState=cssMode.startState(htmlMode.indent(state.htmlState,"")));return style}function maybeBackup(stream,pat,style){var cur=stream.current(),close=cur.search(pat),m;return close>-1?stream.backUp(cur.length-close):(m=cur.match(/<\/?$/))&&(stream.backUp(cur.length),stream.match(pat,!1)||stream.match(cur[0])),style}function script(stream,state){return stream.match(/^<\/\s*script\s*>/i,!1)?(state.token=html,state.localState=state.localMode=null,html(stream,state)):maybeBackup(stream,/<\/\s*script\s*>/,state.localMode.token(stream,state.localState))}function css(stream,state){return stream.match(/^<\/\s*style\s*>/i,!1)?(state.token=html,state.localState=state.localMode=null,html(stream,state)):maybeBackup(stream,/<\/\s*style\s*>/,cssMode.token(stream,state.localState))}var htmlMode=CodeMirror.getMode(config,{name:"xml",htmlMode:!0}),cssMode=CodeMirror.getMode(config,"css"),scriptTypes=[],scriptTypesConf=parserConfig&&parserConfig.scriptTypes,i,conf;if(scriptTypes.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:CodeMirror.getMode(config,"javascript")}),scriptTypesConf)for(i=0;i<scriptTypesConf.length;++i)conf=scriptTypesConf[i],scriptTypes.push({matches:conf.matches,mode:conf.mode&&CodeMirror.getMode(config,conf.mode)});return scriptTypes.push({matches:/./,mode:CodeMirror.getMode(config,"text/plain")}),{startState:function(){var state=htmlMode.startState();return{token:html,localMode:null,localState:null,htmlState:state}},copyState:function(state){if(state.localState)var local=CodeMirror.copyState(state.localMode,state.localState);return{token:state.token,localMode:state.localMode,localState:local,htmlState:CodeMirror.copyState(htmlMode,state.htmlState)}},token:function(stream,state){return state.token(stream,state)},indent:function(state,textAfter){return!state.localMode||/^\s*<\//.test(textAfter)?htmlMode.indent(state.htmlState,textAfter):state.localMode.indent?state.localMode.indent(state.localState,textAfter):CodeMirror.Pass},electricChars:"/{}:",innerMode:function(state){return{state:state.localState||state.htmlState,mode:state.localMode||htmlMode}}}},"xml","javascript","css"),CodeMirror.defineMIME("text/html","htmlmixed");
|
@@ -0,0 +1 @@
|
|
1
|
+
(function(){function n(n,t,i){var u=n.getWrapperElement(),r;return r=u.appendChild(document.createElement("div")),r.className=i?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top",r.innerHTML=t,r}CodeMirror.defineExtension("openDialog",function(t,i,r){function f(){s||(s=!0,e.parentNode.removeChild(e))}var e=n(this,t,r&&r.bottom),s=!1,h=this,u=e.getElementsByTagName("input")[0],o;if(u){CodeMirror.on(u,"keydown",function(n){(n.keyCode==13||n.keyCode==27)&&(CodeMirror.e_stop(n),f(),h.focus(),n.keyCode==13&&i(u.value))});r&&r.value&&(u.value=r.value),u.focus();CodeMirror.on(u,"blur",f)}else if(o=e.getElementsByTagName("button")[0]){CodeMirror.on(o,"click",function(){f(),h.focus()});o.focus();CodeMirror.on(o,"blur",f)}return f}),CodeMirror.defineExtension("openConfirm",function(t,i,r){function l(){h||(h=!0,e.parentNode.removeChild(e),c.focus())}var e=n(this,t,r&&r.bottom),o=e.getElementsByTagName("button"),h=!1,c=this,s=1,u,f;for(o[0].focus(),u=0;u<o.length;++u){f=o[u],function(n){CodeMirror.on(f,"click",function(t){CodeMirror.e_preventDefault(t),l(),n&&n(c)})}(i[u]);CodeMirror.on(f,"blur",function(){--s,setTimeout(function(){s<=0&&l()},200)});CodeMirror.on(f,"focus",function(){++s})}})})(),function(){function s(n){return typeof n=="string"?{token:function(t){if(t.match(n))return"searching";t.next(),t.skipTo(n.charAt(0))||t.skipToEnd()}}:{token:function(t){if(t.match(n))return"searching";while(!t.eol())if(t.next(),t.match(n,!1))break}}}function h(){this.posFrom=this.posTo=this.query=null,this.overlay=null}function t(n){return n._searchState||(n._searchState=new h)}function n(n,t,i){return n.getSearchCursor(t,i,typeof t=="string"&&t==t.toLowerCase())}function i(n,t,i,r){n.openDialog?n.openDialog(t,r):r(prompt(i,""))}function c(n,t,i,r){n.openConfirm?n.openConfirm(t,r):confirm(i)&&r[0]()}function f(n){var t=n.match(/^\/(.*)\/([a-z]*)$/);return t?new RegExp(t[1],t[2].indexOf("i")==-1?"":"i"):n}function r(n,r){var u=t(n);if(u.query)return e(n,r);i(n,l,"Search for:",function(t){n.operation(function(){t&&!u.query&&(u.query=f(t),n.removeOverlay(u.overlay),u.overlay=s(t),n.addOverlay(u.overlay),u.posFrom=u.posTo=n.getCursor(),e(n,r))})})}function e(i,r){i.operation(function(){var f=t(i),u=n(i,f.query,r?f.posFrom:f.posTo);(u.find(r)||(u=n(i,f.query,r?CodeMirror.Pos(i.lastLine()):CodeMirror.Pos(i.firstLine(),0)),u.find(r)))&&(i.setSelection(u.from(),u.to()),f.posFrom=u.from(),f.posTo=u.to())})}function u(n){n.operation(function(){var i=t(n);i.query&&(i.query=null,n.removeOverlay(i.overlay))})}function o(t,r){i(t,a,"Replace:",function(e){e&&(e=f(e),i(t,v,"Replace with:",function(i){if(r)t.operation(function(){for(var u,r=n(t,e);r.findNext();)typeof e!="string"?(u=t.getRange(r.from(),r.to()).match(e),r.replace(i.replace(/\$(\d)/,function(n,t){return u[t]}))):r.replace(i)});else{u(t);var f=n(t,e,t.getCursor()),o=function(){var i=f.from(),r;((r=f.findNext())||(f=n(t,e),(r=f.findNext())&&(!i||f.from().line!=i.line||f.from().ch!=i.ch)))&&(t.setSelection(f.from(),f.to()),c(t,y,"Replace?",[function(){s(r)},o]))},s=function(n){f.replace(typeof e=="string"?i:i.replace(/\$(\d)/,function(t,i){return n[i]})),o()};o()}}))})}var l='Search: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)<\/span>',a='Replace: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)<\/span>',v='With: <input type="text" style="width: 10em"/>',y="Replace? <button>Yes<\/button> <button>No<\/button> <button>Stop<\/button>";CodeMirror.commands.find=function(n){u(n),r(n)},CodeMirror.commands.findNext=r,CodeMirror.commands.findPrev=function(n){r(n,!0)},CodeMirror.commands.clearSearch=u,CodeMirror.commands.replace=o,CodeMirror.commands.replaceAll=function(n){o(n,!0)}}(),function(){function t(t,i,r,u){if(this.atOccurrence=!1,this.cm=t,u==null&&typeof i=="string"&&(u=!1),r=r?t.clipPos(r):n(0,0),this.pos={from:r,to:r},typeof i!="string")i.global||(i=new RegExp(i.source,i.ignoreCase?"ig":"g")),this.matches=function(r,u){var s;if(r){i.lastIndex=0;for(var e=t.getLine(u.line).slice(0,u.ch),f=i.exec(e),o=0;f;)if(o+=f.index+1,e=e.slice(o),i.lastIndex=0,s=i.exec(e),s)f=s;else break;o--}else{i.lastIndex=u.ch;var e=t.getLine(u.line),f=i.exec(e),o=f&&f.index}if(f&&f[0])return{from:n(u.line,o),to:n(u.line,o+f[0].length),match:f}};else{u&&(i=i.toLowerCase());var e=u?function(n){return n.toLowerCase()}:function(n){return n},f=i.split("\n");this.matches=f.length==1?i.length?function(r,u){var s=e(t.getLine(u.line)),o=i.length,f;if(r?u.ch>=o&&(f=s.lastIndexOf(i,u.ch-o))!=-1:(f=s.indexOf(i,u.ch))!=-1)return{from:n(u.line,f),to:n(u.line,f+o)}}:function(){}:function(i,r){var s=r.line,h=i?f.length-1:0,u=f[h],o=e(t.getLine(s)),c=i?o.indexOf(u)+u.length:o.lastIndexOf(u),l,a,v;if(!(i?c>=r.ch||c!=u.length:c<=r.ch||c!=o.length-u.length))for(;;){if(i?!s:s==t.lineCount()-1)return;if(o=e(t.getLine(s+=i?-1:1)),u=f[i?--h:++h],h>0&&h<f.length-1){if(o!=u)return;continue}return(l=i?o.lastIndexOf(u):o.indexOf(u)+u.length,i?l!=o.length-u.length:l!=u.length)?void 0:(a=n(r.line,c),v=n(s,l),{from:i?v:a,to:i?a:v})}}}}var n=CodeMirror.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){function f(t){var i=n(t,0);return u.pos={from:i,to:i},u.atOccurrence=!1,!1}for(var u=this,i=this.cm.clipPos(t?this.pos.from:this.pos.to),r;;){if(this.pos=this.matches(t,i))return this.pos.from&&this.pos.to||console.log(this.matches,this.pos),this.atOccurrence=!0,this.pos.match||!0;if(t){if(!i.line)return f(0);i=n(i.line-1,this.cm.getLine(i.line-1).length)}else{if(r=this.cm.lineCount(),i.line==r-1)return f(r);i=n(i.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t){if(this.atOccurrence){var i=CodeMirror.splitLines(t);this.cm.replaceRange(i,this.pos.from,this.pos.to),this.pos.to=n(this.pos.from.line+i.length-1,i[i.length-1].length+(i.length==1?this.pos.from.ch:0))}}},CodeMirror.defineExtension("getSearchCursor",function(n,i,r){return new t(this,n,i,r)})}()
|
@@ -1,465 +1,465 @@
|
|
1
|
-
|
2
|
-
var indentUnit = config.indentUnit, type;
|
3
|
-
|
4
|
-
var atMediaTypes = keySet([
|
5
|
-
"all", "aural", "braille", "handheld", "print", "projection", "screen",
|
6
|
-
"tty", "tv", "embossed"
|
7
|
-
]);
|
8
|
-
|
9
|
-
var atMediaFeatures = keySet([
|
10
|
-
"width", "min-width", "max-width", "height", "min-height", "max-height",
|
11
|
-
"device-width", "min-device-width", "max-device-width", "device-height",
|
12
|
-
"min-device-height", "max-device-height", "aspect-ratio",
|
13
|
-
"min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio",
|
14
|
-
"min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",
|
15
|
-
"max-color", "color-index", "min-color-index", "max-color-index",
|
16
|
-
"monochrome", "min-monochrome", "max-monochrome", "resolution",
|
17
|
-
"min-resolution", "max-resolution", "scan", "grid"
|
18
|
-
]);
|
19
|
-
|
20
|
-
var propertyKeywords = keySet([
|
21
|
-
"align-content", "align-items", "align-self", "alignment-adjust",
|
22
|
-
"alignment-baseline", "anchor-point", "animation", "animation-delay",
|
23
|
-
"animation-direction", "animation-duration", "animation-iteration-count",
|
24
|
-
"animation-name", "animation-play-state", "animation-timing-function",
|
25
|
-
"appearance", "azimuth", "backface-visibility", "background",
|
26
|
-
"background-attachment", "background-clip", "background-color",
|
27
|
-
"background-image", "background-origin", "background-position",
|
28
|
-
"background-repeat", "background-size", "baseline-shift", "binding",
|
29
|
-
"bleed", "bookmark-label", "bookmark-level", "bookmark-state",
|
30
|
-
"bookmark-target", "border", "border-bottom", "border-bottom-color",
|
31
|
-
"border-bottom-left-radius", "border-bottom-right-radius",
|
32
|
-
"border-bottom-style", "border-bottom-width", "border-collapse",
|
33
|
-
"border-color", "border-image", "border-image-outset",
|
34
|
-
"border-image-repeat", "border-image-slice", "border-image-source",
|
35
|
-
"border-image-width", "border-left", "border-left-color",
|
36
|
-
"border-left-style", "border-left-width", "border-radius", "border-right",
|
37
|
-
"border-right-color", "border-right-style", "border-right-width",
|
38
|
-
"border-spacing", "border-style", "border-top", "border-top-color",
|
39
|
-
"border-top-left-radius", "border-top-right-radius", "border-top-style",
|
40
|
-
"border-top-width", "border-width", "bottom", "box-decoration-break",
|
41
|
-
"box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
|
42
|
-
"caption-side", "clear", "clip", "color", "color-profile", "column-count",
|
43
|
-
"column-fill", "column-gap", "column-rule", "column-rule-color",
|
44
|
-
"column-rule-style", "column-rule-width", "column-span", "column-width",
|
45
|
-
"columns", "content", "counter-increment", "counter-reset", "crop", "cue",
|
46
|
-
"cue-after", "cue-before", "cursor", "direction", "display",
|
47
|
-
"dominant-baseline", "drop-initial-after-adjust",
|
48
|
-
"drop-initial-after-align", "drop-initial-before-adjust",
|
49
|
-
"drop-initial-before-align", "drop-initial-size", "drop-initial-value",
|
50
|
-
"elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis",
|
51
|
-
"flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",
|
52
|
-
"float", "float-offset", "font", "font-feature-settings", "font-family",
|
53
|
-
"font-kerning", "font-language-override", "font-size", "font-size-adjust",
|
54
|
-
"font-stretch", "font-style", "font-synthesis", "font-variant",
|
55
|
-
"font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
|
56
|
-
"font-variant-ligatures", "font-variant-numeric", "font-variant-position",
|
57
|
-
"font-weight", "grid-cell", "grid-column", "grid-column-align",
|
58
|
-
"grid-column-sizing", "grid-column-span", "grid-columns", "grid-flow",
|
59
|
-
"grid-row", "grid-row-align", "grid-row-sizing", "grid-row-span",
|
60
|
-
"grid-rows", "grid-template", "hanging-punctuation", "height", "hyphens",
|
61
|
-
"icon", "image-orientation", "image-rendering", "image-resolution",
|
62
|
-
"inline-box-align", "justify-content", "left", "letter-spacing",
|
63
|
-
"line-break", "line-height", "line-stacking", "line-stacking-ruby",
|
64
|
-
"line-stacking-shift", "line-stacking-strategy", "list-style",
|
65
|
-
"list-style-image", "list-style-position", "list-style-type", "margin",
|
66
|
-
"margin-bottom", "margin-left", "margin-right", "margin-top",
|
67
|
-
"marker-offset", "marks", "marquee-direction", "marquee-loop",
|
68
|
-
"marquee-play-count", "marquee-speed", "marquee-style", "max-height",
|
69
|
-
"max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index",
|
70
|
-
"nav-left", "nav-right", "nav-up", "opacity", "order", "orphans", "outline",
|
71
|
-
"outline-color", "outline-offset", "outline-style", "outline-width",
|
72
|
-
"overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",
|
73
|
-
"padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
|
74
|
-
"page", "page-break-after", "page-break-before", "page-break-inside",
|
75
|
-
"page-policy", "pause", "pause-after", "pause-before", "perspective",
|
76
|
-
"perspective-origin", "pitch", "pitch-range", "play-during", "position",
|
77
|
-
"presentation-level", "punctuation-trim", "quotes", "rendering-intent",
|
78
|
-
"resize", "rest", "rest-after", "rest-before", "richness", "right",
|
79
|
-
"rotation", "rotation-point", "ruby-align", "ruby-overhang",
|
80
|
-
"ruby-position", "ruby-span", "size", "speak", "speak-as", "speak-header",
|
81
|
-
"speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",
|
82
|
-
"tab-size", "table-layout", "target", "target-name", "target-new",
|
83
|
-
"target-position", "text-align", "text-align-last", "text-decoration",
|
84
|
-
"text-decoration-color", "text-decoration-line", "text-decoration-skip",
|
85
|
-
"text-decoration-style", "text-emphasis", "text-emphasis-color",
|
86
|
-
"text-emphasis-position", "text-emphasis-style", "text-height",
|
87
|
-
"text-indent", "text-justify", "text-outline", "text-shadow",
|
88
|
-
"text-space-collapse", "text-transform", "text-underline-position",
|
89
|
-
"text-wrap", "top", "transform", "transform-origin", "transform-style",
|
90
|
-
"transition", "transition-delay", "transition-duration",
|
91
|
-
"transition-property", "transition-timing-function", "unicode-bidi",
|
92
|
-
"vertical-align", "visibility", "voice-balance", "voice-duration",
|
93
|
-
"voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
|
94
|
-
"voice-volume", "volume", "white-space", "widows", "width", "word-break",
|
95
|
-
"word-spacing", "word-wrap", "z-index"
|
96
|
-
]);
|
97
|
-
|
98
|
-
var colorKeywords = keySet([
|
99
|
-
"black", "silver", "gray", "white", "maroon", "red", "purple", "fuchsia",
|
100
|
-
"green", "lime", "olive", "yellow", "navy", "blue", "teal", "aqua"
|
101
|
-
]);
|
102
|
-
|
103
|
-
var valueKeywords = keySet([
|
104
|
-
"above", "absolute", "activeborder", "activecaption", "afar",
|
105
|
-
"after-white-space", "ahead", "alias", "all", "all-scroll", "alternate",
|
106
|
-
"always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
|
107
|
-
"arabic-indic", "armenian", "asterisks", "auto", "avoid", "background",
|
108
|
-
"backwards", "baseline", "below", "bidi-override", "binary", "bengali",
|
109
|
-
"blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
|
110
|
-
"both", "bottom", "break-all", "break-word", "button", "button-bevel",
|
111
|
-
"buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian",
|
112
|
-
"capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
|
113
|
-
"cell", "center", "checkbox", "circle", "cjk-earthly-branch",
|
114
|
-
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
|
115
|
-
"col-resize", "collapse", "compact", "condensed", "contain", "content",
|
116
|
-
"content-box", "context-menu", "continuous", "copy", "cover", "crop",
|
117
|
-
"cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal",
|
118
|
-
"decimal-leading-zero", "default", "default-button", "destination-atop",
|
119
|
-
"destination-in", "destination-out", "destination-over", "devanagari",
|
120
|
-
"disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted",
|
121
|
-
"double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
|
122
|
-
"element", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
|
123
|
-
"ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
|
124
|
-
"ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
|
125
|
-
"ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",
|
126
|
-
"ethiopic-halehame-gez", "ethiopic-halehame-om-et",
|
127
|
-
"ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
|
128
|
-
"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et",
|
129
|
-
"ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed",
|
130
|
-
"extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes",
|
131
|
-
"forwards", "from", "geometricPrecision", "georgian", "graytext", "groove",
|
132
|
-
"gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew",
|
133
|
-
"help", "hidden", "hide", "higher", "highlight", "highlighttext",
|
134
|
-
"hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",
|
135
|
-
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
|
136
|
-
"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
|
137
|
-
"inline-block", "inline-table", "inset", "inside", "intrinsic", "invert",
|
138
|
-
"italic", "justify", "kannada", "katakana", "katakana-iroha", "khmer",
|
139
|
-
"landscape", "lao", "large", "larger", "left", "level", "lighter",
|
140
|
-
"line-through", "linear", "lines", "list-item", "listbox", "listitem",
|
141
|
-
"local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
|
142
|
-
"lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
|
143
|
-
"lower-roman", "lowercase", "ltr", "malayalam", "match",
|
144
|
-
"media-controls-background", "media-current-time-display",
|
145
|
-
"media-fullscreen-button", "media-mute-button", "media-play-button",
|
146
|
-
"media-return-to-realtime-button", "media-rewind-button",
|
147
|
-
"media-seek-back-button", "media-seek-forward-button", "media-slider",
|
148
|
-
"media-sliderthumb", "media-time-remaining-display", "media-volume-slider",
|
149
|
-
"media-volume-slider-container", "media-volume-sliderthumb", "medium",
|
150
|
-
"menu", "menulist", "menulist-button", "menulist-text",
|
151
|
-
"menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
|
152
|
-
"mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize",
|
153
|
-
"narrower", "navy", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
|
154
|
-
"no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
|
155
|
-
"ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote",
|
156
|
-
"optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
|
157
|
-
"outside", "overlay", "overline", "padding", "padding-box", "painted",
|
158
|
-
"paused", "persian", "plus-darker", "plus-lighter", "pointer", "portrait",
|
159
|
-
"pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button",
|
160
|
-
"radio", "read-only", "read-write", "read-write-plaintext-only", "relative",
|
161
|
-
"repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba",
|
162
|
-
"ridge", "right", "round", "row-resize", "rtl", "run-in", "running",
|
163
|
-
"s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield",
|
164
|
-
"searchfield-cancel-button", "searchfield-decoration",
|
165
|
-
"searchfield-results-button", "searchfield-results-decoration",
|
166
|
-
"semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
|
167
|
-
"single", "skip-white-space", "slide", "slider-horizontal",
|
168
|
-
"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
|
169
|
-
"small", "small-caps", "small-caption", "smaller", "solid", "somali",
|
170
|
-
"source-atop", "source-in", "source-out", "source-over", "space", "square",
|
171
|
-
"square-button", "start", "static", "status-bar", "stretch", "stroke",
|
172
|
-
"sub", "subpixel-antialiased", "super", "sw-resize", "table",
|
173
|
-
"table-caption", "table-cell", "table-column", "table-column-group",
|
174
|
-
"table-footer-group", "table-header-group", "table-row", "table-row-group",
|
175
|
-
"telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",
|
176
|
-
"thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
|
177
|
-
"threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
|
178
|
-
"tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
|
179
|
-
"transparent", "ultra-condensed", "ultra-expanded", "underline", "up",
|
180
|
-
"upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
|
181
|
-
"upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
|
182
|
-
"vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
|
183
|
-
"visibleStroke", "visual", "w-resize", "wait", "wave", "white", "wider",
|
184
|
-
"window", "windowframe", "windowtext", "x-large", "x-small", "xor",
|
185
|
-
"xx-large", "xx-small", "yellow"
|
186
|
-
]);
|
187
|
-
|
188
|
-
function keySet(array) { var keys = {}; for (var i = 0; i < array.length; ++i) keys[array[i]] = true; return keys; }
|
189
|
-
function ret(style, tp) {type = tp; return style;}
|
190
|
-
|
191
|
-
function tokenBase(stream, state) {
|
192
|
-
var ch = stream.next();
|
193
|
-
if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("def", stream.current());}
|
194
|
-
else if (ch == "/" && stream.eat("*")) {
|
195
|
-
state.tokenize = tokenCComment;
|
196
|
-
return tokenCComment(stream, state);
|
197
|
-
}
|
198
|
-
else if (ch == "<" && stream.eat("!")) {
|
199
|
-
state.tokenize = tokenSGMLComment;
|
200
|
-
return tokenSGMLComment(stream, state);
|
201
|
-
}
|
202
|
-
else if (ch == "=") ret(null, "compare");
|
203
|
-
else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare");
|
204
|
-
else if (ch == "\"" || ch == "'") {
|
205
|
-
state.tokenize = tokenString(ch);
|
206
|
-
return state.tokenize(stream, state);
|
207
|
-
}
|
208
|
-
else if (ch == "#") {
|
209
|
-
stream.eatWhile(/[\w\\\-]/);
|
210
|
-
return ret("atom", "hash");
|
211
|
-
}
|
212
|
-
else if (ch == "!") {
|
213
|
-
stream.match(/^\s*\w*/);
|
214
|
-
return ret("keyword", "important");
|
215
|
-
}
|
216
|
-
else if (/\d/.test(ch)) {
|
217
|
-
stream.eatWhile(/[\w.%]/);
|
218
|
-
return ret("number", "unit");
|
219
|
-
}
|
220
|
-
else if (ch === "-") {
|
221
|
-
if (/\d/.test(stream.peek())) {
|
222
|
-
stream.eatWhile(/[\w.%]/);
|
223
|
-
return ret("number", "unit");
|
224
|
-
} else if (stream.match(/^[^-]+-/)) {
|
225
|
-
return ret("meta",
|
226
|
-
}
|
227
|
-
}
|
228
|
-
else if (/[,+>*\/]/.test(ch)) {
|
229
|
-
return ret(null, "select-op");
|
230
|
-
}
|
231
|
-
else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {
|
232
|
-
return ret("qualifier",
|
233
|
-
}
|
234
|
-
else if (ch == ":") {
|
235
|
-
return ret("operator", ch);
|
236
|
-
}
|
237
|
-
else if (/[;{}\[\]\(\)]/.test(ch)) {
|
238
|
-
return ret(null, ch);
|
239
|
-
}
|
240
|
-
else if (ch == "u" && stream.match("rl(")) {
|
241
|
-
stream.backUp(1);
|
242
|
-
state.tokenize = tokenParenthesized;
|
243
|
-
return ret("property", "variable");
|
244
|
-
}
|
245
|
-
else {
|
246
|
-
stream.eatWhile(/[\w\\\-]/);
|
247
|
-
return ret("property", "variable");
|
248
|
-
}
|
249
|
-
}
|
250
|
-
|
251
|
-
function tokenCComment(stream, state) {
|
252
|
-
var maybeEnd = false, ch;
|
253
|
-
while ((ch = stream.next()) != null) {
|
254
|
-
if (maybeEnd && ch == "/") {
|
255
|
-
state.tokenize = tokenBase;
|
256
|
-
break;
|
257
|
-
}
|
258
|
-
maybeEnd = (ch == "*");
|
259
|
-
}
|
260
|
-
return ret("comment", "comment");
|
261
|
-
}
|
262
|
-
|
263
|
-
function tokenSGMLComment(stream, state) {
|
264
|
-
var dashes = 0, ch;
|
265
|
-
while ((ch = stream.next()) != null) {
|
266
|
-
if (dashes >= 2 && ch == ">") {
|
267
|
-
state.tokenize = tokenBase;
|
268
|
-
break;
|
269
|
-
}
|
270
|
-
dashes = (ch == "-") ? dashes + 1 : 0;
|
271
|
-
}
|
272
|
-
return ret("comment", "comment");
|
273
|
-
}
|
274
|
-
|
275
|
-
function tokenString(quote, nonInclusive) {
|
276
|
-
return function(stream, state) {
|
277
|
-
var escaped = false, ch;
|
278
|
-
while ((ch = stream.next()) != null) {
|
279
|
-
if (ch == quote && !escaped)
|
280
|
-
break;
|
281
|
-
escaped = !escaped && ch == "\\";
|
282
|
-
}
|
283
|
-
if (!escaped) {
|
284
|
-
if (nonInclusive) stream.backUp(1);
|
285
|
-
state.tokenize = tokenBase;
|
286
|
-
}
|
287
|
-
return ret("string", "string");
|
288
|
-
};
|
289
|
-
}
|
290
|
-
|
291
|
-
function tokenParenthesized(stream, state) {
|
292
|
-
stream.next(); // Must be '('
|
293
|
-
if (!stream.match(/\s*[\"\']/, false))
|
294
|
-
state.tokenize = tokenString(")", true);
|
295
|
-
else
|
296
|
-
state.tokenize = tokenBase;
|
297
|
-
return ret(null, "(");
|
298
|
-
}
|
299
|
-
|
300
|
-
return {
|
301
|
-
startState: function(base) {
|
302
|
-
return {tokenize: tokenBase,
|
303
|
-
baseIndent: base || 0,
|
304
|
-
stack: []};
|
305
|
-
},
|
306
|
-
|
307
|
-
token: function(stream, state) {
|
308
|
-
|
309
|
-
// Use these terms when applicable (see http://www.xanthir.com/blog/b4E50)
|
310
|
-
//
|
311
|
-
// rule** or **ruleset:
|
312
|
-
// A selector + braces combo, or an at-rule.
|
313
|
-
//
|
314
|
-
// declaration block:
|
315
|
-
// A sequence of declarations.
|
316
|
-
//
|
317
|
-
// declaration:
|
318
|
-
// A property + colon + value combo.
|
319
|
-
//
|
320
|
-
// property value:
|
321
|
-
// The entire value of a property.
|
322
|
-
//
|
323
|
-
// component value:
|
324
|
-
// A single piece of a property value. Like the 5px in
|
325
|
-
// text-shadow: 0 0 5px blue;. Can also refer to things that are
|
326
|
-
// multiple terms, like the 1-4 terms that make up the background-size
|
327
|
-
// portion of the background shorthand.
|
328
|
-
//
|
329
|
-
// term:
|
330
|
-
// The basic unit of author-facing CSS, like a single number (5),
|
331
|
-
// dimension (5px), string ("foo"), or function. Officially defined
|
332
|
-
// by the CSS 2.1 grammar (look for the 'term' production)
|
333
|
-
//
|
334
|
-
//
|
335
|
-
// simple selector:
|
336
|
-
// A single atomic selector, like a type selector, an attr selector, a
|
337
|
-
// class selector, etc.
|
338
|
-
//
|
339
|
-
// compound selector:
|
340
|
-
// One or more simple selectors without a combinator. div.example is
|
341
|
-
// compound, div > .example is not.
|
342
|
-
//
|
343
|
-
// complex selector:
|
344
|
-
// One or more compound selectors chained with combinators.
|
345
|
-
//
|
346
|
-
// combinator:
|
347
|
-
// The parts of selectors that express relationships. There are four
|
348
|
-
// currently - the space (descendant combinator), the greater-than
|
349
|
-
// bracket (child combinator), the plus sign (next sibling combinator),
|
350
|
-
// and the tilda (following sibling combinator).
|
351
|
-
//
|
352
|
-
// sequence of selectors:
|
353
|
-
// One or more of the named type of selector chained with commas.
|
354
|
-
|
355
|
-
if (state.tokenize == tokenBase && stream.eatSpace()) return null;
|
356
|
-
var style = state.tokenize(stream, state);
|
357
|
-
|
358
|
-
// Changing style returned based on context
|
359
|
-
var context = state.stack[state.stack.length-1];
|
360
|
-
if (style == "property") {
|
361
|
-
if (context == "propertyValue"){
|
362
|
-
if (valueKeywords[stream.current()]) {
|
363
|
-
style = "string-2";
|
364
|
-
} else if (colorKeywords[stream.current()]) {
|
365
|
-
style = "keyword";
|
366
|
-
} else {
|
367
|
-
style = "variable-2";
|
368
|
-
}
|
369
|
-
} else if (context == "rule") {
|
370
|
-
if (!propertyKeywords[stream.current()]) {
|
371
|
-
style += " error";
|
372
|
-
}
|
373
|
-
} else if (!context || context == "@media{") {
|
374
|
-
style = "tag";
|
375
|
-
} else if (context == "@media") {
|
376
|
-
if (atMediaTypes[stream.current()]) {
|
377
|
-
style = "attribute"; // Known attribute
|
378
|
-
} else if (/^(only|not)$/i.test(stream.current())) {
|
379
|
-
style = "keyword";
|
380
|
-
} else if (stream.current().toLowerCase() == "and") {
|
381
|
-
style = "error"; // "and" is only allowed in @mediaType
|
382
|
-
} else if (atMediaFeatures[stream.current()]) {
|
383
|
-
style = "error"; // Known property, should be in @mediaType(
|
384
|
-
} else {
|
385
|
-
// Unknown, expecting keyword or attribute, assuming attribute
|
386
|
-
style = "attribute error";
|
387
|
-
}
|
388
|
-
} else if (context == "@mediaType") {
|
389
|
-
if (atMediaTypes[stream.current()]) {
|
390
|
-
style = "attribute";
|
391
|
-
} else if (stream.current().toLowerCase() == "and") {
|
392
|
-
style = "operator";
|
393
|
-
} else if (/^(only|not)$/i.test(stream.current())) {
|
394
|
-
style = "error"; // Only allowed in @media
|
395
|
-
} else if (atMediaFeatures[stream.current()]) {
|
396
|
-
style = "error"; // Known property, should be in parentheses
|
397
|
-
} else {
|
398
|
-
// Unknown attribute or property, but expecting property (preceded
|
399
|
-
// by "and"). Should be in parentheses
|
400
|
-
style = "error";
|
401
|
-
}
|
402
|
-
} else if (context == "@mediaType(") {
|
403
|
-
if (propertyKeywords[stream.current()]) {
|
404
|
-
// do nothing, remains "property"
|
405
|
-
} else if (atMediaTypes[stream.current()]) {
|
406
|
-
style = "error"; // Known property, should be in parentheses
|
407
|
-
} else if (stream.current().toLowerCase() == "and") {
|
408
|
-
style = "operator";
|
409
|
-
} else if (/^(only|not)$/i.test(stream.current())) {
|
410
|
-
style = "error"; // Only allowed in @media
|
411
|
-
} else {
|
412
|
-
style += " error";
|
413
|
-
}
|
414
|
-
} else {
|
415
|
-
style = "error";
|
416
|
-
}
|
417
|
-
} else if (style == "atom") {
|
418
|
-
if(!context || context == "@media{") {
|
419
|
-
style = "builtin";
|
420
|
-
} else if (context == "propertyValue") {
|
421
|
-
if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) {
|
422
|
-
style += " error";
|
423
|
-
}
|
424
|
-
} else {
|
425
|
-
style = "error";
|
426
|
-
}
|
427
|
-
} else if (context == "@media" && type == "{") {
|
428
|
-
style = "error";
|
429
|
-
}
|
430
|
-
|
431
|
-
// Push/pop context stack
|
432
|
-
if (type == "{") {
|
433
|
-
if (context == "@media" || context == "@mediaType") {
|
434
|
-
state.stack.pop();
|
435
|
-
state.stack[state.stack.length-1] = "@media{";
|
436
|
-
}
|
437
|
-
else state.stack.push("rule");
|
438
|
-
}
|
439
|
-
else if (type == "}") {
|
440
|
-
state.stack.pop();
|
441
|
-
if (context == "propertyValue") state.stack.pop();
|
442
|
-
}
|
443
|
-
else if (type == "@media") state.stack.push("@media");
|
444
|
-
else if (context == "@media" && /\b(keyword|attribute)\b/.test(style))
|
445
|
-
state.stack.push("@mediaType");
|
446
|
-
else if (context == "@mediaType" && stream.current() == ",") state.stack.pop();
|
447
|
-
else if (context == "@mediaType" && type == "(") state.stack.push("@mediaType(");
|
448
|
-
else if (context == "@mediaType(" && type == ")") state.stack.pop();
|
449
|
-
else if (context == "rule" && type == ":") state.stack.push("propertyValue");
|
450
|
-
else if (context == "propertyValue" && type == ";") state.stack.pop();
|
451
|
-
return style;
|
452
|
-
},
|
453
|
-
|
454
|
-
indent: function(state, textAfter) {
|
455
|
-
var n = state.stack.length;
|
456
|
-
if (/^\}/.test(textAfter))
|
457
|
-
n -= state.stack[state.stack.length-1] == "propertyValue" ? 2 : 1;
|
458
|
-
return state.baseIndent + n * indentUnit;
|
459
|
-
},
|
460
|
-
|
461
|
-
electricChars: "}"
|
462
|
-
};
|
463
|
-
});
|
464
|
-
|
465
|
-
CodeMirror.defineMIME("text/css", "css");
|
1
|
+
CodeMirror.defineMode("css", function(config) {
|
2
|
+
var indentUnit = config.indentUnit, type;
|
3
|
+
|
4
|
+
var atMediaTypes = keySet([
|
5
|
+
"all", "aural", "braille", "handheld", "print", "projection", "screen",
|
6
|
+
"tty", "tv", "embossed"
|
7
|
+
]);
|
8
|
+
|
9
|
+
var atMediaFeatures = keySet([
|
10
|
+
"width", "min-width", "max-width", "height", "min-height", "max-height",
|
11
|
+
"device-width", "min-device-width", "max-device-width", "device-height",
|
12
|
+
"min-device-height", "max-device-height", "aspect-ratio",
|
13
|
+
"min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio",
|
14
|
+
"min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",
|
15
|
+
"max-color", "color-index", "min-color-index", "max-color-index",
|
16
|
+
"monochrome", "min-monochrome", "max-monochrome", "resolution",
|
17
|
+
"min-resolution", "max-resolution", "scan", "grid"
|
18
|
+
]);
|
19
|
+
|
20
|
+
var propertyKeywords = keySet([
|
21
|
+
"align-content", "align-items", "align-self", "alignment-adjust",
|
22
|
+
"alignment-baseline", "anchor-point", "animation", "animation-delay",
|
23
|
+
"animation-direction", "animation-duration", "animation-iteration-count",
|
24
|
+
"animation-name", "animation-play-state", "animation-timing-function",
|
25
|
+
"appearance", "azimuth", "backface-visibility", "background",
|
26
|
+
"background-attachment", "background-clip", "background-color",
|
27
|
+
"background-image", "background-origin", "background-position",
|
28
|
+
"background-repeat", "background-size", "baseline-shift", "binding",
|
29
|
+
"bleed", "bookmark-label", "bookmark-level", "bookmark-state",
|
30
|
+
"bookmark-target", "border", "border-bottom", "border-bottom-color",
|
31
|
+
"border-bottom-left-radius", "border-bottom-right-radius",
|
32
|
+
"border-bottom-style", "border-bottom-width", "border-collapse",
|
33
|
+
"border-color", "border-image", "border-image-outset",
|
34
|
+
"border-image-repeat", "border-image-slice", "border-image-source",
|
35
|
+
"border-image-width", "border-left", "border-left-color",
|
36
|
+
"border-left-style", "border-left-width", "border-radius", "border-right",
|
37
|
+
"border-right-color", "border-right-style", "border-right-width",
|
38
|
+
"border-spacing", "border-style", "border-top", "border-top-color",
|
39
|
+
"border-top-left-radius", "border-top-right-radius", "border-top-style",
|
40
|
+
"border-top-width", "border-width", "bottom", "box-decoration-break",
|
41
|
+
"box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
|
42
|
+
"caption-side", "clear", "clip", "color", "color-profile", "column-count",
|
43
|
+
"column-fill", "column-gap", "column-rule", "column-rule-color",
|
44
|
+
"column-rule-style", "column-rule-width", "column-span", "column-width",
|
45
|
+
"columns", "content", "counter-increment", "counter-reset", "crop", "cue",
|
46
|
+
"cue-after", "cue-before", "cursor", "direction", "display",
|
47
|
+
"dominant-baseline", "drop-initial-after-adjust",
|
48
|
+
"drop-initial-after-align", "drop-initial-before-adjust",
|
49
|
+
"drop-initial-before-align", "drop-initial-size", "drop-initial-value",
|
50
|
+
"elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis",
|
51
|
+
"flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",
|
52
|
+
"float", "float-offset", "font", "font-feature-settings", "font-family",
|
53
|
+
"font-kerning", "font-language-override", "font-size", "font-size-adjust",
|
54
|
+
"font-stretch", "font-style", "font-synthesis", "font-variant",
|
55
|
+
"font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
|
56
|
+
"font-variant-ligatures", "font-variant-numeric", "font-variant-position",
|
57
|
+
"font-weight", "grid-cell", "grid-column", "grid-column-align",
|
58
|
+
"grid-column-sizing", "grid-column-span", "grid-columns", "grid-flow",
|
59
|
+
"grid-row", "grid-row-align", "grid-row-sizing", "grid-row-span",
|
60
|
+
"grid-rows", "grid-template", "hanging-punctuation", "height", "hyphens",
|
61
|
+
"icon", "image-orientation", "image-rendering", "image-resolution",
|
62
|
+
"inline-box-align", "justify-content", "left", "letter-spacing",
|
63
|
+
"line-break", "line-height", "line-stacking", "line-stacking-ruby",
|
64
|
+
"line-stacking-shift", "line-stacking-strategy", "list-style",
|
65
|
+
"list-style-image", "list-style-position", "list-style-type", "margin",
|
66
|
+
"margin-bottom", "margin-left", "margin-right", "margin-top",
|
67
|
+
"marker-offset", "marks", "marquee-direction", "marquee-loop",
|
68
|
+
"marquee-play-count", "marquee-speed", "marquee-style", "max-height",
|
69
|
+
"max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index",
|
70
|
+
"nav-left", "nav-right", "nav-up", "opacity", "order", "orphans", "outline",
|
71
|
+
"outline-color", "outline-offset", "outline-style", "outline-width",
|
72
|
+
"overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",
|
73
|
+
"padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
|
74
|
+
"page", "page-break-after", "page-break-before", "page-break-inside",
|
75
|
+
"page-policy", "pause", "pause-after", "pause-before", "perspective",
|
76
|
+
"perspective-origin", "pitch", "pitch-range", "play-during", "position",
|
77
|
+
"presentation-level", "punctuation-trim", "quotes", "rendering-intent",
|
78
|
+
"resize", "rest", "rest-after", "rest-before", "richness", "right",
|
79
|
+
"rotation", "rotation-point", "ruby-align", "ruby-overhang",
|
80
|
+
"ruby-position", "ruby-span", "size", "speak", "speak-as", "speak-header",
|
81
|
+
"speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",
|
82
|
+
"tab-size", "table-layout", "target", "target-name", "target-new",
|
83
|
+
"target-position", "text-align", "text-align-last", "text-decoration",
|
84
|
+
"text-decoration-color", "text-decoration-line", "text-decoration-skip",
|
85
|
+
"text-decoration-style", "text-emphasis", "text-emphasis-color",
|
86
|
+
"text-emphasis-position", "text-emphasis-style", "text-height",
|
87
|
+
"text-indent", "text-justify", "text-outline", "text-shadow",
|
88
|
+
"text-space-collapse", "text-transform", "text-underline-position",
|
89
|
+
"text-wrap", "top", "transform", "transform-origin", "transform-style",
|
90
|
+
"transition", "transition-delay", "transition-duration",
|
91
|
+
"transition-property", "transition-timing-function", "unicode-bidi",
|
92
|
+
"vertical-align", "visibility", "voice-balance", "voice-duration",
|
93
|
+
"voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
|
94
|
+
"voice-volume", "volume", "white-space", "widows", "width", "word-break",
|
95
|
+
"word-spacing", "word-wrap", "z-index"
|
96
|
+
]);
|
97
|
+
|
98
|
+
var colorKeywords = keySet([
|
99
|
+
"black", "silver", "gray", "white", "maroon", "red", "purple", "fuchsia",
|
100
|
+
"green", "lime", "olive", "yellow", "navy", "blue", "teal", "aqua"
|
101
|
+
]);
|
102
|
+
|
103
|
+
var valueKeywords = keySet([
|
104
|
+
"above", "absolute", "activeborder", "activecaption", "afar",
|
105
|
+
"after-white-space", "ahead", "alias", "all", "all-scroll", "alternate",
|
106
|
+
"always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
|
107
|
+
"arabic-indic", "armenian", "asterisks", "auto", "avoid", "background",
|
108
|
+
"backwards", "baseline", "below", "bidi-override", "binary", "bengali",
|
109
|
+
"blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
|
110
|
+
"both", "bottom", "break-all", "break-word", "button", "button-bevel",
|
111
|
+
"buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian",
|
112
|
+
"capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
|
113
|
+
"cell", "center", "checkbox", "circle", "cjk-earthly-branch",
|
114
|
+
"cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
|
115
|
+
"col-resize", "collapse", "compact", "condensed", "contain", "content",
|
116
|
+
"content-box", "context-menu", "continuous", "copy", "cover", "crop",
|
117
|
+
"cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal",
|
118
|
+
"decimal-leading-zero", "default", "default-button", "destination-atop",
|
119
|
+
"destination-in", "destination-out", "destination-over", "devanagari",
|
120
|
+
"disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted",
|
121
|
+
"double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
|
122
|
+
"element", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
|
123
|
+
"ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
|
124
|
+
"ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
|
125
|
+
"ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",
|
126
|
+
"ethiopic-halehame-gez", "ethiopic-halehame-om-et",
|
127
|
+
"ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
|
128
|
+
"ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et",
|
129
|
+
"ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed",
|
130
|
+
"extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes",
|
131
|
+
"forwards", "from", "geometricPrecision", "georgian", "graytext", "groove",
|
132
|
+
"gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew",
|
133
|
+
"help", "hidden", "hide", "higher", "highlight", "highlighttext",
|
134
|
+
"hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",
|
135
|
+
"inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
|
136
|
+
"infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
|
137
|
+
"inline-block", "inline-table", "inset", "inside", "intrinsic", "invert",
|
138
|
+
"italic", "justify", "kannada", "katakana", "katakana-iroha", "khmer",
|
139
|
+
"landscape", "lao", "large", "larger", "left", "level", "lighter",
|
140
|
+
"line-through", "linear", "lines", "list-item", "listbox", "listitem",
|
141
|
+
"local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
|
142
|
+
"lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
|
143
|
+
"lower-roman", "lowercase", "ltr", "malayalam", "match",
|
144
|
+
"media-controls-background", "media-current-time-display",
|
145
|
+
"media-fullscreen-button", "media-mute-button", "media-play-button",
|
146
|
+
"media-return-to-realtime-button", "media-rewind-button",
|
147
|
+
"media-seek-back-button", "media-seek-forward-button", "media-slider",
|
148
|
+
"media-sliderthumb", "media-time-remaining-display", "media-volume-slider",
|
149
|
+
"media-volume-slider-container", "media-volume-sliderthumb", "medium",
|
150
|
+
"menu", "menulist", "menulist-button", "menulist-text",
|
151
|
+
"menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
|
152
|
+
"mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize",
|
153
|
+
"narrower", "navy", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
|
154
|
+
"no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
|
155
|
+
"ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote",
|
156
|
+
"optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
|
157
|
+
"outside", "overlay", "overline", "padding", "padding-box", "painted",
|
158
|
+
"paused", "persian", "plus-darker", "plus-lighter", "pointer", "portrait",
|
159
|
+
"pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button",
|
160
|
+
"radio", "read-only", "read-write", "read-write-plaintext-only", "relative",
|
161
|
+
"repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba",
|
162
|
+
"ridge", "right", "round", "row-resize", "rtl", "run-in", "running",
|
163
|
+
"s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield",
|
164
|
+
"searchfield-cancel-button", "searchfield-decoration",
|
165
|
+
"searchfield-results-button", "searchfield-results-decoration",
|
166
|
+
"semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
|
167
|
+
"single", "skip-white-space", "slide", "slider-horizontal",
|
168
|
+
"slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
|
169
|
+
"small", "small-caps", "small-caption", "smaller", "solid", "somali",
|
170
|
+
"source-atop", "source-in", "source-out", "source-over", "space", "square",
|
171
|
+
"square-button", "start", "static", "status-bar", "stretch", "stroke",
|
172
|
+
"sub", "subpixel-antialiased", "super", "sw-resize", "table",
|
173
|
+
"table-caption", "table-cell", "table-column", "table-column-group",
|
174
|
+
"table-footer-group", "table-header-group", "table-row", "table-row-group",
|
175
|
+
"telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",
|
176
|
+
"thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
|
177
|
+
"threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
|
178
|
+
"tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
|
179
|
+
"transparent", "ultra-condensed", "ultra-expanded", "underline", "up",
|
180
|
+
"upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
|
181
|
+
"upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
|
182
|
+
"vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
|
183
|
+
"visibleStroke", "visual", "w-resize", "wait", "wave", "white", "wider",
|
184
|
+
"window", "windowframe", "windowtext", "x-large", "x-small", "xor",
|
185
|
+
"xx-large", "xx-small", "yellow"
|
186
|
+
]);
|
187
|
+
|
188
|
+
function keySet(array) { var keys = {}; for (var i = 0; i < array.length; ++i) keys[array[i]] = true; return keys; }
|
189
|
+
function ret(style, tp) {type = tp; return style;}
|
190
|
+
|
191
|
+
function tokenBase(stream, state) {
|
192
|
+
var ch = stream.next();
|
193
|
+
if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("def", stream.current());}
|
194
|
+
else if (ch == "/" && stream.eat("*")) {
|
195
|
+
state.tokenize = tokenCComment;
|
196
|
+
return tokenCComment(stream, state);
|
197
|
+
}
|
198
|
+
else if (ch == "<" && stream.eat("!")) {
|
199
|
+
state.tokenize = tokenSGMLComment;
|
200
|
+
return tokenSGMLComment(stream, state);
|
201
|
+
}
|
202
|
+
else if (ch == "=") ret(null, "compare");
|
203
|
+
else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare");
|
204
|
+
else if (ch == "\"" || ch == "'") {
|
205
|
+
state.tokenize = tokenString(ch);
|
206
|
+
return state.tokenize(stream, state);
|
207
|
+
}
|
208
|
+
else if (ch == "#") {
|
209
|
+
stream.eatWhile(/[\w\\\-]/);
|
210
|
+
return ret("atom", "hash");
|
211
|
+
}
|
212
|
+
else if (ch == "!") {
|
213
|
+
stream.match(/^\s*\w*/);
|
214
|
+
return ret("keyword", "important");
|
215
|
+
}
|
216
|
+
else if (/\d/.test(ch)) {
|
217
|
+
stream.eatWhile(/[\w.%]/);
|
218
|
+
return ret("number", "unit");
|
219
|
+
}
|
220
|
+
else if (ch === "-") {
|
221
|
+
if (/\d/.test(stream.peek())) {
|
222
|
+
stream.eatWhile(/[\w.%]/);
|
223
|
+
return ret("number", "unit");
|
224
|
+
} else if (stream.match(/^[^-]+-/)) {
|
225
|
+
return ret("meta", "meta");
|
226
|
+
}
|
227
|
+
}
|
228
|
+
else if (/[,+>*\/]/.test(ch)) {
|
229
|
+
return ret(null, "select-op");
|
230
|
+
}
|
231
|
+
else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {
|
232
|
+
return ret("qualifier", "qualifier");
|
233
|
+
}
|
234
|
+
else if (ch == ":") {
|
235
|
+
return ret("operator", ch);
|
236
|
+
}
|
237
|
+
else if (/[;{}\[\]\(\)]/.test(ch)) {
|
238
|
+
return ret(null, ch);
|
239
|
+
}
|
240
|
+
else if (ch == "u" && stream.match("rl(")) {
|
241
|
+
stream.backUp(1);
|
242
|
+
state.tokenize = tokenParenthesized;
|
243
|
+
return ret("property", "variable");
|
244
|
+
}
|
245
|
+
else {
|
246
|
+
stream.eatWhile(/[\w\\\-]/);
|
247
|
+
return ret("property", "variable");
|
248
|
+
}
|
249
|
+
}
|
250
|
+
|
251
|
+
function tokenCComment(stream, state) {
|
252
|
+
var maybeEnd = false, ch;
|
253
|
+
while ((ch = stream.next()) != null) {
|
254
|
+
if (maybeEnd && ch == "/") {
|
255
|
+
state.tokenize = tokenBase;
|
256
|
+
break;
|
257
|
+
}
|
258
|
+
maybeEnd = (ch == "*");
|
259
|
+
}
|
260
|
+
return ret("comment", "comment");
|
261
|
+
}
|
262
|
+
|
263
|
+
function tokenSGMLComment(stream, state) {
|
264
|
+
var dashes = 0, ch;
|
265
|
+
while ((ch = stream.next()) != null) {
|
266
|
+
if (dashes >= 2 && ch == ">") {
|
267
|
+
state.tokenize = tokenBase;
|
268
|
+
break;
|
269
|
+
}
|
270
|
+
dashes = (ch == "-") ? dashes + 1 : 0;
|
271
|
+
}
|
272
|
+
return ret("comment", "comment");
|
273
|
+
}
|
274
|
+
|
275
|
+
function tokenString(quote, nonInclusive) {
|
276
|
+
return function(stream, state) {
|
277
|
+
var escaped = false, ch;
|
278
|
+
while ((ch = stream.next()) != null) {
|
279
|
+
if (ch == quote && !escaped)
|
280
|
+
break;
|
281
|
+
escaped = !escaped && ch == "\\";
|
282
|
+
}
|
283
|
+
if (!escaped) {
|
284
|
+
if (nonInclusive) stream.backUp(1);
|
285
|
+
state.tokenize = tokenBase;
|
286
|
+
}
|
287
|
+
return ret("string", "string");
|
288
|
+
};
|
289
|
+
}
|
290
|
+
|
291
|
+
function tokenParenthesized(stream, state) {
|
292
|
+
stream.next(); // Must be '('
|
293
|
+
if (!stream.match(/\s*[\"\']/, false))
|
294
|
+
state.tokenize = tokenString(")", true);
|
295
|
+
else
|
296
|
+
state.tokenize = tokenBase;
|
297
|
+
return ret(null, "(");
|
298
|
+
}
|
299
|
+
|
300
|
+
return {
|
301
|
+
startState: function(base) {
|
302
|
+
return {tokenize: tokenBase,
|
303
|
+
baseIndent: base || 0,
|
304
|
+
stack: []};
|
305
|
+
},
|
306
|
+
|
307
|
+
token: function(stream, state) {
|
308
|
+
|
309
|
+
// Use these terms when applicable (see http://www.xanthir.com/blog/b4E50)
|
310
|
+
//
|
311
|
+
// rule** or **ruleset:
|
312
|
+
// A selector + braces combo, or an at-rule.
|
313
|
+
//
|
314
|
+
// declaration block:
|
315
|
+
// A sequence of declarations.
|
316
|
+
//
|
317
|
+
// declaration:
|
318
|
+
// A property + colon + value combo.
|
319
|
+
//
|
320
|
+
// property value:
|
321
|
+
// The entire value of a property.
|
322
|
+
//
|
323
|
+
// component value:
|
324
|
+
// A single piece of a property value. Like the 5px in
|
325
|
+
// text-shadow: 0 0 5px blue;. Can also refer to things that are
|
326
|
+
// multiple terms, like the 1-4 terms that make up the background-size
|
327
|
+
// portion of the background shorthand.
|
328
|
+
//
|
329
|
+
// term:
|
330
|
+
// The basic unit of author-facing CSS, like a single number (5),
|
331
|
+
// dimension (5px), string ("foo"), or function. Officially defined
|
332
|
+
// by the CSS 2.1 grammar (look for the 'term' production)
|
333
|
+
//
|
334
|
+
//
|
335
|
+
// simple selector:
|
336
|
+
// A single atomic selector, like a type selector, an attr selector, a
|
337
|
+
// class selector, etc.
|
338
|
+
//
|
339
|
+
// compound selector:
|
340
|
+
// One or more simple selectors without a combinator. div.example is
|
341
|
+
// compound, div > .example is not.
|
342
|
+
//
|
343
|
+
// complex selector:
|
344
|
+
// One or more compound selectors chained with combinators.
|
345
|
+
//
|
346
|
+
// combinator:
|
347
|
+
// The parts of selectors that express relationships. There are four
|
348
|
+
// currently - the space (descendant combinator), the greater-than
|
349
|
+
// bracket (child combinator), the plus sign (next sibling combinator),
|
350
|
+
// and the tilda (following sibling combinator).
|
351
|
+
//
|
352
|
+
// sequence of selectors:
|
353
|
+
// One or more of the named type of selector chained with commas.
|
354
|
+
|
355
|
+
if (state.tokenize == tokenBase && stream.eatSpace()) return null;
|
356
|
+
var style = state.tokenize(stream, state);
|
357
|
+
|
358
|
+
// Changing style returned based on context
|
359
|
+
var context = state.stack[state.stack.length-1];
|
360
|
+
if (style == "property") {
|
361
|
+
if (context == "propertyValue"){
|
362
|
+
if (valueKeywords[stream.current()]) {
|
363
|
+
style = "string-2";
|
364
|
+
} else if (colorKeywords[stream.current()]) {
|
365
|
+
style = "keyword";
|
366
|
+
} else {
|
367
|
+
style = "variable-2";
|
368
|
+
}
|
369
|
+
} else if (context == "rule") {
|
370
|
+
if (!propertyKeywords[stream.current()]) {
|
371
|
+
style += " error";
|
372
|
+
}
|
373
|
+
} else if (!context || context == "@media{") {
|
374
|
+
style = "tag";
|
375
|
+
} else if (context == "@media") {
|
376
|
+
if (atMediaTypes[stream.current()]) {
|
377
|
+
style = "attribute"; // Known attribute
|
378
|
+
} else if (/^(only|not)$/i.test(stream.current())) {
|
379
|
+
style = "keyword";
|
380
|
+
} else if (stream.current().toLowerCase() == "and") {
|
381
|
+
style = "error"; // "and" is only allowed in @mediaType
|
382
|
+
} else if (atMediaFeatures[stream.current()]) {
|
383
|
+
style = "error"; // Known property, should be in @mediaType(
|
384
|
+
} else {
|
385
|
+
// Unknown, expecting keyword or attribute, assuming attribute
|
386
|
+
style = "attribute error";
|
387
|
+
}
|
388
|
+
} else if (context == "@mediaType") {
|
389
|
+
if (atMediaTypes[stream.current()]) {
|
390
|
+
style = "attribute";
|
391
|
+
} else if (stream.current().toLowerCase() == "and") {
|
392
|
+
style = "operator";
|
393
|
+
} else if (/^(only|not)$/i.test(stream.current())) {
|
394
|
+
style = "error"; // Only allowed in @media
|
395
|
+
} else if (atMediaFeatures[stream.current()]) {
|
396
|
+
style = "error"; // Known property, should be in parentheses
|
397
|
+
} else {
|
398
|
+
// Unknown attribute or property, but expecting property (preceded
|
399
|
+
// by "and"). Should be in parentheses
|
400
|
+
style = "error";
|
401
|
+
}
|
402
|
+
} else if (context == "@mediaType(") {
|
403
|
+
if (propertyKeywords[stream.current()]) {
|
404
|
+
// do nothing, remains "property"
|
405
|
+
} else if (atMediaTypes[stream.current()]) {
|
406
|
+
style = "error"; // Known property, should be in parentheses
|
407
|
+
} else if (stream.current().toLowerCase() == "and") {
|
408
|
+
style = "operator";
|
409
|
+
} else if (/^(only|not)$/i.test(stream.current())) {
|
410
|
+
style = "error"; // Only allowed in @media
|
411
|
+
} else {
|
412
|
+
style += " error";
|
413
|
+
}
|
414
|
+
} else {
|
415
|
+
style = "error";
|
416
|
+
}
|
417
|
+
} else if (style == "atom") {
|
418
|
+
if(!context || context == "@media{") {
|
419
|
+
style = "builtin";
|
420
|
+
} else if (context == "propertyValue") {
|
421
|
+
if (!/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) {
|
422
|
+
style += " error";
|
423
|
+
}
|
424
|
+
} else {
|
425
|
+
style = "error";
|
426
|
+
}
|
427
|
+
} else if (context == "@media" && type == "{") {
|
428
|
+
style = "error";
|
429
|
+
}
|
430
|
+
|
431
|
+
// Push/pop context stack
|
432
|
+
if (type == "{") {
|
433
|
+
if (context == "@media" || context == "@mediaType") {
|
434
|
+
state.stack.pop();
|
435
|
+
state.stack[state.stack.length-1] = "@media{";
|
436
|
+
}
|
437
|
+
else state.stack.push("rule");
|
438
|
+
}
|
439
|
+
else if (type == "}") {
|
440
|
+
state.stack.pop();
|
441
|
+
if (context == "propertyValue") state.stack.pop();
|
442
|
+
}
|
443
|
+
else if (type == "@media") state.stack.push("@media");
|
444
|
+
else if (context == "@media" && /\b(keyword|attribute)\b/.test(style))
|
445
|
+
state.stack.push("@mediaType");
|
446
|
+
else if (context == "@mediaType" && stream.current() == ",") state.stack.pop();
|
447
|
+
else if (context == "@mediaType" && type == "(") state.stack.push("@mediaType(");
|
448
|
+
else if (context == "@mediaType(" && type == ")") state.stack.pop();
|
449
|
+
else if (context == "rule" && type == ":") state.stack.push("propertyValue");
|
450
|
+
else if (context == "propertyValue" && type == ";") state.stack.pop();
|
451
|
+
return style;
|
452
|
+
},
|
453
|
+
|
454
|
+
indent: function(state, textAfter) {
|
455
|
+
var n = state.stack.length;
|
456
|
+
if (/^\}/.test(textAfter))
|
457
|
+
n -= state.stack[state.stack.length-1] == "propertyValue" ? 2 : 1;
|
458
|
+
return state.baseIndent + n * indentUnit;
|
459
|
+
},
|
460
|
+
|
461
|
+
electricChars: "}"
|
462
|
+
};
|
463
|
+
});
|
464
|
+
|
465
|
+
CodeMirror.defineMIME("text/css", "css");
|