gollum 5.0.1 → 5.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gollum might be problematic. Click here for more details.

Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/HISTORY.md +6 -0
  3. data/Rakefile +2 -5
  4. data/gollum.gemspec +9 -7
  5. data/lib/gollum.rb +1 -1
  6. data/lib/gollum/app.rb +51 -21
  7. data/lib/gollum/assets.rb +3 -3
  8. data/lib/gollum/helpers.rb +1 -1
  9. data/lib/gollum/public/assets/{.sprockets-manifest-3edc7e21737459b21fbf150f5dccd15c.json → .sprockets-manifest-459226ba5fc211b78ba9a3aa6ebde96c.json} +1 -1
  10. data/lib/gollum/public/assets/{app-982c7fca1832732a24e92474ca2729aeb56f2d0c05bb7a8ff913e9f58a6500d5.js → app-6e925e38a12a40c4fa9e0400cc874e0f4f97b66fdeb90a144dea527dbb544fbd.js} +2 -2
  11. data/lib/gollum/public/assets/app-6e925e38a12a40c4fa9e0400cc874e0f4f97b66fdeb90a144dea527dbb544fbd.js.gz +0 -0
  12. data/lib/gollum/public/assets/{editor-0dbae28c53db5a73d666d30504946671eb09948ffdaf1fdd9d1c8d856d4c0ba1.js → editor-b2c10f22ef6ca1e120956a2d11ff4ca19ac44d7e7240f5cc43ec949184d8b708.js} +7 -7
  13. data/lib/gollum/public/assets/{editor-0dbae28c53db5a73d666d30504946671eb09948ffdaf1fdd9d1c8d856d4c0ba1.js.gz → editor-b2c10f22ef6ca1e120956a2d11ff4ca19ac44d7e7240f5cc43ec949184d8b708.js.gz} +0 -0
  14. data/lib/gollum/public/gollum/javascript/editor/gollum.editor.js +59 -0
  15. data/lib/gollum/public/gollum/javascript/editor/modes.js.erb +1 -1
  16. data/lib/gollum/public/gollum/javascript/gollum.js.erb +6 -5
  17. data/lib/gollum/templates/commit.mustache +26 -0
  18. data/lib/gollum/templates/editor.mustache +5 -0
  19. data/lib/gollum/templates/history.mustache +5 -2
  20. data/lib/gollum/templates/latest_changes.mustache +7 -5
  21. data/lib/gollum/templates/layout.mustache +4 -4
  22. data/lib/gollum/templates/navbar.mustache +4 -4
  23. data/lib/gollum/templates/overview.mustache +2 -2
  24. data/lib/gollum/templates/search.mustache +2 -3
  25. data/lib/gollum/templates/wiki_content.mustache +1 -1
  26. data/lib/gollum/views/commit.rb +38 -0
  27. data/lib/gollum/views/compare.rb +3 -3
  28. data/lib/gollum/views/has_page.rb +0 -4
  29. data/lib/gollum/views/helpers.rb +10 -3
  30. data/lib/gollum/views/history.rb +4 -1
  31. data/lib/gollum/views/latest_changes.rb +1 -0
  32. data/lib/gollum/views/layout.rb +17 -1
  33. data/lib/gollum/views/overview.rb +1 -1
  34. data/lib/gollum/views/page.rb +4 -0
  35. data/lib/gollum/views/search.rb +2 -1
  36. metadata +9 -7
  37. data/lib/gollum/public/assets/app-982c7fca1832732a24e92474ca2729aeb56f2d0c05bb7a8ff913e9f58a6500d5.js.gz +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d4d24ffaa889dd2ccaea1b04803e084020f923f3efb3e1512609676f9fc8647
4
- data.tar.gz: ade42ad7156ebde9985813a051b2f327bc5c597604dc3d1fa20141fc307a197a
3
+ metadata.gz: 1c6a7823724264dbbdb857eee0e9fc313fc9059f5b010bc1b704e02721d600af
4
+ data.tar.gz: 3b216fd6163e4dc39e7aaefaed9e1c8915b6a2b3b31213aa63cb7d6a6ad25503
5
5
  SHA512:
6
- metadata.gz: 33521b0483e80acdb63acbceb27dda772684dda4e5bf619e4a1cbf6fa0eb9b60c49c70ff15d0def8f34dce5d8690625e173f35137e3ff51a58e3c18926398ecb
7
- data.tar.gz: 6f9c3b0b3a97ce1789c2f91184d6aebebab966b883be753b30562f41bca42782f1d2c2abb5b1dfd0bf55977521d2f49e77969f1211073b658860222ed772786b
6
+ metadata.gz: 692d36c6b11e986aedb215de20d5003b3e099e92ab4fc0b20a1ba835b66a1c5cfe4a46e4a42af4299873422e9614cf519048dd620c36ee5eaa13675b5000e777
7
+ data.tar.gz: 9085e53a42effcf8de7a81a843fc5027f2a7ef101b64f26e6b670a6701c18ac66e6b68c72a5fa193aab9f39e55d31548579eccf7469bc2b9d7a6c95cf9049d04
data/HISTORY.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 5.1
2
+
3
+ * Bugfixes
4
+ * Add autosave feature (#1576)
5
+ * Add Add quick access to diff of each commit in the history
6
+
1
7
  # 5.0 / 2020-03-17
2
8
 
3
9
  This is a major new release that introduces many new features, bugfixes, and removes major limitations. See [here](https://github.com/gollum/gollum/wiki/5.0-release-notes) for a list of changes.
data/Rakefile CHANGED
@@ -181,11 +181,8 @@ end
181
181
 
182
182
  desc 'Precompile assets'
183
183
  task :precompile do
184
- require './lib/gollum/views/helpers.rb'
185
- require './lib/gollum/assets.rb'
186
- require 'sprockets'
187
- require 'sprockets-helpers'
188
- require 'sass'
184
+ require './lib/gollum/app.rb'
185
+ Precious::App.set(:environment, :production)
189
186
  env = Precious::Assets.sprockets
190
187
  path = ENV.fetch('GOLLUM_ASSETS_PATH', ::File.join(File.dirname(__FILE__), 'lib/gollum/public/assets'))
191
188
  manifest = Sprockets::Manifest.new(env, path)
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
5
5
  s.required_ruby_version = '>= 1.9'
6
6
 
7
7
  s.name = 'gollum'
8
- s.version = '5.0.1'
9
- s.date = '2020-04-04'
8
+ s.version = '5.1'
9
+ s.date = '2020-08-03'
10
10
  s.license = 'MIT'
11
11
 
12
12
  s.summary = 'A simple, Git-powered wiki.'
@@ -68,15 +68,15 @@ Gem::Specification.new do |s|
68
68
  lib/gollum/app.rb
69
69
  lib/gollum/assets.rb
70
70
  lib/gollum/helpers.rb
71
- lib/gollum/public/assets/.sprockets-manifest-3edc7e21737459b21fbf150f5dccd15c.json
72
- lib/gollum/public/assets/app-982c7fca1832732a24e92474ca2729aeb56f2d0c05bb7a8ff913e9f58a6500d5.js
73
- lib/gollum/public/assets/app-982c7fca1832732a24e92474ca2729aeb56f2d0c05bb7a8ff913e9f58a6500d5.js.gz
71
+ lib/gollum/public/assets/.sprockets-manifest-459226ba5fc211b78ba9a3aa6ebde96c.json
72
+ lib/gollum/public/assets/app-6e925e38a12a40c4fa9e0400cc874e0f4f97b66fdeb90a144dea527dbb544fbd.js
73
+ lib/gollum/public/assets/app-6e925e38a12a40c4fa9e0400cc874e0f4f97b66fdeb90a144dea527dbb544fbd.js.gz
74
74
  lib/gollum/public/assets/app-b205e593a30f1cc0054e2e9ed9fc8af3658d8ef4a62b9708c20f204560deefb7.css
75
75
  lib/gollum/public/assets/app-b205e593a30f1cc0054e2e9ed9fc8af3658d8ef4a62b9708c20f204560deefb7.css.gz
76
76
  lib/gollum/public/assets/criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css
77
77
  lib/gollum/public/assets/criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css.gz
78
- lib/gollum/public/assets/editor-0dbae28c53db5a73d666d30504946671eb09948ffdaf1fdd9d1c8d856d4c0ba1.js
79
- lib/gollum/public/assets/editor-0dbae28c53db5a73d666d30504946671eb09948ffdaf1fdd9d1c8d856d4c0ba1.js.gz
78
+ lib/gollum/public/assets/editor-b2c10f22ef6ca1e120956a2d11ff4ca19ac44d7e7240f5cc43ec949184d8b708.js
79
+ lib/gollum/public/assets/editor-b2c10f22ef6ca1e120956a2d11ff4ca19ac44d7e7240f5cc43ec949184d8b708.js.gz
80
80
  lib/gollum/public/assets/print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css
81
81
  lib/gollum/public/assets/print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css.gz
82
82
  lib/gollum/public/gollum/javascript/HOWTO_UPDATE_ACE.md
@@ -1190,6 +1190,7 @@ Gem::Specification.new do |s|
1190
1190
  lib/gollum/public/gollum/stylesheets/spinner.scss
1191
1191
  lib/gollum/public/gollum/stylesheets/tables.scss
1192
1192
  lib/gollum/public/gollum/stylesheets/template.scss.erb
1193
+ lib/gollum/templates/commit.mustache
1193
1194
  lib/gollum/templates/compare.mustache
1194
1195
  lib/gollum/templates/create.mustache
1195
1196
  lib/gollum/templates/edit.mustache
@@ -1209,6 +1210,7 @@ Gem::Specification.new do |s|
1209
1210
  lib/gollum/templates/searchbar.mustache
1210
1211
  lib/gollum/templates/wiki_content.mustache
1211
1212
  lib/gollum/uri_encode_component.rb
1213
+ lib/gollum/views/commit.rb
1212
1214
  lib/gollum/views/compare.rb
1213
1215
  lib/gollum/views/create.rb
1214
1216
  lib/gollum/views/edit.rb
@@ -12,7 +12,7 @@ require 'rhino' if RUBY_PLATFORM == 'java'
12
12
  require File.expand_path('../gollum/uri_encode_component', __FILE__)
13
13
 
14
14
  module Gollum
15
- VERSION = '5.0.1'
15
+ VERSION = '5.1'
16
16
 
17
17
  def self.assets_path
18
18
  ::File.expand_path('gollum/public', ::File.dirname(__FILE__))
@@ -230,14 +230,15 @@ module Precious
230
230
  halt 500 unless tempfile.is_a? Tempfile
231
231
 
232
232
  if wiki.per_page_uploads
233
- # remove base_url and gollum/* subpath if necessary
234
- dir = request.referer.
235
- sub(request.base_url, '').
236
- sub(/.*gollum\/[-\w]+\//, '')
233
+ dir = request.referer.sub(request.base_url, '')
237
234
  # remove base path if it is set
238
- dir = dir.sub(wiki.base_path, '') if wiki.base_path
235
+ dir.sub!(/^#{wiki.base_path}/, '') if wiki.base_path
236
+ # remove base_url and gollum/* subpath if necessary
237
+ dir.sub!(/^\/gollum\/[-\w]+\//, '')
239
238
  # remove file extension
240
- dir = dir.sub(::File.extname(dir), '')
239
+ dir.sub!(/#{::File.extname(dir)}$/, '')
240
+ # revert escaped whitespaces
241
+ dir.gsub!(/%20/, ' ')
241
242
  dir = ::File.join('uploads', dir)
242
243
  else
243
244
  # store all uploads together
@@ -459,20 +460,6 @@ module Precious
459
460
  mustache :latest_changes
460
461
  end
461
462
 
462
- post '/compare/*' do
463
- @file = clean_url(encodeURIComponent(params[:splat].first))
464
- @versions = params[:versions] || []
465
- if @versions.size < 2
466
- redirect to("gollum/history/#{@file}")
467
- else
468
- redirect to("gollum/compare/%s/%s...%s" % [
469
- @file,
470
- @versions.last,
471
- @versions.first]
472
- )
473
- end
474
- end
475
-
476
463
  get %r{
477
464
  /compare/ # match any URL beginning with /compare/
478
465
  (.+) # extract the full path (including any directories)
@@ -496,8 +483,51 @@ module Precious
496
483
  end
497
484
  end
498
485
 
486
+ get '/compare/*' do
487
+ @file = clean_url(encodeURIComponent(params[:splat].first))
488
+ @versions = params[:versions] || []
489
+ if @versions.size == 1
490
+ wikip = wiki_page(params[:splat].first)
491
+ commit = wikip.wiki.repo.commit(@versions.first)
492
+ parent = commit.parent
493
+ if parent.nil?
494
+ redirect to("#{@file}/#{@commit.id}")
495
+ else
496
+ @versions.push(parent.id)
497
+ end
498
+ end
499
+ if @versions.empty?
500
+ redirect to("gollum/history/#{@file}")
501
+ else
502
+ redirect to("gollum/compare/%s/%s...%s" % [
503
+ @file,
504
+ @versions.last,
505
+ @versions.first]
506
+ )
507
+ end
508
+ end
509
+
510
+
511
+ get %r{
512
+ /commit/ # match any URL beginning with /show/
513
+ (\w+) # match the SHA1
514
+ }x do |version|
515
+ @version = version
516
+ wiki = wiki_new
517
+ begin
518
+ @commit = wiki.repo.commit(version)
519
+ parent = @commit.parent
520
+ parent_id = parent.nil? ? nil : parent.id
521
+ @diff = wiki.repo.diff(parent_id, version)
522
+ mustache :commit
523
+ rescue Gollum::Git::NoSuchShaFound
524
+ @message = "Invalid commit: #{@version}"
525
+ mustache :error
526
+ end
527
+ end
528
+
499
529
  get '/search' do
500
- @query = params[:q]
530
+ @query = params[:q] || ''
501
531
  @name = @query
502
532
  if @query.empty?
503
533
  @results = []
@@ -4,7 +4,7 @@ module Precious
4
4
  module Assets
5
5
  MANIFEST = %w(app.js editor.js app.css criticmarkup.css fileview.css ie7.css print.css *.png *.jpg *.svg *.eot *.ttf)
6
6
  ASSET_URL = 'gollum/assets'
7
-
7
+
8
8
  def self.sprockets(dir = File.dirname(File.expand_path(__FILE__)))
9
9
  env = Sprockets::Environment.new
10
10
  env.append_path ::File.join(dir, 'public/gollum/stylesheets/')
@@ -12,7 +12,7 @@ module Precious
12
12
  env.append_path ::File.join(dir, 'public/gollum/images')
13
13
  env.append_path ::File.join(dir, 'public/gollum/fonts')
14
14
 
15
- env.js_compressor = :uglify
15
+ env.js_compressor = :uglify unless Precious::App.development?
16
16
  env.css_compressor = :scss
17
17
 
18
18
  env.context_class.class_eval do
@@ -26,4 +26,4 @@ module Precious
26
26
  env
27
27
  end
28
28
  end
29
- end
29
+ end
@@ -19,7 +19,7 @@ module Precious
19
19
  # Remove all double slashes
20
20
  def clean_url(url)
21
21
  return url if url.nil?
22
- url.gsub('%2F', '/').gsub(/^\/+/, '').gsub('//', '/')
22
+ url.gsub('%2F', '/').gsub(%r{/{2,}}, '/').gsub(%r{^/}, '')
23
23
  end
24
24
 
25
25
  def forbid(msg = "Forbidden. This wiki is set to no-edit mode.")
@@ -1 +1 @@
1
- {"files":{"app-982c7fca1832732a24e92474ca2729aeb56f2d0c05bb7a8ff913e9f58a6500d5.js":{"logical_path":"app.js","mtime":"2020-03-30T11:12:22+02:00","size":136039,"digest":"982c7fca1832732a24e92474ca2729aeb56f2d0c05bb7a8ff913e9f58a6500d5","integrity":"sha256-mCx/yhgycyok6SR0yicprrVvLQwFu3qP+RPp9YplANU="},"editor-0dbae28c53db5a73d666d30504946671eb09948ffdaf1fdd9d1c8d856d4c0ba1.js":{"logical_path":"editor.js","mtime":"2020-03-29T22:28:50+02:00","size":746117,"digest":"0dbae28c53db5a73d666d30504946671eb09948ffdaf1fdd9d1c8d856d4c0ba1","integrity":"sha256-DbrijFPbWnPWZtMFBJRmcesJlI/9rx/dnRyNhW1MC6E="},"app-b205e593a30f1cc0054e2e9ed9fc8af3658d8ef4a62b9708c20f204560deefb7.css":{"logical_path":"app.css","mtime":"2020-03-30T11:12:22+02:00","size":298111,"digest":"b205e593a30f1cc0054e2e9ed9fc8af3658d8ef4a62b9708c20f204560deefb7","integrity":"sha256-sgXlk6MPHMAFTi6e2fyK82WNjvSmK5cIwg8gRWDe77c="},"criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css":{"logical_path":"criticmarkup.css","mtime":"2020-03-29T22:28:51+02:00","size":646,"digest":"31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4","integrity":"sha256-Ma5dMoK7uOe3w8mRfp+2jjMVprSnXabOxI0huIRpBcQ="},"print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css":{"logical_path":"print.css","mtime":"2020-03-30T11:12:22+02:00","size":75,"digest":"512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb","integrity":"sha256-USSYw2i+DT+xuhBd+oQomuSDgOyfy++Ui9TiOwsJW/s="}},"assets":{"app.js":"app-982c7fca1832732a24e92474ca2729aeb56f2d0c05bb7a8ff913e9f58a6500d5.js","editor.js":"editor-0dbae28c53db5a73d666d30504946671eb09948ffdaf1fdd9d1c8d856d4c0ba1.js","app.css":"app-b205e593a30f1cc0054e2e9ed9fc8af3658d8ef4a62b9708c20f204560deefb7.css","criticmarkup.css":"criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css","print.css":"print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css"}}
1
+ {"files":{"app-6e925e38a12a40c4fa9e0400cc874e0f4f97b66fdeb90a144dea527dbb544fbd.js":{"logical_path":"app.js","mtime":"2020-08-03T18:13:54+02:00","size":136032,"digest":"6e925e38a12a40c4fa9e0400cc874e0f4f97b66fdeb90a144dea527dbb544fbd","integrity":"sha256-bpJeOKEqQMT6ngQAzIdOD0+Xtm/euQoUTepSfbtUT70="},"editor-b2c10f22ef6ca1e120956a2d11ff4ca19ac44d7e7240f5cc43ec949184d8b708.js":{"logical_path":"editor.js","mtime":"2020-08-03T18:13:54+02:00","size":747273,"digest":"b2c10f22ef6ca1e120956a2d11ff4ca19ac44d7e7240f5cc43ec949184d8b708","integrity":"sha256-ssEPIu9soeEglWotEf9MoZrETX5yQPXMQ+yUkYTYtwg="},"app-b205e593a30f1cc0054e2e9ed9fc8af3658d8ef4a62b9708c20f204560deefb7.css":{"logical_path":"app.css","mtime":"2020-03-30T11:12:22+02:00","size":298111,"digest":"b205e593a30f1cc0054e2e9ed9fc8af3658d8ef4a62b9708c20f204560deefb7","integrity":"sha256-sgXlk6MPHMAFTi6e2fyK82WNjvSmK5cIwg8gRWDe77c="},"criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css":{"logical_path":"criticmarkup.css","mtime":"2020-03-29T22:28:51+02:00","size":646,"digest":"31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4","integrity":"sha256-Ma5dMoK7uOe3w8mRfp+2jjMVprSnXabOxI0huIRpBcQ="},"print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css":{"logical_path":"print.css","mtime":"2020-03-30T11:12:22+02:00","size":75,"digest":"512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb","integrity":"sha256-USSYw2i+DT+xuhBd+oQomuSDgOyfy++Ui9TiOwsJW/s="}},"assets":{"app.js":"app-6e925e38a12a40c4fa9e0400cc874e0f4f97b66fdeb90a144dea527dbb544fbd.js","editor.js":"editor-b2c10f22ef6ca1e120956a2d11ff4ca19ac44d7e7240f5cc43ec949184d8b708.js","app.css":"app-b205e593a30f1cc0054e2e9ed9fc8af3658d8ef4a62b9708c20f204560deefb7.css","criticmarkup.css":"criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css","print.css":"print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css"}}
@@ -1,5 +1,5 @@
1
- function brokenAvatarImage(e){return e.onerror="",e.src='data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" class="octicon octicon-person" viewBox="0 0 12 16" version="1.1" aria-hidden="true"><path fill-rule="evenodd" d="M12 14.002a.998.998 0 0 1-.998.998H1.001A1 1 0 0 1 0 13.999V13c0-2.633 4-4 4-4s.229-.409 0-1c-.841-.62-.944-1.59-1-4 .173-2.413 1.867-3 3-3s2.827.586 3 3c-.056 2.41-.159 3.38-1 4-.229.59 0 1 0 1s4 1.367 4 4v1.002z"/></svg>',!0}function routePath(e){return path=gollumRoutes[e],prefixBaseUrl(path)}function prefixBaseUrl(e){if(baseUrl==undefined)console.log("Gollum error: baseUrl undefined");else{if(e!=undefined)return""==baseUrl?e:("/"==baseUrl.charAt(baseUrl.length-1)?result=baseUrl+e:result=baseUrl+"/"+e,result.replace(/\/{2}/g,"/"));console.log("Could not find route with name: "+name)}}function cleanPath(e){return("/"+e.replace(/\/$/,"")).replace(/\/{2}/g,"/")}function pageName(){return"undefined"==typeof pageFullPath?undefined:(name=pageFullPath.split("/").pop(),name.substring(0,name.lastIndexOf(".")))}function pagePath(){return"undefined"==typeof pageFullPath?undefined:pageFullPath.split("/").slice(0,-1).join("/")}function htmlEscape(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function abspath(e,t){"/"!=t[0]&&(t="/"+t,e&&(t="/"+e+t));var n=t.split("/");return[n.slice(0,-1).join("/"),n.pop()]}function setTextDirection(){$(".markdown-body p, .markdown-body span, .markdown-body pre, .markdown-body table").attr("dir","auto")}function preparePage(){setTextDirection(),"true"==criticMarkup&&($("#wiki-content").addClass("criticmarkup"),$("ins.break").unwrap(),$("span.critic.comment").wrap('<span class="popover" />'),$("span.critic.comment").filter(function(){return""!=$(this).text()}).before("&#8225;"))}function flashNotice(e,t,n,i,r){nested_button_html="",void 0!==n&&void 0!==i&&(r=void 0!==r&&"danger"==r?" btn-danger":"",nested_button_html='<span class="px-2"><button type="button" class="btn btn-sm'+r+'" onclick="'+i+'">'+n+"</button></span>"),html='<p><div id="gollum-flash" class="flash flash-'+e+'"><button class="flash-close js-flash-close" type="button" onclick="parentNode.remove()"><svg class="octicon octicon-x" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"/></svg></button>'+t+nested_button_html+"</div></p>",$("#gollum-flash").remove(),$("#wiki-content h1").before(html),"success"==e&&setTimeout(function(){$("#gollum-flash").fadeOut()},5e3)}!function(e,t){function n(e){return M.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}function i(e){if(!yt[e]){var t=j.body,n=M("<"+e+">").appendTo(t),i=n.css("display");n.remove(),"none"!==i&&""!==i||(pt||(pt=j.createElement("iframe"),pt.frameBorder=pt.width=pt.height=0),t.appendChild(pt),ht&&pt.createElement||(ht=(pt.contentWindow||pt.contentDocument).document,ht.write((M.support.boxModel?"<!doctype html>":"")+"<html><body>"),ht.close()),n=ht.createElement(e),ht.body.appendChild(n),i=M.css(n,"display"),t.removeChild(pt)),yt[e]=i}return yt[e]}function r(e,t){var n={};return M.each(wt.concat.apply([],wt.slice(0,t)),function(){n[this]=e}),n}function o(){mt=t}function a(){return setTimeout(o,0),mt=M.now()}function s(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function l(){try{return new e.XMLHttpRequest}catch(e){}}function u(e,n){e.dataFilter&&(n=e.dataFilter(n,e.dataType));var i,r,o,a,s,l,u,c,d=e.dataTypes,f={},p=d.length,h=d[0];for(i=1;i<p;i++){if(1===i)for(r in e.converters)"string"==typeof r&&(f[r.toLowerCase()]=e.converters[r]);if(a=h,"*"===(h=d[i]))h=a;else if("*"!==a&&a!==h){if(s=a+" "+h,!(l=f[s]||f["* "+h])){c=t;for(u in f)if(o=u.split(" "),(o[0]===a||"*"===o[0])&&(c=f[o[1]+" "+h])){u=f[u],!0===u?l=c:!0===c&&(l=u);break}}!l&&!c&&M.error("No conversion from "+s.replace(" "," to ")),!0!==l&&(n=l?l(n):c(u(n)))}}return n}function c(e,n,i){var r,o,a,s,l=e.contents,u=e.dataTypes,c=e.responseFields;for(o in c)o in i&&(n[c[o]]=i[o]);for(;"*"===u[0];)u.shift(),r===t&&(r=e.mimeType||n.getResponseHeader("content-type"));if(r)for(o in l)if(l[o]&&l[o].test(r)){u.unshift(o);break}if(u[0]in i)a=u[0];else{for(o in i){if(!u[0]||e.converters[o+" "+u[0]]){a=o;break}s||(s=o)}a=a||s}if(a)return a!==u[0]&&u.unshift(a),i[a]}function d(e,t,n,i){if(M.isArray(t))M.each(t,function(t,r){n||We.test(e)?i(e,r):d(e+"["+("object"==typeof r?t:"")+"]",r,n,i)});else if(n||"object"!==M.type(t))i(e,t);else for(var r in t)d(e+"["+r+"]",t[r],n,i)}function f(e,n){var i,r,o=M.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);r&&M.extend(!0,e,r)}function p(e,n,i,r,o,a){o=o||n.dataTypes[0],a=a||{},a[o]=!0;for(var s,l=e[o],u=0,c=l?l.length:0,d=e===ot;u<c&&(d||!s);u++)"string"==typeof(s=l[u](n,i,r))&&(!d||a[s]?s=t:(n.dataTypes.unshift(s),s=p(e,n,i,r,s,a)));return(d||!s)&&!a["*"]&&(s=p(e,n,i,r,"*",a)),s}function h(e){return function(t,n){if("string"!=typeof t&&(n=t,t="*"),M.isFunction(n))for(var i,r,o,a=t.toLowerCase().split(tt),s=0,l=a.length;s<l;s++)i=a[s],o=/^\+/.test(i),o&&(i=i.substr(1)||"*"),r=e[i]=e[i]||[],r[o?"unshift":"push"](n)}}function g(e,t,n){var i="width"===t?e.offsetWidth:e.offsetHeight,r="width"===t?1:0,o=4;if(i>0){if("border"!==n)for(;r<o;r+=2)n||(i-=parseFloat(M.css(e,"padding"+qe[r]))||0),"margin"===n?i+=parseFloat(M.css(e,n+qe[r]))||0:i-=parseFloat(M.css(e,"border"+qe[r]+"Width"))||0;return i+"px"}if(i=Ae(e,t),(i<0||null==i)&&(i=e.style[t]),Oe.test(i))return i;if(i=parseFloat(i)||0,n)for(;r<o;r+=2)i+=parseFloat(M.css(e,"padding"+qe[r]))||0,"padding"!==n&&(i+=parseFloat(M.css(e,"border"+qe[r]+"Width"))||0),"margin"===n&&(i+=parseFloat(M.css(e,n+qe[r]))||0);return i+"px"}function m(e){var t=j.createElement("div");return Se.appendChild(t),t.innerHTML=e.outerHTML,t.firstChild}function y(e){var t=(e.nodeName||"").toLowerCase();"input"===t?v(e):"script"!==t&&"undefined"!=typeof e.getElementsByTagName&&M.grep(e.getElementsByTagName("input"),v)}function v(e){"checkbox"!==e.type&&"radio"!==e.type||(e.defaultChecked=e.checked)}function b(e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName("*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll("*"):[]}function w(e,t){var n;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),"object"===n?t.outerHTML=e.outerHTML:"input"!==n||"checkbox"!==e.type&&"radio"!==e.type?"option"===n?t.selected=e.defaultSelected:"input"===n||"textarea"===n?t.defaultValue=e.defaultValue:"script"===n&&t.text!==e.text&&(t.text=e.text):(e.checked&&(t.defaultChecked=t.checked=e.checked),t.value!==e.value&&(t.value=e.value)),t.removeAttribute(M.expando),t.removeAttribute("_submit_attached"),t.removeAttribute("_change_attached"))}function x(e,t){if(1===t.nodeType&&M.hasData(e)){var n,i,r,o=M._data(e),a=M._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(i=0,r=s[n].length;i<r;i++)M.event.add(t,n,s[n][i])}a.data&&(a.data=M.extend({},a.data))}}function k(e){return M.nodeName(e,"table")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function T(e){var t=he.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function C(e,t,n){if(t=t||0,M.isFunction(t))return M.grep(e,function(e,i){return!!t.call(e,i,e)===n});if(t.nodeType)return M.grep(e,function(e){return e===t===n});if("string"==typeof t){var i=M.grep(e,function(e){return 1===e.nodeType});if(ce.test(t))return M.filter(t,i,!n);t=M.filter(t,i)}return M.grep(e,function(e){return M.inArray(e,t)>=0===n})}function E(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function N(){return!0}function _(){return!1}function S(e,t,n){var i=t+"defer",r=t+"queue",o=t+"mark",a=M._data(e,i);a&&("queue"===n||!M._data(e,r))&&("mark"===n||!M._data(e,o))&&setTimeout(function(){!M._data(e,r)&&!M._data(e,o)&&(M.removeData(e,i,!0),a.fire())},0)}function A(e){for(var t in e)if(("data"!==t||!M.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function $(e,n,i){if(i===t&&1===e.nodeType){var r="data-"+n.replace(z,"-$1").toLowerCase();if("string"==typeof(i=e.getAttribute(r))){try{i="true"===i||"false"!==i&&("null"===i?null:M.isNumeric(i)?+i:H.test(i)?M.parseJSON(i):i)}catch(e){}M.data(e,n,i)}else i=t}return i}function L(e){var t,n,i=O[e]={};for(e=e.split(/\s+/),t=0,n=e.length;t<n;t++)i[e[t]]=!0;return i}var j=e.document,D=e.navigator,F=e.location,M=function(){function n(){if(!s.isReady){try{j.documentElement.doScroll("left")}catch(e){return void setTimeout(n,1)}s.ready()}}var i,r,o,a,s=function(e,t){return new s.fn.init(e,t,i)},l=e.jQuery,u=e.$,c=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,d=/\S/,f=/^\s+/,p=/\s+$/,h=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,g=/^[\],:{}\s]*$/,m=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,y=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,v=/(?:^|:|,)(?:\s*\[)+/g,b=/(webkit)[ \/]([\w.]+)/,w=/(opera)(?:.*version)?[ \/]([\w.]+)/,x=/(msie) ([\w.]+)/,k=/(mozilla)(?:.*? rv:([\w.]+))?/,T=/-([a-z]|[0-9])/gi,C=/^-ms-/,E=function(e,t){return(t+"").toUpperCase()},N=D.userAgent,_=Object.prototype.toString,S=Object.prototype.hasOwnProperty,A=Array.prototype.push,$=Array.prototype.slice,L=String.prototype.trim,F=Array.prototype.indexOf,M={};return s.fn=s.prototype={constructor:s,init:function(e,n,i){var r,o,a,l;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if("body"===e&&!n&&j.body)return this.context=j,this[0]=j.body,this.selector=e,this.length=1,this;if("string"==typeof e){if((r="<"!==e.charAt(0)||">"!==e.charAt(e.length-1)||e.length<3?c.exec(e):[null,e,null])&&(r[1]||!n)){if(r[1])return n=n instanceof s?n[0]:n,l=n?n.ownerDocument||n:j,a=h.exec(e),a?s.isPlainObject(n)?(e=[j.createElement(a[1])],s.fn.attr.call(e,n,!0)):e=[l.createElement(a[1])]:(a=s.buildFragment([r[1]],[l]),e=(a.cacheable?s.clone(a.fragment):a.fragment).childNodes),s.merge(this,e);if((o=j.getElementById(r[2]))&&o.parentNode){if(o.id!==r[2])return i.find(e);this.length=1,this[0]=o}return this.context=j,this.selector=e,this}return!n||n.jquery?(n||i).find(e):this.constructor(n).find(e)}return s.isFunction(e)?i.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),s.makeArray(e,this))},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return $.call(this,0)},get:function(e){return null==e?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var i=this.constructor();return s.isArray(e)?A.apply(i,e):s.merge(i,e),i.prevObject=this,i.context=this.context,"find"===t?i.selector=this.selector+(this.selector?" ":"")+n:t&&(i.selector=this.selector+"."+t+"("+n+")"),i},each:function(e,t){return s.each(this,e,t)},ready:function(e){return s.bindReady(),o.add(e),this},eq:function(e){return e=+e,-1===e?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack($.apply(this,arguments),"slice",$.call(arguments).join(","))},map:function(e){return this.pushStack(s.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:A,sort:[].sort,splice:[].splice},s.fn.init.prototype=s.fn,s.extend=s.fn.extend=function(){var e,n,i,r,o,a,l=arguments[0]||{},u=1,c=arguments.length,d=!1;for("boolean"==typeof l&&(d=l,l=arguments[1]||{},u=2),"object"!=typeof l&&!s.isFunction(l)&&(l={}),c===u&&(l=this,--u);u<c;u++)if(null!=(e=arguments[u]))for(n in e)i=l[n],r=e[n],l!==r&&(d&&r&&(s.isPlainObject(r)||(o=s.isArray(r)))?(o?(o=!1,a=i&&s.isArray(i)?i:[]):a=i&&s.isPlainObject(i)?i:{},l[n]=s.extend(d,a,r)):r!==t&&(l[n]=r));return l},s.extend({noConflict:function(t){return e.$===s&&(e.$=u),t&&e.jQuery===s&&(e.jQuery=l),s},isReady:!1,readyWait:1,holdReady:function(e){e?s.readyWait++:s.ready(!0)},ready:function(e){if(!0===e&&!--s.readyWait||!0!==e&&!s.isReady){if(!j.body)return setTimeout(s.ready,1);if(s.isReady=!0,!0!==e&&--s.readyWait>0)return;o.fireWith(j,[s]),s.fn.trigger&&s(j).trigger("ready").off("ready")}},bindReady:function(){if(!o){if(o=s.Callbacks("once memory"),"complete"===j.readyState)return setTimeout(s.ready,1);if(j.addEventListener)j.addEventListener("DOMContentLoaded",a,!1),e.addEventListener("load",s.ready,!1);else if(j.attachEvent){j.attachEvent("onreadystatechange",a),e.attachEvent("onload",s.ready);var t=!1;try{t=null==e.frameElement}catch(e){}j.documentElement.doScroll&&t&&n()}}},isFunction:function(e){return"function"===s.type(e)},isArray:Array.isArray||function(e){return"array"===s.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?String(e):M[_.call(e)]||"object"},isPlainObject:function(e){if(!e||"object"!==s.type(e)||e.nodeType||s.isWindow(e))return!1;try{if(e.constructor&&!S.call(e,"constructor")&&!S.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}var n;for(n in e);return n===t||S.call(e,n)},isEmptyObject:function(e){for(var t in e)return!1;return!0},error:function(e){throw new Error(e)},parseJSON:function(t){return"string"==typeof t&&t?(t=s.trim(t),e.JSON&&e.JSON.parse?e.JSON.parse(t):g.test(t.replace(m,"@").replace(y,"]").replace(v,""))?new Function("return "+t)():void s.error("Invalid JSON: "+t)):null},parseXML:function(n){if("string"!=typeof n||!n)return null;var i,r;try{e.DOMParser?(r=new DOMParser,i=r.parseFromString(n,"text/xml")):(i=new ActiveXObject("Microsoft.XMLDOM"),i.async="false",i.loadXML(n))}catch(e){i=t}return(!i||!i.documentElement||i.getElementsByTagName("parsererror").length)&&s.error("Invalid XML: "+n),i},noop:function(){},globalEval:function(t){t&&d.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(T,E)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toUpperCase()===t.toUpperCase()},each:function(e,n,i){var r,o=0,a=e.length,l=a===t||s.isFunction(e);if(i)if(l){for(r in e)if(!1===n.apply(e[r],i))break}else for(;o<a&&!1!==n.apply(e[o++],i););else if(l){for(r in e)if(!1===n.call(e[r],r,e[r]))break}else for(;o<a&&!1!==n.call(e[o],o,e[o++]););return e},trim:L?function(e){return null==e?"":L.call(e)}:function(e){return null==e?"":(e+"").replace(f,"").replace(p,"")},makeArray:function(e,t){var n=t||[];if(null!=e){var i=s.type(e);null==e.length||"string"===i||"function"===i||"regexp"===i||s.isWindow(e)?A.call(n,e):s.merge(n,e)}return n},inArray:function(e,t,n){var i;if(t){if(F)return F.call(t,e,n);for(i=t.length,n=n?n<0?Math.max(0,i+n):n:0;n<i;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var i=e.length,r=0;if("number"==typeof n.length)for(var o=n.length;r<o;r++)e[i++]=n[r];else for(;n[r]!==t;)e[i++]=n[r++];return e.length=i,e},grep:function(e,t,n){var i,r=[];n=!!n;for(var o=0,a=e.length;o<a;o++)i=!!t(e[o],o),n!==i&&r.push(e[o]);return r},map:function(e,n,i){var r,o,a=[],l=0,u=e.length;if(e instanceof s||u!==t&&"number"==typeof u&&(u>0&&e[0]&&e[u-1]||0===u||s.isArray(e)))for(;l<u;l++)null!=(r=n(e[l],l,i))&&(a[a.length]=r);else for(o in e)null!=(r=n(e[o],o,i))&&(a[a.length]=r);return a.concat.apply([],a)},guid:1,proxy:function(e,n){if("string"==typeof n){var i=e[n];n=e,e=i}if(!s.isFunction(e))return t;var r=$.call(arguments,2),o=function(){return e.apply(n,r.concat($.call(arguments)))};return o.guid=e.guid=e.guid||o.guid||s.guid++,o},access:function(e,n,i,r,o,a,l){var u,c=null==i,d=0,f=e.length;if(i&&"object"==typeof i){for(d in i)s.access(e,n,d,i[d],1,a,r);o=1}else if(r!==t){if(u=l===t&&s.isFunction(r),c&&(u?(u=n,n=function(e,t,n){return u.call(s(e),n)}):(n.call(e,r),n=null)),n)for(;d<f;d++)n(e[d],i,u?r.call(e[d],d,n(e[d],i)):r,l);o=1}return o?e:c?n.call(e):f?n(e[0],i):a},now:function(){return(new Date).getTime()},uaMatch:function(e){e=e.toLowerCase();var t=b.exec(e)||w.exec(e)||x.exec(e)||e.indexOf("compatible")<0&&k.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},sub:function(){function e(t,n){return new e.fn.init(t,n)}s.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(n,i){return i&&i instanceof s&&!(i instanceof e)&&(i=e(i)),s.fn.init.call(this,n,i,t)},e.fn.init.prototype=e.fn;var t=e(j);return e},browser:{}}),s.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){M["[object "+t+"]"]=t.toLowerCase()}),r=s.uaMatch(N),r.browser&&(s.browser[r.browser]=!0,s.browser.version=r.version),s.browser.webkit&&(s.browser.safari=!0),d.test("\xa0")&&(f=/^[\s\xA0]+/,p=/[\s\xA0]+$/),i=s(j),j.addEventListener?a=function(){j.removeEventListener("DOMContentLoaded",a,!1),s.ready()}:j.attachEvent&&(a=function(){"complete"===j.readyState&&(j.detachEvent("onreadystatechange",a),s.ready())}),s}(),O={};M.Callbacks=function(e){e=e?O[e]||L(e):{};var n,i,r,o,a,s,l=[],u=[],c=function(t){var n,i,r,o;for(n=0,i=t.length;n<i;n++)r=t[n],o=M.type(r),"array"===o?c(r):"function"===o&&(!e.unique||!f.has(r))&&l.push(r)},d=function(t,c){for(c=c||[],n=!e.memory||[t,c],i=!0,r=!0,s=o||0,o=0,a=l.length;l&&s<a;s++)if(!1===l[s].apply(t,c)&&e.stopOnFalse){n=!0;break}r=!1,l&&(e.once?!0===n?f.disable():l=[]:u&&u.length&&(n=u.shift(),f.fireWith(n[0],n[1])))},f={add:function(){if(l){var e=l.length;c(arguments),r?a=l.length:n&&!0!==n&&(o=e,d(n[0],n[1]))}return this},remove:function(){if(l)for(var t=arguments,n=0,i=t.length;n<i;n++)for(var o=0;o<l.length&&(t[n]!==l[o]||(r&&o<=a&&(a--,o<=s&&s--),l.splice(o--,1),!e.unique));o++);return this},has:function(e){if(l)for(var t=0,n=l.length;t<n;t++)if(e===l[t])return!0;return!1},empty:function(){return l=[],this},disable:function(){return l=u=n=t,this},disabled:function(){return!l},lock:function(){return u=t,(!n||!0===n)&&f.disable(),this},locked:function(){return!u},fireWith:function(t,i){return u&&(r?e.once||u.push([t,i]):(!e.once||!n)&&d(t,i)),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!i}};return f};var P=[].slice;M.extend({Deferred:function(e){var t,n=M.Callbacks("once memory"),i=M.Callbacks("once memory"),r=M.Callbacks("memory"),o="pending",a={resolve:n,reject:i,notify:r},s={done:n.add,fail:i.add,progress:r.add,state:function(){return o},isResolved:n.fired,isRejected:i.fired,then:function(e,t,n){return l.done(e).fail(t).progress(n),this},always:function(){return l.done.apply(l,arguments).fail.apply(l,arguments),this},pipe:function(e,t,n){return M.Deferred(function(i){M.each({done:[e,"resolve"],fail:[t,"reject"],progress:[n,"notify"]},function(e,t){var n,r=t[0],o=t[1];M.isFunction(r)?l[e](function(){n=r.apply(this,arguments),n&&M.isFunction(n.promise)?n.promise().then(i.resolve,i.reject,i.notify):i[o+"With"](this===l?i:this,[n])}):l[e](i[o])})}).promise()},promise:function(e){if(null==e)e=s;else for(var t in s)e[t]=s[t];return e}},l=s.promise({});for(t in a)l[t]=a[t].fire,l[t+"With"]=a[t].fireWith;return l.done(function(){o="resolved"},i.disable,r.lock).fail(function(){o="rejected"},n.disable,r.lock),e&&e.call(l,l),l},when:function(e){function t(e){return function(t){a[e]=arguments.length>1?P.call(arguments,0):t,l.notifyWith(u,a)}}function n(e){return function(t){i[e]=arguments.length>1?P.call(arguments,0):t,--s||l.resolveWith(l,i)}}var i=P.call(arguments,0),r=0,o=i.length,a=Array(o),s=o,l=o<=1&&e&&M.isFunction(e.promise)?e:M.Deferred(),u=l.promise();if(o>1){for(;r<o;r++)i[r]&&i[r].promise&&M.isFunction(i[r].promise)?i[r].promise().then(n(r),l.reject,t(r)):--s;s||l.resolveWith(l,i)}else l!==e&&l.resolveWith(l,o?[e]:[]);return u}}),M.support=function(){var t,n,i,r,o,a,s,l,u,c,d,f=j.createElement("div");j.documentElement;if(f.setAttribute("className","t"),f.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",n=f.getElementsByTagName("*"),i=f.getElementsByTagName("a")[0],!n||!n.length||!i)return{};r=j.createElement("select"),o=r.appendChild(j.createElement("option")),a=f.getElementsByTagName("input")[0],t={leadingWhitespace:3===f.firstChild.nodeType,tbody:!f.getElementsByTagName("tbody").length,htmlSerialize:!!f.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.55/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:"on"===a.value,optSelected:o.selected,getSetAttribute:"t"!==f.className,enctype:!!j.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==j.createElement("nav").cloneNode(!0).outerHTML,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},M.boxModel=t.boxModel="CSS1Compat"===j.compatMode,a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,r.disabled=!0,t.optDisabled=!o.disabled;try{delete f.test}catch(e){t.deleteExpando=!1}if(!f.addEventListener&&f.attachEvent&&f.fireEvent&&(f.attachEvent("onclick",function(){t.noCloneEvent=!1}),f.cloneNode(!0).fireEvent("onclick")),a=j.createElement("input"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","checked"),a.setAttribute("name","t"),f.appendChild(a),s=j.createDocumentFragment(),s.appendChild(f.lastChild),t.checkClone=s.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=a.checked,s.removeChild(a),s.appendChild(f),f.attachEvent)for(c in{submit:1,change:1,focusin:1})u="on"+c,d=u in f,d||(f.setAttribute(u,"return;"),d="function"==typeof f[u]),t[c+"Bubbles"]=d;return s.removeChild(f),s=r=o=f=a=null,M(function(){var n,i,r,o,a,s,u,c,p,h,g,m,y=j.getElementsByTagName("body")[0];!y||(u=1,m="padding:0;margin:0;border:",h="position:absolute;top:0;left:0;width:1px;height:1px;",g=m+"0;visibility:hidden;",c="style='"+h+m+"5px solid #000;",p="<div "+c+"display:block;'><div style='"+m+"0;display:block;overflow:hidden;'></div></div><table "+c+"' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>",n=j.createElement("div"),n.style.cssText=g+"width:0;height:0;position:static;top:0;margin-top:"+u+"px",y.insertBefore(n,y.firstChild),f=j.createElement("div"),n.appendChild(f),f.innerHTML="<table><tr><td style='"+m+"0;display:none'></td><td>t</td></tr></table>",l=f.getElementsByTagName("td"),d=0===l[0].offsetHeight,l[0].style.display="",l[1].style.display="none",t.reliableHiddenOffsets=d&&0===l[0].offsetHeight,e.getComputedStyle&&(f.innerHTML="",s=j.createElement("div"),s.style.width="0",s.style.marginRight="0",f.style.width="2px",f.appendChild(s),t.reliableMarginRight=0===(parseInt((e.getComputedStyle(s,null)||{marginRight:0}).marginRight,10)||0)),"undefined"!=typeof f.style.zoom&&(f.innerHTML="",f.style.width=f.style.padding="1px",f.style.border=0,f.style.overflow="hidden",f.style.display="inline",f.style.zoom=1,t.inlineBlockNeedsLayout=3===f.offsetWidth,f.style.display="block",f.style.overflow="visible",f.innerHTML="<div style='width:5px;'></div>",t.shrinkWrapBlocks=3!==f.offsetWidth),f.style.cssText=h+g,f.innerHTML=p,i=f.firstChild,r=i.firstChild,o=i.nextSibling.firstChild.firstChild,a={doesNotAddBorder:5!==r.offsetTop,doesAddBorderForTableAndCells:5===o.offsetTop},r.style.position="fixed",r.style.top="20px",a.fixedPosition=20===r.offsetTop||15===r.offsetTop,r.style.position=r.style.top="",i.style.overflow="hidden",i.style.position="relative",a.subtractsBorderForOverflowNotVisible=-5===r.offsetTop,a.doesNotIncludeMarginInBodyOffset=y.offsetTop!==u,e.getComputedStyle&&(f.style.marginTop="1%",t.pixelMargin="1%"!==(e.getComputedStyle(f,null)||{marginTop:0}).marginTop),"undefined"!=typeof n.style.zoom&&(n.style.zoom=1),y.removeChild(n),s=f=n=null,M.extend(t,a))}),t}();var H=/^(?:\{.*\}|\[.*\])$/,z=/([A-Z])/g;M.extend({cache:{},uuid:0,expando:"jQuery"+(M.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return!!(e=e.nodeType?M.cache[e[M.expando]]:e[M.expando])&&!A(e)},data:function(e,n,i,r){if(M.acceptData(e)){var o,a,s,l=M.expando,u="string"==typeof n,c=e.nodeType,d=c?M.cache:e,f=c?e[l]:e[l]&&l,p="events"===n;if((!f||!d[f]||!p&&!r&&!d[f].data)&&u&&i===t)return;return f||(c?e[l]=f=++M.uuid:f=l),d[f]||(d[f]={},c||(d[f].toJSON=M.noop)),("object"!=typeof n&&"function"!=typeof n||(r?d[f]=M.extend(d[f],n):d[f].data=M.extend(d[f].data,n)),o=a=d[f],r||(a.data||(a.data={}),a=a.data),i!==t&&(a[M.camelCase(n)]=i),p&&!a[n])?o.events:(u?null==(s=a[n])&&(s=a[M.camelCase(n)]):s=a,s)}},removeData:function(e,t,n){if(M.acceptData(e)){var i,r,o,a=M.expando,s=e.nodeType,l=s?M.cache:e,u=s?e[a]:a;if(!l[u])return;if(t&&(i=n?l[u]:l[u].data)){M.isArray(t)||(t in i?t=[t]:(t=M.camelCase(t),t=t in i?[t]:t.split(" ")));for(r=0,o=t.length;r<o;r++)delete i[t[r]];if(!(n?A:M.isEmptyObject)(i))return}if(!n&&(delete l[u].data,!A(l[u])))return;M.support.deleteExpando||!l.setInterval?delete l[u]:l[u]=null,s&&(M.support.deleteExpando?delete e[a]:e.removeAttribute?e.removeAttribute(a):e[a]=null)}},_data:function(e,t,n){return M.data(e,t,n,!0)},acceptData:function(e){if(e.nodeName){var t=M.noData[e.nodeName.toLowerCase()];if(t)return!0!==t&&e.getAttribute("classid")===t}return!0}}),M.fn.extend({data:function(e,n){var i,r,o,a,s,l=this[0],u=0,c=null;if(e===t){if(this.length&&(c=M.data(l),1===l.nodeType&&!M._data(l,"parsedAttrs"))){for(o=l.attributes,s=o.length;u<s;u++)a=o[u].name,0===a.indexOf("data-")&&(a=M.camelCase(a.substring(5)),$(l,a,c[a]));M._data(l,"parsedAttrs",!0)}return c}return"object"==typeof e?this.each(function(){M.data(this,e)}):(i=e.split(".",2),i[1]=i[1]?"."+i[1]:"",r=i[1]+"!",M.access(this,function(n){if(n===t)return(c=this.triggerHandler("getData"+r,[i[0]]))===t&&l&&(c=M.data(l,e),c=$(l,e,c)),c===t&&i[1]?this.data(i[0]):c;i[1]=n,this.each(function(){var t=M(this);t.triggerHandler("setData"+r,i),M.data(this,e,n),t.triggerHandler("changeData"+r,i)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){M.removeData(this,e)})}}),M.extend({_mark:function(e,t){e&&(t=(t||"fx")+"mark",M._data(e,t,(M._data(e,t)||0)+1))},_unmark:function(e,t,n){if(!0!==e&&(n=t,t=e,e=!1),t){n=n||"fx";var i=n+"mark",r=e?0:(M._data(t,i)||1)-1;r?M._data(t,i,r):(M.removeData(t,i,!0),S(t,n,"mark"))}},queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=M._data(e,t),n&&(!i||M.isArray(n)?i=M._data(e,t,M.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=M.queue(e,t),i=n.shift(),r={};"inprogress"===i&&(i=n.shift()),i&&("fx"===t&&n.unshift("inprogress"),M._data(e,t+".run",r),i.call(e,function(){M.dequeue(e,t)},r)),n.length||(M.removeData(e,t+"queue "+t+".run",!0),S(e,t,"queue"))}}),M.fn.extend({queue:function(e,n){var i=2;return"string"!=typeof e&&(n=e,e="fx",i--),arguments.length<i?M.queue(this[0],e):n===t?this:this.each(function(){var t=M.queue(this,e,n);"fx"===e&&"inprogress"!==t[0]&&M.dequeue(this,e)})},dequeue:function(e){return this.each(function(){M.dequeue(this,e)})},delay:function(e,t){return e=M.fx?M.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var i=setTimeout(t,e);n.stop=function(){clearTimeout(i)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){function i(){--l||o.resolveWith(a,[a])}"string"!=typeof e&&(n=e,e=t),e=e||"fx";for(var r,o=M.Deferred(),a=this,s=a.length,l=1,u=e+"defer",c=e+"queue",d=e+"mark";s--;)(r=M.data(a[s],u,t,!0)||(M.data(a[s],c,t,!0)||M.data(a[s],d,t,!0))&&M.data(a[s],u,M.Callbacks("once memory"),!0))&&(l++,r.add(i));return i(),o.promise(n)}});var q,B,R,I=/[\n\t\r]/g,W=/\s+/,X=/\r/g,U=/^(?:button|input)$/i,V=/^(?:button|input|object|select|textarea)$/i,K=/^a(?:rea)?$/i,G=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,J=M.support.getSetAttribute;M.fn.extend({attr:function(e,t){return M.access(this,M.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){M.removeAttr(this,e)})},prop:function(e,t){return M.access(this,M.prop,e,t,arguments.length>1)},removeProp:function(e){return e=M.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(e){}})},addClass:function(e){var t,n,i,r,o,a,s;if(M.isFunction(e))return this.each(function(t){M(this).addClass(e.call(this,t,this.className))});if(e&&"string"==typeof e)for(t=e.split(W),n=0,i=this.length;n<i;n++)if(r=this[n],1===r.nodeType)if(r.className||1!==t.length){for(o=" "+r.className+" ",a=0,s=t.length;a<s;a++)~o.indexOf(" "+t[a]+" ")||(o+=t[a]+" ");r.className=M.trim(o)}else r.className=e;return this},removeClass:function(e){var n,i,r,o,a,s,l;if(M.isFunction(e))return this.each(function(t){M(this).removeClass(e.call(this,t,this.className))});if(e&&"string"==typeof e||e===t)for(n=(e||"").split(W),i=0,r=this.length;i<r;i++)if(o=this[i],1===o.nodeType&&o.className)if(e){for(a=(" "+o.className+" ").replace(I," "),s=0,l=n.length;s<l;s++)a=a.replace(" "+n[s]+" "," ");o.className=M.trim(a)}else o.className="";return this},toggleClass:function(e,t){var n=typeof e,i="boolean"==typeof t;return M.isFunction(e)?this.each(function(n){M(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var r,o=0,a=M(this),s=t,l=e.split(W);r=l[o++];)s=i?s:!a.hasClass(r),a[s?"addClass":"removeClass"](r);else"undefined"!==n&&"boolean"!==n||(this.className&&M._data(this,"__className__",this.className),this.className=this.className||!1===e?"":M._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,i=this.length;n<i;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(I," ").indexOf(t)>-1)return!0;return!1},val:function(e){var n,i,r,o=this[0];return arguments.length?(r=M.isFunction(e),this.each(function(i){var o,a=M(this);1===this.nodeType&&(o=r?e.call(this,i,a.val()):e,null==o?o="":"number"==typeof o?o+="":M.isArray(o)&&(o=M.map(o,function(e){return null==e?"":e+""})),n=M.valHooks[this.type]||M.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))})):o?(n=M.valHooks[o.type]||M.valHooks[o.nodeName.toLowerCase()])&&"get"in n&&(i=n.get(o,"value"))!==t?i:(i=o.value,"string"==typeof i?i.replace(X,""):null==i?"":i):void 0}}),M.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,i,r,o=e.selectedIndex,a=[],s=e.options,l="select-one"===e.type;if(o<0)return null;for(n=l?o:0,i=l?o+1:s.length;n<i;n++)if(r=s[n],r.selected&&(M.support.optDisabled?!r.disabled:null===r.getAttribute("disabled"))&&(!r.parentNode.disabled||!M.nodeName(r.parentNode,"optgroup"))){if(t=M(r).val(),l)return t;a.push(t)}return l&&!a.length&&s.length?M(s[o]).val():a},set:function(e,t){var n=M.makeArray(t);return M(e).find("option").each(function(){this.selected=M.inArray(M(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(e,n,i,r){var o,a,s,l=e.nodeType;if(e&&3!==l&&8!==l&&2!==l)return r&&n in M.attrFn?M(e)[n](i):"undefined"==typeof e.getAttribute?M.prop(e,n,i):((s=1!==l||!M.isXMLDoc(e))&&(n=n.toLowerCase(),a=M.attrHooks[n]||(G.test(n)?B:q)),i!==t?null===i?void M.removeAttr(e,n):a&&"set"in a&&s&&(o=a.set(e,i,n))!==t?o:(e.setAttribute(n,""+i),i):a&&"get"in a&&s&&null!==(o=a.get(e,n))?o:(o=e.getAttribute(n),null===o?t:o))},removeAttr:function(e,t){var n,i,r,o,a,s=0;if(t&&1===e.nodeType)for(i=t.toLowerCase().split(W),o=i.length;s<o;s++)(r=i[s])&&(n=M.propFix[r]||r,a=G.test(r),a||M.attr(e,r,""),e.removeAttribute(J?r:n),a&&n in e&&(e[n]=!1))},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)M.error("type property can't be changed");else if(!M.support.radioValue&&"radio"===t&&M.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return q&&M.nodeName(e,"button")?q.get(e,t):t in e?e.value:null},set:function(e,t,n){if(q&&M.nodeName(e,"button"))return q.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,i){var r,o,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return(1!==a||!M.isXMLDoc(e))&&(n=M.propFix[n]||n,o=M.propHooks[n]),i!==t?o&&"set"in o&&(r=o.set(e,i,n))!==t?r:e[n]=i:o&&"get"in o&&null!==(r=o.get(e,n))?r:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||K.test(e.nodeName)&&e.href?0:t}}}}),
1
+ function brokenAvatarImage(e){return e.onerror="",e.src='data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" class="octicon octicon-person" viewBox="0 0 12 16" version="1.1" aria-hidden="true"><path fill-rule="evenodd" d="M12 14.002a.998.998 0 0 1-.998.998H1.001A1 1 0 0 1 0 13.999V13c0-2.633 4-4 4-4s.229-.409 0-1c-.841-.62-.944-1.59-1-4 .173-2.413 1.867-3 3-3s2.827.586 3 3c-.056 2.41-.159 3.38-1 4-.229.59 0 1 0 1s4 1.367 4 4v1.002z"/></svg>',!0}function routePath(e){return path=gollumRoutes[e],prefixBaseUrl(path)}function prefixBaseUrl(e){if(baseUrl==undefined)console.log("Gollum error: baseUrl undefined");else{if(e!=undefined)return""==baseUrl?e:("/"==baseUrl.charAt(baseUrl.length-1)?result=baseUrl+e:result=baseUrl+"/"+e,result.replace(/\/{2}/g,"/"));console.log("Could not find route with name: "+name)}}function cleanPath(e){return("/"+e.replace(/\/$/,"")).replace(/\/{2}/g,"/")}function pageName(){return"undefined"==typeof pageFullPath?undefined:(name=pageFullPath.split("/").pop(),name.substring(0,name.lastIndexOf(".")))}function pagePath(){return"undefined"==typeof pageFullPath?undefined:pageFullPath.split("/").slice(0,-1).join("/")}function htmlEscape(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function abspath(e,t){"/"!=t[0]&&(t="/"+t,e&&(t="/"+e+t));var n=t.split("/");return[n.slice(0,-1).join("/"),n.pop()]}function setTextDirection(){$(".markdown-body p, .markdown-body span, .markdown-body pre, .markdown-body table").attr("dir","auto")}function preparePage(){setTextDirection(),"true"==criticMarkup&&($("#wiki-content").addClass("criticmarkup"),$("ins.break").unwrap(),$("span.critic.comment").wrap('<span class="popover" />'),$("span.critic.comment").filter(function(){return""!=$(this).text()}).before("&#8225;"))}function flashNotice(e,t,n,i,r){nested_button_html="",void 0!==n&&void 0!==i&&(r=void 0!==r&&"danger"==r?" btn-danger":"",nested_button_html='<span class="px-2"><button type="button" class="btn btn-sm'+r+'" onclick="'+i+'">'+n+"</button></span>"),html='<p><div id="gollum-flash" class="flash flash-'+e+'"><button class="flash-close js-flash-close" type="button" onclick="parentNode.remove()"><svg class="octicon octicon-x" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"/></svg></button>'+t+nested_button_html+"</div></p>",$("#gollum-flash").remove(),$("#wiki-content").before(html),"success"==e&&setTimeout(function(){$("#gollum-flash").fadeOut()},5e3)}!function(e,t){function n(e){return M.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}function i(e){if(!yt[e]){var t=j.body,n=M("<"+e+">").appendTo(t),i=n.css("display");n.remove(),"none"!==i&&""!==i||(pt||(pt=j.createElement("iframe"),pt.frameBorder=pt.width=pt.height=0),t.appendChild(pt),ht&&pt.createElement||(ht=(pt.contentWindow||pt.contentDocument).document,ht.write((M.support.boxModel?"<!doctype html>":"")+"<html><body>"),ht.close()),n=ht.createElement(e),ht.body.appendChild(n),i=M.css(n,"display"),t.removeChild(pt)),yt[e]=i}return yt[e]}function r(e,t){var n={};return M.each(wt.concat.apply([],wt.slice(0,t)),function(){n[this]=e}),n}function o(){mt=t}function a(){return setTimeout(o,0),mt=M.now()}function s(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function l(){try{return new e.XMLHttpRequest}catch(e){}}function u(e,n){e.dataFilter&&(n=e.dataFilter(n,e.dataType));var i,r,o,a,s,l,u,c,d=e.dataTypes,f={},p=d.length,h=d[0];for(i=1;i<p;i++){if(1===i)for(r in e.converters)"string"==typeof r&&(f[r.toLowerCase()]=e.converters[r]);if(a=h,"*"===(h=d[i]))h=a;else if("*"!==a&&a!==h){if(s=a+" "+h,!(l=f[s]||f["* "+h])){c=t;for(u in f)if(o=u.split(" "),(o[0]===a||"*"===o[0])&&(c=f[o[1]+" "+h])){u=f[u],!0===u?l=c:!0===c&&(l=u);break}}!l&&!c&&M.error("No conversion from "+s.replace(" "," to ")),!0!==l&&(n=l?l(n):c(u(n)))}}return n}function c(e,n,i){var r,o,a,s,l=e.contents,u=e.dataTypes,c=e.responseFields;for(o in c)o in i&&(n[c[o]]=i[o]);for(;"*"===u[0];)u.shift(),r===t&&(r=e.mimeType||n.getResponseHeader("content-type"));if(r)for(o in l)if(l[o]&&l[o].test(r)){u.unshift(o);break}if(u[0]in i)a=u[0];else{for(o in i){if(!u[0]||e.converters[o+" "+u[0]]){a=o;break}s||(s=o)}a=a||s}if(a)return a!==u[0]&&u.unshift(a),i[a]}function d(e,t,n,i){if(M.isArray(t))M.each(t,function(t,r){n||We.test(e)?i(e,r):d(e+"["+("object"==typeof r?t:"")+"]",r,n,i)});else if(n||"object"!==M.type(t))i(e,t);else for(var r in t)d(e+"["+r+"]",t[r],n,i)}function f(e,n){var i,r,o=M.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);r&&M.extend(!0,e,r)}function p(e,n,i,r,o,a){o=o||n.dataTypes[0],a=a||{},a[o]=!0;for(var s,l=e[o],u=0,c=l?l.length:0,d=e===ot;u<c&&(d||!s);u++)"string"==typeof(s=l[u](n,i,r))&&(!d||a[s]?s=t:(n.dataTypes.unshift(s),s=p(e,n,i,r,s,a)));return(d||!s)&&!a["*"]&&(s=p(e,n,i,r,"*",a)),s}function h(e){return function(t,n){if("string"!=typeof t&&(n=t,t="*"),M.isFunction(n))for(var i,r,o,a=t.toLowerCase().split(tt),s=0,l=a.length;s<l;s++)i=a[s],o=/^\+/.test(i),o&&(i=i.substr(1)||"*"),r=e[i]=e[i]||[],r[o?"unshift":"push"](n)}}function g(e,t,n){var i="width"===t?e.offsetWidth:e.offsetHeight,r="width"===t?1:0,o=4;if(i>0){if("border"!==n)for(;r<o;r+=2)n||(i-=parseFloat(M.css(e,"padding"+qe[r]))||0),"margin"===n?i+=parseFloat(M.css(e,n+qe[r]))||0:i-=parseFloat(M.css(e,"border"+qe[r]+"Width"))||0;return i+"px"}if(i=Ae(e,t),(i<0||null==i)&&(i=e.style[t]),Oe.test(i))return i;if(i=parseFloat(i)||0,n)for(;r<o;r+=2)i+=parseFloat(M.css(e,"padding"+qe[r]))||0,"padding"!==n&&(i+=parseFloat(M.css(e,"border"+qe[r]+"Width"))||0),"margin"===n&&(i+=parseFloat(M.css(e,n+qe[r]))||0);return i+"px"}function m(e){var t=j.createElement("div");return Se.appendChild(t),t.innerHTML=e.outerHTML,t.firstChild}function y(e){var t=(e.nodeName||"").toLowerCase();"input"===t?v(e):"script"!==t&&"undefined"!=typeof e.getElementsByTagName&&M.grep(e.getElementsByTagName("input"),v)}function v(e){"checkbox"!==e.type&&"radio"!==e.type||(e.defaultChecked=e.checked)}function b(e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName("*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll("*"):[]}function w(e,t){var n;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),"object"===n?t.outerHTML=e.outerHTML:"input"!==n||"checkbox"!==e.type&&"radio"!==e.type?"option"===n?t.selected=e.defaultSelected:"input"===n||"textarea"===n?t.defaultValue=e.defaultValue:"script"===n&&t.text!==e.text&&(t.text=e.text):(e.checked&&(t.defaultChecked=t.checked=e.checked),t.value!==e.value&&(t.value=e.value)),t.removeAttribute(M.expando),t.removeAttribute("_submit_attached"),t.removeAttribute("_change_attached"))}function x(e,t){if(1===t.nodeType&&M.hasData(e)){var n,i,r,o=M._data(e),a=M._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(i=0,r=s[n].length;i<r;i++)M.event.add(t,n,s[n][i])}a.data&&(a.data=M.extend({},a.data))}}function k(e){return M.nodeName(e,"table")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function T(e){var t=he.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function C(e,t,n){if(t=t||0,M.isFunction(t))return M.grep(e,function(e,i){return!!t.call(e,i,e)===n});if(t.nodeType)return M.grep(e,function(e){return e===t===n});if("string"==typeof t){var i=M.grep(e,function(e){return 1===e.nodeType});if(ce.test(t))return M.filter(t,i,!n);t=M.filter(t,i)}return M.grep(e,function(e){return M.inArray(e,t)>=0===n})}function E(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function N(){return!0}function _(){return!1}function S(e,t,n){var i=t+"defer",r=t+"queue",o=t+"mark",a=M._data(e,i);a&&("queue"===n||!M._data(e,r))&&("mark"===n||!M._data(e,o))&&setTimeout(function(){!M._data(e,r)&&!M._data(e,o)&&(M.removeData(e,i,!0),a.fire())},0)}function A(e){for(var t in e)if(("data"!==t||!M.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function $(e,n,i){if(i===t&&1===e.nodeType){var r="data-"+n.replace(z,"-$1").toLowerCase();if("string"==typeof(i=e.getAttribute(r))){try{i="true"===i||"false"!==i&&("null"===i?null:M.isNumeric(i)?+i:H.test(i)?M.parseJSON(i):i)}catch(e){}M.data(e,n,i)}else i=t}return i}function L(e){var t,n,i=O[e]={};for(e=e.split(/\s+/),t=0,n=e.length;t<n;t++)i[e[t]]=!0;return i}var j=e.document,D=e.navigator,F=e.location,M=function(){function n(){if(!s.isReady){try{j.documentElement.doScroll("left")}catch(e){return void setTimeout(n,1)}s.ready()}}var i,r,o,a,s=function(e,t){return new s.fn.init(e,t,i)},l=e.jQuery,u=e.$,c=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,d=/\S/,f=/^\s+/,p=/\s+$/,h=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,g=/^[\],:{}\s]*$/,m=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,y=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,v=/(?:^|:|,)(?:\s*\[)+/g,b=/(webkit)[ \/]([\w.]+)/,w=/(opera)(?:.*version)?[ \/]([\w.]+)/,x=/(msie) ([\w.]+)/,k=/(mozilla)(?:.*? rv:([\w.]+))?/,T=/-([a-z]|[0-9])/gi,C=/^-ms-/,E=function(e,t){return(t+"").toUpperCase()},N=D.userAgent,_=Object.prototype.toString,S=Object.prototype.hasOwnProperty,A=Array.prototype.push,$=Array.prototype.slice,L=String.prototype.trim,F=Array.prototype.indexOf,M={};return s.fn=s.prototype={constructor:s,init:function(e,n,i){var r,o,a,l;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if("body"===e&&!n&&j.body)return this.context=j,this[0]=j.body,this.selector=e,this.length=1,this;if("string"==typeof e){if((r="<"!==e.charAt(0)||">"!==e.charAt(e.length-1)||e.length<3?c.exec(e):[null,e,null])&&(r[1]||!n)){if(r[1])return n=n instanceof s?n[0]:n,l=n?n.ownerDocument||n:j,a=h.exec(e),a?s.isPlainObject(n)?(e=[j.createElement(a[1])],s.fn.attr.call(e,n,!0)):e=[l.createElement(a[1])]:(a=s.buildFragment([r[1]],[l]),e=(a.cacheable?s.clone(a.fragment):a.fragment).childNodes),s.merge(this,e);if((o=j.getElementById(r[2]))&&o.parentNode){if(o.id!==r[2])return i.find(e);this.length=1,this[0]=o}return this.context=j,this.selector=e,this}return!n||n.jquery?(n||i).find(e):this.constructor(n).find(e)}return s.isFunction(e)?i.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),s.makeArray(e,this))},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return $.call(this,0)},get:function(e){return null==e?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var i=this.constructor();return s.isArray(e)?A.apply(i,e):s.merge(i,e),i.prevObject=this,i.context=this.context,"find"===t?i.selector=this.selector+(this.selector?" ":"")+n:t&&(i.selector=this.selector+"."+t+"("+n+")"),i},each:function(e,t){return s.each(this,e,t)},ready:function(e){return s.bindReady(),o.add(e),this},eq:function(e){return e=+e,-1===e?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack($.apply(this,arguments),"slice",$.call(arguments).join(","))},map:function(e){return this.pushStack(s.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:A,sort:[].sort,splice:[].splice},s.fn.init.prototype=s.fn,s.extend=s.fn.extend=function(){var e,n,i,r,o,a,l=arguments[0]||{},u=1,c=arguments.length,d=!1;for("boolean"==typeof l&&(d=l,l=arguments[1]||{},u=2),"object"!=typeof l&&!s.isFunction(l)&&(l={}),c===u&&(l=this,--u);u<c;u++)if(null!=(e=arguments[u]))for(n in e)i=l[n],r=e[n],l!==r&&(d&&r&&(s.isPlainObject(r)||(o=s.isArray(r)))?(o?(o=!1,a=i&&s.isArray(i)?i:[]):a=i&&s.isPlainObject(i)?i:{},l[n]=s.extend(d,a,r)):r!==t&&(l[n]=r));return l},s.extend({noConflict:function(t){return e.$===s&&(e.$=u),t&&e.jQuery===s&&(e.jQuery=l),s},isReady:!1,readyWait:1,holdReady:function(e){e?s.readyWait++:s.ready(!0)},ready:function(e){if(!0===e&&!--s.readyWait||!0!==e&&!s.isReady){if(!j.body)return setTimeout(s.ready,1);if(s.isReady=!0,!0!==e&&--s.readyWait>0)return;o.fireWith(j,[s]),s.fn.trigger&&s(j).trigger("ready").off("ready")}},bindReady:function(){if(!o){if(o=s.Callbacks("once memory"),"complete"===j.readyState)return setTimeout(s.ready,1);if(j.addEventListener)j.addEventListener("DOMContentLoaded",a,!1),e.addEventListener("load",s.ready,!1);else if(j.attachEvent){j.attachEvent("onreadystatechange",a),e.attachEvent("onload",s.ready);var t=!1;try{t=null==e.frameElement}catch(e){}j.documentElement.doScroll&&t&&n()}}},isFunction:function(e){return"function"===s.type(e)},isArray:Array.isArray||function(e){return"array"===s.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?String(e):M[_.call(e)]||"object"},isPlainObject:function(e){if(!e||"object"!==s.type(e)||e.nodeType||s.isWindow(e))return!1;try{if(e.constructor&&!S.call(e,"constructor")&&!S.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}var n;for(n in e);return n===t||S.call(e,n)},isEmptyObject:function(e){for(var t in e)return!1;return!0},error:function(e){throw new Error(e)},parseJSON:function(t){return"string"==typeof t&&t?(t=s.trim(t),e.JSON&&e.JSON.parse?e.JSON.parse(t):g.test(t.replace(m,"@").replace(y,"]").replace(v,""))?new Function("return "+t)():void s.error("Invalid JSON: "+t)):null},parseXML:function(n){if("string"!=typeof n||!n)return null;var i,r;try{e.DOMParser?(r=new DOMParser,i=r.parseFromString(n,"text/xml")):(i=new ActiveXObject("Microsoft.XMLDOM"),i.async="false",i.loadXML(n))}catch(e){i=t}return(!i||!i.documentElement||i.getElementsByTagName("parsererror").length)&&s.error("Invalid XML: "+n),i},noop:function(){},globalEval:function(t){t&&d.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(T,E)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toUpperCase()===t.toUpperCase()},each:function(e,n,i){var r,o=0,a=e.length,l=a===t||s.isFunction(e);if(i)if(l){for(r in e)if(!1===n.apply(e[r],i))break}else for(;o<a&&!1!==n.apply(e[o++],i););else if(l){for(r in e)if(!1===n.call(e[r],r,e[r]))break}else for(;o<a&&!1!==n.call(e[o],o,e[o++]););return e},trim:L?function(e){return null==e?"":L.call(e)}:function(e){return null==e?"":(e+"").replace(f,"").replace(p,"")},makeArray:function(e,t){var n=t||[];if(null!=e){var i=s.type(e);null==e.length||"string"===i||"function"===i||"regexp"===i||s.isWindow(e)?A.call(n,e):s.merge(n,e)}return n},inArray:function(e,t,n){var i;if(t){if(F)return F.call(t,e,n);for(i=t.length,n=n?n<0?Math.max(0,i+n):n:0;n<i;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var i=e.length,r=0;if("number"==typeof n.length)for(var o=n.length;r<o;r++)e[i++]=n[r];else for(;n[r]!==t;)e[i++]=n[r++];return e.length=i,e},grep:function(e,t,n){var i,r=[];n=!!n;for(var o=0,a=e.length;o<a;o++)i=!!t(e[o],o),n!==i&&r.push(e[o]);return r},map:function(e,n,i){var r,o,a=[],l=0,u=e.length;if(e instanceof s||u!==t&&"number"==typeof u&&(u>0&&e[0]&&e[u-1]||0===u||s.isArray(e)))for(;l<u;l++)null!=(r=n(e[l],l,i))&&(a[a.length]=r);else for(o in e)null!=(r=n(e[o],o,i))&&(a[a.length]=r);return a.concat.apply([],a)},guid:1,proxy:function(e,n){if("string"==typeof n){var i=e[n];n=e,e=i}if(!s.isFunction(e))return t;var r=$.call(arguments,2),o=function(){return e.apply(n,r.concat($.call(arguments)))};return o.guid=e.guid=e.guid||o.guid||s.guid++,o},access:function(e,n,i,r,o,a,l){var u,c=null==i,d=0,f=e.length;if(i&&"object"==typeof i){for(d in i)s.access(e,n,d,i[d],1,a,r);o=1}else if(r!==t){if(u=l===t&&s.isFunction(r),c&&(u?(u=n,n=function(e,t,n){return u.call(s(e),n)}):(n.call(e,r),n=null)),n)for(;d<f;d++)n(e[d],i,u?r.call(e[d],d,n(e[d],i)):r,l);o=1}return o?e:c?n.call(e):f?n(e[0],i):a},now:function(){return(new Date).getTime()},uaMatch:function(e){e=e.toLowerCase();var t=b.exec(e)||w.exec(e)||x.exec(e)||e.indexOf("compatible")<0&&k.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},sub:function(){function e(t,n){return new e.fn.init(t,n)}s.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(n,i){return i&&i instanceof s&&!(i instanceof e)&&(i=e(i)),s.fn.init.call(this,n,i,t)},e.fn.init.prototype=e.fn;var t=e(j);return e},browser:{}}),s.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){M["[object "+t+"]"]=t.toLowerCase()}),r=s.uaMatch(N),r.browser&&(s.browser[r.browser]=!0,s.browser.version=r.version),s.browser.webkit&&(s.browser.safari=!0),d.test("\xa0")&&(f=/^[\s\xA0]+/,p=/[\s\xA0]+$/),i=s(j),j.addEventListener?a=function(){j.removeEventListener("DOMContentLoaded",a,!1),s.ready()}:j.attachEvent&&(a=function(){"complete"===j.readyState&&(j.detachEvent("onreadystatechange",a),s.ready())}),s}(),O={};M.Callbacks=function(e){e=e?O[e]||L(e):{};var n,i,r,o,a,s,l=[],u=[],c=function(t){var n,i,r,o;for(n=0,i=t.length;n<i;n++)r=t[n],o=M.type(r),"array"===o?c(r):"function"===o&&(!e.unique||!f.has(r))&&l.push(r)},d=function(t,c){for(c=c||[],n=!e.memory||[t,c],i=!0,r=!0,s=o||0,o=0,a=l.length;l&&s<a;s++)if(!1===l[s].apply(t,c)&&e.stopOnFalse){n=!0;break}r=!1,l&&(e.once?!0===n?f.disable():l=[]:u&&u.length&&(n=u.shift(),f.fireWith(n[0],n[1])))},f={add:function(){if(l){var e=l.length;c(arguments),r?a=l.length:n&&!0!==n&&(o=e,d(n[0],n[1]))}return this},remove:function(){if(l)for(var t=arguments,n=0,i=t.length;n<i;n++)for(var o=0;o<l.length&&(t[n]!==l[o]||(r&&o<=a&&(a--,o<=s&&s--),l.splice(o--,1),!e.unique));o++);return this},has:function(e){if(l)for(var t=0,n=l.length;t<n;t++)if(e===l[t])return!0;return!1},empty:function(){return l=[],this},disable:function(){return l=u=n=t,this},disabled:function(){return!l},lock:function(){return u=t,(!n||!0===n)&&f.disable(),this},locked:function(){return!u},fireWith:function(t,i){return u&&(r?e.once||u.push([t,i]):(!e.once||!n)&&d(t,i)),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!i}};return f};var P=[].slice;M.extend({Deferred:function(e){var t,n=M.Callbacks("once memory"),i=M.Callbacks("once memory"),r=M.Callbacks("memory"),o="pending",a={resolve:n,reject:i,notify:r},s={done:n.add,fail:i.add,progress:r.add,state:function(){return o},isResolved:n.fired,isRejected:i.fired,then:function(e,t,n){return l.done(e).fail(t).progress(n),this},always:function(){return l.done.apply(l,arguments).fail.apply(l,arguments),this},pipe:function(e,t,n){return M.Deferred(function(i){M.each({done:[e,"resolve"],fail:[t,"reject"],progress:[n,"notify"]},function(e,t){var n,r=t[0],o=t[1];M.isFunction(r)?l[e](function(){n=r.apply(this,arguments),n&&M.isFunction(n.promise)?n.promise().then(i.resolve,i.reject,i.notify):i[o+"With"](this===l?i:this,[n])}):l[e](i[o])})}).promise()},promise:function(e){if(null==e)e=s;else for(var t in s)e[t]=s[t];return e}},l=s.promise({});for(t in a)l[t]=a[t].fire,l[t+"With"]=a[t].fireWith;return l.done(function(){o="resolved"},i.disable,r.lock).fail(function(){o="rejected"},n.disable,r.lock),e&&e.call(l,l),l},when:function(e){function t(e){return function(t){a[e]=arguments.length>1?P.call(arguments,0):t,l.notifyWith(u,a)}}function n(e){return function(t){i[e]=arguments.length>1?P.call(arguments,0):t,--s||l.resolveWith(l,i)}}var i=P.call(arguments,0),r=0,o=i.length,a=Array(o),s=o,l=o<=1&&e&&M.isFunction(e.promise)?e:M.Deferred(),u=l.promise();if(o>1){for(;r<o;r++)i[r]&&i[r].promise&&M.isFunction(i[r].promise)?i[r].promise().then(n(r),l.reject,t(r)):--s;s||l.resolveWith(l,i)}else l!==e&&l.resolveWith(l,o?[e]:[]);return u}}),M.support=function(){var t,n,i,r,o,a,s,l,u,c,d,f=j.createElement("div");j.documentElement;if(f.setAttribute("className","t"),f.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",n=f.getElementsByTagName("*"),i=f.getElementsByTagName("a")[0],!n||!n.length||!i)return{};r=j.createElement("select"),o=r.appendChild(j.createElement("option")),a=f.getElementsByTagName("input")[0],t={leadingWhitespace:3===f.firstChild.nodeType,tbody:!f.getElementsByTagName("tbody").length,htmlSerialize:!!f.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.55/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:"on"===a.value,optSelected:o.selected,getSetAttribute:"t"!==f.className,enctype:!!j.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==j.createElement("nav").cloneNode(!0).outerHTML,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},M.boxModel=t.boxModel="CSS1Compat"===j.compatMode,a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,r.disabled=!0,t.optDisabled=!o.disabled;try{delete f.test}catch(e){t.deleteExpando=!1}if(!f.addEventListener&&f.attachEvent&&f.fireEvent&&(f.attachEvent("onclick",function(){t.noCloneEvent=!1}),f.cloneNode(!0).fireEvent("onclick")),a=j.createElement("input"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","checked"),a.setAttribute("name","t"),f.appendChild(a),s=j.createDocumentFragment(),s.appendChild(f.lastChild),t.checkClone=s.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=a.checked,s.removeChild(a),s.appendChild(f),f.attachEvent)for(c in{submit:1,change:1,focusin:1})u="on"+c,d=u in f,d||(f.setAttribute(u,"return;"),d="function"==typeof f[u]),t[c+"Bubbles"]=d;return s.removeChild(f),s=r=o=f=a=null,M(function(){var n,i,r,o,a,s,u,c,p,h,g,m,y=j.getElementsByTagName("body")[0];!y||(u=1,m="padding:0;margin:0;border:",h="position:absolute;top:0;left:0;width:1px;height:1px;",g=m+"0;visibility:hidden;",c="style='"+h+m+"5px solid #000;",p="<div "+c+"display:block;'><div style='"+m+"0;display:block;overflow:hidden;'></div></div><table "+c+"' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>",n=j.createElement("div"),n.style.cssText=g+"width:0;height:0;position:static;top:0;margin-top:"+u+"px",y.insertBefore(n,y.firstChild),f=j.createElement("div"),n.appendChild(f),f.innerHTML="<table><tr><td style='"+m+"0;display:none'></td><td>t</td></tr></table>",l=f.getElementsByTagName("td"),d=0===l[0].offsetHeight,l[0].style.display="",l[1].style.display="none",t.reliableHiddenOffsets=d&&0===l[0].offsetHeight,e.getComputedStyle&&(f.innerHTML="",s=j.createElement("div"),s.style.width="0",s.style.marginRight="0",f.style.width="2px",f.appendChild(s),t.reliableMarginRight=0===(parseInt((e.getComputedStyle(s,null)||{marginRight:0}).marginRight,10)||0)),"undefined"!=typeof f.style.zoom&&(f.innerHTML="",f.style.width=f.style.padding="1px",f.style.border=0,f.style.overflow="hidden",f.style.display="inline",f.style.zoom=1,t.inlineBlockNeedsLayout=3===f.offsetWidth,f.style.display="block",f.style.overflow="visible",f.innerHTML="<div style='width:5px;'></div>",t.shrinkWrapBlocks=3!==f.offsetWidth),f.style.cssText=h+g,f.innerHTML=p,i=f.firstChild,r=i.firstChild,o=i.nextSibling.firstChild.firstChild,a={doesNotAddBorder:5!==r.offsetTop,doesAddBorderForTableAndCells:5===o.offsetTop},r.style.position="fixed",r.style.top="20px",a.fixedPosition=20===r.offsetTop||15===r.offsetTop,r.style.position=r.style.top="",i.style.overflow="hidden",i.style.position="relative",a.subtractsBorderForOverflowNotVisible=-5===r.offsetTop,a.doesNotIncludeMarginInBodyOffset=y.offsetTop!==u,e.getComputedStyle&&(f.style.marginTop="1%",t.pixelMargin="1%"!==(e.getComputedStyle(f,null)||{marginTop:0}).marginTop),"undefined"!=typeof n.style.zoom&&(n.style.zoom=1),y.removeChild(n),s=f=n=null,M.extend(t,a))}),t}();var H=/^(?:\{.*\}|\[.*\])$/,z=/([A-Z])/g;M.extend({cache:{},uuid:0,expando:"jQuery"+(M.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return!!(e=e.nodeType?M.cache[e[M.expando]]:e[M.expando])&&!A(e)},data:function(e,n,i,r){if(M.acceptData(e)){var o,a,s,l=M.expando,u="string"==typeof n,c=e.nodeType,d=c?M.cache:e,f=c?e[l]:e[l]&&l,p="events"===n;if((!f||!d[f]||!p&&!r&&!d[f].data)&&u&&i===t)return;return f||(c?e[l]=f=++M.uuid:f=l),d[f]||(d[f]={},c||(d[f].toJSON=M.noop)),("object"!=typeof n&&"function"!=typeof n||(r?d[f]=M.extend(d[f],n):d[f].data=M.extend(d[f].data,n)),o=a=d[f],r||(a.data||(a.data={}),a=a.data),i!==t&&(a[M.camelCase(n)]=i),p&&!a[n])?o.events:(u?null==(s=a[n])&&(s=a[M.camelCase(n)]):s=a,s)}},removeData:function(e,t,n){if(M.acceptData(e)){var i,r,o,a=M.expando,s=e.nodeType,l=s?M.cache:e,u=s?e[a]:a;if(!l[u])return;if(t&&(i=n?l[u]:l[u].data)){M.isArray(t)||(t in i?t=[t]:(t=M.camelCase(t),t=t in i?[t]:t.split(" ")));for(r=0,o=t.length;r<o;r++)delete i[t[r]];if(!(n?A:M.isEmptyObject)(i))return}if(!n&&(delete l[u].data,!A(l[u])))return;M.support.deleteExpando||!l.setInterval?delete l[u]:l[u]=null,s&&(M.support.deleteExpando?delete e[a]:e.removeAttribute?e.removeAttribute(a):e[a]=null)}},_data:function(e,t,n){return M.data(e,t,n,!0)},acceptData:function(e){if(e.nodeName){var t=M.noData[e.nodeName.toLowerCase()];if(t)return!0!==t&&e.getAttribute("classid")===t}return!0}}),M.fn.extend({data:function(e,n){var i,r,o,a,s,l=this[0],u=0,c=null;if(e===t){if(this.length&&(c=M.data(l),1===l.nodeType&&!M._data(l,"parsedAttrs"))){for(o=l.attributes,s=o.length;u<s;u++)a=o[u].name,0===a.indexOf("data-")&&(a=M.camelCase(a.substring(5)),$(l,a,c[a]));M._data(l,"parsedAttrs",!0)}return c}return"object"==typeof e?this.each(function(){M.data(this,e)}):(i=e.split(".",2),i[1]=i[1]?"."+i[1]:"",r=i[1]+"!",M.access(this,function(n){if(n===t)return(c=this.triggerHandler("getData"+r,[i[0]]))===t&&l&&(c=M.data(l,e),c=$(l,e,c)),c===t&&i[1]?this.data(i[0]):c;i[1]=n,this.each(function(){var t=M(this);t.triggerHandler("setData"+r,i),M.data(this,e,n),t.triggerHandler("changeData"+r,i)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){M.removeData(this,e)})}}),M.extend({_mark:function(e,t){e&&(t=(t||"fx")+"mark",M._data(e,t,(M._data(e,t)||0)+1))},_unmark:function(e,t,n){if(!0!==e&&(n=t,t=e,e=!1),t){n=n||"fx";var i=n+"mark",r=e?0:(M._data(t,i)||1)-1;r?M._data(t,i,r):(M.removeData(t,i,!0),S(t,n,"mark"))}},queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=M._data(e,t),n&&(!i||M.isArray(n)?i=M._data(e,t,M.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=M.queue(e,t),i=n.shift(),r={};"inprogress"===i&&(i=n.shift()),i&&("fx"===t&&n.unshift("inprogress"),M._data(e,t+".run",r),i.call(e,function(){M.dequeue(e,t)},r)),n.length||(M.removeData(e,t+"queue "+t+".run",!0),S(e,t,"queue"))}}),M.fn.extend({queue:function(e,n){var i=2;return"string"!=typeof e&&(n=e,e="fx",i--),arguments.length<i?M.queue(this[0],e):n===t?this:this.each(function(){var t=M.queue(this,e,n);"fx"===e&&"inprogress"!==t[0]&&M.dequeue(this,e)})},dequeue:function(e){return this.each(function(){M.dequeue(this,e)})},delay:function(e,t){return e=M.fx?M.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var i=setTimeout(t,e);n.stop=function(){clearTimeout(i)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){function i(){--l||o.resolveWith(a,[a])}"string"!=typeof e&&(n=e,e=t),e=e||"fx";for(var r,o=M.Deferred(),a=this,s=a.length,l=1,u=e+"defer",c=e+"queue",d=e+"mark";s--;)(r=M.data(a[s],u,t,!0)||(M.data(a[s],c,t,!0)||M.data(a[s],d,t,!0))&&M.data(a[s],u,M.Callbacks("once memory"),!0))&&(l++,r.add(i));return i(),o.promise(n)}});var q,B,R,I=/[\n\t\r]/g,W=/\s+/,X=/\r/g,U=/^(?:button|input)$/i,V=/^(?:button|input|object|select|textarea)$/i,K=/^a(?:rea)?$/i,G=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,J=M.support.getSetAttribute;M.fn.extend({attr:function(e,t){return M.access(this,M.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){M.removeAttr(this,e)})},prop:function(e,t){return M.access(this,M.prop,e,t,arguments.length>1)},removeProp:function(e){return e=M.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(e){}})},addClass:function(e){var t,n,i,r,o,a,s;if(M.isFunction(e))return this.each(function(t){M(this).addClass(e.call(this,t,this.className))});if(e&&"string"==typeof e)for(t=e.split(W),n=0,i=this.length;n<i;n++)if(r=this[n],1===r.nodeType)if(r.className||1!==t.length){for(o=" "+r.className+" ",a=0,s=t.length;a<s;a++)~o.indexOf(" "+t[a]+" ")||(o+=t[a]+" ");r.className=M.trim(o)}else r.className=e;return this},removeClass:function(e){var n,i,r,o,a,s,l;if(M.isFunction(e))return this.each(function(t){M(this).removeClass(e.call(this,t,this.className))});if(e&&"string"==typeof e||e===t)for(n=(e||"").split(W),i=0,r=this.length;i<r;i++)if(o=this[i],1===o.nodeType&&o.className)if(e){for(a=(" "+o.className+" ").replace(I," "),s=0,l=n.length;s<l;s++)a=a.replace(" "+n[s]+" "," ");o.className=M.trim(a)}else o.className="";return this},toggleClass:function(e,t){var n=typeof e,i="boolean"==typeof t;return M.isFunction(e)?this.each(function(n){M(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var r,o=0,a=M(this),s=t,l=e.split(W);r=l[o++];)s=i?s:!a.hasClass(r),a[s?"addClass":"removeClass"](r);else"undefined"!==n&&"boolean"!==n||(this.className&&M._data(this,"__className__",this.className),this.className=this.className||!1===e?"":M._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,i=this.length;n<i;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(I," ").indexOf(t)>-1)return!0;return!1},val:function(e){var n,i,r,o=this[0];return arguments.length?(r=M.isFunction(e),this.each(function(i){var o,a=M(this);1===this.nodeType&&(o=r?e.call(this,i,a.val()):e,null==o?o="":"number"==typeof o?o+="":M.isArray(o)&&(o=M.map(o,function(e){return null==e?"":e+""})),n=M.valHooks[this.type]||M.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))})):o?(n=M.valHooks[o.type]||M.valHooks[o.nodeName.toLowerCase()])&&"get"in n&&(i=n.get(o,"value"))!==t?i:(i=o.value,"string"==typeof i?i.replace(X,""):null==i?"":i):void 0}}),M.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,i,r,o=e.selectedIndex,a=[],s=e.options,l="select-one"===e.type;if(o<0)return null;for(n=l?o:0,i=l?o+1:s.length;n<i;n++)if(r=s[n],r.selected&&(M.support.optDisabled?!r.disabled:null===r.getAttribute("disabled"))&&(!r.parentNode.disabled||!M.nodeName(r.parentNode,"optgroup"))){if(t=M(r).val(),l)return t;a.push(t)}return l&&!a.length&&s.length?M(s[o]).val():a},set:function(e,t){var n=M.makeArray(t);return M(e).find("option").each(function(){this.selected=M.inArray(M(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(e,n,i,r){var o,a,s,l=e.nodeType;if(e&&3!==l&&8!==l&&2!==l)return r&&n in M.attrFn?M(e)[n](i):"undefined"==typeof e.getAttribute?M.prop(e,n,i):((s=1!==l||!M.isXMLDoc(e))&&(n=n.toLowerCase(),a=M.attrHooks[n]||(G.test(n)?B:q)),i!==t?null===i?void M.removeAttr(e,n):a&&"set"in a&&s&&(o=a.set(e,i,n))!==t?o:(e.setAttribute(n,""+i),i):a&&"get"in a&&s&&null!==(o=a.get(e,n))?o:(o=e.getAttribute(n),null===o?t:o))},removeAttr:function(e,t){var n,i,r,o,a,s=0;if(t&&1===e.nodeType)for(i=t.toLowerCase().split(W),o=i.length;s<o;s++)(r=i[s])&&(n=M.propFix[r]||r,a=G.test(r),a||M.attr(e,r,""),e.removeAttribute(J?r:n),a&&n in e&&(e[n]=!1))},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)M.error("type property can't be changed");else if(!M.support.radioValue&&"radio"===t&&M.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return q&&M.nodeName(e,"button")?q.get(e,t):t in e?e.value:null},set:function(e,t,n){if(q&&M.nodeName(e,"button"))return q.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,i){var r,o,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a)return(1!==a||!M.isXMLDoc(e))&&(n=M.propFix[n]||n,o=M.propHooks[n]),i!==t?o&&"set"in o&&(r=o.set(e,i,n))!==t?r:e[n]=i:o&&"get"in o&&null!==(r=o.get(e,n))?r:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||K.test(e.nodeName)&&e.href?0:t}}}}),
2
2
  M.attrHooks.tabindex=M.propHooks.tabIndex,B={get:function(e,n){var i,r=M.prop(e,n);return!0===r||"boolean"!=typeof r&&(i=e.getAttributeNode(n))&&!1!==i.nodeValue?n.toLowerCase():t},set:function(e,t,n){var i;return!1===t?M.removeAttr(e,n):(i=M.propFix[n]||n,i in e&&(e[i]=!0),e.setAttribute(n,n.toLowerCase())),n}},J||(R={name:!0,id:!0,coords:!0},q=M.valHooks.button={get:function(e,n){var i;return i=e.getAttributeNode(n),i&&(R[n]?""!==i.nodeValue:i.specified)?i.nodeValue:t},set:function(e,t,n){var i=e.getAttributeNode(n);return i||(i=j.createAttribute(n),e.setAttributeNode(i)),i.nodeValue=t+""}},M.attrHooks.tabindex.set=q.set,M.each(["width","height"],function(e,t){M.attrHooks[t]=M.extend(M.attrHooks[t],{set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}})}),M.attrHooks.contenteditable={get:q.get,set:function(e,t,n){""===t&&(t="false"),q.set(e,t,n)}}),M.support.hrefNormalized||M.each(["href","src","width","height"],function(e,n){M.attrHooks[n]=M.extend(M.attrHooks[n],{get:function(e){var i=e.getAttribute(n,2);return null===i?t:i}})}),M.support.style||(M.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=""+t}}),M.support.optSelected||(M.propHooks.selected=M.extend(M.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),M.support.enctype||(M.propFix.enctype="encoding"),M.support.checkOn||M.each(["radio","checkbox"],function(){M.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),M.each(["radio","checkbox"],function(){M.valHooks[this]=M.extend(M.valHooks[this],{set:function(e,t){if(M.isArray(t))return e.checked=M.inArray(M(e).val(),t)>=0}})});var Y=/^(?:textarea|input|select)$/i,Q=/^([^\.]*)?(?:\.(.+))?$/,Z=/(?:^|\s)hover(\.\S+)?\b/,ee=/^key/,te=/^(?:mouse|contextmenu)|click/,ne=/^(?:focusinfocus|focusoutblur)$/,ie=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,re=function(e){var t=ie.exec(e);return t&&(t[1]=(t[1]||"").toLowerCase(),t[3]=t[3]&&new RegExp("(?:^|\\s)"+t[3]+"(?:\\s|$)")),t},oe=function(e,t){var n=e.attributes||{};return(!t[1]||e.nodeName.toLowerCase()===t[1])&&(!t[2]||(n.id||{}).value===t[2])&&(!t[3]||t[3].test((n["class"]||{}).value))},ae=function(e){return M.event.special.hover?e:e.replace(Z,"mouseenter$1 mouseleave$1")};M.event={add:function(e,n,i,r,o){var a,s,l,u,c,d,f,p,h,g,m;if(3!==e.nodeType&&8!==e.nodeType&&n&&i&&(a=M._data(e))){for(i.handler&&(h=i,i=h.handler,o=h.selector),i.guid||(i.guid=M.guid++),l=a.events,l||(a.events=l={}),s=a.handle,s||(a.handle=s=function(e){return void 0===M||e&&M.event.triggered===e.type?t:M.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=M.trim(ae(n)).split(" "),u=0;u<n.length;u++)c=Q.exec(n[u])||[],d=c[1],f=(c[2]||"").split(".").sort(),m=M.event.special[d]||{},d=(o?m.delegateType:m.bindType)||d,m=M.event.special[d]||{},p=M.extend({type:d,origType:c[1],data:r,handler:i,guid:i.guid,selector:o,quick:o&&re(o),namespace:f.join(".")},h),g=l[d],g||(g=l[d]=[],g.delegateCount=0,m.setup&&!1!==m.setup.call(e,r,f,s)||(e.addEventListener?e.addEventListener(d,s,!1):e.attachEvent&&e.attachEvent("on"+d,s))),m.add&&(m.add.call(e,p),p.handler.guid||(p.handler.guid=i.guid)),o?g.splice(g.delegateCount++,0,p):g.push(p),M.event.global[d]=!0;e=null}},global:{},remove:function(e,t,n,i,r){var o,a,s,l,u,c,d,f,p,h,g,m,y=M.hasData(e)&&M._data(e);if(y&&(f=y.events)){for(t=M.trim(ae(t||"")).split(" "),o=0;o<t.length;o++)if(a=Q.exec(t[o])||[],s=l=a[1],u=a[2],s){for(p=M.event.special[s]||{},s=(i?p.delegateType:p.bindType)||s,g=f[s]||[],c=g.length,u=u?new RegExp("(^|\\.)"+u.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null,d=0;d<g.length;d++)m=g[d],(r||l===m.origType)&&(!n||n.guid===m.guid)&&(!u||u.test(m.namespace))&&(!i||i===m.selector||"**"===i&&m.selector)&&(g.splice(d--,1),m.selector&&g.delegateCount--,p.remove&&p.remove.call(e,m));0===g.length&&c!==g.length&&((!p.teardown||!1===p.teardown.call(e,u))&&M.removeEvent(e,s,y.handle),delete f[s])}else for(s in f)M.event.remove(e,s+t[o],n,i,!0);M.isEmptyObject(f)&&(h=y.handle,h&&(h.elem=null),M.removeData(e,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,i,r,o){if(!r||3!==r.nodeType&&8!==r.nodeType){var a,s,l,u,c,d,f,p,h,g,m=n.type||n,y=[];if(ne.test(m+M.event.triggered))return;if(m.indexOf("!")>=0&&(m=m.slice(0,-1),s=!0),m.indexOf(".")>=0&&(y=m.split("."),m=y.shift(),y.sort()),(!r||M.event.customEvent[m])&&!M.event.global[m])return;if(n="object"==typeof n?n[M.expando]?n:new M.Event(m,n):new M.Event(m),n.type=m,n.isTrigger=!0,n.exclusive=s,n.namespace=y.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,d=m.indexOf(":")<0?"on"+m:"",!r){a=M.cache;for(l in a)a[l].events&&a[l].events[m]&&M.event.trigger(n,i,a[l].handle.elem,!0);return}if(n.result=t,n.target||(n.target=r),i=null!=i?M.makeArray(i):[],i.unshift(n),f=M.event.special[m]||{},f.trigger&&!1===f.trigger.apply(r,i))return;if(h=[[r,f.bindType||m]],!o&&!f.noBubble&&!M.isWindow(r)){for(g=f.delegateType||m,u=ne.test(g+m)?r:r.parentNode,c=null;u;u=u.parentNode)h.push([u,g]),c=u;c&&c===r.ownerDocument&&h.push([c.defaultView||c.parentWindow||e,g])}for(l=0;l<h.length&&!n.isPropagationStopped();l++)u=h[l][0],n.type=h[l][1],p=(M._data(u,"events")||{})[n.type]&&M._data(u,"handle"),p&&p.apply(u,i),(p=d&&u[d])&&M.acceptData(u)&&!1===p.apply(u,i)&&n.preventDefault();return n.type=m,!o&&!n.isDefaultPrevented()&&(!f._default||!1===f._default.apply(r.ownerDocument,i))&&("click"!==m||!M.nodeName(r,"a"))&&M.acceptData(r)&&d&&r[m]&&("focus"!==m&&"blur"!==m||0!==n.target.offsetWidth)&&!M.isWindow(r)&&(c=r[d],c&&(r[d]=null),M.event.triggered=m,r[m](),M.event.triggered=t,c&&(r[d]=c)),n.result}},dispatch:function(n){n=M.event.fix(n||e.event);var i,r,o,a,s,l,u,c,d,f,p=(M._data(this,"events")||{})[n.type]||[],h=p.delegateCount,g=[].slice.call(arguments,0),m=!n.exclusive&&!n.namespace,y=M.event.special[n.type]||{},v=[];if(g[0]=n,n.delegateTarget=this,!y.preDispatch||!1!==y.preDispatch.call(this,n)){if(h&&(!n.button||"click"!==n.type))for(a=M(this),a.context=this.ownerDocument||this,o=n.target;o!=this;o=o.parentNode||this)if(!0!==o.disabled){for(l={},c=[],a[0]=o,i=0;i<h;i++)d=p[i],f=d.selector,l[f]===t&&(l[f]=d.quick?oe(o,d.quick):a.is(f)),l[f]&&c.push(d);c.length&&v.push({elem:o,matches:c})}for(p.length>h&&v.push({elem:this,matches:p.slice(h)}),i=0;i<v.length&&!n.isPropagationStopped();i++)for(u=v[i],n.currentTarget=u.elem,r=0;r<u.matches.length&&!n.isImmediatePropagationStopped();r++)d=u.matches[r],(m||!n.namespace&&!d.namespace||n.namespace_re&&n.namespace_re.test(d.namespace))&&(n.data=d.data,n.handleObj=d,(s=((M.event.special[d.origType]||{}).handle||d.handler).apply(u.elem,g))!==t&&(n.result=s,!1===s&&(n.preventDefault(),n.stopPropagation())));return y.postDispatch&&y.postDispatch.call(this,n),n.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var i,r,o,a=n.button,s=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||j,r=i.documentElement,o=i.body,e.pageX=n.clientX+(r&&r.scrollLeft||o&&o.scrollLeft||0)-(r&&r.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(r&&r.scrollTop||o&&o.scrollTop||0)-(r&&r.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?n.toElement:s),!e.which&&a!==t&&(e.which=1&a?1:2&a?3:4&a?2:0),e}},fix:function(e){if(e[M.expando])return e;var n,i,r=e,o=M.event.fixHooks[e.type]||{},a=o.props?this.props.concat(o.props):this.props;for(e=M.Event(r),n=a.length;n;)i=a[--n],e[i]=r[i];return e.target||(e.target=r.srcElement||j),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey===t&&(e.metaKey=e.ctrlKey),o.filter?o.filter(e,r):e},special:{ready:{setup:M.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){M.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,i){var r=M.extend(new M.Event,n,{type:e,isSimulated:!0,originalEvent:{}});i?M.event.trigger(r,null,t):M.event.dispatch.call(t,r),r.isDefaultPrevented()&&n.preventDefault()}},M.event.handle=M.event.dispatch,M.removeEvent=j.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){e.detachEvent&&e.detachEvent("on"+t,n)},M.Event=function(e,t){if(!(this instanceof M.Event))return new M.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||!1===e.returnValue||e.getPreventDefault&&e.getPreventDefault()?N:_):this.type=e,t&&M.extend(this,t),this.timeStamp=e&&e.timeStamp||M.now(),this[M.expando]=!0},M.Event.prototype={preventDefault:function(){this.isDefaultPrevented=N;var e=this.originalEvent;!e||(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=N;var e=this.originalEvent;!e||(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=N,this.stopPropagation()},isDefaultPrevented:_,isPropagationStopped:_,isImmediatePropagationStopped:_},M.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){M.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,i=this,r=e.relatedTarget,o=e.handleObj;o.selector;return r&&(r===i||M.contains(i,r))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),M.support.submitBubbles||(M.event.special.submit={setup:function(){if(M.nodeName(this,"form"))return!1;M.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,i=M.nodeName(n,"input")||M.nodeName(n,"button")?n.form:t;i&&!i._submit_attached&&(M.event.add(i,"submit._submit",function(e){e._submit_bubble=!0}),i._submit_attached=!0)})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&M.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(M.nodeName(this,"form"))return!1;M.event.remove(this,"._submit")}}),M.support.changeBubbles||(M.event.special.change={setup:function(){if(Y.test(this.nodeName))return"checkbox"!==this.type&&"radio"!==this.type||(M.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),M.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1,M.event.simulate("change",this,e,!0))})),!1;M.event.add(this,"beforeactivate._change",function(e){var t=e.target;Y.test(t.nodeName)&&!t._change_attached&&(M.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&M.event.simulate("change",this.parentNode,e,!0)}),t._change_attached=!0)})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type)return e.handleObj.handler.apply(this,arguments)},teardown:function(){return M.event.remove(this,"._change"),Y.test(this.nodeName)}}),M.support.focusinBubbles||M.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,i=function(e){M.event.simulate(t,e.target,M.event.fix(e),!0)};M.event.special[t]={setup:function(){0==n++&&j.addEventListener(e,i,!0)},teardown:function(){0==--n&&j.removeEventListener(e,i,!0)}}}),M.fn.extend({on:function(e,n,i,r,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(i=i||n,n=t);for(s in e)this.on(s,n,i,e[s],o);return this}if(null==i&&null==r?(r=n,i=n=t):null==r&&("string"==typeof n?(r=i,i=t):(r=i,i=n,n=t)),!1===r)r=_;else if(!r)return this;return 1===o&&(a=r,r=function(e){return M().off(e),a.apply(this,arguments)},r.guid=a.guid||(a.guid=M.guid++)),this.each(function(){M.event.add(this,e,r,i,n)})},one:function(e,t,n,i){return this.on(e,t,n,i,1)},off:function(e,n,i){if(e&&e.preventDefault&&e.handleObj){var r=e.handleObj;return M(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this}if("object"==typeof e){for(var o in e)this.off(o,n,e[o]);return this}return!1!==n&&"function"!=typeof n||(i=n,n=t),!1===i&&(i=_),this.each(function(){M.event.remove(this,e,i,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return M(this.context).on(e,this.selector,t,n),this},die:function(e,t){return M(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1==arguments.length?this.off(e,"**"):this.off(t,e,n)},trigger:function(e,t){return this.each(function(){M.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return M.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||M.guid++,i=0,r=function(n){var r=(M._data(this,"lastToggle"+e.guid)||0)%i;return M._data(this,"lastToggle"+e.guid,r+1),n.preventDefault(),t[r].apply(this,arguments)||!1};for(r.guid=n;i<t.length;)t[i++].guid=n;return this.click(r)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),M.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){M.fn[t]=function(e,n){return null==n&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},M.attrFn&&(M.attrFn[t]=!0),ee.test(t)&&(M.event.fixHooks[t]=M.event.keyHooks),te.test(t)&&(M.event.fixHooks[t]=M.event.mouseHooks)}),function(){function e(e,t,n,i,o,a){for(var s=0,l=i.length;s<l;s++){var u=i[s];if(u){var c=!1;for(u=u[e];u;){if(u[r]===n){c=i[u.sizset];break}if(1===u.nodeType)if(a||(u[r]=n,u.sizset=s),"string"!=typeof t){if(u===t){c=!0;break}}else if(f.filter(t,[u]).length>0){c=u;break}u=u[e]}i[s]=c}}}function n(e,t,n,i,o,a){for(var s=0,l=i.length;s<l;s++){var u=i[s];if(u){var c=!1;for(u=u[e];u;){if(u[r]===n){c=i[u.sizset];break}if(1===u.nodeType&&!a&&(u[r]=n,u.sizset=s),u.nodeName.toLowerCase()===t){c=u;break}u=u[e]}i[s]=c}}}var i=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,r="sizcache"+(Math.random()+"").replace(".",""),o=0,a=Object.prototype.toString,s=!1,l=!0,u=/\\/g,c=/\r\n/g,d=/\W/;[0,0].sort(function(){return l=!1,0});var f=function(e,t,n,r){n=n||[],t=t||j;var o=t;if(1!==t.nodeType&&9!==t.nodeType)return[];if(!e||"string"!=typeof e)return n;var s,l,u,c,d,p,m,y,b=!0,w=f.isXML(t),k=[],T=e;do{if(i.exec(""),(s=i.exec(T))&&(T=s[3],k.push(s[1]),s[2])){c=s[3];break}}while(s);if(k.length>1&&g.exec(e))if(2===k.length&&h.relative[k[0]])l=x(k[0]+k[1],t,r);else for(l=h.relative[k[0]]?[t]:f(k.shift(),t);k.length;)e=k.shift(),h.relative[e]&&(e+=k.shift()),l=x(e,l,r);else if(!r&&k.length>1&&9===t.nodeType&&!w&&h.match.ID.test(k[0])&&!h.match.ID.test(k[k.length-1])&&(d=f.find(k.shift(),t,w),t=d.expr?f.filter(d.expr,d.set)[0]:d.set[0]),t)for(d=r?{expr:k.pop(),set:v(r)}:f.find(k.pop(),1!==k.length||"~"!==k[0]&&"+"!==k[0]||!t.parentNode?t:t.parentNode,w),l=d.expr?f.filter(d.expr,d.set):d.set,k.length>0?u=v(l):b=!1;k.length;)p=k.pop(),m=p,h.relative[p]?m=k.pop():p="",null==m&&(m=t),h.relative[p](u,m,w);else u=k=[];if(u||(u=l),u||f.error(p||e),"[object Array]"===a.call(u))if(b)if(t&&1===t.nodeType)for(y=0;null!=u[y];y++)u[y]&&(!0===u[y]||1===u[y].nodeType&&f.contains(t,u[y]))&&n.push(l[y]);else for(y=0;null!=u[y];y++)u[y]&&1===u[y].nodeType&&n.push(l[y]);else n.push.apply(n,u);else v(u,n);return c&&(f(c,o,n,r),f.uniqueSort(n)),n};f.uniqueSort=function(e){if(b&&(s=l,e.sort(b),s))for(var t=1;t<e.length;t++)e[t]===e[t-1]&&e.splice(t--,1);return e},f.matches=function(e,t){return f(e,null,null,t)},f.matchesSelector=function(e,t){return f(t,null,null,[e]).length>0},f.find=function(e,t,n){var i,r,o,a,s,l;if(!e)return[];for(r=0,o=h.order.length;r<o;r++)if(s=h.order[r],(a=h.leftMatch[s].exec(e))&&(l=a[1],a.splice(1,1),"\\"!==l.substr(l.length-1)&&(a[1]=(a[1]||"").replace(u,""),null!=(i=h.find[s](a,t,n))))){e=e.replace(h.match[s],"");break}return i||(i="undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName("*"):[]),{set:i,expr:e}},f.filter=function(e,n,i,r){for(var o,a,s,l,u,c,d,p,g,m=e,y=[],v=n,b=n&&n[0]&&f.isXML(n[0]);e&&n.length;){for(s in h.filter)if(null!=(o=h.leftMatch[s].exec(e))&&o[2]){if(c=h.filter[s],d=o[1],a=!1,o.splice(1,1),"\\"===d.substr(d.length-1))continue;if(v===y&&(y=[]),h.preFilter[s])if(o=h.preFilter[s](o,v,i,y,r,b)){if(!0===o)continue}else a=l=!0;if(o)for(p=0;null!=(u=v[p]);p++)u&&(l=c(u,o,p,v),g=r^l,i&&null!=l?g?a=!0:v[p]=!1:g&&(y.push(u),a=!0));if(l!==t){if(i||(v=y),e=e.replace(h.match[s],""),!a)return[];break}}if(e===m){if(null!=a)break;f.error(e)}m=e}return v},f.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)};var p=f.getText=function(e){var t,n,i=e.nodeType,r="";if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;if("string"==typeof e.innerText)return e.innerText.replace(c,"");for(e=e.firstChild;e;e=e.nextSibling)r+=p(e)}else if(3===i||4===i)return e.nodeValue}else for(t=0;n=e[t];t++)8!==n.nodeType&&(r+=p(n));return r},h=f.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")},type:function(e){return e.getAttribute("type")}},relative:{"+":function(e,t){var n="string"==typeof t,i=n&&!d.test(t),r=n&&!i;i&&(t=t.toLowerCase());for(var o,a=0,s=e.length;a<s;a++)if(o=e[a]){for(;(o=o.previousSibling)&&1!==o.nodeType;);e[a]=r||o&&o.nodeName.toLowerCase()===t?o||!1:o===t}r&&f.filter(t,e,!0)},">":function(e,t){var n,i="string"==typeof t,r=0,o=e.length;if(i&&!d.test(t)){for(t=t.toLowerCase();r<o;r++)if(n=e[r]){var a=n.parentNode;e[r]=a.nodeName.toLowerCase()===t&&a}}else{for(;r<o;r++)(n=e[r])&&(e[r]=i?n.parentNode:n.parentNode===t);i&&f.filter(t,e,!0)}},"":function(t,i,r){var a,s=o++,l=e;"string"==typeof i&&!d.test(i)&&(i=i.toLowerCase(),a=i,l=n),l("parentNode",i,s,t,a,r)},"~":function(t,i,r){var a,s=o++,l=e;"string"==typeof i&&!d.test(i)&&(i=i.toLowerCase(),a=i,l=n),l("previousSibling",i,s,t,a,r)}},find:{ID:function(e,t,n){if("undefined"!=typeof t.getElementById&&!n){var i=t.getElementById(e[1]);return i&&i.parentNode?[i]:[]}},NAME:function(e,t){if("undefined"!=typeof t.getElementsByName){for(var n=[],i=t.getElementsByName(e[1]),r=0,o=i.length;r<o;r++)i[r].getAttribute("name")===e[1]&&n.push(i[r]);return 0===n.length?null:n}},TAG:function(e,t){if("undefined"!=typeof t.getElementsByTagName)return t.getElementsByTagName(e[1])}},preFilter:{CLASS:function(e,t,n,i,r,o){if(e=" "+e[1].replace(u,"")+" ",o)return e;for(var a,s=0;null!=(a=t[s]);s++)a&&(r^(a.className&&(" "+a.className+" ").replace(/[\t\n\r]/g," ").indexOf(e)>=0)?n||i.push(a):n&&(t[s]=!1));return!1},ID:function(e){return e[1].replace(u,"")},TAG:function(e){return e[1].replace(u,"").toLowerCase()},CHILD:function(e){if("nth"===e[1]){e[2]||f.error(e[0]),e[2]=e[2].replace(/^\+|\s*/g,"");var t=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even"===e[2]&&"2n"||"odd"===e[2]&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=t[1]+(t[2]||1)-0,e[3]=t[3]-0}else e[2]&&f.error(e[0]);return e[0]=o++,e},ATTR:function(e,t,n,i,r,o){var a=e[1]=e[1].replace(u,"");return!o&&h.attrMap[a]&&(e[1]=h.attrMap[a]),e[4]=(e[4]||e[5]||"").replace(u,""),"~="===e[2]&&(e[4]=" "+e[4]+" "),e},PSEUDO:function(e,t,n,r,o){if("not"===e[1]){if(!((i.exec(e[3])||"").length>1||/^\w/.test(e[3]))){var a=f.filter(e[3],t,n,!0^o);return n||r.push.apply(r,a),!1}e[3]=f(e[3],null,null,t)}else if(h.match.POS.test(e[0])||h.match.CHILD.test(e[0]))return!0;return e},POS:function(e){return e.unshift(!0),e}},filters:{enabled:function(e){return!1===e.disabled&&"hidden"!==e.type},disabled:function(e){return!0===e.disabled},checked:function(e){return!0===e.checked},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},parent:function(e){return!!e.firstChild},empty:function(e){return!e.firstChild},has:function(e,t,n){return!!f(n[3],e).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){var t=e.getAttribute("type"),n=e.type;return"input"===e.nodeName.toLowerCase()&&"text"===n&&(t===n||null===t)},radio:function(e){return"input"===e.nodeName.toLowerCase()&&"radio"===e.type},checkbox:function(e){return"input"===e.nodeName.toLowerCase()&&"checkbox"===e.type},file:function(e){return"input"===e.nodeName.toLowerCase()&&"file"===e.type},password:function(e){return"input"===e.nodeName.toLowerCase()&&"password"===e.type},submit:function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&"submit"===e.type},image:function(e){return"input"===e.nodeName.toLowerCase()&&"image"===e.type},reset:function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&"reset"===e.type},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(e,t){return 0===t},last:function(e,t,n,i){return t===i.length-1},even:function(e,t){return t%2==0},odd:function(e,t){return t%2==1},lt:function(e,t,n){return t<n[3]-0},gt:function(e,t,n){return t>n[3]-0},nth:function(e,t,n){return n[3]-0===t},eq:function(e,t,n){return n[3]-0===t}},filter:{PSEUDO:function(e,t,n,i){var r=t[1],o=h.filters[r];if(o)return o(e,n,t,i);if("contains"===r)return(e.textContent||e.innerText||p([e])||"").indexOf(t[3])>=0;if("not"===r){for(var a=t[3],s=0,l=a.length;s<l;s++)if(a[s]===e)return!1;return!0}f.error(r)},CHILD:function(e,t){var n,i,o,a,s,l,u=t[1],c=e;switch(u){case"only":case"first":for(;c=c.previousSibling;)if(1===c.nodeType)return!1;if("first"===u)return!0;c=e;case"last":for(;c=c.nextSibling;)if(1===c.nodeType)return!1;return!0;case"nth":if(n=t[2],i=t[3],1===n&&0===i)return!0;if(o=t[0],(a=e.parentNode)&&(a[r]!==o||!e.nodeIndex)){for(s=0,c=a.firstChild;c;c=c.nextSibling)1===c.nodeType&&(c.nodeIndex=++s);a[r]=o}return l=e.nodeIndex-i,0===n?0===l:l%n==0&&l/n>=0}},ID:function(e,t){return 1===e.nodeType&&e.getAttribute("id")===t},TAG:function(e,t){return"*"===t&&1===e.nodeType||!!e.nodeName&&e.nodeName.toLowerCase()===t},CLASS:function(e,t){return(" "+(e.className||e.getAttribute("class"))+" ").indexOf(t)>-1},ATTR:function(e,t){var n=t[1],i=f.attr?f.attr(e,n):h.attrHandle[n]?h.attrHandle[n](e):null!=e[n]?e[n]:e.getAttribute(n),r=i+"",o=t[2],a=t[4];return null==i?"!="===o:!o&&f.attr?null!=i:"="===o?r===a:"*="===o?r.indexOf(a)>=0:"~="===o?(" "+r+" ").indexOf(a)>=0:a?"!="===o?r!==a:"^="===o?0===r.indexOf(a):"$="===o?r.substr(r.length-a.length)===a:"|="===o&&(r===a||r.substr(0,a.length+1)===a+"-"):r&&!1!==i},POS:function(e,t,n,i){var r=t[2],o=h.setFilters[r];if(o)return o(e,n,t,i)}}},g=h.match.POS,m=function(e,t){return"\\"+(t-0+1)};for(var y in h.match)h.match[y]=new RegExp(h.match[y].source+/(?![^\[]*\])(?![^\(]*\))/.source),h.leftMatch[y]=new RegExp(/(^(?:.|\r|\n)*?)/.source+h.match[y].source.replace(/\\(\d+)/g,m));h.match.globalPOS=g;var v=function(e,t){return e=Array.prototype.slice.call(e,0),t?(t.push.apply(t,e),t):e};try{Array.prototype.slice.call(j.documentElement.childNodes,0)[0].nodeType}catch(e){v=function(e,t){var n=0,i=t||[];if("[object Array]"===a.call(e))Array.prototype.push.apply(i,e);else if("number"==typeof e.length)for(var r=e.length;n<r;n++)i.push(e[n]);else for(;e[n];n++)i.push(e[n]);return i}}var b,w;j.documentElement.compareDocumentPosition?b=function(e,t){return e===t?(s=!0,0):e.compareDocumentPosition&&t.compareDocumentPosition?4&e.compareDocumentPosition(t)?-1:1:e.compareDocumentPosition?-1:1}:(b=function(e,t){if(e===t)return s=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,i,r=[],o=[],a=e.parentNode,l=t.parentNode,u=a;if(a===l)return w(e,t);if(!a)return-1;if(!l)return 1;for(;u;)r.unshift(u),u=u.parentNode;for(u=l;u;)o.unshift(u),u=u.parentNode;n=r.length,i=o.length;for(var c=0;c<n&&c<i;c++)if(r[c]!==o[c])return w(r[c],o[c]);return c===n?w(e,o[c],-1):w(r[c],t,1)},w=function(e,t,n){if(e===t)return n;for(var i=e.nextSibling;i;){if(i===t)return-1;i=i.nextSibling}return 1}),function(){var e=j.createElement("div"),n="script"+(new Date).getTime(),i=j.documentElement;e.innerHTML="<a name='"+n+"'/>",i.insertBefore(e,i.firstChild),j.getElementById(n)&&(h.find.ID=function(e,n,i){if("undefined"!=typeof n.getElementById&&!i){var r=n.getElementById(e[1]);return r?r.id===e[1]||"undefined"!=typeof r.getAttributeNode&&r.getAttributeNode("id").nodeValue===e[1]?[r]:t:[]}},h.filter.ID=function(e,t){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return 1===e.nodeType&&n&&n.nodeValue===t}),i.removeChild(e),i=e=null}(),function(){var e=j.createElement("div");e.appendChild(j.createComment("")),e.getElementsByTagName("*").length>0&&(h.find.TAG=function(e,t){var n=t.getElementsByTagName(e[1]);if("*"===e[1]){for(var i=[],r=0;n[r];r++)1===n[r].nodeType&&i.push(n[r]);n=i}return n}),e.innerHTML="<a href='#'></a>",e.firstChild&&"undefined"!=typeof e.firstChild.getAttribute&&"#"!==e.firstChild.getAttribute("href")&&(h.attrHandle.href=function(e){return e.getAttribute("href",2)}),e=null}(),j.querySelectorAll&&function(){var e=f,t=j.createElement("div");if(t.innerHTML="<p class='TEST'></p>",!t.querySelectorAll||0!==t.querySelectorAll(".TEST").length){f=function(t,n,i,r){if(n=n||j,!r&&!f.isXML(n)){var o=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(t);if(o&&(1===n.nodeType||9===n.nodeType)){if(o[1])return v(n.getElementsByTagName(t),i);if(o[2]&&h.find.CLASS&&n.getElementsByClassName)return v(n.getElementsByClassName(o[2]),i)}if(9===n.nodeType){if("body"===t&&n.body)return v([n.body],i);if(o&&o[3]){var a=n.getElementById(o[3]);if(!a||!a.parentNode)return v([],i);if(a.id===o[3])return v([a],i)}try{return v(n.querySelectorAll(t),i)}catch(e){}}else if(1===n.nodeType&&"object"!==n.nodeName.toLowerCase()){var s=n,l=n.getAttribute("id"),u=l||"__sizzle__",c=n.parentNode,d=/^\s*[+~]/.test(t);l?u=u.replace(/'/g,"\\$&"):n.setAttribute("id",u),d&&c&&(n=n.parentNode);try{if(!d||c)return v(n.querySelectorAll("[id='"+u+"'] "+t),i)}catch(e){}finally{l||s.removeAttribute("id")}}}return e(t,n,i,r)};for(var n in e)f[n]=e[n];t=null}}(),function(){var e=j.documentElement,t=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(t){var n=!t.call(j.createElement("div"),"div"),i=!1;try{t.call(j.documentElement,"[test!='']:sizzle")}catch(e){i=!0}f.matchesSelector=function(e,r){if(r=r.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']"),!f.isXML(e))try{if(i||!h.match.PSEUDO.test(r)&&!/!=/.test(r)){var o=t.call(e,r);if(o||!n||e.document&&11!==e.document.nodeType)return o}}catch(e){}return f(r,null,null,[e]).length>0}}}(),function(){var e=j.createElement("div");if(e.innerHTML="<div class='test e'></div><div class='test'></div>",e.getElementsByClassName&&0!==e.getElementsByClassName("e").length){if(e.lastChild.className="e",1===e.getElementsByClassName("e").length)return;h.order.splice(1,0,"CLASS"),h.find.CLASS=function(e,t,n){if("undefined"!=typeof t.getElementsByClassName&&!n)return t.getElementsByClassName(e[1])},e=null}}(),j.documentElement.contains?f.contains=function(e,t){return e!==t&&(!e.contains||e.contains(t))}:j.documentElement.compareDocumentPosition?f.contains=function(e,t){return!!(16&e.compareDocumentPosition(t))}:f.contains=function(){return!1},f.isXML=function(e){var t=(e?e.ownerDocument||e:0).documentElement;return!!t&&"HTML"!==t.nodeName};var x=function(e,t,n){for(var i,r=[],o="",a=t.nodeType?[t]:t;i=h.match.PSEUDO.exec(e);)o+=i[0],e=e.replace(h.match.PSEUDO,"");e=h.relative[e]?e+"*":e;for(var s=0,l=a.length;s<l;s++)f(e,a[s],r,n);return f.filter(o,r)};f.attr=M.attr,f.selectors.attrMap={},M.find=f,M.expr=f.selectors,M.expr[":"]=M.expr.filters,M.unique=f.uniqueSort,M.text=f.getText,M.isXMLDoc=f.isXML,M.contains=f.contains}();var se=/Until$/,le=/^(?:parents|prevUntil|prevAll)/,ue=/,/,ce=/^.[^:#\[\.,]*$/,de=Array.prototype.slice,fe=M.expr.match.globalPOS,pe={children:!0,contents:!0,next:!0,prev:!0};M.fn.extend({find:function(e){var t,n,i=this;if("string"!=typeof e)return M(e).filter(function(){for(t=0,n=i.length;t<n;t++)if(M.contains(i[t],this))return!0});var r,o,a,s=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++)if(r=s.length,M.find(e,this[t],s),t>0)for(o=r;o<s.length;o++)for(a=0;a<r;a++)if(s[a]===s[o]){s.splice(o--,1);break}return s},has:function(e){var t=M(e);return this.filter(function(){for(var e=0,n=t.length;e<n;e++)if(M.contains(this,t[e]))return!0})},not:function(e){return this.pushStack(C(this,e,!1),"not",e)},filter:function(e){return this.pushStack(C(this,e,!0),"filter",e)},is:function(e){return!!e&&("string"==typeof e?fe.test(e)?M(e,this.context).index(this[0])>=0:M.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,i,r=[],o=this[0];if(M.isArray(e)){for(var a=1;o&&o.ownerDocument&&o!==t;){for(n=0;n<e.length;n++)M(o).is(e[n])&&r.push({selector:e[n],elem:o,level:a});o=o.parentNode,a++}return r}var s=fe.test(e)||"string"!=typeof e?M(e,t||this.context):0;for(n=0,i=this.length;n<i;n++)for(o=this[n];o;){if(s?s.index(o)>-1:M.find.matchesSelector(o,e)){r.push(o);break}if(!(o=o.parentNode)||!o.ownerDocument||o===t||11===o.nodeType)break}return r=r.length>1?M.unique(r):r,this.pushStack(r,"closest",e)},index:function(e){return e?"string"==typeof e?M.inArray(this[0],M(e)):M.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n="string"==typeof e?M(e,t):M.makeArray(e&&e.nodeType?[e]:e),i=M.merge(this.get(),n);return this.pushStack(E(n[0])||E(i[0])?i:M.unique(i))},andSelf:function(){return this.add(this.prevObject)}}),M.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return M.dir(e,"parentNode")},parentsUntil:function(e,t,n){return M.dir(e,"parentNode",n)},next:function(e){return M.nth(e,2,"nextSibling")},prev:function(e){return M.nth(e,2,"previousSibling")},nextAll:function(e){return M.dir(e,"nextSibling")},prevAll:function(e){return M.dir(e,"previousSibling")},nextUntil:function(e,t,n){return M.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return M.dir(e,"previousSibling",n)},siblings:function(e){return M.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return M.sibling(e.firstChild)},contents:function(e){return M.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:M.makeArray(e.childNodes)}},function(e,t){M.fn[e]=function(n,i){var r=M.map(this,t,n);return se.test(e)||(i=n),i&&"string"==typeof i&&(r=M.filter(i,r)),r=this.length>1&&!pe[e]?M.unique(r):r,(this.length>1||ue.test(i))&&le.test(e)&&(r=r.reverse()),this.pushStack(r,e,de.call(arguments).join(","))}}),M.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?M.find.matchesSelector(t[0],e)?[t[0]]:[]:M.find.matches(e,t)},dir:function(e,n,i){for(var r=[],o=e[n];o&&9!==o.nodeType&&(i===t||1!==o.nodeType||!M(o).is(i));)1===o.nodeType&&r.push(o),o=o[n];return r},nth:function(e,t,n){t=t||1;for(var i=0;e&&(1!==e.nodeType||++i!==t);e=e[n]);return e},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var he="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ge=/ jQuery\d+="(?:\d+|null)"/g,me=/^\s+/,ye=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ve=/<([\w:]+)/,be=/<tbody/i,we=/<|&#?\w+;/,xe=/<(?:script|style)/i,ke=/<(?:script|object|embed|option|style)/i,Te=new RegExp("<(?:"+he+")[\\s/>]","i"),Ce=/checked\s*(?:[^=]|=\s*.checked.)/i,Ee=/\/(java|ecma)script/i,Ne=/^\s*<!(?:\[CDATA\[|\-\-)/,_e={
3
3
  option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Se=T(j);_e.optgroup=_e.option,_e.tbody=_e.tfoot=_e.colgroup=_e.caption=_e.thead,_e.th=_e.td,M.support.htmlSerialize||(_e._default=[1,"div<div>","</div>"]),M.fn.extend({text:function(e){return M.access(this,function(e){return e===t?M.text(this):this.empty().append((this[0]&&this[0].ownerDocument||j).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(M.isFunction(e))return this.each(function(t){M(this).wrapAll(e.call(this,t))});if(this[0]){var t=M(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return M.isFunction(e)?this.each(function(t){M(this).wrapInner(e.call(this,t))}):this.each(function(){var t=M(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=M.isFunction(e);return this.each(function(n){M(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){M.nodeName(this,"body")||M(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){1===this.nodeType&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){1===this.nodeType&&this.insertBefore(e,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=M.clean(arguments);return e.push.apply(e,this.toArray()),this.pushStack(e,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=this.pushStack(this,"after",arguments);return e.push.apply(e,M.clean(arguments)),e}},remove:function(e,t){for(var n,i=0;null!=(n=this[i]);i++)e&&!M.filter(e,[n]).length||(!t&&1===n.nodeType&&(M.cleanData(n.getElementsByTagName("*")),M.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)for(1===e.nodeType&&M.cleanData(e.getElementsByTagName("*"));e.firstChild;)e.removeChild(e.firstChild);return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return M.clone(this,e,t)})},html:function(e){return M.access(this,function(e){var n=this[0]||{},i=0,r=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(ge,""):null;if("string"==typeof e&&!xe.test(e)&&(M.support.leadingWhitespace||!me.test(e))&&!_e[(ve.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(ye,"<$1></$2>");try{for(;i<r;i++)n=this[i]||{},1===n.nodeType&&(M.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(e){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return this[0]&&this[0].parentNode?M.isFunction(e)?this.each(function(t){var n=M(this),i=n.html();n.replaceWith(e.call(this,t,i))}):("string"!=typeof e&&(e=M(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;M(this).remove(),t?M(t).before(e):M(n).append(e)})):this.length?this.pushStack(M(M.isFunction(e)?e():e),"replaceWith",e):this},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,i){var r,o,a,s,l=e[0],u=[];if(!M.support.checkClone&&3===arguments.length&&"string"==typeof l&&Ce.test(l))return this.each(function(){M(this).domManip(e,n,i,!0)});if(M.isFunction(l))return this.each(function(r){var o=M(this);e[0]=l.call(this,r,n?o.html():t),o.domManip(e,n,i)});if(this[0]){if(s=l&&l.parentNode,r=M.support.parentNode&&s&&11===s.nodeType&&s.childNodes.length===this.length?{fragment:s}:M.buildFragment(e,this,u),a=r.fragment,o=1===a.childNodes.length?a=a.firstChild:a.firstChild,o){n=n&&M.nodeName(o,"tr");for(var c=0,d=this.length,f=d-1;c<d;c++)i.call(n?k(this[c],o):this[c],r.cacheable||d>1&&c<f?M.clone(a,!0,!0):a)}u.length&&M.each(u,function(e,t){t.src?M.ajax({type:"GET",global:!1,url:t.src,async:!1,dataType:"script"}):M.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Ne,"/*$0*/")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),M.buildFragment=function(e,t,n){var i,r,o,a,s=e[0];return t&&t[0]&&(a=t[0].ownerDocument||t[0]),a.createDocumentFragment||(a=j),1===e.length&&"string"==typeof s&&s.length<512&&a===j&&"<"===s.charAt(0)&&!ke.test(s)&&(M.support.checkClone||!Ce.test(s))&&(M.support.html5Clone||!Te.test(s))&&(r=!0,(o=M.fragments[s])&&1!==o&&(i=o)),i||(i=a.createDocumentFragment(),M.clean(e,a,i,n)),r&&(M.fragments[s]=o?i:1),{fragment:i,cacheable:r}},M.fragments={},M.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){M.fn[e]=function(n){var i=[],r=M(n),o=1===this.length&&this[0].parentNode;if(o&&11===o.nodeType&&1===o.childNodes.length&&1===r.length)return r[t](this[0]),this;for(var a=0,s=r.length;a<s;a++){var l=(a>0?this.clone(!0):this).get();M(r[a])[t](l),i=i.concat(l)}return this.pushStack(i,e,r.selector)}}),M.extend({clone:function(e,t,n){var i,r,o,a=M.support.html5Clone||M.isXMLDoc(e)||!Te.test("<"+e.nodeName+">")?e.cloneNode(!0):m(e);if(!(M.support.noCloneEvent&&M.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||M.isXMLDoc(e)))for(w(e,a),i=b(e),r=b(a),o=0;i[o];++o)r[o]&&w(i[o],r[o]);if(t&&(x(e,a),n))for(i=b(e),r=b(a),o=0;i[o];++o)x(i[o],r[o]);return i=r=null,a},clean:function(e,t,n,i){var r,o,a,s=[];t=t||j,"undefined"==typeof t.createElement&&(t=t.ownerDocument||t[0]&&t[0].ownerDocument||j);for(var l,u=0;null!=(l=e[u]);u++)if("number"==typeof l&&(l+=""),l){if("string"==typeof l)if(we.test(l)){l=l.replace(ye,"<$1></$2>");var c,d=(ve.exec(l)||["",""])[1].toLowerCase(),f=_e[d]||_e._default,p=f[0],h=t.createElement("div"),g=Se.childNodes;for(t===j?Se.appendChild(h):T(t).appendChild(h),h.innerHTML=f[1]+l+f[2];p--;)h=h.lastChild;if(!M.support.tbody){var m=be.test(l),v="table"!==d||m?"<table>"!==f[1]||m?[]:h.childNodes:h.firstChild&&h.firstChild.childNodes;for(a=v.length-1;a>=0;--a)M.nodeName(v[a],"tbody")&&!v[a].childNodes.length&&v[a].parentNode.removeChild(v[a])}!M.support.leadingWhitespace&&me.test(l)&&h.insertBefore(t.createTextNode(me.exec(l)[0]),h.firstChild),l=h.childNodes,h&&(h.parentNode.removeChild(h),g.length>0&&(c=g[g.length-1])&&c.parentNode&&c.parentNode.removeChild(c))}else l=t.createTextNode(l);var b;if(!M.support.appendChecked)if(l[0]&&"number"==typeof(b=l.length))for(a=0;a<b;a++)y(l[a]);else y(l);l.nodeType?s.push(l):s=M.merge(s,l)}if(n)for(r=function(e){return!e.type||Ee.test(e.type)},u=0;s[u];u++)if(o=s[u],i&&M.nodeName(o,"script")&&(!o.type||Ee.test(o.type)))i.push(o.parentNode?o.parentNode.removeChild(o):o);else{if(1===o.nodeType){var w=M.grep(o.getElementsByTagName("script"),r);s.splice.apply(s,[u+1,0].concat(w))}n.appendChild(o)}return s},cleanData:function(e){for(var t,n,i,r=M.cache,o=M.event.special,a=M.support.deleteExpando,s=0;null!=(i=e[s]);s++)if((!i.nodeName||!M.noData[i.nodeName.toLowerCase()])&&(n=i[M.expando])){if((t=r[n])&&t.events){for(var l in t.events)o[l]?M.event.remove(i,l):M.removeEvent(i,l,t.handle);t.handle&&(t.handle.elem=null)}a?delete i[M.expando]:i.removeAttribute&&i.removeAttribute(M.expando),delete r[n]}}});var Ae,$e,Le,je=/alpha\([^)]*\)/i,De=/opacity=([^)]*)/,Fe=/([A-Z]|^ms)/g,Me=/^[\-+]?(?:\d*\.)?\d+$/i,Oe=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,Pe=/^([\-+])=([\-+.\de]+)/,He=/^margin/,ze={position:"absolute",visibility:"hidden",display:"block"},qe=["Top","Right","Bottom","Left"];M.fn.css=function(e,n){return M.access(this,function(e,n,i){return i!==t?M.style(e,n,i):M.css(e,n)},e,n,arguments.length>1)},M.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ae(e,"opacity");return""===n?"1":n}return e.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":M.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,i,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s=M.camelCase(n),l=e.style,u=M.cssHooks[s];if(n=M.cssProps[s]||s,i===t)return u&&"get"in u&&(o=u.get(e,!1,r))!==t?o:l[n];if("string"===(a=typeof i)&&(o=Pe.exec(i))&&(i=+(o[1]+1)*+o[2]+parseFloat(M.css(e,n)),a="number"),null==i||"number"===a&&isNaN(i))return;if("number"===a&&!M.cssNumber[s]&&(i+="px"),!(u&&"set"in u&&(i=u.set(e,i))===t))try{l[n]=i}catch(e){}}},css:function(e,n,i){var r,o;return n=M.camelCase(n),o=M.cssHooks[n],"cssFloat"===(n=M.cssProps[n]||n)&&(n="float"),o&&"get"in o&&(r=o.get(e,!0,i))!==t?r:Ae?Ae(e,n):void 0},swap:function(e,t,n){var i,r,o={};for(r in t)o[r]=e.style[r],e.style[r]=t[r];i=n.call(e);for(r in t)e.style[r]=o[r];return i}}),M.curCSS=M.css,j.defaultView&&j.defaultView.getComputedStyle&&($e=function(e,t){var n,i,r,o,a=e.style;return t=t.replace(Fe,"-$1").toLowerCase(),(i=e.ownerDocument.defaultView)&&(r=i.getComputedStyle(e,null))&&""===(n=r.getPropertyValue(t))&&!M.contains(e.ownerDocument.documentElement,e)&&(n=M.style(e,t)),!M.support.pixelMargin&&r&&He.test(t)&&Oe.test(n)&&(o=a.width,a.width=n,n=r.width,a.width=o),n}),j.documentElement.currentStyle&&(Le=function(e,t){var n,i,r,o=e.currentStyle&&e.currentStyle[t],a=e.style;return null==o&&a&&(r=a[t])&&(o=r),Oe.test(o)&&(n=a.left,i=e.runtimeStyle&&e.runtimeStyle.left,i&&(e.runtimeStyle.left=e.currentStyle.left),a.left="fontSize"===t?"1em":o,o=a.pixelLeft+"px",a.left=n,i&&(e.runtimeStyle.left=i)),""===o?"auto":o}),Ae=$e||Le,M.each(["height","width"],function(e,t){M.cssHooks[t]={get:function(e,n,i){if(n)return 0!==e.offsetWidth?g(e,t,i):M.swap(e,ze,function(){return g(e,t,i)})},set:function(e,t){return Me.test(t)?t+"px":t}}}),M.support.opacity||(M.cssHooks.opacity={get:function(e,t){return De.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?parseFloat(RegExp.$1)/100+"":t?"1":""},set:function(e,t){var n=e.style,i=e.currentStyle,r=M.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=i&&i.filter||n.filter||"";n.zoom=1,t>=1&&""===M.trim(o.replace(je,""))&&(n.removeAttribute("filter"),i&&!i.filter)||(n.filter=je.test(o)?o.replace(je,r):o+" "+r)}}),M(function(){M.support.reliableMarginRight||(M.cssHooks.marginRight={get:function(e,t){return M.swap(e,{display:"inline-block"},function(){return t?Ae(e,"margin-right"):e.style.marginRight})}})}),M.expr&&M.expr.filters&&(M.expr.filters.hidden=function(e){var t=e.offsetWidth,n=e.offsetHeight;return 0===t&&0===n||!M.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||M.css(e,"display"))},M.expr.filters.visible=function(e){return!M.expr.filters.hidden(e)}),M.each({margin:"",padding:"",border:"Width"},function(e,t){M.cssHooks[e+t]={expand:function(n){var i,r="string"==typeof n?n.split(" "):[n],o={};for(i=0;i<4;i++)o[e+qe[i]+t]=r[i]||r[i-2]||r[0];return o}}});var Be,Re,Ie=/%20/g,We=/\[\]$/,Xe=/\r?\n/g,Ue=/#.*$/,Ve=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ke=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Ge=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Je=/^(?:GET|HEAD)$/,Ye=/^\/\//,Qe=/\?/,Ze=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,et=/^(?:select|textarea)/i,tt=/\s+/,nt=/([?&])_=[^&]*/,it=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,rt=M.fn.load,ot={},at={},st=["*/"]+["*"];try{Be=F.href}catch(e){Be=j.createElement("a"),Be.href="",Be=Be.href}Re=it.exec(Be.toLowerCase())||[],M.fn.extend({load:function(e,n,i){if("string"!=typeof e&&rt)return rt.apply(this,arguments);if(!this.length)return this;var r=e.indexOf(" ");if(r>=0){var o=e.slice(r,e.length);e=e.slice(0,r)}var a="GET";n&&(M.isFunction(n)?(i=n,n=t):"object"==typeof n&&(n=M.param(n,M.ajaxSettings.traditional),a="POST"));var s=this;return M.ajax({url:e,type:a,dataType:"html",data:n,complete:function(e,t,n){n=e.responseText,e.isResolved()&&(e.done(function(e){n=e}),s.html(o?M("<div>").append(n.replace(Ze,"")).find(o):n)),i&&s.each(i,[n,t,e])}}),this},serialize:function(){return M.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?M.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||et.test(this.nodeName)||Ke.test(this.type))}).map(function(e,t){var n=M(this).val();return null==n?null:M.isArray(n)?M.map(n,function(e){return{name:t.name,value:e.replace(Xe,"\r\n")}}):{name:t.name,value:n.replace(Xe,"\r\n")}}).get()}}),M.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){M.fn[t]=function(e){return this.on(t,e)}}),M.each(["get","post"],function(e,n){M[n]=function(e,i,r,o){return M.isFunction(i)&&(o=o||r,r=i,i=t),M.ajax({type:n,url:e,data:i,success:r,dataType:o})}}),M.extend({getScript:function(e,n){return M.get(e,t,n,"script")},getJSON:function(e,t,n){return M.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?f(e,M.ajaxSettings):(t=e,e=M.ajaxSettings),f(e,t),e},ajaxSettings:{url:Be,isLocal:Ge.test(Re[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":st},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":M.parseJSON,"text xml":M.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:h(ot),ajaxTransport:h(at),ajax:function(e,n){function i(e,n,i,a){if(2!==T){T=2,l&&clearTimeout(l),s=t,o=a||"",C.readyState=e>0?4:0;var d,p,h,x,k,E=n,N=i?c(g,C,i):t;if(e>=200&&e<300||304===e)if(g.ifModified&&((x=C.getResponseHeader("Last-Modified"))&&(M.lastModified[r]=x),(k=C.getResponseHeader("Etag"))&&(M.etag[r]=k)),304===e)E="notmodified",d=!0;else try{p=u(g,N),E="success",d=!0}catch(e){E="parsererror",h=e}else h=E,E&&!e||(E="error",e<0&&(e=0));C.status=e,C.statusText=""+(n||E),d?v.resolveWith(m,[p,E,C]):v.rejectWith(m,[C,E,h]),C.statusCode(w),w=t,f&&y.trigger("ajax"+(d?"Success":"Error"),[C,g,d?p:h]),b.fireWith(m,[C,E]),f&&(y.trigger("ajaxComplete",[C,g]),--M.active||M.event.trigger("ajaxStop"))}}"object"==typeof e&&(n=e,e=t),n=n||{};var r,o,a,s,l,d,f,h,g=M.ajaxSetup({},n),m=g.context||g,y=m!==g&&(m.nodeType||m instanceof M)?M(m):M.event,v=M.Deferred(),b=M.Callbacks("once memory"),w=g.statusCode||{},x={},k={},T=0,C={readyState:0,setRequestHeader:function(e,t){if(!T){var n=e.toLowerCase();e=k[n]=k[n]||e,x[e]=t}return this},getAllResponseHeaders:function(){return 2===T?o:null},getResponseHeader:function(e){var n;if(2===T){if(!a)for(a={};n=Ve.exec(o);)a[n[1].toLowerCase()]=n[2];n=a[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return T||(g.mimeType=e),this},abort:function(e){return e=e||"abort",s&&s.abort(e),i(0,e),this}};if(v.promise(C),C.success=C.done,C.error=C.fail,C.complete=b.add,C.statusCode=function(e){if(e){var t;if(T<2)for(t in e)w[t]=[w[t],e[t]];else t=e[C.status],C.then(t,t)}return this},g.url=((e||g.url)+"").replace(Ue,"").replace(Ye,Re[1]+"//"),g.dataTypes=M.trim(g.dataType||"*").toLowerCase().split(tt),null==g.crossDomain&&(d=it.exec(g.url.toLowerCase()),g.crossDomain=!(!d||d[1]==Re[1]&&d[2]==Re[2]&&(d[3]||("http:"===d[1]?80:443))==(Re[3]||("http:"===Re[1]?80:443)))),g.data&&g.processData&&"string"!=typeof g.data&&(g.data=M.param(g.data,g.traditional)),p(ot,g,n,C),2===T)return!1;if(f=g.global,g.type=g.type.toUpperCase(),g.hasContent=!Je.test(g.type),f&&0==M.active++&&M.event.trigger("ajaxStart"),!g.hasContent&&(g.data&&(g.url+=(Qe.test(g.url)?"&":"?")+g.data,delete g.data),r=g.url,!1===g.cache)){var E=M.now(),N=g.url.replace(nt,"$1_="+E);g.url=N+(N===g.url?(Qe.test(g.url)?"&":"?")+"_="+E:"")}(g.data&&g.hasContent&&!1!==g.contentType||n.contentType)&&C.setRequestHeader("Content-Type",g.contentType),g.ifModified&&(r=r||g.url,M.lastModified[r]&&C.setRequestHeader("If-Modified-Since",M.lastModified[r]),M.etag[r]&&C.setRequestHeader("If-None-Match",M.etag[r])),C.setRequestHeader("Accept",g.dataTypes[0]&&g.accepts[g.dataTypes[0]]?g.accepts[g.dataTypes[0]]+("*"!==g.dataTypes[0]?", "+st+"; q=0.01":""):g.accepts["*"]);for(h in g.headers)C.setRequestHeader(h,g.headers[h]);if(g.beforeSend&&(!1===g.beforeSend.call(m,C,g)||2===T))return C.abort(),!1;for(h in{success:1,error:1,complete:1})C[h](g[h]);if(s=p(at,g,n,C)){C.readyState=1,f&&y.trigger("ajaxSend",[C,g]),g.async&&g.timeout>0&&(l=setTimeout(function(){C.abort("timeout")},g.timeout));try{T=1,s.send(x,i)}catch(e){if(!(T<2))throw e;i(-1,e)}}else i(-1,"No Transport");return C},param:function(e,n){var i=[],r=function(e,t){t=M.isFunction(t)?t():t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=M.ajaxSettings.traditional),M.isArray(e)||e.jquery&&!M.isPlainObject(e))M.each(e,function(){r(this.name,this.value)});else for(var o in e)d(o,e[o],n,r);return i.join("&").replace(Ie,"+")}}),M.extend({active:0,lastModified:{},etag:{}});var lt=M.now(),ut=/(\=)\?(&|$)|\?\?/i;M.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return M.expando+"_"+lt++}}),M.ajaxPrefilter("json jsonp",function(t,n,i){var r="string"==typeof t.data&&/^application\/x\-www\-form\-urlencoded/.test(t.contentType);if("jsonp"===t.dataTypes[0]||!1!==t.jsonp&&(ut.test(t.url)||r&&ut.test(t.data))){var o,a=t.jsonpCallback=M.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s=e[a],l=t.url,u=t.data,c="$1"+a+"$2";return!1!==t.jsonp&&(l=l.replace(ut,c),t.url===l&&(r&&(u=u.replace(ut,c)),t.data===u&&(l+=(/\?/.test(l)?"&":"?")+t.jsonp+"="+a))),t.url=l,t.data=u,e[a]=function(e){o=[e]},i.always(function(){e[a]=s,o&&M.isFunction(s)&&e[a](o[0])}),t.converters["script json"]=function(){return o||M.error(a+" was not called"),o[0]},t.dataTypes[0]="json","script"}}),M.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return M.globalEval(e),e}}}),M.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),M.ajaxTransport("script",function(e){if(e.crossDomain){var n,i=j.head||j.getElementsByTagName("head")[0]||j.documentElement;return{send:function(r,o){n=j.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,r){(r||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,i&&n.parentNode&&i.removeChild(n),n=t,r||o(200,"success"))},i.insertBefore(n,i.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var ct,dt=!!e.ActiveXObject&&function(){for(var e in ct)ct[e](0,1)},ft=0;M.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&l()||s()}:l,function(e){M.extend(M.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(M.ajaxSettings.xhr()),M.support.ajax&&M.ajaxTransport(function(n){if(!n.crossDomain||M.support.cors){var i;return{send:function(r,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),!n.crossDomain&&!r["X-Requested-With"]&&(r["X-Requested-With"]="XMLHttpRequest");try{for(s in r)l.setRequestHeader(s,r[s])}catch(e){}l.send(n.hasContent&&n.data||null),i=function(e,r){var s,u,c,d,f;try{if(i&&(r||4===l.readyState))if(i=t,a&&(l.onreadystatechange=M.noop,dt&&delete ct[a]),r)4!==l.readyState&&l.abort();else{s=l.status,c=l.getAllResponseHeaders(),d={},(f=l.responseXML)&&f.documentElement&&(d.xml=f);try{d.text=l.responseText}catch(e){}try{u=l.statusText}catch(e){u=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=d.text?200:404}}catch(e){r||o(-1,e)}d&&o(s,u,d,c)},n.async&&4!==l.readyState?(a=++ft,dt&&(ct||(ct={},M(e).unload(dt)),ct[a]=i),l.onreadystatechange=i):i()},abort:function(){i&&i(0,1)}}}});var pt,ht,gt,mt,yt={},vt=/^(?:toggle|show|hide)$/,bt=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,wt=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];M.fn.extend({show:function(e,t,n){var o,a;if(e||0===e)return this.animate(r("show",3),e,t,n);for(var s=0,l=this.length;s<l;s++)o=this[s],o.style&&(a=o.style.display,!M._data(o,"olddisplay")&&"none"===a&&(a=o.style.display=""),(""===a&&"none"===M.css(o,"display")||!M.contains(o.ownerDocument.documentElement,o))&&M._data(o,"olddisplay",i(o.nodeName)));for(s=0;s<l;s++)o=this[s],o.style&&(""!==(a=o.style.display)&&"none"!==a||(o.style.display=M._data(o,"olddisplay")||""));return this},hide:function(e,t,n){if(e||0===e)return this.animate(r("hide",3),e,t,n);for(var i,o,a=0,s=this.length;a<s;a++)i=this[a],i.style&&"none"!==(o=M.css(i,"display"))&&!M._data(i,"olddisplay")&&M._data(i,"olddisplay",o);for(a=0;a<s;a++)this[a].style&&(this[a].style.display="none");return this},_toggle:M.fn.toggle,toggle:function(e,t,n){var i="boolean"==typeof e;return M.isFunction(e)&&M.isFunction(t)?this._toggle.apply(this,arguments):null==e||i?this.each(function(){var t=i?e:M(this).is(":hidden");M(this)[t?"show":"hide"]()}):this.animate(r("toggle",3),e,t,n),this},fadeTo:function(e,t,n,i){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(e,t,n,r){function o(){!1===a.queue&&M._mark(this);var t,n,r,o,s,l,u,c,d,f,p,h=M.extend({},a),g=1===this.nodeType,m=g&&M(this).is(":hidden");h.animatedProperties={};for(r in e)if(t=M.camelCase(r),r!==t&&(e[t]=e[r],delete e[r]),(s=M.cssHooks[t])&&"expand"in s){l=s.expand(e[t]),delete e[t];for(r in l)r in e||(e[r]=l[r])}for(t in e){if(n=e[t],M.isArray(n)?(h.animatedProperties[t]=n[1],n=e[t]=n[0]):h.animatedProperties[t]=h.specialEasing&&h.specialEasing[t]||h.easing||"swing","hide"===n&&m||"show"===n&&!m)return h.complete.call(this);g&&("height"===t||"width"===t)&&(h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],"inline"===M.css(this,"display")&&"none"===M.css(this,"float")&&(M.support.inlineBlockNeedsLayout&&"inline"!==i(this.nodeName)?this.style.zoom=1:this.style.display="inline-block"))}null!=h.overflow&&(this.style.overflow="hidden");for(r in e)o=new M.fx(this,h,r),n=e[r],vt.test(n)?(p=M._data(this,"toggle"+r)||("toggle"===n?m?"show":"hide":0),p?(M._data(this,"toggle"+r,"show"===p?"hide":"show"),o[p]()):o[n]()):(u=bt.exec(n),c=o.cur(),u?(d=parseFloat(u[2]),f=u[3]||(M.cssNumber[r]?"":"px"),"px"!==f&&(M.style(this,r,(d||1)+f),c=(d||1)/o.cur()*c,M.style(this,r,c+f)),u[1]&&(d=("-="===u[1]?-1:1)*d+c),o.custom(c,d,f)):o.custom(c,n,""));return!0}var a=M.speed(t,n,r);return M.isEmptyObject(e)?this.each(a.complete,[!1]):(e=M.extend({},e),!1===a.queue?this.each(o):this.queue(a.queue,o))},stop:function(e,n,i){return"string"!=typeof e&&(i=n,n=e,e=t),n&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){function t(e,t,n){var r=t[n];M.removeData(e,n,!0),r.stop(i)}var n,r=!1,o=M.timers,a=M._data(this);if(i||M._unmark(!0,this),null==e)for(n in a)a[n]&&a[n].stop&&n.indexOf(".run")===n.length-4&&t(this,a,n);else a[n=e+".run"]&&a[n].stop&&t(this,a,n);for(n=o.length;n--;)o[n].elem===this&&(null==e||o[n].queue===e)&&(i?o[n](!0):o[n].saveState(),r=!0,o.splice(n,1));(!i||!r)&&M.dequeue(this,e)})}}),M.each({slideDown:r("show",1),slideUp:r("hide",1),slideToggle:r("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){M.fn[e]=function(e,n,i){return this.animate(t,e,n,i)}}),M.extend({speed:function(e,t,n){var i=e&&"object"==typeof e?M.extend({},e):{complete:n||!n&&t||M.isFunction(e)&&e,duration:e,easing:n&&t||t&&!M.isFunction(t)&&t};return i.duration=M.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in M.fx.speeds?M.fx.speeds[i.duration]:M.fx.speeds._default,null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(e){M.isFunction(i.old)&&i.old.call(this),i.queue?M.dequeue(this,i.queue):!1!==e&&M._unmark(this)},i},easing:{linear:function(e){return e},swing:function(e){return-Math.cos(e*Math.PI)/2+.5}},timers:[],fx:function(e,t,n){this.options=t,this.elem=e,this.prop=n,t.orig=t.orig||{}}}),M.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(M.fx.step[this.prop]||M.fx.step._default)(this)},cur:function(){if(null!=this.elem[this.prop]&&(!this.elem.style||null==this.elem.style[this.prop]))return this.elem[this.prop];var e,t=M.css(this.elem,this.prop);return isNaN(e=parseFloat(t))?t&&"auto"!==t?t:0:e},custom:function(e,n,i){function r(e){return o.step(e)}var o=this,s=M.fx;this.startTime=mt||a(),this.end=n,this.now=this.start=e,this.pos=this.state=0,this.unit=i||this.unit||(M.cssNumber[this.prop]?"":"px"),r.queue=this.options.queue,r.elem=this.elem,r.saveState=function(){M._data(o.elem,"fxshow"+o.prop)===t&&(o.options.hide?M._data(o.elem,"fxshow"+o.prop,o.start):o.options.show&&M._data(o.elem,"fxshow"+o.prop,o.end))},r()&&M.timers.push(r)&&!gt&&(gt=setInterval(s.tick,s.interval))},show:function(){var e=M._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=e||M.style(this.elem,this.prop),this.options.show=!0,e!==t?this.custom(this.cur(),e):this.custom("width"===this.prop||"height"===this.prop?1:0,this.cur()),M(this.elem).show()},hide:function(){this.options.orig[this.prop]=M._data(this.elem,"fxshow"+this.prop)||M.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(e){var t,n,i,r=mt||a(),o=!0,s=this.elem,l=this.options;if(e||r>=l.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),l.animatedProperties[this.prop]=!0;for(t in l.animatedProperties)!0!==l.animatedProperties[t]&&(o=!1);if(o){if(null!=l.overflow&&!M.support.shrinkWrapBlocks&&M.each(["","X","Y"],function(e,t){s.style["overflow"+t]=l.overflow[e]}),l.hide&&M(s).hide(),l.hide||l.show)for(t in l.animatedProperties)M.style(s,t,l.orig[t]),M.removeData(s,"fxshow"+t,!0),M.removeData(s,"toggle"+t,!0);(i=l.complete)&&(l.complete=!1,i.call(s))}return!1}return l.duration==Infinity?this.now=r:(n=r-this.startTime,this.state=n/l.duration,this.pos=M.easing[l.animatedProperties[this.prop]](this.state,n,0,1,l.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},M.extend(M.fx,{tick:function(){for(var e,t=M.timers,n=0;n<t.length;n++)!(e=t[n])()&&t[n]===e&&t.splice(n--,1);t.length||M.fx.stop()},interval:13,stop:function(){clearInterval(gt),gt=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(e){M.style(e.elem,"opacity",e.now)},_default:function(e){e.elem.style&&null!=e.elem.style[e.prop]?e.elem.style[e.prop]=e.now+e.unit:e.elem[e.prop]=e.now}}}),M.each(wt.concat.apply([],wt),function(e,t){t.indexOf("margin")&&(M.fx.step[t]=function(e){M.style(e.elem,t,Math.max(0,e.now)+e.unit)})}),M.expr&&M.expr.filters&&(M.expr.filters.animated=function(e){return M.grep(M.timers,function(t){return e===t.elem}).length});var xt,kt=/^t(?:able|d|h)$/i,Tt=/^(?:body|html)$/i;xt="getBoundingClientRect"in j.documentElement?function(e,t,i,r){try{r=e.getBoundingClientRect()}catch(e){}if(!r||!M.contains(i,e))return r?{top:r.top,left:r.left}:{top:0,left:0};var o=t.body,a=n(t),s=i.clientTop||o.clientTop||0,l=i.clientLeft||o.clientLeft||0,u=a.pageYOffset||M.support.boxModel&&i.scrollTop||o.scrollTop,c=a.pageXOffset||M.support.boxModel&&i.scrollLeft||o.scrollLeft;return{top:r.top+u-s,left:r.left+c-l}}:function(e,t,n){for(var i,r=e.offsetParent,o=t.body,a=t.defaultView,s=a?a.getComputedStyle(e,null):e.currentStyle,l=e.offsetTop,u=e.offsetLeft;(e=e.parentNode)&&e!==o&&e!==n&&(!M.support.fixedPosition||"fixed"!==s.position);)i=a?a.getComputedStyle(e,null):e.currentStyle,l-=e.scrollTop,u-=e.scrollLeft,e===r&&(l+=e.offsetTop,u+=e.offsetLeft,M.support.doesNotAddBorder&&(!M.support.doesAddBorderForTableAndCells||!kt.test(e.nodeName))&&(l+=parseFloat(i.borderTopWidth)||0,u+=parseFloat(i.borderLeftWidth)||0),r,r=e.offsetParent),M.support.subtractsBorderForOverflowNotVisible&&"visible"!==i.overflow&&(l+=parseFloat(i.borderTopWidth)||0,u+=parseFloat(i.borderLeftWidth)||0),s=i;return"relative"!==s.position&&"static"!==s.position||(l+=o.offsetTop,u+=o.offsetLeft),M.support.fixedPosition&&"fixed"===s.position&&(l+=Math.max(n.scrollTop,o.scrollTop),u+=Math.max(n.scrollLeft,o.scrollLeft)),{top:l,left:u}},M.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){M.offset.setOffset(this,e,t)});var n=this[0],i=n&&n.ownerDocument;return i?n===i.body?M.offset.bodyOffset(n):xt(n,i,i.documentElement):null},M.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return M.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(M.css(e,"marginTop"))||0,n+=parseFloat(M.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var i=M.css(e,"position");"static"===i&&(e.style.position="relative");var r,o,a=M(e),s=a.offset(),l=M.css(e,"top"),u=M.css(e,"left"),c=("absolute"===i||"fixed"===i)&&M.inArray("auto",[l,u])>-1,d={},f={};c?(f=a.position(),r=f.top,o=f.left):(r=parseFloat(l)||0,o=parseFloat(u)||0),M.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(d.top=t.top-s.top+r),null!=t.left&&(d.left=t.left-s.left+o),"using"in t?t.using.call(e,d):a.css(d)}},M.fn.extend({position:function(){if(!this[0])return null;var e=this[0],t=this.offsetParent(),n=this.offset(),i=Tt.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(M.css(e,"marginTop"))||0,n.left-=parseFloat(M.css(e,"marginLeft"))||0,i.top+=parseFloat(M.css(t[0],"borderTopWidth"))||0,i.left+=parseFloat(M.css(t[0],"borderLeftWidth"))||0,{top:n.top-i.top,left:n.left-i.left}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||j.body;e&&!Tt.test(e.nodeName)&&"static"===M.css(e,"position");)e=e.offsetParent;return e})}}),M.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,i){var r=/Y/.test(i);M.fn[e]=function(o){return M.access(this,function(e,o,a){var s=n(e);if(a===t)return s?i in s?s[i]:M.support.boxModel&&s.document.documentElement[o]||s.document.body[o]:e[o];s?s.scrollTo(r?M(s).scrollLeft():a,r?a:M(s).scrollTop()):e[o]=a},e,o,arguments.length,null)}}),M.each({Height:"height",Width:"width"},function(e,n){var i="client"+e,r="scroll"+e,o="offset"+e;M.fn["inner"+e]=function(){var e=this[0];return e?e.style?parseFloat(M.css(e,n,"padding")):this[n]():null},M.fn["outer"+e]=function(e){var t=this[0];return t?t.style?parseFloat(M.css(t,n,e?"margin":"border")):this[n]():null},M.fn[n]=function(e){return M.access(this,function(e,n,a){var s,l,u,c;return M.isWindow(e)?(s=e.document,l=s.documentElement[i],M.support.boxModel&&l||s.body&&s.body[i]||l):9===e.nodeType?(s=e.documentElement,s[i]>=s[r]?s[i]:Math.max(e.body[r],s[r],e.body[o],s[o])):a===t?(u=M.css(e,n),c=parseFloat(u),M.isNumeric(c)?c:u):void M(e).css(n,a)},n,e,arguments.length,null)}}),e.jQuery=e.$=M,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return M})}(window),function(){var e;e="undefined"!=typeof module&&"undefined"!=typeof module.exports?require("./pnglib"):window.PNGlib;var t=function(e,t){if("string"!=typeof e||e.length<15)throw"A hash of at least 15 characters is required.";this.defaults={background:[240,240,240,255],margin:.08,size:64,saturation:.7,brightness:.5,format:"png"},this.options="object"==typeof t?t:this.defaults,"number"==typeof arguments[1]&&(this.options.size=arguments[1]),arguments[2]&&(this.options.margin=arguments[2]),this.hash=e,this.background=this.options.background||this.defaults.background,this.size=this.options.size||this.defaults.size,this.format=this.options.format||this.defaults.format,this.margin=this.options.margin!==undefined?this.options.margin:this.defaults.margin;var n=parseInt(this.hash.substr(-7),16)/268435455,i=this.options.saturation||this.defaults.saturation,r=this.options.brightness||this.defaults.brightness;this.foreground=this.options.foreground||this.hsl2rgb(n,i,r)};t.prototype={background:null,foreground:null,hash:null,margin:null,size:null,format:null,image:function(){return this.isSvg()?new n(this.size,this.foreground,this.background):new e(this.size,this.size,256)},render:function(){var e,t,n=this.image(),i=this.size,r=Math.floor(i*this.margin),o=Math.floor((i-2*r)/5),a=Math.floor((i-5*o)/2),s=n.color.apply(n,this.background),l=n.color.apply(n,this.foreground);for(e=0;e<15;e++)t=parseInt(this.hash.charAt(e),16)%2?s:l,e<5?this.rectangle(2*o+a,e*o+a,o,o,t,n):e<10?(this.rectangle(1*o+a,(e-5)*o+a,o,o,t,n),
4
- this.rectangle(3*o+a,(e-5)*o+a,o,o,t,n)):e<15&&(this.rectangle(0*o+a,(e-10)*o+a,o,o,t,n),this.rectangle(4*o+a,(e-10)*o+a,o,o,t,n));return n},rectangle:function(e,t,n,i,r,o){if(this.isSvg())o.rectangles.push({x:e,y:t,w:n,h:i,color:r});else{var a,s;for(a=e;a<e+n;a++)for(s=t;s<t+i;s++)o.buffer[o.index(a,s)]=r}},hsl2rgb:function(e,t,n){return e*=6,t=[n+=t*=n<.5?n:1-n,n-e%1*t*2,n-=t*=2,n,n+e%1*t,n+t],[255*t[~~e%6],255*t[(16|e)%6],255*t[(8|e)%6]]},toString:function(e){return e?this.render().getDump():this.render().getBase64()},isSvg:function(){return this.format.match(/svg/i)}};var n=function(e,t,n){this.size=e,this.foreground=this.color.apply(this,t),this.background=this.color.apply(this,n),this.rectangles=[]};n.prototype={size:null,foreground:null,background:null,rectangles:null,color:function(e,t,n,i){var r=[e,t,n].map(Math.round);return r.push(i>=0&&i<=255?i/255:1),"rgba("+r.join(",")+")"},getDump:function(){var e,t,n,i=this.foreground,r=this.background,o=.005*this.size;for(t="<svg xmlns='http://www.w3.org/2000/svg' width='"+this.size+"' height='"+this.size+"' style='background-color:"+r+";'><g style='fill:"+i+"; stroke:"+i+"; stroke-width:"+o+";'>",e=0;e<this.rectangles.length;e++)n=this.rectangles[e],n.color!=r&&(t+="<rect x='"+n.x+"' y='"+n.y+"' width='"+n.w+"' height='"+n.h+"'/>");return t+="</g></svg>"},getBase64:function(){if("function"==typeof btoa)return btoa(this.getDump());if(Buffer)return new Buffer(this.getDump(),"binary").toString("base64");throw"Cannot generate base64 output"}},"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=t:window.Identicon=t}(),function(e,t,n){function i(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function r(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return d[e.which]?d[e.which]:f[e.which]?f[e.which]:String.fromCharCode(e.which).toLowerCase()}function o(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}function a(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function s(e,t){var n,i,r,o=[];for(n=e,"+"===n?n=["+"]:(n=n.replace(/\+{2}/g,"+plus"),n=n.split("+")),r=0;r<n.length;++r)i=n[r],h[i]&&(i=h[i]),t&&"keypress"!=t&&p[i]&&(i=p[i],o.push("shift")),a(i)&&o.push(i);if(n=i,!(r=t)){if(!c){c={};for(var s in d)95<s&&112>s||d.hasOwnProperty(s)&&(c[d[s]]=s)}r=c[n]?"keydown":"keypress"}return"keypress"==r&&o.length&&(r="keydown"),{key:i,modifiers:o,action:r}}function l(e,n){return null!==e&&e!==t&&(e===n||l(e.parentNode,n))}function u(e){function n(e){e=e||{};var t,n=!1;for(t in m)e[t]?n=!0:m[t]=0;n||(b=!1)}function l(e,t,n,i,r,o){var s,l,u=[],c=n.type;if(!h._callbacks[e])return[];for("keyup"==c&&a(e)&&(t=[e]),s=0;s<h._callbacks[e].length;++s)if(l=h._callbacks[e][s],(i||!l.seq||m[l.seq]==l.level)&&c==l.action){var d;(d="keypress"==c&&!n.metaKey&&!n.ctrlKey)||(d=l.modifiers,d=t.sort().join(",")===d.sort().join(",")),d&&(d=i&&l.seq==i&&l.level==o,(!i&&l.combo==r||d)&&h._callbacks[e].splice(s,1),u.push(l))}return u}function c(e,t,n,i){h.stopCallback(t,t.target||t.srcElement,n,i)||!1!==e(t,n)||(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)}function d(e){"number"!=typeof e.which&&(e.which=e.keyCode);var t=r(e);t&&("keyup"==e.type&&y===t?y=!1:h.handleKey(t,o(e),e))}function f(e,t,i,o){function a(t){return function(){b=t,++m[e],clearTimeout(g),g=setTimeout(n,1e3)}}function l(t){c(i,t,e),"keyup"!==o&&(y=r(t)),setTimeout(n,10)}for(var u=m[e]=0;u<t.length;++u){var d=u+1===t.length?l:a(o||s(t[u+1]).action);p(t[u],d,o,e,u)}}function p(e,t,n,i,r){h._directMap[e+":"+n]=t,e=e.replace(/\s+/g," ");var o=e.split(" ");1<o.length?f(e,o,t,n):(n=s(e,n),h._callbacks[n.key]=h._callbacks[n.key]||[],l(n.key,n.modifiers,{type:n.action},i,e,r),h._callbacks[n.key][i?"unshift":"push"]({callback:t,modifiers:n.modifiers,action:n.action,seq:i,level:r,combo:e}))}var h=this;if(e=e||t,!(h instanceof u))return new u(e);h.target=e,h._callbacks={},h._directMap={};var g,m={},y=!1,v=!1,b=!1;h._handleKey=function(e,t,i){var r,o=l(e,t,i);t={};var s=0,u=!1;for(r=0;r<o.length;++r)o[r].seq&&(s=Math.max(s,o[r].level));for(r=0;r<o.length;++r)o[r].seq?o[r].level==s&&(u=!0,t[o[r].seq]=1,c(o[r].callback,i,o[r].combo,o[r].seq)):u||c(o[r].callback,i,o[r].combo);o="keypress"==i.type&&v,i.type!=b||a(e)||o||n(t),v=u&&"keydown"==i.type},h._bindMultiple=function(e,t,n){for(var i=0;i<e.length;++i)p(e[i],t,n)},i(e,"keypress",d),i(e,"keydown",d),i(e,"keyup",d)}if(e){var c,d={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},f={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},p={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},h={option:"alt",command:"meta","return":"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"};for(n=1;20>n;++n)d[111+n]="f"+n;for(n=0;9>=n;++n)d[n+96]=n.toString();u.prototype.bind=function(e,t,n){return e=e instanceof Array?e:[e],this._bindMultiple.call(this,e,t,n),this},u.prototype.unbind=function(e,t){return this.bind.call(this,e,function(){},t)},u.prototype.trigger=function(e,t){return this._directMap[e+":"+t]&&this._directMap[e+":"+t]({},e),this},u.prototype.reset=function(){return this._callbacks={},this._directMap={},this},u.prototype.stopCallback=function(e,t){return!(-1<(" "+t.className+" ").indexOf(" mousetrap ")||l(t,this.target))&&("INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable)},u.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},u.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(d[t]=e[t]);c=null},u.init=function(){var e,n=u(t);for(e in n)"_"!==e.charAt(0)&&(u[e]=function(e){return function(){return n[e].apply(n,arguments)}}(e))},u.init(),e.Mousetrap=u,"undefined"!=typeof module&&module.exports&&(module.exports=u),"function"==typeof define&&define.amd&&define(function(){return u})}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ClipboardJS=t():e.ClipboardJS=t()}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:i})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(i,r,function(t){return e[t]}.bind(null,r));return i},t.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=i(n(1)),l=i(n(3)),u=i(n(4)),c=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.resolveOptions(n),i.listenClick(t),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(e,l["default"]),a(e,[{key:"resolveOptions",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===o(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=(0,u["default"])(e,"click",function(e){return t.onClick(e)})}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new s["default"]({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return r("action",e)}},{key:"defaultTarget",value:function(e){var t=r("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return r("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach(function(e){n=n&&!!document.queryCommandSupported(e)}),n}}]),e}();e.exports=c},function(e,t,n){"use strict";var i,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(2),s=(i=a)&&i.__esModule?i:{"default":i},l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}return o(e,[{key:"resolveOptions",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,s["default"])(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,s["default"])(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==(void 0===e?"undefined":r(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}]),e}();e.exports=l},function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var i=window.getSelection(),r=document.createRange();r.selectNodeContents(e),i.removeAllRanges(),i.addRange(r),t=i.toString()}return t}},function(e){function t(){}t.prototype={on:function(e,t,n){var i=this.e||(this.e={});return(i[e]||(i[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function i(){r.off(e,i),t.apply(n,arguments)}var r=this;return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),i=0,r=n.length;i<r;i++)n[i].fn.apply(n[i].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),i=n[e],r=[];if(i&&t)for(var o=0,a=i.length;o<a;o++)i[o].fn!==t&&i[o].fn._!==t&&r.push(i[o]);return r.length?n[e]=r:delete n[e],this}},e.exports=t},function(e,t,n){var i=n(5),r=n(6);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!i.string(t))throw new TypeError("Second argument must be a String");if(!i.fn(n))throw new TypeError("Third argument must be a Function");if(i.node(e))return f=t,p=n,(d=e).addEventListener(f,p),{destroy:function(){d.removeEventListener(f,p)}};if(i.nodeList(e))return l=e,u=t,c=n,Array.prototype.forEach.call(l,function(e){e.addEventListener(u,c)}),{destroy:function(){Array.prototype.forEach.call(l,function(e){e.removeEventListener(u,c)})}};if(i.string(e))return o=e,a=t,s=n,r(document.body,o,a,s);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,a,s,l,u,c,d,f,p}},function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},function(e,t,n){function i(e,t,n,i,o){var a=function(e,t,n,i){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&i.call(e,n)}}.apply(this,arguments);return e.addEventListener(n,a,o),{destroy:function(){e.removeEventListener(n,a,o)}}}var r=n(7);e.exports=function(e,t,n,r,o){return"function"==typeof e.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,function(e){return i(e,t,n,r,o)}))}},function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}}])});var gollumRoutes=$.parseJSON('{"assets":"/gollum/assets","last_commit_info":"/gollum/last_commit_info","latest_changes":"/gollum/latest_changes","upload_file":"/gollum/upload_file","create":"/gollum/create","delete":"/gollum/delete","edit":"/gollum/edit","overview":"/gollum/overview","history":"/gollum/history","rename":"/gollum/rename","revert":"/gollum/revert","preview":"/gollum/preview","compare":"/gollum/compare","search":"/gollum/search"}');$(document).ready(function(){function e(){var e=new FormData($("#gollum-editor-form").get(0)),t=window.location.pathname.split("/"),n=window.location.hash.substr(1);e.append("page",t[t.length-1]||""),$.ajax({url:routePath("preview"),data:e,type:"POST",processData:!1,contentType:!1,success:function(e){var t=$("#wiki-wrapper",e);$(".tabnav-div#preview-content").html(t),preparePage(),n&&(sectionHeading=$("a#"+n+".anchor")[0])&&sectionHeading.scrollIntoView(),null!=window.MathJax&&window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,"preview-content"])},error:function(e,t,n){console.log("something went wrong: "+t+n)}})}function t(e){e?(active_div="#preview-content",active_tab="#preview.tabnav-tab"):(active_div="#edit-content",active_tab="#edit.tabnav-tab"),$(".tabnav-tab.selected").removeClass("selected"),$(active_tab).addClass("selected"),$(".tabnav-div").hide(),$(active_div).show()}$("#delete-link").click(function(e){confirm($(this).data("confirm"))&&$.post(routePath("delete")+"/"+pageFullPath,{},function(){window.location="/"}),e.preventDefault()}),$(".delete-file").click(function(e){if(confirm($(this).data("confirm"))){var t=$(this);$.post(routePath("delete")+"/"+$(this).data("file-path"),{},function(){t.closest("li").remove()})}e.preventDefault()}),$.browser.mozilla?$("body").addClass("ff"):$.browser.webkit?$("body").addClass("webkit"):$.browser.msie&&($("body").addClass("ie"),"7.0"==$.browser.version?$("body").addClass("ie7"):"8.0"==$.browser.version&&$("body").addClass("ie8")),$("#minibutton-upload-page").length&&(new ClipboardJS("#ClipboardJSlink"),$("#minibutton-upload-page").parent().removeClass("jaws"),$("#minibutton-upload-page").click(function(e){e.preventDefault(),$.GollumDialog.init({title:"Upload File",fields:[{type:"file",context:"Your uploaded file will be accessible at<br>/"+uploadDest+"/[filename]",action:routePath("upload_file")}],OK:function(){$("#wiki-content").addClass("uploading");var e=new FormData($("#upload").get(0)),t=$("#upload").attr("action");$.ajax({url:t,type:"POST",data:e,processData:!1,contentType:!1,success:function(){$("#wiki-content").removeClass("uploading"),flashNotice("success","Your file was successfully uploaded.")},error:function(e,t,n){$("#wiki-content").removeClass("uploading"),409==e.status?flashNotice("error","The file you tried to upload already exists. Please rename the file and try again."):flashNotice("error","Error uploading file: "+t+" "+n)}})}}),$("#gollum-dialog-action-ok").attr("disabled",!0),$("input:file").on("change",function(){$(this).val()&&(filename=$("input[type=file]").val().split("\\").pop(),upload_path="/"+uploadDest+"/"+filename,clipboard_button='<button class="btn btn-sm mb-2" id="ClipboardJSlink" data-clipboard-text="'+upload_path+'"><svg class="octicon octicon-clippy" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"/></svg></button>',news="Your uploaded file will be accessible at<br>"+clipboard_button+"&nbsp;"+upload_path,$(".context").html(news),$("#gollum-dialog-action-ok").attr("disabled",!1))})})),$("#minibutton-rename-page").length&&($("#minibutton-rename-page").parent().removeClass("jaws"),$("#minibutton-rename-page").click(function(e){e.preventDefault();var t=decodeURI(pagePath()),n=decodeURI(pageName()),i="Renamed page will be under <span class='path'>"+htmlEscape(cleanPath(t))+"</span> unless an absolute path is given.";$.GollumDialog.init({title:"Rename Page",fields:[{id:"name",name:"Rename to",type:"text",defaultValue:n||"",context:i}],OK:function(e){var i="Rename Page";e.name&&(i=e.name);var r=abspath(t,i),o=r[0],a="/"+t==o?"Renamed "+n+" to "+i:"Renamed "+n+" to "+r.join("/"),s=$("form[name=rename]");s.children("input[name=rename]").val(r.join("/")),s.children("input[name=message]").val(a),s.submit()}})})),$("#minibutton-new-page").length&&($("#minibutton-new-page").parent().removeClass("jaws"),$("#minibutton-new-page").click(function(e){e.preventDefault();var t=pagePath();t===undefined&&0!=$("#file-browser").length&&(t=window.location.pathname.replace(routePath("overview"),""));var n="Page will be created under <span class='path'>"+htmlEscape(cleanPath(t))+"</span> unless an absolute path is given.";$.GollumDialog.init({title:"Create New Page",fields:[{id:"name",name:"Page Name",type:"text",defaultValue:"",context:n}],OK:function(e){var n="New Page";e.name&&(n=e.name);for(var i=[],r=abspath(t,n).join("/").split("/"),o=0;o<r.length;o++)i.push(encodeURIComponent(r[o]));window.location=routePath("create")+i.join("/")}})})),$("#wiki-wrapper").hasClass("history")&&($("#wiki-history td.checkbox input").each(function(){$(this).click(function(){nodeSelector.checkNode($(this))}),$(this).is(":checked")&&nodeSelector.checkNode($(this))}),$(".history button.action-compare-revision").length&&$(".history button.action-compare-revision").click(function(){$("#selection-form").submit()})),$("#searchbar a#search-submit").length&&($.GollumPlaceholder.add($("#searchbar #search-query")),$("#searchbar a#search-submit").click(function(e){e.preventDefault(),$("#searchbar #search-form")[0].submit()}),$("#searchbar #search-form").submit(function(){$.GollumPlaceholder.clearAll(),$(this).unbind("submit"),$(this).submit()})),$("#gollum-revert-form").length&&$(".gollum-revert-button").length&&$("a.gollum-revert-button").click(function(e){e.preventDefault(),$("#gollum-revert-form").submit()}),$(".tabnav-tabs").length&&$(".tabnav-tab").click(function(n){n.preventDefault(),$(this).hasClass("selected")||(preview="preview"==$(this).attr("id"),preview&&e(),t(preview))});var n=function(){return $(".tabnav-tab").not(".selected").click(),!1},i=[{name:"saveContents",bindKey:{win:"Ctrl-s",mac:"Command-s"},exec:function(){$("#gollum-editor-submit").trigger("click")}},{name:"togglePreview",bindKey:{win:"ctrl-shift-p",mac:"ctrl-shift-p"},exec:n}];if(($("#wiki-wrapper.edit").length||$("#wiki-wrapper.create").length)&&Mousetrap.bind(["ctrl+shift+p"],n),$("#wiki-wrapper.edit").length&&($("#gollum-editor-submit").click(function(){window.onbeforeunload=null}),$("#gollum-editor-body").one("change",function(){window.onbeforeunload=function(){return"Leaving will discard all edits!"}}),$.GollumEditor({section:window.location.hash.substr(1),commands:i}),$("#gollum-editor-submit").click(function(e){e.preventDefault(),$(this).attr("disabled",!0);var t=new FormData($("#gollum-editor-form").get(0)),n="."+$("#wiki_format option:selected").attr("data-ext"),i=cleanPath(prefixBaseUrl(pagePath()+"/"+pageName()+n)),r=$("#gollum-editor-form").attr("action");$.ajax({url:r,type:"POST",data:t,processData:!1,contentType:!1,success:function(){window.location=i},error:function(e,t,n){412==e.status?($("#gollum-editor-submit").attr("disabled",!1),alert("Someone else has modified this page while you were editing it. Please store your version on disk outside of the browser, reload this page and reapply your modifications.")):alert("Error updating page: "+t+" "+n)}})})),$("#page-history").length&&$("#page-history #pagination").length){var r=2,o=["bg-green-light","bg-red-light"],a=function(){var e=0;$("#selection-form input").each(function(t,n){var i=$(n).val(),r=$('#version-form input[value="'+i+'"]');r.prop("checked",!0),0==t?r.closest("li").removeClass(o[1]).addClass(o[t]):1==t&&r.closest("li").addClass(o[t]),e+=1}),e==r?($("#version-form input:not(:checked)").prop("disabled",!0),$(".history button.action-compare-revision").prop("disabled",!1)):e<r&&($("#version-form input").prop("disabled",!1),$(".history button.action-compare-revision").prop("disabled",!0))},s=function(e){$("<input>").attr({type:"hidden",id:$(e).val(),name:"versions[]",value:$(e).val()}).appendTo($("#selection-form")),a()},l=function(e){$("#selection-form #"+$(e).val()).remove(),$(e).closest("li").removeClass(o.join(" ")),a()},u=function(){$("#version-form input").on("change",function(){this.checked?s(this):l(this)})};u(),a();var c=function(e){e.preventDefault(),$(this).hasClass("disabled")||$.ajax({url:$(this).attr("href"),type:"GET",success:function(e){var t=$("#page-history-list",e),n=$("#pagination",e);["#next","#prev"].forEach(function(e){old_btn=$("#pagination "+e),new_btn=n.find(e),old_btn.attr("href",new_btn.attr("href")),new_btn.hasClass("disabled")?old_btn.addClass("disabled"):old_btn.removeClass("disabled")}),$("#page-history-list").replaceWith(t),u(),a()},error:function(e,t,n){console.log("something went wrong: "+t+n)}}),this.blur()};$("#pagination #next, #pagination #prev").each(function(e,t){$(t).on("click",c)})}if($("#last-edit").length&&$("#page-info-toggle").click(function(){$.ajax({url:routePath("last_commit_info"),data:{path:$("#page-info-toggle").data("pagepath")},success:function(e){$("#last-edit").next(".dotted-spinner").toggleClass("hidden"),$("#last-edit-in-progress").html("Last edited by <b>"+e.author+"</b>, "+e.date)}}),$("#last-edit").next(".dotted-spinner").toggleClass("hidden"),$("#page-info-toggle").before('<span id="last-edit-in-progress">&nbsp;Getting commit info...</span>').remove()}),$("#wiki-wrapper.create").length&&($("#gollum-editor-submit").click(function(){window.onbeforeunload=null}),$("#gollum-editor-body").one("change",function(){window.onbeforeunload=function(){return"Leaving will not create a new page!"}}),$.GollumEditor({NewFile:!0,MarkupType:default_markup,commands:i})),$("#search-results").length){$(".toggle-context").each(function(){var e=$(this).parent().next("div.search-context").find("li:hidden");e.length?$(this).click(function(){e.toggle(),$(this).toggle()}):$(this).toggle()});var d=new RegExp(searchTerms.join("|"),"gi");$("div.search-context li span").each(function(){var e=$(this).html().replace(/"/g,"&quot;").replace(/'/g,"&#39;"),t=e.replace(d,function(e){return'<span class="bg-green-light">'+e+"</span>"});$(this).html(t)})}if($(".markdown-body").length&&(preparePage(),(match=new RegExp(/[?&]redirected\_from=([^?]*)/).exec(window.location.href))&&(notice="The page you requested was renamed or moved. You've been successfully redirected to its new location.",flashNotice("success",notice)),Mousetrap.bind(["e"],function(e){return e.preventDefault(),window.location=routePath("edit")+"/"+pageFullPath,!1}),$.markupSupportsEditableSections(pageFormat)&&$("a.anchor").each(function(e,t){if(header=$(t).closest(":header"),header.hasClass("editable")){var n=routePath("edit")+"/"+pageFullPath+$(t).attr("href");$(t).clone().addClass("edit").attr("href",n).appendTo(header)}})),$("#wiki-history").length||$("#page-history").length){var f={format:"svg",background:[255,255,255,255]};$("img.identicon").each(function(e,t){var n=$(t),i=n.data("identicon"),r=new Identicon(i,f).toString();r="data:image/svg+xml;base64,"+r,n.attr("src",r)})}}),function(e){var t={debugOn:!1,markupCreated:!1,markup:"",currentAspect:function(){return window.innerWidth<480?"small-mobile":"fixed"==e("#gollum-dialog-dialog").css("position")?"large-mobile":"desktop"},attachEvents:function(n){e("#gollum-dialog-action-ok").click(function(e){t.eventOK(e,n)}),e("#gollum-dialog-action-cancel").click(t.eventCancel),e('#gollum-dialog-dialog input[type="text"]').keydown(function(e){13==e.keyCode&&t.eventOK(e,n)})},detachEvents:function(){e("#gollum-dialog-action-ok").unbind("click"),e("#gollum-dialog-action-cancel").unbind("click")},createFieldMarkup:function(e){for(var n="<fieldset>",i=0;i<e.length;i++)if("object"==typeof e[i]){switch(n+='<div class="field">',e[i].type){case"text":n+=t.createFieldText(e[i]);break;case"file":n+=t.createFieldFile(e[i])}n+="</div>"}return n+="</fieldset>"},createFieldText:function(e){var t="";return e.name&&(t+="<label",e.id&&(t+=' for="gollum-dialog-dialog-generated-field-'+e.id+'"'),t+=">"+e.name+"</label>"),t+='<input type="text" class="form-control input-sm width-full"',e.id&&(t+=' name="'+e.id+'"',"code"==e.type&&(t+=' class="code"'),e.defaultValue&&(t+=' value="'+e.defaultValue.split('"').join("&quot;")+'"'),t+=' id="gollum-dialog-dialog-generated-field-'+e.id+'">'),e.context&&(t+='<span class="context">'+e.context+"</span>"),t},createFieldFile:function(e){var t="",n=e.id||"upload",i=e.name||"file";return t+='<form method=post enctype="multipart/form-data" action="'+(e.action||routePath("upload_file"))+'" id="'+n+'">',t+='<input type=file name="'+i+'" class="form-control width-full">',t+="</form>",e.context&&(t+='<span class="context">'+e.context+"</span>"),t},createMarkup:function(e,n){return t.markupCreated=!0,'<div id="gollum-dialog-dialog"><div id="gollum-dialog-dialog-inner" class="border rounded-1"><div id="gollum-dialog-dialog-title"><h4>'+e+'</h4></div><div id="gollum-dialog-dialog-body">'+n+'</div><div id="gollum-dialog-dialog-buttons" class="pt-2 float-right"><button name="Cancel" id="gollum-dialog-action-cancel" class="btn">Cancel</button><span class="px-1"></span><button name="OK" id="gollum-dialog-action-ok" class="btn btn-primary">OK</button></div></div></div>'},eventCancel:function(e){e.preventDefault(),n("Cancelled dialog."),t.hide()},eventOK:function(n,i){n.preventDefault();var r=[];e("#gollum-dialog-dialog-body input").each(function(){r[e(this).attr("name")]=e(this).val()}),i&&"function"==typeof i&&i(r),t.hide()},hide:function(){e.browser.msie?(e("#gollum-dialog-dialog").hide().removeClass("active"),e("select").css("visibility","visible")):(e("#gollum-dialog-dialog").animate({opacity:0},{duration:200,complete:function(){e("#gollum-dialog-dialog").removeClass("active"),e("#gollum-dialog-dialog").css("display","none")}}),e(window).unbind("resize",t.resize))},init:function(i){var r="",o="";if(!i||"object"!=typeof i)return void n("Editor Dialog: Cannot init; invalid init object");i.body&&"string"==typeof i.body&&(o="<p>"+i.body+"</p>"),i.fields&&"object"==typeof i.fields&&(o+=t.createFieldMarkup(i.fields)),i.title&&"string"==typeof i.title&&(r=i.title),t.markupCreated&&e("#gollum-dialog-dialog").remove(),t.markup=t.createMarkup(r,o),e("body").append(t.markup),i.OK&&"function"==typeof i.OK&&t.attachEvents(i.OK),t.show()},show:function(){t.markupCreated?(n("Showing dialog"),e.browser.msie?(e("#gollum-dialog.dialog").addClass("active"),t.position(),e("select").css("visibility","hidden")):(e("#gollum-dialog.dialog").css("display","none"),e("#gollum-dialog-dialog").animate({opacity:0},{duration:0,complete:function(){e("#gollum-dialog-dialog").css("display","block"),t.position(),e("#gollum-dialog-dialog").animate({opacity:1},{duration:500}),e(e('#gollum-dialog-dialog input[type="text"]').get(0)).focus()}})),e(window).bind("resize",t.resize)):n("Dialog: No markup to show. Please use init first.")},resize:function(){t.position()},position:function(){if("small-mobile"==t.currentAspect())e("#gollum-dialog-dialog-inner").css("height","100%").css("margin-top","auto");else if("large-mobile"==t.currentAspect())e("#gollum-dialog-dialog-inner").css("height","auto").css("margin-top","auto");else if("desktop"==t.currentAspect()){
4
+ this.rectangle(3*o+a,(e-5)*o+a,o,o,t,n)):e<15&&(this.rectangle(0*o+a,(e-10)*o+a,o,o,t,n),this.rectangle(4*o+a,(e-10)*o+a,o,o,t,n));return n},rectangle:function(e,t,n,i,r,o){if(this.isSvg())o.rectangles.push({x:e,y:t,w:n,h:i,color:r});else{var a,s;for(a=e;a<e+n;a++)for(s=t;s<t+i;s++)o.buffer[o.index(a,s)]=r}},hsl2rgb:function(e,t,n){return e*=6,t=[n+=t*=n<.5?n:1-n,n-e%1*t*2,n-=t*=2,n,n+e%1*t,n+t],[255*t[~~e%6],255*t[(16|e)%6],255*t[(8|e)%6]]},toString:function(e){return e?this.render().getDump():this.render().getBase64()},isSvg:function(){return this.format.match(/svg/i)}};var n=function(e,t,n){this.size=e,this.foreground=this.color.apply(this,t),this.background=this.color.apply(this,n),this.rectangles=[]};n.prototype={size:null,foreground:null,background:null,rectangles:null,color:function(e,t,n,i){var r=[e,t,n].map(Math.round);return r.push(i>=0&&i<=255?i/255:1),"rgba("+r.join(",")+")"},getDump:function(){var e,t,n,i=this.foreground,r=this.background,o=.005*this.size;for(t="<svg xmlns='http://www.w3.org/2000/svg' width='"+this.size+"' height='"+this.size+"' style='background-color:"+r+";'><g style='fill:"+i+"; stroke:"+i+"; stroke-width:"+o+";'>",e=0;e<this.rectangles.length;e++)n=this.rectangles[e],n.color!=r&&(t+="<rect x='"+n.x+"' y='"+n.y+"' width='"+n.w+"' height='"+n.h+"'/>");return t+="</g></svg>"},getBase64:function(){if("function"==typeof btoa)return btoa(this.getDump());if(Buffer)return new Buffer(this.getDump(),"binary").toString("base64");throw"Cannot generate base64 output"}},"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=t:window.Identicon=t}(),function(e,t,n){function i(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function r(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return d[e.which]?d[e.which]:f[e.which]?f[e.which]:String.fromCharCode(e.which).toLowerCase()}function o(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}function a(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function s(e,t){var n,i,r,o=[];for(n=e,"+"===n?n=["+"]:(n=n.replace(/\+{2}/g,"+plus"),n=n.split("+")),r=0;r<n.length;++r)i=n[r],h[i]&&(i=h[i]),t&&"keypress"!=t&&p[i]&&(i=p[i],o.push("shift")),a(i)&&o.push(i);if(n=i,!(r=t)){if(!c){c={};for(var s in d)95<s&&112>s||d.hasOwnProperty(s)&&(c[d[s]]=s)}r=c[n]?"keydown":"keypress"}return"keypress"==r&&o.length&&(r="keydown"),{key:i,modifiers:o,action:r}}function l(e,n){return null!==e&&e!==t&&(e===n||l(e.parentNode,n))}function u(e){function n(e){e=e||{};var t,n=!1;for(t in m)e[t]?n=!0:m[t]=0;n||(b=!1)}function l(e,t,n,i,r,o){var s,l,u=[],c=n.type;if(!h._callbacks[e])return[];for("keyup"==c&&a(e)&&(t=[e]),s=0;s<h._callbacks[e].length;++s)if(l=h._callbacks[e][s],(i||!l.seq||m[l.seq]==l.level)&&c==l.action){var d;(d="keypress"==c&&!n.metaKey&&!n.ctrlKey)||(d=l.modifiers,d=t.sort().join(",")===d.sort().join(",")),d&&(d=i&&l.seq==i&&l.level==o,(!i&&l.combo==r||d)&&h._callbacks[e].splice(s,1),u.push(l))}return u}function c(e,t,n,i){h.stopCallback(t,t.target||t.srcElement,n,i)||!1!==e(t,n)||(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation?t.stopPropagation():t.cancelBubble=!0)}function d(e){"number"!=typeof e.which&&(e.which=e.keyCode);var t=r(e);t&&("keyup"==e.type&&y===t?y=!1:h.handleKey(t,o(e),e))}function f(e,t,i,o){function a(t){return function(){b=t,++m[e],clearTimeout(g),g=setTimeout(n,1e3)}}function l(t){c(i,t,e),"keyup"!==o&&(y=r(t)),setTimeout(n,10)}for(var u=m[e]=0;u<t.length;++u){var d=u+1===t.length?l:a(o||s(t[u+1]).action);p(t[u],d,o,e,u)}}function p(e,t,n,i,r){h._directMap[e+":"+n]=t,e=e.replace(/\s+/g," ");var o=e.split(" ");1<o.length?f(e,o,t,n):(n=s(e,n),h._callbacks[n.key]=h._callbacks[n.key]||[],l(n.key,n.modifiers,{type:n.action},i,e,r),h._callbacks[n.key][i?"unshift":"push"]({callback:t,modifiers:n.modifiers,action:n.action,seq:i,level:r,combo:e}))}var h=this;if(e=e||t,!(h instanceof u))return new u(e);h.target=e,h._callbacks={},h._directMap={};var g,m={},y=!1,v=!1,b=!1;h._handleKey=function(e,t,i){var r,o=l(e,t,i);t={};var s=0,u=!1;for(r=0;r<o.length;++r)o[r].seq&&(s=Math.max(s,o[r].level));for(r=0;r<o.length;++r)o[r].seq?o[r].level==s&&(u=!0,t[o[r].seq]=1,c(o[r].callback,i,o[r].combo,o[r].seq)):u||c(o[r].callback,i,o[r].combo);o="keypress"==i.type&&v,i.type!=b||a(e)||o||n(t),v=u&&"keydown"==i.type},h._bindMultiple=function(e,t,n){for(var i=0;i<e.length;++i)p(e[i],t,n)},i(e,"keypress",d),i(e,"keydown",d),i(e,"keyup",d)}if(e){var c,d={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},f={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},p={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},h={option:"alt",command:"meta","return":"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"};for(n=1;20>n;++n)d[111+n]="f"+n;for(n=0;9>=n;++n)d[n+96]=n.toString();u.prototype.bind=function(e,t,n){return e=e instanceof Array?e:[e],this._bindMultiple.call(this,e,t,n),this},u.prototype.unbind=function(e,t){return this.bind.call(this,e,function(){},t)},u.prototype.trigger=function(e,t){return this._directMap[e+":"+t]&&this._directMap[e+":"+t]({},e),this},u.prototype.reset=function(){return this._callbacks={},this._directMap={},this},u.prototype.stopCallback=function(e,t){return!(-1<(" "+t.className+" ").indexOf(" mousetrap ")||l(t,this.target))&&("INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable)},u.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},u.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(d[t]=e[t]);c=null},u.init=function(){var e,n=u(t);for(e in n)"_"!==e.charAt(0)&&(u[e]=function(e){return function(){return n[e].apply(n,arguments)}}(e))},u.init(),e.Mousetrap=u,"undefined"!=typeof module&&module.exports&&(module.exports=u),"function"==typeof define&&define.amd&&define(function(){return u})}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ClipboardJS=t():e.ClipboardJS=t()}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:i})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(i,r,function(t){return e[t]}.bind(null,r));return i},t.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=i(n(1)),l=i(n(3)),u=i(n(4)),c=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return i.resolveOptions(n),i.listenClick(t),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(e,l["default"]),a(e,[{key:"resolveOptions",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===o(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=(0,u["default"])(e,"click",function(e){return t.onClick(e)})}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new s["default"]({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return r("action",e)}},{key:"defaultTarget",value:function(e){var t=r("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return r("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach(function(e){n=n&&!!document.queryCommandSupported(e)}),n}}]),e}();e.exports=c},function(e,t,n){"use strict";var i,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=n(2),s=(i=a)&&i.__esModule?i:{"default":i},l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}return o(e,[{key:"resolveOptions",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,s["default"])(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,s["default"])(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==(void 0===e?"undefined":r(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}]),e}();e.exports=l},function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var i=window.getSelection(),r=document.createRange();r.selectNodeContents(e),i.removeAllRanges(),i.addRange(r),t=i.toString()}return t}},function(e){function t(){}t.prototype={on:function(e,t,n){var i=this.e||(this.e={});return(i[e]||(i[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function i(){r.off(e,i),t.apply(n,arguments)}var r=this;return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),i=0,r=n.length;i<r;i++)n[i].fn.apply(n[i].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),i=n[e],r=[];if(i&&t)for(var o=0,a=i.length;o<a;o++)i[o].fn!==t&&i[o].fn._!==t&&r.push(i[o]);return r.length?n[e]=r:delete n[e],this}},e.exports=t},function(e,t,n){var i=n(5),r=n(6);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!i.string(t))throw new TypeError("Second argument must be a String");if(!i.fn(n))throw new TypeError("Third argument must be a Function");if(i.node(e))return f=t,p=n,(d=e).addEventListener(f,p),{destroy:function(){d.removeEventListener(f,p)}};if(i.nodeList(e))return l=e,u=t,c=n,Array.prototype.forEach.call(l,function(e){e.addEventListener(u,c)}),{destroy:function(){Array.prototype.forEach.call(l,function(e){e.removeEventListener(u,c)})}};if(i.string(e))return o=e,a=t,s=n,r(document.body,o,a,s);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,a,s,l,u,c,d,f,p}},function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},function(e,t,n){function i(e,t,n,i,o){var a=function(e,t,n,i){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&i.call(e,n)}}.apply(this,arguments);return e.addEventListener(n,a,o),{destroy:function(){e.removeEventListener(n,a,o)}}}var r=n(7);e.exports=function(e,t,n,r,o){return"function"==typeof e.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,function(e){return i(e,t,n,r,o)}))}},function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}}])});var gollumRoutes=$.parseJSON('{"assets":"/gollum/assets","last_commit_info":"/gollum/last_commit_info","latest_changes":"/gollum/latest_changes","upload_file":"/gollum/upload_file","create":"/gollum/create","delete":"/gollum/delete","edit":"/gollum/edit","overview":"/gollum/overview","history":"/gollum/history","rename":"/gollum/rename","revert":"/gollum/revert","preview":"/gollum/preview","compare":"/gollum/compare","search":"/gollum/search"}');$(document).ready(function(){function e(){var e=new FormData($("#gollum-editor-form").get(0)),t=window.location.pathname.split("/"),n=window.location.hash.substr(1);e.append("page",t[t.length-1]||""),$.ajax({url:routePath("preview"),data:e,type:"POST",processData:!1,contentType:!1,success:function(e){var t=$("#wiki-wrapper",e);$(".tabnav-div#preview-content").html(t),preparePage(),n&&(sectionHeading=$("a#"+n+".anchor")[0])&&sectionHeading.scrollIntoView(),null!=window.MathJax&&window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,"preview-content"])},error:function(e,t,n){console.log("something went wrong: "+t+n)}})}function t(e){e?(active_div="#preview-content",active_tab="#preview.tabnav-tab"):(active_div="#edit-content",active_tab="#edit.tabnav-tab"),$(".tabnav-tab.selected").removeClass("selected"),$(active_tab).addClass("selected"),$(".tabnav-div").hide(),$(active_div).show()}$("#delete-link").click(function(e){confirm($(this).data("confirm"))&&$.post(routePath("delete")+"/"+pageFullPath,{},function(){window.location="/"}),e.preventDefault()}),$(".delete-file").click(function(e){if(confirm($(this).data("confirm"))){var t=$(this);$.post(routePath("delete")+"/"+$(this).data("file-path"),{},function(){t.closest("li").remove()})}e.preventDefault()}),$.browser.mozilla?$("body").addClass("ff"):$.browser.webkit?$("body").addClass("webkit"):$.browser.msie&&($("body").addClass("ie"),"7.0"==$.browser.version?$("body").addClass("ie7"):"8.0"==$.browser.version&&$("body").addClass("ie8")),$("#minibutton-upload-page").length&&(new ClipboardJS("#ClipboardJSlink"),$("#minibutton-upload-page").parent().removeClass("jaws"),$("#minibutton-upload-page").click(function(e){e.preventDefault(),$.GollumDialog.init({title:"Upload File",fields:[{type:"file",context:"Your uploaded file will be accessible at<br>/"+uploadDest+"/[filename]",action:routePath("upload_file")}],OK:function(){$("#wiki-content").addClass("uploading");var e=new FormData($("#upload").get(0)),t=$("#upload").attr("action");$.ajax({url:t,type:"POST",data:e,processData:!1,contentType:!1,success:function(){$("#wiki-content").removeClass("uploading"),flashNotice("success","Your file was successfully uploaded.")},error:function(e,t,n){$("#wiki-content").removeClass("uploading"),409==e.status?flashNotice("error","The file you tried to upload already exists. Please rename the file and try again."):flashNotice("error","Error uploading file: "+t+" "+n)}})}}),$("#gollum-dialog-action-ok").attr("disabled",!0),$("input:file").on("change",function(){$(this).val()&&(filename=$("input[type=file]").val().split("\\").pop(),upload_path="/"+uploadDest+"/"+filename,clipboard_button='<button class="btn btn-sm mb-2" id="ClipboardJSlink" data-clipboard-text="'+upload_path+'"><svg class="octicon octicon-clippy" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"/></svg></button>',news="Your uploaded file will be accessible at<br>"+clipboard_button+"&nbsp;"+upload_path,$(".context").html(news),$("#gollum-dialog-action-ok").attr("disabled",!1))})})),$("#minibutton-rename-page").length&&($("#minibutton-rename-page").parent().removeClass("jaws"),$("#minibutton-rename-page").click(function(e){e.preventDefault();var t=decodeURI(pagePath()),n=decodeURI(pageName()),i="Renamed page will be under <span class='path'>"+htmlEscape(cleanPath(t))+"</span> unless an absolute path is given.";$.GollumDialog.init({title:"Rename Page",fields:[{id:"name",name:"Rename to",type:"text",defaultValue:n||"",context:i}],OK:function(e){var i="Rename Page";e.name&&(i=e.name);var r=abspath(t,i),o=r[0],a="/"+t==o?"Renamed "+n+" to "+i:"Renamed "+n+" to "+r.join("/"),s=$("form[name=rename]");s.children("input[name=rename]").val(r.join("/")),s.children("input[name=message]").val(a),s.submit()}})})),$("#minibutton-new-page").length&&($("#minibutton-new-page").parent().removeClass("jaws"),$("#minibutton-new-page").click(function(e){e.preventDefault();var t=pagePath();t===undefined&&0!=$("#file-browser").length&&(t=window.location.pathname.replace(routePath("overview"),""));var n="Page will be created under <span class='path'>"+htmlEscape(cleanPath(t))+"</span> unless an absolute path is given.";$.GollumDialog.init({title:"Create New Page",fields:[{id:"name",name:"Page Name",type:"text",defaultValue:"",context:n}],OK:function(e){var n="New Page";e.name&&(n=e.name);for(var i=[],r=abspath(t,n).join("/").split("/"),o=0;o<r.length;o++)i.push(encodeURIComponent(r[o]));window.location=routePath("create")+i.join("/")}})})),$("#wiki-wrapper").hasClass("history")&&($("#wiki-history td.checkbox input").each(function(){$(this).click(function(){nodeSelector.checkNode($(this))}),$(this).is(":checked")&&nodeSelector.checkNode($(this))}),$(".history button.action-compare-revision").length&&$(".history button.action-compare-revision").click(function(){$("#selection-form").submit()})),$("#searchbar a#search-submit").length&&($.GollumPlaceholder.add($("#searchbar #search-query")),$("#searchbar a#search-submit").click(function(e){e.preventDefault(),$("#searchbar #search-form")[0].submit()}),$("#searchbar #search-form").submit(function(){$.GollumPlaceholder.clearAll(),$(this).unbind("submit"),$(this).submit()})),$("#gollum-revert-form").length&&$(".gollum-revert-button").length&&$("a.gollum-revert-button").click(function(e){e.preventDefault(),$("#gollum-revert-form").submit()}),$(".tabnav-tabs").length&&$(".tabnav-tab").click(function(n){n.preventDefault(),$(this).hasClass("selected")||(preview="preview"==$(this).attr("id"),preview&&e(),t(preview))});var n=function(){return $(".tabnav-tab").not(".selected").click(),!1},i=[{name:"saveContents",bindKey:{win:"Ctrl-s",mac:"Command-s"},exec:function(){$("#gollum-editor-submit").trigger("click")}},{name:"togglePreview",bindKey:{win:"ctrl-shift-p",mac:"ctrl-shift-p"},exec:n}];if(($("#wiki-wrapper.edit").length||$("#wiki-wrapper.create").length)&&Mousetrap.bind(["ctrl+shift+p"],n),$("#wiki-wrapper.edit").length&&($("#gollum-editor-submit").click(function(){window.onbeforeunload=null}),$("#gollum-editor-body").one("change",function(){window.onbeforeunload=function(){return"Leaving will discard all edits!"}}),$.GollumEditor({section:window.location.hash.substr(1),commands:i}),$("#gollum-editor-submit").click(function(e){e.preventDefault(),$(this).attr("disabled",!0);var t=new FormData($("#gollum-editor-form").get(0)),n="."+$("#wiki_format option:selected").attr("data-ext"),i=cleanPath(prefixBaseUrl(pagePath()+"/"+pageName()+n)),r=$("#gollum-editor-form").attr("action");$.ajax({url:r,type:"POST",data:t,processData:!1,contentType:!1,success:function(){window.location=i},error:function(e,t,n){412==e.status?($("#gollum-editor-submit").attr("disabled",!1),alert("Someone else has modified this page while you were editing it. Please store your version on disk outside of the browser, reload this page and reapply your modifications.")):alert("Error updating page: "+t+" "+n)}})})),$("#page-history").length&&$("#page-history #pagination").length){var r=2,o=["bg-green-light","bg-red-light"],a=function(){var e=0;$("#selection-form input").each(function(t,n){var i=$(n).val(),r=$('#version-form input[value="'+i+'"]');r.prop("checked",!0),0==t?r.closest("li").removeClass(o[1]).addClass(o[t]):1==t&&r.closest("li").addClass(o[t]),e+=1}),e<1?$(".history button.action-compare-revision").prop("disabled",!0):e<r?($(".history button.action-compare-revision").prop("disabled",!1),$("#version-form input").prop("disabled",!1)):$("#version-form input:not(:checked)").prop("disabled",!0)},s=function(e){$("<input>").attr({type:"hidden",id:$(e).val(),name:"versions[]",value:$(e).val()}).appendTo($("#selection-form")),a()},l=function(e){$("#selection-form #"+$(e).val()).remove(),$(e).closest("li").removeClass(o.join(" ")),a()},u=function(){$("#version-form input").on("change",function(){this.checked?s(this):l(this)})};u(),a();var c=function(e){e.preventDefault(),$(this).hasClass("disabled")||$.ajax({url:$(this).attr("href"),type:"GET",success:function(e){var t=$("#page-history-list",e),n=$("#pagination",e);["#next","#prev"].forEach(function(e){old_btn=$("#pagination "+e),new_btn=n.find(e),old_btn.attr("href",new_btn.attr("href")),new_btn.hasClass("disabled")?old_btn.addClass("disabled"):old_btn.removeClass("disabled")}),$("#page-history-list").replaceWith(t),u(),a()},error:function(e,t,n){console.log("something went wrong: "+t+n)}}),this.blur()};$("#pagination #next, #pagination #prev").each(function(e,t){$(t).on("click",c)})}if($("#last-edit").length&&$("#page-info-toggle").click(function(){$.ajax({url:routePath("last_commit_info"),data:{path:$("#page-info-toggle").data("pagepath")},success:function(e){$("#last-edit").next(".dotted-spinner").toggleClass("hidden"),$("#last-edit-in-progress").html("Last edited by <b>"+e.author+"</b>, "+e.date)}}),$("#last-edit").next(".dotted-spinner").toggleClass("hidden"),$("#page-info-toggle").before('<span id="last-edit-in-progress">&nbsp;Getting commit info...</span>').remove()}),$("#wiki-wrapper.create").length&&($("#gollum-editor-submit").click(function(){window.onbeforeunload=null}),$("#gollum-editor-body").one("change",function(){window.onbeforeunload=function(){return"Leaving will not create a new page!"}}),$.GollumEditor({NewFile:!0,MarkupType:default_markup,commands:i})),$("#search-results").length){$(".toggle-context").each(function(){var e=$(this).parent().next("div.search-context").find("li:hidden");e.length?$(this).click(function(){e.toggle(),$(this).toggle()}):$(this).toggle()});var d=new RegExp(searchTerms.join("|"),"gi");$("div.search-context li span").each(function(){var e=$(this).html().replace(/"/g,"&quot;").replace(/'/g,"&#39;"),t=e.replace(d,function(e){return'<span class="bg-green-light">'+e+"</span>"});$(this).html(t)})}if($(".markdown-body").length&&(preparePage(),(match=new RegExp(/[?&]redirected\_from=([^?]*)/).exec(window.location.href))&&(notice="The page you requested was renamed or moved. You've been successfully redirected to its new location.",flashNotice("success",notice)),Mousetrap.bind(["e"],function(e){return e.preventDefault(),window.location=routePath("edit")+"/"+pageFullPath,!1}),$.markupSupportsEditableSections(pageFormat)&&$("a.anchor").each(function(e,t){if(header=$(t).closest(":header"),header.hasClass("editable")){var n=routePath("edit")+"/"+pageFullPath+$(t).attr("href");$(t).clone().addClass("edit").attr("href",n).appendTo(header)}})),$("#wiki-history").length||$("#page-history").length){var f={format:"svg",background:[255,255,255,255]};$("img.identicon").each(function(e,t){var n=$(t),i=n.data("identicon"),r=new Identicon(i,f).toString();r="data:image/svg+xml;base64,"+r,n.attr("src",r)})}}),function(e){var t={debugOn:!1,markupCreated:!1,markup:"",currentAspect:function(){return window.innerWidth<480?"small-mobile":"fixed"==e("#gollum-dialog-dialog").css("position")?"large-mobile":"desktop"},attachEvents:function(n){e("#gollum-dialog-action-ok").click(function(e){t.eventOK(e,n)}),e("#gollum-dialog-action-cancel").click(t.eventCancel),e('#gollum-dialog-dialog input[type="text"]').keydown(function(e){13==e.keyCode&&t.eventOK(e,n)})},detachEvents:function(){e("#gollum-dialog-action-ok").unbind("click"),e("#gollum-dialog-action-cancel").unbind("click")},createFieldMarkup:function(e){for(var n="<fieldset>",i=0;i<e.length;i++)if("object"==typeof e[i]){switch(n+='<div class="field">',e[i].type){case"text":n+=t.createFieldText(e[i]);break;case"file":n+=t.createFieldFile(e[i])}n+="</div>"}return n+="</fieldset>"},createFieldText:function(e){var t="";return e.name&&(t+="<label",e.id&&(t+=' for="gollum-dialog-dialog-generated-field-'+e.id+'"'),t+=">"+e.name+"</label>"),t+='<input type="text" class="form-control input-sm width-full"',e.id&&(t+=' name="'+e.id+'"',"code"==e.type&&(t+=' class="code"'),e.defaultValue&&(t+=' value="'+e.defaultValue.split('"').join("&quot;")+'"'),t+=' id="gollum-dialog-dialog-generated-field-'+e.id+'">'),e.context&&(t+='<span class="context">'+e.context+"</span>"),t},createFieldFile:function(e){var t="",n=e.id||"upload",i=e.name||"file";return t+='<form method=post enctype="multipart/form-data" action="'+(e.action||routePath("upload_file"))+'" id="'+n+'">',t+='<input type=file name="'+i+'" class="form-control width-full">',t+="</form>",e.context&&(t+='<span class="context">'+e.context+"</span>"),t},createMarkup:function(e,n){return t.markupCreated=!0,'<div id="gollum-dialog-dialog"><div id="gollum-dialog-dialog-inner" class="border rounded-1"><div id="gollum-dialog-dialog-title"><h4>'+e+'</h4></div><div id="gollum-dialog-dialog-body">'+n+'</div><div id="gollum-dialog-dialog-buttons" class="pt-2 float-right"><button name="Cancel" id="gollum-dialog-action-cancel" class="btn">Cancel</button><span class="px-1"></span><button name="OK" id="gollum-dialog-action-ok" class="btn btn-primary">OK</button></div></div></div>'},eventCancel:function(e){e.preventDefault(),n("Cancelled dialog."),t.hide()},eventOK:function(n,i){n.preventDefault();var r=[];e("#gollum-dialog-dialog-body input").each(function(){r[e(this).attr("name")]=e(this).val()}),i&&"function"==typeof i&&i(r),t.hide()},hide:function(){e.browser.msie?(e("#gollum-dialog-dialog").hide().removeClass("active"),e("select").css("visibility","visible")):(e("#gollum-dialog-dialog").animate({opacity:0},{duration:200,complete:function(){e("#gollum-dialog-dialog").removeClass("active"),e("#gollum-dialog-dialog").css("display","none")}}),e(window).unbind("resize",t.resize))},init:function(i){var r="",o="";if(!i||"object"!=typeof i)return void n("Editor Dialog: Cannot init; invalid init object");i.body&&"string"==typeof i.body&&(o="<p>"+i.body+"</p>"),i.fields&&"object"==typeof i.fields&&(o+=t.createFieldMarkup(i.fields)),i.title&&"string"==typeof i.title&&(r=i.title),t.markupCreated&&e("#gollum-dialog-dialog").remove(),t.markup=t.createMarkup(r,o),e("body").append(t.markup),i.OK&&"function"==typeof i.OK&&t.attachEvents(i.OK),t.show()},show:function(){t.markupCreated?(n("Showing dialog"),e.browser.msie?(e("#gollum-dialog.dialog").addClass("active"),t.position(),e("select").css("visibility","hidden")):(e("#gollum-dialog.dialog").css("display","none"),e("#gollum-dialog-dialog").animate({opacity:0},{duration:0,complete:function(){e("#gollum-dialog-dialog").css("display","block"),t.position(),e("#gollum-dialog-dialog").animate({opacity:1},{duration:500}),e(e('#gollum-dialog-dialog input[type="text"]').get(0)).focus()}})),e(window).bind("resize",t.resize)):n("Dialog: No markup to show. Please use init first.")},resize:function(){t.position()},position:function(){if("small-mobile"==t.currentAspect())e("#gollum-dialog-dialog-inner").css("height","100%").css("margin-top","auto");else if("large-mobile"==t.currentAspect())e("#gollum-dialog-dialog-inner").css("height","auto").css("margin-top","auto");else if("desktop"==t.currentAspect()){
5
5
  var n=e("#gollum-dialog-dialog-inner").height();e("#gollum-dialog-dialog-inner").css("height",n+"px").css("margin-top",-1*parseInt(n/2))}}},n=function(e){t.debugOn&&"undefined"!=typeof console&&console.log(e)};e.GollumDialog=t}(jQuery),function(e){var t={_PLACEHOLDERS:[],_p:function(t){this.fieldObject=t,this.placeholderText=t.val();var n=t.val();t.addClass("ph"),t.blur(function(){""==e(this).val()&&(e(this).val(n),e(this).addClass("ph"))}),t.focus(function(){e(this).removeClass("ph"),e(this).val()==n?e(this).val(""):e(this)[0].select()})},add:function(e){t._PLACEHOLDERS.push(new t._p(e))},clearAll:function(){for(var e=0;e<t._PLACEHOLDERS.length;e++)t._PLACEHOLDERS[e].fieldObject.val()==t._PLACEHOLDERS[e].placeholderText&&t._PLACEHOLDERS[e].fieldObject.val("")},exists:function(){return _PLACEHOLDERS.length}};e.GollumPlaceholder=t}(jQuery),function(e){function t(e){var t=window.ace_editor.getSession();return tokens=t.getTokens(e),section=tokens.filter(function(e){return e.type.startsWith("markup.heading")})[0],header=tokens.filter(function(e){return/^(heading)|(text)$/.test(e.type)})[0],[section,header]}function n(e,t,n){if(!n||!n["find-header-line"])return[];var i=n["find-header-line"](e,t);return null==i?[]:[i[0],i[1]]}function r(e){return e.trim().replace(/[^a-z0-9_\s]/gi," ").replace(/\s\s+/g," ").split(/\s/).join("-").replace(/^-/,"").toLowerCase()}e.markupSupportsEditableSections=function(e){return["markdown","textile","asciidoc","rst"].includes(e)},e.findSection=function(e,o){var a={};for(i=0;i<window.ace_editor.getSession().getLength();i++){var s=null,l=t(i),u=l[0],c=l[1];if(u){if(c)c=c.value,s=i;else{var d=n(i,u.value,o);if(!d.length)continue;c=d[0],s=d[1]}if(c=r(c),(index=a[c])?(c=c+"-"+index.toString(),a[c]=index+1):a[c]=1,c==e)return s}}return null}}(jQuery),function(e){function t(e){var t=e.__resizeTriggers__,n=t.firstElementChild,i=t.lastElementChild,r=n.firstElementChild;i.scrollLeft=i.scrollWidth,i.scrollTop=i.scrollHeight,r.style.width=n.offsetWidth+1+"px",r.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight}function n(e){return e.offsetWidth!=e.__resizeLast__.width||e.offsetHeight!=e.__resizeLast__.height}function i(e){var i=this;t(this),this.__resizeRAF__&&u(this.__resizeRAF__),this.__resizeRAF__=l(function(){n(i)&&(i.__resizeLast__.width=i.offsetWidth,i.__resizeLast__.height=i.offsetHeight,i.__resizeListeners__.forEach(function(t){t.call(i,e)}))})}function r(){if(!a){var e=(b||"")+".resize-triggers { "+(w||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t.appendChild(n),a=!0}}var o=document.attachEvent,a=!1,s=e.fn.resize;if(e.fn.resize=function(e){return this.each(function(){this==window?s.call(jQuery(this),e):addResizeListener(this,e)})},e.fn.removeResize=function(e){return this.each(function(){removeResizeListener(this,e)})},!o){var l=function(){var e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){return window.setTimeout(e,20)};return function(t){return e(t)}}(),u=function(){var e=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout;return function(t){return e(t)}}(),c=!1,d="",f="animationstart",p="Webkit Moz O ms".split(" "),h="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),g="",m=document.createElement("fakeelement");if(m.style.animationName!==undefined&&(c=!0),!1===c)for(var y=0;y<p.length;y++)if(m.style[p[y]+"AnimationName"]!==undefined){g=p[y],g+"Animation",d="-"+g.toLowerCase()+"-",f=h[y],c=!0;break}var v="resizeanim",b="@"+d+"keyframes "+v+" { from { opacity: 0; } to { opacity: 0; } } ",w=d+"animation: 1ms "+v+"; "}window.addResizeListener=function(e,n){o?e.attachEvent("onresize",n):(e.__resizeTriggers__||("static"==getComputedStyle(e).position&&(e.style.position="relative"),r(),e.__resizeLast__={},e.__resizeListeners__=[],(e.__resizeTriggers__=document.createElement("div")).className="resize-triggers",e.__resizeTriggers__.innerHTML='<div class="expand-trigger"><div></div></div><div class="contract-trigger"></div>',e.appendChild(e.__resizeTriggers__),t(e),e.addEventListener("scroll",i,!0),f&&e.__resizeTriggers__.addEventListener(f,function(n){n.animationName==v&&t(e)})),e.__resizeListeners__.push(n))},window.removeResizeListener=function(e,t){o?e.detachEvent("onresize",t):(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||(e.removeEventListener("scroll",i),e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)))}}(jQuery);
@@ -1,5 +1,5 @@
1
1
  (function(){function e(e){var t=n;e&&(n[e]||(n[e]={}),t=n[e]),t.define&&t.define.packaged||(i.original=t.define,t.define=i,t.define.packaged=!0),t.require&&t.require.packaged||(r.original=t.require,t.require=r,t.require.packaged=!0)}var t="ace",n=function(){return this}();if(!n&&"undefined"!=typeof window&&(n=window),t||"undefined"==typeof requirejs){var i=function(e,t,n){if("string"!=typeof e)return void(i.original?i.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace()));2==arguments.length&&(n=t),i.modules[e]||(i.payloads[e]=n,i.modules[e]=null)};i.modules={},i.payloads={};var o=function(e,t,n){if("string"==typeof t){var i=a(e,t);if(i!=undefined)return n&&n(),i}else if("[object Array]"===Object.prototype.toString.call(t)){for(var o=[],s=0,l=t.length;s<l;++s){var c=a(e,t[s]);if(c==undefined&&r.original)return;o.push(c)}return n&&n.apply(null,o)||!0}},r=function(e,t){var n=o("",e,t);return n==undefined&&r.original?r.original.apply(this,arguments):n},s=function(e,t){if(-1!==t.indexOf("!")){var n=t.split("!");return s(e,n[0])+"!"+s(e,n[1])}if("."==t.charAt(0)){var i=e.split("/").slice(0,-1).join("/");for(t=i+"/"+t;-1!==t.indexOf(".")&&o!=t;){var o=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return t},a=function(e,t){t=s(e,t);var n=i.modules[t];if(!n){if("function"==typeof(n=i.payloads[t])){var r={},a={id:t,uri:"",exports:r,packaged:!0};r=n(function(e,n){return o(t,e,n)},r,a)||a.exports,i.modules[t]=r,delete i.payloads[t]}n=i.modules[t]=r||n}return n};e(t)}})(),ace.define("ace/lib/regexp",["require","exports","module"],function(){"use strict";function e(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function t(e,t,n){if(Array.prototype.indexOf)return e.indexOf(t,n);for(var i=n||0;i<e.length;i++)if(e[i]===t)return i;return-1}var n={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},i=n.exec.call(/()??/,"")[1]===undefined,o=function(){var e=/^/g;return n.test.call(e,""),!e.lastIndex}();o&&i||(RegExp.prototype.exec=function(r){var s,a,l=n.exec.apply(this,arguments);if("string"==typeof r&&l){if(!i&&l.length>1&&t(l,"")>-1&&(a=RegExp(this.source,n.replace.call(e(this),"g","")),n.replace.call(r.slice(l.index),a,function(){for(var e=1;e<arguments.length-2;e++)arguments[e]===undefined&&(l[e]=undefined)})),this._xregexp&&this._xregexp.captureNames)for(var c=1;c<l.length;c++)(s=this._xregexp.captureNames[c-1])&&(l[s]=l[c]);!o&&this.global&&!l[0].length&&this.lastIndex>l.index&&this.lastIndex--}return l},o||(RegExp.prototype.test=function(e){var t=n.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),ace.define("ace/lib/es5-shim",["require","exports","module"],function(){function e(){}function t(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(e){}}function n(e){return e=+e,e!==e?e=0:0!==e&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if("function"!=typeof n)throw new TypeError("Function.prototype.bind called on incompatible "+n);var i=u.call(arguments,1),o=function(){if(this instanceof o){var e=n.apply(this,i.concat(u.call(arguments)));return Object(e)===e?e:this}return n.apply(t,i.concat(u.call(arguments)))};return n.prototype&&(e.prototype=n.prototype,o.prototype=new e,e.prototype=null),o});var i,o,r,s,a,l=Function.prototype.call,c=Array.prototype,h=Object.prototype,u=c.slice,d=l.bind(h.toString),g=l.bind(h.hasOwnProperty);if((a=g(h,"__defineGetter__"))&&(i=l.bind(h.__defineGetter__),o=l.bind(h.__defineSetter__),r=l.bind(h.__lookupGetter__),s=l.bind(h.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,n=[];if(n.splice.apply(n,e(20)),n.splice.apply(n,e(26)),t=n.length,n.splice(5,0,"XXX"),n.length,t+1==n.length)return!0}()){var p=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?p.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(u.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):void 0==e?e=0:e<0&&(e=Math.max(n+e,0)),e+t<n||(t=n-e);var i=this.slice(e,e+t),o=u.call(arguments,2),r=o.length;if(e===n)r&&this.push.apply(this,o);else{var s=Math.min(t,n-e),a=e+s,l=a+r-s,c=n-a,h=n-s;if(l<a)for(var d=0;d<c;++d)this[l+d]=this[a+d];else if(l>a)for(d=c;d--;)this[l+d]=this[a+d];if(r&&e===h)this.length=h,this.push.apply(this,o);else for(this.length=h+r,d=0;d<r;++d)this[e+d]=o[d]}return i};Array.isArray||(Array.isArray=function(e){return"[object Array]"==d(e)});var f=Object("a"),m="a"!=f[0]||!(0 in f);if(Array.prototype.forEach||(Array.prototype.forEach=function(e){var t=L(this),n=m&&"[object String]"==d(this)?this.split(""):t,i=arguments[1],o=-1,r=n.length>>>0;if("[object Function]"!=d(e))throw new TypeError;for(;++o<r;)o in n&&e.call(i,n[o],o,t)}),Array.prototype.map||(Array.prototype.map=function(e){var t=L(this),n=m&&"[object String]"==d(this)?this.split(""):t,i=n.length>>>0,o=Array(i),r=arguments[1];if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");for(var s=0;s<i;s++)s in n&&(o[s]=e.call(r,n[s],s,t));return o}),Array.prototype.filter||(Array.prototype.filter=function(e){var t,n=L(this),i=m&&"[object String]"==d(this)?this.split(""):n,o=i.length>>>0,r=[],s=arguments[1];if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");for(var a=0;a<o;a++)a in i&&(t=i[a],e.call(s,t,a,n)&&r.push(t));return r}),Array.prototype.every||(Array.prototype.every=function(e){var t=L(this),n=m&&"[object String]"==d(this)?this.split(""):t,i=n.length>>>0,o=arguments[1];if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");for(var r=0;r<i;r++)if(r in n&&!e.call(o,n[r],r,t))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(e){var t=L(this),n=m&&"[object String]"==d(this)?this.split(""):t,i=n.length>>>0,o=arguments[1];if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");for(var r=0;r<i;r++)if(r in n&&e.call(o,n[r],r,t))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(e){var t=L(this),n=m&&"[object String]"==d(this)?this.split(""):t,i=n.length>>>0;if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");if(!i&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var o,r=0;if(arguments.length>=2)o=arguments[1];else for(;;){if(r in n){o=n[r++];break}if(++r>=i)throw new TypeError("reduce of empty array with no initial value")}for(;r<i;r++)r in n&&(o=e.call(void 0,o,n[r],r,t));return o}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(e){var t=L(this),n=m&&"[object String]"==d(this)?this.split(""):t,i=n.length>>>0;if("[object Function]"!=d(e))throw new TypeError(e+" is not a function");if(!i&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var o,r=i-1;if(arguments.length>=2)o=arguments[1];else for(;;){if(r in n){o=n[r--];break}if(--r<0)throw new TypeError("reduceRight of empty array with no initial value")}do{r in this&&(o=e.call(void 0,o,n[r],r,t))}while(r--);return o}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=m&&"[object String]"==d(this)?this.split(""):L(this),i=t.length>>>0;if(!i)return-1;var o=0;for(arguments.length>1&&(o=n(arguments[1])),o=o>=0?o:Math.max(0,i+o);o<i;o++)if(o in t&&t[o]===e)return o;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(e){var t=m&&"[object String]"==d(this)?this.split(""):L(this),i=t.length>>>0;if(!i)return-1;var o=i-1;for(arguments.length>1&&(o=Math.min(o,n(arguments[1]))),o=o>=0?o:i-Math.abs(o);o>=0;o--)if(o in t&&e===t[o])return o;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:h)}),!Object.getOwnPropertyDescriptor){Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(g(e,t)){var n,i,o;if(n={enumerable:!0,configurable:!0},a){var l=e.__proto__;e.__proto__=h;var i=r(e,t),o=s(e,t);if(e.__proto__=l,i||o)return i&&(n.get=i),o&&(n.set=o),n}return n.value=e[t],n}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),!Object.create){var v;v=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var n;if(null===e)n=v();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var i=function(){};i.prototype=e,n=new i,n.__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n}}if(Object.defineProperty){var b=t({}),w="undefined"==typeof document||t(document.createElement("div"));if(!b||!w)var y=Object.defineProperty}if(!Object.defineProperty||y){Object.defineProperty=function(e,t,n){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof n&&"function"!=typeof n||null===n)throw new TypeError("Property description must be an object: "+n);if(y)try{return y.call(Object,e,t,n)}catch(e){}if(g(n,"value"))if(a&&(r(e,t)||s(e,t))){var l=e.__proto__;e.__proto__=h,delete e[t],e[t]=n.value,e.__proto__=l}else e[t]=n.value;else{if(!a)throw new TypeError("getters & setters can not be defined on this javascript engine");g(n,"get")&&i(e,t,n.get),g(n,"set")&&o(e,t,n.set)}return e}}Object.defineProperties||(Object.defineProperties=function(e,t){for(var n in t)g(t,n)&&Object.defineProperty(e,n,t[n]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=function(e){return function(t){return"function"==typeof t?t:e(t)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(){return!1}),Object.isFrozen||(Object.isFrozen=function(){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";g(e,t);)t+="?";e[t]=!0;var n=g(e,t);return delete e[t],n}),!Object.keys){var x=!0,k=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],C=k.length;for(var S in{toString:null})x=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)g(e,n)&&t.push(n);if(x)for(var i=0,o=C;i<o;i++){var r=k[i];g(e,r)&&t.push(r)}return t}}Date.now||(Date.now=function(){return(new Date).getTime()});var $="\t\n\x0B\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff";if(!String.prototype.trim||$.trim()){$="["+$+"]";var _=new RegExp("^"+$+$+"*"),A=new RegExp($+$+"*$");String.prototype.trim=function(){return String(this).replace(_,"").replace(A,"")}}var L=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e){"use strict";e("./regexp"),e("./es5-shim"),"undefined"!=typeof Element&&!Element.prototype.remove&&Object.defineProperty(Element.prototype,"remove",{enumerable:!1,writable:!0,configurable:!0,value:function(){this.parentNode&&this.parentNode.removeChild(this)}})}),ace.define("ace/lib/useragent",["require","exports","module"],function(e,t){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var n="object"==typeof navigator?navigator:{},i=(/mac|win|linux/i.exec(n.platform)||["other"])[0].toLowerCase(),o=n.userAgent||"",r=n.appName||"";t.isWin="win"==i,t.isMac="mac"==i,t.isLinux="linux"==i,t.isIE="Microsoft Internet Explorer"==r||r.indexOf("MSAppHost")>=0?parseFloat((o.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((o.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=o.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(o.split("WebKit/")[1])||undefined,t.isChrome=parseFloat(o.split(" Chrome/")[1])||undefined,t.isEdge=parseFloat(o.split(" Edge/")[1])||undefined,t.isAIR=o.indexOf("AdobeAIR")>=0,t.isAndroid=o.indexOf("Android")>=0,t.isChromeOS=o.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(o)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(e,t){"use strict";var n=e("./useragent");if(t.buildDom=function e(t,n,i){if("string"==typeof t&&t){var o=document.createTextNode(t);return n&&n.appendChild(o),o}if(!Array.isArray(t))return t;if("string"!=typeof t[0]||!t[0]){for(var r=[],s=0;s<t.length;s++){var a=e(t[s],n,i);a&&r.push(a)}return r}var l=document.createElement(t[0]),c=t[1],h=1;c&&"object"==typeof c&&!Array.isArray(c)&&(h=2);for(var s=h;s<t.length;s++)e(t[s],l,i);return 2==h&&Object.keys(c).forEach(function(e){var t=c[e];"class"===e?l.className=Array.isArray(t)?t.join(" "):t:"function"==typeof t||"value"==e?l[e]=t:"ref"===e?i&&(i[t]=l):null!=t&&l.setAttribute(e,t)}),n&&n.appendChild(l),l},t.getDocumentHead=function(e){return e||(e=document),e.head||e.getElementsByTagName("head")[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||"http://www.w3.org/1999/xhtml",e):document.createElement(e)},t.removeChildren=function(e){e.innerHTML=""},t.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},t.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},t.hasCssClass=function(e,t){return-1!==(e.className+"").split(/\s+/g).indexOf(t)},t.addCssClass=function(e,n){t.hasCssClass(e,n)||(e.className+=" "+n)},t.removeCssClass=function(e,t){for(var n=e.className.split(/\s+/g);;){var i=n.indexOf(t);if(-1==i)break;n.splice(i,1)}e.className=n.join(" ")},t.toggleCssClass=function(e,t){for(var n=e.className.split(/\s+/g),i=!0;;){var o=n.indexOf(t);if(-1==o)break;i=!1,n.splice(o,1)}return i&&n.push(t),e.className=n.join(" "),i},t.setCssClass=function(e,n,i){i?t.addCssClass(e,n):t.removeCssClass(e,n)},t.hasCssString=function(e,t){var n,i=0;if(t=t||document,n=t.querySelectorAll("style"))for(;i<n.length;)if(n[i++].id===e)return!0},t.importCssString=function(e,n,i){var o=i;i&&i.getRootNode?(o=i.getRootNode())&&o!=i||(o=document):o=document;var r=o.ownerDocument||o;if(n&&t.hasCssString(n,o))return null;n&&(e+="\n/*# sourceURL=ace/css/"+n+" */");var s=t.createElement("style");s.appendChild(r.createTextNode(e)),n&&(s.id=n),o==r&&(o=t.getDocumentHead(r)),o.insertBefore(s,o.firstChild)},t.importCssStylsheet=function(e,n){t.buildDom(["link",{rel:"stylesheet",href:e}],t.getDocumentHead(n))},t.scrollbarWidth=function(e){var n=t.createElement("ace_inner");n.style.width="100%",n.style.minWidth="0px",n.style.height="200px",n.style.display="block";var i=t.createElement("ace_outer"),o=i.style;o.position="absolute",o.left="-10000px",o.overflow="hidden",o.width="200px",o.minWidth="0px",o.height="150px",o.display="block",i.appendChild(n);var r=e.documentElement;r.appendChild(i);var s=n.offsetWidth;o.overflow="scroll";var a=n.offsetWidth;return s==a&&(a=i.clientWidth),r.removeChild(i),s-a},"undefined"==typeof document&&(t.importCssString=function(){}),t.computedStyle=function(e){return window.getComputedStyle(e,"")||{}},t.setStyle=function(e,t,n){e[t]!==n&&(e[t]=n)},t.HAS_CSS_ANIMATION=!1,t.HAS_CSS_TRANSFORMS=!1,t.HI_DPI=!n.isWin||"undefined"!=typeof window&&window.devicePixelRatio>=1.5,"undefined"!=typeof document){var i=document.createElement("div");t.HI_DPI&&i.style.transform!==undefined&&(t.HAS_CSS_TRANSFORMS=!0),!n.isEdge&&"undefined"!=typeof i.style.animationName&&(t.HAS_CSS_ANIMATION=!0),i=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}}),ace.define("ace/lib/oop",["require","exports","module"],function(e,t){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(e,t){"use strict";var n=e("./oop"),i=function(){var e,t,i={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,"super":8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in i.FUNCTION_KEYS)e=i.FUNCTION_KEYS[t].toLowerCase(),i[e]=parseInt(t,10);for(t in i.PRINTABLE_KEYS)e=i.PRINTABLE_KEYS[t].toLowerCase(),i[e]=parseInt(t,10);return n.mixin(i,i.MODIFIER_KEYS),n.mixin(i,i.PRINTABLE_KEYS),n.mixin(i,i.FUNCTION_KEYS),i.enter=i["return"],i.escape=i.esc,i.del=i["delete"],i[173]="-",function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)i.KEY_MODS[t]=e.filter(function(e){return t&i.KEY_MODS[e]}).join("-")+"-"}(),i.KEY_MODS[0]="",i.KEY_MODS[-1]="input-",i}();n.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t){"use strict";function n(e,t,n){var i=l(t);if(!r.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(i|=8),s.altGr){if(3==(3&i))return;s.altGr=0}if(18===n||17===n){var c="location"in t?t.location:t.keyLocation;if(17===n&&1===c)1==s[n]&&(a=t.timeStamp);else if(18===n&&3===i&&2===c){var h=t.timeStamp-a;h<50&&(s.altGr=!0)}}}if(n in o.MODIFIER_KEYS&&(n=-1),!i&&13===n){var c="location"in t?t.location:t.keyLocation;if(3===c&&(e(t,i,-n),t.defaultPrevented))return}if(r.isChromeOS&&8&i){if(e(t,i,n),t.defaultPrevented)return;i&=-9}return!!(i||n in o.FUNCTION_KEYS||n in o.PRINTABLE_KEYS)&&e(t,i,n)}function i(){s=Object.create(null)}var o=e("./keys"),r=e("./useragent"),s=null,a=0;t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var i=function(){n.call(e,window.event)};n._wrapper=i,e.attachEvent("on"+t,i)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||r.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,i){function o(e){n&&n(e),i&&i(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",o,!0),t.removeListener(document,"dragstart",o,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",o,!0),t.addListener(document,"dragstart",o,!0),o},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){var t=8;e.wheelDeltaX!==undefined?(e.wheelX=-e.wheelDeltaX/t,e.wheelY=-e.wheelDeltaY/t):(e.wheelX=0,e.wheelY=-e.wheelDelta/t),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){var t=.35;switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=e.deltaX*t||0,e.wheelY=e.deltaY*t||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),n(e)})},t.addMultiMouseDownListener=function(e,n,i,o){function s(e){if(0!==t.getButton(e)?u=0:e.detail>1?++u>4&&(u=1):u=1,r.isIE){var s=Math.abs(e.clientX-l)>5||Math.abs(e.clientY-c)>5;h&&!s||(u=1),h&&clearTimeout(h),h=setTimeout(function(){h=null},n[u-1]||600),1==u&&(l=e.clientX,c=e.clientY)}if(e._clicks=u,i[o]("mousedown",e),u>4)u=0;else if(u>1)return i[o](d[u],e)}function a(e){u=2,h&&clearTimeout(h),h=setTimeout(function(){h=null},n[u-1]||600),i[o]("mousedown",e),i[o](d[u],e)}var l,c,h,u=0,d={2:"dblclick",3:"tripleclick",4:"quadclick"};Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",s),r.isOldIE&&t.addListener(e,"dblclick",a)})};var l=!r.isMac||!r.isOpera||"KeyboardEvent"in window?function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}:function(e){return 0|(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)};if(t.getModifierString=function(e){return o.KEY_MODS[l(e)]},t.addCommandKeyListener=function(e,o){var a=t.addListener;if(r.isOldGecko||r.isOpera&&!("KeyboardEvent"in window)){var l=null;a(e,"keydown",function(e){l=e.keyCode}),a(e,"keypress",function(e){return n(o,e,l)})}else{var c=null;a(e,"keydown",function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=n(o,e,e.keyCode);return c=e.defaultPrevented,t}),a(e,"keypress",function(e){c&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),c=null)}),a(e,"keyup",function(e){s[e.keyCode]=null}),s||(i(),a(window,"focus",i))}},"object"==typeof window&&window.postMessage&&!r.isOldIE){var c=1;t.nextTick=function(e,n){n=n||window;var i="zero-timeout-message-"+c++,o=function(r){r.data==i&&(t.stopPropagation(r),t.removeListener(n,"message",o),e())};t.addListener(n,"message",o),n.postMessage(i,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout(function n(){t.$idleBlocked?setTimeout(n,100):e()},n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout(function(){t.$idleBlocked=!1},e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),ace.define("ace/range",["require","exports","module"],function(e,t){"use strict";var n=function(e,t){return e.row-t.row||e.column-t.column},i=function(e,t,n,i){this.start={row:e,column:t},this.end={row:n,column:i}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,n=e.end,i=e.start;return t=this.compare(n.row,n.column),1==t?(t=this.compare(i.row,i.column),1==t?2:0==t?1:0):-1==t?-2:(t=this.compare(i.row,i.column),-1==t?-1:1==t?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&(!this.isEnd(e,t)&&!this.isStart(e,t))},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:t<this.start.column?-1:t>this.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.row<e)var n={row:e,column:0};if(this.start.row>t)var o={row:t+1,column:0};else if(this.start.row<e)var o={row:e,column:0};return i.fromPoints(o||this.start,n||this.end)},this.extend=function(e,t){var n=this.compare(e,t);if(0==n)return this;if(-1==n)var o={row:e,column:t};else var r={row:e,column:t};return i.fromPoints(o||this.start,r||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return i.fromPoints(this.start,this.end)},this.collapseRows=function(){return 0==this.end.column?new i(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new i(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),n=e.documentToScreenPosition(this.end);return new i(t.row,t.column,n.row,n.column)},this.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t}}).call(i.prototype),i.fromPoints=function(e,t){return new i(e.row,e.column,t.row,t.column)},i.comparePoints=n,i.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=i}),ace.define("ace/lib/lang",["require","exports","module"],function(e,t){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var n="";t>0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var n=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(n,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,i=e.length;n<i;n++)e[n]&&"object"==typeof e[n]?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=function e(t){if("object"!=typeof t||!t)return t;var n;if(Array.isArray(t)){n=[];for(var i=0;i<t.length;i++)n[i]=e(t[i]);return n}if("[object Object]"!==Object.prototype.toString.call(t))return t;n={};for(var i in t)n[i]=e(t[i]);return n},t.arrayToMap=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return(""+e).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,function(e){n.push({offset:arguments[arguments.length-2],length:e.length})}),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},i=function(e){return i.cancel(),t=setTimeout(n,e||0),i};return i.schedule=i,i.call=function(){return this.cancel(),e(),i},i.cancel=function(){return clearTimeout(t),t=null,i},i.isPending=function(){return t},i},t.delayedCall=function(e,t){var n=null,i=function(){n=null,e()},o=function(e){null==n&&(n=setTimeout(i,e||t))};return o.delay=function(e){n&&clearTimeout(n),n=setTimeout(i,e||t)},o.schedule=o,o.call=function(){this.cancel(),e()},o.cancel=function(){n&&clearTimeout(n),n=null},o.isPending=function(){return n},o}}),ace.define("ace/clipboard",["require","exports","module"],function(e,t,n){"use strict";var i;n.exports={lineMode:!1,pasteCancelled:function(){return!!(i&&i>Date.now()-50)||(i=!1)},cancel:function(){i=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(e,t){"use strict";var n=e("../lib/event"),i=e("../lib/useragent"),o=e("../lib/dom"),r=e("../lib/lang"),s=e("../clipboard"),a=i.isChrome<18,l=i.isIE,c=i.isChrome>63,h=400,u=e("../lib/keys"),d=u.KEY_MODS,g=i.isIOS,p=g?/\s/:/\n/,f=function(e,t){function f(){_=!0,w.blur(),w.focus(),_=!1}function m(e){27==e.keyCode&&w.value.length<w.selectionStart&&(k||(A=w.value),L=M=-1,T()),G()}function v(){clearTimeout(j),j=setTimeout(function(){S&&(w.style.cssText=S,S=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()},0)}function b(e,t,n){var i=null,o=!1;n.addEventListener("keydown",function(){i&&clearTimeout(i),o=!0},!0),n.addEventListener("keyup",function(){i=setTimeout(function(){o=!1},100)},!0);var r=function(){if(document.activeElement===n&&!(o||k||t.$mouseHandler.isMousePressed||y)){var e=n.selectionStart,i=n.selectionEnd,r=null,s=0;if(0==e?r=u.up:1==e?r=u.home:i>M&&"\n"==A[i]?r=u.end:e<L&&" "==A[e-1]?(r=u.left,s=d.option):e<L||e==L&&M!=L&&e==i?r=u.left:i>M&&A.slice(0,i).split("\n").length>2?r=u.down:i>M&&" "==A[i-1]?(r=u.right,s=d.option):(i>M||i==M&&M!=L&&e==i)&&(r=u.right),e!==i&&(s|=d.shift),r){if(!t.onCommandKey({},s,r)&&t.commands){r=u.keyCodeToString(r);var a=t.commands.findKeyCommand(s,r);a&&t.execCommand(a)}L=e,M=i,T("")}}};document.addEventListener("selectionchange",r),t.on("destroy",function(){document.removeEventListener("selectionchange",r)})}var w=o.createElement("textarea");w.className="ace_text-input",w.setAttribute("wrap","off"),w.setAttribute("autocorrect","off"),w.setAttribute("autocapitalize","off"),w.setAttribute("spellcheck",!1),w.style.opacity="0",e.insertBefore(w,e.firstChild);var y=!1,x=!1,k=!1,C=!1,S="";i.isMobile||(w.style.fontSize="1px");var $=!1,_=!1,A="",L=0,M=0;try{var R=document.activeElement===w}catch(e){}n.addListener(w,"blur",function(e){_||(t.onBlur(e),R=!1)}),n.addListener(w,"focus",function(e){if(!_){if(R=!0,i.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),i.isEdge?setTimeout(T):T()}}),this.$focusScroll=!1,this.focus=function(){if(S||c||"browser"==this.$focusScroll)return w.focus({preventScroll:!0});var e=w.style.top;w.style.position="fixed",w.style.top="0px";try{var t=0!=w.getBoundingClientRect().top}catch(e){return}var n=[];if(t)for(var i=w.parentElement;i&&1==i.nodeType;)n.push(i),i.setAttribute("ace_nocontext",!0),i=!i.parentElement&&i.getRootNode?i.getRootNode().host:i.parentElement;w.focus({preventScroll:!0}),t&&n.forEach(function(e){e.removeAttribute("ace_nocontext")}),setTimeout(function(){w.style.position="","0px"==w.style.top&&(w.style.top=e)},0)},this.blur=function(){w.blur()},this.isFocused=function(){return R},t.on("beforeEndOperation",function(){t.curOp&&"insertstring"==t.curOp.command.name||(k&&(A=w.value="",U()),T())});var T=g?function(e){if(R&&(!y||e)&&!C){e||(e="");var n="\n ab"+e+"cde fg\n";n!=w.value&&(w.value=A=n);var i=4,o=4+(e.length||(t.selection.isEmpty()?0:1));(L!=i||M!=o)&&w.setSelectionRange(i,o),L=i,M=o}}:function(){if(!k&&!C&&(R||F)){k=!0
2
- ;var e=t.selection,n=e.getRange(),i=e.cursor.row,o=n.start.column,r=n.end.column,s=t.session.getLine(i);if(n.start.row!=i){var a=t.session.getLine(i-1);o=n.start.row<i-1?0:o,r+=a.length+1,s=a+"\n"+s}else if(n.end.row!=i){var l=t.session.getLine(i+1);r=n.end.row>i+1?l.length:r,r+=s.length+1,s=s+"\n"+l}s.length>h&&(o<h&&r<h?s=s.slice(0,h):(s="\n",o=0,r=1));var c=s+"\n\n";if(c!=A&&(w.value=A=c,L=M=c.length),F&&(L=w.selectionStart,M=w.selectionEnd),M!=r||L!=o||w.selectionEnd!=M)try{w.setSelectionRange(o,r),L=o,M=r}catch(e){}k=!1}};R&&t.onFocus();var E=function(e){return 0===e.selectionStart&&e.selectionEnd>=A.length&&e.value===A&&A&&e.selectionEnd!==M},O=function(){k||(y?y=!1:E(w)&&(t.selectAll(),T()))},I=null;this.setInputHandler=function(e){I=e},this.getInputHandler=function(){return I};var F=!1,B=function(e,n){if(F&&(F=!1),x)return T(),e&&t.onPaste(e),x=!1,"";for(var i=w.selectionStart,o=w.selectionEnd,r=L,s=A.length-M,a=e,l=e.length-i,c=e.length-o,h=0;r>0&&A[h]==e[h];)h++,r--;for(a=a.slice(h),h=1;s>0&&A.length-h>L-1&&A[A.length-h]==e[e.length-h];)h++,s--;l-=h-1,c-=h-1;var u=a.length-h+1;return u<0&&(r=-u,u=0),a=a.slice(0,u),n||l!=a.length||r||s||c?(C=!0,a&&!r&&!s&&!l&&!c||$?t.onTextInput(a):t.onTextInput(a,{extendLeft:r,extendRight:s,restoreStart:l,restoreEnd:c}),C=!1,A=e,L=i,M=o,a):""},H=function(e){if(k)return V();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var n=w.value,i=B(n,!0);(n.length>h+100||p.test(i))&&T()},N=function(e,t,n){var i=e.clipboardData||window.clipboardData;if(i&&!a){var o=l||n?"Text":"text/plain";try{return t?!1!==i.setData(o,t):i.getData(o)}catch(e){if(!n)return N(e,t,!0)}}},P=function(e,i){var o=t.getCopyText();if(!o)return n.preventDefault(e);N(e,o)?(g&&(T(o),y=o,setTimeout(function(){y=!1},10)),i?t.onCut():t.onCopy(),n.preventDefault(e)):(y=!0,w.value=o,w.select(),setTimeout(function(){y=!1,T(),i?t.onCut():t.onCopy()}))},D=function(e){P(e,!0)},W=function(e){P(e,!1)},z=function(e){var o=N(e);s.pasteCancelled()||("string"==typeof o?(o&&t.onPaste(o,e),i.isIE&&setTimeout(T),n.preventDefault(e)):(w.value="",x=!0))};n.addCommandKeyListener(w,t.onCommandKey.bind(t)),n.addListener(w,"select",O),n.addListener(w,"input",H),n.addListener(w,"cut",D),n.addListener(w,"copy",W),n.addListener(w,"paste",z),(!("oncut"in w)||!("oncopy"in w)||!("onpaste"in w))&&n.addListener(e,"keydown",function(e){if((!i.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:W(e);break;case 86:z(e);break;case 88:D(e)}});var K=function(){if(!k&&t.onCompositionStart&&!t.$readOnly&&(k={},!$)){setTimeout(V,0),t.on("mousedown",f);var e=t.getSelectionRange();e.end.row=e.start.row,e.end.column=e.start.column,k.markerRange=e,k.selectionStart=L,t.onCompositionStart(k),k.useTextareaForIME?(w.value="",A="",L=0,M=0):(w.msGetInputContext&&(k.context=w.msGetInputContext()),w.getInputContext&&(k.context=w.getInputContext()))}},V=function(){if(k&&t.onCompositionUpdate&&!t.$readOnly){if($)return f();if(k.useTextareaForIME)t.onCompositionUpdate(w.value);else{var e=w.value;B(e),k.markerRange&&(k.context&&(k.markerRange.start.column=k.selectionStart=k.context.compositionStartOffset),k.markerRange.end.column=k.markerRange.start.column+M-k.selectionStart)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(k=!1,t.onCompositionEnd(),t.off("mousedown",f),e&&H())},G=r.delayedCall(V,50).schedule.bind(null,null);n.addListener(w,"compositionstart",K),n.addListener(w,"compositionupdate",V),n.addListener(w,"keyup",m),n.addListener(w,"keydown",G),n.addListener(w,"compositionend",U),this.getElement=function(){return w},this.setCommandMode=function(e){$=e,w.readOnly=!1},this.setReadOnly=function(e){$||(w.readOnly=e)},this.setCopyWithEmptySelection=function(){},this.onContextMenu=function(e){F=!0,T(),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,r){S||(S=w.style.cssText),w.style.cssText=(r?"z-index:100000;":"")+(i.isIE?"opacity:0.1;":"")+"text-indent: -"+(L+M)*t.renderer.characterWidth*.5+"px;";var s=t.container.getBoundingClientRect(),a=o.computedStyle(t.container),l=s.top+(parseInt(a.borderTopWidth)||0),c=s.left+(parseInt(s.borderLeftWidth)||0),h=s.bottom-l-w.clientHeight-2,u=function(e){o.translate(w,e.clientX-c-2,Math.min(e.clientY-l-2,h))};u(e),"mousedown"==e.type&&(t.renderer.$isMousePressed=!0,clearTimeout(j),i.isWin&&n.capture(t.container,u,v))},this.onContextMenuClose=v;var j,q=function(e){t.textInput.onContextMenu(e),v()};n.addListener(w,"mouseup",q),n.addListener(w,"mousedown",function(e){e.preventDefault(),v()}),n.addListener(t.renderer.scroller,"contextmenu",q),n.addListener(w,"contextmenu",q),g&&b(e,t,w)};t.TextInput=f}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t){"use strict";function n(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function i(e,t,n,i){return Math.sqrt(Math.pow(n-e,2)+Math.pow(i-t,2))}function o(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)var n=2*t.row-e.start.row-e.end.row;else var n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var r=e("../lib/useragent"),s=550;(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,o=e.getButton();return 0!==o?((i.getSelectionRange().isEmpty()||1==o)&&i.selection.moveToPosition(n),void(2==o&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimeout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var i=this.$clickSelection.comparePoint(n);if(-1==i)e=this.$clickSelection.end;else if(1==i)e=this.$clickSelection.start;else{var r=o(this.$clickSelection,n);n=r.cursor,e=r.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,i=n.renderer.screenToTextCoordinates(this.x,this.y),r=n.selection[e](i.row,i.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(r.start),a=this.$clickSelection.comparePoint(r.end);if(-1==s&&a<=0)t=this.$clickSelection.end,r.end.row==i.row&&r.end.column==i.column||(i=r.start);else if(1==a&&s>=0)t=this.$clickSelection.start,r.start.row==i.row&&r.start.column==i.column||(i=r.end);else if(-1==s&&1==a)i=r.end,t=r.start;else{var l=o(this.$clickSelection,i);i=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(i),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=i(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(e>0||t-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,i=n.session,o=i.getBracketRange(t);o?(o.isEmpty()&&(o.start.column--,o.end.column++),this.setState("select")):(o=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=o,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var i=n.getSelectionRange();i.isMultiLine()&&i.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(i.start.row),this.$clickSelection.end=n.selection.getLineRange(i.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(){var e=this.editor;e.selectAll(),this.$clickSelection=e.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,i=e.domEvent.timeStamp,o=i-n.t,r=o?e.wheelX/o:n.vx,a=o?e.wheelY/o:n.vy;o<s&&(r=(r+n.vx)/2,a=(a+n.vy)/2);var l=Math.abs(r/a),c=!1;if(l>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(c=!0),l<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(c=!0),c)n.allowed=i;else if(i-n.allowed<s){var h=Math.abs(r)<=1.5*Math.abs(n.vx)&&Math.abs(a)<=1.5*Math.abs(n.vy);h?(c=!0,n.allowed=i):n.allowed=0}return n.t=i,n.vx=r,n.vy=a,c?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(n.prototype),t.DefaultHandlers=n}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t){"use strict";function n(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}var i=(e("./lib/oop"),e("./lib/dom"));(function(){this.$init=function(){return this.$element=i.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){i.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(n.prototype),t.Tooltip=n}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t){"use strict";function n(e){function t(){var t=u.getDocumentPosition().row,i=l.$annotations[t];if(!i)return n();if(t==a.session.getLength()){var o=a.renderer.pixelToScreenCoordinates(0,u.y).row,s=u.$pos;if(o>a.session.documentToScreenRow(s.row,s.column))return n()}if(d!=i)if(d=i.text.join("<br/>"),c.setHtml(d),c.show(),a._signal("showGutterTooltip",c),a.on("mousewheel",n),e.$tooltipFollowsMouse)r(u);else{var h=u.domEvent.target,g=h.getBoundingClientRect(),p=c.getElement().style;p.left=g.right+"px",p.top=g.bottom+"px"}}function n(){h&&(h=clearTimeout(h)),d&&(c.hide(),d=null,a._signal("hideGutterTooltip",c),a.removeEventListener("mousewheel",n))}function r(e){c.setPosition(e.x,e.y)}var a=e.editor,l=a.renderer.$gutterLayer,c=new i(a.container);e.editor.setDefaultHandler("guttermousedown",function(t){if(a.isFocused()&&0==t.getButton()){if("foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,i=a.session.selection;if(t.getShiftKey())i.selectTo(n,0);else{if(2==t.domEvent.detail)return a.selectAll(),t.preventDefault();e.$clickSelection=a.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}});var h,u,d;e.editor.setDefaultHandler("guttermousemove",function(i){var s=i.domEvent.target||i.domEvent.srcElement;if(o.hasCssClass(s,"ace_fold-widget"))return n();d&&e.$tooltipFollowsMouse&&r(i),u=i,h||(h=setTimeout(function(){h=null,u&&!e.isMousePressed?t():n()},50))}),s.addListener(a.renderer.$gutter,"mouseout",function(){u=null,d&&!h&&(h=setTimeout(function(){h=null,n()},50))}),a.on("changeSession",n)}function i(e){a.call(this,e)}var o=e("../lib/dom"),r=e("../lib/oop"),s=e("../lib/event"),a=e("../tooltip").Tooltip;r.inherits(i,a),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight,o=this.getWidth(),r=this.getHeight();e+=15,t+=15,e+o>n&&(e-=e+o-n),t+r>i&&(t-=20+r),a.prototype.setPosition.call(this,e,t)}}.call(i.prototype),t.GutterHandler=n}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t){"use strict";var n=e("../lib/event"),i=e("../lib/useragent"),o=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){n.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){n.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor,t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var n=this.getDocumentPosition();this.$inSelection=t.contains(n.row,n.column)}return this.$inSelection},this.getButton=function(){return n.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(o.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t){"use strict";function n(e){function t(e,t){var n=Date.now(),o=!t||e.row!=t.row,r=!t||e.column!=t.column;if(!A||o||r)m.moveCursorToPosition(e),A=n,L={x:w,y:y};else{i(L.x,L.y,w,y)>c?A=null:n-A>=l&&(m.renderer.scrollCursorIntoView(),A=null)}}function n(e,t){var n=Date.now(),i=m.renderer.layerConfig.lineHeight,o=m.renderer.layerConfig.characterWidth,r=m.renderer.scroller.getBoundingClientRect(),s={x:{left:w-r.left,right:r.right-w},y:{top:y-r.top,bottom:r.bottom-y}},l=Math.min(s.x.left,s.x.right),c=Math.min(s.y.top,s.y.bottom),h={row:e.row,column:e.column};l/o<=2&&(h.column+=s.x.left<s.x.right?-3:2),c/i<=1&&(h.row+=s.y.top<s.y.bottom?-1:1);var u=e.row!=h.row,d=e.column!=h.column,g=!t||e.row!=t.row;u||d&&!g?_?n-_>=a&&m.renderer.scrollCursorIntoView(h):_=n:_=null}function h(){var e=C;C=m.renderer.screenToTextCoordinates(w,y),t(C,e),n(C,e)}function u(){k=m.selection.toOrientedRange(),b=m.session.addMarker(k,"ace_selection",m.getSelectionStyle()),m.clearSelection(),m.isFocused()&&m.renderer.$cursorLayer.setBlinking(!1),clearInterval(x),h(),x=setInterval(h,20),R=0,r.addListener(document,"mousemove",g)}function d(){clearInterval(x),m.session.removeMarker(b),b=null,m.selection.fromOrientedRange(k),m.isFocused()&&!$&&m.$resetCursorStyle(),k=null,C=null,R=0,_=null,A=null,r.removeListener(document,"mousemove",g)}function g(){null==T&&(T=setTimeout(function(){null!=T&&b&&d()},20))}function p(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function f(e){var t=["copy","copymove","all","uninitialized"],n=["move","copymove","linkmove","all","uninitialized"],i=s.isMac?e.altKey:e.ctrlKey,o="uninitialized";try{o=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var r="none";return i&&t.indexOf(o)>=0?r="copy":n.indexOf(o)>=0?r="move":t.indexOf(o)>=0&&(r="copy"),r}var m=e.editor,v=o.createElement("img");v.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(v.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),m.addEventListener("mousedown",this.onMouseDown.bind(e));var b,w,y,x,k,C,S,$,_,A,L,M=m.container,R=0;this.onDragStart=function(e){if(this.cancelDrag||!M.draggable){var t=this;return setTimeout(function(){t.startSelect(),t.captureMouse(e)},0),e.preventDefault()}k=m.getSelectionRange();var n=e.dataTransfer;n.effectAllowed=m.getReadOnly()?"copy":"copyMove",s.isOpera&&(m.container.appendChild(v),v.scrollTop=0),n.setDragImage&&n.setDragImage(v,0,0),s.isOpera&&m.container.removeChild(v),n.clearData(),n.setData("Text",m.session.getTextRange()),$=!0,this.setState("drag")},this.onDragEnd=function(e){if(M.draggable=!1,$=!1,this.setState(null),!m.getReadOnly()){var t=e.dataTransfer.dropEffect;!S&&"move"==t&&m.session.remove(m.getSelectionRange()),m.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!m.getReadOnly()&&p(e.dataTransfer))return w=e.clientX,y=e.clientY,b||u(),R++,e.dataTransfer.dropEffect=S=f(e),r.preventDefault(e)},this.onDragOver=function(e){if(!m.getReadOnly()&&p(e.dataTransfer))return w=e.clientX,y=e.clientY,b||(u(),R++),null!==T&&(T=null),e.dataTransfer.dropEffect=S=f(e),r.preventDefault(e)},this.onDragLeave=function(e){if(--R<=0&&b)return d(),S=null,r.preventDefault(e)},this.onDrop=function(e){if(C){var t=e.dataTransfer;if($)switch(S){case"move":k=k.contains(C.row,C.column)?{start:C,end:C}:m.moveText(k,C);break;case"copy":k=m.moveText(k,C,!0)}else{var n=t.getData("Text");k={start:C,end:m.session.insert(C,n)},m.focus(),S=null}return d(),r.preventDefault(e)}},r.addListener(M,"dragstart",this.onDragStart.bind(e)),r.addListener(M,"dragend",this.onDragEnd.bind(e)),r.addListener(M,"dragenter",this.onDragEnter.bind(e)),r.addListener(M,"dragover",this.onDragOver.bind(e)),r.addListener(M,"dragleave",this.onDragLeave.bind(e)),r.addListener(M,"drop",this.onDrop.bind(e));var T=null}function i(e,t,n,i){return Math.sqrt(Math.pow(n-e,2)+Math.pow(i-t,2))}var o=e("../lib/dom"),r=e("../lib/event"),s=e("../lib/useragent"),a=200,l=200,c=5;(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=s.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(){var e=this.editor.container;if(s.isIE&&"dragReady"==this.state){var t=i(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);t>3&&e.dragDrop()}if("dragWait"===this.state){var t=i(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);t>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),i=e.getButton();if(1===(e.domEvent.detail||1)&&0===i&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var o=e.domEvent.target||e.domEvent.srcElement;if("unselectable"in o&&(o.unselectable="on"),t.getDragDelay()){if(s.isWebKit){this.cancelDrag=!0;t.container.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(n.prototype),t.DragdropHandler=n}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],function(e,t){"use strict";var n=e("./mouse_event").MouseEvent,i=e("../lib/dom");t.addTouchListeners=function(e,t){function o(){var e=window.navigator&&window.navigator.clipboard,n=!1,o=function(){var o=t.getCopyText(),r=t.session.getUndoManager().hasUndo();b.replaceChild(i.buildDom(n?["span",!o&&["span",{"class":"ace_mobile-button",action:"selectall"},"Select All"],o&&["span",{"class":"ace_mobile-button",action:"copy"},"Copy"],o&&["span",{"class":"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{"class":"ace_mobile-button",action:"paste"},"Paste"],r&&["span",{"class":"ace_mobile-button",action:"undo"},"Undo"],["span",{"class":"ace_mobile-button",action:"find"},"Find"],["span",{"class":"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),b.firstChild)},r=function(i){var r=i.target.getAttribute("action");if("more"==r||!n)return n=!n,o();"paste"==r?e.readText().then(function(e){t.execCommand(r,e)}):r&&("cut"!=r&&"copy"!=r||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(r)),b.firstChild.style.display="none",n=!1,"openCommandPallete"!=r&&t.focus()};b=i.buildDom(["div",{"class":"ace_mobile-menu",ontouchstart:function(e){w="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),r(e)},onclick:r},["span"],["span",{"class":"ace_mobile-button",action:"more"},"..."]],t.container)}function r(){b||o();var e=t.selection.cursor,n=t.renderer.textToScreenCoordinates(e.row,e.column),i=t.container.getBoundingClientRect();b.style.top=n.pageY-i.top-3+"px",b.style.right="10px",b.style.display="",b.firstChild.style.display="none",t.on("input",s)}function s(){b&&(b.style.display="none"),t.off("input",s)}function a(){p=null,clearTimeout(p);var e=t.selection.getRange(),n=e.contains(m.row,m.column);!e.isEmpty()&&n||(t.selection.moveToPosition(m),t.selection.selectWord()),w="wait",r()}function l(){p=null,clearTimeout(p),t.selection.moveToPosition(m);var e=x>=2?t.selection.getLineRange(m.row):t.session.getBracketRange(m);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),w="wait"}function c(){y+=60,f=setInterval(function(){y--<=0&&(clearInterval(f),f=null),Math.abs(k)<.01&&(k=0),Math.abs(C)<.01&&(C=0),y<20&&(k*=.9),y<20&&(C*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*k,10*C),e==t.session.getScrollTop()&&(y=0)},10)}var h,u,d,g,p,f,m,v,b,w="scroll",y=0,x=0,k=0,C=0;e.addEventListener("contextmenu",function(){if(v){t.textInput.getElement().focus()}}),e.addEventListener("touchstart",function(e){var i=e.touches;if(p||i.length>1)return clearTimeout(p),p=null,d=-1,w="zoom",void 0;v=t.$mouseHandler.isMousePressed=!0;var o=t.renderer.layerConfig.lineHeight,r=t.renderer.layerConfig.lineHeight,s=e.timeStamp;g=s;var c=i[0],f=c.clientX,b=c.clientY;Math.abs(h-f)+Math.abs(u-b)>o&&(d=-1),h=e.clientX=f,u=e.clientY=b,k=C=0;var S=new n(e,t);if(m=S.getDocumentPosition(),s-d<500&&1==i.length&&!y)x++,e.preventDefault(),e.button=0,l();else{x=0;var $=t.selection.cursor,_=t.selection.isEmpty()?$:t.selection.anchor,A=t.renderer.$cursorLayer.getPixelPosition($,!0),L=t.renderer.$cursorLayer.getPixelPosition(_,!0),M=t.renderer.scroller.getBoundingClientRect(),R=function(e,t){return e/=r,t=t/o-.75,e*e+t*t};if(e.clientX<M.left)return void(w="zoom");var T=R(e.clientX-M.left-A.left,e.clientY-M.top-A.top),E=R(e.clientX-M.left-L.left,e.clientY-M.top-L.top);T<3.5&&E<3.5&&(w=T>E?"cursor":"anchor"),w=E<3.5?"anchor":T<3.5?"cursor":"scroll",p=setTimeout(a,450)}d=s}),e.addEventListener("touchend",function(e){v=t.$mouseHandler.isMousePressed=!1,f&&clearInterval(f),"zoom"==w?(w="",y=0):p?(t.selection.moveToPosition(m),y=0,r()):"scroll"==w?(c(),e.preventDefault(),s()):r(),clearTimeout(p),p=null}),e.addEventListener("touchmove",function(e){p&&(clearTimeout(p),p=null);var i=e.touches;if(!(i.length>1||"zoom"==w)){var o=i[0],r=h-o.clientX,s=u-o.clientY;if("wait"==w){if(!(r*r+s*s>4))return e.preventDefault();w="cursor"}h=o.clientX,u=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var a=e.timeStamp,l=a-g;if(g=a,"scroll"==w){var c=new n(e,t);c.speed=1,c.wheelX=r,c.wheelY=s,10*Math.abs(r)<Math.abs(s)&&(r=0),10*Math.abs(s)<Math.abs(r)&&(s=0),0!=l&&(k=r/l,C=s/l),t._emit("mousewheel",c),c.propagationStopped||(k=C=0)}else{var d=new n(e,t),f=d.getDocumentPosition();"cursor"==w?t.selection.moveCursorToPosition(f):"anchor"==w&&t.selection.setSelectionAnchor(f.row,f.column),t.renderer.scrollCursorIntoView(f),e.preventDefault()}}})}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t){"use strict";var n=e("./dom");t.get=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){4===n.readyState&&t(n.responseText)},n.send(null)},t.loadScript=function(e,t){var i=n.getDocumentHead(),o=document.createElement("script");o.src=e,i.appendChild(o),o.onload=o.onreadystatechange=function(e,n){!n&&o.readyState&&"loaded"!=o.readyState&&"complete"!=o.readyState||(o=o.onload=o.onreadystatechange=null,n||t())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(e,t){"use strict";var n={},i=function(){this.propagationStopped=!0},o=function(){this.defaultPrevented=!0};n._emit=n._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(n.length||r){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=o),n=n.slice();for(var s=0;s<n.length&&(n[s](t,this),!t.propagationStopped);s++);return r&&!t.defaultPrevented?r(t,this):void 0}},n._signal=function(e,t){var n=(this._eventRegistry||{})[e];if(n){n=n.slice();for(var i=0;i<n.length;i++)n[i](t,this)}},n.once=function(e,t){var n=this;if(this.addEventListener(e,function i(){n.removeEventListener(e,i),t.apply(null,arguments)}),!t)return new Promise(function(e){t=e})},n.setDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n||(n=this._defaultHandlers={_disabled_:{}}),n[e]){var i=n[e],o=n._disabled_[e];o||(n._disabled_[e]=o=[]),o.push(i);var r=o.indexOf(t);-1!=r&&o.splice(r,1)}n[e]=t},n.removeDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n){var i=n._disabled_[e];if(n[e]==t)i&&this.setDefaultHandler(e,i.pop());else if(i){var o=i.indexOf(t);-1!=o&&i.splice(o,1)}}},n.on=n.addEventListener=function(e,t,n){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[e];return i||(i=this._eventRegistry[e]=[]),-1==i.indexOf(t)&&i[n?"unshift":"push"](t),t},n.off=n.removeListener=n.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(n){var i=n.indexOf(t);-1!==i&&n.splice(i,1)}},n.removeAllListeners=function(e){this._eventRegistry&&(this._eventRegistry[e]=[])},t.EventEmitter=n}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t){"no use strict";function n(){"undefined"!=typeof console&&console.warn&&console.warn.apply(console,arguments)}function i(e,t){var n=new Error(e);n.data=t,"object"==typeof console&&console.error&&console.error(n),setTimeout(function(){throw n})}var o=e("./oop"),r=e("./event_emitter").EventEmitter,s={setOptions:function(e){Object.keys(e).forEach(function(t){this.setOption(t,e[t])},this)},getOptions:function(e){var t={};if(e)Array.isArray(e)||(t=e,e=Object.keys(t));else{var n=this.$options;e=Object.keys(n).filter(function(e){return!n[e].hidden})}return e.forEach(function(e){t[e]=this.getOption(e)},this),t},setOption:function(e,t){if(this["$"+e]!==t){var i=this.$options[e];return i?i.forwardTo?this[i.forwardTo]&&this[i.forwardTo].setOption(e,t):(i.handlesSet||(this["$"+e]=t),void(i&&i.set&&i.set.call(this,t))):n('misspelled option "'+e+'"')}},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this["$"+e]:n('misspelled option "'+e+'"')}},a=function(){this.$defaultOptions={}};(function(){o.implement(this,r),this.defineOptions=function(e,t,n){return e.$options||(this.$defaultOptions[t]=e.$options={}),Object.keys(n).forEach(function(t){var i=n[t];"string"==typeof i&&(i={forwardTo:i}),i.name||(i.name=t),e.$options[i.name]=i,"initialValue"in i&&(e["$"+i.name]=i.initialValue)}),o.implement(e,s),this},this.resetOptions=function(e){Object.keys(e.$options).forEach(function(t){var n=e.$options[t];"value"in n&&e.setOption(t,n.value)})},this.setDefaultValue=function(e,t,n){if(!e){for(e in this.$defaultOptions)if(this.$defaultOptions[e][t])break;if(!this.$defaultOptions[e][t])return!1}var i=this.$defaultOptions[e]||(this.$defaultOptions[e]={});i[t]&&(i.forwardTo?this.setDefaultValue(i.forwardTo,t,n):i[t].value=n)},this.setDefaultValues=function(e,t){Object.keys(t).forEach(function(n){this.setDefaultValue(e,n,t[n])},this)},this.warn=n,this.reportError=i}).call(a.prototype),t.AppConfig=a}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/app_config"],function(e,t,n){"no use strict";function i(i){if(l&&l.document){c.packaged=i||e.packaged||n.packaged||l.define&&define.packaged;for(var r={},s="",a=document.currentScript||document._currentScript,h=a&&a.ownerDocument||document,u=h.getElementsByTagName("script"),d=0;d<u.length;d++){var g=u[d],p=g.src||g.getAttribute("src");if(p){for(var f=g.attributes,m=0,v=f.length;m<v;m++){var b=f[m];0===b.name.indexOf("data-ace-")&&(r[o(b.name.replace(/^data-ace-/,""))]=b.value)}var w=p.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);w&&(s=w[1])}}s&&(r.base=r.base||s,r.packaged=!0),r.basePath=r.base,r.workerPath=r.workerPath||r.base,r.modePath=r.modePath||r.base,r.themePath=r.themePath||r.base,delete r.base;for(var y in r)"undefined"!=typeof r[y]&&t.set(y,r[y])}}function o(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}var r=e("./lib/lang"),s=(e("./lib/oop"),e("./lib/net")),a=e("./lib/app_config").AppConfig;n.exports=t=new a;var l=function(){return this||"undefined"!=typeof window&&window}(),c={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1};t.get=function(e){if(!c.hasOwnProperty(e))throw new Error("Unknown config key: "+e);return c[e]},t.set=function(e,t){if(c.hasOwnProperty(e))c[e]=t;else if(0==this.setDefaultValue("",e,t))throw new Error("Unknown config key: "+e)},t.all=function(){return r.copyObject(c)},t.$modes={},t.moduleUrl=function(e,t){if(c.$moduleUrls[e])return c.$moduleUrls[e];var n=e.split("/");t=t||n[n.length-2]||"";var i="snippets"==t?"/":"-",o=n[n.length-1];if("worker"==t&&"-"==i){var r=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g");o=o.replace(r,"")}(!o||o==t)&&n.length>1&&(o=n[n.length-2]);var s=c[t+"Path"];return null==s?s=c.basePath:"/"==i&&(t=i=""),s&&"/"!=s.slice(-1)&&(s+="/"),s+t+i+o+this.get("suffix")},t.setModuleUrl=function(e,t){return c.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,i){var o,r;Array.isArray(n)&&(r=n[0],n=n[1]);try{o=e(n)}catch(e){}if(o&&!t.$loading[n])return i&&i(o);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(i),!(t.$loading[n].length>1)){var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var i=t.$loading[n];t.$loading[n]=null,i.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,r),a),h()}};var h=function(){!c.basePath&&!c.workerPath&&!c.modePath&&!c.themePath&&!Object.keys(c.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),h=function(){})};t.init=i,t.version="1.4.6"}),
2
+ ;var e=t.selection,n=e.getRange(),i=e.cursor.row,o=n.start.column,r=n.end.column,s=t.session.getLine(i);if(n.start.row!=i){var a=t.session.getLine(i-1);o=n.start.row<i-1?0:o,r+=a.length+1,s=a+"\n"+s}else if(n.end.row!=i){var l=t.session.getLine(i+1);r=n.end.row>i+1?l.length:r,r+=s.length+1,s=s+"\n"+l}s.length>h&&(o<h&&r<h?s=s.slice(0,h):(s="\n",o=0,r=1));var c=s+"\n\n";if(c!=A&&(w.value=A=c,L=M=c.length),F&&(L=w.selectionStart,M=w.selectionEnd),M!=r||L!=o||w.selectionEnd!=M)try{w.setSelectionRange(o,r),L=o,M=r}catch(e){}k=!1}};R&&t.onFocus();var E=function(e){return 0===e.selectionStart&&e.selectionEnd>=A.length&&e.value===A&&A&&e.selectionEnd!==M},O=function(){k||(y?y=!1:E(w)&&(t.selectAll(),T()))},I=null;this.setInputHandler=function(e){I=e},this.getInputHandler=function(){return I};var F=!1,B=function(e,n){if(F&&(F=!1),x)return T(),e&&t.onPaste(e),x=!1,"";for(var i=w.selectionStart,o=w.selectionEnd,r=L,s=A.length-M,a=e,l=e.length-i,c=e.length-o,h=0;r>0&&A[h]==e[h];)h++,r--;for(a=a.slice(h),h=1;s>0&&A.length-h>L-1&&A[A.length-h]==e[e.length-h];)h++,s--;l-=h-1,c-=h-1;var u=a.length-h+1;return u<0&&(r=-u,u=0),a=a.slice(0,u),n||l!=a.length||r||s||c?(C=!0,a&&!r&&!s&&!l&&!c||$?t.onTextInput(a):t.onTextInput(a,{extendLeft:r,extendRight:s,restoreStart:l,restoreEnd:c}),C=!1,A=e,L=i,M=o,a):""},H=function(e){if(k)return V();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var n=w.value,i=B(n,!0);(n.length>h+100||p.test(i))&&T()},N=function(e,t,n){var i=e.clipboardData||window.clipboardData;if(i&&!a){var o=l||n?"Text":"text/plain";try{return t?!1!==i.setData(o,t):i.getData(o)}catch(e){if(!n)return N(e,t,!0)}}},D=function(e,i){var o=t.getCopyText();if(!o)return n.preventDefault(e);N(e,o)?(g&&(T(o),y=o,setTimeout(function(){y=!1},10)),i?t.onCut():t.onCopy(),n.preventDefault(e)):(y=!0,w.value=o,w.select(),setTimeout(function(){y=!1,T(),i?t.onCut():t.onCopy()}))},P=function(e){D(e,!0)},W=function(e){D(e,!1)},z=function(e){var o=N(e);s.pasteCancelled()||("string"==typeof o?(o&&t.onPaste(o,e),i.isIE&&setTimeout(T),n.preventDefault(e)):(w.value="",x=!0))};n.addCommandKeyListener(w,t.onCommandKey.bind(t)),n.addListener(w,"select",O),n.addListener(w,"input",H),n.addListener(w,"cut",P),n.addListener(w,"copy",W),n.addListener(w,"paste",z),(!("oncut"in w)||!("oncopy"in w)||!("onpaste"in w))&&n.addListener(e,"keydown",function(e){if((!i.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:W(e);break;case 86:z(e);break;case 88:P(e)}});var K=function(){if(!k&&t.onCompositionStart&&!t.$readOnly&&(k={},!$)){setTimeout(V,0),t.on("mousedown",f);var e=t.getSelectionRange();e.end.row=e.start.row,e.end.column=e.start.column,k.markerRange=e,k.selectionStart=L,t.onCompositionStart(k),k.useTextareaForIME?(w.value="",A="",L=0,M=0):(w.msGetInputContext&&(k.context=w.msGetInputContext()),w.getInputContext&&(k.context=w.getInputContext()))}},V=function(){if(k&&t.onCompositionUpdate&&!t.$readOnly){if($)return f();if(k.useTextareaForIME)t.onCompositionUpdate(w.value);else{var e=w.value;B(e),k.markerRange&&(k.context&&(k.markerRange.start.column=k.selectionStart=k.context.compositionStartOffset),k.markerRange.end.column=k.markerRange.start.column+M-k.selectionStart)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(k=!1,t.onCompositionEnd(),t.off("mousedown",f),e&&H())},G=r.delayedCall(V,50).schedule.bind(null,null);n.addListener(w,"compositionstart",K),n.addListener(w,"compositionupdate",V),n.addListener(w,"keyup",m),n.addListener(w,"keydown",G),n.addListener(w,"compositionend",U),this.getElement=function(){return w},this.setCommandMode=function(e){$=e,w.readOnly=!1},this.setReadOnly=function(e){$||(w.readOnly=e)},this.setCopyWithEmptySelection=function(){},this.onContextMenu=function(e){F=!0,T(),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,r){S||(S=w.style.cssText),w.style.cssText=(r?"z-index:100000;":"")+(i.isIE?"opacity:0.1;":"")+"text-indent: -"+(L+M)*t.renderer.characterWidth*.5+"px;";var s=t.container.getBoundingClientRect(),a=o.computedStyle(t.container),l=s.top+(parseInt(a.borderTopWidth)||0),c=s.left+(parseInt(s.borderLeftWidth)||0),h=s.bottom-l-w.clientHeight-2,u=function(e){o.translate(w,e.clientX-c-2,Math.min(e.clientY-l-2,h))};u(e),"mousedown"==e.type&&(t.renderer.$isMousePressed=!0,clearTimeout(j),i.isWin&&n.capture(t.container,u,v))},this.onContextMenuClose=v;var j,q=function(e){t.textInput.onContextMenu(e),v()};n.addListener(w,"mouseup",q),n.addListener(w,"mousedown",function(e){e.preventDefault(),v()}),n.addListener(t.renderer.scroller,"contextmenu",q),n.addListener(w,"contextmenu",q),g&&b(e,t,w)};t.TextInput=f}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(e,t){"use strict";function n(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function i(e,t,n,i){return Math.sqrt(Math.pow(n-e,2)+Math.pow(i-t,2))}function o(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)var n=2*t.row-e.start.row-e.end.row;else var n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var r=e("../lib/useragent"),s=550;(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,o=e.getButton();return 0!==o?((i.getSelectionRange().isEmpty()||1==o)&&i.selection.moveToPosition(n),void(2==o&&(i.textInput.onContextMenu(e.domEvent),r.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimeout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select"))},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var i=this.$clickSelection.comparePoint(n);if(-1==i)e=this.$clickSelection.end;else if(1==i)e=this.$clickSelection.start;else{var r=o(this.$clickSelection,n);n=r.cursor,e=r.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,i=n.renderer.screenToTextCoordinates(this.x,this.y),r=n.selection[e](i.row,i.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(r.start),a=this.$clickSelection.comparePoint(r.end);if(-1==s&&a<=0)t=this.$clickSelection.end,r.end.row==i.row&&r.end.column==i.column||(i=r.start);else if(1==a&&s>=0)t=this.$clickSelection.start,r.start.row==i.row&&r.start.column==i.column||(i=r.end);else if(-1==s&&1==a)i=r.end,t=r.start;else{var l=o(this.$clickSelection,i);i=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(i),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=i(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(e>0||t-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,i=n.session,o=i.getBracketRange(t);o?(o.isEmpty()&&(o.start.column--,o.end.column++),this.setState("select")):(o=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=o,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var i=n.getSelectionRange();i.isMultiLine()&&i.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(i.start.row),this.$clickSelection.end=n.selection.getLineRange(i.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(){var e=this.editor;e.selectAll(),this.$clickSelection=e.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,i=e.domEvent.timeStamp,o=i-n.t,r=o?e.wheelX/o:n.vx,a=o?e.wheelY/o:n.vy;o<s&&(r=(r+n.vx)/2,a=(a+n.vy)/2);var l=Math.abs(r/a),c=!1;if(l>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(c=!0),l<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(c=!0),c)n.allowed=i;else if(i-n.allowed<s){var h=Math.abs(r)<=1.5*Math.abs(n.vx)&&Math.abs(a)<=1.5*Math.abs(n.vy);h?(c=!0,n.allowed=i):n.allowed=0}return n.t=i,n.vx=r,n.vy=a,c?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}}}).call(n.prototype),t.DefaultHandlers=n}),ace.define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t){"use strict";function n(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}var i=(e("./lib/oop"),e("./lib/dom"));(function(){this.$init=function(){return this.$element=i.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){this.getElement().textContent=e},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){i.addCssClass(this.getElement(),e)},this.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(n.prototype),t.Tooltip=n}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t){"use strict";function n(e){function t(){var t=u.getDocumentPosition().row,i=l.$annotations[t];if(!i)return n();if(t==a.session.getLength()){var o=a.renderer.pixelToScreenCoordinates(0,u.y).row,s=u.$pos;if(o>a.session.documentToScreenRow(s.row,s.column))return n()}if(d!=i)if(d=i.text.join("<br/>"),c.setHtml(d),c.show(),a._signal("showGutterTooltip",c),a.on("mousewheel",n),e.$tooltipFollowsMouse)r(u);else{var h=u.domEvent.target,g=h.getBoundingClientRect(),p=c.getElement().style;p.left=g.right+"px",p.top=g.bottom+"px"}}function n(){h&&(h=clearTimeout(h)),d&&(c.hide(),d=null,a._signal("hideGutterTooltip",c),a.removeEventListener("mousewheel",n))}function r(e){c.setPosition(e.x,e.y)}var a=e.editor,l=a.renderer.$gutterLayer,c=new i(a.container);e.editor.setDefaultHandler("guttermousedown",function(t){if(a.isFocused()&&0==t.getButton()){if("foldWidgets"!=l.getRegion(t)){var n=t.getDocumentPosition().row,i=a.session.selection;if(t.getShiftKey())i.selectTo(n,0);else{if(2==t.domEvent.detail)return a.selectAll(),t.preventDefault();e.$clickSelection=a.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}});var h,u,d;e.editor.setDefaultHandler("guttermousemove",function(i){var s=i.domEvent.target||i.domEvent.srcElement;if(o.hasCssClass(s,"ace_fold-widget"))return n();d&&e.$tooltipFollowsMouse&&r(i),u=i,h||(h=setTimeout(function(){h=null,u&&!e.isMousePressed?t():n()},50))}),s.addListener(a.renderer.$gutter,"mouseout",function(){u=null,d&&!h&&(h=setTimeout(function(){h=null,n()},50))}),a.on("changeSession",n)}function i(e){a.call(this,e)}var o=e("../lib/dom"),r=e("../lib/oop"),s=e("../lib/event"),a=e("../tooltip").Tooltip;r.inherits(i,a),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight,o=this.getWidth(),r=this.getHeight();e+=15,t+=15,e+o>n&&(e-=e+o-n),t+r>i&&(t-=20+r),a.prototype.setPosition.call(this,e,t)}}.call(i.prototype),t.GutterHandler=n}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t){"use strict";var n=e("../lib/event"),i=e("../lib/useragent"),o=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){n.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){n.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor,t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var n=this.getDocumentPosition();this.$inSelection=t.contains(n.row,n.column)}return this.$inSelection},this.getButton=function(){return n.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(o.prototype)}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t){"use strict";function n(e){function t(e,t){var n=Date.now(),o=!t||e.row!=t.row,r=!t||e.column!=t.column;if(!A||o||r)m.moveCursorToPosition(e),A=n,L={x:w,y:y};else{i(L.x,L.y,w,y)>c?A=null:n-A>=l&&(m.renderer.scrollCursorIntoView(),A=null)}}function n(e,t){var n=Date.now(),i=m.renderer.layerConfig.lineHeight,o=m.renderer.layerConfig.characterWidth,r=m.renderer.scroller.getBoundingClientRect(),s={x:{left:w-r.left,right:r.right-w},y:{top:y-r.top,bottom:r.bottom-y}},l=Math.min(s.x.left,s.x.right),c=Math.min(s.y.top,s.y.bottom),h={row:e.row,column:e.column};l/o<=2&&(h.column+=s.x.left<s.x.right?-3:2),c/i<=1&&(h.row+=s.y.top<s.y.bottom?-1:1);var u=e.row!=h.row,d=e.column!=h.column,g=!t||e.row!=t.row;u||d&&!g?_?n-_>=a&&m.renderer.scrollCursorIntoView(h):_=n:_=null}function h(){var e=C;C=m.renderer.screenToTextCoordinates(w,y),t(C,e),n(C,e)}function u(){k=m.selection.toOrientedRange(),b=m.session.addMarker(k,"ace_selection",m.getSelectionStyle()),m.clearSelection(),m.isFocused()&&m.renderer.$cursorLayer.setBlinking(!1),clearInterval(x),h(),x=setInterval(h,20),R=0,r.addListener(document,"mousemove",g)}function d(){clearInterval(x),m.session.removeMarker(b),b=null,m.selection.fromOrientedRange(k),m.isFocused()&&!$&&m.$resetCursorStyle(),k=null,C=null,R=0,_=null,A=null,r.removeListener(document,"mousemove",g)}function g(){null==T&&(T=setTimeout(function(){null!=T&&b&&d()},20))}function p(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function f(e){var t=["copy","copymove","all","uninitialized"],n=["move","copymove","linkmove","all","uninitialized"],i=s.isMac?e.altKey:e.ctrlKey,o="uninitialized";try{o=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var r="none";return i&&t.indexOf(o)>=0?r="copy":n.indexOf(o)>=0?r="move":t.indexOf(o)>=0&&(r="copy"),r}var m=e.editor,v=o.createElement("img");v.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(v.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),m.addEventListener("mousedown",this.onMouseDown.bind(e));var b,w,y,x,k,C,S,$,_,A,L,M=m.container,R=0;this.onDragStart=function(e){if(this.cancelDrag||!M.draggable){var t=this;return setTimeout(function(){t.startSelect(),t.captureMouse(e)},0),e.preventDefault()}k=m.getSelectionRange();var n=e.dataTransfer;n.effectAllowed=m.getReadOnly()?"copy":"copyMove",s.isOpera&&(m.container.appendChild(v),v.scrollTop=0),n.setDragImage&&n.setDragImage(v,0,0),s.isOpera&&m.container.removeChild(v),n.clearData(),n.setData("Text",m.session.getTextRange()),$=!0,this.setState("drag")},this.onDragEnd=function(e){if(M.draggable=!1,$=!1,this.setState(null),!m.getReadOnly()){var t=e.dataTransfer.dropEffect;!S&&"move"==t&&m.session.remove(m.getSelectionRange()),m.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!m.getReadOnly()&&p(e.dataTransfer))return w=e.clientX,y=e.clientY,b||u(),R++,e.dataTransfer.dropEffect=S=f(e),r.preventDefault(e)},this.onDragOver=function(e){if(!m.getReadOnly()&&p(e.dataTransfer))return w=e.clientX,y=e.clientY,b||(u(),R++),null!==T&&(T=null),e.dataTransfer.dropEffect=S=f(e),r.preventDefault(e)},this.onDragLeave=function(e){if(--R<=0&&b)return d(),S=null,r.preventDefault(e)},this.onDrop=function(e){if(C){var t=e.dataTransfer;if($)switch(S){case"move":k=k.contains(C.row,C.column)?{start:C,end:C}:m.moveText(k,C);break;case"copy":k=m.moveText(k,C,!0)}else{var n=t.getData("Text");k={start:C,end:m.session.insert(C,n)},m.focus(),S=null}return d(),r.preventDefault(e)}},r.addListener(M,"dragstart",this.onDragStart.bind(e)),r.addListener(M,"dragend",this.onDragEnd.bind(e)),r.addListener(M,"dragenter",this.onDragEnter.bind(e)),r.addListener(M,"dragover",this.onDragOver.bind(e)),r.addListener(M,"dragleave",this.onDragLeave.bind(e)),r.addListener(M,"drop",this.onDrop.bind(e));var T=null}function i(e,t,n,i){return Math.sqrt(Math.pow(n-e,2)+Math.pow(i-t,2))}var o=e("../lib/dom"),r=e("../lib/event"),s=e("../lib/useragent"),a=200,l=200,c=5;(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=s.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(){var e=this.editor.container;if(s.isIE&&"dragReady"==this.state){var t=i(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);t>3&&e.dragDrop()}if("dragWait"===this.state){var t=i(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);t>0&&(e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),i=e.getButton();if(1===(e.domEvent.detail||1)&&0===i&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var o=e.domEvent.target||e.domEvent.srcElement;if("unselectable"in o&&(o.unselectable="on"),t.getDragDelay()){if(s.isWebKit){this.cancelDrag=!0;t.container.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(n.prototype),t.DragdropHandler=n}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/dom"],function(e,t){"use strict";var n=e("./mouse_event").MouseEvent,i=e("../lib/dom");t.addTouchListeners=function(e,t){function o(){var e=window.navigator&&window.navigator.clipboard,n=!1,o=function(){var o=t.getCopyText(),r=t.session.getUndoManager().hasUndo();b.replaceChild(i.buildDom(n?["span",!o&&["span",{"class":"ace_mobile-button",action:"selectall"},"Select All"],o&&["span",{"class":"ace_mobile-button",action:"copy"},"Copy"],o&&["span",{"class":"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{"class":"ace_mobile-button",action:"paste"},"Paste"],r&&["span",{"class":"ace_mobile-button",action:"undo"},"Undo"],["span",{"class":"ace_mobile-button",action:"find"},"Find"],["span",{"class":"ace_mobile-button",action:"openCommandPallete"},"Pallete"]]:["span"]),b.firstChild)},r=function(i){var r=i.target.getAttribute("action");if("more"==r||!n)return n=!n,o();"paste"==r?e.readText().then(function(e){t.execCommand(r,e)}):r&&("cut"!=r&&"copy"!=r||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(r)),b.firstChild.style.display="none",n=!1,"openCommandPallete"!=r&&t.focus()};b=i.buildDom(["div",{"class":"ace_mobile-menu",ontouchstart:function(e){w="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),r(e)},onclick:r},["span"],["span",{"class":"ace_mobile-button",action:"more"},"..."]],t.container)}function r(){b||o();var e=t.selection.cursor,n=t.renderer.textToScreenCoordinates(e.row,e.column),i=t.container.getBoundingClientRect();b.style.top=n.pageY-i.top-3+"px",b.style.right="10px",b.style.display="",b.firstChild.style.display="none",t.on("input",s)}function s(){b&&(b.style.display="none"),t.off("input",s)}function a(){p=null,clearTimeout(p);var e=t.selection.getRange(),n=e.contains(m.row,m.column);!e.isEmpty()&&n||(t.selection.moveToPosition(m),t.selection.selectWord()),w="wait",r()}function l(){p=null,clearTimeout(p),t.selection.moveToPosition(m);var e=x>=2?t.selection.getLineRange(m.row):t.session.getBracketRange(m);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),w="wait"}function c(){y+=60,f=setInterval(function(){y--<=0&&(clearInterval(f),f=null),Math.abs(k)<.01&&(k=0),Math.abs(C)<.01&&(C=0),y<20&&(k*=.9),y<20&&(C*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*k,10*C),e==t.session.getScrollTop()&&(y=0)},10)}var h,u,d,g,p,f,m,v,b,w="scroll",y=0,x=0,k=0,C=0;e.addEventListener("contextmenu",function(){if(v){t.textInput.getElement().focus()}}),e.addEventListener("touchstart",function(e){var i=e.touches;if(p||i.length>1)return clearTimeout(p),p=null,d=-1,w="zoom",void 0;v=t.$mouseHandler.isMousePressed=!0;var o=t.renderer.layerConfig.lineHeight,r=t.renderer.layerConfig.lineHeight,s=e.timeStamp;g=s;var c=i[0],f=c.clientX,b=c.clientY;Math.abs(h-f)+Math.abs(u-b)>o&&(d=-1),h=e.clientX=f,u=e.clientY=b,k=C=0;var S=new n(e,t);if(m=S.getDocumentPosition(),s-d<500&&1==i.length&&!y)x++,e.preventDefault(),e.button=0,l();else{x=0;var $=t.selection.cursor,_=t.selection.isEmpty()?$:t.selection.anchor,A=t.renderer.$cursorLayer.getPixelPosition($,!0),L=t.renderer.$cursorLayer.getPixelPosition(_,!0),M=t.renderer.scroller.getBoundingClientRect(),R=function(e,t){return e/=r,t=t/o-.75,e*e+t*t};if(e.clientX<M.left)return void(w="zoom");var T=R(e.clientX-M.left-A.left,e.clientY-M.top-A.top),E=R(e.clientX-M.left-L.left,e.clientY-M.top-L.top);T<3.5&&E<3.5&&(w=T>E?"cursor":"anchor"),w=E<3.5?"anchor":T<3.5?"cursor":"scroll",p=setTimeout(a,450)}d=s}),e.addEventListener("touchend",function(e){v=t.$mouseHandler.isMousePressed=!1,f&&clearInterval(f),"zoom"==w?(w="",y=0):p?(t.selection.moveToPosition(m),y=0,r()):"scroll"==w?(c(),e.preventDefault(),s()):r(),clearTimeout(p),p=null}),e.addEventListener("touchmove",function(e){p&&(clearTimeout(p),p=null);var i=e.touches;if(!(i.length>1||"zoom"==w)){var o=i[0],r=h-o.clientX,s=u-o.clientY;if("wait"==w){if(!(r*r+s*s>4))return e.preventDefault();w="cursor"}h=o.clientX,u=o.clientY,e.clientX=o.clientX,e.clientY=o.clientY;var a=e.timeStamp,l=a-g;if(g=a,"scroll"==w){var c=new n(e,t);c.speed=1,c.wheelX=r,c.wheelY=s,10*Math.abs(r)<Math.abs(s)&&(r=0),10*Math.abs(s)<Math.abs(r)&&(s=0),0!=l&&(k=r/l,C=s/l),t._emit("mousewheel",c),c.propagationStopped||(k=C=0)}else{var d=new n(e,t),f=d.getDocumentPosition();"cursor"==w?t.selection.moveCursorToPosition(f):"anchor"==w&&t.selection.setSelectionAnchor(f.row,f.column),t.renderer.scrollCursorIntoView(f),e.preventDefault()}}})}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t){"use strict";var n=e("./dom");t.get=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){4===n.readyState&&t(n.responseText)},n.send(null)},t.loadScript=function(e,t){var i=n.getDocumentHead(),o=document.createElement("script");o.src=e,i.appendChild(o),o.onload=o.onreadystatechange=function(e,n){!n&&o.readyState&&"loaded"!=o.readyState&&"complete"!=o.readyState||(o=o.onload=o.onreadystatechange=null,n||t())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(e,t){"use strict";var n={},i=function(){this.propagationStopped=!0},o=function(){this.defaultPrevented=!0};n._emit=n._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(n.length||r){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=o),n=n.slice();for(var s=0;s<n.length&&(n[s](t,this),!t.propagationStopped);s++);return r&&!t.defaultPrevented?r(t,this):void 0}},n._signal=function(e,t){var n=(this._eventRegistry||{})[e];if(n){n=n.slice();for(var i=0;i<n.length;i++)n[i](t,this)}},n.once=function(e,t){var n=this;if(this.addEventListener(e,function i(){n.removeEventListener(e,i),t.apply(null,arguments)}),!t)return new Promise(function(e){t=e})},n.setDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n||(n=this._defaultHandlers={_disabled_:{}}),n[e]){var i=n[e],o=n._disabled_[e];o||(n._disabled_[e]=o=[]),o.push(i);var r=o.indexOf(t);-1!=r&&o.splice(r,1)}n[e]=t},n.removeDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n){var i=n._disabled_[e];if(n[e]==t)i&&this.setDefaultHandler(e,i.pop());else if(i){var o=i.indexOf(t);-1!=o&&i.splice(o,1)}}},n.on=n.addEventListener=function(e,t,n){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[e];return i||(i=this._eventRegistry[e]=[]),-1==i.indexOf(t)&&i[n?"unshift":"push"](t),t},n.off=n.removeListener=n.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(n){var i=n.indexOf(t);-1!==i&&n.splice(i,1)}},n.removeAllListeners=function(e){this._eventRegistry&&(this._eventRegistry[e]=[])},t.EventEmitter=n}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t){"no use strict";function n(){"undefined"!=typeof console&&console.warn&&console.warn.apply(console,arguments)}function i(e,t){var n=new Error(e);n.data=t,"object"==typeof console&&console.error&&console.error(n),setTimeout(function(){throw n})}var o=e("./oop"),r=e("./event_emitter").EventEmitter,s={setOptions:function(e){Object.keys(e).forEach(function(t){this.setOption(t,e[t])},this)},getOptions:function(e){var t={};if(e)Array.isArray(e)||(t=e,e=Object.keys(t));else{var n=this.$options;e=Object.keys(n).filter(function(e){return!n[e].hidden})}return e.forEach(function(e){t[e]=this.getOption(e)},this),t},setOption:function(e,t){if(this["$"+e]!==t){var i=this.$options[e];return i?i.forwardTo?this[i.forwardTo]&&this[i.forwardTo].setOption(e,t):(i.handlesSet||(this["$"+e]=t),void(i&&i.set&&i.set.call(this,t))):n('misspelled option "'+e+'"')}},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this["$"+e]:n('misspelled option "'+e+'"')}},a=function(){this.$defaultOptions={}};(function(){o.implement(this,r),this.defineOptions=function(e,t,n){return e.$options||(this.$defaultOptions[t]=e.$options={}),Object.keys(n).forEach(function(t){var i=n[t];"string"==typeof i&&(i={forwardTo:i}),i.name||(i.name=t),e.$options[i.name]=i,"initialValue"in i&&(e["$"+i.name]=i.initialValue)}),o.implement(e,s),this},this.resetOptions=function(e){Object.keys(e.$options).forEach(function(t){var n=e.$options[t];"value"in n&&e.setOption(t,n.value)})},this.setDefaultValue=function(e,t,n){if(!e){for(e in this.$defaultOptions)if(this.$defaultOptions[e][t])break;if(!this.$defaultOptions[e][t])return!1}var i=this.$defaultOptions[e]||(this.$defaultOptions[e]={});i[t]&&(i.forwardTo?this.setDefaultValue(i.forwardTo,t,n):i[t].value=n)},this.setDefaultValues=function(e,t){Object.keys(t).forEach(function(n){this.setDefaultValue(e,n,t[n])},this)},this.warn=n,this.reportError=i}).call(a.prototype),t.AppConfig=a}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/app_config"],function(e,t,n){"no use strict";function i(i){if(l&&l.document){c.packaged=i||e.packaged||n.packaged||l.define&&define.packaged;for(var r={},s="",a=document.currentScript||document._currentScript,h=a&&a.ownerDocument||document,u=h.getElementsByTagName("script"),d=0;d<u.length;d++){var g=u[d],p=g.src||g.getAttribute("src");if(p){for(var f=g.attributes,m=0,v=f.length;m<v;m++){var b=f[m];0===b.name.indexOf("data-ace-")&&(r[o(b.name.replace(/^data-ace-/,""))]=b.value)}var w=p.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);w&&(s=w[1])}}s&&(r.base=r.base||s,r.packaged=!0),r.basePath=r.base,r.workerPath=r.workerPath||r.base,r.modePath=r.modePath||r.base,r.themePath=r.themePath||r.base,delete r.base;for(var y in r)"undefined"!=typeof r[y]&&t.set(y,r[y])}}function o(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}var r=e("./lib/lang"),s=(e("./lib/oop"),e("./lib/net")),a=e("./lib/app_config").AppConfig;n.exports=t=new a;var l=function(){return this||"undefined"!=typeof window&&window}(),c={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1};t.get=function(e){if(!c.hasOwnProperty(e))throw new Error("Unknown config key: "+e);return c[e]},t.set=function(e,t){if(c.hasOwnProperty(e))c[e]=t;else if(0==this.setDefaultValue("",e,t))throw new Error("Unknown config key: "+e)},t.all=function(){return r.copyObject(c)},t.$modes={},t.moduleUrl=function(e,t){if(c.$moduleUrls[e])return c.$moduleUrls[e];var n=e.split("/");t=t||n[n.length-2]||"";var i="snippets"==t?"/":"-",o=n[n.length-1];if("worker"==t&&"-"==i){var r=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g");o=o.replace(r,"")}(!o||o==t)&&n.length>1&&(o=n[n.length-2]);var s=c[t+"Path"];return null==s?s=c.basePath:"/"==i&&(t=i=""),s&&"/"!=s.slice(-1)&&(s+="/"),s+t+i+o+this.get("suffix")},t.setModuleUrl=function(e,t){return c.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,i){var o,r;Array.isArray(n)&&(r=n[0],n=n[1]);try{o=e(n)}catch(e){}if(o&&!t.$loading[n])return i&&i(o);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(i),!(t.$loading[n].length>1)){var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var i=t.$loading[n];t.$loading[n]=null,i.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,r),a),h()}};var h=function(){!c.basePath&&!c.workerPath&&!c.modePath&&!c.themePath&&!Object.keys(c.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),h=function(){})};t.init=i,t.version="1.4.6"}),
3
3
  ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(e,t){"use strict";var n=e("../lib/event"),i=e("../lib/useragent"),o=e("./default_handlers").DefaultHandlers,r=e("./default_gutter_handler").GutterHandler,s=e("./mouse_event").MouseEvent,a=e("./dragdrop_handler").DragdropHandler,l=e("./touch_handler").addTouchListeners,c=e("../config"),h=function(e){var t=this;this.editor=e,new o(this),new r(this),new a(this);var s=function(){(!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement()))&&window.focus(),e.focus()},c=e.renderer.getMouseEventTarget();n.addListener(c,"click",this.onMouseEvent.bind(this,"click")),n.addListener(c,"mousemove",this.onMouseMove.bind(this,"mousemove")),n.addMultiMouseDownListener([c,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent"),n.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel")),l(e.container,e);var h=e.renderer.$gutter;n.addListener(h,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),n.addListener(h,"click",this.onMouseEvent.bind(this,"gutterclick")),n.addListener(h,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),n.addListener(h,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),n.addListener(c,"mousedown",s),n.addListener(h,"mousedown",s),i.isIE&&e.renderer.scrollBarV&&(n.addListener(e.renderer.scrollBarV.element,"mousedown",s),n.addListener(e.renderer.scrollBarH.element,"mousedown",s)),e.on("mousemove",function(n){if(!t.state&&!t.$dragDelay&&t.$dragEnabled){var i=e.renderer.screenToTextCoordinates(n.x,n.y),o=e.session.selection.getRange(),r=e.renderer;!o.isEmpty()&&o.insideStart(i.row,i.column)?r.setCursorStyle("default"):r.setCursorStyle("")}})};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new s(t,this.editor))},this.onMouseMove=function(e,t){var n=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;n&&n.length&&this.editor._emit(e,new s(t,this.editor))},this.onMouseWheel=function(e,t){var n=new s(t,this.editor);n.speed=2*this.$scrollSpeed,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var o=this.editor,r=this.editor.renderer;r.$isMousePressed=!0;var a=this,l=function(e){if(e)return i.isWebKit&&!e.which&&a.releaseMouse?a.releaseMouse():(a.x=e.clientX,a.y=e.clientY,t&&t(e),a.mouseEvent=new s(e,a.editor),a.$mouseMoved=!0,void 0)},c=function(e){o.off("beforeEndOperation",u),clearInterval(d),h(),a[a.state+"End"]&&a[a.state+"End"](e),a.state="",a.isMousePressed=r.$isMousePressed=!1,r.$keepTextAreaAtCursor&&r.$moveTextAreaToCursor(),a.$onCaptureMouseMove=a.releaseMouse=null,e&&a.onMouseEvent("mouseup",e),o.endOperation()},h=function(){a[a.state]&&a[a.state](),a.$mouseMoved=!1};if(i.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout(function(){c(e)});var u=function(){a.releaseMouse&&o.curOp.command.name&&o.curOp.selectionChanged&&(a[a.state+"End"]&&a[a.state+"End"](),a.state="",a.releaseMouse())};o.on("beforeEndOperation",u),o.startOperation({command:{name:"mouse"}}),a.$onCaptureMouseMove=l,a.releaseMouse=n.capture(this.editor.container,l,c);var d=setInterval(h,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&"contextmenu"!=t.domEvent.type||(this.editor.off("nativecontextmenu",e),t&&t.domEvent&&n.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)}}).call(h.prototype),c.defineOptions(h.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:i.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=h}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(e,t){"use strict";function n(e){e.on("click",function(t){var n=t.getDocumentPosition(),o=e.session,r=o.getFoldAt(n.row,n.column,1);r&&(t.getAccelKey()?o.removeFold(r):o.expandFold(r),t.stop());var s=t.domEvent&&t.domEvent.target;s&&i.hasCssClass(s,"ace_inline_button")&&i.hasCssClass(s,"ace_toggle_wrap")&&(o.setOption("wrap",!o.getUseWrapMode()),e.renderer.scrollCursorIntoView())}),e.on("gutterclick",function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var n=t.getDocumentPosition().row,i=e.session;i.foldWidgets&&i.foldWidgets[n]&&e.session.onFoldWidgetClick(n,t),e.isFocused()||e.focus(),t.stop()}}),e.on("gutterdblclick",function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var n=t.getDocumentPosition().row,i=e.session,o=i.getParentFoldRangeData(n,!0),r=o.range||o.firstRange;if(r){n=r.start.row;var s=i.getFoldAt(n,i.getLine(n).length,1);s?i.removeFold(s):(i.addFold("...",r),e.renderer.scrollCursorIntoView({row:r.start.row,column:0}))}t.stop()}})}var i=e("../lib/dom");t.FoldHandler=n}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t){"use strict";var n=e("../lib/keys"),i=e("../lib/event"),o=function(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},this.addKeyboardHandler=function(e,t){if(e){"function"==typeof e&&!e.handleKeyboard&&(e.handleKeyboard=e);var n=this.$handlers.indexOf(e);-1!=n&&this.$handlers.splice(n,1),t==undefined?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==n&&e.attach&&e.attach(this.$editor)}},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map(function(n){return n.getStatusText&&n.getStatusText(t,e)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,n,o){for(var r,s=!1,a=this.$editor.commands,l=this.$handlers.length;l--&&!((r=this.$handlers[l].handleKeyboard(this.$data,e,t,n,o))&&r.command&&((s="null"==r.command||a.exec(r.command,this.$editor,r.args,o))&&o&&-1!=e&&1!=r.passEvent&&1!=r.command.passEvent&&i.stopEvent(o),s)););return!s&&-1==e&&(r={command:"insertstring"},s=a.exec("insertstring",this.$editor,t)),s&&this.$editor._signal&&this.$editor._signal("keyboardActivity",r),s},this.onCommandKey=function(e,t,i){var o=n.keyCodeToString(i);return this.$callKeyboardHandlers(t,o,i,e)},this.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)}}).call(o.prototype),t.KeyBinding=o}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(e,t){"use strict";function n(e,t,n,i){var p=s?g:d,f=null,m=null,v=null,b=0,w=null,k=-1,S=null,$=null,_=[];if(!i)for(S=0,i=[];S<n;S++)i[S]=r(e[S]);for(a=s,l=!1,c=!1,h=!1,u=!1,$=0;$<n;$++){if(f=b,_[$]=m=o(e,i,_,$),b=p[f][m],w=240&b,b&=15,t[$]=v=p[b][5],w>0)if(16==w){for(S=k;S<$;S++)t[S]=1;k=-1}else k=-1;if(p[b][6])-1==k&&(k=$);else if(k>-1){for(S=k;S<$;S++)t[S]=v;k=-1}i[$]==y&&(t[$]=0),a|=v}if(u)for(S=0;S<n;S++)if(i[S]==x){t[S]=s;for(var A=S-1;A>=0&&i[A]==C;A--)t[A]=s}}function i(e,t,n){if(!(a<e)){if(1==e&&s==p&&!h)return void n.reverse();for(var i,o,r,l,c=n.length,u=0;u<c;){if(t[u]>=e){for(i=u+1;i<c&&t[i]>=e;)i++;for(o=u,r=i-1;o<r;o++,r--)l=n[o],n[o]=n[r],n[r]=l;u=i}u++}}}function o(e,t,n,i){var o,r,a,d,g=t[i];switch(g){case f:case m:l=!1;case w:case b:return g;case v:return l?b:v;case k:return l=!0,c=!0,m;case C:return w;case S:return i<1||i+1>=t.length||(o=n[i-1])!=v&&o!=b||(r=t[i+1])!=v&&r!=b?w:(l&&(r=b),r==o?r:w);case $:return o=i>0?n[i-1]:y,o==v&&i+1<t.length&&t[i+1]==v?v:w;case _:if(i>0&&n[i-1]==v)return v;if(l)return w;for(d=i+1,a=t.length;d<a&&t[d]==_;)d++;return d<a&&t[d]==v?v:w;case A:for(a=t.length,d=i+1;d<a&&t[d]==A;)d++;if(d<a){var p=e[i],I=p>=1425&&p<=2303||64286==p;if(o=t[d],I&&(o==m||o==k))return m}return i<1||(o=t[i-1])==y?w:n[i-1];case y:return l=!1,h=!0,s;case x:return u=!0,w;case L:case M:case T:case E:case R:l=!1;case O:return w}}function r(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?f:I[t]:5==n?/[\u0591-\u05f4]/.test(e)?m:f:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?A:/[\u0660-\u0669\u066b-\u066c]/.test(e)?b:1642==t?_:/[\u06f0-\u06f9]/.test(e)?v:k:32==n&&t<=8287?F[255&t]:254==n&&t>=65136?k:w}var s=0,a=0,l=!1,c=!1,h=!1,u=!1,d=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],g=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],p=1,f=0,m=1,v=2,b=3,w=4,y=5,x=6,k=7,C=8,S=9,$=10,_=11,A=12,L=13,M=14,R=15,T=16,E=17,O=18,I=[O,O,O,O,O,O,O,O,O,x,y,x,C,y,O,O,O,O,O,O,O,O,O,O,O,O,O,O,y,y,y,x,C,w,w,_,_,_,w,w,w,w,w,$,S,$,S,S,v,v,v,v,v,v,v,v,v,v,S,w,w,w,w,w,w,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,w,w,w,w,w,w,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,w,w,w,w,O,O,O,O,O,O,y,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,S,w,_,_,_,_,w,w,w,w,f,w,w,O,w,w,_,_,v,v,w,f,w,w,w,v,f,w,w,w,w,w],F=[C,C,C,C,C,C,C,C,C,C,C,O,O,O,f,m,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,C,y,L,M,R,T,E,S,_,_,_,_,_,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,S,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,C];t.L=f,t.R=m,t.EN=v,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="\xb7",t.doBidiReorder=function(e,o,r){if(e.length<2)return{};var a=e.split(""),l=new Array(a.length),c=new Array(a.length),h=[];s=r?p:0,n(a,h,a.length,o);for(var u=0;u<l.length;l[u]=u,u++);i(2,h,l),i(1,h,l);for(var u=0;u<l.length-1;u++)o[u]===b?h[u]=t.AN:h[u]===m&&(o[u]>k&&o[u]<L||o[u]===w||o[u]===O)?h[u]=t.ON_R:u>0&&"\u0644"===a[u-1]&&/\u0622|\u0623|\u0625|\u0627/.test(a[u])&&(h[u-1]=h[u]=t.R_H,u++);a[a.length-1]===t.DOT&&(h[a.length-1]=t.B),"\u202b"===a[0]&&(h[0]=t.RLE);for(var u=0;u<l.length;u++)c[u]=h[l[u]];return{logicalFromVisual:l,bidiLevels:c}},t.hasBidiCharacters=function(e,t){for(var n=!1,i=0;i<e.length;i++)t[i]=r(e.charAt(i)),!n&&(t[i]==m||t[i]==k||t[i]==b)&&(n=!0);return n},t.getVisualFromLogicalIdx=function(e,t){for(var n=0;n<t.logicalFromVisual.length;n++)if(t.logicalFromVisual[n]==e)return n;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(e,t){"use strict";var n=e("./lib/bidiutil"),i=e("./lib/lang"),o=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,r=function(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=n,this.charWidths=[],this.EOL="\xac",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="\xb6",this.RLE="\u202b",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=o.test(e.getValue())};(function(){this.isBidiRow=function(e,t,n){return!!this.seenBidi&&(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,n),this.updateBidiMap()),this.bidiMap.bidiLevels)},this.onChange=function(e){this.seenBidi?this.currentRow=null:"insert"==e.action&&o.test(e.lines.join("\n"))&&(this.seenBidi=!0,this.currentRow=null)},this.getDocumentRow=function(){var e=0,t=this.session.$screenRowCache;if(t.length){var n=this.session.$getRowCacheIndex(t,this.currentRow);n>=0&&(e=this.session.$docRowCache[n])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,i=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===i;)i=n,e++;else e=this.currentRow;return e},this.updateRowLine=function(e,t){e===undefined&&(e=this.getDocumentRow());var o=e===this.session.getLength()-1,r=o?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var s=this.session.$wrapData[e];s&&(t===undefined&&(t=this.getSplitIndex()),t>0&&s.length?(this.wrapIndent=s.indent,this.wrapOffset=this.wrapIndent*this.charWidths[n.L],this.line=t<s.length?this.line.substring(s[t-1],s[t]):this.line.substring(s[s.length-1])):this.line=this.line.substring(0,s[t])),t==s.length&&(this.line+=this.showInvisibles?r:n.DOT)}else this.line+=this.showInvisibles?r:n.DOT;var a,l=this.session,c=0;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(e,t){return"\t"===e||l.isFullWidth(e.charCodeAt(0))?(a="\t"===e?l.getScreenTabSize(t+c):2,c+=a-1,i.stringRepeat(n.DOT,a)):e}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==n.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},this.updateBidiMap=function(){var e=[];n.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=n.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},this.markAsDirty=function(){this.currentRow=null},this.updateCharacterWidths=function(e){if(this.characterWidth!==e.$characterSize.width){this.fontMetrics=e;var t=this.characterWidth=e.$characterSize.width,i=e.$measureCharWidth("\u05d4");this.charWidths[n.L]=this.charWidths[n.EN]=this.charWidths[n.ON_R]=t,this.charWidths[n.R]=this.charWidths[n.AN]=i,this.charWidths[n.R_H]=.45*i,this.charWidths[n.B]=this.charWidths[n.RLE]=0,this.currentRow=null}},this.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},this.setEolChar=function(e){this.EOL=e},this.setContentWidth=function(e){this.contentWidth=e},this.isRtlLine=function(e){return!!this.$isRtl||(e!=undefined?this.session.getLine(e).charAt(0)==this.RLE:this.isRtlDir)},this.setRtlDirection=function(e,t){for(var n=e.getCursorPosition(),i=e.selection.getSelectionAnchor().row;i<=n.row;i++)t||e.session.getLine(i).charAt(0)!==e.session.$bidiHandler.RLE?t&&e.session.getLine(i).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:i},e.session.$bidiHandler.RLE):e.session.doc.removeInLine(i,0,1)},this.getPosLeft=function(e){e-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0,i=e>t?this.session.getOverwrite()?e:e-1:t,o=n.getVisualFromLogicalIdx(i,this.bidiMap),r=this.bidiMap.bidiLevels,s=0;!this.session.getOverwrite()&&e<=t&&r[o]%2!=0&&o++;for(var a=0;a<o;a++)s+=this.charWidths[r[a]];return!this.session.getOverwrite()&&e>t&&r[o]%2==0&&(s+=this.charWidths[r[o]]),this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(s+=this.rtlLineOffset),s},this.getSelections=function(e,t){var n,i=this.bidiMap,o=i.bidiLevels,r=[],s=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,c=!1,h=!1,u=0;this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var d,g=0;g<o.length;g++)d=i.logicalFromVisual[g],n=o[g],c=d>=a&&d<l,c&&!h?u=s:!c&&h&&r.push({left:u,width:s-u}),s+=this.charWidths[n],h=c;if(c&&g===o.length&&r.push({left:u,width:s-u}),this.isRtlDir)for(var p=0;p<r.length;p++)r[p].left+=this.rtlLineOffset;return r},this.offsetToCol=function(e){this.isRtlDir&&(e-=this.rtlLineOffset);var t=0,e=Math.max(e,0),n=0,i=0,o=this.bidiMap.bidiLevels,r=this.charWidths[o[i]];for(this.wrapIndent&&(e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);e>n+r/2;){if(n+=r,i===o.length-1){r=0;break}r=this.charWidths[o[++i]]}return i>0&&o[i-1]%2!=0&&o[i]%2==0?(e<n&&i--,t=this.bidiMap.logicalFromVisual[i]):i>0&&o[i-1]%2==0&&o[i]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===o.length-1&&0===r&&o[i-1]%2==0||!this.isRtlDir&&0===i&&o[i]%2!=0?t=1+this.bidiMap.logicalFromVisual[i]:(i>0&&o[i-1]%2!=0&&0!==r&&i--,t=this.bidiMap.logicalFromVisual[i]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent}}).call(r.prototype),t.BidiHandler=r}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t){"use strict";var n=e("./lib/oop"),i=e("./lib/lang"),o=e("./lib/event_emitter").EventEmitter,r=e("./range").Range,s=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),!t.$isEmpty&&!t.$silent&&t._emit("changeSelection"),!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column&&(t.$desiredColumn=null)}),this.anchor.on("change",function(){t.$anchorChanged=!0,!t.$isEmpty&&!t.$silent&&t._emit("changeSelection")})};(function(){n.implement(this,o),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.getAnchor=this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?r.fromPoints(t,t):this.isBackwards()?r.fromPoints(t,e):r.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,i=t?e.start:e.end;this.$setSelection(n.row,n.column,i.row,i.column)},this.$setSelection=function(e,t,n,i){var o=this.$isEmpty,s=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,i),this.$isEmpty=!r.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||o!=this.$isEmpty||s)&&this._emit("changeSelection")},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,i="number"==typeof e?e:this.lead.row,o=this.session.getFoldLine(i);return o?(i=o.start.row,n=o.end.row):n=i,!0===t?new r(i,0,n,this.session.getLine(n).length):new r(i,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var i=e.column,o=e.column+t;return n<0&&(i=e.column-t,o=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(i,o).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var n=this.session.getTabSize(),t=this.lead;this.wouldMoveIntoSoftTab(t,n,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,n):this.moveCursorBy(0,1)}},this.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,n=this.session.documentToScreenRow(e,t),i=this.session.screenToDocumentPosition(n,0),o=this.session.getDisplayLine(e,null,i.row,i.column),r=o.match(/^\s*/);r[0].length!=t&&!this.session.$useEmacsStyleLineStart&&(i.column+=r[0].length),this.moveCursorToPosition(i)},this.moveCursorLineEnd=function(){var e=this.lead,t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var n=this.session.getLine(t.row);if(t.column==n.length){var i=n.search(/\s+$/);i>0&&(t.column=i)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),i=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var o=this.session.getFoldAt(e,t,1);return o?void this.moveCursorTo(o.end.row,o.end.column):(this.session.nonTokenRe.exec(i)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=n.substring(t)),t>=n.length?(this.moveCursorTo(e,n.length),this.moveCursorRight(),e<this.doc.getLength()-1&&this.moveCursorWordRight(),void 0):(this.session.tokenRe.exec(i)&&(t+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),void this.moveCursorTo(e,t)))},this.moveCursorLongWordLeft=function(){var e,t=this.lead.row,n=this.lead.column;if(e=this.session.getFoldAt(t,n,-1))return void this.moveCursorTo(e.start.row,e.start.column);var o=this.session.getFoldStringAt(t,n,-1);null==o&&(o=this.doc.getLine(t).substring(0,n));var r=i.stringReverse(o);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(r)&&(n-=this.session.nonTokenRe.lastIndex,r=r.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),n<=0)return this.moveCursorTo(t,0),this.moveCursorLeft(),t>0&&this.moveCursorWordLeft(),void 0;this.session.tokenRe.exec(r)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)},this.$shortWordEndIndex=function(e){var t,n=0,i=/\s/,o=this.session.tokenRe;if(o.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&i.test(t);)n++;if(n<1)for(o.lastIndex=0;(t=e[n])&&!o.test(t);)if(o.lastIndex=0,n++,i.test(t)){if(n>2){n--;break}for(;(t=e[n])&&i.test(t);)n++;if(n>2)break}}return o.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),i=n.substring(t),o=this.session.getFoldAt(e,t,1);if(o)return this.moveCursorTo(o.end.row,o.end.column);if(t==n.length){var r=this.doc.getLength();do{e++,i=this.doc.getLine(e)}while(e<r&&/^\s*$/.test(i));/^\s+/.test(i)||(i=""),t=0}var s=this.$shortWordEndIndex(i);this.moveCursorTo(e,t+s)},this.moveCursorShortWordLeft=function(){var e,t=this.lead.row,n=this.lead.column;if(e=this.session.getFoldAt(t,n,-1))return this.moveCursorTo(e.start.row,e.start.column);var o=this.session.getLine(t).substring(0,n);if(0===n){do{t--,o=this.doc.getLine(t)}while(t>0&&/^\s*$/.test(o));n=o.length,/\s+$/.test(o)||(o="")}var r=i.stringReverse(o),s=this.$shortWordEndIndex(r);return this.moveCursorTo(t,n-s)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,i=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column);var o=this.session.screenToDocumentPosition(i.row+e,i.column,n);0!==e&&0===t&&o.row===this.lead.row&&o.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[o.row]&&(o.row>0||e>0)&&o.row++,this.moveCursorTo(o.row,o.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var i=this.session.getFoldAt(e,t,1);i&&(e=i.start.row,t=i.start.column),this.$keepDesiredColumnOnChange=!0;var o=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(o.charAt(t))&&o.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var i=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(i.row,i.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return r.fromPoints(t,n)}catch(e){return r.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e},this.fromJSON=function(e){if(e.start==undefined){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=r.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(s.prototype),t.Selection=s}),ace.define("ace/tokenizer",["require","exports","module","ace/config"],function(e,t){"use strict";var n=e("./config"),i=2e3,o=function(e){this.states=e,this.regExps={},this.matchMappings={};for(var t in this.states){for(var n=this.states[t],i=[],o=0,r=this.matchMappings[t]={defaultToken:"text"},s="g",a=[],l=0;l<n.length;l++){var c=n[l];if(c.defaultToken&&(r.defaultToken=c.defaultToken),c.caseInsensitive&&(s="gi"),null!=c.regex){c.regex instanceof RegExp&&(c.regex=c.regex.toString().slice(1,-1));var h=c.regex,u=new RegExp("(?:("+h+")|(.))").exec("a").length-2;Array.isArray(c.token)?1==c.token.length||1==u?c.token=c.token[0]:u-1!=c.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:c,groupCount:u-1}),c.token=c.token[0]):(c.tokenArray=c.token,c.token=null,c.onMatch=this.$arrayTokens):"function"==typeof c.token&&!c.onMatch&&(c.onMatch=u>1?this.$applyToken:c.token),u>1&&(/\\\d/.test(c.regex)?h=c.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+o+1)}):(u=1,h=this.removeCapturingGroups(c.regex)),!c.splitRegex&&"string"!=typeof c.token&&a.push(c)),r[o]=l,o+=u,i.push(h),c.onMatch||(c.onMatch=null)}}i.length||(r[0]=0,i.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,s)},this),this.regExps[t]=new RegExp("("+i.join(")|(")+")|($)",s)}};(function(){this.$setMaxTokenCount=function(e){i=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var i=[],o=0,r=n.length;o<r;o++)t[o]&&(i[i.length]={type:n[o],value:t[o]});return i},this.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";for(var n=[],i=this.tokenArray,o=0,r=i.length;o<r;o++)t[o+1]&&(n[n.length]={type:i[o],value:t[o+1]});return n},this.removeCapturingGroups=function(e){return e.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!]|(\()/g,function(e,t){return t?"(?:":e})},this.createSplitterRegexp=function(e,t){if(-1!=e.indexOf("(?=")){var n=0,i=!1,o={};e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,t,r,s,a,l){return i?i="]"!=a:a?i=!0:s?(n==o.stack&&(o.end=l+1,o.stack=-1),n--):r&&(n++,1!=r.length&&(o.stack=n,o.start=l)),e}),null!=o.end&&/^\)*$/.test(e.substr(o.end))&&(e=e.substring(0,o.start)+e.substr(o.end))}return"^"!=e.charAt(0)&&(e="^"+e),"$"!=e.charAt(e.length-1)&&(e+="$"),new RegExp(e,(t||"").replace("g",""))},this.getLineTokens=function(e,t){if(t&&"string"!=typeof t){var n=t.slice(0);"#tmp"===(t=n[0])&&(n.shift(),t=n.shift())}else var n=[];var o=t||"start",r=this.states[o];r||(o="start",r=this.states[o]);var s=this.matchMappings[o],a=this.regExps[o];a.lastIndex=0;for(var l,c=[],h=0,u=0,d={type:null,value:""};l=a.exec(e);){var g=s.defaultToken,p=null,f=l[0],m=a.lastIndex;if(m-f.length>h){var v=e.substring(h,m-f.length);d.type==g?d.value+=v:(d.type&&c.push(d),d={type:g,value:v})}for(var b=0;b<l.length-2;b++)if(l[b+1]!==undefined){p=r[s[b]],g=p.onMatch?p.onMatch(f,o,n,e):p.token,p.next&&(o="string"==typeof p.next?p.next:p.next(o,n),r=this.states[o],r||(this.reportError("state doesn't exist",o),o="start",r=this.states[o]),s=this.matchMappings[o],h=m,a=this.regExps[o],a.lastIndex=m),p.consumeLineEnd&&(h=m);break}if(f)if("string"==typeof g)p&&!1===p.merge||d.type!==g?(d.type&&c.push(d),d={type:g,value:f}):d.value+=f;else if(g){d.type&&c.push(d),d={type:null,value:""};for(var b=0;b<g.length;b++)c.push(g[b])}if(h==e.length)break;if(h=m,u++>i){for(u>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});h<e.length;)d.type&&c.push(d),d={value:e.substring(h,h+=500),type:"overflow"};o="start",n=[];break}}return d.type&&c.push(d),n.length>1&&n[0]!==o&&n.unshift("#tmp",o),{tokens:c,state:n.length?n:o}},this.reportError=n.reportError}).call(o.prototype),t.Tokenizer=o}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t){"use strict";var n=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var i=e[n],o=0;o<i.length;o++){var r=i[o];(r.next||r.onMatch)&&("string"==typeof r.next&&0!==r.next.indexOf(t)&&(r.next=t+r.next),r.nextState&&0!==r.nextState.indexOf(t)&&(r.nextState=t+r.nextState))}this.$rules[t+n]=i}else for(var n in e)this.$rules[n]=e[n]},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,i,o,r){var s="function"==typeof e?(new e).getRules():e;if(o)for(var a=0;a<o.length;a++)o[a]=t+o[a];else{o=[];for(var l in s)o.push(t+l)}if(this.addRules(s,t),i)for(var c=Array.prototype[r?"push":"unshift"],a=0;a<o.length;a++)c.apply(this.$rules[o[a]],n.deepCopy(i));this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds};var e=function(e,t){
4
4
  return("start"!=e||t.length)&&t.unshift(this.nextState,e),this.nextState},t=function(e,t){return t.shift(),t.shift()||"start"};this.normalizeRules=function(){function n(r){var s=o[r];s.processed=!0;for(var a=0;a<s.length;a++){var l=s[a],c=null;Array.isArray(l)&&(c=l,l={}),!l.regex&&l.start&&(l.regex=l.start,l.next||(l.next=[]),l.next.push({defaultToken:l.token},{token:l.token+".end",regex:l.end||l.start,next:"pop"}),l.token=l.token+".start",l.push=!0);var h=l.next||l.push;if(h&&Array.isArray(h)){var u=l.stateName;u||(u=l.token,"string"!=typeof u&&(u=u[0]||""),o[u]&&(u+=i++)),o[u]=h,l.next=u,n(u)}else"pop"==h&&(l.next=t);if(l.push&&(l.nextState=l.next||l.push,l.next=e,delete l.push),l.rules)for(var d in l.rules)o[d]?o[d].push&&o[d].push.apply(o[d],l.rules[d]):o[d]=l.rules[d];var g="string"==typeof l?l:l.include;if(g&&(c=Array.isArray(g)?g.map(function(e){return o[e]}):o[g]),c){var p=[a,1].concat(c);l.noEscape&&(p=p.filter(function(e){return!e.next})),s.splice.apply(s,p),a--}l.keywordMap&&(l.token=this.createKeywordMapper(l.keywordMap,l.defaultToken||"text",l.caseInsensitive),delete l.defaultToken)}}var i=0,o=this.$rules;Object.keys(o).forEach(n,this)},this.createKeywordMapper=function(e,t,n,i){var o=Object.create(null);return Object.keys(e).forEach(function(t){var r=e[t];n&&(r=r.toLowerCase());for(var s=r.split(i||"|"),a=s.length;a--;)o[s[a]]=t}),Object.getPrototypeOf(o)&&(o.__proto__=null),this.$keywordList=Object.keys(o),e=null,n?function(e){return o[e.toLowerCase()]||t}:function(e){return o[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(i.prototype),t.TextHighlightRules=i}),ace.define("ace/mode/behaviour",["require","exports","module"],function(e,t){"use strict";var n=function(){this.$behaviours={}};(function(){this.add=function(e,t,n){switch(undefined){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=n},this.addBehaviours=function(e){for(var t in e)for(var n in e[t])this.add(t,n,e[t][n])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){if("function"==typeof e)var n=(new e).getBehaviours(t);else var n=e.getBehaviours(t);this.addBehaviours(n)},this.getBehaviours=function(e){if(!e)return this.$behaviours;for(var t={},n=0;n<e.length;n++)this.$behaviours[e[n]]&&(t[e[n]]=this.$behaviours[e[n]]);return t}}).call(n.prototype),t.Behaviour=n}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(e,t){"use strict";var n=e("./range").Range,i=function(e,t,n){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t);var i=e.getTokenAt(t,n);this.$tokenIndex=i?i.index:-1};(function(){this.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},this.stepForward=function(){this.$tokenIndex+=1;for(var e;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(n!==undefined)return n;for(n=0;t>0;)t-=1,n+=e[t].value.length;return n},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new n(this.$row,t,this.$row,t+e.value.length)}}).call(i.prototype),t.TokenIterator=i}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t){"use strict";var n,i=e("../../lib/oop"),o=e("../behaviour").Behaviour,r=e("../../token_iterator").TokenIterator,s=e("../../lib/lang"),a=["text","paren.rparen","rparen","paren","punctuation.operator"],l=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],c={},h={'"':'"',"'":"'"},u=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,c.rangeCount!=e.multiSelect.rangeCount&&(c={rangeCount:e.multiSelect.rangeCount})),c[t])return n=c[t];n=c[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},d=function(e,t,n,i){var o=e.end.row-e.start.row;return{text:n+t+i,selection:[0,e.start.column+1,o,e.end.column+(o?0:1)]}},g=function(e){this.add("braces","insertion",function(t,i,o,r,a){var l=o.getCursorPosition(),c=r.doc.getLine(l.row);if("{"==a){u(o);var h=o.getSelectionRange(),p=r.doc.getTextRange(h);if(""!==p&&"{"!==p&&o.getWrapBehavioursEnabled())return d(h,p,"{","}");if(g.isSaneInsertion(o,r))return/[\]\}\)]/.test(c[l.column])||o.inMultiSelectMode||e&&e.braces?(g.recordAutoInsert(o,r,"}"),{text:"{}",selection:[1,1]}):(g.recordMaybeInsert(o,r,"{"),{text:"{",selection:[1,1]})}else if("}"==a){u(o);var f=c.substring(l.column,l.column+1);if("}"==f){var m=r.$findOpeningBracket("}",{column:l.column+1,row:l.row});if(null!==m&&g.isAutoInsertedClosing(l,c,a))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if("\n"==a||"\r\n"==a){u(o);var v="";g.isMaybeInsertedClosing(l,c)&&(v=s.stringRepeat("}",n.maybeInsertedBrackets),g.clearMaybeInsertedClosing());var f=c.substring(l.column,l.column+1);if("}"===f){var b=r.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!b)return null;var w=this.$getIndent(r.getLine(b.row))}else{if(!v)return void g.clearMaybeInsertedClosing();var w=this.$getIndent(c)}var y=w+r.getTabString();return{text:"\n"+y+"\n"+w+v,selection:[1,y.length,1,y.length]}}g.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,i,o,r){var s=o.doc.getTextRange(r);if(!r.isMultiLine()&&"{"==s){u(i);if("}"==o.doc.getLine(r.start.row).substring(r.end.column,r.end.column+1))return r.end.column++,r;n.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,i,o){if("("==o){u(n);var r=n.getSelectionRange(),s=i.doc.getTextRange(r);if(""!==s&&n.getWrapBehavioursEnabled())return d(r,s,"(",")");if(g.isSaneInsertion(n,i))return g.recordAutoInsert(n,i,")"),{text:"()",selection:[1,1]}}else if(")"==o){u(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row),c=l.substring(a.column,a.column+1);if(")"==c){var h=i.$findOpeningBracket(")",{column:a.column+1,row:a.row});if(null!==h&&g.isAutoInsertedClosing(a,l,o))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,i,o){var r=i.doc.getTextRange(o);if(!o.isMultiLine()&&"("==r){u(n);if(")"==i.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2))return o.end.column++,o}}),this.add("brackets","insertion",function(e,t,n,i,o){if("["==o){u(n);var r=n.getSelectionRange(),s=i.doc.getTextRange(r);if(""!==s&&n.getWrapBehavioursEnabled())return d(r,s,"[","]");if(g.isSaneInsertion(n,i))return g.recordAutoInsert(n,i,"]"),{text:"[]",selection:[1,1]}}else if("]"==o){u(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row),c=l.substring(a.column,a.column+1);if("]"==c){var h=i.$findOpeningBracket("]",{column:a.column+1,row:a.row});if(null!==h&&g.isAutoInsertedClosing(a,l,o))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,i,o){var r=i.doc.getTextRange(o);if(!o.isMultiLine()&&"["==r){u(n);if("]"==i.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2))return o.end.column++,o}}),this.add("string_dquotes","insertion",function(e,t,n,i,o){var r=i.$mode.$quotes||h;if(1==o.length&&r[o]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(o))return;u(n);var s=o,a=n.getSelectionRange(),l=i.doc.getTextRange(a);if(""!==l&&(1!=l.length||!r[l])&&n.getWrapBehavioursEnabled())return d(a,l,s,s);if(!l){var c=n.getCursorPosition(),g=i.doc.getLine(c.row),p=g.substring(c.column-1,c.column),f=g.substring(c.column,c.column+1),m=i.getTokenAt(c.row,c.column),v=i.getTokenAt(c.row,c.column+1);if("\\"==p&&m&&/escape/.test(m.type))return null;var b,w=m&&/string|escape/.test(m.type),y=!v||/string|escape/.test(v.type);if(f==s)(b=w!==y)&&/string\.end/.test(v.type)&&(b=!1);else{if(w&&!y)return null;if(w&&y)return null;var x=i.$mode.tokenRe;x.lastIndex=0;var k=x.test(p);x.lastIndex=0;var C=x.test(p);if(k||C)return null;if(f&&!/[\s;,.})\]\\]/.test(f))return null;var S=g[c.column-2];if(p==s&&(S==s||x.test(S)))return null;b=!0}return{text:b?s+s:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,i,o){var r=i.$mode.$quotes||h,s=i.doc.getTextRange(o);if(!o.isMultiLine()&&r.hasOwnProperty(s)){u(n);if(i.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)==s)return o.end.column++,o}})};g.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),i=new r(t,n.row,n.column);if(!this.$matchTokenType(i.getCurrentToken()||"text",a)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var o=new r(t,n.row,n.column+1);if(!this.$matchTokenType(o.getCurrentToken()||"text",a))return!1}return i.stepForward(),i.getCurrentTokenRow()!==n.row||this.$matchTokenType(i.getCurrentToken()||"text",l)},g.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},g.recordAutoInsert=function(e,t,i){var o=e.getCursorPosition(),r=t.doc.getLine(o.row);this.isAutoInsertedClosing(o,r,n.autoInsertedLineEnd[0])||(n.autoInsertedBrackets=0),n.autoInsertedRow=o.row,n.autoInsertedLineEnd=i+r.substr(o.column),n.autoInsertedBrackets++},g.recordMaybeInsert=function(e,t,i){var o=e.getCursorPosition(),r=t.doc.getLine(o.row);this.isMaybeInsertedClosing(o,r)||(n.maybeInsertedBrackets=0),n.maybeInsertedRow=o.row,n.maybeInsertedLineStart=r.substr(0,o.column)+i,n.maybeInsertedLineEnd=r.substr(o.column),n.maybeInsertedBrackets++},g.isAutoInsertedClosing=function(e,t,i){return n.autoInsertedBrackets>0&&e.row===n.autoInsertedRow&&i===n.autoInsertedLineEnd[0]&&t.substr(e.column)===n.autoInsertedLineEnd},g.isMaybeInsertedClosing=function(e,t){return n.maybeInsertedBrackets>0&&e.row===n.maybeInsertedRow&&t.substr(e.column)===n.maybeInsertedLineEnd&&t.substr(0,e.column)==n.maybeInsertedLineStart},g.popAutoInsertedClosing=function(){n.autoInsertedLineEnd=n.autoInsertedLineEnd.substr(1),n.autoInsertedBrackets--},g.clearMaybeInsertedClosing=function(){n&&(n.maybeInsertedBrackets=0,n.maybeInsertedRow=-1)},i.inherits(g,o),t.CstyleBehaviour=g}),ace.define("ace/unicode",["require","exports","module"],function(e,t){"use strict";for(var n=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],i=0,o=[],r=0;r<n.length;r+=2)o.push(i+=n[r]),n[r+1]&&o.push(45,i+=n[r+1]);t.wordChars=String.fromCharCode.apply(null,o)}),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(e,t){"use strict";var n=e("../config"),i=e("../tokenizer").Tokenizer,o=e("./text_highlight_rules").TextHighlightRules,r=e("./behaviour/cstyle").CstyleBehaviour,s=e("../unicode"),a=e("../lib/lang"),l=e("../token_iterator").TokenIterator,c=e("../range").Range,h=function(){this.HighlightRules=o};(function(){this.$defaultBehaviour=new r,this.tokenRe=new RegExp("^["+s.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+s.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new i(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,n,i){function o(e){for(var t=n;t<=i;t++)e(r.getLine(t),t)}var r=t.doc,s=!0,l=!0,c=Infinity,h=t.getTabSize(),u=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var d=this.lineCommentStart.map(a.escapeRegExp).join("|"),g=this.lineCommentStart[0];else var d=a.escapeRegExp(this.lineCommentStart),g=this.lineCommentStart;d=new RegExp("^(\\s*)(?:"+d+") ?"),u=t.getUseSoftTabs();var p=function(e,t){var n=e.match(d);if(n){var i=n[1].length,o=n[0].length;!b(e,i,o)&&" "==n[0][o-1]&&o--,r.removeInLine(t,i,o)}},f=g+" ",m=function(e,t){s&&!/\S/.test(e)||(b(e,c,c)?r.insertInLine({row:t,column:c},f):r.insertInLine({row:t,column:c},g))},v=function(e){return d.test(e)},b=function(e,t,n){for(var i=0;t--&&" "==e.charAt(t);)i++;if(i%h!=0)return!1;for(var i=0;" "==e.charAt(n++);)i++;return h>2?i%h!=h-1:i%h==0}}else{if(!this.blockComment)return!1;var g=this.blockComment.start,w=this.blockComment.end,d=new RegExp("^(\\s*)(?:"+a.escapeRegExp(g)+")"),y=new RegExp("(?:"+a.escapeRegExp(w)+")\\s*$"),m=function(e,t){v(e,t)||s&&!/\S/.test(e)||(r.insertInLine({row:t,column:e.length},w),r.insertInLine({row:t,column:c},g))},p=function(e,t){var n;(n=e.match(y))&&r.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(d))&&r.removeInLine(t,n[1].length,n[0].length)},v=function(e,n){if(d.test(e))return!0;for(var i=t.getTokens(n),o=0;o<i.length;o++)if("comment"===i[o].type)return!0}}var x=Infinity;o(function(e,t){var n=e.search(/\S/);-1!==n?(n<c&&(c=n),l&&!v(e,t)&&(l=!1)):x>e.length&&(x=e.length)}),c==Infinity&&(c=x,s=!1,l=!1),u&&c%h!=0&&(c=Math.floor(c/h)*h),o(l?p:m)},this.toggleBlockComment=function(e,t,n,i){var o=this.blockComment;if(o){!o.start&&o[0]&&(o=o[0]);var r,s,a=new l(t,i.row,i.column),h=a.getCurrentToken(),u=(t.selection,t.selection.toOrientedRange());if(h&&/comment/.test(h.type)){for(var d,g;h&&/comment/.test(h.type);){var p=h.value.indexOf(o.start);if(-1!=p){var f=a.getCurrentTokenRow(),m=a.getCurrentTokenColumn()+p;d=new c(f,m,f,m+o.start.length);break}h=a.stepBackward()}for(var a=new l(t,i.row,i.column),h=a.getCurrentToken();h&&/comment/.test(h.type);){var p=h.value.indexOf(o.end);if(-1!=p){var f=a.getCurrentTokenRow(),m=a.getCurrentTokenColumn()+p;g=new c(f,m,f,m+o.end.length);break}h=a.stepForward()}g&&t.remove(g),d&&(t.remove(d),r=d.start.row,s=-o.start.length)}else s=o.start.length,r=n.start.row,t.insert(n.end,o.end),t.insert(n.start,o.start);u.start.row==r&&(u.start.column+=s),u.end.row==r&&(u.end.column+=s),t.selection.fromOrientedRange(u)}},this.getNextLineIndent=function(e,t){return this.$getIndent(t)},this.checkOutdent=function(){return!1},this.autoOutdent=function(){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var t in e)if(e[t]){var i=e[t],o=i.prototype.$id,r=n.$modes[o];r||(n.$modes[o]=r=new i),n.$modes[t]||(n.$modes[t]=r),this.$embeds.push(t),this.$modes[t]=r}for(var s=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],t=0;t<s.length;t++)!function(e){var n=s[t],i=e[n];e[s[t]]=function(){return this.$delegator(n,arguments,i)}}(this)},this.$delegator=function(e,t,n){var i=t[0]||"start";if("string"!=typeof i){if(Array.isArray(i[2])){var o=i[2][i[2].length-1],r=this.$modes[o];if(r)return r[e].apply(r,[i[1]].concat([].slice.call(t,1)))}i=i[0]||"start"}for(var s=0;s<this.$embeds.length;s++)if(this.$modes[this.$embeds[s]]){var a=i.split(this.$embeds[s]);if(!a[0]&&a[1]){t[0]=a[1];var r=this.$modes[this.$embeds[s]];return r[e].apply(r,t)}}var l=n.apply(this,t);return n?l:undefined},this.transformAction=function(e,t){if(this.$behaviour){var n=this.$behaviour.getBehaviours();for(var i in n)if(n[i][t]){var o=n[i][t].apply(this,arguments);if(o)return o}}},this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules,n=[];for(var i in t)for(var o=t[i],r=0,s=o.length;r<s;r++)if("string"==typeof o[r].token)/keyword|support|storage/.test(o[r].token)&&n.push(o[r].regex);else if("object"==typeof o[r].token)for(var a=0,l=o[r].token.length;a<l;a++)if(/keyword|support|storage/.test(o[r].token[a])){var i=o[r].regex.match(/\(.+?\)/g)[a];n.push(i.substr(1,i.length-2))}this.completionKeywords=n}return e?n.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(){return(this.$keywordList||this.$createKeywordList()).map(function(e){return{name:e,value:e,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(h.prototype),t.Mode=h}),ace.define("ace/apply_delta",["require","exports","module"],function(e,t){"use strict";function n(e,t){throw console.log("Invalid Delta:",e),"Invalid Delta: "+t}function i(e,t){return t.row>=0&&t.row<e.length&&t.column>=0&&t.column<=e[t.row].length}t.applyDelta=function(e,t){var n=t.start.row,i=t.start.column,o=e[n]||"";switch(t.action){case"insert":if(1===t.lines.length)e[n]=o.substring(0,i)+t.lines[0]+o.substring(i);else{var r=[n,1].concat(t.lines);e.splice.apply(e,r),e[n]=o.substring(0,i)+e[n],e[n+t.lines.length-1]+=o.substring(i)}break;case"remove":var s=t.end.column,a=t.end.row;n===a?e[n]=o.substring(0,i)+o.substring(s):e.splice(n,a-n+1,o.substring(0,i)+e[a].substring(s))}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t){"use strict";var n=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,o=t.Anchor=function(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),void 0===n?this.setPosition(t.row,t.column):this.setPosition(t,n)};(function(){function e(e,t,n){var i=n?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&i}function t(t,n,i){var o="insert"==t.action,r=(o?1:-1)*(t.end.row-t.start.row),s=(o?1:-1)*(t.end.column-t.start.column),a=t.start,l=o?a:t.end;return e(n,a,i)?{row:n.row,column:n.column}:e(l,n,!i)?{row:n.row+r,column:n.column+(n.row==l.row?s:0)}:{row:a.row,column:a.column}}n.implement(this,i),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(e){if(!(e.start.row==e.end.row&&e.start.row!=this.row||e.start.row>this.row)){var n=t(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(n.row,n.column,!0)}},this.setPosition=function(e,t,n){var i;if(i=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=i.row||this.column!=i.column){var o={row:this.row,column:this.column};this.row=i.row,this.column=i.column,this._signal("change",{old:o,value:i})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(o.prototype)}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(e,t){"use strict";var n=e("./lib/oop"),i=e("./apply_delta").applyDelta,o=e("./lib/event_emitter").EventEmitter,r=e("./range").Range,s=e("./anchor").Anchor,a=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){n.implement(this,o),this.setValue=function(e){var t=this.getLength()-1;this.remove(new r(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new s(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{t=this.getLines(e.start.row,e.end.row),t[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),i=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:i,action:"insert",lines:[t]},!0),this.clonePos(i)},this.clippedPos=function(e,t){var n=this.getLength();e===undefined?e=n:e<0?e=0:e>=n&&(e=n-1,t=undefined);var i=this.getLine(e);return t==undefined&&(t=i.length),t=Math.min(Math.max(t,0),i.length),{row:e,column:t}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var n=0;e<this.getLength()?(t=t.concat([""]),n=0):(t=[""].concat(t),e--,n=this.$lines[e].length),this.insertMergedLines({row:e,column:n},t)},this.insertMergedLines=function(e,t){var n=this.clippedPos(e.row,e.column),i={row:n.row+t.length-1,column:(1==t.length?n.column:0)+t[t.length-1].length};return this.applyDelta({start:n,end:i,action:"insert",lines:t}),this.clonePos(i)},this.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column),n=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:t,end:n,action:"remove",lines:this.getLinesForRange({start:t,end:n})}),this.clonePos(t)},this.removeInLine=function(e,t,n){var i=this.clippedPos(e,t),o=this.clippedPos(e,n);return this.applyDelta({start:i,end:o,action:"remove",lines:this.getLinesForRange({start:i,end:o})},!0),this.clonePos(i)},this.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1),t=Math.min(Math.max(0,t),this.getLength()-1);var n=t==this.getLength()-1&&e>0,i=t<this.getLength()-1,o=n?e-1:e,s=n?this.getLine(o).length:0,a=i?t+1:t,l=i?0:this.getLine(a).length,c=new r(o,s,a,l),h=this.$lines.slice(e,t+1);return this.applyDelta({start:c.start,end:c.end,action:"remove",lines:this.getLinesForRange(c)}),h},this.removeNewLine=function(e){e<this.getLength()-1&&e>=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){if(e instanceof r||(e=r.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);return t?this.insert(e.start,t):e.start},this.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},this.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!r.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(i(this.$lines,e,t),this._signal("change",e)))},this.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,i=n.length-t+1,o=e.start.row,r=e.start.column,s=0,a=0;s<i;s=a){a+=t-1;var l=n.slice(s,a);l.push(""),this.applyDelta({start:this.pos(o+s,r),end:this.pos(o+a,r=0),action:e.action,lines:l},!0)}e.lines=n.slice(s),e.start.row=o+s,e.start.column=r,this.applyDelta(e,!0)},this.revertDelta=function(e){this.applyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:"insert"==e.action?"remove":"insert",lines:e.lines.slice()})},this.indexToPosition=function(e,t){for(var n=this.$lines||this.getAllLines(),i=this.getNewLineCharacter().length,o=t||0,r=n.length;o<r;o++)if((e-=n[o].length+i)<0)return{row:o,column:e+n[o].length+i};return{row:r-1,column:e+n[r-1].length+i}},this.positionToIndex=function(e,t){for(var n=this.$lines||this.getAllLines(),i=this.getNewLineCharacter().length,o=0,r=Math.min(e.row,n.length),s=t||0;s<r;++s)o+=n[s].length+i;return o+e.column}}).call(a.prototype),t.Document=a}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t){"use strict";var n=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,o=function(e){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=e;var t=this;this.$worker=function(){if(t.running){for(var e=new Date,n=t.currentLine,i=-1,o=t.doc,r=n;t.lines[n];)n++;var s=o.getLength(),a=0;for(t.running=!1;n<s;){t.$tokenizeRow(n),i=n;do{n++}while(t.lines[n]);if(++a%5==0&&new Date-e>20){t.running=setTimeout(t.$worker,20);break}}t.currentLine=n,-1==i&&(i=n),r<=i&&t.fireUpdateEvent(r,i)}}};(function(){n.implement(this,i),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var i=Array(n+1);i.unshift(t,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],i=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=i.state+""?(this.states[e]=i.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=i.tokens}}).call(o.prototype),t.BackgroundTokenizer=o}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(e,t){"use strict";var n=e("./lib/lang"),i=(e("./lib/oop"),e("./range").Range),o=function(e,t,n){this.setRegexp(e),this.clazz=t,this.type=n||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,o,r){if(this.regExp)for(var s=r.firstRow,a=r.lastRow,l=s;l<=a;l++){var c=this.cache[l];null==c&&(c=n.getMatchOffsets(o.getLine(l),this.regExp),c.length>this.MAX_RANGES&&(c=c.slice(0,this.MAX_RANGES)),c=c.map(function(e){return new i(l,e.offset,l,e.offset+e.length)}),this.cache[l]=c.length?c:"");for(var h=c.length;h--;)t.drawSingleLineMarker(e,c[h].toScreenRange(o),this.clazz,r)}}}).call(o.prototype),t.SearchHighlight=o}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(e,t){"use strict";function n(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new i(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}var i=e("../range").Range;(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.row<this.startRow||e.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,n){var i,o,r,s=0,a=this.folds,l=!0;null==t&&(t=this.end.row,n=this.end.column);for(var c=0;c<a.length;c++){if(i=a[c],-1==(o=i.range.compareStart(t,n)))return void e(null,t,n,s,l);if(r=e(null,i.start.row,i.start.column,s,l),(r=!r&&e(i.placeholder,i.start.row,i.start.column,s))||0===o)return;l=!i.sameRow,s=i.end.column}e(null,t,n,s,l)},this.getNextFoldTo=function(e,t){for(var n,i,o=0;o<this.folds.length;o++){if(n=this.folds[o],-1==(i=n.range.compareEnd(e,t)))return{fold:n,kind:"after"};if(0===i)return{fold:n,kind:"inside"}}return null},this.addRemoveChars=function(e,t,n){
5
5
  var i,o,r=this.getNextFoldTo(e,t);if(r)if(i=r.fold,"inside"==r.kind&&i.start.column!=t&&i.start.row!=e)window.console&&window.console.log(e,t,i);else if(i.start.row==e){o=this.folds;var s=o.indexOf(i);for(0===s&&(this.start.column+=n),s;s<o.length;s++){if(i=o[s],i.start.column+=n,!i.sameRow)return;i.end.column+=n}this.end.column+=n}},this.split=function(e,t){var i=this.getNextFoldTo(e,t);if(!i||"inside"==i.kind)return null;var o=i.fold,r=this.folds,s=this.foldData,a=r.indexOf(o),l=r[a-1];this.end.row=l.end.row,this.end.column=l.end.column,r=r.splice(a,r.length-a);var c=new n(s,r);return s.splice(s.indexOf(this)+1,0,c),c},this.merge=function(e){for(var t=e.folds,n=0;n<t.length;n++)this.addFold(t[n]);var i=this.foldData;i.splice(i.indexOf(e),1)},this.toString=function(){var e=[this.range.toString()+": ["];return this.folds.forEach(function(t){e.push(" "+t.toString())}),e.push("]"),e.join("\n")},this.idxToPosition=function(e){for(var t=0,n=0;n<this.folds.length;n++){var i=this.folds[n];if((e-=i.start.column-t)<0)return{row:i.start.row,column:i.start.column+e};if((e-=i.placeholder.length)<0)return i.start;t=i.end.column}return{row:this.end.row,column:this.end.column+e}}}).call(n.prototype),t.FoldLine=n}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(e,t){"use strict";var n=e("./range").Range,i=n.comparePoints,o=function(){this.ranges=[],this.$bias=1};(function(){this.comparePoints=i,this.pointIndex=function(e,t,n){for(var o=this.ranges,r=n||0;r<o.length;r++){var s=o[r],a=i(e,s.end);if(!(a>0)){var l=i(e,s.start);return 0===a?t&&0!==l?-r-2:r:l>0||0===l&&!t?r:-r-1}}return-r-1},this.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var i=this.pointIndex(e.end,t,n);return i<0?i=-i-1:i++,this.ranges.splice(n,i-n,e)},this.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){var e=[],t=this.ranges;t=t.sort(function(e,t){return i(e.start,t.start)});for(var n,o=t[0],r=1;r<t.length;r++){n=o,o=t[r];var s=i(n.end,o.start);s<0||(0!=s||n.isEmpty()||o.isEmpty())&&(i(n.end,o.end)<0&&(n.end.row=o.end.row,n.end.column=o.end.column),t.splice(r,1),e.push(o),o=n,r--)}return this.ranges=t,e},this.contains=function(e,t){return this.pointIndex({row:e,column:t})>=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row<e)return[];var i=this.pointIndex({row:e,column:0});i<0&&(i=-i-1);var o=this.pointIndex({row:t,column:0},i);o<0&&(o=-o-1);for(var r=[],s=i;s<o;s++)r.push(n[s]);return r},this.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},this.attach=function(e){this.session&&this.detach(),this.session=e,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},this.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},this.$onChange=function(e){for(var t=e.start,n=e.end,i=t.row,o=n.row,r=this.ranges,s=0,a=r.length;s<a;s++){var l=r[s];if(l.end.row>=i)break}if("insert"==e.action)for(var c=o-i,h=-t.column+n.column;s<a;s++){var l=r[s];if(l.start.row>i)break;if(l.start.row==i&&l.start.column>=t.column&&(l.start.column==t.column&&this.$bias<=0||(l.start.column+=h,l.start.row+=c)),l.end.row==i&&l.end.column>=t.column){if(l.end.column==t.column&&this.$bias<0)continue;l.end.column==t.column&&h>0&&s<a-1&&l.end.column>l.start.column&&l.end.column==r[s+1].start.column&&(l.end.column-=h),l.end.column+=h,l.end.row+=c}}else for(var c=i-o,h=t.column-n.column;s<a;s++){var l=r[s];if(l.start.row>o)break;l.end.row<o&&(i<l.end.row||i==l.end.row&&t.column<l.end.column)?(l.end.row=i,l.end.column=t.column):l.end.row==o?l.end.column<=n.column?(c||l.end.column>t.column)&&(l.end.column=t.column,l.end.row=t.row):(l.end.column+=h,l.end.row+=c):l.end.row>o&&(l.end.row+=c),l.start.row<o&&(i<l.start.row||i==l.start.row&&t.column<l.start.column)?(l.start.row=i,l.start.column=t.column):l.start.row==o?l.start.column<=n.column?(c||l.start.column>t.column)&&(l.start.column=t.column,l.start.row=t.row):(l.start.column+=h,l.start.row+=c):l.start.row>o&&(l.start.row+=c)}if(0!=c&&s<a)for(;s<a;s++){var l=r[s];l.start.row+=c,l.end.row+=c}}}).call(o.prototype),t.RangeList=o}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list","ace/lib/oop"],function(e,t){"use strict";function n(e,t){e.row-=t.row,0==e.row&&(e.column-=t.column)}function i(e,t){n(e.start,t),n(e.end,t)}function o(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row}function r(e,t){o(e.start,t),o(e.end,t)}var s=e("../range_list").RangeList,a=e("../lib/oop"),l=t.Fold=function(e,t){this.foldLine=null,this.placeholder=t,this.range=e,this.start=e.start,this.end=e.end,this.sameRow=e.start.row==e.end.row,this.subFolds=this.ranges=[]};a.inherits(l,s),function(){this.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},this.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach(function(t){t.setFoldLine(e)})},this.clone=function(){var e=this.range.clone(),t=new l(e,this.placeholder);return this.subFolds.forEach(function(e){t.subFolds.push(e.clone())}),t.collapseChildren=this.collapseChildren,t},this.addSubFold=function(e){if(!this.range.isEqual(e)){i(e,this.start);for(var t=e.start.row,n=e.start.column,o=0,r=-1;o<this.subFolds.length&&1==(r=this.subFolds[o].range.compare(t,n));o++);var s=this.subFolds[o],a=0;if(0==r){if(s.range.containsRange(e))return s.addSubFold(e);a=1}for(var t=e.range.end.row,n=e.range.end.column,l=o,r=-1;l<this.subFolds.length&&1==(r=this.subFolds[l].range.compare(t,n));l++);0==r&&l++;for(var c=this.subFolds.splice(o,l-o,e),h=0==r?c.length-1:c.length,u=a;u<h;u++)e.addSubFold(c[u]);return e.setFoldLine(this.foldLine),e}},this.restoreRange=function(e){return r(e,this.start)}}.call(l.prototype)}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator"],function(e,t){"use strict";function n(){this.getFoldAt=function(e,t,n){var i=this.getFoldLine(e);if(!i)return null;for(var o=i.folds,r=0;r<o.length;r++){var s=o[r].range;if(s.contains(e,t)){if(1==n&&s.isEnd(e,t)&&!s.isEmpty())continue;if(-1==n&&s.isStart(e,t)&&!s.isEmpty())continue;return o[r]}}},this.getFoldsInRange=function(e){var t=e.start,n=e.end,i=this.$foldData,o=[];t.column+=1,n.column-=1;for(var r=0;r<i.length;r++){var s=i[r].range.compareRange(e);if(2!=s){if(-2==s)break;for(var a=i[r].folds,l=0;l<a.length;l++){var c=a[l];if(-2==(s=c.range.compareRange(e)))break;if(2!=s){if(42==s)break;o.push(c)}}}}return t.column-=1,n.column+=1,o},this.getFoldsInRangeList=function(e){if(Array.isArray(e)){var t=[];e.forEach(function(e){t=t.concat(this.getFoldsInRange(e))},this)}else var t=this.getFoldsInRange(e);return t},this.getAllFolds=function(){for(var e=[],t=this.$foldData,n=0;n<t.length;n++)for(var i=0;i<t[n].folds.length;i++)e.push(t[n].folds[i]);return e},this.getFoldStringAt=function(e,t,n,i){if(!(i=i||this.getFoldLine(e)))return null;for(var o,r,s={end:{column:0}},a=0;a<i.folds.length;a++){r=i.folds[a];var l=r.range.compareEnd(e,t);if(-1==l){o=this.getLine(r.start.row).substring(s.end.column,r.start.column);break}if(0===l)return null;s=r}return o||(o=this.getLine(r.start.row).substring(s.end.column)),-1==n?o.substring(0,t-s.end.column):1==n?o.substring(t-s.end.column):o},this.getFoldLine=function(e,t){var n=this.$foldData,i=0;for(t&&(i=n.indexOf(t)),-1==i&&(i=0),i;i<n.length;i++){var o=n[i];if(o.start.row<=e&&o.end.row>=e)return o;if(o.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,i=0;for(t&&(i=n.indexOf(t)),-1==i&&(i=0),i;i<n.length;i++){var o=n[i];if(o.end.row>=e)return o}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,i=t-e+1,o=0;o<n.length;o++){var r=n[o],s=r.end.row,a=r.start.row;if(s>=t){a<t&&(a>=e?i-=t-a:i=0);break}s>=e&&(i-=a>=e?s-a:s-e+1)}return i},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var n,i=this.$foldData,s=!1;e instanceof r?n=e:(n=new r(t,e),n.collapseChildren=t.collapseChildren),this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,c=n.end.row,h=n.end.column,u=this.getFoldAt(a,l,1),d=this.getFoldAt(c,h,-1);if(u&&d==u)return u.addSubFold(n);u&&!u.range.isStart(a,l)&&this.removeFold(u),d&&!d.range.isEnd(c,h)&&this.removeFold(d);var g=this.getFoldsInRange(n.range);g.length>0&&(this.removeFolds(g),g.forEach(function(e){n.addSubFold(e)}));for(var p=0;p<i.length;p++){var f=i[p];if(c==f.start.row){f.addFold(n),s=!0;break}if(a==f.end.row){if(f.addFold(n),s=!0,!n.sameRow){var m=i[p+1];if(m&&m.start.row==c){f.merge(m);break}}break}if(c<=f.start.row)break}return s||(f=this.$addFoldLine(new o(this.$foldData,n))),this.$useWrapMode?this.$updateWrapData(f.start.row,f.start.row):this.$updateRowLengthCache(f.start.row,f.start.row),this.$modified=!0,this._signal("changeFold",{data:n,action:"add"}),n},this.addFolds=function(e){e.forEach(function(e){this.addFold(e)},this)},this.removeFold=function(e){var t=e.foldLine,n=t.start.row,i=t.end.row,o=this.$foldData,r=t.folds;if(1==r.length)o.splice(o.indexOf(t),1);else if(t.range.isEnd(e.end.row,e.end.column))r.pop(),t.end.row=r[r.length-1].end.row,t.end.column=r[r.length-1].end.column;else if(t.range.isStart(e.start.row,e.start.column))r.shift(),t.start.row=r[0].start.row,t.start.column=r[0].start.column;else if(e.sameRow)r.splice(r.indexOf(e),1);else{var s=t.split(e.start.row,e.start.column);r=s.folds,r.shift(),s.start.row=r[0].start.row,s.start.column=r[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(n,i):this.$updateRowLengthCache(n,i)),this.$modified=!0,this._signal("changeFold",{data:e,action:"remove"})},this.removeFolds=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);t.forEach(function(e){this.removeFold(e)},this),this.$modified=!0},this.expandFold=function(e){this.removeFold(e),e.subFolds.forEach(function(t){e.restoreRange(t),this.addFold(t)},this),e.collapseChildren>0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var n,o;if(null==e?(n=new i(0,0,this.getLength(),0),t=!0):n="number"==typeof e?new i(e,0,e,this.getLine(e).length):"row"in e?i.fromPoints(e,e):e,o=this.getFoldsInRangeList(n),t)this.removeFolds(o);else for(var r=o;r.length;)this.expandFolds(r),r=this.getFoldsInRangeList(n);if(o.length)return o},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,i,o){null==i&&(i=e.start.row),null==o&&(o=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var r=this.doc,s="";return e.walk(function(e,t,n,a){if(!(t<i)){if(t==i){if(n<o)return;a=Math.max(o,a)}s+=null!=e?e:r.getLine(t).substring(a,n)}},t,n),s},this.getDisplayLine=function(e,t,n,i){var o=this.getFoldLine(e);if(!o){var r;return r=this.doc.getLine(e),r.substring(i||0,t||r.length)}return this.getFoldDisplayLine(o,e,t,n,i)},this.$cloneFoldData=function(){var e=[];return e=this.$foldData.map(function(t){var n=t.folds.map(function(e){return e.clone()});return new o(e,n)})},this.toggleFold=function(e){var t,n,i=this.selection,o=i.getRange();if(o.isEmpty()){var r=o.start;if(t=this.getFoldAt(r.row,r.column))return void this.expandFold(t);(n=this.findMatchingBracket(r))?1==o.comparePoint(n)?o.end=n:(o.start=n,o.start.column++,o.end.column--):(n=this.findMatchingBracket({row:r.row,column:r.column+1}))?(1==o.comparePoint(n)?o.end=n:o.start=n,o.start.column++):o=this.getCommentFoldRange(r.row,r.column)||o}else{var s=this.getFoldsInRange(o);if(e&&s.length)return void this.expandFolds(s);1==s.length&&(t=s[0])}if(t||(t=this.getFoldAt(o.start.row,o.start.column)),t&&t.range.toString()==o.toString())return void this.expandFold(t);var a="...";if(!o.isMultiLine()){if(a=this.getTextRange(o),a.length<4)return;a=a.trim().substring(0,2)+".."}this.addFold(a,o)},this.getCommentFoldRange=function(e,t,n){var o=new s(this,e,t),r=o.getCurrentToken(),a=r.type;if(r&&/^comment|string/.test(a)){"comment"==(a=a.match(/comment|string/)[0])&&(a+="|doc-start");var l=new RegExp(a),c=new i;if(1!=n){do{r=o.stepBackward()}while(r&&l.test(r.type));o.stepForward()}if(c.start.row=o.getCurrentTokenRow(),c.start.column=o.getCurrentTokenColumn()+2,o=new s(this,e,t),-1!=n){var h=-1;do{if(r=o.stepForward(),-1==h){var u=this.getState(o.$row);l.test(u)||(h=o.$row)}else if(o.$row>h)break}while(r&&l.test(r.type));r=o.stepBackward()}else r=o.getCurrentToken();return c.end.row=o.getCurrentTokenRow(),c.end.column=o.getCurrentTokenColumn()+r.value.length-2,c}},this.foldAll=function(e,t,n){n==undefined&&(n=1e5);var i=this.foldWidgets;if(i){t=t||this.getLength(),e=e||0;for(var o=e;o<t;o++)if(null==i[o]&&(i[o]=this.getFoldWidget(o)),"start"==i[o]){var r=this.getFoldWidgetRange(o);if(r&&r.isMultiLine()&&r.end.row<=t&&r.start.row>=e){o=r.end.row;try{var s=this.addFold("...",r);s&&(s.collapseChildren=n)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){if(this.$foldMode!=e){if(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!e||"manual"==this.$foldStyle)return void(this.foldWidgets=null);this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)}},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var i,o=e-1;o>=0;){var r=n[o];if(null==r&&(r=n[o]=this.getFoldWidget(o)),"start"==r){var s=this.getFoldWidgetRange(o);if(i||(i=s),s&&s.end.row>=e)break}o--}return{range:-1!==o&&s,firstRange:i}},this.onFoldWidgetClick=function(e,t){t=t.domEvent;var n={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var i=t.target||t.srcElement;i&&/ace_fold-widget/.test(i.className)&&(i.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),i=this.getLine(e),o="end"===n?-1:1,r=this.getFoldAt(e,-1===o?0:i.length,o);if(r)return t.children||t.all?this.removeFold(r):this.expandFold(r),r;var s=this.getFoldWidgetRange(e,!0);if(s&&!s.isMultiLine()&&(r=this.getFoldAt(s.start.row,s.start.column,1))&&s.isEqual(r.range))return this.removeFold(r),r;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,c=a.range.end.row;this.foldAll(l,c,t.all?1e4:0)}else t.children?(c=s?s.end.row:this.getLength(),this.foldAll(e+1,c,t.all?1e4:0)):s&&(t.all&&(s.collapseChildren=1e4),this.addFold("...",s));return s}},this.toggleFoldWidget=function(){var e=this.selection.getCursor().row;e=this.getRowFoldStart(e);var t=this.$toggleFoldWidget(e,{});if(!t){var n=this.getParentFoldRangeData(e,!0);if(t=n.range||n.firstRange){e=t.start.row;var i=this.getFoldAt(e,this.getLine(e).length,1);i?this.removeFold(i):this.addFold("...",t)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var i=Array(n+1);i.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,i)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}var i=e("../range").Range,o=e("./fold_line").FoldLine,r=e("./fold").Fold,s=e("../token_iterator").TokenIterator;t.Folding=n}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(e,t){"use strict";function n(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var i=n.match(/([\(\[\{])|([\)\]\}])/);return i?i[1]?this.$findClosingBracket(i[1],e):this.$findOpeningBracket(i[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),i=!0,r=n.charAt(e.column-1),s=r&&r.match(/([\(\[\{])|([\)\]\}])/);if(s||(r=n.charAt(e.column),e={row:e.row,column:e.column+1},s=r&&r.match(/([\(\[\{])|([\)\]\}])/),i=!1),!s)return null;if(s[1]){var a=this.$findClosingBracket(s[1],e);if(!a)return null;t=o.fromPoints(e,a),i||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a=this.$findOpeningBracket(s[2],e);if(!a)return null;t=o.fromPoints(a,e),i||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var o=this.$brackets[e],r=1,s=new i(this,t.row,t.column),a=s.getCurrentToken();if(a||(a=s.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-s.getCurrentTokenColumn()-2,c=a.value;;){for(;l>=0;){var h=c.charAt(l);if(h==o){if(0==(r-=1))return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else h==e&&(r+=1);l-=1}do{a=s.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;c=a.value,l=c.length-1}return null}},this.$findClosingBracket=function(e,t,n){var o=this.$brackets[e],r=1,s=new i(this,t.row,t.column),a=s.getCurrentToken();if(a||(a=s.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-s.getCurrentTokenColumn();;){for(var c=a.value,h=c.length;l<h;){var u=c.charAt(l);if(u==o){if(0==(r-=1))return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else u==e&&(r+=1);l+=1}do{a=s.stepForward()}while(a&&!n.test(a.type));if(null==a)break;l=0}return null}}}var i=e("../token_iterator").TokenIterator,o=e("../range").Range;t.BracketMatch=n}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"],function(e,t){"use strict";var n=e("./lib/oop"),i=e("./lib/lang"),o=e("./bidihandler").BidiHandler,r=e("./config"),s=e("./lib/event_emitter").EventEmitter,a=e("./selection").Selection,l=e("./mode/text").Mode,c=e("./range").Range,h=e("./document").Document,u=e("./background_tokenizer").BackgroundTokenizer,d=e("./search_highlight").SearchHighlight,g=function(e,t){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++g.$uid,this.$foldData.toString=function(){return this.join("\n")},this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),"object"==typeof e&&e.getLine||(e=new h(e)),this.setDocument(e),this.selection=new a(this),this.$bidiHandler=new o(this),r.resetOptions(this),this.setMode(t),r._signal("session",this)};g.$uid=0,function(){function e(e){return!(e<4352)&&(e>=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}n.implement(this,s),this.setDocument=function(e){this.doc&&this.doc.removeListener("change",this.$onChange),this.doc=e,e.on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(e){if(!e)return this.$docRowCache=[],void(this.$screenRowCache=[]);var t=this.$docRowCache.length,n=this.$getRowCacheIndex(this.$docRowCache,e)+1;t>n&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},this.$getRowCacheIndex=function(e,t){for(var n=0,i=e.length-1;n<=i;){var o=n+i>>1,r=e[o];if(t>r)n=o+1;else{if(!(t<r))return o;i=o-1}}return n-1},this.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.bgTokenizer&&this.bgTokenizer.start(0)},this.onChangeFold=function(e){var t=e.data;this.$resetRowCache(t.start.row)},this.onChange=function(e){this.$modified=!0,this.$bidiHandler.onChange(e),this.$resetRowCache(e.start.row);var t=this.$updateInternalDataOnChange(e);!this.$fromUndo&&this.$undoManager&&(t&&t.length&&(this.$undoManager.add({action:"removeFolds",folds:t},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(e,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer&&this.bgTokenizer.$updateOnChange(e),this._signal("change",e)},this.setValue=function(e){this.doc.setValue(e),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},this.getValue=this.toString=function(){return this.doc.getValue()},this.getSelection=function(){return this.selection},this.getState=function(e){return this.bgTokenizer.getState(e)},this.getTokens=function(e){return this.bgTokenizer.getTokens(e)},this.getTokenAt=function(e,t){var n,i=this.bgTokenizer.getTokens(e),o=0;if(null==t){var r=i.length-1;o=this.getLine(e).length}else for(var r=0;r<i.length&&!((o+=i[r].value.length)>=t);r++);return n=i[r],n?(n.index=r,n.start=o-n.value.length,n):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=i.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?i.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t<e.length;t++)this.$breakpoints[e[t]]="ace_breakpoint";this._signal("changeBreakpoint",{})},this.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},this.setBreakpoint=function(e,t){t===undefined&&(t="ace_breakpoint"),t?this.$breakpoints[e]=t:delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.clearBreakpoint=function(e){delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},this.addMarker=function(e,t,n,i){var o=this.$markerId++,r={range:e,type:n||"line",renderer:"function"==typeof n?n:null,clazz:t,inFront:!!i,id:o};return i?(this.$frontMarkers[o]=r,this._signal("changeFrontMarker")):(this.$backMarkers[o]=r,this._signal("changeBackMarker")),o},this.addDynamicMarker=function(e,t){if(e.update){var n=this.$markerId++;return e.id=n,e.inFront=!!t,t?(this.$frontMarkers[n]=e,this._signal("changeFrontMarker")):(this.$backMarkers[n]=e,this._signal("changeBackMarker")),e}},this.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];if(t){delete(t.inFront?this.$frontMarkers:this.$backMarkers)[e],this._signal(t.inFront?"changeFrontMarker":"changeBackMarker")}},this.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers},this.highlight=function(e){if(!this.$searchHighlight){var t=new d(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(t)}this.$searchHighlight.setRegexp(e)},this.highlightLines=function(e,t,n,i){"number"!=typeof t&&(n=t,t=e),n||(n="ace_step");var o=new c(e,0,t,Infinity);return o.id=this.addMarker(o,n,"fullLine",i),o},this.setAnnotations=function(e){this.$annotations=e,this._signal("changeAnnotation",{})},this.getAnnotations=function(){return this.$annotations||[]},this.clearAnnotations=function(){this.setAnnotations([])},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r?\n)/m);this.$autoNewLine=t?t[1]:"\n"},this.getWordRange=function(e,t){var n=this.getLine(e),i=!1;if(t>0&&(i=!!n.charAt(t-1).match(this.tokenRe)),i||(i=!!n.charAt(t).match(this.tokenRe)),i)var o=this.tokenRe;else if(/^\s+$/.test(n.slice(t-1,t+1)))var o=/\s/;else var o=this.nonTokenRe;var r=t;if(r>0){do{r--}while(r>=0&&n.charAt(r).match(o));r++}for(var s=t;s<n.length&&n.charAt(s).match(o);)s++;return new c(e,r,e,s)},this.getAWordRange=function(e,t){for(var n=this.getWordRange(e,t),i=this.getLine(n.end.row);i.charAt(n.end.column).match(/[ \t]/);)n.end.column+=1;return n},this.setNewLineMode=function(e){this.doc.setNewLineMode(e)},this.getNewLineMode=function(){return this.doc.getNewLineMode()},this.setUseWorker=function(e){this.setOption("useWorker",e)},this.getUseWorker=function(){return this.$useWorker},this.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first),this._signal("tokenizerUpdate",e)},this.$modes=r.$modes,this.$mode=null,this.$modeId=null,this.setMode=function(e,t){if(e&&"object"==typeof e){if(e.getTokenizer)return this.$onChangeMode(e);var n=e,i=n.path}else i=e||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new l),this.$modes[i]&&!n)return this.$onChangeMode(this.$modes[i]),void(t&&t());this.$modeId=i,r.loadModule(["mode",i],function(e){if(this.$modeId!==i)return t&&t();this.$modes[i]&&!n?this.$onChangeMode(this.$modes[i]):e&&e.Mode&&(e=new e.Mode(n),n||(this.$modes[i]=e,e.$id=i),this.$onChangeMode(e)),t&&t()}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},this.$onChangeMode=function(e,t){if(t||(this.$modeId=e.$id),this.$mode!==e){this.$mode=e,this.$stopWorker(),this.$useWorker&&this.$startWorker();var n=e.getTokenizer();if(n.addEventListener!==undefined){var i=this.onReloadTokenizer.bind(this);n.addEventListener("update",i)}if(this.bgTokenizer)this.bgTokenizer.setTokenizer(n);else{this.bgTokenizer=new u(n);var o=this;this.bgTokenizer.addEventListener("update",function(e){o._signal("tokenizerUpdate",e)})}this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=e.tokenRe,this.nonTokenRe=e.nonTokenRe,t||(e.attachToSession&&e.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(e.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode"))}},this.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},this.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(e){r.warn("Could not load worker",e),this.$worker=null}},this.getMode=function(){return this.$mode},this.$scrollTop=0,this.setScrollTop=function(e){this.$scrollTop===e||isNaN(e)||(this.$scrollTop=e,this._signal("changeScrollTop",e))},this.getScrollTop=function(){return this.$scrollTop},this.$scrollLeft=0,this.setScrollLeft=function(e){this.$scrollLeft===e||isNaN(e)||(this.$scrollLeft=e,this._signal("changeScrollLeft",e))},this.getScrollLeft=function(){return this.$scrollLeft},this.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},this.getLineWidgetMaxWidth=function(){if(null!=this.lineWidgetsWidth)return this.lineWidgetsWidth;var e=0;return this.lineWidgets.forEach(function(t){t&&t.screenWidth>e&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,i=0,o=0,r=this.$foldData[o],s=r?r.start.row:Infinity,a=t.length,l=0;l<a;l++){if(l>s){if((l=r.end.row+1)>=a)break;r=this.$foldData[o++],s=r?r.start.row:Infinity}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>i&&(i=n[l])}this.screenWidth=i}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var i=e[n];"insert"==i.action||"remove"==i.action?this.doc.revertDelta(i):i.folds&&this.addFolds(i.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;n<e.length;n++){var i=e[n];("insert"==i.action||"remove"==i.action)&&this.doc.applyDelta(i)}!t&&this.$undoSelect&&(e.selectionAfter?this.selection.fromJSON(e.selectionAfter):this.selection.setRange(this.$getUndoSelection(e,!1))),this.$fromUndo=!1}},this.setUndoSelect=function(e){this.$undoSelect=e},this.$getUndoSelection=function(e,t){function n(e){return t?"insert"!==e.action:"insert"===e.action}for(var i,o,r=0;r<e.length;r++){var s=e[r];s.start&&(i?n(s)?(o=s.start,-1==i.compare(o.row,o.column)&&i.setStart(o),o=s.end,1==i.compare(o.row,o.column)&&i.setEnd(o),!0):(o=s.start,-1==i.compare(o.row,o.column)&&(i=c.fromPoints(s.start,s.start)),!1):n(s)?(i=c.fromPoints(s.start,s.end),!0):(i=c.fromPoints(s.start,s.start),!1))}return i},this.replace=function(e,t){return this.doc.replace(e,t)},this.moveText=function(e,t,n){var i=this.getTextRange(e),o=this.getFoldsInRange(e),r=c.fromPoints(t,t);if(!n){this.remove(e);var s=e.start.row-e.end.row,a=s?-e.end.column:e.start.column-e.end.column;a&&(r.start.row==e.end.row&&r.start.column>e.end.column&&(r.start.column+=a),r.end.row==e.end.row&&r.end.column>e.end.column&&(r.end.column+=a)),s&&r.start.row>=e.end.row&&(r.start.row+=s,r.end.row+=s)}if(r.end=this.insert(r.start,i),o.length){var l=e.start,h=r.start,s=h.row-l.row,a=h.column-l.column;this.addFolds(o.map(function(e){return e=e.clone(),e.start.row==l.row&&(e.start.column+=a),e.end.row==l.row&&(e.end.column+=a),e.start.row+=s,e.end.row+=s,e}))}return r},this.indentRows=function(e,t,n){
@@ -12,13 +12,13 @@ this.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.s
12
12
  ;return i&&r.rangeList.rangeAtPoint(i.start)&&r.addRange(i,!0),o.length},this.selectMoreLines=function(e,t){var n=this.selection.toOrientedRange(),i=n.cursor==n.end,o=this.session.documentToScreenPosition(n.cursor);this.selection.$desiredColumn&&(o.column=this.selection.$desiredColumn);var r=this.session.screenToDocumentPosition(o.row+e,o.column);if(n.isEmpty())var s=r;else var l=this.session.documentToScreenPosition(i?n.end:n.start),s=this.session.screenToDocumentPosition(l.row+e,l.column);if(i){var c=a.fromPoints(r,s);c.cursor=c.start}else{var c=a.fromPoints(s,r);c.cursor=c.end}if(c.desiredColumn=o.column,this.selection.inMultiSelectMode){if(t)var h=n.cursor}else this.selection.addRange(n);this.selection.addRange(c),h&&this.selection.substractPoint(h)},this.transposeSelections=function(e){for(var t=this.session,n=t.multiSelect,i=n.ranges,o=i.length;o--;){var r=i[o];if(r.isEmpty()){var s=t.getWordRange(r.start.row,r.start.column);r.start.row=s.start.row,r.start.column=s.start.column,r.end.row=s.end.row,r.end.column=s.end.column}}n.mergeOverlappingRanges();for(var a=[],o=i.length;o--;){var r=i[o];a.unshift(t.getTextRange(r))}e<0?a.unshift(a.pop()):a.push(a.shift());for(var o=i.length;o--;){var r=i[o],s=r.clone();t.replace(r,a[o]),r.start.row=s.start.row,r.start.column=s.start.column}n.fromOrientedRange(n.ranges[0])},this.selectMore=function(e,t,i){var o=this.session,r=o.multiSelect,s=r.toOrientedRange();if(!s.isEmpty()||(s=o.getWordRange(s.start.row,s.start.column),s.cursor=-1==e?s.start:s.end,this.multiSelect.addRange(s),!i)){var a=o.getTextRange(s),l=n(o,a,e);l&&(l.cursor=-1==e?l.start:l.end,this.session.unfold(l),this.multiSelect.addRange(l),this.renderer.scrollCursorIntoView(null,.5)),t&&this.multiSelect.substractPoint(s.cursor)}},this.alignCursors=function(){var e=this.session,t=e.multiSelect,n=t.ranges,i=-1,o=n.filter(function(e){if(e.cursor.row==i)return!0;i=e.cursor.row});if(n.length&&o.length!=n.length-1){o.forEach(function(e){t.substractPoint(e.cursor)});var r=0,s=Infinity,l=n.map(function(t){var n=t.cursor,i=e.getLine(n.row),o=i.substr(n.column).search(/\S/g);return-1==o&&(o=0),n.column>r&&(r=n.column),o<s&&(s=o),o});n.forEach(function(t,n){var i=t.cursor,o=r-i.column,c=l[n]-s;o>c?e.insert(i,u.stringRepeat(" ",o-c)):e.remove(new a(i.row,i.column,i.row,i.column-o+c)),t.start.column=t.end.column=r,t.start.row=t.end.row=i.row,t.cursor=t.end}),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var c=this.selection.getRange(),h=c.start.row,d=c.end.row,g=h==d;if(g){var p,f=this.session.getLength();do{p=this.session.getLine(d)}while(/[=:]/.test(p)&&++d<f);do{p=this.session.getLine(h)}while(/[=:]/.test(p)&&--h>0);h<0&&(h=0),d>=f&&(d=f-1)}var m=this.session.removeFullLines(h,d);m=this.$reAlignText(m,g),this.session.insert({row:h,column:0},m.join("\n")+"\n"),g||(c.start.column=0,c.end.column=m[m.length-1].length),this.selection.setRange(c)}},this.$reAlignText=function(e,t){function n(e){return u.stringRepeat(" ",e)}function i(e){return e[2]?n(s)+e[2]+n(a-e[2].length+l)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function o(e){return e[2]?n(s+a-e[2].length)+e[2]+n(l)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}function r(e){return e[2]?n(s)+e[2]+n(l)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}var s,a,l,c=!0,h=!0;return e.map(function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==s?(s=t[1].length,a=t[2].length,l=t[3].length,t):(s+a+l!=t[1].length+t[2].length+t[3].length&&(h=!1),s!=t[1].length&&(c=!1),s>t[1].length&&(s=t[1].length),a<t[2].length&&(a=t[2].length),l>t[3].length&&(l=t[3].length),t):[e]}).map(t?i:c?h?o:i:r)}}).call(m.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=o,e("./config").defineOptions(m.prototype,"editor",{enableMultiselect:{set:function(e){o(this),e?(this.on("changeSession",this.$multiselectOnSessionChange),this.on("mousedown",c)):(this.off("changeSession",this.$multiselectOnSessionChange),this.off("mousedown",c))},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(e,t){"use strict";var n=e("../../range").Range,i=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var i=e.getLine(n);return this.foldingStartMarker.test(i)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(i)?"end":""},this.getFoldWidgetRange=function(){return null},this.indentationBlock=function(e,t,i){var o=/\S/,r=e.getLine(t),s=r.search(o);if(-1!=s){for(var a=i||r.length,l=e.getLength(),c=t,h=t;++t<l;){var u=e.getLine(t).search(o);if(-1!=u){if(u<=s){var d=e.getTokenAt(t,0);if(!d||"string"!==d.type)break}h=t}}if(h>c){var g=e.getLine(h).length;return new n(c,a,h,g)}}},this.openingBracketBlock=function(e,t,i,o,r){var s={row:i,column:o+1},a=e.$findClosingBracket(t,s,r);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>s.row&&(a.row--,a.column=e.getLine(a.row).length),n.fromPoints(s,a)}},this.closingBracketBlock=function(e,t,i,o){var r={row:i,column:o},s=e.$findOpeningBracket(t,r);if(s)return s.column++,r.column--,n.fromPoints(s,r)}}).call(i.prototype)}),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/range"],function(e,t){"use strict";function n(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}var i=(e("./lib/oop"),e("./lib/dom"));e("./range").Range;(function(){this.getRowLength=function(e){var t;return t=this.lineWidgets?this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0:0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach(function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)}),e},this.$onChangeEditor=function(e){this.attach(e.editor)},this.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},this.detach=function(){var e=this.editor;if(e){this.editor=null,e.widgetManager=null,e.renderer.off("beforeRender",this.measureWidgets),e.renderer.off("afterRender",this.renderWidgets);var t=this.session.lineWidgets;t&&t.forEach(function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))})}},this.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var i=e.data,o=i.start.row,r=i.end.row,s="add"==e.action,a=o+1;a<r;a++)n[a]&&(n[a].hidden=s);n[r]&&(s?n[o]?n[r].hidden=s:n[o]=n[r]:(n[o]==n[r]&&(n[o]=undefined),n[r].hidden=s))}},this.updateOnChange=function(e){var t=this.session.lineWidgets;if(t){var n=e.start.row,i=e.end.row-n;if(0!==i)if("remove"==e.action){var o=t.splice(n+1,i);o.forEach(function(e){e&&this.removeLineWidget(e)},this),this.$updateRows()}else{var r=new Array(i);r.unshift(n,0),t.splice.apply(t,r),this.$updateRows()}}},this.$updateRows=function(){var e=this.session.lineWidgets;if(e){var t=!0;e.forEach(function(e,n){if(e)for(t=!1,e.row=n;e.$oldWidget;)e.$oldWidget.row=n,e=e.$oldWidget}),t&&(this.session.lineWidgets=null)}},this.addLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];t&&(e.$oldWidget=t,t.el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),this.session.lineWidgets[e.row]=e,e.session=this.session;var n=this.editor.renderer;e.html&&!e.el&&(e.el=i.createElement("div"),e.el.innerHTML=e.html),e.el&&(i.addCssClass(e.el,"ace_lineWidgetContainer"),e.el.style.position="absolute",e.el.style.zIndex=5,n.container.appendChild(e.el),e._inDocument=!0),e.coverGutter||(e.el.style.zIndex=3),null==e.pixelHeight&&(e.pixelHeight=e.el.offsetHeight),null==e.rowCount&&(e.rowCount=e.pixelHeight/n.layerConfig.lineHeight);var o=this.session.getFoldAt(e.row,0);if(e.$fold=o,o){var r=this.session.lineWidgets;e.row!=o.end.row||r[o.start.row]?e.hidden=!0:r[o.start.row]=e}return this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,n),this.onWidgetChanged(e),e},this.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(e){}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;t;){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},this.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,n=t&&t[e],i=[];n;)i.push(n),n=n.$oldWidget;return i},this.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},this.measureWidgets=function(e,t){var n=this.session._changedWidgets,i=t.layerConfig;if(n&&n.length){for(var o=Infinity,r=0;r<n.length;r++){var s=n[r];if(s&&s.el&&s.session==this.session){if(!s._inDocument){if(this.session.lineWidgets[s.row]!=s)continue;s._inDocument=!0,t.container.appendChild(s.el)}s.h=s.el.offsetHeight,s.fixedWidth||(s.w=s.el.offsetWidth,s.screenWidth=Math.ceil(s.w/i.characterWidth));var a=s.h/i.lineHeight;s.coverLine&&(a-=this.session.getRowLineCount(s.row))<0&&(a=0),s.rowCount!=a&&(s.rowCount=a,s.row<o&&(o=s.row))}}o!=Infinity&&(this.session._emit("changeFold",{data:{start:{row:o}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},this.renderWidgets=function(e,t){var n=t.layerConfig,i=this.session.lineWidgets;if(i){for(var o=Math.min(this.firstRow,n.firstRow),r=Math.max(this.lastRow,n.lastRow,i.length);o>0&&!i[o];)o--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var s=o;s<=r;s++){var a=i[s];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:s,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var c=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(c-=t.scrollLeft),a.el.style.left=c+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}}}).call(n.prototype),t.LineWidgets=n}),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range"],function(e,t){"use strict";function n(e,t,n){for(var i=0,o=e.length-1;i<=o;){var r=i+o>>1,s=n(t,e[r]);if(s>0)i=r+1;else{if(!(s<0))return r;o=r-1}}return-(i+1)}function i(e,t,i){var o=e.getAnnotations().sort(s.comparePoints);if(o.length){var r=n(o,{row:t,column:-1},s.comparePoints);r<0&&(r=-r-1),r>=o.length?r=i>0?0:o.length-1:0===r&&i<0&&(r=o.length-1);var a=o[r];if(a&&i){if(a.row===t){do{a=o[r+=i]}while(a&&a.row===t);if(!a)return o.slice()}var l=[];t=a.row;do{l[i<0?"unshift":"push"](a),a=o[r+=i]}while(a&&a.row==t);return l.length&&l}}}var o=e("../line_widgets").LineWidgets,r=e("../lib/dom"),s=e("../range").Range;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new o(n),n.widgetManager.attach(e));var s=e.getCursorPosition(),a=s.row,l=n.widgetManager.getWidgetsAtRow(a).filter(function(e){return"errorMarker"==e.type})[0];l?l.destroy():a-=t;var c,h=i(n,a,t);if(h){var u=h[0];s.column=(u.pos&&"number"!=typeof u.column?u.pos.sc:u.column)||0,s.row=u.row,c=e.renderer.$gutterLayer.$annotations[s.row]}else{if(l)return;c={text:["Looks good!"],className:"ace_ok"}}e.session.unfold(s.row),e.selection.moveToPosition(s);var d={row:s.row,fixedWidth:!0,coverGutter:!0,el:r.createElement("div"),type:"errorMarker"},g=d.el.appendChild(r.createElement("div")),p=d.el.appendChild(r.createElement("div"));p.className="error_widget_arrow "+c.className;var f=e.renderer.$cursorLayer.getPixelPosition(s).left;p.style.left=f+e.renderer.gutterWidth-5+"px",d.el.className="error_widget_wrapper",g.className="error_widget "+c.className,g.innerHTML=c.text.join("<br>"),g.appendChild(r.createElement("div"));var m=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return d.destroy(),{command:"null"}};d.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(m),n.widgetManager.removeLineWidget(d),e.off("changeSelection",d.destroy),e.off("changeSession",d.destroy),e.off("mouseup",d.destroy),e.off("change",d.destroy))},e.keyBinding.addKeyboardHandler(m),e.on("changeSelection",d.destroy),e.on("changeSession",d.destroy),e.on("mouseup",d.destroy),e.on("change",d.destroy),e.session.widgetManager.addLineWidget(d),d.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:d.el.offsetHeight})},r.importCssString(" .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }","")}),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t){"use strict";e("./lib/fixoldbrowsers");var n=e("./lib/dom"),i=e("./lib/event"),o=e("./range").Range,r=e("./editor").Editor,s=e("./edit_session").EditSession,a=e("./undomanager").UndoManager,l=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,"function"==typeof define&&(t.define=define),t.edit=function(e,o){if("string"==typeof e){var s=e;if(!(e=document.getElementById(s)))throw new Error("ace.edit can't find div #"+s)}if(e&&e.env&&e.env.editor instanceof r)return e.env.editor;var a="";if(e&&/input|textarea/i.test(e.tagName)){var c=e;a=c.value,e=n.createElement("pre"),c.parentNode.replaceChild(e,c)}else e&&(a=e.textContent,e.innerHTML="");var h=t.createEditSession(a),u=new r(new l(e),h,o),d={document:h,editor:u,onResize:u.resize.bind(u,null)};return c&&(d.textarea=c),i.addListener(window,"resize",d.onResize),u.on("destroy",function(){i.removeListener(window,"resize",d.onResize),d.editor.container.env=null}),u.container.env=u.env=d,u},t.createEditSession=function(e,t){var n=new s(e,t);return n.setUndoManager(new a),n},t.Range=o,t.Editor=r,t.EditSession=s,t.UndoManager=a,t.VirtualRenderer=l,t.version=t.config.version}),function(){ace.require(["ace/ace"],function(e){e&&(e.config.init(!0),e.define=ace.define),window.ace||(window.ace=e);for(var t in e)e.hasOwnProperty(t)&&(window.ace[t]=e[t]);window.ace["default"]=window.ace,"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=window.ace)})}(),ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,o=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},o.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};n.inherits(o,i),o.getTagRule=function(){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},o.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},o.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=o}),ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t){"use strict";function n(){var e=a.replace("\\d","\\d\\-"),t={onMatch:function(e,t,n){var i="/"==e.charAt(1)?2:1;return 1==i?(t!=this.nextState?n.unshift(this.next,this.nextState,0):n.unshift(this.next),n[2]++):2==i&&t==this.nextState&&(!--n[1]||n[1]<0)&&(n.shift(),n.shift()),[{type:"meta.tag.punctuation."+(1==i?"":"end-")+"tag-open.xml",value:e.slice(0,i)},{type:"meta.tag.tag-name.xml",value:e.substr(i)}]},regex:"</?"+e,next:"jsxAttributes",nextState:"jsx"};this.$rules.start.unshift(t);var n={regex:"{",token:"paren.quasi.start",push:"start"};this.$rules.jsx=[n,t,{include:"reference"},{defaultToken:"string"}],this.$rules.jsxAttributes=[{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",onMatch:function(e,t,n){return t==n[0]&&n.shift(),2==e.length&&(n[0]==this.nextState&&n[1]--,(!n[1]||n[1]<0)&&n.splice(0,2)),this.next=n[0]||"start",[{type:this.token,value:e}]},nextState:"jsx"},n,i("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:e},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},t],this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}]}function i(e){return[{token:"comment",regex:/\/\*/,next:[r.getTagRule(),{token:"comment",regex:"\\*\\/",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]},{token:"comment",regex:"\\/\\/",next:[r.getTagRule(),{token:"comment",regex:"$|^",next:e||"pop"},{defaultToken:"comment",caseInsensitive:!0}]}]}var o=e("../lib/oop"),r=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,a="[a-zA-Z\\$_\xa1-\uffff][a-zA-Z\\d\\$_\xa1-\uffff]*",l=function(e){var t=this.createKeywordMapper({"variable.language":"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",keyword:"const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),o="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[r.getStartRule("doc-start"),i("no_regex"),{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+a+")(\\.)(prototype)(\\.)("+a+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+a+")(\\.)("+a+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+a+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+a+")(\\.)("+a+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+a+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+a+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"from(?=\\s*('|\"))"},{token:"keyword",regex:"(?:case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void)\\b",next:"start"},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:t,regex:a},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"storage.type",regex:/=>/,next:"start"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+a+")(\\.)("+a+")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|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:"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|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"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:"identifier",regex:a},{regex:"",token:"empty",next:"no_regex"}],start:[r.getStartRule("doc-start"),i("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:a},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],qqstring:[{token:"constant.language.escape",regex:o},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{
13
13
  token:"constant.language.escape",regex:o},{token:"string",regex:"\\\\$",consumeLineEnd:!0},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]},e&&e.noES6||(this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(e,t,n){if(this.next="{"==e?this.nextState:"","{"==e&&n.length)n.unshift("start",t);else if("}"==e&&n.length&&(n.shift(),this.next=n.shift(),-1!=this.next.indexOf("string")||-1!=this.next.indexOf("jsx")))return"paren.quasi.end";return"{"==e?"paren.lparen":"paren.rparen"},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:o},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]}),(!e||0!=e.jsx)&&n.call(this)),this.embedRules(r,"doc-",[r.getEndRule("no_regex")]),this.normalizeRules()};o.inherits(l,s),t.JavaScriptHighlightRules=l}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t){"use strict";var n=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var i=e.getLine(t),o=i.match(/^(\s*\})/);if(!o)return 0;var r=o[1].length,s=e.findMatchingBracket({row:t,column:r});if(!s||s.row==t)return 0;var a=this.$getIndent(e.getLine(s.row));e.replace(new n(t,0,t,r-1),a)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t){"use strict";var n=e("../../lib/oop"),i=e("../../range").Range,o=e("./fold_mode").FoldMode,r=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};n.inherits(r,o),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var i=e.getLine(n);if(this.singleLineBlockCommentRe.test(i)&&!this.startRegionRe.test(i)&&!this.tripleStarBlockCommentRe.test(i))return"";var o=this._getFoldWidgetBase(e,t,n);return!o&&this.startRegionRe.test(i)?"start":o},this.getFoldWidgetRange=function(e,t,n,i){var o=e.getLine(n);if(this.startRegionRe.test(o))return this.getCommentRegionBlock(e,o,n);var r=o.match(this.foldingStartMarker);if(r){var s=r.index;if(r[1])return this.openingBracketBlock(e,r[1],n,s);var a=e.getCommentFoldRange(n,s+r[0].length,1);return a&&!a.isMultiLine()&&(i?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}if("markbegin"!==t){var r=o.match(this.foldingStopMarker);if(r){var s=r.index+r[0].length;return r[1]?this.closingBracketBlock(e,r[1],n,s):e.getCommentFoldRange(n,s,-1)}}},this.getSectionRange=function(e,t){var n=e.getLine(t),o=n.search(/\S/),r=t,s=n.length;t+=1;for(var a=t,l=e.getLength();++t<l;){n=e.getLine(t);var c=n.search(/\S/);if(-1!==c){if(o>c)break;var h=this.getFoldWidgetRange(e,"all",t);if(h){if(h.start.row<=r)break;if(h.isMultiLine())t=h.end.row;else if(o==c)break}a=t}}return new i(r,s,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var o=t.search(/\s*$/),r=e.getLength(),s=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++n<r;){t=e.getLine(n);var c=a.exec(t);if(c&&(c[1]?l--:l++,!l))break}var h=n;if(h>s)return new i(s,o,h,t.length)}}.call(r.prototype)}),ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text").Mode,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,r=e("./matching_brace_outdent").MatchingBraceOutdent,s=e("../worker/worker_client").WorkerClient,a=e("./behaviour/cstyle").CstyleBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.HighlightRules=o,this.$outdent=new r,this.$behaviour=new a,this.foldingRules=new l};n.inherits(c,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.getNextLineIndent=function(e,t,n){var i=this.$getIndent(t),o=this.getTokenizer().getLineTokens(t,e),r=o.tokens,s=o.state;if(r.length&&"comment"==r[r.length-1].type)return i;if("start"==e||"no_regex"==e){var a=t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);a&&(i+=n)}else if("doc-start"==e){if("start"==s||"no_regex"==s)return"";var a=t.match(/^\s*(\/?)\*/);a&&(a[1]&&(i+=" "),i+="* ")}return i},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new s(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript"}.call(c.prototype),t.Mode=c}),ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,o=function(){var e="[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)("+e+")",next:"processing_instruction"},{token:"comment.start.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:!0},{include:"tag"},{token:"text.end-tag-open.xml",regex:"</"},{token:"text.tag-open.xml",regex:"<"},{include:"reference"},{defaultToken:"text.xml"}],processing_instruction:[{token:"entity.other.attribute-name.decl-attribute-name.xml",regex:e},{token:"keyword.operator.decl-attribute-equals.xml",regex:"="},{include:"whitespace"},{include:"string"},{token:"punctuation.xml-decl.xml",regex:"\\?>",next:"start"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)("+e+")",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.end.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(</))((?:"+e+":)?"+e+")",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:e},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]},this.constructor===o&&this.normalizeRules()};(function(){this.embedTagRules=function(e,t,n){this.$rules.tag.unshift({token:["meta.tag.punctuation.tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(<)("+n+"(?=\\s|>|$))",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:t+"start"}]}),this.$rules[n+"-end"]=[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start",onMatch:function(e,t,n){return n.splice(0),this.token}}],this.embedRules(e,t,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(</)("+n+"(?=\\s|>|$))",next:n+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}])}}).call(i.prototype),n.inherits(o,i),t.XmlHighlightRules=o}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t){"use strict";function n(e,t){return e&&e.type.lastIndexOf(t+".xml")>-1}var i=e("../../lib/oop"),o=e("../behaviour").Behaviour,r=e("../../token_iterator").TokenIterator,s=(e("../../lib/lang"),function(){this.add("string_dquotes","insertion",function(e,t,i,o,s){if('"'==s||"'"==s){var a=s,l=o.doc.getTextRange(i.getSelectionRange());if(""!==l&&"'"!==l&&'"'!=l&&i.getWrapBehavioursEnabled())return{text:a+l+a,selection:!1};var c=i.getCursorPosition(),h=o.doc.getLine(c.row),u=h.substring(c.column,c.column+1),d=new r(o,c.row,c.column),g=d.getCurrentToken();if(u==a&&(n(g,"attribute-value")||n(g,"string")))return{text:"",selection:[1,1]};if(g||(g=d.stepBackward()),!g)return;for(;n(g,"tag-whitespace")||n(g,"whitespace");)g=d.stepBackward();var p=!u||u.match(/\s/);if(n(g,"attribute-equals")&&(p||">"==u)||n(g,"decl-attribute-equals")&&(p||"?"==u))return{text:a+a,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,i,o){var r=i.doc.getTextRange(o);if(!o.isMultiLine()&&('"'==r||"'"==r)){if(i.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)==r)return o.end.column++,o}}),this.add("autoclosing","insertion",function(e,t,i,o,s){if(">"==s){var a=i.getSelectionRange().start,l=new r(o,a.row,a.column),c=l.getCurrentToken()||l.stepBackward();if(!c||!(n(c,"tag-name")||n(c,"tag-whitespace")||n(c,"attribute-name")||n(c,"attribute-equals")||n(c,"attribute-value")))return;if(n(c,"reference.attribute-value"))return;if(n(c,"attribute-value")){var h=l.getCurrentTokenColumn()+c.value.length;if(a.column<h)return;if(a.column==h){var u=l.stepForward();if(u&&n(u,"attribute-value"))return;l.stepBackward()}}if(/^\s*>/.test(o.getLine(a.row).slice(a.column)))return;for(;!n(c,"tag-name");)if(c=l.stepBackward(),"<"==c.value){c=l.stepForward();break}var d=l.getCurrentTokenRow(),g=l.getCurrentTokenColumn();if(n(l.stepBackward(),"end-tag-open"))return;var p=c.value;if(d==a.row&&(p=p.substring(0,a.column-g)),this.voidElements.hasOwnProperty(p.toLowerCase()))return;return{text:"></"+p+">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,i,o){if("\n"==o){var s=n.getCursorPosition(),a=i.getLine(s.row),l=new r(i,s.row,s.column),c=l.getCurrentToken();if(c&&-1!==c.type.indexOf("tag-close")){if("/>"==c.value)return;for(;c&&-1===c.type.indexOf("tag-name");)c=l.stepBackward();if(!c)return;var h=c.value,u=l.getCurrentTokenRow();if(!(c=l.stepBackward())||-1!==c.type.indexOf("end-tag"))return;if(this.voidElements&&!this.voidElements[h]){var d=i.getTokenAt(s.row,s.column+1),a=i.getLine(u),g=this.$getIndent(a),p=g+i.getTabString();return d&&"</"===d.value?{text:"\n"+p+"\n"+g,selection:[1,p.length,1,p.length]}:{text:"\n"+p}}}}})});i.inherits(s,o),t.XmlBehaviour=s}),ace.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(e,t){"use strict";function n(e,t){return e.type.lastIndexOf(t+".xml")>-1}var i=e("../../lib/oop"),o=(e("../../lib/lang"),e("../../range").Range),r=e("./fold_mode").FoldMode,s=e("../../token_iterator").TokenIterator,a=t.FoldMode=function(e,t){r.call(this),this.voidElements=e||{},this.optionalEndTags=i.mixin({},this.voidElements),t&&i.mixin(this.optionalEndTags,t)};i.inherits(a,r);var l=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var i=this._getFirstTagInLine(e,n);return i?i.closing||!i.tagName&&i.selfClosing?"markbeginend"==t?"end":"":!i.tagName||i.selfClosing||this.voidElements.hasOwnProperty(i.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,i.tagName,i.end.column)?"":"start":this.getCommentFoldWidget(e,n)},this.getCommentFoldWidget=function(e,t){return/comment/.test(e.getState(t))&&/<!-/.test(e.getLine(t))?"start":""},this._getFirstTagInLine=function(e,t){for(var i=e.getTokens(t),o=new l,r=0;r<i.length;r++){var s=i[r];if(n(s,"tag-open")){if(o.end.column=o.start.column+s.value.length,o.closing=n(s,"end-tag-open"),s=i[++r],!s)return null;for(o.tagName=s.value,o.end.column+=s.value.length,r++;r<i.length;r++)if(s=i[r],o.end.column+=s.value.length,n(s,"tag-close")){o.selfClosing="/>"==s.value;break}return o}if(n(s,"tag-close"))return o.selfClosing="/>"==s.value,o;o.start.column+=s.value.length}return null},this._findEndTagInLine=function(e,t,i,o){for(var r=e.getTokens(t),s=0,a=0;a<r.length;a++){var l=r[a];if(!((s+=l.value.length)<o)&&n(l,"end-tag-open")&&(l=r[a+1])&&l.value==i)return!0}return!1},this._readTagForward=function(e){var t=e.getCurrentToken();if(!t)return null;var i=new l;do{if(n(t,"tag-open"))i.closing=n(t,"end-tag-open"),i.start.row=e.getCurrentTokenRow(),i.start.column=e.getCurrentTokenColumn();else if(n(t,"tag-name"))i.tagName=t.value;else if(n(t,"tag-close"))return i.selfClosing="/>"==t.value,i.end.row=e.getCurrentTokenRow(),i.end.column=e.getCurrentTokenColumn()+t.value.length,e.stepForward(),i}while(t=e.stepForward());return null},this._readTagBackward=function(e){var t=e.getCurrentToken();if(!t)return null;var i=new l;do{if(n(t,"tag-open"))return i.closing=n(t,"end-tag-open"),i.start.row=e.getCurrentTokenRow(),i.start.column=e.getCurrentTokenColumn(),e.stepBackward(),i;n(t,"tag-name")?i.tagName=t.value:n(t,"tag-close")&&(i.selfClosing="/>"==t.value,i.end.row=e.getCurrentTokenRow(),i.end.column=e.getCurrentTokenColumn()+t.value.length)}while(t=e.stepBackward());return null},this._pop=function(e,t){for(;e.length;){var n=e[e.length-1];if(!t||n.tagName==t.tagName)return e.pop();{if(!this.optionalEndTags.hasOwnProperty(n.tagName))return null;e.pop()}}},this.getFoldWidgetRange=function(e,t,n){var i=this._getFirstTagInLine(e,n);if(!i)return this.getCommentFoldWidget(e,n)&&e.getCommentFoldRange(n,e.getLine(n).length);var r,a=i.closing||i.selfClosing,l=[];if(a){for(var c=new s(e,n,i.end.column),h={row:n,column:i.start.column};r=this._readTagBackward(c);)if(r.selfClosing){if(!l.length)return r.start.column+=r.tagName.length+2,r.end.column-=2,o.fromPoints(r.start,r.end)}else if(r.closing)l.push(r);else if(this._pop(l,r),0==l.length)return r.start.column+=r.tagName.length+2,r.start.row==r.end.row&&r.start.column<r.end.column&&(r.start.column=r.end.column),o.fromPoints(r.start,h)}else{var c=new s(e,n,i.start.column),u={row:n,column:i.start.column+i.tagName.length+2};for(i.start.row==i.end.row&&(u.column=i.end.column);r=this._readTagForward(c);)if(r.selfClosing){if(!l.length)return r.start.column+=r.tagName.length+2,r.end.column-=2,o.fromPoints(r.start,r.end)}else if(r.closing){if(this._pop(l,r),0==l.length)return o.fromPoints(u,r.start)}else l.push(r)}}}).call(a.prototype)}),ace.define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml","ace/worker/worker_client"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("../lib/lang"),o=e("./text").Mode,r=e("./xml_highlight_rules").XmlHighlightRules,s=e("./behaviour/xml").XmlBehaviour,a=e("./folding/xml").FoldMode,l=e("../worker/worker_client").WorkerClient,c=function(){this.HighlightRules=r,this.$behaviour=new s,this.foldingRules=new a};n.inherits(c,o),function(){this.voidElements=i.arrayToMap([]),this.blockComment={start:"<!--",end:"-->"},this.createWorker=function(e){var t=new l(["ace"],"ace/mode/xml_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/xml"}.call(c.prototype),t.Mode=c}),ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=(e("../lib/lang"),e("./text_highlight_rules").TextHighlightRules),o=t.supportType="align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|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|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index",r=t.supportFunction="rgb|rgba|url|attr|counter|counters",s=t.supportConstant="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|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|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom",a=t.supportConstantColor="aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",l=t.supportConstantFonts="arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",c=t.numRe="\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",u=t.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",d=function(){var e=this.createKeywordMapper({"support.function":r,"support.constant":s,"support.type":o,"support.constant.color":a,"support.constant.fonts":l},"text",!0);this.$rules={start:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"paren.rparen",regex:"\\}"},{token:"string",regex:"@(?!viewport)",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"keyword",regex:"%"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant.numeric",regex:c},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"start"},{token:"paren.rparen",regex:"\\}",next:"start"},{token:"string",regex:";",next:"start"},{token:"keyword",regex:"(?:media|supports|document|charset|import|namespace|media|supports|document|page|font|keyframes|viewport|counter-style|font-feature-values|swash|ornaments|annotation|stylistic|styleset|character-variant)"}],comments:[{token:"comment",regex:"\\/\\*",push:[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}]}],ruleset:[{regex:"-(webkit|ms|moz|o)-",token:"text"},{token:"punctuation.operator",regex:"[:;]"},{token:"paren.rparen",regex:"\\}",next:"start"},{include:["strings","url","comments"]},{token:["constant.numeric","keyword"],regex:"("+c+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"},{token:"constant.numeric",regex:c},{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:u},{include:"url"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{caseInsensitive:!0}],url:[{token:"support.function",regex:"(?:url(:?-prefix)?|domain|regexp)\\(",push:[{token:"support.function",regex:"\\)",next:"pop"},{defaultToken:"string"}]}],strings:[{token:"string.start",regex:"'",push:[{token:"string.end",regex:"'|$",next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]},{token:"string.start",regex:'"',push:[{token:"string.end",regex:'"|$',next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]}],escapes:[{token:"constant.language.escape",regex:/\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/}]},this.normalizeRules()};n.inherits(d,i),t.CssHighlightRules=d}),ace.define("ace/mode/css_completions",["require","exports","module"],function(e,t){"use strict";var n={background:{"#$0":1},"background-color":{"#$0":1,transparent:1,fixed:1},"background-image":{"url('/$0')":1},"background-repeat":{repeat:1,"repeat-x":1,"repeat-y":1,"no-repeat":1,inherit:1},"background-position":{bottom:2,center:2,left:2,right:2,top:2,inherit:2},"background-attachment":{scroll:1,fixed:1},"background-size":{cover:1,contain:1},"background-clip":{"border-box":1,"padding-box":1,"content-box":1},"background-origin":{"border-box":1,"padding-box":1,"content-box":1},border:{"solid $0":1,"dashed $0":1,"dotted $0":1,"#$0":1},"border-color":{"#$0":1},"border-style":{solid:2,dashed:2,dotted:2,"double":2,groove:2,hidden:2,inherit:2,inset:2,none:2,outset:2,ridged:2},"border-collapse":{collapse:1,separate:1},bottom:{px:1,em:1,"%":1},clear:{left:1,right:1,both:1,none:1},color:{"#$0":1,"rgb(#$00,0,0)":1},cursor:{"default":1,pointer:1,move:1,text:1,wait:1,help:1,progress:1,"n-resize":1,"ne-resize":1,"e-resize":1,"se-resize":1,"s-resize":1,"sw-resize":1,"w-resize":1,"nw-resize":1},display:{none:1,block:1,inline:1,"inline-block":1,"table-cell":1},"empty-cells":{show:1,hide:1},"float":{left:1,right:1,none:1},"font-family":{Arial:2,"Comic Sans MS":2,Consolas:2,"Courier New":2,Courier:2,Georgia:2,Monospace:2,"Sans-Serif":2,"Segoe UI":2,Tahoma:2,"Times New Roman":2,"Trebuchet MS":2,Verdana:1},"font-size":{px:1,em:1,"%":1},"font-weight":{bold:1,normal:1},"font-style":{italic:1,normal:1},"font-variant":{normal:1,"small-caps":1},height:{px:1,em:1,"%":1},left:{px:1,em:1,"%":1},"letter-spacing":{normal:1},"line-height":{normal:1},"list-style-type":{none:1,disc:1,circle:1,square:1,decimal:1,"decimal-leading-zero":1,"lower-roman":1,"upper-roman":1,"lower-greek":1,"lower-latin":1,"upper-latin":1,georgian:1,"lower-alpha":1,"upper-alpha":1},margin:{px:1,em:1,"%":1},"margin-right":{px:1,em:1,"%":1},"margin-left":{px:1,em:1,"%":1},"margin-top":{px:1,em:1,"%":1},"margin-bottom":{px:1,em:1,"%":1},"max-height":{px:1,em:1,"%":1},"max-width":{px:1,em:1,"%":1},"min-height":{px:1,em:1,"%":1},"min-width":{px:1,em:1,"%":1},overflow:{hidden:1,visible:1,auto:1,scroll:1},"overflow-x":{hidden:1,visible:1,auto:1,scroll:1},"overflow-y":{hidden:1,visible:1,auto:1,scroll:1},padding:{px:1,em:1,"%":1},"padding-top":{px:1,em:1,"%":1},"padding-right":{px:1,em:1,"%":1},"padding-bottom":{px:1,em:1,"%":1},"padding-left":{px:1,em:1,"%":1},"page-break-after":{auto:1,always:1,avoid:1,left:1,right:1},"page-break-before":{auto:1,always:1,avoid:1,left:1,right:1},position:{absolute:1,relative:1,fixed:1,"static":1},right:{px:1,em:1,"%":1},"table-layout":{fixed:1,auto:1},"text-decoration":{none:1,underline:1,"line-through":1,blink:1},"text-align":{left:1,right:1,center:1,justify:1},"text-transform":{capitalize:1,uppercase:1,lowercase:1,none:1},top:{px:1,em:1,"%":1},"vertical-align":{top:1,bottom:1},visibility:{hidden:1,visible:1},"white-space":{nowrap:1,normal:1,pre:1,"pre-line":1,"pre-wrap":1},width:{px:1,em:1,"%":1},"word-spacing":{normal:1},filter:{"alpha(opacity=$0100)":1},"text-shadow":{"$02px 2px 2px #777":1},"text-overflow":{"ellipsis-word":1,clip:1,ellipsis:1},"-moz-border-radius":1,"-moz-border-radius-topright":1,"-moz-border-radius-bottomright":1,"-moz-border-radius-topleft":1,"-moz-border-radius-bottomleft":1,"-webkit-border-radius":1,"-webkit-border-top-right-radius":1,"-webkit-border-top-left-radius":1,"-webkit-border-bottom-right-radius":1,"-webkit-border-bottom-left-radius":1,"-moz-box-shadow":1,"-webkit-box-shadow":1,transform:{"rotate($00deg)":1,"skew($00deg)":1},"-moz-transform":{"rotate($00deg)":1,"skew($00deg)":1},"-webkit-transform":{"rotate($00deg)":1,"skew($00deg)":1}},i=function(){};(function(){this.completionsDefined=!1,this.defineCompletions=function(){if(document){var e=document.createElement("c").style;for(var t in e)if("string"==typeof e[t]){var i=t.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()});n.hasOwnProperty(i)||(n[i]=1)}}this.completionsDefined=!0},this.getCompletions=function(e,t,n,i){if(this.completionsDefined||this.defineCompletions(),"ruleset"===e||"ace/mode/scss"==t.$mode.$id){var o=t.getLine(n.row).substr(0,n.column);return/:[^;]+$/.test(o)?(/([\w\-]+):[^:]*$/.test(o),this.getPropertyValueCompletions(e,t,n,i)):this.getPropertyCompletions(e,t,n,i)}return[]},this.getPropertyCompletions=function(){return Object.keys(n).map(function(e){return{caption:e,snippet:e+": $0;",meta:"property",score:1e6}})},this.getPropertyValueCompletions=function(e,t,i){var o=t.getLine(i.row).substr(0,i.column),r=(/([\w\-]+):[^:]*$/.exec(o)||{})[1];if(!r)return[];var s=[];return r in n&&"object"==typeof n[r]&&(s=Object.keys(n[r])),s.map(function(e){return{caption:e,snippet:e,meta:"property value",score:1e6}})}}).call(i.prototype),t.CssCompletions=i}),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t){"use strict";var n=e("../../lib/oop"),i=(e("../behaviour").Behaviour,e("./cstyle").CstyleBehaviour),o=e("../../token_iterator").TokenIterator,r=function(){this.inherit(i),this.add("colon","insertion",function(e,t,n,i,r){if(":"===r&&n.selection.isEmpty()){var s=n.getCursorPosition(),a=new o(i,s.row,s.column),l=a.getCurrentToken();if(l&&l.value.match(/\s+/)&&(l=a.stepBackward()),l&&"support.type"===l.type){var c=i.doc.getLine(s.row);if(":"===c.substring(s.column,s.column+1))return{text:"",selection:[1,1]};if(/^(\s+[^;]|\s*$)/.test(c.substring(s.column)))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,i,r){var s=i.doc.getTextRange(r);if(!r.isMultiLine()&&":"===s){var a=n.getCursorPosition(),l=new o(i,a.row,a.column),c=l.getCurrentToken();if(c&&c.value.match(/\s+/)&&(c=l.stepBackward()),c&&"support.type"===c.type){if(";"===i.doc.getLine(r.start.row).substring(r.end.column,r.end.column+1))return r.end.column++,r}}}),
14
14
  this.add("semicolon","insertion",function(e,t,n,i,o){if(";"===o&&n.selection.isEmpty()){var r=n.getCursorPosition();if(";"===i.doc.getLine(r.row).substring(r.column,r.column+1))return{text:"",selection:[1,1]}}}),this.add("!important","insertion",function(e,t,n,i,o){if("!"===o&&n.selection.isEmpty()){var r=n.getCursorPosition(),s=i.doc.getLine(r.row);if(/^\s*(;|}|$)/.test(s.substring(r.column)))return{text:"!important",selection:[10,10]}}})};n.inherits(r,i),t.CssBehaviour=r}),ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text").Mode,o=e("./css_highlight_rules").CssHighlightRules,r=e("./matching_brace_outdent").MatchingBraceOutdent,s=e("../worker/worker_client").WorkerClient,a=e("./css_completions").CssCompletions,l=e("./behaviour/css").CssBehaviour,c=e("./folding/cstyle").FoldMode,h=function(){this.HighlightRules=o,this.$outdent=new r,this.$behaviour=new l,this.$completer=new a,this.foldingRules=new c};n.inherits(h,i),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var i=this.$getIndent(t),o=this.getTokenizer().getLineTokens(t,e).tokens;return o.length&&"comment"==o[o.length-1].type?i:(t.match(/^.*\{\s*$/)&&(i+=n),i)},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.getCompletions=function(e,t,n,i){return this.$completer.getCompletions(e,t,n,i)},this.createWorker=function(e){var t=new s(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/css"}.call(h.prototype),t.Mode=h}),ace.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_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("../lib/lang"),o=e("./css_highlight_rules").CssHighlightRules,r=e("./javascript_highlight_rules").JavaScriptHighlightRules,s=e("./xml_highlight_rules").XmlHighlightRules,a=i.createMap({a:"anchor",button:"form",form:"form",img:"image",input:"form",label:"form",option:"form",script:"script",select:"form",textarea:"form",style:"style",table:"table",tbody:"table",td:"table",tfoot:"table",th:"table",tr:"table"}),l=function(){s.call(this),this.addRules({attributes:[{include:"tag_whitespace"},{token:"entity.other.attribute-name.xml",regex:"[-_a-zA-Z0-9:.]+"},{token:"keyword.operator.attribute-equals.xml",regex:"=",push:[{include:"tag_whitespace"},{token:"string.unquoted.attribute-value.html",regex:"[^<>='\"`\\s]+",next:"pop"},{token:"empty",regex:"",next:"pop"}]},{include:"attribute_value"}],tag:[{token:function(e,t){var n=a[t];return["meta.tag.punctuation."+("<"==e?"":"end-")+"tag-open.xml","meta.tag"+(n?"."+n:"")+".tag-name.xml"]},regex:"(</?)([-_a-zA-Z0-9:.]+)",next:"tag_stuff"}],tag_stuff:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start"}]}),this.embedTagRules(o,"css-","style"),this.embedTagRules(new r({jsx:!1}).getRules(),"js-","script"),this.constructor===l&&this.normalizeRules()};n.inherits(l,s),t.HtmlHighlightRules=l}),ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t){"use strict";var n=e("../../lib/oop"),i=e("./fold_mode").FoldMode,o=t.FoldMode=function(e,t){this.defaultMode=e,this.subModes=t};n.inherits(o,i),function(){this.$getMode=function(e){"string"!=typeof e&&(e=e[0]);for(var t in this.subModes)if(0===e.indexOf(t))return this.subModes[t];return null},this.$tryMode=function(e,t,n,i){var o=this.$getMode(e);return o?o.getFoldWidget(t,n,i):""},this.getFoldWidget=function(e,t,n){return this.$tryMode(e.getState(n-1),e,t,n)||this.$tryMode(e.getState(n),e,t,n)||this.defaultMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n){var i=this.$getMode(e.getState(n-1));return i&&i.getFoldWidget(e,t,n)||(i=this.$getMode(e.getState(n))),i&&i.getFoldWidget(e,t,n)||(i=this.defaultMode),i.getFoldWidgetRange(e,t,n)}}.call(o.prototype)}),ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t){"use strict";var n=e("../../lib/oop"),i=e("./mixed").FoldMode,o=e("./xml").FoldMode,r=e("./cstyle").FoldMode,s=t.FoldMode=function(e,t){i.call(this,new o(e,t),{"js-":new r,"css-":new r})};n.inherits(s,i)}),ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"],function(e,t){"use strict";function n(e,t){return e.type.lastIndexOf(t+".xml")>-1}function i(e,t){for(var i=new r(e,t.row,t.column),o=i.getCurrentToken();o&&!n(o,"tag-name");)o=i.stepBackward();if(o)return o.value}function o(e,t){for(var i=new r(e,t.row,t.column),o=i.getCurrentToken();o&&!n(o,"attribute-name");)o=i.stepBackward();if(o)return o.value}var r=e("../token_iterator").TokenIterator,s=["accesskey","class","contenteditable","contextmenu","dir","draggable","dropzone","hidden","id","inert","itemid","itemprop","itemref","itemscope","itemtype","lang","spellcheck","style","tabindex","title","translate"],a=["onabort","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncuechange","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onpause","onplay","onplaying","onprogress","onratechange","onreset","onscroll","onseeked","onseeking","onselect","onshow","onstalled","onsubmit","onsuspend","ontimeupdate","onvolumechange","onwaiting"],l=s.concat(a),c={a:{href:1,target:{_blank:1,top:1},ping:1,rel:{nofollow:1,alternate:1,author:1,bookmark:1,help:1,license:1,next:1,noreferrer:1,prefetch:1,prev:1,search:1,tag:1},media:1,hreflang:1,type:1},abbr:{},address:{},area:{shape:1,coords:1,href:1,hreflang:1,alt:1,target:1,media:1,rel:1,ping:1,type:1},article:{pubdate:1},aside:{},audio:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},muted:{muted:1},preload:{auto:1,metadata:1,none:1}},b:{},base:{href:1,target:1},bdi:{},bdo:{},blockquote:{cite:1},body:{onafterprint:1,onbeforeprint:1,onbeforeunload:1,onhashchange:1,onmessage:1,onoffline:1,onpopstate:1,onredo:1,onresize:1,onstorage:1,onundo:1,onunload:1},br:{},button:{autofocus:1,disabled:{disabled:1},form:1,formaction:1,formenctype:1,formmethod:1,formnovalidate:1,formtarget:1,name:1,value:1,type:{button:1,submit:1}},canvas:{width:1,height:1},caption:{},cite:{},code:{},col:{span:1},colgroup:{span:1},command:{type:1,label:1,icon:1,disabled:1,checked:1,radiogroup:1,command:1},data:{},datalist:{},dd:{},del:{cite:1,datetime:1},details:{open:1},dfn:{},dialog:{open:1},div:{},dl:{},dt:{},em:{},embed:{src:1,height:1,width:1,type:1},fieldset:{disabled:1,form:1,name:1},figcaption:{},figure:{},footer:{},form:{"accept-charset":1,action:1,autocomplete:1,enctype:{"multipart/form-data":1,"application/x-www-form-urlencoded":1},method:{get:1,post:1},name:1,novalidate:1,target:{_blank:1,top:1}},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},head:{},header:{},hr:{},html:{manifest:1},i:{},iframe:{name:1,src:1,height:1,width:1,sandbox:{"allow-same-origin":1,"allow-top-navigation":1,"allow-forms":1,"allow-scripts":1},seamless:{seamless:1}},img:{alt:1,src:1,height:1,width:1,usemap:1,ismap:1},input:{type:{text:1,password:1,hidden:1,checkbox:1,submit:1,radio:1,file:1,button:1,reset:1,image:31,color:1,date:1,datetime:1,"datetime-local":1,email:1,month:1,number:1,range:1,search:1,tel:1,time:1,url:1,week:1},accept:1,alt:1,autocomplete:{on:1,off:1},autofocus:{autofocus:1},checked:{checked:1},disabled:{disabled:1},form:1,formaction:1,formenctype:{"application/x-www-form-urlencoded":1,"multipart/form-data":1,"text/plain":1},formmethod:{get:1,post:1},formnovalidate:{formnovalidate:1},formtarget:{_blank:1,_self:1,_parent:1,_top:1},height:1,list:1,max:1,maxlength:1,min:1,multiple:{multiple:1},name:1,pattern:1,placeholder:1,readonly:{readonly:1},required:{required:1},size:1,src:1,step:1,width:1,files:1,value:1},ins:{cite:1,datetime:1},kbd:{},keygen:{autofocus:1,challenge:{challenge:1},disabled:{disabled:1},form:1,keytype:{rsa:1,dsa:1,ec:1},name:1},label:{form:1,"for":1},legend:{},li:{value:1},link:{href:1,hreflang:1,rel:{stylesheet:1,icon:1},media:{all:1,screen:1,print:1},type:{"text/css":1,"image/png":1,"image/jpeg":1,"image/gif":1},sizes:1},main:{},map:{name:1},mark:{},math:{},menu:{type:1,label:1},meta:{"http-equiv":{"content-type":1},name:{description:1,keywords:1},content:{"text/html; charset=UTF-8":1},charset:1},meter:{value:1,min:1,max:1,low:1,high:1,optimum:1},nav:{},noscript:{href:1},object:{param:1,data:1,type:1,height:1,width:1,usemap:1,name:1,form:1,classid:1},ol:{start:1,reversed:1},optgroup:{disabled:1,label:1},option:{disabled:1,selected:1,label:1,value:1},output:{"for":1,form:1,name:1},p:{},param:{name:1,value:1},pre:{},progress:{value:1,max:1},q:{cite:1},rp:{},rt:{},ruby:{},s:{},samp:{},script:{charset:1,type:{"text/javascript":1},src:1,defer:1,async:1},select:{autofocus:1,disabled:1,form:1,multiple:{multiple:1},name:1,size:1,readonly:{readonly:1}},small:{},source:{src:1,type:1,media:1},span:{},strong:{},style:{type:1,media:{all:1,screen:1,print:1},scoped:1},sub:{},sup:{},svg:{},table:{summary:1},tbody:{},td:{headers:1,rowspan:1,colspan:1},textarea:{autofocus:{autofocus:1},disabled:{disabled:1},form:1,maxlength:1,name:1,placeholder:1,readonly:{readonly:1},required:{required:1},rows:1,cols:1,wrap:{on:1,off:1,hard:1,soft:1}},tfoot:{},th:{headers:1,rowspan:1,colspan:1,scope:1},thead:{},time:{datetime:1},title:{},tr:{},track:{kind:1,src:1,srclang:1,label:1,"default":1},section:{},summary:{},u:{},ul:{},"var":{},video:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},width:1,height:1,poster:1,muted:{muted:1},preload:{auto:1,metadata:1,none:1}},wbr:{}},h=Object.keys(c),u=function(){};(function(){this.getCompletions=function(e,t,i,o){var r=t.getTokenAt(i.row,i.column);if(!r)return[];if(n(r,"tag-name")||n(r,"tag-open")||n(r,"end-tag-open"))return this.getTagCompletions(e,t,i,o);if(n(r,"tag-whitespace")||n(r,"attribute-name"))return this.getAttributeCompletions(e,t,i,o);if(n(r,"attribute-value"))return this.getAttributeValueCompletions(e,t,i,o);var s=t.getLine(i.row).substr(0,i.column);return/&[a-z]*$/i.test(s)?this.getHTMLEntityCompletions(e,t,i,o):[]},this.getTagCompletions=function(){return h.map(function(e){return{value:e,meta:"tag",score:1e6}})},this.getAttributeCompletions=function(e,t,n){var o=i(t,n);if(!o)return[];var r=l;return o in c&&(r=r.concat(Object.keys(c[o]))),r.map(function(e){return{caption:e,snippet:e+'="$0"',meta:"attribute",score:1e6}})},this.getAttributeValueCompletions=function(e,t,n){var r=i(t,n),s=o(t,n);if(!r)return[];var a=[];return r in c&&s in c[r]&&"object"==typeof c[r][s]&&(a=Object.keys(c[r][s])),a.map(function(e){return{caption:e,snippet:e,meta:"attribute value",score:1e6}})},this.getHTMLEntityCompletions=function(){return["Aacute;","aacute;","Acirc;","acirc;","acute;","AElig;","aelig;","Agrave;","agrave;","alefsym;","Alpha;","alpha;","amp;","and;","ang;","Aring;","aring;","asymp;","Atilde;","atilde;","Auml;","auml;","bdquo;","Beta;","beta;","brvbar;","bull;","cap;","Ccedil;","ccedil;","cedil;","cent;","Chi;","chi;","circ;","clubs;","cong;","copy;","crarr;","cup;","curren;","Dagger;","dagger;","dArr;","darr;","deg;","Delta;","delta;","diams;","divide;","Eacute;","eacute;","Ecirc;","ecirc;","Egrave;","egrave;","empty;","emsp;","ensp;","Epsilon;","epsilon;","equiv;","Eta;","eta;","ETH;","eth;","Euml;","euml;","euro;","exist;","fnof;","forall;","frac12;","frac14;","frac34;","frasl;","Gamma;","gamma;","ge;","gt;","hArr;","harr;","hearts;","hellip;","Iacute;","iacute;","Icirc;","icirc;","iexcl;","Igrave;","igrave;","image;","infin;","int;","Iota;","iota;","iquest;","isin;","Iuml;","iuml;","Kappa;","kappa;","Lambda;","lambda;","lang;","laquo;","lArr;","larr;","lceil;","ldquo;","le;","lfloor;","lowast;","loz;","lrm;","lsaquo;","lsquo;","lt;","macr;","mdash;","micro;","middot;","minus;","Mu;","mu;","nabla;","nbsp;","ndash;","ne;","ni;","not;","notin;","nsub;","Ntilde;","ntilde;","Nu;","nu;","Oacute;","oacute;","Ocirc;","ocirc;","OElig;","oelig;","Ograve;","ograve;","oline;","Omega;","omega;","Omicron;","omicron;","oplus;","or;","ordf;","ordm;","Oslash;","oslash;","Otilde;","otilde;","otimes;","Ouml;","ouml;","para;","part;","permil;","perp;","Phi;","phi;","Pi;","pi;","piv;","plusmn;","pound;","Prime;","prime;","prod;","prop;","Psi;","psi;","quot;","radic;","rang;","raquo;","rArr;","rarr;","rceil;","rdquo;","real;","reg;","rfloor;","Rho;","rho;","rlm;","rsaquo;","rsquo;","sbquo;","Scaron;","scaron;","sdot;","sect;","shy;","Sigma;","sigma;","sigmaf;","sim;","spades;","sub;","sube;","sum;","sup;","sup1;","sup2;","sup3;","supe;","szlig;","Tau;","tau;","there4;","Theta;","theta;","thetasym;","thinsp;","THORN;","thorn;","tilde;","times;","trade;","Uacute;","uacute;","uArr;","uarr;","Ucirc;","ucirc;","Ugrave;","ugrave;","uml;","upsih;","Upsilon;","upsilon;","Uuml;","uuml;","weierp;","Xi;","xi;","Yacute;","yacute;","yen;","Yuml;","yuml;","Zeta;","zeta;","zwj;","zwnj;"].map(function(e){return{caption:e,snippet:e,meta:"html entity",score:1e6}})}}).call(u.prototype),t.HtmlCompletions=u}),ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("../lib/lang"),o=e("./text").Mode,r=e("./javascript").Mode,s=e("./css").Mode,a=e("./html_highlight_rules").HtmlHighlightRules,l=e("./behaviour/xml").XmlBehaviour,c=e("./folding/html").FoldMode,h=e("./html_completions").HtmlCompletions,u=e("../worker/worker_client").WorkerClient,d=["area","base","br","col","embed","hr","img","input","keygen","link","meta","menuitem","param","source","track","wbr"],g=["li","dt","dd","p","rt","rp","optgroup","option","colgroup","td","th"],p=function(e){this.fragmentContext=e&&e.fragmentContext,this.HighlightRules=a,this.$behaviour=new l,this.$completer=new h,this.createModeDelegates({"js-":r,"css-":s}),this.foldingRules=new c(this.voidElements,i.arrayToMap(g))};n.inherits(p,o),function(){this.blockComment={start:"<!--",end:"-->"},this.voidElements=i.arrayToMap(d),this.getNextLineIndent=function(e,t){return this.$getIndent(t)},this.checkOutdent=function(){return!1},this.getCompletions=function(e,t,n,i){return this.$completer.getCompletions(e,t,n,i)},this.createWorker=function(e){if(this.constructor==p){var t=new u(["ace"],"ace/mode/html_worker","Worker");return t.attachToDocument(e.getDocument()),this.fragmentContext&&t.call("setOptions",[{context:this.fragmentContext}]),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t}},this.$id="ace/mode/html"}.call(p.prototype),t.Mode=p}),ace.define("ace/mode/markdown_highlight_rules",["require","exports","module","ace/config","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/html_highlight_rules"],function(e,t){"use strict";var n=e("../config").$modes,i=e("../lib/oop"),o=e("../lib/lang"),r=e("./text_highlight_rules").TextHighlightRules,s=e("./html_highlight_rules").HtmlHighlightRules,a=function(e){return"(?:[^"+o.escapeRegExp(e)+"\\\\]|\\\\.)*"},l=function(){s.call(this);var e={token:"support.function",regex:/^\s*(```+[^`]*|~~~+[^~]*)$/,onMatch:function(e,t,i){var o=e.match(/^(\s*)([`~]+)(.*)/),r=/[\w-]+|$/.exec(o[3])[0];return n[r]||(r=""),i.unshift("githubblock",[],[o[1],o[2],r],t),this.token},next:"githubblock"},t=[{token:"support.function",regex:".*",onMatch:function(e,t,i){var o=i[1],r=i[2][0],s=i[2][1],a=i[2][2],l=/^(\s*)(`+|~+)\s*$/.exec(e);if(l&&l[1].length<r.length+3&&l[2].length>=s.length&&l[2][0]==s[0])return i.splice(0,3),this.next=i.shift(),this.token;if(this.next="",a&&n[a]){var c=n[a].getTokenizer().getLineTokens(e,o.slice(0));return i[1]=c.state,c.tokens}return this.token}}];this.$rules.start.unshift({token:"empty_line",regex:"^$",next:"allowBlock"},{token:"markup.heading.1",regex:"^=+(?=\\s*$)"},{token:"markup.heading.2",regex:"^\\-+(?=\\s*$)"},{token:function(e){return"markup.heading."+e.length},regex:/^#{1,6}(?=\s|$)/,next:"header"},e,{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{token:"constant",regex:"^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",next:"allowBlock"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic"}),this.addRules({basic:[{token:"constant.language.escape",regex:/\\[\\`*_{}\[\]()#+\-.!]/},{token:"support.function",regex:"(`+)(.*?[^`])(\\1)"},{token:["text","constant","text","url","string","text"],regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},{token:["text","string","text","constant","text"],regex:"(\\[)("+a("]")+")(\\]\\s*\\[)("+a("]")+")(\\])"},{token:["text","string","text","markup.underline","string","text"],regex:"(\\!?\\[)("+a("]")+')(\\]\\()((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)(\\s*"'+a('"')+'"\\s*)?(\\))'},{token:"string.strong",regex:"([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"},{token:"string.emphasis",regex:"([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"},{token:["text","url","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"}],allowBlock:[{token:"support.function",regex:"^ {4}.+",next:"allowBlock"},{token:"empty_line",regex:"^$",next:"allowBlock"},{token:"empty",regex:"",next:"start"}],header:[{regex:"$",next:"start"},{include:"basic"},{defaultToken:"heading"}],"listblock-start":[{token:"support.variable",regex:/(?:\[[ x]\])?/,next:"listblock"}],listblock:[{token:"empty_line",regex:"^$",next:"start"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic",noEscape:!0},e,{defaultToken:"list"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{include:"basic",noEscape:!0},{defaultToken:"string.blockquote"}],githubblock:t}),this.normalizeRules()};i.inherits(l,r),t.MarkdownHighlightRules=l}),ace.define("ace/mode/folding/markdown",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t){"use strict";var n=e("../../lib/oop"),i=e("./fold_mode").FoldMode,o=e("../../range").Range,r=t.FoldMode=function(){};n.inherits(r,i),function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/,this.getFoldWidget=function(e,t,n){var i=e.getLine(n);return this.foldingStartMarker.test(i)?"`"==i[0]&&"start"==e.bgTokenizer.getState(n)?"end":"start":""},this.getFoldWidgetRange=function(e,t,n){function i(t){return(u=e.getTokens(t)[0])&&0===u.type.lastIndexOf(d,0)}function r(){var e=u.value[0];return"="==e?6:"-"==e?5:7-u.value.search(/[^#]|$/)}var s=e.getLine(n),a=s.length,l=e.getLength(),c=n,h=n;if(s.match(this.foldingStartMarker)){if("`"==s[0]){if("start"!==e.bgTokenizer.getState(n)){for(;++n<l&&(s=e.getLine(n),!("`"==s[0]&"```"==s.substring(0,3))););return new o(c,a,n,0)}for(;n-- >0&&(s=e.getLine(n),!("`"==s[0]&"```"==s.substring(0,3))););return new o(n,s.length,c,0)}var u,d="markup.heading";if(i(n)){for(var g=r();++n<l;)if(i(n)){var p=r();if(p>=g)break}if((h=n-(u&&-1!=["=","-"].indexOf(u.value[0])?2:1))>c)for(;h>c&&/^\s*$/.test(e.getLine(h));)h--;if(h>c){var f=e.getLine(h).length;return new o(c,a,h,f)}}}}}.call(r.prototype)}),ace.define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,o=t.reservedKeywords="!|{|}|case|do|done|elif|else|esac|fi|for|if|in|then|until|while|&|;|export|local|read|typeset|unset|elif|select|set|function|declare|readonly",r=t.languageConstructs="[|]|alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|dirs|disown|echo|enable|eval|exec|exit|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|return|set|shift|shopt|source|suspend|test|times|trap|type|ulimit|umask|unalias|wait",s=function(){var e=this.createKeywordMapper({keyword:o,"support.function.builtin":r,"invalid.deprecated":"debugger"},"identifier"),t="(?:\\.\\d+)",n="(?:\\d+)",i="(?:(?:"+n+"?"+t+")|(?:"+n+"\\.))",s="(?:(?:"+i+"|"+n+"))",a="(?:"+s+"|"+i+")",l="(?:&"+n+")",c="[a-zA-Z_][a-zA-Z0-9_]*",h="(?:"+c+"(?==))",u="(?:"+c+"\\s*\\(\\))";this.$rules={start:[{token:"constant",regex:/\\./},{token:["text","comment"],regex:/(^|\s)(#.*)$/},{token:"string.start",regex:'"',push:[{token:"constant.language.escape",regex:/\\(?:[$`"\\]|$)/},{include:"variables"},{token:"keyword.operator",regex:/`/},{token:"string.end",regex:'"',next:"pop"},{defaultToken:"string"}]},{token:"string",regex:"\\$'",push:[{token:"constant.language.escape",regex:/\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/},{token:"string",regex:"'",next:"pop"},{defaultToken:"string"}]},{regex:"<<<",token:"keyword.operator"},{stateName:"heredoc",regex:"(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",onMatch:function(e,t,n){var i="-"==e[2]?"indentedHeredoc":"heredoc",o=e.split(this.splitRegex);return n.push(i,o[4]),[{type:"constant",value:o[1]},{type:"text",value:o[2]},{type:"string",value:o[3]},{type:"support.class",value:o[4]},{type:"string",value:o[5]}]},rules:{heredoc:[{onMatch:function(e,t,n){return e===n[1]?(n.shift(),n.shift(),this.next=n[0]||"start","support.class"):(this.next="","string")},regex:".*$",next:"start"}],indentedHeredoc:[{token:"string",regex:"^\t+"},{onMatch:function(e,t,n){return e===n[1]?(n.shift(),n.shift(),this.next=n[0]||"start","support.class"):(this.next="","string")},regex:".*$",next:"start"}]}},{regex:"$",token:"empty",next:function(e,t){return"heredoc"===t[0]||"indentedHeredoc"===t[0]?t[0]:e}},{token:["keyword","text","text","text","variable"],regex:/(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/},{token:"variable.language",regex:"(?:\\$(?:SHLVL|\\$|\\!|\\?))"},{token:"variable",regex:h},{include:"variables"},{token:"support.function",regex:u},{token:"support.function",regex:l},{token:"string",start:"'",end:"'"},{token:"constant.numeric",regex:a},{token:"constant.numeric",regex:"(?:(?:[1-9]\\d*)|(?:0))\\b"},{token:e,regex:"[a-zA-Z_][a-zA-Z0-9_]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"},{token:"punctuation.operator",regex:";"},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]]"},{token:"paren.rparen",regex:"[\\)\\}]",next:"pop"}],variables:[{token:"variable",regex:/(\$)(\w+)/},{token:["variable","paren.lparen"],regex:/(\$)(\()/,push:"start"},{token:["variable","paren.lparen","keyword.operator","variable","keyword.operator"],regex:/(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/,push:"start"},{token:"variable",regex:/\$[*@#?\-$!0_]/},{token:["variable","paren.lparen"],regex:/(\$)(\{)/,push:"start"}]},this.normalizeRules()};n.inherits(s,i),t.ShHighlightRules=s}),ace.define("ace/mode/sh",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sh_highlight_rules","ace/range","ace/mode/folding/cstyle","ace/mode/behaviour/cstyle"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text").Mode,o=e("./sh_highlight_rules").ShHighlightRules,r=e("../range").Range,s=e("./folding/cstyle").FoldMode,a=e("./behaviour/cstyle").CstyleBehaviour,l=function(){this.HighlightRules=o,this.foldingRules=new s,this.$behaviour=new a};n.inherits(l,i),function(){this.lineCommentStart="#",this.getNextLineIndent=function(e,t,n){var i=this.$getIndent(t),o=this.getTokenizer().getLineTokens(t,e),r=o.tokens;if(r.length&&"comment"==r[r.length-1].type)return i;if("start"==e){t.match(/^.*[\{\(\[:]\s*$/)&&(i+=n)}return i};var e={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(t,n,i){if("\r\n"!==i&&"\r"!==i&&"\n"!==i)return!1;var o=this.getTokenizer().getLineTokens(n.trim(),t).tokens;if(!o)return!1;do{var r=o.pop()}while(r&&("comment"==r.type||"text"==r.type&&r.value.match(/^\s+$/)));return!!r&&("keyword"==r.type&&e[r.value])},this.autoOutdent=function(e,t,n){n+=1;var i=this.$getIndent(t.getLine(n)),o=t.getTabString();i.slice(-o.length)==o&&t.remove(new r(n,i.length-o.length,n,i.length))},this.$id="ace/mode/sh"}.call(l.prototype),t.Mode=l}),ace.define("ace/mode/markdown",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/html","ace/mode/markdown_highlight_rules","ace/mode/folding/markdown","ace/mode/javascript","ace/mode/html","ace/mode/sh","ace/mode/sh","ace/mode/xml","ace/mode/css"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text").Mode,o=(e("./javascript").Mode,e("./xml").Mode,e("./html").Mode,e("./markdown_highlight_rules").MarkdownHighlightRules),r=e("./folding/markdown").FoldMode,s=function(){this.HighlightRules=o,this.createModeDelegates({javascript:e("./javascript").Mode,html:e("./html").Mode,bash:e("./sh").Mode,sh:e("./sh").Mode,xml:e("./xml").Mode,css:e("./css").Mode}),this.foldingRules=new r,this.$behaviour=this.$defaultBehaviour};n.inherits(s,i),function(){this.type="text",this.blockComment={start:"<!--",end:"-->"},this.$quotes={'"':'"',"`":"`"},this.getNextLineIndent=function(e,t){if("listblock"==e){var n=/^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(t);if(!n)return"";var i=n[2];return i||(i=parseInt(n[3],10)+1+"."),n[1]+i+n[4]}return this.$getIndent(t)},this.$id="ace/mode/markdown"}.call(s.prototype),t.Mode=s}),function(){ace.require(["ace/mode/markdown"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/mode/asciidoc_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,o=function(){function e(e){return(/\w/.test(e)?"\\b":"(?:\\B|^)")+e+"[^"+e+"].*?"+e+"(?![\\w*])"}var t="[a-zA-Z\xa1-\uffff]+\\b";this.$rules={start:[{token:"empty",regex:/$/},{token:"literal",regex:/^\.{4,}\s*$/,next:"listingBlock"},{token:"literal",regex:/^-{4,}\s*$/,next:"literalBlock"},{token:"string",regex:/^\+{4,}\s*$/,next:"passthroughBlock"},{token:"keyword",regex:/^={4,}\s*$/},{token:"text",regex:/^\s*$/},{token:"empty",regex:"",next:"dissallowDelimitedBlock"}],dissallowDelimitedBlock:[{include:"paragraphEnd"},{token:"comment",regex:"^//.+$"},{token:"keyword",regex:"^(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION):"},{include:"listStart"},{token:"literal",regex:/^\s+.+$/,next:"indentedBlock"},{token:"empty",regex:"",next:"text"}],paragraphEnd:[{token:"doc.comment",regex:/^\/{4,}\s*$/,next:"commentBlock"},{token:"tableBlock",regex:/^\s*[|!]=+\s*$/,next:"tableBlock"},{token:"keyword",regex:/^(?:--|''')\s*$/,next:"start"},{token:"option",regex:/^\[.*\]\s*$/,next:"start"},{token:"pageBreak",regex:/^>{3,}$/,next:"start"},{token:"literal",regex:/^\.{4,}\s*$/,next:"listingBlock"},{token:"titleUnderline",regex:/^(?:={2,}|-{2,}|~{2,}|\^{2,}|\+{2,})\s*$/,next:"start"},{token:"singleLineTitle",regex:/^={1,5}\s+\S.*$/,next:"start"},{token:"otherBlock",regex:/^(?:\*{2,}|_{2,})\s*$/,next:"start"},{token:"optionalTitle",regex:/^\.[^.\s].+$/,next:"start"}],listStart:[{token:"keyword",regex:/^\s*(?:\d+\.|[a-zA-Z]\.|[ixvmIXVM]+\)|\*{1,5}|-|\.{1,5})\s/,next:"listText"},{token:"meta.tag",regex:/^.+(?::{2,4}|;;)(?: |$)/,next:"listText"},{token:"support.function.list.callout",regex:/^(?:<\d+>|\d+>|>) /,next:"text"},{token:"keyword",regex:/^\+\s*$/,next:"start"}],text:[{token:["link","variable.language"],regex:/((?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+)(\[.*?\])/},{token:"link",regex:/(?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+/},{token:"link",regex:/\b[\w\.\/\-]+@[\w\.\/\-]+\b/},{include:"macros"},{include:"paragraphEnd"},{token:"literal",regex:/\+{3,}/,next:"smallPassthrough"},{token:"escape",regex:/\((?:C|TM|R)\)|\.{3}|->|<-|=>|<=|&#(?:\d+|x[a-fA-F\d]+);|(?: |^)--(?=\s+\S)/},{token:"escape",regex:/\\[_*'`+#]|\\{2}[_*'`+#]{2}/},{token:"keyword",regex:/\s\+$/},{token:"text",regex:t},{token:["keyword","string","keyword"],regex:/(<<[\w\d\-$]+,)(.*?)(>>|$)/},{token:"keyword",regex:/<<[\w\d\-$]+,?|>>/},{token:"constant.character",regex:/\({2,3}.*?\){2,3}/},{token:"keyword",regex:/\[\[.+?\]\]/},{token:"support",regex:/^\[{3}[\w\d =\-]+\]{3}/},{include:"quotes"},{token:"empty",regex:/^\s*$/,next:"start"}],listText:[{include:"listStart"},{include:"text"}],indentedBlock:[{token:"literal",regex:/^[\s\w].+$/,next:"indentedBlock"},{token:"literal",regex:"",next:"start"}],listingBlock:[{token:"literal",regex:/^\.{4,}\s*$/,next:"dissallowDelimitedBlock"},{token:"constant.numeric",regex:"<\\d+>"},{token:"literal",regex:"[^<]+"},{token:"literal",regex:"<"}],literalBlock:[{token:"literal",regex:/^-{4,}\s*$/,next:"dissallowDelimitedBlock"},{token:"constant.numeric",regex:"<\\d+>"},{token:"literal",regex:"[^<]+"},{token:"literal",regex:"<"}],passthroughBlock:[{token:"literal",regex:/^\+{4,}\s*$/,next:"dissallowDelimitedBlock"},{token:"literal",regex:t+"|\\d+"},{include:"macros"},{token:"literal",regex:"."}],smallPassthrough:[{token:"literal",regex:/[+]{3,}/,next:"dissallowDelimitedBlock"},{token:"literal",regex:/^\s*$/,next:"dissallowDelimitedBlock"},{token:"literal",regex:t+"|\\d+"},{include:"macros"}],commentBlock:[{token:"doc.comment",regex:/^\/{4,}\s*$/,next:"dissallowDelimitedBlock"},{token:"doc.comment",regex:"^.*$"}],tableBlock:[{token:"tableBlock",regex:/^\s*\|={3,}\s*$/,next:"dissallowDelimitedBlock"},{token:"tableBlock",regex:/^\s*!={3,}\s*$/,next:"innerTableBlock"},{token:"tableBlock",regex:/\|/},{include:"text",noEscape:!0}],innerTableBlock:[{token:"tableBlock",regex:/^\s*!={3,}\s*$/,next:"tableBlock"},{token:"tableBlock",regex:/^\s*|={3,}\s*$/,next:"dissallowDelimitedBlock"},{token:"tableBlock",regex:/!/}],macros:[{token:"macro",regex:/{[\w\-$]+}/},{token:["text","string","text","constant.character","text"],regex:/({)([\w\-$]+)(:)?(.+)?(})/},{token:["text","markup.list.macro","keyword","string"],regex:/(\w+)(footnote(?:ref)?::?)([^\s\[]+)?(\[.*?\])?/},{token:["markup.list.macro","keyword","string"],regex:/([a-zA-Z\-][\w\.\/\-]*::?)([^\s\[]+)(\[.*?\])?/},{token:["markup.list.macro","keyword"],regex:/([a-zA-Z\-][\w\.\/\-]+::?)(\[.*?\])/},{token:"keyword",regex:/^:.+?:(?= |$)/}],quotes:[{token:"string.italic",regex:/__[^_\s].*?__/},{token:"string.italic",regex:e("_")},{token:"keyword.bold",regex:/\*\*[^*\s].*?\*\*/},{token:"keyword.bold",regex:e("\\*")},{token:"literal",regex:e("\\+")},{token:"literal",regex:/\+\+[^+\s].*?\+\+/},{token:"literal",regex:/\$\$.+?\$\$/},{token:"literal",regex:e("`")},{token:"keyword",regex:e("^")},{token:"keyword",regex:e("~")},{token:"keyword",regex:/##?/},{token:"keyword",regex:/(?:\B|^)``|\b''/}]};var n={macro:"constant.character",tableBlock:"doc.comment",titleUnderline:"markup.heading",singleLineTitle:"markup.heading",pageBreak:"string",option:"string.regexp",otherBlock:"markup.list",literal:"support.function",optionalTitle:"constant.numeric",escape:"constant.language.escape",link:"markup.underline.list"};for(var i in this.$rules)for(var o=this.$rules[i],r=o.length;r--;){var s=o[r];if(s.include||"string"==typeof s){var a=[r,1].concat(this.$rules[s.include||s]);s.noEscape&&(a=a.filter(function(e){return!e.next})),o.splice.apply(o,a)}else s.token in n&&(s.token=n[s.token])}};n.inherits(o,i),t.AsciidocHighlightRules=o}),ace.define("ace/mode/folding/asciidoc",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t){"use strict";var n=e("../../lib/oop"),i=e("./fold_mode").FoldMode,o=e("../../range").Range,r=t.FoldMode=function(){};n.inherits(r,i),function(){this.foldingStartMarker=/^(?:\|={10,}|[\.\/=\-~^+]{4,}\s*$|={1,5} )/,this.singleLineHeadingRe=/^={1,5}(?=\s+\S)/,this.getFoldWidget=function(e,t,n){var i=e.getLine(n)
15
- ;return this.foldingStartMarker.test(i)?"="==i[0]?this.singleLineHeadingRe.test(i)?"start":e.getLine(n-1).length!=e.getLine(n).length?"":"start":"dissallowDelimitedBlock"==e.bgTokenizer.getState(n)?"end":"start":""},this.getFoldWidgetRange=function(e,t,n){function i(t){return(u=e.getTokens(t)[0])&&u.type}function r(){var t=u.value.match(p);if(t)return t[0].length;var i=d.indexOf(u.value[0])+1;return 1==i&&e.getLine(n-1).length!=e.getLine(n).length?Infinity:i}var s=e.getLine(n),a=s.length,l=e.getLength(),c=n,h=n;if(s.match(this.foldingStartMarker)){var u,d=["=","-","~","^","+"],g="markup.heading",p=this.singleLineHeadingRe;if(i(n)==g){for(var f=r();++n<l;)if(i(n)==g){var m=r();if(m<=f)break}if((h=u&&u.value.match(this.singleLineHeadingRe)?n-1:n-2)>c)for(;h>c&&(!i(h)||"["==u.value[0]);)h--;if(h>c){var v=e.getLine(h).length;return new o(c,a,h,v)}}else{if("dissallowDelimitedBlock"==e.bgTokenizer.getState(n)){for(;n-- >0&&-1!=e.bgTokenizer.getState(n).lastIndexOf("Block"););if((h=n+1)<c){var v=e.getLine(n).length;return new o(h,5,c,a-5)}}else{for(;++n<l&&"dissallowDelimitedBlock"!=e.bgTokenizer.getState(n););if((h=n)>c){var v=e.getLine(n).length;return new o(c,5,h,v-5)}}}}}}.call(r.prototype)}),ace.define("ace/mode/asciidoc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/asciidoc_highlight_rules","ace/mode/folding/asciidoc"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text").Mode,o=e("./asciidoc_highlight_rules").AsciidocHighlightRules,r=e("./folding/asciidoc").FoldMode,s=function(){this.HighlightRules=o,this.foldingRules=new r};n.inherits(s,i),function(){this.type="text",this.getNextLineIndent=function(e,t){if("listblock"==e){var n=/^((?:.+)?)([-+*][ ]+)/.exec(t);return n?new Array(n[1].length+1).join(" ")+n[2]:""}return this.$getIndent(t)},this.$id="ace/mode/asciidoc"}.call(s.prototype),t.Mode=s}),function(){ace.require(["ace/mode/asciidoc"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),function(){ace.require(["ace/mode/text"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/mode/latex_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,o=function(){this.$rules={start:[{token:"comment",regex:"%.*$"},{token:["keyword","lparen","variable.parameter","rparen","lparen","storage.type","rparen"],regex:"(\\\\(?:documentclass|usepackage|input))(?:(\\[)([^\\]]*)(\\]))?({)([^}]*)(})"},{token:["keyword","lparen","variable.parameter","rparen"],regex:"(\\\\(?:label|v?ref|cite(?:[^{]*)))(?:({)([^}]*)(}))?"},{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\begin)({)(verbatim)(})",next:"verbatim"},{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\begin)({)(lstlisting)(})",next:"lstlisting"},{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\(?:begin|end))({)([\\w*]*)(})"},{token:"storage.type",regex:/\\verb\b\*?/,next:[{token:["keyword.operator","string","keyword.operator"],regex:"(.)(.*?)(\\1|$)|",next:"start"}]},{token:"storage.type",regex:"\\\\[a-zA-Z]+"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"constant.character.escape",regex:"\\\\[^a-zA-Z]?"},{token:"string",regex:"\\${1,2}",next:"equation"}],equation:[{token:"comment",regex:"%.*$"},{token:"string",regex:"\\${1,2}",next:"start"},{token:"constant.character.escape",regex:"\\\\(?:[^a-zA-Z]|[a-zA-Z]+)"},{token:"error",regex:"^\\s*$",next:"start"},{defaultToken:"string"}],verbatim:[{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\end)({)(verbatim)(})",next:"start"},{defaultToken:"text"}],lstlisting:[{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\end)({)(lstlisting)(})",next:"start"},{defaultToken:"text"}]},this.normalizeRules()};n.inherits(o,i),t.LatexHighlightRules=o}),ace.define("ace/mode/rdoc_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/latex_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=(e("../lib/lang"),e("./text_highlight_rules").TextHighlightRules),o=(e("./latex_highlight_rules"),function(){this.$rules={start:[{token:"comment",regex:"%.*$"},{token:"text",regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b",next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell.text",regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell.text",regex:"\\s+"},{token:"nospell.text",regex:"\\w+"}]}});n.inherits(o,i),t.RDocHighlightRules=o}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t){"use strict";var n=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var i=e.getLine(t),o=i.match(/^(\s*\})/);if(!o)return 0;var r=o[1].length,s=e.findMatchingBracket({row:t,column:r});if(!s||s.row==t)return 0;var a=this.$getIndent(e.getLine(s.row));e.replace(new n(t,0,t,r-1),a)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/rdoc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/rdoc_highlight_rules","ace/mode/matching_brace_outdent"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text").Mode,o=e("./rdoc_highlight_rules").RDocHighlightRules,r=e("./matching_brace_outdent").MatchingBraceOutdent,s=function(){this.HighlightRules=o,this.$outdent=new r,this.$behaviour=this.$defaultBehaviour};n.inherits(s,i),function(){this.getNextLineIndent=function(e,t){return this.$getIndent(t)},this.$id="ace/mode/rdoc"}.call(s.prototype),t.Mode=s}),function(){ace.require(["ace/mode/rdoc"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/mode/textile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,o=function(){this.$rules={start:[{token:function(e){return"h"==e.charAt(0)?"markup.heading."+e.charAt(1):"markup.heading"},regex:"h1|h2|h3|h4|h5|h6|bq|p|bc|pre",next:"blocktag"},{token:"keyword",regex:"[\\*]+|[#]+"},{token:"text",regex:".+"}],blocktag:[{token:"keyword",regex:"\\. ",next:"start"},{token:"keyword",regex:"\\(",next:"blocktagproperties"}],blocktagproperties:[{token:"keyword",regex:"\\)",next:"blocktag"},{token:"string",regex:"[a-zA-Z0-9\\-_]+"},{token:"keyword",regex:"#"}]}};n.inherits(o,i),t.TextileHighlightRules=o}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t){"use strict";var n=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var i=e.getLine(t),o=i.match(/^(\s*\})/);if(!o)return 0;var r=o[1].length,s=e.findMatchingBracket({row:t,column:r});if(!s||s.row==t)return 0;var a=this.$getIndent(e.getLine(s.row));e.replace(new n(t,0,t,r-1),a)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/textile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/textile_highlight_rules","ace/mode/matching_brace_outdent"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text").Mode,o=e("./textile_highlight_rules").TextileHighlightRules,r=e("./matching_brace_outdent").MatchingBraceOutdent,s=function(){this.HighlightRules=o,this.$outdent=new r,this.$behaviour=this.$defaultBehaviour};n.inherits(s,i),function(){this.type="text",this.getNextLineIndent=function(e,t,n){return"intag"==e?n:""},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/textile"}.call(s.prototype),t.Mode=s}),function(){ace.require(["ace/mode/textile"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/mode/rst_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=(e("../lib/lang"),e("./text_highlight_rules").TextHighlightRules),o=function(){var e={title:"markup.heading",list:"markup.heading",table:"constant",directive:"keyword.operator",entity:"string",link:"markup.underline.list",bold:"markup.bold",italic:"markup.italic",literal:"support.function",comment:"comment"},t="(^|\\s|[\"'(<\\[{\\-/:])",n="(?:$|(?=\\s|[\\\\.,;!?\\-/:\"')>\\]}]))";this.$rules={start:[{token:e.title,regex:"(^)([\\=\\-`:\\.'\"~\\^_\\*\\+#])(\\2{2,}\\s*$)"},{token:["text",e.directive,e.literal],regex:"(^\\s*\\.\\. )([^: ]+::)(.*$)",next:"codeblock"},{token:e.directive,regex:"::$",next:"codeblock"},{token:[e.entity,e.link],regex:"(^\\.\\. _[^:]+:)(.*$)"},{token:[e.entity,e.link],regex:"(^__ )(https?://.*$)"},{token:e.entity,regex:"^\\.\\. \\[[^\\]]+\\] "},{token:e.comment,regex:"^\\.\\. .*$",next:"comment"},{token:e.list,regex:"^\\s*[\\*\\+-] "},{token:e.list,regex:"^\\s*(?:[A-Za-z]|[0-9]+|[ivxlcdmIVXLCDM]+)\\. "},{token:e.list,regex:"^\\s*\\(?(?:[A-Za-z]|[0-9]+|[ivxlcdmIVXLCDM]+)\\) "},{token:e.table,regex:"^={2,}(?: +={2,})+$"},{token:e.table,regex:"^\\+-{2,}(?:\\+-{2,})+\\+$"},{token:e.table,regex:"^\\+={2,}(?:\\+={2,})+\\+$"},{token:["text",e.literal],regex:t+"(``)(?=\\S)",next:"code"},{token:["text",e.bold],regex:t+"(\\*\\*)(?=\\S)",next:"bold"},{token:["text",e.italic],regex:t+"(\\*)(?=\\S)",next:"italic"},{token:e.entity,regex:"\\|[\\w\\-]+?\\|"},{token:e.entity,regex:":[\\w-:]+:`\\S",next:"entity"},{token:["text",e.entity],regex:t+"(_`)(?=\\S)",next:"entity"},{token:e.entity,regex:"_[A-Za-z0-9\\-]+?"},{token:["text",e.link],regex:t+"(`)(?=\\S)",next:"link"},{token:e.link,regex:"[A-Za-z0-9\\-]+?__?"},{token:e.link,regex:"\\[[^\\]]+?\\]_"},{token:e.link,regex:"https?://\\S+"},{token:e.table,regex:"\\|"}],codeblock:[{token:e.literal,regex:"^ +.+$",next:"codeblock"},{token:e.literal,regex:"^$",next:"codeblock"},{token:"empty",regex:"",next:"start"}],code:[{token:e.literal,regex:"\\S``"+n,next:"start"},{defaultToken:e.literal}],bold:[{token:e.bold,regex:"\\S\\*\\*"+n,next:"start"},{defaultToken:e.bold}],italic:[{token:e.italic,regex:"\\S\\*"+n,next:"start"},{defaultToken:e.italic}],entity:[{token:e.entity,regex:"\\S`"+n,next:"start"},{defaultToken:e.entity}],link:[{token:e.link,regex:"\\S`__?"+n,next:"start"},{defaultToken:e.link}],comment:[{token:e.comment,regex:"^ +.+$",next:"comment"},{token:e.comment,regex:"^$",next:"comment"},{token:"empty",regex:"",next:"start"}]}};n.inherits(o,i),t.RSTHighlightRules=o}),ace.define("ace/mode/rst",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/rst_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text").Mode,o=e("./rst_highlight_rules").RSTHighlightRules,r=function(){this.HighlightRules=o};n.inherits(r,i),function(){this.type="text",this.$id="ace/mode/rst"}.call(r.prototype),t.Mode=r}),function(){ace.require(["ace/mode/rst"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/mode/latex_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,o=function(){this.$rules={start:[{token:"comment",regex:"%.*$"},{token:["keyword","lparen","variable.parameter","rparen","lparen","storage.type","rparen"],regex:"(\\\\(?:documentclass|usepackage|input))(?:(\\[)([^\\]]*)(\\]))?({)([^}]*)(})"},{token:["keyword","lparen","variable.parameter","rparen"],regex:"(\\\\(?:label|v?ref|cite(?:[^{]*)))(?:({)([^}]*)(}))?"},{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\begin)({)(verbatim)(})",next:"verbatim"},{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\begin)({)(lstlisting)(})",next:"lstlisting"},{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\(?:begin|end))({)([\\w*]*)(})"},{token:"storage.type",regex:/\\verb\b\*?/,next:[{token:["keyword.operator","string","keyword.operator"],regex:"(.)(.*?)(\\1|$)|",next:"start"}]},{token:"storage.type",regex:"\\\\[a-zA-Z]+"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"constant.character.escape",regex:"\\\\[^a-zA-Z]?"},{token:"string",regex:"\\${1,2}",next:"equation"}],equation:[{token:"comment",regex:"%.*$"},{token:"string",regex:"\\${1,2}",next:"start"},{token:"constant.character.escape",regex:"\\\\(?:[^a-zA-Z]|[a-zA-Z]+)"},{token:"error",regex:"^\\s*$",next:"start"},{defaultToken:"string"}],verbatim:[{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\end)({)(verbatim)(})",next:"start"},{defaultToken:"text"}],lstlisting:[{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\end)({)(lstlisting)(})",next:"start"},{defaultToken:"text"}]},this.normalizeRules()};n.inherits(o,i),t.LatexHighlightRules=o}),ace.define("ace/mode/folding/latex",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"],function(e,t){"use strict";var n=e("../../lib/oop"),i=e("./fold_mode").FoldMode,o=e("../../range").Range,r=e("../../token_iterator").TokenIterator,s={"\\subparagraph":1,"\\paragraph":2,"\\subsubsubsection":3,"\\subsubsection":4,"\\subsection":5,"\\section":6,"\\chapter":7,"\\part":8,"\\begin":9,"\\end":10},a=t.FoldMode=function(){};n.inherits(a,i),function(){this.foldingStartMarker=/^\s*\\(begin)|\s*\\(part|chapter|(?:sub)*(?:section|paragraph))\b|{\s*$/,this.foldingStopMarker=/^\s*\\(end)\b|^\s*}/,this.getFoldWidgetRange=function(e,t,n){var i=e.doc.getLine(n),o=this.foldingStartMarker.exec(i);if(o)return o[1]?this.latexBlock(e,n,o[0].length-1):o[2]?this.latexSection(e,n,o[0].length-1):this.openingBracketBlock(e,"{",n,o.index);var o=this.foldingStopMarker.exec(i);return o?o[1]?this.latexBlock(e,n,o[0].length-1):this.closingBracketBlock(e,"}",n,o.index+o[0].length):void 0},this.latexBlock=function(e,t,n,i){var s={"\\begin":1,"\\end":-1},a=new r(e,t,n),l=a.getCurrentToken();if(l&&("storage.type"==l.type||"constant.character.escape"==l.type)){var c=l.value,h=s[c],u=function(){var e=a.stepForward(),t="lparen"==e.type?a.stepForward().value:"";return-1===h&&(a.stepBackward(),t&&a.stepBackward()),t},d=[u()],g=-1===h?a.getCurrentTokenColumn():e.getLine(t).length,p=t;for(a.step=-1===h?a.stepBackward:a.stepForward;l=a.step();)if(l&&("storage.type"==l.type||"constant.character.escape"==l.type)){var f=s[l.value];if(f){var m=u();if(f===h)d.unshift(m);else if(d.shift()!==m||!d.length)break}}if(!d.length){if(1==h&&(a.stepBackward(),a.stepBackward()),i)return a.getCurrentTokenRange();var t=a.getCurrentTokenRow();return-1===h?new o(t,e.getLine(t).length,p,g):new o(p,g,t,a.getCurrentTokenColumn())}}},this.latexSection=function(e,t,n){var i=new r(e,t,n),a=i.getCurrentToken();if(a&&"storage.type"==a.type){for(var l=s[a.value]||0,c=0,h=t;a=i.stepForward();)if("storage.type"===a.type){var u=s[a.value]||0;if(u>=9){if(c||(h=i.getCurrentTokenRow()-1),(c+=9==u?1:-1)<0)break}else if(u>=l)break}for(c||(h=i.getCurrentTokenRow()-1);h>t&&!/\S/.test(e.getLine(h));)h--;return new o(t,e.getLine(t).length,h,e.getLine(h).length)}}}.call(a.prototype)}),ace.define("ace/mode/latex",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/latex_highlight_rules","ace/mode/behaviour/cstyle","ace/mode/folding/latex"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text").Mode,o=e("./latex_highlight_rules").LatexHighlightRules,r=e("./behaviour/cstyle").CstyleBehaviour,s=e("./folding/latex").FoldMode,a=function(){this.HighlightRules=o,this.foldingRules=new s,this.$behaviour=new r({braces:!0})};n.inherits(a,i),function(){this.type="text",this.lineCommentStart="%",this.$id="ace/mode/latex",this.getMatching=function(e,t,n){t==undefined&&(t=e.selection.lead),"object"==typeof t&&(n=t.column,t=t.row);var i=e.getTokenAt(t,n);if(i)return"\\begin"==i.value||"\\end"==i.value?this.foldingRules.latexBlock(e,t,n,!0):void 0}}.call(a.prototype),t.Mode=a}),function(){ace.require(["ace/mode/latex"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/theme/tomorrow",["require","exports","module","ace/lib/dom"],function(e,t){t.isDark=!1,t.cssClass="ace-tomorrow",t.cssText=".ace-tomorrow .ace_gutter {background: #f6f6f6;color: #4D4D4C}.ace-tomorrow .ace_print-margin {width: 1px;background: #f6f6f6}.ace-tomorrow {background-color: #FFFFFF;color: #4D4D4C}.ace-tomorrow .ace_cursor {color: #AEAFAD}.ace-tomorrow .ace_marker-layer .ace_selection {background: #D6D6D6}.ace-tomorrow.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;}.ace-tomorrow .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-tomorrow .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #D1D1D1}.ace-tomorrow .ace_marker-layer .ace_active-line {background: #EFEFEF}.ace-tomorrow .ace_gutter-active-line {background-color : #dcdcdc}.ace-tomorrow .ace_marker-layer .ace_selected-word {border: 1px solid #D6D6D6}.ace-tomorrow .ace_invisible {color: #D1D1D1}.ace-tomorrow .ace_keyword,.ace-tomorrow .ace_meta,.ace-tomorrow .ace_storage,.ace-tomorrow .ace_storage.ace_type,.ace-tomorrow .ace_support.ace_type {color: #8959A8}.ace-tomorrow .ace_keyword.ace_operator {color: #3E999F}.ace-tomorrow .ace_constant.ace_character,.ace-tomorrow .ace_constant.ace_language,.ace-tomorrow .ace_constant.ace_numeric,.ace-tomorrow .ace_keyword.ace_other.ace_unit,.ace-tomorrow .ace_support.ace_constant,.ace-tomorrow .ace_variable.ace_parameter {color: #F5871F}.ace-tomorrow .ace_constant.ace_other {color: #666969}.ace-tomorrow .ace_invalid {color: #FFFFFF;background-color: #C82829}.ace-tomorrow .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #8959A8}.ace-tomorrow .ace_fold {background-color: #4271AE;border-color: #4D4D4C}.ace-tomorrow .ace_entity.ace_name.ace_function,.ace-tomorrow .ace_support.ace_function,.ace-tomorrow .ace_variable {color: #4271AE}.ace-tomorrow .ace_support.ace_class,.ace-tomorrow .ace_support.ace_type {color: #C99E00}.ace-tomorrow .ace_heading,.ace-tomorrow .ace_markup.ace_heading,.ace-tomorrow .ace_string {color: #718C00}.ace-tomorrow .ace_entity.ace_name.ace_tag,.ace-tomorrow .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow .ace_meta.ace_tag,.ace-tomorrow .ace_string.ace_regexp,.ace-tomorrow .ace_variable {color: #C82829}.ace-tomorrow .ace_comment {color: #8E908C}.ace-tomorrow .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y}",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),function(){ace.require(["ace/theme/tomorrow"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/dom","ace/lib/oop","ace/lib/keys","ace/lib/event","ace/search","ace/lib/useragent","ace/search_highlight","ace/commands/multi_select_commands","ace/mode/text","ace/multi_select"],function(e,t){"use strict";function n(e){return{row:e.line,column:e.ch}}function i(e){return new Rt(e.row,e.column)}function o(e){e.setOption("disableInput",!0),e.setOption("showCursorWhenSelecting",!1),_t.signal(e,"vim-mode-change",{mode:"normal"}),e.on("cursorActivity",ot),S(e),_t.on(e.getInputField(),"paste",h(e))}function r(e){e.setOption("disableInput",!1),e.off("cursorActivity",ot),_t.off(e.getInputField(),"paste",h(e)),e.state.vim=null}function s(e,t){this==_t.keyMap.vim&&_t.rmClass(e.getWrapperElement(),"cm-fat-cursor"),(!t||t.attach!=a)&&r(e)}function a(e,t){this==_t.keyMap.vim&&_t.addClass(e.getWrapperElement(),"cm-fat-cursor"),(!t||t.attach!=a)&&o(e)}function l(e,t){if(!t)return undefined;if(this[e])return this[e];var n=c(e);if(!n)return!1;var i=_t.Vim.findKey(t,n);return"function"==typeof i&&_t.signal(t,"vim-keypress",n),i}function c(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split(/-(?!$)/),n=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==n.length)return!1;for(var i=!1,o=0;o<t.length;o++){var r=t[o];r in Et?t[o]=Et[r]:i=!0,r in Ot&&(t[o]=Ot[r])}return!!i&&(m(n)&&(t[t.length-1]=n.toLowerCase()),"<"+t.join("-")+">")}function h(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(N(e.getCursor(),0,1)),Yt.enterInsertMode(e,{},t))}),t.onPasteFn}function u(e,t){for(var n=[],i=e;i<e+t;i++)n.push(String.fromCharCode(i));return n}function d(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function g(e){return/^[a-z]$/.test(e)}function p(e){return-1!="()[]{}".indexOf(e)}function f(e){return It.test(e)}function m(e){return/^[A-Z]$/.test(e)}function v(e){return/^\s*$/.test(e)}function b(e){return-1!=".?!".indexOf(e)}function w(e,t){for(var n=0;n<t.length;n++)if(t[n]==e)return!0;return!1}function y(e,t,n,i,o){if(t===undefined&&!o)throw Error("defaultValue is required unless callback is provided");if(n||(n="string"),zt[e]={type:n,defaultValue:t,callback:o},i)for(var r=0;r<i.length;r++)zt[i[r]]=zt[e];t&&x(e,t)}function x(e,t,n,i){var o=zt[e];i=i||{};var r=i.scope;if(!o)return new Error("Unknown option: "+e);if("boolean"==o.type){if(t&&!0!==t)return new Error("Invalid argument: "+e+"="+t);!1!==t&&(t=!0)}o.callback?("local"!==r&&o.callback(t,undefined),"global"!==r&&n&&o.callback(t,n)):("local"!==r&&(o.value="boolean"==o.type?!!t:t),"global"!==r&&n&&(n.state.vim.options[e]={value:t}))}function k(e,t,n){var i=zt[e];n=n||{};var o=n.scope;if(!i)return new Error("Unknown option: "+e);{if(!i.callback){var r="global"!==o&&t&&t.state.vim.options[e];return(r||"local"!==o&&i||{}).value}var r=t&&i.callback(undefined,t);if("global"!==o&&r!==undefined)return r;if("local"!==o)return i.callback()}}function C(){this.latestRegister=undefined,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=undefined,this.lastInsertModeChanges=Vt()}function S(e){return e.state.vim||(e.state.vim={inputState:new _,lastEditInputState:undefined,lastEditActionCommand:undefined,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},fakeCursor:null,insertMode:!1,insertModeRepeat:undefined,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{}}),e.state.vim}function $(){Ut={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:undefined,jumpList:Kt(),macroModeState:new C,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new R({}),searchHistoryController:new T,exCommandHistoryController:new T};for(var e in zt){var t=zt[e];t.value=t.defaultValue}}function _(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=null}function A(e,t){e.state.vim.inputState=new _,_t.signal(e,"vim-command-done",t)}function L(e,t,n){this.clear(),this.keyBuffer=[e||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!t,this.blockwise=!!n}function M(e,t){var n=Ut.registerController.registers;if(!e||1!=e.length)throw Error("Register name must be 1 character");n[e]=t,Wt.push(e)}function R(e){this.registers=e,this.unnamedRegister=e['"']=new L,e["."]=new L,e[":"]=new L,e["/"]=new L}function T(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}function E(e,t){Xt[e]=t}function O(e,t){for(var n=[],i=0;i<t;i++)n.push(e);return n}function I(e,t){Qt[e]=t}function F(e,t){Yt[e]=t}function B(e,t,n){var i=Math.min(Math.max(e.firstLine(),t.line),e.lastLine()),o=X(e,i)-1;o=n?o+1:o;var r=Math.min(Math.max(0,t.ch),o);return Rt(i,r)}function H(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function N(e,t,n){return"object"==typeof t&&(n=t.ch,t=t.line),Rt(e.line+t,e.ch+n)}function P(e,t,n,i){for(var o,r=[],s=[],a=0;a<t.length;a++){var l=t[a];"insert"==n&&"insert"!=l.context||l.context&&l.context!=n||i.operator&&"action"==l.type||!(o=D(e,l.keys))||("partial"==o&&r.push(l),"full"==o&&s.push(l))}return{partial:r.length&&r,full:s.length&&s}}function D(e,t){if("<character>"==t.slice(-11)){var n=t.length-11,i=e.slice(0,n),o=t.slice(0,n);return i==o&&e.length>n?"full":0==o.indexOf(i)&&"partial"}return e==t?"full":0==t.indexOf(e)&&"partial"}function W(e){var t=/^.*(<[^>]+>)$/.exec(e),n=t?t[1]:e.slice(-1);if(n.length>1)switch(n){case"<CR>":n="\n";break;case"<Space>":n=" ";break;default:n=""}return n}function z(e,t,n){return function(){for(var i=0;i<n;i++)t(e)}}function K(e){return Rt(e.line,e.ch)}function V(e,t){return e.ch==t.ch&&e.line==t.line}function U(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function G(e,t){return arguments.length>2&&(t=G.apply(undefined,Array.prototype.slice.call(arguments,1))),U(e,t)?e:t}function j(e,t){return arguments.length>2&&(t=j.apply(undefined,Array.prototype.slice.call(arguments,1))),U(e,t)?t:e}function q(e,t,n){var i=U(e,t),o=U(t,n);return i&&o}function X(e,t){return e.getLine(t).length}function Q(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Y(e){return e.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function J(e,t,n){var i=X(e,t),o=new Array(n-i+1).join(" ");e.setCursor(Rt(t,i)),e.replaceRange(o,e.getCursor())}function Z(e,t){var n=[],i=e.listSelections(),o=K(e.clipPos(t)),r=!V(t,o),s=e.getCursor("head"),a=te(i,s),l=V(i[a].head,i[a].anchor),c=i.length-1,h=c-a>a?c:0,u=i[h].anchor,d=Math.min(u.line,o.line),g=Math.max(u.line,o.line),p=u.ch,f=o.ch,m=i[h].head.ch-p,v=f-p;m>0&&v<=0?(p++,r||f--):m<0&&v>=0?(p--,l||f++):m<0&&-1==v&&(p--,f++);for(var b=d;b<=g;b++){var w={anchor:new Rt(b,p),head:new Rt(b,f)};n.push(w)}return e.setSelections(n),t.ch=f,u.ch=p,u}function ee(e,t,n){for(var i=[],o=0;o<n;o++){var r=N(t,o,0);i.push({anchor:r,head:r})}e.setSelections(i,0)}function te(e,t,n){for(var i=0;i<e.length;i++){var o="head"!=n&&V(e[i].anchor,t),r="anchor"!=n&&V(e[i].head,t);if(o||r)return i}return-1}function ne(e,t){var n=t.lastSelection,i=function(){var t=e.listSelections(),n=t[0],i=t[t.length-1];return[U(n.anchor,n.head)?n.anchor:n.head,U(i.anchor,i.head)?i.head:i.anchor]},o=function(){var t=e.getCursor(),i=e.getCursor(),o=n.visualBlock;if(o){var r=o.width,s=o.height;i=Rt(t.line+s,t.ch+r);for(var a=[],l=t.line;l<i.line;l++){var c=Rt(l,t.ch),h=Rt(l,i.ch),u={anchor:c,head:h};a.push(u)}e.setSelections(a)}else{var d=n.anchorMark.find(),g=n.headMark.find(),p=g.line-d.line,f=g.ch-d.ch;i={line:i.line+p,ch:p?i.ch:f+i.ch},n.visualLine&&(t=Rt(t.line,0),i=Rt(i.line,X(e,i.line))),e.setSelection(t,i)}return[t,i]};return t.visualMode?i():o()}function ie(e,t){var n=t.sel.anchor,i=t.sel.head;t.lastPastedText&&(i=e.posFromIndex(e.indexFromPos(n)+t.lastPastedText.length),t.lastPastedText=null),t.lastSelection={anchorMark:e.setBookmark(n),headMark:e.setBookmark(i),anchor:K(n),head:K(i),visualMode:t.visualMode,visualLine:t.visualLine,visualBlock:t.visualBlock}}function oe(e,t,n){var i,o=e.state.vim.sel,r=o.head,s=o.anchor;return U(n,t)&&(i=n,n=t,t=i),U(r,s)?(r=G(t,r),s=j(s,n)):(s=G(t,s),r=j(r,n),r=N(r,0,-1),-1==r.ch&&r.line!=e.firstLine()&&(r=Rt(r.line-1,X(e,r.line-1)))),[s,r]}function re(e,t,n){var i=e.state.vim;t=t||i.sel;var n=n||i.visualLine?"line":i.visualBlock?"block":"char",o=se(e,t,n);e.setSelections(o.ranges,o.primary),rt(e)}function se(e,t,n,i){var o=K(t.head),r=K(t.anchor);if("char"==n){var s=i||U(t.head,t.anchor)?0:1,a=U(t.head,t.anchor)?1:0;return o=N(t.head,0,s),r=N(t.anchor,0,a),{ranges:[{anchor:r,head:o}],primary:0}}if("line"==n){if(U(t.head,t.anchor))o.ch=0,r.ch=X(e,r.line);else{r.ch=0;var l=e.lastLine();o.line>l&&(o.line=l),o.ch=X(e,o.line)}return{ranges:[{anchor:r,head:o}],primary:0}}if("block"==n){for(var c=Math.min(r.line,o.line),h=Math.min(r.ch,o.ch),u=Math.max(r.line,o.line),d=Math.max(r.ch,o.ch)+1,g=u-c+1,p=o.line==c?0:g-1,f=[],m=0;m<g;m++)f.push({anchor:Rt(c+m,h),head:Rt(c+m,d)});return{ranges:f,primary:p}}}function ae(e){var t=e.getCursor("head");return 1==e.getSelection().length&&(t=G(t,e.getCursor("anchor"))),t}function le(e,t){var n=e.state.vim;!1!==t&&e.setCursor(B(e,n.sel.head)),ie(e,n),n.visualMode=!1,n.visualLine=!1,n.visualBlock=!1,_t.signal(e,"vim-mode-change",{mode:"normal"}),n.fakeCursor&&n.fakeCursor.clear()}function ce(e,t,n){var i=e.getRange(t,n);if(/\n\s*$/.test(i)){var o=i.split("\n");o.pop();for(var r,r=o.pop();o.length>0&&r&&v(r);r=o.pop())n.line--,n.ch=0;r?(n.line--,n.ch=X(e,n.line)):n.ch=0}}function he(e,t,n){t.ch=0,n.ch=0,n.line++}function ue(e){if(!e)return 0;var t=e.search(/\S/);return-1==t?e.length:t}function de(e,t,n,i,o){for(var r=ae(e),s=e.getLine(r.line),a=r.ch,l=o?Ft[0]:Bt[0];!l(s.charAt(a));)if(++a>=s.length)return null;i?l=Bt[0]:(l=Ft[0])(s.charAt(a))||(l=Ft[1]);for(var c=a,h=a;l(s.charAt(c))&&c<s.length;)c++;for(;l(s.charAt(h))&&h>=0;)h--;if(h++,t){for(var u=c;/\s/.test(s.charAt(c))&&c<s.length;)c++;if(u==c){for(var d=h;/\s/.test(s.charAt(h-1))&&h>0;)h--;h||(h=d)}}return{start:Rt(r.line,h),end:Rt(r.line,c)}}function ge(e,t,n){V(t,n)||Ut.jumpList.add(e,t,n)}function pe(e,t){Ut.lastCharacterSearch.increment=e,Ut.lastCharacterSearch.forward=t.forward,Ut.lastCharacterSearch.selectedCharacter=t.selectedCharacter}function fe(e,t,n,i){var o=K(e.getCursor()),r=n?1:-1,s=n?e.lineCount():-1,a=o.ch,l=o.line,c=e.getLine(l),h={lineText:c,nextCh:c.charAt(a),lastCh:null,index:a,symb:i,reverseSymb:(n?{")":"(","}":"{"}:{"(":")","{":"}"})[i],forward:n,depth:0,curMoveThrough:!1},u=Jt[i];if(!u)return o;var d=Zt[u].init,g=Zt[u].isComplete;for(d&&d(h);l!==s&&t;){if(h.index+=r,h.nextCh=h.lineText.charAt(h.index),!h.nextCh){if(l+=r,h.lineText=e.getLine(l)||"",r>0)h.index=0;else{var p=h.lineText.length;h.index=p>0?p-1:0}h.nextCh=h.lineText.charAt(h.index)}g(h)&&(o.line=l,o.ch=h.index,t--)}return h.nextCh||h.curMoveThrough?Rt(l,h.index):o}function me(e,t,n,i,o){var r=t.line,s=t.ch,a=e.getLine(r),l=n?1:-1,c=i?Bt:Ft;if(o&&""==a){if(r+=l,a=e.getLine(r),!d(e,r))return null;s=n?0:a.length}for(;;){if(o&&""==a)return{from:0,to:0,line:r};for(var h=l>0?a.length:-1,u=h,g=h;s!=h;){for(var p=!1,f=0;f<c.length&&!p;++f)if(c[f](a.charAt(s))){for(u=s;s!=h&&c[f](a.charAt(s));)s+=l;if(g=s,p=u!=g,u==t.ch&&r==t.line&&g==u+l)continue;return{from:Math.min(u,g+1),to:Math.max(u,g),line:r}}p||(s+=l)}if(r+=l,!d(e,r))return null;a=e.getLine(r),s=l>0?0:a.length}}function ve(e,t,n,i,o,r){var s=K(t),a=[];(i&&!o||!i&&o)&&n++;for(var l=!i||!o,c=0;c<n;c++){var h=me(e,t,i,r,l);if(!h){var u=X(e,e.lastLine());a.push(i?{line:e.lastLine(),from:u,to:u}:{line:0,from:0,to:0});break}a.push(h),t=Rt(h.line,i?h.to-1:h.from)}var d=a.length!=n,g=a[0],p=a.pop();return i&&!o?(!d&&(g.from!=s.ch||g.line!=s.line)&&(p=a.pop()),Rt(p.line,p.from)):i&&o?Rt(p.line,p.to-1):!i&&o?(!d&&(g.to!=s.ch||g.line!=s.line)&&(p=a.pop()),Rt(p.line,p.to)):Rt(p.line,p.from)}function be(e,t,n,i){for(var o,r=e.getCursor(),s=r.ch,a=0;a<t;a++){if(-1==(o=xe(s,e.getLine(r.line),i,n,!0)))return null;s=o}return Rt(e.getCursor().line,o)}function we(e,t){var n=e.getCursor().line;return B(e,Rt(n,t-1))}function ye(e,t,n,i){w(n,Dt)&&(t.marks[n]&&t.marks[n].clear(),t.marks[n]=e.setBookmark(i))}function xe(e,t,n,i,o){var r;return i?-1!=(r=t.indexOf(n,e+1))&&!o&&(r-=1):-1!=(r=t.lastIndexOf(n,e-1))&&!o&&(r+=1),r}function ke(e,t,n,i,o){function r(t){return!/\S/.test(e.getLine(t))}function s(e,t,n){return n?r(e)!=r(e+t):!r(e)&&r(e+t)}function a(t){i=i>0?1:-1;var n=e.ace.session.getFoldLine(t);n&&t+i>n.start.row&&t+i<n.end.row&&(i=(i>0?n.end.row:n.start.row)-t)}
16
- var l,c,h=t.line,u=e.firstLine(),d=e.lastLine(),g=h;if(i){for(;u<=g&&g<=d&&n>0;)a(g),s(g,i)&&n--,g+=i;return new Rt(g,0)}var p=e.state.vim;if(p.visualLine&&s(h,1,!0)){var f=p.sel.anchor;s(f.line,-1,!0)&&(!o||f.line!=h)&&(h+=1)}var m=r(h);for(g=h;g<=d&&n;g++)s(g,1,!0)&&(!o||r(g)!=m)&&n--;for(c=new Rt(g,0),g>d&&!m?m=!0:o=!1,g=h;g>u&&(o&&r(g)!=m&&g!=h||!s(g,-1,!0));g--);return l=new Rt(g,0),{start:l,end:c}}function Ce(e,t,n,i){function o(e,t){if(t.pos+t.dir<0||t.pos+t.dir>=t.line.length){if(t.ln+=t.dir,!d(e,t.ln))return t.line=null,t.ln=null,t.pos=null,void 0;t.line=e.getLine(t.ln),t.pos=t.dir>0?0:t.line.length-1}else t.pos+=t.dir}function r(e,t,n,i){var r=e.getLine(t),s=""===r,a={line:r,ln:t,pos:n,dir:i},l={ln:a.ln,pos:a.pos},c=""===a.line;for(o(e,a);null!==a.line;){if(l.ln=a.ln,l.pos=a.pos,""===a.line&&!c)return{ln:a.ln,pos:a.pos};if(s&&""!==a.line&&!v(a.line[a.pos]))return{ln:a.ln,pos:a.pos};b(a.line[a.pos])&&!s&&(a.pos===a.line.length-1||v(a.line[a.pos+1]))&&(s=!0),o(e,a)}var r=e.getLine(l.ln);l.pos=0;for(var h=r.length-1;h>=0;--h)if(!v(r[h])){l.pos=h;break}return l}function s(e,t,n,i){var r=e.getLine(t),s={line:r,ln:t,pos:n,dir:i},a={ln:s.ln,pos:null},l=""===s.line;for(o(e,s);null!==s.line;){if(""===s.line&&!l)return null!==a.pos?a:{ln:s.ln,pos:s.pos};if(b(s.line[s.pos])&&null!==a.pos&&(s.ln!==a.ln||s.pos+1!==a.pos))return a;""!==s.line&&!v(s.line[s.pos])&&(l=!1,a={ln:s.ln,pos:s.pos}),o(e,s)}var r=e.getLine(a.ln);a.pos=0;for(var c=0;c<r.length;++c)if(!v(r[c])){a.pos=c;break}return a}for(var a={ln:t.line,pos:t.ch};n>0;)a=i<0?s(e,a.ln,a.pos,i):r(e,a.ln,a.pos,i),n--;return Rt(a.ln,a.pos)}function Se(e,t,n,i){var o,r,s=t,a={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[n],l={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[n],c=e.getLine(s.line).charAt(s.ch),h=c===l?1:0;if(o=e.scanForBracket(Rt(s.line,s.ch+h),-1,undefined,{bracketRegex:a}),r=e.scanForBracket(Rt(s.line,s.ch+h),1,undefined,{bracketRegex:a}),!o||!r)return{start:s,end:s};if(o=o.pos,r=r.pos,o.line==r.line&&o.ch>r.ch||o.line>r.line){var u=o;o=r,r=u}return i?r.ch+=1:o.ch+=1,{start:o,end:r}}function $e(e,t,n,i){var o,r,s,a,l=K(t),c=e.getLine(l.line),h=c.split(""),u=h.indexOf(n);if(l.ch<u?l.ch=u:u<l.ch&&h[l.ch]==n&&(r=l.ch,--l.ch),h[l.ch]!=n||r)for(s=l.ch;s>-1&&!o;s--)h[s]==n&&(o=s+1);else o=l.ch+1;if(o&&!r)for(s=o,a=h.length;s<a&&!r;s++)h[s]==n&&(r=s);return o&&r?(i&&(--o,++r),{start:Rt(l.line,o),end:Rt(l.line,r)}):{start:l,end:l}}function _e(){}function Ae(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new _e)}function Le(e,t,n,i,o){e.openDialog?e.openDialog(t,i,{bottom:!0,value:o.value,onKeyDown:o.onKeyDown,onKeyUp:o.onKeyUp,selectValueOnOpen:!1,onClose:function(){e.state.vim&&(e.state.vim.status="",e.ace.renderer.$loop.schedule(e.ace.renderer.CHANGE_CURSOR))}}):i(prompt(n,""))}function Me(e){return Te(e,"/")}function Re(e){return Ee(e,"/")}function Te(e,t){var n=Ee(e,t)||[];if(!n.length)return[];var i=[];if(0===n[0]){for(var o=0;o<n.length;o++)"number"==typeof n[o]&&i.push(e.substring(n[o]+1,n[o+1]));return i}}function Ee(e,t){t||(t="/");for(var n=!1,i=[],o=0;o<e.length;o++){var r=e.charAt(o);!n&&r==t&&i.push(o),n=!n&&"\\"==r}return i}function Oe(e){for(var t="|(){",n="}",i=!1,o=[],r=-1;r<e.length;r++){var s=e.charAt(r)||"",a=e.charAt(r+1)||"",l=a&&-1!=t.indexOf(a);i?(("\\"!==s||!l)&&o.push(s),i=!1):"\\"===s?(i=!0,a&&-1!=n.indexOf(a)&&(l=!0),(!l||"\\"===a)&&o.push(s)):(o.push(s),l&&"\\"!==a&&o.push("\\"))}return o.join("")}function Ie(e){for(var t=!1,n=[],i=-1;i<e.length;i++){var o=e.charAt(i)||"",r=e.charAt(i+1)||"";en[o+r]?(n.push(en[o+r]),i++):t?(n.push(o),t=!1):"\\"===o?(t=!0,f(r)||"$"===r?n.push("$"):"/"!==r&&"\\"!==r&&n.push("\\")):("$"===o&&n.push("$"),n.push(o),"/"===r&&n.push("\\"))}return n.join("")}function Fe(e){for(var t=new _t.StringStream(e),n=[];!t.eol();){for(;t.peek()&&"\\"!=t.peek();)n.push(t.next());var i=!1;for(var o in tn)if(t.match(o,!0)){i=!0,n.push(tn[o]);break}i||n.push(t.next())}return n.join("")}function Be(e,t,n){if(Ut.registerController.getRegister("/").setText(e),e instanceof RegExp)return e;var i,o,r=Re(e);if(r.length){i=e.substring(0,r[0]);o=-1!=e.substring(r[0]).indexOf("i")}else i=e;return i?(k("pcre")||(i=Oe(i)),n&&(t=/^[^A-Z]*$/.test(i)),new RegExp(i,t||o?"i":undefined)):null}function He(e,t){e.openNotification?e.openNotification('<span style="color: red">'+t+"</span>",{bottom:!0,duration:5e3}):alert(t)}function Ne(e,t){var n='<span style="font-family: monospace; white-space: pre">'+(e||"")+'<input type="text" autocorrect="off" autocapitalize="none" autocomplete="off"></span>';return t&&(n+=' <span style="color: #888">'+t+"</span>"),n}function Pe(e,t){var n=(t.prefix||"")+" "+(t.desc||"");Le(e,Ne(t.prefix,t.desc),n,t.onClose,t)}function De(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var n=["global","multiline","ignoreCase","source"],i=0;i<n.length;i++){var o=n[i];if(e[o]!==t[o])return!1}return!0}return!1}function We(e,t,n,i){if(t){var o=Ae(e),r=Be(t,!!n,!!i);if(r)return Ke(e,r),De(r,o.getQuery())?r:(o.setQuery(r),r)}}function ze(e){if("^"==e.source.charAt(0))var t=!0;return{token:function(n){if(t&&!n.sol())return void n.skipToEnd();var i=n.match(e,!1);if(i)return 0==i[0].length?(n.next(),"searching"):n.sol()||(n.backUp(1),e.exec(n.next()+i[0]))?(n.match(e),"searching"):(n.next(),null);for(;!n.eol()&&(n.next(),!n.match(e,!1)););},query:e}}function Ke(e,t){var n=Ae(e),i=n.getOverlay();i&&t==i.query||(i&&e.removeOverlay(i),i=ze(t),e.addOverlay(i),e.showMatchesOnScrollbar&&(n.getScrollbarAnnotate()&&n.getScrollbarAnnotate().clear(),n.setScrollbarAnnotate(e.showMatchesOnScrollbar(t))),n.setOverlay(i))}function Ve(e,t,n,i){return i===undefined&&(i=1),e.operation(function(){for(var o=e.getCursor(),r=e.getSearchCursor(n,o),s=0;s<i;s++){var a=r.find(t);if(0==s&&a&&V(r.from(),o)&&(a=r.find(t)),!a&&(r=e.getSearchCursor(n,t?Rt(e.lastLine()):Rt(e.firstLine(),0)),!r.find(t)))return}return r.from()})}function Ue(e){var t=Ae(e);e.removeOverlay(Ae(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function Ge(e,t,n){return"number"!=typeof e&&(e=e.line),t instanceof Array?w(e,t):n?e>=t&&e<=n:e==t}function je(e){var t=e.ace.renderer;return{top:t.getFirstFullyVisibleRow(),bottom:t.getLastFullyVisibleRow()}}function qe(e,t,n){var i=t.marks[n];return i&&i.find()}function Xe(e,t,n,i,o,r,s,a,l){function c(){e.operation(function(){for(;!p;)h(),u();d()})}function h(){var t=e.getRange(r.from(),r.to()),n=t.replace(s,a);r.replace(n)}function u(){for(;r.findNext()&&Ge(r.from(),i,o);)if(n||!f||r.from().line!=f.line)return e.scrollIntoView(r.from(),30),e.setSelection(r.from(),r.to()),f=r.from(),p=!1,void 0;p=!0}function d(t){if(t&&t(),e.focus(),f){e.setCursor(f);var n=e.state.vim;n.exMode=!1,n.lastHPos=n.lastHSPos=f.ch}l&&l()}function g(t,n,i){switch(_t.e_stop(t),_t.keyName(t)){case"Y":h(),u();break;case"N":u();break;case"A":var o=l;l=undefined,e.operation(c),l=o;break;case"L":h();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":d(i)}return p&&d(i),!0}e.state.vim.exMode=!0;var p=!1,f=r.from();return u(),p?void He(e,"No matches for "+s.source):t?void Pe(e,{prefix:"replace with <strong>"+a+"</strong> (y/n/a/q/l)",onKeyDown:g}):(c(),void(l&&l()))}function Qe(e){var t=e.state.vim,n=Ut.macroModeState,i=Ut.registerController.getRegister("."),o=n.isPlaying,r=n.lastInsertModeChanges;o||(e.off("change",it),_t.off(e.getInputField(),"keydown",lt)),!o&&t.insertModeRepeat>1&&(ct(e,t,t.insertModeRepeat-1,!0),t.lastEditInputState.repeatOverride=t.insertModeRepeat),delete t.insertModeRepeat,t.insertMode=!1,e.setCursor(e.getCursor().line,e.getCursor().ch-1),e.setOption("keyMap","vim"),e.setOption("disableInput",!0),e.toggleOverwrite(!1),i.setText(r.changes.join("")),_t.signal(e,"vim-mode-change",{mode:"normal"}),n.isRecording&&tt(n)}function Ye(e){At.unshift(e)}function Je(e,t,n,i,o){var r={keys:e,type:t};r[t]=n,r[t+"Args"]=i;for(var s in o)r[s]=o[s];Ye(r)}function Ze(e,t,n,i){var o=Ut.registerController.getRegister(i);if(":"==i)return o.keyBuffer[0]&&sn.processCommand(e,o.keyBuffer[0]),void(n.isPlaying=!1);var r=o.keyBuffer,s=0;n.isPlaying=!0,n.replaySearchQueries=o.searchQueries.slice(0);for(var a=0;a<r.length;a++)for(var l,c,h=r[a];h;)if(l=/<\w+-.+?>|<\w+>|./.exec(h),c=l[0],h=h.substring(l.index+c.length),_t.Vim.handleKey(e,c,"macro"),t.insertMode){var u=o.insertModeChanges[s++].changes;Ut.macroModeState.lastInsertModeChanges.changes=u,ht(e,u,1),Qe(e)}n.isPlaying=!1}function et(e,t){if(!e.isPlaying){var n=e.latestRegister,i=Ut.registerController.getRegister(n);i&&i.pushText(t)}}function tt(e){if(!e.isPlaying){var t=e.latestRegister,n=Ut.registerController.getRegister(t);n&&n.pushInsertModeChanges&&n.pushInsertModeChanges(e.lastInsertModeChanges)}}function nt(e,t){if(!e.isPlaying){var n=e.latestRegister,i=Ut.registerController.getRegister(n);i&&i.pushSearchQuery&&i.pushSearchQuery(t)}}function it(e,t){var n=Ut.macroModeState,i=n.lastInsertModeChanges;if(!n.isPlaying)for(;t;){if(i.expectCursorActivityForChange=!0,i.ignoreCount>1)i.ignoreCount--;else if("+input"==t.origin||"paste"==t.origin||t.origin===undefined){var o=e.listSelections().length;o>1&&(i.ignoreCount=o);var r=t.text.join("\n");i.maybeReset&&(i.changes=[],i.maybeReset=!1),r&&(e.state.overwrite&&!/\n/.test(r)?i.changes.push([r]):i.changes.push(r))}t=t.next}}function ot(e){var t=e.state.vim;if(t.insertMode){var n=Ut.macroModeState;if(n.isPlaying)return;var i=n.lastInsertModeChanges;i.expectCursorActivityForChange?i.expectCursorActivityForChange=!1:i.maybeReset=!0}else e.curOp.isVimOp||st(e,t);t.visualMode&&rt(e)}function rt(e){var t=e.state.vim,n=B(e,K(t.sel.head)),i=N(n,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(n,i,{className:"cm-animate-fat-cursor"})}function st(e,t,n){var i=e.getCursor("anchor"),o=e.getCursor("head");if(t.visualMode&&!e.somethingSelected()?le(e,!1):!t.visualMode&&!t.insertMode&&e.somethingSelected()&&(t.visualMode=!0,t.visualLine=!1,_t.signal(e,"vim-mode-change",{mode:"visual"})),t.visualMode){var r=U(o,i)?0:-1,s=U(o,i)?-1:0;o=N(o,0,r),i=N(i,0,s),t.sel={anchor:i,head:o},ye(e,t,"<",G(o,i)),ye(e,t,">",j(o,i))}else!t.insertMode&&!n&&(t.lastHPos=e.getCursor().ch)}function at(e){this.keyName=e}function lt(e){function t(){return i.maybeReset&&(i.changes=[],i.maybeReset=!1),i.changes.push(new at(o)),!0}var n=Ut.macroModeState,i=n.lastInsertModeChanges,o=_t.keyName(e);o&&(-1!=o.indexOf("Delete")||-1!=o.indexOf("Backspace"))&&_t.lookupKey(o,"vim-insert",t)}function ct(e,t,n,i){function o(){a?qt.processAction(e,t,t.lastEditActionCommand):qt.evalInput(e,t)}function r(n){if(s.lastInsertModeChanges.changes.length>0){n=t.lastEditActionCommand?n:1;var i=s.lastInsertModeChanges;ht(e,i.changes,n)}}var s=Ut.macroModeState;s.isPlaying=!0;var a=!!t.lastEditActionCommand,l=t.inputState;if(t.inputState=t.lastEditInputState,a&&t.lastEditActionCommand.interlaceInsertRepeat)for(var c=0;c<n;c++)o(),r(1);else i||o(),r(n);t.inputState=l,t.insertMode&&!i&&Qe(e),s.isPlaying=!1}function ht(e,t,n){function i(t){return"string"==typeof t?_t.commands[t](e):t(e),!0}var o=e.getCursor("head"),r=Ut.macroModeState.lastInsertModeChanges.visualBlock;r&&(ee(e,o,r+1),n=e.listSelections().length,e.setCursor(o));for(var s=0;s<n;s++){r&&e.setCursor(N(o,s,0));for(var a=0;a<t.length;a++){var l=t[a];if(l instanceof at)_t.lookupKey(l.keyName,"vim-insert",i);else if("string"==typeof l){var c=e.getCursor();e.replaceRange(l,c,c)}else{var h=e.getCursor(),u=N(h,0,l[0].length);e.replaceRange(l[0],h,u)}}}r&&e.setCursor(N(o,0,1))}function ut(e,t,n){t.length>1&&"n"==t[0]&&(t=t.replace("numpad","")),t=an[t]||t;var i="";return n.ctrlKey&&(i+="C-"),n.altKey&&(i+="A-"),(i||t.length>1)&&n.shiftKey&&(i+="S-"),i+=t,i.length>1&&(i="<"+i+">"),i}function dt(e){var t=new e.constructor;return Object.keys(e).forEach(function(n){var i=e[n];Array.isArray(i)?i=i.slice():i&&"object"==typeof i&&i.constructor!=Object&&(i=dt(i)),t[n]=i}),e.sel&&(t.sel={head:e.sel.head&&K(e.sel.head),anchor:e.sel.anchor&&K(e.sel.anchor)}),t}function gt(e,t,n){var i=!1,o=Tt.maybeInitVimState_(e),r=o.visualBlock||o.wasInVisualBlock,s=e.ace.inMultiSelectMode;if(o.wasInVisualBlock&&!s?o.wasInVisualBlock=!1:s&&o.visualBlock&&(o.wasInVisualBlock=!0),"<Esc>"!=t||o.insertMode||o.visualMode||!s)if(r||!s||e.ace.inVirtualSelectionMode)i=Tt.handleKey(e,t,n);else{var a=dt(o);e.operation(function(){e.ace.forEachSelection(function(){var o=e.ace.selection;e.state.vim.lastHPos=null==o.$desiredColumn?o.lead.column:o.$desiredColumn;var r=e.getCursor("head"),s=e.getCursor("anchor"),l=U(r,s)?0:-1,c=U(r,s)?-1:0;r=N(r,0,l),s=N(s,0,c),e.state.vim.sel.head=r,e.state.vim.sel.anchor=s,i=ln(e,t,n),o.$desiredColumn=-1==e.state.vim.lastHPos?null:e.state.vim.lastHPos,e.virtualSelectionMode()&&(e.state.vim=dt(a))}),e.curOp.cursorActivity&&!i&&(e.curOp.cursorActivity=!1)},!0)}else e.ace.exitMultiSelectMode();return i&&!o.visualMode&&!o.insert&&o.visualMode!=e.somethingSelected()&&st(e,o,!0),i}function pt(e,t){t.off("beforeEndOperation",pt);var n=t.state.cm.vimCmd;n&&t.execCommand(n.exec?n:n.name,n.args),t.curOp=t.prevOp}var ft=e("../range").Range,mt=e("../lib/event_emitter").EventEmitter,vt=e("../lib/dom"),bt=e("../lib/oop"),wt=e("../lib/keys"),yt=e("../lib/event"),xt=e("../search").Search,kt=e("../lib/useragent"),Ct=e("../search_highlight").SearchHighlight,St=e("../commands/multi_select_commands"),$t=e("../mode/text").Mode.prototype.tokenRe;e("../multi_select");var _t=function(e){this.ace=e,this.state={},this.marks={},this.$uid=0,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this),this.onBeforeEndOperation=this.onBeforeEndOperation.bind(this),this.ace.on("change",this.onChange),this.ace.on("changeSelection",this.onSelectionChange),this.ace.on("beforeEndOperation",this.onBeforeEndOperation)};_t.Pos=function(e,t){if(!(this instanceof Rt))return new Rt(e,t);this.line=e,this.ch=t},_t.defineOption=function(){},_t.commands={redo:function(e){e.ace.redo()},undo:function(e){e.ace.undo()},newlineAndIndent:function(e){e.ace.insert("\n")}},_t.keyMap={},_t.addClass=_t.rmClass=function(){},_t.e_stop=_t.e_preventDefault=yt.stopEvent,_t.keyName=function(e){var t=wt[e.keyCode]||e.key||"";return 1==t.length&&(t=t.toUpperCase()),t=yt.getModifierString(e).replace(/(^|-)\w/g,function(e){return e.toUpperCase()})+t},_t.keyMap["default"]=function(e){return function(t){var n=t.ace.commands.commandKeyBinding[e.toLowerCase()];return n&&!1!==t.ace.execCommand(n)}},_t.lookupKey=function e(t,n,i){n||(n="default"),"string"==typeof n&&(n=_t.keyMap[n]);var o="function"==typeof n?n(t):n[t];if(!1===o)return"nothing";if("..."===o)return"multi";if(null!=o&&i(o))return"handled";if(n.fallthrough){if(!Array.isArray(n.fallthrough))return e(t,n.fallthrough,i);for(var r=0;r<n.fallthrough.length;r++){var s=e(t,n.fallthrough[r],i);if(s)return s}}},_t.signal=function(e,t,n){return e._signal(t,n)},_t.on=yt.addListener,_t.off=yt.removeListener,_t.isWordChar=function(e){return e<"\x7f"?/^\w$/.test(e):($t.lastIndex=0,$t.test(e))},function(){bt.implement(_t.prototype,mt),this.destroy=function(){this.ace.off("change",this.onChange),this.ace.off("changeSelection",this.onSelectionChange),this.ace.off("beforeEndOperation",this.onBeforeEndOperation),this.removeOverlay()},this.virtualSelectionMode=function(){return this.ace.inVirtualSelectionMode&&this.ace.selection.index},this.onChange=function(e){var t={text:"i"==e.action[0]?e.lines:[]},n=this.curOp=this.curOp||{};n.changeHandlers||(n.changeHandlers=this._eventRegistry.change&&this._eventRegistry.change.slice()),n.lastChange?n.lastChange.next=n.lastChange=t:n.lastChange=n.change=t,this.$updateMarkers(e)},this.onSelectionChange=function(){var e=this.curOp=this.curOp||{};e.cursorActivityHandlers||(e.cursorActivityHandlers=this._eventRegistry.cursorActivity&&this._eventRegistry.cursorActivity.slice()),this.curOp.cursorActivity=!0,this.ace.inMultiSelectMode&&this.ace.keyBinding.removeKeyboardHandler(St.keyboardHandler)},this.operation=function(e,t){if(!t&&this.curOp||t&&this.curOp&&this.curOp.force)return e();if((t||!this.ace.curOp)&&this.curOp&&this.onBeforeEndOperation(),!this.ace.curOp){var n=this.ace.prevOp;this.ace.startOperation({command:{name:"vim",scrollIntoView:"cursor"}})}var i=this.curOp=this.curOp||{};this.curOp.force=t;var o=e();return this.ace.curOp&&"vim"==this.ace.curOp.command.name&&(this.state.dialog&&(this.ace.curOp.command.scrollIntoView=!1),this.ace.endOperation(),!i.cursorActivity&&!i.lastChange&&n&&(this.ace.prevOp=n)),(t||!this.ace.curOp)&&this.curOp&&this.onBeforeEndOperation(),o},this.onBeforeEndOperation=function(){var e=this.curOp;e&&(e.change&&this.signal("change",e.change,e),e&&e.cursorActivity&&this.signal("cursorActivity",null,e),this.curOp=null)},this.signal=function(e,t,n){var i=n?n[e+"Handlers"]:(this._eventRegistry||{})[e];if(i){i=i.slice();for(var o=0;o<i.length;o++)i[o](this,t)}},this.firstLine=function(){return 0},this.lastLine=function(){return this.ace.session.getLength()-1},this.lineCount=function(){return this.ace.session.getLength()},this.setCursor=function(e,t){"object"==typeof e&&(t=e.ch,e=e.line),this.ace.inVirtualSelectionMode||this.ace.exitMultiSelectMode(),this.ace.session.unfold({row:e,column:t}),this.ace.selection.moveTo(e,t)},this.getCursor=function(e){var t=this.ace.selection;return i("anchor"==e?t.isEmpty()?t.lead:t.anchor:"head"!=e&&e?t.getRange()[e]:t.lead)},this.listSelections=function(){var e=this.ace.multiSelect.rangeList.ranges;return!e.length||this.ace.inVirtualSelectionMode?[{anchor:this.getCursor("anchor"),head:this.getCursor("head")}]:e.map(function(e){return{anchor:this.clipPos(i(e.cursor==e.end?e.start:e.end)),head:this.clipPos(i(e.cursor))}},this)},this.setSelections=function(e,t){var i=this.ace.multiSelect,o=e.map(function(e){var t=n(e.anchor),i=n(e.head),o=ft.comparePoints(t,i)<0?new ft.fromPoints(t,i):new ft.fromPoints(i,t);return o.cursor=ft.comparePoints(o.start,i)?o.end:o.start,o});if(this.ace.inVirtualSelectionMode)return void this.ace.selection.fromOrientedRange(o[0]);t?o[t]&&o.push(o.splice(t,1)[0]):o=o.reverse(),i.toSingleRange(o[0].clone());for(var r=this.ace.session,s=0;s<o.length;s++){var a=r.$clipRangeToDocument(o[s]);i.addRange(a)}},this.setSelection=function(e,t,n){var i=this.ace.selection;i.moveTo(e.line,e.ch),i.selectTo(t.line,t.ch),n&&"*mouse"==n.origin&&this.onBeforeEndOperation()},this.somethingSelected=function(){return!this.ace.selection.isEmpty()},this.clipPos=function(e){return i(this.ace.session.$clipPositionToDocument(e.line,e.ch))},this.markText=function(){return{clear:function(){},find:function(){}}},this.$updateMarkers=function(e){var t="insert"==e.action,n=e.start,i=e.end,o=(i.row-n.row)*(t?1:-1),r=(i.column-n.column)*(t?1:-1);t&&(i=n);for(var s in this.marks){var a=this.marks[s],l=ft.comparePoints(a,n);if(!(l<0)){if(0===l&&t){if(1!=a.bias){a.bias=-1;continue}l=1}var c=t?l:ft.comparePoints(a,i);c>0?(a.row+=o,a.column+=a.row==i.row?r:0):!t&&c<=0&&(a.row=n.row,a.column=n.column,0===c&&(a.bias=1))}}};var e=function(e,t,n,i){this.cm=e,this.id=t,this.row=n,this.column=i,e.marks[this.id]=this};e.prototype.clear=function(){delete this.cm.marks[this.id]},e.prototype.find=function(){return i(this)},this.setBookmark=function(t,n){var i=new e(this,this.$uid++,t.line,t.ch);return n&&n.insertLeft||(i.$insertRight=!0),this.marks[i.id]=i,i},this.moveH=function(e,t){if("char"==t){var n=this.ace.selection;n.clearSelection(),n.moveCursorBy(0,e)}},this.findPosV=function(e,t,n,o){if("page"==n){var r=this.ace.renderer,s=r.layerConfig;t*=Math.floor(s.height/s.lineHeight),n="line"}if("line"==n){var a=this.ace.session.documentToScreenPosition(e.line,e.ch);null!=o&&(a.column=o),a.row+=t,a.row=Math.min(Math.max(0,a.row),this.ace.session.getScreenLength()-1);return i(this.ace.session.screenToDocumentPosition(a.row,a.column))}},this.charCoords=function(e,t){if("div"==t||!t){var n=this.ace.session.documentToScreenPosition(e.line,e.ch);return{left:n.column,top:n.row}}if("local"==t){var i=this.ace.renderer,n=this.ace.session.documentToScreenPosition(e.line,e.ch),o=i.layerConfig.lineHeight,r=i.layerConfig.characterWidth,s=o*n.row;return{left:n.column*r,top:s,bottom:s+o}}},this.coordsChar=function(e,t){var n=this.ace.renderer;if("local"==t){var o=Math.max(0,Math.floor(e.top/n.lineHeight)),r=Math.max(0,Math.floor(e.left/n.characterWidth));return i(n.session.screenToDocumentPosition(o,r))}if("div"==t)throw"not implemented"},this.getSearchCursor=function(e,t){var n=!1,o=!1;e instanceof RegExp&&!e.global&&(n=!e.ignoreCase,e=e.source,o=!0);var r=new xt;t.ch==undefined&&(t.ch=Number.MAX_VALUE);var s={row:t.line,column:t.ch},a=this,l=null;return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){r.setOptions({needle:e,caseSensitive:n,wrap:!1,backwards:t,regExp:o,start:l||s});var i=r.find(a.ace.session);return i&&i.isEmpty()&&a.getLine(i.start.row).length==i.start.column&&(r.$options.start=i,i=r.find(a.ace.session)),l=i},from:function(){return l&&i(l.start)},to:function(){return l&&i(l.end)},replace:function(e){l&&(l.end=a.ace.session.doc.replace(l,e))}}},this.scrollTo=function(e,t){var n=this.ace.renderer,i=n.layerConfig,o=i.maxHeight;o-=(n.$size.scrollerHeight-n.lineHeight)*n.$scrollPastEnd,null!=t&&this.ace.session.setScrollTop(Math.max(0,Math.min(t,o))),null!=e&&this.ace.session.setScrollLeft(Math.max(0,Math.min(e,i.width)))},this.scrollInfo=function(){return 0},this.scrollIntoView=function(e,t){if(e){var i=this.ace.renderer,o={top:0,bottom:t};i.scrollCursorIntoView(n(e),2*i.lineHeight/i.$size.scrollerHeight,o)}},this.getLine=function(e){return this.ace.session.getLine(e)},this.getRange=function(e,t){return this.ace.session.getTextRange(new ft(e.line,e.ch,t.line,t.ch))},this.replaceRange=function(e,t,n){return n||(n=t),this.ace.session.replace(new ft(t.line,t.ch,n.line,n.ch),e)},this.replaceSelections=function(e){var t=this.ace.selection;if(this.ace.inVirtualSelectionMode)return void this.ace.session.replace(t.getRange(),e[0]||"");t.inVirtualSelectionMode=!0;var n=t.rangeList.ranges;n.length||(n=[this.ace.multiSelect.getRange()]);for(var i=n.length;i--;)this.ace.session.replace(n[i],e[i]||"");t.inVirtualSelectionMode=!1},this.getSelection=function(){return this.ace.getSelectedText()},this.getSelections=function(){return this.listSelections().map(function(e){return this.getRange(e.anchor,e.head)},this)},this.getInputField=function(){return this.ace.textInput.getElement()},this.getWrapperElement=function(){return this.ace.container};var t={indentWithTabs:"useSoftTabs",indentUnit:"tabSize",tabSize:"tabSize",firstLineNumber:"firstLineNumber",readOnly:"readOnly"};this.setOption=function(e,n){switch(this.state[e]=n,e){case"indentWithTabs":e=t[e],n=!n;break;case"keyMap":return void(this.state.$keyMap=n);default:e=t[e]}e&&this.ace.setOption(e,n)},this.getOption=function(e,n){var i=t[e];switch(i&&(n=this.ace.getOption(i)),e){case"indentWithTabs":return e=t[e],!n;case"keyMap":return this.state.$keyMap}return i?n:this.state[e]},this.toggleOverwrite=function(e){return this.state.overwrite=e,this.ace.setOverwrite(e)},this.addOverlay=function(e){if(!this.$searchHighlight||!this.$searchHighlight.session){var t=new Ct(null,"ace_highlight-marker","text"),n=this.ace.session.addDynamicMarker(t);t.id=n.id,t.session=this.ace.session,t.destroy=function(){t.session.off("change",t.updateOnChange),t.session.off("changeEditor",t.destroy),t.session.removeMarker(t.id),t.session=null},t.updateOnChange=function(e){var n=e.start.row;n==e.end.row?t.cache[n]=undefined:t.cache.splice(n,t.cache.length)},t.session.on("changeEditor",t.destroy),t.session.on("change",t.updateOnChange)}var i=new RegExp(e.query.source,"gmi");this.$searchHighlight=e.highlight=t,this.$searchHighlight.setRegexp(i),this.ace.renderer.updateBackMarkers()},this.removeOverlay=function(){this.$searchHighlight&&this.$searchHighlight.session&&this.$searchHighlight.destroy()},this.getScrollInfo=function(){var e=this.ace.renderer,t=e.layerConfig;return{left:e.scrollLeft,top:e.scrollTop,height:t.maxHeight,width:t.width,clientHeight:t.height,clientWidth:t.width}},this.getValue=function(){return this.ace.getValue()},this.setValue=function(e){return this.ace.setValue(e,-1)},this.getTokenTypeAt=function(e){var t=this.ace.session.getTokenAt(e.line,e.ch);return t&&/comment|string/.test(t.type)?"string":""},this.findMatchingBracket=function(e){var t=this.ace.session.findMatchingBracket(n(e));return{to:t&&i(t)}},this.indentLine=function(e,t){!0===t?this.ace.session.indentRows(e,e,"\t"):!1===t&&this.ace.session.outdentRows(new ft(e,0,e,0))},this.indexFromPos=function(e){return this.ace.session.doc.positionToIndex(n(e))},this.posFromIndex=function(e){return i(this.ace.session.doc.indexToPosition(e))},this.focus=function(){return this.ace.textInput.focus()},this.blur=function(){return this.ace.blur()},this.defaultTextHeight=function(){return this.ace.renderer.layerConfig.lineHeight},this.scanForBracket=function(e,t,o,r){var s=r.bracketRegex.source,a=/paren|text|operator|tag/;if(1==t)var l=this.ace.session.$findClosingBracket(s.slice(1,2),n(e),a);else var l=this.ace.session.$findOpeningBracket(s.slice(-2,-1),{row:e.line,column:e.ch+1},a);return l&&{pos:i(l)}},this.refresh=function(){return this.ace.resize(!0)},this.getMode=function(){return{name:this.getOption("mode")}},this.execCommand=function(){}}.call(_t.prototype),(_t.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0}).prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var n=t==e;else var n=t&&(e.test?e.test(t):e(t));if(n)return++this.pos,t},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){throw"not implemented"},indentation:function(){throw"not implemented"},match:function(e,t,n){if("string"!=typeof e){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var o=function(e){return n?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}},_t.defineExtension=function(e,t){_t.prototype[e]=t},vt.importCssString(".normal-mode .ace_cursor{ border: none; background-color: rgba(255,0,0,0.5);}.normal-mode .ace_hidden-cursors .ace_cursor{ background-color: transparent; border: 1px solid red; opacity: 0.7}.ace_dialog { position: absolute; left: 0; right: 0; background: inherit; z-index: 15; padding: .1em .8em; overflow: hidden; color: inherit;}.ace_dialog-top { border-bottom: 1px solid #444; top: 0;}.ace_dialog-bottom { border-top: 1px solid #444; bottom: 0;}.ace_dialog input { border: none; outline: none; background: transparent; width: 20em; color: inherit; font-family: monospace;}","vimMode"),function(){function e(e,t,n){var i;return i=e.ace.container.appendChild(document.createElement("div")),i.className=n?"ace_dialog ace_dialog-bottom":"ace_dialog ace_dialog-top","string"==typeof t?i.innerHTML=t:i.appendChild(t),i}function t(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}_t.defineExtension("openDialog",function(n,i,o){function r(e){if("string"==typeof e)h.value=e;else{if(a)return;if(e&&"blur"==e.type&&document.activeElement===h)return;l.state.dialog=null,a=!0,s.parentNode.removeChild(s),l.focus(),o.onClose&&o.onClose(s)}}if(!this.virtualSelectionMode()){o||(o={}),t(this,null);var s=e(this,n,o.bottom),a=!1,l=this;this.state.dialog=s;var c,h=s.getElementsByTagName("input")[0];return h?(o.value&&(h.value=o.value,!1!==o.selectValueOnOpen&&h.select()),o.onInput&&_t.on(h,"input",function(e){o.onInput(e,h.value,r)}),o.onKeyUp&&_t.on(h,"keyup",function(e){o.onKeyUp(e,h.value,r)}),_t.on(h,"keydown",function(e){o&&o.onKeyDown&&o.onKeyDown(e,h.value,r)||(13==e.keyCode&&i(h.value),(27==e.keyCode||!1!==o.closeOnEnter&&13==e.keyCode)&&(h.blur(),_t.e_stop(e),r()))}),!1!==o.closeOnBlur&&_t.on(h,"blur",r),h.focus()):(c=s.getElementsByTagName("button")[0])&&(_t.on(c,"click",function(){r(),l.focus()}),!1!==o.closeOnBlur&&_t.on(c,"blur",r),c.focus()),r}}),_t.defineExtension("openNotification",function(n,i){function o(){a||(a=!0,clearTimeout(r),s.parentNode.removeChild(s))}if(!this.virtualSelectionMode()){t(this,o);var r,s=e(this,n,i&&i.bottom),a=!1,l=i&&"undefined"!=typeof i.duration?i.duration:5e3;return _t.on(s,"click",function(e){_t.e_preventDefault(e),o()}),l&&(r=setTimeout(o,l)),o}})}();var At=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"<Del>",type:"keyToKey",toKeys:"x",context:"normal"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{
17
- forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<character>",type:"action",action:"replayMacro"},{keys:"q<character>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<character>",type:"action",action:"setMark"},{keys:'"<character>',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<character>",type:"motion",motion:"textObjectManipulation"},{keys:"i<character>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],Lt=At.length,Mt=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],Rt=_t.Pos,Tt=function(){return jt};_t.defineOption("vimMode",!1,function(e,t,n){t&&"vim"!=e.getOption("keyMap")?e.setOption("keyMap","vim"):!t&&n!=_t.Init&&/^vim/.test(e.getOption("keyMap"))&&e.setOption("keyMap","default")});var Et={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A"},Ot={Enter:"CR",Backspace:"BS",Delete:"Del",Insert:"Ins"},It=/[\d]/,Ft=[_t.isWordChar,function(e){return e&&!_t.isWordChar(e)&&!/\s/.test(e)}],Bt=[function(e){return/\S/.test(e)}],Ht=u(65,26),Nt=u(97,26),Pt=u(48,10),Dt=[].concat(Ht,Nt,Pt,["<",">"]),Wt=[].concat(Ht,Nt,Pt,["-",'"',".",":","/"]),zt={};y("filetype",undefined,"string",["ft"],function(e,t){if(t!==undefined){if(e===undefined){var n=t.getOption("mode");return"null"==n?"":n}var n=""==e?"null":e;t.setOption("mode",n)}});var Kt=function(){function e(e,t,a){function l(t){var o=++i%n,r=s[o];r&&r.clear(),s[o]=e.setBookmark(t)}var c=i%n,h=s[c];if(h){var u=h.find();u&&!V(u,t)&&l(t)}else l(t);l(a),o=i,(r=i-n+1)<0&&(r=0)}function t(e,t){i+=t,i>o?i=o:i<r&&(i=r);var a=s[(n+i)%n];if(a&&!a.find()){var l,c=t>0?1:-1,h=e.getCursor();do{if(i+=c,(a=s[(n+i)%n])&&(l=a.find())&&!V(h,l))break}while(i<o&&i>r)}return a}var n=100,i=-1,o=0,r=0,s=new Array(n);return{cachedCursor:undefined,add:e,move:t}},Vt=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};C.prototype={exitMacroRecordMode:function(){var e=Ut.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=undefined,e.isRecording=!1},enterMacroRecordMode:function(e,t){var n=Ut.registerController.getRegister(t);n&&(n.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var Ut,Gt,jt={buildKeyMap:function(){},getRegisterController:function(){return Ut.registerController},resetVimGlobalState_:$,getVimGlobalState_:function(){return Ut},maybeInitVimState_:S,suppressErrorLogging:!1,InsertModeKey:at,map:function(e,t,n){sn.map(e,t,n)},unmap:function(e,t){sn.unmap(e,t)},noremap:function(e,t,n){function i(e){return e?[e]:["normal","insert","visual"]}for(var o=i(n),r=At.length,s=Lt,a=r-s;a<r&&o.length;a++){var l=At[a];if(!(l.keys!=t||n&&l.context&&l.context!==n||"ex"===l.type.substr(0,2)||"key"===l.type.substr(0,3))){var c={};for(var h in l)c[h]=l[h];c.keys=e,n&&!c.context&&(c.context=n),this._mapCommand(c);var u=i(l.context);o=o.filter(function(e){return-1===u.indexOf(e)})}}},mapclear:function(e){var t=At.length,n=Lt,i=At.slice(0,t-n);if(At=At.slice(t-n),e)for(var o=i.length-1;o>=0;o--){var r=i[o];if(e!==r.context)if(r.context)this._mapCommand(r);else{var s=["normal","insert","visual"];for(var a in s)if(s[a]!==e){var l={};for(var c in r)l[c]=r[c];l.context=s[a],this._mapCommand(l)}}}},setOption:x,getOption:k,defineOption:y,defineEx:function(e,t,n){if(t){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered')}else t=e;rn[e]=n,sn.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,n){var i=this.findKey(e,t,n);if("function"==typeof i)return i()},findKey:function(e,t,n){function i(){var i=Ut.macroModeState;if(i.isRecording){if("q"==t)return i.exitMacroRecordMode(),A(e),!0;"mapping"!=n&&et(i,t)}}function o(){if("<Esc>"==t)return A(e),c.visualMode?le(e):c.insertMode&&Qe(e),!0}function r(n){for(var i;n;)i=/<\w+-.+?>|<\w+>|./.exec(n),t=i[0],n=n.substring(i.index+t.length),_t.Vim.handleKey(e,t,"mapping")}function s(){if(o())return!0;for(var n=c.inputState.keyBuffer=c.inputState.keyBuffer+t,i=1==t.length,r=qt.matchCommand(n,At,c.inputState,"insert");n.length>1&&"full"!=r.type;){var n=c.inputState.keyBuffer=n.slice(1),s=qt.matchCommand(n,At,c.inputState,"insert");"none"!=s.type&&(r=s)}if("none"==r.type)return A(e),!1;if("partial"==r.type)return Gt&&window.clearTimeout(Gt),Gt=window.setTimeout(function(){c.insertMode&&c.inputState.keyBuffer&&A(e)},k("insertModeEscKeysTimeout")),!i;if(Gt&&window.clearTimeout(Gt),i){for(var a=e.listSelections(),l=0;l<a.length;l++){var h=a[l].head;e.replaceRange("",N(h,0,-(n.length-1)),h,"+input")}Ut.macroModeState.lastInsertModeChanges.changes.pop()}return A(e),r.command}function a(){if(i()||o())return!0;var n=c.inputState.keyBuffer=c.inputState.keyBuffer+t;if(/^[1-9]\d*$/.test(n))return!0;var r=/^(\d*)(.*)$/.exec(n);if(!r)return A(e),!1;var s=c.visualMode?"visual":"normal",a=qt.matchCommand(r[2]||r[1],At,c.inputState,s);if("none"==a.type)return A(e),!1;if("partial"==a.type)return!0;c.inputState.keyBuffer="";var r=/^(\d*)(.*)$/.exec(n);return r[1]&&"0"!=r[1]&&c.inputState.pushRepeatDigit(r[1]),a.command}var l,c=S(e);return l=c.insertMode?s():a(),!1===l?undefined:!0===l?function(){return!0}:function(){if(!l.operator&&!l.isEdit||!e.getOption("readOnly"))return e.operation(function(){e.curOp.isVimOp=!0;try{"keyToKey"==l.type?r(l.toKeys):qt.processCommand(e,c,l)}catch(t){throw e.state.vim=undefined,S(e),_t.Vim.suppressErrorLogging||console.log(t),t}return!0})}},handleEx:function(e,t){sn.processCommand(e,t)},defineMotion:E,defineAction:F,defineOperator:I,mapCommand:Je,_mapCommand:Ye,defineRegister:M,exitVisualMode:le,exitInsertMode:Qe};_.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},_.prototype.getRepeat=function(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},L.prototype={setText:function(e,t,n){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!n},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(Vt(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},R.prototype={pushText:function(e,t,n,i,o){i&&"\n"!==n.charAt(n.length-1)&&(n+="\n");var r=this.isValidRegister(e)?this.getRegister(e):null;if(!r){switch(t){case"yank":this.registers[0]=new L(n,i,o);break;case"delete":case"change":-1==n.indexOf("\n")?this.registers["-"]=new L(n,i):(this.shiftNumericRegisters_(),this.registers[1]=new L(n,i))}return void this.unnamedRegister.setText(n,i,o)}m(e)?r.pushText(n,i):r.setText(n,i,o),this.unnamedRegister.setText(r.toString(),i)},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new L),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&w(e,Wt)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},T.prototype={nextMatch:function(e,t){var n=this.historyBuffer,i=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var o=this.iterator+i;t?o>=0:o<n.length;o+=i)for(var r=n[o],s=0;s<=r.length;s++)if(this.initialPrefix==r.substring(0,s))return this.iterator=o,r;return o>=n.length?(this.iterator=n.length,this.initialPrefix):o<0?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var qt={matchCommand:function(e,t,n,i){var o=P(e,t,i,n);if(!o.full&&!o.partial)return{type:"none"};if(!o.full&&o.partial)return{type:"partial"};for(var r,s=0;s<o.full.length;s++){var a=o.full[s];r||(r=a)}if("<character>"==r.keys.slice(-11)){var l=W(e);if(/<C-.>/.test(l)||!l)return{type:"none"};n.selectedCharacter=l}return{type:"full",command:r}},processCommand:function(e,t,n){switch(t.inputState.repeatOverride=n.repeatOverride,n.type){case"motion":this.processMotion(e,t,n);break;case"operator":this.processOperator(e,t,n);break;case"operatorMotion":this.processOperatorMotion(e,t,n);break;case"action":this.processAction(e,t,n);break;case"search":this.processSearch(e,t,n);break;case"ex":case"keyToEx":this.processEx(e,t,n)}},processMotion:function(e,t,n){t.inputState.motion=n.motion,t.inputState.motionArgs=H(n.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,n){var i=t.inputState;if(i.operator){if(i.operator==n.operator)return i.motion="expandToLine",i.motionArgs={linewise:!0},this.evalInput(e,t),void 0;A(e)}i.operator=n.operator,i.operatorArgs=H(n.operatorArgs),n.exitVisualBlock&&(t.visualBlock=!1,re(e)),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,n){var i=t.visualMode,o=H(n.operatorMotionArgs);o&&i&&o.visualLine&&(t.visualLine=!0),this.processOperator(e,t,n),i||this.processMotion(e,t,n)},processAction:function(e,t,n){var i=t.inputState,o=i.getRepeat(),r=!!o,s=H(n.actionArgs)||{};i.selectedCharacter&&(s.selectedCharacter=i.selectedCharacter),n.operator&&this.processOperator(e,t,n),n.motion&&this.processMotion(e,t,n),(n.motion||n.operator)&&this.evalInput(e,t),s.repeat=o||1,s.repeatIsExplicit=r,s.registerName=i.registerName,A(e),t.lastMotion=null,n.isEdit&&this.recordLastEdit(t,i,n),Yt[n.action](e,s,t)},processSearch:function(e,t,n){function i(i,o,r){Ut.searchHistoryController.pushInput(i),Ut.searchHistoryController.reset();try{We(e,i,o,r)}catch(t){return He(e,"Invalid regex: "+i),void A(e)}qt.processMotion(e,t,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:n.searchArgs.toJumplist}})}function o(e){i(e,!0,!0);var t=Ut.macroModeState;t.isRecording&&nt(t,e)}function r(t,n,i){var o,r,s=_t.keyName(t);"Up"==s||"Down"==s?(o="Up"==s,r=t.target?t.target.selectionEnd:0,n=Ut.searchHistoryController.nextMatch(n,o)||"",i(n),r&&t.target&&(t.target.selectionEnd=t.target.selectionStart=Math.min(r,t.target.value.length))):"Left"!=s&&"Right"!=s&&"Ctrl"!=s&&"Alt"!=s&&"Shift"!=s&&Ut.searchHistoryController.reset();var l;try{l=We(e,n,!0,!0)}catch(t){}l?e.scrollIntoView(Ve(e,!a,l),30):(Ue(e),e.scrollTo(u.left,u.top))}function s(t,n,i){var o=_t.keyName(t);"Esc"==o||"Ctrl-C"==o||"Ctrl-["==o||"Backspace"==o&&""==n?(Ut.searchHistoryController.pushInput(n),Ut.searchHistoryController.reset(),We(e,h),Ue(e),e.scrollTo(u.left,u.top),_t.e_stop(t),A(e),i(),e.focus()):"Up"==o||"Down"==o?_t.e_stop(t):"Ctrl-U"==o&&(_t.e_stop(t),i(""))}if(e.getSearchCursor){var a=n.searchArgs.forward,l=n.searchArgs.wholeWordOnly;Ae(e).setReversed(!a);var c=a?"/":"?",h=Ae(e).getQuery(),u=e.getScrollInfo();switch(n.searchArgs.querySrc){case"prompt":var d=Ut.macroModeState;if(d.isPlaying){var g=d.replaySearchQueries.shift();i(g,!0,!1)}else Pe(e,{onClose:o,prefix:c,desc:nn,onKeyUp:r,onKeyDown:s});break;case"wordUnderCursor":var p=de(e,!1,!0,!1,!0),f=!0;if(p||(p=de(e,!1,!0,!1,!1),f=!1),!p)return;var g=e.getLine(p.start.line).substring(p.start.ch,p.end.ch);g=f&&l?"\\b"+g+"\\b":Y(g),Ut.jumpList.cachedCursor=e.getCursor(),e.setCursor(p.start),i(g,!0,!1)}}},processEx:function(e,t,n){function i(t){Ut.exCommandHistoryController.pushInput(t),Ut.exCommandHistoryController.reset(),sn.processCommand(e,t)}function o(t,n,i){var o,r,s=_t.keyName(t);("Esc"==s||"Ctrl-C"==s||"Ctrl-["==s||"Backspace"==s&&""==n)&&(Ut.exCommandHistoryController.pushInput(n),Ut.exCommandHistoryController.reset(),_t.e_stop(t),A(e),i(),e.focus()),"Up"==s||"Down"==s?(_t.e_stop(t),o="Up"==s,r=t.target?t.target.selectionEnd:0,n=Ut.exCommandHistoryController.nextMatch(n,o)||"",i(n),r&&t.target&&(t.target.selectionEnd=t.target.selectionStart=Math.min(r,t.target.value.length))):"Ctrl-U"==s?(_t.e_stop(t),i("")):"Left"!=s&&"Right"!=s&&"Ctrl"!=s&&"Alt"!=s&&"Shift"!=s&&Ut.exCommandHistoryController.reset()}"keyToEx"==n.type?sn.processCommand(e,n.exArgs.input):t.visualMode?Pe(e,{onClose:i,prefix:":",value:"'<,'>",onKeyDown:o,selectValueOnOpen:!1}):Pe(e,{onClose:i,prefix:":",onKeyDown:o})},evalInput:function(e,t){var n,i,o,r=t.inputState,s=r.motion,a=r.motionArgs||{},l=r.operator,c=r.operatorArgs||{},h=r.registerName,u=t.sel,d=K(t.visualMode?B(e,u.head):e.getCursor("head")),g=K(t.visualMode?B(e,u.anchor):e.getCursor("anchor")),p=K(d),f=K(g);if(l&&this.recordLastEdit(t,r),o=r.repeatOverride!==undefined?r.repeatOverride:r.getRepeat(),o>0&&a.explicitRepeat?a.repeatIsExplicit=!0:(a.noRepeat||!a.explicitRepeat&&0===o)&&(o=1,a.repeatIsExplicit=!1),r.selectedCharacter&&(a.selectedCharacter=c.selectedCharacter=r.selectedCharacter),a.repeat=o,A(e),s){var m=Xt[s](e,d,a,t);if(t.lastMotion=Xt[s],!m)return;if(a.toJumplist){!l&&null!=e.ace.curOp&&(e.ace.curOp.command.scrollIntoView="center-animate");var v=Ut.jumpList,b=v.cachedCursor;b?(ge(e,b,m),delete v.cachedCursor):ge(e,d,m)}m instanceof Array?(i=m[0],n=m[1]):n=m,n||(n=K(d)),t.visualMode?(t.visualBlock&&n.ch===Infinity||(n=B(e,n,t.visualBlock)),i&&(i=B(e,i,!0)),i=i||f,u.anchor=i,u.head=n,re(e),ye(e,t,"<",U(i,n)?i:n),ye(e,t,">",U(i,n)?n:i)):l||(n=B(e,n),e.setCursor(n.line,n.ch))}if(l){if(c.lastSel){i=f;var w=c.lastSel,y=Math.abs(w.head.line-w.anchor.line),x=Math.abs(w.head.ch-w.anchor.ch);n=w.visualLine?Rt(f.line+y,f.ch):w.visualBlock?Rt(f.line+y,f.ch+x):w.head.line==w.anchor.line?Rt(f.line,f.ch+x):Rt(f.line+y,f.ch),t.visualMode=!0,t.visualLine=w.visualLine,t.visualBlock=w.visualBlock,u=t.sel={anchor:i,head:n},re(e)}else t.visualMode&&(c.lastSel={anchor:K(u.anchor),head:K(u.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var k,C,S,$,_;if(t.visualMode){if(k=G(u.head,u.anchor),C=j(u.head,u.anchor),S=t.visualLine||c.linewise,$=t.visualBlock?"block":S?"line":"char",_=se(e,{anchor:k,head:C},$),S){var L=_.ranges;if("block"==$)for(var M=0;M<L.length;M++)L[M].head.ch=X(e,L[M].head.line);else"line"==$&&(L[0].head=Rt(L[0].head.line+1,0))}}else{if(k=K(i||f),C=K(n||p),U(C,k)){var R=k;k=C,C=R}S=a.linewise||c.linewise,S?he(e,k,C):a.forward&&ce(e,k,C),$="char";_=se(e,{anchor:k,head:C},$,!a.inclusive||S)}e.setSelections(_.ranges,_.primary),t.lastMotion=null,c.repeat=o,c.registerName=h,c.linewise=S;var T=Qt[l](e,c,_.ranges,f,n);t.visualMode&&le(e,null!=T),T&&e.setCursor(T)}},recordLastEdit:function(e,t,n){var i=Ut.macroModeState;i.isPlaying||(e.lastEditInputState=t,e.lastEditActionCommand=n,i.lastInsertModeChanges.changes=[],i.lastInsertModeChanges.expectCursorActivityForChange=!1,i.lastInsertModeChanges.visualBlock=e.visualBlock?e.sel.head.line-e.sel.anchor.line:0)}},Xt={moveToTopLine:function(e,t,n){var i=je(e).top+n.repeat-1;return Rt(i,ue(e.getLine(i)))},moveToMiddleLine:function(e){var t=je(e),n=Math.floor(.5*(t.top+t.bottom));return Rt(n,ue(e.getLine(n)))},moveToBottomLine:function(e,t,n){var i=je(e).bottom-n.repeat+1;return Rt(i,ue(e.getLine(i)))},expandToLine:function(e,t,n){return Rt(t.line+n.repeat-1,Infinity)},findNext:function(e,t,n){var i=Ae(e),o=i.getQuery();if(o){var r=!n.forward;return r=i.isReversed()?!r:r,Ke(e,o),Ve(e,r,o,n.repeat)}},goToMark:function(e,t,n,i){var o=qe(e,i,n.selectedCharacter);return o?n.linewise?{line:o.line,ch:ue(e.getLine(o.line))}:o:null},moveToOtherHighlightedEnd:function(e,t,n,i){if(i.visualBlock&&n.sameLine){var o=i.sel;return[B(e,Rt(o.anchor.line,o.head.ch)),B(e,Rt(o.head.line,o.anchor.ch))]}return[i.sel.head,i.sel.anchor]},jumpToMark:function(e,t,n,i){for(var o=t,r=0;r<n.repeat;r++){var s=o;for(var a in i.marks)if(g(a)){var l=i.marks[a].find(),c=n.forward?U(l,s):U(s,l);if(!(c||n.linewise&&l.line==s.line)){var h=V(s,o),u=n.forward?q(s,l,o):q(o,l,s);(h||u)&&(o=l)}}}return n.linewise&&(o=Rt(o.line,ue(e.getLine(o.line)))),o},moveByCharacters:function(e,t,n){var i=t,o=n.repeat,r=n.forward?i.ch+o:i.ch-o;return Rt(i.line,r)},moveByLines:function(e,t,n,i){var o=t,r=o.ch;switch(i.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:r=i.lastHPos;break;default:i.lastHPos=r}var s=n.repeat+(n.repeatOffset||0),a=n.forward?o.line+s:o.line-s,l=e.firstLine(),c=e.lastLine();if(a<l&&o.line==l)return this.moveToStartOfLine(e,t,n,i);if(a>c&&o.line==c)return this.moveToEol(e,t,n,i,!0);var h=e.ace.session.getFoldLine(a);return h&&(n.forward?a>h.start.row&&(a=h.end.row+1):a=h.start.row),n.toFirstChar&&(r=ue(e.getLine(a)),i.lastHPos=r),i.lastHSPos=e.charCoords(Rt(a,r),"div").left,Rt(a,r)},moveByDisplayLines:function(e,t,n,i){var o=t;switch(i.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:i.lastHSPos=e.charCoords(o,"div").left}var r=n.repeat,s=e.findPosV(o,n.forward?r:-r,"line",i.lastHSPos);if(s.hitSide)if(n.forward)var a=e.charCoords(s,"div"),l={top:a.top+8,left:i.lastHSPos},s=e.coordsChar(l,"div");else{var c=e.charCoords(Rt(e.firstLine(),0),"div");c.left=i.lastHSPos,s=e.coordsChar(c,"div")}return i.lastHPos=s.ch,s},moveByPage:function(e,t,n){var i=t,o=n.repeat;return e.findPosV(i,n.forward?o:-o,"page")},moveByParagraph:function(e,t,n){var i=n.forward?1:-1;return ke(e,t,n.repeat,i)},moveBySentence:function(e,t,n){var i=n.forward?1:-1;return Ce(e,t,n.repeat,i)},moveByScroll:function(e,t,n,i){var o=e.getScrollInfo(),r=null,s=n.repeat;s||(s=o.clientHeight/(2*e.defaultTextHeight()));var a=e.charCoords(t,"local");n.repeat=s;var r=Xt.moveByDisplayLines(e,t,n,i);if(!r)return null;var l=e.charCoords(r,"local");return e.scrollTo(null,o.top+l.top-a.top),r},moveByWords:function(e,t,n){return ve(e,t,n.repeat,!!n.forward,!!n.wordEnd,!!n.bigWord)},moveTillCharacter:function(e,t,n){var i=n.repeat,o=be(e,i,n.forward,n.selectedCharacter),r=n.forward?-1:1;return pe(r,n),o?(o.ch+=r,o):null},moveToCharacter:function(e,t,n){var i=n.repeat;return pe(0,n),be(e,i,n.forward,n.selectedCharacter)||t},moveToSymbol:function(e,t,n){return fe(e,n.repeat,n.forward,n.selectedCharacter)||t},moveToColumn:function(e,t,n,i){var o=n.repeat;return i.lastHPos=o-1,i.lastHSPos=e.charCoords(t,"div").left,we(e,o)},moveToEol:function(e,t,n,i,o){var r=t,s=Rt(r.line+n.repeat-1,Infinity),a=e.clipPos(s);return a.ch--,o||(i.lastHPos=Infinity,i.lastHSPos=e.charCoords(a,"div").left),s},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return Rt(n.line,ue(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){for(var n,i=t,o=i.line,r=i.ch,s=e.getLine(o);r<s.length;r++)if((n=s.charAt(r))&&p(n)){var a=e.getTokenTypeAt(Rt(o,r+1));if("string"!==a&&"comment"!==a)break}if(r<s.length){var l=/[<>]/.test(s[r])?/[(){}[\]<>]/:/[(){}[\]]/;return e.findMatchingBracket(Rt(o,r+1),{bracketRegex:l}).to}return i},moveToStartOfLine:function(e,t){return Rt(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var i=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(i=n.repeat-e.getOption("firstLineNumber")),Rt(i,ue(e.getLine(i)))},textObjectManipulation:function(e,t,n,i){var o={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},r={"'":!0,'"':!0,"`":!0},s=n.selectedCharacter;"b"==s?s="(":"B"==s&&(s="{");var a,l=!n.textObjectInner;if(o[s])a=Se(e,t,s,l);else if(r[s])a=$e(e,t,s,l);else if("W"===s)a=de(e,l,!0,!0);else if("w"===s)a=de(e,l,!0,!1);else{if("p"!==s)return null;if(a=ke(e,t,n.repeat,0,l),n.linewise=!0,i.visualMode)i.visualLine||(i.visualLine=!0);else{var c=i.inputState.operatorArgs;c&&(c.linewise=!0),a.end.line--}}return e.state.vim.visualMode?oe(e,a.start,a.end):[a.start,a.end]},repeatLastCharacterSearch:function(e,t,n){var i=Ut.lastCharacterSearch,o=n.repeat,r=n.forward===i.forward,s=(i.increment?1:0)*(r?-1:1);e.moveH(-s,"char"),n.inclusive=!!r;var a=be(e,o,r,i.selectedCharacter);return a?(a.ch+=s,a):(e.moveH(s,"char"),t)}},Qt={change:function(e,t,n){var i,o,r=e.state.vim,s=n[0].anchor,a=n[0].head;if(r.visualMode)if(t.fullLine)a.ch=Number.MAX_VALUE,a.line--,e.setSelection(s,a),o=e.getSelection(),e.replaceSelections(""),i=s;else{o=e.getSelection();var l=O("",n.length);e.replaceSelections(l),i=G(n[0].head,n[0].anchor)}else{o=e.getRange(s,a);var c=r.lastEditInputState||{};if("moveByWords"==c.motion&&!v(o)){var h=/\s+$/.exec(o);h&&c.motionArgs&&c.motionArgs.forward&&(a=N(a,0,-h[0].length),o=o.slice(0,-h[0].length))}var u=new Rt(s.line-1,Number.MAX_VALUE),d=e.firstLine()==e.lastLine();a.line>e.lastLine()&&t.linewise&&!d?e.replaceRange("",u,a):e.replaceRange("",s,a),t.linewise&&(d||(e.setCursor(u),_t.commands.newlineAndIndent(e)),s.ch=Number.MAX_VALUE),i=s}Ut.registerController.pushText(t.registerName,"change",o,t.linewise,n.length>1),Yt.enterInsertMode(e,{head:i},e.state.vim)},"delete":function(e,t,n){var i,o,r=e.state.vim;if(r.visualBlock){o=e.getSelection();var s=O("",n.length);e.replaceSelections(s),i=n[0].anchor}else{var a=n[0].anchor,l=n[0].head;t.linewise&&l.line!=e.firstLine()&&a.line==e.lastLine()&&a.line==l.line-1&&(a.line==e.firstLine()?a.ch=0:a=Rt(a.line-1,X(e,a.line-1))),o=e.getRange(a,l),e.replaceRange("",a,l),i=a,t.linewise&&(i=Xt.moveToFirstNonWhiteSpaceCharacter(e,a))}return Ut.registerController.pushText(t.registerName,"delete",o,t.linewise,r.visualBlock),B(e,i,r.insertMode)},indent:function(e,t,n){var i=e.state.vim,o=n[0].anchor.line,r=i.visualBlock?n[n.length-1].anchor.line:n[0].head.line,s=i.visualMode?t.repeat:1;t.linewise&&r--;for(var a=o;a<=r;a++)for(var l=0;l<s;l++)e.indentLine(a,t.indentRight);return Xt.moveToFirstNonWhiteSpaceCharacter(e,n[0].anchor)},indentAuto:function(e,t,n){return e.execCommand("indentAuto"),Xt.moveToFirstNonWhiteSpaceCharacter(e,n[0].anchor)},changeCase:function(e,t,n,i,o){for(var r=e.getSelections(),s=[],a=t.toLower,l=0;l<r.length;l++){var c=r[l],h="";if(!0===a)h=c.toLowerCase();else if(!1===a)h=c.toUpperCase();else for(var u=0;u<c.length;u++){var d=c.charAt(u);h+=m(d)?d.toLowerCase():d.toUpperCase()}s.push(h)}return e.replaceSelections(s),t.shouldMoveCursor?o:!e.state.vim.visualMode&&t.linewise&&n[0].anchor.line+1==n[0].head.line?Xt.moveToFirstNonWhiteSpaceCharacter(e,i):t.linewise?i:G(n[0].anchor,n[0].head)},yank:function(e,t,n,i){var o=e.state.vim,r=e.getSelection(),s=o.visualMode?G(o.sel.anchor,o.sel.head,n[0].head,n[0].anchor):i;return Ut.registerController.pushText(t.registerName,"yank",r,t.linewise,o.visualBlock),s}},Yt={jumpListWalk:function(e,t,n){if(!n.visualMode){var i=t.repeat,o=t.forward,r=Ut.jumpList,s=r.move(e,o?i:-i),a=s?s.find():undefined;a=a||e.getCursor(),e.setCursor(a),e.ace.curOp.command.scrollIntoView="center-animate"}},scroll:function(e,t,n){if(!n.visualMode){var i=t.repeat||1,o=e.defaultTextHeight(),r=e.getScrollInfo().top,s=o*i,a=t.forward?r+s:r-s,l=K(e.getCursor()),c=e.charCoords(l,"local");if(t.forward)a>c.top?(l.line+=(a-c.top)/o,l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,a);else{var h=a+e.getScrollInfo().clientHeight;h<c.bottom?(l.line-=(c.bottom-h)/o,l.line=Math.floor(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.bottom-e.getScrollInfo().clientHeight)):e.scrollTo(null,a)}}},scrollToCursor:function(e,t){var n=e.getCursor().line,i=e.charCoords(Rt(n,0),"local"),o=e.getScrollInfo().clientHeight,r=i.top,s=i.bottom-r;switch(t.position){case"center":r=r-o/2+s;break;case"bottom":r=r-o+s}e.scrollTo(null,r)},replayMacro:function(e,t,n){var i=t.selectedCharacter,o=t.repeat,r=Ut.macroModeState;for("@"==i?i=r.latestRegister:r.latestRegister=i;o--;)Ze(e,n,r,i)},enterMacroRecordMode:function(e,t){var n=Ut.macroModeState,i=t.selectedCharacter
15
+ ;return this.foldingStartMarker.test(i)?"="==i[0]?this.singleLineHeadingRe.test(i)?"start":e.getLine(n-1).length!=e.getLine(n).length?"":"start":"dissallowDelimitedBlock"==e.bgTokenizer.getState(n)?"end":"start":""},this.getFoldWidgetRange=function(e,t,n){function i(t){return(u=e.getTokens(t)[0])&&u.type}function r(){var t=u.value.match(p);if(t)return t[0].length;var i=d.indexOf(u.value[0])+1;return 1==i&&e.getLine(n-1).length!=e.getLine(n).length?Infinity:i}var s=e.getLine(n),a=s.length,l=e.getLength(),c=n,h=n;if(s.match(this.foldingStartMarker)){var u,d=["=","-","~","^","+"],g="markup.heading",p=this.singleLineHeadingRe;if(i(n)==g){for(var f=r();++n<l;)if(i(n)==g){var m=r();if(m<=f)break}if((h=u&&u.value.match(this.singleLineHeadingRe)?n-1:n-2)>c)for(;h>c&&(!i(h)||"["==u.value[0]);)h--;if(h>c){var v=e.getLine(h).length;return new o(c,a,h,v)}}else{if("dissallowDelimitedBlock"==e.bgTokenizer.getState(n)){for(;n-- >0&&-1!=e.bgTokenizer.getState(n).lastIndexOf("Block"););if((h=n+1)<c){var v=e.getLine(n).length;return new o(h,5,c,a-5)}}else{for(;++n<l&&"dissallowDelimitedBlock"!=e.bgTokenizer.getState(n););if((h=n)>c){var v=e.getLine(n).length;return new o(c,5,h,v-5)}}}}}}.call(r.prototype)}),ace.define("ace/mode/asciidoc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/asciidoc_highlight_rules","ace/mode/folding/asciidoc"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text").Mode,o=e("./asciidoc_highlight_rules").AsciidocHighlightRules,r=e("./folding/asciidoc").FoldMode,s=function(){this.HighlightRules=o,this.foldingRules=new r};n.inherits(s,i),function(){this.type="text",this.getNextLineIndent=function(e,t){if("listblock"==e){var n=/^((?:.+)?)([-+*][ ]+)/.exec(t);return n?new Array(n[1].length+1).join(" ")+n[2]:""}return this.$getIndent(t)},this.$id="ace/mode/asciidoc"}.call(s.prototype),t.Mode=s}),function(){ace.require(["ace/mode/asciidoc"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),function(){ace.require(["ace/mode/text"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/mode/latex_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,o=function(){this.$rules={start:[{token:"comment",regex:"%.*$"},{token:["keyword","lparen","variable.parameter","rparen","lparen","storage.type","rparen"],regex:"(\\\\(?:documentclass|usepackage|input))(?:(\\[)([^\\]]*)(\\]))?({)([^}]*)(})"},{token:["keyword","lparen","variable.parameter","rparen"],regex:"(\\\\(?:label|v?ref|cite(?:[^{]*)))(?:({)([^}]*)(}))?"},{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\begin)({)(verbatim)(})",next:"verbatim"},{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\begin)({)(lstlisting)(})",next:"lstlisting"},{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\(?:begin|end))({)([\\w*]*)(})"},{token:"storage.type",regex:/\\verb\b\*?/,next:[{token:["keyword.operator","string","keyword.operator"],regex:"(.)(.*?)(\\1|$)|",next:"start"}]},{token:"storage.type",regex:"\\\\[a-zA-Z]+"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"constant.character.escape",regex:"\\\\[^a-zA-Z]?"},{token:"string",regex:"\\${1,2}",next:"equation"}],equation:[{token:"comment",regex:"%.*$"},{token:"string",regex:"\\${1,2}",next:"start"},{token:"constant.character.escape",regex:"\\\\(?:[^a-zA-Z]|[a-zA-Z]+)"},{token:"error",regex:"^\\s*$",next:"start"},{defaultToken:"string"}],verbatim:[{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\end)({)(verbatim)(})",next:"start"},{defaultToken:"text"}],lstlisting:[{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\end)({)(lstlisting)(})",next:"start"},{defaultToken:"text"}]},this.normalizeRules()};n.inherits(o,i),t.LatexHighlightRules=o}),ace.define("ace/mode/rdoc_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/latex_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=(e("../lib/lang"),e("./text_highlight_rules").TextHighlightRules),o=(e("./latex_highlight_rules"),function(){this.$rules={start:[{token:"comment",regex:"%.*$"},{token:"text",regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b",next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell.text",regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b"},{token:"keyword",regex:"\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell.text",regex:"\\s+"},{token:"nospell.text",regex:"\\w+"}]}});n.inherits(o,i),t.RDocHighlightRules=o}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t){"use strict";var n=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var i=e.getLine(t),o=i.match(/^(\s*\})/);if(!o)return 0;var r=o[1].length,s=e.findMatchingBracket({row:t,column:r});if(!s||s.row==t)return 0;var a=this.$getIndent(e.getLine(s.row));e.replace(new n(t,0,t,r-1),a)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/rdoc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/rdoc_highlight_rules","ace/mode/matching_brace_outdent"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text").Mode,o=e("./rdoc_highlight_rules").RDocHighlightRules,r=e("./matching_brace_outdent").MatchingBraceOutdent,s=function(){this.HighlightRules=o,this.$outdent=new r,this.$behaviour=this.$defaultBehaviour};n.inherits(s,i),function(){this.getNextLineIndent=function(e,t){return this.$getIndent(t)},this.$id="ace/mode/rdoc"}.call(s.prototype),t.Mode=s}),function(){ace.require(["ace/mode/rdoc"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/mode/textile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,o=function(){this.$rules={start:[{token:function(e){return"h"==e.charAt(0)?"markup.heading."+e.charAt(1):"markup.heading"},regex:"h1|h2|h3|h4|h5|h6|bq|p|bc|pre",next:"blocktag"},{token:"keyword",regex:"[\\*]+|[#]+"},{token:"text",regex:".+"}],blocktag:[{token:"keyword",regex:"\\. ",next:"start"},{token:"keyword",regex:"\\(",next:"blocktagproperties"}],blocktagproperties:[{token:"keyword",regex:"\\)",next:"blocktag"},{token:"string",regex:"[a-zA-Z0-9\\-_]+"},{token:"keyword",regex:"#"}]}};n.inherits(o,i),t.TextileHighlightRules=o}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t){"use strict";var n=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var i=e.getLine(t),o=i.match(/^(\s*\})/);if(!o)return 0;var r=o[1].length,s=e.findMatchingBracket({row:t,column:r});if(!s||s.row==t)return 0;var a=this.$getIndent(e.getLine(s.row));e.replace(new n(t,0,t,r-1),a)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/textile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/textile_highlight_rules","ace/mode/matching_brace_outdent"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text").Mode,o=e("./textile_highlight_rules").TextileHighlightRules,r=e("./matching_brace_outdent").MatchingBraceOutdent,s=function(){this.HighlightRules=o,this.$outdent=new r,this.$behaviour=this.$defaultBehaviour};n.inherits(s,i),function(){this.type="text",this.getNextLineIndent=function(e,t,n){return"intag"==e?n:""},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/textile"}.call(s.prototype),t.Mode=s}),function(){ace.require(["ace/mode/textile"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/mode/rst_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=(e("../lib/lang"),e("./text_highlight_rules").TextHighlightRules),o=function(){var e={title:"markup.heading",list:"markup.heading",table:"constant",directive:"keyword.operator",entity:"string",link:"markup.underline.list",bold:"markup.bold",italic:"markup.italic",literal:"support.function",comment:"comment"},t="(^|\\s|[\"'(<\\[{\\-/:])",n="(?:$|(?=\\s|[\\\\.,;!?\\-/:\"')>\\]}]))";this.$rules={start:[{token:e.title,regex:"(^)([\\=\\-`:\\.'\"~\\^_\\*\\+#])(\\2{2,}\\s*$)"},{token:["text",e.directive,e.literal],regex:"(^\\s*\\.\\. )([^: ]+::)(.*$)",next:"codeblock"},{token:e.directive,regex:"::$",next:"codeblock"},{token:[e.entity,e.link],regex:"(^\\.\\. _[^:]+:)(.*$)"},{token:[e.entity,e.link],regex:"(^__ )(https?://.*$)"},{token:e.entity,regex:"^\\.\\. \\[[^\\]]+\\] "},{token:e.comment,regex:"^\\.\\. .*$",next:"comment"},{token:e.list,regex:"^\\s*[\\*\\+-] "},{token:e.list,regex:"^\\s*(?:[A-Za-z]|[0-9]+|[ivxlcdmIVXLCDM]+)\\. "},{token:e.list,regex:"^\\s*\\(?(?:[A-Za-z]|[0-9]+|[ivxlcdmIVXLCDM]+)\\) "},{token:e.table,regex:"^={2,}(?: +={2,})+$"},{token:e.table,regex:"^\\+-{2,}(?:\\+-{2,})+\\+$"},{token:e.table,regex:"^\\+={2,}(?:\\+={2,})+\\+$"},{token:["text",e.literal],regex:t+"(``)(?=\\S)",next:"code"},{token:["text",e.bold],regex:t+"(\\*\\*)(?=\\S)",next:"bold"},{token:["text",e.italic],regex:t+"(\\*)(?=\\S)",next:"italic"},{token:e.entity,regex:"\\|[\\w\\-]+?\\|"},{token:e.entity,regex:":[\\w-:]+:`\\S",next:"entity"},{token:["text",e.entity],regex:t+"(_`)(?=\\S)",next:"entity"},{token:e.entity,regex:"_[A-Za-z0-9\\-]+?"},{token:["text",e.link],regex:t+"(`)(?=\\S)",next:"link"},{token:e.link,regex:"[A-Za-z0-9\\-]+?__?"},{token:e.link,regex:"\\[[^\\]]+?\\]_"},{token:e.link,regex:"https?://\\S+"},{token:e.table,regex:"\\|"}],codeblock:[{token:e.literal,regex:"^ +.+$",next:"codeblock"},{token:e.literal,regex:"^$",next:"codeblock"},{token:"empty",regex:"",next:"start"}],code:[{token:e.literal,regex:"\\S``"+n,next:"start"},{defaultToken:e.literal}],bold:[{token:e.bold,regex:"\\S\\*\\*"+n,next:"start"},{defaultToken:e.bold}],italic:[{token:e.italic,regex:"\\S\\*"+n,next:"start"},{defaultToken:e.italic}],entity:[{token:e.entity,regex:"\\S`"+n,next:"start"},{defaultToken:e.entity}],link:[{token:e.link,regex:"\\S`__?"+n,next:"start"},{defaultToken:e.link}],comment:[{token:e.comment,regex:"^ +.+$",next:"comment"},{token:e.comment,regex:"^$",next:"comment"},{token:"empty",regex:"",next:"start"}]}};n.inherits(o,i),t.RSTHighlightRules=o}),ace.define("ace/mode/rst",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/rst_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text").Mode,o=e("./rst_highlight_rules").RSTHighlightRules,r=function(){this.HighlightRules=o};n.inherits(r,i),function(){this.type="text",this.$id="ace/mode/rst"}.call(r.prototype),t.Mode=r}),function(){ace.require(["ace/mode/rst"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/mode/latex_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,o=function(){this.$rules={start:[{token:"comment",regex:"%.*$"},{token:["keyword","lparen","variable.parameter","rparen","lparen","storage.type","rparen"],regex:"(\\\\(?:documentclass|usepackage|input))(?:(\\[)([^\\]]*)(\\]))?({)([^}]*)(})"},{token:["keyword","lparen","variable.parameter","rparen"],regex:"(\\\\(?:label|v?ref|cite(?:[^{]*)))(?:({)([^}]*)(}))?"},{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\begin)({)(verbatim)(})",next:"verbatim"},{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\begin)({)(lstlisting)(})",next:"lstlisting"},{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\(?:begin|end))({)([\\w*]*)(})"},{token:"storage.type",regex:/\\verb\b\*?/,next:[{token:["keyword.operator","string","keyword.operator"],regex:"(.)(.*?)(\\1|$)|",next:"start"}]},{token:"storage.type",regex:"\\\\[a-zA-Z]+"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"constant.character.escape",regex:"\\\\[^a-zA-Z]?"},{token:"string",regex:"\\${1,2}",next:"equation"}],equation:[{token:"comment",regex:"%.*$"},{token:"string",regex:"\\${1,2}",next:"start"},{token:"constant.character.escape",regex:"\\\\(?:[^a-zA-Z]|[a-zA-Z]+)"},{token:"error",regex:"^\\s*$",next:"start"},{defaultToken:"string"}],verbatim:[{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\end)({)(verbatim)(})",next:"start"},{defaultToken:"text"}],lstlisting:[{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\end)({)(lstlisting)(})",next:"start"},{defaultToken:"text"}]},this.normalizeRules()};n.inherits(o,i),t.LatexHighlightRules=o}),ace.define("ace/mode/folding/latex",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"],function(e,t){"use strict";var n=e("../../lib/oop"),i=e("./fold_mode").FoldMode,o=e("../../range").Range,r=e("../../token_iterator").TokenIterator,s={"\\subparagraph":1,"\\paragraph":2,"\\subsubsubsection":3,"\\subsubsection":4,"\\subsection":5,"\\section":6,"\\chapter":7,"\\part":8,"\\begin":9,"\\end":10},a=t.FoldMode=function(){};n.inherits(a,i),function(){this.foldingStartMarker=/^\s*\\(begin)|\s*\\(part|chapter|(?:sub)*(?:section|paragraph))\b|{\s*$/,this.foldingStopMarker=/^\s*\\(end)\b|^\s*}/,this.getFoldWidgetRange=function(e,t,n){var i=e.doc.getLine(n),o=this.foldingStartMarker.exec(i);if(o)return o[1]?this.latexBlock(e,n,o[0].length-1):o[2]?this.latexSection(e,n,o[0].length-1):this.openingBracketBlock(e,"{",n,o.index);var o=this.foldingStopMarker.exec(i);return o?o[1]?this.latexBlock(e,n,o[0].length-1):this.closingBracketBlock(e,"}",n,o.index+o[0].length):void 0},this.latexBlock=function(e,t,n,i){var s={"\\begin":1,"\\end":-1},a=new r(e,t,n),l=a.getCurrentToken();if(l&&("storage.type"==l.type||"constant.character.escape"==l.type)){var c=l.value,h=s[c],u=function(){var e=a.stepForward(),t="lparen"==e.type?a.stepForward().value:"";return-1===h&&(a.stepBackward(),t&&a.stepBackward()),t},d=[u()],g=-1===h?a.getCurrentTokenColumn():e.getLine(t).length,p=t;for(a.step=-1===h?a.stepBackward:a.stepForward;l=a.step();)if(l&&("storage.type"==l.type||"constant.character.escape"==l.type)){var f=s[l.value];if(f){var m=u();if(f===h)d.unshift(m);else if(d.shift()!==m||!d.length)break}}if(!d.length){if(1==h&&(a.stepBackward(),a.stepBackward()),i)return a.getCurrentTokenRange();var t=a.getCurrentTokenRow();return-1===h?new o(t,e.getLine(t).length,p,g):new o(p,g,t,a.getCurrentTokenColumn())}}},this.latexSection=function(e,t,n){var i=new r(e,t,n),a=i.getCurrentToken();if(a&&"storage.type"==a.type){for(var l=s[a.value]||0,c=0,h=t;a=i.stepForward();)if("storage.type"===a.type){var u=s[a.value]||0;if(u>=9){if(c||(h=i.getCurrentTokenRow()-1),(c+=9==u?1:-1)<0)break}else if(u>=l)break}for(c||(h=i.getCurrentTokenRow()-1);h>t&&!/\S/.test(e.getLine(h));)h--;return new o(t,e.getLine(t).length,h,e.getLine(h).length)}}}.call(a.prototype)}),ace.define("ace/mode/latex",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/latex_highlight_rules","ace/mode/behaviour/cstyle","ace/mode/folding/latex"],function(e,t){"use strict";var n=e("../lib/oop"),i=e("./text").Mode,o=e("./latex_highlight_rules").LatexHighlightRules,r=e("./behaviour/cstyle").CstyleBehaviour,s=e("./folding/latex").FoldMode,a=function(){this.HighlightRules=o,this.foldingRules=new s,this.$behaviour=new r({braces:!0})};n.inherits(a,i),function(){this.type="text",this.lineCommentStart="%",this.$id="ace/mode/latex",this.getMatching=function(e,t,n){t==undefined&&(t=e.selection.lead),"object"==typeof t&&(n=t.column,t=t.row);var i=e.getTokenAt(t,n);if(i)return"\\begin"==i.value||"\\end"==i.value?this.foldingRules.latexBlock(e,t,n,!0):void 0}}.call(a.prototype),t.Mode=a}),function(){ace.require(["ace/mode/latex"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/theme/tomorrow",["require","exports","module","ace/lib/dom"],function(e,t){t.isDark=!1,t.cssClass="ace-tomorrow",t.cssText=".ace-tomorrow .ace_gutter {background: #f6f6f6;color: #4D4D4C}.ace-tomorrow .ace_print-margin {width: 1px;background: #f6f6f6}.ace-tomorrow {background-color: #FFFFFF;color: #4D4D4C}.ace-tomorrow .ace_cursor {color: #AEAFAD}.ace-tomorrow .ace_marker-layer .ace_selection {background: #D6D6D6}.ace-tomorrow.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;}.ace-tomorrow .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-tomorrow .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #D1D1D1}.ace-tomorrow .ace_marker-layer .ace_active-line {background: #EFEFEF}.ace-tomorrow .ace_gutter-active-line {background-color : #dcdcdc}.ace-tomorrow .ace_marker-layer .ace_selected-word {border: 1px solid #D6D6D6}.ace-tomorrow .ace_invisible {color: #D1D1D1}.ace-tomorrow .ace_keyword,.ace-tomorrow .ace_meta,.ace-tomorrow .ace_storage,.ace-tomorrow .ace_storage.ace_type,.ace-tomorrow .ace_support.ace_type {color: #8959A8}.ace-tomorrow .ace_keyword.ace_operator {color: #3E999F}.ace-tomorrow .ace_constant.ace_character,.ace-tomorrow .ace_constant.ace_language,.ace-tomorrow .ace_constant.ace_numeric,.ace-tomorrow .ace_keyword.ace_other.ace_unit,.ace-tomorrow .ace_support.ace_constant,.ace-tomorrow .ace_variable.ace_parameter {color: #F5871F}.ace-tomorrow .ace_constant.ace_other {color: #666969}.ace-tomorrow .ace_invalid {color: #FFFFFF;background-color: #C82829}.ace-tomorrow .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #8959A8}.ace-tomorrow .ace_fold {background-color: #4271AE;border-color: #4D4D4C}.ace-tomorrow .ace_entity.ace_name.ace_function,.ace-tomorrow .ace_support.ace_function,.ace-tomorrow .ace_variable {color: #4271AE}.ace-tomorrow .ace_support.ace_class,.ace-tomorrow .ace_support.ace_type {color: #C99E00}.ace-tomorrow .ace_heading,.ace-tomorrow .ace_markup.ace_heading,.ace-tomorrow .ace_string {color: #718C00}.ace-tomorrow .ace_entity.ace_name.ace_tag,.ace-tomorrow .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow .ace_meta.ace_tag,.ace-tomorrow .ace_string.ace_regexp,.ace-tomorrow .ace_variable {color: #C82829}.ace-tomorrow .ace_comment {color: #8E908C}.ace-tomorrow .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y}",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),function(){ace.require(["ace/theme/tomorrow"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/dom","ace/lib/oop","ace/lib/keys","ace/lib/event","ace/search","ace/lib/useragent","ace/search_highlight","ace/commands/multi_select_commands","ace/mode/text","ace/multi_select"],function(e,t){"use strict";function n(e){return{row:e.line,column:e.ch}}function i(e){return new Rt(e.row,e.column)}function o(e){e.setOption("disableInput",!0),e.setOption("showCursorWhenSelecting",!1),_t.signal(e,"vim-mode-change",{mode:"normal"}),e.on("cursorActivity",ot),S(e),_t.on(e.getInputField(),"paste",h(e))}function r(e){e.setOption("disableInput",!1),e.off("cursorActivity",ot),_t.off(e.getInputField(),"paste",h(e)),e.state.vim=null}function s(e,t){this==_t.keyMap.vim&&_t.rmClass(e.getWrapperElement(),"cm-fat-cursor"),(!t||t.attach!=a)&&r(e)}function a(e,t){this==_t.keyMap.vim&&_t.addClass(e.getWrapperElement(),"cm-fat-cursor"),(!t||t.attach!=a)&&o(e)}function l(e,t){if(!t)return undefined;if(this[e])return this[e];var n=c(e);if(!n)return!1;var i=_t.Vim.findKey(t,n);return"function"==typeof i&&_t.signal(t,"vim-keypress",n),i}function c(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split(/-(?!$)/),n=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==n.length)return!1;for(var i=!1,o=0;o<t.length;o++){var r=t[o];r in Et?t[o]=Et[r]:i=!0,r in Ot&&(t[o]=Ot[r])}return!!i&&(m(n)&&(t[t.length-1]=n.toLowerCase()),"<"+t.join("-")+">")}function h(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(N(e.getCursor(),0,1)),Yt.enterInsertMode(e,{},t))}),t.onPasteFn}function u(e,t){for(var n=[],i=e;i<e+t;i++)n.push(String.fromCharCode(i));return n}function d(e,t){return t>=e.firstLine()&&t<=e.lastLine()}function g(e){return/^[a-z]$/.test(e)}function p(e){return-1!="()[]{}".indexOf(e)}function f(e){return It.test(e)}function m(e){return/^[A-Z]$/.test(e)}function v(e){return/^\s*$/.test(e)}function b(e){return-1!=".?!".indexOf(e)}function w(e,t){for(var n=0;n<t.length;n++)if(t[n]==e)return!0;return!1}function y(e,t,n,i,o){if(t===undefined&&!o)throw Error("defaultValue is required unless callback is provided");if(n||(n="string"),zt[e]={type:n,defaultValue:t,callback:o},i)for(var r=0;r<i.length;r++)zt[i[r]]=zt[e];t&&x(e,t)}function x(e,t,n,i){var o=zt[e];i=i||{};var r=i.scope;if(!o)return new Error("Unknown option: "+e);if("boolean"==o.type){if(t&&!0!==t)return new Error("Invalid argument: "+e+"="+t);!1!==t&&(t=!0)}o.callback?("local"!==r&&o.callback(t,undefined),"global"!==r&&n&&o.callback(t,n)):("local"!==r&&(o.value="boolean"==o.type?!!t:t),"global"!==r&&n&&(n.state.vim.options[e]={value:t}))}function k(e,t,n){var i=zt[e];n=n||{};var o=n.scope;if(!i)return new Error("Unknown option: "+e);{if(!i.callback){var r="global"!==o&&t&&t.state.vim.options[e];return(r||"local"!==o&&i||{}).value}var r=t&&i.callback(undefined,t);if("global"!==o&&r!==undefined)return r;if("local"!==o)return i.callback()}}function C(){this.latestRegister=undefined,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=undefined,this.lastInsertModeChanges=Vt()}function S(e){return e.state.vim||(e.state.vim={inputState:new _,lastEditInputState:undefined,lastEditActionCommand:undefined,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},fakeCursor:null,insertMode:!1,insertModeRepeat:undefined,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{}}),e.state.vim}function $(){Ut={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:undefined,jumpList:Kt(),macroModeState:new C,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new R({}),searchHistoryController:new T,exCommandHistoryController:new T};for(var e in zt){var t=zt[e];t.value=t.defaultValue}}function _(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=null}function A(e,t){e.state.vim.inputState=new _,_t.signal(e,"vim-command-done",t)}function L(e,t,n){this.clear(),this.keyBuffer=[e||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!t,this.blockwise=!!n}function M(e,t){var n=Ut.registerController.registers;if(!e||1!=e.length)throw Error("Register name must be 1 character");n[e]=t,Wt.push(e)}function R(e){this.registers=e,this.unnamedRegister=e['"']=new L,e["."]=new L,e[":"]=new L,e["/"]=new L}function T(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}function E(e,t){Xt[e]=t}function O(e,t){for(var n=[],i=0;i<t;i++)n.push(e);return n}function I(e,t){Qt[e]=t}function F(e,t){Yt[e]=t}function B(e,t,n){var i=Math.min(Math.max(e.firstLine(),t.line),e.lastLine()),o=X(e,i)-1;o=n?o+1:o;var r=Math.min(Math.max(0,t.ch),o);return Rt(i,r)}function H(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function N(e,t,n){return"object"==typeof t&&(n=t.ch,t=t.line),Rt(e.line+t,e.ch+n)}function D(e,t,n,i){for(var o,r=[],s=[],a=0;a<t.length;a++){var l=t[a];"insert"==n&&"insert"!=l.context||l.context&&l.context!=n||i.operator&&"action"==l.type||!(o=P(e,l.keys))||("partial"==o&&r.push(l),"full"==o&&s.push(l))}return{partial:r.length&&r,full:s.length&&s}}function P(e,t){if("<character>"==t.slice(-11)){var n=t.length-11,i=e.slice(0,n),o=t.slice(0,n);return i==o&&e.length>n?"full":0==o.indexOf(i)&&"partial"}return e==t?"full":0==t.indexOf(e)&&"partial"}function W(e){var t=/^.*(<[^>]+>)$/.exec(e),n=t?t[1]:e.slice(-1);if(n.length>1)switch(n){case"<CR>":n="\n";break;case"<Space>":n=" ";break;default:n=""}return n}function z(e,t,n){return function(){for(var i=0;i<n;i++)t(e)}}function K(e){return Rt(e.line,e.ch)}function V(e,t){return e.ch==t.ch&&e.line==t.line}function U(e,t){return e.line<t.line||e.line==t.line&&e.ch<t.ch}function G(e,t){return arguments.length>2&&(t=G.apply(undefined,Array.prototype.slice.call(arguments,1))),U(e,t)?e:t}function j(e,t){return arguments.length>2&&(t=j.apply(undefined,Array.prototype.slice.call(arguments,1))),U(e,t)?t:e}function q(e,t,n){var i=U(e,t),o=U(t,n);return i&&o}function X(e,t){return e.getLine(t).length}function Q(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Y(e){return e.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function J(e,t,n){var i=X(e,t),o=new Array(n-i+1).join(" ");e.setCursor(Rt(t,i)),e.replaceRange(o,e.getCursor())}function Z(e,t){var n=[],i=e.listSelections(),o=K(e.clipPos(t)),r=!V(t,o),s=e.getCursor("head"),a=te(i,s),l=V(i[a].head,i[a].anchor),c=i.length-1,h=c-a>a?c:0,u=i[h].anchor,d=Math.min(u.line,o.line),g=Math.max(u.line,o.line),p=u.ch,f=o.ch,m=i[h].head.ch-p,v=f-p;m>0&&v<=0?(p++,r||f--):m<0&&v>=0?(p--,l||f++):m<0&&-1==v&&(p--,f++);for(var b=d;b<=g;b++){var w={anchor:new Rt(b,p),head:new Rt(b,f)};n.push(w)}return e.setSelections(n),t.ch=f,u.ch=p,u}function ee(e,t,n){for(var i=[],o=0;o<n;o++){var r=N(t,o,0);i.push({anchor:r,head:r})}e.setSelections(i,0)}function te(e,t,n){for(var i=0;i<e.length;i++){var o="head"!=n&&V(e[i].anchor,t),r="anchor"!=n&&V(e[i].head,t);if(o||r)return i}return-1}function ne(e,t){var n=t.lastSelection,i=function(){var t=e.listSelections(),n=t[0],i=t[t.length-1];return[U(n.anchor,n.head)?n.anchor:n.head,U(i.anchor,i.head)?i.head:i.anchor]},o=function(){var t=e.getCursor(),i=e.getCursor(),o=n.visualBlock;if(o){var r=o.width,s=o.height;i=Rt(t.line+s,t.ch+r);for(var a=[],l=t.line;l<i.line;l++){var c=Rt(l,t.ch),h=Rt(l,i.ch),u={anchor:c,head:h};a.push(u)}e.setSelections(a)}else{var d=n.anchorMark.find(),g=n.headMark.find(),p=g.line-d.line,f=g.ch-d.ch;i={line:i.line+p,ch:p?i.ch:f+i.ch},n.visualLine&&(t=Rt(t.line,0),i=Rt(i.line,X(e,i.line))),e.setSelection(t,i)}return[t,i]};return t.visualMode?i():o()}function ie(e,t){var n=t.sel.anchor,i=t.sel.head;t.lastPastedText&&(i=e.posFromIndex(e.indexFromPos(n)+t.lastPastedText.length),t.lastPastedText=null),t.lastSelection={anchorMark:e.setBookmark(n),headMark:e.setBookmark(i),anchor:K(n),head:K(i),visualMode:t.visualMode,visualLine:t.visualLine,visualBlock:t.visualBlock}}function oe(e,t,n){var i,o=e.state.vim.sel,r=o.head,s=o.anchor;return U(n,t)&&(i=n,n=t,t=i),U(r,s)?(r=G(t,r),s=j(s,n)):(s=G(t,s),r=j(r,n),r=N(r,0,-1),-1==r.ch&&r.line!=e.firstLine()&&(r=Rt(r.line-1,X(e,r.line-1)))),[s,r]}function re(e,t,n){var i=e.state.vim;t=t||i.sel;var n=n||i.visualLine?"line":i.visualBlock?"block":"char",o=se(e,t,n);e.setSelections(o.ranges,o.primary),rt(e)}function se(e,t,n,i){var o=K(t.head),r=K(t.anchor);if("char"==n){var s=i||U(t.head,t.anchor)?0:1,a=U(t.head,t.anchor)?1:0;return o=N(t.head,0,s),r=N(t.anchor,0,a),{ranges:[{anchor:r,head:o}],primary:0}}if("line"==n){if(U(t.head,t.anchor))o.ch=0,r.ch=X(e,r.line);else{r.ch=0;var l=e.lastLine();o.line>l&&(o.line=l),o.ch=X(e,o.line)}return{ranges:[{anchor:r,head:o}],primary:0}}if("block"==n){for(var c=Math.min(r.line,o.line),h=Math.min(r.ch,o.ch),u=Math.max(r.line,o.line),d=Math.max(r.ch,o.ch)+1,g=u-c+1,p=o.line==c?0:g-1,f=[],m=0;m<g;m++)f.push({anchor:Rt(c+m,h),head:Rt(c+m,d)});return{ranges:f,primary:p}}}function ae(e){var t=e.getCursor("head");return 1==e.getSelection().length&&(t=G(t,e.getCursor("anchor"))),t}function le(e,t){var n=e.state.vim;!1!==t&&e.setCursor(B(e,n.sel.head)),ie(e,n),n.visualMode=!1,n.visualLine=!1,n.visualBlock=!1,_t.signal(e,"vim-mode-change",{mode:"normal"}),n.fakeCursor&&n.fakeCursor.clear()}function ce(e,t,n){var i=e.getRange(t,n);if(/\n\s*$/.test(i)){var o=i.split("\n");o.pop();for(var r,r=o.pop();o.length>0&&r&&v(r);r=o.pop())n.line--,n.ch=0;r?(n.line--,n.ch=X(e,n.line)):n.ch=0}}function he(e,t,n){t.ch=0,n.ch=0,n.line++}function ue(e){if(!e)return 0;var t=e.search(/\S/);return-1==t?e.length:t}function de(e,t,n,i,o){for(var r=ae(e),s=e.getLine(r.line),a=r.ch,l=o?Ft[0]:Bt[0];!l(s.charAt(a));)if(++a>=s.length)return null;i?l=Bt[0]:(l=Ft[0])(s.charAt(a))||(l=Ft[1]);for(var c=a,h=a;l(s.charAt(c))&&c<s.length;)c++;for(;l(s.charAt(h))&&h>=0;)h--;if(h++,t){for(var u=c;/\s/.test(s.charAt(c))&&c<s.length;)c++;if(u==c){for(var d=h;/\s/.test(s.charAt(h-1))&&h>0;)h--;h||(h=d)}}return{start:Rt(r.line,h),end:Rt(r.line,c)}}function ge(e,t,n){V(t,n)||Ut.jumpList.add(e,t,n)}function pe(e,t){Ut.lastCharacterSearch.increment=e,Ut.lastCharacterSearch.forward=t.forward,Ut.lastCharacterSearch.selectedCharacter=t.selectedCharacter}function fe(e,t,n,i){var o=K(e.getCursor()),r=n?1:-1,s=n?e.lineCount():-1,a=o.ch,l=o.line,c=e.getLine(l),h={lineText:c,nextCh:c.charAt(a),lastCh:null,index:a,symb:i,reverseSymb:(n?{")":"(","}":"{"}:{"(":")","{":"}"})[i],forward:n,depth:0,curMoveThrough:!1},u=Jt[i];if(!u)return o;var d=Zt[u].init,g=Zt[u].isComplete;for(d&&d(h);l!==s&&t;){if(h.index+=r,h.nextCh=h.lineText.charAt(h.index),!h.nextCh){if(l+=r,h.lineText=e.getLine(l)||"",r>0)h.index=0;else{var p=h.lineText.length;h.index=p>0?p-1:0}h.nextCh=h.lineText.charAt(h.index)}g(h)&&(o.line=l,o.ch=h.index,t--)}return h.nextCh||h.curMoveThrough?Rt(l,h.index):o}function me(e,t,n,i,o){var r=t.line,s=t.ch,a=e.getLine(r),l=n?1:-1,c=i?Bt:Ft;if(o&&""==a){if(r+=l,a=e.getLine(r),!d(e,r))return null;s=n?0:a.length}for(;;){if(o&&""==a)return{from:0,to:0,line:r};for(var h=l>0?a.length:-1,u=h,g=h;s!=h;){for(var p=!1,f=0;f<c.length&&!p;++f)if(c[f](a.charAt(s))){for(u=s;s!=h&&c[f](a.charAt(s));)s+=l;if(g=s,p=u!=g,u==t.ch&&r==t.line&&g==u+l)continue;return{from:Math.min(u,g+1),to:Math.max(u,g),line:r}}p||(s+=l)}if(r+=l,!d(e,r))return null;a=e.getLine(r),s=l>0?0:a.length}}function ve(e,t,n,i,o,r){var s=K(t),a=[];(i&&!o||!i&&o)&&n++;for(var l=!i||!o,c=0;c<n;c++){var h=me(e,t,i,r,l);if(!h){var u=X(e,e.lastLine());a.push(i?{line:e.lastLine(),from:u,to:u}:{line:0,from:0,to:0});break}a.push(h),t=Rt(h.line,i?h.to-1:h.from)}var d=a.length!=n,g=a[0],p=a.pop();return i&&!o?(!d&&(g.from!=s.ch||g.line!=s.line)&&(p=a.pop()),Rt(p.line,p.from)):i&&o?Rt(p.line,p.to-1):!i&&o?(!d&&(g.to!=s.ch||g.line!=s.line)&&(p=a.pop()),Rt(p.line,p.to)):Rt(p.line,p.from)}function be(e,t,n,i){for(var o,r=e.getCursor(),s=r.ch,a=0;a<t;a++){if(-1==(o=xe(s,e.getLine(r.line),i,n,!0)))return null;s=o}return Rt(e.getCursor().line,o)}function we(e,t){var n=e.getCursor().line;return B(e,Rt(n,t-1))}function ye(e,t,n,i){w(n,Pt)&&(t.marks[n]&&t.marks[n].clear(),t.marks[n]=e.setBookmark(i))}function xe(e,t,n,i,o){var r;return i?-1!=(r=t.indexOf(n,e+1))&&!o&&(r-=1):-1!=(r=t.lastIndexOf(n,e-1))&&!o&&(r+=1),r}function ke(e,t,n,i,o){function r(t){return!/\S/.test(e.getLine(t))}function s(e,t,n){return n?r(e)!=r(e+t):!r(e)&&r(e+t)}function a(t){i=i>0?1:-1;var n=e.ace.session.getFoldLine(t);n&&t+i>n.start.row&&t+i<n.end.row&&(i=(i>0?n.end.row:n.start.row)-t)}
16
+ var l,c,h=t.line,u=e.firstLine(),d=e.lastLine(),g=h;if(i){for(;u<=g&&g<=d&&n>0;)a(g),s(g,i)&&n--,g+=i;return new Rt(g,0)}var p=e.state.vim;if(p.visualLine&&s(h,1,!0)){var f=p.sel.anchor;s(f.line,-1,!0)&&(!o||f.line!=h)&&(h+=1)}var m=r(h);for(g=h;g<=d&&n;g++)s(g,1,!0)&&(!o||r(g)!=m)&&n--;for(c=new Rt(g,0),g>d&&!m?m=!0:o=!1,g=h;g>u&&(o&&r(g)!=m&&g!=h||!s(g,-1,!0));g--);return l=new Rt(g,0),{start:l,end:c}}function Ce(e,t,n,i){function o(e,t){if(t.pos+t.dir<0||t.pos+t.dir>=t.line.length){if(t.ln+=t.dir,!d(e,t.ln))return t.line=null,t.ln=null,t.pos=null,void 0;t.line=e.getLine(t.ln),t.pos=t.dir>0?0:t.line.length-1}else t.pos+=t.dir}function r(e,t,n,i){var r=e.getLine(t),s=""===r,a={line:r,ln:t,pos:n,dir:i},l={ln:a.ln,pos:a.pos},c=""===a.line;for(o(e,a);null!==a.line;){if(l.ln=a.ln,l.pos=a.pos,""===a.line&&!c)return{ln:a.ln,pos:a.pos};if(s&&""!==a.line&&!v(a.line[a.pos]))return{ln:a.ln,pos:a.pos};b(a.line[a.pos])&&!s&&(a.pos===a.line.length-1||v(a.line[a.pos+1]))&&(s=!0),o(e,a)}var r=e.getLine(l.ln);l.pos=0;for(var h=r.length-1;h>=0;--h)if(!v(r[h])){l.pos=h;break}return l}function s(e,t,n,i){var r=e.getLine(t),s={line:r,ln:t,pos:n,dir:i},a={ln:s.ln,pos:null},l=""===s.line;for(o(e,s);null!==s.line;){if(""===s.line&&!l)return null!==a.pos?a:{ln:s.ln,pos:s.pos};if(b(s.line[s.pos])&&null!==a.pos&&(s.ln!==a.ln||s.pos+1!==a.pos))return a;""!==s.line&&!v(s.line[s.pos])&&(l=!1,a={ln:s.ln,pos:s.pos}),o(e,s)}var r=e.getLine(a.ln);a.pos=0;for(var c=0;c<r.length;++c)if(!v(r[c])){a.pos=c;break}return a}for(var a={ln:t.line,pos:t.ch};n>0;)a=i<0?s(e,a.ln,a.pos,i):r(e,a.ln,a.pos,i),n--;return Rt(a.ln,a.pos)}function Se(e,t,n,i){var o,r,s=t,a={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[n],l={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[n],c=e.getLine(s.line).charAt(s.ch),h=c===l?1:0;if(o=e.scanForBracket(Rt(s.line,s.ch+h),-1,undefined,{bracketRegex:a}),r=e.scanForBracket(Rt(s.line,s.ch+h),1,undefined,{bracketRegex:a}),!o||!r)return{start:s,end:s};if(o=o.pos,r=r.pos,o.line==r.line&&o.ch>r.ch||o.line>r.line){var u=o;o=r,r=u}return i?r.ch+=1:o.ch+=1,{start:o,end:r}}function $e(e,t,n,i){var o,r,s,a,l=K(t),c=e.getLine(l.line),h=c.split(""),u=h.indexOf(n);if(l.ch<u?l.ch=u:u<l.ch&&h[l.ch]==n&&(r=l.ch,--l.ch),h[l.ch]!=n||r)for(s=l.ch;s>-1&&!o;s--)h[s]==n&&(o=s+1);else o=l.ch+1;if(o&&!r)for(s=o,a=h.length;s<a&&!r;s++)h[s]==n&&(r=s);return o&&r?(i&&(--o,++r),{start:Rt(l.line,o),end:Rt(l.line,r)}):{start:l,end:l}}function _e(){}function Ae(e){var t=e.state.vim;return t.searchState_||(t.searchState_=new _e)}function Le(e,t,n,i,o){e.openDialog?e.openDialog(t,i,{bottom:!0,value:o.value,onKeyDown:o.onKeyDown,onKeyUp:o.onKeyUp,selectValueOnOpen:!1,onClose:function(){e.state.vim&&(e.state.vim.status="",e.ace.renderer.$loop.schedule(e.ace.renderer.CHANGE_CURSOR))}}):i(prompt(n,""))}function Me(e){return Te(e,"/")}function Re(e){return Ee(e,"/")}function Te(e,t){var n=Ee(e,t)||[];if(!n.length)return[];var i=[];if(0===n[0]){for(var o=0;o<n.length;o++)"number"==typeof n[o]&&i.push(e.substring(n[o]+1,n[o+1]));return i}}function Ee(e,t){t||(t="/");for(var n=!1,i=[],o=0;o<e.length;o++){var r=e.charAt(o);!n&&r==t&&i.push(o),n=!n&&"\\"==r}return i}function Oe(e){for(var t="|(){",n="}",i=!1,o=[],r=-1;r<e.length;r++){var s=e.charAt(r)||"",a=e.charAt(r+1)||"",l=a&&-1!=t.indexOf(a);i?(("\\"!==s||!l)&&o.push(s),i=!1):"\\"===s?(i=!0,a&&-1!=n.indexOf(a)&&(l=!0),(!l||"\\"===a)&&o.push(s)):(o.push(s),l&&"\\"!==a&&o.push("\\"))}return o.join("")}function Ie(e){for(var t=!1,n=[],i=-1;i<e.length;i++){var o=e.charAt(i)||"",r=e.charAt(i+1)||"";en[o+r]?(n.push(en[o+r]),i++):t?(n.push(o),t=!1):"\\"===o?(t=!0,f(r)||"$"===r?n.push("$"):"/"!==r&&"\\"!==r&&n.push("\\")):("$"===o&&n.push("$"),n.push(o),"/"===r&&n.push("\\"))}return n.join("")}function Fe(e){for(var t=new _t.StringStream(e),n=[];!t.eol();){for(;t.peek()&&"\\"!=t.peek();)n.push(t.next());var i=!1;for(var o in tn)if(t.match(o,!0)){i=!0,n.push(tn[o]);break}i||n.push(t.next())}return n.join("")}function Be(e,t,n){if(Ut.registerController.getRegister("/").setText(e),e instanceof RegExp)return e;var i,o,r=Re(e);if(r.length){i=e.substring(0,r[0]);o=-1!=e.substring(r[0]).indexOf("i")}else i=e;return i?(k("pcre")||(i=Oe(i)),n&&(t=/^[^A-Z]*$/.test(i)),new RegExp(i,t||o?"i":undefined)):null}function He(e,t){e.openNotification?e.openNotification('<span style="color: red">'+t+"</span>",{bottom:!0,duration:5e3}):alert(t)}function Ne(e,t){var n='<span style="font-family: monospace; white-space: pre">'+(e||"")+'<input type="text" autocorrect="off" autocapitalize="none" autocomplete="off"></span>';return t&&(n+=' <span style="color: #888">'+t+"</span>"),n}function De(e,t){var n=(t.prefix||"")+" "+(t.desc||"");Le(e,Ne(t.prefix,t.desc),n,t.onClose,t)}function Pe(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var n=["global","multiline","ignoreCase","source"],i=0;i<n.length;i++){var o=n[i];if(e[o]!==t[o])return!1}return!0}return!1}function We(e,t,n,i){if(t){var o=Ae(e),r=Be(t,!!n,!!i);if(r)return Ke(e,r),Pe(r,o.getQuery())?r:(o.setQuery(r),r)}}function ze(e){if("^"==e.source.charAt(0))var t=!0;return{token:function(n){if(t&&!n.sol())return void n.skipToEnd();var i=n.match(e,!1);if(i)return 0==i[0].length?(n.next(),"searching"):n.sol()||(n.backUp(1),e.exec(n.next()+i[0]))?(n.match(e),"searching"):(n.next(),null);for(;!n.eol()&&(n.next(),!n.match(e,!1)););},query:e}}function Ke(e,t){var n=Ae(e),i=n.getOverlay();i&&t==i.query||(i&&e.removeOverlay(i),i=ze(t),e.addOverlay(i),e.showMatchesOnScrollbar&&(n.getScrollbarAnnotate()&&n.getScrollbarAnnotate().clear(),n.setScrollbarAnnotate(e.showMatchesOnScrollbar(t))),n.setOverlay(i))}function Ve(e,t,n,i){return i===undefined&&(i=1),e.operation(function(){for(var o=e.getCursor(),r=e.getSearchCursor(n,o),s=0;s<i;s++){var a=r.find(t);if(0==s&&a&&V(r.from(),o)&&(a=r.find(t)),!a&&(r=e.getSearchCursor(n,t?Rt(e.lastLine()):Rt(e.firstLine(),0)),!r.find(t)))return}return r.from()})}function Ue(e){var t=Ae(e);e.removeOverlay(Ae(e).getOverlay()),t.setOverlay(null),t.getScrollbarAnnotate()&&(t.getScrollbarAnnotate().clear(),t.setScrollbarAnnotate(null))}function Ge(e,t,n){return"number"!=typeof e&&(e=e.line),t instanceof Array?w(e,t):n?e>=t&&e<=n:e==t}function je(e){var t=e.ace.renderer;return{top:t.getFirstFullyVisibleRow(),bottom:t.getLastFullyVisibleRow()}}function qe(e,t,n){var i=t.marks[n];return i&&i.find()}function Xe(e,t,n,i,o,r,s,a,l){function c(){e.operation(function(){for(;!p;)h(),u();d()})}function h(){var t=e.getRange(r.from(),r.to()),n=t.replace(s,a);r.replace(n)}function u(){for(;r.findNext()&&Ge(r.from(),i,o);)if(n||!f||r.from().line!=f.line)return e.scrollIntoView(r.from(),30),e.setSelection(r.from(),r.to()),f=r.from(),p=!1,void 0;p=!0}function d(t){if(t&&t(),e.focus(),f){e.setCursor(f);var n=e.state.vim;n.exMode=!1,n.lastHPos=n.lastHSPos=f.ch}l&&l()}function g(t,n,i){switch(_t.e_stop(t),_t.keyName(t)){case"Y":h(),u();break;case"N":u();break;case"A":var o=l;l=undefined,e.operation(c),l=o;break;case"L":h();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":d(i)}return p&&d(i),!0}e.state.vim.exMode=!0;var p=!1,f=r.from();return u(),p?void He(e,"No matches for "+s.source):t?void De(e,{prefix:"replace with <strong>"+a+"</strong> (y/n/a/q/l)",onKeyDown:g}):(c(),void(l&&l()))}function Qe(e){var t=e.state.vim,n=Ut.macroModeState,i=Ut.registerController.getRegister("."),o=n.isPlaying,r=n.lastInsertModeChanges;o||(e.off("change",it),_t.off(e.getInputField(),"keydown",lt)),!o&&t.insertModeRepeat>1&&(ct(e,t,t.insertModeRepeat-1,!0),t.lastEditInputState.repeatOverride=t.insertModeRepeat),delete t.insertModeRepeat,t.insertMode=!1,e.setCursor(e.getCursor().line,e.getCursor().ch-1),e.setOption("keyMap","vim"),e.setOption("disableInput",!0),e.toggleOverwrite(!1),i.setText(r.changes.join("")),_t.signal(e,"vim-mode-change",{mode:"normal"}),n.isRecording&&tt(n)}function Ye(e){At.unshift(e)}function Je(e,t,n,i,o){var r={keys:e,type:t};r[t]=n,r[t+"Args"]=i;for(var s in o)r[s]=o[s];Ye(r)}function Ze(e,t,n,i){var o=Ut.registerController.getRegister(i);if(":"==i)return o.keyBuffer[0]&&sn.processCommand(e,o.keyBuffer[0]),void(n.isPlaying=!1);var r=o.keyBuffer,s=0;n.isPlaying=!0,n.replaySearchQueries=o.searchQueries.slice(0);for(var a=0;a<r.length;a++)for(var l,c,h=r[a];h;)if(l=/<\w+-.+?>|<\w+>|./.exec(h),c=l[0],h=h.substring(l.index+c.length),_t.Vim.handleKey(e,c,"macro"),t.insertMode){var u=o.insertModeChanges[s++].changes;Ut.macroModeState.lastInsertModeChanges.changes=u,ht(e,u,1),Qe(e)}n.isPlaying=!1}function et(e,t){if(!e.isPlaying){var n=e.latestRegister,i=Ut.registerController.getRegister(n);i&&i.pushText(t)}}function tt(e){if(!e.isPlaying){var t=e.latestRegister,n=Ut.registerController.getRegister(t);n&&n.pushInsertModeChanges&&n.pushInsertModeChanges(e.lastInsertModeChanges)}}function nt(e,t){if(!e.isPlaying){var n=e.latestRegister,i=Ut.registerController.getRegister(n);i&&i.pushSearchQuery&&i.pushSearchQuery(t)}}function it(e,t){var n=Ut.macroModeState,i=n.lastInsertModeChanges;if(!n.isPlaying)for(;t;){if(i.expectCursorActivityForChange=!0,i.ignoreCount>1)i.ignoreCount--;else if("+input"==t.origin||"paste"==t.origin||t.origin===undefined){var o=e.listSelections().length;o>1&&(i.ignoreCount=o);var r=t.text.join("\n");i.maybeReset&&(i.changes=[],i.maybeReset=!1),r&&(e.state.overwrite&&!/\n/.test(r)?i.changes.push([r]):i.changes.push(r))}t=t.next}}function ot(e){var t=e.state.vim;if(t.insertMode){var n=Ut.macroModeState;if(n.isPlaying)return;var i=n.lastInsertModeChanges;i.expectCursorActivityForChange?i.expectCursorActivityForChange=!1:i.maybeReset=!0}else e.curOp.isVimOp||st(e,t);t.visualMode&&rt(e)}function rt(e){var t=e.state.vim,n=B(e,K(t.sel.head)),i=N(n,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(n,i,{className:"cm-animate-fat-cursor"})}function st(e,t,n){var i=e.getCursor("anchor"),o=e.getCursor("head");if(t.visualMode&&!e.somethingSelected()?le(e,!1):!t.visualMode&&!t.insertMode&&e.somethingSelected()&&(t.visualMode=!0,t.visualLine=!1,_t.signal(e,"vim-mode-change",{mode:"visual"})),t.visualMode){var r=U(o,i)?0:-1,s=U(o,i)?-1:0;o=N(o,0,r),i=N(i,0,s),t.sel={anchor:i,head:o},ye(e,t,"<",G(o,i)),ye(e,t,">",j(o,i))}else!t.insertMode&&!n&&(t.lastHPos=e.getCursor().ch)}function at(e){this.keyName=e}function lt(e){function t(){return i.maybeReset&&(i.changes=[],i.maybeReset=!1),i.changes.push(new at(o)),!0}var n=Ut.macroModeState,i=n.lastInsertModeChanges,o=_t.keyName(e);o&&(-1!=o.indexOf("Delete")||-1!=o.indexOf("Backspace"))&&_t.lookupKey(o,"vim-insert",t)}function ct(e,t,n,i){function o(){a?qt.processAction(e,t,t.lastEditActionCommand):qt.evalInput(e,t)}function r(n){if(s.lastInsertModeChanges.changes.length>0){n=t.lastEditActionCommand?n:1;var i=s.lastInsertModeChanges;ht(e,i.changes,n)}}var s=Ut.macroModeState;s.isPlaying=!0;var a=!!t.lastEditActionCommand,l=t.inputState;if(t.inputState=t.lastEditInputState,a&&t.lastEditActionCommand.interlaceInsertRepeat)for(var c=0;c<n;c++)o(),r(1);else i||o(),r(n);t.inputState=l,t.insertMode&&!i&&Qe(e),s.isPlaying=!1}function ht(e,t,n){function i(t){return"string"==typeof t?_t.commands[t](e):t(e),!0}var o=e.getCursor("head"),r=Ut.macroModeState.lastInsertModeChanges.visualBlock;r&&(ee(e,o,r+1),n=e.listSelections().length,e.setCursor(o));for(var s=0;s<n;s++){r&&e.setCursor(N(o,s,0));for(var a=0;a<t.length;a++){var l=t[a];if(l instanceof at)_t.lookupKey(l.keyName,"vim-insert",i);else if("string"==typeof l){var c=e.getCursor();e.replaceRange(l,c,c)}else{var h=e.getCursor(),u=N(h,0,l[0].length);e.replaceRange(l[0],h,u)}}}r&&e.setCursor(N(o,0,1))}function ut(e,t,n){t.length>1&&"n"==t[0]&&(t=t.replace("numpad","")),t=an[t]||t;var i="";return n.ctrlKey&&(i+="C-"),n.altKey&&(i+="A-"),(i||t.length>1)&&n.shiftKey&&(i+="S-"),i+=t,i.length>1&&(i="<"+i+">"),i}function dt(e){var t=new e.constructor;return Object.keys(e).forEach(function(n){var i=e[n];Array.isArray(i)?i=i.slice():i&&"object"==typeof i&&i.constructor!=Object&&(i=dt(i)),t[n]=i}),e.sel&&(t.sel={head:e.sel.head&&K(e.sel.head),anchor:e.sel.anchor&&K(e.sel.anchor)}),t}function gt(e,t,n){var i=!1,o=Tt.maybeInitVimState_(e),r=o.visualBlock||o.wasInVisualBlock,s=e.ace.inMultiSelectMode;if(o.wasInVisualBlock&&!s?o.wasInVisualBlock=!1:s&&o.visualBlock&&(o.wasInVisualBlock=!0),"<Esc>"!=t||o.insertMode||o.visualMode||!s)if(r||!s||e.ace.inVirtualSelectionMode)i=Tt.handleKey(e,t,n);else{var a=dt(o);e.operation(function(){e.ace.forEachSelection(function(){var o=e.ace.selection;e.state.vim.lastHPos=null==o.$desiredColumn?o.lead.column:o.$desiredColumn;var r=e.getCursor("head"),s=e.getCursor("anchor"),l=U(r,s)?0:-1,c=U(r,s)?-1:0;r=N(r,0,l),s=N(s,0,c),e.state.vim.sel.head=r,e.state.vim.sel.anchor=s,i=ln(e,t,n),o.$desiredColumn=-1==e.state.vim.lastHPos?null:e.state.vim.lastHPos,e.virtualSelectionMode()&&(e.state.vim=dt(a))}),e.curOp.cursorActivity&&!i&&(e.curOp.cursorActivity=!1)},!0)}else e.ace.exitMultiSelectMode();return i&&!o.visualMode&&!o.insert&&o.visualMode!=e.somethingSelected()&&st(e,o,!0),i}function pt(e,t){t.off("beforeEndOperation",pt);var n=t.state.cm.vimCmd;n&&t.execCommand(n.exec?n:n.name,n.args),t.curOp=t.prevOp}var ft=e("../range").Range,mt=e("../lib/event_emitter").EventEmitter,vt=e("../lib/dom"),bt=e("../lib/oop"),wt=e("../lib/keys"),yt=e("../lib/event"),xt=e("../search").Search,kt=e("../lib/useragent"),Ct=e("../search_highlight").SearchHighlight,St=e("../commands/multi_select_commands"),$t=e("../mode/text").Mode.prototype.tokenRe;e("../multi_select");var _t=function(e){this.ace=e,this.state={},this.marks={},this.$uid=0,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this),this.onBeforeEndOperation=this.onBeforeEndOperation.bind(this),this.ace.on("change",this.onChange),this.ace.on("changeSelection",this.onSelectionChange),this.ace.on("beforeEndOperation",this.onBeforeEndOperation)};_t.Pos=function(e,t){if(!(this instanceof Rt))return new Rt(e,t);this.line=e,this.ch=t},_t.defineOption=function(){},_t.commands={redo:function(e){e.ace.redo()},undo:function(e){e.ace.undo()},newlineAndIndent:function(e){e.ace.insert("\n")}},_t.keyMap={},_t.addClass=_t.rmClass=function(){},_t.e_stop=_t.e_preventDefault=yt.stopEvent,_t.keyName=function(e){var t=wt[e.keyCode]||e.key||"";return 1==t.length&&(t=t.toUpperCase()),t=yt.getModifierString(e).replace(/(^|-)\w/g,function(e){return e.toUpperCase()})+t},_t.keyMap["default"]=function(e){return function(t){var n=t.ace.commands.commandKeyBinding[e.toLowerCase()];return n&&!1!==t.ace.execCommand(n)}},_t.lookupKey=function e(t,n,i){n||(n="default"),"string"==typeof n&&(n=_t.keyMap[n]);var o="function"==typeof n?n(t):n[t];if(!1===o)return"nothing";if("..."===o)return"multi";if(null!=o&&i(o))return"handled";if(n.fallthrough){if(!Array.isArray(n.fallthrough))return e(t,n.fallthrough,i);for(var r=0;r<n.fallthrough.length;r++){var s=e(t,n.fallthrough[r],i);if(s)return s}}},_t.signal=function(e,t,n){return e._signal(t,n)},_t.on=yt.addListener,_t.off=yt.removeListener,_t.isWordChar=function(e){return e<"\x7f"?/^\w$/.test(e):($t.lastIndex=0,$t.test(e))},function(){bt.implement(_t.prototype,mt),this.destroy=function(){this.ace.off("change",this.onChange),this.ace.off("changeSelection",this.onSelectionChange),this.ace.off("beforeEndOperation",this.onBeforeEndOperation),this.removeOverlay()},this.virtualSelectionMode=function(){return this.ace.inVirtualSelectionMode&&this.ace.selection.index},this.onChange=function(e){var t={text:"i"==e.action[0]?e.lines:[]},n=this.curOp=this.curOp||{};n.changeHandlers||(n.changeHandlers=this._eventRegistry.change&&this._eventRegistry.change.slice()),n.lastChange?n.lastChange.next=n.lastChange=t:n.lastChange=n.change=t,this.$updateMarkers(e)},this.onSelectionChange=function(){var e=this.curOp=this.curOp||{};e.cursorActivityHandlers||(e.cursorActivityHandlers=this._eventRegistry.cursorActivity&&this._eventRegistry.cursorActivity.slice()),this.curOp.cursorActivity=!0,this.ace.inMultiSelectMode&&this.ace.keyBinding.removeKeyboardHandler(St.keyboardHandler)},this.operation=function(e,t){if(!t&&this.curOp||t&&this.curOp&&this.curOp.force)return e();if((t||!this.ace.curOp)&&this.curOp&&this.onBeforeEndOperation(),!this.ace.curOp){var n=this.ace.prevOp;this.ace.startOperation({command:{name:"vim",scrollIntoView:"cursor"}})}var i=this.curOp=this.curOp||{};this.curOp.force=t;var o=e();return this.ace.curOp&&"vim"==this.ace.curOp.command.name&&(this.state.dialog&&(this.ace.curOp.command.scrollIntoView=!1),this.ace.endOperation(),!i.cursorActivity&&!i.lastChange&&n&&(this.ace.prevOp=n)),(t||!this.ace.curOp)&&this.curOp&&this.onBeforeEndOperation(),o},this.onBeforeEndOperation=function(){var e=this.curOp;e&&(e.change&&this.signal("change",e.change,e),e&&e.cursorActivity&&this.signal("cursorActivity",null,e),this.curOp=null)},this.signal=function(e,t,n){var i=n?n[e+"Handlers"]:(this._eventRegistry||{})[e];if(i){i=i.slice();for(var o=0;o<i.length;o++)i[o](this,t)}},this.firstLine=function(){return 0},this.lastLine=function(){return this.ace.session.getLength()-1},this.lineCount=function(){return this.ace.session.getLength()},this.setCursor=function(e,t){"object"==typeof e&&(t=e.ch,e=e.line),this.ace.inVirtualSelectionMode||this.ace.exitMultiSelectMode(),this.ace.session.unfold({row:e,column:t}),this.ace.selection.moveTo(e,t)},this.getCursor=function(e){var t=this.ace.selection;return i("anchor"==e?t.isEmpty()?t.lead:t.anchor:"head"!=e&&e?t.getRange()[e]:t.lead)},this.listSelections=function(){var e=this.ace.multiSelect.rangeList.ranges;return!e.length||this.ace.inVirtualSelectionMode?[{anchor:this.getCursor("anchor"),head:this.getCursor("head")}]:e.map(function(e){return{anchor:this.clipPos(i(e.cursor==e.end?e.start:e.end)),head:this.clipPos(i(e.cursor))}},this)},this.setSelections=function(e,t){var i=this.ace.multiSelect,o=e.map(function(e){var t=n(e.anchor),i=n(e.head),o=ft.comparePoints(t,i)<0?new ft.fromPoints(t,i):new ft.fromPoints(i,t);return o.cursor=ft.comparePoints(o.start,i)?o.end:o.start,o});if(this.ace.inVirtualSelectionMode)return void this.ace.selection.fromOrientedRange(o[0]);t?o[t]&&o.push(o.splice(t,1)[0]):o=o.reverse(),i.toSingleRange(o[0].clone());for(var r=this.ace.session,s=0;s<o.length;s++){var a=r.$clipRangeToDocument(o[s]);i.addRange(a)}},this.setSelection=function(e,t,n){var i=this.ace.selection;i.moveTo(e.line,e.ch),i.selectTo(t.line,t.ch),n&&"*mouse"==n.origin&&this.onBeforeEndOperation()},this.somethingSelected=function(){return!this.ace.selection.isEmpty()},this.clipPos=function(e){return i(this.ace.session.$clipPositionToDocument(e.line,e.ch))},this.markText=function(){return{clear:function(){},find:function(){}}},this.$updateMarkers=function(e){var t="insert"==e.action,n=e.start,i=e.end,o=(i.row-n.row)*(t?1:-1),r=(i.column-n.column)*(t?1:-1);t&&(i=n);for(var s in this.marks){var a=this.marks[s],l=ft.comparePoints(a,n);if(!(l<0)){if(0===l&&t){if(1!=a.bias){a.bias=-1;continue}l=1}var c=t?l:ft.comparePoints(a,i);c>0?(a.row+=o,a.column+=a.row==i.row?r:0):!t&&c<=0&&(a.row=n.row,a.column=n.column,0===c&&(a.bias=1))}}};var e=function(e,t,n,i){this.cm=e,this.id=t,this.row=n,this.column=i,e.marks[this.id]=this};e.prototype.clear=function(){delete this.cm.marks[this.id]},e.prototype.find=function(){return i(this)},this.setBookmark=function(t,n){var i=new e(this,this.$uid++,t.line,t.ch);return n&&n.insertLeft||(i.$insertRight=!0),this.marks[i.id]=i,i},this.moveH=function(e,t){if("char"==t){var n=this.ace.selection;n.clearSelection(),n.moveCursorBy(0,e)}},this.findPosV=function(e,t,n,o){if("page"==n){var r=this.ace.renderer,s=r.layerConfig;t*=Math.floor(s.height/s.lineHeight),n="line"}if("line"==n){var a=this.ace.session.documentToScreenPosition(e.line,e.ch);null!=o&&(a.column=o),a.row+=t,a.row=Math.min(Math.max(0,a.row),this.ace.session.getScreenLength()-1);return i(this.ace.session.screenToDocumentPosition(a.row,a.column))}},this.charCoords=function(e,t){if("div"==t||!t){var n=this.ace.session.documentToScreenPosition(e.line,e.ch);return{left:n.column,top:n.row}}if("local"==t){var i=this.ace.renderer,n=this.ace.session.documentToScreenPosition(e.line,e.ch),o=i.layerConfig.lineHeight,r=i.layerConfig.characterWidth,s=o*n.row;return{left:n.column*r,top:s,bottom:s+o}}},this.coordsChar=function(e,t){var n=this.ace.renderer;if("local"==t){var o=Math.max(0,Math.floor(e.top/n.lineHeight)),r=Math.max(0,Math.floor(e.left/n.characterWidth));return i(n.session.screenToDocumentPosition(o,r))}if("div"==t)throw"not implemented"},this.getSearchCursor=function(e,t){var n=!1,o=!1;e instanceof RegExp&&!e.global&&(n=!e.ignoreCase,e=e.source,o=!0);var r=new xt;t.ch==undefined&&(t.ch=Number.MAX_VALUE);var s={row:t.line,column:t.ch},a=this,l=null;return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){r.setOptions({needle:e,caseSensitive:n,wrap:!1,backwards:t,regExp:o,start:l||s});var i=r.find(a.ace.session);return i&&i.isEmpty()&&a.getLine(i.start.row).length==i.start.column&&(r.$options.start=i,i=r.find(a.ace.session)),l=i},from:function(){return l&&i(l.start)},to:function(){return l&&i(l.end)},replace:function(e){l&&(l.end=a.ace.session.doc.replace(l,e))}}},this.scrollTo=function(e,t){var n=this.ace.renderer,i=n.layerConfig,o=i.maxHeight;o-=(n.$size.scrollerHeight-n.lineHeight)*n.$scrollPastEnd,null!=t&&this.ace.session.setScrollTop(Math.max(0,Math.min(t,o))),null!=e&&this.ace.session.setScrollLeft(Math.max(0,Math.min(e,i.width)))},this.scrollInfo=function(){return 0},this.scrollIntoView=function(e,t){if(e){var i=this.ace.renderer,o={top:0,bottom:t};i.scrollCursorIntoView(n(e),2*i.lineHeight/i.$size.scrollerHeight,o)}},this.getLine=function(e){return this.ace.session.getLine(e)},this.getRange=function(e,t){return this.ace.session.getTextRange(new ft(e.line,e.ch,t.line,t.ch))},this.replaceRange=function(e,t,n){return n||(n=t),this.ace.session.replace(new ft(t.line,t.ch,n.line,n.ch),e)},this.replaceSelections=function(e){var t=this.ace.selection;if(this.ace.inVirtualSelectionMode)return void this.ace.session.replace(t.getRange(),e[0]||"");t.inVirtualSelectionMode=!0;var n=t.rangeList.ranges;n.length||(n=[this.ace.multiSelect.getRange()]);for(var i=n.length;i--;)this.ace.session.replace(n[i],e[i]||"");t.inVirtualSelectionMode=!1},this.getSelection=function(){return this.ace.getSelectedText()},this.getSelections=function(){return this.listSelections().map(function(e){return this.getRange(e.anchor,e.head)},this)},this.getInputField=function(){return this.ace.textInput.getElement()},this.getWrapperElement=function(){return this.ace.container};var t={indentWithTabs:"useSoftTabs",indentUnit:"tabSize",tabSize:"tabSize",firstLineNumber:"firstLineNumber",readOnly:"readOnly"};this.setOption=function(e,n){switch(this.state[e]=n,e){case"indentWithTabs":e=t[e],n=!n;break;case"keyMap":return void(this.state.$keyMap=n);default:e=t[e]}e&&this.ace.setOption(e,n)},this.getOption=function(e,n){var i=t[e];switch(i&&(n=this.ace.getOption(i)),e){case"indentWithTabs":return e=t[e],!n;case"keyMap":return this.state.$keyMap}return i?n:this.state[e]},this.toggleOverwrite=function(e){return this.state.overwrite=e,this.ace.setOverwrite(e)},this.addOverlay=function(e){if(!this.$searchHighlight||!this.$searchHighlight.session){var t=new Ct(null,"ace_highlight-marker","text"),n=this.ace.session.addDynamicMarker(t);t.id=n.id,t.session=this.ace.session,t.destroy=function(){t.session.off("change",t.updateOnChange),t.session.off("changeEditor",t.destroy),t.session.removeMarker(t.id),t.session=null},t.updateOnChange=function(e){var n=e.start.row;n==e.end.row?t.cache[n]=undefined:t.cache.splice(n,t.cache.length)},t.session.on("changeEditor",t.destroy),t.session.on("change",t.updateOnChange)}var i=new RegExp(e.query.source,"gmi");this.$searchHighlight=e.highlight=t,this.$searchHighlight.setRegexp(i),this.ace.renderer.updateBackMarkers()},this.removeOverlay=function(){this.$searchHighlight&&this.$searchHighlight.session&&this.$searchHighlight.destroy()},this.getScrollInfo=function(){var e=this.ace.renderer,t=e.layerConfig;return{left:e.scrollLeft,top:e.scrollTop,height:t.maxHeight,width:t.width,clientHeight:t.height,clientWidth:t.width}},this.getValue=function(){return this.ace.getValue()},this.setValue=function(e){return this.ace.setValue(e,-1)},this.getTokenTypeAt=function(e){var t=this.ace.session.getTokenAt(e.line,e.ch);return t&&/comment|string/.test(t.type)?"string":""},this.findMatchingBracket=function(e){var t=this.ace.session.findMatchingBracket(n(e));return{to:t&&i(t)}},this.indentLine=function(e,t){!0===t?this.ace.session.indentRows(e,e,"\t"):!1===t&&this.ace.session.outdentRows(new ft(e,0,e,0))},this.indexFromPos=function(e){return this.ace.session.doc.positionToIndex(n(e))},this.posFromIndex=function(e){return i(this.ace.session.doc.indexToPosition(e))},this.focus=function(){return this.ace.textInput.focus()},this.blur=function(){return this.ace.blur()},this.defaultTextHeight=function(){return this.ace.renderer.layerConfig.lineHeight},this.scanForBracket=function(e,t,o,r){var s=r.bracketRegex.source,a=/paren|text|operator|tag/;if(1==t)var l=this.ace.session.$findClosingBracket(s.slice(1,2),n(e),a);else var l=this.ace.session.$findOpeningBracket(s.slice(-2,-1),{row:e.line,column:e.ch+1},a);return l&&{pos:i(l)}},this.refresh=function(){return this.ace.resize(!0)},this.getMode=function(){return{name:this.getOption("mode")}},this.execCommand=function(){}}.call(_t.prototype),(_t.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0}).prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var n=t==e;else var n=t&&(e.test?e.test(t):e(t));if(n)return++this.pos,t},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){throw"not implemented"},indentation:function(){throw"not implemented"},match:function(e,t,n){if("string"!=typeof e){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var o=function(e){return n?e.toLowerCase():e};if(o(this.string.substr(this.pos,e.length))==o(e))return!1!==t&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}},_t.defineExtension=function(e,t){_t.prototype[e]=t},vt.importCssString(".normal-mode .ace_cursor{ border: none; background-color: rgba(255,0,0,0.5);}.normal-mode .ace_hidden-cursors .ace_cursor{ background-color: transparent; border: 1px solid red; opacity: 0.7}.ace_dialog { position: absolute; left: 0; right: 0; background: inherit; z-index: 15; padding: .1em .8em; overflow: hidden; color: inherit;}.ace_dialog-top { border-bottom: 1px solid #444; top: 0;}.ace_dialog-bottom { border-top: 1px solid #444; bottom: 0;}.ace_dialog input { border: none; outline: none; background: transparent; width: 20em; color: inherit; font-family: monospace;}","vimMode"),function(){function e(e,t,n){var i;return i=e.ace.container.appendChild(document.createElement("div")),i.className=n?"ace_dialog ace_dialog-bottom":"ace_dialog ace_dialog-top","string"==typeof t?i.innerHTML=t:i.appendChild(t),i}function t(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}_t.defineExtension("openDialog",function(n,i,o){function r(e){if("string"==typeof e)h.value=e;else{if(a)return;if(e&&"blur"==e.type&&document.activeElement===h)return;l.state.dialog=null,a=!0,s.parentNode.removeChild(s),l.focus(),o.onClose&&o.onClose(s)}}if(!this.virtualSelectionMode()){o||(o={}),t(this,null);var s=e(this,n,o.bottom),a=!1,l=this;this.state.dialog=s;var c,h=s.getElementsByTagName("input")[0];return h?(o.value&&(h.value=o.value,!1!==o.selectValueOnOpen&&h.select()),o.onInput&&_t.on(h,"input",function(e){o.onInput(e,h.value,r)}),o.onKeyUp&&_t.on(h,"keyup",function(e){o.onKeyUp(e,h.value,r)}),_t.on(h,"keydown",function(e){o&&o.onKeyDown&&o.onKeyDown(e,h.value,r)||(13==e.keyCode&&i(h.value),(27==e.keyCode||!1!==o.closeOnEnter&&13==e.keyCode)&&(h.blur(),_t.e_stop(e),r()))}),!1!==o.closeOnBlur&&_t.on(h,"blur",r),h.focus()):(c=s.getElementsByTagName("button")[0])&&(_t.on(c,"click",function(){r(),l.focus()}),!1!==o.closeOnBlur&&_t.on(c,"blur",r),c.focus()),r}}),_t.defineExtension("openNotification",function(n,i){function o(){a||(a=!0,clearTimeout(r),s.parentNode.removeChild(s))}if(!this.virtualSelectionMode()){t(this,o);var r,s=e(this,n,i&&i.bottom),a=!1,l=i&&"undefined"!=typeof i.duration?i.duration:5e3;return _t.on(s,"click",function(e){_t.e_preventDefault(e),o()}),l&&(r=setTimeout(o,l)),o}})}();var At=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"<Del>",type:"keyToKey",toKeys:"x",context:"normal"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{
17
+ forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<character>",type:"action",action:"replayMacro"},{keys:"q<character>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<character>",type:"action",action:"setMark"},{keys:'"<character>',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<character>",type:"motion",motion:"textObjectManipulation"},{keys:"i<character>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],Lt=At.length,Mt=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],Rt=_t.Pos,Tt=function(){return jt};_t.defineOption("vimMode",!1,function(e,t,n){t&&"vim"!=e.getOption("keyMap")?e.setOption("keyMap","vim"):!t&&n!=_t.Init&&/^vim/.test(e.getOption("keyMap"))&&e.setOption("keyMap","default")});var Et={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A"},Ot={Enter:"CR",Backspace:"BS",Delete:"Del",Insert:"Ins"},It=/[\d]/,Ft=[_t.isWordChar,function(e){return e&&!_t.isWordChar(e)&&!/\s/.test(e)}],Bt=[function(e){return/\S/.test(e)}],Ht=u(65,26),Nt=u(97,26),Dt=u(48,10),Pt=[].concat(Ht,Nt,Dt,["<",">"]),Wt=[].concat(Ht,Nt,Dt,["-",'"',".",":","/"]),zt={};y("filetype",undefined,"string",["ft"],function(e,t){if(t!==undefined){if(e===undefined){var n=t.getOption("mode");return"null"==n?"":n}var n=""==e?"null":e;t.setOption("mode",n)}});var Kt=function(){function e(e,t,a){function l(t){var o=++i%n,r=s[o];r&&r.clear(),s[o]=e.setBookmark(t)}var c=i%n,h=s[c];if(h){var u=h.find();u&&!V(u,t)&&l(t)}else l(t);l(a),o=i,(r=i-n+1)<0&&(r=0)}function t(e,t){i+=t,i>o?i=o:i<r&&(i=r);var a=s[(n+i)%n];if(a&&!a.find()){var l,c=t>0?1:-1,h=e.getCursor();do{if(i+=c,(a=s[(n+i)%n])&&(l=a.find())&&!V(h,l))break}while(i<o&&i>r)}return a}var n=100,i=-1,o=0,r=0,s=new Array(n);return{cachedCursor:undefined,add:e,move:t}},Vt=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};C.prototype={exitMacroRecordMode:function(){var e=Ut.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=undefined,e.isRecording=!1},enterMacroRecordMode:function(e,t){var n=Ut.registerController.getRegister(t);n&&(n.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var Ut,Gt,jt={buildKeyMap:function(){},getRegisterController:function(){return Ut.registerController},resetVimGlobalState_:$,getVimGlobalState_:function(){return Ut},maybeInitVimState_:S,suppressErrorLogging:!1,InsertModeKey:at,map:function(e,t,n){sn.map(e,t,n)},unmap:function(e,t){sn.unmap(e,t)},noremap:function(e,t,n){function i(e){return e?[e]:["normal","insert","visual"]}for(var o=i(n),r=At.length,s=Lt,a=r-s;a<r&&o.length;a++){var l=At[a];if(!(l.keys!=t||n&&l.context&&l.context!==n||"ex"===l.type.substr(0,2)||"key"===l.type.substr(0,3))){var c={};for(var h in l)c[h]=l[h];c.keys=e,n&&!c.context&&(c.context=n),this._mapCommand(c);var u=i(l.context);o=o.filter(function(e){return-1===u.indexOf(e)})}}},mapclear:function(e){var t=At.length,n=Lt,i=At.slice(0,t-n);if(At=At.slice(t-n),e)for(var o=i.length-1;o>=0;o--){var r=i[o];if(e!==r.context)if(r.context)this._mapCommand(r);else{var s=["normal","insert","visual"];for(var a in s)if(s[a]!==e){var l={};for(var c in r)l[c]=r[c];l.context=s[a],this._mapCommand(l)}}}},setOption:x,getOption:k,defineOption:y,defineEx:function(e,t,n){if(t){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered')}else t=e;rn[e]=n,sn.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,n){var i=this.findKey(e,t,n);if("function"==typeof i)return i()},findKey:function(e,t,n){function i(){var i=Ut.macroModeState;if(i.isRecording){if("q"==t)return i.exitMacroRecordMode(),A(e),!0;"mapping"!=n&&et(i,t)}}function o(){if("<Esc>"==t)return A(e),c.visualMode?le(e):c.insertMode&&Qe(e),!0}function r(n){for(var i;n;)i=/<\w+-.+?>|<\w+>|./.exec(n),t=i[0],n=n.substring(i.index+t.length),_t.Vim.handleKey(e,t,"mapping")}function s(){if(o())return!0;for(var n=c.inputState.keyBuffer=c.inputState.keyBuffer+t,i=1==t.length,r=qt.matchCommand(n,At,c.inputState,"insert");n.length>1&&"full"!=r.type;){var n=c.inputState.keyBuffer=n.slice(1),s=qt.matchCommand(n,At,c.inputState,"insert");"none"!=s.type&&(r=s)}if("none"==r.type)return A(e),!1;if("partial"==r.type)return Gt&&window.clearTimeout(Gt),Gt=window.setTimeout(function(){c.insertMode&&c.inputState.keyBuffer&&A(e)},k("insertModeEscKeysTimeout")),!i;if(Gt&&window.clearTimeout(Gt),i){for(var a=e.listSelections(),l=0;l<a.length;l++){var h=a[l].head;e.replaceRange("",N(h,0,-(n.length-1)),h,"+input")}Ut.macroModeState.lastInsertModeChanges.changes.pop()}return A(e),r.command}function a(){if(i()||o())return!0;var n=c.inputState.keyBuffer=c.inputState.keyBuffer+t;if(/^[1-9]\d*$/.test(n))return!0;var r=/^(\d*)(.*)$/.exec(n);if(!r)return A(e),!1;var s=c.visualMode?"visual":"normal",a=qt.matchCommand(r[2]||r[1],At,c.inputState,s);if("none"==a.type)return A(e),!1;if("partial"==a.type)return!0;c.inputState.keyBuffer="";var r=/^(\d*)(.*)$/.exec(n);return r[1]&&"0"!=r[1]&&c.inputState.pushRepeatDigit(r[1]),a.command}var l,c=S(e);return l=c.insertMode?s():a(),!1===l?undefined:!0===l?function(){return!0}:function(){if(!l.operator&&!l.isEdit||!e.getOption("readOnly"))return e.operation(function(){e.curOp.isVimOp=!0;try{"keyToKey"==l.type?r(l.toKeys):qt.processCommand(e,c,l)}catch(t){throw e.state.vim=undefined,S(e),_t.Vim.suppressErrorLogging||console.log(t),t}return!0})}},handleEx:function(e,t){sn.processCommand(e,t)},defineMotion:E,defineAction:F,defineOperator:I,mapCommand:Je,_mapCommand:Ye,defineRegister:M,exitVisualMode:le,exitInsertMode:Qe};_.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},_.prototype.getRepeat=function(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},L.prototype={setText:function(e,t,n){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!n},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(Vt(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},R.prototype={pushText:function(e,t,n,i,o){i&&"\n"!==n.charAt(n.length-1)&&(n+="\n");var r=this.isValidRegister(e)?this.getRegister(e):null;if(!r){switch(t){case"yank":this.registers[0]=new L(n,i,o);break;case"delete":case"change":-1==n.indexOf("\n")?this.registers["-"]=new L(n,i):(this.shiftNumericRegisters_(),this.registers[1]=new L(n,i))}return void this.unnamedRegister.setText(n,i,o)}m(e)?r.pushText(n,i):r.setText(n,i,o),this.unnamedRegister.setText(r.toString(),i)},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new L),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&w(e,Wt)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},T.prototype={nextMatch:function(e,t){var n=this.historyBuffer,i=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var o=this.iterator+i;t?o>=0:o<n.length;o+=i)for(var r=n[o],s=0;s<=r.length;s++)if(this.initialPrefix==r.substring(0,s))return this.iterator=o,r;return o>=n.length?(this.iterator=n.length,this.initialPrefix):o<0?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var qt={matchCommand:function(e,t,n,i){var o=D(e,t,i,n);if(!o.full&&!o.partial)return{type:"none"};if(!o.full&&o.partial)return{type:"partial"};for(var r,s=0;s<o.full.length;s++){var a=o.full[s];r||(r=a)}if("<character>"==r.keys.slice(-11)){var l=W(e);if(/<C-.>/.test(l)||!l)return{type:"none"};n.selectedCharacter=l}return{type:"full",command:r}},processCommand:function(e,t,n){switch(t.inputState.repeatOverride=n.repeatOverride,n.type){case"motion":this.processMotion(e,t,n);break;case"operator":this.processOperator(e,t,n);break;case"operatorMotion":this.processOperatorMotion(e,t,n);break;case"action":this.processAction(e,t,n);break;case"search":this.processSearch(e,t,n);break;case"ex":case"keyToEx":this.processEx(e,t,n)}},processMotion:function(e,t,n){t.inputState.motion=n.motion,t.inputState.motionArgs=H(n.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,n){var i=t.inputState;if(i.operator){if(i.operator==n.operator)return i.motion="expandToLine",i.motionArgs={linewise:!0},this.evalInput(e,t),void 0;A(e)}i.operator=n.operator,i.operatorArgs=H(n.operatorArgs),n.exitVisualBlock&&(t.visualBlock=!1,re(e)),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,n){var i=t.visualMode,o=H(n.operatorMotionArgs);o&&i&&o.visualLine&&(t.visualLine=!0),this.processOperator(e,t,n),i||this.processMotion(e,t,n)},processAction:function(e,t,n){var i=t.inputState,o=i.getRepeat(),r=!!o,s=H(n.actionArgs)||{};i.selectedCharacter&&(s.selectedCharacter=i.selectedCharacter),n.operator&&this.processOperator(e,t,n),n.motion&&this.processMotion(e,t,n),(n.motion||n.operator)&&this.evalInput(e,t),s.repeat=o||1,s.repeatIsExplicit=r,s.registerName=i.registerName,A(e),t.lastMotion=null,n.isEdit&&this.recordLastEdit(t,i,n),Yt[n.action](e,s,t)},processSearch:function(e,t,n){function i(i,o,r){Ut.searchHistoryController.pushInput(i),Ut.searchHistoryController.reset();try{We(e,i,o,r)}catch(t){return He(e,"Invalid regex: "+i),void A(e)}qt.processMotion(e,t,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:n.searchArgs.toJumplist}})}function o(e){i(e,!0,!0);var t=Ut.macroModeState;t.isRecording&&nt(t,e)}function r(t,n,i){var o,r,s=_t.keyName(t);"Up"==s||"Down"==s?(o="Up"==s,r=t.target?t.target.selectionEnd:0,n=Ut.searchHistoryController.nextMatch(n,o)||"",i(n),r&&t.target&&(t.target.selectionEnd=t.target.selectionStart=Math.min(r,t.target.value.length))):"Left"!=s&&"Right"!=s&&"Ctrl"!=s&&"Alt"!=s&&"Shift"!=s&&Ut.searchHistoryController.reset();var l;try{l=We(e,n,!0,!0)}catch(t){}l?e.scrollIntoView(Ve(e,!a,l),30):(Ue(e),e.scrollTo(u.left,u.top))}function s(t,n,i){var o=_t.keyName(t);"Esc"==o||"Ctrl-C"==o||"Ctrl-["==o||"Backspace"==o&&""==n?(Ut.searchHistoryController.pushInput(n),Ut.searchHistoryController.reset(),We(e,h),Ue(e),e.scrollTo(u.left,u.top),_t.e_stop(t),A(e),i(),e.focus()):"Up"==o||"Down"==o?_t.e_stop(t):"Ctrl-U"==o&&(_t.e_stop(t),i(""))}if(e.getSearchCursor){var a=n.searchArgs.forward,l=n.searchArgs.wholeWordOnly;Ae(e).setReversed(!a);var c=a?"/":"?",h=Ae(e).getQuery(),u=e.getScrollInfo();switch(n.searchArgs.querySrc){case"prompt":var d=Ut.macroModeState;if(d.isPlaying){var g=d.replaySearchQueries.shift();i(g,!0,!1)}else De(e,{onClose:o,prefix:c,desc:nn,onKeyUp:r,onKeyDown:s});break;case"wordUnderCursor":var p=de(e,!1,!0,!1,!0),f=!0;if(p||(p=de(e,!1,!0,!1,!1),f=!1),!p)return;var g=e.getLine(p.start.line).substring(p.start.ch,p.end.ch);g=f&&l?"\\b"+g+"\\b":Y(g),Ut.jumpList.cachedCursor=e.getCursor(),e.setCursor(p.start),i(g,!0,!1)}}},processEx:function(e,t,n){function i(t){Ut.exCommandHistoryController.pushInput(t),Ut.exCommandHistoryController.reset(),sn.processCommand(e,t)}function o(t,n,i){var o,r,s=_t.keyName(t);("Esc"==s||"Ctrl-C"==s||"Ctrl-["==s||"Backspace"==s&&""==n)&&(Ut.exCommandHistoryController.pushInput(n),Ut.exCommandHistoryController.reset(),_t.e_stop(t),A(e),i(),e.focus()),"Up"==s||"Down"==s?(_t.e_stop(t),o="Up"==s,r=t.target?t.target.selectionEnd:0,n=Ut.exCommandHistoryController.nextMatch(n,o)||"",i(n),r&&t.target&&(t.target.selectionEnd=t.target.selectionStart=Math.min(r,t.target.value.length))):"Ctrl-U"==s?(_t.e_stop(t),i("")):"Left"!=s&&"Right"!=s&&"Ctrl"!=s&&"Alt"!=s&&"Shift"!=s&&Ut.exCommandHistoryController.reset()}"keyToEx"==n.type?sn.processCommand(e,n.exArgs.input):t.visualMode?De(e,{onClose:i,prefix:":",value:"'<,'>",onKeyDown:o,selectValueOnOpen:!1}):De(e,{onClose:i,prefix:":",onKeyDown:o})},evalInput:function(e,t){var n,i,o,r=t.inputState,s=r.motion,a=r.motionArgs||{},l=r.operator,c=r.operatorArgs||{},h=r.registerName,u=t.sel,d=K(t.visualMode?B(e,u.head):e.getCursor("head")),g=K(t.visualMode?B(e,u.anchor):e.getCursor("anchor")),p=K(d),f=K(g);if(l&&this.recordLastEdit(t,r),o=r.repeatOverride!==undefined?r.repeatOverride:r.getRepeat(),o>0&&a.explicitRepeat?a.repeatIsExplicit=!0:(a.noRepeat||!a.explicitRepeat&&0===o)&&(o=1,a.repeatIsExplicit=!1),r.selectedCharacter&&(a.selectedCharacter=c.selectedCharacter=r.selectedCharacter),a.repeat=o,A(e),s){var m=Xt[s](e,d,a,t);if(t.lastMotion=Xt[s],!m)return;if(a.toJumplist){!l&&null!=e.ace.curOp&&(e.ace.curOp.command.scrollIntoView="center-animate");var v=Ut.jumpList,b=v.cachedCursor;b?(ge(e,b,m),delete v.cachedCursor):ge(e,d,m)}m instanceof Array?(i=m[0],n=m[1]):n=m,n||(n=K(d)),t.visualMode?(t.visualBlock&&n.ch===Infinity||(n=B(e,n,t.visualBlock)),i&&(i=B(e,i,!0)),i=i||f,u.anchor=i,u.head=n,re(e),ye(e,t,"<",U(i,n)?i:n),ye(e,t,">",U(i,n)?n:i)):l||(n=B(e,n),e.setCursor(n.line,n.ch))}if(l){if(c.lastSel){i=f;var w=c.lastSel,y=Math.abs(w.head.line-w.anchor.line),x=Math.abs(w.head.ch-w.anchor.ch);n=w.visualLine?Rt(f.line+y,f.ch):w.visualBlock?Rt(f.line+y,f.ch+x):w.head.line==w.anchor.line?Rt(f.line,f.ch+x):Rt(f.line+y,f.ch),t.visualMode=!0,t.visualLine=w.visualLine,t.visualBlock=w.visualBlock,u=t.sel={anchor:i,head:n},re(e)}else t.visualMode&&(c.lastSel={anchor:K(u.anchor),head:K(u.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var k,C,S,$,_;if(t.visualMode){if(k=G(u.head,u.anchor),C=j(u.head,u.anchor),S=t.visualLine||c.linewise,$=t.visualBlock?"block":S?"line":"char",_=se(e,{anchor:k,head:C},$),S){var L=_.ranges;if("block"==$)for(var M=0;M<L.length;M++)L[M].head.ch=X(e,L[M].head.line);else"line"==$&&(L[0].head=Rt(L[0].head.line+1,0))}}else{if(k=K(i||f),C=K(n||p),U(C,k)){var R=k;k=C,C=R}S=a.linewise||c.linewise,S?he(e,k,C):a.forward&&ce(e,k,C),$="char";_=se(e,{anchor:k,head:C},$,!a.inclusive||S)}e.setSelections(_.ranges,_.primary),t.lastMotion=null,c.repeat=o,c.registerName=h,c.linewise=S;var T=Qt[l](e,c,_.ranges,f,n);t.visualMode&&le(e,null!=T),T&&e.setCursor(T)}},recordLastEdit:function(e,t,n){var i=Ut.macroModeState;i.isPlaying||(e.lastEditInputState=t,e.lastEditActionCommand=n,i.lastInsertModeChanges.changes=[],i.lastInsertModeChanges.expectCursorActivityForChange=!1,i.lastInsertModeChanges.visualBlock=e.visualBlock?e.sel.head.line-e.sel.anchor.line:0)}},Xt={moveToTopLine:function(e,t,n){var i=je(e).top+n.repeat-1;return Rt(i,ue(e.getLine(i)))},moveToMiddleLine:function(e){var t=je(e),n=Math.floor(.5*(t.top+t.bottom));return Rt(n,ue(e.getLine(n)))},moveToBottomLine:function(e,t,n){var i=je(e).bottom-n.repeat+1;return Rt(i,ue(e.getLine(i)))},expandToLine:function(e,t,n){return Rt(t.line+n.repeat-1,Infinity)},findNext:function(e,t,n){var i=Ae(e),o=i.getQuery();if(o){var r=!n.forward;return r=i.isReversed()?!r:r,Ke(e,o),Ve(e,r,o,n.repeat)}},goToMark:function(e,t,n,i){var o=qe(e,i,n.selectedCharacter);return o?n.linewise?{line:o.line,ch:ue(e.getLine(o.line))}:o:null},moveToOtherHighlightedEnd:function(e,t,n,i){if(i.visualBlock&&n.sameLine){var o=i.sel;return[B(e,Rt(o.anchor.line,o.head.ch)),B(e,Rt(o.head.line,o.anchor.ch))]}return[i.sel.head,i.sel.anchor]},jumpToMark:function(e,t,n,i){for(var o=t,r=0;r<n.repeat;r++){var s=o;for(var a in i.marks)if(g(a)){var l=i.marks[a].find(),c=n.forward?U(l,s):U(s,l);if(!(c||n.linewise&&l.line==s.line)){var h=V(s,o),u=n.forward?q(s,l,o):q(o,l,s);(h||u)&&(o=l)}}}return n.linewise&&(o=Rt(o.line,ue(e.getLine(o.line)))),o},moveByCharacters:function(e,t,n){var i=t,o=n.repeat,r=n.forward?i.ch+o:i.ch-o;return Rt(i.line,r)},moveByLines:function(e,t,n,i){var o=t,r=o.ch;switch(i.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:r=i.lastHPos;break;default:i.lastHPos=r}var s=n.repeat+(n.repeatOffset||0),a=n.forward?o.line+s:o.line-s,l=e.firstLine(),c=e.lastLine();if(a<l&&o.line==l)return this.moveToStartOfLine(e,t,n,i);if(a>c&&o.line==c)return this.moveToEol(e,t,n,i,!0);var h=e.ace.session.getFoldLine(a);return h&&(n.forward?a>h.start.row&&(a=h.end.row+1):a=h.start.row),n.toFirstChar&&(r=ue(e.getLine(a)),i.lastHPos=r),i.lastHSPos=e.charCoords(Rt(a,r),"div").left,Rt(a,r)},moveByDisplayLines:function(e,t,n,i){var o=t;switch(i.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:i.lastHSPos=e.charCoords(o,"div").left}var r=n.repeat,s=e.findPosV(o,n.forward?r:-r,"line",i.lastHSPos);if(s.hitSide)if(n.forward)var a=e.charCoords(s,"div"),l={top:a.top+8,left:i.lastHSPos},s=e.coordsChar(l,"div");else{var c=e.charCoords(Rt(e.firstLine(),0),"div");c.left=i.lastHSPos,s=e.coordsChar(c,"div")}return i.lastHPos=s.ch,s},moveByPage:function(e,t,n){var i=t,o=n.repeat;return e.findPosV(i,n.forward?o:-o,"page")},moveByParagraph:function(e,t,n){var i=n.forward?1:-1;return ke(e,t,n.repeat,i)},moveBySentence:function(e,t,n){var i=n.forward?1:-1;return Ce(e,t,n.repeat,i)},moveByScroll:function(e,t,n,i){var o=e.getScrollInfo(),r=null,s=n.repeat;s||(s=o.clientHeight/(2*e.defaultTextHeight()));var a=e.charCoords(t,"local");n.repeat=s;var r=Xt.moveByDisplayLines(e,t,n,i);if(!r)return null;var l=e.charCoords(r,"local");return e.scrollTo(null,o.top+l.top-a.top),r},moveByWords:function(e,t,n){return ve(e,t,n.repeat,!!n.forward,!!n.wordEnd,!!n.bigWord)},moveTillCharacter:function(e,t,n){var i=n.repeat,o=be(e,i,n.forward,n.selectedCharacter),r=n.forward?-1:1;return pe(r,n),o?(o.ch+=r,o):null},moveToCharacter:function(e,t,n){var i=n.repeat;return pe(0,n),be(e,i,n.forward,n.selectedCharacter)||t},moveToSymbol:function(e,t,n){return fe(e,n.repeat,n.forward,n.selectedCharacter)||t},moveToColumn:function(e,t,n,i){var o=n.repeat;return i.lastHPos=o-1,i.lastHSPos=e.charCoords(t,"div").left,we(e,o)},moveToEol:function(e,t,n,i,o){var r=t,s=Rt(r.line+n.repeat-1,Infinity),a=e.clipPos(s);return a.ch--,o||(i.lastHPos=Infinity,i.lastHSPos=e.charCoords(a,"div").left),s},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return Rt(n.line,ue(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){for(var n,i=t,o=i.line,r=i.ch,s=e.getLine(o);r<s.length;r++)if((n=s.charAt(r))&&p(n)){var a=e.getTokenTypeAt(Rt(o,r+1));if("string"!==a&&"comment"!==a)break}if(r<s.length){var l=/[<>]/.test(s[r])?/[(){}[\]<>]/:/[(){}[\]]/;return e.findMatchingBracket(Rt(o,r+1),{bracketRegex:l}).to}return i},moveToStartOfLine:function(e,t){return Rt(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var i=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(i=n.repeat-e.getOption("firstLineNumber")),Rt(i,ue(e.getLine(i)))},textObjectManipulation:function(e,t,n,i){var o={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},r={"'":!0,'"':!0,"`":!0},s=n.selectedCharacter;"b"==s?s="(":"B"==s&&(s="{");var a,l=!n.textObjectInner;if(o[s])a=Se(e,t,s,l);else if(r[s])a=$e(e,t,s,l);else if("W"===s)a=de(e,l,!0,!0);else if("w"===s)a=de(e,l,!0,!1);else{if("p"!==s)return null;if(a=ke(e,t,n.repeat,0,l),n.linewise=!0,i.visualMode)i.visualLine||(i.visualLine=!0);else{var c=i.inputState.operatorArgs;c&&(c.linewise=!0),a.end.line--}}return e.state.vim.visualMode?oe(e,a.start,a.end):[a.start,a.end]},repeatLastCharacterSearch:function(e,t,n){var i=Ut.lastCharacterSearch,o=n.repeat,r=n.forward===i.forward,s=(i.increment?1:0)*(r?-1:1);e.moveH(-s,"char"),n.inclusive=!!r;var a=be(e,o,r,i.selectedCharacter);return a?(a.ch+=s,a):(e.moveH(s,"char"),t)}},Qt={change:function(e,t,n){var i,o,r=e.state.vim,s=n[0].anchor,a=n[0].head;if(r.visualMode)if(t.fullLine)a.ch=Number.MAX_VALUE,a.line--,e.setSelection(s,a),o=e.getSelection(),e.replaceSelections(""),i=s;else{o=e.getSelection();var l=O("",n.length);e.replaceSelections(l),i=G(n[0].head,n[0].anchor)}else{o=e.getRange(s,a);var c=r.lastEditInputState||{};if("moveByWords"==c.motion&&!v(o)){var h=/\s+$/.exec(o);h&&c.motionArgs&&c.motionArgs.forward&&(a=N(a,0,-h[0].length),o=o.slice(0,-h[0].length))}var u=new Rt(s.line-1,Number.MAX_VALUE),d=e.firstLine()==e.lastLine();a.line>e.lastLine()&&t.linewise&&!d?e.replaceRange("",u,a):e.replaceRange("",s,a),t.linewise&&(d||(e.setCursor(u),_t.commands.newlineAndIndent(e)),s.ch=Number.MAX_VALUE),i=s}Ut.registerController.pushText(t.registerName,"change",o,t.linewise,n.length>1),Yt.enterInsertMode(e,{head:i},e.state.vim)},"delete":function(e,t,n){var i,o,r=e.state.vim;if(r.visualBlock){o=e.getSelection();var s=O("",n.length);e.replaceSelections(s),i=n[0].anchor}else{var a=n[0].anchor,l=n[0].head;t.linewise&&l.line!=e.firstLine()&&a.line==e.lastLine()&&a.line==l.line-1&&(a.line==e.firstLine()?a.ch=0:a=Rt(a.line-1,X(e,a.line-1))),o=e.getRange(a,l),e.replaceRange("",a,l),i=a,t.linewise&&(i=Xt.moveToFirstNonWhiteSpaceCharacter(e,a))}return Ut.registerController.pushText(t.registerName,"delete",o,t.linewise,r.visualBlock),B(e,i,r.insertMode)},indent:function(e,t,n){var i=e.state.vim,o=n[0].anchor.line,r=i.visualBlock?n[n.length-1].anchor.line:n[0].head.line,s=i.visualMode?t.repeat:1;t.linewise&&r--;for(var a=o;a<=r;a++)for(var l=0;l<s;l++)e.indentLine(a,t.indentRight);return Xt.moveToFirstNonWhiteSpaceCharacter(e,n[0].anchor)},indentAuto:function(e,t,n){return e.execCommand("indentAuto"),Xt.moveToFirstNonWhiteSpaceCharacter(e,n[0].anchor)},changeCase:function(e,t,n,i,o){for(var r=e.getSelections(),s=[],a=t.toLower,l=0;l<r.length;l++){var c=r[l],h="";if(!0===a)h=c.toLowerCase();else if(!1===a)h=c.toUpperCase();else for(var u=0;u<c.length;u++){var d=c.charAt(u);h+=m(d)?d.toLowerCase():d.toUpperCase()}s.push(h)}return e.replaceSelections(s),t.shouldMoveCursor?o:!e.state.vim.visualMode&&t.linewise&&n[0].anchor.line+1==n[0].head.line?Xt.moveToFirstNonWhiteSpaceCharacter(e,i):t.linewise?i:G(n[0].anchor,n[0].head)},yank:function(e,t,n,i){var o=e.state.vim,r=e.getSelection(),s=o.visualMode?G(o.sel.anchor,o.sel.head,n[0].head,n[0].anchor):i;return Ut.registerController.pushText(t.registerName,"yank",r,t.linewise,o.visualBlock),s}},Yt={jumpListWalk:function(e,t,n){if(!n.visualMode){var i=t.repeat,o=t.forward,r=Ut.jumpList,s=r.move(e,o?i:-i),a=s?s.find():undefined;a=a||e.getCursor(),e.setCursor(a),e.ace.curOp.command.scrollIntoView="center-animate"}},scroll:function(e,t,n){if(!n.visualMode){var i=t.repeat||1,o=e.defaultTextHeight(),r=e.getScrollInfo().top,s=o*i,a=t.forward?r+s:r-s,l=K(e.getCursor()),c=e.charCoords(l,"local");if(t.forward)a>c.top?(l.line+=(a-c.top)/o,l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,a);else{var h=a+e.getScrollInfo().clientHeight;h<c.bottom?(l.line-=(c.bottom-h)/o,l.line=Math.floor(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.bottom-e.getScrollInfo().clientHeight)):e.scrollTo(null,a)}}},scrollToCursor:function(e,t){var n=e.getCursor().line,i=e.charCoords(Rt(n,0),"local"),o=e.getScrollInfo().clientHeight,r=i.top,s=i.bottom-r;switch(t.position){case"center":r=r-o/2+s;break;case"bottom":r=r-o+s}e.scrollTo(null,r)},replayMacro:function(e,t,n){var i=t.selectedCharacter,o=t.repeat,r=Ut.macroModeState;for("@"==i?i=r.latestRegister:r.latestRegister=i;o--;)Ze(e,n,r,i)},enterMacroRecordMode:function(e,t){var n=Ut.macroModeState,i=t.selectedCharacter
18
18
  ;Ut.registerController.isValidRegister(i)&&n.enterMacroRecordMode(e,i)},toggleOverwrite:function(e){e.state.overwrite?(e.toggleOverwrite(!1),e.setOption("keyMap","vim-insert"),_t.signal(e,"vim-mode-change",{mode:"insert"})):(e.toggleOverwrite(!0),e.setOption("keyMap","vim-replace"),_t.signal(e,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(e,t,n){if(!e.getOption("readOnly")){n.insertMode=!0,n.insertModeRepeat=t&&t.repeat||1;var i=t?t.insertAt:null,o=n.sel,r=t.head||e.getCursor("head"),s=e.listSelections().length;if("eol"==i)r=Rt(r.line,X(e,r.line));else if("charAfter"==i)r=N(r,0,1);else if("firstNonBlank"==i)r=Xt.moveToFirstNonWhiteSpaceCharacter(e,r);else if("startOfSelectedArea"==i){if(!n.visualMode)return;n.visualBlock?(r=Rt(Math.min(o.head.line,o.anchor.line),Math.min(o.head.ch,o.anchor.ch)),s=Math.abs(o.head.line-o.anchor.line)+1):r=o.head.line<o.anchor.line?o.head:Rt(o.anchor.line,0)}else if("endOfSelectedArea"==i){if(!n.visualMode)return;n.visualBlock?(r=Rt(Math.min(o.head.line,o.anchor.line),Math.max(o.head.ch+1,o.anchor.ch)),s=Math.abs(o.head.line-o.anchor.line)+1):r=o.head.line>=o.anchor.line?N(o.head,0,1):Rt(o.anchor.line,0)}else if("inplace"==i&&n.visualMode)return;e.setOption("disableInput",!1),t&&t.replace?(e.toggleOverwrite(!0),e.setOption("keyMap","vim-replace"),_t.signal(e,"vim-mode-change",{mode:"replace"})):(e.toggleOverwrite(!1),e.setOption("keyMap","vim-insert"),_t.signal(e,"vim-mode-change",{mode:"insert"})),Ut.macroModeState.isPlaying||(e.on("change",it),_t.on(e.getInputField(),"keydown",lt)),n.visualMode&&le(e),ee(e,r,s)}},toggleVisualMode:function(e,t,n){var i,o=t.repeat,r=e.getCursor();n.visualMode?n.visualLine^t.linewise||n.visualBlock^t.blockwise?(n.visualLine=!!t.linewise,n.visualBlock=!!t.blockwise,_t.signal(e,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""}),re(e)):le(e):(n.visualMode=!0,n.visualLine=!!t.linewise,n.visualBlock=!!t.blockwise,i=B(e,Rt(r.line,r.ch+o-1),!0),n.sel={anchor:r,head:i},_t.signal(e,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""}),re(e),ye(e,n,"<",G(r,i)),ye(e,n,">",j(r,i)))},reselectLastSelection:function(e,t,n){var i=n.lastSelection;if(n.visualMode&&ie(e,n),i){var o=i.anchorMark.find(),r=i.headMark.find();if(!o||!r)return;n.sel={anchor:o,head:r},n.visualMode=!0,n.visualLine=i.visualLine,n.visualBlock=i.visualBlock,re(e),ye(e,n,"<",G(o,r)),ye(e,n,">",j(o,r)),_t.signal(e,"vim-mode-change",{mode:"visual",subMode:n.visualLine?"linewise":n.visualBlock?"blockwise":""})}},joinLines:function(e,t,n){var i,o;if(n.visualMode){if(i=e.getCursor("anchor"),o=e.getCursor("head"),U(o,i)){var r=o;o=i,i=r}o.ch=X(e,o.line)-1}else{var s=Math.max(t.repeat,2);i=e.getCursor(),o=B(e,Rt(i.line+s-1,Infinity))}for(var a=0,l=i.line;l<o.line;l++){a=X(e,i.line);var r=Rt(i.line+1,X(e,i.line+1)),c=e.getRange(i,r);c=c.replace(/\n\s*/g," "),e.replaceRange(c,i,r)}var h=Rt(i.line,a);n.visualMode&&le(e,!1),e.setCursor(h)},newLineAndEnterInsertMode:function(e,t,n){n.insertMode=!0;var i=K(e.getCursor());if(i.line!==e.firstLine()||t.after){i.line=t.after?i.line:i.line-1,i.ch=X(e,i.line),e.setCursor(i);(_t.commands.newlineAndIndentContinueComment||_t.commands.newlineAndIndent)(e)}else e.replaceRange("\n",Rt(e.firstLine(),0)),e.setCursor(e.firstLine(),0);this.enterInsertMode(e,{repeat:t.repeat},n)},paste:function(e,t,n){var i=K(e.getCursor()),o=Ut.registerController.getRegister(t.registerName),r=o.toString();if(r){if(t.matchIndent){var s=e.getOption("tabSize"),a=function(e){var t=e.split("\t").length-1,n=e.split(" ").length-1;return t*s+1*n},l=e.getLine(e.getCursor().line),c=a(l.match(/^\s*/)[0]),h=r.replace(/\n$/,""),u=r!==h,d=a(r.match(/^\s*/)[0]),r=h.replace(/^\s*/gm,function(t){var n=c+(a(t)-d);if(n<0)return"";if(e.getOption("indentWithTabs")){var i=Math.floor(n/s);return Array(i+1).join("\t")}return Array(n+1).join(" ")});r+=u?"\n":""}if(t.repeat>1)var r=Array(t.repeat+1).join(r);var g=o.linewise,p=o.blockwise;if(p){r=r.split("\n"),g&&r.pop();for(var f=0;f<r.length;f++)r[f]=""==r[f]?" ":r[f];i.ch+=t.after?1:0,i.ch=Math.min(X(e,i.line),i.ch)}else g?n.visualMode?r=n.visualLine?r.slice(0,-1):"\n"+r.slice(0,r.length-1)+"\n":t.after?(r="\n"+r.slice(0,r.length-1),i.ch=X(e,i.line)):i.ch=0:i.ch+=t.after?1:0;var m,v;if(n.visualMode){n.lastPastedText=r;var b,w=ne(e,n),y=w[0],x=w[1],k=e.getSelection(),C=e.listSelections(),S=new Array(C.length).join("1").split("1");n.lastSelection&&(b=n.lastSelection.headMark.find()),Ut.registerController.unnamedRegister.setText(k),p?(e.replaceSelections(S),x=Rt(y.line+r.length-1,y.ch),e.setCursor(y),Z(e,x),e.replaceSelections(r),m=y):n.visualBlock?(e.replaceSelections(S),e.setCursor(y),e.replaceRange(r,y,y),m=y):(e.replaceRange(r,y,x),m=e.posFromIndex(e.indexFromPos(y)+r.length-1)),b&&(n.lastSelection.headMark=e.setBookmark(b)),g&&(m.ch=0)}else if(p){e.setCursor(i);for(var f=0;f<r.length;f++){var $=i.line+f;$>e.lastLine()&&e.replaceRange("\n",Rt($,0));var _=X(e,$);_<i.ch&&J(e,$,i.ch)}e.setCursor(i),Z(e,Rt(i.line+r.length-1,i.ch)),e.replaceSelections(r),m=i}else e.replaceRange(r,i),g&&t.after?m=Rt(i.line+1,ue(e.getLine(i.line+1))):g&&!t.after?m=Rt(i.line,ue(e.getLine(i.line))):!g&&t.after?(v=e.indexFromPos(i),m=e.posFromIndex(v+r.length-1)):(v=e.indexFromPos(i),m=e.posFromIndex(v+r.length));n.visualMode&&le(e,!1),e.setCursor(m)}},undo:function(e,t){e.operation(function(){z(e,_t.commands.undo,t.repeat)(),e.setCursor(e.getCursor("anchor"))})},redo:function(e,t){z(e,_t.commands.redo,t.repeat)()},setRegister:function(e,t,n){n.inputState.registerName=t.selectedCharacter},setMark:function(e,t,n){ye(e,n,t.selectedCharacter,e.getCursor())},replace:function(e,t,n){var i,o,r=t.selectedCharacter,s=e.getCursor(),a=e.listSelections();if(n.visualMode)s=e.getCursor("start"),o=e.getCursor("end");else{var l=e.getLine(s.line);i=s.ch+t.repeat,i>l.length&&(i=l.length),o=Rt(s.line,i)}if("\n"==r)n.visualMode||e.replaceRange("",s,o),(_t.commands.newlineAndIndentContinueComment||_t.commands.newlineAndIndent)(e);else{var c=e.getRange(s,o);if(c=c.replace(/[^\n]/g,r),n.visualBlock){var h=new Array(e.getOption("tabSize")+1).join(" ");c=e.getSelection(),c=c.replace(/\t/g,h).replace(/[^\n]/g,r).split("\n"),e.replaceSelections(c)}else e.replaceRange(c,s,o);n.visualMode?(s=U(a[0].anchor,a[0].head)?a[0].anchor:a[0].head,e.setCursor(s),le(e,!1)):e.setCursor(N(o,0,-1))}},incrementNumberToken:function(e,t){for(var n,i,o,r,s=e.getCursor(),a=e.getLine(s.line),l=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;null!==(n=l.exec(a))&&(i=n.index,o=i+n[0].length,!(s.ch<o)););if((t.backtrack||!(o<=s.ch))&&n){var c=n[2]||n[4],h=n[3]||n[5],u=t.increase?1:-1,d={"0b":2,0:8,"":10,"0x":16}[c.toLowerCase()];r=(parseInt(n[1]+h,d)+u*t.repeat).toString(d);var g=c?new Array(h.length-r.length+1+n[1].length).join("0"):"";r="-"===r.charAt(0)?"-"+c+g+r.substr(1):c+g+r;var p=Rt(s.line,i),f=Rt(s.line,o);e.replaceRange(r,p,f),e.setCursor(Rt(s.line,i+r.length-1))}},repeatLastEdit:function(e,t,n){if(n.lastEditInputState){var i=t.repeat;i&&t.repeatIsExplicit?n.lastEditInputState.repeatOverride=i:i=n.lastEditInputState.repeatOverride||i,ct(e,n,i,!1)}},indent:function(e,t){e.indentLine(e.getCursor().line,t.indentRight)},exitInsertMode:Qe},Jt={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},Zt={bracket:{isComplete:function(e){if(e.nextCh===e.symb){if(++e.depth>=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};y("pcre",!0,"boolean"),_e.prototype={getQuery:function(){return Ut.query},setQuery:function(e){Ut.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return Ut.isReversed},setReversed:function(e){Ut.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var en={"\\n":"\n","\\r":"\r","\\t":"\t"},tn={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t"},nn="(Javascript regexp)",on=function(){this.buildCommandMap_()};on.prototype={processCommand:function(e,t,n){var i=this;e.operation(function(){e.curOp.isVimOp=!0,i._processCommand(e,t,n)})},_processCommand:function(e,t,n){var i=e.state.vim,o=Ut.registerController.getRegister(":"),r=o.toString();i.visualMode&&le(e);var s=new _t.StringStream(t);o.setText(t);var a=n||{};a.input=t;try{this.parseInput_(e,s,a)}catch(t){throw He(e,t),t}var l,c;if(a.commandName){if(l=this.matchCommand_(a.commandName)){if(c=l.name,l.excludeFromCommandHistory&&o.setText(r),this.parseCommandArgs_(s,a,l),"exToKey"==l.type){for(var h=0;h<l.toKeys.length;h++)_t.Vim.handleKey(e,l.toKeys[h],"mapping");return}if("exToEx"==l.type)return void this.processCommand(e,l.toInput)}}else a.line!==undefined&&(c="move");if(!c)return void He(e,'Not an editor command ":'+t+'"');try{rn[c](e,a),(!l||!l.possiblyAsync)&&a.callback&&a.callback()}catch(t){throw He(e,t),t}},parseInput_:function(e,t,n){t.eatWhile(":"),t.eat("%")?(n.line=e.firstLine(),n.lineEnd=e.lastLine()):(n.line=this.parseLineSpec_(e,t),n.line!==undefined&&t.eat(",")&&(n.lineEnd=this.parseLineSpec_(e,t)));var i=t.match(/^(\w+)/);return n.commandName=i?i[1]:t.match(/.*/)[0],n},parseLineSpec_:function(e,t){var n=t.match(/^(\d+)/);if(n)return parseInt(n[1],10)-1;switch(t.next()){case".":return this.parseLineSpecOffset_(t,e.getCursor().line);case"$":return this.parseLineSpecOffset_(t,e.lastLine());case"'":var i=t.next(),o=qe(e,e.state.vim,i);if(!o)throw new Error("Mark not set");return this.parseLineSpecOffset_(t,o.line);case"-":case"+":return t.backUp(1),this.parseLineSpecOffset_(t,e.getCursor().line);default:return t.backUp(1),undefined}},parseLineSpecOffset_:function(e,t){var n=e.match(/^([+-])?(\d+)/);if(n){var i=parseInt(n[2],10);"-"==n[1]?t-=i:t+=i}return t},parseCommandArgs_:function(e,t,n){if(!e.eol()){t.argString=e.match(/.*/)[0];var i=n.argDelimiter||/\s+/,o=Q(t.argString).split(i);o.length&&o[0]&&(t.args=o)}},matchCommand_:function(e){for(var t=e.length;t>0;t--){var n=e.substring(0,t);if(this.commandMap_[n]){var i=this.commandMap_[n];if(0===i.name.indexOf(e))return i}}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e<Mt.length;e++){var t=Mt[e],n=t.shortName||t.name;this.commandMap_[n]=t}},map:function(e,t,n){if(":"!=e&&":"==e.charAt(0)){if(n)throw Error("Mode not supported for ex mappings");var i=e.substring(1);":"!=t&&":"==t.charAt(0)?this.commandMap_[i]={name:i,type:"exToEx",toInput:t.substring(1),user:!0}:this.commandMap_[i]={name:i,type:"exToKey",toKeys:t,user:!0}}else if(":"!=t&&":"==t.charAt(0)){var o={keys:e,type:"keyToEx",exArgs:{input:t.substring(1)}};n&&(o.context=n),At.unshift(o)}else{var o={keys:e,type:"keyToKey",toKeys:t};n&&(o.context=n),At.unshift(o)}},unmap:function(e,t){if(":"!=e&&":"==e.charAt(0)){if(t)throw Error("Mode not supported for ex mappings");var n=e.substring(1);if(this.commandMap_[n]&&this.commandMap_[n].user)return void delete this.commandMap_[n]}else for(var i=e,o=0;o<At.length;o++)if(i==At[o].keys&&At[o].context===t)return void At.splice(o,1)}};var rn={colorscheme:function(e,t){if(!t.args||t.args.length<1)return void He(e,e.getOption("theme"));e.setOption("theme",t.args[0])},map:function(e,t,n){var i=t.args;if(!i||i.length<2)return void(e&&He(e,"Invalid mapping: "+t.input));sn.map(i[0],i[1],n)},imap:function(e,t){this.map(e,t,"insert")},nmap:function(e,t){this.map(e,t,"normal")},vmap:function(e,t){this.map(e,t,"visual")},unmap:function(e,t,n){var i=t.args;if(!i||i.length<1)return void(e&&He(e,"No such mapping: "+t.input));sn.unmap(i[0],n)},move:function(e,t){qt.processCommand(e,e.state.vim,{type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:t.line+1})},set:function(e,t){var n=t.args,i=t.setCfg||{};if(!n||n.length<1)return void(e&&He(e,"Invalid mapping: "+t.input));var o=n[0].split("="),r=o[0],s=o[1],a=!1;if("?"==r.charAt(r.length-1)){if(s)throw Error("Trailing characters: "+t.argString);r=r.substring(0,r.length-1),a=!0}s===undefined&&"no"==r.substring(0,2)&&(r=r.substring(2),s=!1);var l=zt[r]&&"boolean"==zt[r].type;if(l&&s==undefined&&(s=!0),!l&&s===undefined||a){var c=k(r,e,i);c instanceof Error?He(e,c.message):!0===c||!1===c?He(e," "+(c?"":"no")+r):He(e," "+r+"="+c)}else{var h=x(r,s,e,i);h instanceof Error&&He(e,h.message)}},setlocal:function(e,t){t.setCfg={scope:"local"},this.set(e,t)},setglobal:function(e,t){t.setCfg={scope:"global"},this.set(e,t)},registers:function(e,t){var n=t.args,i=Ut.registerController.registers,o="----------Registers----------<br><br>";if(n){var r;n=n.join("");for(var s=0;s<n.length;s++)if(r=n.charAt(s),Ut.registerController.isValidRegister(r)){var a=i[r]||new L;o+='"'+r+" "+a.toString()+"<br>"}}else for(var r in i){var l=i[r].toString();l.length&&(o+='"'+r+" "+l+"<br>")}He(e,o)},sort:function(e,t){function n(){if(t.argString){var e=new _t.StringStream(t.argString);if(e.eat("!")&&(r=!0),e.eol())return;if(!e.eatSpace())return"Invalid arguments";var n=e.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!n&&!e.eol())return"Invalid arguments";if(n[1]){s=-1!=n[1].indexOf("i"),a=-1!=n[1].indexOf("u");var i=-1!=n[1].indexOf("d")||-1!=n[1].indexOf("n")&&1,o=-1!=n[1].indexOf("x")&&1,h=-1!=n[1].indexOf("o")&&1;if(i+o+h>1)return"Invalid arguments";l=i&&"decimal"||o&&"hex"||h&&"octal"}n[2]&&(c=new RegExp(n[2].substr(1,n[2].length-2),s?"i":""))}}function i(e,t){if(r){var n;n=e,e=t,t=n}s&&(e=e.toLowerCase(),t=t.toLowerCase());var i=l&&m.exec(e),o=l&&m.exec(t);return i?(i=parseInt((i[1]+i[2]).toLowerCase(),v),o=parseInt((o[1]+o[2]).toLowerCase(),v),i-o):e<t?-1:1}function o(e,t){if(r){var n;n=e,e=t,t=n}return s&&(e[0]=e[0].toLowerCase(),t[0]=t[0].toLowerCase()),e[0]<t[0]?-1:1}var r,s,a,l,c,h=n();if(h)return void He(e,h+": "+t.argString);var u=t.line||e.firstLine(),d=t.lineEnd||t.line||e.lastLine();if(u!=d){var g=Rt(u,0),p=Rt(d,X(e,d)),f=e.getRange(g,p).split("\n"),m=c||("decimal"==l?/(-?)([\d]+)/:"hex"==l?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==l?/([0-7]+)/:null),v="decimal"==l?10:"hex"==l?16:"octal"==l?8:null,b=[],w=[];if(l||c)for(var y=0;y<f.length;y++){var x=c?f[y].match(c):null;x&&""!=x[0]?b.push(x):!c&&m.exec(f[y])?b.push(f[y]):w.push(f[y])}else w=f;if(b.sort(c?o:i),c)for(var y=0;y<b.length;y++)b[y]=b[y].input;else l||w.sort(i);if(f=r?b.concat(w):w.concat(b),a){var k,C=f;f=[];for(var y=0;y<C.length;y++)C[y]!=k&&f.push(C[y]),k=C[y]}e.replaceRange(f.join("\n"),g,p)}},global:function(e,t){var n=t.argString;if(!n)return void He(e,"Regular Expression missing from global");var i,o=t.line!==undefined?t.line:e.firstLine(),r=t.lineEnd||t.line||e.lastLine(),s=Me(n),a=n;if(s.length&&(a=s[0],i=s.slice(1,s.length).join("/")),a)try{We(e,a,!0,!0)}catch(t){return void He(e,"Invalid regex: "+a)}for(var l=Ae(e).getQuery(),c=[],h="",u=o;u<=r;u++){l.test(e.getLine(u))&&(c.push(u+1),h+=e.getLine(u)+"<br>")}if(!i)return void He(e,h);var d=0,g=function(){if(d<c.length){var t=c[d]+i;sn.processCommand(e,t,{callback:g})}d++};g()},substitute:function(e,t){if(!e.getSearchCursor)throw new Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var n,i,o,r,s=t.argString,a=s?Te(s,s[0]):[],l="",c=!1,h=!1;if(a.length)n=a[0],l=a[1],n&&"$"===n[n.length-1]&&(n=n.slice(0,n.length-1)+"\\n",l=l?l+"\n":"\n"),l!==undefined&&(l=k("pcre")?Fe(l):Ie(l),Ut.lastSubstituteReplacePart=l),i=a[2]?a[2].split(" "):[];else if(s&&s.length)return void He(e,"Substitutions should be of the form :s/pattern/replace/");if(i&&(o=i[0],r=parseInt(i[1]),o&&(-1!=o.indexOf("c")&&(c=!0,o.replace("c","")),-1!=o.indexOf("g")&&(h=!0,o.replace("g","")),n=n.replace(/\//g,"\\/")+"/"+o)),n)try{We(e,n,!0,!0)}catch(t){return void He(e,"Invalid regex: "+n)}if((l=l||Ut.lastSubstituteReplacePart)===undefined)return void He(e,"No previous substitute regular expression");var u=Ae(e),d=u.getQuery(),g=t.line!==undefined?t.line:e.getCursor().line,p=t.lineEnd||g;g==e.firstLine()&&p==e.lastLine()&&(p=Infinity),r&&(g=p,p=g+r-1);var f=B(e,Rt(g,0)),m=e.getSearchCursor(d,f);Xe(e,c,h,g,p,m,d,l,t.callback)},redo:_t.commands.redo,undo:_t.commands.undo,write:function(e){_t.commands.save?_t.commands.save(e):e.save&&e.save()},nohlsearch:function(e){Ue(e)},yank:function(e){var t=K(e.getCursor()),n=t.line,i=e.getLine(n);Ut.registerController.pushText("0","yank",i,!0,!0)},delmarks:function(e,t){if(!t.argString||!Q(t.argString))return void He(e,"Argument required");for(var n=e.state.vim,i=new _t.StringStream(Q(t.argString));!i.eol();){i.eatSpace();var o=i.pos;if(!i.match(/[a-zA-Z]/,!1))return void He(e,"Invalid argument: "+t.argString.substring(o));var r=i.next();if(i.match("-",!0)){if(!i.match(/[a-zA-Z]/,!1))return void He(e,"Invalid argument: "+t.argString.substring(o));var s=r,a=i.next();if(!(g(s)&&g(a)||m(s)&&m(a)))return void He(e,"Invalid argument: "+s+"-");var l=s.charCodeAt(0),c=a.charCodeAt(0);if(l>=c)return void He(e,"Invalid argument: "+t.argString.substring(o));for(var h=0;h<=c-l;h++){var u=String.fromCharCode(l+h);delete n.marks[u]}}else delete n.marks[r]}}},sn=new on;_t.keyMap.vim={attach:a,detach:s,call:l},y("insertModeEscKeysTimeout",200,"number"),_t.keyMap["vim-insert"]={fallthrough:["default"],attach:a,detach:s,call:l},_t.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:a,detach:s,call:l},$(),_t.Vim=Tt(),Tt=_t.Vim;var an={"return":"CR",backspace:"BS","delete":"Del",esc:"Esc",left:"Left",right:"Right",up:"Up",down:"Down",space:"Space",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown",enter:"CR"},ln=Tt.handleKey.bind(Tt);Tt.handleKey=function(e,t,n){return e.operation(function(){return ln(e,t,n)},!0)},t.CodeMirror=_t;var cn=Tt.maybeInitVimState_;t.handler={$id:"ace/keyboard/vim",drawCursor:function(e,t,n,i,o){var r=this.state.vim||{},s=n.characterWidth,a=n.lineHeight,l=t.top,c=t.left;if(!r.insertMode){!(i.cursor?ft.comparePoints(i.cursor,i.start)<=0:o.selection.isBackwards()||o.selection.isEmpty())&&c>s&&(c-=s)}!r.insertMode&&r.status&&(a/=2,l+=a),vt.translate(e,c,l),vt.setStyle(e.style,"width",s+"px"),vt.setStyle(e.style,"height",a+"px")},handleKeyboard:function(e,t,n,i,o){var r=e.editor,s=r.state.cm,a=cn(s);if(-1!=i){if(a.insertMode||(-1==t?(n.charCodeAt(0)>255&&e.inputKey&&(n=e.inputKey)&&4==e.inputHash&&(n=n.toUpperCase()),e.inputChar=n):4==t||0==t?e.inputKey==n&&e.inputHash==t&&e.inputChar?(n=e.inputChar,t=-1):(e.inputChar=null,e.inputKey=n,e.inputHash=t):e.inputChar=e.inputKey=null),"c"==n&&1==t&&!kt.isMac&&r.getCopyText())return r.once("copy",function(){r.selection.clearSelection()}),{command:"null",passEvent:!0};if("esc"==n&&!a.insertMode&&!a.visualMode&&!s.ace.inMultiSelectMode){var l=Ae(s),c=l.getOverlay();c&&s.removeOverlay(c)}if(-1==t||1&t||0===t&&n.length>1){var h=a.insertMode,u=ut(t,n,o||{});null==a.status&&(a.status="");var d=gt(s,u,"user");if(a=cn(s),d&&null!=a.status?a.status+=u:null==a.status&&(a.status=""),s._signal("changeStatus"),!d&&(-1!=t||h))return;return{command:"null",passEvent:!d}}}},attach:function(e){function t(){var t=cn(n).insertMode;n.ace.renderer.setStyle("normal-mode",!t),e.textInput.setCommandMode(!t),e.renderer.$keepTextAreaAtCursor=t,e.renderer.$blockCursor=!t}e.state||(e.state={});var n=new _t(e);e.state.cm=n,e.$vimModeHandler=this,_t.keyMap.vim.attach(n),cn(n).status=null,n.on("vim-command-done",function(){n.virtualSelectionMode()||(cn(n).status=null,n.ace._signal("changeStatus"),n.ace.session.markUndoGroup())}),n.on("changeStatus",function(){n.ace.renderer.updateCursor(),n.ace._signal("changeStatus")}),n.on("vim-mode-change",function(){n.virtualSelectionMode()||(t(),n._signal("changeStatus"))}),t(),e.renderer.$cursorLayer.drawCursor=this.drawCursor.bind(n)},detach:function(e){var t=e.state.cm;_t.keyMap.vim.detach(t),t.destroy(),e.state.cm=null,e.$vimModeHandler=null,e.renderer.$cursorLayer.drawCursor=null,e.renderer.setStyle("normal-mode",!1),e.textInput.setCommandMode(!1),e.renderer.$keepTextAreaAtCursor=!0},getStatusText:function(e){var t=e.state.cm,n=cn(t);if(n.insertMode)return"INSERT";var i="";return n.visualMode&&(i+="VISUAL",n.visualLine&&(i+=" LINE"),n.visualBlock&&(i+=" BLOCK")),n.status&&(i+=(i?" ":"")+n.status),i}},Tt.defineOption({name:"wrap",set:function(e,t){t&&t.ace.setOption("wrap",e)},type:"boolean"},!1),Tt.defineEx("write","w",function(){console.log(":write is not implemented")}),At.push({keys:"zc",type:"action",action:"fold",actionArgs:{open:!1}},{keys:"zC",type:"action",action:"fold",actionArgs:{open:!1,all:!0}},{keys:"zo",type:"action",action:"fold",actionArgs:{open:!0}},{keys:"zO",type:"action",action:"fold",actionArgs:{open:!0,all:!0}},{keys:"za",type:"action",action:"fold",actionArgs:{toggle:!0}},{keys:"zA",type:"action",action:"fold",actionArgs:{toggle:!0,all:!0}},{keys:"zf",type:"action",action:"fold",actionArgs:{open:!0,all:!0}},{keys:"zd",type:"action",action:"fold",actionArgs:{open:!0,all:!0}},{keys:"<C-A-k>",type:"action",action:"aceCommand",actionArgs:{name:"addCursorAbove"}},{keys:"<C-A-j>",type:"action",action:"aceCommand",actionArgs:{name:"addCursorBelow"}},{keys:"<C-A-S-k>",type:"action",action:"aceCommand",actionArgs:{name:"addCursorAboveSkipCurrent"}},{keys:"<C-A-S-j>",type:"action",action:"aceCommand",actionArgs:{name:"addCursorBelowSkipCurrent"}},{keys:"<C-A-h>",type:"action",action:"aceCommand",actionArgs:{name:"selectMoreBefore"}},{keys:"<C-A-l>",type:"action",action:"aceCommand",actionArgs:{name:"selectMoreAfter"}},{keys:"<C-A-S-h>",type:"action",action:"aceCommand",actionArgs:{name:"selectNextBefore"}},{keys:"<C-A-S-l>",type:"action",action:"aceCommand",actionArgs:{name:"selectNextAfter"}}),Yt.aceCommand=function(e,t){e.vimCmd=t,e.ace.inVirtualSelectionMode?e.ace.on("beforeEndOperation",pt):pt(null,e.ace)},Yt.fold=function(e,t){e.ace.execCommand(["toggleFoldWidget","toggleFoldWidget","foldOther","unfoldall"][(t.all?2:0)+(t.open?1:0)])},t.handler.defaultKeymap=At,t.handler.actions=Yt,t.Vim=Tt}),function(){ace.require(["ace/keyboard/vim"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/occur",["require","exports","module","ace/lib/oop","ace/range","ace/search","ace/edit_session","ace/search_highlight","ace/lib/dom"],function(e,t){"use strict";function n(){}var i=e("./lib/oop"),o=(e("./range").Range,e("./search").Search),r=e("./edit_session").EditSession,s=e("./search_highlight").SearchHighlight;i.inherits(n,o),function(){this.enter=function(e,t){if(!t.needle)return!1;var n=e.getCursorPosition();this.displayOccurContent(e,t);var i=this.originalToOccurPosition(e.session,n);return e.moveCursorToPosition(i),!0},this.exit=function(e,t){var n=t.translatePosition&&e.getCursorPosition(),i=n&&this.occurToOriginalPosition(e.session,n);return this.displayOriginalContent(e),i&&e.moveCursorToPosition(i),!0},this.highlight=function(e,t){(e.$occurHighlight=e.$occurHighlight||e.addDynamicMarker(new s(null,"ace_occur-highlight","text"))).setRegexp(t),e._emit("changeBackMarker")},this.displayOccurContent=function(e,t){this.$originalSession=e.session;var n=this.matchingLines(e.session,t),i=n.map(function(e){return e.content}),o=new r(i.join("\n"));o.$occur=this,o.$occurMatchingLines=n,e.setSession(o),this.$useEmacsStyleLineStart=this.$originalSession.$useEmacsStyleLineStart,o.$useEmacsStyleLineStart=this.$useEmacsStyleLineStart,this.highlight(o,t.re),o._emit("changeBackMarker")},this.displayOriginalContent=function(e){e.setSession(this.$originalSession),this.$originalSession.$useEmacsStyleLineStart=this.$useEmacsStyleLineStart},this.originalToOccurPosition=function(e,t){var n=e.$occurMatchingLines,i={row:0,column:0};if(!n)return i;for(var o=0;o<n.length;o++)if(n[o].row===t.row)return{row:o,column:t.column};return i},this.occurToOriginalPosition=function(e,t){var n=e.$occurMatchingLines;return n&&n[t.row]?{row:n[t.row].row,column:t.column}:t},this.matchingLines=function(e,t){if(t=i.mixin({},t),!e||!t.needle)return[];var n=new o;return n.set(t),n.findAll(e).reduce(function(t,n){var i=n.start.row,o=t[t.length-1];return o&&o.row===i?t:t.concat({row:i,content:e.getLine(i)})},[])}}.call(n.prototype),e("./lib/dom").importCssString(".ace_occur-highlight {\n border-radius: 4px;\n background-color: rgba(87, 255, 8, 0.25);\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n box-shadow: 0 0 4px rgb(91, 255, 50);\n}\n.ace_dark .ace_occur-highlight {\n background-color: rgb(80, 140, 85);\n box-shadow: 0 0 4px rgb(60, 120, 70);\n}\n","incremental-occur-highlighting"),t.Occur=n}),ace.define("ace/commands/occur_commands",["require","exports","module","ace/config","ace/occur","ace/keyboard/hash_handler","ace/lib/oop"],function(e,t){function n(){}var i=(e("../config"),e("../occur").Occur),o={name:"occur",exec:function(e,t){var o=!!e.session.$occur;(new i).enter(e,t)&&!o&&n.installIn(e)},readOnly:!0},r=[{name:"occurexit",bindKey:"esc|Ctrl-G",exec:function(e){var t=e.session.$occur;t&&(t.exit(e,{}),e.session.$occur||n.uninstallFrom(e))},readOnly:!0},{name:"occuraccept",bindKey:"enter",exec:function(e){var t=e.session.$occur;t&&(t.exit(e,{translatePosition:!0}),e.session.$occur||n.uninstallFrom(e))},readOnly:!0}],s=e("../keyboard/hash_handler").HashHandler;e("../lib/oop").inherits(n,s),function(){this.isOccurHandler=!0,this.attach=function(e){s.call(this,r,e.commands.platform),this.$editor=e};var e=this.handleKeyboard;this.handleKeyboard=function(t,n,i,o){var r=e.call(this,t,n,i,o);return r&&r.command?r:undefined}}.call(n.prototype),n.installIn=function(e){var t=new this;e.keyBinding.addKeyboardHandler(t),e.commands.addCommands(r)},n.uninstallFrom=function(e){e.commands.removeCommands(r);var t=e.getKeyboardHandler();t.isOccurHandler&&e.keyBinding.removeKeyboardHandler(t)},t.occurStartCommand=o}),ace.define("ace/commands/incremental_search_commands",["require","exports","module","ace/config","ace/lib/oop","ace/keyboard/hash_handler","ace/commands/occur_commands"],function(e,t){function n(e){this.$iSearch=e}var i=e("../config"),o=e("../lib/oop"),r=e("../keyboard/hash_handler").HashHandler,s=e("./occur_commands").occurStartCommand;t.iSearchStartCommands=[{name:"iSearch",bindKey:{win:"Ctrl-F",mac:"Command-F"},exec:function(e,t){i.loadModule(["core","ace/incremental_search"],function(n){var i=n.iSearch=n.iSearch||new n.IncrementalSearch;i.activate(e,t.backwards),t.jumpToFirstMatch&&i.next(t)})},readOnly:!0},{name:"iSearchBackwards",exec:function(e){e.execCommand("iSearch",{backwards:!0})},readOnly:!0},{name:"iSearchAndGo",bindKey:{win:"Ctrl-K",mac:"Command-G"},exec:function(e){e.execCommand("iSearch",{jumpToFirstMatch:!0,useCurrentOrPrevSearch:!0})},readOnly:!0},{name:"iSearchBackwardsAndGo",bindKey:{win:"Ctrl-Shift-K",mac:"Command-Shift-G"},exec:function(e){e.execCommand("iSearch",{jumpToFirstMatch:!0,backwards:!0,useCurrentOrPrevSearch:!0})},readOnly:!0}],t.iSearchCommands=[{name:"restartSearch",bindKey:{win:"Ctrl-F",mac:"Command-F"},exec:function(e){e.cancelSearch(!0)}},{name:"searchForward",bindKey:{win:"Ctrl-S|Ctrl-K",mac:"Ctrl-S|Command-G"},exec:function(e,t){t.useCurrentOrPrevSearch=!0,e.next(t)}},{name:"searchBackward",bindKey:{win:"Ctrl-R|Ctrl-Shift-K",mac:"Ctrl-R|Command-Shift-G"},exec:function(e,t){t.useCurrentOrPrevSearch=!0,t.backwards=!0,e.next(t)}},{name:"extendSearchTerm",exec:function(e,t){e.addString(t)}},{name:"extendSearchTermSpace",bindKey:"space",exec:function(e){e.addString(" ")}},{name:"shrinkSearchTerm",bindKey:"backspace",exec:function(e){e.removeChar()}},{name:"confirmSearch",bindKey:"return",exec:function(e){e.deactivate()}},{name:"cancelSearch",bindKey:"esc|Ctrl-G",exec:function(e){e.deactivate(!0)}},{name:"occurisearch",bindKey:"Ctrl-O",exec:function(e){var t=o.mixin({},e.$options);e.deactivate(),s.exec(e.$editor,t)}},{name:"yankNextWord",bindKey:"Ctrl-w",exec:function(e){var t=e.$editor,n=t.selection.getRangeOfMovements(function(e){e.moveCursorWordRight()}),i=t.session.getTextRange(n);e.addString(i)}},{name:"yankNextChar",bindKey:"Ctrl-Alt-y",exec:function(e){var t=e.$editor,n=t.selection.getRangeOfMovements(function(e){e.moveCursorRight()}),i=t.session.getTextRange(n);e.addString(i)}},{name:"recenterTopBottom",bindKey:"Ctrl-l",exec:function(e){e.$editor.execCommand("recenterTopBottom")}},{name:"selectAllMatches",bindKey:"Ctrl-space",exec:function(e){var t=e.$editor,n=t.session.$isearchHighlight,i=n&&n.cache?n.cache.reduce(function(e,t){return e.concat(t||[])},[]):[];e.deactivate(!1),i.forEach(t.selection.addRange.bind(t.selection))}},{name:"searchAsRegExp",bindKey:"Alt-r",exec:function(e){e.convertNeedleToRegExp()}}].map(function(e){return e.readOnly=!0,e.isIncrementalSearchCommand=!0,e.scrollIntoView="animate-cursor",e}),o.inherits(n,r),function(){this.attach=function(e){var n=this.$iSearch;r.call(this,t.iSearchCommands,e.commands.platform),this.$commandExecHandler=e.commands.addEventListener("exec",function(t){if(!t.command.isIncrementalSearchCommand)return n.deactivate();t.stopPropagation(),t.preventDefault();var i=e.session.getScrollTop(),o=t.command.exec(n,t.args||{});return e.renderer.scrollCursorIntoView(null,.5),e.renderer.animateScrolling(i),o})},this.detach=function(e){this.$commandExecHandler&&(e.commands.removeEventListener("exec",this.$commandExecHandler),delete this.$commandExecHandler)};var e=this.handleKeyboard;this.handleKeyboard=function(t,n,i,o){if((1===n||8===n)&&"v"===i||1===n&&"y"===i)return null;var r=e.call(this,t,n,i,o);if(r.command)return r;if(-1==n){var s=this.commands.extendSearchTerm;if(s)return{command:s,args:i}}return!1}}.call(n.prototype),t.IncrementalSearchKeyboardHandler=n}),ace.define("ace/incremental_search",["require","exports","module","ace/lib/oop","ace/range","ace/search","ace/search_highlight","ace/commands/incremental_search_commands","ace/lib/dom","ace/commands/command_manager","ace/editor","ace/config"],function(e,t){"use strict";function n(){this.$options={wrap:!1,skipCurrent:!1},this.$keyboardHandler=new d(this)}function i(e){return e instanceof RegExp}function o(e){var t=String(e),n=t.indexOf("/"),i=t.lastIndexOf("/");return{expression:t.slice(n+1,i),flags:t.slice(i+1)}}function r(e,t){try{return new RegExp(e,t)}catch(t){return e}}function s(e){return r(e.expression,e.flags)}var a=e("./lib/oop"),l=e("./range").Range,c=e("./search").Search,h=e("./search_highlight").SearchHighlight,u=e("./commands/incremental_search_commands"),d=u.IncrementalSearchKeyboardHandler;a.inherits(n,c),function(){this.activate=function(e,t){this.$editor=e,this.$startPos=this.$currentPos=e.getCursorPosition(),this.$options.needle="",this.$options.backwards=t,e.keyBinding.addKeyboardHandler(this.$keyboardHandler),this.$originalEditorOnPaste=e.onPaste,e.onPaste=this.onPaste.bind(this),this.$mousedownHandler=e.addEventListener("mousedown",this.onMouseDown.bind(this)),this.selectionFix(e),this.statusMessage(!0)},this.deactivate=function(e){this.cancelSearch(e);var t=this.$editor;t.keyBinding.removeKeyboardHandler(this.$keyboardHandler),this.$mousedownHandler&&(t.removeEventListener("mousedown",this.$mousedownHandler),delete this.$mousedownHandler),t.onPaste=this.$originalEditorOnPaste,this.message("")},this.selectionFix=function(e){e.selection.isEmpty()&&!e.session.$emacsMark&&e.clearSelection()},this.highlight=function(e){var t=this.$editor.session;(t.$isearchHighlight=t.$isearchHighlight||t.addDynamicMarker(new h(null,"ace_isearch-result","text"))).setRegexp(e),t._emit("changeBackMarker")},this.cancelSearch=function(e){var t=this.$editor;return this.$prevNeedle=this.$options.needle,this.$options.needle="",e?(t.moveCursorToPosition(this.$startPos),this.$currentPos=this.$startPos):t.pushEmacsMark&&t.pushEmacsMark(this.$startPos,!1),this.highlight(null),l.fromPoints(this.$currentPos,this.$currentPos)},this.highlightAndFindWithNeedle=function(e,t){if(!this.$editor)return null;var n=this.$options;if(t&&(n.needle=t.call(this,n.needle||"")||""),0===n.needle.length)return this.statusMessage(!0),this.cancelSearch(!0);n.start=this.$currentPos
19
19
  ;var i=this.$editor.session,o=this.find(i),r=this.$editor.emacsMark?!!this.$editor.emacsMark():!this.$editor.selection.isEmpty();return o&&(n.backwards&&(o=l.fromPoints(o.end,o.start)),this.$editor.selection.setRange(l.fromPoints(r?this.$startPos:o.end,o.end)),e&&(this.$currentPos=o.end),this.highlight(n.re)),this.statusMessage(o),o},this.addString=function(e){return this.highlightAndFindWithNeedle(!1,function(t){if(!i(t))return t+e;var n=o(t);return n.expression+=e,s(n)})},this.removeChar=function(){return this.highlightAndFindWithNeedle(!1,function(e){if(!i(e))return e.substring(0,e.length-1);var t=o(e);return t.expression=t.expression.substring(0,t.expression.length-1),s(t)})},this.next=function(e){return e=e||{},this.$options.backwards=!!e.backwards,this.$currentPos=this.$editor.getCursorPosition(),this.highlightAndFindWithNeedle(!0,function(t){return e.useCurrentOrPrevSearch&&0===t.length?this.$prevNeedle||"":t})},this.onMouseDown=function(){return this.deactivate(),!0},this.onPaste=function(e){this.addString(e)},this.convertNeedleToRegExp=function(){return this.highlightAndFindWithNeedle(!1,function(e){return i(e)?e:r(e,"ig")})},this.convertNeedleToString=function(){return this.highlightAndFindWithNeedle(!1,function(e){return i(e)?o(e).expression:e})},this.statusMessage=function(e){var t=this.$options,n="";n+=t.backwards?"reverse-":"",n+="isearch: "+t.needle,n+=e?"":" (not found)",this.message(n)},this.message=function(e){this.$editor.showCommandLine?(this.$editor.showCommandLine(e),this.$editor.focus()):console.log(e)}}.call(n.prototype),t.IncrementalSearch=n;var g=e("./lib/dom");g.importCssString&&g.importCssString(".ace_marker-layer .ace_isearch-result { position: absolute; z-index: 6; box-sizing: border-box;}div.ace_isearch-result { border-radius: 4px; background-color: rgba(255, 200, 0, 0.5); box-shadow: 0 0 4px rgb(255, 200, 0);}.ace_dark div.ace_isearch-result { background-color: rgb(100, 110, 160); box-shadow: 0 0 4px rgb(80, 90, 140);}","incremental-search-highlighting");var p=e("./commands/command_manager");(function(){this.setupIncrementalSearch=function(e,t){if(this.usesIncrementalSearch!=t){this.usesIncrementalSearch=t;var n=u.iSearchStartCommands;this[t?"addCommands":"removeCommands"](n)}}}).call(p.CommandManager.prototype);var f=e("./editor").Editor;e("./config").defineOptions(f.prototype,"editor",{useIncrementalSearch:{set:function(e){this.keyBinding.$handlers.forEach(function(t){t.setupIncrementalSearch&&t.setupIncrementalSearch(this,e)}),this._emit("incrementalSearchSettingChanged",{isEnabled:e})}}})}),ace.define("ace/keyboard/emacs",["require","exports","module","ace/lib/dom","ace/incremental_search","ace/commands/incremental_search_commands","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t){"use strict";var n=e("../lib/dom");e("../incremental_search");var i=e("../commands/incremental_search_commands"),o=e("./hash_handler").HashHandler;t.handler=new o,t.handler.isEmacs=!0,t.handler.$id="ace/keyboard/emacs";var r,s,a=!1;t.handler.attach=function(e){a||(a=!0,n.importCssString(" .emacs-mode .ace_cursor{ border: 1px rgba(50,250,50,0.8) solid!important; box-sizing: border-box!important; background-color: rgba(0,250,0,0.9); opacity: 0.5; } .emacs-mode .ace_hidden-cursors .ace_cursor{ opacity: 1; background-color: transparent; } .emacs-mode .ace_overwrite-cursors .ace_cursor { opacity: 1; background-color: transparent; border-width: 0 0 2px 2px !important; } .emacs-mode .ace_text-layer { z-index: 4 } .emacs-mode .ace_cursor-layer { z-index: 2 }","emacsMode")),r=e.session.$selectLongWords,e.session.$selectLongWords=!0,s=e.session.$useEmacsStyleLineStart,e.session.$useEmacsStyleLineStart=!0,e.session.$emacsMark=null,e.session.$emacsMarkRing=e.session.$emacsMarkRing||[],e.emacsMark=function(){return this.session.$emacsMark},e.setEmacsMark=function(e){this.session.$emacsMark=e},e.pushEmacsMark=function(e,t){var n=this.session.$emacsMark;n&&this.session.$emacsMarkRing.push(n),!e||t?this.setEmacsMark(e):this.session.$emacsMarkRing.push(e)},e.popEmacsMark=function(){var e=this.emacsMark();return e?(this.setEmacsMark(null),e):this.session.$emacsMarkRing.pop()},e.getLastEmacsMark=function(){return this.session.$emacsMark||this.session.$emacsMarkRing.slice(-1)[0]},e.emacsMarkForSelection=function(e){var t=this.selection,n=this.multiSelect?this.multiSelect.getAllRanges().length:1,i=t.index||0,o=this.session.$emacsMarkRing,r=o.length-(n-i),s=o[r]||t.anchor;return e&&o.splice(r,1,"row"in e&&"column"in e?e:undefined),s},e.on("click",c),e.on("changeSession",l),e.renderer.$blockCursor=!0,e.setStyle("emacs-mode"),e.commands.addCommands(d),t.handler.platform=e.commands.platform,e.$emacsModeHandler=this,e.addEventListener("copy",this.onCopy),e.addEventListener("paste",this.onPaste)},t.handler.detach=function(e){e.renderer.$blockCursor=!1,e.session.$selectLongWords=r,e.session.$useEmacsStyleLineStart=s,e.removeEventListener("click",c),e.removeEventListener("changeSession",l),e.unsetStyle("emacs-mode"),e.commands.removeCommands(d),e.removeEventListener("copy",this.onCopy),e.removeEventListener("paste",this.onPaste),e.$emacsModeHandler=null};var l=function(e){e.oldSession&&(e.oldSession.$selectLongWords=r,e.oldSession.$useEmacsStyleLineStart=s),r=e.session.$selectLongWords,e.session.$selectLongWords=!0,s=e.session.$useEmacsStyleLineStart,e.session.$useEmacsStyleLineStart=!0,e.session.hasOwnProperty("$emacsMark")||(e.session.$emacsMark=null),e.session.hasOwnProperty("$emacsMarkRing")||(e.session.$emacsMarkRing=[])},c=function(e){e.editor.session.$emacsMark=null},h=e("../lib/keys").KEY_MODS,u={C:"ctrl",S:"shift",M:"alt",CMD:"command"};["C-S-M-CMD","S-M-CMD","C-M-CMD","C-S-CMD","C-S-M","M-CMD","S-CMD","S-M","C-CMD","C-M","C-S","CMD","M","S","C"].forEach(function(e){var t=0;e.split("-").forEach(function(e){t|=h[u[e]]}),u[t]=e.toLowerCase()+"-"}),t.handler.onCopy=function(e,n){n.$handlesEmacsOnCopy||(n.$handlesEmacsOnCopy=!0,t.handler.commands.killRingSave.exec(n),n.$handlesEmacsOnCopy=!1)},t.handler.onPaste=function(e,t){t.pushEmacsMark(t.getCursorPosition())},t.handler.bindKey=function(e,t){if("object"==typeof e&&(e=e[this.platform]),e){var n=this.commandKeyBinding;e.split("|").forEach(function(e){e=e.toLowerCase(),n[e]=t,e.split(" ").slice(0,-1).reduce(function(e,t,n){var i=e[n-1]?e[n-1]+" ":"";return e.concat([i+t])},[]).forEach(function(e){n[e]||(n[e]="null")})},this)}},t.handler.getStatusText=function(e,t){var n="";return t.count&&(n+=t.count),t.keyChain&&(n+=" "+t.keyChain),n},t.handler.handleKeyboard=function(e,t,n,i){if(-1===i)return undefined;var o=e.editor;if(o._signal("changeStatus"),-1==t&&(o.pushEmacsMark(),e.count)){var r=new Array(e.count+1).join(n);return e.count=null,{command:"insertstring",args:r}}var s=u[t];if("c-"==s||e.count){var a=parseInt(n[n.length-1]);if("number"==typeof a&&!isNaN(a))return e.count=Math.max(e.count,0)||0,e.count=10*e.count+a,{command:"null"}}s&&(n=s+n),e.keyChain&&(n=e.keyChain+=" "+n);var l=this.commandKeyBinding[n];if(e.keyChain="null"==l?n:"",!l)return undefined;if("null"===l)return{command:"null"};if("universalArgument"===l)return e.count=-4,{command:"null"};var c;if("string"!=typeof l&&(c=l.args,l.command&&(l=l.command),"goorselect"===l&&(l=o.emacsMark()?c[1]:c[0],c=null)),"string"==typeof l&&(("insertstring"===l||"splitline"===l||"togglecomment"===l)&&o.pushEmacsMark(),!(l=this.commands[l]||o.commands.commands[l])))return undefined;if(!l.readOnly&&!l.isYank&&(e.lastCommand=null),!l.readOnly&&o.emacsMark()&&o.setEmacsMark(null),e.count){var a=e.count;if(e.count=0,!l||!l.handlesCount)return{args:c,command:{exec:function(e,t){for(var n=0;n<a;n++)l.exec(e,t)},multiSelectAction:l.multiSelectAction}};c||(c={}),"object"==typeof c&&(c.count=a)}return{command:l,args:c}},t.emacsKeys={"Up|C-p":{command:"goorselect",args:["golineup","selectup"]},"Down|C-n":{command:"goorselect",args:["golinedown","selectdown"]},"Left|C-b":{command:"goorselect",args:["gotoleft","selectleft"]},"Right|C-f":{command:"goorselect",args:["gotoright","selectright"]},"C-Left|M-b":{command:"goorselect",args:["gotowordleft","selectwordleft"]},"C-Right|M-f":{command:"goorselect",args:["gotowordright","selectwordright"]},"Home|C-a":{command:"goorselect",args:["gotolinestart","selecttolinestart"]},"End|C-e":{command:"goorselect",args:["gotolineend","selecttolineend"]},"C-Home|S-M-,":{command:"goorselect",args:["gotostart","selecttostart"]},"C-End|S-M-.":{command:"goorselect",args:["gotoend","selecttoend"]},"S-Up|S-C-p":"selectup","S-Down|S-C-n":"selectdown","S-Left|S-C-b":"selectleft","S-Right|S-C-f":"selectright","S-C-Left|S-M-b":"selectwordleft","S-C-Right|S-M-f":"selectwordright","S-Home|S-C-a":"selecttolinestart","S-End|S-C-e":"selecttolineend","S-C-Home":"selecttostart","S-C-End":"selecttoend","C-l":"recenterTopBottom","M-s":"centerselection","M-g":"gotoline","C-x C-p":"selectall","C-Down":{command:"goorselect",args:["gotopagedown","selectpagedown"]},"C-Up":{command:"goorselect",args:["gotopageup","selectpageup"]},"PageDown|C-v":{command:"goorselect",args:["gotopagedown","selectpagedown"]},"PageUp|M-v":{command:"goorselect",args:["gotopageup","selectpageup"]},"S-C-Down":"selectpagedown","S-C-Up":"selectpageup","C-s":"iSearch","C-r":"iSearchBackwards","M-C-s":"findnext","M-C-r":"findprevious","S-M-5":"replace",Backspace:"backspace","Delete|C-d":"del","Return|C-m":{command:"insertstring",args:"\n"},"C-o":"splitline","M-d|C-Delete":{command:"killWord",args:"right"},"C-Backspace|M-Backspace|M-Delete":{command:"killWord",args:"left"},"C-k":"killLine","C-y|S-Delete":"yank","M-y":"yankRotate","C-g":"keyboardQuit","C-w|C-S-W":"killRegion","M-w":"killRingSave","C-Space":"setMark","C-x C-x":"exchangePointAndMark","C-t":"transposeletters","M-u":"touppercase","M-l":"tolowercase","M-/":"autocomplete","C-u":"universalArgument","M-;":"togglecomment","C-/|C-x u|S-C--|C-z":"undo","S-C-/|S-C-x u|C--|S-C-z":"redo","C-x r":"selectRectangularRegion","M-x":{command:"focusCommandLine",args:"M-x "}},t.handler.bindKeys(t.emacsKeys),t.handler.addCommands({recenterTopBottom:function(e){var t=e.renderer,n=t.$cursorLayer.getPixelPosition(),i=t.$size.scrollerHeight-t.lineHeight,o=t.scrollTop;o=Math.abs(n.top-o)<2?n.top-i:Math.abs(n.top-o-.5*i)<2?n.top:n.top-.5*i,e.session.setScrollTop(o)},selectRectangularRegion:function(e){e.multiSelect.toggleBlockSelection()},setMark:{exec:function(e,t){function n(){var t=e.popEmacsMark();t&&e.moveCursorToPosition(t)}if(t&&t.count)return e.inMultiSelectMode?e.forEachSelection(n):n(),void n();var i=e.emacsMark(),o=e.selection.getAllRanges(),r=o.map(function(e){return{row:e.start.row,column:e.start.column}}),s=o.every(function(e){return e.isEmpty()});return!i&&s?i?void 0:(r.forEach(function(t){e.pushEmacsMark(t)}),void e.setEmacsMark(r[r.length-1])):(e.inMultiSelectMode?e.forEachSelection({exec:e.clearSelection.bind(e)}):e.clearSelection(),void(i&&e.pushEmacsMark(null)))},readOnly:!0,handlesCount:!0},exchangePointAndMark:{exec:function(e,t){var n=e.selection;if(!t.count&&!n.isEmpty())return void n.setSelectionRange(n.getRange(),!n.isBackwards());if(t.count){var i={row:n.lead.row,column:n.lead.column};n.clearSelection(),n.moveCursorToPosition(e.emacsMarkForSelection(i))}else n.selectToPosition(e.emacsMarkForSelection())},readOnly:!0,handlesCount:!0,multiSelectAction:"forEach"},killWord:{exec:function(e,n){e.clearSelection(),"left"==n?e.selection.selectWordLeft():e.selection.selectWordRight();var i=e.getSelectionRange(),o=e.session.getTextRange(i);t.killRing.add(o),e.session.remove(i),e.clearSelection()},multiSelectAction:"forEach"},killLine:function(e){e.pushEmacsMark(null),e.clearSelection();var n=e.getSelectionRange(),i=e.session.getLine(n.start.row);n.end.column=i.length,i=i.substr(n.start.column);var o=e.session.getFoldLine(n.start.row);o&&n.end.row!=o.end.row&&(n.end.row=o.end.row,i="x"),/^\s*$/.test(i)&&(n.end.row++,i=e.session.getLine(n.end.row),n.end.column=/^\s*$/.test(i)?i.length:0);var r=e.session.getTextRange(n);e.prevOp.command==this?t.killRing.append(r):t.killRing.add(r),e.session.remove(n),e.clearSelection()},yank:function(e){e.onPaste(t.killRing.get()||""),e.keyBinding.$data.lastCommand="yank"},yankRotate:function(e){"yank"==e.keyBinding.$data.lastCommand&&(e.undo(),e.session.$emacsMarkRing.pop(),e.onPaste(t.killRing.rotate()),e.keyBinding.$data.lastCommand="yank")},killRegion:{exec:function(e){t.killRing.add(e.getCopyText()),e.commands.byName.cut.exec(e),e.setEmacsMark(null)},readOnly:!0,multiSelectAction:"forEach"},killRingSave:{exec:function(e){e.$handlesEmacsOnCopy=!0;var n=e.session.$emacsMarkRing.slice(),i=[];t.killRing.add(e.getCopyText()),setTimeout(function(){function t(){var t=e.selection,n=t.getRange(),o=t.isBackwards()?n.end:n.start;i.push({row:o.row,column:o.column}),t.clearSelection()}e.$handlesEmacsOnCopy=!1,e.inMultiSelectMode?e.forEachSelection({exec:t}):t(),e.setEmacsMark(null),e.session.$emacsMarkRing=n.concat(i.reverse())},0)},readOnly:!0},keyboardQuit:function(e){e.selection.clearSelection(),e.setEmacsMark(null),e.keyBinding.$data.count=null},focusCommandLine:function(e,t){e.showCommandLine&&e.showCommandLine(t)}}),t.handler.addCommands(i.iSearchStartCommands);var d=t.handler.commands;d.yank.isYank=!0,d.yankRotate.isYank=!0,t.killRing={$data:[],add:function(e){e&&this.$data.push(e),this.$data.length>30&&this.$data.shift()},append:function(e){var t=this.$data.length-1,n=this.$data[t]||"";e&&(n+=e),n&&(this.$data[t]=n)},get:function(e){return e=e||1,this.$data.slice(this.$data.length-e,this.$data.length).reverse().join("\n")},pop:function(){return this.$data.length>1&&this.$data.pop(),this.get()},rotate:function(){return this.$data.unshift(this.$data.pop()),this.get()}}}),function(){ace.require(["ace/keyboard/emacs"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"],function(e,t){"use strict";var n=function(e){this.$editor=e;var t=this,n=[],i=!1;this.onAfterExec=function(){i=!1,t.processRows(n),n=[]},this.onExec=function(){i=!0},this.onChange=function(e){i&&(-1==n.indexOf(e.start.row)&&n.push(e.start.row),e.end.row!=e.start.row&&n.push(e.end.row))}};(function(){this.processRows=function(e){this.$inChange=!0;for(var t=[],n=0,i=e.length;n<i;n++){var o=e[n];if(!(t.indexOf(o)>-1))for(var r=this.$findCellWidthsForBlock(o),s=this.$setBlockCellWidthsToMax(r.cellWidths),a=r.firstRow,l=0,c=s.length;l<c;l++){var h=s[l];t.push(a),this.$adjustRow(a,h),a++}}this.$inChange=!1},this.$findCellWidthsForBlock=function(e){for(var t,n=[],i=e;i>=0&&(t=this.$cellWidthsForRow(i),0!=t.length);)n.unshift(t),i--;var o=i+1;i=e;for(var r=this.$editor.session.getLength();i<r-1&&(i++,t=this.$cellWidthsForRow(i),0!=t.length);)n.push(t);return{cellWidths:n,firstRow:o}},this.$cellWidthsForRow=function(e){for(var t=this.$selectionColumnsForRow(e),n=[-1].concat(this.$tabsForRow(e)),i=n.map(function(){return 0}).slice(1),o=this.$editor.session.getLine(e),r=0,s=n.length-1;r<s;r++){var a=n[r]+1,l=n[r+1],c=this.$rightmostSelectionInCell(t,l),h=o.substring(a,l);i[r]=Math.max(h.replace(/\s+$/g,"").length,c-a)}return i},this.$selectionColumnsForRow=function(e){var t=[],n=this.$editor.getCursorPosition();return this.$editor.session.getSelection().isEmpty()&&e==n.row&&t.push(n.column),t},this.$setBlockCellWidthsToMax=function(e){for(var t,n,i,o=!0,r=this.$izip_longest(e),s=0,a=r.length;s<a;s++){var l=r[s];if(l.push){l.push(NaN);for(var c=0,h=l.length;c<h;c++){var u=l[c];if(o&&(t=c,i=0,o=!1),isNaN(u)){n=c;for(var d=t;d<n;d++)e[d][s]=i;o=!0}i=Math.max(i,u)}}else console.error(l)}return e},this.$rightmostSelectionInCell=function(e,t){var n=0;if(e.length){for(var i=[],o=0,r=e.length;o<r;o++)e[o]<=t?i.push(o):i.push(0);n=Math.max.apply(Math,i)}return n},this.$tabsForRow=function(e){for(var t,n=[],i=this.$editor.session.getLine(e),o=/\t/g;null!=(t=o.exec(i));)n.push(t.index);return n},this.$adjustRow=function(e,t){var n=this.$tabsForRow(e);if(0!=n.length)for(var i=0,o=-1,r=this.$izip(t,n),s=0,a=r.length;s<a;s++){var l=r[s][0],c=r[s][1];o+=1+l,c+=i;var h=o-c;if(0!=h){var u=this.$editor.session.getLine(e).substr(0,c),d=u.replace(/\s*$/g,""),g=u.length-d.length;h>0&&(this.$editor.session.getDocument().insertInLine({row:e,column:c+1},Array(h+1).join(" ")+"\t"),this.$editor.session.getDocument().removeInLine(e,c,c+1),i+=h),h<0&&g>=-h&&(this.$editor.session.getDocument().removeInLine(e,c+h,c),i+=h)}}},this.$izip_longest=function(e){if(!e[0])return[];for(var t=e[0].length,n=e.length,i=1;i<n;i++){var o=e[i].length;o>t&&(t=o)}for(var r=[],s=0;s<t;s++){for(var a=[],i=0;i<n;i++)""===e[i][s]?a.push(NaN):a.push(e[i][s]);r.push(a)}return r},this.$izip=function(e,t){for(var n=e.length>=t.length?t.length:e.length,i=[],o=0;o<n;o++){var r=[e[o],t[o]];i.push(r)}return i}}).call(n.prototype),t.ElasticTabstopsLite=n;var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{useElasticTabstops:{set:function(e){e?(this.elasticTabstops||(this.elasticTabstops=new n(this)),this.commands.on("afterExec",this.elasticTabstops.onAfterExec),this.commands.on("exec",this.elasticTabstops.onExec),this.on("change",this.elasticTabstops.onChange)):this.elasticTabstops&&(this.commands.removeListener("afterExec",this.elasticTabstops.onAfterExec),this.commands.removeListener("exec",this.elasticTabstops.onExec),this.removeListener("change",this.elasticTabstops.onChange))}}})}),function(){ace.require(["ace/ext/elastic_tabstops_lite"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),function(){ace.require(["ace/ext/error_marker"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";e("../../lib/dom").importCssString("#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 100000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {vertical-align: middle;}.ace_optionsMenuEntry button[ace_selected_button=true] {background: #e7e7e7;box-shadow: 1px 0px 2px 0px #adadad inset;border-color: #adadad;}.ace_optionsMenuEntry button {background: white;border: 1px solid lightgray;margin: 0px;}.ace_optionsMenuEntry button:hover{background: #f0f0f0;}"),n.exports.overlayPage=function(e,t,n){function i(e){27===e.keyCode&&o()}function o(){r&&(document.removeEventListener("keydown",i),r.parentNode.removeChild(r),e.focus(),r=null,n&&n())}var r=document.createElement("div");return r.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; background-color: rgba(0, 0, 0, 0.3);",r.addEventListener("click",function(){o()}),document.addEventListener("keydown",i),t.addEventListener("click",function(e){e.stopPropagation()}),r.appendChild(t),document.body.appendChild(r),e.blur(),{close:o}}}),ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],function(e,t,n){"use strict";var i=e("../../lib/keys");n.exports.getEditorKeybordShortcuts=function(e){var t=(i.KEY_MODS,[]),n={};return e.keyBinding.$handlers.forEach(function(e){var i=e.commandKeyBinding;for(var o in i){var r=o.replace(/(^|-)\w/g,function(e){return e.toUpperCase()}),s=i[o];Array.isArray(s)||(s=[s]),s.forEach(function(e){"string"!=typeof e&&(e=e.name),n[e]?n[e].key+="|"+r:(n[e]={key:r,command:e},t.push(n[e]))})}}),t}}),ace.define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"],function(e,t,n){"use strict";function i(t){if(!document.getElementById("kbshortcutmenu")){var n=e("./menu_tools/overlay_page").overlayPage,i=e("./menu_tools/get_editor_keyboard_shortcuts").getEditorKeybordShortcuts,o=i(t),r=document.createElement("div"),s=o.reduce(function(e,t){return e+'<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'+t.command+'</span> : <span class="ace_optionsMenuKey">'+t.key+"</span></div>"},"");r.id="kbshortcutmenu",r.innerHTML="<h1>Keyboard Shortcuts</h1>"+s+"</div>",n(t,r)}}var o=e("../editor").Editor;n.exports.init=function(e){o.prototype.showKeyboardShortcuts=function(){i(this)},e.commands.addCommands([{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e){e.showKeyboardShortcuts()}}])}}),function(){ace.require(["ace/ext/keybinding_menu"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/snippets",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/lib/dom","ace/editor"],function(e,t){"use strict";function n(e){var t=(new Date).toLocaleString("en-us",e);return 1==t.length?"0"+t:t}var i=e("./lib/oop"),o=e("./lib/event_emitter").EventEmitter,r=e("./lib/lang"),s=e("./range").Range,a=e("./range_list").RangeList,l=e("./keyboard/hash_handler").HashHandler,c=e("./tokenizer").Tokenizer,h=e("./clipboard"),u={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,n){var i=e.session.getTextRange();return n?i.replace(/\n\r?([ \t]*\S)/g,"\n"+n+"$1"):i},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(){return h.getText&&h.getText()},FILENAME:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\]*$/,"")},FILEPATH:function(){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.start||""},BLOCK_COMMENT_END:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.end||""},LINE_COMMENT:function(e){return(e.session.$mode||{}).lineCommentStart||""},CURRENT_YEAR:n.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:n.bind(null,{year:"2-digit"}),CURRENT_MONTH:n.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:n.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:n.bind(null,{month:"short"}),CURRENT_DATE:n.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:n.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:n.bind(null,{weekday:"short"}),CURRENT_HOUR:n.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:n.bind(null,{minute:"2-digit"}),CURRENT_SECOND:n.bind(null,{second:"2-digit"})};u.SELECTED_TEXT=u.SELECTION;var d=function(){this.snippetMap={},this.snippetNameMap={}};(function(){i.implement(this,o),this.getTokenizer=function(){return d.$tokenizer||this.createTokenizer()},this.createTokenizer=function(){function e(e){return e=e.substr(1),/^\d+$/.test(e)?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function t(e){return"(?:[^\\\\"+e+"]|\\\\.)"}var n={regex:"/("+t("/")+"+)/",onMatch:function(e,t,n){var i=n[0];return i.fmtString=!0,i.guard=e.slice(1,-1),i.flag="",""},next:"formatString"};return d.$tokenizer=new c({start:[{regex:/\\./,onMatch:function(e,t,n){var i=e[1];return"}"==i&&n.length?e=i:-1!="`$\\".indexOf(i)&&(e=i),[e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:e},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(t,n,i){var o=e(t.substr(1));return i.unshift(o[0]),o},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+t("\\|")+"*\\|",onMatch:function(e,t,n){var i=e.slice(1,-1).replace(/\\[,|\\]|,/g,function(e){return 2==e.length?e[1]:"\0"}).split("\0");return n[0].choices=i,[i[0]]},next:"start"},n,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectElse?(n[0].expectElse=!1,n[0].ifEnd={elseEnd:n[0]},[n[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(e,t,n){var i=e[1];return"}"==i&&n.length?e=i:-1!="`$\\".indexOf(i)?e=i:"n"==i?e="\n":"t"==i?e="\t":-1!="ulULE".indexOf(i)&&(e={changeCase:i,local:i>"a"}),[e]}},{regex:"/\\w*}",onMatch:function(e,t,n){var i=n.shift();return i&&(i.flag=e.slice(1,-1)),this.next=i&&i.tabstopId?"start":"",[i||e]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(e){return[{text:e.slice(1)}]}},{regex:/\${\w+/,onMatch:function(e,t,n){var i={text:e.slice(2)};return n.unshift(i),[i]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(e,t,n){var i=n.shift();return this.next=i&&i.tabstopId?"start":"",[i||e]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(e,t,n){return n[0].formatFunction=e.slice(2,-1),[n.shift()]},next:"formatString"},n,{regex:/:[\?\-+]?/,onMatch:function(e,t,n){"+"==e[1]&&(n[0].ifEnd=n[0]),"?"==e[1]&&(n[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]}),d.$tokenizer},this.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map(function(e){return e.value||e})},this.getVariableValue=function(e,t,n){if(/^\d+$/.test(t))return(this.variables.__||{})[t]||"";if(/^[A-Z]\d+$/.test(t))return(this.variables[t[0]+"__"]||{})[t.substr(1)]||"";if(t=t.replace(/^TM_/,""),!this.variables.hasOwnProperty(t))return"";var i=this.variables[t];return"function"==typeof i&&(i=this.variables[t](e,t,n)),null==i?"":i},this.variables=u,this.tmStrFormat=function(e,t,n){if(!t.fmt)return e;var i=t.flag||"",o=t.guard;o=new RegExp(o,i.replace(/[^gim]/g,""));var r="string"==typeof t.fmt?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt,s=this;return e.replace(o,function(){var e=s.variables.__;s.variables.__=[].slice.call(arguments);for(var t=s.resolveVariables(r,n),i="E",o=0;o<t.length;o++){var a=t[o];if("object"==typeof a)if(t[o]="",a.changeCase&&a.local){var l=t[o+1];l&&"string"==typeof l&&("u"==a.changeCase?t[o]=l[0].toUpperCase():t[o]=l[0].toLowerCase(),t[o+1]=l.substr(1))}else a.changeCase&&(i=a.changeCase);else"U"==i?t[o]=a.toUpperCase():"L"==i&&(t[o]=a.toLowerCase())}return s.variables.__=e,t.join("")})},this.tmFormatFunction=function(e,t){return"upcase"==t.formatFunction?e.toUpperCase():"downcase"==t.formatFunction?e.toLowerCase():e},this.resolveVariables=function(e,t){function n(t){var n=e.indexOf(t,s+1);-1!=n&&(s=n)}for(var i=[],o="",r=!0,s=0;s<e.length;s++){var a=e[s];if("string"!=typeof a){if(a){if(r=!1,a.fmtString){var l=e.indexOf(a,s+1);-1==l&&(l=e.length),a.fmt=e.slice(s+1,l),s=l}if(a.text){var c=this.getVariableValue(t,a.text,o)+"";a.fmtString&&(c=this.tmStrFormat(c,a,t)),a.formatFunction&&(c=this.tmFormatFunction(c,a,t)),c&&!a.ifEnd?(i.push(c),n(a)):!c&&a.ifEnd&&n(a.ifEnd)}else a.elseEnd?n(a.elseEnd):null!=a.tabstopId?i.push(a):null!=a.changeCase&&i.push(a)}}else i.push(a),"\n"==a?(r=!0,o=""):r&&(o=/^\t*/.exec(a)[0],r=/\S/.test(a))}return i},this.insertSnippetForSelection=function(e,t){function n(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];if("object"==typeof i){if(c[i.tabstopId])continue;i=t[e.lastIndexOf(i,n-1)]||{tabstopId:i.tabstopId}}t[n]=i}return t}var i=e.getCursorPosition(),o=e.session.getLine(i.row),r=e.session.getTabString(),s=o.match(/^\s*/)[0];i.column<s.length&&(s=s.slice(0,i.column)),t=t.replace(/\r/g,"");var a=this.tokenizeTmSnippet(t);a=this.resolveVariables(a,e),a=a.map(function(e){return"\n"==e?e+s:"string"==typeof e?e.replace(/\t/g,r):e});var l=[];a.forEach(function(e,t){if("object"==typeof e){var n=e.tabstopId,i=l[n];if(i||(i=l[n]=[],i.index=n,i.value="",i.parents={}),-1===i.indexOf(e)){e.choices&&!i.choices&&(i.choices=e.choices),i.push(e);var o=a.indexOf(e,t+1);if(-1!==o){var r=a.slice(t+1,o);r.some(function(e){return"object"==typeof e})&&!i.value?i.value=r:r.length&&(!i.value||"string"!=typeof i.value)&&(i.value=r.join(""))}}}}),l.forEach(function(e){e.length=0});for(var c={},h=0;h<a.length;h++){var u=a[h];if("object"==typeof u){var d=u.tabstopId,p=l[d],f=a.indexOf(u,h+1);if(c[d])c[d]===u&&(delete c[d],Object.keys(c).forEach(function(e){p.parents[e]=!0}));else{c[d]=u;var m=p.value;"string"!=typeof m?m=n(m):u.fmt&&(m=this.tmStrFormat(m,u,e)),a.splice.apply(a,[h+1,Math.max(0,f-h)].concat(m,u)),-1===p.indexOf(u)&&p.push(u)}}}var v=0,b=0,w="";a.forEach(function(e){if("string"==typeof e){var t=e.split("\n");t.length>1?(b=t[t.length-1].length,v+=t.length-1):b+=e.length,w+=e}else e&&(e.start?e.end={row:v,column:b}:e.start={row:v,column:b})});var y=e.getSelectionRange(),x=e.session.replace(y,w),k=new g(e),C=e.inVirtualSelectionMode&&e.selection.index;k.addTabstops(l,y.start,x,C)},this.insertSnippet=function(e,t){var n=this;if(e.inVirtualSelectionMode)return n.insertSnippetForSelection(e,t);e.forEachSelection(function(){n.insertSnippetForSelection(e,t)},null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},this.$getScope=function(e){var t=e.session.$mode.$id||"";if("html"===(t=t.split("/").pop())||"php"===t){"php"===t&&!e.session.$mode.inlinePhp&&(t="html");var n=e.getCursorPosition(),i=e.session.getState(n.row);"object"==typeof i&&(i=i[0]),i.substring&&("js-"==i.substring(0,3)?t="javascript":"css-"==i.substring(0,4)?t="css":"php-"==i.substring(0,4)&&(t="php"))}return t},this.getActiveScopes=function(e){var t=this.$getScope(e),n=[t],i=this.snippetMap;return i[t]&&i[t].includeScopes&&n.push.apply(n,i[t].includeScopes),n.push("_"),n},this.expandWithTab=function(e,t){var n=this,i=e.forEachSelection(function(){return n.expandSnippetForSelection(e,t)},null,{keepOrder:!0});return i&&e.tabstopManager&&e.tabstopManager.tabNext(),i},this.expandSnippetForSelection=function(e,t){var n,i=e.getCursorPosition(),o=e.session.getLine(i.row),r=o.substring(0,i.column),s=o.substr(i.column),a=this.snippetMap;return this.getActiveScopes(e).some(function(e){var t=a[e];return t&&(n=this.findMatchingSnippet(t,r,s)),!!n},this),!!n&&(!(!t||!t.dryRun)||(e.session.doc.removeInLine(i.row,i.column-n.replaceBefore.length,i.column+n.replaceAfter.length),this.variables.M__=n.matchBefore,this.variables.T__=n.matchAfter,this.insertSnippetForSelection(e,n.content),this.variables.M__=this.variables.T__=null,!0))},this.findMatchingSnippet=function(e,t,n){for(var i=e.length;i--;){var o=e[i];if((!o.startRe||o.startRe.test(t))&&((!o.endRe||o.endRe.test(n))&&(o.startRe||o.endRe)))return o.matchBefore=o.startRe?o.startRe.exec(t):[""],o.matchAfter=o.endRe?o.endRe.exec(n):[""],o.replaceBefore=o.triggerRe?o.triggerRe.exec(t)[0]:"",o.replaceAfter=o.endTriggerRe?o.endTriggerRe.exec(n)[0]:"",o}},this.snippetMap={},this.snippetNameMap={},this.register=function(e,t){function n(e){return e&&!/^\^?\(.*\)\$?$|^\\b$/.test(e)&&(e="(?:"+e+")"),e||""}function i(e,t,i){return e=n(e),t=n(t),i?(e=t+e)&&"$"!=e[e.length-1]&&(e+="$"):(e+=t)&&"^"!=e[0]&&(e="^"+e),new RegExp(e)}function o(e){e.scope||(e.scope=t||"_"),t=e.scope,s[t]||(s[t]=[],a[t]={});var n=a[t];if(e.name){var o=n[e.name];o&&l.unregister(o),n[e.name]=e}s[t].push(e),e.tabTrigger&&!e.trigger&&(!e.guard&&/^\w/.test(e.tabTrigger)&&(e.guard="\\b"),e.trigger=r.escapeRegExp(e.tabTrigger)),(e.trigger||e.guard||e.endTrigger||e.endGuard)&&(e.startRe=i(e.trigger,e.guard,!0),e.triggerRe=new RegExp(e.trigger),e.endRe=i(e.endTrigger,e.endGuard,!0),e.endTriggerRe=new RegExp(e.endTrigger))}var s=this.snippetMap,a=this.snippetNameMap,l=this;e||(e=[]),e&&e.content?o(e):Array.isArray(e)&&e.forEach(o),this._signal("registerSnippets",{scope:t})},
20
20
  this.unregister=function(e,t){function n(e){var n=o[e.scope||t];if(n&&n[e.name]){delete n[e.name];var r=i[e.scope||t],s=r&&r.indexOf(e);s>=0&&r.splice(s,1)}}var i=this.snippetMap,o=this.snippetNameMap;e.content?n(e):Array.isArray(e)&&e.forEach(n)},this.parseSnippetFile=function(e){e=e.replace(/\r/g,"");for(var t,n=[],i={},o=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;t=o.exec(e);){if(t[1])try{i=JSON.parse(t[1]),n.push(i)}catch(e){}if(t[4])i.content=t[4].replace(/^\t/gm,""),n.push(i),i={};else{var r=t[2],s=t[3];if("regex"==r){var a=/\/((?:[^\/\\]|\\.)*)|$/g;i.guard=a.exec(s)[1],i.trigger=a.exec(s)[1],i.endTrigger=a.exec(s)[1],i.endGuard=a.exec(s)[1]}else"snippet"==r?(i.tabTrigger=s.match(/^\S*/)[0],i.name||(i.name=s)):i[r]=s}}return n},this.getSnippetByName=function(e,t){var n,i=this.snippetNameMap;return this.getActiveScopes(t).some(function(t){var o=i[t];return o&&(n=o[e]),!!n},this),n}}).call(d.prototype);var g=function(e){if(e.tabstopManager)return e.tabstopManager;e.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=r.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)};(function(){this.attach=function(e){this.index=0,this.ranges=[],this.tabstops=[],this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},this.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges=null,this.tabstops=null,this.selectedTabstop=null,this.editor.removeListener("change",this.$onChange),this.editor.removeListener("changeSelection",this.$onChangeSelection),this.editor.removeListener("changeSession",this.$onChangeSession),this.editor.commands.removeListener("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.editor=null},this.onChange=function(e){for(var t="r"==e.action[0],n=this.selectedTabstop&&this.selectedTabstop.parents||{},i=(this.tabstops||[]).slice(),o=0;o<i.length;o++){var r=i[o],s=r==this.selectedTabstop||n[r.index];if(r.rangeList.$bias=s?0:1,"remove"==e.action&&r!==this.selectedTabstop){var a=r.parents&&r.parents[this.selectedTabstop.index],l=r.rangeList.pointIndex(e.start,a);l=l<0?-l-1:l+1;var c=r.rangeList.pointIndex(e.end,a);c=c<0?-c-1:c-1;for(var h=r.rangeList.ranges.slice(l,c),u=0;u<h.length;u++)this.removeRange(h[u])}r.rangeList.$onChange(e)}var d=this.editor.session;!this.$inChange&&t&&1==d.getLength()&&!d.getValue()&&this.detach()},this.updateLinkedFields=function(){var e=this.selectedTabstop;if(e&&e.hasLinkedRanges&&e.firstNonLinked){this.$inChange=!0;for(var n=this.editor.session,i=n.getTextRange(e.firstNonLinked),o=0;o<e.length;o++){var r=e[o];if(r.linked){var s=r.original,a=t.snippetManager.tmStrFormat(i,s,this.editor);n.replace(r,a)}}this.$inChange=!1}},this.onAfterExec=function(e){e.command&&!e.command.readOnly&&this.updateLinkedFields()},this.onChangeSelection=function(){if(this.editor){for(var e=this.editor.selection.lead,t=this.editor.selection.anchor,n=this.editor.selection.isEmpty(),i=0;i<this.ranges.length;i++)if(!this.ranges[i].linked){var o=this.ranges[i].contains(e.row,e.column),r=n||this.ranges[i].contains(t.row,t.column);if(o&&r)return}this.detach()}},this.onChangeSession=function(){this.detach()},this.tabNext=function(e){var t=this.tabstops.length,n=this.index+(e||1);n=Math.min(Math.max(n,1),t),n==t&&(n=0),this.selectTabstop(n),0===n&&this.detach()},this.selectTabstop=function(e){this.$openTabstops=null;var t=this.tabstops[this.index];if(t&&this.addTabstopMarkers(t),this.index=e,t=this.tabstops[this.index],t&&t.length){this.selectedTabstop=t;var n=t.firstNonLinked||t;if(this.editor.inVirtualSelectionMode)this.editor.selection.setRange(n);else{var i=this.editor.multiSelect;i.toSingleRange(n.clone());for(var o=0;o<t.length;o++)t.hasLinkedRanges&&t[o].linked||i.addRange(t[o].clone(),!0);i.ranges[0]&&i.addRange(i.ranges[0].clone())}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},this.addTabstops=function(e,t,n){var i=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!e[0]){var o=s.fromPoints(n,n);f(o.start,t),f(o.end,t),e[0]=[o],e[0].index=0}var r=this.index,l=[r+1,0],c=this.ranges;e.forEach(function(e,n){var o=this.$openTabstops[n]||e;e.rangeList=new a,e.rangeList.$bias=0;for(var r=0;r<e.length;r++){var h=e[r],u=s.fromPoints(h.start,h.end||h.start);p(u.start,t),p(u.end,t),u.original=h,u.tabstop=o,c.push(u),e.rangeList.ranges.push(u),o!=e?o.unshift(u):o[r]=u,h.fmtString||o.firstNonLinked&&i?(u.linked=!0,o.hasLinkedRanges=!0):o.firstNonLinked||(o.firstNonLinked=u)}o.firstNonLinked||(o.hasLinkedRanges=!1),o===e&&(l.push(o),this.$openTabstops[n]=o),this.addTabstopMarkers(o)},this),l.length>2&&(this.tabstops.length&&l.push(l.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,l))},this.addTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))})},this.removeTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){t.removeMarker(e.markerId),e.markerId=null})},this.removeRange=function(e){var t=e.tabstop.indexOf(e);-1!=t&&e.tabstop.splice(t,1),t=this.ranges.indexOf(e),-1!=t&&this.ranges.splice(t,1),t=e.tabstop.rangeList.ranges.indexOf(e),-1!=t&&e.tabstop.splice(t,1),this.editor.session.removeMarker(e.markerId),e.tabstop.length||(t=this.tabstops.indexOf(e.tabstop),-1!=t&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},this.keyboardHandler=new l,this.keyboardHandler.bindKeys({Tab:function(e){t.snippetManager&&t.snippetManager.expandWithTab(e)||e.tabstopManager.tabNext(1)},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1)},Esc:function(e){e.tabstopManager.detach()},Return:function(){return!1}})}).call(g.prototype);var p=function(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row},f=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};e("./lib/dom").importCssString(".ace_snippet-marker { -moz-box-sizing: border-box; box-sizing: border-box; background: rgba(194, 193, 208, 0.09); border: 1px dotted rgba(211, 208, 235, 0.62); position: absolute;}"),t.snippetManager=new d;var m=e("./editor").Editor;(function(){this.insertSnippet=function(e,n){return t.snippetManager.insertSnippet(this,e,n)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}).call(m.prototype)}),ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom"],function(e,t){"use strict";var n=e("../virtual_renderer").VirtualRenderer,i=e("../editor").Editor,o=e("../range").Range,r=e("../lib/event"),s=e("../lib/lang"),a=e("../lib/dom"),l=function(e){var t=new n(e);t.$maxLines=4;var o=new i(t);return o.setHighlightActiveLine(!1),o.setShowPrintMargin(!1),o.renderer.setShowGutter(!1),o.renderer.setHighlightGutterLine(!1),o.$mouseHandler.$focusTimeout=0,o.$highlightTagPending=!0,o},c=function(e){var t=a.createElement("div"),n=new l(t);e&&e.appendChild(t),t.style.display="none",n.renderer.content.style.cursor="default",n.renderer.setStyle("ace_autocomplete"),n.setOption("displayIndentGuides",!1),n.setOption("dragDelay",150);var i=function(){};n.focus=i,n.$isFocused=!0,n.renderer.$cursorLayer.restartTimer=i,n.renderer.$cursorLayer.element.style.opacity=0,n.renderer.$maxLines=8,n.renderer.$keepTextAreaAtCursor=!1,n.setHighlightActiveLine(!1),n.session.highlight(""),n.session.$searchHighlight.clazz="ace_highlight-marker",n.on("mousedown",function(e){var t=e.getDocumentPosition();n.selection.moveToPosition(t),u.start.row=u.end.row=t.row,e.stop()});var c,h=new o(-1,0,-1,Infinity),u=new o(-1,0,-1,Infinity);u.id=n.session.addMarker(u,"ace_active-line","fullLine"),n.setSelectOnHover=function(e){e?h.id&&(n.session.removeMarker(h.id),h.id=null):h.id=n.session.addMarker(h,"ace_line-hover","fullLine")},n.setSelectOnHover(!1),n.on("mousemove",function(e){if(!c)return void(c=e);if(c.x!=e.x||c.y!=e.y){c=e,c.scrollTop=n.renderer.scrollTop;var t=c.getDocumentPosition().row;h.start.row!=t&&(h.id||n.setRow(t),g(t))}}),n.renderer.on("beforeRender",function(){if(c&&-1!=h.start.row){c.$pos=null;var e=c.getDocumentPosition().row;h.id||n.setRow(e),g(e,!0)}}),n.renderer.on("afterRender",function(){var e=n.getRow(),t=n.renderer.$textLayer,i=t.element.childNodes[e-t.config.firstRow];i!==t.selectedNode&&t.selectedNode&&a.removeCssClass(t.selectedNode,"ace_selected"),t.selectedNode=i,i&&a.addCssClass(i,"ace_selected")});var d=function(){g(-1)},g=function(e,t){e!==h.start.row&&(h.start.row=h.end.row=e,t||n.session._emit("changeBackMarker"),n._emit("changeHoverMarker"))};n.getHoveredRow=function(){return h.start.row},r.addListener(n.container,"mouseout",d),n.on("hide",d),n.on("changeSelection",d),n.session.doc.getLength=function(){return n.data.length},n.session.doc.getLine=function(e){var t=n.data[e];return"string"==typeof t?t:t&&t.value||""};var p=n.session.bgTokenizer;return p.$tokenizeRow=function(e){function t(e,t){e&&o.push({type:(i.className||"")+(t||""),value:e})}var i=n.data[e],o=[];if(!i)return o;"string"==typeof i&&(i={value:i});for(var r=i.caption||i.value||i.name,s=r.toLowerCase(),a=(n.filterText||"").toLowerCase(),l=0,c=0,h=0;h<=a.length;h++)if(h!=c&&(i.matchMask&1<<h||h==a.length)){var u=a.slice(c,h);c=h;var d=s.indexOf(u,l);if(-1==d)continue;t(r.slice(l,d),""),l=d+u.length,t(r.slice(d,l),"completion-highlight")}return t(r.slice(l,r.length),""),i.meta&&o.push({type:"completion-meta",value:i.meta}),i.message&&o.push({type:"completion-message",value:i.message}),o},p.$updateOnChange=i,p.start=i,n.session.$computeWidth=function(){return this.screenWidth=0},n.isOpen=!1,n.isTopdown=!1,n.autoSelect=!0,n.filterText="",n.data=[],n.setData=function(e,t){n.filterText=t||"",n.setValue(s.stringRepeat("\n",e.length),-1),n.data=e||[],n.setRow(0)},n.getData=function(e){return n.data[e]},n.getRow=function(){return u.start.row},n.setRow=function(e){e=Math.max(this.autoSelect?0:-1,Math.min(this.data.length,e)),u.start.row!=e&&(n.selection.clearSelection(),u.start.row=u.end.row=e||0,n.session._emit("changeBackMarker"),n.moveCursorTo(e||0,0),n.isOpen&&n._signal("select"))},n.on("changeSelection",function(){n.isOpen&&n.setRow(n.selection.lead.row),n.renderer.scrollCursorIntoView()}),n.hide=function(){this.container.style.display="none",this._signal("hide"),n.isOpen=!1},n.show=function(e,t,i){var o=this.container,r=window.innerHeight,s=window.innerWidth,a=this.renderer,l=a.$maxLines*t*1.4,h=e.top+this.$borderSize;h>r/2&&!i&&h+t+l>r?(a.$maxPixelHeight=h-2*this.$borderSize,o.style.top="",o.style.bottom=r-h+"px",n.isTopdown=!1):(h+=t,a.$maxPixelHeight=r-h-.2*t,o.style.top=h+"px",o.style.bottom="",n.isTopdown=!0),o.style.display="";var u=e.left;u+o.offsetWidth>s&&(u=s-o.offsetWidth),o.style.left=u+"px",this._signal("show"),c=null,n.isOpen=!0},n.goTo=function(e){var t=this.getRow(),n=this.session.getLength()-1;switch(e){case"up":t=t<=0?n:t-1;break;case"down":t=t>=n?-1:t+1;break;case"start":t=0;break;case"end":t=n}this.setRow(t)},n.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},n.$imageSize=0,n.$borderSize=1,n};a.importCssString(".ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { background-color: #CAD6FA; z-index: 1;}.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { background-color: #3a674e;}.ace_editor.ace_autocomplete .ace_line-hover { border: 1px solid #abbffe; margin-top: -1px; background: rgba(233,233,253,0.4); position: absolute; z-index: 2;}.ace_dark.ace_editor.ace_autocomplete .ace_line-hover { border: 1px solid rgba(109, 150, 13, 0.8); background: rgba(58, 103, 78, 0.62);}.ace_completion-meta { opacity: 0.5; margin: 0.9em;}.ace_completion-message { color: blue;}.ace_editor.ace_autocomplete .ace_completion-highlight{ color: #2d69c7;}.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{ color: #93ca12;}.ace_editor.ace_autocomplete { width: 300px; z-index: 200000; border: 1px lightgray solid; position: fixed; box-shadow: 2px 3px 5px rgba(0,0,0,.2); line-height: 1.4; background: #fefefe; color: #111;}.ace_dark.ace_editor.ace_autocomplete { border: 1px #484747 solid; box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51); line-height: 1.4; background: #25282c; color: #c1c1c1;}","autocompletion.css"),t.AcePopup=c,t.$singleLineEditor=l}),ace.define("ace/autocomplete/util",["require","exports","module"],function(e,t){"use strict";t.parForEach=function(e,t,n){var i=0,o=e.length;0===o&&n();for(var r=0;r<o;r++)t(e[r],function(e,t){++i===o&&n(e,t)})};var n=/[a-zA-Z_0-9\$\-\u00A2-\uFFFF]/;t.retrievePrecedingIdentifier=function(e,t,i){i=i||n;for(var o=[],r=t-1;r>=0&&i.test(e[r]);r--)o.push(e[r]);return o.reverse().join("")},t.retrieveFollowingIdentifier=function(e,t,i){i=i||n;for(var o=[],r=t;r<e.length&&i.test(e[r]);r++)o.push(e[r]);return o},t.getCompletionPrefix=function(e){var t,n=e.getCursorPosition(),i=e.session.getLine(n.row);return e.completers.forEach(function(e){e.identifierRegexps&&e.identifierRegexps.forEach(function(e){!t&&e&&(t=this.retrievePrecedingIdentifier(i,n.column,e))}.bind(this))}.bind(this)),t||this.retrievePrecedingIdentifier(i,n.column)}}),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config"],function(e,t){"use strict";var n=e("./keyboard/hash_handler").HashHandler,i=e("./autocomplete/popup").AcePopup,o=e("./autocomplete/util"),r=e("./lib/lang"),s=e("./lib/dom"),a=e("./snippets").snippetManager,l=e("./config"),c=function(){this.autoInsert=!1,this.autoSelect=!0,this.exactMatch=!1,this.gatherCompletionsId=0,this.keyboardHandler=new n,this.keyboardHandler.bindKeys(this.commands),this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.changeTimer=r.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=r.delayedCall(this.updateDocTooltip.bind(this),50)};(function(){this.$init=function(){return this.popup=new i(document.body||document.documentElement),this.popup.on("click",function(e){this.insertMatch(),e.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.tooltipTimer.bind(null,null)),this.popup.on("select",this.tooltipTimer.bind(null,null)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup},this.getPopup=function(){return this.popup||this.$init()},this.openPopup=function(e,t,n){this.popup||this.$init(),this.popup.autoSelect=this.autoSelect,this.popup.setData(this.completions.filtered,this.completions.filterText),e.keyBinding.addKeyboardHandler(this.keyboardHandler);var i=e.renderer;if(this.popup.setRow(this.autoSelect?0:-1),n)n&&!t&&this.detach();else{this.popup.setTheme(e.getTheme()),this.popup.setFontSize(e.getFontSize());var o=i.layerConfig.lineHeight,r=i.$cursorLayer.getPixelPosition(this.base,!0);r.left-=this.popup.getTextLeftOffset();var s=e.container.getBoundingClientRect();r.top+=s.top-i.layerConfig.offset,r.left+=s.left-e.renderer.scrollLeft,r.left+=i.gutterWidth,this.popup.show(r,o)}},this.detach=function(){this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener),this.changeTimer.cancel(),this.hideDocTooltip(),this.gatherCompletionsId+=1,this.popup&&this.popup.isOpen&&this.popup.hide(),this.base&&this.base.detach(),this.activated=!1,this.completions=this.base=null},this.changeListener=function(){var e=this.editor.selection.lead;(e.row!=this.base.row||e.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},this.blurListener=function(e){var t=document.activeElement,n=this.editor.textInput.getElement(),i=e.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(e.relatedTarget),o=this.popup&&this.popup.container;t!=n&&t.parentNode!=o&&!i&&t!=this.tooltipNode&&e.relatedTarget!=n&&this.detach()},this.mousedownListener=function(){this.detach()},this.mousewheelListener=function(){this.detach()},this.goTo=function(e){this.popup.goTo(e)},this.insertMatch=function(e){if(e||(e=this.popup.getData(this.popup.getRow())),!e)return!1;if(e.completer&&e.completer.insertMatch)e.completer.insertMatch(this.editor,e);else{if(this.completions.filterText)for(var t,n=this.editor.selection.getAllRanges(),i=0;t=n[i];i++)t.start.column-=this.completions.filterText.length,this.editor.session.remove(t);e.snippet?a.insertSnippet(this.editor,e.snippet):this.editor.execCommand("insertstring",e.value||e)}this.detach()},this.commands={Up:function(e){e.completer.goTo("up")},Down:function(e){e.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(e){e.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(e){e.completer.goTo("end")},Esc:function(e){e.completer.detach()},Return:function(e){return e.completer.insertMatch()},"Shift-Return":function(e){e.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(e){var t=e.completer.insertMatch();if(t||e.tabstopManager)return t;e.completer.goTo("down")},PageUp:function(e){e.completer.popup.gotoPageUp()},PageDown:function(e){e.completer.popup.gotoPageDown()}},this.gatherCompletions=function(e,t){var n=e.getSession(),i=e.getCursorPosition(),r=o.getCompletionPrefix(e);this.base=n.doc.createAnchor(i.row,i.column-r.length),this.base.$insertRight=!0;var s=[],a=e.completers.length;return e.completers.forEach(function(l){l.getCompletions(e,n,i,r,function(n,i){!n&&i&&(s=s.concat(i)),t(null,{prefix:o.getCompletionPrefix(e),matches:s,finished:0==--a})})}),!0},this.showPopup=function(e,t){this.editor&&this.detach(),this.activated=!0,this.editor=e,e.completer!=this&&(e.completer&&e.completer.detach(),e.completer=this),e.on("changeSelection",this.changeListener),e.on("blur",this.blurListener),e.on("mousedown",this.mousedownListener),e.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,t)},this.updateCompletions=function(e,t){if(e&&this.base&&this.completions){var n=this.editor.getCursorPosition(),i=this.editor.session.getTextRange({start:this.base,end:n});if(i==this.completions.filterText)return;return this.completions.setFilter(i),this.completions.filtered.length?1!=this.completions.filtered.length||this.completions.filtered[0].value!=i||this.completions.filtered[0].snippet?void this.openPopup(this.editor,i,e):this.detach():this.detach()}if(t&&t.matches){var n=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(n.row,n.column),this.base.$insertRight=!0,this.completions=new h(t.matches),this.openPopup(this.editor,"",e)}var o=this.gatherCompletionsId;this.gatherCompletions(this.editor,function(t,n){var i=function(){if(n.finished)return this.detach()}.bind(this),r=n.prefix,s=n&&n.matches;if(!s||!s.length)return i();if(0===r.indexOf(n.prefix)&&o==this.gatherCompletionsId){this.completions=new h(s),this.exactMatch&&(this.completions.exactMatch=!0),this.completions.setFilter(r);var a=this.completions.filtered;return a.length&&(1!=a.length||a[0].value!=r||a[0].snippet)?this.autoInsert&&1==a.length&&n.finished?this.insertMatch(a[0]):void this.openPopup(this.editor,r,e):i()}}.bind(this))},this.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},this.updateDocTooltip=function(){var e=this.popup,t=e.data,n=t&&(t[e.getHoveredRow()]||t[e.getRow()]),i=null;return n&&this.editor&&this.popup.isOpen?(this.editor.completers.some(function(e){return e.getDocTooltip&&(i=e.getDocTooltip(n)),i}),!i&&"string"!=typeof n&&(i=n),"string"==typeof i&&(i={docText:i}),i&&(i.docHTML||i.docText)?void this.showDocTooltip(i):this.hideDocTooltip()):this.hideDocTooltip()},this.showDocTooltip=function(e){this.tooltipNode||(this.tooltipNode=s.createElement("div"),this.tooltipNode.className="ace_tooltip ace_doc-tooltip",this.tooltipNode.style.margin=0,this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this));var t=this.tooltipNode;e.docHTML?t.innerHTML=e.docHTML:e.docText&&(t.textContent=e.docText),t.parentNode||document.body.appendChild(t);var n=this.popup,i=n.container.getBoundingClientRect();t.style.top=n.container.style.top,t.style.bottom=n.container.style.bottom,t.style.display="block",window.innerWidth-i.right<320?i.left<320?n.isTopdown?(t.style.top=i.bottom+"px",t.style.left=i.left+"px",t.style.right="",t.style.bottom=""):(t.style.top=n.container.offsetTop-t.offsetHeight+"px",t.style.left=i.left+"px",t.style.right="",t.style.bottom=""):(t.style.right=window.innerWidth-i.left+"px",t.style.left=""):(t.style.left=i.right+1+"px",t.style.right="")},this.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),this.tooltipNode){var e=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==e&&this.editor.focus(),this.tooltipNode=null,e.parentNode&&e.parentNode.removeChild(e)}},this.onTooltipClick=function(e){for(var t=e.target;t&&t!=this.tooltipNode;){if("A"==t.nodeName&&t.href){t.rel="noreferrer",t.target="_blank";break}t=t.parentNode}},this.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var e=this.popup.container;e&&e.parentNode&&e.parentNode.removeChild(e)}this.editor&&this.editor.completer==this&&this.editor.completer,this.popup=null}}).call(c.prototype),c["for"]=function(e){return e.completer?e.completer:(l.get("sharedPopups")?(c.$shared||(c.$sharedInstance=new c),e.completer=c.$sharedInstance):(e.completer=new c,e.once("destroy",function(e,t){t.completer.destroy()})),e.completer)},c.startCommand={name:"startAutocomplete",exec:function(e,t){var n=c["for"](e);n.autoInsert=!1,n.autoSelect=!0,n.showPopup(e,t),n.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var h=function(e,t){this.all=e,this.filtered=e,this.filterText=t||"",this.exactMatch=!1};(function(){this.setFilter=function(e){if(e.length>this.filterText&&0===e.lastIndexOf(this.filterText,0))var t=this.filtered;else var t=this.all;this.filterText=e,t=this.filterCompletions(t,this.filterText),t=t.sort(function(e,t){return t.exactMatch-e.exactMatch||t.$score-e.$score||(e.caption||e.value).localeCompare(t.caption||t.value)});var n=null;t=t.filter(function(e){var t=e.snippet||e.caption||e.value;return t!==n&&(n=t,!0)}),this.filtered=t},this.filterCompletions=function(e,t){var n=[],i=t.toUpperCase(),o=t.toLowerCase();e:for(var r,s=0;r=e[s];s++){var a=r.caption||r.value||r.snippet;if(a){var l,c,h=-1,u=0,d=0;if(this.exactMatch){if(t!==a.substr(0,t.length))continue e}else{var g=a.toLowerCase().indexOf(o);if(g>-1)d=g;else for(var p=0;p<t.length;p++){var f=a.indexOf(o[p],h+1),m=a.indexOf(i[p],h+1);if((l=f>=0&&(m<0||f<m)?f:m)<0)continue e;c=l-h-1,c>0&&(-1===h&&(d+=10),d+=c,u|=1<<p),h=l}}r.matchMask=u,r.exactMatch=d?0:1,r.$score=(r.score||0)-d,n.push(r)}}return n}}).call(h.prototype),t.Autocomplete=c,t.FilteredList=h}),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(e,t){function n(e,t){return e.getTextRange(o.fromPoints({row:0,column:0},t)).split(r).length-1}function i(e,t){var i=n(e,t),o=e.getValue().split(r),s=Object.create(null),a=o[i];return o.forEach(function(e,t){if(e&&e!==a){var n=Math.abs(i-t),r=o.length-n;s[e]?s[e]=Math.max(r,s[e]):s[e]=r}}),s}var o=e("../range").Range,r=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;t.getCompletions=function(e,t,n,o,r){var s=i(t,n);r(null,Object.keys(s).map(function(e){return{caption:e,value:e,score:s[e],meta:"local"}}))}}),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(e,t){"use strict";var n=e("../snippets").snippetManager,i=e("../autocomplete").Autocomplete,o=e("../config"),r=e("../lib/lang"),s=e("../autocomplete/util"),a=e("../autocomplete/text_completer"),l={getCompletions:function(e,t,n,i,o){if(t.$mode.completer)return t.$mode.completer.getCompletions(e,t,n,i,o);var r=e.session.getState(n.row);o(null,t.$mode.getCompletions(r,t,n,i))}},c={getCompletions:function(e,t,i,o,r){var s=[],a=t.getTokenAt(i.row,i.column);a&&a.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?s.push("html-tag"):s=n.getActiveScopes(e);var l=n.snippetMap,c=[];s.forEach(function(e){for(var t=l[e]||[],n=t.length;n--;){var i=t[n],o=i.name||i.tabTrigger;o&&c.push({caption:o,snippet:i.content,meta:i.tabTrigger&&!i.name?i.tabTrigger+"\u21e5 ":"snippet",type:"snippet"})}},this),r(null,c)},getDocTooltip:function(e){"snippet"==e.type&&!e.docHTML&&(e.docHTML=["<b>",r.escapeHTML(e.caption),"</b>","<hr></hr>",r.escapeHTML(e.snippet)].join(""))}},h=[c,a,l];t.setCompleters=function(e){h.length=0,e&&h.push.apply(h,e)},t.addCompleter=function(e){h.push(e)},t.textCompleter=a,t.keyWordCompleter=l,t.snippetCompleter=c;var u={name:"expandSnippet",exec:function(e){return n.expandWithTab(e)},bindKey:"Tab"},d=function(e,t){g(t.session.$mode)},g=function(e){var t=e.$id;n.files||(n.files={}),p(t),e.modes&&e.modes.forEach(g)},p=function(e){if(e&&!n.files[e]){var t=e.replace("mode","snippets");n.files[e]={},o.loadModule(t,function(t){t&&(n.files[e]=t,!t.snippets&&t.snippetText&&(t.snippets=n.parseSnippetFile(t.snippetText)),n.register(t.snippets||[],t.scope),t.includeScopes&&(n.snippetMap[t.scope].includeScopes=t.includeScopes,t.includeScopes.forEach(function(e){p("ace/mode/"+e)})))})}},f=function(e){var t=e.editor,n=t.completer&&t.completer.activated;if("backspace"===e.command.name)n&&!s.getCompletionPrefix(t)&&t.completer.detach();else if("insertstring"===e.command.name){var o=s.getCompletionPrefix(t);if(o&&!n){var r=i["for"](t);r.autoInsert=!1,r.showPopup(t)}}},m=e("../editor").Editor;e("../config").defineOptions(m.prototype,"editor",{enableBasicAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:h),this.commands.addCommand(i.startCommand)):this.commands.removeCommand(i.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:h),this.commands.on("afterExec",f)):this.commands.removeListener("afterExec",f)},value:!1},enableSnippets:{set:function(e){e?(this.commands.addCommand(u),this.on("changeMode",d),d(null,this)):(this.commands.removeCommand(u),this.off("changeMode",d))},value:!1}})}),function(){ace.require(["ace/ext/language_tools"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"],function(e,t){function n(e){var n=e.editor;if(e.getAccelKey()){var n=e.editor,i=e.getDocumentPosition(),o=n.session,r=o.getTokenAt(i.row,i.column);t.previousLinkingHover&&t.previousLinkingHover!=r&&n._emit("linkHoverOut"),n._emit("linkHover",{position:i,token:r}),t.previousLinkingHover=r}else t.previousLinkingHover&&(n._emit("linkHoverOut"),t.previousLinkingHover=!1)}function i(e){var t=e.getAccelKey();if(0==e.getButton()&&t){var n=e.editor,i=e.getDocumentPosition(),o=n.session,r=o.getTokenAt(i.row,i.column);n._emit("linkClick",{position:i,token:r})}}var o=e("../editor").Editor;e("../config").defineOptions(o.prototype,"editor",{enableLinking:{set:function(e){e?(this.on("click",i),this.on("mousemove",n)):(this.off("click",i),this.off("mousemove",n))},value:!1}}),t.previousLinkingHover=!1}),function(){ace.require(["ace/ext/linking"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/ext/rtl",["require","exports","module","ace/editor","ace/config"],function(e){"use strict";function t(e,t){var n=t.getSelection().lead;t.session.$bidiHandler.isRtlLine(n.row)&&0===n.column&&(t.session.$bidiHandler.isMoveLeftOperation&&n.row>0?t.getSelection().moveCursorTo(n.row-1,t.session.getLine(n.row-1).length):t.getSelection().isEmpty()?n.column+=1:n.setPosition(n.row,n.column+1))}function n(e){e.editor.session.$bidiHandler.isMoveLeftOperation=/gotoleft|selectleft|backspace|removewordleft/.test(e.command.name)}function i(e,t){var n=t.session;if(n.$bidiHandler.currentRow=null,n.$bidiHandler.isRtlLine(e.start.row)&&"insert"===e.action&&e.lines.length>1)for(var i=e.start.row;i<e.end.row;i++)n.getLine(i+1).charAt(0)!==n.$bidiHandler.RLE&&(n.doc.$lines[i+1]=n.$bidiHandler.RLE+n.getLine(i+1))}function o(e,t){var n=t.session,i=n.$bidiHandler,o=t.$textLayer.$lines.cells,r=t.layerConfig.width-t.layerConfig.padding+"px";o.forEach(function(e){var t=e.element.style;i&&i.isRtlLine(e.row)?(t.direction="rtl",t.textAlign="right",t.width=r):(t.direction="",t.textAlign="",t.width="")})}function r(e){function t(e){var t=e.element.style;t.direction=t.textAlign=t.width=""}var n=e.$textLayer.$lines;n.cells.forEach(t),n.cellCache.forEach(t)}var s=[{name:"leftToRight",bindKey:{win:"Ctrl-Alt-Shift-L",mac:"Command-Alt-Shift-L"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!1)},readOnly:!0},{name:"rightToLeft",bindKey:{win:"Ctrl-Alt-Shift-R",mac:"Command-Alt-Shift-R"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!0)},readOnly:!0}],a=e("../editor").Editor;e("../config").defineOptions(a.prototype,"editor",{rtlText:{set:function(e){e?(this.on("change",i),this.on("changeSelection",t),this.renderer.on("afterRender",o),this.commands.on("exec",n),this.commands.addCommands(s)):(this.off("change",i),this.off("changeSelection",t),this.renderer.off("afterRender",o),this.commands.off("exec",n),this.commands.removeCommands(s),r(this.renderer)),this.renderer.updateFull()}},rtl:{set:function(e){this.session.$bidiHandler.$isRtl=e,e?(this.setOption("rtlText",!1),this.renderer.on("afterRender",o),this.session.$bidiHandler.seenBidi=!0):(this.renderer.off("afterRender",o),r(this.renderer)),this.renderer.updateFull()}}})}),function(){ace.require(["ace/ext/rtl"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t){"use strict"
21
21
  ;var n=e("../lib/dom"),i=e("../lib/lang"),o=e("../lib/event"),r='.ace_search {background-color: #ddd;color: #666;border: 1px solid #cbcbcb;border-top: 0 none;overflow: hidden;margin: 0;padding: 4px 6px 0 4px;position: absolute;top: 0;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {margin: 0 20px 4px 0;overflow: hidden;line-height: 1.9;}.ace_replace_form {margin-right: 0;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {border-radius: 3px 0 0 3px;background-color: white;color: black;border: 1px solid #cbcbcb;border-right: 0 none;outline: 0;padding: 0;font-size: inherit;margin: 0;line-height: inherit;padding: 0 6px;min-width: 17em;vertical-align: top;min-height: 1.8em;box-sizing: content-box;}.ace_searchbtn {border: 1px solid #cbcbcb;line-height: inherit;display: inline-block;padding: 0 6px;background: #fff;border-right: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;margin: 0;position: relative;color: #666;}.ace_searchbtn:last-child {border-radius: 0 3px 3px 0;border-right: 1px solid #cbcbcb;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn:hover {background-color: #eef1f6;}.ace_searchbtn.prev, .ace_searchbtn.next {padding: 0px 0.7em}.ace_searchbtn.prev:after, .ace_searchbtn.next:after {content: "";border: solid 2px #888;width: 0.5em;height: 0.5em;border-width: 2px 0 0 2px;display:inline-block;transform: rotate(-45deg);}.ace_searchbtn.next:after {border-width: 0 2px 2px 0 ;}.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;font: 16px/16px Arial;padding: 0;height: 14px;width: 14px;top: 9px;right: 7px;position: absolute;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;box-sizing: border-box!important;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;clear: both;}.ace_search_counter {float: left;font-family: arial;padding: 0 8px;}',s=e("../keyboard/hash_handler").HashHandler,a=e("../lib/keys"),l=999;n.importCssString(r,"ace_searchbox");var c=function(e){var t=n.createElement("div");n.buildDom(["div",{"class":"ace_search right"},["span",{action:"hide","class":"ace_searchbtn_close"}],["div",{"class":"ace_search_form"},["input",{"class":"ace_search_field",placeholder:"Search for",spellcheck:"false"}],["span",{action:"findPrev","class":"ace_searchbtn prev"},"\u200b"],["span",{action:"findNext","class":"ace_searchbtn next"},"\u200b"],["span",{action:"findAll","class":"ace_searchbtn",title:"Alt-Enter"},"All"]],["div",{"class":"ace_replace_form"},["input",{"class":"ace_search_field",placeholder:"Replace with",spellcheck:"false"}],["span",{action:"replaceAndFindNext","class":"ace_searchbtn"},"Replace"],["span",{action:"replaceAll","class":"ace_searchbtn"},"All"]],["div",{"class":"ace_search_options"},["span",{action:"toggleReplace","class":"ace_button",title:"Toggle Replace mode",style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{"class":"ace_search_counter"}],["span",{action:"toggleRegexpMode","class":"ace_button",title:"RegExp Search"},".*"],["span",{action:"toggleCaseSensitive","class":"ace_button",title:"CaseSensitive Search"},"Aa"],["span",{action:"toggleWholeWords","class":"ace_button",title:"Whole Word Search"},"\\b"],["span",{action:"searchInSelection","class":"ace_button",title:"Search In Selection"},"S"]]],t),this.element=t.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(e),n.importCssString(r,"ace_searchbox",e.container)};(function(){this.setEditor=function(e){e.searchBox=this,e.renderer.scroller.appendChild(this.element),this.editor=e},this.setSession=function(){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(e){this.searchBox=e.querySelector(".ace_search_form"),this.replaceBox=e.querySelector(".ace_replace_form"),this.searchOption=e.querySelector("[action=searchInSelection]"),this.replaceOption=e.querySelector("[action=toggleReplace]"),this.regExpOption=e.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=e.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=e.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=e.querySelector(".ace_search_counter")},this.$init=function(){var e=this.element;this.$initElements(e);var t=this;o.addListener(e,"mousedown",function(e){setTimeout(function(){t.activeInput.focus()},0),o.stopPropagation(e)}),o.addListener(e,"click",function(e){var n=e.target||e.srcElement,i=n.getAttribute("action");i&&t[i]?t[i]():t.$searchBarKb.commands[i]&&t.$searchBarKb.commands[i].exec(t),o.stopPropagation(e)}),o.addCommandKeyListener(e,function(e,n,i){var r=a.keyCodeToString(i),s=t.$searchBarKb.findKeyCommand(n,r);s&&s.exec&&(s.exec(t),o.stopEvent(e))}),this.$onChange=i.delayedCall(function(){t.find(!1,!1)}),o.addListener(this.searchInput,"input",function(){t.$onChange.schedule(20)}),o.addListener(this.searchInput,"focus",function(){t.activeInput=t.searchInput,t.searchInput.value&&t.highlight()}),o.addListener(this.replaceInput,"focus",function(){t.activeInput=t.replaceInput,t.searchInput.value&&t.highlight()})},this.$closeSearchBarKb=new s([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]),this.$searchBarKb=new s,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())},"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]),this.setSearchRange=function(e){this.searchRange=e,e?this.searchRangeMarker=this.editor.session.addMarker(e,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(e){n.setCssClass(this.replaceOption,"checked",this.searchRange),n.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",n.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),n.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),n.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var t=this.editor.getReadOnly();this.replaceOption.style.display=t?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!t?"":"none",this.find(!1,!1,e)},this.highlight=function(e){this.editor.session.highlight(e||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(e,t,i){var o=this.editor.find(this.searchInput.value,{skipCurrent:e,backwards:t,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:i,range:this.searchRange}),r=!o&&this.searchInput.value;n.setCssClass(this.searchBox,"ace_nomatch",r),this.editor._emit("findSearchBox",{match:!r}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var e=this.editor,t=e.$search.$options.re,n=0,i=0;if(t){var o=this.searchRange?e.session.getTextRange(this.searchRange):e.getValue(),r=e.session.doc.positionToIndex(e.selection.anchor);this.searchRange&&(r-=e.session.doc.positionToIndex(this.searchRange.start));for(var s,a=t.lastIndex=0;(s=t.exec(o))&&(n++,(a=s.index)<=r&&i++,!(n>l))&&(s[0]||(t.lastIndex=a+=1,!(a>=o.length))););}this.searchCounter.textContent=i+" of "+(n>l?l+"+":n)},this.findNext=function(){this.find(!0,!1)},this.findPrev=function(){this.find(!0,!0)},this.findAll=function(){var e=this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked}),t=!e&&this.searchInput.value;n.setCssClass(this.searchBox,"ace_nomatch",t),this.editor._emit("findSearchBox",{match:!t}),this.highlight(),this.hide()},this.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},this.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},this.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},this.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},this.show=function(e,t){this.active=!0,this.editor.on("changeSession",this.setSession),this.element.style.display="",this.replaceOption.checked=t,e&&(this.searchInput.value=e),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},this.isFocused=function(){var e=document.activeElement;return e==this.searchInput||e==this.replaceInput}}).call(c.prototype),t.SearchBox=c,t.Search=function(e,t){(e.searchBox||new c(e)).show(e.session.getTextRange(),t)}}),function(){ace.require(["ace/ext/searchbox"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";e("../../lib/dom").importCssString("#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 100000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {vertical-align: middle;}.ace_optionsMenuEntry button[ace_selected_button=true] {background: #e7e7e7;box-shadow: 1px 0px 2px 0px #adadad inset;border-color: #adadad;}.ace_optionsMenuEntry button {background: white;border: 1px solid lightgray;margin: 0px;}.ace_optionsMenuEntry button:hover{background: #f0f0f0;}"),n.exports.overlayPage=function(e,t,n){function i(e){27===e.keyCode&&o()}function o(){r&&(document.removeEventListener("keydown",i),r.parentNode.removeChild(r),e.focus(),r=null,n&&n())}var r=document.createElement("div");return r.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; background-color: rgba(0, 0, 0, 0.3);",r.addEventListener("click",function(){o()}),document.addEventListener("keydown",i),t.addEventListener("click",function(e){e.stopPropagation()}),r.appendChild(t),document.body.appendChild(r),e.blur(),{close:o}}}),ace.define("ace/ext/modelist",["require","exports","module"],function(e,t,n){"use strict";function i(e){for(var t=l.text,n=e.split(/[\/\\]/).pop(),i=0;i<o.length;i++)if(o[i].supportsFile(n)){t=o[i];break}return t}var o=[],r=function(e,t,n){this.name=e,this.caption=t,this.mode="ace/mode/"+e,this.extensions=n;var i;i=/\^/.test(n)?n.replace(/\|(\^)?/g,function(e,t){return"$|"+(t?"^":"^.*\\.")})+"$":"^.*\\.("+n+")$",this.extRe=new RegExp(i,"gi")};r.prototype.supportsFile=function(e){return e.match(this.extRe)};var s={ABAP:["abap"],ABC:["abc"],ActionScript:["as"],ADA:["ada|adb"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],AsciiDoc:["asciidoc|adoc"],ASL:["dsl|asl"],Assembly_x86:["asm|a"],AutoHotKey:["ahk"],Apex:["apex|cls|trigger|tgr"],AQL:["aql"],BatchFile:["bat|cmd"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp|ino"],C9Search:["c9search_results"],Crystal:["cr"],Cirru:["cirru|cr"],Clojure:["clj|cljs"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm"],CSharp:["cs"],Csound_Document:["csd"],Csound_Orchestra:["orc"],Csound_Score:["sco"],CSS:["css"],Curly:["curly"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Dockerfile:["^Dockerfile"],Dot:["dot"],Drools:["drl"],Edifact:["edi"],Eiffel:["e|ge"],EJS:["ejs"],Elixir:["ex|exs"],Elm:["elm"],Erlang:["erl|hrl"],Forth:["frt|fs|ldr|fth|4th"],Fortran:["f|f90"],FSharp:["fsi|fs|ml|mli|fsx|fsscript"],FSL:["fsl"],FTL:["ftl"],Gcode:["gcode"],Gherkin:["feature"],Gitignore:["^.gitignore"],Glsl:["glsl|frag|vert"],Gobstones:["gbs"],golang:["go"],GraphQLSchema:["gql"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],Haskell_Cabal:["cabal"],haXe:["hx"],Hjson:["hjson"],HTML:["html|htm|xhtml|vue|we|wpy"],HTML_Elixir:["eex|html.eex"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Io:["io"],Jack:["jack"],Jade:["jade|pug"],Java:["java"],JavaScript:["js|jsm|jsx"],JSON:["json"],JSONiq:["jq"],JSP:["jsp"],JSSM:["jssm|jssm_state"],JSX:["jsx"],Julia:["jl"],Kotlin:["kt|kts"],LaTeX:["tex|latex|ltx|bib"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],LogiQL:["logic|lql"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],Mask:["mask"],MATLAB:["matlab"],Maze:["mz"],MEL:["mel"],MIXAL:["mixal"],MUSHCode:["mc|mush"],MySQL:["mysql"],Nginx:["nginx|conf"],Nix:["nix"],Nim:["nim"],NSIS:["nsi|nsh"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Pascal:["pas|p"],Perl:["pl|pm"],Perl6:["p6|pl6|pm6"],pgSQL:["pgsql"],PHP_Laravel_blade:["blade.php"],PHP:["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],Puppet:["epp|pp"],Pig:["pig"],Powershell:["ps1"],Praat:["praat|praatscript|psc|proc"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],Python:["py"],R:["r"],Razor:["cshtml|asp"],RDoc:["Rd"],Red:["red|reds"],RHTML:["Rhtml"],RST:["rst"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SASS:["sass"],SCAD:["scad"],Scala:["scala|sbt"],Scheme:["scm|sm|rkt|oak|scheme"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Slim:["slim|skim"],Smarty:["smarty|tpl"],snippets:["snippets"],Soy_Template:["soy"],Space:["space"],SQL:["sql"],SQLServer:["sqlserver"],Stylus:["styl|stylus"],SVG:["svg"],Swift:["swift"],Tcl:["tcl"],Terraform:["tf","tfvars","terragrunt"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],TSX:["tsx"],Twig:["latte|twig|swig"],Typescript:["ts|typescript|str"],Vala:["vala"],VBScript:["vbs|vb"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],VHDL:["vhd|vhdl"],Visualforce:["vfp|component|page"],Wollok:["wlk|wpgm|wtest"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],XQuery:["xq"],YAML:["yaml|yml"],Zeek:["zeek|bro"],Django:["html"]},a={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C and C++",Csound_Document:"Csound Document",Csound_Orchestra:"Csound",Csound_Score:"Csound Score",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",HTML_Elixir:"HTML (Elixir)",FTL:"FreeMarker",PHP_Laravel_blade:"PHP (Blade Template)",Perl6:"Perl 6",AutoHotKey:"AutoHotkey / AutoIt"},l={};for(var c in s){var h=s[c],u=(a[c]||c).replace(/_/g," "),d=c.toLowerCase(),g=new r(d,u,h[0]);l[d]=g,o.push(g)}n.exports={getModeForPath:i,modes:o,modesByName:l}}),ace.define("ace/ext/themelist",["require","exports","module"],function(e,t){"use strict";var n=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub"],["IPlastic"],["Solarized Light"],["TextMate"],["Tomorrow"],["XCode"],["Kuroir"],["KatzenMilch"],["SQL Server","sqlserver","light"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Dracula","","dark"],["Cobalt","cobalt","dark"],["Gruvbox","gruvbox","dark"],["Green on Black","gob","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"]];t.themesByName={},t.themes=n.map(function(e){var n=e[1]||e[0].replace(/ /g,"_").toLowerCase(),i={caption:e[0],theme:"ace/theme/"+n,isDark:"dark"==e[2],name:n};return t.themesByName[n]=i,i})}),ace.define("ace/ext/options",["require","exports","module","ace/ext/menu_tools/overlay_page","ace/lib/dom","ace/lib/oop","ace/config","ace/lib/event_emitter","ace/ext/modelist","ace/ext/themelist"],function(e,t){"use strict";var n=(e("./menu_tools/overlay_page").overlayPage,e("../lib/dom")),i=e("../lib/oop"),o=e("../config"),r=e("../lib/event_emitter").EventEmitter,s=n.buildDom,a=e("./modelist"),l=e("./themelist"),c={Bright:[],Dark:[]};l.themes.forEach(function(e){c[e.isDark?"Dark":"Bright"].push({caption:e.caption,value:e.theme})});var h=a.modes.map(function(e){return{caption:e.caption,value:e.mode}}),u={Main:{Mode:{path:"mode",type:"select",items:h},Theme:{path:"theme",type:"select",items:c},Keybinding:{type:"buttonBar",path:"keyboardHandler",items:[{caption:"Ace",value:null},{caption:"Vim",value:"ace/keyboard/vim"},{caption:"Emacs",value:"ace/keyboard/emacs"},{caption:"Sublime",value:"ace/keyboard/sublime"}]},"Font Size":{path:"fontSize",type:"number",defaultValue:12,defaults:[{caption:"12px",value:12},{caption:"24px",value:24}]},"Soft Wrap":{type:"buttonBar",path:"wrap",items:[{caption:"Off",value:"off"},{caption:"View",value:"free"},{caption:"margin",value:"printMargin"},{caption:"40",value:"40"}]},"Cursor Style":{path:"cursorStyle",items:[{caption:"Ace",value:"ace"},{caption:"Slim",value:"slim"},{caption:"Smooth",value:"smooth"},{caption:"Smooth And Slim",value:"smooth slim"},{caption:"Wide",value:"wide"}]},Folding:{path:"foldStyle",items:[{caption:"Manual",value:"manual"},{caption:"Mark begin",value:"markbegin"},{caption:"Mark begin and end",value:"markbeginend"}]},"Soft Tabs":[{path:"useSoftTabs"},{path:"tabSize",type:"number",values:[2,3,4,8,16]}],Overscroll:{type:"buttonBar",path:"scrollPastEnd",items:[{caption:"None",value:0},{caption:"Half",value:.5},{caption:"Full",value:1}]}},More:{"Atomic soft tabs":{path:"navigateWithinSoftTabs"},"Enable Behaviours":{path:"behavioursEnabled"},"Full Line Selection":{type:"checkbox",values:"text|line",path:"selectionStyle"},"Highlight Active Line":{path:"highlightActiveLine"},"Show Invisibles":{path:"showInvisibles"},"Show Indent Guides":{path:"displayIndentGuides"},"Persistent Scrollbar":[{path:"hScrollBarAlwaysVisible"},{path:"vScrollBarAlwaysVisible"}],"Animate scrolling":{path:"animatedScroll"},"Show Gutter":{path:"showGutter"},"Show Line Numbers":{path:"showLineNumbers"},"Relative Line Numbers":{path:"relativeLineNumbers"},"Fixed Gutter Width":{path:"fixedWidthGutter"},"Show Print Margin":[{path:"showPrintMargin"},{type:"number",path:"printMarginColumn"}],"Indented Soft Wrap":{path:"indentedSoftWrap"},"Highlight selected word":{path:"highlightSelectedWord"},"Fade Fold Widgets":{path:"fadeFoldWidgets"},"Use textarea for IME":{path:"useTextareaForIME"},"Merge Undo Deltas":{path:"mergeUndoDeltas",items:[{caption:"Always",value:"always"},{caption:"Never",value:"false"},{caption:"Timed",value:"true"}]},"Elastic Tabstops":{path:"useElasticTabstops"},"Incremental Search":{path:"useIncrementalSearch"},"Read-only":{path:"readOnly"},"Copy without selection":{path:"copyWithEmptySelection"},"Live Autocompletion":{path:"enableLiveAutocompletion"}}},d=function(e,t){this.editor=e,this.container=t||document.createElement("div"),this.groups=[],this.options={}};(function(){i.implement(this,r),this.add=function(e){e.Main&&i.mixin(u.Main,e.Main),e.More&&i.mixin(u.More,e.More)},this.render=function(){this.container.innerHTML="",s(["table",{id:"controls"},this.renderOptionGroup(u.Main),["tr",null,["td",{colspan:2},["table",{id:"more-controls"},this.renderOptionGroup(u.More)]]],["tr",null,["td",{colspan:2},"version "+o.version]]],this.container)},this.renderOptionGroup=function(e){return Object.keys(e).map(function(t,n){var i=e[t];return i.position||(i.position=n/1e4),i.label||(i.label=t),i}).sort(function(e,t){return e.position-t.position}).map(function(e){return this.renderOption(e.label,e)},this)},this.renderOptionControl=function(e,t){var n=this;if(Array.isArray(t))return t.map(function(t){return n.renderOptionControl(e,t)});var i,o=n.getOption(t);if(t.values&&"checkbox"!=t.type&&("string"==typeof t.values&&(t.values=t.values.split("|")),t.items=t.values.map(function(e){return{value:e,name:e}})),"buttonBar"==t.type)i=["div",t.items.map(function(e){return["button",{value:e.value,ace_selected_button:o==e.value,onclick:function(){n.setOption(t,e.value);for(var i=this.parentNode.querySelectorAll("[ace_selected_button]"),o=0;o<i.length;o++)i[o].removeAttribute("ace_selected_button");this.setAttribute("ace_selected_button",!0)}},e.desc||e.caption||e.name]})];else if("number"==t.type)i=["input",{type:"number",value:o||t.defaultValue,style:"width:3em",oninput:function(){n.setOption(t,parseInt(this.value))}}],t.defaults&&(i=[i,t.defaults.map(function(e){return["button",{onclick:function(){var t=this.parentNode.firstChild;t.value=e.value,t.oninput()}},e.caption]})]);else if(t.items){var r=function(e){return e.map(function(e){return["option",{value:e.value||e.name},e.desc||e.caption||e.name]})},s=Array.isArray(t.items)?r(t.items):Object.keys(t.items).map(function(e){return["optgroup",{label:e},r(t.items[e])]});i=["select",{id:e,value:o,onchange:function(){n.setOption(t,this.value)}},s]}else"string"==typeof t.values&&(t.values=t.values.split("|")),t.values&&(o=o==t.values[1]),i=["input",{type:"checkbox",id:e,checked:o||null,onchange:function(){var e=this.checked;t.values&&(e=t.values[e?1:0]),n.setOption(t,e)}}],"checkedNumber"==t.type&&(i=[i,[]]);return i},this.renderOption=function(e,t){if(!t.path||t.onchange||this.editor.$options[t.path]){this.options[t.path]=t;var n="-"+t.path;return["tr",{"class":"ace_optionsMenuEntry"},["td",["label",{"for":n},e]],["td",this.renderOptionControl(n,t)]]}},this.setOption=function(e,t){"string"==typeof e&&(e=this.options[e]),"false"==t&&(t=!1),"true"==t&&(t=!0),"null"==t&&(t=null),"undefined"==t&&(t=undefined),"string"==typeof t&&parseFloat(t).toString()==t&&(t=parseFloat(t)),e.onchange?e.onchange(t):e.path&&this.editor.setOption(e.path,t),this._signal("setOption",{name:e.path,value:t})},this.getOption=function(e){return e.getValue?e.getValue():this.editor.getOption(e.path)}}).call(d.prototype),t.OptionPanel=d}),ace.define("ace/ext/settings_menu",["require","exports","module","ace/ext/options","ace/ext/menu_tools/overlay_page","ace/editor"],function(e,t,n){"use strict";function i(e){if(!document.getElementById("ace_settingsmenu")){var t=new o(e);t.render(),t.container.id="ace_settingsmenu",r(e,t.container),t.container.querySelector("select,input,button,checkbox").focus()}}var o=e("./options").OptionPanel,r=e("./menu_tools/overlay_page").overlayPage;n.exports.init=function(){e("../editor").Editor.prototype.showSettingsMenu=function(){i(this)}}}),function(){ace.require(["ace/ext/settings_menu"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"],function(e,t){"use strict";var n=e("../lib/event");t.contextMenuHandler=function(e){var t=e.target,i=t.textInput.getElement();if(t.selection.isEmpty()){var o=t.getCursorPosition(),r=t.session.getWordRange(o.row,o.column),s=t.session.getTextRange(r);if(t.session.tokenRe.lastIndex=0,t.session.tokenRe.test(s)){var a="\x01\x01",l=s+" "+a;i.value=l,i.setSelectionRange(s.length,s.length+1),i.setSelectionRange(0,0),i.setSelectionRange(0,s.length);var c=!1;n.addListener(i,"keydown",function e(){n.removeListener(i,"keydown",e),c=!0}),t.textInput.setInputHandler(function(e){if(console.log(e,l,i.selectionStart,i.selectionEnd),e==l)return"";if(0===e.lastIndexOf(l,0))return e.slice(l.length);if(e.substr(i.selectionEnd)==l)return e.slice(0,-l.length);if(e.slice(-2)==a){var n=e.slice(0,-2);if(" "==n.slice(-1))return c?n.substring(0,i.selectionEnd):(n=n.slice(0,-1),t.session.replace(r,n),"")}return e})}}};var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{spellcheck:{set:function(e){this.textInput.getElement().spellcheck=!!e,e?this.on("nativecontextmenu",t.contextMenuHandler):this.removeListener("nativecontextmenu",t.contextMenuHandler)},value:!0}})}),function(){ace.require(["ace/ext/spellcheck"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(e,t){"use strict";var n=e("./lib/oop"),i=(e("./lib/lang"),e("./lib/event_emitter").EventEmitter),o=e("./editor").Editor,r=e("./virtual_renderer").VirtualRenderer,s=e("./edit_session").EditSession,a=function(e,t,n){this.BELOW=1,this.BESIDE=0,this.$container=e,this.$theme=t,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(n||1),this.$cEditor=this.$editors[0],this.on("focus",function(e){this.$cEditor=e}.bind(this))};(function(){n.implement(this,i),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new o(new r(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e!=this.$splits){if(e>this.$splits){for(;this.$splits<this.$editors.length&&this.$splits<e;)t=this.$editors[this.$splits],this.$container.appendChild(t.container),t.setFontSize(this.$fontSize),this.$splits++;for(;this.$splits<e;)this.$createEditor(),this.$splits++}else for(;this.$splits>e;)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()}},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach(function(t){t.setTheme(e)})},this.setKeyboardHandler=function(e){this.$editors.forEach(function(t){t.setKeyboardHandler(e)})},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach(function(t){t.setFontSize(e)})},this.$cloneSession=function(e){var t=new s(e.getDocument(),e.getMode()),n=e.getUndoManager();return t.setUndoManager(n),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var n;return n=null==t?this.$cEditor:this.$editors[t],this.$editors.some(function(t){return t.session===e})&&(e=this.$cloneSession(e)),n.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){this.$orientation!=e&&(this.$orientation=e,this.resize())},this.resize=function(){var e,t=this.$container.clientWidth,n=this.$container.clientHeight;if(this.$orientation==this.BESIDE)for(var i=t/this.$splits,o=0;o<this.$splits;o++)e=this.$editors[o],e.container.style.width=i+"px",e.container.style.top="0px",e.container.style.left=o*i+"px",e.container.style.height=n+"px",e.resize();else for(var r=n/this.$splits,o=0;o<this.$splits;o++)e=this.$editors[o],e.container.style.width=t+"px",e.container.style.top=o*r+"px",e.container.style.left="0px",e.container.style.height=r+"px",e.resize()}}).call(a.prototype),t.Split=a}),ace.define("ace/ext/split",["require","exports","module","ace/split"],function(e,t,n){"use strict";n.exports=e("../split")}),function(){ace.require(["ace/ext/split"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom","ace/lib/lang"],function(e,t,n){"use strict";function i(e){this.type=e,this.style={},this.textContent=""}var o=e("../edit_session").EditSession,r=e("../layer/text").Text,s=".ace_static_highlight {font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;font-size: 12px;white-space: pre-wrap}.ace_static_highlight .ace_gutter {width: 2em;text-align: right;padding: 0 3px 0 0;margin-right: 3px;contain: none;}.ace_static_highlight.ace_show_gutter .ace_line {padding-left: 2.6em;}.ace_static_highlight .ace_line { position: relative; }.ace_static_highlight .ace_gutter-cell {-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;user-select: none;top: 0;bottom: 0;left: 0;position: absolute;}.ace_static_highlight .ace_gutter-cell:before {content: counter(ace_line, decimal);counter-increment: ace_line;}.ace_static_highlight {counter-reset: ace_line;}",a=e("../config"),l=e("../lib/dom"),c=e("../lib/lang").escapeHTML;i.prototype.cloneNode=function(){return this},i.prototype.appendChild=function(e){this.textContent+=e.toString()},i.prototype.toString=function(){var e=[];if("fragment"!=this.type){e.push("<",this.type),this.className&&e.push(" class='",this.className,"'");var t=[];for(var n in this.style)t.push(n,":",this.style[n]);t.length&&e.push(" style='",t.join(""),"'"),e.push(">")}return this.textContent&&e.push(this.textContent),"fragment"!=this.type&&e.push("</",this.type,">"),e.join("")};var h={createTextNode:function(e){return c(e)},createElement:function(e){return new i(e)},createFragment:function(){
22
- return new i("fragment")}},u=function(){this.config={},this.dom=h};u.prototype=r.prototype;var d=function(e,t,n){var i=e.className.match(/lang-(\w+)/),o=t.mode||i&&"ace/mode/"+i[1];if(!o)return!1;var r=t.theme||"ace/theme/textmate",s="",a=[];if(e.firstElementChild)for(var c=0,h=0;h<e.childNodes.length;h++){var u=e.childNodes[h];3==u.nodeType?(c+=u.data.length,s+=u.data):a.push(c,u)}else s=e.textContent,t.trim&&(s=s.trim());d.render(s,o,r,t.firstLineNumber,!t.showGutter,function(t){l.importCssString(t.css,"ace_highlight"),e.innerHTML=t.html;for(var i=e.firstChild.firstChild,o=0;o<a.length;o+=2){var r=t.session.doc.indexToPosition(a[o]),s=a[o+1],c=i.children[r.row];c&&c.appendChild(s)}n&&n()})};d.render=function(e,t,n,i,r,s){function l(){var o=d.renderSync(e,t,n,i,r);return s?s(o):o}var c=1,h=o.prototype.$modes;"string"==typeof n&&(c++,a.loadModule(["theme",n],function(e){n=e,--c||l()}));var u;return t&&"object"==typeof t&&!t.getTokenizer&&(u=t,t=u.path),"string"==typeof t&&(c++,a.loadModule(["mode",t],function(e){h[t]&&!u||(h[t]=new e.Mode(u)),t=h[t],--c||l()})),--c||l()},d.renderSync=function(e,t,n,i,r){i=parseInt(i||1,10);var a=new o("");a.setUseWorker(!1),a.setMode(t);var l=new u;l.setSession(a),Object.keys(l.$tabStrings).forEach(function(e){if("string"==typeof l.$tabStrings[e]){var t=h.createFragment();t.textContent=l.$tabStrings[e],l.$tabStrings[e]=t}}),a.setValue(e);var c=a.getLength(),d=h.createElement("div");d.className=n.cssClass;var g=h.createElement("div");g.className="ace_static_highlight"+(r?"":" ace_show_gutter"),g.style["counter-reset"]="ace_line "+(i-1);for(var p=0;p<c;p++){var f=h.createElement("div");if(f.className="ace_line",!r){var m=h.createElement("span");m.className="ace_gutter ace_gutter-cell",m.textContent="",f.appendChild(m)}l.$renderLine(f,p,!1),f.textContent+="\n",g.appendChild(f)}return d.appendChild(g),{css:s+n.cssText,html:d.toString(),session:a}},n.exports=d,n.exports.highlight=d}),function(){ace.require(["ace/ext/static_highlight"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t){"use strict";var n=e("../lib/dom"),i=e("../lib/lang"),o=function(e,t){this.element=n.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var o=i.delayedCall(function(){this.updateStatus(e)}.bind(this)).schedule.bind(null,100);e.on("changeStatus",o),e.on("changeSelection",o),e.on("keyboardActivity",o)};(function(){this.updateStatus=function(e){function t(e,t){e&&n.push(e,t||"|")}var n=[];t(e.keyBinding.getStatusText(e)),e.commands.recording&&t("REC");var i=e.selection,o=i.lead;if(!i.isEmpty()){var r=e.getSelectionRange();t("("+(r.end.row-r.start.row)+":"+(r.end.column-r.start.column)+")"," ")}t(o.row+":"+o.column," "),i.rangeCount&&t("["+i.rangeCount+"]"," "),n.pop(),this.element.textContent=n.join("")}}).call(o.prototype),t.StatusBar=o}),function(){ace.require(["ace/ext/statusbar"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/ext/textarea",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/net","ace/ace","ace/theme/textmate"],function(e,t,n){"use strict";function i(e,t){for(var n in t)e.style[n]=t[n]}function o(e,t){if("textarea"!=e.type)throw new Error("Textarea required!");var n=e.parentNode,i=document.createElement("div"),o=function(){var t="position:relative;";["margin-top","margin-left","margin-right","margin-bottom"].forEach(function(n){t+=n+":"+u(e,i,n)+";"});var n=u(e,i,"width")||e.clientWidth+"px",o=u(e,i,"height")||e.clientHeight+"px";t+="height:"+o+";width:"+n+";",t+="display:inline-block;",i.setAttribute("style",t)};for(a.addListener(window,"resize",o),o(),n.insertBefore(i,e.nextSibling);n!==document;){if("FORM"===n.tagName.toUpperCase()){var r=n.onsubmit;n.onsubmit=function(n){e.value=t(),r&&r.call(this,n)};break}n=n.parentNode}return i}function r(e,t,n,i,o){function r(e){return"true"===e||1==e}e.getSession(),e.renderer;return e.setDisplaySettings=function(t){null==t&&(t="none"==n.style.display),t?(n.style.display="block",n.hideButton.focus(),e.on("focus",function t(){e.removeListener("focus",t),n.style.display="none"})):e.focus()},e.$setOption=e.setOption,e.$getOption=e.getOption,e.setOption=function(t,n){switch(t){case"mode":e.$setOption("mode","ace/mode/"+n);break;case"theme":e.$setOption("theme","ace/theme/"+n);break;case"keybindings":switch(n){case"vim":e.setKeyboardHandler("ace/keyboard/vim");break;case"emacs":e.setKeyboardHandler("ace/keyboard/emacs");break;default:e.setKeyboardHandler(null)}break;case"wrap":case"fontSize":e.$setOption(t,n);break;default:e.$setOption(t,r(n))}},e.getOption=function(t){switch(t){case"mode":return e.$getOption("mode").substr("ace/mode/".length);case"theme":return e.$getOption("theme").substr("ace/theme/".length);case"keybindings":var n=e.getKeyboardHandler();switch(n&&n.$id){case"ace/keyboard/vim":return"vim";case"ace/keyboard/emacs":return"emacs";default:return"ace"}break;default:return e.$getOption(t)}},e.setOptions(o),e}function s(e,n,i){function o(e,t,n,i){if(!n)return void e.push("<input type='checkbox' title='",t,"' ",i+""=="true"?"checked='true'":"","'></input>");e.push("<select title='"+t+"'>");for(var o in n)e.push("<option value='"+o+"' "),i==o&&e.push(" selected "),e.push(">",n[o],"</option>");e.push("</select>")}var r=null,s={mode:"Mode:",wrap:"Soft Wrap:",theme:"Theme:",fontSize:"Font Size:",showGutter:"Display Gutter:",keybindings:"Keyboard",showPrintMargin:"Show Print Margin:",useSoftTabs:"Use Soft Tabs:",showInvisibles:"Show Invisibles"},l={mode:{text:"Plain",javascript:"JavaScript",xml:"XML",html:"HTML",css:"CSS",scss:"SCSS",python:"Python",php:"PHP",java:"Java",ruby:"Ruby",c_cpp:"C/C++",coffee:"CoffeeScript",json:"json",perl:"Perl",clojure:"Clojure",ocaml:"OCaml",csharp:"C#",haxe:"haXe",svg:"SVG",textile:"Textile",groovy:"Groovy",liquid:"Liquid",Scala:"Scala"},theme:{clouds:"Clouds",clouds_midnight:"Clouds Midnight",cobalt:"Cobalt",crimson_editor:"Crimson Editor",dawn:"Dawn",gob:"Green on Black",eclipse:"Eclipse",idle_fingers:"Idle Fingers",kr_theme:"Kr Theme",merbivore:"Merbivore",merbivore_soft:"Merbivore Soft",mono_industrial:"Mono Industrial",monokai:"Monokai",pastel_on_dark:"Pastel On Dark",solarized_dark:"Solarized Dark",solarized_light:"Solarized Light",textmate:"Textmate",twilight:"Twilight",vibrant_ink:"Vibrant Ink"},showGutter:r,fontSize:{"10px":"10px","11px":"11px","12px":"12px","14px":"14px","16px":"16px"},wrap:{off:"Off",40:"40",80:"80",free:"Free"},keybindings:{ace:"ace",vim:"vim",emacs:"emacs"},showPrintMargin:r,useSoftTabs:r,showInvisibles:r},c=[];c.push("<table><tr><th>Setting</th><th>Value</th></tr>");for(var h in t.defaultOptions)c.push("<tr><td>",s[h],"</td>"),c.push("<td>"),o(c,h,l[h],i.getOption(h)),c.push("</td></tr>");c.push("</table>"),e.innerHTML=c.join("");for(var u=function(e){var t=e.currentTarget;i.setOption(t.title,t.value)},d=function(e){var t=e.currentTarget;i.setOption(t.title,t.checked)},g=e.getElementsByTagName("select"),p=0;p<g.length;p++)g[p].onchange=u;for(var f=e.getElementsByTagName("input"),p=0;p<f.length;p++)f[p].onclick=d;var m=document.createElement("input");m.type="button",m.value="Hide",a.addListener(m,"click",function(){i.setDisplaySettings(!1)}),e.appendChild(m),e.hideButton=m}var a=e("../lib/event"),l=e("../lib/useragent"),c=e("../lib/net"),h=e("../ace");e("../theme/textmate"),n.exports=t=h;var u=function(e,t,n){var i=e.style[n];return i||(i=window.getComputedStyle?window.getComputedStyle(e,"").getPropertyValue(n):e.currentStyle[n]),i&&"auto"!=i&&"intrinsic"!=i||(i=t.style[n]),i};t.transformTextarea=function(e,n){var c,u=e.autofocus||document.activeElement==e,d=o(e,function(){return c.getValue()});e.style.display="none",d.style.background="white";var g=document.createElement("div");i(g,{top:"0px",left:"0px",right:"0px",bottom:"0px",border:"1px solid gray",position:"absolute"}),d.appendChild(g);var p=document.createElement("div");i(p,{position:"absolute",right:"0px",bottom:"0px",cursor:"nw-resize",border:"solid 9px",borderColor:"lightblue gray gray #ceade6",zIndex:101});var f=document.createElement("div"),m={top:"0px",left:"20%",right:"0px",bottom:"0px",position:"absolute",padding:"5px",zIndex:100,color:"white",display:"none",overflow:"auto",fontSize:"14px",boxShadow:"-5px 2px 3px gray"};l.isOldIE?m.backgroundColor="#333":m.backgroundColor="rgba(0, 0, 0, 0.6)",i(f,m),d.appendChild(f),n=n||t.defaultOptions;var v=h.edit(g);c=v.getSession(),c.setValue(e.value||e.innerHTML),u&&v.focus(),d.appendChild(p),r(v,g,f,h,n),s(f,p,v);var b="";return a.addListener(p,"mousemove",function(e){var t=this.getBoundingClientRect();e.clientX-t.left+(e.clientY-t.top)<(t.width+t.height)/2?(this.style.cursor="pointer",b="toggle"):(b="resize",this.style.cursor="nw-resize")}),a.addListener(p,"mousedown",function(e){if(e.preventDefault(),"toggle"==b)return void v.setDisplaySettings();d.style.zIndex=1e5;var t=d.getBoundingClientRect(),n=t.width+t.left-e.clientX,i=t.height+t.top-e.clientY;a.capture(p,function(e){d.style.width=e.clientX-t.left+n+"px",d.style.height=e.clientY-t.top+i+"px",v.resize()},function(){})}),v},t.defaultOptions={mode:"javascript",theme:"textmate",wrap:"off",fontSize:"12px",showGutter:"false",keybindings:"ace",showPrintMargin:"false",useSoftTabs:"true",showInvisibles:"false"}}),function(){ace.require(["ace/ext/textarea"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/ext/themelist",["require","exports","module"],function(e,t){"use strict";var n=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub"],["IPlastic"],["Solarized Light"],["TextMate"],["Tomorrow"],["XCode"],["Kuroir"],["KatzenMilch"],["SQL Server","sqlserver","light"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Dracula","","dark"],["Cobalt","cobalt","dark"],["Gruvbox","gruvbox","dark"],["Green on Black","gob","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"]];t.themesByName={},t.themes=n.map(function(e){var n=e[1]||e[0].replace(/ /g,"_").toLowerCase(),i={caption:e[0],theme:"ace/theme/"+n,isDark:"dark"==e[2],name:n};return t.themesByName[n]=i,i})}),function(){ace.require(["ace/ext/themelist"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,t){"use strict";var n=e("../lib/lang");t.$detectIndentation=function(e){function t(e){for(var t=0,i=e;i<n.length;i+=e)t+=n[i]||0;return t}for(var n=[],i=[],o=0,r=0,s=Math.min(e.length,1e3),a=0;a<s;a++){var l=e[a];if(/^\s*[^*+\-\s]/.test(l)){if("\t"==l[0])o++,r=-Number.MAX_VALUE;else{var c=l.match(/^ */)[0].length;if(c&&"\t"!=l[c]){var h=c-r;h>0&&!(r%h)&&!(c%h)&&(i[h]=(i[h]||0)+1),n[c]=(n[c]||0)+1}r=c}for(;a<s&&"\\"==l[l.length-1];)l=e[a++]}}for(var u=i.reduce(function(e,t){return e+t},0),d={score:0,length:0},g=0,a=1;a<12;a++){var p=t(a);1==a?(g=p,p=n[1]?.9:.8,n.length||(p=0)):p/=g,i[a]&&(p+=i[a]/u),p>d.score&&(d={score:p,length:a})}if(d.score&&d.score>1.4)var f=d.length;return o>g+1?((1==f||g<o/4||d.score<1.8)&&(f=undefined),{ch:"\t",length:f}):g>o+1?{ch:" ",length:f}:void 0},t.detectIndentation=function(e){var n=e.getLines(0,1e3),i=t.$detectIndentation(n)||{};return i.ch&&e.setUseSoftTabs(" "==i.ch),i.length&&e.setTabSize(i.length),i},t.trimTrailingSpace=function(e,t){var n=e.getDocument(),i=n.getAllLines(),o=t&&t.trimEmpty?-1:0,r=[],s=-1;t&&t.keepCursorPosition&&(e.selection.rangeCount?e.selection.rangeList.ranges.forEach(function(e,t,n){var i=n[t+1];i&&i.cursor.row==e.cursor.row||r.push(e.cursor)}):r.push(e.selection.getCursor()),s=0);for(var a=r[s]&&r[s].row,l=0,c=i.length;l<c;l++){var h=i[l],u=h.search(/\s+$/);l==a&&(u<r[s].column&&u>o&&(u=r[s].column),s++,a=r[s]?r[s].row:-1),u>o&&n.removeInLine(l,u,h.length)}},t.convertIndentation=function(e,t,i){var o=e.getTabString()[0],r=e.getTabSize();i||(i=r),t||(t=o);for(var s="\t"==t?t:n.stringRepeat(t,i),a=e.doc,l=a.getAllLines(),c={},h={},u=0,d=l.length;u<d;u++){var g=l[u],p=g.match(/^\s*/)[0];if(p){var f=e.$getStringScreenWidth(p)[0],m=Math.floor(f/r),v=f%r,b=c[m]||(c[m]=n.stringRepeat(s,m));(b+=h[v]||(h[v]=n.stringRepeat(" ",v)))!=p&&(a.removeInLine(u,0,p.length),a.insertInLine({row:u,column:0},b))}}e.setTabSize(i),e.setUseSoftTabs(" "==t)},t.$parseStringArg=function(e){var t={};/t/.test(e)?t.ch="\t":/s/.test(e)&&(t.ch=" ");var n=e.match(/\d+/);return n&&(t.length=parseInt(n[0],10)),t},t.$parseArg=function(e){return e?"string"==typeof e?t.$parseStringArg(e):"string"==typeof e.text?t.$parseStringArg(e.text):e:{}},t.commands=[{name:"detectIndentation",description:"Detect indentation from content",exec:function(e){t.detectIndentation(e.session)}},{name:"trimTrailingSpace",description:"Trim trailing whitespace",exec:function(e,n){t.trimTrailingSpace(e.session,n)}},{name:"convertIndentation",description:"Convert indentation to ...",exec:function(e,n){var i=t.$parseArg(n);t.convertIndentation(e.session,i.ch,i.length)}},{name:"setIndentation",description:"Set indentation",exec:function(e,n){var i=t.$parseArg(n);i.length&&e.session.setTabSize(i.length),i.ch&&e.session.setUseSoftTabs(" "==i.ch)}}]}),function(){ace.require(["ace/ext/whitespace"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}();var GollumTagStart={token:"support.function",regex:"\\[\\[.*\\]\\]",next:"start"},UMLBlock=[{token:"support.function",regex:"^\\@enduml$",next:"start"},{defaultToken:"support.function"}],UMLStart={token:"support.function",regex:"^(?:[ \\t]*)\\@startuml$",next:"umlblock"},GithubCodeBlock=[{token:"support.function",regex:".*",onMatch:function(e,t,n){var i=n[2][0],o=n[2][1],r=/^( {0,3})(~~[~]+|```)\s*$/.exec(e);return r&&r[2].length>=i&&r[2].charAt(0)==o?(n.splice(0,3),this.next=n.shift(),this.token):(this.next="",this.token)}},{defaultToken:"support.function"}],startCodeBlockMatch=function(e,t,n){var i=new RegExp(this.regex).exec(e);return n.unshift("githubblock",[],[i[2].length,i[2].charAt(0)],t),this.token},GollumCodeStart={token:"support.function",regex:"^( {0,3})(```)[^`]*$",onMatch:startCodeBlockMatch,next:"githubblock"},MarkdownCodeStart={token:"support.function",regex:"^( {0,3})(~~[~]+)[^`~]*$",onMatch:startCodeBlockMatch,next:"githubblock"};ace.define("GollumRstHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/rst_highlight_rules").RSTHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumAsciidocHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/asciidoc_highlight_rules").AsciidocHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumTextileHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/textile_highlight_rules").TextileHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumTextHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/text_highlight_rules").TextHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumRdocHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/rdoc_highlight_rules").RDocHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumMarkdownHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/markdown_highlight_rules").MarkdownHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.$rules.start.unshift(MarkdownCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),function(e){var t={asciidoc:{mode:"asciidoc",highlighter:"GollumAsciidocHighlightRules"},creole:{mode:"text",highlighter:"GollumTextHighlightRules"},markdown:{mode:"markdown",highlighter:"GollumMarkdownHighlightRules"},mediawiki:{mode:"text",highlighter:"GollumTextHighlightRules"},bib:{mode:"latex"},org:{mode:"text",highlighter:"GollumTextHighlightRules"},rst:{mode:"rst",highlighter:"GollumRstHighlightRules"},txt:{mode:"text"},pod:{mode:"text",highlighter:"GollumTextHighlightRules"},rdoc:{mode:"rdoc",highlighter:"GollumRdocHighlightRules"},textile:{mode:"textile",highlighter:"GollumTextileHighlightRules"}};e.getEditorMode=function(e){var n=null;if(n=t[e]){var i=n.mode,o=n.highlighter;if(o){var r=ace.require("ace/mode/"+i).Mode,s=new r;return s.HighlightRules=ace.require(o).GollumHighlightRules,s}return"ace/mode/"+i}return null}}(jQuery),function(e){function t(e){return new RegExp("^[^A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02b8\u0300-\u0590\u0800-\u1fff\u2c00-\ufb1c\ufdfe-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]").test(e)}function n(e){window.ace_editor.session.$bidiHandler.$isRtl=e,window.ace_editor.session.$bidiHandler.updateBidiMap(),window.ace_editor.renderer.updateFull()}var i={MarkupType:"markdown",EditorMode:"code",NewFile:!1,HasFunctionBar:!0,Debug:!1,NoDefinitionsFor:[]},o={};e.GollumEditor=function(l){if(o=e.extend(i,l),e('textarea[id="gollum-editor-body"]').each(function(){var i=e(this),r=i.attr("data-markup-lang")?i.attr("data-markup-lang"):"markdown",s=e("<div>",{position:"absolute",height:i.height(),"class":i.attr("class"),id:"gollum-editor-body-ace"}).insertAfter(i);i.css("display","none");var a=ace.edit(s[0],{rtlText:!0});window.ace_editor=a,a.setTheme("ace/theme/tomorrow"),a.setKeyboardHandler(),a.renderer.setShowGutter(!1),a.getSession().setUseWrapMode(!0),a.getSession().setValue(i.val()),a.getSession().setMode(e.getEditorMode(r)),a.getSession().on("change",function(){i.val(a.getSession().getValue())}),t(a.getSession().getLine(0))&&n(!0),a.commands.addCommand({name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e){ace.config.loadModule("ace/ext/keybinding_menu",function(t){t.init(e),e.showKeyboardShortcuts()})}}),o.commands&&e.each(o.commands,function(e,t){a.commands.addCommand(t)})}),e("#gollum-editor-body-ace").resize(function(){window.ace_editor.resize()}),e("#wiki_format").change(function(){var t=e(this).val(),n=window.ace_editor;window.ace_editor.getSession().setMode(e.getEditorMode(t)),c.updateCommitMessage(t),n.focus()}),e("#keybinding").change(function(){var t=e(this).val(),n=window.ace_editor;"default"==t?n.setKeyboardHandler():"vim"==t||"emacs"==t?n.setKeyboardHandler("ace/keyboard/"+t):n.setKeyboardHandler(),n.focus()}),r("GollumEditor loading"),a.baseEditorMarkup()){if(a.titleDisplayed()&&e("#gollum-editor-title-field").addClass("active"),a.editSummaryMarkup()&&(e.GollumEditor.Placeholder.add(e("#gollum-editor-edit-summary input")),e('#gollum-editor form[name="gollum-editor"]').submit(function(t){t.preventDefault(),r("submitting"),e(this).unbind("submit"),e(this).submit()})),a.collapsibleInputs()&&e("#gollum-editor .collapsed button.collapsable, #gollum-editor .expanded button.collapsable").click(function(t){t.preventDefault(),e(this).parent().toggleClass("expanded"),e(this).parent().toggleClass("collapsed"),buttons=e(this).parent().children("button"),hidden_button=buttons.filter(":hidden")[0],shown_button=buttons.not(":hidden")[0],hidden_button.hidden=!1,shown_button.hidden=!0}),a.previewButton()){e("#gollum-editor #gollum-editor-preview").click(function(){var t=e("#gollum-editor form").attr("action"),n=e(e("#gollum-editor form").get(0));n.attr("action",this.href||routePath("preview")),n.attr("target","_blank");var i=window.location.pathname.split("/");return n.attr("page",i[i.length-1]||""),n.submit(),n.attr("action",t),n.removeAttr("target"),!1})}if(a.functionBar()){var h=e("#gollum-editor-body").attr("data-markup-lang");h&&(o.MarkupType=h),s.setActiveLanguage(o.MarkupType),a.formatSelector()&&c.init(e("#wiki_format")),a.dir()&&e("#function-text-direction").click(function(e){e.preventDefault(),n(!window.ace_editor.session.$bidiHandler.$isRtl)}),a.help()&&(e("#gollum-editor-help").hide(),e("#gollum-editor-help").removeClass("jaws"))}if(o.section&&e.markupSupportsEditableSections(o.MarkupType)){var u=e.findSection(o.section,s.getDefinitionFor("gollum-helpers"));u&&(window.ace_editor.gotoLine(u+1,0,animate=!1),window.ace_editor.scrollToLine(u,center=!1,animate=!1),window.ace_editor.focus())}if(a.dragDropUpload()){var d=e("#gollum-editor-body-ace"),g=e("#gollum-editor-body-ace")[0];g.ondragover=function(){return d.addClass("dragging"),!1},g.ondragleave=function(){return d.removeClass("dragging"),!1},g.ondrop=function(t){r("dropped file"),t.preventDefault(),d.removeClass("dragging").addClass("uploading");var n=t.dataTransfer.files[0],i=new FormData;return i.append("file",n),e.ajax({url:routePath("upload_file"),data:i,cache:!1,contentType:!1,processData:!1,type:"POST",success:function(){d.removeClass("uploading");var e=n.name.split(".").pop().toLowerCase();if(["jpg","jpeg","tif","tiff","png","gif","svg","bmp"].indexOf(e)>-1)var t="[[/"+uploadDest+"/"+n.name+"]]";else var t="[["+n.name+"|/"+uploadDest+"/"+n.name+"]]";window.ace_editor.insert(t)},error:function(e,t,n){409==e.status?alert("This file already exists."):alert("Error uploading file: "+t+" "+n),d.removeClass("uploading")}}),!1}}}},e.GollumEditor.defineLanguage=function(e,t){"object"==typeof t?s.define(e,t):r("GollumEditor.defineLanguage: definition for "+e+" is not an object")};var r=function(e){o.Debug&&"undefined"!=typeof console&&console.log(e)},s={_ACTIVE_LANG:"",_LOADED_LANGS:[],_LANG:{},define:function(t,n){if(s._ACTIVE_LANG=t,s._LOADED_LANGS.push(t),"object"==typeof e.GollumEditor.WikiLanguage){var i={};e.extend(i,e.GollumEditor.WikiLanguage,n),s._LANG[t]=i}else s._LANG[t]=n},getActiveLanguage:function(){return s._ACTIVE_LANG},setActiveLanguage:function(e){function t(e){return function(){var t=s.getDefinitionFor(e);"object"==typeof t&&l.executeAction(t)}}null!=s._ACTIVE_LANG&&s._ACTIVE_LANG.length<=0&&c.updateCommitMessage(e),s.getHookFunctionFor("deactivate")&&s.getHookFunctionFor("deactivate")(),s.isLoadedFor(e)?(s._ACTIVE_LANG=e,l.refresh(),s.getHookFunctionFor("activate")&&s.getHookFunctionFor("activate")()):(s._ACTIVE_LANG=null,a.functionBar()&&l.refresh(),s.isValid()&&a.formatSelector()&&c.updateSelected(),s.getHookFunctionFor("activate")&&s.getHookFunctionFor("activate")()),window.ace_editor.commands.addCommand({name:"header-1",bindKey:{win:"Ctrl-1",mac:"Command-1"},exec:t("function-h1")}),window.ace_editor.commands.addCommand({name:"header-2",bindKey:{win:"Ctrl-2",mac:"Command-2"},exec:t("function-h2")}),window.ace_editor.commands.addCommand({name:"header-3",bindKey:{win:"Ctrl-3",mac:"Command-3"},exec:t("function-h3")}),window.ace_editor.commands.addCommand({name:"bold-text",bindKey:{win:"Ctrl-b",mac:"Command-b"},exec:t("function-bold")}),window.ace_editor.commands.addCommand({name:"italic-text",bindKey:{win:"Ctrl-i",mac:"Command-i"},exec:t("function-italic")})},getHookFunctionFor:function(e,t){return t||(t=s._ACTIVE_LANG),s.isLoadedFor(t)&&s._LANG[t][e]&&"function"==typeof s._LANG[t][e]?s._LANG[t][e]:null},getDefinitionFor:function(e,t){return t||(t=s._ACTIVE_LANG),s.isLoadedFor(t)&&s._LANG[t][e]&&"object"==typeof s._LANG[t][e]?s._LANG[t][e]:null},isLoadedFor:function(e){if(0===s._LOADED_LANGS.length)return!1;for(var t=0;t<s._LOADED_LANGS.length;t++)if(s._LOADED_LANGS[t]==e)return!0;return!1},isValid:function(){return s._ACTIVE_LANG&&"object"==typeof s._LANG[s._ACTIVE_LANG]}},a={baseEditorMarkup:function(){return e("#gollum-editor").length&&e("#gollum-editor-body").length},collapsibleInputs:function(){return e("#gollum-editor .collapsed, #gollum-editor .expanded").length},formatSelector:function(){return e("#wiki_format").length},functionBar:function(){return o.HasFunctionBar&&e("#gollum-editor-function-bar").length},ff4Environment:function(){return new RegExp(/Firefox\/4.0b/).test(navigator.userAgent)},editSummaryMarkup:function(){return e("input#gollum-editor-message-field").length>0},help:function(){return e("#gollum-editor #gollum-editor-help").length&&e("#gollum-editor #function-help").length},dir:function(){return e("#gollum-editor #function-text-direction").length},previewButton:function(){return e("#gollum-editor #gollum-editor-preview").length},titleDisplayed:function(){return o.NewFile},dragDropUpload:function(){return e("#gollum-editor.uploads-allowed").length}},l={isActive:!1,activate:function(){r("Activating function bar"),e("#gollum-editor-function-bar button.function-button").each(function(){s.getDefinitionFor(e(this).attr("id"))?(e(this).click(l.evtFunctionButtonClick),e(this).attr("disabled",!1)):["function-help","function-text-direction"].includes(e(this).attr("id"))||e(this).attr("disabled",!0)}),e("#gollum-editor-function-bar").addClass("active"),l.isActive=!0},deactivate:function(){e("#gollum-editor-function-bar button.function-button").not("#function-text-direction").unbind("click"),e("#gollum-editor-function-bar").removeClass("active"),l.isActive=!1},evtFunctionButtonClick:function(t){t.preventDefault();var n=s.getDefinitionFor(e(this).attr("id"));"object"==typeof n&&l.executeAction(n)},executeAction:function(t){var n=window.ace_editor,i=n.getValue(),o=!1,s=!1,a=n.getSelectionRange(),l=n.getSelectedText(),c=l.length,h=!1;if(""==l)if(t.whole_line&&1==t.whole_line){h=!0;var u=a.start.row;l=n.session.getLine(u);var d=ace.require("ace/range").Range;a=new d(u,0,u,l.length)}else t.break_line&&1==t.break_line&&(o=!0,s=!0);else t.break_line&&1==t.break_line&&(o=!0,s=!0);var g=l;if(t.exec&&"function"==typeof t.exec)return void t.exec(i,l,e("#gollum-editor-body"),a);var p=/([^\n]+)/gi;if(t.search&&"object"==typeof t.search&&(r("Replacing search Regex"),p=null,p=new RegExp(t.search),r(p)),r('repText is "'+g+'"'),t.replace&&"string"==typeof t.replace){r("Running replacement - using "+t.replace);var f=t.replace;g=escape(g),g=g.replace(p,f),g=g.replace(/\$[\d]/g,""),g=unescape(g),""===g&&(r("Search string is empty"),g=f.replace(/\$[\d]/g,""));var m=undefined;if(0==h){repPosition=f.indexOf("$1"),-1==repPosition&&(repPosition=Math.floor(f.length/2));var v=f.substring(0,repPosition),b=v.split("\n").length-1,w=repPosition;b>0&&(w-=v.lastIndexOf("\n")),w+=c,m=[b,w]}}t.append&&"string"==typeof t.append&&(g+=t.append),g&&e.GollumEditor.replaceSelection(g,o,s,a,m)},isShown:function(){return e("#gollum-editor-function-bar").is(":visible")},refresh:function(){a.functionBar()&&(r("Refreshing function bar"),s.isValid()?(l.deactivate(),l.activate(),h&&h.setActiveHelp(s.getActiveLanguage())):(r("Language definition is invalid."),l.isShown()&&l.deactivate(),
23
- h.isShown()&&h.hide()))}},c={$_SELECTOR:null,evtChangeFormat:function(){var t=e(this).val();c.updateCommitMessage(t),s.setActiveLanguage(t)},updateCommitMessage:function(e){var t=document.getElementById("gollum-editor-message-field"),n=t.value;/^(?:created|updated)/i.test(n)&&(t.value=n.replace(/\([^\)]*\)$/,"("+e+")"))},init:function(e){r("Initializing format selector"),c.$_SELECTOR&&"object"==typeof c.$_SELECTOR&&c.$_SELECTOR.unbind("change"),c.$_SELECTOR=e,c.updateSelected(),c.$_SELECTOR.change(c.evtChangeFormat)},updateSelected:function(){var e=s.getActiveLanguage();c.$_SELECTOR.val(e)}},h={_ACTIVE_HELP:"",_LOADED_HELP_LANGS:[],_HELP:{},define:function(t,n){h.isValidHelpFormat(n)?(r("help is a valid format"),h._ACTIVE_HELP_LANG=t,h._LOADED_HELP_LANGS.push(t),h._HELP[t]=n,e("#function-help").length&&(e("#function-help").attr("disabled")&&e("#function-help").attr("disabled",!1),e("#function-help").unbind("click"),e("#function-help").click(h.evtHelpButtonClick),h.generateHelpMenuFor(t),e("#gollum-editor-help").length&&void 0!==e("#gollum-editor-help").attr("data-autodisplay")&&"true"===e("#gollum-editor-help").attr("data-autodisplay")&&h.show())):e("#function-help").length&&e("#function-help").attr("disabled",!0)},generateHelpMenuFor:function(t){if(!h._HELP[t])return r("Help is not defined for "+t.toString()),!1;var n=h._HELP[t];e("#gollum-editor-help-parent").html(""),e("#gollum-editor-help-list").html(""),e("#gollum-editor-help-content").html("");for(var i=0;i<n.length&&"object"==typeof n[i];i++){var o=e('<li><a href="#" rel="'+i+'">'+n[i].menuName+"</a></li>");e("#gollum-editor-help-parent").append(o),0===i&&o.children("a").addClass("selected"),o.children("a").click(h.evtParentMenuClick)}h.generateSubMenu(n[0],0),e(e("#gollum-editor-help-list li a").get(0)).click()},generateSubMenu:function(t,n){e("#gollum-editor-help-list").html(""),e("#gollum-editor-help-content").html("");for(var i=0;i<t.content.length&&"object"==typeof t.content[i];i++){var o=e('<li><a href="#" rel="'+n+":"+i+'">'+t.content[i].menuName+"</a></li>");e("#gollum-editor-help-list").append(o),o.children("a").click(h.evtSubMenuClick)}},hide:function(){e.browser.msie?e("#gollum-editor-help").css("display","none"):e("#gollum-editor-help").animate({opacity:0},200,function(){e("#gollum-editor-help").animate({height:"hide"},200)})},show:function(){e.browser.msie?e("#gollum-editor-help").css("display","block"):e("#gollum-editor-help").animate({height:"show"},200,function(){e("#gollum-editor-help").animate({opacity:1},300)})},showHelpFor:function(t,n){var i=h._HELP[h._ACTIVE_HELP_LANG][t].content[n].data;e("#gollum-editor-help-content").html(i)},isLoadedFor:function(e){for(var t=0;t<h._LOADED_HELP_LANGS.length;t++)if(e==h._LOADED_HELP_LANGS[t])return!0;return!1},isShown:function(){return e("#gollum-editor-help").is(":visible")},isValidHelpFormat:function(e){return"object"==typeof e&&e.length&&"string"==typeof e[0].menuName&&"object"==typeof e[0].content&&e[0].content.length},setActiveHelp:function(t){h.isLoadedFor(t)?(h._ACTIVE_HELP_LANG=t,e("#function-help").length&&(e("#function-help").attr("disabled")&&e("#function-help").attr("disabled",!1),e("#function-help").unbind("click"),e("#function-help").click(h.evtHelpButtonClick),h.generateHelpMenuFor(t))):(e("#function-help").length&&e("#function-help").attr("disabled",!0),h.isShown()&&h.hide())},evtHelpButtonClick:function(t){t.preventDefault(),h.isShown()?(e("#gollum-editor-help").length&&"undefined"!==e("#gollum-editor-help").attr("data-autodisplay")&&"true"===e("#gollum-editor-help").attr("data-autodisplay")&&(e.post("/wiki/help?_method=delete"),e("#gollum-editor-help").attr("data-autodisplay","")),h.hide()):h.show()},evtParentMenuClick:function(t){if(t.preventDefault(),!e(this).hasClass("selected")){var n=e(this).attr("rel"),i=h._HELP[h._ACTIVE_HELP_LANG][n];e("#gollum-editor-help-parent li a").removeClass("selected"),e(this).addClass("selected"),h.generateSubMenu(i,n),e(e("#gollum-editor-help-list li a").get(0)).click()}},evtSubMenuClick:function(t){if(t.preventDefault(),!e(this).hasClass("selected")){var n=e(this).attr("rel").split(":");e("#gollum-editor-help-list li a").removeClass("selected"),e(this).addClass("selected"),h.showHelpFor(n[0],n[1])}}};e.GollumEditor.defineHelp=h.define,e.GollumEditor.Dialog=e.GollumDialog,e.GollumEditor.replaceSelection=function(e,t,n,i,o){var r=window.ace_editor,s=0;if(i==undefined)var i=r.selection.getRange();if(1==t){var a=r.session.doc.getLine(i.start.row-1);i.start.column>0?(e="\n\n"+e,s=2):""!=a&&(e="\n"+e,s=1)}if(1==n){var l=r.session.doc.getLine(i.end.row+1);i.end.column<r.session.doc.getLine(i.end.row).length?e+="\n\n":""!=l&&(e+="\n")}r.session.replace(i,e),o!=undefined&&(totalVerticalOffset=o[0]+s+i.start.row,totalHorizontalOffset=o[1]+i.start.column,r.navigateTo(totalVerticalOffset,totalHorizontalOffset)),r.focus()},e.GollumEditor.Placeholder=e.GollumPlaceholder}(jQuery),function(e){e.constructLanguageDefinition=function(t){var n=e.extend(!0,{},e.DefaultLang,t);return Object.keys(t).forEach(function(e){"undefined"==typeof t[e]&&delete n[e]}),n};var t=function(t,n,i){e.GollumEditor.Dialog.init({title:t,fields:n,OK:function(t){e.GollumEditor.replaceSelection(i(t))}})};e.DefaultLang={"function-bold":{search:/([^\n]+)([\n\s]*)/g,replace:"**$1**$2"},"function-italic":{search:/([^\n]+)([\n\s]*)/g,replace:"_$1_$2"},"function-code":{search:/([^\n]+)([\n\s]*)/g,replace:"`$1`$2"},"function-hr":{append:"\n***\n"},"function-ul":{exec:function(t,n){for(var i="",o=n.split("\n"),r=0;r<o.length;r++)i+="* "+o[r]+"\n";i=i.substring(0,i.length-1),e.GollumEditor.replaceSelection(i,!0,!0)}},"function-ol":{line:function(e,t){return e.toString()+". "+t+"\n"},exec:function(t,n){for(var i="",o=n.split("\n"),r=0;r<o.length;r++)i+=this.line(r+1,o[r]);i=i.substring(0,i.length-1),e.GollumEditor.replaceSelection(i,!0,!0)}},"function-blockquote":{search:/(.+)([\n]?)/g,replace:"> $1$2",break_line:!0},"function-h1":{search:/(.+)([\n]?)/g,replace:"# $1$2",break_line:!0,whole_line:!0},"function-h2":{search:/(.+)([\n]?)/g,replace:"## $1$2",break_line:!0,whole_line:!0},"function-h3":{search:/(.+)([\n]?)/g,replace:"### $1$2",break_line:!0,whole_line:!0},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="["+e.text+"]("+e.href+")"),t},exec:function(e,n){t("Insert Link",[{id:"text",name:"Link Text",type:"text",defaultValue:n},{id:"href",name:"URL",type:"text"}],this.replace)}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t="!["+e.alt+"]("+e.url+")"),t},exec:function(e,n){t("Insert Image",[{id:"url",name:"Image Url",type:"text",defaultValue:n},{id:"alt",name:"Alt Text",type:"text"}],this.replace)}},"function-critic-accept":{exec:function(t,n){var i=n.replace(/\{\+\+(.*?)\+\+[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"$1").replace(/\{--(.*?)--[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"").replace(/\{~~(.*?)~>(.*?)~~\}/gm,"$2").replace(/\{\=\=(.*?)[ \t]*(\[(.*?)\])?[ \t]*\=\=\}{>>(.*?)<<\}/gm,"$1").replace(/\{>>(.*?)<<\}/gm,"");e.GollumEditor.replaceSelection(i)}},"function-critic-reject":{exec:function(t,n){var i=n.replace(/\{\+\+(.*?)\+\+[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"").replace(/\{--(.*?)--[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"$1").replace(/\{~~(.*?)~>(.*?)~~\}/gm,"$1").replace(/\{\=\=(.*?)[ \t]*(\[(.*?)\])?[ \t]*\=\=\}{>>(.*?)<<\}/gm,"$1").replace(/\{>>(.*?)<<\}/gm,"");e.GollumEditor.replaceSelection(i)}}}}(jQuery),function(e){var t={"function-bold":{replace:"*$1*$2"},"function-hr":undefined,"function-blockquote":{replace:"----\n$1$2\n----"},"function-h1":{replace:"= $1$2"},"function-h2":{replace:"== $1$2"},"function-h3":{replace:"=== $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t=e.href+"["+e.text+"]"),t}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t="image::"+e.url+"["+e.alt+"]"),t}}};e.GollumEditor.defineLanguage("asciidoc",e.constructLanguageDefinition(t));var n=[{menuName:"Text Formatting",content:[{menuName:"Headers",data:"<p>AsciiDoc headers can be written in two ways: with differing underlines or with different indentation using <code>=</code> (equals sign). AsciiDoc supports headings 1-4. The editor will automatically use the <code>=</code> notation. To create a level one header, prefix your line with one <code>=</code>. Level two headers are created with <code>==</code> and so on.</p>"},{menuName:"Bold / Italic",data:"<p>To display text as <strong>bold</strong>, wrap the text in <code>*</code> (asterisks). To display text as <em>italic</em>, wrap the text in <code>_</code> (underscores). To create <code>monospace</code> text, wrap the text in <code>`</code> (backtick)."},{menuName:"Scripts",data:"<p>Superscript and subscript is created the same way as other inline formats. To create superscript text, wrap your text in <code>^</code> (carats). To create subscript text, wrap your text in <code>~</code> (tildes).</p>"},{menuName:"Special Characters",data:"<p>AsciiDoc will automatically convert textual representations of commonly-used special characters. For example, <code>(R)</code> becomes &reg;, <code>(C)</code> becomes &copy; and <code>(TM)</code> becomes &trade;.</p>"}]},{menuName:"Blocks",content:[{menuName:"Paragraphs",data:"<p>AsciiDoc allows paragraphs to have optional titles or icons to denote special sections. To make a normal paragraph, simply add a line between blocks and a new paragraph will start. If you want to title your paragraphs, adda line prefixed by <code>.</code> (full stop). An example paragraph with optional title is displayed below:<br><br><code>.Optional Title<br><br>This is my paragraph. It is two sentences long.</code></p>"},{menuName:"Source Blocks",data:"<p>To create source blocks (long blocks of code), follow the same syntax as above but with an extra line denoting the inline source and lines of four dashes (<code>----</code>) delimiting the source block.. An example of Python source is below:<br><br><code>.python.py<br>[source,python]<br>----<br># i just wrote a comment in python<br># and maybe one more<br>----</code></p>"},{menuName:"Comment Blocks",data:"<p>Comment blocks are useful if you want to keep notes for yourself inline but do not want them displayed to the public. To create a comment block, simply wrap the paragraph in dividers with four slashes (<code>////</code>). An example comment block is below:<br><br><code>////<br>My comment block is here now<br><br>It can be multiple paragraphs. Really.<br>////</p>"},{menuName:"Quote Blocks",data:"<p>Quote blocks work much like comment blocks &mdash; simply create dividers using four underscores (<code>____</code>) around your quote. An example quote block is displayed below:<br><code>____<br>This is my quote block. Quote something nice here, otherwise there is no point in quoting.<br>____</code></p>"}]},{menuName:"Macros",content:[{menuName:"Links",data:'<p>To create links to external pages, you can simply write the URI if you want the URI to link to itself. (i.e., <code>http://github.com/</code> will automatically be parsed to <a href="javascript:void(0);">http://github.com/</a>. If you want different text to be displayed, simply append it to the end of the URI in between <code>[</code> (brackets.) For example, <code>http://github.com/[GitHub]</code> will be parsed as <a href="javascript:void(0);">GitHub</a>, with the URI pointing to <code>http://github.com</code>.</p>'},{menuName:"Images",data:"<p>Images in AsciiDoc work much like hyperlinks, but image URLs are prefixed with <code>image:</code>. For example, to link to an image at <code>images/icons/home.png</code>, write <code>image:images/icons/home.png</code>. Alt text can be added by appending the text to the URI in <code>[</code> (brackets).</p>"}]}];e.GollumEditor.defineHelp("asciidoc",n)}(jQuery),function(e){e.GollumEditor.defineLanguage("bib",{})}(jQuery),function(e){var t={"function-italic":{replace:"//$1//$2"},"function-code":{replace:"{{{$1}}}$2"},"function-hr":{append:"\n\n----\n\n"},"function-blockquote":undefined,"function-ol":{line:function(e,t){return"# "+t+"\n"}},"function-h1":{replace:"== $1$2"},"function-h2":{replace:"=== $1$2"},"function-h3":{replace:"==== $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="[["+e.href+"|"+e.text+"]]"),t}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t="{{"+e.url,""!=e.alt&&(t+="|"+e.alt),t+="}}"),t}}};e.GollumEditor.defineLanguage("creole",e.constructLanguageDefinition(t))}(jQuery),function(e){var t={"gollum-helpers":{"find-header-line":function(e,t){if(t.match(/(^[=]+$)/)||t.match(/(^[-]+$)/)){var n=e-1,i=window.ace_editor.getSession().getLine(n);return n>=0&&!/^\s+$/.test(i)?[i,n]:null}return null}}};e.GollumEditor.defineLanguage("markdown",e.constructLanguageDefinition(t));var n=[{menuName:"Block Elements",content:[{menuName:"Paragraphs &amp; Breaks",data:"<p>To create a paragraph, simply create a block of text that is not separated by one or more blank lines. Blocks of text separated by one or more blank lines will be parsed as paragraphs.</p><p>If you want to create a line break, end a line with two or more spaces, then hit Return/Enter.</p>"},{menuName:"Headers",data:"<p>Markdown supports two header formats. The wiki editor uses the &ldquo;atx&rsquo;-style headers. Simply prefix your header text with the number of <code>#</code> characters to specify heading depth. For example: <code># Header 1</code>, <code>## Header 2</code> and <code>### Header 3</code> will be progressively smaller headers. You may end your headers with any number of hashes.</p>"},{menuName:"Blockquotes",data:"<p>Markdown creates blockquotes email-style by prefixing each line with the <code>&gt;</code>. This looks best if you decide to hard-wrap text and prefix each line with a <code>&gt;</code> character, but Markdown supports just putting <code>&gt;</code> before your paragraph.</p>"},{menuName:"Lists",data:"<p>Markdown supports both ordered and unordered lists. To create an ordered list, simply prefix each line with a number (any number will do &mdash; this is why the editor only uses one number.) To create an unordered list, you can prefix each line with <code>*</code>, <code>+</code> or <code>-</code>.</p> List items can contain multiple paragraphs, however each paragraph must be indented by at least 4 spaces or a tab."},{menuName:"Code Blocks",data:"<p>Markdown wraps code blocks in pre-formatted tags to preserve indentation in your code blocks. To create a code block, indent the entire block by at least 4 spaces or one tab. Markdown will strip the extra indentation you&rsquo;ve added to the code block.</p>"},{menuName:"Horizontal Rules",data:"Horizontal rules are created by placing three or more hyphens, asterisks or underscores on a line by themselves. Spaces are allowed between the hyphens, asterisks or underscores."}]},{menuName:"Span Elements",content:[{menuName:"Links",data:"<p>Markdown has two types of links: <strong>inline</strong> and <strong>reference</strong>. For both types of links, the text you want to display to the user is placed in square brackets. For example, if you want your link to display the text &ldquo;GitHub&rdquo;, you write <code>[GitHub]</code>.</p><p>To create an inline link, create a set of parentheses immediately after the brackets and write your URL within the parentheses. (e.g., <code>[GitHub](http://github.com/)</code>). Relative paths are allowed in inline links.</p><p>To create a reference link, use two sets of square brackets. <code>[my internal link][internal-ref]</code> will link to the internal reference <code>internal-ref</code>.</p>"},{menuName:"Emphasis",data:"<p>Asterisks (<code>*</code>) and underscores (<code>_</code>) are treated as emphasis and are wrapped with an <code>&lt;em&gt;</code> tag, which usually displays as italics in most browsers. Double asterisks (<code>**</code>) or double underscores (<code>__</code>) are treated as bold using the <code>&lt;strong&gt;</code> tag. To create italic or bold text, simply wrap your words in single/double asterisks/underscores. For example, <code>**My double emphasis text**</code> becomes <strong>My double emphasis text</strong>, and <code>*My single emphasis text*</code> becomes <em>My single emphasis text</em>.</p>"},{menuName:"Code",data:"<p>To create inline spans of code, simply wrap the code in backticks (<code>`</code>). Markdown will turn <code>`myFunction`</code> into <code>myFunction</code>.</p>"},{menuName:"Images",data:"<p>Markdown image syntax looks a lot like the syntax for links; it is essentially the same syntax preceded by an exclamation point (<code>!</code>). For example, if you want to link to an image at <code>http://github.com/unicorn.png</code> with the alternate text <code>My Unicorn</code>, you would write <code>![My Unicorn](http://github.com/unicorn.png)</code>.</p>"}]},{menuName:"Miscellaneous",content:[{menuName:"Automatic Links",data:'<p>If you want to create a link that displays the actual URL, markdown allows you to quickly wrap the URL in <code>&lt;</code> and <code>&gt;</code> to do so. For example, the link <a href="javascript:void(0);">http://github.com/</a> is easily produced by writing <code>&lt;http://github.com/&gt;</code>.</p>'},{menuName:"Escaping",data:"<p>If you want to use a special Markdown character in your document (such as displaying literal asterisks), you can escape the character with the backslash (<code>\\</code>). Markdown will ignore the character directly after a backslash."},{menuName:"Emoji",data:'<p>See the <a href="http://emojione.com/demo/" target="_blank">EmojiOne demo</a> for all available emoji. To include one, wrap the emoji name in colons and use underscores instead of spaces (e.g. :heart: or :point_up:).'}]}];e.GollumEditor.defineHelp("markdown",n)}(jQuery),function(e){var t={"function-bold":{replace:"'''$1'''$2"},"function-italic":{replace:"''$1''$2"},"function-hr":{append:"\n---\n"},"function-code":{replace:"<code>$1</code>$2"},"function-ol":{link:function(e,t){return"# "+t+"\n"}},"function-blockquote":{replace:"<blockquote>\n$1$2\n</blockquote>"},"function-h1":{replace:"= $1$2 ="},"function-h2":{replace:"== $1$2 =="},"function-h3":{replace:"=== $1$2 ==="},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="["+e.href+" | "+e.text+"]"),t}}};e.GollumEditor.defineLanguage("mediawiki",e.constructLanguageDefinition(t));var n=[{menuName:"Text Formatting",content:[{menuName:"Headers",data:"<p>MediaWiki headers are written with different indentation using <code>= Title =</code> (equals sign). MediaWiki supports headings 1-6.</p>"},{menuName:"Bold / Italic",data:"<p>To display text as <strong>bold</strong>, wrap the text in <code>'''</code>. To display text as <em>italic</em>, wrap the text in <code>''</code>. To create <code>monospace</code> text, wrap the text in <code>&lt;code&gt;&lt;/code&gt;</code>."},{menuName:"Special Characters",data:"<p>Use HTML special characters, e.g. <code>&copy;</code> or <code>&euro;</code></p>"}]},{menuName:"Blocks",content:[{menuName:"Paragraphs",data:"<p>MediaWiki ignores single line breaks. To start a new paragraph, leave an empty line. You can force a line break within a paragraph with the HTML tag <code><br /></code>.</p>"},{menuName:"Tables",data:'<p>Tables may be authored in wiki pages using either XHTML table elements directly, or using wikicode formatting to define the table. Wikitable syntax overview: <table cellpadding="5" cellspacing="0" border="1"><tr><td><pre> <code>{|</code></pre></td><td><b>table start</b></td></tr><tr><td><pre> <code>|+</code></pre></td><td>table <b>caption,</b> <i>optional;</i> only between <b>table start</b> and first <b>table row</b></td></tr><tr><td><pre> <code>|-</code></pre></td><td><b>table row,</b> <i>optional on first row</i> -- wiki engine assumes the first row</td></tr><tr><td><pre> <code>!</code></pre></td><td><b>table header</b> cell, <i>optional.</i> Consecutive <b>table header</b> cells may be added on same line separated by double marks (<code>!!</code>) or start on new lines, each with its own single mark (<code>!</code>).</td></tr><tr><td><pre> <code>|</code></pre></td><td><b>table data</b> cell, <i>required!</i> Consecutive <b>table data</b> cells may be added on same line separated by double marks (<code>||</code>) or start on new lines, each with its own single mark (<code>|</code>).</td></tr><tr><td><pre> <code>|}</code></pre></td><td><b>table end</b></td></tr></table></p>'}]},{menuName:"Macros",content:[{menuName:"Links",data:"<p>To create links to external pages, use single brackets, e.g. <code>[https://mediawiki.org MediaWiki]</code>. Internal links use double brackets: <code>[[Main Page]]</code>. To define the link text, use <code>[[Main Page | this is displayed]]</code> (note: the order of the URL/Page Name and the link text is reversed compared to Gollum pages in other markups).</p>"},{menuName:"Images",data:"<p>Use Gollum internal links, e.g. <code>[[sauron.jpg]]<code>, to insert images."}]}];e.GollumEditor.defineHelp("mediawiki",n)}(jQuery),function(e){var t={"function-bold":{replace:"*$1*$2"},"function-italic":{replace:"/$1/$2"},"function-code":{replace:"=$1=$2"},"function-hr":undefined,"function-blockquote":{replace:"#+BEGIN_QUOTE\n$1$2\n#+END_QUOTE"},"function-h1":{replace:"* $1$2"},"function-h2":{replace:"** $1$2"},"function-h3":{replace:"*** $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href?t="[["+e.href+"]["+e.text+"]]":e.href&&(t="[["+e.href+"]]"),t}},"function-image":{replace:function(e){var t="";return e.url&&(t="[["+e.url+"]]"),t}}};e.GollumEditor.defineLanguage("org",e.constructLanguageDefinition(t));var n=[{menuName:"Block Elements",content:[{menuName:"Paragraphs &amp; Breaks",data:"<p>To create a paragraph, simply create a block of text that is not separated by one or more blank lines. Blocks of text separated by one or more blank lines will be parsed as paragraphs.</p>"},{menuName:"Headers",data:"<p>Simply prefix your header text with the number of <code>*</code> characters to specify heading depth. For example: <code>* Header 1</code>, <code>** Header 2</code> and <code>*** Header 3</code> will be progressively smaller headers.</p>"},{menuName:"Blockquotes",data:"<p>To create a blockquote, simple embed the text between <code>#+BEGIN_QUOTE</code> and <code>#+END_QUOTE</code>. An example quote block is displayed below:<br><code>#+BEGIN_QUOTE<br>This is my quote block. Quote something nice here, otherwise there is no point in quoting.<br>#+END_QUOTE</code></p>"},{menuName:"Lists",data:"<p>Org-mode supports both ordered and unordered lists. To create an ordered list, simply prefix each line with a number (any number will do &mdash; this is why the editor only uses one number.) To create an unordered list, you can prefix each line with <code>+</code> or <code>-</code>.</p>"},{menuName:"Code Blocks",data:"<p>Code Blocks are similar to blockquote, except that <code>#+BEGIN_EXAMPLE</code> and <code>#+END_EXAMPLE</code> are used.</p>"},{menuName:"Tables",data:"<p>Org-mode supports simple tables (tables with equal number of cells in each row). To create a simple table, just separate the contents of each cell with a <code>|</code> character. For example, <br><br><code>|one|two|three|<br>|four|five|six|</code><br><br> will appear as a table with two rows and three columns. Additionally, <br><br><code>|one|two|three|<br>|---+---+-----|<br>|four|five|six|</code><br><br> will also appear as a table, but the first row will be interpreted as a header row and the <code>&lt;th&gt;</code> tag will be used to render it. </p>"}]},{menuName:"Span Elements",content:[{menuName:"Links",data:'<p>To create links to external pages, you need to enclose the URI in double square brackets. (i.e., <code>[[http://github.com/]]</code> will automatically be parsed to <a href="javascript:void(0);">http://github.com/</a>)If you want to add text, to be displayed to the user, you write the URI and the text next to each other, both enclosed in square brackets and both of them together enclosed in another pair of square brackets. For example, if you want your link to display the text &ldquo;GitHub&rdquo;, you write <code>[[http://github.com][GitHub]]</code>.</p>'},{menuName:"Emphasis",data:"<p>Forward slashes (<code>/</code>) are treated as emphasis and are wrapped with an <code>&lt;i&gt;</code> tag. Asterisks (<code>*</code>) are treated as bold using the <code>&lt;b&gt;</code> tag.</p>"},{menuName:"Code",data:"<p>To create inline spans of code, simply wrap the code in equal signs (<code>=</code>). Orgmode will turn <code>=myFunction=</code> into <code>myFunction</code>.</p>"},{menuName:"Images",data:"<p>Org-mode image syntax is exactly same as the syntax that you would use for a URI to link to itself. The image URI is enclosed in double square brackets. Alt text on images is not currently supported by Gollum's Org-mode parser.</p>"}]}];e.GollumEditor.defineHelp("org",n)}(jQuery),function(e){e.GollumEditor.defineLanguage("txt",{})}(jQuery),function(e){var t={"function-bold":{replace:"B<$1>$2"},"function-italic":{replace:"I<$1>$2"},"function-hr":undefined,"function-code":{replace:"C<$1>$2"},"function-h1":{replace:"=head1 $1$2"},"function-h2":{replace:"=head2 $1$2"},"function-h3":{replace:"=head3 $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="L<"+e.text+"|"+e.href+">"),t}},"function-image":undefined,"function-ul":undefined,"function-ol":undefined,"function-blockquote":undefined};e.GollumEditor.defineLanguage("pod",e.constructLanguageDefinition(t));var n=[{menuName:"Command Paragraphs",content:[{menuName:"Headings",data:"<p>All command paragraphs start with <code>=</code> (equals sign).</p><p>To create headings 1 through 4, begin your command paragraph with <code>=headN</code>, where <code>N</code> is the number of the heading 1 through 4. For example, to make a first-order heading (the largest possible,) write <code>=head1</code>, then on the next line begin your paragraph that you want under the heading.</p>"},{menuName:"Beginning &amp; Ending",data:"<p>Perl pod blocks should begin with <code>=pod</code> and end with <code>=cut</code>, signifying to Pod parsers that the pod block has begun and ended. These command paragraphs only signal the beginning and end of a pod block.</p>"},{menuName:"Other Formats",data:"<p>pod also allows blocks in other formats, such as HTML or plain text. To create one of these blocks, use the <code>=format SYNTAX</code> command paragraph, where <code>SYNTAX</code> is the syntax of the block (e.g. <code>html</code> or <code>txt</code>). At the end of your block, use the <code>=end SYNTAX</code> block.</p>"},{menuName:"Encoding",data:"<p>If you are having encoding troubles, use the <code>=encoding ENC_TYPE</code> command, where <code>ENC_TYPE</code> is the encoding type (e.g. <code>utf8</code>, <code>koi8-r</code>). This will affect the entire document, not just the block below the command.</p>"}]},{menuName:"Formatting",content:[{menuName:"Text",data:"<p>Formatting text as <strong>bold</strong>, <em>italic</em> or <code>code</code> works in the <code>S&lt;word&gt;</code> syntax, where <code>S</code> is an abbreviation for the type of text you are trying to create. For example, <code>B&lt;my bold text&gt;</code> becomes <strong>my bold text</strong>, <code>I&lt;italic text&gt;</code> becomes <em>italic text</em> and <code>C&lt;code here()&gt;</code> becomes <code>code here()</code>.</p>"},{menuName:"Hyperlinks",data:"<p>Writing hyperlinks in pod is much like formatting text, using the same <code>S&lt;&gt;</code> syntax. Instead of <code>B</code>, <code>I</code> or <code>C</code>, use <code>L</code> to begin a hyperlink.</p><p>pod allows you to hyperlink to a <code>man</code> page, a Perl documentation page, or another web page. To link to a <code>man</code> or Perl documentation page, simply include the page name in the link (e.g. <code>L&lt;perl(1)&gt;</code> or <code>L&lt;Net::Ping&gt;</code>). If you want to link to a web page, separate the URL and the link text with a pipe (e.g. to link to github.com, write <code>L&lt;GitHub|http://github.com/&gt;</code>)."}]}];e.GollumEditor.defineHelp("pod",n)}(jQuery),function(e){var t={"function-code":undefined,"function-h1":undefined,"function-h2":undefined,"function-h3":undefined,"function-link":undefined,"function-image":undefined,"function-hr":undefined,"function-blockquote":undefined};e.GollumEditor.defineLanguage("rdoc",e.constructLanguageDefinition(t))}(jQuery),function(e){var t=function(t,n,i){var o="";o=t.length?t:"Title here",adornment=i.repeat(o.length),o=o+"\n"+adornment+"\n",e.GollumEditor.replaceSelection(o,!1,!1,n)},n={"function-bold":{replace:"**$1**$2"},"function-italic":{replace:"*$1*$2"},"function-code":{replace:"``$1``$2"},"function-hr":{append:"\n\n----\n\n"},"function-blockquote":{exec:function(t,n){for(var i=" ",o=n.split("\n"),r=0;r<o.length;r++)o[r]=i+o[r];var s=o.join("\n");e.GollumEditor.replaceSelection(s)}},"function-h1":{symbol:"=",exec:function(e,n,i,o){t(n,o,this.symbol)}},"function-h2":{symbol:"-",exec:function(e,n,i,o){t(n,o,this.symbol)}},"function-h3":{symbol:"~",exec:function(e,n,i,o){t(n,o,this.symbol)}},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="`"+e.text+" <"+e.href+">`_"),t}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t=".. image:: "+e.url+"\n :alt: "+e.alt),t}},"gollum-helpers":{"find-header-line":function(e){var t=e-1,n=window.ace_editor.getSession().getLine(t);return t>=0&&!/^\s+$/.test(n)?[n,t]:null}}};e.GollumEditor.defineLanguage("rst",e.constructLanguageDefinition(n));var i=[{menuName:"Block Elements",content:[{menuName:"Paragraphs &amp; Breaks",data:"<p>To create a paragraph, simply create a block of text that is not separated by one or more blank lines. Blocks of text separated by one or more blank lines will be parsed as paragraphs.</p>"},{menuName:"Headers",data:"<p>Rest uses overline/underline adornments to indicate headers. To create a header, underline your header text with adornment characters such as the <code>=, ~, +, ^</code> characters. Make sure that the adornment is of the same length (or longer) as the header text. Use a different adornment character to specify a different heading depth.</p>"},{menuName:"Blockquotes",data:"<p>Rest creates blockquotes using indentation. This looks best if you use four spaces per level of indentation.</p>"},{menuName:"Lists",data:"<p>Rest supports both ordered and unordered lists. To create an ordered list, simply prefix each line with a number, or use <code>#</code> for auto enumeration. To create an unordered list, you can prefix each line with <code>*</code>, <code>+</code> or <code>-</code>.</p>"},{menuName:"Code Blocks",data:"<p>Rest wraps code blocks in pre-formatted tags to preserve indentation in your code blocks. To create a code block, indent the entire block by at least 4 spaces or one tab. Rest will strip the extra indentation you&rsquo;ve added to the code block.</p>"},{menuName:"Horizontal Rules",data:"<p>Horizontal rules are created by placing four or more hyphens, asterisks or underscores on a line by themselves.</p>"}]},{menuName:"Span Elements",content:[{menuName:"Links",data:"<p>To create an inline link, create a set of backticks, include the link title first, followed by the url in angled brackets (e.g., <code>`Python <http://www.python.org/>`_</code>).</p>"},{menuName:"Emphasis",data:"<p>Asterisks (<code>*</code>) are treated as emphasis and are wrapped with an <code>&lt;em&gt;</code> tag, which usually displays as italics in most browsers. Double asterisks (<code>**</code>) are treated as bold using the <code>&lt;strong&gt;</code> tag. To create italic or bold text, simply wrap your words in single/double asterisks. For example, <code>**My double emphasis text**</code> becomes <strong>My double emphasis text</strong>, and <code>*My single emphasis text*</code> becomes <em>My single emphasis text</em>.</p>"},{menuName:"Code",data:"<p>To create inline spans of code, simply wrap the code in backticks (<code>`</code>). Rest will turn <code>`myFunction`</code> into <code>myFunction</code>.</p>"},{menuName:"Images",data:'<p>Rest image syntax is two dots, followed by a space, the word "image", two colons, another space, and the url: <code>.. image:: http://image.com/image.png</code>.</p>'}]},{menuName:"Miscellaneous",content:[{menuName:"Escaping",data:"<p>If you want to use a special Rest character in your document (such as displaying literal asterisks), you can escape the character with the backslash (<code>\\</code>). Rest will ignore the character directly after a backslash."}]}];e.GollumEditor.defineHelp("rst",i)}(jQuery),function(e){var t={"function-hr":undefined,
24
- "function-code":{replace:"bc. $1$2",whole_line:!0},"function-ol":{line:function(e,t){return"# "+t+"\n"}},"function-blockquote":{replace:"bq. $1$2"},"function-h1":{replace:"h1. $1$2"},"function-h2":{replace:"h2. $1$2"},"function-h3":{replace:"h3. $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t='"'+e.text+'":'+e.href),t}},"function-image":{replace:function(e){var t="";if(e.url){var t="!"+e.url;return""!=e.alt&&(t+="("+e.alt+")"),t+="!"}}}};e.GollumEditor.defineLanguage("textile",e.constructLanguageDefinition(t));var n=[{menuName:"Phrase Modifiers",content:[{menuName:"Emphasis / Strength",data:"<p>To place emphasis or strength on inline text, simply place <code>_</code> (underscores) around the text for emphasis or <code>*</code> (asterisks) around the text for strength. In most browsers, <code>_mytext_</code> will appear as italics and <code>*mytext*</code> will appear as bold.</p><p>To force italics or bold, simply double the characters: <code>__mytext__</code> will appear italic and <code>**mytext**</code> will appear as bold text.</p>"},{menuName:"Citations / Editing",data:'<p>To display citations, wrap your text in <code>??</code> (two question marks).</p><p>To display edit marks such as deleted text (strikethrough) or inserted text (underlined text), wrap your text in <code>-</code> (minuses) or <code>+</code> (pluses). For example <code>-mytext-</code> will be rendered as <span style="text-decoration: line-through;">mytext</span> and <code>+mytext+</code> will be rendered as <span style="text-decoration: underline;">mytext</span></p>'},{menuName:"Superscript / Subscript",data:"<p>To display superscript, wrap your text in <code>^</code> (carets). To display subscript, wrap your text in <code>~</code> (tildes).</p>"},{menuName:"Code",data:"<p>To display monospace code, wrap your text in <code>@</code> (at symbol). For example, <code>@mytext@</code> will appear as <code>mytext</code>.</p>"},{menuName:"Acronyms",data:'<p>To create an acronym, suffix the acronym with the definition in parentheses. For example, <code>JS(JavaScript)</code> will be displayed as <abbr title="JavaScript">JS</abbr>.</p>'}]},{menuName:"Block Modifiers",content:[{menuName:"Headings",data:"<p>To display a heading in Textile, prefix your line of text with <code>hn.</code>, where <code>n</code> equals the heading size you want (1 is largest, 6 is smallest).</p>"},{menuName:"Paragraphs / Quotes",data:"<p>To create a new paragraph, prefix your first line of a block of text with <code>p.</code>.</p><p>To create a blockquote, make sure at least one blank line exists between your text and any surrounding text, and then prefix that block with <code>bq.</code> If you need to extend a blockquote to more than one text block, write <code>bq..</code> (note the two periods) and prefix your next normal paragraph with <code>p.</code></p>"},{menuName:"Code Blocks",data:"<p>Code blocks in textile are simply prefixed like any other block. To create a code block, place the beginning of the block on a separate line and prefix it with <code>bc.</code></p><p>To display a preformatted block, prefix the block with <code>pre.</code></p>"},{menuName:"Lists",data:"<p>To create ordered lists, prefix each line with <code>#</code>. To create unordered lists, prefix each line with <code>*</code>.</p>"}]},{menuName:"Links / Images",content:[{menuName:"Links",data:'<p>To display a link, put the text you want to display in quotes, then a colon (<code>:</code>), then the URL after the colon. For example <code>&quot;GitHub&quot;:http://github.com/</code> will appear as <a href="javascript:void(0);">GitHub</a>.</p>'},{menuName:"Images",data:"<p>To display an image, simply wrap the image&rsquo;s URL in <code>!</code> (exclamation points). If you want to link the image to a URL, you can blend the image and link syntax: place your image URL in the exclamation points and suffix that with a colon and your URL. For example, an image at <code>http://myurl/image.png</code> that should link to <code>http://myurl/</code> should be written as <code>!http://myurl/image.png!:http://myurl/</code>.</p>"}]}];e.GollumEditor.defineHelp("textile",n)}(jQuery);
22
+ return new i("fragment")}},u=function(){this.config={},this.dom=h};u.prototype=r.prototype;var d=function(e,t,n){var i=e.className.match(/lang-(\w+)/),o=t.mode||i&&"ace/mode/"+i[1];if(!o)return!1;var r=t.theme||"ace/theme/textmate",s="",a=[];if(e.firstElementChild)for(var c=0,h=0;h<e.childNodes.length;h++){var u=e.childNodes[h];3==u.nodeType?(c+=u.data.length,s+=u.data):a.push(c,u)}else s=e.textContent,t.trim&&(s=s.trim());d.render(s,o,r,t.firstLineNumber,!t.showGutter,function(t){l.importCssString(t.css,"ace_highlight"),e.innerHTML=t.html;for(var i=e.firstChild.firstChild,o=0;o<a.length;o+=2){var r=t.session.doc.indexToPosition(a[o]),s=a[o+1],c=i.children[r.row];c&&c.appendChild(s)}n&&n()})};d.render=function(e,t,n,i,r,s){function l(){var o=d.renderSync(e,t,n,i,r);return s?s(o):o}var c=1,h=o.prototype.$modes;"string"==typeof n&&(c++,a.loadModule(["theme",n],function(e){n=e,--c||l()}));var u;return t&&"object"==typeof t&&!t.getTokenizer&&(u=t,t=u.path),"string"==typeof t&&(c++,a.loadModule(["mode",t],function(e){h[t]&&!u||(h[t]=new e.Mode(u)),t=h[t],--c||l()})),--c||l()},d.renderSync=function(e,t,n,i,r){i=parseInt(i||1,10);var a=new o("");a.setUseWorker(!1),a.setMode(t);var l=new u;l.setSession(a),Object.keys(l.$tabStrings).forEach(function(e){if("string"==typeof l.$tabStrings[e]){var t=h.createFragment();t.textContent=l.$tabStrings[e],l.$tabStrings[e]=t}}),a.setValue(e);var c=a.getLength(),d=h.createElement("div");d.className=n.cssClass;var g=h.createElement("div");g.className="ace_static_highlight"+(r?"":" ace_show_gutter"),g.style["counter-reset"]="ace_line "+(i-1);for(var p=0;p<c;p++){var f=h.createElement("div");if(f.className="ace_line",!r){var m=h.createElement("span");m.className="ace_gutter ace_gutter-cell",m.textContent="",f.appendChild(m)}l.$renderLine(f,p,!1),f.textContent+="\n",g.appendChild(f)}return d.appendChild(g),{css:s+n.cssText,html:d.toString(),session:a}},n.exports=d,n.exports.highlight=d}),function(){ace.require(["ace/ext/static_highlight"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t){"use strict";var n=e("../lib/dom"),i=e("../lib/lang"),o=function(e,t){this.element=n.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var o=i.delayedCall(function(){this.updateStatus(e)}.bind(this)).schedule.bind(null,100);e.on("changeStatus",o),e.on("changeSelection",o),e.on("keyboardActivity",o)};(function(){this.updateStatus=function(e){function t(e,t){e&&n.push(e,t||"|")}var n=[];t(e.keyBinding.getStatusText(e)),e.commands.recording&&t("REC");var i=e.selection,o=i.lead;if(!i.isEmpty()){var r=e.getSelectionRange();t("("+(r.end.row-r.start.row)+":"+(r.end.column-r.start.column)+")"," ")}t(o.row+":"+o.column," "),i.rangeCount&&t("["+i.rangeCount+"]"," "),n.pop(),this.element.textContent=n.join("")}}).call(o.prototype),t.StatusBar=o}),function(){ace.require(["ace/ext/statusbar"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass)}),ace.define("ace/ext/textarea",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/net","ace/ace","ace/theme/textmate"],function(e,t,n){"use strict";function i(e,t){for(var n in t)e.style[n]=t[n]}function o(e,t){if("textarea"!=e.type)throw new Error("Textarea required!");var n=e.parentNode,i=document.createElement("div"),o=function(){var t="position:relative;";["margin-top","margin-left","margin-right","margin-bottom"].forEach(function(n){t+=n+":"+u(e,i,n)+";"});var n=u(e,i,"width")||e.clientWidth+"px",o=u(e,i,"height")||e.clientHeight+"px";t+="height:"+o+";width:"+n+";",t+="display:inline-block;",i.setAttribute("style",t)};for(a.addListener(window,"resize",o),o(),n.insertBefore(i,e.nextSibling);n!==document;){if("FORM"===n.tagName.toUpperCase()){var r=n.onsubmit;n.onsubmit=function(n){e.value=t(),r&&r.call(this,n)};break}n=n.parentNode}return i}function r(e,t,n,i,o){function r(e){return"true"===e||1==e}e.getSession(),e.renderer;return e.setDisplaySettings=function(t){null==t&&(t="none"==n.style.display),t?(n.style.display="block",n.hideButton.focus(),e.on("focus",function t(){e.removeListener("focus",t),n.style.display="none"})):e.focus()},e.$setOption=e.setOption,e.$getOption=e.getOption,e.setOption=function(t,n){switch(t){case"mode":e.$setOption("mode","ace/mode/"+n);break;case"theme":e.$setOption("theme","ace/theme/"+n);break;case"keybindings":switch(n){case"vim":e.setKeyboardHandler("ace/keyboard/vim");break;case"emacs":e.setKeyboardHandler("ace/keyboard/emacs");break;default:e.setKeyboardHandler(null)}break;case"wrap":case"fontSize":e.$setOption(t,n);break;default:e.$setOption(t,r(n))}},e.getOption=function(t){switch(t){case"mode":return e.$getOption("mode").substr("ace/mode/".length);case"theme":return e.$getOption("theme").substr("ace/theme/".length);case"keybindings":var n=e.getKeyboardHandler();switch(n&&n.$id){case"ace/keyboard/vim":return"vim";case"ace/keyboard/emacs":return"emacs";default:return"ace"}break;default:return e.$getOption(t)}},e.setOptions(o),e}function s(e,n,i){function o(e,t,n,i){if(!n)return void e.push("<input type='checkbox' title='",t,"' ",i+""=="true"?"checked='true'":"","'></input>");e.push("<select title='"+t+"'>");for(var o in n)e.push("<option value='"+o+"' "),i==o&&e.push(" selected "),e.push(">",n[o],"</option>");e.push("</select>")}var r=null,s={mode:"Mode:",wrap:"Soft Wrap:",theme:"Theme:",fontSize:"Font Size:",showGutter:"Display Gutter:",keybindings:"Keyboard",showPrintMargin:"Show Print Margin:",useSoftTabs:"Use Soft Tabs:",showInvisibles:"Show Invisibles"},l={mode:{text:"Plain",javascript:"JavaScript",xml:"XML",html:"HTML",css:"CSS",scss:"SCSS",python:"Python",php:"PHP",java:"Java",ruby:"Ruby",c_cpp:"C/C++",coffee:"CoffeeScript",json:"json",perl:"Perl",clojure:"Clojure",ocaml:"OCaml",csharp:"C#",haxe:"haXe",svg:"SVG",textile:"Textile",groovy:"Groovy",liquid:"Liquid",Scala:"Scala"},theme:{clouds:"Clouds",clouds_midnight:"Clouds Midnight",cobalt:"Cobalt",crimson_editor:"Crimson Editor",dawn:"Dawn",gob:"Green on Black",eclipse:"Eclipse",idle_fingers:"Idle Fingers",kr_theme:"Kr Theme",merbivore:"Merbivore",merbivore_soft:"Merbivore Soft",mono_industrial:"Mono Industrial",monokai:"Monokai",pastel_on_dark:"Pastel On Dark",solarized_dark:"Solarized Dark",solarized_light:"Solarized Light",textmate:"Textmate",twilight:"Twilight",vibrant_ink:"Vibrant Ink"},showGutter:r,fontSize:{"10px":"10px","11px":"11px","12px":"12px","14px":"14px","16px":"16px"},wrap:{off:"Off",40:"40",80:"80",free:"Free"},keybindings:{ace:"ace",vim:"vim",emacs:"emacs"},showPrintMargin:r,useSoftTabs:r,showInvisibles:r},c=[];c.push("<table><tr><th>Setting</th><th>Value</th></tr>");for(var h in t.defaultOptions)c.push("<tr><td>",s[h],"</td>"),c.push("<td>"),o(c,h,l[h],i.getOption(h)),c.push("</td></tr>");c.push("</table>"),e.innerHTML=c.join("");for(var u=function(e){var t=e.currentTarget;i.setOption(t.title,t.value)},d=function(e){var t=e.currentTarget;i.setOption(t.title,t.checked)},g=e.getElementsByTagName("select"),p=0;p<g.length;p++)g[p].onchange=u;for(var f=e.getElementsByTagName("input"),p=0;p<f.length;p++)f[p].onclick=d;var m=document.createElement("input");m.type="button",m.value="Hide",a.addListener(m,"click",function(){i.setDisplaySettings(!1)}),e.appendChild(m),e.hideButton=m}var a=e("../lib/event"),l=e("../lib/useragent"),c=e("../lib/net"),h=e("../ace");e("../theme/textmate"),n.exports=t=h;var u=function(e,t,n){var i=e.style[n];return i||(i=window.getComputedStyle?window.getComputedStyle(e,"").getPropertyValue(n):e.currentStyle[n]),i&&"auto"!=i&&"intrinsic"!=i||(i=t.style[n]),i};t.transformTextarea=function(e,n){var c,u=e.autofocus||document.activeElement==e,d=o(e,function(){return c.getValue()});e.style.display="none",d.style.background="white";var g=document.createElement("div");i(g,{top:"0px",left:"0px",right:"0px",bottom:"0px",border:"1px solid gray",position:"absolute"}),d.appendChild(g);var p=document.createElement("div");i(p,{position:"absolute",right:"0px",bottom:"0px",cursor:"nw-resize",border:"solid 9px",borderColor:"lightblue gray gray #ceade6",zIndex:101});var f=document.createElement("div"),m={top:"0px",left:"20%",right:"0px",bottom:"0px",position:"absolute",padding:"5px",zIndex:100,color:"white",display:"none",overflow:"auto",fontSize:"14px",boxShadow:"-5px 2px 3px gray"};l.isOldIE?m.backgroundColor="#333":m.backgroundColor="rgba(0, 0, 0, 0.6)",i(f,m),d.appendChild(f),n=n||t.defaultOptions;var v=h.edit(g);c=v.getSession(),c.setValue(e.value||e.innerHTML),u&&v.focus(),d.appendChild(p),r(v,g,f,h,n),s(f,p,v);var b="";return a.addListener(p,"mousemove",function(e){var t=this.getBoundingClientRect();e.clientX-t.left+(e.clientY-t.top)<(t.width+t.height)/2?(this.style.cursor="pointer",b="toggle"):(b="resize",this.style.cursor="nw-resize")}),a.addListener(p,"mousedown",function(e){if(e.preventDefault(),"toggle"==b)return void v.setDisplaySettings();d.style.zIndex=1e5;var t=d.getBoundingClientRect(),n=t.width+t.left-e.clientX,i=t.height+t.top-e.clientY;a.capture(p,function(e){d.style.width=e.clientX-t.left+n+"px",d.style.height=e.clientY-t.top+i+"px",v.resize()},function(){})}),v},t.defaultOptions={mode:"javascript",theme:"textmate",wrap:"off",fontSize:"12px",showGutter:"false",keybindings:"ace",showPrintMargin:"false",useSoftTabs:"true",showInvisibles:"false"}}),function(){ace.require(["ace/ext/textarea"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/ext/themelist",["require","exports","module"],function(e,t){"use strict";var n=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub"],["IPlastic"],["Solarized Light"],["TextMate"],["Tomorrow"],["XCode"],["Kuroir"],["KatzenMilch"],["SQL Server","sqlserver","light"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Dracula","","dark"],["Cobalt","cobalt","dark"],["Gruvbox","gruvbox","dark"],["Green on Black","gob","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"]];t.themesByName={},t.themes=n.map(function(e){var n=e[1]||e[0].replace(/ /g,"_").toLowerCase(),i={caption:e[0],theme:"ace/theme/"+n,isDark:"dark"==e[2],name:n};return t.themesByName[n]=i,i})}),function(){ace.require(["ace/ext/themelist"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}(),ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,t){"use strict";var n=e("../lib/lang");t.$detectIndentation=function(e){function t(e){for(var t=0,i=e;i<n.length;i+=e)t+=n[i]||0;return t}for(var n=[],i=[],o=0,r=0,s=Math.min(e.length,1e3),a=0;a<s;a++){var l=e[a];if(/^\s*[^*+\-\s]/.test(l)){if("\t"==l[0])o++,r=-Number.MAX_VALUE;else{var c=l.match(/^ */)[0].length;if(c&&"\t"!=l[c]){var h=c-r;h>0&&!(r%h)&&!(c%h)&&(i[h]=(i[h]||0)+1),n[c]=(n[c]||0)+1}r=c}for(;a<s&&"\\"==l[l.length-1];)l=e[a++]}}for(var u=i.reduce(function(e,t){return e+t},0),d={score:0,length:0},g=0,a=1;a<12;a++){var p=t(a);1==a?(g=p,p=n[1]?.9:.8,n.length||(p=0)):p/=g,i[a]&&(p+=i[a]/u),p>d.score&&(d={score:p,length:a})}if(d.score&&d.score>1.4)var f=d.length;return o>g+1?((1==f||g<o/4||d.score<1.8)&&(f=undefined),{ch:"\t",length:f}):g>o+1?{ch:" ",length:f}:void 0},t.detectIndentation=function(e){var n=e.getLines(0,1e3),i=t.$detectIndentation(n)||{};return i.ch&&e.setUseSoftTabs(" "==i.ch),i.length&&e.setTabSize(i.length),i},t.trimTrailingSpace=function(e,t){var n=e.getDocument(),i=n.getAllLines(),o=t&&t.trimEmpty?-1:0,r=[],s=-1;t&&t.keepCursorPosition&&(e.selection.rangeCount?e.selection.rangeList.ranges.forEach(function(e,t,n){var i=n[t+1];i&&i.cursor.row==e.cursor.row||r.push(e.cursor)}):r.push(e.selection.getCursor()),s=0);for(var a=r[s]&&r[s].row,l=0,c=i.length;l<c;l++){var h=i[l],u=h.search(/\s+$/);l==a&&(u<r[s].column&&u>o&&(u=r[s].column),s++,a=r[s]?r[s].row:-1),u>o&&n.removeInLine(l,u,h.length)}},t.convertIndentation=function(e,t,i){var o=e.getTabString()[0],r=e.getTabSize();i||(i=r),t||(t=o);for(var s="\t"==t?t:n.stringRepeat(t,i),a=e.doc,l=a.getAllLines(),c={},h={},u=0,d=l.length;u<d;u++){var g=l[u],p=g.match(/^\s*/)[0];if(p){var f=e.$getStringScreenWidth(p)[0],m=Math.floor(f/r),v=f%r,b=c[m]||(c[m]=n.stringRepeat(s,m));(b+=h[v]||(h[v]=n.stringRepeat(" ",v)))!=p&&(a.removeInLine(u,0,p.length),a.insertInLine({row:u,column:0},b))}}e.setTabSize(i),e.setUseSoftTabs(" "==t)},t.$parseStringArg=function(e){var t={};/t/.test(e)?t.ch="\t":/s/.test(e)&&(t.ch=" ");var n=e.match(/\d+/);return n&&(t.length=parseInt(n[0],10)),t},t.$parseArg=function(e){return e?"string"==typeof e?t.$parseStringArg(e):"string"==typeof e.text?t.$parseStringArg(e.text):e:{}},t.commands=[{name:"detectIndentation",description:"Detect indentation from content",exec:function(e){t.detectIndentation(e.session)}},{name:"trimTrailingSpace",description:"Trim trailing whitespace",exec:function(e,n){t.trimTrailingSpace(e.session,n)}},{name:"convertIndentation",description:"Convert indentation to ...",exec:function(e,n){var i=t.$parseArg(n);t.convertIndentation(e.session,i.ch,i.length)}},{name:"setIndentation",description:"Set indentation",exec:function(e,n){var i=t.$parseArg(n);i.length&&e.session.setTabSize(i.length),i.ch&&e.session.setUseSoftTabs(" "==i.ch)}}]}),function(){ace.require(["ace/ext/whitespace"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)})}();var GollumTagStart={token:"support.function",regex:"\\[\\[[^\\]]*\\]\\]",next:"start"},UMLBlock=[{token:"support.function",regex:"^\\@enduml$",next:"start"},{defaultToken:"support.function"}],UMLStart={token:"support.function",regex:"^(?:[ \\t]*)\\@startuml$",next:"umlblock"},GithubCodeBlock=[{token:"support.function",regex:".*",onMatch:function(e,t,n){var i=n[2][0],o=n[2][1],r=/^( {0,3})(~~[~]+|```)\s*$/.exec(e);return r&&r[2].length>=i&&r[2].charAt(0)==o?(n.splice(0,3),this.next=n.shift(),this.token):(this.next="",this.token)}},{defaultToken:"support.function"}],startCodeBlockMatch=function(e,t,n){var i=new RegExp(this.regex).exec(e);return n.unshift("githubblock",[],[i[2].length,i[2].charAt(0)],t),this.token},GollumCodeStart={token:"support.function",regex:"^( {0,3})(```)[^`]*$",onMatch:startCodeBlockMatch,next:"githubblock"},MarkdownCodeStart={token:"support.function",regex:"^( {0,3})(~~[~]+)[^`~]*$",onMatch:startCodeBlockMatch,next:"githubblock"};ace.define("GollumRstHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/rst_highlight_rules").RSTHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumAsciidocHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/asciidoc_highlight_rules").AsciidocHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumTextileHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/textile_highlight_rules").TextileHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumTextHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/text_highlight_rules").TextHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumRdocHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/rdoc_highlight_rules").RDocHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),ace.define("GollumMarkdownHighlightRules",[],function(e,t){"use strict";var n=e("ace/lib/oop"),i=e("ace/mode/markdown_highlight_rules").MarkdownHighlightRules,o=function(){var e=new i;this.$rules=e.getRules(),this.$rules.start=this.$rules.start.filter(function(e){return!("githubblock"==e.next)}),this.$rules.start.unshift(GollumTagStart),this.$rules.start.unshift(UMLStart),this.$rules.start.unshift(GollumCodeStart),this.$rules.start.unshift(MarkdownCodeStart),this.addRules({githubblock:GithubCodeBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.addRules({umlblock:UMLBlock}),null!=this.$rules.listblock&&this.$rules.listblock.unshift(GollumTagStart),this.normalizeRules()};n.inherits(o,i),t.GollumHighlightRules=o}),function(e){var t={asciidoc:{mode:"asciidoc",highlighter:"GollumAsciidocHighlightRules"},creole:{mode:"text",highlighter:"GollumTextHighlightRules"},markdown:{mode:"markdown",highlighter:"GollumMarkdownHighlightRules"},mediawiki:{mode:"text",highlighter:"GollumTextHighlightRules"},bib:{mode:"latex"},org:{mode:"text",highlighter:"GollumTextHighlightRules"},rst:{mode:"rst",highlighter:"GollumRstHighlightRules"},txt:{mode:"text"},pod:{mode:"text",highlighter:"GollumTextHighlightRules"},rdoc:{mode:"rdoc",highlighter:"GollumRdocHighlightRules"},textile:{mode:"textile",highlighter:"GollumTextileHighlightRules"}};e.getEditorMode=function(e){var n=null;if(n=t[e]){var i=n.mode,o=n.highlighter;if(o){var r=ace.require("ace/mode/"+i).Mode,s=new r;return s.HighlightRules=ace.require(o).GollumHighlightRules,s}return"ace/mode/"+i}return null}}(jQuery),function(e){function t(e){return new RegExp("^[^A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02b8\u0300-\u0590\u0800-\u1fff\u2c00-\ufb1c\ufdfe-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]").test(e)}function n(e){window.ace_editor.session.$bidiHandler.$isRtl=e,window.ace_editor.session.$bidiHandler.updateBidiMap(),window.ace_editor.renderer.updateFull()}function i(){s&&clearTimeout(s),e("#gollum-saved-msg").text("Saving..."),s=setTimeout(function(){localStorage.setItem(a,window.ace_editor.getSession().getValue()),e("#gollum-editor-header, #gollum-editor-footer, #gollum-editor-sidebar").each(function(e,t){var n=a+t.id.replace("gollum-editor-","_");localStorage.setItem(n,t.value)}),e("#gollum-saved-msg").text("Saved recovery text")},2e3)}var o={MarkupType:"markdown",EditorMode:"code",NewFile:!1,HasFunctionBar:!0,Debug:!1,NoDefinitionsFor:[]},r={},s=null,a="gollum_autorecover_"+window.location;e.GollumEditor=function(s){if(r=e.extend(o,s),e('textarea[id="gollum-editor-body"]').each(function(){var o=e(this),s=o.attr("data-markup-lang")?o.attr("data-markup-lang"):"markdown",l=e("<div>",{position:"absolute",height:o.height(),"class":o.attr("class"),id:"gollum-editor-body-ace"}).insertAfter(o);o.css("display","none");var c=ace.edit(l[0],{rtlText:!0});window.ace_editor=c;var h=localStorage.getItem(a);h&&(e("#gollum-autorecover-button").click(function(t){c.getSession().setValue(h),["header","footer","sidebar"].forEach(function(t){var n=localStorage.getItem(a+"_"+t);n&&e("#gollum-editor-"+t).val(n)}),e("#gollum-autorecover-msg")[0].hidden=!0,t.preventDefault()}),e("#gollum-autorecover-msg")[0].hidden=!1),c.setTheme("ace/theme/tomorrow"),c.setKeyboardHandler(),c.renderer.setShowGutter(!1),c.getSession().setUseWrapMode(!0),c.getSession().setValue(o.val()),c.getSession().setMode(e.getEditorMode(s)),c.getSession().on("change",function(){o.val(c.getSession().getValue()),i()}),e("#gollum-editor-header, #gollum-editor-footer, #gollum-editor-sidebar").on("change keyup paste",i),t(c.getSession().getLine(0))&&n(!0),c.commands.addCommand({name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e){ace.config.loadModule("ace/ext/keybinding_menu",function(t){t.init(e),e.showKeyboardShortcuts()})}}),r.commands&&e.each(r.commands,function(e,t){c.commands.addCommand(t)})}),e("#gollum-editor-body-ace").resize(function(){window.ace_editor.resize()}),e("#wiki_format").change(function(){var t=e(this).val(),n=window.ace_editor;window.ace_editor.getSession().setMode(e.getEditorMode(t)),d.updateCommitMessage(t),n.focus()}),e("#keybinding").change(function(){var t=e(this).val(),n=window.ace_editor;"default"==t?n.setKeyboardHandler():"vim"==t||"emacs"==t?n.setKeyboardHandler("ace/keyboard/"+t):n.setKeyboardHandler(),n.focus()}),e("#gollum-editor-submit, #gollum-editor-cancel").click(function(){var e="gollum_autorecover_"+window.location;localStorage.removeItem(e),["header","footer","sidebar"].forEach(function(t){localStorage.removeItem(e+"_"+t)})}),l("GollumEditor loading"),h.baseEditorMarkup()){if(h.titleDisplayed()&&e("#gollum-editor-title-field").addClass("active"),h.editSummaryMarkup()&&(e.GollumEditor.Placeholder.add(e("#gollum-editor-edit-summary input")),e('#gollum-editor form[name="gollum-editor"]').submit(function(t){t.preventDefault(),l("submitting"),e(this).unbind("submit"),e(this).submit()})),h.collapsibleInputs()&&e("#gollum-editor .collapsed button.collapsable, #gollum-editor .expanded button.collapsable").click(function(t){t.preventDefault(),e(this).parent().toggleClass("expanded"),e(this).parent().toggleClass("collapsed"),buttons=e(this).parent().children("button"),hidden_button=buttons.filter(":hidden")[0],shown_button=buttons.not(":hidden")[0],hidden_button.hidden=!1,shown_button.hidden=!0}),h.previewButton()){e("#gollum-editor #gollum-editor-preview").click(function(){var t=e("#gollum-editor form").attr("action"),n=e(e("#gollum-editor form").get(0));n.attr("action",this.href||routePath("preview")),n.attr("target","_blank");var i=window.location.pathname.split("/");return n.attr("page",i[i.length-1]||""),n.submit(),n.attr("action",t),n.removeAttr("target"),!1})}if(h.functionBar()){var u=e("#gollum-editor-body").attr("data-markup-lang");u&&(r.MarkupType=u),c.setActiveLanguage(r.MarkupType),h.formatSelector()&&d.init(e("#wiki_format")),h.dir()&&e("#function-text-direction").click(function(e){e.preventDefault(),n(!window.ace_editor.session.$bidiHandler.$isRtl)}),h.help()&&(e("#gollum-editor-help").hide(),e("#gollum-editor-help").removeClass("jaws"))}if(r.section&&e.markupSupportsEditableSections(r.MarkupType)){var g=e.findSection(r.section,c.getDefinitionFor("gollum-helpers"));g&&(window.ace_editor.gotoLine(g+1,0,animate=!1),window.ace_editor.scrollToLine(g,center=!1,animate=!1),window.ace_editor.focus())}if(h.dragDropUpload()){var p=e("#gollum-editor-body-ace"),f=e("#gollum-editor-body-ace")[0];f.ondragover=function(){return p.addClass("dragging"),!1},f.ondragleave=function(){return p.removeClass("dragging"),!1},f.ondrop=function(t){l("dropped file"),t.preventDefault(),p.removeClass("dragging").addClass("uploading");var n=t.dataTransfer.files[0],i=new FormData;return i.append("file",n),e.ajax({url:routePath("upload_file"),data:i,cache:!1,contentType:!1,processData:!1,type:"POST",success:function(){p.removeClass("uploading");var e=n.name.split(".").pop().toLowerCase(),t=["jpg","jpeg","tif","tiff","png","gif","svg","bmp"];if(uploadDest=uploadDest.replace(/%20/g," "),t.indexOf(e)>-1)var i="[[/"+uploadDest+"/"+n.name+"]]";else var i="[["+n.name+"|/"+uploadDest+"/"+n.name+"]]";window.ace_editor.insert(i)},error:function(e,t,n){409==e.status?alert("This file already exists."):alert("Error uploading file: "+t+" "+n),p.removeClass("uploading")}}),!1}}}},e.GollumEditor.defineLanguage=function(e,t){"object"==typeof t?c.define(e,t):l("GollumEditor.defineLanguage: definition for "+e+" is not an object")};var l=function(e){r.Debug&&"undefined"!=typeof console&&console.log(e)},c={_ACTIVE_LANG:"",_LOADED_LANGS:[],_LANG:{},define:function(t,n){if(c._ACTIVE_LANG=t,c._LOADED_LANGS.push(t),"object"==typeof e.GollumEditor.WikiLanguage){var i={};e.extend(i,e.GollumEditor.WikiLanguage,n),c._LANG[t]=i}else c._LANG[t]=n},getActiveLanguage:function(){return c._ACTIVE_LANG},setActiveLanguage:function(e){function t(e){return function(){var t=c.getDefinitionFor(e);"object"==typeof t&&u.executeAction(t)}}null!=c._ACTIVE_LANG&&c._ACTIVE_LANG.length<=0&&d.updateCommitMessage(e),c.getHookFunctionFor("deactivate")&&c.getHookFunctionFor("deactivate")(),c.isLoadedFor(e)?(c._ACTIVE_LANG=e,u.refresh(),c.getHookFunctionFor("activate")&&c.getHookFunctionFor("activate")()):(c._ACTIVE_LANG=null,h.functionBar()&&u.refresh(),c.isValid()&&h.formatSelector()&&d.updateSelected(),c.getHookFunctionFor("activate")&&c.getHookFunctionFor("activate")()),window.ace_editor.commands.addCommand({name:"header-1",bindKey:{win:"Ctrl-1",mac:"Command-1"},exec:t("function-h1")}),window.ace_editor.commands.addCommand({name:"header-2",bindKey:{win:"Ctrl-2",mac:"Command-2"},exec:t("function-h2")}),window.ace_editor.commands.addCommand({name:"header-3",bindKey:{win:"Ctrl-3",mac:"Command-3"},exec:t("function-h3")}),window.ace_editor.commands.addCommand({name:"bold-text",bindKey:{win:"Ctrl-b",mac:"Command-b"},exec:t("function-bold")}),window.ace_editor.commands.addCommand({name:"italic-text",bindKey:{win:"Ctrl-i",mac:"Command-i"},exec:t("function-italic")})},getHookFunctionFor:function(e,t){return t||(t=c._ACTIVE_LANG),c.isLoadedFor(t)&&c._LANG[t][e]&&"function"==typeof c._LANG[t][e]?c._LANG[t][e]:null},getDefinitionFor:function(e,t){return t||(t=c._ACTIVE_LANG),c.isLoadedFor(t)&&c._LANG[t][e]&&"object"==typeof c._LANG[t][e]?c._LANG[t][e]:null},isLoadedFor:function(e){if(0===c._LOADED_LANGS.length)return!1;for(var t=0;t<c._LOADED_LANGS.length;t++)if(c._LOADED_LANGS[t]==e)return!0;return!1},isValid:function(){return c._ACTIVE_LANG&&"object"==typeof c._LANG[c._ACTIVE_LANG]}},h={baseEditorMarkup:function(){return e("#gollum-editor").length&&e("#gollum-editor-body").length},collapsibleInputs:function(){return e("#gollum-editor .collapsed, #gollum-editor .expanded").length},formatSelector:function(){return e("#wiki_format").length},functionBar:function(){return r.HasFunctionBar&&e("#gollum-editor-function-bar").length},ff4Environment:function(){return new RegExp(/Firefox\/4.0b/).test(navigator.userAgent)},editSummaryMarkup:function(){return e("input#gollum-editor-message-field").length>0},help:function(){return e("#gollum-editor #gollum-editor-help").length&&e("#gollum-editor #function-help").length},dir:function(){return e("#gollum-editor #function-text-direction").length},previewButton:function(){return e("#gollum-editor #gollum-editor-preview").length},titleDisplayed:function(){return r.NewFile},dragDropUpload:function(){return e("#gollum-editor.uploads-allowed").length}},u={isActive:!1,activate:function(){l("Activating function bar"),e("#gollum-editor-function-bar button.function-button").each(function(){c.getDefinitionFor(e(this).attr("id"))?(e(this).click(u.evtFunctionButtonClick),e(this).attr("disabled",!1)):["function-help","function-text-direction"].includes(e(this).attr("id"))||e(this).attr("disabled",!0)}),e("#gollum-editor-function-bar").addClass("active"),u.isActive=!0},deactivate:function(){e("#gollum-editor-function-bar button.function-button").not("#function-text-direction").unbind("click"),e("#gollum-editor-function-bar").removeClass("active"),u.isActive=!1},evtFunctionButtonClick:function(t){t.preventDefault();var n=c.getDefinitionFor(e(this).attr("id"));"object"==typeof n&&u.executeAction(n)},executeAction:function(t){var n=window.ace_editor,i=n.getValue(),o=!1,r=!1,s=n.getSelectionRange(),a=n.getSelectedText(),c=a.length,h=!1;if(""==a)if(t.whole_line&&1==t.whole_line){h=!0;var u=s.start.row;a=n.session.getLine(u);var d=ace.require("ace/range").Range;s=new d(u,0,u,a.length)
23
+ }else t.break_line&&1==t.break_line&&(o=!0,r=!0);else t.break_line&&1==t.break_line&&(o=!0,r=!0);var g=a;if(t.exec&&"function"==typeof t.exec)return void t.exec(i,a,e("#gollum-editor-body"),s);var p=/([^\n]+)/gi;if(t.search&&"object"==typeof t.search&&(l("Replacing search Regex"),p=null,p=new RegExp(t.search),l(p)),l('repText is "'+g+'"'),t.replace&&"string"==typeof t.replace){l("Running replacement - using "+t.replace);var f=t.replace;g=escape(g),g=g.replace(p,f),g=g.replace(/\$[\d]/g,""),g=unescape(g),""===g&&(l("Search string is empty"),g=f.replace(/\$[\d]/g,""));var m=undefined;if(0==h){repPosition=f.indexOf("$1"),-1==repPosition&&(repPosition=Math.floor(f.length/2));var v=f.substring(0,repPosition),b=v.split("\n").length-1,w=repPosition;b>0&&(w-=v.lastIndexOf("\n")),w+=c,m=[b,w]}}t.append&&"string"==typeof t.append&&(g+=t.append),g&&e.GollumEditor.replaceSelection(g,o,r,s,m)},isShown:function(){return e("#gollum-editor-function-bar").is(":visible")},refresh:function(){h.functionBar()&&(l("Refreshing function bar"),c.isValid()?(u.deactivate(),u.activate(),g&&g.setActiveHelp(c.getActiveLanguage())):(l("Language definition is invalid."),u.isShown()&&u.deactivate(),g.isShown()&&g.hide()))}},d={$_SELECTOR:null,evtChangeFormat:function(){var t=e(this).val();d.updateCommitMessage(t),c.setActiveLanguage(t)},updateCommitMessage:function(e){var t=document.getElementById("gollum-editor-message-field"),n=t.value;/^(?:created|updated)/i.test(n)&&(t.value=n.replace(/\([^\)]*\)$/,"("+e+")"))},init:function(e){l("Initializing format selector"),d.$_SELECTOR&&"object"==typeof d.$_SELECTOR&&d.$_SELECTOR.unbind("change"),d.$_SELECTOR=e,d.updateSelected(),d.$_SELECTOR.change(d.evtChangeFormat)},updateSelected:function(){var e=c.getActiveLanguage();d.$_SELECTOR.val(e)}},g={_ACTIVE_HELP:"",_LOADED_HELP_LANGS:[],_HELP:{},define:function(t,n){g.isValidHelpFormat(n)?(l("help is a valid format"),g._ACTIVE_HELP_LANG=t,g._LOADED_HELP_LANGS.push(t),g._HELP[t]=n,e("#function-help").length&&(e("#function-help").attr("disabled")&&e("#function-help").attr("disabled",!1),e("#function-help").unbind("click"),e("#function-help").click(g.evtHelpButtonClick),g.generateHelpMenuFor(t),e("#gollum-editor-help").length&&void 0!==e("#gollum-editor-help").attr("data-autodisplay")&&"true"===e("#gollum-editor-help").attr("data-autodisplay")&&g.show())):e("#function-help").length&&e("#function-help").attr("disabled",!0)},generateHelpMenuFor:function(t){if(!g._HELP[t])return l("Help is not defined for "+t.toString()),!1;var n=g._HELP[t];e("#gollum-editor-help-parent").html(""),e("#gollum-editor-help-list").html(""),e("#gollum-editor-help-content").html("");for(var i=0;i<n.length&&"object"==typeof n[i];i++){var o=e('<li><a href="#" rel="'+i+'">'+n[i].menuName+"</a></li>");e("#gollum-editor-help-parent").append(o),0===i&&o.children("a").addClass("selected"),o.children("a").click(g.evtParentMenuClick)}g.generateSubMenu(n[0],0),e(e("#gollum-editor-help-list li a").get(0)).click()},generateSubMenu:function(t,n){e("#gollum-editor-help-list").html(""),e("#gollum-editor-help-content").html("");for(var i=0;i<t.content.length&&"object"==typeof t.content[i];i++){var o=e('<li><a href="#" rel="'+n+":"+i+'">'+t.content[i].menuName+"</a></li>");e("#gollum-editor-help-list").append(o),o.children("a").click(g.evtSubMenuClick)}},hide:function(){e.browser.msie?e("#gollum-editor-help").css("display","none"):e("#gollum-editor-help").animate({opacity:0},200,function(){e("#gollum-editor-help").animate({height:"hide"},200)})},show:function(){e.browser.msie?e("#gollum-editor-help").css("display","block"):e("#gollum-editor-help").animate({height:"show"},200,function(){e("#gollum-editor-help").animate({opacity:1},300)})},showHelpFor:function(t,n){var i=g._HELP[g._ACTIVE_HELP_LANG][t].content[n].data;e("#gollum-editor-help-content").html(i)},isLoadedFor:function(e){for(var t=0;t<g._LOADED_HELP_LANGS.length;t++)if(e==g._LOADED_HELP_LANGS[t])return!0;return!1},isShown:function(){return e("#gollum-editor-help").is(":visible")},isValidHelpFormat:function(e){return"object"==typeof e&&e.length&&"string"==typeof e[0].menuName&&"object"==typeof e[0].content&&e[0].content.length},setActiveHelp:function(t){g.isLoadedFor(t)?(g._ACTIVE_HELP_LANG=t,e("#function-help").length&&(e("#function-help").attr("disabled")&&e("#function-help").attr("disabled",!1),e("#function-help").unbind("click"),e("#function-help").click(g.evtHelpButtonClick),g.generateHelpMenuFor(t))):(e("#function-help").length&&e("#function-help").attr("disabled",!0),g.isShown()&&g.hide())},evtHelpButtonClick:function(t){t.preventDefault(),g.isShown()?(e("#gollum-editor-help").length&&"undefined"!==e("#gollum-editor-help").attr("data-autodisplay")&&"true"===e("#gollum-editor-help").attr("data-autodisplay")&&(e.post("/wiki/help?_method=delete"),e("#gollum-editor-help").attr("data-autodisplay","")),g.hide()):g.show()},evtParentMenuClick:function(t){if(t.preventDefault(),!e(this).hasClass("selected")){var n=e(this).attr("rel"),i=g._HELP[g._ACTIVE_HELP_LANG][n];e("#gollum-editor-help-parent li a").removeClass("selected"),e(this).addClass("selected"),g.generateSubMenu(i,n),e(e("#gollum-editor-help-list li a").get(0)).click()}},evtSubMenuClick:function(t){if(t.preventDefault(),!e(this).hasClass("selected")){var n=e(this).attr("rel").split(":");e("#gollum-editor-help-list li a").removeClass("selected"),e(this).addClass("selected"),g.showHelpFor(n[0],n[1])}}};e.GollumEditor.defineHelp=g.define,e.GollumEditor.Dialog=e.GollumDialog,e.GollumEditor.replaceSelection=function(e,t,n,i,o){var r=window.ace_editor,s=0;if(i==undefined)var i=r.selection.getRange();if(1==t){var a=r.session.doc.getLine(i.start.row-1);i.start.column>0?(e="\n\n"+e,s=2):""!=a&&(e="\n"+e,s=1)}if(1==n){var l=r.session.doc.getLine(i.end.row+1);i.end.column<r.session.doc.getLine(i.end.row).length?e+="\n\n":""!=l&&(e+="\n")}r.session.replace(i,e),o!=undefined&&(totalVerticalOffset=o[0]+s+i.start.row,totalHorizontalOffset=o[1]+i.start.column,r.navigateTo(totalVerticalOffset,totalHorizontalOffset)),r.focus()},e.GollumEditor.Placeholder=e.GollumPlaceholder}(jQuery),function(e){e.constructLanguageDefinition=function(t){var n=e.extend(!0,{},e.DefaultLang,t);return Object.keys(t).forEach(function(e){"undefined"==typeof t[e]&&delete n[e]}),n};var t=function(t,n,i){e.GollumEditor.Dialog.init({title:t,fields:n,OK:function(t){e.GollumEditor.replaceSelection(i(t))}})};e.DefaultLang={"function-bold":{search:/([^\n]+)([\n\s]*)/g,replace:"**$1**$2"},"function-italic":{search:/([^\n]+)([\n\s]*)/g,replace:"_$1_$2"},"function-code":{search:/([^\n]+)([\n\s]*)/g,replace:"`$1`$2"},"function-hr":{append:"\n***\n"},"function-ul":{exec:function(t,n){for(var i="",o=n.split("\n"),r=0;r<o.length;r++)i+="* "+o[r]+"\n";i=i.substring(0,i.length-1),e.GollumEditor.replaceSelection(i,!0,!0)}},"function-ol":{line:function(e,t){return e.toString()+". "+t+"\n"},exec:function(t,n){for(var i="",o=n.split("\n"),r=0;r<o.length;r++)i+=this.line(r+1,o[r]);i=i.substring(0,i.length-1),e.GollumEditor.replaceSelection(i,!0,!0)}},"function-blockquote":{search:/(.+)([\n]?)/g,replace:"> $1$2",break_line:!0},"function-h1":{search:/(.+)([\n]?)/g,replace:"# $1$2",break_line:!0,whole_line:!0},"function-h2":{search:/(.+)([\n]?)/g,replace:"## $1$2",break_line:!0,whole_line:!0},"function-h3":{search:/(.+)([\n]?)/g,replace:"### $1$2",break_line:!0,whole_line:!0},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="["+e.text+"]("+e.href+")"),t},exec:function(e,n){t("Insert Link",[{id:"text",name:"Link Text",type:"text",defaultValue:n},{id:"href",name:"URL",type:"text"}],this.replace)}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t="!["+e.alt+"]("+e.url+")"),t},exec:function(e,n){t("Insert Image",[{id:"url",name:"Image Url",type:"text",defaultValue:n},{id:"alt",name:"Alt Text",type:"text"}],this.replace)}},"function-critic-accept":{exec:function(t,n){var i=n.replace(/\{\+\+(.*?)\+\+[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"$1").replace(/\{--(.*?)--[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"").replace(/\{~~(.*?)~>(.*?)~~\}/gm,"$2").replace(/\{\=\=(.*?)[ \t]*(\[(.*?)\])?[ \t]*\=\=\}{>>(.*?)<<\}/gm,"$1").replace(/\{>>(.*?)<<\}/gm,"");e.GollumEditor.replaceSelection(i)}},"function-critic-reject":{exec:function(t,n){var i=n.replace(/\{\+\+(.*?)\+\+[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"").replace(/\{--(.*?)--[ \t]*(\[(.*?)\])?[ \t]*\}/gm,"$1").replace(/\{~~(.*?)~>(.*?)~~\}/gm,"$1").replace(/\{\=\=(.*?)[ \t]*(\[(.*?)\])?[ \t]*\=\=\}{>>(.*?)<<\}/gm,"$1").replace(/\{>>(.*?)<<\}/gm,"");e.GollumEditor.replaceSelection(i)}}}}(jQuery),function(e){var t={"function-bold":{replace:"*$1*$2"},"function-hr":undefined,"function-blockquote":{replace:"----\n$1$2\n----"},"function-h1":{replace:"= $1$2"},"function-h2":{replace:"== $1$2"},"function-h3":{replace:"=== $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t=e.href+"["+e.text+"]"),t}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t="image::"+e.url+"["+e.alt+"]"),t}}};e.GollumEditor.defineLanguage("asciidoc",e.constructLanguageDefinition(t));var n=[{menuName:"Text Formatting",content:[{menuName:"Headers",data:"<p>AsciiDoc headers can be written in two ways: with differing underlines or with different indentation using <code>=</code> (equals sign). AsciiDoc supports headings 1-4. The editor will automatically use the <code>=</code> notation. To create a level one header, prefix your line with one <code>=</code>. Level two headers are created with <code>==</code> and so on.</p>"},{menuName:"Bold / Italic",data:"<p>To display text as <strong>bold</strong>, wrap the text in <code>*</code> (asterisks). To display text as <em>italic</em>, wrap the text in <code>_</code> (underscores). To create <code>monospace</code> text, wrap the text in <code>`</code> (backtick)."},{menuName:"Scripts",data:"<p>Superscript and subscript is created the same way as other inline formats. To create superscript text, wrap your text in <code>^</code> (carats). To create subscript text, wrap your text in <code>~</code> (tildes).</p>"},{menuName:"Special Characters",data:"<p>AsciiDoc will automatically convert textual representations of commonly-used special characters. For example, <code>(R)</code> becomes &reg;, <code>(C)</code> becomes &copy; and <code>(TM)</code> becomes &trade;.</p>"}]},{menuName:"Blocks",content:[{menuName:"Paragraphs",data:"<p>AsciiDoc allows paragraphs to have optional titles or icons to denote special sections. To make a normal paragraph, simply add a line between blocks and a new paragraph will start. If you want to title your paragraphs, adda line prefixed by <code>.</code> (full stop). An example paragraph with optional title is displayed below:<br><br><code>.Optional Title<br><br>This is my paragraph. It is two sentences long.</code></p>"},{menuName:"Source Blocks",data:"<p>To create source blocks (long blocks of code), follow the same syntax as above but with an extra line denoting the inline source and lines of four dashes (<code>----</code>) delimiting the source block.. An example of Python source is below:<br><br><code>.python.py<br>[source,python]<br>----<br># i just wrote a comment in python<br># and maybe one more<br>----</code></p>"},{menuName:"Comment Blocks",data:"<p>Comment blocks are useful if you want to keep notes for yourself inline but do not want them displayed to the public. To create a comment block, simply wrap the paragraph in dividers with four slashes (<code>////</code>). An example comment block is below:<br><br><code>////<br>My comment block is here now<br><br>It can be multiple paragraphs. Really.<br>////</p>"},{menuName:"Quote Blocks",data:"<p>Quote blocks work much like comment blocks &mdash; simply create dividers using four underscores (<code>____</code>) around your quote. An example quote block is displayed below:<br><code>____<br>This is my quote block. Quote something nice here, otherwise there is no point in quoting.<br>____</code></p>"}]},{menuName:"Macros",content:[{menuName:"Links",data:'<p>To create links to external pages, you can simply write the URI if you want the URI to link to itself. (i.e., <code>http://github.com/</code> will automatically be parsed to <a href="javascript:void(0);">http://github.com/</a>. If you want different text to be displayed, simply append it to the end of the URI in between <code>[</code> (brackets.) For example, <code>http://github.com/[GitHub]</code> will be parsed as <a href="javascript:void(0);">GitHub</a>, with the URI pointing to <code>http://github.com</code>.</p>'},{menuName:"Images",data:"<p>Images in AsciiDoc work much like hyperlinks, but image URLs are prefixed with <code>image:</code>. For example, to link to an image at <code>images/icons/home.png</code>, write <code>image:images/icons/home.png</code>. Alt text can be added by appending the text to the URI in <code>[</code> (brackets).</p>"}]}];e.GollumEditor.defineHelp("asciidoc",n)}(jQuery),function(e){e.GollumEditor.defineLanguage("bib",{})}(jQuery),function(e){var t={"function-italic":{replace:"//$1//$2"},"function-code":{replace:"{{{$1}}}$2"},"function-hr":{append:"\n\n----\n\n"},"function-blockquote":undefined,"function-ol":{line:function(e,t){return"# "+t+"\n"}},"function-h1":{replace:"== $1$2"},"function-h2":{replace:"=== $1$2"},"function-h3":{replace:"==== $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="[["+e.href+"|"+e.text+"]]"),t}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t="{{"+e.url,""!=e.alt&&(t+="|"+e.alt),t+="}}"),t}}};e.GollumEditor.defineLanguage("creole",e.constructLanguageDefinition(t))}(jQuery),function(e){var t={"gollum-helpers":{"find-header-line":function(e,t){if(t.match(/(^[=]+$)/)||t.match(/(^[-]+$)/)){var n=e-1,i=window.ace_editor.getSession().getLine(n);return n>=0&&!/^\s+$/.test(i)?[i,n]:null}return null}}};e.GollumEditor.defineLanguage("markdown",e.constructLanguageDefinition(t));var n=[{menuName:"Block Elements",content:[{menuName:"Paragraphs &amp; Breaks",data:"<p>To create a paragraph, simply create a block of text that is not separated by one or more blank lines. Blocks of text separated by one or more blank lines will be parsed as paragraphs.</p><p>If you want to create a line break, end a line with two or more spaces, then hit Return/Enter.</p>"},{menuName:"Headers",data:"<p>Markdown supports two header formats. The wiki editor uses the &ldquo;atx&rsquo;-style headers. Simply prefix your header text with the number of <code>#</code> characters to specify heading depth. For example: <code># Header 1</code>, <code>## Header 2</code> and <code>### Header 3</code> will be progressively smaller headers. You may end your headers with any number of hashes.</p>"},{menuName:"Blockquotes",data:"<p>Markdown creates blockquotes email-style by prefixing each line with the <code>&gt;</code>. This looks best if you decide to hard-wrap text and prefix each line with a <code>&gt;</code> character, but Markdown supports just putting <code>&gt;</code> before your paragraph.</p>"},{menuName:"Lists",data:"<p>Markdown supports both ordered and unordered lists. To create an ordered list, simply prefix each line with a number (any number will do &mdash; this is why the editor only uses one number.) To create an unordered list, you can prefix each line with <code>*</code>, <code>+</code> or <code>-</code>.</p> List items can contain multiple paragraphs, however each paragraph must be indented by at least 4 spaces or a tab."},{menuName:"Code Blocks",data:"<p>Markdown wraps code blocks in pre-formatted tags to preserve indentation in your code blocks. To create a code block, indent the entire block by at least 4 spaces or one tab. Markdown will strip the extra indentation you&rsquo;ve added to the code block.</p>"},{menuName:"Horizontal Rules",data:"Horizontal rules are created by placing three or more hyphens, asterisks or underscores on a line by themselves. Spaces are allowed between the hyphens, asterisks or underscores."}]},{menuName:"Span Elements",content:[{menuName:"Links",data:"<p>Markdown has two types of links: <strong>inline</strong> and <strong>reference</strong>. For both types of links, the text you want to display to the user is placed in square brackets. For example, if you want your link to display the text &ldquo;GitHub&rdquo;, you write <code>[GitHub]</code>.</p><p>To create an inline link, create a set of parentheses immediately after the brackets and write your URL within the parentheses. (e.g., <code>[GitHub](http://github.com/)</code>). Relative paths are allowed in inline links.</p><p>To create a reference link, use two sets of square brackets. <code>[my internal link][internal-ref]</code> will link to the internal reference <code>internal-ref</code>.</p>"},{menuName:"Emphasis",data:"<p>Asterisks (<code>*</code>) and underscores (<code>_</code>) are treated as emphasis and are wrapped with an <code>&lt;em&gt;</code> tag, which usually displays as italics in most browsers. Double asterisks (<code>**</code>) or double underscores (<code>__</code>) are treated as bold using the <code>&lt;strong&gt;</code> tag. To create italic or bold text, simply wrap your words in single/double asterisks/underscores. For example, <code>**My double emphasis text**</code> becomes <strong>My double emphasis text</strong>, and <code>*My single emphasis text*</code> becomes <em>My single emphasis text</em>.</p>"},{menuName:"Code",data:"<p>To create inline spans of code, simply wrap the code in backticks (<code>`</code>). Markdown will turn <code>`myFunction`</code> into <code>myFunction</code>.</p>"},{menuName:"Images",data:"<p>Markdown image syntax looks a lot like the syntax for links; it is essentially the same syntax preceded by an exclamation point (<code>!</code>). For example, if you want to link to an image at <code>http://github.com/unicorn.png</code> with the alternate text <code>My Unicorn</code>, you would write <code>![My Unicorn](http://github.com/unicorn.png)</code>.</p>"}]},{menuName:"Miscellaneous",content:[{menuName:"Automatic Links",data:'<p>If you want to create a link that displays the actual URL, markdown allows you to quickly wrap the URL in <code>&lt;</code> and <code>&gt;</code> to do so. For example, the link <a href="javascript:void(0);">http://github.com/</a> is easily produced by writing <code>&lt;http://github.com/&gt;</code>.</p>'},{menuName:"Escaping",data:"<p>If you want to use a special Markdown character in your document (such as displaying literal asterisks), you can escape the character with the backslash (<code>\\</code>). Markdown will ignore the character directly after a backslash."},{menuName:"Emoji",data:'<p>See the <a href="http://emojione.com/demo/" target="_blank">EmojiOne demo</a> for all available emoji. To include one, wrap the emoji name in colons and use underscores instead of spaces (e.g. :heart: or :point_up:).'}]}];e.GollumEditor.defineHelp("markdown",n)}(jQuery),function(e){var t={"function-bold":{replace:"'''$1'''$2"},"function-italic":{replace:"''$1''$2"},"function-hr":{append:"\n---\n"},"function-code":{replace:"<code>$1</code>$2"},"function-ol":{link:function(e,t){return"# "+t+"\n"}},"function-blockquote":{replace:"<blockquote>\n$1$2\n</blockquote>"},"function-h1":{replace:"= $1$2 ="},"function-h2":{replace:"== $1$2 =="},"function-h3":{replace:"=== $1$2 ==="},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="["+e.href+" | "+e.text+"]"),t}}};e.GollumEditor.defineLanguage("mediawiki",e.constructLanguageDefinition(t));var n=[{menuName:"Text Formatting",content:[{menuName:"Headers",data:"<p>MediaWiki headers are written with different indentation using <code>= Title =</code> (equals sign). MediaWiki supports headings 1-6.</p>"},{menuName:"Bold / Italic",data:"<p>To display text as <strong>bold</strong>, wrap the text in <code>'''</code>. To display text as <em>italic</em>, wrap the text in <code>''</code>. To create <code>monospace</code> text, wrap the text in <code>&lt;code&gt;&lt;/code&gt;</code>."},{menuName:"Special Characters",data:"<p>Use HTML special characters, e.g. <code>&copy;</code> or <code>&euro;</code></p>"}]},{menuName:"Blocks",content:[{menuName:"Paragraphs",data:"<p>MediaWiki ignores single line breaks. To start a new paragraph, leave an empty line. You can force a line break within a paragraph with the HTML tag <code><br /></code>.</p>"},{menuName:"Tables",data:'<p>Tables may be authored in wiki pages using either XHTML table elements directly, or using wikicode formatting to define the table. Wikitable syntax overview: <table cellpadding="5" cellspacing="0" border="1"><tr><td><pre> <code>{|</code></pre></td><td><b>table start</b></td></tr><tr><td><pre> <code>|+</code></pre></td><td>table <b>caption,</b> <i>optional;</i> only between <b>table start</b> and first <b>table row</b></td></tr><tr><td><pre> <code>|-</code></pre></td><td><b>table row,</b> <i>optional on first row</i> -- wiki engine assumes the first row</td></tr><tr><td><pre> <code>!</code></pre></td><td><b>table header</b> cell, <i>optional.</i> Consecutive <b>table header</b> cells may be added on same line separated by double marks (<code>!!</code>) or start on new lines, each with its own single mark (<code>!</code>).</td></tr><tr><td><pre> <code>|</code></pre></td><td><b>table data</b> cell, <i>required!</i> Consecutive <b>table data</b> cells may be added on same line separated by double marks (<code>||</code>) or start on new lines, each with its own single mark (<code>|</code>).</td></tr><tr><td><pre> <code>|}</code></pre></td><td><b>table end</b></td></tr></table></p>'}]},{menuName:"Macros",content:[{menuName:"Links",data:"<p>To create links to external pages, use single brackets, e.g. <code>[https://mediawiki.org MediaWiki]</code>. Internal links use double brackets: <code>[[Main Page]]</code>. To define the link text, use <code>[[Main Page | this is displayed]]</code> (note: the order of the URL/Page Name and the link text is reversed compared to Gollum pages in other markups).</p>"},{menuName:"Images",data:"<p>Use Gollum internal links, e.g. <code>[[sauron.jpg]]<code>, to insert images."}]}];e.GollumEditor.defineHelp("mediawiki",n)}(jQuery),function(e){var t={"function-bold":{replace:"*$1*$2"},"function-italic":{replace:"/$1/$2"},"function-code":{replace:"=$1=$2"},"function-hr":undefined,"function-blockquote":{replace:"#+BEGIN_QUOTE\n$1$2\n#+END_QUOTE"},"function-h1":{replace:"* $1$2"},"function-h2":{replace:"** $1$2"},"function-h3":{replace:"*** $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href?t="[["+e.href+"]["+e.text+"]]":e.href&&(t="[["+e.href+"]]"),t}},"function-image":{replace:function(e){var t="";return e.url&&(t="[["+e.url+"]]"),t}}};e.GollumEditor.defineLanguage("org",e.constructLanguageDefinition(t));var n=[{menuName:"Block Elements",content:[{menuName:"Paragraphs &amp; Breaks",data:"<p>To create a paragraph, simply create a block of text that is not separated by one or more blank lines. Blocks of text separated by one or more blank lines will be parsed as paragraphs.</p>"},{menuName:"Headers",data:"<p>Simply prefix your header text with the number of <code>*</code> characters to specify heading depth. For example: <code>* Header 1</code>, <code>** Header 2</code> and <code>*** Header 3</code> will be progressively smaller headers.</p>"},{menuName:"Blockquotes",data:"<p>To create a blockquote, simple embed the text between <code>#+BEGIN_QUOTE</code> and <code>#+END_QUOTE</code>. An example quote block is displayed below:<br><code>#+BEGIN_QUOTE<br>This is my quote block. Quote something nice here, otherwise there is no point in quoting.<br>#+END_QUOTE</code></p>"},{menuName:"Lists",data:"<p>Org-mode supports both ordered and unordered lists. To create an ordered list, simply prefix each line with a number (any number will do &mdash; this is why the editor only uses one number.) To create an unordered list, you can prefix each line with <code>+</code> or <code>-</code>.</p>"},{menuName:"Code Blocks",data:"<p>Code Blocks are similar to blockquote, except that <code>#+BEGIN_EXAMPLE</code> and <code>#+END_EXAMPLE</code> are used.</p>"},{menuName:"Tables",data:"<p>Org-mode supports simple tables (tables with equal number of cells in each row). To create a simple table, just separate the contents of each cell with a <code>|</code> character. For example, <br><br><code>|one|two|three|<br>|four|five|six|</code><br><br> will appear as a table with two rows and three columns. Additionally, <br><br><code>|one|two|three|<br>|---+---+-----|<br>|four|five|six|</code><br><br> will also appear as a table, but the first row will be interpreted as a header row and the <code>&lt;th&gt;</code> tag will be used to render it. </p>"}]},{menuName:"Span Elements",content:[{menuName:"Links",data:'<p>To create links to external pages, you need to enclose the URI in double square brackets. (i.e., <code>[[http://github.com/]]</code> will automatically be parsed to <a href="javascript:void(0);">http://github.com/</a>)If you want to add text, to be displayed to the user, you write the URI and the text next to each other, both enclosed in square brackets and both of them together enclosed in another pair of square brackets. For example, if you want your link to display the text &ldquo;GitHub&rdquo;, you write <code>[[http://github.com][GitHub]]</code>.</p>'},{menuName:"Emphasis",data:"<p>Forward slashes (<code>/</code>) are treated as emphasis and are wrapped with an <code>&lt;i&gt;</code> tag. Asterisks (<code>*</code>) are treated as bold using the <code>&lt;b&gt;</code> tag.</p>"},{menuName:"Code",data:"<p>To create inline spans of code, simply wrap the code in equal signs (<code>=</code>). Orgmode will turn <code>=myFunction=</code> into <code>myFunction</code>.</p>"},{menuName:"Images",data:"<p>Org-mode image syntax is exactly same as the syntax that you would use for a URI to link to itself. The image URI is enclosed in double square brackets. Alt text on images is not currently supported by Gollum's Org-mode parser.</p>"}]}];e.GollumEditor.defineHelp("org",n)}(jQuery),function(e){e.GollumEditor.defineLanguage("txt",{})}(jQuery),function(e){var t={"function-bold":{replace:"B<$1>$2"},"function-italic":{replace:"I<$1>$2"},"function-hr":undefined,"function-code":{replace:"C<$1>$2"},"function-h1":{replace:"=head1 $1$2"},"function-h2":{replace:"=head2 $1$2"},"function-h3":{replace:"=head3 $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="L<"+e.text+"|"+e.href+">"),t}},"function-image":undefined,"function-ul":undefined,"function-ol":undefined,"function-blockquote":undefined};e.GollumEditor.defineLanguage("pod",e.constructLanguageDefinition(t));var n=[{menuName:"Command Paragraphs",content:[{menuName:"Headings",data:"<p>All command paragraphs start with <code>=</code> (equals sign).</p><p>To create headings 1 through 4, begin your command paragraph with <code>=headN</code>, where <code>N</code> is the number of the heading 1 through 4. For example, to make a first-order heading (the largest possible,) write <code>=head1</code>, then on the next line begin your paragraph that you want under the heading.</p>"},{menuName:"Beginning &amp; Ending",data:"<p>Perl pod blocks should begin with <code>=pod</code> and end with <code>=cut</code>, signifying to Pod parsers that the pod block has begun and ended. These command paragraphs only signal the beginning and end of a pod block.</p>"},{menuName:"Other Formats",data:"<p>pod also allows blocks in other formats, such as HTML or plain text. To create one of these blocks, use the <code>=format SYNTAX</code> command paragraph, where <code>SYNTAX</code> is the syntax of the block (e.g. <code>html</code> or <code>txt</code>). At the end of your block, use the <code>=end SYNTAX</code> block.</p>"},{menuName:"Encoding",data:"<p>If you are having encoding troubles, use the <code>=encoding ENC_TYPE</code> command, where <code>ENC_TYPE</code> is the encoding type (e.g. <code>utf8</code>, <code>koi8-r</code>). This will affect the entire document, not just the block below the command.</p>"}]},{menuName:"Formatting",content:[{menuName:"Text",data:"<p>Formatting text as <strong>bold</strong>, <em>italic</em> or <code>code</code> works in the <code>S&lt;word&gt;</code> syntax, where <code>S</code> is an abbreviation for the type of text you are trying to create. For example, <code>B&lt;my bold text&gt;</code> becomes <strong>my bold text</strong>, <code>I&lt;italic text&gt;</code> becomes <em>italic text</em> and <code>C&lt;code here()&gt;</code> becomes <code>code here()</code>.</p>"},{menuName:"Hyperlinks",data:"<p>Writing hyperlinks in pod is much like formatting text, using the same <code>S&lt;&gt;</code> syntax. Instead of <code>B</code>, <code>I</code> or <code>C</code>, use <code>L</code> to begin a hyperlink.</p><p>pod allows you to hyperlink to a <code>man</code> page, a Perl documentation page, or another web page. To link to a <code>man</code> or Perl documentation page, simply include the page name in the link (e.g. <code>L&lt;perl(1)&gt;</code> or <code>L&lt;Net::Ping&gt;</code>). If you want to link to a web page, separate the URL and the link text with a pipe (e.g. to link to github.com, write <code>L&lt;GitHub|http://github.com/&gt;</code>)."}]}];e.GollumEditor.defineHelp("pod",n)}(jQuery),function(e){var t={"function-code":undefined,"function-h1":undefined,"function-h2":undefined,"function-h3":undefined,"function-link":undefined,"function-image":undefined,"function-hr":undefined,"function-blockquote":undefined};e.GollumEditor.defineLanguage("rdoc",e.constructLanguageDefinition(t))}(jQuery),function(e){var t=function(t,n,i){var o="";o=t.length?t:"Title here",adornment=i.repeat(o.length),o=o+"\n"+adornment+"\n",e.GollumEditor.replaceSelection(o,!1,!1,n)},n={"function-bold":{replace:"**$1**$2"},"function-italic":{replace:"*$1*$2"},"function-code":{replace:"``$1``$2"},"function-hr":{append:"\n\n----\n\n"},"function-blockquote":{exec:function(t,n){for(var i=" ",o=n.split("\n"),r=0;r<o.length;r++)o[r]=i+o[r];var s=o.join("\n");e.GollumEditor.replaceSelection(s)}},"function-h1":{symbol:"=",exec:function(e,n,i,o){t(n,o,this.symbol)}},"function-h2":{symbol:"-",exec:function(e,n,i,o){t(n,o,this.symbol)}},"function-h3":{symbol:"~",exec:function(e,n,i,o){t(n,o,this.symbol)}},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t="`"+e.text+" <"+e.href+">`_"),t}},"function-image":{replace:function(e){var t="";return e.url&&e.alt&&(t=".. image:: "+e.url+"\n :alt: "+e.alt),t}},"gollum-helpers":{"find-header-line":function(e){var t=e-1,n=window.ace_editor.getSession().getLine(t);return t>=0&&!/^\s+$/.test(n)?[n,t]:null}}};e.GollumEditor.defineLanguage("rst",e.constructLanguageDefinition(n));var i=[{menuName:"Block Elements",content:[{menuName:"Paragraphs &amp; Breaks",data:"<p>To create a paragraph, simply create a block of text that is not separated by one or more blank lines. Blocks of text separated by one or more blank lines will be parsed as paragraphs.</p>"},{menuName:"Headers",data:"<p>Rest uses overline/underline adornments to indicate headers. To create a header, underline your header text with adornment characters such as the <code>=, ~, +, ^</code> characters. Make sure that the adornment is of the same length (or longer) as the header text. Use a different adornment character to specify a different heading depth.</p>"},{menuName:"Blockquotes",data:"<p>Rest creates blockquotes using indentation. This looks best if you use four spaces per level of indentation.</p>"},{menuName:"Lists",data:"<p>Rest supports both ordered and unordered lists. To create an ordered list, simply prefix each line with a number, or use <code>#</code> for auto enumeration. To create an unordered list, you can prefix each line with <code>*</code>, <code>+</code> or <code>-</code>.</p>"},{menuName:"Code Blocks",data:"<p>Rest wraps code blocks in pre-formatted tags to preserve indentation in your code blocks. To create a code block, indent the entire block by at least 4 spaces or one tab. Rest will strip the extra indentation you&rsquo;ve added to the code block.</p>"},{menuName:"Horizontal Rules",data:"<p>Horizontal rules are created by placing four or more hyphens, asterisks or underscores on a line by themselves.</p>"}]},{menuName:"Span Elements",content:[{menuName:"Links",data:"<p>To create an inline link, create a set of backticks, include the link title first, followed by the url in angled brackets (e.g., <code>`Python <http://www.python.org/>`_</code>).</p>"},{menuName:"Emphasis",
24
+ data:"<p>Asterisks (<code>*</code>) are treated as emphasis and are wrapped with an <code>&lt;em&gt;</code> tag, which usually displays as italics in most browsers. Double asterisks (<code>**</code>) are treated as bold using the <code>&lt;strong&gt;</code> tag. To create italic or bold text, simply wrap your words in single/double asterisks. For example, <code>**My double emphasis text**</code> becomes <strong>My double emphasis text</strong>, and <code>*My single emphasis text*</code> becomes <em>My single emphasis text</em>.</p>"},{menuName:"Code",data:"<p>To create inline spans of code, simply wrap the code in backticks (<code>`</code>). Rest will turn <code>`myFunction`</code> into <code>myFunction</code>.</p>"},{menuName:"Images",data:'<p>Rest image syntax is two dots, followed by a space, the word "image", two colons, another space, and the url: <code>.. image:: http://image.com/image.png</code>.</p>'}]},{menuName:"Miscellaneous",content:[{menuName:"Escaping",data:"<p>If you want to use a special Rest character in your document (such as displaying literal asterisks), you can escape the character with the backslash (<code>\\</code>). Rest will ignore the character directly after a backslash."}]}];e.GollumEditor.defineHelp("rst",i)}(jQuery),function(e){var t={"function-hr":undefined,"function-code":{replace:"bc. $1$2",whole_line:!0},"function-ol":{line:function(e,t){return"# "+t+"\n"}},"function-blockquote":{replace:"bq. $1$2"},"function-h1":{replace:"h1. $1$2"},"function-h2":{replace:"h2. $1$2"},"function-h3":{replace:"h3. $1$2"},"function-link":{replace:function(e){var t="";return e.text&&e.href&&(t='"'+e.text+'":'+e.href),t}},"function-image":{replace:function(e){var t="";if(e.url){var t="!"+e.url;return""!=e.alt&&(t+="("+e.alt+")"),t+="!"}}}};e.GollumEditor.defineLanguage("textile",e.constructLanguageDefinition(t));var n=[{menuName:"Phrase Modifiers",content:[{menuName:"Emphasis / Strength",data:"<p>To place emphasis or strength on inline text, simply place <code>_</code> (underscores) around the text for emphasis or <code>*</code> (asterisks) around the text for strength. In most browsers, <code>_mytext_</code> will appear as italics and <code>*mytext*</code> will appear as bold.</p><p>To force italics or bold, simply double the characters: <code>__mytext__</code> will appear italic and <code>**mytext**</code> will appear as bold text.</p>"},{menuName:"Citations / Editing",data:'<p>To display citations, wrap your text in <code>??</code> (two question marks).</p><p>To display edit marks such as deleted text (strikethrough) or inserted text (underlined text), wrap your text in <code>-</code> (minuses) or <code>+</code> (pluses). For example <code>-mytext-</code> will be rendered as <span style="text-decoration: line-through;">mytext</span> and <code>+mytext+</code> will be rendered as <span style="text-decoration: underline;">mytext</span></p>'},{menuName:"Superscript / Subscript",data:"<p>To display superscript, wrap your text in <code>^</code> (carets). To display subscript, wrap your text in <code>~</code> (tildes).</p>"},{menuName:"Code",data:"<p>To display monospace code, wrap your text in <code>@</code> (at symbol). For example, <code>@mytext@</code> will appear as <code>mytext</code>.</p>"},{menuName:"Acronyms",data:'<p>To create an acronym, suffix the acronym with the definition in parentheses. For example, <code>JS(JavaScript)</code> will be displayed as <abbr title="JavaScript">JS</abbr>.</p>'}]},{menuName:"Block Modifiers",content:[{menuName:"Headings",data:"<p>To display a heading in Textile, prefix your line of text with <code>hn.</code>, where <code>n</code> equals the heading size you want (1 is largest, 6 is smallest).</p>"},{menuName:"Paragraphs / Quotes",data:"<p>To create a new paragraph, prefix your first line of a block of text with <code>p.</code>.</p><p>To create a blockquote, make sure at least one blank line exists between your text and any surrounding text, and then prefix that block with <code>bq.</code> If you need to extend a blockquote to more than one text block, write <code>bq..</code> (note the two periods) and prefix your next normal paragraph with <code>p.</code></p>"},{menuName:"Code Blocks",data:"<p>Code blocks in textile are simply prefixed like any other block. To create a code block, place the beginning of the block on a separate line and prefix it with <code>bc.</code></p><p>To display a preformatted block, prefix the block with <code>pre.</code></p>"},{menuName:"Lists",data:"<p>To create ordered lists, prefix each line with <code>#</code>. To create unordered lists, prefix each line with <code>*</code>.</p>"}]},{menuName:"Links / Images",content:[{menuName:"Links",data:'<p>To display a link, put the text you want to display in quotes, then a colon (<code>:</code>), then the URL after the colon. For example <code>&quot;GitHub&quot;:http://github.com/</code> will appear as <a href="javascript:void(0);">GitHub</a>.</p>'},{menuName:"Images",data:"<p>To display an image, simply wrap the image&rsquo;s URL in <code>!</code> (exclamation points). If you want to link the image to a URL, you can blend the image and link syntax: place your image URL in the exclamation points and suffix that with a colon and your URL. For example, an image at <code>http://myurl/image.png</code> that should link to <code>http://myurl/</code> should be written as <code>!http://myurl/image.png!:http://myurl/</code>.</p>"}]}];e.GollumEditor.defineHelp("textile",n)}(jQuery);
@@ -17,6 +17,8 @@
17
17
  NoDefinitionsFor: []
18
18
  };
19
19
  var ActiveOptions = {};
20
+ var autoSaveTimer = null;
21
+ var storageKey = 'gollum_autorecover_' + window.location;
20
22
 
21
23
  function isRTL(s){
22
24
  var ltrChars = 'A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02B8\u0300-\u0590\u0800-\u1FFF'+'\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF',
@@ -32,6 +34,27 @@
32
34
  window.ace_editor.renderer.updateFull();
33
35
  }
34
36
 
37
+ function autoSaveHandler() {
38
+ // Autosave
39
+ if (autoSaveTimer) {
40
+ // Reset the timer because we just changed the text
41
+ clearTimeout(autoSaveTimer);
42
+ }
43
+
44
+ $('#gollum-saved-msg').text('Saving...');
45
+
46
+ // Wait 2 seconds, then actualy save the text to local storage
47
+ autoSaveTimer = setTimeout(function() {
48
+ localStorage.setItem(storageKey, window.ace_editor.getSession().getValue());
49
+ // Save any subpage editor text that might exist
50
+ $('#gollum-editor-header, #gollum-editor-footer, #gollum-editor-sidebar').each(function(_, el) {
51
+ var spStorageKey = storageKey + el.id.replace('gollum-editor-', '_');
52
+ localStorage.setItem(spStorageKey, el.value);
53
+ });
54
+ $('#gollum-saved-msg').text('Saved recovery text');
55
+ }, 2000);
56
+ }
57
+
35
58
  /**
36
59
  * $.GollumEditor
37
60
  *
@@ -55,6 +78,26 @@
55
78
  var editor = ace.edit(editDiv[0], {rtlText: true});
56
79
  window.ace_editor = editor;
57
80
 
81
+ // Check to see if we have any autosaved text and show a message to
82
+ // restore it if present.
83
+ var savedText = localStorage.getItem(storageKey);
84
+
85
+ if (savedText) {
86
+ $('#gollum-autorecover-button').click(function(e) {
87
+ editor.getSession().setValue(savedText);
88
+ // Restore subpage editor values too, if they exist
89
+ ['header', 'footer', 'sidebar'].forEach(function(i) {
90
+ var sbSavedText = localStorage.getItem(storageKey + '_' + i);
91
+ if (sbSavedText) {
92
+ $('#gollum-editor-' + i).val(sbSavedText);
93
+ }
94
+ });
95
+ $('#gollum-autorecover-msg')[0].hidden = true;
96
+ e.preventDefault();
97
+ });
98
+ $('#gollum-autorecover-msg')[0].hidden = false;
99
+ }
100
+
58
101
  editor.setTheme("ace/theme/tomorrow");
59
102
  editor.setKeyboardHandler();
60
103
  editor.renderer.setShowGutter(false);
@@ -64,8 +107,13 @@
64
107
 
65
108
  editor.getSession().on('change', function(){
66
109
  textarea.val(editor.getSession().getValue());
110
+ autoSaveHandler();
67
111
  });
68
112
 
113
+ // Autosave for the header, footer and sidebar
114
+ $('#gollum-editor-header, #gollum-editor-footer, #gollum-editor-sidebar')
115
+ .on('change keyup paste', autoSaveHandler);
116
+
69
117
  if (isRTL(editor.getSession().getLine(0))) {
70
118
  switchRtl(true);
71
119
  }
@@ -114,6 +162,16 @@
114
162
  editor.focus();
115
163
  });
116
164
 
165
+ // Remove any autosaved text when we hit save or cancel
166
+ $("#gollum-editor-submit, #gollum-editor-cancel").click(function() {
167
+ var storageKey = 'gollum_autorecover_' + window.location;
168
+ localStorage.removeItem(storageKey);
169
+ // Clear subpage editor values too, if they exist
170
+ ['header', 'footer', 'sidebar'].forEach(function(i) {
171
+ localStorage.removeItem(storageKey + '_' + i);
172
+ });
173
+ });
174
+
117
175
  debug('GollumEditor loading');
118
176
 
119
177
  if ( EditorHas.baseEditorMarkup() ) {
@@ -241,6 +299,7 @@
241
299
  var ext = file.name.split('.').pop().toLowerCase()
242
300
  var image_ext = ['jpg', 'jpeg', 'tif', 'tiff', 'png', 'gif', 'svg', 'bmp']
243
301
  // Link directly to image files
302
+ uploadDest = uploadDest.replace(/%20/g, ' ');
244
303
  if ((image_ext.indexOf(ext) > -1)) {
245
304
  var text = '[[/' + uploadDest + '/' + file.name + ']]';
246
305
  } else {
@@ -23,7 +23,7 @@
23
23
  // For Gollum link tags
24
24
  var GollumTagStart = {
25
25
  token: "support.function",
26
- regex: "\\[\\[.*\\]\\]",
26
+ regex: "\\[\\[[^\\]]*\\]\\]",
27
27
  next: 'start'
28
28
  };
29
29
 
@@ -105,7 +105,7 @@ function flashNotice(type, notice, button_label, button_function, button_type) {
105
105
  }
106
106
  html = '<p><div id="gollum-flash" class="flash flash-' + type +'"><button class="flash-close js-flash-close" type="button" onclick="parentNode.remove()"><%=rocticon('x')%></button>' + notice + nested_button_html + '</div></p>';
107
107
  $('#gollum-flash').remove();
108
- $('#wiki-content h1').before(html);
108
+ $('#wiki-content').before(html);
109
109
  if (type == 'success') { setTimeout(function() {$('#gollum-flash').fadeOut();}, 5000); }
110
110
  }
111
111
 
@@ -486,12 +486,13 @@ $(document).ready(function() {
486
486
  }
487
487
  numSelected = numSelected + 1;
488
488
  });
489
- if (numSelected == maxSelected) {
490
- $('#version-form input:not(:checked)').prop('disabled', true);
491
- $('.history button.action-compare-revision').prop('disabled', false);
489
+ if (numSelected < 1) {
490
+ $('.history button.action-compare-revision').prop('disabled', true);
492
491
  } else if (numSelected < maxSelected) {
492
+ $('.history button.action-compare-revision').prop('disabled', false);
493
493
  $('#version-form input').prop('disabled', false);
494
- $('.history button.action-compare-revision').prop('disabled', true);
494
+ } else {
495
+ $('#version-form input:not(:checked)').prop('disabled', true);
495
496
  }
496
497
  };
497
498
 
@@ -0,0 +1,26 @@
1
+ <div id="wiki-wrapper" class="compare">
2
+ <div id="head">
3
+ <h1 class="py-4">{{message}}</h1>
4
+ {{author}} commited {{authored_date}}
5
+ <span class="px-2 float-right">commit <code>{{version}}</code></span>
6
+ </div>
7
+
8
+ <div id="compare-content">
9
+ {{#files}}
10
+ <div class="Box data highlight my-3">
11
+ <div class="Box-header Box--condensed Box-header--gray">
12
+ <code>{{path}}</code>
13
+ </div>
14
+ <table>
15
+ {{#lines}}
16
+ <tr>
17
+ <td class="line_numbers">{{ldln}}</td>
18
+ <td class="line_numbers">{{rdln}}</td>
19
+ <td><div class="{{class}} pl-2">{{line}}</div></td>
20
+ </tr>
21
+ {{/lines}}
22
+ </table>
23
+ </div>
24
+ {{/files}}
25
+ </div>
26
+ </div>
@@ -96,6 +96,10 @@
96
96
  </p>
97
97
  </div>
98
98
  </div>
99
+ </div>
100
+ <div id="gollum-autorecover-msg" class="flash" hidden>
101
+ Autosaved text is available. Click the button to restore it.
102
+ <button id="gollum-autorecover-button" class="btn btn-sm primary flash-action">Restore Text</button>
99
103
  </div>
100
104
  <textarea id="gollum-editor-body" class="form-control"
101
105
  data-markup-lang="{{format}}" name="content" class="mousetrap">{{content}}</textarea>
@@ -147,3 +151,4 @@
147
151
  </fieldset>
148
152
  </form>
149
153
  </div>
154
+ <div id="gollum-saved-msg" class="position-fixed bottom-0 left-0"></div>