Advanced Access Manager - Version 2.9.3

Version Description

  • Introduced AAM version 3 alpha
Download this release

Release Info

Developer vasyl_m
Plugin Icon 128x128 Advanced Access Manager
Version 2.9.3
Comparing to
See all releases

Code changes from version 2.9.2 to 2.9.3

Files changed (37) hide show
  1. aam.php +1 -1
  2. application/control/object/configpress.php +211 -0
  3. application/view/tmpl/manager.phtml +3 -6
  4. config.php +1 -1
  5. library/Zend/Config.php +485 -0
  6. library/Zend/Config/Exception.php +33 -0
  7. library/Zend/Config/Ini.php +301 -0
  8. library/Zend/Exception.php +101 -0
  9. media/css/codemirror.css +262 -0
  10. media/css/common.css +0 -369
  11. media/css/images/common/large-iconset.png +0 -0
  12. media/css/images/common/medium-iconset.png +0 -0
  13. media/css/images/common/medium-loader.gif +0 -0
  14. media/css/images/common/small-iconset.png +0 -0
  15. media/css/images/cpanel/help-forum-active.png +0 -0
  16. media/css/images/cpanel/help-forum.png +0 -0
  17. media/css/images/cpanel/message-active.png +0 -0
  18. media/css/images/cpanel/message.png +0 -0
  19. media/css/images/cpanel/restore-active.png +0 -0
  20. media/css/images/cpanel/restore.png +0 -0
  21. media/css/images/cpanel/save-active.png +0 -0
  22. media/css/images/cpanel/save.png +0 -0
  23. media/css/images/cpanel/star-active.png +0 -0
  24. media/css/images/cpanel/star.png +0 -0
  25. media/css/images/cpanel/twitter-active.png +0 -0
  26. media/css/images/cpanel/twitter.png +0 -0
  27. media/css/images/extension/link-active.png +0 -0
  28. media/css/images/extension/link.png +0 -0
  29. media/css/images/extension/message-active.png +0 -0
  30. media/css/images/extension/message.png +0 -0
  31. media/css/images/extension/twitter-active.png +0 -0
  32. media/css/images/extension/twitter.png +0 -0
  33. media/css/images/logo.png +0 -0
  34. media/css/images/{common/warning.png → warning.png} +0 -0
  35. media/js/codemirror.js +1 -0
  36. media/js/properties.js +64 -0
  37. readme.txt +4 -1
aam.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  Plugin Name: Advanced Access Manager
5
  Description: Manage User and Role Access to WordPress Backend and Frontend.
6
- Version: 2.9.2
7
  Author: Vasyl Martyniuk <support@wpaam.com>
8
  Author URI: http://www.wpaam.com
9
 
3
  /**
4
  Plugin Name: Advanced Access Manager
5
  Description: Manage User and Role Access to WordPress Backend and Frontend.
6
+ Version: 2.9.3
7
  Author: Vasyl Martyniuk <support@wpaam.com>
8
  Author URI: http://www.wpaam.com
9
 
application/control/object/configpress.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ======================================================================
4
+ * LICENSE: This file is subject to the terms and conditions defined in *
5
+ * file 'license.txt', which is part of this source code package. *
6
+ * ======================================================================
7
+ */
8
+
9
+ /**
10
+ * ConfigPress Legacy
11
+ *
12
+ * Keep this object for compatibility reasons
13
+ *
14
+ * @package AAM
15
+ * @author Vasyl Martyniuk <support@wpaam.com>
16
+ * @copyright Copyright C 2013 Vasyl Martyniuk
17
+ * @license GNU General Public License {@link http://www.gnu.org/licenses/}
18
+ * @todo Remove in 4/30/2014
19
+ */
20
+ class aam_Control_Object_ConfigPress extends aam_Control_Object {
21
+
22
+ /**
23
+ *
24
+ */
25
+ const UID = 'configpress';
26
+
27
+ /**
28
+ *
29
+ * @var type
30
+ */
31
+ private $_option = '';
32
+
33
+ /**
34
+ *
35
+ * @var type
36
+ */
37
+ private $_config = '';
38
+
39
+ /**
40
+ *
41
+ * @var type
42
+ */
43
+ private $_tree = null;
44
+
45
+ /**
46
+ * @inheritdoc
47
+ */
48
+ public function __sleep(){
49
+ return array('_option', '_config', '_tree');
50
+ }
51
+
52
+ /**
53
+ * @inheritdoc
54
+ */
55
+ public function cacheObject(){
56
+ return false;
57
+ }
58
+
59
+ /**
60
+ *
61
+ * @param type $config_press
62
+ * @return boolean
63
+ */
64
+ public function save($config_press = null) {
65
+ if (is_writable(AAM_TEMP_DIR)) {
66
+ $filename = $this->getOption();
67
+ if (!$filename) { //file already was created
68
+ $filename = sha1(uniqid('aam'));
69
+ aam_Core_API::updateBlogOption('aam_' . self::UID, $filename);
70
+ }
71
+ $response = file_put_contents(
72
+ AAM_TEMP_DIR . $filename, stripcslashes($config_press)
73
+ );
74
+ } else {
75
+ $response = false;
76
+ }
77
+
78
+ return $response;
79
+ }
80
+
81
+ /**
82
+ *
83
+ * @return type
84
+ */
85
+ public function getUID(){
86
+ return self::UID;
87
+ }
88
+
89
+ /**
90
+ *
91
+ * @param type $object_id
92
+ */
93
+ public function init($object_id) {
94
+ $filename = aam_Core_API::getBlogOption('aam_' . self::UID, '');
95
+ if ($filename && file_exists(AAM_TEMP_DIR . $filename)) {
96
+ $this->setOption($filename);
97
+ $this->setConfig(file_get_contents(AAM_TEMP_DIR . $filename));
98
+ $this->parseConfig(AAM_TEMP_DIR . $filename);
99
+ }
100
+ }
101
+
102
+ /**
103
+ *
104
+ * @param type $filename
105
+ */
106
+ protected function parseConfig($filename) {
107
+ //include third party library
108
+ if (!class_exists('Zend_Config')){
109
+ require_once(AAM_LIBRARY_DIR . 'Zend/Exception.php');
110
+ require_once(AAM_LIBRARY_DIR . 'Zend/Config/Exception.php');
111
+ require_once(AAM_LIBRARY_DIR . 'Zend/Config.php');
112
+ require_once(AAM_LIBRARY_DIR . 'Zend/Config/Ini.php');
113
+ }
114
+ //parse ini file
115
+ try {
116
+ $this->setTree(new Zend_Config_Ini($filename));
117
+ } catch (Zend_Config_Exception $e) {
118
+ aam_Core_Console::add('ConfigPress parsing error');
119
+ }
120
+ }
121
+
122
+ /**
123
+ *
124
+ * @param type $param
125
+ * @param type $default
126
+ * @return type
127
+ */
128
+ protected function parseParam($param, $default) {
129
+ if (is_object($param) && isset($param->userFunc)) {
130
+ $func = trim($param->userFunc);
131
+ if (is_string($func) && is_callable($func)) {
132
+ $response = call_user_func($func);
133
+ } else {
134
+ $response = $default;
135
+ }
136
+ } else {
137
+ $response = $param;
138
+ }
139
+
140
+ return $response;
141
+ }
142
+
143
+ /**
144
+ *
145
+ * @param type $param
146
+ * @param type $default
147
+ * @return type
148
+ */
149
+ public function getParam($param, $default = NULL) {
150
+ $tree = $this->getTree();
151
+ foreach (explode('.', $param) as $section) {
152
+ if (isset($tree->{$section})) {
153
+ $tree = $tree->{$section};
154
+ } else {
155
+ $tree = $default;
156
+ break;
157
+ }
158
+ }
159
+
160
+ return $this->parseParam($tree, $default);
161
+ }
162
+
163
+ /**
164
+ *
165
+ * @param type $option
166
+ */
167
+ public function setOption($option) {
168
+ $this->_option = $option;
169
+ }
170
+
171
+ /**
172
+ *
173
+ * @return type
174
+ */
175
+ public function getOption() {
176
+ return $this->_option;
177
+ }
178
+
179
+ /**
180
+ *
181
+ * @param type $config
182
+ */
183
+ public function setConfig($config) {
184
+ $this->_config = $config;
185
+ }
186
+
187
+ /**
188
+ *
189
+ * @return type
190
+ */
191
+ public function getConfig() {
192
+ return $this->_config;
193
+ }
194
+
195
+ /**
196
+ *
197
+ * @param type $tree
198
+ */
199
+ public function setTree($tree) {
200
+ $this->_tree = $tree;
201
+ }
202
+
203
+ /**
204
+ *
205
+ * @return type
206
+ */
207
+ public function getTree() {
208
+ return $this->_tree;
209
+ }
210
+
211
+ }
application/view/tmpl/manager.phtml CHANGED
@@ -10,12 +10,9 @@
10
  <div class="aam-notification">
11
  <div class="aam-logo"></div>
12
  <div class="aam-notification-content">
13
- <h1>Important Notification</h1>
14
- <p>
15
- Advanced Access Manager is changing the primary owner to <a href="http://vasyltech.com" target="_blank">VasylTech</a>.<br/>
16
- Stay tuned to the AAM version 3 development progress on <a href="https://github.com/VasylTech/advanced-access-manager" target="_blank">GitHub repository</a> or on twitter <a href="https://twitter.com/vasyltech" target="_blank">@vasyltech</a>.
17
- <br/>The estimated release is mid November 2015.
18
- </p>
19
  </div>
20
  <a class="dashicons dashicons-dismiss" id="close-aam-notification" href="#"></a>
21
  </div>
10
  <div class="aam-notification">
11
  <div class="aam-logo"></div>
12
  <div class="aam-notification-content">
13
+ <h1 style="color: #d80800">Important Notification</h1>
14
+ <h3>The <u>AAM version 3</u> is available for download <a href="https://downloads.wordpress.org/plugin/advanced-access-manager.3.0.zip">here</a></h3>
15
+ <p>Please notice that this is the alpha version and it strongly recommended to install and test it first on a test environment.</p>
 
 
 
16
  </div>
17
  <a class="dashicons dashicons-dismiss" id="close-aam-notification" href="#"></a>
18
  </div>
config.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  //AAM Version for Update purpose
11
- define('AAM_VERSION', '2.9.2');
12
 
13
  define('AAM_BASE_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
14
 
8
  */
9
 
10
  //AAM Version for Update purpose
11
+ define('AAM_VERSION', '2.9.3');
12
 
13
  define('AAM_BASE_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
14
 
library/Zend/Config.php ADDED
@@ -0,0 +1,485 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Zend Framework
4
+ *
5
+ * LICENSE
6
+ *
7
+ * This source file is subject to the new BSD license that is bundled
8
+ * with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://framework.zend.com/license/new-bsd
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@zend.com so we can send you a copy immediately.
14
+ *
15
+ * @category Zend
16
+ * @package Zend_Config
17
+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
18
+ * @license http://framework.zend.com/license/new-bsd New BSD License
19
+ * @version $Id: Config.php 23775 2011-03-01 17:25:24Z ralph $
20
+ */
21
+
22
+ /**
23
+ * File has been modified by Vasyl Martyniuk <martyniuk.vasyl@gmail.com> to fit the
24
+ * project needs.
25
+ */
26
+
27
+ /**
28
+ * @category Zend
29
+ * @package Zend_Config
30
+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
31
+ * @license http://framework.zend.com/license/new-bsd New BSD License
32
+ */
33
+ class Zend_Config implements Countable, Iterator
34
+ {
35
+ /**
36
+ * Whether in-memory modifications to configuration data are allowed
37
+ *
38
+ * @var boolean
39
+ */
40
+ protected $_allowModifications;
41
+
42
+ /**
43
+ * Iteration index
44
+ *
45
+ * @var integer
46
+ */
47
+ protected $_index;
48
+
49
+ /**
50
+ * Number of elements in configuration data
51
+ *
52
+ * @var integer
53
+ */
54
+ protected $_count;
55
+
56
+ /**
57
+ * Contains array of configuration data
58
+ *
59
+ * @var array
60
+ */
61
+ protected $_data;
62
+
63
+ /**
64
+ * Used when unsetting values during iteration to ensure we do not skip
65
+ * the next element
66
+ *
67
+ * @var boolean
68
+ */
69
+ protected $_skipNextIteration;
70
+
71
+ /**
72
+ * Contains which config file sections were loaded. This is null
73
+ * if all sections were loaded, a string name if one section is loaded
74
+ * and an array of string names if multiple sections were loaded.
75
+ *
76
+ * @var mixed
77
+ */
78
+ protected $_loadedSection;
79
+
80
+ /**
81
+ * This is used to track section inheritance. The keys are names of sections that
82
+ * extend other sections, and the values are the extended sections.
83
+ *
84
+ * @var array
85
+ */
86
+ protected $_extends = array();
87
+
88
+ /**
89
+ * Load file error string.
90
+ *
91
+ * Is null if there was no error while file loading
92
+ *
93
+ * @var string
94
+ */
95
+ protected $_loadFileErrorStr = null;
96
+
97
+ /**
98
+ * Zend_Config provides a property based interface to
99
+ * an array. The data are read-only unless $allowModifications
100
+ * is set to true on construction.
101
+ *
102
+ * Zend_Config also implements Countable and Iterator to
103
+ * facilitate easy access to the data.
104
+ *
105
+ * @param array $array
106
+ * @param boolean $allowModifications
107
+ * @return void
108
+ */
109
+ public function __construct(array $array, $allowModifications = false)
110
+ {
111
+ $this->_allowModifications = (boolean) $allowModifications;
112
+ $this->_loadedSection = null;
113
+ $this->_index = 0;
114
+ $this->_data = array();
115
+ foreach ($array as $key => $value) {
116
+ if (is_array($value)) {
117
+ $this->_data[$key] = new self($value, $this->_allowModifications);
118
+ } else {
119
+ $this->_data[$key] = $value;
120
+ }
121
+ }
122
+ $this->_count = count($this->_data);
123
+ }
124
+
125
+ /**
126
+ * Retrieve a value and return $default if there is no element set.
127
+ *
128
+ * @param string $name
129
+ * @param mixed $default
130
+ * @return mixed
131
+ */
132
+ public function get($name, $default = null)
133
+ {
134
+ $result = $default;
135
+ if (array_key_exists($name, $this->_data)) {
136
+ $result = $this->_data[$name];
137
+ }
138
+ return $result;
139
+ }
140
+
141
+ /**
142
+ * Magic function so that $obj->value will work.
143
+ *
144
+ * @param string $name
145
+ * @return mixed
146
+ */
147
+ public function __get($name)
148
+ {
149
+ return $this->get($name);
150
+ }
151
+
152
+ /**
153
+ * Only allow setting of a property if $allowModifications
154
+ * was set to true on construction. Otherwise, throw an exception.
155
+ *
156
+ * @param string $name
157
+ * @param mixed $value
158
+ * @throws Zend_Config_Exception
159
+ * @return void
160
+ */
161
+ public function __set($name, $value)
162
+ {
163
+ if ($this->_allowModifications) {
164
+ if (is_array($value)) {
165
+ $this->_data[$name] = new self($value, true);
166
+ } else {
167
+ $this->_data[$name] = $value;
168
+ }
169
+ $this->_count = count($this->_data);
170
+ } else {
171
+ /** @see Zend_Config_Exception */
172
+ throw new Zend_Config_Exception('Zend_Config is read only');
173
+ }
174
+ }
175
+
176
+ /**
177
+ * Deep clone of this instance to ensure that nested Zend_Configs
178
+ * are also cloned.
179
+ *
180
+ * @return void
181
+ */
182
+ public function __clone()
183
+ {
184
+ $array = array();
185
+ foreach ($this->_data as $key => $value) {
186
+ if ($value instanceof Zend_Config) {
187
+ $array[$key] = clone $value;
188
+ } else {
189
+ $array[$key] = $value;
190
+ }
191
+ }
192
+ $this->_data = $array;
193
+ }
194
+
195
+ /**
196
+ * Return an associative array of the stored data.
197
+ *
198
+ * @return array
199
+ */
200
+ public function toArray()
201
+ {
202
+ $array = array();
203
+ $data = $this->_data;
204
+ foreach ($data as $key => $value) {
205
+ if ($value instanceof Zend_Config) {
206
+ $array[$key] = $value->toArray();
207
+ } else {
208
+ $array[$key] = $value;
209
+ }
210
+ }
211
+ return $array;
212
+ }
213
+
214
+ /**
215
+ * Support isset() overloading on PHP 5.1
216
+ *
217
+ * @param string $name
218
+ * @return boolean
219
+ */
220
+ public function __isset($name)
221
+ {
222
+ return isset($this->_data[$name]);
223
+ }
224
+
225
+ /**
226
+ * Support unset() overloading on PHP 5.1
227
+ *
228
+ * @param string $name
229
+ * @throws Zend_Config_Exception
230
+ * @return void
231
+ */
232
+ public function __unset($name)
233
+ {
234
+ if ($this->_allowModifications) {
235
+ unset($this->_data[$name]);
236
+ $this->_count = count($this->_data);
237
+ $this->_skipNextIteration = true;
238
+ } else {
239
+ /** @see Zend_Config_Exception */
240
+ throw new Zend_Config_Exception('Zend_Config is read only');
241
+ }
242
+
243
+ }
244
+
245
+ /**
246
+ * Defined by Countable interface
247
+ *
248
+ * @return int
249
+ */
250
+ public function count()
251
+ {
252
+ return $this->_count;
253
+ }
254
+
255
+ /**
256
+ * Defined by Iterator interface
257
+ *
258
+ * @return mixed
259
+ */
260
+ public function current()
261
+ {
262
+ $this->_skipNextIteration = false;
263
+ return current($this->_data);
264
+ }
265
+
266
+ /**
267
+ * Defined by Iterator interface
268
+ *
269
+ * @return mixed
270
+ */
271
+ public function key()
272
+ {
273
+ return key($this->_data);
274
+ }
275
+
276
+ /**
277
+ * Defined by Iterator interface
278
+ *
279
+ */
280
+ public function next()
281
+ {
282
+ if ($this->_skipNextIteration) {
283
+ $this->_skipNextIteration = false;
284
+ return;
285
+ }
286
+ next($this->_data);
287
+ $this->_index++;
288
+ }
289
+
290
+ /**
291
+ * Defined by Iterator interface
292
+ *
293
+ */
294
+ public function rewind()
295
+ {
296
+ $this->_skipNextIteration = false;
297
+ reset($this->_data);
298
+ $this->_index = 0;
299
+ }
300
+
301
+ /**
302
+ * Defined by Iterator interface
303
+ *
304
+ * @return boolean
305
+ */
306
+ public function valid()
307
+ {
308
+ return $this->_index < $this->_count;
309
+ }
310
+
311
+ /**
312
+ * Returns the section name(s) loaded.
313
+ *
314
+ * @return mixed
315
+ */
316
+ public function getSectionName()
317
+ {
318
+ if(is_array($this->_loadedSection) && count($this->_loadedSection) == 1) {
319
+ $this->_loadedSection = $this->_loadedSection[0];
320
+ }
321
+ return $this->_loadedSection;
322
+ }
323
+
324
+ /**
325
+ * Returns true if all sections were loaded
326
+ *
327
+ * @return boolean
328
+ */
329
+ public function areAllSectionsLoaded()
330
+ {
331
+ return $this->_loadedSection === null;
332
+ }
333
+
334
+
335
+ /**
336
+ * Merge another Zend_Config with this one. The items
337
+ * in $merge will override the same named items in
338
+ * the current config.
339
+ *
340
+ * @param Zend_Config $merge
341
+ * @return Zend_Config
342
+ */
343
+ public function merge(Zend_Config $merge)
344
+ {
345
+ foreach($merge as $key => $item) {
346
+ if(array_key_exists($key, $this->_data)) {
347
+ if($item instanceof Zend_Config && $this->$key instanceof Zend_Config) {
348
+ $this->$key = $this->$key->merge(new Zend_Config($item->toArray(), !$this->readOnly()));
349
+ } else {
350
+ $this->$key = $item;
351
+ }
352
+ } else {
353
+ if($item instanceof Zend_Config) {
354
+ $this->$key = new Zend_Config($item->toArray(), !$this->readOnly());
355
+ } else {
356
+ $this->$key = $item;
357
+ }
358
+ }
359
+ }
360
+
361
+ return $this;
362
+ }
363
+
364
+ /**
365
+ * Prevent any more modifications being made to this instance. Useful
366
+ * after merge() has been used to merge multiple Zend_Config objects
367
+ * into one object which should then not be modified again.
368
+ *
369
+ */
370
+ public function setReadOnly()
371
+ {
372
+ $this->_allowModifications = false;
373
+ foreach ($this->_data as $key => $value) {
374
+ if ($value instanceof Zend_Config) {
375
+ $value->setReadOnly();
376
+ }
377
+ }
378
+ }
379
+
380
+ /**
381
+ * Returns if this Zend_Config object is read only or not.
382
+ *
383
+ * @return boolean
384
+ */
385
+ public function readOnly()
386
+ {
387
+ return !$this->_allowModifications;
388
+ }
389
+
390
+ /**
391
+ * Get the current extends
392
+ *
393
+ * @return array
394
+ */
395
+ public function getExtends()
396
+ {
397
+ return $this->_extends;
398
+ }
399
+
400
+ /**
401
+ * Set an extend for Zend_Config_Writer
402
+ *
403
+ * @param string $extendingSection
404
+ * @param string $extendedSection
405
+ * @return void
406
+ */
407
+ public function setExtend($extendingSection, $extendedSection = null)
408
+ {
409
+ if ($extendedSection === null && isset($this->_extends[$extendingSection])) {
410
+ unset($this->_extends[$extendingSection]);
411
+ } else if ($extendedSection !== null) {
412
+ $this->_extends[$extendingSection] = $extendedSection;
413
+ }
414
+ }
415
+
416
+ /**
417
+ * Throws an exception if $extendingSection may not extend $extendedSection,
418
+ * and tracks the section extension if it is valid.
419
+ *
420
+ * @param string $extendingSection
421
+ * @param string $extendedSection
422
+ * @throws Zend_Config_Exception
423
+ * @return void
424
+ */
425
+ protected function _assertValidExtend($extendingSection, $extendedSection)
426
+ {
427
+ // detect circular section inheritance
428
+ $extendedSectionCurrent = $extendedSection;
429
+ while (array_key_exists($extendedSectionCurrent, $this->_extends)) {
430
+ if ($this->_extends[$extendedSectionCurrent] == $extendingSection) {
431
+ /** @see Zend_Config_Exception */
432
+ throw new Zend_Config_Exception('Illegal circular inheritance detected');
433
+ }
434
+ $extendedSectionCurrent = $this->_extends[$extendedSectionCurrent];
435
+ }
436
+ // remember that this section extends another section
437
+ $this->_extends[$extendingSection] = $extendedSection;
438
+ }
439
+
440
+ /**
441
+ * Handle any errors from simplexml_load_file or parse_ini_file
442
+ *
443
+ * @param integer $errno
444
+ * @param string $errstr
445
+ * @param string $errfile
446
+ * @param integer $errline
447
+ */
448
+ protected function _loadFileErrorHandler($errno, $errstr, $errfile, $errline)
449
+ {
450
+ if ($this->_loadFileErrorStr === null) {
451
+ $this->_loadFileErrorStr = $errstr;
452
+ } else {
453
+ $this->_loadFileErrorStr .= (PHP_EOL . $errstr);
454
+ }
455
+ }
456
+
457
+ /**
458
+ * Merge two arrays recursively, overwriting keys of the same name
459
+ * in $firstArray with the value in $secondArray.
460
+ *
461
+ * @param mixed $firstArray First array
462
+ * @param mixed $secondArray Second array to merge into first array
463
+ * @return array
464
+ */
465
+ protected function _arrayMergeRecursive($firstArray, $secondArray)
466
+ {
467
+ if (is_array($firstArray) && is_array($secondArray)) {
468
+ foreach ($secondArray as $key => $value) {
469
+ if (isset($firstArray[$key])) {
470
+ $firstArray[$key] = $this->_arrayMergeRecursive($firstArray[$key], $value);
471
+ } else {
472
+ if($key === 0) {
473
+ $firstArray= array(0=>$this->_arrayMergeRecursive($firstArray, $value));
474
+ } else {
475
+ $firstArray[$key] = $value;
476
+ }
477
+ }
478
+ }
479
+ } else {
480
+ $firstArray = $secondArray;
481
+ }
482
+
483
+ return $firstArray;
484
+ }
485
+ }
library/Zend/Config/Exception.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Zend Framework
4
+ *
5
+ * LICENSE
6
+ *
7
+ * This source file is subject to the new BSD license that is bundled
8
+ * with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://framework.zend.com/license/new-bsd
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@zend.com so we can send you a copy immediately.
14
+ *
15
+ * @category Zend
16
+ * @package Zend_Config
17
+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
18
+ * @license http://framework.zend.com/license/new-bsd New BSD License
19
+ * @version $Id: Exception.php 23775 2011-03-01 17:25:24Z ralph $
20
+ */
21
+
22
+ /**
23
+ * File has been modified by Vasyl Martyniuk <martyniuk.vasyl@gmail.com> to fit the
24
+ * project needs.
25
+ */
26
+
27
+ /**
28
+ * @category Zend
29
+ * @package Zend_Config
30
+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
31
+ * @license http://framework.zend.com/license/new-bsd New BSD License
32
+ */
33
+ class Zend_Config_Exception extends Zend_Exception {}
library/Zend/Config/Ini.php ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Zend Framework
4
+ *
5
+ * LICENSE
6
+ *
7
+ * This source file is subject to the new BSD license that is bundled
8
+ * with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://framework.zend.com/license/new-bsd
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@zend.com so we can send you a copy immediately.
14
+ *
15
+ * @category Zend
16
+ * @package Zend_Config
17
+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
18
+ * @license http://framework.zend.com/license/new-bsd New BSD License
19
+ * @version $Id: Ini.php 24045 2011-05-23 12:45:11Z rob $
20
+ */
21
+
22
+ /**
23
+ * File has been modified by Vasyl Martyniuk <martyniuk.vasyl@gmail.com> to fit the
24
+ * project needs.
25
+ */
26
+
27
+
28
+ /**
29
+ * @category Zend
30
+ * @package Zend_Config
31
+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
32
+ * @license http://framework.zend.com/license/new-bsd New BSD License
33
+ */
34
+ class Zend_Config_Ini extends Zend_Config
35
+ {
36
+ /**
37
+ * String that separates nesting levels of configuration data identifiers
38
+ *
39
+ * @var string
40
+ */
41
+ protected $_nestSeparator = '.';
42
+
43
+ /**
44
+ * String that separates the parent section name
45
+ *
46
+ * @var string
47
+ */
48
+ protected $_sectionSeparator = ':';
49
+
50
+ /**
51
+ * Whether to skip extends or not
52
+ *
53
+ * @var boolean
54
+ */
55
+ protected $_skipExtends = false;
56
+
57
+ /**
58
+ * Loads the section $section from the config file $filename for
59
+ * access facilitated by nested object properties.
60
+ *
61
+ * If the section name contains a ":" then the section name to the right
62
+ * is loaded and included into the properties. Note that the keys in
63
+ * this $section will override any keys of the same
64
+ * name in the sections that have been included via ":".
65
+ *
66
+ * If the $section is null, then all sections in the ini file are loaded.
67
+ *
68
+ * If any key includes a ".", then this will act as a separator to
69
+ * create a sub-property.
70
+ *
71
+ * example ini file:
72
+ * [all]
73
+ * db.connection = database
74
+ * hostname = live
75
+ *
76
+ * [staging : all]
77
+ * hostname = staging
78
+ *
79
+ * after calling $data = new Zend_Config_Ini($file, 'staging'); then
80
+ * $data->hostname === "staging"
81
+ * $data->db->connection === "database"
82
+ *
83
+ * The $options parameter may be provided as either a boolean or an array.
84
+ * If provided as a boolean, this sets the $allowModifications option of
85
+ * Zend_Config. If provided as an array, there are three configuration
86
+ * directives that may be set. For example:
87
+ *
88
+ * $options = array(
89
+ * 'allowModifications' => false,
90
+ * 'nestSeparator' => ':',
91
+ * 'skipExtends' => false,
92
+ * );
93
+ *
94
+ * @param string $filename
95
+ * @param mixed $section
96
+ * @param boolean|array $options
97
+ * @throws Zend_Config_Exception
98
+ * @return void
99
+ */
100
+ public function __construct($filename, $section = null, $options = false)
101
+ {
102
+ if (empty($filename)) {
103
+ /**
104
+ * @see Zend_Config_Exception
105
+ */
106
+ throw new Zend_Config_Exception('Filename is not set');
107
+ }
108
+
109
+ $allowModifications = false;
110
+ if (is_bool($options)) {
111
+ $allowModifications = $options;
112
+ } elseif (is_array($options)) {
113
+ if (isset($options['allowModifications'])) {
114
+ $allowModifications = (bool) $options['allowModifications'];
115
+ }
116
+ if (isset($options['nestSeparator'])) {
117
+ $this->_nestSeparator = (string) $options['nestSeparator'];
118
+ }
119
+ if (isset($options['skipExtends'])) {
120
+ $this->_skipExtends = (bool) $options['skipExtends'];
121
+ }
122
+ }
123
+
124
+ $iniArray = $this->_loadIniFile($filename);
125
+
126
+ if (null === $section) {
127
+ // Load entire file
128
+ $dataArray = array();
129
+ foreach ($iniArray as $sectionName => $sectionData) {
130
+ if(!is_array($sectionData)) {
131
+ $dataArray = $this->_arrayMergeRecursive($dataArray, $this->_processKey(array(), $sectionName, $sectionData));
132
+ } else {
133
+ $dataArray[$sectionName] = $this->_processSection($iniArray, $sectionName);
134
+ }
135
+ }
136
+ parent::__construct($dataArray, $allowModifications);
137
+ } else {
138
+ // Load one or more sections
139
+ if (!is_array($section)) {
140
+ $section = array($section);
141
+ }
142
+ $dataArray = array();
143
+ foreach ($section as $sectionName) {
144
+ if (!isset($iniArray[$sectionName])) {
145
+ /**
146
+ * @see Zend_Config_Exception
147
+ */
148
+ throw new Zend_Config_Exception("Section '$sectionName' cannot be found in $filename");
149
+ }
150
+ $dataArray = $this->_arrayMergeRecursive($this->_processSection($iniArray, $sectionName), $dataArray);
151
+
152
+ }
153
+ parent::__construct($dataArray, $allowModifications);
154
+ }
155
+
156
+ $this->_loadedSection = $section;
157
+ }
158
+
159
+ /**
160
+ * Load the INI file from disk using parse_ini_file(). Use a private error
161
+ * handler to convert any loading errors into a Zend_Config_Exception
162
+ *
163
+ * @param string $filename
164
+ * @throws Zend_Config_Exception
165
+ * @return array
166
+ */
167
+ protected function _parseIniFile($filename)
168
+ {
169
+ set_error_handler(array($this, '_loadFileErrorHandler'));
170
+ $iniArray = parse_ini_file($filename, true); // Warnings and errors are suppressed
171
+ restore_error_handler();
172
+
173
+ // Check if there was a error while loading file
174
+ if ($this->_loadFileErrorStr !== null) {
175
+ /**
176
+ * @see Zend_Config_Exception
177
+ */
178
+ throw new Zend_Config_Exception($this->_loadFileErrorStr);
179
+ }
180
+
181
+ return $iniArray;
182
+ }
183
+
184
+ /**
185
+ * Load the ini file and preprocess the section separator (':' in the
186
+ * section name (that is used for section extension) so that the resultant
187
+ * array has the correct section names and the extension information is
188
+ * stored in a sub-key called ';extends'. We use ';extends' as this can
189
+ * never be a valid key name in an INI file that has been loaded using
190
+ * parse_ini_file().
191
+ *
192
+ * @param string $filename
193
+ * @throws Zend_Config_Exception
194
+ * @return array
195
+ */
196
+ protected function _loadIniFile($filename)
197
+ {
198
+ $loaded = $this->_parseIniFile($filename);
199
+ $iniArray = array();
200
+ foreach ($loaded as $key => $data)
201
+ {
202
+ $pieces = explode($this->_sectionSeparator, $key);
203
+ $thisSection = trim($pieces[0]);
204
+ switch (count($pieces)) {
205
+ case 1:
206
+ $iniArray[$thisSection] = $data;
207
+ break;
208
+
209
+ case 2:
210
+ $extendedSection = trim($pieces[1]);
211
+ $iniArray[$thisSection] = array_merge(array(';extends'=>$extendedSection), $data);
212
+ break;
213
+
214
+ default:
215
+ /**
216
+ * @see Zend_Config_Exception
217
+ */
218
+ throw new Zend_Config_Exception("Section '$thisSection' may not extend multiple sections in $filename");
219
+ }
220
+ }
221
+
222
+ return $iniArray;
223
+ }
224
+
225
+ /**
226
+ * Process each element in the section and handle the ";extends" inheritance
227
+ * key. Passes control to _processKey() to handle the nest separator
228
+ * sub-property syntax that may be used within the key name.
229
+ *
230
+ * @param array $iniArray
231
+ * @param string $section
232
+ * @param array $config
233
+ * @throws Zend_Config_Exception
234
+ * @return array
235
+ */
236
+ protected function _processSection($iniArray, $section, $config = array())
237
+ {
238
+ $thisSection = $iniArray[$section];
239
+
240
+ foreach ($thisSection as $key => $value) {
241
+ if (strtolower($key) == ';extends') {
242
+ if (isset($iniArray[$value])) {
243
+ $this->_assertValidExtend($section, $value);
244
+
245
+ if (!$this->_skipExtends) {
246
+ $config = $this->_processSection($iniArray, $value, $config);
247
+ }
248
+ } else {
249
+ /**
250
+ * @see Zend_Config_Exception
251
+ */
252
+ throw new Zend_Config_Exception("Parent section '$section' cannot be found");
253
+ }
254
+ } else {
255
+ $config = $this->_processKey($config, $key, $value);
256
+ }
257
+ }
258
+ return $config;
259
+ }
260
+
261
+ /**
262
+ * Assign the key's value to the property list. Handles the
263
+ * nest separator for sub-properties.
264
+ *
265
+ * @param array $config
266
+ * @param string $key
267
+ * @param string $value
268
+ * @throws Zend_Config_Exception
269
+ * @return array
270
+ */
271
+ protected function _processKey($config, $key, $value)
272
+ {
273
+ if (strpos($key, $this->_nestSeparator) !== false) {
274
+ $pieces = explode($this->_nestSeparator, $key, 2);
275
+ if (strlen($pieces[0]) && strlen($pieces[1])) {
276
+ if (!isset($config[$pieces[0]])) {
277
+ if ($pieces[0] === '0' && !empty($config)) {
278
+ // convert the current values in $config into an array
279
+ $config = array($pieces[0] => $config);
280
+ } else {
281
+ $config[$pieces[0]] = array();
282
+ }
283
+ } elseif (!is_array($config[$pieces[0]])) {
284
+ /**
285
+ * @see Zend_Config_Exception
286
+ */
287
+ throw new Zend_Config_Exception("Cannot create sub-key for '{$pieces[0]}' as key already exists");
288
+ }
289
+ $config[$pieces[0]] = $this->_processKey($config[$pieces[0]], $pieces[1], $value);
290
+ } else {
291
+ /**
292
+ * @see Zend_Config_Exception
293
+ */
294
+ throw new Zend_Config_Exception("Invalid key '$key'");
295
+ }
296
+ } else {
297
+ $config[$key] = $value;
298
+ }
299
+ return $config;
300
+ }
301
+ }
library/Zend/Exception.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Zend Framework
4
+ *
5
+ * LICENSE
6
+ *
7
+ * This source file is subject to the new BSD license that is bundled
8
+ * with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://framework.zend.com/license/new-bsd
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@zend.com so we can send you a copy immediately.
14
+ *
15
+ * @category Zend
16
+ * @package Zend
17
+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
18
+ * @license http://framework.zend.com/license/new-bsd New BSD License
19
+ * @version $Id: Exception.php 23775 2011-03-01 17:25:24Z ralph $
20
+ */
21
+
22
+ /**
23
+ * File has been modified by Vasyl Martyniuk <martyniuk.vasyl@gmail.com> to fit the
24
+ * project needs.
25
+ */
26
+
27
+ /**
28
+ * @category Zend
29
+ * @package Zend
30
+ * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
31
+ * @license http://framework.zend.com/license/new-bsd New BSD License
32
+ */
33
+ class Zend_Exception extends Exception
34
+ {
35
+ /**
36
+ * @var null|Exception
37
+ */
38
+ private $_previous = null;
39
+
40
+ /**
41
+ * Construct the exception
42
+ *
43
+ * @param string $msg
44
+ * @param int $code
45
+ * @param Exception $previous
46
+ * @return void
47
+ */
48
+ public function __construct($msg = '', $code = 0, Exception $previous = null)
49
+ {
50
+ if (version_compare(PHP_VERSION, '5.3.0', '<')) {
51
+ parent::__construct($msg, (int) $code);
52
+ $this->_previous = $previous;
53
+ } else {
54
+ parent::__construct($msg, (int) $code, $previous);
55
+ }
56
+ }
57
+
58
+ /**
59
+ * Overloading
60
+ *
61
+ * For PHP < 5.3.0, provides access to the getPrevious() method.
62
+ *
63
+ * @param string $method
64
+ * @param array $args
65
+ * @return mixed
66
+ */
67
+ public function __call($method, array $args)
68
+ {
69
+ if ('getprevious' == strtolower($method)) {
70
+ return $this->_getPrevious();
71
+ }
72
+ return null;
73
+ }
74
+
75
+ /**
76
+ * String representation of the exception
77
+ *
78
+ * @return string
79
+ */
80
+ public function __toString()
81
+ {
82
+ if (version_compare(PHP_VERSION, '5.3.0', '<')) {
83
+ if (null !== ($e = $this->getPrevious())) {
84
+ return $e->__toString()
85
+ . "\n\nNext "
86
+ . parent::__toString();
87
+ }
88
+ }
89
+ return parent::__toString();
90
+ }
91
+
92
+ /**
93
+ * Returns previous Exception
94
+ *
95
+ * @return Exception|null
96
+ */
97
+ protected function _getPrevious()
98
+ {
99
+ return $this->_previous;
100
+ }
101
+ }
media/css/codemirror.css ADDED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* BASICS */
2
+
3
+ .CodeMirror {
4
+ /* Set height, width, borders, and global font properties here */
5
+ font-family: monospace;
6
+ height: 300px;
7
+ }
8
+ .CodeMirror-scroll {
9
+ /* Set scrolling behaviour here */
10
+ overflow: auto;
11
+ }
12
+
13
+ /* PADDING */
14
+
15
+ .CodeMirror-lines {
16
+ padding: 4px 0; /* Vertical padding around content */
17
+ }
18
+ .CodeMirror pre {
19
+ padding: 0 4px; /* Horizontal padding of content */
20
+ }
21
+
22
+ .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
23
+ background-color: white; /* The little square between H and V scrollbars */
24
+ }
25
+
26
+ /* GUTTER */
27
+
28
+ .CodeMirror-gutters {
29
+ border-right: 1px solid #ddd;
30
+ background-color: #f7f7f7;
31
+ white-space: nowrap;
32
+ }
33
+ .CodeMirror-linenumbers {}
34
+ .CodeMirror-linenumber {
35
+ padding: 0 3px 0 5px;
36
+ min-width: 20px;
37
+ text-align: right;
38
+ color: #999;
39
+ }
40
+
41
+ /* CURSOR */
42
+
43
+ .CodeMirror div.CodeMirror-cursor {
44
+ border-left: 1px solid black;
45
+ z-index: 3;
46
+ }
47
+ /* Shown when moving in bi-directional text */
48
+ .CodeMirror div.CodeMirror-secondarycursor {
49
+ border-left: 1px solid silver;
50
+ }
51
+ .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
52
+ width: auto;
53
+ border: 0;
54
+ background: #7e7;
55
+ z-index: 1;
56
+ }
57
+ /* Can style cursor different in overwrite (non-insert) mode */
58
+ .CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
59
+
60
+ .cm-tab { display: inline-block; }
61
+
62
+ /* DEFAULT THEME */
63
+
64
+ .cm-s-default .cm-keyword {color: #708;}
65
+ .cm-s-default .cm-atom {color: #219;}
66
+ .cm-s-default .cm-number {color: #164;}
67
+ .cm-s-default .cm-def {color: #00f;}
68
+ .cm-s-default .cm-variable {color: black;}
69
+ .cm-s-default .cm-variable-2 {color: #05a;}
70
+ .cm-s-default .cm-variable-3 {color: #085;}
71
+ .cm-s-default .cm-property {color: black;}
72
+ .cm-s-default .cm-operator {color: black;}
73
+ .cm-s-default .cm-comment {color: #a50;}
74
+ .cm-s-default .cm-string {color: #a11;}
75
+ .cm-s-default .cm-string-2 {color: #f50;}
76
+ .cm-s-default .cm-meta {color: #555;}
77
+ .cm-s-default .cm-error {color: #f00;}
78
+ .cm-s-default .cm-qualifier {color: #555;}
79
+ .cm-s-default .cm-builtin {color: #30a;}
80
+ .cm-s-default .cm-bracket {color: #997;}
81
+ .cm-s-default .cm-tag {color: #170;}
82
+ .cm-s-default .cm-attribute {color: #00c;}
83
+ .cm-s-default .cm-header {color: blue;}
84
+ .cm-s-default .cm-quote {color: #090;}
85
+ .cm-s-default .cm-hr {color: #999;}
86
+ .cm-s-default .cm-link {color: #00c;}
87
+
88
+ .cm-negative {color: #d44;}
89
+ .cm-positive {color: #292;}
90
+ .cm-header, .cm-strong {font-weight: bold;}
91
+ .cm-em {font-style: italic;}
92
+ .cm-link {text-decoration: underline;}
93
+
94
+ .cm-invalidchar {color: #f00;}
95
+
96
+ div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
97
+ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
98
+ .CodeMirror-activeline-background {background: #e8f2ff;}
99
+
100
+ /* STOP */
101
+
102
+ /* The rest of this file contains styles related to the mechanics of
103
+ the editor. You probably shouldn't touch them. */
104
+
105
+ .CodeMirror {
106
+ line-height: 1;
107
+ position: relative;
108
+ overflow: hidden;
109
+ background: #FFFFFF;
110
+ color: black;
111
+ border: 1px solid #CCCCCC;
112
+ border-radius: 4px;
113
+ padding: 1px;
114
+ }
115
+
116
+ .CodeMirror-scroll {
117
+ /* 30px is the magic margin used to hide the element's real scrollbars */
118
+ /* See overflow: hidden in .CodeMirror */
119
+ background-color: #F9F9F9;
120
+ font-size: 1.1em;
121
+ height: 100%;
122
+ outline: none; /* Prevent dragging from highlighting the element */
123
+ position: relative;
124
+ }
125
+ .CodeMirror-sizer {
126
+ position: relative;
127
+ }
128
+
129
+ /* The fake, visible scrollbars. Used to force redraw during scrolling
130
+ before actuall scrolling happens, thus preventing shaking and
131
+ flickering artifacts. */
132
+ .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
133
+ position: absolute;
134
+ z-index: 6;
135
+ display: none;
136
+ }
137
+ .CodeMirror-vscrollbar {
138
+ right: 0; top: 0;
139
+ overflow-x: hidden;
140
+ overflow-y: scroll;
141
+ }
142
+ .CodeMirror-hscrollbar {
143
+ bottom: 0; left: 0;
144
+ overflow-y: hidden;
145
+ overflow-x: scroll;
146
+ }
147
+ .CodeMirror-scrollbar-filler {
148
+ right: 0; bottom: 0;
149
+ }
150
+ .CodeMirror-gutter-filler {
151
+ left: 0; bottom: 0;
152
+ }
153
+
154
+ .CodeMirror-gutters {
155
+ position: absolute; left: 0; top: 0;
156
+ padding-bottom: 30px;
157
+ z-index: 3;
158
+ }
159
+ .CodeMirror-gutter {
160
+ white-space: normal;
161
+ height: 100%;
162
+ padding-bottom: 30px;
163
+ margin-bottom: -32px;
164
+ display: inline-block;
165
+ /* Hack to make IE7 behave */
166
+ *zoom:1;
167
+ *display:inline;
168
+ }
169
+ .CodeMirror-gutter-elt {
170
+ position: absolute;
171
+ cursor: default;
172
+ z-index: 4;
173
+ }
174
+
175
+ .CodeMirror-lines {
176
+ cursor: text;
177
+ }
178
+ .CodeMirror pre {
179
+ /* Reset some styles that the rest of the page might have set */
180
+ -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
181
+ border-width: 0;
182
+ background: transparent;
183
+ font-family: inherit;
184
+ font-size: inherit;
185
+ margin: 0;
186
+ white-space: pre;
187
+ word-wrap: normal;
188
+ line-height: inherit;
189
+ color: inherit;
190
+ z-index: 2;
191
+ position: relative;
192
+ overflow: visible;
193
+ }
194
+ .CodeMirror-wrap pre {
195
+ word-wrap: break-word;
196
+ white-space: pre-wrap;
197
+ word-break: normal;
198
+ }
199
+ .CodeMirror-code pre {
200
+ border-right: 30px solid transparent;
201
+ width: -webkit-fit-content;
202
+ width: -moz-fit-content;
203
+ width: fit-content;
204
+ }
205
+ .CodeMirror-wrap .CodeMirror-code pre {
206
+ border-right: none;
207
+ width: auto;
208
+ }
209
+ .CodeMirror-linebackground {
210
+ position: absolute;
211
+ left: 0; right: 0; top: 0; bottom: 0;
212
+ z-index: 0;
213
+ }
214
+
215
+ .CodeMirror-linewidget {
216
+ position: relative;
217
+ z-index: 2;
218
+ overflow: auto;
219
+ }
220
+
221
+ .CodeMirror-widget {
222
+ }
223
+
224
+ .CodeMirror-wrap .CodeMirror-scroll {
225
+ overflow-x: hidden;
226
+ }
227
+
228
+ .CodeMirror-measure {
229
+ position: absolute;
230
+ width: 100%; height: 0px;
231
+ overflow: hidden;
232
+ visibility: hidden;
233
+ }
234
+ .CodeMirror-measure pre { position: static; }
235
+
236
+ .CodeMirror div.CodeMirror-cursor {
237
+ position: absolute;
238
+ visibility: hidden;
239
+ border-right: none;
240
+ width: 0;
241
+ }
242
+ .CodeMirror-focused div.CodeMirror-cursor {
243
+ visibility: visible;
244
+ }
245
+
246
+ .CodeMirror-selected { background: #d9d9d9; }
247
+ .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
248
+
249
+ .cm-searching {
250
+ background: #ffa;
251
+ background: rgba(255, 255, 0, .4);
252
+ }
253
+
254
+ /* IE7 hack to prevent it from returning funny offsetTops on the spans */
255
+ .CodeMirror span { *vertical-align: text-bottom; }
256
+
257
+ @media print {
258
+ /* Hide the cursor when printing */
259
+ .CodeMirror div.CodeMirror-cursor {
260
+ visibility: hidden;
261
+ }
262
+ }
media/css/common.css DELETED
@@ -1,369 +0,0 @@
1
- /**
2
- * ======================================================================
3
- * LICENSE: This file is subject to the terms and conditions defined in *
4
- * file 'license.txt', which is part of this source code package. *
5
- * ======================================================================
6
- */
7
- .aam-beta-version{
8
- margin: 15px 10px;
9
- border: 1px solid #FF8888;
10
- border-radius: 4px;
11
- padding: 4px;
12
- text-align: center;
13
- font-weight: bold;
14
- font-size: 1.1em;
15
- }
16
-
17
- .aam-hidden{
18
- display: none;
19
- }
20
-
21
- .aam-dialog{
22
- display: none;
23
- }
24
-
25
- .wrap a{
26
- outline: 0;
27
- }
28
-
29
- .aam-tooltip {
30
- display:none;
31
- position:absolute;
32
- border:1px solid #CCCCCC;
33
- background-color: #F5F5F5;
34
- border-radius: 4px;
35
- box-shadow: 0 0 5px #AAAAAA;
36
- padding: 5px 10px;
37
- z-index: 9999;
38
- color: #333333;
39
- font-size: 1em;
40
- max-width: 300px;
41
- left:0px;
42
- top: 0px;
43
- font-weight: bold;
44
- font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
45
- }
46
-
47
- .aam-icon{
48
- text-indent: -9999px;
49
- text-align: center;
50
- background-repeat: no-repeat;
51
- }
52
-
53
- a.aam-icon{
54
- outline: none;
55
- }
56
-
57
- .aam-icon span {
58
- content: "";
59
- display: block;
60
- background-repeat: no-repeat;
61
- opacity: 1;
62
- -webkit-transition: opacity 0.5s;
63
- -moz-transition: opacity 0.5s;
64
- -o-transition: opacity 0.5s;
65
- }
66
-
67
- .aam-icon span:hover{
68
- opacity: 1;
69
- }
70
-
71
- .aam-icon-large span {
72
- background-image: url('images/common/large-iconset.png');
73
- width: 48px;
74
- height: 48px;
75
- margin-left: calc(50% - 24px);
76
- margin-left: -moz-calc(50% - 24px);
77
- }
78
-
79
- .aam-icon-medium span {
80
- background-image: url('images/common/medium-iconset.png');
81
- width: 24px;
82
- height: 24px;
83
- margin-left: calc(50% - 12px);
84
- margin-left: -moz-calc(50% - 12px);
85
- }
86
-
87
- .aam-icon-small span {
88
- background-image: url('images/common/small-iconset.png');
89
- width: 16px;
90
- height: 16px;
91
- margin-left: calc(50% - 8px);
92
- margin-left: -moz-calc(50% - 8px);
93
- }
94
-
95
- .aam-icon-large-active{
96
- background-position-y: -48px !important;
97
- }
98
-
99
- .aam-icon-medium-active{
100
- background-position-y: -24px !important;
101
- }
102
-
103
- .aam-icon-small-active{
104
- background-position-y: -16px !important;
105
- }
106
-
107
- .aam-icon-large-save span{
108
- background-position: 0 0;
109
- }
110
-
111
- .aam-icon-large-save:hover span{
112
- background-position: 0 -48px;
113
- }
114
-
115
- .aam-icon-large-roleback span{
116
- background-position: -48px 0;
117
- }
118
-
119
- .aam-icon-large-roleback:hover span{
120
- background-position: -48px -48px;
121
- }
122
-
123
- .aam-icon-large-twitter span{
124
- background-position: -96px 0;
125
- }
126
-
127
- .aam-icon-large-twitter:hover span{
128
- background-position: -96px -48px;
129
- }
130
-
131
- .aam-icon-large-message span{
132
- background-position: -144px 0;
133
- }
134
-
135
- .aam-icon-large-message:hover span{
136
- background-position: -144px -48px;
137
- }
138
-
139
- .aam-icon-large-link span{
140
- background-position: -192px 0;
141
- }
142
-
143
- .aam-icon-large-link:hover span{
144
- background-position: -192px -48px;
145
- }
146
-
147
- .aam-icon-large-info span{
148
- background-position: -240px 0;
149
- }
150
-
151
- .aam-icon-large-info:hover span{
152
- background-position: -240px -48px;
153
- }
154
-
155
- .aam-icon-large-editor span{
156
- background-position: -288px 0;
157
- }
158
-
159
- .aam-icon-large-editor:hover span{
160
- background-position: -288px -48px;
161
- }
162
-
163
- .aam-icon-medium-add span{
164
- background-position: 0 0;
165
- }
166
-
167
- .aam-icon-medium-add:hover span{
168
- background-position: 0 -24px;
169
- }
170
-
171
- .aam-icon-medium-refresh span{
172
- background-position: -24px 0px;
173
- }
174
-
175
- .aam-icon-medium-refresh:hover span{
176
- background-position: -24px -24px;
177
- }
178
-
179
- .aam-icon-medium-filter span{
180
- background-position: -48px 0px;
181
- }
182
-
183
- .aam-icon-medium-filter:hover span{
184
- background-position: -48px -24px;
185
- }
186
-
187
- .aam-icon-medium-copy span{
188
- background-position: -72px 0px;
189
- }
190
-
191
- .aam-icon-medium-copy:hover span{
192
- background-position: -72px -24px;
193
- }
194
-
195
- .aam-icon-medium-roleback span{
196
- background-position: -96px 0px;
197
- }
198
-
199
- .aam-icon-medium-roleback:hover span{
200
- background-position: -96px -24px;
201
- }
202
-
203
- .aam-icon-medium-twitter span{
204
- background-position: -120px 0;
205
- }
206
-
207
- .aam-icon-medium-twitter:hover span{
208
- background-position: -120px -24px;
209
- }
210
-
211
- .aam-icon-medium-help span{
212
- background-position: -144px 0;
213
- }
214
-
215
- .aam-icon-medium-help:hover span{
216
- background-position: -144px -24px;
217
- }
218
-
219
- .aam-icon-medium-message span{
220
- background-position: -168px 0;
221
- }
222
-
223
- .aam-icon-medium-message:hover span{
224
- background-position: -168px -24px;
225
- }
226
-
227
- .aam-icon-medium-star span{
228
- background-position: -192px 0;
229
- }
230
-
231
- .aam-icon-medium-star:hover span{
232
- background-position: -192px -24px;
233
- }
234
-
235
- .aam-icon-small-manage span{
236
- background-position: 0 0;
237
- }
238
-
239
- .aam-icon-small-manage:hover span{
240
- background-position: 0 -16px;
241
- }
242
-
243
- .aam-icon-small-delete span{
244
- background-position: -16px 0;
245
- }
246
-
247
- .aam-icon-small-delete:hover span{
248
- background-position: -16px -16px;
249
- }
250
-
251
- .aam-icon-small-pen span{
252
- background-position: -32px 0;
253
- }
254
-
255
- .aam-icon-small-pen:hover span{
256
- background-position: -32px -16px;
257
- }
258
-
259
- .aam-icon-small-edit-user span{
260
- background-position: -48px 0;
261
- }
262
-
263
- .aam-icon-small-edit-user:hover span{
264
- background-position: -48px -16px;
265
- }
266
-
267
- .aam-icon-small-block span{
268
- background-position: -64px 0;
269
- }
270
-
271
- .aam-icon-small-block:hover span{
272
- background-position: -64px -16px;
273
- }
274
-
275
- .aam-icon-small-roleback span{
276
- background-position: -80px 0;
277
- }
278
-
279
- .aam-icon-small-roleback:hover span{
280
- background-position: -80px -16px;
281
- }
282
-
283
- .aam-icon-small-trash span{
284
- background-position: -96px 0;
285
- }
286
-
287
- .aam-icon-small-trash:hover span{
288
- background-position: -96px -16px;
289
- }
290
-
291
- .aam-icon-small-select span{
292
- background-position: -112px 0;
293
- }
294
-
295
- .aam-icon-small-select:hover span{
296
- background-position: -112px -16px;
297
- }
298
-
299
- .large-icons-row{
300
- display: table;
301
- width: 100%;
302
- margin-bottom: 5px;
303
- padding-bottom: 5px;
304
- border-bottom: 1px solid #CCCCCC;
305
- }
306
-
307
- .large-icons-row .aam-icon{
308
- display: table-cell;
309
- text-align: center;
310
- vertical-align: bottom;
311
- text-decoration: none;
312
- text-transform: uppercase;
313
- font-size: 10px;
314
- font-weight: bold;
315
- color: #333333;
316
- }
317
-
318
- .large-icons-row a.disabled span{
319
- opacity: 0.8;
320
- cursor: none;
321
- pointer-events: none;
322
- text-decoration: line-through;
323
- }
324
-
325
- .medium-icons-row{
326
- display: inline-table;
327
- width: 100%;
328
- margin-top: 10px;
329
- }
330
-
331
- .medium-icons-row .aam-icon{
332
- display: table-cell;
333
- text-indent: 0;
334
- font-size: 9px;
335
- font-weight: bold;
336
- color: #333333;
337
- }
338
-
339
- .medium-icons-row a.aam-icon{
340
- text-decoration: none;
341
- }
342
-
343
- .aam-list-row-actions{
344
- width: 100%;
345
- display: inline-table;
346
- text-align: center;
347
- }
348
-
349
- .aam-list-row-actions .aam-icon{
350
- display: table-cell;
351
- }
352
-
353
- .aam-warning{
354
- width: 100%;
355
- height: 40px;
356
- display: table-row;
357
- background: transparent url('images/common/warning.png') no-repeat 2px center;
358
- -moz-box-sizing: border-box;
359
- -webkit-box-sizing: border-box;
360
- box-sizing: border-box;
361
- margin-top: 1px;
362
- }
363
-
364
- .aam-warning span{
365
- display: table-cell;
366
- vertical-align: middle;
367
- padding-left: 30px;
368
- font-size: 0.9em;
369
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
media/css/images/common/large-iconset.png DELETED
Binary file
media/css/images/common/medium-iconset.png DELETED
Binary file
media/css/images/common/medium-loader.gif DELETED
Binary file
media/css/images/common/small-iconset.png DELETED
Binary file
media/css/images/cpanel/help-forum-active.png ADDED
Binary file
media/css/images/cpanel/help-forum.png ADDED
Binary file
media/css/images/cpanel/message-active.png ADDED
Binary file
media/css/images/cpanel/message.png ADDED
Binary file
media/css/images/cpanel/restore-active.png ADDED
Binary file
media/css/images/cpanel/restore.png ADDED
Binary file
media/css/images/cpanel/save-active.png ADDED
Binary file
media/css/images/cpanel/save.png ADDED
Binary file
media/css/images/cpanel/star-active.png ADDED
Binary file
media/css/images/cpanel/star.png ADDED
Binary file
media/css/images/cpanel/twitter-active.png ADDED
Binary file
media/css/images/cpanel/twitter.png ADDED
Binary file
media/css/images/extension/link-active.png ADDED
Binary file
media/css/images/extension/link.png ADDED
Binary file
media/css/images/extension/message-active.png ADDED
Binary file
media/css/images/extension/message.png ADDED
Binary file
media/css/images/extension/twitter-active.png ADDED
Binary file
media/css/images/extension/twitter.png ADDED
Binary file
media/css/images/logo.png DELETED
Binary file
media/css/images/{common/warning.png → warning.png} RENAMED
File without changes
media/js/codemirror.js ADDED
@@ -0,0 +1 @@
 
1
+ window.CodeMirror=function(){function m(a,b){if(!(this instanceof m))return new m(a,b);this.options=b=b||{};for(var c in Rb)!b.hasOwnProperty(c)&&Rb.hasOwnProperty(c)&&(b[c]=Rb[c]);Sb(b);c=this.display=Td(a,"string"==typeof b.value?0:b.value.first);c.wrapper.CodeMirror=this;Nc(this);b.autofocus&&!Tb&&N(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,draggingText:!1,highlight:new Ub};Oc(this);b.lineWrapping&&(this.display.wrapper.className+= " CodeMirror-wrap");var d=b.value;"string"==typeof d&&(d=new I(b.value,b.mode));t(this,Pc)(this,d);B&&setTimeout(O(Y,this,!0),20);Ud(this);var e;try{e=document.activeElement==c.input}catch(f){}e||b.autofocus&&!Tb?setTimeout(O(ha,this),20):Vb(this);t(this,function(){for(var a in pa)if(pa.propertyIsEnumerable(a))pa[a](this,b[a],Qc);for(a=0;a<Wb.length;++a)Wb[a](this)})()}function Td(a,b){var c={},d=c.input=p("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;"); K?d.style.width="1000px":d.setAttribute("wrap","off");Ia&&(d.style.border="1px solid black");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");c.inputDiv=p("div",[d],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");c.scrollbarH=p("div",[p("div",null,null,"height: 1px")],"CodeMirror-hscrollbar");c.scrollbarV=p("div",[p("div",null,null,"width: 1px")],"CodeMirror-vscrollbar");c.scrollbarFiller=p("div",null,"CodeMirror-scrollbar-filler"); c.gutterFiller=p("div",null,"CodeMirror-gutter-filler");c.lineDiv=p("div",null,"CodeMirror-code");c.selectionDiv=p("div",null,null,"position: relative; z-index: 1");c.cursor=p("div","\u00a0","CodeMirror-cursor");c.otherCursor=p("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor");c.measure=p("div",null,"CodeMirror-measure");c.lineSpace=p("div",[c.measure,c.selectionDiv,c.lineDiv,c.cursor,c.otherCursor],null,"position: relative; outline: none");c.mover=p("div",[p("div",[c.lineSpace],"CodeMirror-lines")], null,"position: relative");c.sizer=p("div",[c.mover],"CodeMirror-sizer");c.heightForcer=p("div",null,null,"position: absolute; height: "+qa+"px; width: 1px;");c.gutters=p("div",null,"CodeMirror-gutters");c.lineGutter=null;c.scroller=p("div",[c.sizer,c.heightForcer,c.gutters],"CodeMirror-scroll");c.scroller.setAttribute("tabIndex","-1");c.wrapper=p("div",[c.inputDiv,c.scrollbarH,c.scrollbarV,c.scrollbarFiller,c.gutterFiller,c.scroller],"CodeMirror");ra&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight= 0);a.appendChild?a.appendChild(c.wrapper):a(c.wrapper);Ia&&(d.style.width="0px");K||(c.scroller.draggable=!0);Xb?(c.inputDiv.style.height="1px",c.inputDiv.style.position="absolute"):ra&&(c.scrollbarH.style.minWidth=c.scrollbarV.style.minWidth="18px");c.viewOffset=c.lastSizeC=0;c.showingFrom=c.showingTo=b;c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null;c.prevInput="";c.alignWidgets=!1;c.pollingFast=!1;c.poll=new Ub;c.cachedCharWidth=c.cachedTextHeight=null;c.measureLineCache=[];c.measureLineCachePos= 0;c.inaccurateSelection=!1;c.maxLine=null;c.maxLineLength=0;c.maxLineChanged=!1;c.wheelDX=c.wheelDY=c.wheelStartX=c.wheelStartY=null;return c}function Ja(a){a.doc.mode=m.getMode(a.options,a.doc.modeOption);a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null)});a.doc.frontier=a.doc.first;Ka(a,100);a.state.modeGen++;a.curOp&&D(a)}function Rc(a){var b=sa(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/Sc(a.display)-3);return function(e){return ia(a.doc, e)?0:c?(Math.ceil(e.text.length/d)||1)*b:b}}function Tc(a){var b=a.doc,c=Rc(a);b.iter(function(a){var b=c(a);b!=a.height&&R(a,b)})}function Uc(a){var b=Z[a.options.keyMap],c=b.style;a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(c?" cm-keymap-"+c:"");a.state.disableInput=b.disableInput}function Oc(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-");ta(a)}function La(a){Nc(a); D(a);setTimeout(function(){Yb(a)},20)}function Nc(a){var b=a.display.gutters,c=a.options.gutters;Ma(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(p("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none"}function mb(a,b){if(0==b.height)return 0;for(var c=b.text.length,d,e=b;d=ua(e,-1);)d=d.find(),e=u(a,d.from.line),c+=d.from.ch-d.to.ch;for(e=b;d=nb(e);)d=d.find(),c-=e.text.length- d.from.ch,e=u(a,d.to.line),c+=e.text.length-d.to.ch;return c}function Zb(a){var b=a.display,c=a.doc;b.maxLine=u(c,c.first);b.maxLineLength=mb(c,b.maxLine);b.maxLineChanged=!0;c.iter(function(a){var e=mb(c,a);e>b.maxLineLength&&(b.maxLineLength=e,b.maxLine=a)})}function Sb(a){for(var b=!1,c=0;c<a.gutters.length;++c)"CodeMirror-linenumbers"==a.gutters[c]&&(a.lineNumbers?b=!0:a.gutters.splice(c--,1));!b&&a.lineNumbers&&a.gutters.push("CodeMirror-linenumbers")}function $b(a){var b=a.display,c=a.doc.height+ (b.mover.offsetHeight-b.lineSpace.offsetHeight);b.sizer.style.minHeight=b.heightForcer.style.top=c+"px";b.gutters.style.height=Math.max(c,b.scroller.clientHeight-qa)+"px";var c=Math.max(c,b.scroller.scrollHeight),d=b.scroller.scrollWidth>b.scroller.clientWidth+1,e=c>b.scroller.clientHeight+1;e?(b.scrollbarV.style.display="block",b.scrollbarV.style.bottom=d?Na(b.measure)+"px":"0",b.scrollbarV.firstChild.style.height=c-b.scroller.clientHeight+b.scrollbarV.clientHeight+"px"):(b.scrollbarV.style.display= "",b.scrollbarV.firstChild.style.height="0");d?(b.scrollbarH.style.display="block",b.scrollbarH.style.right=e?Na(b.measure)+"px":"0",b.scrollbarH.firstChild.style.width=b.scroller.scrollWidth-b.scroller.clientWidth+b.scrollbarH.clientWidth+"px"):(b.scrollbarH.style.display="",b.scrollbarH.firstChild.style.width="0");d&&e?(b.scrollbarFiller.style.display="block",b.scrollbarFiller.style.height=b.scrollbarFiller.style.width=Na(b.measure)+"px"):b.scrollbarFiller.style.display="";d&&a.options.coverGutterNextToScrollbar&& a.options.fixedGutter?(b.gutterFiller.style.display="block",b.gutterFiller.style.height=Na(b.measure)+"px",b.gutterFiller.style.width=b.gutters.offsetWidth+"px"):b.gutterFiller.style.display="";Vd&&0===Na(b.measure)&&(b.scrollbarV.style.minWidth=b.scrollbarH.style.minHeight=Wd?"18px":"12px")}function ac(a,b,c){var d=a.scroller.scrollTop,e=a.wrapper.clientHeight;"number"==typeof c?d=c:c&&(d=c.top,e=c.bottom-c.top);d=Math.floor(d-a.lineSpace.offsetTop);a=Math.ceil(d+e);return{from:Oa(b,d),to:Oa(b,a)}} function Yb(a){var b=a.display;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var c=bc(b)-b.scroller.scrollLeft+a.doc.scrollLeft,d=b.gutters.offsetWidth,e=c+"px",f=b.lineDiv.firstChild;f;f=f.nextSibling)if(f.alignable)for(var g=0,h=f.alignable;g<h.length;++g)h[g].style.left=e;a.options.fixedGutter&&(b.gutters.style.left=c+d+"px")}}function Xd(a){if(!a.options.lineNumbers)return!1;var b=a.doc,b=cc(a.options,b.first+b.size-1);a=a.display;if(b.length!=a.lineNumChars){var c=a.measure.appendChild(p("div", [p("div",b)],"CodeMirror-linenumber CodeMirror-gutter-elt")),d=c.firstChild.offsetWidth,c=c.offsetWidth-d;a.lineGutter.style.width="";a.lineNumInnerWidth=Math.max(d,a.lineGutter.offsetWidth-c);a.lineNumWidth=a.lineNumInnerWidth+c;a.lineNumChars=a.lineNumInnerWidth?b.length:-1;a.lineGutter.style.width=a.lineNumWidth+"px";return!0}return!1}function cc(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function bc(a){return y(a.scroller).left-y(a.sizer).left}function ob(a,b,c,d){for(var e= a.display.showingFrom,f=a.display.showingTo,g,h=ac(a.display,a.doc,c);Yd(a,b,h,d);){d=!1;g=!0;dc(a);$b(a);c&&(c=Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,"number"==typeof c?c:c.top));h=ac(a.display,a.doc,c);if(h.from>=a.display.showingFrom&&h.to<=a.display.showingTo)break;b=[]}g&&(M(a,"update",a),a.display.showingFrom==e&&a.display.showingTo==f||M(a,"viewportChange",a,a.display.showingFrom,a.display.showingTo));return g}function Yd(a,b,c,d){var e=a.display,f=a.doc;if(!e.wrapper.clientWidth)e.showingFrom= e.showingTo=f.first,e.viewOffset=0;else if(d||!(0==b.length&&c.from>e.showingFrom&&c.to<e.showingTo)){Xd(a)&&(b=[{from:f.first,to:f.first+f.size}]);var g=e.sizer.style.marginLeft=e.gutters.offsetWidth+"px";e.scrollbarH.style.left=a.options.fixedGutter?g:"0";g=Infinity;if(a.options.lineNumbers)for(var h=0;h<b.length;++h)b[h].diff&&b[h].from<g&&(g=b[h].from);var h=f.first+f.size,k=Math.max(c.from-a.options.viewportMargin,f.first);c=Math.min(h,c.to+a.options.viewportMargin);e.showingFrom<k&&20>k-e.showingFrom&& (k=Math.max(f.first,e.showingFrom));e.showingTo>c&&20>e.showingTo-c&&(c=Math.min(h,e.showingTo));if(Pa)for(k=P($(f,u(f,k)));c<h&&ia(f,u(f,c));)++c;var l=[{from:Math.max(e.showingFrom,f.first),to:Math.min(e.showingTo,h)}],l=l[0].from>=l[0].to?[]:Zd(l,b);if(Pa)for(h=0;h<l.length;++h){b=l[h];for(var n;n=nb(u(f,b.to-1));)if(n=n.find().from.line,n>b.from)b.to=n;else{l.splice(h--,1);break}}for(h=f=0;h<l.length;++h)b=l[h],b.from<k&&(b.from=k),b.to>c&&(b.to=c),b.from>=b.to?l.splice(h--,1):f+=b.to-b.from; if(d||f!=c-k||k!=e.showingFrom||c!=e.showingTo){l.sort(function(a,b){return a.from-b.from});try{var E=document.activeElement}catch(q){}f<0.7*(c-k)&&(e.lineDiv.style.display="none");$d(a,k,c,l,g);e.lineDiv.style.display="";E&&document.activeElement!=E&&E.offsetHeight&&E.focus();if(k!=e.showingFrom||c!=e.showingTo||e.lastSizeC!=e.wrapper.clientHeight)e.lastSizeC=e.wrapper.clientHeight,Ka(a,400);e.showingFrom=k;e.showingTo=c;ae(a);Vc(a);return!0}Vc(a)}}function ae(a){a=a.display;for(var b=a.lineDiv.offsetTop, c=a.lineDiv.firstChild,d;c;c=c.nextSibling)if(c.lineObj){if(ra){var e=c.offsetTop+c.offsetHeight;d=e-b;b=e}else d=y(c),d=d.bottom-d.top;e=c.lineObj.height-d;2>d&&(d=sa(a));if(0.001<e||-0.001>e)if(R(c.lineObj,d),d=c.lineObj.widgets)for(e=0;e<d.length;++e)d[e].height=d[e].node.offsetHeight}}function Vc(a){var b=a.display.viewOffset=Qa(a,u(a.doc,a.display.showingFrom));a.display.mover.style.top=b+"px"}function Zd(a,b){for(var c=0,d=b.length||0;c<d;++c){for(var e=b[c],f=[],g=e.diff||0,h=0,k=a.length;h< k;++h){var l=a[h];e.to<=l.from&&e.diff?f.push({from:l.from+g,to:l.to+g}):e.to<=l.from||e.from>=l.to?f.push(l):(e.from>l.from&&f.push({from:l.from,to:e.from}),e.to<l.to&&f.push({from:e.to+g,to:l.to+g}))}a=f}return a}function be(a){for(var b=a.display,c={},d={},e=b.gutters.firstChild,f=0;e;e=e.nextSibling,++f)c[a.options.gutters[f]]=e.offsetLeft,d[a.options.gutters[f]]=e.offsetWidth;return{fixedPos:bc(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}} function $d(a,b,c,d,e){function f(b){var c=b.nextSibling;K&&va&&a.display.currentWheelTarget==b?(b.style.display="none",b.lineObj=null):b.parentNode.removeChild(b);return c}var g=be(a),h=a.display,k=a.options.lineNumbers;d.length||K&&a.display.currentWheelTarget||Ma(h.lineDiv);var l=h.lineDiv,n=l.firstChild,E=d.shift(),q=b;for(a.doc.iter(b,c,function(b){E&&E.to==q&&(E=d.shift());if(ia(a.doc,b)){if(0!=b.height&&R(b,0),b.widgets&&n&&n.previousSibling)for(var c=0;c<b.widgets.length;++c){var h=b.widgets[c]; if(h.showIfHidden){var m=n.previousSibling;if(/pre/i.test(m.nodeName)){var C=p("div",null,null,"position: relative");m.parentNode.replaceChild(C,m);C.appendChild(m);m=C}C=m.appendChild(p("div",[h.node],"CodeMirror-linewidget"));h.handleMouseEvents||(C.ignoreEvents=!0);ec(h,C,m,g)}}}else if(E&&E.from<=q&&E.to>q){for(;n.lineObj!=b;)n=f(n);k&&e<=q&&n.lineNumber&&Wc(n.lineNumber,cc(a.options,q));n=n.nextSibling}else{if(b.widgets)for(var C=0,r=n;r&&20>C;++C,r=r.nextSibling)if(r.lineObj==b&&/div/i.test(r.nodeName)){c= r;break}var C=a,u=q,H=c,r=fc(C,b),G=b.gutterMarkers,s=C.display;if(C.options.lineNumbers||G||b.bgClass||b.wrapClass||b.widgets){if(H){H.alignable=null;for(var t=!0,v=0,w=null,x=H.firstChild,z;x;x=z)if(z=x.nextSibling,/\bCodeMirror-linewidget\b/.test(x.className)){for(var y=0;y<b.widgets.length;++y){var B=b.widgets[y];if(B.node==x.firstChild){B.above||w||(w=x);ec(B,x,H,g);++v;break}}if(y==b.widgets.length){t=!1;break}}else H.removeChild(x);H.insertBefore(r,w);t&&v==b.widgets.length&&(h=H,H.className= b.wrapClass||"")}h||(h=p("div",null,b.wrapClass,"position: relative"),h.appendChild(r));b.bgClass&&h.insertBefore(p("div",null,b.bgClass+" CodeMirror-linebackground"),h.firstChild);if(C.options.lineNumbers||G)if(m=h.insertBefore(p("div",null,null,"position: absolute; left: "+(C.options.fixedGutter?g.fixedPos:-g.gutterTotalWidth)+"px"),h.firstChild),C.options.fixedGutter&&(h.alignable||(h.alignable=[])).push(m),!C.options.lineNumbers||G&&G["CodeMirror-linenumbers"]||(h.lineNumber=m.appendChild(p("div", cc(C.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+g.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+s.lineNumInnerWidth+"px"))),G)for(y=0;y<C.options.gutters.length;++y)B=C.options.gutters[y],(u=G.hasOwnProperty(B)&&G[B])&&m.appendChild(p("div",[u],"CodeMirror-gutter-elt","left: "+g.gutterLeft[B]+"px; width: "+g.gutterWidth[B]+"px"));ra&&(h.style.zIndex=2);if(b.widgets&&h!=H)for(y=0,H=b.widgets;y<H.length;++y)B=H[y],G=p("div",[B.node],"CodeMirror-linewidget"),B.handleMouseEvents|| (G.ignoreEvents=!0),ec(B,G,h,g),B.above?h.insertBefore(G,C.options.lineNumbers&&0!=b.height?m:r):h.appendChild(G),M(B,"redraw")}else h=r;if(h!=c)l.insertBefore(h,n);else{for(;n!=c;)n=f(n);n=n.nextSibling}h.lineObj=b}++q});n;)n=f(n)}function ec(a,b,c,d){a.noHScroll&&((c.alignable||(c.alignable=[])).push(b),c=d.wrapperWidth,b.style.left=d.fixedPos+"px",a.coverGutter||(c-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=c+"px");a.coverGutter&&(b.style.zIndex=5,b.style.position= "relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function dc(a){var b=a.display,c=x(a.doc.sel.from,a.doc.sel.to);if(c||a.options.showCursorWhenSelecting){var d=a.display,e=U(a,a.doc.sel.head,"div");d.cursor.style.left=e.left+"px";d.cursor.style.top=e.top+"px";d.cursor.style.height=Math.max(0,e.bottom-e.top)*a.options.cursorHeight+"px";d.cursor.style.display="";e.other?(d.otherCursor.style.display="",d.otherCursor.style.left=e.other.left+"px",d.otherCursor.style.top=e.other.top+ "px",d.otherCursor.style.height=0.85*(e.other.bottom-e.other.top)+"px"):d.otherCursor.style.display="none"}else b.cursor.style.display=b.otherCursor.style.display="none";c?b.selectionDiv.style.display="none":ce(a);a.options.moveInputWithCursor&&(a=U(a,a.doc.sel.head,"div"),c=y(b.wrapper),d=y(b.lineDiv),b.inputDiv.style.top=Math.max(0,Math.min(b.wrapper.clientHeight-10,a.top+d.top-c.top))+"px",b.inputDiv.style.left=Math.max(0,Math.min(b.wrapper.clientWidth-10,a.left+d.left-c.left))+"px")}function ce(a){function b(a, b,c,d){0>b&&(b=0);g.appendChild(p("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?h-a:c)+"px; height: "+(d-b)+"px"))}function c(c,d,f){var g=u(e,c),l=g.text.length,n,m;de(V(g),d||0,null==f?l:f,function(e,u,H){var p=rb(a,r(c,e),"div",g,"left"),s,t;e==u?(s=p,H=t=p.left):(s=rb(a,r(c,u-1),"div",g,"right"),"rtl"==H&&(H=p,p=s,s=H),H=p.left,t=s.right);null==d&&0==e&&(H=k);3<s.top-p.top&&(b(H,p.top,null,p.bottom),H=k,p.bottom<s.top&&b(H,p.bottom,null,s.top)); null==f&&u==l&&(t=h);if(!n||p.top<n.top||p.top==n.top&&p.left<n.left)n=p;if(!m||s.bottom>m.bottom||s.bottom==m.bottom&&s.right>m.right)m=s;H<k+1&&(H=k);b(H,s.top,t-H,s.bottom)});return{start:n,end:m}}var d=a.display,e=a.doc,f=a.doc.sel,g=document.createDocumentFragment(),h=d.lineSpace.offsetWidth,k=W(a.display.measure,p("pre",null,null,"text-align: left")).appendChild(p("span","x")).offsetLeft;if(f.from.line==f.to.line)c(f.from.line,f.from.ch,f.to.ch);else{var l=u(e,f.from.line),n=u(e,f.to.line), n=$(e,l)==$(e,n),l=c(f.from.line,f.from.ch,n?l.text.length:null).end,f=c(f.to.line,n?0:null,f.to.ch).start;n&&(l.top<f.top-2?(b(l.right,l.top,null,l.bottom),b(k,f.top,f.left,f.bottom)):b(l.right,l.top,f.left-l.right,l.bottom));l.bottom<f.top&&b(k,l.bottom,null,f.top)}W(d.selectionDiv,g);d.selectionDiv.style.display=""}function sb(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursor.style.visibility=b.otherCursor.style.visibility="";0<a.options.cursorBlinkRate&&(b.blinker= setInterval(function(){b.cursor.style.visibility=b.otherCursor.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate))}}function Ka(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.showingTo&&a.state.highlight.set(b,O(ee,a))}function ee(a){var b=a.doc;b.frontier<b.first&&(b.frontier=b.first);if(!(b.frontier>=a.display.showingTo)){var c=+new Date+a.options.workTime,d=wa(b.mode,Ra(a,b.frontier)),e=[],f;b.iter(b.frontier,Math.min(b.first+b.size,a.display.showingTo+500),function(g){if(b.frontier>= a.display.showingFrom){var h=g.styles;g.styles=Xc(a,g,d);for(var k=!h||h.length!=g.styles.length,l=0;!k&&l<h.length;++l)k=h[l]!=g.styles[l];k&&(f&&f.end==b.frontier?f.end++:e.push(f={start:b.frontier,end:b.frontier+1}));g.stateAfter=wa(b.mode,d)}else Yc(a,g,d),g.stateAfter=0==b.frontier%5?wa(b.mode,d):null;++b.frontier;if(+new Date>c)return Ka(a,a.options.workDelay),!0});e.length&&t(a,function(){for(var a=0;a<e.length;++a)D(this,e[a].start,e[a].end)})()}}function fe(a,b,c){var d,e,f=a.doc,g=b;for(b-= a.doc.mode.innerMode?1E3:100;g>b;--g){if(g<=f.first)return f.first;var h=u(f,g-1);if(h.stateAfter&&(!c||g<=f.frontier))return g;h=xa(h.text,null,a.options.tabSize);if(null==e||d>h)e=g-1,d=h}return e}function Ra(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=fe(a,b,c),g=f>d.first&&u(d,f-1).stateAfter,g=g?wa(d.mode,g):Zc(d.mode);d.iter(f,b,function(c){Yc(a,c,g);c.stateAfter=f==b-1||0==f%5||f>=e.showingFrom&&f<e.showingTo?wa(d.mode,g):null;++f});return g}function gc(a,b,c,d,e){var f= -1;d=d||hc(a,b);for(a=c;;a+=f){var g=d[a];if(g)break;0>f&&0==a&&(f=1)}e=a>c?"left":a<c?"right":e;"left"==e&&g.leftSide?g=g.leftSide:"right"==e&&g.rightSide&&(g=g.rightSide);return{left:a<c?g.right:g.left,right:a>c?g.left:g.right,top:g.top,bottom:g.bottom}}function ic(a,b){for(var c=a.display.measureLineCache,d=0;d<c.length;++d){var e=c[d];if(e.text==b.text&&e.markedSpans==b.markedSpans&&a.display.scroller.clientWidth==e.width&&e.classes==b.textClass+"|"+b.bgClass+"|"+b.wrapClass)return e}}function ge(a, b){var c=ic(a,b);c&&(c.text=c.measure=c.markedSpans=null)}function hc(a,b){var c=ic(a,b);if(c)return c.measure;var c=he(a,b),d=a.display.measureLineCache,e={text:b.text,width:a.display.scroller.clientWidth,markedSpans:b.markedSpans,measure:c,classes:b.textClass+"|"+b.bgClass+"|"+b.wrapClass};16==d.length?d[++a.display.measureLineCachePos%16]=e:d.push(e);return c}function he(a,b){function c(a){var b=a.top-pb.top,c=a.bottom-pb.top;c>r&&(c=r);0>b&&(b=0);for(var d=m.length-2;0<=d;d-=2){var e=m[d],f=m[d+ 1];if(!(e>c||f<b)&&(e<=b&&f>=c||b<=e&&c>=f||Math.min(c,f)-Math.max(b,e)>=c-b>>1)){m[d]=Math.min(b,e);m[d+1]=Math.max(c,f);break}}0>d&&(d=m.length,m.push(b,c));return{left:a.left-pb.left,right:a.right-pb.left,top:d,bottom:null}}function d(a){a.bottom=m[a.top+1];a.top=m[a.top]}var e=a.display,f=$c(b.text.length),g=fc(a,b,f,!0);if(B&&!ra&&!a.options.lineWrapping&&100<g.childNodes.length){for(var h=document.createDocumentFragment(),k=g.childNodes.length,l=0,n=Math.ceil(k/10);l<n;++l){for(var E=p("div", null,null,"display: inline-block"),q=0;10>q&&k;++q)E.appendChild(g.firstChild),--k;h.appendChild(E)}g.appendChild(h)}W(e.measure,g);var pb=y(e.lineDiv),m=[],h=$c(b.text.length),r=g.offsetHeight;Q&&e.measure.first!=g&&W(e.measure,g);for(l=0;l<f.length;++l)if(e=f[l])g=e,k=null,/\bCodeMirror-widget\b/.test(e.className)&&e.getClientRects&&(1==e.firstChild.nodeType&&(g=e.firstChild),n=g.getClientRects(),1<n.length&&(k=h[l]=c(n[0]),k.rightSide=c(n[n.length-1]))),k||(k=h[l]=c(y(g))),e.measureRight&&(k.right= y(e.measureRight).left),e.leftSide&&(k.leftSide=c(y(e.leftSide)));Ma(a.display.measure);for(l=0;l<h.length;++l)if(e=h[l])d(e),e.leftSide&&d(e.leftSide),e.rightSide&&d(e.rightSide);return h}function ta(a){a.display.measureLineCache.length=a.display.measureLineCachePos=0;a.display.cachedCharWidth=a.display.cachedTextHeight=null;a.options.lineWrapping||(a.display.maxLineChanged=!0);a.display.lineNumChars=null}function jc(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f= tb(b.widgets[e]);c.top+=f;c.bottom+=f}if("line"==d)return c;d||(d="local");b=Qa(a,b);b="local"==d?b+a.display.lineSpace.offsetTop:b-a.display.viewOffset;if("page"==d||"window"==d)a=y(a.display.lineSpace),b+=a.top+("window"==d?0:window.pageYOffset||(document.documentElement||document.body).scrollTop),d=a.left+("window"==d?0:window.pageXOffset||(document.documentElement||document.body).scrollLeft),c.left+=d,c.right+=d;c.top+=b;c.bottom+=b;return c}function ad(a,b,c){if("div"==c)return b;var d=b.left; b=b.top;"page"==c?(d-=window.pageXOffset||(document.documentElement||document.body).scrollLeft,b-=window.pageYOffset||(document.documentElement||document.body).scrollTop):"local"!=c&&c||(c=y(a.display.sizer),d+=c.left,b+=c.top);a=y(a.display.lineSpace);return{left:d-a.left,top:b-a.top}}function rb(a,b,c,d,e){d||(d=u(a.doc,b.line));return jc(a,d,gc(a,d,b.ch,null,e),c)}function U(a,b,c,d,e){function f(b,f){var g=gc(a,d,b,e,f?"right":"left");f?g.left=g.right:g.right=g.left;return jc(a,d,g,c)}function g(a, b){var c=h[b],d=c.level%2;a==kc(c)&&b&&c.level<h[b-1].level?(c=h[--b],a=lc(c)-(c.level%2?0:1),d=!0):a==lc(c)&&b<h.length-1&&c.level<h[b+1].level&&(c=h[++b],a=kc(c)-c.level%2,d=!1);return d&&a==c.to&&a>c.from?f(a-1):f(a,d)}d=d||u(a.doc,b.line);e||(e=hc(a,d));var h=V(d);b=b.ch;if(!h)return f(b);var k=mc(h,b),k=g(b,k);null!=ya&&(k.other=g(b,ya));return k}function ub(a,b,c,d){a=new r(a,b);a.xRel=d;c&&(a.outside=!0);return a}function nc(a,b,c){var d=a.doc;c+=a.display.viewOffset;if(0>c)return ub(d.first, 0,!0,-1);var e=Oa(d,c),f=d.first+d.size-1;if(e>f)return ub(d.first+d.size-1,u(d,f).text.length,!0,1);for(0>b&&(b=0);;){var f=u(d,e),e=ie(a,f,e,b,c),g=(f=nb(f))&&f.find();if(f&&(e.ch>g.from.ch||e.ch==g.from.ch&&0<e.xRel))e=g.to.line;else return e}}function ie(a,b,c,d,e){function f(d){d=U(a,r(c,d),"line",b,l);h=!0;if(g>d.bottom)return d.left-k;if(g<d.top)return d.left+k;h=!1;return d.left}var g=e-Qa(a,b),h=!1,k=2*a.display.wrapper.clientWidth,l=hc(a,b),n=V(b),E=b.text.length;e=vb(b);var q=wb(b),m=f(e), p=h,s=f(q),u=h;if(d>s)return ub(c,q,u,1);for(;;){if(n?q==e||q==oc(b,e,1):1>=q-e){n=d<m||d-m<=s-d?e:q;for(d-=n==e?m:s;pc.test(b.text.charAt(n));)++n;return ub(c,n,n==e?p:u,0>d?-1:d?1:0)}var C=Math.ceil(E/2),t=e+C;if(n)for(var t=e,v=0;v<C;++v)t=oc(b,t,1);v=f(t);if(v>d){q=t;s=v;if(u=h)s+=1E3;E=C}else e=t,m=v,p=h,E-=C}}function sa(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==ja){ja=p("pre");for(var b=0;49>b;++b)ja.appendChild(document.createTextNode("x")),ja.appendChild(p("br")); ja.appendChild(document.createTextNode("x"))}W(a.measure,ja);b=ja.offsetHeight/50;3<b&&(a.cachedTextHeight=b);Ma(a.measure);return b||1}function Sc(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=p("span","x"),c=p("pre",[b]);W(a.measure,c);b=b.offsetWidth;2<b&&(a.cachedCharWidth=b);return b||10}function za(a){a.curOp={changes:[],forceUpdate:!1,updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,cursorActivity:!1,updateMaxLine:!1,updateScrollPos:!1,id:++je};xb++|| (da=[])}function Aa(a){var b=a.curOp,c=a.doc,d=a.display;a.curOp=null;b.updateMaxLine&&Zb(a);if(d.maxLineChanged&&!a.options.lineWrapping&&d.maxLine){var e;e=d.maxLine;var f=!1;if(e.markedSpans)for(var g=0;g<e.markedSpans;++g){var h=e.markedSpans[g];!h.collapsed||null!=h.to&&h.to!=e.text.length||(f=!0)}(f=!f&&ic(a,e))?e=gc(a,e,e.text.length,f.measure,"right").right:(e=fc(a,e,null,!0),f=e.appendChild(Sa(a.display.measure)),W(a.display.measure,e),e=y(f).right-y(a.display.lineDiv).left);d.sizer.style.minWidth= Math.max(0,e+3+qa)+"px";d.maxLineChanged=!1;e=Math.max(0,d.sizer.offsetLeft+d.sizer.offsetWidth-d.scroller.clientWidth);e<c.scrollLeft&&!b.updateScrollPos&&Ba(a,Math.min(d.scroller.scrollLeft,e),!0)}var k,l;b.updateScrollPos?k=b.updateScrollPos:b.selectionChanged&&d.scroller.clientHeight&&(k=U(a,c.sel.head),k=yb(a,k.left,k.top,k.left,k.bottom));if(b.changes.length||b.forceUpdate||k&&null!=k.scrollTop)l=ob(a,b.changes,k&&k.scrollTop,b.forceUpdate),a.display.scroller.offsetHeight&&(a.doc.scrollTop= a.display.scroller.scrollTop);!l&&b.selectionChanged&&dc(a);if(b.updateScrollPos)d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=k.scrollTop,d.scroller.scrollLeft=d.scrollbarH.scrollLeft=c.scrollLeft=k.scrollLeft,Yb(a),b.scrollToPos&&bd(a,s(a.doc,b.scrollToPos),b.scrollToPosMargin);else if(k&&(c=bd(a,a.doc.sel.head,a.options.cursorScrollMargin),a.state.focused&&(d=a.display,k=y(d.sizer),l=null,0>c.top+k.top?l=!0:c.bottom+k.top>(window.innerHeight||document.documentElement.clientHeight)&&(l= !1),null!=l&&!ke))){if(k="none"==d.cursor.style.display)d.cursor.style.display="",d.cursor.style.left=c.left+"px",d.cursor.style.top=c.top-d.viewOffset+"px";d.cursor.scrollIntoView(l);k&&(d.cursor.style.display="none")}b.selectionChanged&&sb(a);a.state.focused&&b.updateInput&&Y(a,b.userSelChange);c=b.maybeHiddenMarkers;d=b.maybeUnhiddenMarkers;if(c)for(l=0;l<c.length;++l)c[l].lines.length||J(c[l],"hide");if(d)for(l=0;l<d.length;++l)d[l].lines.length&&J(d[l],"unhide");var n;--xb||(n=da,da=null);b.textChanged&& J(a,"change",a,b.textChanged);b.cursorActivity&&J(a,"cursorActivity",a);if(n)for(l=0;l<n.length;++l)n[l]()}function t(a,b){return function(){var c=a||this,d=!c.curOp;d&&za(c);try{var e=b.apply(c,arguments)}finally{d&&Aa(c)}return e}}function Ta(a){return function(){var b=this.cm&&!this.cm.curOp,c;b&&za(this.cm);try{c=a.apply(this,arguments)}finally{b&&Aa(this.cm)}return c}}function qc(a,b){var c=!a.curOp,d;c&&za(a);try{d=b()}finally{c&&Aa(a)}return d}function D(a,b,c,d){null==b&&(b=a.doc.first);null== c&&(c=a.doc.first+a.doc.size);a.curOp.changes.push({from:b,to:c,diff:d})}function zb(a){a.display.pollingFast||a.display.poll.set(a.options.pollInterval,function(){rc(a);a.state.focused&&zb(a)})}function Ua(a){function b(){rc(a)||c?(a.display.pollingFast=!1,zb(a)):(c=!0,a.display.poll.set(60,b))}var c=!1;a.display.pollingFast=!0;a.display.poll.set(20,b)}function rc(a){var b=a.display.input,c=a.display.prevInput,d=a.doc,e=d.sel;if(!a.state.focused||le(b)||Va(a)||a.state.disableInput)return!1;a.state.pasteIncoming&& a.state.fakedLastChar&&(b.value=b.value.substring(0,b.value.length-1),a.state.fakedLastChar=!1);var f=b.value;if(f==c&&x(e.from,e.to))return!1;if(B&&!Q&&a.display.inputHasSelection===f)return Y(a,!0),!1;var g=!a.curOp;g&&za(a);e.shift=!1;for(var h=0,k=Math.min(c.length,f.length);h<k&&c.charCodeAt(h)==f.charCodeAt(h);)++h;k=e.from;e=e.to;h<c.length?k=r(k.line,k.ch-(c.length-h)):a.state.overwrite&&x(k,e)&&!a.state.pasteIncoming&&(e=r(e.line,Math.min(u(d,e.line).text.length,e.ch+(f.length-h))));c=a.curOp.updateInput; h={from:k,to:e,text:ka(f.slice(h)),origin:a.state.pasteIncoming?"paste":"+input"};Ca(a.doc,h,"end");a.curOp.updateInput=c;M(a,"inputRead",a,h);1E3<f.length||-1<f.indexOf("\n")?b.value=a.display.prevInput="":a.display.prevInput=f;g&&Aa(a);a.state.pasteIncoming=!1;return!0}function Y(a,b){var c,d,e=a.doc;x(e.sel.from,e.sel.to)?b&&(a.display.prevInput=a.display.input.value="",B&&!Q&&(a.display.inputHasSelection=null)):(a.display.prevInput="",d=(c=cd&&(100<e.sel.to.line-e.sel.from.line||1E3<(d=a.getSelection()).length))? "-":d||a.getSelection(),a.display.input.value=d,a.state.focused&&dd(a.display.input),B&&!Q&&(a.display.inputHasSelection=d));a.display.inaccurateSelection=c}function N(a){"nocursor"==a.options.readOnly||Tb&&document.activeElement==a.display.input||a.display.input.focus()}function Va(a){return a.options.readOnly||a.doc.cantEdit}function Ud(a){function b(){a.state.focused&&setTimeout(O(N,a),0)}function c(){null==h&&(h=setTimeout(function(){h=null;g.cachedCharWidth=g.cachedTextHeight=Wa=null;ta(a);qc(a, O(D,a))},100))}function d(){for(var a=g.wrapper.parentNode;a&&a!=document.body;a=a.parentNode);a?setTimeout(d,5E3):aa(window,"resize",c)}function e(b){X(a,b)||a.options.onDragEvent&&a.options.onDragEvent(a,Xa(b))||Ya(b)}function f(){g.inaccurateSelection&&(g.prevInput="",g.inaccurateSelection=!1,g.input.value=a.getSelection(),dd(g.input))}var g=a.display;v(g.scroller,"mousedown",t(a,me));B?v(g.scroller,"dblclick",t(a,function(b){if(!X(a,b)){var c=Za(a,b);!c||ed(a,b)||la(a.display,b)||(A(b),b=sc(u(a.doc, c.line).text,c),F(a.doc,b.from,b.to))}})):v(g.scroller,"dblclick",function(b){X(a,b)||A(b)});v(g.lineSpace,"selectstart",function(a){la(g,a)||A(a)});tc||v(g.scroller,"contextmenu",function(b){fd(a,b)});v(g.scroller,"scroll",function(){g.scroller.clientHeight&&($a(a,g.scroller.scrollTop),Ba(a,g.scroller.scrollLeft,!0),J(a,"scroll",a))});v(g.scrollbarV,"scroll",function(){g.scroller.clientHeight&&$a(a,g.scrollbarV.scrollTop)});v(g.scrollbarH,"scroll",function(){g.scroller.clientHeight&&Ba(a,g.scrollbarH.scrollLeft)}); v(g.scroller,"mousewheel",function(b){gd(a,b)});v(g.scroller,"DOMMouseScroll",function(b){gd(a,b)});v(g.scrollbarH,"mousedown",b);v(g.scrollbarV,"mousedown",b);v(g.wrapper,"scroll",function(){g.wrapper.scrollTop=g.wrapper.scrollLeft=0});var h;v(window,"resize",c);setTimeout(d,5E3);v(g.input,"keyup",t(a,function(b){X(a,b)||a.options.onKeyEvent&&a.options.onKeyEvent(a,Xa(b))||16!=b.keyCode||(a.doc.sel.shift=!1)}));v(g.input,"input",O(Ua,a));v(g.input,"keydown",t(a,hd));v(g.input,"keypress",t(a,ne)); v(g.input,"focus",O(ha,a));v(g.input,"blur",O(Vb,a));a.options.dragDrop&&(v(g.scroller,"dragstart",function(b){var c=a;if(B&&(!c.state.draggingText||100>+new Date-id))Ya(b);else if(!X(c,b)&&!la(c.display,b)){var d=c.getSelection();b.dataTransfer.setData("Text",d);b.dataTransfer.setDragImage&&!uc&&(d=p("img",null,null,"position: fixed; left: 0; top: 0;"),S&&(d.width=d.height=1,c.display.wrapper.appendChild(d),d._top=d.offsetTop),b.dataTransfer.setDragImage(d,0,0),S&&d.parentNode.removeChild(d))}}), v(g.scroller,"dragenter",e),v(g.scroller,"dragover",e),v(g.scroller,"drop",t(a,oe)));v(g.scroller,"paste",function(b){la(g,b)||(N(a),Ua(a))});v(g.input,"paste",function(){if(K&&!(a.state.fakedLastChar||200>new Date-a.state.lastMiddleDown)){var b=g.input.selectionStart,c=g.input.selectionEnd;g.input.value+="$";g.input.selectionStart=b;g.input.selectionEnd=c;a.state.fakedLastChar=!0}a.state.pasteIncoming=!0;Ua(a)});v(g.input,"cut",f);v(g.input,"copy",f);Xb&&v(g.sizer,"mouseup",function(){document.activeElement== g.input&&g.input.blur();N(a)})}function la(a,b){for(var c=b.target||b.srcElement;c!=a.wrapper;c=c.parentNode)if(!c||c.ignoreEvents||c.parentNode==a.sizer&&c!=a.mover)return!0}function Za(a,b,c){var d=a.display;if(!c&&(c=b.target||b.srcElement,c==d.scrollbarH||c==d.scrollbarH.firstChild||c==d.scrollbarV||c==d.scrollbarV.firstChild||c==d.scrollbarFiller||c==d.gutterFiller))return null;var e,f,d=y(d.lineSpace);try{e=b.clientX,f=b.clientY}catch(g){return null}return nc(a,e-d.left,f-d.top)}function me(a){function b(a){if(!x(p, a))if(p=a,"single"==n)F(e.doc,s(g,k),a);else if(q=s(g,q),m=s(g,m),"double"==n){var b=sc(u(g,a.line).text,a);z(a,q)?F(e.doc,b.from,m):F(e.doc,q,b.to)}else"triple"==n&&(z(a,q)?F(e.doc,m,s(g,r(a.line,0))):F(e.doc,q,s(g,r(a.line+1,0))))}function c(a){var d=++qb,h=Za(e,a,!0);if(h)if(x(h,E)){var k=a.clientY<w.top?-20:a.clientY>w.bottom?20:0;k&&setTimeout(t(e,function(){qb==d&&(f.scroller.scrollTop+=k,c(a))}),50)}else{e.state.focused||ha(e);E=h;b(h);var l=ac(f,g);(h.line>=l.to||h.line<l.from)&&setTimeout(t(e, function(){qb==d&&c(a)}),150)}}function d(a){qb=Infinity;A(a);N(e);aa(document,"mousemove",C);aa(document,"mouseup",D)}if(!X(this,a)){var e=this,f=e.display,g=e.doc,h=g.sel;h.shift=a.shiftKey;if(la(f,a))K||(f.scroller.draggable=!1,setTimeout(function(){f.scroller.draggable=!0},100));else if(!ed(e,a)){var k=Za(e,a);switch(jd(a)){case 3:tc&&fd.call(e,e,a);return;case 2:K&&(e.state.lastMiddleDown=+new Date);k&&F(e.doc,k);setTimeout(O(N,e),20);A(a);return}if(k){e.state.focused||ha(e);var l=+new Date, n="single";Ab&&Ab.time>l-400&&x(Ab.pos,k)?(n="triple",A(a),setTimeout(O(N,e),20),pe(e,k.line)):Bb&&Bb.time>l-400&&x(Bb.pos,k)?(n="double",Ab={time:l,pos:k},A(a),l=sc(u(g,k.line).text,k),F(e.doc,l.from,l.to)):Bb={time:l,pos:k};var E=k;if(!e.options.dragDrop||!qe||Va(e)||x(h.from,h.to)||z(k,h.from)||z(h.to,k)||"single"!=n){A(a);"single"==n&&F(e.doc,s(g,k));var q=h.from,m=h.to,p=k,w=y(f.wrapper),qb=0,C=t(e,function(a){B||jd(a)?c(a):d(a)}),D=t(e,d);v(document,"mousemove",C);v(document,"mouseup",D)}else{var J= t(e,function(b){K&&(f.scroller.draggable=!1);e.state.draggingText=!1;aa(document,"mouseup",J);aa(f.scroller,"drop",J);10>Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-b.clientY)&&(A(b),F(e.doc,k),N(e))});K&&(f.scroller.draggable=!0);e.state.draggingText=J;f.scroller.dragDrop&&f.scroller.dragDrop();v(document,"mouseup",J);v(f.scroller,"drop",J)}}else(a.target||a.srcElement)==f.scroller&&A(a)}}}function ed(a,b){var c=a.display;try{var d=b.clientX,e=b.clientY}catch(f){return!1}if(d>=Math.floor(y(c.gutters).right))return!1; A(b);if(!ba(a,"gutterClick"))return!0;var g=y(c.lineDiv);if(e>g.bottom)return!0;e-=g.top-c.viewOffset;for(g=0;g<a.options.gutters.length;++g){var h=c.gutters.childNodes[g];if(h&&y(h).right>=d){c=Oa(a.doc,e);M(a,"gutterClick",a,c,a.options.gutters[g],b);break}}return!0}function oe(a){var b=this;if(!(X(b,a)||la(b.display,a)||b.options.onDragEvent&&b.options.onDragEvent(b,Xa(a)))){A(a);B&&(id=+new Date);var c=Za(b,a,!0),d=a.dataTransfer.files;if(c&&!Va(b))if(d&&d.length&&window.FileReader&&window.File){var e= d.length,f=Array(e),g=0;a=function(a,d){var h=new FileReader;h.onload=function(){f[d]=h.result;++g==e&&(c=s(b.doc,c),Ca(b.doc,{from:c,to:c,text:ka(f.join("\n")),origin:"paste"},"around"))};h.readAsText(a)};for(var h=0;h<e;++h)a(d[h],h)}else if(!b.state.draggingText||z(c,b.doc.sel.from)||z(b.doc.sel.to,c))try{if(f=a.dataTransfer.getData("Text")){var h=b.doc.sel.from,k=b.doc.sel.to;ea(b.doc,c,c);b.state.draggingText&&fa(b.doc,"",h,k,"paste");b.replaceSelection(f,null,"paste");N(b);ha(b)}}catch(l){}else b.state.draggingText(a), setTimeout(O(N,b),20)}}function $a(a,b){2>Math.abs(a.doc.scrollTop-b)||(a.doc.scrollTop=b,Da||ob(a,[],b),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbarV.scrollTop!=b&&(a.display.scrollbarV.scrollTop=b),Da&&ob(a,[]),Ka(a,100))}function Ba(a,b,c){(c?b==a.doc.scrollLeft:2>Math.abs(a.doc.scrollLeft-b))||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,Yb(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft= b),a.display.scrollbarH.scrollLeft!=b&&(a.display.scrollbarH.scrollLeft=b))}function gd(a,b){var c=b.wheelDeltaX,d=b.wheelDeltaY;null==c&&b.detail&&b.axis==b.HORIZONTAL_AXIS&&(c=b.detail);null==d&&b.detail&&b.axis==b.VERTICAL_AXIS?d=b.detail:null==d&&(d=b.wheelDelta);var e=a.display,f=e.scroller;if(c&&f.scrollWidth>f.clientWidth||d&&f.scrollHeight>f.clientHeight){if(d&&va&&K)for(var g=b.target;g!=f;g=g.parentNode)if(g.lineObj){a.display.currentWheelTarget=g;break}if(!c||Da||S||null==T){if(d&&null!= T){var g=d*T,h=a.doc.scrollTop,k=h+e.wrapper.clientHeight;0>g?h=Math.max(0,h+g-50):k=Math.min(a.doc.height,k+g+50);ob(a,[],{top:h,bottom:k})}20>Cb&&(null==e.wheelStartX?(e.wheelStartX=f.scrollLeft,e.wheelStartY=f.scrollTop,e.wheelDX=c,e.wheelDY=d,setTimeout(function(){if(null!=e.wheelStartX){var a=f.scrollLeft-e.wheelStartX,b=f.scrollTop-e.wheelStartY,a=b&&e.wheelDY&&b/e.wheelDY||a&&e.wheelDX&&a/e.wheelDX;e.wheelStartX=e.wheelStartY=null;a&&(T=(T*Cb+a)/(Cb+1),++Cb)}},200)):(e.wheelDX+=c,e.wheelDY+= d))}else d&&$a(a,Math.max(0,Math.min(f.scrollTop+d*T,f.scrollHeight-f.clientHeight))),Ba(a,Math.max(0,Math.min(f.scrollLeft+c*T,f.scrollWidth-f.clientWidth))),A(b),e.wheelStartX=null}}function Db(a,b,c){if("string"==typeof b&&(b=vc[b],!b))return!1;a.display.pollingFast&&rc(a)&&(a.display.pollingFast=!1);var d=a.doc,e=d.sel.shift,f=!1;try{Va(a)&&(a.state.suppressEdits=!0),c&&(d.sel.shift=!1),f=b(a)!=kd}finally{d.sel.shift=e,a.state.suppressEdits=!1}return f}function ld(a){var b=a.state.keyMaps.slice(0); a.options.extraKeys&&b.push(a.options.extraKeys);b.push(a.options.keyMap);return b}function md(a,b){var c=wc(a.options.keyMap),d=c.auto;clearTimeout(nd);d&&!od(b)&&(nd=setTimeout(function(){wc(a.options.keyMap)==c&&(a.options.keyMap=d.call?d.call(null,a):d,Uc(a))},50));var e=pd(b,!0),f=!1;if(!e)return!1;f=ld(a);if(f=b.shiftKey?ab("Shift-"+e,f,function(b){return Db(a,b,!0)})||ab(e,f,function(b){if("string"==typeof b?/^go[A-Z]/.test(b):b.motion)return Db(a,b)}):ab(e,f,function(b){return Db(a,b)}))A(b), sb(a),Q&&(b.oldKeyCode=b.keyCode,b.keyCode=0),M(a,"keyHandled",a,e,b);return f}function re(a,b,c){var d=ab("'"+c+"'",ld(a),function(b){return Db(a,b,!0)});d&&(A(b),sb(a),M(a,"keyHandled",a,"'"+c+"'",b));return d}function hd(a){this.state.focused||ha(this);if(!(X(this,a)||this.options.onKeyEvent&&this.options.onKeyEvent(this,Xa(a)))){B&&27==a.keyCode&&(a.returnValue=!1);var b=a.keyCode;this.doc.sel.shift=16==b||a.shiftKey;var c=md(this,a);S&&(xc=c?b:null,!c&&88==b&&!cd&&(va?a.metaKey:a.ctrlKey)&&this.replaceSelection(""))}} function ne(a){var b=this;if(!(X(b,a)||b.options.onKeyEvent&&b.options.onKeyEvent(b,Xa(a)))){var c=a.keyCode,d=a.charCode;S&&c==xc?(xc=null,A(a)):(S&&(!a.which||10>a.which)||Xb)&&md(b,a)||(c=String.fromCharCode(null==d?c:d),this.options.electricChars&&this.doc.mode.electricChars&&this.options.smartIndent&&!Va(this)&&-1<this.doc.mode.electricChars.indexOf(c)&&setTimeout(t(b,function(){Eb(b,b.doc.sel.to.line,"smart")}),75),re(b,a,c)||(B&&!Q&&(b.display.inputHasSelection=null),Ua(b)))}}function ha(a){"nocursor"!= a.options.readOnly&&(a.state.focused||(J(a,"focus",a),a.state.focused=!0,-1==a.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(a.display.wrapper.className+=" CodeMirror-focused"),a.curOp||(Y(a,!0),K&&setTimeout(O(Y,a,!0),0))),zb(a),sb(a))}function Vb(a){a.state.focused&&(J(a,"blur",a),a.state.focused=!1,a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-focused",""));clearInterval(a.display.blinker);setTimeout(function(){a.state.focused||(a.doc.sel.shift=!1)}, 150)}function fd(a,b){function c(){if(null!=e.input.selectionStart){var a=e.input.value=" "+(x(f.from,f.to)?"":e.input.value);e.prevInput=" ";e.input.selectionStart=1;e.input.selectionEnd=a.length}}function d(){e.inputDiv.style.position="relative";e.input.style.cssText=k;Q&&(e.scrollbarV.scrollTop=e.scroller.scrollTop=h);zb(a);if(null!=e.input.selectionStart){B&&!Q||c();clearTimeout(yc);var b=0,d=function(){" "==e.prevInput&&0==e.input.selectionStart?t(a,vc.selectAll)(a):10>b++?yc=setTimeout(d,500): Y(a)};yc=setTimeout(d,200)}}if(!X(a,b,"contextmenu")){var e=a.display,f=a.doc.sel;if(!la(e,b)){var g=Za(a,b),h=e.scroller.scrollTop;if(g&&!S){(x(f.from,f.to)||z(g,f.from)||!z(g,f.to))&&t(a,ea)(a.doc,g,g);var k=e.input.style.cssText;e.inputDiv.style.position="absolute";e.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(b.clientY-5)+"px; left: "+(b.clientX-5)+"px; z-index: 1000; background: white; outline: none;border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);"; N(a);Y(a,!0);x(f.from,f.to)&&(e.input.value=e.prevInput=" ");B&&!Q&&c();if(tc){Ya(b);var l=function(){aa(window,"mouseup",l);setTimeout(d,20)};v(window,"mouseup",l)}else setTimeout(d,50)}}}}function qd(a,b,c){if(!z(b.from,c))return s(a,c);var d=b.text.length-1-(b.to.line-b.from.line);if(c.line>b.to.line+d)return b=c.line-d,d=a.first+a.size-1,b>d?r(d,u(a,d).text.length):Fb(c,u(a,b).text.length);if(c.line==b.to.line+d)return Fb(c,L(b.text).length+(1==b.text.length?b.from.ch:0)+u(a,b.to.line).text.length- b.to.ch);a=c.line-b.from.line;return Fb(c,b.text[a].length+(a?0:b.from.ch))}function zc(a,b,c){if(c&&"object"==typeof c)return{anchor:qd(a,b,c.anchor),head:qd(a,b,c.head)};if("start"==c)return{anchor:b.from,head:b.from};var d=Ac(b);if("around"==c)return{anchor:b.from,head:d};if("end"==c)return{anchor:d,head:d};c=function(a){if(z(a,b.from))return a;if(!z(b.to,a))return d;var c=a.line+b.text.length-(b.to.line-b.from.line)-1,g=a.ch;a.line==b.to.line&&(g+=d.ch-b.to.ch);return r(c,g)};return{anchor:c(a.sel.anchor), head:c(a.sel.head)}}function rd(a,b,c){b={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};c&&(b.update=function(b,c,f,g){b&&(this.from=s(a,b));c&&(this.to=s(a,c));f&&(this.text=f);void 0!==g&&(this.origin=g)});J(a,"beforeChange",a,b);a.cm&&J(a.cm,"beforeChange",a.cm,b);return b.canceled?null:{from:b.from,to:b.to,text:b.text,origin:b.origin}}function Ca(a,b,c,d){if(a.cm){if(!a.cm.curOp)return t(a.cm,Ca)(a,b,c,d);if(a.cm.state.suppressEdits)return}if(ba(a, "beforeChange")||a.cm&&ba(a.cm,"beforeChange"))if(b=rd(a,b,!0),!b)return;if(d=sd&&!d&&se(a,b.from,b.to)){for(var e=d.length-1;1<=e;--e)Bc(a,{from:d[e].from,to:d[e].to,text:[""]});d.length&&Bc(a,{from:d[0].from,to:d[0].to,text:b.text},c)}else Bc(a,b,c)}function Bc(a,b,c){c=zc(a,b,c);td(a,b,c,a.cm?a.cm.curOp.id:NaN);bb(a,b,c,Cc(a,b));var d=[];Ea(a,function(a,c){c||-1!=ca(d,a.history)||(ud(a.history,b),d.push(a.history));bb(a,b,null,Cc(a,b))})}function vd(a,b){if(!a.cm||!a.cm.state.suppressEdits){var c= a.history,d=("undo"==b?c.done:c.undone).pop();if(d){var e={changes:[],anchorBefore:d.anchorAfter,headBefore:d.headAfter,anchorAfter:d.anchorBefore,headAfter:d.headBefore,generation:c.generation};("undo"==b?c.undone:c.done).push(e);c.generation=d.generation||++c.maxGeneration;for(var f=ba(a,"beforeChange")||a.cm&&ba(a.cm,"beforeChange"),g=d.changes.length-1;0<=g;--g){var h=d.changes[g];h.origin=b;if(f&&!rd(a,h,!1)){("undo"==b?c.done:c.undone).length=0;break}e.changes.push(Dc(a,h));var k=g?zc(a,h,null): {anchor:d.anchorBefore,head:d.headBefore};bb(a,h,k,wd(a,h));var l=[];Ea(a,function(a,b){b||-1!=ca(l,a.history)||(ud(a.history,h),l.push(a.history));bb(a,h,null,wd(a,h))})}}}}function xd(a,b){function c(a){return r(a.line+b,a.ch)}a.first+=b;a.cm&&D(a.cm,a.first,a.first,b);a.sel.head=c(a.sel.head);a.sel.anchor=c(a.sel.anchor);a.sel.from=c(a.sel.from);a.sel.to=c(a.sel.to)}function bb(a,b,c,d){if(a.cm&&!a.cm.curOp)return t(a.cm,bb)(a,b,c,d);if(b.to.line<a.first)xd(a,b.text.length-1-(b.to.line-b.from.line)); else if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);xd(a,e);b={from:r(a.first,0),to:r(b.to.line+e,b.to.ch),text:[L(b.text)],origin:b.origin}}e=a.lastLine();b.to.line>e&&(b={from:b.from,to:r(e,u(a,e).text.length),text:[b.text[0]],origin:b.origin});b.removed=Ec(a,b.from,b.to);c||(c=zc(a,b,null));a.cm?te(a.cm,b,d,c):Fc(a,b,d,c)}}function te(a,b,c,d){var e=a.doc,f=a.display,g=b.from,h=b.to,k=!1,l=g.line;a.options.lineWrapping||(l=P($(e,u(e,g.line))), e.iter(l,h.line+1,function(a){if(a==f.maxLine)return k=!0}));z(e.sel.head,b.from)||z(b.to,e.sel.head)||(a.curOp.cursorActivity=!0);Fc(e,b,c,d,Rc(a));a.options.lineWrapping||(e.iter(l,g.line+b.text.length,function(a){var b=mb(e,a);b>f.maxLineLength&&(f.maxLine=a,f.maxLineLength=b,f.maxLineChanged=!0,k=!1)}),k&&(a.curOp.updateMaxLine=!0));e.frontier=Math.min(e.frontier,g.line);Ka(a,400);D(a,g.line,h.line+1,b.text.length-(h.line-g.line)-1);if(ba(a,"change"))if(b={from:g,to:h,text:b.text,removed:b.removed, origin:b.origin},a.curOp.textChanged){for(a=a.curOp.textChanged;a.next;a=a.next);a.next=b}else a.curOp.textChanged=b}function fa(a,b,c,d,e){d||(d=c);if(z(d,c)){var f=d;d=c;c=f}"string"==typeof b&&(b=ka(b));Ca(a,{from:c,to:d,text:b,origin:e},null)}function r(a,b){if(!(this instanceof r))return new r(a,b);this.line=a;this.ch=b}function x(a,b){return a.line==b.line&&a.ch==b.ch}function z(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function ma(a){return r(a.line,a.ch)}function s(a,b){if(b.line< a.first)return r(a.first,0);var c=a.first+a.size-1;return b.line>c?r(c,u(a,c).text.length):Fb(b,u(a,b.line).text.length)}function Fb(a,b){var c=a.ch;return null==c||c>b?r(a.line,b):0>c?r(a.line,0):a}function Fa(a,b){return b>=a.first&&b<a.first+a.size}function F(a,b,c,d){if(a.sel.shift||a.sel.extend){var e=a.sel.anchor;if(c){var f=z(b,e);f!=z(c,e)?(e=b,b=c):f!=z(b,c)&&(b=c)}ea(a,e,b,d)}else ea(a,b,c||b,d);a.cm&&(a.cm.curOp.userSelChange=!0)}function ea(a,b,c,d,e){if(!e&&ba(a,"beforeSelectionChange")|| a.cm&&ba(a.cm,"beforeSelectionChange"))b={anchor:b,head:c},J(a,"beforeSelectionChange",a,b),a.cm&&J(a.cm,"beforeSelectionChange",a.cm,b),b.anchor=s(a,b.anchor),b.head=s(a,b.head),c=b.head,b=b.anchor;var f=a.sel;f.goalColumn=null;if(e||!x(b,f.anchor))b=Gb(a,b,d,"push"!=e);if(e||!x(c,f.head))c=Gb(a,c,d,"push"!=e);x(f.anchor,b)&&x(f.head,c)||(f.anchor=b,f.head=c,d=z(c,b),f.from=d?c:b,f.to=d?b:c,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=a.cm.curOp.cursorActivity=!0),M(a,"cursorActivity", a))}function yd(a){ea(a.doc,a.doc.sel.from,a.doc.sel.to,null,"push")}function Gb(a,b,c,d){var e=!1,f=b,g=c||1;a.cantEdit=!1;a:for(;;){var h=u(a,f.line);if(h.markedSpans)for(var k=0;k<h.markedSpans.length;++k){var l=h.markedSpans[k],n=l.marker;if((null==l.from||(n.inclusiveLeft?l.from<=f.ch:l.from<f.ch))&&(null==l.to||(n.inclusiveRight?l.to>=f.ch:l.to>f.ch))){if(d&&(J(n,"beforeCursorEnter"),n.explicitlyCleared))if(h.markedSpans){--k;continue}else break;if(n.atomic){k=n.find()[0>g?"from":"to"];if(x(k, f)&&(k.ch+=g,0>k.ch?k=k.line>a.first?s(a,r(k.line-1)):null:k.ch>h.text.length&&(k=k.line<a.first+a.size-1?r(k.line+1,0):null),!k)){if(e){if(!d)return Gb(a,b,c,!0);a.cantEdit=!0;return r(a.first,0)}e=!0;k=b;g=-g}f=k;continue a}}}return f}}function bd(a,b,c){for(null==c&&(c=0);;){var d=!1,e=U(a,b),f=yb(a,e.left,e.top-c,e.left,e.bottom+c),g=a.doc.scrollTop,h=a.doc.scrollLeft;null!=f.scrollTop&&($a(a,f.scrollTop),1<Math.abs(a.doc.scrollTop-g)&&(d=!0));null!=f.scrollLeft&&(Ba(a,f.scrollLeft),1<Math.abs(a.doc.scrollLeft- h)&&(d=!0));if(!d)return e}}function yb(a,b,c,d,e){var f=a.display,g=sa(a.display);0>c&&(c=0);var h=f.scroller.clientHeight-qa,k=f.scroller.scrollTop,l={};a=a.doc.height+(f.mover.offsetHeight-f.lineSpace.offsetHeight);var n=c<g,g=e>a-g;c<k?l.scrollTop=n?0:c:e>k+h&&(c=Math.min(c,(g?a:e)-h),c!=k&&(l.scrollTop=c));k=f.scroller.clientWidth-qa;c=f.scroller.scrollLeft;b+=f.gutters.offsetWidth;d+=f.gutters.offsetWidth;f=f.gutters.offsetWidth;e=b<f+10;b<c+f||e?(e&&(b=0),l.scrollLeft=Math.max(0,b-10-f)):d> k+c-3&&(l.scrollLeft=d+10-k);return l}function Hb(a,b,c){a.curOp.updateScrollPos={scrollLeft:null==b?a.doc.scrollLeft:b,scrollTop:null==c?a.doc.scrollTop:c}}function Gc(a,b,c){var d=a.curOp.updateScrollPos||(a.curOp.updateScrollPos={scrollLeft:a.doc.scrollLeft,scrollTop:a.doc.scrollTop});a=a.display.scroller;d.scrollTop=Math.max(0,Math.min(a.scrollHeight-a.clientHeight,d.scrollTop+c));d.scrollLeft=Math.max(0,Math.min(a.scrollWidth-a.clientWidth,d.scrollLeft+b))}function Eb(a,b,c,d){var e=a.doc;null== c&&(c="add");if("smart"==c)if(a.doc.mode.indent)var f=Ra(a,b);else c="prev";var g=a.options.tabSize,h=u(e,b),k=xa(h.text,null,g),l=h.text.match(/^\s*/)[0],n;if("smart"==c&&(n=a.doc.mode.indent(f,h.text.slice(l.length),h.text),n==kd)){if(!d)return;c="prev"}"prev"==c?n=b>e.first?xa(u(e,b-1).text,null,g):0:"add"==c?n=k+a.options.indentUnit:"subtract"==c?n=k-a.options.indentUnit:"number"==typeof c&&(n=k+c);n=Math.max(0,n);c="";d=0;if(a.options.indentWithTabs)for(e=Math.floor(n/g);e;--e)d+=g,c+="\t";d< n&&(c+=zd(n-d));c!=l&&fa(a.doc,c,r(b,0),r(b,l.length),"+input");h.stateAfter=null}function Ib(a,b,c){var d=b,e=b,f=a.doc;"number"==typeof b?e=u(f,Math.max(f.first,Math.min(b,f.first+f.size-1))):d=P(b);if(null!=d&&c(e,d))D(a,d,d+1);else return null;return e}function Hc(a,b,c,d,e){function f(b){var d=(e?oc:Ad)(k,h,c,!0);if(null==d){if(b=!b)b=g+c,b<a.first||b>=a.first+a.size?b=l=!1:(g=b,b=k=u(a,b));if(b)h=e?(0>c?wb:vb)(k):0>c?k.text.length:0;else return l=!1}else h=d;return!0}var g=b.line,h=b.ch;b=c; var k=u(a,g),l=!0;if("char"==d)f();else if("column"==d)f(!0);else if("word"==d||"group"==d){var n=null;d="group"==d;for(var E=!0;!(0>c)||f(!E);E=!1){var q=k.text.charAt(h)||"\n",q=cb(q)?"w":d?/\s/.test(q)?null:"p":null;if(n&&n!=q){0>c&&(c=1,f());break}q&&(n=q);if(0<c&&!f(!E))break}}b=Gb(a,r(g,h),b,!0);l||(b.hitSide=!0);return b}function Bd(a,b,c,d){var e=a.doc,f=b.left,g;"page"==d?(d=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),g=b.top+c*(d-(0> c?1.5:0.5)*sa(a.display))):"line"==d&&(g=0<c?b.bottom+3:b.top-3);for(;;){var h=nc(a,f,g);if(!h.outside)break;if(0>c?0>=g:g>=e.height){h.hitSide=!0;break}g+=5*c}return h}function sc(a,b){var c=b.ch,d=b.ch;if(a){(0>b.xRel||d==a.length)&&c?--c:++d;for(var e=a.charAt(c),e=cb(e)?cb:/\s/.test(e)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!cb(a)};0<c&&e(a.charAt(c-1));)--c;for(;d<a.length&&e(a.charAt(d));)++d}return{from:r(b.line,c),to:r(b.line,d)}}function pe(a,b){F(a.doc,r(b,0),s(a.doc, r(b+1,0)))}function w(a,b,c,d){m.defaults[a]=b;c&&(pa[a]=d?function(a,b,d){d!=Qc&&c(a,b,d)}:c)}function wa(a,b){if(!0===b)return b;if(a.copyState)return a.copyState(b);var c={},d;for(d in b){var e=b[d];e instanceof Array&&(e=e.concat([]));c[d]=e}return c}function Zc(a,b,c){return a.startState?a.startState(b,c):!0}function wc(a){return"string"==typeof a?Z[a]:a}function ab(a,b,c){function d(b){b=wc(b);var e=b[a];if(!1===e)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";b=b.fallthrough; if(null==b)return!1;if("[object Array]"!=Object.prototype.toString.call(b))return d(b);for(var e=0,f=b.length;e<f;++e){var l=d(b[e]);if(l)return l}return!1}for(var e=0;e<b.length;++e){var f=d(b[e]);if(f)return"stop"!=f}}function od(a){a=na[a.keyCode];return"Ctrl"==a||"Alt"==a||"Shift"==a||"Mod"==a}function pd(a,b){if(S&&34==a.keyCode&&a["char"])return!1;var c=na[a.keyCode];if(null==c||a.altGraphKey)return!1;a.altKey&&(c="Alt-"+c);if(Cd?a.metaKey:a.ctrlKey)c="Ctrl-"+c;if(Cd?a.ctrlKey:a.metaKey)c="Cmd-"+ c;!b&&a.shiftKey&&(c="Shift-"+c);return c}function db(a,b){this.pos=this.start=0;this.string=a;this.tabSize=b||8;this.lastColumnPos=this.lastColumnValue=0}function ga(a,b){this.lines=[];this.type=b;this.doc=a}function eb(a,b,c,d,e){if(d&&d.shared)return ue(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return t(a.cm,eb)(a,b,c,d,e);var f=new ga(a,e);if("range"==e&&!z(b,c))return f;d&&Jb(d,f);f.replacedWith&&(f.collapsed=!0,f.replacedWith=p("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||(f.replacedWith.ignoreEvents= !0));f.collapsed&&(Pa=!0);f.addToHistory&&td(a,{from:b,to:c,origin:"markText"},{head:a.sel.head,anchor:a.sel.anchor},NaN);var g=b.line,h=0,k,l,n=a.cm,E;a.iter(g,c.line+1,function(d){n&&f.collapsed&&!n.options.lineWrapping&&$(a,d)==n.display.maxLine&&(E=!0);var e={from:null,to:null,marker:f};h+=d.text.length;g==b.line&&(e.from=b.ch,h-=b.ch);g==c.line&&(e.to=c.ch,h-=d.text.length-c.ch);f.collapsed&&(g==c.line&&(l=ua(d,c.ch)),g==b.line?k=ua(d,b.ch):R(d,0));d.markedSpans=d.markedSpans?d.markedSpans.concat([e]): [e];e.marker.attachLine(d);++g});f.collapsed&&a.iter(b.line,c.line+1,function(b){ia(a,b)&&R(b,0)});f.clearOnEnter&&v(f,"beforeCursorEnter",function(){f.clear()});f.readOnly&&(sd=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory());if(f.collapsed){if(k!=l)throw Error("Inserting collapsed marker overlapping an existing one");f.size=h;f.atomic=!0}n&&(E&&(n.curOp.updateMaxLine=!0),(f.className||f.title||f.startStyle||f.endStyle||f.collapsed)&&D(n,b.line,c.line+1),f.atomic&&yd(n));return f} function fb(a,b){this.markers=a;this.primary=b;for(var c=0,d=this;c<a.length;++c)a[c].parent=this,v(a[c],"clear",function(){d.clear()})}function ue(a,b,c,d,e){d=Jb(d);d.shared=!1;var f=[eb(a,b,c,d,e)],g=f[0],h=d.replacedWith;Ea(a,function(a){h&&(d.replacedWith=h.cloneNode(!0));f.push(eb(a,s(a,b),s(a,c),d,e));for(var l=0;l<a.linked.length;++l)if(a.linked[l].isParent)return;g=L(f)});return new fb(f,g)}function gb(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function Cc(a, b){var c=Fa(a,b.from.line)&&u(a,b.from.line).markedSpans,d=Fa(a,b.to.line)&&u(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=x(b.from,b.to);if(c)for(var h=0,k;h<c.length;++h){var l=c[h],n=l.marker;if(null==l.from||(n.inclusiveLeft?l.from<=e:l.from<e)||"bookmark"==n.type&&!(l.from!=e||g&&l.marker.insertLeft)){var E=null==l.to||(n.inclusiveRight?l.to>=e:l.to>e);(k||(k=[])).push({from:l.from,to:E?null:l.to,marker:n})}}c=k;if(d)for(var h=0,m;h<d.length;++h)if(k=d[h],l=k.marker, null==k.to||(l.inclusiveRight?k.to>=f:k.to>f)||"bookmark"==l.type&&k.from==f&&(!g||k.marker.insertLeft))n=null==k.from||(l.inclusiveLeft?k.from<=f:k.from<f),(m||(m=[])).push({from:n?null:k.from-f,to:null==k.to?null:k.to-f,marker:l});d=m;g=1==b.text.length;m=L(b.text).length+(g?e:0);if(c)for(f=0;f<c.length;++f)if(h=c[f],null==h.to)(k=gb(d,h.marker),k)?g&&(h.to=null==k.to?null:k.to+m):h.to=e;if(d)for(f=0;f<d.length;++f)h=d[f],null!=h.to&&(h.to+=m),null==h.from?(k=gb(c,h.marker),k||(h.from=m,g&&(c|| (c=[])).push(h))):(h.from+=m,g&&(c||(c=[])).push(h));if(g&&c){for(f=0;f<c.length;++f)null!=c[f].from&&c[f].from==c[f].to&&"bookmark"!=c[f].marker.type&&c.splice(f--,1);c.length||(c=null)}e=[c];if(!g){var g=b.text.length-2,p;if(0<g&&c)for(f=0;f<c.length;++f)null==c[f].to&&(p||(p=[])).push({from:null,to:null,marker:c[f].marker});for(f=0;f<g;++f)e.push(p);e.push(d)}return e}function wd(a,b){var c;if(c=b["spans_"+a.id]){for(var d=0,e=[];d<b.text.length;++d)e.push(ve(c[d]));c=e}else c=null;d=Cc(a,b);if(!c)return d; if(!d)return c;for(e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g){var h=0;a:for(;h<g.length;++h){for(var k=g[h],l=0;l<f.length;++l)if(f[l].marker==k.marker)continue a;f.push(k)}}else g&&(c[e]=g)}return c}function se(a,b,c){var d=null;a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=ca(d,c)||(d||(d=[])).push(c)}});if(!d)return null;a=[{from:b,to:c}];for(b=0;b<d.length;++b){c=d[b];for(var e=c.find(),f=0;f<a.length;++f){var g= a[f];if(!z(g.to,e.from)&&!z(e.to,g.from)){var h=[f,1];(z(g.from,e.from)||!c.inclusiveLeft&&x(g.from,e.from))&&h.push({from:g.from,to:e.from});(z(e.to,g.to)||!c.inclusiveRight&&x(g.to,e.to))&&h.push({from:e.to,to:g.to});a.splice.apply(a,h);f+=h.length-1}}}return a}function ua(a,b){var c=Pa&&a.markedSpans,d;if(c)for(var e,f=0;f<c.length;++f)e=c[f],e.marker.collapsed&&(null==e.from||e.from<b)&&(null==e.to||e.to>b)&&(!d||d.width<e.marker.width)&&(d=e.marker);return d}function nb(a){return ua(a,a.text.length+ 1)}function $(a,b){for(var c;c=ua(b,-1);)b=u(a,c.find().from.line);return b}function ia(a,b){var c=Pa&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed&&(null==d.from||!d.marker.replacedWith&&0==d.from&&d.marker.inclusiveLeft&&Ic(a,b,d)))return!0}function Ic(a,b,c){if(null==c.to)return b=c.marker.find().to,b=u(a,b.line),Ic(a,b,gb(b.markedSpans,c.marker));if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var d,e=0;e<b.markedSpans.length;++e)if(d=b.markedSpans[e], d.marker.collapsed&&!d.marker.replacedWith&&d.from==c.to&&(d.marker.inclusiveLeft||c.marker.inclusiveRight)&&Ic(a,b,d))return!0}function Dd(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function Ed(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function Fd(a){return function(){var b=!this.cm.curOp;b&&za(this.cm);try{var c=a.apply(this,arguments)}finally{b&&Aa(this.cm)}return c}}function tb(a){if(null!=a.height)return a.height; a.node.parentNode&&1==a.node.parentNode.nodeType||W(a.cm.display.measure,p("div",[a.node],null,"position: relative"));return a.height=a.node.offsetHeight}function we(a,b,c,d){var e=new Kb(a,c,d);e.noHScroll&&(a.display.alignWidgets=!0);Ib(a,b,function(b){var c=b.widgets||(b.widgets=[]);null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e);e.line=b;if(!ia(a.doc,b)||e.showIfHidden)c=Qa(a,b)<a.doc.scrollTop,R(b,b.height+tb(e)),c&&Gc(a,0,e.height);return!0});return e}function Gd(a, b,c,d,e){var f=c.flattenSpans;null==f&&(f=a.options.flattenSpans);var g=0,h=null,k=new db(b,a.options.tabSize),l;for(""==b&&c.blankLine&&c.blankLine(d);!k.eol();)k.pos>a.options.maxHighlightLength?(f=!1,k.pos=Math.min(b.length,k.start+5E4),l=null):l=c.token(k,d),f&&h==l||(g<k.start&&e(k.start,h),g=k.start,h=l),k.start=k.pos;g<k.pos&&e(k.pos,h)}function Xc(a,b,c){var d=[a.state.modeGen];Gd(a,b.text,a.doc.mode,c,function(a,b){d.push(a,b)});for(c=0;c<a.state.overlays.length;++c){var e=a.state.overlays[c], f=1,g=0;Gd(a,b.text,e.mode,!0,function(a,b){for(var c=f;g<a;){var n=d[f];n>a&&d.splice(f,1,a,d[f+1],n);f+=2;g=Math.min(a,n)}if(b)if(e.opaque)d.splice(c,f-c,a,b),f=c+2;else for(;c<f;c+=2)n=d[c+1],d[c+1]=n?n+" "+b:b})}return d}function Hd(a,b){b.styles&&b.styles[0]==a.state.modeGen||(b.styles=Xc(a,b,b.stateAfter=Ra(a,P(b))));return b.styles}function Yc(a,b,c){var d=a.doc.mode,e=new db(b.text,a.options.tabSize);for(""==b.text&&d.blankLine&&d.blankLine(c);!e.eol()&&e.pos<=a.options.maxHighlightLength;)d.token(e, c),e.start=e.pos}function Id(a){return a?Jd[a]||(Jd[a]="cm-"+a.replace(/ +/g," cm-")):null}function fc(a,b,c,d){for(var e,f=b,g=!0;e=ua(f,-1);)f=u(a.doc,e.find().from.line);d={pre:p("pre"),col:0,pos:0,measure:null,measuredSomething:!1,cm:a,copyWidgets:d};f.textClass&&(d.pre.className=f.textClass);do{f.text&&(g=!1);d.measure=f==b&&c;d.pos=0;d.addToken=d.measure?xe:Kd;(B||K)&&a.getOption("lineWrapping")&&(d.addToken=ye(d.addToken));a:{e=d;var h=Hd(a,f),k=f.markedSpans,l=f.text,n=0;if(k)for(var m=l.length, q=0,r=1,s="",t=void 0,v=0,C=void 0,w=void 0,x=void 0,y=void 0,G=void 0;;){if(v==q){for(var C=w=x=y="",G=null,v=Infinity,z=[],D=0;D<k.length;++D){var A=k[D],F=A.marker;A.from<=q&&(null==A.to||A.to>q)?(null!=A.to&&v>A.to&&(v=A.to,w=""),F.className&&(C+=" "+F.className),F.startStyle&&A.from==q&&(x+=" "+F.startStyle),F.endStyle&&A.to==v&&(w+=" "+F.endStyle),F.title&&!y&&(y=F.title),F.collapsed&&(!G||G.marker.size<F.size)&&(G=A)):A.from>q&&v>A.from&&(v=A.from);"bookmark"==F.type&&A.from==q&&F.replacedWith&& z.push(F)}if(G&&(G.from||0)==q&&(Ld(e,(null==G.to?m:G.to)-q,G.marker,null==G.from),null==G.to)){e=G.marker.find();break a}if(!G&&z.length)for(D=0;D<z.length;++D)Ld(e,0,z[D])}if(q>=m)break;for(z=Math.min(m,v);;){if(s){D=q+s.length;G||(A=D>z?s.slice(0,z-q):s,e.addToken(e,A,t?t+C:C,x,q+A.length==v?w:"",y));if(D>=z){s=s.slice(z-q);q=z;break}q=D;x=""}s=l.slice(n,n=h[r++]);t=Id(h[r++])}}else for(var r=1;r<h.length;r+=2)e.addToken(e,l.slice(n,n=h[r]),Id(h[r+1]));e=void 0}c&&f==b&&!d.measuredSomething&&(c[0]= d.pre.appendChild(Sa(a.display.measure)),d.measuredSomething=!0);e&&(f=u(a.doc,e.to.line))}while(e);!c||d.measuredSomething||c[0]||(c[0]=d.pre.appendChild(g?p("span","\u00a0"):Sa(a.display.measure)));d.pre.firstChild||ia(a.doc,b)||d.pre.appendChild(document.createTextNode("\u00a0"));var I;c&&B&&(I=V(f))&&(g=I.length-1,I[g].from==I[g].to&&--g,f=I[g],I=I[g-1],f.from+1==f.to&&I&&f.level<I.level&&(c=c[d.pos-1])&&c.parentNode.insertBefore(c.measureRight=Sa(a.display.measure),c.nextSibling));J(a,"renderLine", a,b,d.pre);return d.pre}function Kd(a,b,c,d,e,f){if(b){if(Jc.test(b))for(var g=document.createDocumentFragment(),h=0;;){Jc.lastIndex=h;var k=Jc.exec(b),l=k?k.index-h:b.length-h;l&&(g.appendChild(document.createTextNode(b.slice(h,h+l))),a.col+=l);if(!k)break;h+=l+1;"\t"==k[0]?(k=a.cm.options.tabSize,k-=a.col%k,g.appendChild(p("span",zd(k),"cm-tab")),a.col+=k):(l=p("span","\u2022","cm-invalidchar"),l.title="\\u"+k[0].charCodeAt(0).toString(16),g.appendChild(l),a.col+=1)}else{a.col+=b.length;var g=document.createTextNode(b)}if(c|| d||e||a.measure)return b=c||"",d&&(b+=d),e&&(b+=e),l=p("span",[g],b),f&&(l.title=f),a.pre.appendChild(l);a.pre.appendChild(g)}}function xe(a,b,c,d,e){for(var f=a.cm.options.lineWrapping,g=0;g<b.length;++g){var h=b.charAt(g),k=0==g;"\ud800"<=h&&"\udbff">h&&g<b.length-1?(h=b.slice(g,g+2),++g):g&&f&&Lb(b,g)&&a.pre.appendChild(p("wbr"));var l=a.measure[a.pos],k=a.measure[a.pos]=Kd(a,h,c,k&&d,g==b.length-1&&e);l&&(k.leftSide=l.leftSide||l);B&&f&&" "==h&&g&&!/\s/.test(b.charAt(g-1))&&g<b.length-1&&!/\s/.test(b.charAt(g+ 1))&&(k.style.whiteSpace="normal");a.pos+=h.length}b.length&&(a.measuredSomething=!0)}function ye(a){function b(a){for(var b=" ",e=0;e<a.length-2;++e)b+=e%2?" ":"\u00a0";return b+" "}return function(c,d,e,f,g,h){return a(c,d.replace(/ {3,}/,b),e,f,g,h)}}function Ld(a,b,c,d){if(d=!d&&c.replacedWith)if(a.copyWidgets&&(d=d.cloneNode(!0)),a.pre.appendChild(d),a.measure){if(b)a.measure[a.pos]=d;else{var e=Sa(a.cm.display.measure);if("bookmark"!=c.type||c.insertLeft){if(a.measure[a.pos])return;a.measure[a.pos]= a.pre.insertBefore(e,d)}else a.measure[a.pos]=a.pre.appendChild(e)}a.measuredSomething=!0}a.pos+=b}function Fc(a,b,c,d,e){function f(a,c,d){var f=e;a.text=c;a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null);null!=a.order&&(a.order=null);Dd(a);Ed(a,d);c=f?f(a):1;c!=a.height&&R(a,c);M(a,"change",a,b)}var g=b.from,h=b.to,k=b.text,l=u(a,g.line),n=u(a,h.line),m=L(k),q=c?c[k.length-1]:null,r=h.line-g.line;if(0==g.ch&&0==h.ch&&""==m){for(var p=0,s=k.length-1,t=[];p<s;++p)t.push(new Ga(k[p],c?c[p]: null,e));f(n,n.text,q);r&&a.remove(g.line,r);t.length&&a.insert(g.line,t)}else if(l==n)if(1==k.length)f(l,l.text.slice(0,g.ch)+m+l.text.slice(h.ch),q);else{t=[];p=1;for(s=k.length-1;p<s;++p)t.push(new Ga(k[p],c?c[p]:null,e));t.push(new Ga(m+l.text.slice(h.ch),q,e));f(l,l.text.slice(0,g.ch)+k[0],c?c[0]:null);a.insert(g.line+1,t)}else if(1==k.length)f(l,l.text.slice(0,g.ch)+k[0]+n.text.slice(h.ch),c?c[0]:null),a.remove(g.line+1,r);else{f(l,l.text.slice(0,g.ch)+k[0],c?c[0]:null);f(n,m+n.text.slice(h.ch), q);p=1;s=k.length-1;for(t=[];p<s;++p)t.push(new Ga(k[p],c?c[p]:null,e));1<r&&a.remove(g.line+1,r-1);a.insert(g.line+1,t)}M(a,"change",a,b);ea(a,d.anchor,d.head,null,!0)}function Mb(a){this.lines=a;this.parent=null;for(var b=0,c=a.length,d=0;b<c;++b)a[b].parent=this,d+=a[b].height;this.height=d}function hb(a){this.children=a;for(var b=0,c=0,d=0,e=a.length;d<e;++d){var f=a[d],b=b+f.chunkSize(),c=c+f.height;f.parent=this}this.size=b;this.height=c;this.parent=null}function Ea(a,b,c){function d(a,f,g){if(a.linked)for(var h= 0;h<a.linked.length;++h){var k=a.linked[h];if(k.doc!=f){var l=g&&k.sharedHist;if(!c||l)b(k.doc,l),d(k.doc,a,l)}}}d(a,null,!0)}function Pc(a,b){if(b.cm)throw Error("This document is already in use.");a.doc=b;b.cm=a;Tc(a);Ja(a);a.options.lineWrapping||Zb(a);a.options.mode=b.modeOption;D(a)}function u(a,b){for(b-=a.first;!a.lines;)for(var c=0;;++c){var d=a.children[c],e=d.chunkSize();if(b<e){a=d;break}b-=e}return a.lines[b]}function Ec(a,b,c){var d=[],e=b.line;a.iter(b.line,c.line+1,function(a){a=a.text; e==c.line&&(a=a.slice(0,c.ch));e==b.line&&(a=a.slice(b.ch));d.push(a);++e});return d}function Kc(a,b,c){var d=[];a.iter(b,c,function(a){d.push(a.text)});return d}function R(a,b){for(var c=b-a.height,d=a;d;d=d.parent)d.height+=c}function P(a){if(null==a.parent)return null;var b=a.parent;a=ca(b.lines,a);for(var c=b.parent;c;b=c,c=c.parent)for(var d=0;c.children[d]!=b;++d)a+=c.children[d].chunkSize();return a+b.first}function Oa(a,b){var c=a.first;a:do{for(var d=0,e=a.children.length;d<e;++d){var f= a.children[d],g=f.height;if(b<g){a=f;continue a}b-=g;c+=f.chunkSize()}return c}while(!a.lines);d=0;for(e=a.lines.length;d<e;++d){f=a.lines[d].height;if(b<f)break;b-=f}return c+d}function Qa(a,b){b=$(a.doc,b);for(var c=0,d=b.parent,e=0;e<d.lines.length;++e){var f=d.lines[e];if(f==b)break;else c+=f.height}for(f=d.parent;f;d=f,f=d.parent)for(e=0;e<f.children.length;++e){var g=f.children[e];if(g==d)break;else c+=g.height}return c}function V(a){var b=a.order;null==b&&(b=a.order=ze(a.text));return b}function Nb(a){return{done:[], undone:[],undoDepth:Infinity,lastTime:0,lastOp:null,lastOrigin:null,generation:a||1,maxGeneration:a||1}}function Md(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans);++f})}function Dc(a,b){var c={from:{line:b.from.line,ch:b.from.ch},to:Ac(b),text:Ec(a,b.from,b.to)};Md(a,c,b.from.line,b.to.line+1);Ea(a,function(a){Md(a,c,b.from.line,b.to.line+1)},!0);return c}function td(a,b,c,d){var e= a.history;e.undone.length=0;var f=+new Date,g=L(e.done);if(g&&(e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastTime>f-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))){var h=L(g.changes);x(b.from,b.to)&&x(b.from,h.to)?h.to=Ac(b):g.changes.push(Dc(a,b));g.anchorAfter=c.anchor;g.headAfter=c.head}else for(g={changes:[Dc(a,b)],generation:e.generation,anchorBefore:a.sel.anchor,headBefore:a.sel.head,anchorAfter:c.anchor,headAfter:c.head},e.done.push(g),e.generation= ++e.maxGeneration;e.done.length>e.undoDepth;)e.done.shift();e.lastTime=f;e.lastOp=d;e.lastOrigin=b.origin}function ve(a){if(!a)return null;for(var b=0,c;b<a.length;++b)a[b].marker.explicitlyCleared?c||(c=a.slice(0,b)):c&&c.push(a[b]);return c?c.length?c:null:a}function Ob(a,b){for(var c=0,d=[];c<a.length;++c){var e=a[c],f=e.changes,g=[];d.push({changes:g,anchorBefore:e.anchorBefore,headBefore:e.headBefore,anchorAfter:e.anchorAfter,headAfter:e.headAfter});for(e=0;e<f.length;++e){var h=f[e],k;g.push({from:h.from, to:h.to,text:h.text});if(b)for(var l in h)(k=l.match(/^spans_(\d+)$/))&&-1<ca(b,Number(k[1]))&&(L(g)[l]=h[l],delete h[l])}}return d}function Pb(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function Nd(a,b,c,d){for(var e=0;e<a.length;++e){for(var f=a[e],g=!0,h=0;h<f.changes.length;++h){var k=f.changes[h];f.copied||(k.from=ma(k.from),k.to=ma(k.to));if(c<k.from.line)k.from.line+=d,k.to.line+=d;else if(b<=k.to.line){g=!1;break}}f.copied||(f.anchorBefore=ma(f.anchorBefore),f.headBefore=ma(f.headBefore), f.anchorAfter=ma(f.anchorAfter),f.readAfter=ma(f.headAfter),f.copied=!0);g?(Pb(f.anchorBefore),Pb(f.headBefore),Pb(f.anchorAfter),Pb(f.headAfter)):(a.splice(0,e+1),e=0)}}function ud(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;Nd(a.done,c,d,e);Nd(a.undone,c,d,e)}function Ae(){Ya(this)}function Xa(a){a.stop||(a.stop=Ae);return a}function A(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Od(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function Ya(a){A(a); Od(a)}function jd(a){var b=a.which;null==b&&(a.button&1?b=1:a.button&2?b=3:a.button&4&&(b=2));va&&a.ctrlKey&&1==b&&(b=3);return b}function v(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):(a=a._handlers||(a._handlers={}),(a[b]||(a[b]=[])).push(c))}function aa(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else if(a=a._handlers&&a._handlers[b])for(b=0;b<a.length;++b)if(a[b]==c){a.splice(b,1);break}} function J(a,b){var c=a._handlers&&a._handlers[b];if(c)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)}function M(a,b){function c(a){return function(){a.apply(null,e)}}var d=a._handlers&&a._handlers[b];if(d){var e=Array.prototype.slice.call(arguments,2);da||(++xb,da=[],setTimeout(Be,0));for(var f=0;f<d.length;++f)da.push(c(d[f]))}}function X(a,b,c){J(a,c||b.type,a,b);return(null!=b.defaultPrevented?b.defaultPrevented:!1==b.returnValue)||b.codemirrorIgnore}function Be(){--xb; var a=da;da=null;for(var b=0;b<a.length;++b)a[b]()}function ba(a,b){var c=a._handlers&&a._handlers[b];return c&&0<c.length}function Ha(a){a.prototype.on=function(a,c){v(this,a,c)};a.prototype.off=function(a,c){aa(this,a,c)}}function Ub(){this.id=null}function xa(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));d=d||0;for(e=e||0;d<b;++d)"\t"==a.charAt(d)?e+=c-e%c:++e;return e}function zd(a){for(;Qb.length<=a;)Qb.push(L(Qb)+" ");return Qb[a]}function L(a){return a[a.length-1]}function dd(a){if(Ia)a.selectionStart= 0,a.selectionEnd=a.value.length;else try{a.select()}catch(b){}}function ca(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;++c)if(a[c]==b)return c;return-1}function Pd(a,b){function c(){}c.prototype=a;var d=new c;b&&Jb(b,d);return d}function Jb(a,b){b||(b={});for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function $c(a){for(var b=[],c=0;c<a;++c)b.push(void 0);return b}function O(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function cb(a){return/\w/.test(a)|| "\u0080"<a&&(a.toUpperCase()!=a.toLowerCase()||Ce.test(a))}function Qd(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function p(a,b,c,d){a=document.createElement(a);c&&(a.className=c);d&&(a.style.cssText=d);if("string"==typeof b)Wc(a,b);else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a}function Ma(a){for(var b=a.childNodes.length;0<b;--b)a.removeChild(a.firstChild);return a}function W(a,b){return Ma(a).appendChild(b)}function Wc(a,b){Q?(a.innerHTML="",a.appendChild(document.createTextNode(b))): a.textContent=b}function y(a){return a.getBoundingClientRect()}function Lb(){return!1}function Na(a){if(null!=Wa)return Wa;var b=p("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");W(a,b);b.offsetWidth&&(Wa=b.offsetHeight-b.clientHeight);return Wa||0}function Sa(a){if(null==Lc){var b=p("span","\u200b");W(a,p("span",[b,document.createTextNode("x")]));0!=a.firstChild.offsetHeight&&(Lc=1>=b.offsetWidth&&2<b.offsetHeight&&!ra)}return Lc?p("span","\u200b"):p("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px")} function de(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];if(g.from<c&&g.to>b||b==c&&g.to==b)d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0}e||d(b,c,"ltr")}function kc(a){return a.level%2?a.to:a.from}function lc(a){return a.level%2?a.from:a.to}function vb(a){return(a=V(a))?kc(a[0]):0}function wb(a){var b=V(a);return b?lc(L(b)):a.text.length}function Rd(a,b){var c=u(a.doc,b),d=$(a.doc,c);d!=c&&(b=P(d));d=(c=V(d))?c[0].level%2?wb(d):vb(d):0;return r(b, d)}function De(a,b){for(var c,d;c=nb(d=u(a.doc,b));)b=c.find().to.line;d=(c=V(d))?c[0].level%2?vb(d):wb(d):d.text.length;return r(b,d)}function mc(a,b){for(var c=0,d;c<a.length;++c){var e=a[c];if(e.from<b&&e.to>b)return ya=null,c;if(e.from==b||e.to==b)if(null==d)d=c;else{var e=e.level,f=a[d].level,g=a[0].level,e=e==g?!0:f==g?!1:e<f;if(e)return ya=d,c;ya=c;return d}}ya=null;return d}function Mc(a,b,c,d){if(!d)return b+c;do b+=c;while(0<b&&pc.test(a.text.charAt(b)));return b}function oc(a,b,c,d){var e= V(a);if(!e)return Ad(a,b,c,d);var f=mc(e,b),g=e[f];for(b=Mc(a,b,g.level%2?-c:c,d);;){if(b>g.from&&b<g.to)return b;if(b==g.from||b==g.to){if(mc(e,b)==f)return b;g=e[f+c];return 0<c==g.level%2?g.to:g.from}g=e[f+=c];if(!g)return null;b=0<c==g.level%2?Mc(a,g.to,-1,d):Mc(a,g.from,1,d)}}function Ad(a,b,c,d){b+=c;if(d)for(;0<b&&pc.test(a.text.charAt(b));)b+=c;return 0>b||b>a.text.length?null:b}var Da=/gecko\/\d/i.test(navigator.userAgent),B=/MSIE \d/.test(navigator.userAgent),ra=B&&(null==document.documentMode|| 8>document.documentMode),Q=B&&(null==document.documentMode||9>document.documentMode),K=/WebKit\//.test(navigator.userAgent),Ee=K&&/Qt\/\d+\.\d+/.test(navigator.userAgent),Fe=/Chrome\//.test(navigator.userAgent),S=/Opera\//.test(navigator.userAgent),uc=/Apple Computer/.test(navigator.vendor),Xb=/KHTML\//.test(navigator.userAgent),Vd=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),Wd=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),ke=/PhantomJS/.test(navigator.userAgent),Ia=/AppleWebKit/.test(navigator.userAgent)&& /Mobile\/\w+/.test(navigator.userAgent),Tb=Ia||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),va=Ia||/Mac/.test(navigator.platform),Ge=/win/i.test(navigator.platform),oa=S&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);oa&&(oa=Number(oa[1]));oa&&15<=oa&&(S=!1,K=!0);var Cd=va&&(Ee||S&&(null==oa||12.11>oa)),tc=Da||B&&!Q,sd=!1,Pa=!1,ja,je=0,Bb,Ab,id=0,Cb=0,T=null;B?T=-0.53:Da?T=15:Fe?T=-0.7:uc&&(T=-1/3);var nd,xc=null,yc,Ac=m.changeEnd=function(a){return a.text? r(a.from.line+a.text.length-1,L(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};m.Pos=r;m.prototype={constructor:m,focus:function(){window.focus();N(this);ha(this);Ua(this)},setOption:function(a,b){var c=this.options,d=c[a];if(c[a]!=b||"mode"==a)c[a]=b,pa.hasOwnProperty(a)&&t(this,pa[a])(this,b,d)},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](a)},removeKeyMap:function(a){for(var b=this.state.keyMaps, c=0;c<b.length;++c)if(b[c]==a||"string"!=typeof b[c]&&b[c].name==a)return b.splice(c,1),!0},addOverlay:t(null,function(a,b){var c=a.token?a:m.getMode(this.options,a);if(c.startState)throw Error("Overlays may not be stateful.");this.state.overlays.push({mode:c,modeSpec:a,opaque:b&&b.opaque});this.state.modeGen++;D(this)}),removeOverlay:t(null,function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||"string"==typeof a&&d.name==a){b.splice(c,1);this.state.modeGen++; D(this);break}}}),indentLine:t(null,function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract");Fa(this.doc,a)&&Eb(this,a,b,c)}),indentSelection:t(null,function(a){var b=this.doc.sel;if(x(b.from,b.to))return Eb(this,b.from.line,a);for(var c=b.to.line-(b.to.ch?0:1),b=b.from.line;b<=c;++b)Eb(this,b,a)}),getTokenAt:function(a,b){var c=this.doc;a=s(c,a);for(var d=Ra(this,a.line,b),e=this.doc.mode,c=u(c,a.line),c=new db(c.text,this.options.tabSize);c.pos< a.ch&&!c.eol();){c.start=c.pos;var f=e.token(c,d)}return{start:c.start,end:c.pos,string:c.current(),className:f||null,type:f||null,state:d}},getTokenTypeAt:function(a){a=s(this.doc,a);var b=Hd(this,u(this.doc,a.line)),c=0,d=(b.length-1)/2;a=a.ch;if(0==a)return b[2];for(;;){var e=c+d>>1;if((e?b[2*e-1]:0)>=a)d=e;else if(b[2*e+1]<a)c=e+1;else return b[2*e+2]}},getModeAt:function(a){var b=this.doc.mode;return b.innerMode?m.innerMode(b,this.getTokenAt(a).state).mode:b},getHelper:function(a,b){if(ib.hasOwnProperty(b)){var c= ib[b],d=this.getModeAt(a);return d[b]&&c[d[b]]||d.helperType&&c[d.helperType]||c[d.name]}},getStateAfter:function(a,b){var c=this.doc;a=Math.max(c.first,Math.min(null==a?c.first+c.size-1:a,c.first+c.size-1));return Ra(this,a+1,b)},cursorCoords:function(a,b){var c;c=this.doc.sel;c=null==a?c.head:"object"==typeof a?s(this.doc,a):a?c.from:c.to;return U(this,c,b||"page")},charCoords:function(a,b){return rb(this,s(this.doc,a),b||"page")},coordsChar:function(a,b){a=ad(this,a,b||"page");return nc(this,a.left, a.top)},lineAtHeight:function(a,b){a=ad(this,{top:a,left:0},b||"page").top;return Oa(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b){var c=!1,d=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>d&&(a=d,c=!0);d=u(this.doc,a);return jc(this,u(this.doc,a),{top:0,left:0},b||"page").top+(c?d.height:0)},defaultTextHeight:function(){return sa(this.display)},defaultCharWidth:function(){return Sc(this.display)},setGutterMarker:t(null,function(a,b,c){return Ib(this,a,function(a){var e= a.gutterMarkers||(a.gutterMarkers={});e[b]=c;!c&&Qd(e)&&(a.gutterMarkers=null);return!0})}),clearGutter:t(null,function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,D(b,d,d+1),Qd(c.gutterMarkers)&&(c.gutterMarkers=null));++d})}),addLineClass:t(null,function(a,b,c){return Ib(this,a,function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[e]){if(RegExp("(?:^|\\s)"+c+"(?:$|\\s)").test(a[e]))return!1;a[e]+=" "+ c}else a[e]=c;return!0})}),removeLineClass:t(null,function(a,b,c){return Ib(this,a,function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",f=a[e];if(f)if(null==c)a[e]=null;else{var g=f.match(RegExp("(?:^|\\s+)"+c+"(?:$|\\s+)"));if(!g)return!1;var h=g.index+g[0].length;a[e]=f.slice(0,g.index)+(g.index&&h!=f.length?" ":"")+f.slice(h)||null}else return!1;return!0})}),addLineWidget:t(null,function(a,b,c){return we(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"== typeof a){if(!Fa(this.doc,a))return null;var b=a;a=u(this.doc,a);if(!a)return null}else if(b=P(a),null==b)return null;return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=U(this,s(this.doc,a));var g=a.bottom,h=a.left;b.style.position="absolute";f.sizer.appendChild(b); if("over"==d)g=a.top;else if("above"==d||"near"==d){var k=Math.max(f.wrapper.clientHeight,this.doc.height),l=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>k)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=k&&(g=a.bottom);h+b.offsetWidth>l&&(h=l-b.offsetWidth)}b.style.top=g+"px";b.style.left=b.style.right="";"right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/ 2),b.style.left=h+"px");c&&(a=yb(this,h,g,h+b.offsetWidth,g+b.offsetHeight),null!=a.scrollTop&&$a(this,a.scrollTop),null!=a.scrollLeft&&Ba(this,a.scrollLeft))},triggerOnKeyDown:t(null,hd),execCommand:function(a){return vc[a](this)},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);var f=0;for(a=s(this.doc,a);f<b&&(a=Hc(this.doc,a,e,c,d),!a.hitSide);++f);return a},moveH:t(null,function(a,b){var c=this.doc.sel,c=c.shift||c.extend||x(c.from,c.to)?Hc(this.doc,c.head,a,b,this.options.rtlMoveVisually): 0>a?c.from:c.to;F(this.doc,c,c,a)}),deleteH:t(null,function(a,b){var c=this.doc.sel;x(c.from,c.to)?fa(this.doc,"",c.from,Hc(this.doc,c.head,a,b,!1),"+delete"):fa(this.doc,"",c.from,c.to,"+delete");this.curOp.userSelChange=!0}),findPosV:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);var f=0;for(a=s(this.doc,a);f<b&&(a=U(this,a,"div"),null==d?d=a.left:a.left=d,a=Bd(this,a,e,c),!a.hitSide);++f);return a},moveV:t(null,function(a,b){var c=this.doc.sel,d=U(this,c.head,"div");null!=c.goalColumn&&(d.left=c.goalColumn); var e=Bd(this,d,a,b);"page"==b&&Gc(this,0,rb(this,e,"div").top-d.top);F(this.doc,e,e,a);c.goalColumn=d.left}),toggleOverwrite:function(a){if(null==a||a!=this.state.overwrite)(this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+=" CodeMirror-overwrite":this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite","")},hasFocus:function(){return this.state.focused},scrollTo:t(null,function(a,b){Hb(this,a,b)}),getScrollInfo:function(){var a=this.display.scroller, b=qa;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-b,width:a.scrollWidth-b,clientHeight:a.clientHeight-b,clientWidth:a.clientWidth-b}},scrollIntoView:t(null,function(a,b){"number"==typeof a&&(a=r(a,0));b||(b=0);var c=a;a&&null==a.line||(this.curOp.scrollToPos=a?s(this.doc,a):this.doc.sel.head,this.curOp.scrollToPosMargin=b,c=U(this,this.curOp.scrollToPos));c=yb(this,c.left,c.top-b,c.right,c.bottom+b);Hb(this,c.scrollLeft,c.scrollTop)}),setSize:t(null,function(a,b){function c(a){return"number"== typeof a||/^\d+$/.test(String(a))?a+"px":a}null!=a&&(this.display.wrapper.style.width=c(a));null!=b&&(this.display.wrapper.style.height=c(b));this.options.lineWrapping&&(this.display.measureLineCache.length=this.display.measureLineCachePos=0);this.curOp.forceUpdate=!0}),operation:function(a){return qc(this,a)},refresh:t(null,function(){ta(this);Hb(this,this.doc.scrollLeft,this.doc.scrollTop);D(this)}),swapDoc:t(null,function(a){var b=this.doc;b.cm=null;Pc(this,a);ta(this);Y(this,!0);Hb(this,a.scrollLeft, a.scrollTop);return b}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};Ha(m);var pa=m.optionHandlers={},Rb=m.defaults={},Qc=m.Init={toString:function(){return"CodeMirror.Init"}};w("value","",function(a,b){a.setValue(b)},!0);w("mode",null,function(a,b){a.doc.modeOption=b;Ja(a)},!0);w("indentUnit",2,Ja,!0);w("indentWithTabs", !1);w("smartIndent",!0);w("tabSize",4,function(a){Ja(a);ta(a);D(a)},!0);w("electricChars",!0);w("rtlMoveVisually",!Ge);w("theme","default",function(a){Oc(a);La(a)},!0);w("keyMap","default",Uc);w("extraKeys",null);w("onKeyEvent",null);w("onDragEvent",null);w("lineWrapping",!1,function(a){a.options.lineWrapping?(a.display.wrapper.className+=" CodeMirror-wrap",a.display.sizer.style.minWidth=""):(a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-wrap",""),Zb(a));Tc(a);D(a); ta(a);setTimeout(function(){$b(a)},100)},!0);w("gutters",[],function(a){Sb(a.options);La(a)},!0);w("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?bc(a.display)+"px":"0";a.refresh()},!0);w("coverGutterNextToScrollbar",!1,$b,!0);w("lineNumbers",!1,function(a){Sb(a.options);La(a)},!0);w("firstLineNumber",1,La,!0);w("lineNumberFormatter",function(a){return a},La,!0);w("showCursorWhenSelecting",!1,dc,!0);w("readOnly",!1,function(a,b){"nocursor"==b?(Vb(a),a.display.input.blur()):b||Y(a,!0)}); w("dragDrop",!0);w("cursorBlinkRate",530);w("cursorScrollMargin",0);w("cursorHeight",1);w("workTime",100);w("workDelay",100);w("flattenSpans",!0);w("pollInterval",100);w("undoDepth",40,function(a,b){a.doc.history.undoDepth=b});w("historyEventDelay",500);w("viewportMargin",10,function(a){a.refresh()},!0);w("maxHighlightLength",1E4,function(a){Ja(a);a.refresh()},!0);w("moveInputWithCursor",!0,function(a,b){b||(a.display.inputDiv.style.top=a.display.inputDiv.style.left=0)});w("tabindex",null,function(a, b){a.display.input.tabIndex=b||""});w("autofocus",null);var Sd=m.modes={},jb=m.mimeModes={};m.defineMode=function(a,b){m.defaults.mode||"null"==a||(m.defaults.mode=a);if(2<arguments.length){b.dependencies=[];for(var c=2;c<arguments.length;++c)b.dependencies.push(arguments[c])}Sd[a]=b};m.defineMIME=function(a,b){jb[a]=b};m.resolveMode=function(a){if("string"==typeof a&&jb.hasOwnProperty(a))a=jb[a];else if(a&&"string"==typeof a.name&&jb.hasOwnProperty(a.name)){var b=jb[a.name];a=Pd(b,a);a.name=b.name}else if("string"== typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return m.resolveMode("application/xml");return"string"==typeof a?{name:a}:a||{name:"null"}};m.getMode=function(a,b){b=m.resolveMode(b);var c=Sd[b.name];if(!c)return m.getMode(a,"text/plain");c=c(a,b);if(kb.hasOwnProperty(b.name)){var d=kb[b.name],e;for(e in d)d.hasOwnProperty(e)&&(c.hasOwnProperty(e)&&(c["_"+e]=c[e]),c[e]=d[e])}c.name=b.name;return c};m.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}});m.defineMIME("text/plain","null"); var kb=m.modeExtensions={};m.extendMode=function(a,b){var c=kb.hasOwnProperty(a)?kb[a]:kb[a]={};Jb(b,c)};m.defineExtension=function(a,b){m.prototype[a]=b};m.defineDocExtension=function(a,b){I.prototype[a]=b};m.defineOption=w;var Wb=[];m.defineInitHook=function(a){Wb.push(a)};var ib=m.helpers={};m.registerHelper=function(a,b,c){ib.hasOwnProperty(a)||(ib[a]=m[a]={});ib[a][b]=c};m.isWordChar=cb;m.copyState=wa;m.startState=Zc;m.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode== a)break;b=c.state;a=c.mode}return c||{mode:a,state:b}};var vc=m.commands={selectAll:function(a){a.setSelection(r(a.firstLine(),0),r(a.lastLine()))},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),d=!x(b,c);d||a.getLine(b.line).length!=b.ch?a.replaceRange("",b,d?c:r(b.line),"+delete"):a.replaceRange("",b,r(b.line+1,0),"+delete")},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",r(b,0),r(b),"+delete")},delLineLeft:function(a){var b=a.getCursor();a.replaceRange("",r(b.line, 0),b,"+delete")},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.extendSelection(r(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(r(a.lastLine()))},goLineStart:function(a){a.extendSelection(Rd(a,a.getCursor().line))},goLineStartSmart:function(a){var b=a.getCursor(),c=Rd(a,b.line),d=a.getLineHandle(c.line),e=V(d);e&&0!=e[0].level?a.extendSelection(c):(d=Math.max(0,d.text.search(/\S/)),a.extendSelection(r(c.line,b.line==c.line&&b.ch<=d&&b.ch?0:d)))},goLineEnd:function(a){a.extendSelection(De(a, a.getCursor().line))},goLineRight:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:b},"div"))},goLineLeft:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:0,top:b},"div"))},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1, "char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goGroupRight:function(a){a.moveH(1,"group")},goGroupLeft:function(a){a.moveH(-1,"group")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},delWordAfter:function(a){a.deleteH(1, "word")},delGroupBefore:function(a){a.deleteH(-1,"group")},delGroupAfter:function(a){a.deleteH(1,"group")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("\t","end","+input")},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.replaceSelection("\t","end","+input")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line); 0<b.ch&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),r(b.line,b.ch-1),r(b.line,b.ch+1))},newlineAndIndent:function(a){t(a,function(){a.replaceSelection("\n","end","+input");a.indentLine(a.getCursor().line,null,!0)})()},toggleOverwrite:function(a){a.toggleOverwrite()}},Z=m.keyMap={};Z.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore", Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"};Z.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext", "Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"};Z.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter", "Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delLineLeft",fallthrough:["basic","emacsy"]};Z["default"]=va?Z.macDefault:Z.pcDefault;Z.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp", "Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};m.lookupKey=ab;m.isModifierKey=od;m.keyName=pd;m.fromTextArea=function(a,b){function c(){a.value=l.getValue()}b||(b={});b.value=a.value;!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex);!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder);if(null==b.autofocus){var d=document.body;try{d=document.activeElement}catch(e){}b.autofocus=d==a||null!= a.getAttribute("autofocus")&&d==document.body}if(a.form&&(v(a.form,"submit",c),!b.leaveSubmitMethodAlone)){var f=a.form,g=f.submit;try{var h=f.submit=function(){c();f.submit=g;f.submit();f.submit=h}}catch(k){}}a.style.display="none";var l=m(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);l.save=c;l.getTextArea=function(){return a};l.toTextArea=function(){c();a.parentNode.removeChild(l.getWrapperElement());a.style.display="";a.form&&(aa(a.form,"submit",c),"function"==typeof a.form.submit&& (a.form.submit=g))};return l};db.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a?b==a:b&&(a.test?a.test(b):a(b)))return++this.pos,b},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a= this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){a=this.string.indexOf(a,this.pos);if(-1<a)return this.pos=a,!0},backUp:function(a){this.pos-=a},column:function(){this.lastColumnPos<this.start&&(this.lastColumnValue=xa(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start);return this.lastColumnValue},indentation:function(){return xa(this.string, null,this.tabSize)},match:function(a,b,c){if("string"==typeof a){var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);if(d(e)==d(a))return!1!==b&&(this.pos+=a.length),!0}else{if((a=this.string.slice(this.pos).match(a))&&0<a.index)return null;a&&!1!==b&&(this.pos+=a[0].length);return a}},current:function(){return this.string.slice(this.start,this.pos)}};m.StringStream=db;m.TextMarker=ga;Ha(ga);ga.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm, b=a&&!a.curOp;b&&za(a);if(ba(this,"clear")){var c=this.find();c&&M(this,"clear",c.from,c.to)}for(var d=c=null,e=0;e<this.lines.length;++e){var f=this.lines[e],g=gb(f.markedSpans,this);null!=g.to&&(d=P(f));for(var h=f,k=f.markedSpans,l=g,n=void 0,m=0;m<k.length;++m)k[m]!=l&&(n||(n=[])).push(k[m]);h.markedSpans=n;null!=g.from?c=P(f):this.collapsed&&!ia(this.doc,f)&&a&&R(f,sa(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(e=0;e<this.lines.length;++e)f=$(a.doc,this.lines[e]),g=mb(a.doc, f),g>a.display.maxLineLength&&(a.display.maxLine=f,a.display.maxLineLength=g,a.display.maxLineChanged=!0);null!=c&&a&&D(a,c,d+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&yd(a));b&&Aa(a)}};ga.prototype.find=function(){for(var a,b,c=0;c<this.lines.length;++c){var d=this.lines[c],e=gb(d.markedSpans,this);if(null!=e.from||null!=e.to)d=P(d),null!=e.from&&(a=r(d,e.from)),null!=e.to&&(b=r(d,e.to))}return"bookmark"==this.type?a:a&&{from:a,to:b}}; ga.prototype.changed=function(){var a=this.find(),b=this.doc.cm;if(a&&b){"bookmark"!=this.type&&(a=a.from);var c=u(this.doc,a.line);ge(b,c);if(a.line>=b.display.showingFrom&&a.line<b.display.showingTo){for(a=b.display.lineDiv.firstChild;a;a=a.nextSibling)if(a.lineObj==c){a.offsetHeight!=c.height&&R(c,a.offsetHeight);break}qc(b,function(){b.curOp.selectionChanged=b.curOp.forceUpdate=b.curOp.updateMaxLine=!0})}}};ga.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp; b.maybeHiddenMarkers&&-1!=ca(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)};ga.prototype.detachLine=function(a){this.lines.splice(ca(this.lines,a),1);!this.lines.length&&this.doc.cm&&(a=this.doc.cm.curOp,(a.maybeHiddenMarkers||(a.maybeHiddenMarkers=[])).push(this))};m.SharedTextMarker=fb;Ha(fb);fb.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear(); M(this,"clear")}};fb.prototype.find=function(){return this.primary.find()};var Kb=m.LineWidget=function(a,b,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.cm=a;this.node=b};Ha(Kb);Kb.prototype.clear=Fd(function(){var a=this.line.widgets,b=P(this.line);if(null!=b&&a){for(var c=0;c<a.length;++c)a[c]==this&&a.splice(c--,1);a.length||(this.line.widgets=null);a=Qa(this.cm,this.line)<this.cm.doc.scrollTop;R(this.line,Math.max(0,this.line.height-tb(this)));a&&Gc(this.cm,0,-this.height); D(this.cm,b,b+1)}});Kb.prototype.changed=Fd(function(){var a=this.height;this.height=null;if(a=tb(this)-a)R(this.line,this.line.height+a),a=P(this.line),D(this.cm,a,a+1)});var Ga=m.Line=function(a,b,c){this.text=a;Ed(this,b);this.height=c?c(this):1};Ha(Ga);var Jd={},Jc=/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\uFEFF]/g;Mb.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=a,d=a+b;c<d;++c){var e=this.lines[c];this.height-=e.height;var f=e;f.parent=null;Dd(f); M(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.splice.apply(a,[a.length,0].concat(this.lines))},insertInner:function(a,b,c){this.height+=c;this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));a=0;for(c=b.length;a<c;++a)b[a].parent=this},iterN:function(a,b,c){for(b=a+b;a<b;++a)if(c(this.lines[a]))return!0}};hb.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize(); if(a<e){var f=Math.min(b,e-a),g=d.height;d.removeInner(a,f);this.height-=g-d.height;e==f&&(this.children.splice(c--,1),d.parent=null);if(0==(b-=f))break;a=0}else a-=e}25>this.size-b&&(c=[],this.collapse(c),this.children=[new Mb(c)],this.children[0].parent=this)},collapse:function(a){for(var b=0,c=this.children.length;b<c;++b)this.children[b].collapse(a)},insertInner:function(a,b,c){this.size+=b.length;this.height+=c;for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize(); if(a<=g){f.insertInner(a,b,c);if(f.lines&&50<f.lines.length){for(;50<f.lines.length;)a=f.lines.splice(f.lines.length-25,25),a=new Mb(a),f.height-=a.height,this.children.splice(d+1,0,a),a.parent=this;this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),b=new hb(b);if(a.parent){a.size-=b.size;a.height-=b.height;var c=ca(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new hb(a.children),c.parent= a,a.children=[c,b],a=c;b.parent=a.parent}while(10<a.children.length);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<g){g=Math.min(b,g-a);if(f.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=g}}};var He=0,I=m.Doc=function(a,b,c){if(!(this instanceof I))return new I(a,b,c);null==c&&(c=0);hb.call(this,[new Mb([new Ga("",null)])]);this.first=c;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.history=Nb(); this.cleanGeneration=1;this.frontier=c;c=r(c,0);this.sel={from:c,to:c,head:c,anchor:c,shift:!1,extend:!1,goalColumn:null};this.id=++He;this.modeOption=b;"string"==typeof a&&(a=ka(a));Fc(this,{from:c,to:c,text:a},null,{head:c,anchor:c})};I.prototype=Pd(hb.prototype,{constructor:I,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0,e=b.length;d<e;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a, b){this.removeInner(a-this.first,b)},getValue:function(a){var b=Kc(this,this.first,this.first+this.size);return!1===a?b:b.join(a||"\n")},setValue:function(a){var b=r(this.first,0),c=this.first+this.size-1;Ca(this,{from:b,to:r(c,u(this,c).text.length),text:ka(a),origin:"setValue"},{head:b,anchor:b},!0)},replaceRange:function(a,b,c,d){b=s(this,b);c=c?s(this,c):b;fa(this,a,b,c,d)},getRange:function(a,b,c){a=Ec(this,s(this,a),s(this,b));return!1===c?a:a.join(c||"\n")},getLine:function(a){return(a=this.getLineHandle(a))&& a.text},setLine:function(a,b){Fa(this,a)&&fa(this,b,r(a,0),s(this,r(a)))},removeLine:function(a){a?fa(this,"",s(this,r(a-1)),s(this,r(a))):fa(this,"",r(0,0),s(this,r(1,0)))},getLineHandle:function(a){if(Fa(this,a))return u(this,a)},getLineNumber:function(a){return P(a)},getLineHandleVisualStart:function(a){"number"==typeof a&&(a=u(this,a));return $(this,a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return s(this, a)},getCursor:function(a){var b=this.sel;return ma(null==a||"head"==a?b.head:"anchor"==a?b.anchor:"end"==a||!1===a?b.to:b.from)},somethingSelected:function(){return!x(this.sel.head,this.sel.anchor)},setCursor:Ta(function(a,b,c){a=s(this,"number"==typeof a?r(a,b||0):a);c?F(this,a):ea(this,a,a)}),setSelection:Ta(function(a,b,c){ea(this,s(this,a),s(this,b||a),c)}),extendSelection:Ta(function(a,b,c){F(this,s(this,a),b&&s(this,b),c)}),getSelection:function(a){return this.getRange(this.sel.from,this.sel.to, a)},replaceSelection:function(a,b,c){Ca(this,{from:this.sel.from,to:this.sel.to,text:ka(a),origin:c},b||"around")},undo:Ta(function(){vd(this,"undo")}),redo:Ta(function(){vd(this,"redo")}),setExtending:function(a){this.sel.extend=a},historySize:function(){var a=this.history;return{undo:a.done.length,redo:a.undone.length}},clearHistory:function(){this.history=Nb(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration()},changeGeneration:function(){this.history.lastOp= this.history.lastOrigin=null;return this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:Ob(this.history.done),undone:Ob(this.history.undone)}},setHistory:function(a){var b=this.history=Nb(this.history.maxGeneration);b.done=a.done.slice(0);b.undone=a.undone.slice(0)},markText:function(a,b,c){return eb(this,s(this,a),s(this,b),c,"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget: b),insertLeft:b&&b.insertLeft};a=s(this,a);return eb(this,a,a,c,"bookmark")},findMarksAt:function(a){a=s(this,a);var b=[],c=u(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},getAllMarks:function(){var a=[];this.iter(function(b){if(b=b.markedSpans)for(var c=0;c<b.length;++c)null!=b[c].from&&a.push(b[c].marker)});return a},posFromIndex:function(a){var b,c=this.first;this.iter(function(d){d= d.text.length+1;if(d>a)return b=a,!0;a-=d;++c});return s(this,r(c,b))},indexFromPos:function(a){a=s(this,a);var b=a.ch;if(a.line<this.first||0>a.ch)return 0;this.iter(this.first,a.line,function(a){b+=a.text.length+1});return b},copy:function(a){var b=new I(Kc(this,this.first,this.first+this.size),this.modeOption,this.first);b.scrollTop=this.scrollTop;b.scrollLeft=this.scrollLeft;b.sel={from:this.sel.from,to:this.sel.to,head:this.sel.head,anchor:this.sel.anchor,shift:this.sel.shift,extend:!1,goalColumn:this.sel.goalColumn}; a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory()));return b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from);null!=a.to&&a.to<c&&(c=a.to);b=new I(Kc(this,b,c),a.mode||this.modeOption,b);a.sharedHist&&(b.history=this.history);(this.linked||(this.linked=[])).push({doc:b,sharedHist:a.sharedHist});b.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}];return b},unlinkDoc:function(a){a instanceof m&&(a=a.doc);if(this.linked)for(var b= 0;b<this.linked.length;++b)if(this.linked[b].doc==a){this.linked.splice(b,1);a.unlinkDoc(this);break}if(a.history==this.history){var c=[a.id];Ea(a,function(a){c.push(a.id)},!0);a.history=Nb();a.history.done=Ob(this.history.done,c);a.history.undone=Ob(this.history.undone,c)}},iterLinkedDocs:function(a){Ea(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});I.prototype.eachLine=I.prototype.iter;var Ie=["iter","insert","remove","copy","getEditor"],lb;for(lb in I.prototype)I.prototype.hasOwnProperty(lb)&& 0>ca(Ie,lb)&&(m.prototype[lb]=function(a){return function(){return a.apply(this.doc,arguments)}}(I.prototype[lb]));Ha(I);m.e_stop=Ya;m.e_preventDefault=A;m.e_stopPropagation=Od;var da,xb=0;m.on=v;m.off=aa;m.signal=J;var qa=30,kd=m.Pass={toString:function(){return"CodeMirror.Pass"}};Ub.prototype={set:function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)}};m.countColumn=xa;var Qb=[""],Ce=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,pc=/[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/; m.replaceGetRect=function(a){y=a};var qe=function(){if(Q)return!1;var a=p("div");return"draggable"in a||"dragDrop"in a}();Da?Lb=function(a,b){return 36==a.charCodeAt(b-1)&&39==a.charCodeAt(b)}:uc&&!/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)?Lb=function(a,b){return/\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(a.slice(b-1,b+1))}:K&&!/Chrome\/(?:29|[3-9]\d|\d\d\d)\./.test(navigator.userAgent)&&(Lb=function(a,b){if(1<b&&45==a.charCodeAt(b-1)){if(/\w/.test(a.charAt(b-2))&&/[^\-?\.]/.test(a.charAt(b)))return!0; if(2<b&&/[\d\.,]/.test(a.charAt(b-2))&&/[\d\.,]/.test(a.charAt(b)))return!1}return/[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|\u2026[\w~`@#$%\^&*(_=+{[><]/.test(a.slice(b-1,b+1))});var Wa,Lc,ka=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)}; m.splitLines=ka;var le=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},cd=function(){var a=p("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(),na={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc", 32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};m.keyNames=na;(function(){for(var a=0;10>a;a++)na[a+48]=String(a);for(a=65;90>= a;a++)na[a]=String.fromCharCode(a);for(a=1;12>=a;a++)na[a+111]=na[a+63235]="F"+a})();var ya,ze=function(){function a(a){return 255>=a?b.charAt(a):1424<=a&&1524>=a?"R":1536<=a&&1791>=a?c.charAt(a-1536):1792<=a&&2220>=a?"r":"L"}var b="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",c="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr", d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,f=/[LRr]/,g=/[Lb1n]/,h=/[1n]/;return function(b){if(!d.test(b))return!1;for(var c=b.length,n=[],m=0,q;m<c;++m)n.push(a(b.charCodeAt(m)));for(var m=0,p="L";m<c;++m)q=n[m],"m"==q?n[m]=p:p=q;m=0;for(p="L";m<c;++m)q=n[m],"1"==q&&"r"==p?n[m]="n":f.test(q)&&(p=q,"r"==q&&(n[m]="R"));m=1;for(p=n[0];m<c-1;++m)q=n[m],"+"==q&&"1"==p&&"1"==n[m+1]?n[m]="1":","!=q||p!=n[m+1]||"1"!=p&&"n"!=p||(n[m]=p),p=q;for(m=0;m<c;++m)if(q=n[m],","==q)n[m]="N";else if("%"== q){for(p=m+1;p<c&&"%"==n[p];++p);var r=m&&"!"==n[m-1]||p<c-1&&"1"==n[p]?"1":"N";for(q=m;q<p;++q)n[q]=r;m=p-1}m=0;for(p="L";m<c;++m)q=n[m],"L"==p&&"1"==q?n[m]="L":f.test(q)&&(p=q);for(m=0;m<c;++m)if(e.test(n[m])){for(p=m+1;p<c&&e.test(n[p]);++p);q="L"==(p<c-1?n[p]:"L");r="L"==(m?n[m-1]:"L")||q?"L":"R";for(q=m;q<p;++q)n[q]=r;m=p-1}for(var p=[],s,m=0;m<c;)if(g.test(n[m])){q=m;for(++m;m<c&&g.test(n[m]);++m);p.push({from:q,to:m,level:0})}else{var t=m,r=p.length;for(++m;m<c&&"L"!=n[m];++m);for(q=t;q<m;)if(h.test(n[q])){t< q&&p.splice(r,0,{from:t,to:q,level:1});t=q;for(++q;q<m&&h.test(n[q]);++q);p.splice(r,0,{from:t,to:q,level:2});t=q}else++q;t<m&&p.splice(r,0,{from:t,to:m,level:1})}1==p[0].level&&(s=b.match(/^\s+/))&&(p[0].from=s[0].length,p.unshift({from:0,to:s[0].length,level:0}));1==L(p).level&&(s=b.match(/\s+$/))&&(L(p).to-=s[0].length,p.push({from:c-s[0].length,to:c,level:0}));p[0].level!=L(p).level&&p.push({from:c,to:c,level:p[0].level});return p}}();m.version="3.16.0";return m}();
media/js/properties.js ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CodeMirror.defineMode("properties", function() {
2
+ return {
3
+ token: function(stream, state) {
4
+ var sol = stream.sol() || state.afterSection;
5
+ var eol = stream.eol();
6
+
7
+ state.afterSection = false;
8
+
9
+ if (sol) {
10
+ if (state.nextMultiline) {
11
+ state.inMultiline = true;
12
+ state.nextMultiline = false;
13
+ } else {
14
+ state.position = "def";
15
+ }
16
+ }
17
+
18
+ if (eol && !state.nextMultiline) {
19
+ state.inMultiline = false;
20
+ state.position = "def";
21
+ }
22
+
23
+ if (sol) {
24
+ while (stream.eatSpace())
25
+ ;
26
+ }
27
+
28
+ var ch = stream.next();
29
+
30
+ if (sol && (ch === "#" || ch === "!" || ch === ";")) {
31
+ state.position = "comment";
32
+ stream.skipToEnd();
33
+ return "comment";
34
+ } else if (sol && ch === "[") {
35
+ state.afterSection = true;
36
+ stream.skipTo("]");
37
+ stream.eat("]");
38
+ return "header";
39
+ } else if (ch === "=" || ch === ":") {
40
+ state.position = "quote";
41
+ return null;
42
+ } else if (ch === "\\" && state.position === "quote") {
43
+ if (stream.next() !== "u") { // u = Unicode sequence \u1234
44
+ // Multiline value
45
+ state.nextMultiline = true;
46
+ }
47
+ }
48
+
49
+ return state.position;
50
+ },
51
+ startState: function() {
52
+ return {
53
+ position: "def", // Current position, "def", "quote" or "comment"
54
+ nextMultiline: false, // Is the next line multiline value
55
+ inMultiline: false, // Is the current line a multiline value
56
+ afterSection: false // Did we just open a section
57
+ };
58
+ }
59
+
60
+ };
61
+ });
62
+
63
+ CodeMirror.defineMIME("text/x-properties", "properties");
64
+ CodeMirror.defineMIME("text/x-ini", "properties");
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: vasyltech
3
  Tags: security, login, access manager, access, access control, capability, role, user, post filter, category
4
  Requires at least: 3.4.2
5
  Tested up to: 4.3.1
6
- Stable tag: 2.9.2
7
 
8
  The powerful and easy-to-use tool to improve security and define access to your
9
  posts, pages and backend areas for single blog or multisite network.
@@ -93,6 +93,9 @@ the list of additional metaboxes can be picked by AAM.
93
 
94
  == Changelog ==
95
 
 
 
 
96
  = 2.9.2 =
97
  * Small fix in core
98
  * Moved ConfigPress as stand-alone plugin. It is no longer a part of AAM
3
  Tags: security, login, access manager, access, access control, capability, role, user, post filter, category
4
  Requires at least: 3.4.2
5
  Tested up to: 4.3.1
6
+ Stable tag: 2.9.3
7
 
8
  The powerful and easy-to-use tool to improve security and define access to your
9
  posts, pages and backend areas for single blog or multisite network.
93
 
94
  == Changelog ==
95
 
96
+ = 2.9.3 =
97
+ * Introduced AAM version 3 alpha
98
+
99
  = 2.9.2 =
100
  * Small fix in core
101
  * Moved ConfigPress as stand-alone plugin. It is no longer a part of AAM