ace-rails-ap 0.0.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. data/lib/ace/rails/version.rb +1 -1
  2. data/vendor/assets/javascripts/ace.js +15680 -1
  3. data/vendor/assets/javascripts/keybinding-emacs.js +367 -1
  4. data/vendor/assets/javascripts/keybinding-vim.js +1635 -1
  5. data/vendor/assets/javascripts/mode-c9search.js +275 -0
  6. data/vendor/assets/javascripts/mode-c_cpp.js +744 -1
  7. data/vendor/assets/javascripts/mode-clojure.js +364 -1
  8. data/vendor/assets/javascripts/mode-coffee.js +527 -1
  9. data/vendor/assets/javascripts/mode-coldfusion.js +1966 -1
  10. data/vendor/assets/javascripts/mode-csharp.js +633 -1
  11. data/vendor/assets/javascripts/mode-css.js +499 -1
  12. data/vendor/assets/javascripts/mode-diff.js +250 -0
  13. data/vendor/assets/javascripts/{mode-c_cpp-uncompressed.js → mode-glsl.js} +147 -244
  14. data/vendor/assets/javascripts/mode-golang.js +681 -1
  15. data/vendor/assets/javascripts/mode-groovy.js +1240 -1
  16. data/vendor/assets/javascripts/mode-haxe.js +633 -1
  17. data/vendor/assets/javascripts/mode-html.js +2064 -1
  18. data/vendor/assets/javascripts/mode-java.js +1202 -1
  19. data/vendor/assets/javascripts/mode-javascript.js +1069 -1
  20. data/vendor/assets/javascripts/mode-json.js +588 -1
  21. data/vendor/assets/javascripts/{mode-haxe-uncompressed.js → mode-jsx.js} +189 -312
  22. data/vendor/assets/javascripts/mode-latex.js +95 -1
  23. data/vendor/assets/javascripts/mode-less.js +512 -1
  24. data/vendor/assets/javascripts/mode-liquid.js +1125 -1
  25. data/vendor/assets/javascripts/mode-lua.js +551 -1
  26. data/vendor/assets/javascripts/{mode-html-uncompressed.js → mode-luahtml.js} +544 -604
  27. data/vendor/assets/javascripts/{mode-coldfusion-uncompressed.js → mode-luapage.js} +2326 -2180
  28. data/vendor/assets/javascripts/mode-markdown.js +2369 -1
  29. data/vendor/assets/javascripts/mode-ocaml.js +464 -1
  30. data/vendor/assets/javascripts/mode-perl.js +432 -1
  31. data/vendor/assets/javascripts/mode-pgsql.js +970 -1
  32. data/vendor/assets/javascripts/mode-php.js +1718 -1
  33. data/vendor/assets/javascripts/mode-powershell.js +610 -1
  34. data/vendor/assets/javascripts/mode-python.js +397 -1
  35. data/vendor/assets/javascripts/mode-ruby.js +318 -1
  36. data/vendor/assets/javascripts/mode-scad.js +732 -1
  37. data/vendor/assets/javascripts/mode-scala.js +1237 -1
  38. data/vendor/assets/javascripts/mode-scss.js +537 -1
  39. data/vendor/assets/javascripts/mode-sh.js +250 -1
  40. data/vendor/assets/javascripts/mode-sql.js +140 -1
  41. data/vendor/assets/javascripts/mode-svg.js +1681 -1
  42. data/vendor/assets/javascripts/mode-tcl.js +320 -0
  43. data/vendor/assets/javascripts/mode-textile.js +182 -1
  44. data/vendor/assets/javascripts/mode-xml.js +829 -1
  45. data/vendor/assets/javascripts/mode-xquery.js +605 -1
  46. data/vendor/assets/javascripts/mode-yaml.js +189 -0
  47. data/vendor/assets/javascripts/theme-chrome.js +213 -1
  48. data/vendor/assets/javascripts/theme-clouds.js +167 -1
  49. data/vendor/assets/javascripts/theme-clouds_midnight.js +168 -1
  50. data/vendor/assets/javascripts/theme-cobalt.js +194 -1
  51. data/vendor/assets/javascripts/theme-crimson_editor.js +200 -1
  52. data/vendor/assets/javascripts/theme-dawn.js +198 -1
  53. data/vendor/assets/javascripts/theme-dreamweaver.js +230 -1
  54. data/vendor/assets/javascripts/theme-eclipse.js +157 -1
  55. data/vendor/assets/javascripts/theme-github.js +182 -0
  56. data/vendor/assets/javascripts/theme-idle_fingers.js +186 -1
  57. data/vendor/assets/javascripts/theme-kr_theme.js +189 -1
  58. data/vendor/assets/javascripts/theme-merbivore.js +189 -1
  59. data/vendor/assets/javascripts/theme-merbivore_soft.js +195 -1
  60. data/vendor/assets/javascripts/theme-mono_industrial.js +197 -1
  61. data/vendor/assets/javascripts/theme-monokai.js +194 -1
  62. data/vendor/assets/javascripts/theme-pastel_on_dark.js +199 -1
  63. data/vendor/assets/javascripts/theme-solarized_dark.js +180 -1
  64. data/vendor/assets/javascripts/theme-solarized_light.js +179 -1
  65. data/vendor/assets/javascripts/theme-textmate.js +216 -0
  66. data/vendor/assets/javascripts/theme-tomorrow.js +213 -1
  67. data/vendor/assets/javascripts/theme-tomorrow_night.js +213 -1
  68. data/vendor/assets/javascripts/theme-tomorrow_night_blue.js +213 -1
  69. data/vendor/assets/javascripts/theme-tomorrow_night_bright.js +213 -1
  70. data/vendor/assets/javascripts/theme-tomorrow_night_eighties.js +209 -1
  71. data/vendor/assets/javascripts/theme-twilight.js +211 -1
  72. data/vendor/assets/javascripts/theme-vibrant_ink.js +190 -1
  73. data/vendor/assets/javascripts/worker-coffee.js +83 -893
  74. data/vendor/assets/javascripts/worker-css.js +88 -1402
  75. data/vendor/assets/javascripts/worker-javascript.js +97 -812
  76. data/vendor/assets/javascripts/worker-json.js +84 -761
  77. data/vendor/assets/javascripts/worker-xquery.js +66464 -0
  78. metadata +12 -195
  79. data/vendor/assets/javascripts/ace-compat-noconflict.js +0 -1
  80. data/vendor/assets/javascripts/ace-compat-uncompressed-noconflict.js +0 -480
  81. data/vendor/assets/javascripts/ace-compat-uncompressed.js +0 -480
  82. data/vendor/assets/javascripts/ace-compat.js +0 -1
  83. data/vendor/assets/javascripts/ace-noconflict.js +0 -10
  84. data/vendor/assets/javascripts/ace-uncompressed-noconflict.js +0 -19976
  85. data/vendor/assets/javascripts/ace-uncompressed.js +0 -19976
  86. data/vendor/assets/javascripts/keybinding-emacs-noconflict.js +0 -1
  87. data/vendor/assets/javascripts/keybinding-emacs-uncompressed-noconflict.js +0 -150
  88. data/vendor/assets/javascripts/keybinding-emacs-uncompressed.js +0 -150
  89. data/vendor/assets/javascripts/keybinding-vim-noconflict.js +0 -1
  90. data/vendor/assets/javascripts/keybinding-vim-uncompressed-noconflict.js +0 -138
  91. data/vendor/assets/javascripts/keybinding-vim-uncompressed.js +0 -138
  92. data/vendor/assets/javascripts/mode-c_cpp-noconflict.js +0 -1
  93. data/vendor/assets/javascripts/mode-c_cpp-uncompressed-noconflict.js +0 -919
  94. data/vendor/assets/javascripts/mode-clojure-noconflict.js +0 -1
  95. data/vendor/assets/javascripts/mode-clojure-uncompressed-noconflict.js +0 -422
  96. data/vendor/assets/javascripts/mode-clojure-uncompressed.js +0 -422
  97. data/vendor/assets/javascripts/mode-coffee-noconflict.js +0 -1
  98. data/vendor/assets/javascripts/mode-coffee-uncompressed-noconflict.js +0 -607
  99. data/vendor/assets/javascripts/mode-coffee-uncompressed.js +0 -607
  100. data/vendor/assets/javascripts/mode-coldfusion-noconflict.js +0 -1
  101. data/vendor/assets/javascripts/mode-coldfusion-uncompressed-noconflict.js +0 -2458
  102. data/vendor/assets/javascripts/mode-csharp-noconflict.js +0 -1
  103. data/vendor/assets/javascripts/mode-csharp-uncompressed-noconflict.js +0 -769
  104. data/vendor/assets/javascripts/mode-csharp-uncompressed.js +0 -769
  105. data/vendor/assets/javascripts/mode-css-noconflict.js +0 -1
  106. data/vendor/assets/javascripts/mode-css-uncompressed-noconflict.js +0 -641
  107. data/vendor/assets/javascripts/mode-css-uncompressed.js +0 -641
  108. data/vendor/assets/javascripts/mode-golang-noconflict.js +0 -1
  109. data/vendor/assets/javascripts/mode-golang-uncompressed-noconflict.js +0 -378
  110. data/vendor/assets/javascripts/mode-golang-uncompressed.js +0 -378
  111. data/vendor/assets/javascripts/mode-groovy-noconflict.js +0 -1
  112. data/vendor/assets/javascripts/mode-groovy-uncompressed-noconflict.js +0 -1393
  113. data/vendor/assets/javascripts/mode-groovy-uncompressed.js +0 -1393
  114. data/vendor/assets/javascripts/mode-haxe-noconflict.js +0 -1
  115. data/vendor/assets/javascripts/mode-haxe-uncompressed-noconflict.js +0 -769
  116. data/vendor/assets/javascripts/mode-html-noconflict.js +0 -1
  117. data/vendor/assets/javascripts/mode-html-uncompressed-noconflict.js +0 -2475
  118. data/vendor/assets/javascripts/mode-java-noconflict.js +0 -1
  119. data/vendor/assets/javascripts/mode-java-uncompressed-noconflict.js +0 -1395
  120. data/vendor/assets/javascripts/mode-java-uncompressed.js +0 -1395
  121. data/vendor/assets/javascripts/mode-javascript-noconflict.js +0 -1
  122. data/vendor/assets/javascripts/mode-javascript-uncompressed-noconflict.js +0 -1226
  123. data/vendor/assets/javascripts/mode-javascript-uncompressed.js +0 -1226
  124. data/vendor/assets/javascripts/mode-json-noconflict.js +0 -1
  125. data/vendor/assets/javascripts/mode-json-uncompressed-noconflict.js +0 -701
  126. data/vendor/assets/javascripts/mode-json-uncompressed.js +0 -701
  127. data/vendor/assets/javascripts/mode-latex-noconflict.js +0 -1
  128. data/vendor/assets/javascripts/mode-latex-uncompressed-noconflict.js +0 -95
  129. data/vendor/assets/javascripts/mode-latex-uncompressed.js +0 -95
  130. data/vendor/assets/javascripts/mode-less-noconflict.js +0 -1
  131. data/vendor/assets/javascripts/mode-less-uncompressed-noconflict.js +0 -655
  132. data/vendor/assets/javascripts/mode-less-uncompressed.js +0 -655
  133. data/vendor/assets/javascripts/mode-liquid-noconflict.js +0 -1
  134. data/vendor/assets/javascripts/mode-liquid-uncompressed-noconflict.js +0 -1353
  135. data/vendor/assets/javascripts/mode-liquid-uncompressed.js +0 -1353
  136. data/vendor/assets/javascripts/mode-lua-noconflict.js +0 -1
  137. data/vendor/assets/javascripts/mode-lua-uncompressed-noconflict.js +0 -523
  138. data/vendor/assets/javascripts/mode-lua-uncompressed.js +0 -523
  139. data/vendor/assets/javascripts/mode-markdown-noconflict.js +0 -1
  140. data/vendor/assets/javascripts/mode-markdown-uncompressed-noconflict.js +0 -2925
  141. data/vendor/assets/javascripts/mode-markdown-uncompressed.js +0 -2925
  142. data/vendor/assets/javascripts/mode-ocaml-noconflict.js +0 -1
  143. data/vendor/assets/javascripts/mode-ocaml-uncompressed-noconflict.js +0 -539
  144. data/vendor/assets/javascripts/mode-ocaml-uncompressed.js +0 -539
  145. data/vendor/assets/javascripts/mode-perl-noconflict.js +0 -1
  146. data/vendor/assets/javascripts/mode-perl-uncompressed-noconflict.js +0 -574
  147. data/vendor/assets/javascripts/mode-perl-uncompressed.js +0 -574
  148. data/vendor/assets/javascripts/mode-pgsql-noconflict.js +0 -1
  149. data/vendor/assets/javascripts/mode-pgsql-uncompressed-noconflict.js +0 -1104
  150. data/vendor/assets/javascripts/mode-pgsql-uncompressed.js +0 -1104
  151. data/vendor/assets/javascripts/mode-php-noconflict.js +0 -1
  152. data/vendor/assets/javascripts/mode-php-uncompressed-noconflict.js +0 -1885
  153. data/vendor/assets/javascripts/mode-php-uncompressed.js +0 -1885
  154. data/vendor/assets/javascripts/mode-powershell-noconflict.js +0 -1
  155. data/vendor/assets/javascripts/mode-powershell-uncompressed-noconflict.js +0 -710
  156. data/vendor/assets/javascripts/mode-powershell-uncompressed.js +0 -710
  157. data/vendor/assets/javascripts/mode-python-noconflict.js +0 -1
  158. data/vendor/assets/javascripts/mode-python-uncompressed-noconflict.js +0 -507
  159. data/vendor/assets/javascripts/mode-python-uncompressed.js +0 -507
  160. data/vendor/assets/javascripts/mode-ruby-noconflict.js +0 -1
  161. data/vendor/assets/javascripts/mode-ruby-uncompressed-noconflict.js +0 -391
  162. data/vendor/assets/javascripts/mode-ruby-uncompressed.js +0 -391
  163. data/vendor/assets/javascripts/mode-scad-noconflict.js +0 -1
  164. data/vendor/assets/javascripts/mode-scad-uncompressed-noconflict.js +0 -907
  165. data/vendor/assets/javascripts/mode-scad-uncompressed.js +0 -907
  166. data/vendor/assets/javascripts/mode-scala-noconflict.js +0 -1
  167. data/vendor/assets/javascripts/mode-scala-uncompressed-noconflict.js +0 -1395
  168. data/vendor/assets/javascripts/mode-scala-uncompressed.js +0 -1395
  169. data/vendor/assets/javascripts/mode-scss-noconflict.js +0 -1
  170. data/vendor/assets/javascripts/mode-scss-uncompressed-noconflict.js +0 -679
  171. data/vendor/assets/javascripts/mode-scss-uncompressed.js +0 -679
  172. data/vendor/assets/javascripts/mode-sh-noconflict.js +0 -1
  173. data/vendor/assets/javascripts/mode-sh-uncompressed-noconflict.js +0 -289
  174. data/vendor/assets/javascripts/mode-sh-uncompressed.js +0 -289
  175. data/vendor/assets/javascripts/mode-sql-noconflict.js +0 -1
  176. data/vendor/assets/javascripts/mode-sql-uncompressed-noconflict.js +0 -159
  177. data/vendor/assets/javascripts/mode-sql-uncompressed.js +0 -159
  178. data/vendor/assets/javascripts/mode-svg-noconflict.js +0 -1
  179. data/vendor/assets/javascripts/mode-svg-uncompressed-noconflict.js +0 -2137
  180. data/vendor/assets/javascripts/mode-svg-uncompressed.js +0 -2137
  181. data/vendor/assets/javascripts/mode-text-noconflict.js +0 -0
  182. data/vendor/assets/javascripts/mode-text-uncompressed-noconflict.js +0 -0
  183. data/vendor/assets/javascripts/mode-text-uncompressed.js +0 -0
  184. data/vendor/assets/javascripts/mode-textile-noconflict.js +0 -1
  185. data/vendor/assets/javascripts/mode-textile-uncompressed-noconflict.js +0 -254
  186. data/vendor/assets/javascripts/mode-textile-uncompressed.js +0 -254
  187. data/vendor/assets/javascripts/mode-xml-noconflict.js +0 -1
  188. data/vendor/assets/javascripts/mode-xml-uncompressed-noconflict.js +0 -1012
  189. data/vendor/assets/javascripts/mode-xml-uncompressed.js +0 -1012
  190. data/vendor/assets/javascripts/mode-xquery-noconflict.js +0 -1
  191. data/vendor/assets/javascripts/mode-xquery-uncompressed-noconflict.js +0 -540
  192. data/vendor/assets/javascripts/mode-xquery-uncompressed.js +0 -540
  193. data/vendor/assets/javascripts/theme-chrome-noconflict.js +0 -1
  194. data/vendor/assets/javascripts/theme-chrome-uncompressed-noconflict.js +0 -207
  195. data/vendor/assets/javascripts/theme-chrome-uncompressed.js +0 -207
  196. data/vendor/assets/javascripts/theme-clouds-noconflict.js +0 -1
  197. data/vendor/assets/javascripts/theme-clouds-uncompressed-noconflict.js +0 -160
  198. data/vendor/assets/javascripts/theme-clouds-uncompressed.js +0 -160
  199. data/vendor/assets/javascripts/theme-clouds_midnight-noconflict.js +0 -1
  200. data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed-noconflict.js +0 -161
  201. data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed.js +0 -161
  202. data/vendor/assets/javascripts/theme-cobalt-noconflict.js +0 -1
  203. data/vendor/assets/javascripts/theme-cobalt-uncompressed-noconflict.js +0 -187
  204. data/vendor/assets/javascripts/theme-cobalt-uncompressed.js +0 -187
  205. data/vendor/assets/javascripts/theme-crimson_editor-noconflict.js +0 -1
  206. data/vendor/assets/javascripts/theme-crimson_editor-uncompressed-noconflict.js +0 -198
  207. data/vendor/assets/javascripts/theme-crimson_editor-uncompressed.js +0 -198
  208. data/vendor/assets/javascripts/theme-dawn-noconflict.js +0 -1
  209. data/vendor/assets/javascripts/theme-dawn-uncompressed-noconflict.js +0 -191
  210. data/vendor/assets/javascripts/theme-dawn-uncompressed.js +0 -191
  211. data/vendor/assets/javascripts/theme-dreamweaver-noconflict.js +0 -1
  212. data/vendor/assets/javascripts/theme-dreamweaver-uncompressed-noconflict.js +0 -227
  213. data/vendor/assets/javascripts/theme-dreamweaver-uncompressed.js +0 -227
  214. data/vendor/assets/javascripts/theme-eclipse-noconflict.js +0 -1
  215. data/vendor/assets/javascripts/theme-eclipse-uncompressed-noconflict.js +0 -147
  216. data/vendor/assets/javascripts/theme-eclipse-uncompressed.js +0 -147
  217. data/vendor/assets/javascripts/theme-idle_fingers-noconflict.js +0 -1
  218. data/vendor/assets/javascripts/theme-idle_fingers-uncompressed-noconflict.js +0 -179
  219. data/vendor/assets/javascripts/theme-idle_fingers-uncompressed.js +0 -179
  220. data/vendor/assets/javascripts/theme-kr_theme-noconflict.js +0 -1
  221. data/vendor/assets/javascripts/theme-kr_theme-uncompressed-noconflict.js +0 -182
  222. data/vendor/assets/javascripts/theme-kr_theme-uncompressed.js +0 -182
  223. data/vendor/assets/javascripts/theme-merbivore-noconflict.js +0 -1
  224. data/vendor/assets/javascripts/theme-merbivore-uncompressed-noconflict.js +0 -182
  225. data/vendor/assets/javascripts/theme-merbivore-uncompressed.js +0 -182
  226. data/vendor/assets/javascripts/theme-merbivore_soft-noconflict.js +0 -1
  227. data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed-noconflict.js +0 -188
  228. data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed.js +0 -188
  229. data/vendor/assets/javascripts/theme-mono_industrial-noconflict.js +0 -1
  230. data/vendor/assets/javascripts/theme-mono_industrial-uncompressed-noconflict.js +0 -190
  231. data/vendor/assets/javascripts/theme-mono_industrial-uncompressed.js +0 -190
  232. data/vendor/assets/javascripts/theme-monokai-noconflict.js +0 -1
  233. data/vendor/assets/javascripts/theme-monokai-uncompressed-noconflict.js +0 -191
  234. data/vendor/assets/javascripts/theme-monokai-uncompressed.js +0 -191
  235. data/vendor/assets/javascripts/theme-pastel_on_dark-noconflict.js +0 -1
  236. data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed-noconflict.js +0 -192
  237. data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed.js +0 -192
  238. data/vendor/assets/javascripts/theme-solarized_dark-noconflict.js +0 -1
  239. data/vendor/assets/javascripts/theme-solarized_dark-uncompressed-noconflict.js +0 -176
  240. data/vendor/assets/javascripts/theme-solarized_dark-uncompressed.js +0 -176
  241. data/vendor/assets/javascripts/theme-solarized_light-noconflict.js +0 -1
  242. data/vendor/assets/javascripts/theme-solarized_light-uncompressed-noconflict.js +0 -172
  243. data/vendor/assets/javascripts/theme-solarized_light-uncompressed.js +0 -172
  244. data/vendor/assets/javascripts/theme-textmate-noconflict.js +0 -0
  245. data/vendor/assets/javascripts/theme-textmate-uncompressed-noconflict.js +0 -0
  246. data/vendor/assets/javascripts/theme-textmate-uncompressed.js +0 -0
  247. data/vendor/assets/javascripts/theme-tomorrow-noconflict.js +0 -1
  248. data/vendor/assets/javascripts/theme-tomorrow-uncompressed-noconflict.js +0 -206
  249. data/vendor/assets/javascripts/theme-tomorrow-uncompressed.js +0 -206
  250. data/vendor/assets/javascripts/theme-tomorrow_night-noconflict.js +0 -1
  251. data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed-noconflict.js +0 -206
  252. data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed.js +0 -206
  253. data/vendor/assets/javascripts/theme-tomorrow_night_blue-noconflict.js +0 -1
  254. data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed-noconflict.js +0 -209
  255. data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed.js +0 -209
  256. data/vendor/assets/javascripts/theme-tomorrow_night_bright-noconflict.js +0 -1
  257. data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed-noconflict.js +0 -206
  258. data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed.js +0 -206
  259. data/vendor/assets/javascripts/theme-tomorrow_night_eighties-noconflict.js +0 -1
  260. data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed-noconflict.js +0 -202
  261. data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed.js +0 -202
  262. data/vendor/assets/javascripts/theme-twilight-noconflict.js +0 -1
  263. data/vendor/assets/javascripts/theme-twilight-uncompressed-noconflict.js +0 -204
  264. data/vendor/assets/javascripts/theme-twilight-uncompressed.js +0 -204
  265. data/vendor/assets/javascripts/theme-vibrant_ink-noconflict.js +0 -1
  266. data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed-noconflict.js +0 -183
  267. data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed.js +0 -183
@@ -1 +1,2064 @@
1
- define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/tokenizer","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("./javascript").Mode,g=a("./css").Mode,h=a("../tokenizer").Tokenizer,i=a("./html_highlight_rules").HtmlHighlightRules,j=a("./behaviour/xml").XmlBehaviour,k=a("./folding/html").FoldMode,l=function(){var a=new i;this.$tokenizer=new h(a.getRules()),this.$behaviour=new j,this.$embeds=a.getEmbeds(),this.createModeDelegates({"js-":f,"css-":g}),this.foldingRules=new k};d.inherits(l,e),function(){this.toggleCommentLines=function(a,b,c,d){return 0},this.getNextLineIndent=function(a,b,c){return this.$getIndent(b)},this.checkOutdent=function(a,b,c){return!1}}.call(l.prototype),b.Mode=l}),define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("../tokenizer").Tokenizer,g=a("./javascript_highlight_rules").JavaScriptHighlightRules,h=a("./matching_brace_outdent").MatchingBraceOutdent,i=a("../range").Range,j=a("../worker/worker_client").WorkerClient,k=a("./behaviour/cstyle").CstyleBehaviour,l=a("./folding/cstyle").FoldMode,m=function(){this.$tokenizer=new f((new g).getRules()),this.$outdent=new h,this.$behaviour=new k,this.foldingRules=new l};d.inherits(m,e),function(){this.toggleCommentLines=function(a,b,c,d){var e=!0,f=/^(\s*)\/\//;for(var g=c;g<=d;g++)if(!f.test(b.getLine(g))){e=!1;break}if(e){var h=new i(0,0,0,0);for(var g=c;g<=d;g++){var j=b.getLine(g),k=j.match(f);h.start.row=g,h.end.row=g,h.end.column=k[0].length,b.replace(h,k[1])}}else b.indentRows(c,d,"//")},this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a),f=e.tokens,g=e.state;if(f.length&&f[f.length-1].type=="comment")return d;if(a=="start"||a=="regex_allowed"){var h=b.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);h&&(d+=c)}else if(a=="doc-start"){if(g=="start"||a=="regex_allowed")return"";var h=b.match(/^\s*(\/?)\*/);h&&(h[1]&&(d+=" "),d+="* ")}return d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},this.createWorker=function(a){var b=new j(["ace"],"worker-javascript.js","ace/mode/javascript_worker","JavaScriptWorker");return b.attachToDocument(a.getDocument()),b.on("jslint",function(b){var c=[];for(var d=0;d<b.data.length;d++){var e=b.data[d];e&&c.push({row:e.line-1,column:e.character-1,text:e.reason,type:"warning",lint:e})}a.setAnnotations(c)}),b.on("narcissus",function(b){a.setAnnotations([b.data])}),b.on("terminate",function(){a.clearAnnotations()}),b}}.call(m.prototype),b.Mode=m}),define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/unicode","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("../lib/lang"),f=a("../unicode"),g=a("./doc_comment_highlight_rules").DocCommentHighlightRules,h=a("./text_highlight_rules").TextHighlightRules,i=function(){var a=e.arrayToMap("Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document".split("|")),b=e.arrayToMap("break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|const|yield|import|get|set".split("|")),c="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield",d=e.arrayToMap("__parent__|__count__|escape|unescape|with|__proto__".split("|")),h=e.arrayToMap("const|let|var|function".split("|")),i=e.arrayToMap("null|Infinity|NaN|undefined".split("|")),j=e.arrayToMap("class|enum|extends|super|export|implements|private|public|interface|package|protected|static".split("|")),k="["+f.packages.L+"\\$_]["+f.packages.L+f.packages.Mn+f.packages.Mc+f.packages.Nd+f.packages.Pc+"\\$_]*\\b",l="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";this.$rules={start:[{token:"comment",regex:/\/\/.*$/},g.getStartRule("doc-start"),{token:"comment",merge:!0,regex:/\/\*/,next:"comment"},{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0[xX][0-9a-fA-F]+\b/},{token:"constant.numeric",regex:/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+k+")(\\.)(prototype)(\\.)("+k+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator","text"],regex:"("+k+")(\\.)(prototype)(\\.)("+k+")(\\s*)(=)(\\s*)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+k+")(\\.)("+k+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+k+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+k+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+k+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"constant.language.boolean",regex:/(?:true|false)\b/},{token:"keyword",regex:"(?:"+c+")\\b",next:"regex_allowed"},{token:["punctuation.operator","support.function"],regex:/(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:["punctuation.operator","support.function.dom"],regex:/(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:["punctuation.operator","support.constant"],regex:/(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/},{token:function(c){return a.hasOwnProperty(c)?"variable.language":d.hasOwnProperty(c)?"invalid.deprecated":h.hasOwnProperty(c)?"storage.type":b.hasOwnProperty(c)?"keyword":i.hasOwnProperty(c)?"constant.language":j.hasOwnProperty(c)?"invalid.illegal":c=="debugger"?"invalid.deprecated":"identifier"},regex:k},{token:"keyword.operator",regex:/!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,next:"regex_allowed"},{token:"punctuation.operator",regex:/\?|\:|\,|\;|\./,next:"regex_allowed"},{token:"paren.lparen",regex:/[\[({]/,next:"regex_allowed"},{token:"paren.rparen",regex:/[\])}]/},{token:"keyword.operator",regex:/\/=?/,next:"regex_allowed"},{token:"comment",regex:/^#!.*$/},{token:"text",regex:/\s+/}],regex_allowed:[g.getStartRule("doc-start"),{token:"comment",merge:!0,regex:"\\/\\*",next:"comment_regex_allowed"},{token:"comment",regex:"\\/\\/.*$"},{token:"string.regexp",regex:"\\/",next:"regex",merge:!0},{token:"text",regex:"\\s+"},{token:"empty",regex:"",next:"start"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/\\w*",next:"start",merge:!0},{token:"string.regexp",regex:"[^\\\\/\\[]+",merge:!0},{token:"string.regexp.charachterclass",regex:"\\[",next:"regex_character_class",merge:!0},{token:"empty",regex:"",next:"start"}],regex_character_class:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp.charachterclass",regex:"]",next:"regex",merge:!0},{token:"string.regexp.charachterclass",regex:"[^\\\\\\]]+",merge:!0},{token:"empty",regex:"",next:"start"}],function_arguments:[{token:"variable.parameter",regex:k},{token:"punctuation.operator",regex:"[, ]+",merge:!0},{token:"punctuation.operator",regex:"$",merge:!0},{token:"empty",regex:"",next:"start"}],comment_regex_allowed:[{token:"comment",regex:".*?\\*\\/",merge:!0,next:"regex_allowed"},{token:"comment",merge:!0,regex:".+"}],comment:[{token:"comment",regex:".*?\\*\\/",merge:!0,next:"start"},{token:"comment",merge:!0,regex:".+"}],qqstring:[{token:"constant.language.escape",regex:l},{token:"string",regex:'[^"\\\\]+',merge:!0},{token:"string",regex:"\\\\$",next:"qqstring",merge:!0},{token:"string",regex:'"|$',next:"start",merge:!0}],qstring:[{token:"constant.language.escape",regex:l},{token:"string",regex:"[^'\\\\]+",merge:!0},{token:"string",regex:"\\\\$",next:"qstring",merge:!0},{token:"string",regex:"'|$",next:"start",merge:!0}]},this.embedRules(g,"doc-",[g.getEndRule("start")])};d.inherits(i,h),b.JavaScriptHighlightRules=i}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text_highlight_rules").TextHighlightRules,f=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc",merge:!0,regex:"\\s+"},{token:"comment.doc",merge:!0,regex:"TODO"},{token:"comment.doc",merge:!0,regex:"[^@\\*]+"},{token:"comment.doc",merge:!0,regex:"."}]}};d.inherits(f,e),f.getStartRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\/\\*(?=\\*)",next:a}},f.getEndRule=function(a){return{token:"comment.doc",merge:!0,regex:"\\*\\/",next:a}},b.DocCommentHighlightRules=f}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(a,b,c){"use strict";var d=a("../range").Range,e=function(){};(function(){this.checkOutdent=function(a,b){return/^\s+$/.test(a)?/^\s*\}/.test(b):!1},this.autoOutdent=function(a,b){var c=a.getLine(b),e=c.match(/^(\s*\})/);if(!e)return 0;var f=e[1].length,g=a.findMatchingBracket({row:b,column:f});if(!g||g.row==b)return 0;var h=this.$getIndent(a.getLine(g.row));a.replace(new d(b,0,b,f-1),h)},this.$getIndent=function(a){var b=a.match(/^(\s+)/);return b?b[1]:""}}).call(e.prototype),b.MatchingBraceOutdent=e}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../behaviour").Behaviour,f=function(){this.add("braces","insertion",function(a,b,c,d,e){if(e=="{"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"{"+g+"}",selection:!1}:{text:"{}",selection:[1,1]}}if(e=="}"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var k=d.$findOpeningBracket("}",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j=="}"){var l=d.findMatchingBracket({row:h.row,column:h.column+1});if(!l)return null;var m=this.getNextLineIndent(a,i.substring(0,i.length-1),d.getTabString()),n=this.$getIndent(d.doc.getLine(l.row));return{text:"\n"+m+"\n"+n,selection:[1,m.length,1,m.length]}}}}),this.add("braces","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="{"){var g=d.doc.getLine(e.start.row),h=g.substring(e.end.column,e.end.column+1);if(h=="}")return e.end.column++,e}}),this.add("parens","insertion",function(a,b,c,d,e){if(e=="("){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?{text:"("+g+")",selection:!1}:{text:"()",selection:[1,1]}}if(e==")"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==")"){var k=d.$findOpeningBracket(")",{column:h.column+1,row:h.row});if(k!==null)return{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&f=="("){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h==")")return e.end.column++,e}}),this.add("string_dquotes","insertion",function(a,b,c,d,e){if(e=='"'||e=="'"){var f=e,g=c.getSelectionRange(),h=d.doc.getTextRange(g);if(h!=="")return{text:f+h+f,selection:!1};var i=c.getCursorPosition(),j=d.doc.getLine(i.row),k=j.substring(i.column-1,i.column);if(k=="\\")return null;var l=d.getTokens(g.start.row,g.start.row)[0].tokens,m=0,n,o=-1;for(var p=0;p<l.length;p++){n=l[p],n.type=="string"?o=-1:o<0&&(o=n.value.indexOf(f));if(n.value.length+m>g.start.column)break;m+=l[p].value.length}if(!n||o<0&&n.type!=="comment"&&(n.type!=="string"||g.start.column!==n.value.length+m-1&&n.value.lastIndexOf(f)===n.value.length-1))return{text:f+f,selection:[1,1]};if(n&&n.type==="string"){var q=j.substring(i.column,i.column+1);if(q==f)return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(a,b,c,d,e){var f=d.doc.getTextRange(e);if(!e.isMultiLine()&&(f=='"'||f=="'")){var g=d.doc.getLine(e.start.row),h=g.substring(e.start.column+1,e.start.column+2);if(h=='"')return e.end.column++,e}})};d.inherits(f,e),b.CstyleBehaviour=f}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../../range").Range,f=a("./fold_mode").FoldMode,g=b.FoldMode=function(){};d.inherits(g,f),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(a,b,c){var d=a.getLine(c),f=d.match(this.foldingStartMarker);if(f){var g=f.index;if(f[1])return this.openingBracketBlock(a,f[1],c,g);var h=a.getCommentFoldRange(c,g+f[0].length);return h.end.column-=2,h}if(b!=="markbeginend")return;var f=d.match(this.foldingStopMarker);if(f){var g=f.index+f[0].length;if(f[2]){var h=a.getCommentFoldRange(c,g);return h.end.column-=2,h}var i={row:c,column:g},j=a.$findOpeningBracket(f[1],i);if(!j)return;return j.column++,i.column--,e.fromPoints(j,i)}}}.call(g.prototype)}),define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(a,b,c){"use strict";var d=a("../../range").Range,e=b.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(a,b,c){var d=a.getLine(c);return this.foldingStartMarker.test(d)?"start":b=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(d)?"end":""},this.getFoldWidgetRange=function(a,b,c){return null},this.indentationBlock=function(a,b,c){var e=/^\s*/,f=b,g=b,h=a.getLine(b),i=c||h.length,j=h.match(e)[0].length,k=a.getLength();while(++b<k){h=a.getLine(b);var l=h.match(e)[0].length;if(l==h.length)continue;if(l<=j)break;g=b}if(g>f){var m=a.getLine(g).length;return new d(f,i,g,m)}},this.openingBracketBlock=function(a,b,c,e){var f={row:c,column:e+1},g=a.$findClosingBracket(b,f);if(!g)return;var h=a.foldWidgets[g.row];return h==null&&(h=this.getFoldWidget(a,g.row)),h=="start"&&(g.row--,g.column=a.getLine(g.row).length),d.fromPoints(f,g)}}).call(e.prototype)}),define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/folding/cstyle"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./text").Mode,f=a("../tokenizer").Tokenizer,g=a("./css_highlight_rules").CssHighlightRules,h=a("./matching_brace_outdent").MatchingBraceOutdent,i=a("../worker/worker_client").WorkerClient,j=a("./folding/cstyle").FoldMode,k=function(){this.$tokenizer=new f((new g).getRules(),"i"),this.$outdent=new h,this.foldingRules=new j};d.inherits(k,e),function(){this.foldingRules="cStyle",this.getNextLineIndent=function(a,b,c){var d=this.$getIndent(b),e=this.$tokenizer.getLineTokens(b,a).tokens;if(e.length&&e[e.length-1].type=="comment")return d;var f=b.match(/^.*\{\s*$/);return f&&(d+=c),d},this.checkOutdent=function(a,b,c){return this.$outdent.checkOutdent(b,c)},this.autoOutdent=function(a,b,c){this.$outdent.autoOutdent(b,c)},this.createWorker=function(a){var b=new i(["ace"],"worker-css.js","ace/mode/css_worker","Worker");return b.attachToDocument(a.getDocument()),b.on("csslint",function(b){var c=[];b.data.forEach(function(a){c.push({row:a.line-1,column:a.col-1,text:a.message,type:a.type,lint:a})}),a.setAnnotations(c)}),b}}.call(k.prototype),b.Mode=k}),define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("../lib/lang"),f=a("./text_highlight_rules").TextHighlightRules,g=function(){var a=e.arrayToMap("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|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|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|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-after|cue-before|cue|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|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|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|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index".split("|")),b=e.arrayToMap("rgb|rgba|url|attr|counter|counters".split("|")),c=e.arrayToMap("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero".split("|")),d=e.arrayToMap("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow".split("|")),f=e.arrayToMap("arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace".split("|")),g="\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))",h="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",i="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",j=[{token:"comment",merge:!0,regex:"\\/\\*",next:"ruleset_comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:["constant.numeric","keyword"],regex:"("+g+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"},{token:["constant.numeric"],regex:"([0-9]+)"},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:i},{token:function(e){return a.hasOwnProperty(e.toLowerCase())?"support.type":b.hasOwnProperty(e.toLowerCase())?"support.function":c.hasOwnProperty(e.toLowerCase())?"support.constant":d.hasOwnProperty(e.toLowerCase())?"support.constant.color":f.hasOwnProperty(e.toLowerCase())?"support.constant.fonts":"text"},regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"}],k=e.copyArray(j);k.unshift({token:"paren.rparen",regex:"\\}",next:"start"});var l=e.copyArray(j);l.unshift({token:"paren.rparen",regex:"\\}",next:"media"});var m=[{token:"comment",merge:!0,regex:".+"}],n=e.copyArray(m);n.unshift({token:"comment",regex:".*?\\*\\/",next:"start"});var o=e.copyArray(m);o.unshift({token:"comment",regex:".*?\\*\\/",next:"media"});var p=e.copyArray(m);p.unshift({token:"comment",regex:".*?\\*\\/",next:"ruleset"}),this.$rules={start:[{token:"comment",merge:!0,regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"string",regex:"@.*?{",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"}],media:[{token:"comment",merge:!0,regex:"\\/\\*",next:"media_comment"},{token:"paren.lparen",regex:"\\{",next:"media_ruleset"},{token:"string",regex:"\\}",next:"start"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"}],comment:n,ruleset:k,ruleset_comment:p,media_ruleset:l,media_comment:o}};d.inherits(g,f),b.CssHighlightRules=g}),define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_util","ace/mode/text_highlight_rules"],function(a,b,c){"use strict";var d=a("../lib/oop"),e=a("./css_highlight_rules").CssHighlightRules,f=a("./javascript_highlight_rules").JavaScriptHighlightRules,g=a("./xml_util"),h=a("./text_highlight_rules").TextHighlightRules,i=function(){this.$rules={start:[{token:"text",merge:!0,regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml_pe",regex:"<\\?.*?\\?>"},{token:"comment",merge:!0,regex:"<\\!--",next:"comment"},{token:"xml_pe",regex:"<\\!.*?>"},{token:"meta.tag",regex:"<(?=s*script\\b)",next:"script"},{token:"meta.tag",regex:"<(?=s*style\\b)",next:"style"},{token:"meta.tag",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"constant.character.entity",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"},{token:"text",regex:"[^<]+"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",merge:!0,regex:"\\s+"},{token:"text",merge:!0,regex:".+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",merge:!0,regex:".+"}]},g.tag(this.$rules,"tag","start"),g.tag(this.$rules,"style","css-start"),g.tag(this.$rules,"script","js-start"),this.embedRules(f,"js-",[{token:"comment",regex:"\\/\\/.*(?=<\\/script>)",next:"tag"},{token:"meta.tag",regex:"<\\/(?=script)",next:"tag"}]),this.embedRules(e,"css-",[{token:"meta.tag",regex:"<\\/(?=style)",next:"tag"}])};d.inherits(i,h),b.HtmlHighlightRules=i}),define("ace/mode/xml_util",["require","exports","module","ace/lib/lang"],function(a,b,c){function g(a){return[{token:"string",regex:'".*?"'},{token:"string",merge:!0,regex:'["].*',next:a+"_qqstring"},{token:"string",regex:"'.*?'"},{token:"string",merge:!0,regex:"['].*",next:a+"_qstring"}]}function h(a,b){return[{token:"string",merge:!0,regex:".*?"+a,next:b},{token:"string",merge:!0,regex:".+"}]}"use strict";var d=a("../lib/lang"),e=d.arrayToMap("button|form|input|label|select|textarea".split("|")),f=d.arrayToMap("table|tbody|td|tfoot|th|tr".split("|"));b.tag=function(a,b,c){a[b]=[{token:"text",regex:"\\s+"},{token:function(a){return a==="a"?"meta.tag.anchor":a==="img"?"meta.tag.image":a==="script"?"meta.tag.script":a==="style"?"meta.tag.style":e.hasOwnProperty(a.toLowerCase())?"meta.tag.form":f.hasOwnProperty(a.toLowerCase())?"meta.tag.table":"meta.tag"},merge:!0,regex:"[-_a-zA-Z0-9:]+",next:b+"_embed_attribute_list"},{token:"empty",regex:"",next:b+"_embed_attribute_list"}],a[b+"_qstring"]=h("'",b+"_embed_attribute_list"),a[b+"_qqstring"]=h('"',b+"_embed_attribute_list"),a[b+"_embed_attribute_list"]=[{token:"meta.tag",merge:!0,regex:"/?>",next:c},{token:"keyword.operator",regex:"="},{token:"entity.other.attribute-name",regex:"[-_a-zA-Z0-9:]+"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"text",regex:"\\s+"}].concat(g(b))}}),define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../behaviour").Behaviour,f=a("./cstyle").CstyleBehaviour,g=function(){this.inherit(f,["string_dquotes"]),this.add("brackets","insertion",function(a,b,c,d,e){if(e=="<"){var f=c.getSelectionRange(),g=d.doc.getTextRange(f);return g!==""?!1:{text:"<>",selection:[1,1]}}if(e==">"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),j=i.substring(h.column,h.column+1);if(j==">")return{text:"",selection:[1,1]}}else if(e=="\n"){var h=c.getCursorPosition(),i=d.doc.getLine(h.row),k=i.substring(h.column,h.column+2);if(k=="</"){var l=this.$getIndent(d.doc.getLine(h.row))+d.getTabString(),m=this.$getIndent(d.doc.getLine(h.row));return{text:"\n"+l+"\n"+m,selection:[1,l.length,1,l.length]}}}})};d.inherits(g,e),b.XmlBehaviour=g}),define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("./mixed").FoldMode,f=a("./xml").FoldMode,g=a("./cstyle").FoldMode,h=b.FoldMode=function(){e.call(this,new f({area:1,base:1,br:1,col:1,command:1,embed:1,hr:1,img:1,input:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1,li:1,dt:1,dd:1,p:1,rt:1,rp:1,optgroup:1,option:1,colgroup:1,td:1,th:1}),{"js-":new g,"css-":new g})};d.inherits(h,e)}),define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("./fold_mode").FoldMode,f=b.FoldMode=function(a,b){this.defaultMode=a,this.subModes=b};d.inherits(f,e),function(){this.$getMode=function(a){for(var b in this.subModes)if(a.indexOf(b)===0)return this.subModes[b];return null},this.$tryMode=function(a,b,c,d){var e=this.$getMode(a);return e?e.getFoldWidget(b,c,d):""},this.getFoldWidget=function(a,b,c){return this.$tryMode(a.getState(c-1),a,b,c)||this.$tryMode(a.getState(c),a,b,c)||this.defaultMode.getFoldWidget(a,b,c)},this.getFoldWidgetRange=function(a,b,c){var d=this.$getMode(a.getState(c-1));if(!d||!d.getFoldWidget(a,b,c))d=this.$getMode(a.getState(c));if(!d||!d.getFoldWidget(a,b,c))d=this.defaultMode;return d.getFoldWidgetRange(a,b,c)}}.call(f.prototype)}),define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"],function(a,b,c){"use strict";var d=a("../../lib/oop"),e=a("../../lib/lang"),f=a("../../range").Range,g=a("./fold_mode").FoldMode,h=a("../../token_iterator").TokenIterator,i=b.FoldMode=function(a){g.call(this),this.voidElements=a||{}};d.inherits(i,g),function(){this.getFoldWidget=function(a,b,c){var d=this._getFirstTagInLine(a,c);return d.closing?b=="markbeginend"?"end":"":!d.tagName||this.voidElements[d.tagName.toLowerCase()]?"":d.selfClosing?"":d.value.indexOf("/"+d.tagName)!==-1?"":"start"},this._getFirstTagInLine=function(a,b){var c=a.getTokens(b,b)[0].tokens,d="";for(var f=0;f<c.length;f++){var g=c[f];g.type.indexOf("meta.tag")===0?d+=g.value:d+=e.stringRepeat(" ",g.value.length)}return this._parseTag(d)},this.tagRe=/^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/,this._parseTag=function(a){var b=this.tagRe.exec(a),c=this.tagRe.lastIndex||0;return this.tagRe.lastIndex=0,{value:a,match:b?b[2]:"",closing:b?!!b[3]:!1,selfClosing:b?!!b[5]||b[2]=="/>":!1,tagName:b?b[4]:"",column:b[1]?c+b[1].length:c}},this._readTagForward=function(a){var b=a.getCurrentToken();if(!b)return null;var c="",d;do if(b.type.indexOf("meta.tag")===0){if(!d)var d={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()};c+=b.value;if(c.indexOf(">")!==-1){var e=this._parseTag(c);return e.start=d,e.end={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length},a.stepForward(),e}}while(b=a.stepForward());return null},this._readTagBackward=function(a){var b=a.getCurrentToken();if(!b)return null;var c="",d;do if(b.type.indexOf("meta.tag")===0){d||(d={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()+b.value.length}),c=b.value+c;if(c.indexOf("<")!==-1){var e=this._parseTag(c);return e.end=d,e.start={row:a.getCurrentTokenRow(),column:a.getCurrentTokenColumn()},a.stepBackward(),e}}while(b=a.stepBackward());return null},this._pop=function(a,b){while(a.length){var c=a[a.length-1];if(!b||c.tagName==b.tagName)return a.pop();if(this.voidElements[b.tagName])return;if(this.voidElements[c.tagName]){a.pop();continue}return null}},this.getFoldWidgetRange=function(a,b,c){var d=this._getFirstTagInLine(a,c);if(!d.match)return null;var e=d.closing||d.selfClosing,g=[],i;if(!e){var j=new h(a,c,d.column),k={row:c,column:d.column+d.tagName.length+2};while(i=this._readTagForward(j)){if(i.selfClosing){if(!g.length)return i.start.column+=i.tagName.length+2,i.end.column-=2,f.fromPoints(i.start,i.end);continue}if(i.closing){this._pop(g,i);if(g.length==0)return f.fromPoints(k,i.start)}else g.push(i)}}else{var j=new h(a,c,d.column+d.match.length),l={row:c,column:d.column};while(i=this._readTagBackward(j)){if(i.selfClosing){if(!g.length)return i.start.column+=i.tagName.length+2,i.end.column-=2,f.fromPoints(i.start,i.end);continue}if(!i.closing){this._pop(g,i);if(g.length==0)return i.start.column+=i.tagName.length+2,f.fromPoints(i.start,l)}else g.push(i)}}}}.call(i.prototype)})
1
+ /* ***** BEGIN LICENSE BLOCK *****
2
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3
+ *
4
+ * The contents of this file are subject to the Mozilla Public License Version
5
+ * 1.1 (the "License"); you may not use this file except in compliance with
6
+ * the License. You may obtain a copy of the License at
7
+ * http://www.mozilla.org/MPL/
8
+ *
9
+ * Software distributed under the License is distributed on an "AS IS" basis,
10
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
+ * for the specific language governing rights and limitations under the
12
+ * License.
13
+ *
14
+ * The Original Code is Ajax.org Code Editor (ACE).
15
+ *
16
+ * The Initial Developer of the Original Code is
17
+ * Ajax.org B.V.
18
+ * Portions created by the Initial Developer are Copyright (C) 2010
19
+ * the Initial Developer. All Rights Reserved.
20
+ *
21
+ * Contributor(s):
22
+ * Fabian Jakobs <fabian AT ajax DOT org>
23
+ *
24
+ * Alternatively, the contents of this file may be used under the terms of
25
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
26
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
+ * in which case the provisions of the GPL or the LGPL are applicable instead
28
+ * of those above. If you wish to allow use of your version of this file only
29
+ * under the terms of either the GPL or the LGPL, and not to allow others to
30
+ * use your version of this file under the terms of the MPL, indicate your
31
+ * decision by deleting the provisions above and replace them with the notice
32
+ * and other provisions required by the GPL or the LGPL. If you do not delete
33
+ * the provisions above, a recipient may use your version of this file under
34
+ * the terms of any one of the MPL, the GPL or the LGPL.
35
+ *
36
+ * ***** END LICENSE BLOCK ***** */
37
+
38
+ define('ace/mode/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/html_highlight_rules', 'ace/mode/behaviour/html', 'ace/mode/folding/html'], function(require, exports, module) {
39
+
40
+
41
+ var oop = require("../lib/oop");
42
+ var TextMode = require("./text").Mode;
43
+ var JavaScriptMode = require("./javascript").Mode;
44
+ var CssMode = require("./css").Mode;
45
+ var Tokenizer = require("../tokenizer").Tokenizer;
46
+ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
47
+ var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
48
+ var HtmlFoldMode = require("./folding/html").FoldMode;
49
+
50
+ var Mode = function() {
51
+ var highlighter = new HtmlHighlightRules();
52
+ this.$tokenizer = new Tokenizer(highlighter.getRules());
53
+ this.$behaviour = new HtmlBehaviour();
54
+
55
+ this.$embeds = highlighter.getEmbeds();
56
+ this.createModeDelegates({
57
+ "js-": JavaScriptMode,
58
+ "css-": CssMode
59
+ });
60
+
61
+ this.foldingRules = new HtmlFoldMode();
62
+ };
63
+ oop.inherits(Mode, TextMode);
64
+
65
+ (function() {
66
+
67
+
68
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
69
+ return 0;
70
+ };
71
+
72
+ this.getNextLineIndent = function(state, line, tab) {
73
+ return this.$getIndent(line);
74
+ };
75
+
76
+ this.checkOutdent = function(state, line, input) {
77
+ return false;
78
+ };
79
+
80
+ }).call(Mode.prototype);
81
+
82
+ exports.Mode = Mode;
83
+ });
84
+
85
+ define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
86
+
87
+
88
+ var oop = require("../lib/oop");
89
+ var TextMode = require("./text").Mode;
90
+ var Tokenizer = require("../tokenizer").Tokenizer;
91
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
92
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
93
+ var Range = require("../range").Range;
94
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
95
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
96
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
97
+
98
+ var Mode = function() {
99
+ this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
100
+ this.$outdent = new MatchingBraceOutdent();
101
+ this.$behaviour = new CstyleBehaviour();
102
+ this.foldingRules = new CStyleFoldMode();
103
+ };
104
+ oop.inherits(Mode, TextMode);
105
+
106
+ (function() {
107
+
108
+
109
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
110
+ var outdent = true;
111
+ var re = /^(\s*)\/\//;
112
+
113
+ for (var i=startRow; i<= endRow; i++) {
114
+ if (!re.test(doc.getLine(i))) {
115
+ outdent = false;
116
+ break;
117
+ }
118
+ }
119
+
120
+ if (outdent) {
121
+ var deleteRange = new Range(0, 0, 0, 0);
122
+ for (var i=startRow; i<= endRow; i++)
123
+ {
124
+ var line = doc.getLine(i);
125
+ var m = line.match(re);
126
+ deleteRange.start.row = i;
127
+ deleteRange.end.row = i;
128
+ deleteRange.end.column = m[0].length;
129
+ doc.replace(deleteRange, m[1]);
130
+ }
131
+ }
132
+ else {
133
+ doc.indentRows(startRow, endRow, "//");
134
+ }
135
+ };
136
+
137
+ this.getNextLineIndent = function(state, line, tab) {
138
+ var indent = this.$getIndent(line);
139
+
140
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
141
+ var tokens = tokenizedLine.tokens;
142
+ var endState = tokenizedLine.state;
143
+
144
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
145
+ return indent;
146
+ }
147
+
148
+ if (state == "start" || state == "regex_allowed") {
149
+ var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
150
+ if (match) {
151
+ indent += tab;
152
+ }
153
+ } else if (state == "doc-start") {
154
+ if (endState == "start" || state == "regex_allowed") {
155
+ return "";
156
+ }
157
+ var match = line.match(/^\s*(\/?)\*/);
158
+ if (match) {
159
+ if (match[1]) {
160
+ indent += " ";
161
+ }
162
+ indent += "* ";
163
+ }
164
+ }
165
+
166
+ return indent;
167
+ };
168
+
169
+ this.checkOutdent = function(state, line, input) {
170
+ return this.$outdent.checkOutdent(line, input);
171
+ };
172
+
173
+ this.autoOutdent = function(state, doc, row) {
174
+ this.$outdent.autoOutdent(doc, row);
175
+ };
176
+
177
+ this.createWorker = function(session) {
178
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
179
+ worker.attachToDocument(session.getDocument());
180
+
181
+ worker.on("jslint", function(results) {
182
+ var errors = [];
183
+ for (var i=0; i<results.data.length; i++) {
184
+ var error = results.data[i];
185
+ if (error)
186
+ errors.push({
187
+ row: error.line-1,
188
+ column: error.character-1,
189
+ text: error.reason,
190
+ type: "warning",
191
+ lint: error
192
+ });
193
+ }
194
+ session.setAnnotations(errors);
195
+ });
196
+
197
+ worker.on("narcissus", function(e) {
198
+ session.setAnnotations([e.data]);
199
+ });
200
+
201
+ worker.on("terminate", function() {
202
+ session.clearAnnotations();
203
+ });
204
+
205
+ return worker;
206
+ };
207
+
208
+ }).call(Mode.prototype);
209
+
210
+ exports.Mode = Mode;
211
+ });
212
+
213
+ define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
214
+
215
+
216
+ var oop = require("../lib/oop");
217
+ var lang = require("../lib/lang");
218
+ var unicode = require("../unicode");
219
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
220
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
221
+
222
+ var JavaScriptHighlightRules = function() {
223
+
224
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
225
+ var globals = lang.arrayToMap(
226
+ // Constructors
227
+ ("Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" +
228
+ // E4X
229
+ "Namespace|QName|XML|XMLList|" +
230
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
231
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
232
+ // Errors
233
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
234
+ "SyntaxError|TypeError|URIError|" +
235
+ // Non-constructor functions
236
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" +
237
+ "isNaN|parseFloat|parseInt|" +
238
+ // Other
239
+ "JSON|Math|" +
240
+ // Pseudo
241
+ "this|arguments|prototype|window|document"
242
+ ).split("|")
243
+ );
244
+
245
+ var keywords = lang.arrayToMap(
246
+ ("break|case|catch|continue|default|delete|do|else|finally|for|function|" +
247
+ "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|" +
248
+ "const|yield|import|get|set").split("|")
249
+ );
250
+
251
+ // keywords which can be followed by regular expressions
252
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
253
+
254
+ var deprecated = lang.arrayToMap(
255
+ ("__parent__|__count__|escape|unescape|with|__proto__").split("|")
256
+ );
257
+
258
+ var definitions = lang.arrayToMap(("const|let|var|function").split("|"));
259
+
260
+ var buildinConstants = lang.arrayToMap(
261
+ ("null|Infinity|NaN|undefined").split("|")
262
+ );
263
+
264
+ var futureReserved = lang.arrayToMap(
265
+ ("class|enum|extends|super|export|implements|private|" +
266
+ "public|interface|package|protected|static").split("|")
267
+ );
268
+
269
+ // TODO: Unicode escape sequences
270
+ var identifierRe = "[" + unicode.packages.L + "\\$_]["
271
+ + unicode.packages.L
272
+ + unicode.packages.Mn + unicode.packages.Mc
273
+ + unicode.packages.Nd
274
+ + unicode.packages.Pc + "\\$_]*\\b";
275
+
276
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
277
+ "u[0-9a-fA-F]{4}|" + // unicode
278
+ "[0-2][0-7]{0,2}|" + // oct
279
+ "3[0-6][0-7]?|" + // oct
280
+ "37[0-7]?|" + // oct
281
+ "[4-7][0-7]?|" + //oct
282
+ ".)";
283
+
284
+ // regexp must not have capturing parentheses. Use (?:) instead.
285
+ // regexps are ordered -> the first match is used
286
+
287
+ this.$rules = {
288
+ "start" : [
289
+ {
290
+ token : "comment",
291
+ regex : /\/\/.*$/
292
+ },
293
+ DocCommentHighlightRules.getStartRule("doc-start"),
294
+ {
295
+ token : "comment", // multi line comment
296
+ merge : true,
297
+ regex : /\/\*/,
298
+ next : "comment"
299
+ }, {
300
+ token : "string",
301
+ regex : "'(?=.)",
302
+ next : "qstring"
303
+ }, {
304
+ token : "string",
305
+ regex : '"(?=.)',
306
+ next : "qqstring"
307
+ }, {
308
+ token : "constant.numeric", // hex
309
+ regex : /0[xX][0-9a-fA-F]+\b/
310
+ }, {
311
+ token : "constant.numeric", // float
312
+ regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
313
+ }, { // match stuff like: Sound.prototype.play = function() { }
314
+ token : [
315
+ "storage.type",
316
+ "punctuation.operator",
317
+ "support.function",
318
+ "punctuation.operator",
319
+ "entity.name.function",
320
+ "text",
321
+ "keyword.operator",
322
+ "text",
323
+ "storage.type",
324
+ "text",
325
+ "paren.lparen"
326
+ ],
327
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
328
+ next: "function_arguments"
329
+ }, { // match stuff like: Sound.prototype.play = myfunc
330
+ token : [
331
+ "storage.type",
332
+ "punctuation.operator",
333
+ "support.function",
334
+ "punctuation.operator",
335
+ "entity.name.function",
336
+ "text",
337
+ "keyword.operator",
338
+ "text"
339
+ ],
340
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
341
+ next: "function_arguments"
342
+ }, { // match stuff like: Sound.play = function() { }
343
+ token : [
344
+ "storage.type",
345
+ "punctuation.operator",
346
+ "entity.name.function",
347
+ "text",
348
+ "keyword.operator",
349
+ "text",
350
+ "storage.type",
351
+ "text",
352
+ "paren.lparen"
353
+ ],
354
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
355
+ next: "function_arguments"
356
+ }, { // match stuff like: play = function() { }
357
+ token : [
358
+ "entity.name.function",
359
+ "text",
360
+ "keyword.operator",
361
+ "text",
362
+ "storage.type",
363
+ "text",
364
+ "paren.lparen"
365
+ ],
366
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
367
+ next: "function_arguments"
368
+ }, { // match stuff like: Sound.play = function play() { }
369
+ token : [
370
+ "storage.type",
371
+ "punctuation.operator",
372
+ "entity.name.function",
373
+ "text",
374
+ "keyword.operator",
375
+ "text",
376
+ "storage.type",
377
+ "text",
378
+ "entity.name.function",
379
+ "text",
380
+ "paren.lparen"
381
+ ],
382
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
383
+ next: "function_arguments"
384
+ }, { // match regular function like: function myFunc(arg) { }
385
+ token : [
386
+ "storage.type",
387
+ "text",
388
+ "entity.name.function",
389
+ "text",
390
+ "paren.lparen"
391
+ ],
392
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
393
+ next: "function_arguments"
394
+ }, { // match stuff like: foobar: function() { }
395
+ token : [
396
+ "entity.name.function",
397
+ "text",
398
+ "punctuation.operator",
399
+ "text",
400
+ "storage.type",
401
+ "text",
402
+ "paren.lparen"
403
+ ],
404
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
405
+ next: "function_arguments"
406
+ }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
407
+ token : [
408
+ "text",
409
+ "text",
410
+ "storage.type",
411
+ "text",
412
+ "paren.lparen"
413
+ ],
414
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
415
+ next: "function_arguments"
416
+ }, {
417
+ token : "constant.language.boolean",
418
+ regex : /(?:true|false)\b/
419
+ }, {
420
+ token : "keyword",
421
+ regex : "(?:" + kwBeforeRe + ")\\b",
422
+ next : "regex_allowed"
423
+ }, {
424
+ token : ["punctuation.operator", "support.function"],
425
+ regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
426
+ }, {
427
+ token : ["punctuation.operator", "support.function.dom"],
428
+ regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
429
+ }, {
430
+ token : ["punctuation.operator", "support.constant"],
431
+ regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
432
+ }, {
433
+ token : ["storage.type", "punctuation.operator", "support.function.firebug"],
434
+ regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
435
+ }, {
436
+ token : function(value) {
437
+ if (globals.hasOwnProperty(value))
438
+ return "variable.language";
439
+ else if (deprecated.hasOwnProperty(value))
440
+ return "invalid.deprecated";
441
+ else if (definitions.hasOwnProperty(value))
442
+ return "storage.type";
443
+ else if (keywords.hasOwnProperty(value))
444
+ return "keyword";
445
+ else if (buildinConstants.hasOwnProperty(value))
446
+ return "constant.language";
447
+ else if (futureReserved.hasOwnProperty(value))
448
+ return "invalid.illegal";
449
+ else if (value == "debugger")
450
+ return "invalid.deprecated";
451
+ else
452
+ return "identifier";
453
+ },
454
+ regex : identifierRe
455
+ }, {
456
+ token : "keyword.operator",
457
+ regex : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
458
+ next : "regex_allowed"
459
+ }, {
460
+ token : "punctuation.operator",
461
+ regex : /\?|\:|\,|\;|\./,
462
+ next : "regex_allowed"
463
+ }, {
464
+ token : "paren.lparen",
465
+ regex : /[\[({]/,
466
+ next : "regex_allowed"
467
+ }, {
468
+ token : "paren.rparen",
469
+ regex : /[\])}]/
470
+ }, {
471
+ token : "keyword.operator",
472
+ regex : /\/=?/,
473
+ next : "regex_allowed"
474
+ }, {
475
+ token: "comment",
476
+ regex: /^#!.*$/
477
+ }, {
478
+ token : "text",
479
+ regex : /\s+/
480
+ }
481
+ ],
482
+ // regular expressions are only allowed after certain tokens. This
483
+ // makes sure we don't mix up regexps with the divison operator
484
+ "regex_allowed": [
485
+ DocCommentHighlightRules.getStartRule("doc-start"),
486
+ {
487
+ token : "comment", // multi line comment
488
+ merge : true,
489
+ regex : "\\/\\*",
490
+ next : "comment_regex_allowed"
491
+ }, {
492
+ token : "comment",
493
+ regex : "\\/\\/.*$"
494
+ }, {
495
+ token: "string.regexp",
496
+ regex: "\\/",
497
+ next: "regex",
498
+ merge: true
499
+ }, {
500
+ token : "text",
501
+ regex : "\\s+"
502
+ }, {
503
+ // immediately return to the start mode without matching
504
+ // anything
505
+ token: "empty",
506
+ regex: "",
507
+ next: "start"
508
+ }
509
+ ],
510
+ "regex": [
511
+ {
512
+ token: "regexp.keyword.operator",
513
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
514
+ }, {
515
+ // flag
516
+ token: "string.regexp",
517
+ regex: "/\\w*",
518
+ next: "start",
519
+ merge: true
520
+ }, {
521
+ token: "string.regexp",
522
+ regex: "[^\\\\/\\[]+",
523
+ merge: true
524
+ }, {
525
+ token: "string.regexp.charachterclass",
526
+ regex: "\\[",
527
+ next: "regex_character_class",
528
+ merge: true
529
+ }, {
530
+ token: "empty",
531
+ regex: "",
532
+ next: "start"
533
+ }
534
+ ],
535
+ "regex_character_class": [
536
+ {
537
+ token: "regexp.keyword.operator",
538
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
539
+ }, {
540
+ token: "string.regexp.charachterclass",
541
+ regex: "]",
542
+ next: "regex",
543
+ merge: true
544
+ }, {
545
+ token: "string.regexp.charachterclass",
546
+ regex: "[^\\\\\\]]+",
547
+ merge: true
548
+ }, {
549
+ token: "empty",
550
+ regex: "",
551
+ next: "start"
552
+ }
553
+ ],
554
+ "function_arguments": [
555
+ {
556
+ token: "variable.parameter",
557
+ regex: identifierRe
558
+ }, {
559
+ token: "punctuation.operator",
560
+ regex: "[, ]+",
561
+ merge: true
562
+ }, {
563
+ token: "punctuation.operator",
564
+ regex: "$",
565
+ merge: true
566
+ }, {
567
+ token: "empty",
568
+ regex: "",
569
+ next: "start"
570
+ }
571
+ ],
572
+ "comment_regex_allowed" : [
573
+ {
574
+ token : "comment", // closing comment
575
+ regex : ".*?\\*\\/",
576
+ merge : true,
577
+ next : "regex_allowed"
578
+ }, {
579
+ token : "comment", // comment spanning whole line
580
+ merge : true,
581
+ regex : ".+"
582
+ }
583
+ ],
584
+ "comment" : [
585
+ {
586
+ token : "comment", // closing comment
587
+ regex : ".*?\\*\\/",
588
+ merge : true,
589
+ next : "start"
590
+ }, {
591
+ token : "comment", // comment spanning whole line
592
+ merge : true,
593
+ regex : ".+"
594
+ }
595
+ ],
596
+ "qqstring" : [
597
+ {
598
+ token : "constant.language.escape",
599
+ regex : escapedRe
600
+ }, {
601
+ token : "string",
602
+ regex : '[^"\\\\]+',
603
+ merge : true
604
+ }, {
605
+ token : "string",
606
+ regex : "\\\\$",
607
+ next : "qqstring",
608
+ merge : true
609
+ }, {
610
+ token : "string",
611
+ regex : '"|$',
612
+ next : "start",
613
+ merge : true
614
+ }
615
+ ],
616
+ "qstring" : [
617
+ {
618
+ token : "constant.language.escape",
619
+ regex : escapedRe
620
+ }, {
621
+ token : "string",
622
+ regex : "[^'\\\\]+",
623
+ merge : true
624
+ }, {
625
+ token : "string",
626
+ regex : "\\\\$",
627
+ next : "qstring",
628
+ merge : true
629
+ }, {
630
+ token : "string",
631
+ regex : "'|$",
632
+ next : "start",
633
+ merge : true
634
+ }
635
+ ]
636
+ };
637
+
638
+ this.embedRules(DocCommentHighlightRules, "doc-",
639
+ [ DocCommentHighlightRules.getEndRule("start") ]);
640
+ };
641
+
642
+ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
643
+
644
+ exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
645
+ });
646
+
647
+ define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
648
+
649
+
650
+ var oop = require("../lib/oop");
651
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
652
+
653
+ var DocCommentHighlightRules = function() {
654
+
655
+ this.$rules = {
656
+ "start" : [ {
657
+ token : "comment.doc.tag",
658
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
659
+ }, {
660
+ token : "comment.doc",
661
+ merge : true,
662
+ regex : "\\s+"
663
+ }, {
664
+ token : "comment.doc",
665
+ merge : true,
666
+ regex : "TODO"
667
+ }, {
668
+ token : "comment.doc",
669
+ merge : true,
670
+ regex : "[^@\\*]+"
671
+ }, {
672
+ token : "comment.doc",
673
+ merge : true,
674
+ regex : "."
675
+ }]
676
+ };
677
+ };
678
+
679
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
680
+
681
+ DocCommentHighlightRules.getStartRule = function(start) {
682
+ return {
683
+ token : "comment.doc", // doc comment
684
+ merge : true,
685
+ regex : "\\/\\*(?=\\*)",
686
+ next : start
687
+ };
688
+ };
689
+
690
+ DocCommentHighlightRules.getEndRule = function (start) {
691
+ return {
692
+ token : "comment.doc", // closing comment
693
+ merge : true,
694
+ regex : "\\*\\/",
695
+ next : start
696
+ };
697
+ };
698
+
699
+
700
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
701
+
702
+ });
703
+
704
+ define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
705
+
706
+
707
+ var Range = require("../range").Range;
708
+
709
+ var MatchingBraceOutdent = function() {};
710
+
711
+ (function() {
712
+
713
+ this.checkOutdent = function(line, input) {
714
+ if (! /^\s+$/.test(line))
715
+ return false;
716
+
717
+ return /^\s*\}/.test(input);
718
+ };
719
+
720
+ this.autoOutdent = function(doc, row) {
721
+ var line = doc.getLine(row);
722
+ var match = line.match(/^(\s*\})/);
723
+
724
+ if (!match) return 0;
725
+
726
+ var column = match[1].length;
727
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
728
+
729
+ if (!openBracePos || openBracePos.row == row) return 0;
730
+
731
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
732
+ doc.replace(new Range(row, 0, row, column-1), indent);
733
+ };
734
+
735
+ this.$getIndent = function(line) {
736
+ var match = line.match(/^(\s+)/);
737
+ if (match) {
738
+ return match[1];
739
+ }
740
+
741
+ return "";
742
+ };
743
+
744
+ }).call(MatchingBraceOutdent.prototype);
745
+
746
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
747
+ });
748
+
749
+ define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
750
+
751
+
752
+ var oop = require("../../lib/oop");
753
+ var Behaviour = require("../behaviour").Behaviour;
754
+
755
+ var CstyleBehaviour = function () {
756
+
757
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
758
+ if (text == '{') {
759
+ var selection = editor.getSelectionRange();
760
+ var selected = session.doc.getTextRange(selection);
761
+ if (selected !== "") {
762
+ return {
763
+ text: '{' + selected + '}',
764
+ selection: false
765
+ };
766
+ } else {
767
+ return {
768
+ text: '{}',
769
+ selection: [1, 1]
770
+ };
771
+ }
772
+ } else if (text == '}') {
773
+ var cursor = editor.getCursorPosition();
774
+ var line = session.doc.getLine(cursor.row);
775
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
776
+ if (rightChar == '}') {
777
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
778
+ if (matching !== null) {
779
+ return {
780
+ text: '',
781
+ selection: [1, 1]
782
+ };
783
+ }
784
+ }
785
+ } else if (text == "\n") {
786
+ var cursor = editor.getCursorPosition();
787
+ var line = session.doc.getLine(cursor.row);
788
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
789
+ if (rightChar == '}') {
790
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
791
+ if (!openBracePos)
792
+ return null;
793
+
794
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
795
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
796
+
797
+ return {
798
+ text: '\n' + indent + '\n' + next_indent,
799
+ selection: [1, indent.length, 1, indent.length]
800
+ };
801
+ }
802
+ }
803
+ });
804
+
805
+ this.add("braces", "deletion", function (state, action, editor, session, range) {
806
+ var selected = session.doc.getTextRange(range);
807
+ if (!range.isMultiLine() && selected == '{') {
808
+ var line = session.doc.getLine(range.start.row);
809
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
810
+ if (rightChar == '}') {
811
+ range.end.column++;
812
+ return range;
813
+ }
814
+ }
815
+ });
816
+
817
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
818
+ if (text == '(') {
819
+ var selection = editor.getSelectionRange();
820
+ var selected = session.doc.getTextRange(selection);
821
+ if (selected !== "") {
822
+ return {
823
+ text: '(' + selected + ')',
824
+ selection: false
825
+ };
826
+ } else {
827
+ return {
828
+ text: '()',
829
+ selection: [1, 1]
830
+ };
831
+ }
832
+ } else if (text == ')') {
833
+ var cursor = editor.getCursorPosition();
834
+ var line = session.doc.getLine(cursor.row);
835
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
836
+ if (rightChar == ')') {
837
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
838
+ if (matching !== null) {
839
+ return {
840
+ text: '',
841
+ selection: [1, 1]
842
+ };
843
+ }
844
+ }
845
+ }
846
+ });
847
+
848
+ this.add("parens", "deletion", function (state, action, editor, session, range) {
849
+ var selected = session.doc.getTextRange(range);
850
+ if (!range.isMultiLine() && selected == '(') {
851
+ var line = session.doc.getLine(range.start.row);
852
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
853
+ if (rightChar == ')') {
854
+ range.end.column++;
855
+ return range;
856
+ }
857
+ }
858
+ });
859
+
860
+ this.add("brackets", "insertion", function (state, action, editor, session, text) {
861
+ if (text == '[') {
862
+ var selection = editor.getSelectionRange();
863
+ var selected = session.doc.getTextRange(selection);
864
+ if (selected !== "") {
865
+ return {
866
+ text: '[' + selected + ']',
867
+ selection: false
868
+ };
869
+ } else {
870
+ return {
871
+ text: '[]',
872
+ selection: [1, 1]
873
+ };
874
+ }
875
+ } else if (text == ']') {
876
+ var cursor = editor.getCursorPosition();
877
+ var line = session.doc.getLine(cursor.row);
878
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
879
+ if (rightChar == ']') {
880
+ var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
881
+ if (matching !== null) {
882
+ return {
883
+ text: '',
884
+ selection: [1, 1]
885
+ };
886
+ }
887
+ }
888
+ }
889
+ });
890
+
891
+ this.add("brackets", "deletion", function (state, action, editor, session, range) {
892
+ var selected = session.doc.getTextRange(range);
893
+ if (!range.isMultiLine() && selected == '[') {
894
+ var line = session.doc.getLine(range.start.row);
895
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
896
+ if (rightChar == ']') {
897
+ range.end.column++;
898
+ return range;
899
+ }
900
+ }
901
+ });
902
+
903
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
904
+ if (text == '"' || text == "'") {
905
+ var quote = text;
906
+ var selection = editor.getSelectionRange();
907
+ var selected = session.doc.getTextRange(selection);
908
+ if (selected !== "") {
909
+ return {
910
+ text: quote + selected + quote,
911
+ selection: false
912
+ };
913
+ } else {
914
+ var cursor = editor.getCursorPosition();
915
+ var line = session.doc.getLine(cursor.row);
916
+ var leftChar = line.substring(cursor.column-1, cursor.column);
917
+
918
+ // We're escaped.
919
+ if (leftChar == '\\') {
920
+ return null;
921
+ }
922
+
923
+ // Find what token we're inside.
924
+ var tokens = session.getTokens(selection.start.row);
925
+ var col = 0, token;
926
+ var quotepos = -1; // Track whether we're inside an open quote.
927
+
928
+ for (var x = 0; x < tokens.length; x++) {
929
+ token = tokens[x];
930
+ if (token.type == "string") {
931
+ quotepos = -1;
932
+ } else if (quotepos < 0) {
933
+ quotepos = token.value.indexOf(quote);
934
+ }
935
+ if ((token.value.length + col) > selection.start.column) {
936
+ break;
937
+ }
938
+ col += tokens[x].value.length;
939
+ }
940
+
941
+ // Try and be smart about when we auto insert.
942
+ if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
943
+ return {
944
+ text: quote + quote,
945
+ selection: [1,1]
946
+ };
947
+ } else if (token && token.type === "string") {
948
+ // Ignore input and move right one if we're typing over the closing quote.
949
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
950
+ if (rightChar == quote) {
951
+ return {
952
+ text: '',
953
+ selection: [1, 1]
954
+ };
955
+ }
956
+ }
957
+ }
958
+ }
959
+ });
960
+
961
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
962
+ var selected = session.doc.getTextRange(range);
963
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
964
+ var line = session.doc.getLine(range.start.row);
965
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
966
+ if (rightChar == '"') {
967
+ range.end.column++;
968
+ return range;
969
+ }
970
+ }
971
+ });
972
+
973
+ };
974
+
975
+ oop.inherits(CstyleBehaviour, Behaviour);
976
+
977
+ exports.CstyleBehaviour = CstyleBehaviour;
978
+ });
979
+
980
+ define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
981
+
982
+
983
+ var oop = require("../../lib/oop");
984
+ var Range = require("../../range").Range;
985
+ var BaseFoldMode = require("./fold_mode").FoldMode;
986
+
987
+ var FoldMode = exports.FoldMode = function() {};
988
+ oop.inherits(FoldMode, BaseFoldMode);
989
+
990
+ (function() {
991
+
992
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
993
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
994
+
995
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
996
+ var line = session.getLine(row);
997
+ var match = line.match(this.foldingStartMarker);
998
+ if (match) {
999
+ var i = match.index;
1000
+
1001
+ if (match[1])
1002
+ return this.openingBracketBlock(session, match[1], row, i);
1003
+
1004
+ var range = session.getCommentFoldRange(row, i + match[0].length);
1005
+ range.end.column -= 2;
1006
+ return range;
1007
+ }
1008
+
1009
+ if (foldStyle !== "markbeginend")
1010
+ return;
1011
+
1012
+ var match = line.match(this.foldingStopMarker);
1013
+ if (match) {
1014
+ var i = match.index + match[0].length;
1015
+
1016
+ if (match[2]) {
1017
+ var range = session.getCommentFoldRange(row, i);
1018
+ range.end.column -= 2;
1019
+ return range;
1020
+ }
1021
+
1022
+ var end = {row: row, column: i};
1023
+ var start = session.$findOpeningBracket(match[1], end);
1024
+
1025
+ if (!start)
1026
+ return;
1027
+
1028
+ start.column++;
1029
+ end.column--;
1030
+
1031
+ return Range.fromPoints(start, end);
1032
+ }
1033
+ };
1034
+
1035
+ }).call(FoldMode.prototype);
1036
+
1037
+ });
1038
+
1039
+ define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
1040
+
1041
+
1042
+ var Range = require("../../range").Range;
1043
+
1044
+ var FoldMode = exports.FoldMode = function() {};
1045
+
1046
+ (function() {
1047
+
1048
+ this.foldingStartMarker = null;
1049
+ this.foldingStopMarker = null;
1050
+
1051
+ // must return "" if there's no fold, to enable caching
1052
+ this.getFoldWidget = function(session, foldStyle, row) {
1053
+ var line = session.getLine(row);
1054
+ if (this.foldingStartMarker.test(line))
1055
+ return "start";
1056
+ if (foldStyle == "markbeginend"
1057
+ && this.foldingStopMarker
1058
+ && this.foldingStopMarker.test(line))
1059
+ return "end";
1060
+ return "";
1061
+ };
1062
+
1063
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1064
+ return null;
1065
+ };
1066
+
1067
+ this.indentationBlock = function(session, row, column) {
1068
+ var re = /\S/;
1069
+ var line = session.getLine(row);
1070
+ var startLevel = line.search(re);
1071
+ if (startLevel == -1)
1072
+ return;
1073
+
1074
+ var startColumn = column || line.length;
1075
+ var maxRow = session.getLength();
1076
+ var startRow = row;
1077
+ var endRow = row;
1078
+
1079
+ while (++row < maxRow) {
1080
+ var level = session.getLine(row).search(re);
1081
+
1082
+ if (level == -1)
1083
+ continue;
1084
+
1085
+ if (level <= startLevel)
1086
+ break;
1087
+
1088
+ endRow = row;
1089
+ }
1090
+
1091
+ if (endRow > startRow) {
1092
+ var endColumn = session.getLine(endRow).length;
1093
+ return new Range(startRow, startColumn, endRow, endColumn);
1094
+ }
1095
+ };
1096
+
1097
+ this.openingBracketBlock = function(session, bracket, row, column, typeRe) {
1098
+ var start = {row: row, column: column + 1};
1099
+ var end = session.$findClosingBracket(bracket, start, typeRe);
1100
+ if (!end)
1101
+ return;
1102
+
1103
+ var fw = session.foldWidgets[end.row];
1104
+ if (fw == null)
1105
+ fw = this.getFoldWidget(session, end.row);
1106
+
1107
+ if (fw == "start" && end.row > start.row) {
1108
+ end.row --;
1109
+ end.column = session.getLine(end.row).length;
1110
+ }
1111
+ return Range.fromPoints(start, end);
1112
+ };
1113
+
1114
+ }).call(FoldMode.prototype);
1115
+
1116
+ });
1117
+
1118
+ define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/folding/cstyle'], function(require, exports, module) {
1119
+
1120
+
1121
+ var oop = require("../lib/oop");
1122
+ var TextMode = require("./text").Mode;
1123
+ var Tokenizer = require("../tokenizer").Tokenizer;
1124
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1125
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1126
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
1127
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1128
+
1129
+ var Mode = function() {
1130
+ this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
1131
+ this.$outdent = new MatchingBraceOutdent();
1132
+ this.foldingRules = new CStyleFoldMode();
1133
+ };
1134
+ oop.inherits(Mode, TextMode);
1135
+
1136
+ (function() {
1137
+
1138
+ this.foldingRules = "cStyle";
1139
+
1140
+ this.getNextLineIndent = function(state, line, tab) {
1141
+ var indent = this.$getIndent(line);
1142
+
1143
+ // ignore braces in comments
1144
+ var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
1145
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
1146
+ return indent;
1147
+ }
1148
+
1149
+ var match = line.match(/^.*\{\s*$/);
1150
+ if (match) {
1151
+ indent += tab;
1152
+ }
1153
+
1154
+ return indent;
1155
+ };
1156
+
1157
+ this.checkOutdent = function(state, line, input) {
1158
+ return this.$outdent.checkOutdent(line, input);
1159
+ };
1160
+
1161
+ this.autoOutdent = function(state, doc, row) {
1162
+ this.$outdent.autoOutdent(doc, row);
1163
+ };
1164
+
1165
+ this.createWorker = function(session) {
1166
+ var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
1167
+ worker.attachToDocument(session.getDocument());
1168
+
1169
+ worker.on("csslint", function(e) {
1170
+ var errors = [];
1171
+ e.data.forEach(function(message) {
1172
+ errors.push({
1173
+ row: message.line - 1,
1174
+ column: message.col - 1,
1175
+ text: message.message,
1176
+ type: message.type,
1177
+ lint: message
1178
+ });
1179
+ });
1180
+
1181
+ session.setAnnotations(errors);
1182
+ });
1183
+ return worker;
1184
+ };
1185
+
1186
+ }).call(Mode.prototype);
1187
+
1188
+ exports.Mode = Mode;
1189
+
1190
+ });
1191
+
1192
+ define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
1193
+
1194
+
1195
+ var oop = require("../lib/oop");
1196
+ var lang = require("../lib/lang");
1197
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1198
+
1199
+ var CssHighlightRules = function() {
1200
+
1201
+ var properties = lang.arrayToMap(
1202
+ ("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|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|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|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-after|cue-before|cue|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|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|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|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|")
1203
+ );
1204
+
1205
+ var functions = lang.arrayToMap(
1206
+ ("rgb|rgba|url|attr|counter|counters").split("|")
1207
+ );
1208
+
1209
+ var constants = lang.arrayToMap(
1210
+ ("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|")
1211
+ );
1212
+
1213
+ var colors = lang.arrayToMap(
1214
+ ("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
1215
+ "purple|red|silver|teal|white|yellow").split("|")
1216
+ );
1217
+
1218
+ var fonts = lang.arrayToMap(
1219
+ ("arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|" +
1220
+ "symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|" +
1221
+ "serif|monospace").split("|")
1222
+ );
1223
+
1224
+ // regexp must not have capturing parentheses. Use (?:) instead.
1225
+ // regexps are ordered -> the first match is used
1226
+
1227
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
1228
+ var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
1229
+ var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
1230
+
1231
+ var base_ruleset = [
1232
+ {
1233
+ token : "comment", // multi line comment
1234
+ merge : true,
1235
+ regex : "\\/\\*",
1236
+ next : "ruleset_comment"
1237
+ }, {
1238
+ token : "string", // single line
1239
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
1240
+ }, {
1241
+ token : "string", // single line
1242
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
1243
+ }, {
1244
+ token : ["constant.numeric", "keyword"],
1245
+ regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
1246
+ }, {
1247
+ token : ["constant.numeric"],
1248
+ regex : "([0-9]+)"
1249
+ }, {
1250
+ token : "constant.numeric", // hex6 color
1251
+ regex : "#[a-f0-9]{6}"
1252
+ }, {
1253
+ token : "constant.numeric", // hex3 color
1254
+ regex : "#[a-f0-9]{3}"
1255
+ }, {
1256
+ token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
1257
+ regex : pseudoElements
1258
+ }, {
1259
+ token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
1260
+ regex : pseudoClasses
1261
+ }, {
1262
+ token : function(value) {
1263
+ if (properties.hasOwnProperty(value.toLowerCase())) {
1264
+ return "support.type";
1265
+ }
1266
+ else if (functions.hasOwnProperty(value.toLowerCase())) {
1267
+ return "support.function";
1268
+ }
1269
+ else if (constants.hasOwnProperty(value.toLowerCase())) {
1270
+ return "support.constant";
1271
+ }
1272
+ else if (colors.hasOwnProperty(value.toLowerCase())) {
1273
+ return "support.constant.color";
1274
+ }
1275
+ else if (fonts.hasOwnProperty(value.toLowerCase())) {
1276
+ return "support.constant.fonts";
1277
+ }
1278
+ else {
1279
+ return "text";
1280
+ }
1281
+ },
1282
+ regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
1283
+ }
1284
+ ];
1285
+
1286
+ var ruleset = lang.copyArray(base_ruleset);
1287
+ ruleset.unshift({
1288
+ token : "paren.rparen",
1289
+ regex : "\\}",
1290
+ next: "start"
1291
+ });
1292
+
1293
+ var media_ruleset = lang.copyArray( base_ruleset );
1294
+ media_ruleset.unshift({
1295
+ token : "paren.rparen",
1296
+ regex : "\\}",
1297
+ next: "media"
1298
+ });
1299
+
1300
+ var base_comment = [{
1301
+ token : "comment", // comment spanning whole line
1302
+ merge : true,
1303
+ regex : ".+"
1304
+ }];
1305
+
1306
+ var comment = lang.copyArray(base_comment);
1307
+ comment.unshift({
1308
+ token : "comment", // closing comment
1309
+ regex : ".*?\\*\\/",
1310
+ next : "start"
1311
+ });
1312
+
1313
+ var media_comment = lang.copyArray(base_comment);
1314
+ media_comment.unshift({
1315
+ token : "comment", // closing comment
1316
+ regex : ".*?\\*\\/",
1317
+ next : "media"
1318
+ });
1319
+
1320
+ var ruleset_comment = lang.copyArray(base_comment);
1321
+ ruleset_comment.unshift({
1322
+ token : "comment", // closing comment
1323
+ regex : ".*?\\*\\/",
1324
+ next : "ruleset"
1325
+ });
1326
+
1327
+ this.$rules = {
1328
+ "start" : [{
1329
+ token : "comment", // multi line comment
1330
+ merge : true,
1331
+ regex : "\\/\\*",
1332
+ next : "comment"
1333
+ }, {
1334
+ token: "paren.lparen",
1335
+ regex: "\\{",
1336
+ next: "ruleset"
1337
+ }, {
1338
+ token: "string",
1339
+ regex: "@.*?{",
1340
+ next: "media"
1341
+ },{
1342
+ token: "keyword",
1343
+ regex: "#[a-z0-9-_]+"
1344
+ },{
1345
+ token: "variable",
1346
+ regex: "\\.[a-z0-9-_]+"
1347
+ },{
1348
+ token: "string",
1349
+ regex: ":[a-z0-9-_]+"
1350
+ },{
1351
+ token: "constant",
1352
+ regex: "[a-z0-9-_]+"
1353
+ }],
1354
+
1355
+ "media" : [ {
1356
+ token : "comment", // multi line comment
1357
+ merge : true,
1358
+ regex : "\\/\\*",
1359
+ next : "media_comment"
1360
+ }, {
1361
+ token: "paren.lparen",
1362
+ regex: "\\{",
1363
+ next: "media_ruleset"
1364
+ },{
1365
+ token: "string",
1366
+ regex: "\\}",
1367
+ next: "start"
1368
+ },{
1369
+ token: "keyword",
1370
+ regex: "#[a-z0-9-_]+"
1371
+ },{
1372
+ token: "variable",
1373
+ regex: "\\.[a-z0-9-_]+"
1374
+ },{
1375
+ token: "string",
1376
+ regex: ":[a-z0-9-_]+"
1377
+ },{
1378
+ token: "constant",
1379
+ regex: "[a-z0-9-_]+"
1380
+ }],
1381
+
1382
+ "comment" : comment,
1383
+
1384
+ "ruleset" : ruleset,
1385
+ "ruleset_comment" : ruleset_comment,
1386
+
1387
+ "media_ruleset" : media_ruleset,
1388
+ "media_comment" : media_comment
1389
+ };
1390
+ };
1391
+
1392
+ oop.inherits(CssHighlightRules, TextHighlightRules);
1393
+
1394
+ exports.CssHighlightRules = CssHighlightRules;
1395
+
1396
+ });
1397
+
1398
+ define('ace/mode/html_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
1399
+
1400
+
1401
+ var oop = require("../lib/oop");
1402
+ var lang = require("../lib/lang");
1403
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
1404
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1405
+ var xmlUtil = require("./xml_util");
1406
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1407
+
1408
+ var tagMap = lang.createMap({
1409
+ a : 'anchor',
1410
+ button : 'form',
1411
+ form : 'form',
1412
+ img : 'image',
1413
+ input : 'form',
1414
+ label : 'form',
1415
+ script : 'script',
1416
+ select : 'form',
1417
+ textarea : 'form',
1418
+ style : 'style',
1419
+ table : 'table',
1420
+ tbody : 'table',
1421
+ td : 'table',
1422
+ tfoot : 'table',
1423
+ th : 'table',
1424
+ tr : 'table'
1425
+ });
1426
+
1427
+ var HtmlHighlightRules = function() {
1428
+
1429
+ // regexp must not have capturing parentheses
1430
+ // regexps are ordered -> the first match is used
1431
+ this.$rules = {
1432
+ start : [{
1433
+ token : "text",
1434
+ merge : true,
1435
+ regex : "<\\!\\[CDATA\\[",
1436
+ next : "cdata"
1437
+ }, {
1438
+ token : "xml_pe",
1439
+ regex : "<\\?.*?\\?>"
1440
+ }, {
1441
+ token : "comment",
1442
+ merge : true,
1443
+ regex : "<\\!--",
1444
+ next : "comment"
1445
+ }, {
1446
+ token : "xml_pe",
1447
+ regex : "<\\!.*?>"
1448
+ }, {
1449
+ token : "meta.tag",
1450
+ regex : "<(?=\s*script\\b)",
1451
+ next : "script"
1452
+ }, {
1453
+ token : "meta.tag",
1454
+ regex : "<(?=\s*style\\b)",
1455
+ next : "style"
1456
+ }, {
1457
+ token : "meta.tag", // opening tag
1458
+ regex : "<\\/?",
1459
+ next : "tag"
1460
+ }, {
1461
+ token : "text",
1462
+ regex : "\\s+"
1463
+ }, {
1464
+ token : "constant.character.entity",
1465
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
1466
+ }, {
1467
+ token : "text",
1468
+ regex : "[^<]+"
1469
+ } ],
1470
+
1471
+ cdata : [ {
1472
+ token : "text",
1473
+ regex : "\\]\\]>",
1474
+ next : "start"
1475
+ }, {
1476
+ token : "text",
1477
+ merge : true,
1478
+ regex : "\\s+"
1479
+ }, {
1480
+ token : "text",
1481
+ merge : true,
1482
+ regex : ".+"
1483
+ } ],
1484
+
1485
+ comment : [ {
1486
+ token : "comment",
1487
+ regex : ".*?-->",
1488
+ next : "start"
1489
+ }, {
1490
+ token : "comment",
1491
+ merge : true,
1492
+ regex : ".+"
1493
+ } ]
1494
+ };
1495
+
1496
+ xmlUtil.tag(this.$rules, "tag", "start", tagMap);
1497
+ xmlUtil.tag(this.$rules, "style", "css-start", tagMap);
1498
+ xmlUtil.tag(this.$rules, "script", "js-start", tagMap);
1499
+
1500
+ this.embedRules(JavaScriptHighlightRules, "js-", [{
1501
+ token: "comment",
1502
+ regex: "\\/\\/.*(?=<\\/script>)",
1503
+ next: "tag"
1504
+ }, {
1505
+ token: "meta.tag",
1506
+ regex: "<\\/(?=script)",
1507
+ next: "tag"
1508
+ }]);
1509
+
1510
+ this.embedRules(CssHighlightRules, "css-", [{
1511
+ token: "meta.tag",
1512
+ regex: "<\\/(?=style)",
1513
+ next: "tag"
1514
+ }]);
1515
+ };
1516
+
1517
+ oop.inherits(HtmlHighlightRules, TextHighlightRules);
1518
+
1519
+ exports.HtmlHighlightRules = HtmlHighlightRules;
1520
+ });
1521
+
1522
+ define('ace/mode/xml_util', ['require', 'exports', 'module' ], function(require, exports, module) {
1523
+
1524
+
1525
+ function string(state) {
1526
+ return [{
1527
+ token : "string",
1528
+ regex : '".*?"'
1529
+ }, {
1530
+ token : "string", // multi line string start
1531
+ merge : true,
1532
+ regex : '["].*',
1533
+ next : state + "_qqstring"
1534
+ }, {
1535
+ token : "string",
1536
+ regex : "'.*?'"
1537
+ }, {
1538
+ token : "string", // multi line string start
1539
+ merge : true,
1540
+ regex : "['].*",
1541
+ next : state + "_qstring"
1542
+ }];
1543
+ }
1544
+
1545
+ function multiLineString(quote, state) {
1546
+ return [{
1547
+ token : "string",
1548
+ merge : true,
1549
+ regex : ".*?" + quote,
1550
+ next : state
1551
+ }, {
1552
+ token : "string",
1553
+ merge : true,
1554
+ regex : '.+'
1555
+ }];
1556
+ }
1557
+
1558
+ exports.tag = function(states, name, nextState, tagMap) {
1559
+ states[name] = [{
1560
+ token : "text",
1561
+ regex : "\\s+"
1562
+ }, {
1563
+ //token : "meta.tag",
1564
+
1565
+ token : !tagMap ? "meta.tag.tag-name" : function(value) {
1566
+ if (tagMap[value])
1567
+ return "meta.tag.tag-name." + tagMap[value];
1568
+ else
1569
+ return "meta.tag.tag-name";
1570
+ },
1571
+ merge : true,
1572
+ regex : "[-_a-zA-Z0-9:]+",
1573
+ next : name + "_embed_attribute_list"
1574
+ }, {
1575
+ token: "empty",
1576
+ regex: "",
1577
+ next : name + "_embed_attribute_list"
1578
+ }];
1579
+
1580
+ states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
1581
+ states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
1582
+
1583
+ states[name + "_embed_attribute_list"] = [{
1584
+ token : "meta.tag",
1585
+ merge : true,
1586
+ regex : "\/?>",
1587
+ next : nextState
1588
+ }, {
1589
+ token : "keyword.operator",
1590
+ regex : "="
1591
+ }, {
1592
+ token : "entity.other.attribute-name",
1593
+ regex : "[-_a-zA-Z0-9:]+"
1594
+ }, {
1595
+ token : "constant.numeric", // float
1596
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
1597
+ }, {
1598
+ token : "text",
1599
+ regex : "\\s+"
1600
+ }].concat(string(name));
1601
+ };
1602
+
1603
+ });
1604
+
1605
+ define('ace/mode/behaviour/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour/xml', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
1606
+
1607
+
1608
+ var oop = require("../../lib/oop");
1609
+ var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
1610
+ var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1611
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1612
+ var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
1613
+
1614
+ function hasType(token, type) {
1615
+ var hasType = true;
1616
+ var typeList = token.type.split('.');
1617
+ var needleList = type.split('.');
1618
+ needleList.forEach(function(needle){
1619
+ if (typeList.indexOf(needle) == -1) {
1620
+ hasType = false;
1621
+ return false;
1622
+ }
1623
+ });
1624
+ return hasType;
1625
+ }
1626
+
1627
+ var HtmlBehaviour = function () {
1628
+
1629
+ this.inherit(XmlBehaviour); // Get xml behaviour
1630
+
1631
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1632
+ if (text == '>') {
1633
+ var position = editor.getCursorPosition();
1634
+ var iterator = new TokenIterator(session, position.row, position.column);
1635
+ var token = iterator.getCurrentToken();
1636
+ var atCursor = false;
1637
+ if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
1638
+ do {
1639
+ token = iterator.stepBackward();
1640
+ } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
1641
+ } else {
1642
+ atCursor = true;
1643
+ }
1644
+ if (!token || !hasType(token, 'meta.tag-name') || iterator.stepBackward().value.match('/')) {
1645
+ return
1646
+ }
1647
+ var element = token.value;
1648
+ if (atCursor){
1649
+ var element = element.substring(0, position.column - token.start);
1650
+ }
1651
+ if (voidElements.indexOf(element) !== -1){
1652
+ return;
1653
+ }
1654
+ return {
1655
+ text: '>' + '</' + element + '>',
1656
+ selection: [1, 1]
1657
+ }
1658
+ }
1659
+ });
1660
+ }
1661
+ oop.inherits(HtmlBehaviour, XmlBehaviour);
1662
+
1663
+ exports.HtmlBehaviour = HtmlBehaviour;
1664
+ });
1665
+
1666
+ define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle', 'ace/token_iterator'], function(require, exports, module) {
1667
+
1668
+
1669
+ var oop = require("../../lib/oop");
1670
+ var Behaviour = require("../behaviour").Behaviour;
1671
+ var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
1672
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1673
+
1674
+ function hasType(token, type) {
1675
+ var hasType = true;
1676
+ var typeList = token.type.split('.');
1677
+ var needleList = type.split('.');
1678
+ needleList.forEach(function(needle){
1679
+ if (typeList.indexOf(needle) == -1) {
1680
+ hasType = false;
1681
+ return false;
1682
+ }
1683
+ });
1684
+ return hasType;
1685
+ }
1686
+
1687
+ var XmlBehaviour = function () {
1688
+
1689
+ this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
1690
+
1691
+ this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
1692
+ if (text == '>') {
1693
+ var position = editor.getCursorPosition();
1694
+ var iterator = new TokenIterator(session, position.row, position.column);
1695
+ var token = iterator.getCurrentToken();
1696
+ var atCursor = false;
1697
+ if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
1698
+ do {
1699
+ token = iterator.stepBackward();
1700
+ } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
1701
+ } else {
1702
+ atCursor = true;
1703
+ }
1704
+ if (!token || !hasType(token, 'meta.tag-name') || iterator.stepBackward().value.match('/')) {
1705
+ return
1706
+ }
1707
+ var tag = token.value;
1708
+ if (atCursor){
1709
+ var tag = tag.substring(0, position.column - token.start);
1710
+ }
1711
+
1712
+ return {
1713
+ text: '>' + '</' + tag + '>',
1714
+ selection: [1, 1]
1715
+ }
1716
+ }
1717
+ });
1718
+
1719
+ this.add('autoindent', 'insertion', function (state, action, editor, session, text) {
1720
+ if (text == "\n") {
1721
+ var cursor = editor.getCursorPosition();
1722
+ var line = session.doc.getLine(cursor.row);
1723
+ var rightChars = line.substring(cursor.column, cursor.column + 2);
1724
+ if (rightChars == '</') {
1725
+ var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
1726
+ var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
1727
+
1728
+ return {
1729
+ text: '\n' + indent + '\n' + next_indent,
1730
+ selection: [1, indent.length, 1, indent.length]
1731
+ }
1732
+ }
1733
+ }
1734
+ });
1735
+
1736
+ }
1737
+ oop.inherits(XmlBehaviour, Behaviour);
1738
+
1739
+ exports.XmlBehaviour = XmlBehaviour;
1740
+ });
1741
+
1742
+ define('ace/mode/folding/html', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/mixed', 'ace/mode/folding/xml', 'ace/mode/folding/cstyle'], function(require, exports, module) {
1743
+
1744
+
1745
+ var oop = require("../../lib/oop");
1746
+ var MixedFoldMode = require("./mixed").FoldMode;
1747
+ var XmlFoldMode = require("./xml").FoldMode;
1748
+ var CStyleFoldMode = require("./cstyle").FoldMode;
1749
+
1750
+ var FoldMode = exports.FoldMode = function() {
1751
+ MixedFoldMode.call(this, new XmlFoldMode({
1752
+ // void elements
1753
+ "area": 1,
1754
+ "base": 1,
1755
+ "br": 1,
1756
+ "col": 1,
1757
+ "command": 1,
1758
+ "embed": 1,
1759
+ "hr": 1,
1760
+ "img": 1,
1761
+ "input": 1,
1762
+ "keygen": 1,
1763
+ "link": 1,
1764
+ "meta": 1,
1765
+ "param": 1,
1766
+ "source": 1,
1767
+ "track": 1,
1768
+ "wbr": 1,
1769
+
1770
+ // optional tags
1771
+ "li": 1,
1772
+ "dt": 1,
1773
+ "dd": 1,
1774
+ "p": 1,
1775
+ "rt": 1,
1776
+ "rp": 1,
1777
+ "optgroup": 1,
1778
+ "option": 1,
1779
+ "colgroup": 1,
1780
+ "td": 1,
1781
+ "th": 1
1782
+ }), {
1783
+ "js-": new CStyleFoldMode(),
1784
+ "css-": new CStyleFoldMode()
1785
+ });
1786
+ };
1787
+
1788
+ oop.inherits(FoldMode, MixedFoldMode);
1789
+
1790
+ });
1791
+
1792
+ define('ace/mode/folding/mixed', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
1793
+
1794
+
1795
+ var oop = require("../../lib/oop");
1796
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1797
+
1798
+ var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
1799
+ this.defaultMode = defaultMode;
1800
+ this.subModes = subModes;
1801
+ };
1802
+ oop.inherits(FoldMode, BaseFoldMode);
1803
+
1804
+ (function() {
1805
+
1806
+
1807
+ this.$getMode = function(state) {
1808
+ for (var key in this.subModes) {
1809
+ if (state.indexOf(key) === 0)
1810
+ return this.subModes[key];
1811
+ }
1812
+ return null;
1813
+ };
1814
+
1815
+ this.$tryMode = function(state, session, foldStyle, row) {
1816
+ var mode = this.$getMode(state);
1817
+ return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
1818
+ };
1819
+
1820
+ this.getFoldWidget = function(session, foldStyle, row) {
1821
+ return (
1822
+ this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
1823
+ this.$tryMode(session.getState(row), session, foldStyle, row) ||
1824
+ this.defaultMode.getFoldWidget(session, foldStyle, row)
1825
+ );
1826
+ };
1827
+
1828
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1829
+ var mode = this.$getMode(session.getState(row-1));
1830
+
1831
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
1832
+ mode = this.$getMode(session.getState(row));
1833
+
1834
+ if (!mode || !mode.getFoldWidget(session, foldStyle, row))
1835
+ mode = this.defaultMode;
1836
+
1837
+ return mode.getFoldWidgetRange(session, foldStyle, row);
1838
+ };
1839
+
1840
+ }).call(FoldMode.prototype);
1841
+
1842
+ });
1843
+
1844
+ define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) {
1845
+
1846
+
1847
+ var oop = require("../../lib/oop");
1848
+ var lang = require("../../lib/lang");
1849
+ var Range = require("../../range").Range;
1850
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1851
+ var TokenIterator = require("../../token_iterator").TokenIterator;
1852
+
1853
+ var FoldMode = exports.FoldMode = function(voidElements) {
1854
+ BaseFoldMode.call(this);
1855
+ this.voidElements = voidElements || {};
1856
+ };
1857
+ oop.inherits(FoldMode, BaseFoldMode);
1858
+
1859
+ (function() {
1860
+
1861
+ this.getFoldWidget = function(session, foldStyle, row) {
1862
+ var tag = this._getFirstTagInLine(session, row);
1863
+
1864
+ if (tag.closing)
1865
+ return foldStyle == "markbeginend" ? "end" : "";
1866
+
1867
+ if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
1868
+ return "";
1869
+
1870
+ if (tag.selfClosing)
1871
+ return "";
1872
+
1873
+ if (tag.value.indexOf("/" + tag.tagName) !== -1)
1874
+ return "";
1875
+
1876
+ return "start";
1877
+ };
1878
+
1879
+ this._getFirstTagInLine = function(session, row) {
1880
+ var tokens = session.getTokens(row);
1881
+ var value = "";
1882
+ for (var i = 0; i < tokens.length; i++) {
1883
+ var token = tokens[i];
1884
+ if (token.type.indexOf("meta.tag") === 0)
1885
+ value += token.value;
1886
+ else
1887
+ value += lang.stringRepeat(" ", token.value.length);
1888
+ }
1889
+
1890
+ return this._parseTag(value);
1891
+ };
1892
+
1893
+ this.tagRe = /^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
1894
+ this._parseTag = function(tag) {
1895
+
1896
+ var match = this.tagRe.exec(tag);
1897
+ var column = this.tagRe.lastIndex || 0;
1898
+ this.tagRe.lastIndex = 0;
1899
+
1900
+ return {
1901
+ value: tag,
1902
+ match: match ? match[2] : "",
1903
+ closing: match ? !!match[3] : false,
1904
+ selfClosing: match ? !!match[5] || match[2] == "/>" : false,
1905
+ tagName: match ? match[4] : "",
1906
+ column: match[1] ? column + match[1].length : column
1907
+ };
1908
+ };
1909
+ this._readTagForward = function(iterator) {
1910
+ var token = iterator.getCurrentToken();
1911
+ if (!token)
1912
+ return null;
1913
+
1914
+ var value = "";
1915
+ var start;
1916
+
1917
+ do {
1918
+ if (token.type.indexOf("meta.tag") === 0) {
1919
+ if (!start) {
1920
+ var start = {
1921
+ row: iterator.getCurrentTokenRow(),
1922
+ column: iterator.getCurrentTokenColumn()
1923
+ };
1924
+ }
1925
+ value += token.value;
1926
+ if (value.indexOf(">") !== -1) {
1927
+ var tag = this._parseTag(value);
1928
+ tag.start = start;
1929
+ tag.end = {
1930
+ row: iterator.getCurrentTokenRow(),
1931
+ column: iterator.getCurrentTokenColumn() + token.value.length
1932
+ };
1933
+ iterator.stepForward();
1934
+ return tag;
1935
+ }
1936
+ }
1937
+ } while(token = iterator.stepForward());
1938
+
1939
+ return null;
1940
+ };
1941
+
1942
+ this._readTagBackward = function(iterator) {
1943
+ var token = iterator.getCurrentToken();
1944
+ if (!token)
1945
+ return null;
1946
+
1947
+ var value = "";
1948
+ var end;
1949
+
1950
+ do {
1951
+ if (token.type.indexOf("meta.tag") === 0) {
1952
+ if (!end) {
1953
+ end = {
1954
+ row: iterator.getCurrentTokenRow(),
1955
+ column: iterator.getCurrentTokenColumn() + token.value.length
1956
+ };
1957
+ }
1958
+ value = token.value + value;
1959
+ if (value.indexOf("<") !== -1) {
1960
+ var tag = this._parseTag(value);
1961
+ tag.end = end;
1962
+ tag.start = {
1963
+ row: iterator.getCurrentTokenRow(),
1964
+ column: iterator.getCurrentTokenColumn()
1965
+ };
1966
+ iterator.stepBackward();
1967
+ return tag;
1968
+ }
1969
+ }
1970
+ } while(token = iterator.stepBackward());
1971
+
1972
+ return null;
1973
+ };
1974
+
1975
+ this._pop = function(stack, tag) {
1976
+ while (stack.length) {
1977
+
1978
+ var top = stack[stack.length-1];
1979
+ if (!tag || top.tagName == tag.tagName) {
1980
+ return stack.pop();
1981
+ }
1982
+ else if (this.voidElements[tag.tagName]) {
1983
+ return;
1984
+ }
1985
+ else if (this.voidElements[top.tagName]) {
1986
+ stack.pop();
1987
+ continue;
1988
+ } else {
1989
+ return null;
1990
+ }
1991
+ }
1992
+ };
1993
+
1994
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1995
+ var firstTag = this._getFirstTagInLine(session, row);
1996
+
1997
+ if (!firstTag.match)
1998
+ return null;
1999
+
2000
+ var isBackward = firstTag.closing || firstTag.selfClosing;
2001
+ var stack = [];
2002
+ var tag;
2003
+
2004
+ if (!isBackward) {
2005
+ var iterator = new TokenIterator(session, row, firstTag.column);
2006
+ var start = {
2007
+ row: row,
2008
+ column: firstTag.column + firstTag.tagName.length + 2
2009
+ };
2010
+ while (tag = this._readTagForward(iterator)) {
2011
+ if (tag.selfClosing) {
2012
+ if (!stack.length) {
2013
+ tag.start.column += tag.tagName.length + 2;
2014
+ tag.end.column -= 2;
2015
+ return Range.fromPoints(tag.start, tag.end);
2016
+ } else
2017
+ continue;
2018
+ }
2019
+
2020
+ if (tag.closing) {
2021
+ this._pop(stack, tag);
2022
+ if (stack.length == 0)
2023
+ return Range.fromPoints(start, tag.start);
2024
+ }
2025
+ else {
2026
+ stack.push(tag)
2027
+ }
2028
+ }
2029
+ }
2030
+ else {
2031
+ var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
2032
+ var end = {
2033
+ row: row,
2034
+ column: firstTag.column
2035
+ };
2036
+
2037
+ while (tag = this._readTagBackward(iterator)) {
2038
+ if (tag.selfClosing) {
2039
+ if (!stack.length) {
2040
+ tag.start.column += tag.tagName.length + 2;
2041
+ tag.end.column -= 2;
2042
+ return Range.fromPoints(tag.start, tag.end);
2043
+ } else
2044
+ continue;
2045
+ }
2046
+
2047
+ if (!tag.closing) {
2048
+ this._pop(stack, tag);
2049
+ if (stack.length == 0) {
2050
+ tag.start.column += tag.tagName.length + 2;
2051
+ return Range.fromPoints(tag.start, end);
2052
+ }
2053
+ }
2054
+ else {
2055
+ stack.push(tag)
2056
+ }
2057
+ }
2058
+ }
2059
+
2060
+ };
2061
+
2062
+ }).call(FoldMode.prototype);
2063
+
2064
+ });